sangwenwei 1 年之前
父節點
當前提交
e247ffc3bb

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

@@ -92,6 +92,22 @@ export default class ProjectInfoService {
 		})
 	}
 
+	saveFormOut (inputForm) {
+		return request({
+			url: prefix + `/jyProject/saveFormOut`,
+			method: 'post',
+			data: inputForm
+		})
+	}
+
+	updateStatusByOutId (data) {
+		return request({
+			url: prefix + '/jyProject/updateStatusByOutId',
+			method: 'post',
+			data: data
+		})
+	}
+
 	/* 一级校审文档下载 */
 	downloadFirstAuditTpl (id, projectId) {
 		return request({
@@ -116,6 +132,17 @@ export default class ProjectInfoService {
 			params: {id: id, projectId: projectId},
 		})
 	}
+	/*
+	根据id查找外审信息
+	 */
+	findByIdOut(id){
+		return request({
+			url: prefix + '/jyProject/findByIdOut',
+			method: 'get',
+			params: {id:id}
+		})
+	}
+
 
 
 }

+ 707 - 0
src/views/common/JyUpLoadComponent.vue

@@ -0,0 +1,707 @@
+<!--文件上传组件-->
+<template>
+	<div>
+		<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>
+		<el-button v-if="showSign" :loading="loading" type="info" style="float: right;" @click="clickSign">签章</el-button>
+		<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"
+				:key="tableKey"
+				v-loading="loading"
+				: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]"
+							></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="文件类型" prop="jyFileType" align="center">
+					<template #header="{ column }">
+						<span style="color: red; font-size: 20px">*</span>
+						<span>{{column.label}}</span>
+					</template>
+					<!--          <template slot="header" scope="scope">-->
+					<!--            <span style="color:red;font-size: 20px">* </span><span>文件类型</span>-->
+					<!--          </template>-->
+					<template #default="scope">
+						<el-select v-if="auth !== 'view'" v-model="scope.row.jyFileType" placeholder="请选择">
+							<el-option
+								v-for="item in $dictUtils.getDictList('jy_project_outInstance')"
+								:key="item.value"
+								:label="item.label"
+								:value="item.value">
+							</el-option>
+						</el-select>
+						<span v-else>{{$dictUtils.getDictLabel("jy_project_outInstance", scope.row.jyFileType, '')}}</span>
+					</template>
+				</el-table-column>
+				<el-table-column label="操作" width="200px" fixed="right" align="center">
+					<template  #default="scope">
+						<el-button text type="primary"  icon="el-icon-edit" @click="toHref(scope.row)" :disabled="false">下载</el-button>
+						<el-button text type="primary"  icon="el-icon-delete"  @click="deleteById(scope.row, scope.$index)" :disabled="auth==='view'&&delFlag === false&&createBy!==scope.row.createBy.name">删除</el-button>
+						<!--<el-button text type="primary" icon="el-icon-edit"
+								 @click="handleUpdate(scope.row, scope.$index)"
+						>{{ scope.row.btn || "修改" }}</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 {
+				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,
+				jyFileType: '',
+				sealType: '',
+				remarks: '',
+				showSign: false,
+				loading: false,
+				dataListLength: ''
+			}
+		},
+		watch: {
+		},
+		created () {
+			this.ossService = new OSSSerivce()
+		},
+		components: {
+			// ElImageViewer,
+			fileTypeComponentA: {
+				render: function (h) {
+					return h('span', {
+						domProps: {
+							innerText: this.$dictUtils.getDictLabel('jy_project_outInstance', this.value, '')
+						}
+					})
+				},
+				props: ['options', 'value']
+			},
+			fileTypeComponentB: {
+				data () {
+					return { jyFileType: '' }
+				},
+				props: ['options', 'value'],
+				mounted () {
+					this.jyFileType = this.value
+				},
+				render: function (h) {
+					return h(
+						'el-select',
+						{
+							attrs: {
+								placeholder: '请选择',
+								value: this.$dictUtils.getDictLabel('jy_project_outInstance', this.jyFileType, ''),
+								size: 'small',
+								clearable: true
+							},
+							props: ['value'],
+							on: {
+								change: (value) => {
+									this.jyFileType = value
+									this.$emit('updateFileType', value)
+								}
+							}
+						},
+						[
+							this.options.map((item) => {
+								let { label, value } = item
+								return h('el-option', {
+									props: {
+										label,
+										value: parseInt(value),
+										key: value
+									}
+								})
+							})
+						]
+					)
+				}
+			},
+			sealTypeComponentA: {
+				render: function (h) {
+					return h('span', {
+						domProps: {
+							innerText: this.$dictUtils.getDictLabel('cw_seal_type', this.value, '')
+						}
+					})
+				},
+				props: ['options', 'value']
+			},
+			sealTypeComponentB: {
+				data () {
+					return { sealType: '' }
+				},
+				props: ['options', 'value', 'scope'],
+				mounted () {
+					this.sealType = this.value
+				},
+				render: function (h) {
+					return h(
+						'el-select',
+						{
+							attrs: {
+								placeholder: '请选择',
+								value: this.$dictUtils.getDictLabel('cw_seal_type', this.sealType, ''),
+								size: 'small',
+								clearable: true
+							},
+							props: ['value'],
+							on: {
+								change: (value) => {
+									let suffix = this.scope.row.name.substring(this.scope.row.name.lastIndexOf('.') + 1)
+									if (parseInt(value) === 1) {
+										if (suffix === 'pdf' || suffix === 'doc' || suffix === 'docx') {
+											this.sealType = value
+											this.$emit('updateSealType', value)
+										} else {
+											this.$message.error('只有“pdf、doc、docx”格式文件的盖章类型可以是“电子章”')
+											this.sealType = ''
+											this.$emit('updateSealType', '')
+										}
+									} else {
+										this.sealType = value
+										this.$emit('updateSealType', value)
+									}
+								}
+							}
+						},
+						[
+							this.options.map((item) => {
+								let { label, value } = item
+								return h('el-option', {
+									props: {
+										label,
+										value: parseInt(value),
+										key: value
+									}
+								})
+							})
+						]
+					)
+				}
+			},
+			remarksComponentA: {
+				render: function (h) {
+					return h('span', {
+						domProps: {
+							innerText: this.value
+						}
+					})
+				},
+				props: ['value']
+			},
+			remarksComponentB: {
+				data () {
+					return { remarks: '' }
+				},
+				props: ['value'],
+				mounted () {
+					this.remarks = this.value
+				},
+				render: function (h) {
+					return h(
+						'el-input',
+						{
+							attrs: {
+								placeholder: '请输入',
+								value: this.remarks,
+								size: 'small',
+								clearable: true
+							},
+							props: ['value'],
+							on: {
+								input: (value) => {
+									this.remarks = value
+									this.$emit('updateRemarks', value)
+								}
+							}
+						}
+					)
+				}
+			}
+		},
+		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隐藏
+			 * @param showSign ‘签章’按钮 是否展示
+			 *    注:值为空时,默认值为false 不展示
+			 *    showSign=audit的时候 ‘签章’按钮展示
+			 */
+			async newUpload (auth, fileList, directory, maxValue, dividerName, uploadFlag, delFlag, showDivider, showSign) {
+				if (this.commonJS.isEmpty(showSign)) {
+					this.showSign = false
+				} else {
+					if (showSign === 'audit') {
+						this.showSign = true
+					} else {
+						this.showSign = false
+					}
+				}
+				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) {
+					if (item.url) {
+						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))
+					return (val / Math.pow(k, i)).toPrecision(3) + '' + 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()
+			},
+			showFile (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) {
+				await this.dataListNew.splice(index, 1)
+				await this.dataList.splice(index, 1)
+				this.tableKey = Math.random()
+			},
+			/**
+			 * 关闭dialog时使用  清除el-upload中上传的文件
+			 */
+			clearUpload () {
+				this.$refs.upload.uploadFiles = []
+				this.dataList = []
+				this.dataListNew = []
+				this.createBy = ''
+			},
+			/**
+			 * 获取当前文件列表中的文件数据
+			 */
+			getDataList () {
+				let _this = this
+				const waitForEach = function () {
+					return new Promise(function (resolve, reject) {
+						_this.dataListNew.forEach((item, index) => {
+							if (item.btnType === 'save') {
+								_this.dataListNew[index].fileTypeComponent = 'fileTypeComponentA'
+								_this.dataListNew[index].sealTypeComponent = 'sealTypeComponentA'
+								_this.dataListNew[index].remarksComponent = 'remarksComponentA'
+								_this.dataListNew[index].btn = '修改'
+								_this.dataListNew[index].btnType = 'edit'
+								_this.dataListNew[index].fileType = _this.fileType
+								_this.dataListNew[index].sealType = _this.sealType
+								_this.dataListNew[index].remarks = _this.remarks
+								_this.dataListNew[index].jyFileType = _this.jyFileType
+							}
+						})
+						_this.tableKey = Math.random()
+						resolve(_this.dataListNew)
+					})
+				}
+				return waitForEach()
+			},
+			/**
+			 * 判断进度条是否结束,附件是否加载完成
+			 * @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
+			},
+			/** 修改||保存按钮操作 */
+			handleUpdate: async function (row, rowIndex) {
+				if (row.btnType === 'edit' || this.commonJS.isEmpty(row.btnType)) {
+					let _this = this
+					const waitForEach = function () {
+						return new Promise(function (resolve, reject) {
+							_this.dataListNew.forEach((item, index) => {
+								if (item.btnType === 'save') {
+									_this.dataListNew[index].fileTypeComponent = 'fileTypeComponentA'
+									_this.dataListNew[index].sealTypeComponent = 'sealTypeComponentA'
+									_this.dataListNew[index].remarksComponent = 'remarksComponentA'
+									_this.dataListNew[index].btn = '修改'
+									_this.dataListNew[index].btnType = 'edit'
+									_this.dataListNew[index].fileType = _this.fileType
+									_this.dataListNew[index].sealType = _this.sealType
+									_this.dataListNew[index].remarks = _this.remarks
+								}
+							})
+							resolve()
+						})
+					}
+					waitForEach().then(() => {
+						this.dataListNew[rowIndex].fileTypeComponent = 'fileTypeComponentB'
+						this.dataListNew[rowIndex].sealTypeComponent = 'sealTypeComponentB'
+						this.dataListNew[rowIndex].remarksComponent = 'remarksComponentB'
+						this.dataListNew[rowIndex].btn = '保存'
+						this.dataListNew[rowIndex].btnType = 'save'
+					})
+				} else {
+					this.dataListNew[rowIndex].fileTypeComponent = 'fileTypeComponentA'
+					this.dataListNew[rowIndex].sealTypeComponent = 'sealTypeComponentA'
+					this.dataListNew[rowIndex].remarksComponent = 'remarksComponentA'
+					this.dataListNew[rowIndex].btn = '修改'
+					this.dataListNew[rowIndex].btnType = 'edit'
+					this.dataListNew[rowIndex].fileType = this.fileType
+					this.dataListNew[rowIndex].sealType = this.sealType
+					this.dataListNew[rowIndex].remarks = this.remarks
+				}
+				this.tableKey = Math.random()
+			},
+			updateFileType (fileType) {
+				this.fileType = fileType
+			},
+			updateSealType (sealType) {
+				this.sealType = sealType
+			},
+			updateRemarks (remarks) {
+				this.remarks = remarks
+			},
+			tableRowClassName ({ row, rowIndex }) {
+				row.index = rowIndex
+			},
+			// 行点击事件
+			tableRowClick (row, column) {
+				if (this.auth !== 'view') {
+					if (column.label !== '备注' && column.label !== '文件名称' && column.label !== '操作') {
+						let _this = this
+						const waitForEach = function () {
+							return new Promise(function (resolve, reject) {
+								_this.dataListNew.forEach((item, index) => {
+									if (item.btnType === 'save') {
+										_this.dataListNew[index].fileTypeComponent = 'fileTypeComponentA'
+										_this.dataListNew[index].sealTypeComponent = 'sealTypeComponentA'
+										_this.dataListNew[index].remarksComponent = 'remarksComponentA'
+										_this.dataListNew[index].btn = '修改'
+										_this.dataListNew[index].btnType = 'edit'
+										_this.dataListNew[index].fileType = _this.fileType
+										_this.dataListNew[index].sealType = _this.sealType
+										_this.dataListNew[index].remarks = _this.remarks
+									}
+								})
+								resolve()
+							})
+						}
+						waitForEach().then(() => {
+							this.fileType = this.dataListNew[row.index].fileType
+							this.sealType = this.dataListNew[row.index].sealType
+							this.remarks = this.dataListNew[row.index].remarks
+							this.dataListNew[row.index].fileTypeComponent = 'fileTypeComponentB'
+							this.dataListNew[row.index].sealTypeComponent = 'sealTypeComponentB'
+							this.dataListNew[row.index].remarksComponent = 'remarksComponentB'
+							this.dataListNew[row.index].btn = '保存'
+							this.dataListNew[row.index].btnType = 'save'
+						})
+						this.tableKey = Math.random()
+					}
+				}
+			},
+			// 点击上传文件按钮的时候,把未保存的文件保存一下
+			clickHandel () {
+				this.dataListNew.forEach((item, index) => {
+					if (item.btnType === 'save') {
+						this.dataListNew[index].fileTypeComponent = 'fileTypeComponentA'
+						this.dataListNew[index].sealTypeComponent = 'sealTypeComponentA'
+						this.dataListNew[index].remarksComponent = 'remarksComponentA'
+						this.dataListNew[index].btn = '修改'
+						this.dataListNew[index].btnType = 'edit'
+						this.dataListNew[index].fileType = this.fileType
+						this.dataListNew[index].sealType = this.sealType
+						this.dataListNew[index].remarks = this.remarks
+					}
+				})
+			},
+			sealTypeChange (scope) {
+				let suffix = scope.row.name.substring(scope.row.name.lastIndexOf('.') + 1)
+				if (parseInt(scope.row.sealType) === 1) {
+					if (suffix !== 'pdf' && suffix !== 'doc' && suffix !== 'docx') {
+						this.$message.error('只有“pdf、doc、docx”格式文件的盖章类型可以是“电子章”')
+						scope.row.sealType = ''
+					}
+				}
+			},
+			// 点击签章按钮事件
+			clickSign () {
+				this.$emit('clickSign')
+			},
+			// 隐藏签章按钮
+			hideSign () {
+				this.showSign = false
+			},
+			// 开启/关闭页面的加载中状态
+			changeLoading (loading) {
+				if (this.commonJS.isNotEmpty(loading)) {
+					this.loading = loading
+				} else {
+					this.loading = false
+				}
+			}
+		}
+	}
+</script>

