Forráskód Böngészése

调整代码提交

user5 1 éve
szülő
commit
1f0f18bde5

+ 8 - 0
src/api/jy/ProjectInfoService.js

@@ -268,6 +268,14 @@ export default class ProjectInfoService {
 		});
 	}
 
+	getByContractId (id, projectForm) {
+		return request({
+			url: prefix + "/jyProject/getByContractId",
+			method: "get",
+			params: { contractId: id, ...projectForm },
+		});
+	}
+
 
 
 

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

@@ -12,6 +12,7 @@
 				   :before-upload="beforeUpload"
 				   :on-change="changes"
 				   :on-progress="uploadVideoProcess"
+				   :on-success="success"
 				   :file-list="fileList">
 			<template v-if="auth==='view'&&uploadFlag===false" #tip>
 				<el-button :loading="loading" type="primary" size="default" :disabled="true"> 点击上传 </el-button>
@@ -55,7 +56,7 @@
 					<template  #default="scope">
 						<el-button text type="primary" key="01" icon="el-icon-download" size="small" @click="toHref(scope.row)" >下载</el-button>
 						<el-button text type="primary" key="02" icon="el-icon-delete" size="small"  @click="deleteById(scope.row, scope.$index,fileList)" :disabled="auth==='view'&&delFlag === false&&createBy!==scope.row.createBy.name">删除</el-button>
-						<el-button v-if="createBy===scope.row.createBy.name" type="text"  icon="el-icon-delete" size="small"  @click="deleteById(scope.row, scope.$index)" :disabled="auth==='view'&&delFlag === false">删除2</el-button>
+						<!--<el-button v-if="createBy===scope.row.createBy.name" type="text"  icon="el-icon-delete" size="small"  @click="deleteById(scope.row, scope.$index)" :disabled="auth==='view'&&delFlag === false">删除2</el-button>-->
 					</template>
 				</el-table-column>
 			</el-table>
@@ -378,6 +379,29 @@
 					}
 				}
 			},
+			async success(res, file,fileList) {
+				if(file.url){
+					this.$message.error('文件上传失败,请重新上传!')
+					for (let i = 0; i < this.dataListNew.length; i++) {
+						var fileItem = this.dataListNew[i];
+						if(this.dataListNew[i].raw !== undefined && this.dataListNew[i].raw !== null && this.dataListNew[i].raw !== {}){
+							fileItem = this.dataListNew[i].raw;
+						}
+						if(file.name === fileItem.name){
+							await this.deleteById(file,i)
+						}
+					}
+					for (let i = 0; i < fileList.length; i++) {
+						var fileListItem = fileList[i];
+						if(fileList[i].raw !== undefined && fileList[i].raw !== null && fileList[i].raw !== {}){
+							fileListItem = fileList[i].raw;
+						}
+						if(file.name === fileListItem.name){
+							await this.deleteById(file,i)
+						}
+					}
+				}
+			},
 			showFile (row) {
 				openWindowOnUrl(row)
 			},

+ 91 - 1
src/views/common/JyArchiveUpLoadComponent.vue

@@ -10,7 +10,9 @@
                      }"
 				   :show-file-list="false"
 				   :on-change="changes"
+				   :before-upload="beforeUpload"
 				   :on-progress="uploadVideoProcess"
+				   :on-success="success"
 				   :file-list="fileList">
 			<template v-if="auth==='view'&&uploadFlag===false" #tip>
 				<el-button :loading="loading" type="primary" size="default" :disabled="true"> 点击上传 </el-button>
@@ -109,6 +111,7 @@
 				loadProgress: 0,
 				fileList: [],
 				dataList: [],
+				oldDataList: [],
 				dataListNew: [],
 				url: '',
 				showViewer: false,
@@ -128,7 +131,8 @@
 				remarks: '',
 				showSign: false,
 				loading: false,
