gjy 3 years ago
parent
commit
7205da8937

+ 26 - 19
src/views/contractManagement/futuresPurchaseContract.vue

@@ -127,7 +127,9 @@
 		</el-pagination>
 		<WinseaContentModal v-model="accessoryTFs" :title="$t('system.noticeCircular.information')"
 			@on-cancel="handleClose">
-			<ws-upload ref="upload" :comp-id="compId" :appendix-ids="appendixIdss" :editable="false"
+			<ws-upload ref="upload" :comp-id="compId" :appendix-ids="appendixIdss"
+			:size-limit="size"
+        @onChange="onChange"
 				accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar" />
 
 		</WinseaContentModal>
@@ -140,6 +142,7 @@
 		editstatus,
 		billoperatehis,
 		deletecontract,
+		editInfo
 	} from '@/model/contarct/index'
 	import {
 		downloadFile
@@ -166,13 +169,7 @@
 		},
 		data() {
 			return {
-				//弹出框
-				dialogViewSpareMoney: false,
-				dialogApproveFormVisible: false,
-				// 船舶类型
-				monetaryKey: null,
-				// 表格显示数据
-				tableDate: [],
+				id:'',
 				size: 10,
 				// 是否显示
 				showType: true,
@@ -206,11 +203,6 @@
 				appendixIdss: [],
 				fileList: [],
 				compId: sessionStorage.getItem('ws-pf_compId'),
-				pickerBeginDateBefore: {
-					disabledDate: (time) => {
-						return time.getTime() > Date.now()
-					},
-				},
 				accessoryTFs: false,
 				taskTypeList: [{
 						value: '未完成',
@@ -280,6 +272,26 @@
 			this.showType = this.isShow
 		},
 		methods: {
+			onChange () {
+			this.$refs.upload
+				.handleSaveBill()
+				.then(async response => {
+				this.deptBudgetList.addressUrl = response
+				this.deptBudgetList.id=this.id
+				this.deptBudgetList.flag=1
+				 editInfo(this.deptBudgetList)
+				.toPromise()
+				.then((response) => {
+				this.accessoryTFs = false
+					this.$message.success('上传成功')
+					this.getList()
+				})
+				})
+				.catch(res => {
+				EventBus.$emit('error', (JSON.parse(res) || {}).message)
+				this.$refs.upload.clearFiles()
+				})
+			},
 			dateFormat(fmt, date) {
 				let ret
 				const opt = {
@@ -407,12 +419,7 @@
 				}
 			},
 			fujian(row) {
-				if (row.addressUrl === null || row.addressUrl === '') {
-					EventBus.$emit(
-						'warning',
-						this.$t('system.noticeCircular.NoInformation')
-					)
-				}
+				this.id=row.id
 				this.appendixIdss = row.addressUrl
 				console.log(this.appendixIdss)
 				this.accessoryTFs = true

+ 1 - 2
src/views/contractManagement/futuresPurchaseContractEdit.vue

@@ -580,10 +580,9 @@
       />
       <ws-upload
         ref="upload"
+        :editable="false"
         :comp-id="compId"
         :appendix-ids="deptBudgetList.addressUrl"
-        :size-limit="size"
-        @onChange="onChange"
         accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
       />
     </ws-form>

+ 27 - 9
src/views/contractManagement/futuresSalesContract.vue

@@ -128,7 +128,9 @@
 		</el-pagination>
 		<WinseaContentModal v-model="accessoryTFs" :title="$t('system.noticeCircular.information')"
 			@on-cancel="handleClose">
-			<ws-upload ref="upload" :comp-id="compId" :appendix-ids="appendixIdss" :editable="false"
+			<ws-upload ref="upload" :comp-id="compId" :appendix-ids="appendixIdss" 
+			:size-limit="size"
+        	@onChange="onChange"
 				accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar" />
 		</WinseaContentModal>
 	</div>
@@ -140,6 +142,7 @@
 		editstatus,
 		billoperatehis,
 		deletecontract,
+		editInfo
 	} from '@/model/contarct/index'
 	import {
 		downloadFile
@@ -174,6 +177,7 @@
 				// 表格显示数据
 				tableDate: [],
 				size: 10,
+				id:'',
 				// 是否显示
 				showType: true,
 				// 年
@@ -280,6 +284,26 @@
 			this.showType = this.isShow
 		},
 		methods: {
+		onChange () {
+			this.$refs.upload
+				.handleSaveBill()
+				.then(async response => {
+				this.deptBudgetList.addressUrl = response
+				this.deptBudgetList.id=this.id
+				this.deptBudgetList.flag=1
+				 editInfo(this.deptBudgetList)
+				.toPromise()
+				.then((response) => {
+					this.accessoryTFs = false
+					this.$message.success('上传成功')
+					this.getList()
+				})
+				})
+				.catch(res => {
+				EventBus.$emit('error', (JSON.parse(res) || {}).message)
+				this.$refs.upload.clearFiles()
+				})
+			},
 			dateFormat(fmt, date) {
 				let ret
 				const opt = {
@@ -408,14 +432,8 @@
 				}
 			},
 			fujian(row) {
-				if (row.addressUrl === null || row.addressUrl === '') {
-					EventBus.$emit(
-						'warning',
-						this.$t('system.noticeCircular.NoInformation')
-					)
-				} else {
-					this.accessoryTFs = true
-				}
+				this.id=row.id
+				this.accessoryTFs = true
 				this.appendixIdss = row.addressUrl
 			},
 			handleExamine(row) {

+ 26 - 9
src/views/contractManagement/purchaseContract.vue

@@ -201,7 +201,8 @@
 
 		<WinseaContentModal v-model="accessoryTFs" :title="$t('system.noticeCircular.information')"
 			@on-cancel="handleClose">
-			<ws-upload ref="upload" :comp-id="compId" :appendix-ids="appendixIdss" :editable="false"
+			<ws-upload ref="upload" :size-limit="size"
+          @onChange="onChange" :comp-id="compId" :appendix-ids="appendixIdss"
 				accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar" />
 		</WinseaContentModal>
 	</div>
@@ -213,6 +214,7 @@
 		editstatus,
 		billoperatehis,
 		deletecontract,
+		editInfo
 	} from '@/model/contarct/index'
 	import {
 		downloadFile
@@ -239,6 +241,7 @@
 		},
 		data() {
 			return {
+				id:'',
 				//弹出框
 				dialogViewSpareMoney: false,
 				dialogApproveFormVisible: false,
@@ -352,6 +355,26 @@
 			this.showType = this.isShow
 		},
 		methods: {
+			onChange () {
+			this.$refs.upload
+				.handleSaveBill()
+				.then(async response => {
+				this.deptBudgetList.addressUrl = response
+				this.deptBudgetList.id=this.id
+				this.deptBudgetList.flag=1
+				 editInfo(this.deptBudgetList)
+				.toPromise()
+				.then((response) => {
+					this.accessoryTFs = false
+					this.$message.success('上传成功')
+					this.getList()
+				})
+				})
+				.catch(res => {
+				EventBus.$emit('error', (JSON.parse(res) || {}).message)
+				this.$refs.upload.clearFiles()
+				})
+			},
 			dateFormat(fmt, date) {
 				let ret
 				const opt = {
@@ -478,14 +501,8 @@
 				}
 			},
 			fujian(row) {
-				if (row.addressUrl === null || row.addressUrl === '') {
-					EventBus.$emit(
-						'warning',
-						this.$t('system.noticeCircular.NoInformation')
-					)
-				} else {
-					this.accessoryTFs = true
-				}
+				this.id=row.id
+				this.accessoryTFs = true
 				this.appendixIdss = row.addressUrl
 				console.log(this.appendixIdss)
 			},

+ 2 - 15
src/views/contractManagement/purchaseContractEdit.vue

@@ -269,13 +269,12 @@
         </div>
         <ws-input v-model="deptBudgetList.remarks" type="textarea" row="3" placeholder="请输入备注信息,不超过200字"
           maxlength="200" />
-        <ws-upload ref="upload" :comp-id="compId" :appendix-ids="deptBudgetList.addressUrl" :size-limit="size"
-          @onChange="onChange" accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
+        <ws-upload ref="upload" :comp-id="compId" :appendix-ids="deptBudgetList.addressUrl" accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
           v-hasPermission="`contractManagement.buyContract.buyContractInfo.appl`" />
       </base-card>
     </ws-form>
     <div v-if="dialogVisible" class="map">
-      <map-drag @marker="marker" :isShowaddress='true' v-on:addressListen='getAddress' :type="type"></map-drag>
+      <map-drag @marker="marker"  :editable="false" :isShowaddress='true' v-on:addressListen='getAddress' :type="type"></map-drag>
     </div>
     <div style="text-align: right; padding: 10px">
       <el-button class="bg-bottom" type="primary" size="small" @click="submit()">提交</el-button>
@@ -544,18 +543,6 @@
           constKey: '',
         })
       },
-      // 上传附件
-      onChange() {
-        this.$refs.upload
-          .handleSaveBill()
-          .then(async response => {
-            this.deptBudgetList.addressUrl = response
-          })
-          .catch(res => {
-            EventBus.$emit('error', (JSON.parse(res) || {}).message)
-            this.$refs.upload.clearFiles()
-          })
-      },
       getUnitList() {
         xiala({
             compId: sessionStorage.getItem('ws-pf_compId'),

+ 26 - 9
src/views/contractManagement/salesContract.vue

@@ -228,7 +228,8 @@
 		</el-pagination>
 		<WinseaContentModal v-model="accessoryTFs" :title="$t('system.noticeCircular.information')"
 			@on-cancel="handleClose">
-			<ws-upload ref="upload" :comp-id="compId" :appendix-ids="appendixIdss" :editable="false"
+				<ws-upload ref="upload" :size-limit="size"
+          @onChange="onChange" :comp-id="compId" :appendix-ids="appendixIdss"
 				accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar" />
 		</WinseaContentModal>
 	</div>
@@ -240,6 +241,7 @@
 		editstatus,
 		billoperatehis,
 		deletecontract,
+		editInfo
 	} from '@/model/contarct/index'
 	import {
 		downloadFile
@@ -267,6 +269,7 @@
 		},
 		data() {
 			return {
+				id:'',
 				//弹出框
 				dialogViewSpareMoney: false,
 				dialogApproveFormVisible: false,
@@ -388,6 +391,26 @@
 			this.showType = this.isShow
 		},
 		methods: {
+			onChange () {
+			this.$refs.upload
+				.handleSaveBill()
+				.then(async response => {
+				this.deptBudgetList.addressUrl = response
+				this.deptBudgetList.id=this.id
+				this.deptBudgetList.flag=1
+				 editInfo(this.deptBudgetList)
+				.toPromise()
+				.then((response) => {
+					this.accessoryTFs = false
+					this.$message.success('上传成功')
+					this.getList()
+				})
+				})
+				.catch(res => {
+				EventBus.$emit('error', (JSON.parse(res) || {}).message)
+				this.$refs.upload.clearFiles()
+				})
+			},
 			dateFormat(fmt, date) {
 				let ret
 				const opt = {
@@ -530,14 +553,8 @@
 			},
 			// receiveAttachmentPath
 			fujian(row) {
-				if (row.addressUrl === null || row.addressUrl === '') {
-					EventBus.$emit(
-						'warning',
-						this.$t('system.noticeCircular.NoInformation')
-					)
-				} else {
-					this.accessoryTFs = true
-				}
+				this.id=row.id
+				this.accessoryTFs = true
 				this.appendixIdss = row.addressUrl
 				console.log(this.appendixIdss)
 			},

+ 1 - 2
src/views/contractManagement/salesContractEdit.vue

@@ -339,8 +339,7 @@
         <!--备注信息-->
         <ws-input v-model="deptBudgetList.remarks" type="textarea" row="3" placeholder="请输入备注信息,不超过200字"
           maxlength="200" />
-        <ws-upload ref="upload" :comp-id="compId" :appendix-ids="deptBudgetList.addressUrl" :size-limit="size"
-          @onChange="onChange" accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar" v-hasPermission="
+        <ws-upload ref="upload" :comp-id="compId" :appendix-ids="deptBudgetList.addressUrl" :editable="false" accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar" v-hasPermission="
             `contractManagement.salesContract.salesContractInfo.appl`"/>
       </ws-form>
     </div>