Explorar o código

附件存放阿里云位置调整

sangwenwei hai 6 meses
pai
achega
82fce4fe90

+ 1 - 0
src/api/sys/OSSService.js

@@ -166,6 +166,7 @@ export function exnameFix (file, isShow, names) {
 }
 
 export async function httpRequest (file, name, type, maxValue) { // 阿里云OSS上传
+	console.log('type',type)
   if (!beforeAvatarUpload(file.file, [], maxValue)) {
     return
   }

+ 1 - 0
src/views/common/InscriptionUpLoadComponent.vue

@@ -236,6 +236,7 @@
 				}
 			},
 			async httpRequest (file) {
+				console.log( this.directory)
 				await httpRequest(file, fileName(file), this.directory, this.maxValue)
 			},
 			async beforeUpload(file) {

+ 1 - 0
src/views/common/UpLoadComponent.vue

@@ -185,6 +185,7 @@
 				} else {
 					this.directory = 'public'
 				}
+				console.log( this.directory)
 				if (maxValue !== undefined && maxValue !== null && maxValue !== '' && maxValue !== 0) {
 					this.maxValue = maxValue
 				} else {

+ 4 - 6
src/views/jy/borrowMoney/BorrowForm.vue

@@ -126,10 +126,8 @@
 		watch: {
 			'keyWatch': {
 				handler (newVal) {
-					if (this.bus) {
-						if (this.bus !== 'false') {
-							this.init('', this.bus)
-						}
+					if (this.commonJS.isNotEmpty(this.bus)) {
+						this.init('', this.bus)
 					} else {
 						this.$nextTick(() => {
 							this.$refs.inputForm.resetFields()
@@ -167,7 +165,7 @@
 				this.$nextTick(() => {
 					this.$refs.inputForm.resetFields()
 					this.loading = true
-					if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+					// if (this.commonJS.isNotEmpty(this.inputForm.id)) {
 						this.borrowService.queryById(this.inputForm.id).then((data)=>{
 							this.$refs.uploadComponent.clearUpload()
 							this.inputForm = this.recover(this.inputForm, data)
@@ -190,7 +188,7 @@
 						console.log('this.inputForm', this.inputForm)
 
 						this.loading = false
-					}
+					// }
 				})
 			},
 			saveForm(callback) {

+ 4 - 6
src/views/jy/driveMaintain/DriveMaintainAddForm.vue

@@ -129,10 +129,8 @@
 		watch: {
 			'keyWatch': {
 				handler (newVal) {
-					if (this.bus) {
-						if (this.bus !== 'false') {
-							this.init('', this.bus)
-						}
+					if (this.commonJS.isNotEmpty(this.bus)) {
+						this.init('', this.bus)
 					} else {
 						this.$nextTick(() => {
 							this.$refs.inputForm.resetFields()
@@ -170,7 +168,7 @@
 					this.$refs.inputForm.resetFields()
 					this.loading = true
 					this.$refs.uploadComponent.clearUpload()
-					if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+					// if (this.commonJS.isNotEmpty(this.inputForm.id)) {
 						console.log('this.inputForm.id', this.inputForm.id)
 						this.driveMaintainService.queryById(this.inputForm.id).then((data)=>{
 							this.inputForm = this.recover(this.inputForm, data)
@@ -184,7 +182,7 @@
 							this.loading = false
 						})
 
-					}
+					// }
 				})
 			},
 			saveForm(callback) {

+ 9 - 6
src/views/jy/evection/EvectionForm.vue

@@ -176,6 +176,11 @@
 			this.commonApi = new CommonApi()
 		},
 		mounted () {
+			// 在这里你可以直接执行上传方法
+			this.$nextTick(() => {
+				this.$refs.uploadComponent.newUpload(this.method, this.inputForm.files, 'evection',null,null,null,null,null)
+
+			});
 		},
 		activated () {
 		},
@@ -200,10 +205,8 @@
 		watch: {
 			'keyWatch': {
 				handler (newVal) {
-					if (this.bus) {
-						if (this.bus !== 'false') {
-							this.init('', this.bus)
-						}
+					if (this.commonJS.isNotEmpty(this.bus)) {
+						this.init('', this.bus)
 					} else {
 						this.$nextTick(() => {
 							this.$refs.inputForm.resetFields()
@@ -241,7 +244,7 @@
 					this.$refs.inputForm.resetFields()
 					this.loading = true
 					this.$refs.uploadComponent.clearUpload()
-					if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+					// if (this.commonJS.isNotEmpty(this.inputForm.id)) {
 						console.log('this.inputForm.id', this.inputForm.id)
 						this.evectionService.queryById(this.inputForm.id).then((data)=>{
 							this.inputForm = this.recover(this.inputForm, data)
@@ -258,7 +261,7 @@
 							this.loading = false
 						})
 
-					}
+					// }
 				})
 			},
 			saveForm(callback) {

+ 4 - 6
src/views/jy/goOut/GoOutForm.vue

@@ -200,10 +200,8 @@
 		watch: {
 			'keyWatch': {
 				handler (newVal) {
-					if (this.bus) {
-						if (this.bus !== 'false') {
-							this.init('', this.bus)
-						}
+					if (this.commonJS.isNotEmpty(this.bus)) {
+						this.init('', this.bus)
 					} else {
 						this.$nextTick(() => {
 							this.$refs.inputForm.resetFields()
@@ -241,7 +239,7 @@
 					this.$refs.inputForm.resetFields()
 					this.loading = true
 					this.$refs.uploadComponent.clearUpload()
-					if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+					// if (this.commonJS.isNotEmpty(this.inputForm.id)) {
 						console.log('this.inputForm.id', this.inputForm.id)
 						this.goOutService.queryById(this.inputForm.id).then((data)=>{
 							this.inputForm = this.recover(this.inputForm, data)
@@ -258,7 +256,7 @@
 							this.loading = false
 						})
 
-					}
+					// }
 				})
 			},
 			saveForm(callback) {

+ 4 - 6
src/views/jy/holiday/HolidayForm.vue

@@ -172,10 +172,8 @@
 		watch: {
 			'keyWatch': {
 				handler (newVal) {
-					if (this.bus) {
-						if (this.bus !== 'false') {
-							this.init('', this.bus)
-						}
+					if (this.commonJS.isNotEmpty(this.bus)) {
+						this.init('', this.bus)
 					} else {
 						this.$nextTick(() => {
 							this.$refs.inputForm.resetFields()
@@ -216,7 +214,7 @@
 					this.$refs.inputForm.resetFields()
 					this.loading = true
 					this.$refs.uploadComponent.clearUpload()
-					if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+					// if (this.commonJS.isNotEmpty(this.inputForm.id)) {
 						console.log('this.inputForm.id', this.inputForm.id)
 						this.holidayService.queryById(this.inputForm.id).then((data)=>{
 							this.inputForm = this.recover(this.inputForm, data)
@@ -237,7 +235,7 @@
 							this.loading = false
 						})
 
-					}
+					// }
 				})
 			},
 			saveForm(callback) {

+ 3 - 5
src/views/jy/inscription/InscriptionForm.vue

@@ -204,10 +204,8 @@
 		watch: {
 			'keyWatch': {
 				handler (newVal) {
-					if (this.bus) {
-						if (this.bus !== 'false') {
-							this.init('', this.bus)
-						}
+					if (this.commonJS.isNotEmpty(this.bus)) {
+						this.init('', this.bus)
 					} else {
 						this.$nextTick(() => {
 							this.$refs.inputForm.resetFields()
@@ -256,6 +254,7 @@
 
 						this.inscriptionService.queryById(this.inputForm.id).then((data)=>{
 							console.log('data',data)
+							this.inputForm = this.recover(this.inputForm, data)
 							if (this.commonJS.isEmpty(this.inputForm.createName)){
 								this.inputForm.createName=this.$store.state.user.name
 							}
@@ -265,7 +264,6 @@
 								this.inputForm.createTime=this.moment(new Date()).format('YYYY-MM-DD')
 							}
 
-							this.inputForm = this.recover(this.inputForm, data)
 							// this.inputForm.files=data.files
 
 							console.log('s',this.inputForm)

+ 5 - 7
src/views/jy/payment/PaymentForm.vue

@@ -321,10 +321,8 @@
 		watch: {
 			'keyWatch': {
 				handler (newVal) {
-					if (this.bus) {
-						if (this.bus !== 'false') {
-							this.init('', this.bus)
-						}
+					if (this.commonJS.isNotEmpty(this.bus)) {
+						this.init('', this.bus)
 					} else {
 						this.$nextTick(() => {
 							this.$refs.inputForm.resetFields()
@@ -372,7 +370,7 @@
 				this.$nextTick(() => {
 					this.$refs.inputForm.resetFields()
 					this.loading = true
-					if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+					// if (this.commonJS.isNotEmpty(this.inputForm.id)) {
 						console.log('this.inputForm.id', this.inputForm.id)
 						this.paymentService.queryById(this.inputForm.id).then((data)=>{
 							this.$refs.uploadComponent.clearUpload()
@@ -407,10 +405,10 @@
 								method = 'view'
 							}
 							this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'paymentMoney')
+							this.loading = false
 
 						})
-						this.loading = false
-					}
+					// }
 				})
 			},
 			saveForm(callback) {

+ 5 - 3
src/views/jy/project/FileForm.vue

@@ -47,6 +47,7 @@
         rogress: 0, // 动态显示进度条
         progressFlag: false, // 关闭进度条
 		  fileType:'', //文件类型及大小
+		  attachmentFlag:'', //文件存储位置
       }
     },
     components: {
@@ -65,9 +66,10 @@
         this.url = ''
         this.showViewer = false
       },
-      async init (method, id,projectId,fileType) {
+      async init (method, id,projectId,fileType,attachmentFlag) {
       	this.attachmentId = id
       	this.moduleType = projectId
+		  this.attachmentFlag = attachmentFlag
         this.dataList = []
         this.dataListNew = []
         await this.ossService.getFileListByAttachmentIdAndModuleType(id,projectId).then((data) => {
@@ -91,7 +93,7 @@
 		  this.$nextTick(() => {
           // this.$refs.upload.clearFiles()
           this.$refs.inputForm.resetFields()
-            this.$refs.uploadComponent.newUpload(method, this.dataList, 'workClient', 300,'附件',false,false,true,fileType)
+            this.$refs.uploadComponent.newUpload(method, this.dataList, attachmentFlag, 300,'附件',false,false,true,fileType)
           this.loading = false
         })
       },
@@ -110,7 +112,7 @@
               if (item.id === null || item.id === undefined || item.id === '') {
                 item.url = item.raw.url
               }
-              item.attachmentFlag = 'workClient'
+              item.attachmentFlag = this.attachmentFlag
               item.fileSize = item.size
               item.attachmentName = item.name
               item.createBy = null

+ 1 - 1
src/views/jy/project/OutInstanceForm.vue

@@ -410,7 +410,7 @@
 
 			//测试按钮
 			openFileForm(row){
-				this.$refs.fileForm.init("add", row.id,this.inputForm.projectId,row.type)
+				this.$refs.fileForm.init("add", row.id,this.inputForm.projectId,row.type,"outInstance")
 			},
 			showFile (row) {
 				console.log("showFile",row)

+ 1 - 1
src/views/jy/project/ProjectArchiveForm.vue

@@ -659,7 +659,7 @@
 			},
 			//测试按钮
 			openFileForm(row){
-				this.$refs.fileForm.init("add", row.id,this.inputForm.projectId,row.type)
+				this.$refs.fileForm.init("add", row.id,this.inputForm.projectId,row.type,"projectArchive")
 			},
 			showFile (row) {
 				console.log("showFile",row)

+ 1 - 1
src/views/jy/project/ProjectEiaForm.vue

@@ -607,7 +607,7 @@
 			},
 			//测试按钮
 			openFileForm(row){
-				this.$refs.fileForm.init("add", row.id,this.inputForm.projectId,row.type)
+				this.$refs.fileForm.init("add", row.id,this.inputForm.projectId,row.type,'projectEia')
 			},
 			showFile (row) {
 				console.log("showFile",row)

+ 7 - 6
src/views/jy/project/ProjectForm.vue

@@ -401,10 +401,8 @@
 		watch: {
 			'keyWatch': {
 				handler (newVal) {
-					if (this.bus) {
-						if (this.bus !== 'false') {
-							this.init('', this.bus)
-						}
+					if (this.commonJS.isNotEmpty(this.bus)) {
+						this.init('', this.bus)
 					} else {
 						this.$nextTick(() => {
 							this.$refs.inputForm.resetFields()
@@ -480,7 +478,7 @@
 					this.loading = true
 					this.$refs.uploadComponent.clearUpload()
 					// this.$refs.archiveFile.clearUpload()
-					if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+					// if (this.commonJS.isNotEmpty(this.inputForm.id)) {
 						this.projectInfoService.findById(this.inputForm.id).then((data) => {
 							console.log(data)
 							this.inputForm = this.recover(this.inputForm, data)
@@ -514,6 +512,9 @@
 							if (this.commonJS.isEmpty(this.inputForm.createDate)) {
 								this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
 							}
+							if (this.commonJS.isEmpty(this.inputForm.createByName)) {
+								this.inputForm.createByName = this.$store.state.user.name
+							}
 							if (this.formReadOnly) {
 								method = 'view'
 							}
@@ -525,7 +526,7 @@
 							// this.$refs.archiveFile.newUpload('view', [], 'cwWorkContract', null, null, null, null, false)
 							this.loading = false
 						})
-					}
+					// }
 				})
 			},
 			openContractForm () {

+ 14 - 2
src/views/jy/project/ProjectList.vue

@@ -1395,6 +1395,12 @@ export default {
 		},
 		//发起报批签发
 		reportsDoSubmit(row){
+			var busId;
+			if (this.commonJS.isNotEmpty(row.reportsSubmitId)){
+				busId = row.reportsSubmitId
+			}else {
+				busId = 'false'
+			}
 			// 读取流程表单
 			let tabTitle = `发起流程【嘉溢-报批签发】`
 			let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [嘉溢-报批签发]`
@@ -1411,7 +1417,7 @@ export default {
 						formType: data.formType,
 						formUrl: data.formUrl,
 						formTitle: processTitle,
-						businessId: row.reportsSubmitId,
+						businessId: busId,
 						isShow: false,
 						routePath: '/jy/project/ProjectList'
 					}
@@ -1808,6 +1814,12 @@ export default {
 
 		//发起报告签发
 		reportIssuanceSubmit(row){
+			var busId;
+			if (this.commonJS.isNotEmpty(row.sealId)){
+				busId = row.sealId
+			}else {
+				busId = 'false'
+			}
 			// 读取流程表单
 			let tabTitle = `发起流程【嘉溢-报告签发】`
 			let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [嘉溢-报告签发]`
@@ -1824,7 +1836,7 @@ export default {
 						formType: data.formType,
 						formUrl: data.formUrl,
 						formTitle: processTitle,
-						businessId: row.sealId,
+						businessId: busId,
 						isShow: false,
 						routePath: '/jy/project/ProjectList'
 					}

+ 2 - 0
src/views/jy/workContractInfo/ContractAddForm.vue

@@ -667,6 +667,7 @@
 					this.loading = false
 				})
 			}else {
+				this.$refs.uploadComponent.newUpload(method, this.inputForm.workAttachmentList, 'jyWorkContract', null, null, null, null, false)
 				this.loading = false
 			}
 
@@ -837,6 +838,7 @@
         this.$refs.inputForm.resetFields()
         this.inputForm.clientName = ''
         this.inputForm.cwWorkClientContactDTOList = []
+		  this.inputForm.contractTypes = []
         this.visible = false
         this.showVi = true
         this.$refs.uploadComponent.clearUpload()

+ 2 - 2
src/views/materialManagement/collect/CollectForm.vue

@@ -329,7 +329,7 @@
                   }
                 }
               }
-              this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
+              this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'collect')
               this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
               this.loading = false
             } else {
@@ -350,7 +350,7 @@
             }
           })
           if (method !== 'edit' && method !== 'view') {
-            this.$refs.uploadComponent.newUpload(method, [], 'reimbursement')
+            this.$refs.uploadComponent.newUpload(method, [], 'collect')
           }
         })
       },

+ 2 - 2
src/views/materialManagement/purchase/PurchaseForm.vue

@@ -431,7 +431,7 @@
 									}
 								}
 							}
-							this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
+							this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'purchase')
 							this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
 							this.loading = false
 						} else {
@@ -452,7 +452,7 @@
 						}
 					})
 					if (method !== 'edit' && method !== 'view') {
-						this.$refs.uploadComponent.newUpload(method, [], 'reimbursement')
+						this.$refs.uploadComponent.newUpload(method, [], 'purchase')
 					}
 				})
 			},

+ 7 - 6
src/views/materialManagement/userSeal/SignetAddForm.vue

@@ -191,10 +191,9 @@
 		watch: {
 			'keyWatch': {
 				handler (newVal) {
-					if (this.bus) {
-						if (this.bus !== 'false') {
-							this.init('', this.bus)
-						}
+					console.log('this.bus',this.bus)
+					if (this.commonJS.isNotEmpty(this.bus)) {
+						this.init('', this.bus)
 					} else {
 						this.$nextTick(() => {
 							this.$refs.inputForm.resetFields()
@@ -212,6 +211,7 @@
 		methods: {
 			getKeyWatch(keyWatch) {
 				this.keyWatch = keyWatch
+				console.log(12312321)
 			},
 			init(method, id) {
 				this.method = method
@@ -243,7 +243,7 @@
 					this.$refs.inputForm.resetFields()
 					this.loading = true
 					this.$refs.uploadComponent.clearUpload()
-					if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+					// if (this.commonJS.isNotEmpty(this.inputForm.id)) {
 						console.log('this.inputForm.id', this.inputForm.id)
 						this.signetService.queryById(this.inputForm.id).then((data)=>{
 							console.log('s',data)
@@ -263,10 +263,11 @@
 							if (this.status === 'audit' || this.status === 'taskFormDetail') {
 								method = 'view'
 							}
+							console.log('123123123')
 							this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'jySeal',null, null, null, null, false)
 						})
 						this.loading = false
-					}
+					// }
 				})
 			},
 			saveForm(callback) {

+ 5 - 5
src/views/materialManagement/wareHouse/WareHouseAddForm.vue

@@ -445,7 +445,7 @@
                   }
                 }
               }
-              this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
+              this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'wareHouse')
               this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
               this.tableKey = Math.random()
               this.loading = false
@@ -454,7 +454,7 @@
             if (method === 'add') {
               this.inputForm.wareHouseDate = new Date()
             }
-            this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
+            this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'wareHouse')
           }
         })
       },
@@ -671,7 +671,7 @@
         if (this.commonJS.isEmpty(this.inputForm.detailInfos[index].fileInfoLost)) {
           this.inputForm.detailInfos[index].fileInfoLost = []
         }
-        this.$refs.materialManagementDialog.newUpload('view', this.inputForm.detailInfos[index].fileInfoLost, null, null, null, null, null, false, index)
+        this.$refs.materialManagementDialog.newUpload('view', this.inputForm.detailInfos[index].fileInfoLost, 'purchase', null, null, null, null, false, index)
       },
       sss (index) {
         if (this.commonJS.isEmpty(this.inputForm.detailInfos[index].fileInfoLost)) {
@@ -683,13 +683,13 @@
         if (this.commonJS.isEmpty(this.inputForm.wareHouse[index].fileInfoLost)) {
           this.inputForm.wareHouse[index].fileInfoLost = []
         }
-        this.$refs.materialManagementDialog.newUpload('view', this.inputForm.wareHouse[index].fileInfoLost, null, null, null, null, null, false, index)
+        this.$refs.materialManagementDialog.newUpload('view', this.inputForm.wareHouse[index].fileInfoLost, 'wareHouse', null, null, null, null, false, index)
 	  },
       sss2 (index) {
         if (this.commonJS.isEmpty(this.inputForm.wareHouse[index].fileInfoLost)) {
           this.inputForm.wareHouse[index].fileInfoLost = []
         }
-        this.$refs.materialManagementDialog.newUpload(null, this.inputForm.wareHouse[index].fileInfoLost, null, null, null, null, null, false, index)
+        this.$refs.materialManagementDialog.newUpload(null, this.inputForm.wareHouse[index].fileInfoLost, 'wareHouse', null, null, null, null, false, index)
       },
       // 采购类型下拉弹窗
       typePullForm (rowIndex) {