-				dataListLength: ''
+				dataListLength: '',
+				uploadDelFlag: false
 			}
 		},
 		watch: {
@@ -344,6 +348,13 @@
 			 *    showSign=audit的时候 ‘签章’按钮展示
 			 */
 			async newUpload (auth, fileList, directory, maxValue, dividerName, uploadFlag, delFlag, showDivider, showSign) {
+				this.uploadKey = Math.random()
+				if (this.commonJS.isEmpty(fileList)) {
+					fileList = []
+					this.fileLoading = true
+				} else {
+					this.dataListLength = fileList.length
+				}
 				if (this.commonJS.isEmpty(showSign)) {
 					this.showSign = false
 				} else {
@@ -394,12 +405,14 @@
 						this.delFlag = delFlag
 					}
 				}
+				this.oldDataList = []
 				for await (let item of fileList) {
 					if (item.url) {
 						await this.ossService.getFileSizeByUrl(item.url).then((data) => {
 							item.lsUrl = data.url
 							item.size = data.size
 							this.dataList.push(item)
+							this.oldDataList.push(item)
 							this.dataListNew.push(item)
 							if (this.dataListNew.length === fileList.length) {
 								this.fileLoading = true
@@ -419,10 +432,25 @@
 					}
 				}
 			},
+			async beforeUpload(file) {
+				console.log("beforeUpload",file)
+				if(this.uploadDelFlag){
+					this.$message.warning('该文件已上传,请勿重复上传');
+					this.uploadKey = Math.random()
+
+					return true; // 取消上传
+				}
+				// 其他判定逻辑...
+				return true; // 允许上传
+			},
 			async httpRequest (file) {
 				await httpRequest(file, fileName(file), this.directory, this.maxValue)
 			},
 			uploadVideoProcess (event, file, fileList) {
+				let parent = this.$parent
+				while (!parent.inputForm) {
+					parent = parent['$parent']
+				}
 				this.progressFlag = true // 显示进度条
 				this.loadProgress = parseInt(event.percent) // 动态获取文件上传进度
 				if (this.loadProgress >= 100) {
@@ -453,6 +481,9 @@
 				}
 			},
 			async changes (file, fileList) {
+				this.uploadKey = Math.random()
+				console.log(fileList)
+				this.uploadDelFlag = false;
 				// if (file.status !== 'ready') {
 				//   return
 				// }
@@ -460,11 +491,46 @@
 					this.$message.error('文件大小不能超过 ' + this.maxValue + ' MB!')
 					return
 				}
+				var verificationFileList = []
+				if(this.oldDataList){
+					for (let item of this.oldDataList) {
+						verificationFileList.push(item)
+					}
+				}
+				for (let item of fileList) {
+					verificationFileList.push(item)
+				}
+				var fileCount = 0;
+				for (let item of verificationFileList) {
+					var fileItem = item;
+					if(item.raw !== undefined && item.raw !== null && item.raw !== {}){
+						fileItem = item.raw;
+					}
+					if(file.raw.name === fileItem.name){
+						fileCount ++
+					}
+				}
+
+
+				if(fileCount>1){
+					this.uploadDelFlag = true;
+					return
+				}
+
 				this.dataListNew = []
 				this.dataList.forEach((item) => {
 					this.dataListNew.push(item)
 				})
+
+				var fileListNames = []
+				for (let fileItem of this.fileList) {
+					fileListNames.push(fileItem.name)
+				}
+
 				for (let item of fileList) {
+					if(fileListNames.length === 0 || fileListNames.indexOf(item.name) === -1){
+						this.fileList.push(item)
+					}
 					item.createTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
 					item.createBy = {
 						id: '',
@@ -486,6 +552,29 @@
 				}
 				this.tableKey = Math.random()
 			},
+			async success(res, file,fileList) {
+				if(file.url){
+					this.$message.error('文件上传失败,请重新上传!')
+					for (let i = 0; i < this.dataListNew.length; i++) {
+						var fileItem = this.dataListNew[i];
+						if(this.dataListNew[i].raw !== undefined && this.dataListNew[i].raw !== null && this.dataListNew[i].raw !== {}){
+							fileItem = this.dataListNew[i].raw;
+						}
+						if(file.name === fileItem.name){
+							await this.deleteById(file,i)
+						}
+					}
+					for (let i = 0; i < fileList.length; i++) {
+						var fileListItem = fileList[i];
+						if(fileList[i].raw !== undefined && fileList[i].raw !== null && fileList[i].raw !== {}){
+							fileListItem = fileList[i].raw;
+						}
+						if(file.name === fileListItem.name){
+							await this.deleteById(file,i)
+						}
+					}
+				}
+			},
 			showFile (row) {
 				openWindowOnUrl(row)
 			},
@@ -510,6 +599,7 @@
 			 * 关闭dialog时使用  清除el-upload中上传的文件
 			 */
 			clearUpload () {
+				this.fileList = []//用于清除上传文件的缓存
 				this.$refs.upload.uploadFiles = []
 				this.dataList = []
 				this.dataListNew = []

+ 91 - 1
src/views/common/JyEiaUpLoadComponent.vue

@@ -10,7 +10,9 @@
                      }"
 				   :show-file-list="false"
 				   :on-change="changes"
+				   :before-upload="beforeUpload"
 				   :on-progress="uploadVideoProcess"
+				   :on-success="success"
 				   :file-list="fileList">
 			<template v-if="auth==='view'&&uploadFlag===false" #tip>
 				<el-button :loading="loading" type="primary" size="default" :disabled="true"> 点击上传 </el-button>
@@ -109,6 +111,7 @@
 				loadProgress: 0,
 				fileList: [],
 				dataList: [],
+				oldDataList: [],
 				dataListNew: [],
 				url: '',
 				showViewer: false,
@@ -128,7 +131,8 @@
 				remarks: '',
 				showSign: false,
 				loading: false,
-				dataListLength: ''
+				dataListLength: '',
+				uploadDelFlag: false
 			}
 		},
 		watch: {
@@ -345,7 +349,14 @@
 			 *    showSign=audit的时候 ‘签章’按钮展示
 			 */
 			async newUpload (auth, fileList, directory, maxValue, dividerName, uploadFlag, delFlag, showDivider, showSign) {
+				this.uploadKey = Math.random()
 					console.log('fileList',fileList)
+				if (this.commonJS.isEmpty(fileList)) {
+					fileList = []
+					this.fileLoading = true
+				} else {
+					this.dataListLength = fileList.length
+				}
 				if (this.commonJS.isEmpty(showSign)) {
 					this.showSign = false
 				} else {
@@ -398,12 +409,14 @@
 					}
 				}
 
+				this.oldDataList = []
 				for await (let item of fileList) {
 					if (item.url) {
 						await this.ossService.getFileSizeByUrl(item.url).then((data) => {
 							item.lsUrl = data.url
 							item.size = data.size
 							this.dataList.push(item)
+							this.oldDataList.push(item)
 							this.dataListNew.push(item)
 							if (this.dataListNew.length === fileList.length) {
 								this.fileLoading = true
@@ -424,10 +437,25 @@
 					}
 				}
 			},
+			async beforeUpload(file) {
+				console.log("beforeUpload",file)
+				if(this.uploadDelFlag){
+					this.$message.warning('该文件已上传,请勿重复上传');
+					this.uploadKey = Math.random()
+
+					return true; // 取消上传
+				}
+				// 其他判定逻辑...
+				return true; // 允许上传
+			},
 			async httpRequest (file) {
 				await httpRequest(file, fileName(file), this.directory, this.maxValue)
 			},
 			uploadVideoProcess (event, file, fileList) {
+				let parent = this.$parent
+				while (!parent.inputForm) {
+					parent = parent['$parent']
+				}
 				this.progressFlag = true // 显示进度条
 				this.loadProgress = parseInt(event.percent) // 动态获取文件上传进度
 				if (this.loadProgress >= 100) {
@@ -458,6 +486,9 @@
 				}
 			},
 			async changes (file, fileList) {
+				this.uploadKey = Math.random()
+				console.log(fileList)
+				this.uploadDelFlag = false;
 				// if (file.status !== 'ready') {
 				//   return
 				// }
@@ -465,11 +496,46 @@
 					this.$message.error('文件大小不能超过 ' + this.maxValue + ' MB!')
 					return
 				}
+				var verificationFileList = []
+				if(this.oldDataList){
+					for (let item of this.oldDataList) {
+						verificationFileList.push(item)
+					}
+				}
+				for (let item of fileList) {
+					verificationFileList.push(item)
+				}
+				var fileCount = 0;
+				for (let item of verificationFileList) {
+					var fileItem = item;
+					if(item.raw !== undefined && item.raw !== null && item.raw !== {}){
+						fileItem = item.raw;
+					}
+					if(file.raw.name === fileItem.name){
+						fileCount ++
+					}
+				}
+
+
+				if(fileCount>1){
+					this.uploadDelFlag = true;
+					return
+				}
+
 				this.dataListNew = []
 				this.dataList.forEach((item) => {
 					this.dataListNew.push(item)
 				})
+
+				var fileListNames = []
+				for (let fileItem of this.fileList) {
+					fileListNames.push(fileItem.name)
+				}
+
 				for (let item of fileList) {
+					if(fileListNames.length === 0 || fileListNames.indexOf(item.name) === -1){
+						this.fileList.push(item)
+					}
 					item.createTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
 					item.createBy = {
 						id: '',
@@ -491,6 +557,29 @@
 				}
 				this.tableKey = Math.random()
 			},
+			async success(res, file,fileList) {
+				if(file.url){
+					this.$message.error('文件上传失败,请重新上传!')
+					for (let i = 0; i < this.dataListNew.length; i++) {
+						var fileItem = this.dataListNew[i];
+						if(this.dataListNew[i].raw !== undefined && this.dataListNew[i].raw !== null && this.dataListNew[i].raw !== {}){
+							fileItem = this.dataListNew[i].raw;
+						}
+						if(file.name === fileItem.name){
+							await this.deleteById(file,i)
+						}
+					}
+					for (let i = 0; i < fileList.length; i++) {
+						var fileListItem = fileList[i];
+						if(fileList[i].raw !== undefined && fileList[i].raw !== null && fileList[i].raw !== {}){
+							fileListItem = fileList[i].raw;
+						}
+						if(file.name === fileListItem.name){
+							await this.deleteById(file,i)
+						}
+					}
+				}
+			},
 			showFile (row) {
 				openWindowOnUrl(row)
 			},
@@ -515,6 +604,7 @@
 			 * 关闭dialog时使用  清除el-upload中上传的文件
 			 */
 			clearUpload () {
+				this.fileList = []//用于清除上传文件的缓存
 				this.$refs.upload.uploadFiles = []
 				this.dataList = []
 				this.dataListNew = []

+ 92 - 1
src/views/common/JyUpLoadComponent.vue

@@ -10,7 +10,9 @@
                      }"
 				   :show-file-list="false"
 				   :on-change="changes"
+				   :before-upload="beforeUpload"
 				   :on-progress="uploadVideoProcess"
+				   :on-success="success"
 				   :file-list="fileList">
 			<template v-if="auth==='view'&&uploadFlag===false" #tip>
 				<el-button :loading="loading" type="primary" size="default" :disabled="true"> 点击上传 </el-button>
@@ -109,6 +111,7 @@
 				loadProgress: 0,
 				fileList: [],
 				dataList: [],
+				oldDataList: [],
 				dataListNew: [],
 				url: '',
 				showViewer: false,
@@ -128,7 +131,8 @@
 				remarks: '',
 				showSign: false,
 				loading: false,
-				dataListLength: ''
+				dataListLength: '',
+				uploadDelFlag: false
 			}
 		},
 		watch: {
@@ -344,6 +348,13 @@
 			 *    showSign=audit的时候 ‘签章’按钮展示
 			 */
 			async newUpload (auth, fileList, directory, maxValue, dividerName, uploadFlag, delFlag, showDivider, showSign) {
+				this.uploadKey = Math.random()
+				if (this.commonJS.isEmpty(fileList)) {
+					fileList = []
+					this.fileLoading = true
+				} else {
+					this.dataListLength = fileList.length
+				}
 				if (this.commonJS.isEmpty(showSign)) {
 					this.showSign = false
 				} else {
@@ -394,12 +405,14 @@
 						this.delFlag = delFlag
 					}
 				}
+				this.oldDataList = []
 				for await (let item of fileList) {
 					if (item.url) {
 						await this.ossService.getFileSizeByUrl(item.url).then((data) => {
 							item.lsUrl = data.url
 							item.size = data.size
 							this.dataList.push(item)
+							this.oldDataList.push(item)
 							this.dataListNew.push(item)
 							if (this.dataListNew.length === fileList.length) {
 								this.fileLoading = true
@@ -419,10 +432,25 @@
 					}
 				}
 			},
+			async beforeUpload(file) {
+				console.log("beforeUpload",file)
+				if(this.uploadDelFlag){
+					this.$message.warning('该文件已上传,请勿重复上传');
+					this.uploadKey = Math.random()
+
+					return true; // 取消上传
+				}
+				// 其他判定逻辑...
+				return true; // 允许上传
+			},
 			async httpRequest (file) {
 				await httpRequest(file, fileName(file), this.directory, this.maxValue)
 			},
 			uploadVideoProcess (event, file, fileList) {
+				let parent = this.$parent
+				while (!parent.inputForm) {
+					parent = parent['$parent']
+				}
 				this.progressFlag = true // 显示进度条
 				this.loadProgress = parseInt(event.percent) // 动态获取文件上传进度
 				if (this.loadProgress >= 100) {
@@ -453,6 +481,9 @@
 				}
 			},
 			async changes (file, fileList) {
+				this.uploadKey = Math.random()
+				console.log(fileList)
+				this.uploadDelFlag = false;
 				// if (file.status !== 'ready') {
 				//   return
 				// }
@@ -460,11 +491,46 @@
 					this.$message.error('文件大小不能超过 ' + this.maxValue + ' MB!')
 					return
 				}
+				var verificationFileList = []
+				if(this.oldDataList){
+					for (let item of this.oldDataList) {
+						verificationFileList.push(item)
+					}
+				}
+				for (let item of fileList) {
+					verificationFileList.push(item)
+				}
+				var fileCount = 0;
+				for (let item of verificationFileList) {
+					var fileItem = item;
+					if(item.raw !== undefined && item.raw !== null && item.raw !== {}){
+						fileItem = item.raw;
+					}
+					if(file.raw.name === fileItem.name){
+						fileCount ++
+					}
+				}
+
+
+				if(fileCount>1){
+					this.uploadDelFlag = true;
+					return
+				}
+
 				this.dataListNew = []
 				this.dataList.forEach((item) => {
 					this.dataListNew.push(item)
 				})
+
+				var fileListNames = []
+				for (let fileItem of this.fileList) {
+					fileListNames.push(fileItem.name)
+				}
+
 				for (let item of fileList) {
+					if(fileListNames.length === 0 || fileListNames.indexOf(item.name) === -1){
+						this.fileList.push(item)
+					}
 					item.createTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
 					item.createBy = {
 						id: '',
@@ -486,6 +552,30 @@
 				}
 				this.tableKey = Math.random()
 			},
+
+			async success(res, file,fileList) {
+				if(file.url){
+					this.$message.error('文件上传失败,请重新上传!')
+					for (let i = 0; i < this.dataListNew.length; i++) {
+						var fileItem = this.dataListNew[i];
+						if(this.dataListNew[i].raw !== undefined && this.dataListNew[i].raw !== null && this.dataListNew[i].raw !== {}){
+							fileItem = this.dataListNew[i].raw;
+						}
+						if(file.name === fileItem.name){
+							await this.deleteById(file,i)
+						}
+					}
+					for (let i = 0; i < fileList.length; i++) {
+						var fileListItem = fileList[i];
+						if(fileList[i].raw !== undefined && fileList[i].raw !== null && fileList[i].raw !== {}){
+							fileListItem = fileList[i].raw;
+						}
+						if(file.name === fileListItem.name){
+							await this.deleteById(file,i)
+						}
+					}
+				}
+			},
 			showFile (row) {
 				openWindowOnUrl(row)
 			},
@@ -510,6 +600,7 @@
 			 * 关闭dialog时使用  清除el-upload中上传的文件
 			 */
 			clearUpload () {
+				this.fileList = []//用于清除上传文件的缓存
 				this.$refs.upload.uploadFiles = []
 				this.dataList = []
 				this.dataListNew = []

+ 25 - 0
src/views/common/ProjectTypeUpLoadComponent.vue

@@ -11,6 +11,7 @@
                :show-file-list="false"
                :on-change="changes"
                :on-progress="uploadVideoProcess"
+			   :on-success="success"
                :file-list="fileList">
 		<template v-if="auth==='view'&&uploadFlag===false" #tip>
 			<el-button  :loading="loading" type="primary" size="default" :disabled="true"> 点击上传 </el-button>
@@ -294,6 +295,30 @@
         this.tableKey = Math.random()
         this.uploadKey = Math.random()
       },
+
+		async success(res, file,fileList) {
+			if(file.url){
+				this.$message.error('文件上传失败,请重新上传!')
+				for (let i = 0; i < this.dataListNew.length; i++) {
+					var fileItem = this.dataListNew[i];
+					if(this.dataListNew[i].raw !== undefined && this.dataListNew[i].raw !== null && this.dataListNew[i].raw !== {}){
+						fileItem = this.dataListNew[i].raw;
+					}
+					if(file.name === fileItem.name){
+						await this.deleteById(file,i)
+					}
+				}
+				for (let i = 0; i < fileList.length; i++) {
+					var fileListItem = fileList[i];
+					if(fileList[i].raw !== undefined && fileList[i].raw !== null && fileList[i].raw !== {}){
+						fileListItem = fileList[i].raw;
+					}
+					if(file.name === fileListItem.name){
+						await this.deleteById(file,i)
+					}
+				}
+			}
+		},
       showFile (row) {
       	console.log('row', row)
         openWindowOnUrl(row)

+ 533 - 381
src/views/common/UpLoadComponent.vue

@@ -1,391 +1,543 @@
 <!--文件上传组件-->
 <template>
-  <div :key="uploadKey">
-    <el-divider v-if="showDivider" content-position="left"><i class="el-icon-document"></i> {{dividerName}}</el-divider>
-    <el-upload ref="upload" style="display: inline-block; :show-header='status'" action=""
-               :limit="999" :http-request="httpRequest"
-               multiple
-               :on-exceed="(files, fileList) =>{
+	<div :key="uploadKey">
+		<el-divider v-if="showDivider" content-position="left"><i class="el-icon-document"></i> {{dividerName}}</el-divider>
+		<el-upload ref="upload" style="display: inline-block; :show-header='status'" action=""
+				   :limit="999" :http-request="httpRequest"
+				   multiple
+				   :on-exceed="(files, fileList) =>{
                       $message.warning(`当前限制选择 999 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
                      }"
-               :show-file-list="false"
-               :on-change="changes"
-               :on-progress="uploadVideoProcess"
-               :file-list="fileList">
-		<template v-if="auth==='view'&&uploadFlag===false" #tip>
-			<el-button  :loading="loading" type="primary" size="default" :disabled="true"> 点击上传 </el-button>
-		</template>
-		<template v-else #trigger>
-			<el-button  :loading="loading" type="primary" size="default"> 点击上传 </el-button>
-		</template>
-    </el-upload>
-    <div style="height: calc(100% - 80px);margin-top: 10px">
-      <!-- 进度条 -->
-      <el-progress style="margin-left: 5em" v-if="progressFlag" :percentage="loadProgress"></el-progress>
-      <el-table
-        ref="uploadTable"
-        v-loading="loading"
-        :key="tableKey"
-        :data="dataListNew">
-        <el-table-column type="seq" width="40"></el-table-column>
-        <el-table-column label="文件名称" prop="name" align="center">
-          <template #default="scope">
-            <div v-if="ifName(scope.row) === true">
-              <el-image
-                style="width: 30px; height: 30px;padding-top: 4px;"
-                :src="scope.row.lsUrl"
-                :preview-src-list="[scope.row.lsUrl]"
-				:preview-teleported="true"
-              ></el-image>
-            </div>
-            <div v-else>
-              <el-link  type="primary" :underline="false" @click="showFile(scope.row)">{{scope.row.name}}</el-link>
-            </div>
-          </template>
-        </el-table-column>
-        <el-table-column label="创建人" prop="createBy.name" align="center"></el-table-column>
-        <el-table-column label="创建时间" prop="createTime" align="center"></el-table-column>
-        <el-table-column label="文件大小" prop="size" align="center">
-          <template #default="scope">
-            {{getSize(scope.row.size)}}
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" width="200px" fixed="right" align="center">
-          <template  #default="scope">
-            <el-button text type="primary" key="01" icon="el-icon-download" size="small" @click="toHref(scope.row)" >下载</el-button>
-            <el-button text type="primary" key="02" icon="el-icon-delete" size="small"  @click="deleteById(scope.row, scope.$index)" :disabled="auth==='view'&&delFlag === false&&createBy!==scope.row.createBy.name">删除</el-button>
-<!--            <el-button v-if="createBy===scope.row.createBy.name" type="text"  icon="el-icon-delete" size="small"  @click="deleteById(scope.row, scope.$index)" :disabled="auth==='view'&&delFlag === false">删除2</el-button>-->
-          </template>
-        </el-table-column>
-      </el-table>
-    </div>
-<!--    <el-image-viewer v-if="showViewer" :on-close="closeViewer" :url-list="[url]" :zIndex=9999></el-image-viewer>-->
-  </div>
+				   :show-file-list="false"
+				   :on-change="changes"
+				   :before-upload="beforeUpload"
+				   :on-progress="uploadVideoProcess"
+				   :on-success="success"
+				   :file-list="fileList">
+			<template v-if="auth==='view'&&uploadFlag===false" #tip>
+				<el-button :loading="loading" type="primary" size="default" :disabled="true"> 点击上传 </el-button>
+			</template>
+			<template v-else #trigger>
+				<el-button :loading="loading" type="primary" size="default"> 点击上传 </el-button>
+			</template>
+		</el-upload>
+		<div style="height: calc(100% - 80px);margin-top: 10px">
+			<!-- 进度条 -->
+			<el-progress style="margin-left: 5em" v-if="progressFlag" :percentage="loadProgress"></el-progress>
+			<el-table
+				ref="uploadTable"
+				v-loading="loading"
+				:key="tableKey"
+				:data="dataListNew">
+				<el-table-column type="seq" width="40"></el-table-column>
+				<el-table-column label="文件名称" prop="name" align="center">
+					<template #default="scope">
+						<div v-if="ifName(scope.row) === true">
+							<el-image
+								style="width: 30px; height: 30px;padding-top: 4px;"
+								:src="scope.row.lsUrl"
+								:preview-src-list="[scope.row.lsUrl]"
+								:preview-teleported="true"
+							></el-image>
+						</div>
+						<div v-else>
+							<el-link  type="primary" :underline="false" @click="showFile(scope.row)">{{scope.row.name}}</el-link>
+						</div>
+					</template>
+				</el-table-column>
+				<el-table-column label="创建人" prop="createBy.name" align="center"></el-table-column>
+				<el-table-column label="创建时间" prop="createTime" align="center"></el-table-column>
+				<el-table-column label="文件大小" prop="size" align="center">
+					<template #default="scope">
+						{{getSize(scope.row.size)}}
+					</template>
+				</el-table-column>
+				<el-table-column label="操作" width="200px" fixed="right" align="center">
+					<template  #default="scope">
+						<el-button text type="primary" key="01" icon="el-icon-download" size="small" @click="toHref(scope.row)" >下载</el-button>
+						<el-button text type="primary" key="02" icon="el-icon-delete" size="small"  @click="deleteById(scope.row, scope.$index,fileList)" :disabled="auth==='view'&&delFlag === false&&createBy!==scope.row.createBy.name">删除</el-button>
+						<!--            <el-button v-if="createBy===scope.row.createBy.name" type="text"  icon="el-icon-delete" size="small"  @click="deleteById(scope.row, scope.$index)" :disabled="auth==='view'&&delFlag === false">删除2</el-button>-->
+					</template>
+				</el-table-column>
+			</el-table>
+		</div>
+		<!--    <el-image-viewer v-if="showViewer" :on-close="closeViewer" :url-list="[url]" :zIndex=9999></el-image-viewer>-->
+	</div>
 </template>
 
 <script>
-  // eslint-disable-next-line no-unused-vars
-  import OSSSerivce, {
-    httpRequest,
-    // eslint-disable-next-line no-unused-vars
-    handleRemove,
-    fileName,
-    // eslint-disable-next-line no-unused-vars
-    beforeAvatarUpload,
-    // eslint-disable-next-line no-unused-vars
-    openWindowOnUrl,
-    // eslint-disable-next-line no-unused-vars
-    toHref
-  } from '@/api/sys/OSSService'
-  // import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
-  import moment from 'moment'
-  export default {
-    data () {
-      return {
-		  uploadKey: '',
-        progressFlag: false,
-        loadProgress: 0,
-        fileList: [],
-        dataList: [],
-        dataListNew: [],
-        url: '',
-        showViewer: false,
-        ossService: null,
-        auth: '',
-        directory: 'public',
-        maxValue: 300,
-        tableKey: '',
-        fileLoading: true,
-        dividerName: '',
-        uploadFlag: false,
-        delFlag: false,
-        createBy: '',
-        showDivider: true,
-        loading: false,
-        dataListLength: ''
-      }
-    },
-    watch: {
-    },
-    created () {
-      this.ossService = new OSSSerivce()
-    },
-    components: {
-      // ElImageViewer
-    },
-    mounted () {
-      window.onPreview = this.onPreview
-    },
-    methods: {
-      /**
-       * dividerName: 组件中divider的名称赋值
-       * showDivider: ‘附件‘Divider是否展示
-       *     注:值为空时,默认值为true
-       *    showDivider=false时 ‘附件‘Divider隐藏
-       **/
-      setDividerName (dividerName, showDivider) {
-        if (this.commonJS.isNotEmpty(dividerName)) {
-          this.dividerName = dividerName
-        }
-        if (this.commonJS.isNotEmpty(showDivider)) {
-          if (showDivider === false) {
-            this.showDivider = false
-          } else {
-            this.showDivider = true
-          }
-        } else {
-          this.showDivider = true
-        }
-      },
-      /**
-       * 文件上传组件初始化
-       * @param auth
-       *    auth的值为"view"时,不可上传/编辑文件
-       *    auth为其他值时,可上传/编辑文件
-       * @param fileList  要显示到文件上传列表中的文件。
-       *    注:文件必须要有url属性并且文件的url属性值必须是在oss中的路径值
-       *    例:'/attachment-file/xxx/xxx/2022/9/08/xxx.jpg'
-       * @param directory  要存放到oss的哪个文件夹下。
-       *    注:值为空时,默认存放到"public"文件夹
-       * @param maxValue  上传文件允许的最大值,单位:MB
-       *    注:值为空时,默认值为300MB
-       * @param dividerName  组件中divider的名称
-       *    注:值为空时,默认值为‘附件’
-       * @param uploadFlag  ‘上传文件’按钮是否禁用
-       *    注:值为空时,默认值为false
-       *    auth=view&&uploadFlag=false时 ‘上传文件’按钮禁用
-       * @param delFlag  ‘删除’按钮是否禁用
-       *    注:值为空时,默认值为false
-       *    auth=view&&delFlag=false时 ‘删除’按钮禁用
-       * @param showDivider  ‘附件‘Divider是否展示
-       *    注:值为空时,默认值为true
-       *    showDivider=false时 ‘附件‘Divider隐藏
-       */
-      async newUpload (auth, fileList, directory, maxValue, dividerName, uploadFlag, delFlag, showDivider) {
-      	console.log('fileList',fileList)
-        await this.fileLoadingFalse()
-        if (this.commonJS.isEmpty(fileList)) {
-          this.fileLoading = true
-        } else {
-          this.dataListLength = fileList.length
-        }
-        if (this.commonJS.isEmpty(dividerName)) {
-          this.dividerName = '附件'
-        } else {
-          this.dividerName = dividerName
-        }
-        if (directory !== undefined && directory !== null && directory !== '' && directory !== {}) {
-          this.directory = directory
-        } else {
-          this.directory = 'public'
-        }
-        if (maxValue !== undefined && maxValue !== null && maxValue !== '' && maxValue !== 0) {
-          this.maxValue = maxValue
-        } else {
-          this.maxValue = 300
-        }
-        this.auth = auth
-        if (this.commonJS.isEmpty(uploadFlag)) {
-          this.uploadFlag = false
-        } else {
-          if (uploadFlag !== true && uploadFlag !== false) {
-            this.uploadFlag = false
-          } else {
-            this.uploadFlag = uploadFlag
-          }
-        }
-        if (this.commonJS.isEmpty(delFlag)) {
-          this.delFlag = false
-        } else {
-          if (delFlag !== true && delFlag !== false) {
-            this.delFlag = false
-            this.createBy = delFlag
-          } else {
-            this.delFlag = delFlag
-          }
-        }
-        for await (let item of fileList) {
-          await this.ossService.getFileSizeByUrl(item.url).then((data) => {
-            item.lsUrl = data.url
-            item.size = data.size
-            this.dataList.push(item)
-            this.dataListNew.push(item)
-            if (this.dataListNew.length === fileList.length) {
-              this.fileLoading = true
-            }
-          })
-        }
-        // this.dataList = JSON.parse(JSON.stringify(fileList))
-        // this.dataListNew = JSON.parse(JSON.stringify(fileList))
-        if (this.commonJS.isEmpty(showDivider)) {
-          this.showDivider = true
-        } else {
-          if (showDivider === false) {
-            this.showDivider = false
-          } else {
-            this.showDivider = true
-          }
-        }
-      },
-      async httpRequest (file) {
-        await httpRequest(file, fileName(file), this.directory, this.maxValue)
-      },
-      uploadVideoProcess (event, file, fileList) {
-        this.progressFlag = true // 显示进度条
-        this.loadProgress = parseInt(event.percent) // 动态获取文件上传进度
-        if (this.loadProgress >= 100) {
-          this.loadProgress = 100
-          setTimeout(() => {
-            this.progressFlag = false
-          }, 1000) // 一秒后关闭进度条
-        }
-      },
-      getSize (value) {
-        if (this.commonJS.isEmpty(value)) {
-          return '0 B'
-        } else {
-          let val = parseInt(value)
-          if (this.commonJS.isEmpty(val)) {
-            return '0 B'
-          }
-          if (isNaN(val)) {
-            return '0 B'
-          }
-          if (val === 0) {
-            return '0 B'
-          }
-          let k = 1024
-          let sizes = ['B', 'KB', 'MB', 'GB', 'PB', 'TB', 'EB', 'ZB', 'YB']
-          let i = Math.floor(Math.log(val) / Math.log(k))
-			let result = val / Math.pow(k, i);
-			let kb = parseFloat(result.toPrecision(3));
-          return kb + '' + sizes[i]
-        }
-      },
-      async changes (file, fileList) {
-        // if (file.status !== 'ready') {
-        //   return
-        // }
-        if (!beforeAvatarUpload(file, fileList, this.maxValue)) {
-          this.$message.error('文件大小不能超过 ' + this.maxValue + ' MB!')
-          return
-        }
-        this.dataListNew = []
-        this.dataList.forEach((item) => {
-          this.dataListNew.push(item)
-        })
-        for (let item of fileList) {
-          item.createTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
-          item.createBy = {
-            id: '',
-            name: ''
-          }
-          item.createBy.id = this.$store.state.user.id
-          item.createBy.name = this.$store.state.user.name
-          this.dataListNew.push(item)
-        }
-        for await (let item of this.dataListNew) {
-          if (item.raw !== undefined && item.raw !== null && item.raw !== {}) {
-            item.url = item.raw.url
-            if (item.raw.url !== undefined && item.raw.url !== null && item.raw.url !== {}) {
-              await this.ossService.getTemporaryUrl(item.raw.url).then((data) => {
-                item.lsUrl = data
-              })
-            }
-          }
-        }
-        this.tableKey = Math.random()
-        this.uploadKey = Math.random()
-      },
-      showFile (row) {
-      	console.log('row', row)
-        openWindowOnUrl(row)
-      },
-      onPreview (url) {
-        this.url = url
-        this.showViewer = true
-      },
-      // 关闭查看器
-      closeViewer () {
-        this.url = ''
-        this.showViewer = false
-      },
-      toHref (row) {
-        toHref(row)
-      },
-      async deleteById (row, index) {
-      	console.log('row', row)
-	  	// this.$refs.upload.handleRemove(this.dataListNew[index])
-        await this.dataListNew.splice(index, 1)
-		await this.dataList.splice(index, 1)
-		  if (this.commonJS.isNotEmpty(row.id)) {
-			  this.ossService.deleteMsgById(row.id)
-		  }
-		this.tableKey = Math.random()
-		this.uploadKey = Math.random()
-      },
-      /**
-       * 关闭dialog时使用  清除el-upload中上传的文件
-       */
-      clearUpload () {
-        this.$refs.upload.clearFiles()
-        this.dataList = []
-        this.dataListNew = []
-        this.createBy = ''
-      },
-      /**
-       * 获取当前文件列表中的文件数据
-       */
-      getDataList () {
-        return this.dataListNew
-      },
-      /**
-       * 判断进度条是否结束,附件是否加载完成
-       * @returns {boolean}
-       */
-      checkProgress () {
-        if (this.progressFlag === true) {
-          this.$message.warning('请等待附件上传完成再进行操作')
-          return true
-        }
-        if (this.fileLoading === false) {
-          this.$message.warning('请等待附件加载完成再进行操作')
-          if (this.dataListLength === this.dataListNew.length) {
-            this.fileLoading = true
-          }
-          return true
-        }
-        return false
-      },
-      ifName (row) {
-        if (this.commonJS.isEmpty(row.name)) {
-          row.name = '---'
-          return false
-        }
-        let suffix = row.name.substring(row.name.lastIndexOf('.') + 1)
-        if (suffix === 'jpg' || suffix === 'png' || suffix === 'gif' || suffix === 'bmp' || suffix === 'jpeg') {
-          return true
-        } else {
-          return false
-        }
-      },
-      fileLoadingFalse () {
-        this.fileLoading = false
-      },
-      // 开启/关闭页面的加载中状态
-      changeLoading (loading) {
-        if (this.commonJS.isNotEmpty(loading)) {
-          this.loading = loading
-        } else {
-          this.loading = false
-        }
-      }
-    }
-  }
+	// eslint-disable-next-line no-unused-vars
+	import OSSSerivce, {
+		httpRequest,
+		// eslint-disable-next-line no-unused-vars
+		handleRemove,
+		fileName,
+		// eslint-disable-next-line no-unused-vars
+		beforeAvatarUpload,
+		// eslint-disable-next-line no-unused-vars
+		openWindowOnUrl,
+		// eslint-disable-next-line no-unused-vars
+		toHref
+	} from '@/api/sys/OSSService'
+	// import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
+	import moment from 'moment'
+	export default {
+		data () {
+			return {
+				uploadKey: '',
+				progressFlag: false,
+				loadProgress: 0,
+				fileList: [],
+				dataList: [],
+				oldDataList: [],
+				dataListNew: [],
+				url: '',
+				showViewer: false,
+				ossService: null,
+				auth: '',
+				directory: 'public',
+				maxValue: 300,
+				tableKey: '',
+				fileLoading: true,
+				dividerName: '',
+				uploadFlag: false,
+				delFlag: false,
+				createBy: '',
+				showDivider: true,
+				loading: false,
+				dataListLength: '',
+				uploadDelFlag: false
+			}
+		},
+		watch: {
+		},
+		created () {
+			this.ossService = new OSSSerivce()
+		},
+		components: {
+			// ElImageViewer
+		},
+		mounted () {
+			window.onPreview = this.onPreview
+		},
+		methods: {
+			/**
+			 * dividerName: 组件中divider的名称赋值
+			 * showDivider: ‘附件‘Divider是否展示
+			 *     注:值为空时,默认值为true
+			 *    showDivider=false时 ‘附件‘Divider隐藏
+			 **/
+			setDividerName (dividerName, showDivider) {
+				if (this.commonJS.isNotEmpty(dividerName)) {
+					this.dividerName = dividerName
+				}
+				if (this.commonJS.isNotEmpty(showDivider)) {
+					if (showDivider === false) {
+						this.showDivider = false
+					} else {
+						this.showDivider = true
+					}
+				} else {
+					this.showDivider = true
+				}
+			},
+			/**
+			 * 文件上传组件初始化
+			 * @param auth
+			 *    auth的值为"view"时,不可上传/编辑文件
+			 *    auth为其他值时,可上传/编辑文件
+			 * @param fileList  要显示到文件上传列表中的文件。
+			 *    注:文件必须要有url属性并且文件的url属性值必须是在oss中的路径值
+			 *    例:'/attachment-file/xxx/xxx/2022/9/08/xxx.jpg'
+			 * @param directory  要存放到oss的哪个文件夹下。
+			 *    注:值为空时,默认存放到"public"文件夹
+			 * @param maxValue  上传文件允许的最大值,单位:MB
+			 *    注:值为空时,默认值为300MB
+			 * @param dividerName  组件中divider的名称
+			 *    注:值为空时,默认值为‘附件’
+			 * @param uploadFlag  ‘上传文件’按钮是否禁用
+			 *    注:值为空时,默认值为false
+			 *    auth=view&&uploadFlag=false时 ‘上传文件’按钮禁用
+			 * @param delFlag  ‘删除’按钮是否禁用
+			 *    注:值为空时,默认值为false
+			 *    auth=view&&delFlag=false时 ‘删除’按钮禁用
+			 * @param showDivider  ‘附件‘Divider是否展示
+			 *    注:值为空时,默认值为true
+			 *    showDivider=false时 ‘附件‘Divider隐藏
+			 */
+			async newUpload (auth, fileList, directory, maxValue, dividerName, uploadFlag, delFlag, showDivider) {
+				this.uploadKey = Math.random()
+				await this.fileLoadingFalse()
+				if (this.commonJS.isEmpty(fileList)) {
+					fileList = []
+					this.fileLoading = true
+				} else {
+					this.dataListLength = fileList.length
+				}
+				if (this.commonJS.isEmpty(dividerName)) {
+					this.dividerName = '附件'
+				} else {
+					this.dividerName = dividerName
+				}
+				if (directory !== undefined && directory !== null && directory !== '' && directory !== {}) {
+					this.directory = directory
+				} else {
+					this.directory = 'public'
+				}
+				if (maxValue !== undefined && maxValue !== null && maxValue !== '' && maxValue !== 0) {
+					this.maxValue = maxValue
+				} else {
+					this.maxValue = 300
+				}
+				this.auth = auth
+				if (this.commonJS.isEmpty(uploadFlag)) {
+					this.uploadFlag = false
+				} else {
+					if (uploadFlag !== true && uploadFlag !== false) {
+						this.uploadFlag = false
+					} else {
+						this.uploadFlag = uploadFlag
+					}
+				}
+				if (this.commonJS.isEmpty(delFlag)) {
+					this.delFlag = false
+				} else {
+					if (delFlag !== true && delFlag !== false) {
+						this.delFlag = false
+						this.createBy = delFlag
+					} else {
+						this.delFlag = delFlag
+					}
+				}
+				this.oldDataList = []
+				for await (let item of fileList) {
+					await this.ossService.getFileSizeByUrl(item.url).then((data) => {
+						item.lsUrl = data.url
+						item.size = data.size
+						this.dataList.push(item)
+						this.oldDataList.push(item)
+						this.dataListNew.push(item)
+						if (this.dataListNew.length === fileList.length) {
+							this.fileLoading = true
+						}
+					})
+				}
+				// this.dataList = JSON.parse(JSON.stringify(fileList))
+				// this.dataListNew = JSON.parse(JSON.stringify(fileList))
+				if (this.commonJS.isEmpty(showDivider)) {
+					this.showDivider = true
+				} else {
+					if (showDivider === false) {
+						this.showDivider = false
+					} else {
+						this.showDivider = true
+					}
+				}
+			},
+			async httpRequest (file) {
+				await httpRequest(file, fileName(file), this.directory, this.maxValue)
+			},
+			async beforeUpload(file) {
+				console.log("beforeUpload",file)
+				if(this.uploadDelFlag){
+					this.$message.warning('该文件已上传,请勿重复上传');
+					this.uploadKey = Math.random()
+
+					return true; // 取消上传
+				}
+				// 其他判定逻辑...
+				return true; // 允许上传
+			},
+			uploadVideoProcess (event, file, fileList) {
+
+				let parent = this.$parent
+				while (!parent.inputForm) {
+					parent = parent['$parent']
+				}
+				this.progressFlag = true // 显示进度条
+				this.loadProgress = parseInt(event.percent) // 动态获取文件上传进度
+				if (this.loadProgress >= 100) {
+					this.loadProgress = 100
+					setTimeout(() => {
+						this.progressFlag = false
+					}, 1000) // 一秒后关闭进度条
+				}
+			},
+			getSize (value) {
+				if (this.commonJS.isEmpty(value)) {
+					return '0 B'
+				} else {
+					let val = parseInt(value)
+					if (this.commonJS.isEmpty(val)) {
+						return '0 B'
+					}
+					if (isNaN(val)) {
+						return '0 B'
+					}
+					if (val === 0) {
+						return '0 B'
+					}
+					let k = 1024
+					let sizes = ['B', 'KB', 'MB', 'GB', 'PB', 'TB', 'EB', 'ZB', 'YB']
+					let i = Math.floor(Math.log(val) / Math.log(k))
+					let result = val / Math.pow(k, i);
+					let kb = parseFloat(result.toPrecision(3));
+					return kb + '' + sizes[i]
+				}
+			},
+			async changes (file, fileList) {
+
+				this.uploadKey = Math.random()
+				console.log(fileList)
+				this.uploadDelFlag = false;
+				// if (file.status !== 'ready') {
+				//   return
+				// }
+				if (!beforeAvatarUpload(file, fileList, this.maxValue)) {
+					this.$message.error('文件大小不能超过 ' + this.maxValue + ' MB!')
+					return
+				}
+				var verificationFileList = []
+				if(this.oldDataList){
+					for (let item of this.oldDataList) {
+						verificationFileList.push(item)
+					}
+				}
+				for (let item of fileList) {
+					verificationFileList.push(item)
+				}
+				var fileCount = 0;
+				for (let item of verificationFileList) {
+					var fileItem = item;
+					if(item.raw !== undefined && item.raw !== null && item.raw !== {}){
+						fileItem = item.raw;
+					}
+					if(file.raw.name === fileItem.name){
+						fileCount ++
+					}
+				}
+
+
+				if(fileCount>1){
+					this.uploadDelFlag = true;
+					return
+				}
+
+				this.dataListNew = []
+				this.dataList.forEach((item) => {
+					this.dataListNew.push(item)
+				})
+
+				var fileListNames = []
+				for (let fileItem of this.fileList) {
+					fileListNames.push(fileItem.name)
+				}
+				for (let item of fileList) {
+					if(fileListNames.length === 0 || fileListNames.indexOf(item.name) === -1){
+						this.fileList.push(item)
+					}
+					item.createTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+					item.createBy = {
+						id: '',
+						name: ''
+					}
+					item.createBy.id = this.$store.state.user.id
+					item.createBy.name = this.$store.state.user.name
+					this.dataListNew.push(item)
+				}
+				for (let item of this.dataListNew) {
+					if (item.raw !== undefined && item.raw !== null && item.raw !== {}) {
+						item.url = item.raw.url
+						if (item.raw.url !== undefined && item.raw.url !== null && item.raw.url !== {}) {
+							this.ossService.getTemporaryUrl(item.raw.url).then((data) => {
+								item.lsUrl = data
+							})
+						}
+					}
+				}
+			},
+			async success(res, file,fileList) {
+				if(file.url){
+					this.$message.error('文件上传失败,请重新上传!')
+					for (let i = 0; i < this.dataListNew.length; i++) {
+						var fileItem = this.dataListNew[i];
+						if(this.dataListNew[i].raw !== undefined && this.dataListNew[i].raw !== null && this.dataListNew[i].raw !== {}){
+							fileItem = this.dataListNew[i].raw;
+						}
+						if(file.name === fileItem.name){
+							await this.deleteById(file,i)
+						}
+					}
+					for (let i = 0; i < fileList.length; i++) {
+						var fileListItem = fileList[i];
+						if(fileList[i].raw !== undefined && fileList[i].raw !== null && fileList[i].raw !== {}){
+							fileListItem = fileList[i].raw;
+						}
+						if(file.name === fileListItem.name){
+							await this.deleteById(file,i)
+						}
+					}
+				}
+			},
+			showFile (row) {
+				console.log('row', row)
+				openWindowOnUrl(row)
+			},
+			onPreview (url) {
+				this.url = url
+				this.showViewer = true
+			},
+			// 关闭查看器
+			closeViewer () {
+				this.url = ''
+				this.showViewer = false
+			},
+			toHref (row) {
+				toHref(row)
+			},
+			async deleteById (row, index,fileList) {
+				// this.$refs.upload.handleRemove(this.dataListNew[index])
+				await this.dataListNew.splice(index, 1)
+				await this.dataList.splice(index, 1)
+				if (this.commonJS.isNotEmpty(row.id)) {
+					this.ossService.deleteMsgById(row.id)
+				}
+				var newFileList = [];
+				for (var i = 0; i < fileList.length; i++) {
+					if (fileList[i].name !== row.name) {
+						newFileList.push(fileList[i])
+					}
+				}
+				this.fileList = newFileList;
+
+			},
+			async deleteFileById (row, index,fileList) {
+				// this.$refs.upload.handleRemove(this.dataListNew[index])
+				await this.dataListNew.splice(index, 1)
+				await this.dataList.splice(index, 1)
+				if (this.commonJS.isNotEmpty(row.id)) {
+					this.ossService.deleteMsgById(row.id)
+				}
+				var newFileList = [];
+				for (var i = 0; i < fileList.length; i++) {
+					if (fileList[i].name !== row.name) {
+						newFileList.push(fileList[i])
+					}
+				}
+				this.fileList = newFileList;
+
+				let parent = this.$parent
+				while (!parent.inputForm) {
+					parent = parent['$parent']
+				}
+			},
+			async parentDeleteById (row) {
+				console.log('this.dataListNew',this.dataListNew)
+				var index = null;
+				for (var j = 0; j < this.dataListNew.length; j++) {
+					if (this.dataListNew[j].name === row.name) {
+						index = j;
+					}
+				}
+				await this.dataListNew.splice(index, 1)
+				await this.dataList.splice(index, 1)
+				if (this.commonJS.isNotEmpty(row.id)) {
+					this.ossService.deleteMsgById(row.id)
+				}
+				var newFileList = [];
+				for (var i = 0; i < this.fileList.length; i++) {
+					if (this.fileList[i].name !== row.name) {
+						newFileList.push(this.fileList[i])
+					}
+				}
+				this.fileList = newFileList;
+
+				let parent = this.$parent
+				while (!parent.inputForm) {
+					parent = parent['$parent']
+				}
+
+			},
+			async deleteFileinfo (row) {
+				var index = null;
+				for (var j = 0; j < this.dataListNew.length; j++) {
+					if (this.dataListNew[j].name === row.name) {
+						index = j;
+					}
+				}
+				await this.dataListNew.splice(index, 1)
+				await this.dataList.splice(index, 1)
+				var newFileList = [];
+				for (var i = 0; i < this.fileList.length; i++) {
+					if (this.fileList[i].name !== row.name) {
+						newFileList.push(this.fileList[i])
+					}
+				}
+				this.fileList = newFileList;
+			},
+			/**
+			 * 关闭dialog时使用  清除el-upload中上传的文件
+			 */
+			clearUpload () {
+				this.fileList = []//用于清除上传文件的缓存
+				this.$refs.upload.clearFiles()
+				this.dataList = []
+				this.dataListNew = []
+				this.createBy = ''
+			},
+			/**
+			 * 获取当前文件列表中的文件数据
+			 */
+			getDataList () {
+				return this.dataListNew
+			},
+			/**
+			 * 判断进度条是否结束,附件是否加载完成
+			 * @returns {boolean}
+			 */
+			checkProgress () {
+				if (this.progressFlag === true) {
+					this.$message.warning('请等待附件上传完成再进行操作')
+					return true
+				}
+				if (this.fileLoading === false) {
+					this.$message.warning('请等待附件加载完成再进行操作')
+					if (this.dataListLength === this.dataListNew.length) {
+						this.fileLoading = true
+					}
+					return true
+				}
+				return false
+			},
+			ifName (row) {
+				if (this.commonJS.isEmpty(row.name)) {
+					row.name = '---'
+					return false
+				}
+				let suffix = row.name.substring(row.name.lastIndexOf('.') + 1)
+				if (suffix === 'jpg' || suffix === 'png' || suffix === 'gif' || suffix === 'bmp' || suffix === 'jpeg') {
+					return true
+				} else {
+					return false
+				}
+			},
+			fileLoadingFalse () {
+				this.fileLoading = false
+			},
+			// 开启/关闭页面的加载中状态
+			changeLoading (loading) {
+				if (this.commonJS.isNotEmpty(loading)) {
+					this.loading = loading
+				} else {
+					this.loading = false
+				}
+			}
+		}
+	}
 </script>
 <style>
-  .el-divider__text {
-    font-size: 16px;
-    font-weight: bold;
-  }
+	.el-divider__text {
+		font-size: 16px;
+		font-weight: bold;
+	}
 </style>

+ 25 - 0
src/views/common/UpLoadComponentCcpm.vue

@@ -11,6 +11,7 @@
                :show-file-list="false"
                :on-change="changes"
                :on-progress="uploadVideoProcess"
+			   :on-success="success"
                :file-list="fileList">
 		<template v-if="auth==='view'&&uploadFlag===false" #tip>
 			<el-button :loading="loading" type="primary" size="default" :disabled="true"> 点击上传 </el-button>
@@ -292,6 +293,30 @@
         }
         this.tableKey = Math.random()
       },
+
+		async success(res, file,fileList) {
+			if(file.url){
+				this.$message.error('文件上传失败,请重新上传!')
+				for (let i = 0; i < this.dataListNew.length; i++) {
+					var fileItem = this.dataListNew[i];
+					if(this.dataListNew[i].raw !== undefined && this.dataListNew[i].raw !== null && this.dataListNew[i].raw !== {}){
+						fileItem = this.dataListNew[i].raw;
+					}
+					if(file.name === fileItem.name){
+						await this.deleteById(file,i)
+					}
+				}
+				for (let i = 0; i < fileList.length; i++) {
+					var fileListItem = fileList[i];
+					if(fileList[i].raw !== undefined && fileList[i].raw !== null && fileList[i].raw !== {}){
+						fileListItem = fileList[i].raw;
+					}
+					if(file.name === fileListItem.name){
+						await this.deleteById(file,i)
+					}
+				}
+			}
+		},
       showFile (row) {
         openWindowOnUrl(row)
       },

+ 24 - 0
src/views/common/UpLoadComponentV2.1.vue

@@ -11,6 +11,7 @@
                :show-file-list="false"
                :on-change="changes"
                :on-progress="uploadVideoProcess"
+			   :on-success="success"
                :file-list="fileList">
 		<template v-if="auth==='view'&&uploadFlag===false" #tip>
 			<el-button :loading="loading" type="primary" size="default" :disabled="true"> 点击上传 </el-button>
@@ -512,6 +513,29 @@
         }
         this.tableKey = Math.random()
       },
+		async success(res, file,fileList) {
+			if(file.url){
+				this.$message.error('文件上传失败,请重新上传!')
+				for (let i = 0; i < this.dataListNew.length; i++) {
+					var fileItem = this.dataListNew[i];
+					if(this.dataListNew[i].raw !== undefined && this.dataListNew[i].raw !== null && this.dataListNew[i].raw !== {}){
+						fileItem = this.dataListNew[i].raw;
+					}
+					if(file.name === fileItem.name){
+						await this.deleteById(file,i)
+					}
+				}
+				for (let i = 0; i < fileList.length; i++) {
+					var fileListItem = fileList[i];
+					if(fileList[i].raw !== undefined && fileList[i].raw !== null && fileList[i].raw !== {}){
+						fileListItem = fileList[i].raw;
+					}
+					if(file.name === fileListItem.name){
+						await this.deleteById(file,i)
+					}
+				}
+			}
+		},
       showFile (row) {
         openWindowOnUrl(row)
       },

+ 25 - 0
src/views/common/UpLoadComponentV2.vue

@@ -11,6 +11,7 @@
                :show-file-list="false"
                :on-change="changes"
                :on-progress="uploadVideoProcess"
+			   :on-success="success"
                :file-list="fileList">
 		<template v-if="auth==='view'&&uploadFlag===false" #tip>
 			<el-button :loading="loading" type="primary" size="default" :disabled="true"> 点击上传 </el-button>
@@ -479,6 +480,30 @@
         }
         this.tableKey = Math.random()
       },
+
+		async success(res, file,fileList) {
+			if(file.url){
+				this.$message.error('文件上传失败,请重新上传!')
+				for (let i = 0; i < this.dataListNew.length; i++) {
+					var fileItem = this.dataListNew[i];
+					if(this.dataListNew[i].raw !== undefined && this.dataListNew[i].raw !== null && this.dataListNew[i].raw !== {}){
+						fileItem = this.dataListNew[i].raw;
+					}
+					if(file.name === fileItem.name){
+						await this.deleteById(file,i)
+					}
+				}
+				for (let i = 0; i < fileList.length; i++) {
+					var fileListItem = fileList[i];
+					if(fileList[i].raw !== undefined && fileList[i].raw !== null && fileList[i].raw !== {}){
+						fileListItem = fileList[i].raw;
+					}
+					if(file.name === fileListItem.name){
+						await this.deleteById(file,i)
+					}
+				}
+			}
+		},
       showFile (row) {
         openWindowOnUrl(row)
       },

+ 25 - 0
src/views/common/UpLoadComponentV3.1.vue

@@ -11,6 +11,7 @@
                :show-file-list="false"
                :on-change="changes"
                :on-progress="uploadVideoProcess"
+			   :on-success="success"
                :file-list="fileList">
 		<template v-if="auth==='view'&&uploadFlag===false" #tip>
 			<el-button :loading="loading" type="primary" size="default" :disabled="true"> 点击上传 </el-button>
@@ -411,6 +412,30 @@
         this.tableKey = Math.random()
 		  this.uploadKey = Math.random()
       },
+
+		async success(res, file,fileList) {
+			if(file.url){
+				this.$message.error('文件上传失败,请重新上传!')
+				for (let i = 0; i < this.dataListNew.length; i++) {
+					var fileItem = this.dataListNew[i];
+					if(this.dataListNew[i].raw !== undefined && this.dataListNew[i].raw !== null && this.dataListNew[i].raw !== {}){
+						fileItem = this.dataListNew[i].raw;
+					}
+					if(file.name === fileItem.name){
+						await this.deleteById(file,i)
+					}
+				}
+				for (let i = 0; i < fileList.length; i++) {
+					var fileListItem = fileList[i];
+					if(fileList[i].raw !== undefined && fileList[i].raw !== null && fileList[i].raw !== {}){
+						fileListItem = fileList[i].raw;
+					}
+					if(file.name === fileListItem.name){
+						await this.deleteById(file,i)
+					}
+				}
+			}
+		},
       showFile (row) {
         openWindowOnUrl(row)
       },

+ 25 - 0
src/views/common/UpLoadComponentV3.vue

@@ -11,6 +11,7 @@
                :show-file-list="false"
                :on-change="changes"
                :on-progress="uploadVideoProcess"
+			   :on-success="success"
                :file-list="fileList">
 		<template v-if="auth==='view'&&uploadFlag===false" #tip>
 			<el-button :loading="loading" type="primary" size="default" :disabled="true"> 点击上传 </el-button>
@@ -404,6 +405,30 @@
         }
         this.tableKey = Math.random()
       },
+
+		async success(res, file,fileList) {
+			if(file.url){
+				this.$message.error('文件上传失败,请重新上传!')
+				for (let i = 0; i < this.dataListNew.length; i++) {
+					var fileItem = this.dataListNew[i];
+					if(this.dataListNew[i].raw !== undefined && this.dataListNew[i].raw !== null && this.dataListNew[i].raw !== {}){
+						fileItem = this.dataListNew[i].raw;
+					}
+					if(file.name === fileItem.name){
+						await this.deleteById(file,i)
+					}
+				}
+				for (let i = 0; i < fileList.length; i++) {
+					var fileListItem = fileList[i];
+					if(fileList[i].raw !== undefined && fileList[i].raw !== null && fileList[i].raw !== {}){
+						fileListItem = fileList[i].raw;
+					}
+					if(file.name === fileListItem.name){
+						await this.deleteById(file,i)
+					}
+				}
+			}
+		},
       showFile (row) {
         openWindowOnUrl(row)
       },

+ 16 - 22
src/views/jy/project/ProjectForm.vue

@@ -30,22 +30,10 @@
 						</el-form-item>
 					</el-col>
 					<el-col :span="12">
-						<el-form-item label="合同金额(元)" prop="amount"
+						<el-form-item label="合同编号" prop="contractNo"
 									  :rules="[
                  ]">
-							<!--              <el-input v-model="inputForm.amount" placeholder="请填写合同金额"></el-input>-->
-							<el-input-number
-								:disabled="true"
-								v-model="inputForm.amount"
-								controls-position="right"
-								:controls="false"
-								style="width:100%;"
-								:precision="2"
-								placeholder="请填写合同金额"
-								:step="0.01"
-								:min="0"
-								clearable>
-							</el-input-number>
+							              <el-input :disabled="true" v-model="inputForm.contractNo" placeholder="请填写合同编号"></el-input>
 						</el-form-item>
 					</el-col>
 					<el-col :span="12">
@@ -338,7 +326,7 @@
 					contractName: '', // 合同名称
 					client: '', // 委托方
 					primaryLinkman: '', // 委托方名称
-					amount: '', // 合同金额
+					contractNo: '', // 合同金额
 					contractType: '', // 合同类别
 					name: '', // 项目名称
 					projectPlace: '', // 项目所在地
@@ -355,7 +343,7 @@
 					createDate: this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), //创建时间
 					projectOverview:'', //工程概况
 					special:'', //特殊要求
-					projectLeader:'', //项目负责人
+					projectLeader:this.$store.state.user.id, //项目负责人
 					clientList:[], //委托方联系人
 					files: [], // 附件信息
 				},
@@ -449,7 +437,7 @@
 					contractName: '', // 合同名称
 					client: '', // 委托方
 					primaryLinkman: '', // 委托方名称
-					amount: '', // 合同金额
+					contractNo: '', // 合同金额
 					contractType: '', // 合同类别
 					name: '', // 项目名称
 					projectPlace: '', // 项目所在地
@@ -466,7 +454,7 @@
 					createDate: this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), //创建时间
 					projectOverview:'', //工程概况
 					special:'', //特殊要求
-					projectLeader:'', //项目负责人
+					projectLeader:this.$store.state.user.id, //项目负责人
 					clientList:[], //委托方联系人
 					files: [], // 附件信息
 					formReadOnly:''
@@ -480,6 +468,7 @@
 				} else if (method === 'view') {
 					this.title = '查看项目详情'
 				}
+				console.log("进入init方法")
 				this.loading = false
 				this.$nextTick(() => {
 					this.$refs.inputForm.resetFields()
@@ -490,12 +479,17 @@
 						this.projectInfoService.findById(this.inputForm.id).then((data) => {
 							console.log(data)
 							this.inputForm = this.recover(this.inputForm, data)
+							if(data.projectLeader){
+								this.inputForm.projectLeader = data.projectLeader
+							}else{
+								this.inputForm.projectLeader = this.$store.state.user.id
+							}
 							this.inputForm.members=data.projectMembers
 							this.inputForm.clientList=data.clientList
 							this.inputForm.createByName=data.createById
 							this.inputForm.createDate=data.createTime
 							this.inputForm.members=data.projectMembers
-							this.inputForm.amount=data.contractAmount
+							this.inputForm.contractNo=data.no
 							if (this.commonJS.isEmpty(this.inputForm.members)) {
 								this.inputForm.cwProjectMembersDTOList = []
 							} else {
@@ -566,7 +560,7 @@
 					this.inputForm.contractId = row.id // 合同id
 					this.inputForm.contractName = row.name // 合同名称
 					this.inputForm.primaryLinkman = row.primaryLinkman // 委托方名称
-					this.inputForm.amount = row.contractAmount // 合同金额
+					this.inputForm.contractNo = row.no // 合同金额
 					this.inputForm.contractType = row.contractType // 合同类型(小类)
 					this.inputForm.contractTypeFirst = row.contractTypeFirst // 合同类型(大类)
 					const wait = function () {
@@ -834,7 +828,7 @@
 					contractName: '', // 合同名称
 					client: '', // 委托方
 					clientName: '', // 委托方名称
-					amount: '', // 合同金额
+					contractNo: '', // 合同金额
 					contractType: '', // 合同类别
 					name: '', // 项目名称
 					projectPlace: '', // 项目所在地
@@ -885,7 +879,7 @@
 					this.inputForm.contractId = ''
 					this.inputForm.contractName = ''
 					this.inputForm.clientName = ''
-					this.inputForm.amount = ''
+					this.inputForm.contractNo = ''
 					this.inputForm.contractType = ''
 					this.inputForm.contractTypeFirst = ''
 					this.inputForm.clientList=[]

+ 3 - 3
src/views/jy/workClientInfo/WorkClientList.vue

@@ -157,14 +157,14 @@
 					</template>
 				</vxe-column>
                 <vxe-column min-width="150px" title="统一社会信用代码" field="uscCode" align="center"> </vxe-column>
-                <vxe-column min-width="80px" title="创建人" field="createById" align="center"> </vxe-column>
+                <vxe-column min-width="80px" title="创建人" field="createByName" align="center"> </vxe-column>
                 <vxe-column min-width="100px" title="创建时间" field="createTime" align="center" fixed="right"> </vxe-column>
 
                 <vxe-column title="操作" width="120px" fixed="right" align="center">
                     <template  #default="scope">
 <!--                      <el-button v-if="hasPermission('sys:work_client:view')" text type="primary" icon="el-icon-view" @click="view(scope.row.id)">查看</el-button>-->
-                      <el-button v-if="hasPermission('jy_work_client:info:edit') " text type="primary"   @click="edit(scope.row.id)">修改</el-button>
-                      <el-button v-if="hasPermission('jy_work_client:info:edit') " text type="primary"    @click="del(scope.row.id)">删除</el-button>
+                      <el-button v-if="(hasPermission('jy_work_client:info:edit')&&scope.row.createById === $store.state.user.id) || hasPermission('jy_work_client:info:leaderEdit')" text type="primary"   @click="edit(scope.row.id)">修改</el-button>
+                      <el-button v-if="(hasPermission('jy_work_client:info:edit')&&scope.row.createById === $store.state.user.id) || hasPermission('jy_work_client:info:leaderEdit')" text type="primary"    @click="del(scope.row.id)">删除</el-button>
                     </template>
                 </vxe-column>
             </vxe-table>

+ 352 - 249
src/views/jy/workContractInfo/ContractAddForm.vue

@@ -5,280 +5,348 @@
       :close-on-click-modal="false"
 	  draggable
       :append-to-body="true"
-      width="1200px"
+      width="1500px"
       height="500px"
       @close="close"
       v-model="visible">
-    <el-form size="default" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="status === 'audit' || status === 'taskFormDetail'|| method==='view'"
-             label-width="150px">
-
-      <el-divider v-if="(status === 'audit' || status === 'taskFormDetail'|| method==='view') && commonJS.isNotEmpty(inputForm.customerId)" content-position="left">
-        <el-link  type="primary" :underline="false" icon="el-icon-document" @click="viewClient(inputForm.customerId)"><b>查看客户详情</b></el-link>
-      </el-divider>
-      <el-divider  content-position="left"><i class="el-icon-document"></i> 客户信息</el-divider>
-      <el-row  :gutter="0">
-        <el-col :span="12">
-          <el-form-item label="主委托方" prop="primaryLinkman"
-                        :rules="[
-                           {required: true, message: '请选择委托方', trigger: 'change'}
-                 ]">
-            <el-input :readonly="true" maxlength="100" @focus="openWorkClient2()" v-model="inputForm.primaryLinkman" placeholder="请选择委托方">
-<!--              <el-button slot="append" icon="el-icon-search" @click="openWorkClient2()"></el-button>-->
-            </el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="客户编号" prop="customerNo"
-                        :rules="[
-                   ]">
-            <el-input :disabled="true" v-model="inputForm.customerNo" placeholder="请填写客户编号" clearable></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="统一社会信用代码" prop="uscCode"
-                        :rules="[
-                   ]">
-            <el-input :disabled="true" v-model="inputForm.uscCode" placeholder="请填写统一社会信用代码" clearable></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="地址" prop="address"
-                        :rules="[
-                   ]">
-            <el-input :disabled="true" v-model="inputForm.address" placeholder="地址" clearable></el-input>
-          </el-form-item>
-        </el-col>
-      </el-row>
-      <el-divider content-position="left"><i class="el-icon-document"></i> 基本信息</el-divider>
-      <el-row  :gutter="0">
-        <el-col :span="12">
-          <el-form-item label="合同名称" prop="contractName"
-                        :rules="[{required: true, message: '合同名称不能为空', trigger: 'blur'}
-                 ]">
-            <el-input v-model="inputForm.contractName"  placeholder="请输入合同名称"     clearable></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="合同编号" prop="contractNo">
-            <el-input maxlength="64" :readonly="true" v-model="inputForm.contractNo" placeholder="自动生成"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="合同类型" prop="contractTypes"
-                        :rules="[{required: true, message: '合同类型不能为空', trigger: 'blur'}
-                 ]" >
-			  <el-cascader style="width: 100%" v-model="inputForm.contractTypes" :options="typeData" @change="handleChange"  clearable  :props="{
-			value: 'value',
-			label: 'label', // 显示名称
-			children: 'children', // 子级字段名
-			multiple: true
-		}"
-			  />
-
-          </el-form-item>
-        </el-col>
-
-        <el-col :span="12">
-          <el-form-item label="签订日期" prop="contractDate"
-                        :rules="[
-                {required: true, message:'请输入签约日期', trigger:'blur'}
-               ]">
-            <el-date-picker
-              placement="bottom-start"
-              value-format="YYYY-MM-DD"
-              v-model="inputForm.contractDate"
-              style="width: 100%"
-              placeholder="选择日期">
-            </el-date-picker>
-          </el-form-item>
-        </el-col>
-		  <el-col :span="12">
-			  <el-form-item label="合同生效日期" prop="effectiveDate">
-				  <el-date-picker
-					  v-model="inputForm.effectiveDate"
-					  value-format="YYYY-MM-DD"
-					  style="width: 418px"
-					  placeholder="选择日期">
-				  </el-date-picker>
+	<el-tabs v-model="activeNameTop" type="border-card" @tab-click="tabHandleClickTop">
+		<el-tab-pane label="合同信息" name="contract">
+		<el-form size="default" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="status === 'audit' || status === 'taskFormDetail'|| method==='view'"
+				 label-width="150px">
+
+		  <el-divider v-if="(status === 'audit' || status === 'taskFormDetail'|| method==='view') && commonJS.isNotEmpty(inputForm.customerId)" content-position="left">
+			<el-link  type="primary" :underline="false" icon="el-icon-document" @click="viewClient(inputForm.customerId)"><b>查看客户详情</b></el-link>
+		  </el-divider>
+		  <el-divider  content-position="left"><i class="el-icon-document"></i> 客户信息</el-divider>
+		  <el-row  :gutter="0">
+			<el-col :span="12">
+			  <el-form-item label="主委托方" prop="primaryLinkman"
+							:rules="[
+							   {required: true, message: '请选择委托方', trigger: 'change'}
+					 ]">
+				<el-input :readonly="true" maxlength="100" @focus="openWorkClient2()" v-model="inputForm.primaryLinkman" placeholder="请选择委托方">
+	<!--              <el-button slot="append" icon="el-icon-search" @click="openWorkClient2()"></el-button>-->
+				</el-input>
 			  </el-form-item>
-		  </el-col>
-
-		  <el-col :span="12">
-			  <el-form-item label="合同终止日期" prop="closingDate">
-				  <el-date-picker
-					  @change="checkData"
-					  value-format="YYYY-MM-DD"
-					  v-model="inputForm.closingDate"
-					  style="width: 418px"
-					  placeholder="选择日期">
-				  </el-date-picker>
+			</el-col>
+			<el-col :span="12">
+			  <el-form-item label="客户编号" prop="customerNo"
+							:rules="[
+					   ]">
+				<el-input :disabled="true" v-model="inputForm.customerNo" placeholder="请填写客户编号" clearable></el-input>
 			  </el-form-item>
-		  </el-col>
-
-
-        <el-col :span="12">
-          <el-form-item label="对方合同编号" prop="contractOpposite">
-            <el-input maxlength="64" v-model="inputForm.contractOpposite" placeholder="请填写对方合同编号"></el-input>
-          </el-form-item>
-        </el-col>
-
-
-        <el-col :span="12">
-          <el-form-item  prop="department" label="所属部门"
-						 :rules="[
-                {required: true, message:'请选择所属部门', trigger:'blur'}
-               ]">
-			  <SelectTree
-				  ref="officeTree"
-				  :props="{
-                  value: 'id',             // ID字段名
-                  label: 'name',         // 显示名称
-                  children: 'children'    // 子级字段名
-                }"
-
-				  :url="`/system-server/sys/office/treeData?type=2`"
-				  :value="inputForm.department"
-				  :accordion="true"
-				  size="default"
-				  @getValue="(value) => {inputForm.department=value}"/>
-<!--			  <el-input v-else-if="method==='view'" maxlength="64" :readonly="true" v-model="inputForm.department" placeholder="请填写所属部门"></el-input>-->
-		  </el-form-item>
-        </el-col>
-
-
-        <el-col :span="12">
-          <el-form-item label="创建时间" prop="createTime">
-            <el-date-picker
-              placement="bottom-start"
-              value-format="YYYY-MM-DD"
-              v-model="inputForm.createTime"
-              style="width: 100%"
-              :disabled="true"
-              placeholder="选择日期">
-            </el-date-picker>
-          </el-form-item>
-        </el-col>
-
-
-        <el-col :span="12">
-          <el-form-item label="合同金额(元)" prop="contractAmount"
-                        :rules="[
-                  {required: true, message:'请输入合同金额(元)', trigger:'blur'}
-               ]">
-            <el-input maxlength="15" v-model="inputForm.contractAmount" placeholder="请输入合同金额(元)"
-                      @keyup.native="inputForm.contractAmount = twoDecimalPlaces(inputForm.contractAmount)"
-            ></el-input>
-          </el-form-item>
-        </el-col>
-
-		  <el-col :span="12" >
-			  <el-form-item label="归档盒号" prop="filedNo"
+			</el-col>
+			<el-col :span="12">
+			  <el-form-item label="统一社会信用代码" prop="uscCode"
 							:rules="[
-											  {required: true, message:'请输入归档盒号', trigger:'blur'}
-										   ]">
-				  <el-input :disabled="false" :readonly="false" maxlength="15" v-model="inputForm.filedNo"  placeholder="请输入归档盒号"></el-input>
+					   ]">
+				<el-input :disabled="true" v-model="inputForm.uscCode" placeholder="请填写统一社会信用代码" clearable></el-input>
 			  </el-form-item>
-		  </el-col>
-		  <el-col>
-			  <el-form-item label="付款摘要" prop="paymentDescribe"
+			</el-col>
+			<el-col :span="12">
+			  <el-form-item label="地址" prop="address"
 							:rules="[
-							 {required: true, message:'请输入付款摘要', trigger:'blur'}
-               ]">
-				  <el-input type="textarea" v-model="inputForm.paymentDescribe" placeholder="根据实际付款方式进行填写"
-				  ></el-input>
+					   ]">
+				<el-input :disabled="true" v-model="inputForm.address" placeholder="地址" clearable></el-input>
+			  </el-form-item>
+			</el-col>
+		  </el-row>
+		  <el-divider content-position="left"><i class="el-icon-document"></i> 基本信息</el-divider>
+		  <el-row  :gutter="0">
+			<el-col :span="12">
+			  <el-form-item label="合同名称" prop="contractName"
+							:rules="[{required: true, message: '合同名称不能为空', trigger: 'blur'}
+					 ]">
+				<el-input v-model="inputForm.contractName"  placeholder="请输入合同名称"     clearable></el-input>
+			  </el-form-item>
+			</el-col>
+			<el-col :span="12">
+			  <el-form-item label="合同编号" prop="contractNo">
+				<el-input maxlength="64" :readonly="true" v-model="inputForm.contractNo" placeholder="自动生成"></el-input>
 			  </el-form-item>
-		  </el-col>
+			</el-col>
+			<el-col :span="12">
+			  <el-form-item label="合同类型" prop="contractTypes"
+							:rules="[{required: true, message: '合同类型不能为空', trigger: 'blur'}
+					 ]" >
+				  <el-cascader style="width: 100%" v-model="inputForm.contractTypes" :options="typeData" @change="handleChange"  clearable  :props="{
+				value: 'value',
+				label: 'label', // 显示名称
+				children: 'children', // 子级字段名
+				multiple: true
+			}"
+				  />
+
+			  </el-form-item>
+			</el-col>
+
+
+			  <el-col :span="12">
 
-		  <el-col>
-			  <el-form-item label="合同特别条款" prop="contractSpecial"
+				  <el-form-item label="合同签订类型" prop="contractSignedType"
+								:rules="[
+							  {required: true, message:'请选择合同签订类型', trigger:'blur'}
+							 ]">
+					  <el-radio-group v-model="inputForm.contractSignedType">
+						  <el-radio :disabled="method === 'view'" v-for="item in $dictUtils.getDictList('contract_signed_type')" :label="item.value" >{{item.label}}</el-radio>
+					  </el-radio-group>
+				  </el-form-item>
+			  </el-col>
+
+			<el-col :span="12">
+			  <el-form-item label="签订日期" prop="contractDate"
 							:rules="[
-               ]">
-				  <el-input type="textarea" v-model="inputForm.contractSpecial" placeholder="请输入合同特别条款"
-				  ></el-input>
+					{required: true, message:'请输入签约日期', trigger:'blur'}
+				   ]">
+				<el-date-picker
+				  placement="bottom-start"
+				  value-format="YYYY-MM-DD"
+				  v-model="inputForm.contractDate"
+				  style="width: 100%"
+				  placeholder="选择日期">
+				</el-date-picker>
+			  </el-form-item>
+			</el-col>
+			  <el-col :span="12">
+				  <el-form-item label="合同生效日期" prop="effectiveDate">
+					  <el-date-picker
+						  v-model="inputForm.effectiveDate"
+						  value-format="YYYY-MM-DD"
+						  style="width: 100%"
+						  placeholder="选择日期">
+					  </el-date-picker>
+				  </el-form-item>
+			  </el-col>
+
+			  <el-col :span="12">
+				  <el-form-item label="合同终止日期" prop="closingDate">
+					  <el-date-picker
+						  @change="checkData"
+						  value-format="YYYY-MM-DD"
+						  v-model="inputForm.closingDate"
+						  style="width: 100%"
+						  placeholder="选择日期">
+					  </el-date-picker>
+				  </el-form-item>
+			  </el-col>
+
+
+			<el-col :span="12">
+			  <el-form-item label="对方合同编号" prop="contractOpposite">
+				<el-input maxlength="64" v-model="inputForm.contractOpposite" placeholder="请填写对方合同编号"></el-input>
+			  </el-form-item>
+			</el-col>
+
+
+			<el-col :span="12">
+			  <el-form-item  prop="department" label="所属部门"
+							 :rules="[
+					{required: true, message:'请选择所属部门', trigger:'blur'}
+				   ]">
+				  <SelectTree
+					  ref="officeTree"
+					  :props="{
+					  value: 'id',             // ID字段名
+					  label: 'name',         // 显示名称
+					  children: 'children'    // 子级字段名
+					}"
+
+					  :url="`/system-server/sys/office/treeData?type=2`"
+					  :value="inputForm.department"
+					  :accordion="true"
+					  size="default"
+					  @getValue="(value) => {inputForm.department=value}"/>
+	<!--			  <el-input v-else-if="method==='view'" maxlength="64" :readonly="true" v-model="inputForm.department" placeholder="请填写所属部门"></el-input>-->
 			  </el-form-item>
-		  </el-col>
+			</el-col>
 
-		  <el-col>
-			  <el-form-item label="备注" prop="remarks"
+
+			<el-col :span="12">
+			  <el-form-item label="创建时间" prop="createTime">
+				<el-date-picker
+				  placement="bottom-start"
+				  value-format="YYYY-MM-DD"
+				  v-model="inputForm.createTime"
+				  style="width: 100%"
+				  :disabled="true"
+				  placeholder="选择日期">
+				</el-date-picker>
+			  </el-form-item>
+			</el-col>
+
+
+			<el-col :span="12">
+			  <el-form-item label="合同金额(元)" prop="contractAmount"
 							:rules="[
-               ]">
-				  <el-input type="textarea" v-model="inputForm.remarks" placeholder="请输入备注"
-				  ></el-input>
+					  {required: true, message:'请输入合同金额(元)', trigger:'blur'}
+				   ]">
+				<el-input maxlength="15" v-model="inputForm.contractAmount" placeholder="请输入合同金额(元)"
+						  @keyup.native="inputForm.contractAmount = twoDecimalPlaces(inputForm.contractAmount)"
+				></el-input>
 			  </el-form-item>
-		  </el-col>
-      </el-row>
+			</el-col>
+
+			  <el-col :span="12" >
+				  <el-form-item label="归档盒号" prop="filedNo"
+								:rules="[
+												  {required: true, message:'请输入归档盒号', trigger:'blur'}
+											   ]">
+					  <el-input :disabled="false" :readonly="false" maxlength="15" v-model="inputForm.filedNo"  placeholder="请输入归档盒号"></el-input>
+				  </el-form-item>
+			  </el-col>
+			  <el-col>
+				  <el-form-item label="付款摘要" prop="paymentDescribe"
+								:rules="[
+								 {required: true, message:'请输入付款摘要', trigger:'blur'}
+				   ]">
+					  <el-input type="textarea" v-model="inputForm.paymentDescribe" placeholder="根据实际付款方式进行填写"
+					  ></el-input>
+				  </el-form-item>
+			  </el-col>
 
-		<el-tabs v-model="activeName" type="border-card">
-			<el-tab-pane name="contactParty">
+			  <el-col>
+				  <el-form-item label="合同特别条款" prop="contractSpecial"
+								:rules="[
+				   ]">
+					  <el-input type="textarea" v-model="inputForm.contractSpecial" placeholder="请输入合同特别条款"
+					  ></el-input>
+				  </el-form-item>
+			  </el-col>
+
+			  <el-col>
+				  <el-form-item label="备注" prop="remarks"
+								:rules="[
+				   ]">
+					  <el-input type="textarea" v-model="inputForm.remarks" placeholder="请输入备注"
+					  ></el-input>
+				  </el-form-item>
+			  </el-col>
+		  </el-row>
+
+			<el-tabs v-model="activeName" type="border-card">
+				<el-tab-pane name="contactParty">
+					<template v-slot:label>
+						<span><span style="color: red;border-top: 20px">*</span> 委托方列表</span>
+					</template>
+					<el-row :gutter="15">
+						<el-button type="primary" style="margin-bottom: 15px" size="small" :disabled="status === 'audit' || status === 'taskFormDetail'|| method==='view'" @click="openWorkClient">
+							新增委托方
+						</el-button>
+					</el-row>
+					<el-row :gutter="15">
+						<el-form style="width: 100%;">
+							<vxe-table
+								border
+								show-overflow
+								show-footer
+								:column-config="{resizable: true}"
+								ref="contactTable"
+								:key="tableKeyClient"
+								class="vxe-table-element"
+								:data="inputForm.cwWorkClientContactDTOList"
+								style=""
+								highlight-current-row
+								:edit-config="{trigger: 'click', mode: 'row', showStatus: false, autoClear: false}"
+							>
+								<vxe-table-column align="center" field="number" title="客户编号" :edit-render="{}">
+									<template v-slot:edit="scope">
+										<el-input :readonly="true" v-model="scope.row.number" placeholder="客户编号" clearable></el-input>
+									</template>
+								</vxe-table-column>
+								<vxe-table-column align="center" field="name" title="客户名称" :edit-render="{}">
+									<template v-slot:edit="scope">
+										<el-input :readonly="true" v-model="scope.row.name" placeholder="客户名称" clearable></el-input>
+									</template>
+								</vxe-table-column>
+								<vxe-table-column align="center" title="操作" width="220px">
+									<template v-slot="scope">
+										<el-button size="small" :disabled="status === 'audit' || status === 'taskFormDetail'|| method==='view'" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'client')">删除</el-button>
+									</template>
+								</vxe-table-column>
+							</vxe-table>
+						</el-form>
+					</el-row>
+				</el-tab-pane>
+			</el-tabs>
+
+		  <el-tabs v-model="activeName1" type="border-card">
+			<el-tab-pane name="contractProper">
 				<template v-slot:label>
-					<span><span style="color: red;border-top: 20px">*</span> 委托方列表</span>
+					<span><span style="color: red;border-top: 20px">*</span> 合同附件信息</span>
 				</template>
-				<el-row :gutter="15">
-					<el-button type="primary" style="margin-bottom: 15px" size="small" :disabled="status === 'audit' || status === 'taskFormDetail'|| method==='view'" @click="openWorkClient">
-						新增委托方
-					</el-button>
-				</el-row>
-				<el-row :gutter="15">
-					<el-form style="width: 100%;">
-						<vxe-table
-							border
-							show-overflow
-							show-footer
-							:column-config="{resizable: true}"
-							ref="contactTable"
-							:key="tableKeyClient"
-							class="vxe-table-element"
-							:data="inputForm.cwWorkClientContactDTOList"
-							style=""
-							highlight-current-row
-							:edit-config="{trigger: 'click', mode: 'row', showStatus: false, autoClear: false}"
-						>
-							<vxe-table-column align="center" field="number" title="客户编号" :edit-render="{}">
-								<template v-slot:edit="scope">
-									<el-input :readonly="true" v-model="scope.row.number" placeholder="客户编号" clearable></el-input>
-								</template>
-							</vxe-table-column>
-							<vxe-table-column align="center" field="name" title="客户名称" :edit-render="{}">
-								<template v-slot:edit="scope">
-									<el-input :readonly="true" v-model="scope.row.name" placeholder="客户名称" clearable></el-input>
-								</template>
-							</vxe-table-column>
-							<vxe-table-column align="center" title="操作" width="220px">
-								<template v-slot="scope">
-									<el-button size="small" :disabled="status === 'audit' || status === 'taskFormDetail'|| method==='view'" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'client')">删除</el-button>
-								</template>
-							</vxe-table-column>
-						</vxe-table>
-					</el-form>
-				</el-row>
+			  <!--        合同文件-->
+			  <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
 			</el-tab-pane>
-		</el-tabs>
-
-      <el-tabs v-model="activeName1" type="border-card">
-        <el-tab-pane name="contractProper">
-			<template v-slot:label>
-				<span><span style="color: red;border-top: 20px">*</span> 合同附件信息</span>
-			</template>
-          <!--        合同文件-->
-          <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
-        </el-tab-pane>
-      </el-tabs>
-
-    </el-form>
-    <el-image-viewer
-      v-if="showViewer"
-      :on-close="closeViewer"
-      :url-list="[url]"
-      zIndex="9999"/>
-    <WorkClientChooseForm ref="workClientChooseForm" @getWorkClientChoose="getWorkClientChoose"></WorkClientChooseForm>
-    <WorkClientChooseRadio ref="workClientChooseRadio" @getWorkClientRadioChoose="getWorkClientChoose2"></WorkClientChooseRadio>
-    <WorkClientForm ref="workClientForm"></WorkClientForm>
+		  </el-tabs>
+
+		</el-form>
+		<el-image-viewer
+		  v-if="showViewer"
+		  :on-close="closeViewer"
+		  :url-list="[url]"
+		  zIndex="9999"/>
+		<WorkClientChooseForm ref="workClientChooseForm" @getWorkClientChoose="getWorkClientChoose"></WorkClientChooseForm>
+		<WorkClientChooseRadio ref="workClientChooseRadio" @getWorkClientRadioChoose="getWorkClientChoose2"></WorkClientChooseRadio>
+		<WorkClientForm ref="workClientForm"></WorkClientForm>
+
+		</el-tab-pane>
+
+		<el-tab-pane label="关联项目" name="project">
+			<el-form :inline="true" class="query-form" style="margin-bottom: 0;padding-top: 2px;padding-left: 0" ref="projectForm" :model="projectForm" @keyup.enter.native="searchProject()" @submit.native.prevent>
+				<!-- 搜索框-->
+				<el-form-item label="项目名称" prop="name">
+					<el-input v-model="projectForm.name" placeholder="请输入项目名称" clearable></el-input>
+				</el-form-item>
+				<el-form-item label="项目编号" prop="no">
+					<el-input v-model="projectForm.no" placeholder="请输入项目编号" clearable></el-input>
+				</el-form-item>
+
+				<el-form-item>
+					<el-button type="primary" @click="searchProject()"  icon="el-icon-search">查询</el-button>
+					<el-button @click="refreshProjectForm()" icon="el-icon-refresh-right">重置</el-button>
+				</el-form-item>
+			</el-form>
+			<vxe-table
+				max-height="500"
+				border="inner"
+				auto-resize
+				resizable
+				height="auto"
+				:loading="loading"
+				ref="projectTable"
+				show-header-overflow
+				show-overflow
+				highlight-hover-row
+				:menu-config="{}"
+				:sort-config="{remote:true}"
+				:data="projectList"
+				:checkbox-config="{}">
+				<vxe-column type="seq" width="60" title="序号"></vxe-column>
+				<vxe-column min-width="230" align="center" title="项目名称" field="name" >
+					<template #default="scope">
+						<el-link  type="primary" :underline="false" v-if="hasPermission('jy_project:info:view')" @click="viewProject(scope.row)">{{scope.row.name}}</el-link>
+						<el-link  type="primary" :underline="false" v-else-if="hasPermission('jy_project:info:view')" @click="viewProject(scope.row)">{{scope.row.name}}</el-link>
+						<span v-else>{{scope.row.name}}</span>
+					</template>
+				</vxe-column>
+				<vxe-column min-width="160" align="center" title="项目编号" field="no" show-overflow="title"></vxe-column>
+				<vxe-column min-width="160" align="center" title="负责人" field="projectLeader" show-overflow="title"></vxe-column>
+				<vxe-column min-width="160" align="center" title="创建人" field="createBy" show-overflow="title"></vxe-column>
+				<vxe-column min-width="160" align="center" title="创建时间" field="createTime" show-overflow="title"></vxe-column>
+				<vxe-column min-width="160" align="center" title="当前项目进度" field="process" show-overflow="title"></vxe-column>
+				<vxe-column min-width="160" align="center" title="进度完成时间" field="processTime" show-overflow="title"></vxe-column>
+			</vxe-table>
+		</el-tab-pane>
+	</el-tabs>
+	<!--<el-tab-pane label="关联项目" name="project">-->
+
 		<template #footer>
 			<span class="dialog-footer">
 				<el-button @click="close()" icon="el-icon-circle-close">关闭</el-button>
       			<el-button v-if="method !== 'view'" type="primary" icon="el-icon-circle-check" @click="doSubmit()">确定</el-button>
 			</span>
 		</template>
+		<ProjectDia  ref="projectDia" @refreshDataList="refreshList"></ProjectDia>
     </el-dialog>
   </div>
 </template>
@@ -292,6 +360,8 @@
   import WorkClientChooseRadio from '../workClientInfo/WorkClientChooseRadio'
   import WorkClientService from '@/api/jy/WorkClientService'
   import dictService from "@/api/sys/dictService";
+  import ProjectInfoService from "@/api/jy/ProjectInfoService";
+  import ProjectDia from '@/views/jy/project/ProjectDia'
   import OSSSerive, {
     httpRequest,
     toHref,
@@ -380,13 +450,19 @@
 			primaryLinkman:'',
 			contractSpecial: '',
 			remarks: '',
+			contractSignedType:'',
 			contractDate:'',
 			effectiveDate: '',
 			closingDate: '',
 			contractTypeFirst:''
         },
+		  activeNameTop: 'contract',
         activeName1: 'contractProper',
 		  activeName:'contactParty',
+		  projectForm: {
+			  name: '',
+			  no: ''
+		  },
         filesArra2: [],
         fileList: [],
         isFlag: true,
@@ -423,6 +499,7 @@
 	  },
     components: {
       // ElImageViewer,
+		ProjectDia,
       UpLoadComponent,
       SelectTree,
       WorkClientForm,
@@ -431,10 +508,12 @@
     },
     ossService: null,
 	  contractService:null,
+	  ProjectInfoService:null,
     created () {
       this.ossService = new OSSSerive()
 		this.contractService=new WorkContractService()
 		this.workClientService = new WorkClientService()
+		this.projectInfoService=new ProjectInfoService()
     },
     mounted () {
       window.onPreview = this.onPreview
@@ -495,6 +574,7 @@
         this.dataList = []
         this.dataListNew = []
         this.method = method
+		  this.activeNameTop = 'contract'
         // console.log('method', method)
         this.inputForm = {
           customerId: '',  // 客户id
@@ -590,6 +670,11 @@
 				this.loading = false
 			}
 
+			// 获取关联项目信息
+			this.projectInfoService.getByContractId(this.inputForm.id).then((project) => {
+				this.projectList = project
+			})
+
         })
       },
       // 查看
@@ -838,6 +923,24 @@
         this.$refs.workClientForm.init('view', id)
       },
 
+	viewProject (row) {
+		this.$refs.projectDia.init('view', row.id,row.auditId1, row.auditId2, row.auditId3,row.sealId,row.outInstanceId,row.reportsSubmitId,row.archiveId,row.eiaId)
+	},
+	searchProject () {
+		this.loading = true
+		this.projectInfoService.getByContractId(this.inputForm.id, this.projectForm).then((data) => {
+			this.projectList = data
+			this.loading = false
+		}).catch(() => {
+			this.loading = false
+		})
+	},
+
+	refreshProjectForm () {
+		this.$refs.projectForm.resetFields()
+		this.searchProject()
+	},
+
 		//获取合同类型
 		getTypeList(){
 			dictService.getListData().then((data)=>{

+ 13 - 0
src/views/jy/workContractInfo/WorkContractForm.vue

@@ -69,6 +69,18 @@
 						</el-form-item>
 					</el-col>
 
+		<el-col :span="12">
+
+			<el-form-item label="合同签订类型" prop="contractSignedType"
+						  :rules="[
+						  {required: true, message:'请选择合同签订类型', trigger:'blur'}
+						 ]">
+				<el-radio-group v-model="inputForm.contractSignedType" :disabled="status === 'audit' || status === 'taskFormDetail'|| method==='view'">
+					<el-radio :disabled="method === 'view'" v-for="item in $dictUtils.getDictList('contract_signed_type')" :label="item.value" >{{item.label}}</el-radio>
+				</el-radio-group>
+			</el-form-item>
+		</el-col>
+
 					<el-col :span="12">
 						<el-form-item label="签订日期" prop="contractDate"
 									  :rules="[
@@ -375,6 +387,7 @@
 					primaryLinkman:'',
 					contractSpecial: '',
 					remarks: '',
+					contractSignedType: '',
 					contractDate:'',
 					effectiveDate: '',
 					closingDate: '',