+ 531 - 0
src/views/jy/project/OutInstanceForm.vue

@@ -0,0 +1,531 @@
+<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
+	<div>
+		<el-form size="large" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"
+				 label-width="170px" @submit.native.prevent>
+
+			<el-row  :gutter="15">
+				<el-row  :gutter="15">
+					<el-col :span="24" >
+						<el-divider content-position="left"><i class="el-icon-document"></i>
+							合同信息
+						</el-divider>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="合同名称" prop="contractName"
+									  :rules="[
+                 ]">
+							<el-input :disabled="true" v-model="inputForm.contractName" placeholder="请填写合同名称"></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="合同金额(元)" prop="contractAmount"
+									  :rules="[
+                 ]">
+							<el-input :disabled="true" v-model="inputForm.contractAmount" placeholder="请填写合同金额(元)"></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="委托方" prop="primaryLinkman"
+									  :rules="[
+                 ]">
+							<el-input :disabled="true" v-model="inputForm.primaryLinkman" placeholder="请填写委托方"></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="合同类型(大类)" prop="contractTypeFirst"
+									  :rules="[
+                 ]">
+							<el-input :disabled="true" v-model="inputForm.contractTypeFirst" placeholder="请填写合同类型(大类)"></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="合同类型(小类)" prop="contractType"
+									  :rules="[
+                 ]">
+							<el-input :disabled="true" v-model="inputForm.contractType" placeholder="请填写合同类型(小类)"></el-input>
+						</el-form-item>
+					</el-col>
+				</el-row>
+			</el-row>
+			<el-row  :gutter="15">
+				<el-row  :gutter="15">
+					<el-col :span="24" >
+						<el-divider content-position="left"><i class="el-icon-document"></i>
+							项目基本信息
+						</el-divider>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="项目名称" prop="projectName"
+									  :rules="[
+                 ]">
+							<el-input :disabled="true" v-model="inputForm.projectName" placeholder="请填写项目名称"></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="项目所在地" prop="projectPlace"
+									  :rules="[
+                 ]">
+							<el-input :disabled="true" v-model="inputForm.projectPlace" placeholder="请填写项目所在地"></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="建设地点" prop="buildPlace"
+									  :rules="[
+                 ]">
+							<el-input :disabled="true" v-model="inputForm.buildPlace" placeholder="请填写建设地点"></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="项目负责人" prop="projectLeader"
+									  :rules="[
+                 ]">
+							<el-input :disabled="true" v-model="inputForm.projectLeader" placeholder="请填写项目负责人"></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="创建人" prop="createByName"
+									  :rules="[
+                 ]">
+							<el-input :disabled="true" v-model="inputForm.createByName" placeholder="请填写创建人"></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="创建时间" prop="createTime"
+									  :rules="[
+                 ]">
+							<el-input :disabled="true" v-model="inputForm.createTime" placeholder="请填写创建时间"></el-input>
+						</el-form-item>
+					</el-col>
+				</el-row>
+
+			</el-row>
+			<el-row  :gutter="15">
+					<el-col :span="24">
+						<el-form-item label="备注" prop="remarks"
+									  :rules="[
+                 ]">
+							<el-input :rows="4" :disabled="status === 'audit' || status === 'taskFormDetail'|| method ==='view'"  show-word-limit maxlength="500" type="textarea" v-model="inputForm.remarks" placeholder="请填写备注"></el-input>
+						</el-form-item>
+					</el-col>
+			</el-row>
+
+		</el-form>
+		<!--        附件-->
+		<UpLoadComponent ref="uploadComponent"></UpLoadComponent>
+
+
+	</div>
+</template>
+
+<script>
+	import ProjectInfoService from "@/api/jy/ProjectInfoService";
+	import UserSelectSignatory from '../workClientInfo/clientUserSelect'
+	import UpLoadComponent from '@/views/common/JyUpLoadComponent'
+	export default {
+		props: {
+			businessId: {
+				type: String,
+				default: ''
+			},
+			formReadOnly: {
+				type: Boolean,
+				default: false
+			},
+			status: {
+				type: String,
+				default: ''
+			}
+		},
+		data () {
+			return {
+				title: '',
+				method: '',
+				visible: false,
+				loading: false,
+				inputForm: {
+					id: '',
+					contractName:'',
+					contractAmount:'',
+					primaryLinkman:'',
+					contractTypeFirst:'',
+					contractType:'',
+					projectName:'',
+					projectPlace:'',
+					buildPlace:'',
+					projectLeader:'',
+					createByName:'',
+					createTime:'',
+					fileList:[],
+					status:'',
+					projectId:'',
+					remarks:''
+				},
+				keyWatch: '',
+				tabName:''
+
+			}
+		},
+		ProjectInfoService:null,
+		created () {
+			this.projectInfoService=new ProjectInfoService()
+		},
+		computed: {
+			bus: {
+				get () {
+					this.$refs.uploadComponent.setDividerName('附件')
+					return this.businessId
+
+				},
+				set (val) {
+					this.businessId = val
+				}
+			}
+		},
+		watch: {
+			'keyWatch': {
+				handler (newVal) {
+					console.log('dsad')
+					if (this.bus) {
+						console.log('dsad',this.bus)
+						if (this.bus !== 'false') {
+							this.init('', this.bus)
+						}
+					} else {
+						this.$nextTick(() => {
+							this.$refs.inputForm.resetFields()
+						})
+					}
+				}
+			},
+			'loading': {
+				handler (newVal) {
+					this.$emit('changeLoading', newVal)
+					this.$refs.uploadComponent.changeLoading(newVal)
+				}
+			}
+		},
+		components: {
+			UserSelectSignatory,
+			UpLoadComponent,
+		},
+		methods: {
+			getKeyWatch (keyWatch) {
+				this.keyWatch = keyWatch
+			},
+			init (method, id,tabName) {
+				this.tabName = tabName
+				this.method = method
+				console.log('method', method)
+				this.inputForm = {
+					id: '',
+					contractName:'',
+					contractAmount:'',
+					primaryLinkman:'',
+					contractTypeFirst:'',
+					contractType:'',
+					projectName:'',
+					projectPlace:'',
+					buildPlace:'',
+					projectLeader:'',
+					createByName:'',
+					createTime:'',
+					fileList:[],
+					status:'',
+					projectId:'',
+					remarks:''
+				}
+				this.inputForm.id = id
+				this.visible = true
+				if (method === 'add') {
+					// this.inputForm.id = 'add'
+					this.title = `新建项目`
+				} else if (method === 'edit') {
+					this.title = '修改项目'
+				} else if (method === 'view') {
+					this.title = '查看项目详情'
+				}
+				this.loading = false
+				this.$nextTick(() => {
+					this.$refs.inputForm.resetFields()
+					this.loading = true
+					this.$refs.uploadComponent.clearUpload()
+					// this.$refs.archiveFile.clearUpload()
+					console.log('id',this.inputForm.id)
+					this.projectInfoService.findByIdOut(this.inputForm.id).then((data) => {
+						this.inputForm = this.recover(this.inputForm, data)
+						this.inputForm.contractName=data.jyProjectList.contractName
+						this.inputForm.contractAmount=data.jyProjectList.contractAmount
+						this.inputForm.primaryLinkman=data.jyProjectList.primaryLinkman
+						this.inputForm.contractTypeFirst=data.jyProjectList.contractTypeFirst
+						this.inputForm.contractType=data.jyProjectList.contractType
+						this.inputForm.projectName=data.jyProjectList.name
+						this.inputForm.projectPlace=data.jyProjectList.place
+						this.inputForm.buildPlace=data.jyProjectList.buildPlace
+						this.inputForm.createByName=data.jyProjectList.createById
+						this.inputForm.createTime=data.jyProjectList.createTime
+						this.inputForm.projectLeader=data.jyProjectList.leader
+						this.inputForm.projectId=data.projectId
+						this.inputForm.remarks=data.remarks
+						console.log('data', data)
+						if (this.status === 'audit' || this.status === 'taskFormDetail') {
+							method = 'view'
+						}
+						console.log('method2',method)
+						this.$refs.uploadComponent.newUpload(method, this.inputForm.fileList, 'jyProjectOut', null, null, null, null, false)
+						// this.$refs.archiveFile.newUpload('view', [], 'cwWorkContract', null, null, null, null, false)
+						this.loading = false
+					})
+				})
+			},
+			close () {
+				this.$refs.uploadComponent.clearUpload()
+				this.inputForm = {
+					id: '',
+					contractName:'',
+					contractAmount:'',
+					primarkLinkman:'',
+					contractTypeFirst:'',
+					contractType:'',
+					projectName:'',
+					projectPlace:'',
+					buildPlace:'',
+					projectLeader:'',
+					createByName:'',
+					createTime:'',
+					remarks:'',
+					fileList:[],
+					status:'',
+				}
+				this.$refs.inputForm.resetFields()
+				this.visible = false
+			},
+			reapplyForm (callback) {
+				this.loading = true
+				this.projectInfoService.findByIdOut(this.inputForm.id).then((data) => {
+					if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
+						this.loading = false
+						this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+						throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+					} else {
+						this.startFormTrue(callback)
+					}
+				})
+			},
+			saveForm (callback) {
+				this.doSubmit('save', callback)
+			},
+			startForm (callback) {
+				this.loading = true
+				if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+					this.projectInfoService.findByIdOut(this.inputForm.id).then((data) => {
+						if (this.commonJS.isNotEmpty(data.status) && data.status !== '0' && data.status !== '1' && data.status !== '3' && data.status !== '6') { // 审核状态不是“未发起”或“暂存”或“撤回”或"超期未发起",就弹出提示
+							this.loading = false
+							this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+							throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+						} else {
+							this.startFormTrue(callback)
+						}
+					})
+				} else {
+					this.startFormTrue(callback)
+				}
+			},
+			startFormTrue (callback) {
+				this.doSubmit('start', callback)
+			},
+			async agreeForm (callback) {
+				this.loading = true
+				await this.projectInfoService.findByIdOut(this.inputForm.id).then((data) => {
+					if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+						this.loading = false
+						this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+						throw new Error()
+					} else {
+						this.doSubmit('agree', callback)
+					}
+				})
+			},
+			// 表单提交
+			async doSubmit (status, callback) {
+				this.loading = true
+				if (await this.$refs.uploadComponent.checkProgress()) {
+					this.loading = false
+					throw new Error()
+				}
+				if (status === 'save') {
+					// 暂存
+					this.loading = true
+					this.inputForm.status = '1'
+					this.$refs.uploadComponent.getDataList().then((list)=>{
+						if (this.commonJS.isNotEmpty(list)){
+							list.forEach((item, index) => {
+								if (this.commonJS.isEmpty(item.jyFileType)) {
+									this.$message.error('第' + (index + 1) + '条附件信息没有填写文件类型')
+									this.loading = false
+									throw new Error('第' + (index + 1) + '条附件信息没有填写文件类型')
+								}
+							})
+						}
+						this.inputForm.fileList = list
+						this.projectInfoService.saveFormOut(this.inputForm).then((data) => {
+							this.inputForm.assignee = this.inputForm.auditPeople
+							this.inputForm.id = data.businessId
+							callback(data.businessTable, data.businessId, this.inputForm)
+							this.loading = false
+						}).catch(() => {
+							this.loading = false
+						})
+					})
+					return
+				} else if (status === 'start') {
+					// 送审  待审核
+					this.inputForm.status = '2'
+				} else if (status === 'agree') {
+					// 审核同意
+					this.inputForm.status = '5'
+					this.inputForm.auditDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+				}
+				this.$refs['inputForm'].validate((valid) => {
+					if (valid) {
+						this.loading = true
+						this.$refs.uploadComponent.getDataList().then((list)=>{
+							if (this.commonJS.isNotEmpty(list)){
+								list.forEach((item, index) => {
+									if (this.commonJS.isEmpty(item.jyFileType)) {
+										this.$message.error('第' + (index + 1) + '条附件信息没有填写文件类型')
+										this.loading = false
+										throw new Error('第' + (index + 1) + '条附件信息没有填写文件类型')
+									}
+								})
+							}
+							this.inputForm.fileList = list
+							this.projectInfoService.saveFormOut(this.inputForm).then((data) => {
+								this.inputForm.id = data.businessId
+								callback(data.businessTable, data.businessId, this.inputForm)
+								this.loading = false
+							}).catch(() => {
+								this.loading = false
+							})
+						})
+					} else {
+						this.loading = false
+					}
+				})
+			},
+			async updateStatusById (type, callback) {
+				this.loading = true
+				if (await this.$refs.uploadComponent.checkProgress()) {
+					this.loading = false
+					throw new Error()
+				} else {
+					if (type === 'reject' || type === 'reback') {
+						this.projectInfoService.findByIdOut(this.inputForm.id).then((data) => {
+							if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+								this.loading = false
+								this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+								throw new Error()
+							} else {
+								// if (type === 'agree') {
+								//   // 同意
+								//   this.inputForm.status = '5'
+								// }
+								if (type === 'reject') {
+									// 驳回
+									this.inputForm.status = '4'
+									this.loading = true
+									this.inputForm.workAttachmentDtoList = this.$refs.uploadComponent.getDataList()
+									this.projectInfoService.saveFormOut(this.inputForm).then((data) => {
+										this.loading = false
+									}).catch(() => {
+										this.loading = false
+									})
+									// return
+								}
+								if (type === 'reback') {
+									// 撤回
+									this.inputForm.status = '3'
+								}
+								if (type === 'reject' || type === 'reback') {
+									let param = {status: this.inputForm.status, id: this.inputForm.id}
+									this.loading = true
+									this.projectInfoService.updateStatusByOutId(param).then(() => {
+										this.loading = false
+										callback()
+									})
+								}
+							}
+						})
+					} else if (type === 'hold') {
+						this.projectInfoService.findByIdOut(this.inputForm.id).then((data) => {
+							if (data.status !== '4') { // status的值不等于“驳回”就弹出提示
+								this.loading = false
+								this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+								throw new Error()
+							} else {
+								// 终止
+								let param = {status: '1', id: this.inputForm.id}
+								this.projectInfoService.updateStatusByOutId(param).then(() => {
+									this.loading = false
+									callback()
+								})
+							}
+						})
+					}
+				}
+			},
+			// 下载一级校审
+			downloadFirstAuditTpl () {
+				// this.$utils.downloadExcel('/sys/project/import/template')
+				this.loading = true
+				if (this.tabName === '一级校审') {
+					this.projectInfoService.downloadFirstAuditTpl(this.inputForm.id, this.inputForm.projectId).then((res) => {
+						console.log('hh',res)
+						// 将二进制流文件写入excel表,以下为重要步骤
+						this.$utils.downloadWord(res, this.tabName)
+						this.loading = false
+					}).catch(function (err) {
+						this.loading = false
+						if (err.response) {
+							console.log(err.response)
+						}
+					})
+				}
+				if (this.tabName === '二级校审') {
+					this.projectInfoService.downloadSecondAuditTpl(this.inputForm.id, this.inputForm.projectId).then((res) => {
+						// 将二进制流文件写入excel表,以下为重要步骤
+						this.$utils.downloadWord(res, this.tabName)
+						this.loading = false
+					}).catch(function (err) {
+						this.loading = false
+						if (err.response) {
+							console.log(err.response)
+						}
+					})
+				}
+				if (this.tabName === '三级校审') {
+					this.projectInfoService.downloadThirdlyAuditTpl(this.inputForm.id, this.inputForm.projectId).then((res) => {
+						// 将二进制流文件写入excel表,以下为重要步骤
+						this.$utils.downloadWord(res, this.tabName)
+						this.loading = false
+					}).catch(function (err) {
+						this.loading = false
+						if (err.response) {
+							console.log(err.response)
+						}
+					})
+				}
+			},
+
+		}
+	}
+</script>
+<style lang="scss">
+	.el-input-number .el-input__inner {
+		text-align: left;
+	}
+	.el-divider__text {
+		font-size: 16px;
+		font-weight: bold;
+	}
+
+</style>

+ 2 - 0
src/views/jy/project/ProjectAuditForm.vue

@@ -428,6 +428,7 @@
 					if (this.commonJS.isEmpty(this.inputForm.auditPeople)) {
 						this.$message.error('请选择审核人')
 						this.loading = false
+						throw new Error('请选择审核人')
 					}
 					this.projectInfoService.saveFormThree(this.inputForm).then((data) => {
 						this.inputForm.assignee = this.inputForm.auditPeople
@@ -452,6 +453,7 @@
 						if (this.commonJS.isEmpty(this.inputForm.auditPeople)) {
 							this.$message.error('请选择审核人')
 							this.loading = false
+							throw new Error('请选择审核人')
 						}
 						this.projectInfoService.saveFormThree(this.inputForm).then((data) => {
 							this.inputForm.assignee = this.inputForm.auditPeople

+ 13 - 6
src/views/jy/project/ProjectDia.vue

@@ -309,6 +309,9 @@
 			  <el-tab-pane label="报告签发" name="reportIssuance">
 				  <SignetAddForm ref="signetAddForm" :formReadOnly="true"></SignetAddForm>
 			  </el-tab-pane>
+			  <el-tab-pane label="外审" name="outInstance">
+				  <OutInstanceForm ref="outInstanceForm" :formReadOnly="true"></OutInstanceForm>
+			  </el-tab-pane>
 		  </el-tabs>
 		  <template #footer>
 			<span class="dialog-footer">
@@ -335,6 +338,7 @@
 	import userService from '@/api/sys/UserService'
 	import ProjectAuditForm from './ProjectAuditForm'
 	import SignetAddForm from '@/views/materialManagement/userSeal/SignetAddForm'
+	import OutInstanceForm from './OutInstanceForm'
   export default {
     props: {
       businessId: {
@@ -398,7 +402,8 @@
 		  provience:'',
 		  city:'',
 		  con:'',
-		  sealId:''
+		  sealId:'',
+		  outInstanceId:''
       }
     },
 	  ProjectInfoService:null,
@@ -424,7 +429,8 @@
 		SelectUserTree,
 		UpLoadComponent,
 		ProjectAuditForm,
-		SignetAddForm
+		SignetAddForm,
+		OutInstanceForm
     },
     methods: {
 		getKeyWatch (keyWatch) {
@@ -530,10 +536,11 @@
 				this.inputForm.clientList.splice(rowIndex, 1)
 			}
 		},
-		init (method, id,auditId1, auditId2, auditId3,sealId) {
+		init (method, id,auditId1, auditId2, auditId3,sealId,outInstanceId) {
 			this.auditIdfirst = auditId1
 			this.auditIdsecond = auditId2
 			this.auditIdthird = auditId3
+			this.outInstanceId=outInstanceId
 			this.sealId=sealId
 			this.method = method
 			// console.log('method', method)
@@ -876,9 +883,9 @@
 					this.$refs.signetAddForm.init('view', this.sealId)
 				}
 			}
-			if (paneName === 'freadBrowse') {
-				if (this.commonJS.isNotEmpty(this.inputForm.id)) {
-					this.$refs.proofreadBrowseFormComponent.init('view', this.inputForm.id)
+			if (paneName === 'outInstance') {
+				if (this.commonJS.isNotEmpty(this.outInstanceId)) {
+					this.$refs.outInstanceForm.init('view', this.outInstanceId)
 				}
 			}
 			if (paneName === 'fread') {

+ 153 - 15
src/views/jy/project/ProjectList.vue

@@ -17,8 +17,8 @@
 			<el-form-item v-if="showHideItem" label="合同名称" prop="contractName">
 				<el-input v-model="searchForm.contractName" placeholder="请输入合同名称" clearable></el-input>
 			</el-form-item>
-			<el-form-item v-if="showHideItem" label="委托方" prop="primaryLinkman">
-				<el-input v-model="searchForm.primaryLinkman" placeholder="请输入委托方" clearable></el-input>
+			<el-form-item v-if="showHideItem" label="委托方" prop="clientName">
+				<el-input v-model="searchForm.clientName" placeholder="请输入委托方" clearable></el-input>
 			</el-form-item>
 			<el-form-item v-if="showHideItem" label="创建时间" prop="createDates">
 				<el-date-picker
@@ -208,7 +208,7 @@
 					</vxe-column>
 					<vxe-column min-width="120" align="center" title="外审" field="outInstance">
 						<template #default="scope">
-							<el-button @click="archiveDetail(scope.row)" :type="$dictUtils.getDictLabel('program_project_list_info_status_info', scope.row.outInstance, '')" effect="dark" >{{$dictUtils.getDictLabel("program_project_archive_list_info_status", scope.row.outInstance, '未登记')}} </el-button>
+							<el-button @click="outInstanceDetail(scope.row)" :type="$dictUtils.getDictLabel('program_project_list_info_status_info', scope.row.outInstance, '')" effect="dark" >{{$dictUtils.getDictLabel("program_project_list_info_status", scope.row.outInstance, '未登记')}} </el-button>
 						</template>
 					</vxe-column>
 					<vxe-column min-width="120" align="center" title="报批签发" field="reportsSubmit">
@@ -262,16 +262,14 @@
 <!--							&lt;!&ndash; 三级校审  被驳回后当前申请人重新调整&ndash;&gt;-->
 							<el-button v-if="hasPermission('jy_project:info:edit')&&(scope.row.createBy === $store.state.user.id)&&scope.row.thirdInstanceStatus === '4'" text type="primary"   @click="adjustThird(scope.row)">驳回调整</el-button>
 
-<!--							&lt;!&ndash;三神结束后,评估报告签发前进行资产评估项目(校对)&ndash;&gt;-->
-<!--							<el-button v-if="hasPermission('program:registered:proo')&&(scope.row.createBy === $store.state.user.id||haveProjectIds.includes(scope.row.id))&&scope.row.status3 === '5'&&scope.row.issuedStatus === '0'" text type="primary"  @click="proofread(scope.row.id)">校对</el-button>-->
-<!--							&lt;!&ndash;报告签发&ndash;&gt;-->
-<!--							<el-button v-if="hasPermission('program:registered:browse')&&(scope.row.createBy === $store.state.user.id||haveProjectIds.includes(scope.row.id)) &&scope.row.status3 === '5' && (scope.row.issuedStatus === null ||scope.row.issuedStatus === undefined ||scope.row.issuedStatus === '' ||scope.row.issuedStatus === '0' || scope.row.issuedStatus === '1' || scope.row.issuedStatus === '3')" text type="primary"  @click="issued(scope.row)">签发</el-button>-->
-<!--							&lt;!&ndash;报告签发撤回&ndash;&gt;-->
-<!--							<el-button v-if="hasPermission('program:registered:browse')&&(scope.row.createBy === $store.state.user.id||haveProjectIds.includes(scope.row.id)) && scope.row.issuedStatus === '2'" text type="primary"  @click="issuedReback(scope.row)">签发撤回</el-button>-->
-<!--							&lt;!&ndash; 报告签发  审核&ndash;&gt;-->
-<!--							<el-button v-if="scope.row.issuedStatus==='2' && checkIsAuditIssued(scope.row)" text type="primary"  @click="examineIssued(scope.row)">签发审核</el-button>-->
-<!--							&lt;!&ndash; 报告签发  被驳回后当前申请人重新调整&ndash;&gt;-->
-<!--							<el-button v-if="hasPermission('program:registered:browse')&&(scope.row.createBy === $store.state.user.id||haveProjectIds.includes(scope.row.id))&&scope.row.issuedStatus === '4'" text type="primary"  @click="adjustIssued(scope.row)">驳回调整</el-button>-->
+<!--							&lt;!&ndash;外审发起&ndash;&gt;-->
+							<el-button v-if="hasPermission('jy_project:info:edit')&&(scope.row.createBy === $store.state.user.id) &&scope.row.reportIssuance === '5' && (scope.row.outInstance === null ||scope.row.outInstance === undefined ||scope.row.outInstance === '' ||scope.row.outInstance === '0' || scope.row.outInstance === '1' || scope.row.outInstance === '3')" text type="primary"  @click="issued(scope.row)">发起外审</el-button>
+<!--							&lt;!&ndash;外审撤回&ndash;&gt;-->
+							<el-button v-if="hasPermission('jy_project:info:edit')&&(scope.row.createBy === $store.state.user.id) && scope.row.outInstance === '2'" text type="primary"  @click="issuedReback(scope.row)">外审撤回</el-button>
+<!--							&lt;!&ndash; 外审  审核&ndash;&gt;-->
+							<el-button v-if="scope.row.outInstance==='2' && checkIsAuditIssued(scope.row)" text type="primary"  @click="examineIssued(scope.row)">外审审核</el-button>
+<!--							&lt;!&ndash; 外审  被驳回后当前申请人重新调整&ndash;&gt;-->
+							<el-button v-if="hasPermission('jy_project:info:edit')&&(scope.row.createBy === $store.state.user.id)&&scope.row.outInstance === '4'" text type="primary"  @click="adjustIssued(scope.row)">驳回调整</el-button>
 
 <!--							&lt;!&ndash;评估报告装订后的审核&ndash;&gt;-->
 <!--							<el-button v-if="hasPermission('program:registered:browse')&&(scope.row.createBy === $store.state.user.id||haveProjectIds.includes(scope.row.id))&&scope.row.issuedStatus === '5'&&scope.row.archiveStatus === '0'" text type="primary" @click="browse(scope.row.id)">装订自校</el-button>-->
@@ -342,7 +340,7 @@ export default {
 				name: '',
 				no: '',
 				createById: '',
-				primaryLinkman: '',//委托方
+				clientName: '',//委托方
 				contractName: '',
 				projectLeader:'',//项目负责人
 				createDates: [],
@@ -374,6 +372,8 @@ export default {
 			procDefKey2:'',
 			processDefinitionId3:'',
 			procDefKey3:'',
+			processDefinitionIdOut:'',
+			procDefKeyOut:'',
 		}
 	},
 	ProjectInfoService:null,
@@ -434,7 +434,7 @@ export default {
 		},
 		// 查看
 		view (row) {
-			this.$refs.projectDia.init('view', row.id,row.auditId1, row.auditId2, row.auditId3,row.sealId)
+			this.$refs.projectDia.init('view', row.id,row.auditId1, row.auditId2, row.auditId3,row.sealId,row.outInstanceId)
 		},
 		// 获取数据列表
 		refreshList () {
@@ -485,6 +485,12 @@ export default {
 					this.procDefKey3 = data.key
 				}
 			})
+			processService.getByName('嘉溢-项目外审').then((data) => {
+				if (!this.commonJS.isEmpty(data.id)) {
+					this.processDefinitionIdOut = data.id
+					this.procDefKeyOut = data.key
+				}
+			})
 		},
 		// 当前页
 		currentChangeHandle ({ currentPage, pageSize }) {
@@ -1133,6 +1139,138 @@ export default {
 					})
 				})
 			}
+		},
+		//外审发起
+		issued(row){
+			// 读取流程表单
+			let title = `发起流程【嘉溢-项目外审】`
+			let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了[嘉溢-项目外审]`
+			let status = 'startAndHold'
+			if (row.outInstance === '3') {
+				status = 'startAndClose'
+			} else if (row.outInstance === '4') {
+				status = 'reapplyFlag'
+			}
+			taskService.getTaskDef({ procDefId: this.processDefinitionIdOut,
+				businessId: row.outInstanceId,
+				businessTable: 'jy_project_outinstance'}).then((data) => {
+				this.$router.push({
+					path: '/flowable/task/TaskForm',
+					query: {
+						...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+						procDefId: this.processDefinitionIdOut,
+						procDefKey: this.procDefKeyOut,
+						title: title,
+						formType: data.formType,
+						formUrl: data.formUrl,
+						formTitle: processTitle,
+						businessTable: 'jy_project_outinstance',
+						businessId: row.outInstanceId,
+						isShow: 'false',
+						status: status,
+						routePath: '/jy/project/ProjectList'
+					}
+				})
+			})
+		},
+		// 查询当前登录人是否是数据的审核人  外审
+		checkIsAuditIssued (row) {
+			let loginUserId = this.$store.state.user.id  // 获取当前登录用户id
+			if (this.commonJS.isNotEmpty(row.outInstanceId)) {
+				for (const userId of row.outInstanceId) {
+					if (userId === loginUserId) {  // 当数据的审核人中包含当前登录人id时,返回true
+						return true
+					}
+				}
+			}
+			return false
+		},
+		//查看外审审批流程结果
+		outInstanceDetail(row){
+			if (row.outInstance !== '0' && row.outInstance !== '1') {
+				// eslint-disable-next-line eqeqeq
+				taskService.getTaskDef({
+					procInsId: row.procInsIdOut,
+					procDefId: this.processDefinitionIdOut
+				}).then((data) => {
+					this.$router.push({
+						path: '/flowable/task/TaskFormDetail',
+						query: {
+							...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+							isShow: 'false',
+							readOnly: true,
+							title: '外审' + '流程详情',
+							formTitle: '外审' + '流程详情',
+							businessId: row.outInstanceId,
+							status: 'reback'
+						}
+					})
+				})
+			}
+		},
+		//外审撤回
+		issuedReback(row){
+			this.$confirm(`确定要撤回该申请吗?`, '提示', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning'
+			}).then(async () => {
+				await this.projectInfoService.findByIdOut(row.outInstanceId).then((data) => {
+					if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+						this.$message.error('数据已发生改变或不存在,请刷新数据')
+						this.refreshList()
+					} else {
+						processService.revokeProcIns(row.procInsIdOut).then((data) => {
+							let form = {status: '3', id: row.outInstanceId}
+							this.projectInfoService.updateStatusByOutId(form)
+							this.$message.success(data)
+							this.refreshList()
+						})
+					}
+				})
+			})
+		},
+		//外审审核
+		examineIssued(row){
+			this.projectInfoService.findByIdOut(row.outInstanceId).then((data) => {
+				if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+					this.$message.error('数据已发生改变或不存在,请刷新数据')
+					this.refreshList()
+				} else {
+					this.todoOut(row)
+				}
+			})
+		},
+		// 审核或重新调整跳转  外审
+		todoOut (row) {
+			let cUser = false
+			taskService.getTaskDefInfo({
+				taskId: row.taskIdOut
+			}).then((data) => {
+				this.$router.push({
+					path: '/flowable/task/TaskForm',
+					query: {
+						...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId'),
+						isShow: false,
+						formReadOnly: true,
+						formTitle: `${data.taskName}`,
+						cUser: cUser,
+						title: `审批【${data.taskName || ''}】`,
+						routePath: '/jy/project/ProjectList'   // 数据处理后需要跳转的页面路径
+					}
+				})
+			})
+		},
+		//外审驳回后重新调整
+		adjustIssued(row){
+			this.projectInfoService.findByIdOut(row.outInstanceId).then((data) => {
+				if (data.status !== '4') { // status的值不等于“驳回”,就弹出提示
+					this.$message.error('数据已发生改变或不存在,请刷新数据')
+					this.refreshList()
+				} else {
+					this.todoOut(row)
+				}
+			})
 		}
 
 	}

+ 1 - 1
src/views/materialManagement/userSeal/SignetList.vue

@@ -509,7 +509,7 @@ export default {
 		},
 		//查看项目信息
 		openProject(row){
-			this.$refs.projectDia.init('view', row.id,row.auditId1, row.auditId2, row.auditId3,row.sealId)
+			this.$refs.projectDia.init('view', row.id,row.auditId1, row.auditId2, row.auditId3,row.sealId,row.outInstanceId)
 		}
     }
   }