{"remainingRequest":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\reform-fvue\\src\\views\\ReformPilotManage\\components\\ReformPilotManageDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\reform-fvue\\src\\views\\ReformPilotManage\\components\\ReformPilotManageDialog.vue","mtime":1687933939321},{"path":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport pilot from '@/api/pilotprojects'\r\nimport FormResultsDialog from './FormResultsDialog'\r\nimport filePreview from '@/components/FilePreview/filePreview.vue'\r\nimport UploadFile from '@/components/uploadFile/index.vue'\r\nimport FileList from '@/components/uploadFile/newFileList.vue'\r\nimport RejectInfoDialog from '@/components/dialog/RejectInfoDialog.vue'\r\nimport sat from '@/api/satisfaction/satisfaction'\r\nimport { TableMixin } from '@/mixins/tableMixin'\r\nimport req from '@/request.js'\r\nimport utils from '@/utils.js'\r\nconst portal = window.context.portal\r\nexport default {\r\n name: 'ReformPilotManageDialog',\r\n components: {\r\n FormResultsDialog,\r\n filePreview,\r\n UploadFile,\r\n RejectInfoDialog,\r\n FileList\r\n },\r\n mixins: [TableMixin],\r\n data() {\r\n var checkPilotSupervisor = (rule, value, callback) => {\r\n if (this.parameter.pilotLevel == '1') {\r\n if (!value) {\r\n return callback(new Error('请选择主管部委'))\r\n } else {\r\n callback()\r\n }\r\n } else {\r\n callback()\r\n }\r\n }\r\n var checkUnitName = (rule, value, callback) => {\r\n if (this.unitValue && !this.unitValue.length) {\r\n return callback(new Error('请选择市级主管部门'))\r\n } else {\r\n callback()\r\n }\r\n }\r\n var checkAcceptanceTime = (rule, value, callback) => {\r\n if (this.parameter.timePeriod == 1) {\r\n if (!value) {\r\n return callback(new Error('请根据文件规定的试点期限选择验收时间'))\r\n } else {\r\n callback()\r\n }\r\n } else {\r\n callback()\r\n }\r\n }\r\n var checkInvs = (rule, value, callback) => {\r\n if (!this.districtValue.length) {\r\n return callback(\r\n new Error('请选择部署该试点项目的文件中明确的所有参与试点区县')\r\n )\r\n } else {\r\n callback()\r\n }\r\n }\r\n return {\r\n isbtn: false,\r\n actionBtn: false,\r\n classified: 0, //0代表不涉密, 1代表涉密\r\n timeValue: null,\r\n options: [\r\n {\r\n value: 0,\r\n label: '长期'\r\n },\r\n {\r\n value: 1,\r\n label: '限时'\r\n }\r\n ],\r\n reqLoading: false,\r\n markLoading: false,\r\n dialogVisible: false,\r\n fileList: [],\r\n treeData: [],\r\n unitValue: [],\r\n formIsShow: true,\r\n isEdit: false,\r\n btnIsShow: false,\r\n activeCollapse1: '1',\r\n visible: false,\r\n title: '新增',\r\n rules: {\r\n timePeriod: [\r\n {\r\n required: true,\r\n message: '请选择试点期限',\r\n trigger: 'change'\r\n }\r\n ],\r\n unitName: [\r\n {\r\n required: true,\r\n validator: checkUnitName,\r\n trigger: 'change'\r\n }\r\n ],\r\n taskDetails: [\r\n {\r\n required: true,\r\n message: '请条目式总结提炼部署该试点项目文件中关于试点任务的描述',\r\n trigger: 'blur'\r\n }\r\n ],\r\n documentBasis: [\r\n {\r\n required: true,\r\n message: '请输入部署该试点项目的文件名称',\r\n trigger: 'blur'\r\n }\r\n ],\r\n pilotProjectName: [\r\n {\r\n required: true,\r\n message: '请输入试点项目名称',\r\n trigger: 'blur'\r\n }\r\n ],\r\n pilotLevel: [\r\n {\r\n required: true,\r\n message: '请选择试点层级',\r\n trigger: 'blur'\r\n }\r\n ],\r\n invs: [\r\n {\r\n required: true,\r\n validator: checkInvs,\r\n trigger: 'change'\r\n }\r\n ],\r\n pilotSupervisor: [\r\n {\r\n required: true,\r\n validator: checkPilotSupervisor,\r\n trigger: 'blur'\r\n }\r\n ],\r\n pilotField: [\r\n {\r\n required: true,\r\n message: '请选择所属领域',\r\n trigger: 'blur'\r\n }\r\n ],\r\n pilotRunway: [\r\n {\r\n required: true,\r\n message: '请选择所属跑道',\r\n trigger: 'blur'\r\n }\r\n ],\r\n startTime: [\r\n {\r\n required: true,\r\n message: '请选择部署该试点项目的文件印发时间',\r\n trigger: 'blur'\r\n }\r\n ],\r\n acceptanceTime: [\r\n {\r\n required: true,\r\n // message: '请根据文件规定的试点期限选择验收时间',\r\n validator: checkAcceptanceTime,\r\n trigger: 'blur'\r\n }\r\n ],\r\n pilotTarget: [\r\n {\r\n required: true,\r\n message: '请条目式总结提炼部署该试点项目文件中关于目标的描述',\r\n trigger: 'blur'\r\n }\r\n ]\r\n },\r\n queryParam: {\r\n pageBean: {\r\n page: 1,\r\n pageSize: -1\r\n }\r\n },\r\n parameter: {\r\n pilotProjectName: '',\r\n docNo: '',\r\n pilotLevel: '2',\r\n pilotSupervisor: '',\r\n startTime: '',\r\n acceptanceTime: '',\r\n classified: 1,\r\n invs: [],\r\n pilotTarget: '',\r\n taskDetails: '',\r\n status: '',\r\n id: '',\r\n docYear: '',\r\n docName: '',\r\n docNum: '',\r\n unitId: '',\r\n unitName: '',\r\n unitCode: '',\r\n unitGrade: '',\r\n pilotField: '',\r\n pilotRunway: '',\r\n documentBasis: '',\r\n timePeriod: null\r\n },\r\n parameter1: {\r\n propulsiveStatus: null,\r\n propulsiveDetails: '',\r\n existingProblems: '',\r\n workPlan: '',\r\n id: '',\r\n actualTime: ''\r\n },\r\n rules2: {\r\n propulsiveStatus: [\r\n { required: true, message: '请选择推进状态', trigger: 'blur' }\r\n ],\r\n actualTime: [\r\n { required: true, message: '请选择验收状态', trigger: 'change' }\r\n ]\r\n },\r\n districtValue: [],\r\n districtName: [],\r\n dataDocNo: '',\r\n routeName: '',\r\n saveLoading: false,\r\n saveLoading1: false,\r\n tableIndex: undefined,\r\n reqData: {\r\n groupRelation: 'AND',\r\n groupTree: {},\r\n pageBean: {\r\n page: 1,\r\n pageSize: 10,\r\n showTotal: true\r\n },\r\n params: {},\r\n querys: [\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: '',\r\n relation: 'AND',\r\n value: {}\r\n }\r\n ],\r\n sorter: [\r\n {\r\n direction: 'ASC',\r\n property: ''\r\n }\r\n ]\r\n },\r\n tableData: [],\r\n isEdit2: false,\r\n recordsId: '',\r\n deleteData: [],\r\n errorText: '',\r\n errorNum: null,\r\n districtData: [],\r\n isUpdate: false,\r\n pickerOptions: {\r\n disabledDate: time => {\r\n return time.getTime() > Date.now()\r\n }\r\n },\r\n pickerOptions2: {\r\n disabledDate: time => {\r\n return time.getTime() < new Date(this.parameter.startTime)\r\n }\r\n },\r\n historyData1: null,\r\n historyTable1: [],\r\n historyShow: false,\r\n editOrUpdate: true,\r\n treeItem: null,\r\n previewUrl: `${portal}/file/onlinePreviewController/v1/getFileById_`,\r\n approvalComments: [],\r\n docNo: '',\r\n isRepeat: true,\r\n // 文件是否涉密\r\n cipher: false,\r\n status: 0,\r\n fileType: '',\r\n recordOptions: [],\r\n // 历史验收材料附件ids \r\n checkIds: [],\r\n // 历史成果附件ids\r\n reslultIds: [],\r\n isRequest: true,\r\n removeIds:[]\r\n }\r\n },\r\n\r\n created() {\r\n this.treeData = JSON.parse(sessionStorage.getItem('responsibilityTree'))\r\n this.districtData = JSON.parse(sessionStorage.getItem('districtList'))\r\n this.recordOptions = utils.getDictItemsFromCache('sd_tjzt')\r\n },\r\n methods: {\r\n idExist(id) {\r\n if (!this.checkIds.includes(id)) {\r\n this.removeIds.push(id)\r\n console.log(this.removeIds);\r\n } \r\n // if (this.checkIds.includes(id)) {\r\n // // this.isRequest = false\r\n // } else {\r\n // // this.isRequest = true\r\n // }\r\n },\r\n // 批量删除附件\r\n // 保存时删除\r\n saveRemoveFiles() {\r\n let ids = this.removeIds.join(\",\")\r\n req.remove(portal + `/file/v1/?ids=${ids}`).then(res => {\r\n console.log(res);\r\n })\r\n },\r\n setAipher(val) {\r\n if (this.fileType === 'pilot') {\r\n this.classified = 1\r\n } else if (this.fileType === 'record') {\r\n this.$set(this.parameter1, 'classified', '1')\r\n }\r\n\r\n this.cipher = val\r\n let routeName = this.$route.name\r\n if (routeName != 'ReformPilotVerify' || this.actionBtn) {\r\n this.inputAddOrUpdata()\r\n }\r\n this.status == 4\r\n ? this.openInputVisible()\r\n : this.status == 5\r\n ? this.handlSaveAndeVerify({}, 5)\r\n : ''\r\n },\r\n getTreeItem(data, id) {\r\n data.map(item => {\r\n if (item.id == id) {\r\n this.treeItem = item\r\n // 结果赋值\r\n } else {\r\n if (item.children) {\r\n this.getTreeItem(item.children, id)\r\n }\r\n }\r\n })\r\n },\r\n getParentsById(list, id) {\r\n for (let item of list) {\r\n if (item.id == id) {\r\n return [item.id]\r\n }\r\n if (item.children) {\r\n let node = this.getParentsById(item.children, id)\r\n if (node !== undefined) {\r\n node.unshift(item.id)\r\n return node\r\n }\r\n }\r\n }\r\n },\r\n setdocName(e) {\r\n this.parameter.docName = e.replace(/\\s+/g, '')\r\n },\r\n // 打开弹框编辑\r\n add(item) {\r\n this.recordOptions.forEach(item => {\r\n item.disabled = false\r\n })\r\n let reqArr =\r\n item.id && item.recId\r\n ? [\r\n this.advanceRecordsById({ unitId: item.unitId, id: item.id }),\r\n this.getIds(item.id),\r\n this.getFindById(item.id)\r\n ]\r\n : item.id\r\n ? [this.getFindById(item.id), this.getIds(item.id)]\r\n : []\r\n Promise.all(reqArr).then(() => {\r\n this.reqLoading = false\r\n })\r\n // let idd = this.$route.name == 'ReformOfficeManagement' ? item.mainUnitId : item.unitId\r\n this.$nextTick(() => {\r\n this.unitValue = this.getParentsById(this.treeData, item.unitId)\r\n })\r\n let {\r\n pilotProjectName,\r\n docNo,\r\n pilotLevel,\r\n pilotSupervisor,\r\n startTime,\r\n acceptanceTime,\r\n classified,\r\n pilotTarget,\r\n taskDetails,\r\n status,\r\n docYear,\r\n docName,\r\n docNum,\r\n unitId,\r\n unitName,\r\n unitCode,\r\n unitGrade,\r\n pilotField,\r\n pilotRunway,\r\n id,\r\n documentBasis,\r\n mainUnitName,\r\n timePeriod,\r\n propulsiveStatus\r\n } = item\r\n this.getByDemandFiledData('ggbb_ssly', pilotField)\r\n this.classified = classified\r\n this.docNo = docNo\r\n this.parameter = {\r\n pilotProjectName,\r\n docNo,\r\n pilotLevel,\r\n pilotSupervisor,\r\n startTime,\r\n acceptanceTime,\r\n pilotTarget,\r\n taskDetails,\r\n status,\r\n docYear,\r\n docName,\r\n docNum,\r\n unitId,\r\n unitName,\r\n unitCode,\r\n unitGrade,\r\n pilotField,\r\n pilotRunway: pilotRunway + '',\r\n id,\r\n documentBasis,\r\n mainUnitName,\r\n timePeriod,\r\n propulsiveStatus\r\n }\r\n this.visible = true\r\n },\r\n onBtnBulr() {\r\n let { docName, docYear, docNum } = this.parameter\r\n if (docName && docYear && docNum) {\r\n this.inputBlur()\r\n }\r\n },\r\n // 校验文件号\r\n inputBlur() {\r\n return new Promise(reslove => {\r\n this.errorText = ''\r\n let { docName, docYear, docNum } = this.parameter\r\n let docNo = `${docName}【${docYear}】${docNum}号`\r\n if (docName && docYear && docNum) {\r\n if (!this.parameter.id || this.docNo != docNo) {\r\n pilot.docNoWhether(docNo, res => {\r\n if (!res) {\r\n this.isRepeat = false\r\n this.errorText = '该文件号已存在,请重新录入'\r\n reslove()\r\n } else {\r\n this.isRepeat = true\r\n reslove()\r\n }\r\n })\r\n } else {\r\n this.isRepeat = true\r\n reslove()\r\n }\r\n } else {\r\n this.isRepeat = false\r\n this.errorText = '请输入部署该试点项目的完整文号'\r\n reslove()\r\n }\r\n })\r\n },\r\n // ------------\r\n\r\n // 文件相关\r\n openUploade(type) {\r\n this.fileType = type\r\n this.$refs.uploadFile.open('Pilot')\r\n },\r\n setFileList(file) {\r\n if (this.fileType === 'pilot') {\r\n this.fileList.push(file)\r\n this.classified = 0\r\n } else if (this.fileType === 'record') {\r\n this.parameter1.fileList\r\n ? this.parameter1.fileList.push(file)\r\n : this.$set(this.parameter1, 'fileList', [file])\r\n this.parameter1.classified = ''\r\n }\r\n },\r\n beforeRemove(file, fileList) {\r\n this.$confirm(`确定删除 ${file.name}?`, this.$t('common.tips'), {\r\n confirmButtonText: this.$t('common.confirm'),\r\n cancelButtonText: this.$t('common.cancel'),\r\n type: 'warning'\r\n }).then(() => {\r\n let id = file.fileId\r\n ? file.fileId\r\n : file.id\r\n ? file.id\r\n : file.response.fileId\r\n sat.deleteFileById(id, res => {\r\n if (res.state) {\r\n this.$message.success('附件删除成功')\r\n let arr = this.fileList.filter(item => {\r\n let fileId = item.id || item.response.fileId\r\n if (fileId !== id) {\r\n return item\r\n }\r\n })\r\n if (arr.length == 0) {\r\n this.classified = 0\r\n }\r\n this.fileList = arr\r\n } else {\r\n this.$message.error('附件删除失败')\r\n }\r\n })\r\n })\r\n },\r\n handlePreview(file) {\r\n let id = file.fileId\r\n ? file.fileId\r\n : file.id\r\n ? file.id\r\n : file.response.fileId\r\n let type = file.extensionName\r\n ? file.extensionName\r\n : file.name.split('.')[1]\r\n this.$refs.filePreview.previewUrl = this.previewUrl + id\r\n this.$refs.filePreview.open(type)\r\n },\r\n changeFileList(arr, type) {\r\n console.log(arr);\r\n if (type === 'pilot') {\r\n this.fileList = arr\r\n } else if (type === 'record') {\r\n this.$set(this.parameter1, 'fileList', arr)\r\n }\r\n },\r\n // 文件下载\r\n handleDownloadFile(file) {\r\n let id = file.fileId\r\n ? file.fileId\r\n : file.id\r\n ? file.id\r\n : file.response.fileId\r\n window.open(portal + `/file/v1/downloadFile?fileId=${id}`, '_self')\r\n },\r\n // ------------\r\n // 区县id\r\n valueChange(value) {\r\n this.parameter.invs = value\r\n },\r\n // 新增数或者修改,试点项目录入\r\n inputAddOrUpdata() {\r\n this.$refs['formInfo'].validate(valid => {\r\n let routeName = this.$route.name\r\n let falg =\r\n routeName == 'ReformPilotVerify'\r\n ? valid\r\n : (valid && this.classified) || (valid && this.fileList.length != 0)\r\n if (falg) {\r\n this.$confirm('确认提交吗?', this.$t('common.tips'), {\r\n confirmButtonText: this.$t('common.confirm'),\r\n cancelButtonText: this.$t('common.cancel'),\r\n type: 'success'\r\n })\r\n .then(() => {\r\n this.markLoading = true\r\n this.inputBlur().then(() => {\r\n if (this.isRepeat) {\r\n let data = JSON.parse(JSON.stringify(this.parameter))\r\n let unitIdArr = JSON.parse(JSON.stringify(this.unitValue))\r\n let itemId = unitIdArr.pop()\r\n this.getTreeItem(this.treeData, itemId)\r\n console.log(this.treeItem)\r\n let { id, name, code, grade } = this.treeItem\r\n data.unitId = id || ''\r\n data.unitName = name || ''\r\n data.unitCode = code || ''\r\n data.unitGrade = grade || ''\r\n data.docNo = `${data.docName}【${data.docYear}】${data.docNum}号`\r\n let arr = []\r\n data.invs.forEach(id => {\r\n this.districtData.forEach(item => {\r\n if (item.id == id) {\r\n let { id, code, grade, name } = item\r\n arr = [\r\n ...arr,\r\n {\r\n unitId: id,\r\n unitName: name,\r\n unitCode: code,\r\n unitGrade: grade\r\n }\r\n ]\r\n }\r\n })\r\n })\r\n data.invs = arr\r\n if (!data.timePeriod) {\r\n data.acceptanceTime = ''\r\n }\r\n if (this.fileList) {\r\n let ids = this.fileList.map(item => {\r\n return item.id ? item.id : item.response.fileId\r\n })\r\n data.ids = ids\r\n }\r\n data.classified = this.classified\r\n\r\n this.cipher = false\r\n !this.isUpdate ? this.addInfo(data) : this.updateInfo(data)\r\n } else {\r\n this.markLoading = false\r\n this.$confirm(this.errorText, '提示', {\r\n cancelButtonText: '关闭',\r\n showConfirmButton: false,\r\n type: 'error'\r\n })\r\n }\r\n })\r\n })\r\n .catch(() => {\r\n this.markLoading = false\r\n })\r\n } else {\r\n if (!valid) {\r\n this.$confirm('请填写完整信息。', '提示', {\r\n cancelButtonText: '关闭',\r\n showConfirmButton: false,\r\n type: 'error'\r\n })\r\n } else if (this.classified != 1 && this.fileList.length == 0) {\r\n this.$confirm('请上传佐证材料后保存。', '提示', {\r\n confirmButtonText: '立即上传',\r\n cancelButtonText: '关闭',\r\n type: 'error'\r\n }).then(() => {\r\n this.openUploade('pilot')\r\n })\r\n }\r\n }\r\n })\r\n },\r\n // 添加录入信息(试点项目录入)\r\n addInfo(data) {\r\n pilot.addPolotProject(data, res => {\r\n this.$emit('sendMsg')\r\n this.handleClose()\r\n this.$message.success('录入试点项目成功')\r\n this.saveLoading1 = false\r\n this.markLoading = false\r\n this.removeIds.length&&this.saveRemoveFiles()\r\n })\r\n },\r\n // 修改试点项目信息(试点项目录入)\r\n updateInfo(data) {\r\n let routeName = this.$route.name\r\n if (routeName == 'ReformPilotEntry') {\r\n data.status = 0\r\n }\r\n if (routeName == 'ReformOfficeManagement') {\r\n data.status = data.status\r\n }\r\n pilot.updatePoltproject(data, res => {\r\n this.$emit('sendMsg')\r\n this.handleClose()\r\n this.$message.success('修改试点项目信息成功')\r\n this.saveLoading1 = false\r\n this.markLoading = false\r\n this.removeIds.length&&this.saveRemoveFiles()\r\n })\r\n },\r\n // 推进录入新增或修改\r\n inputTjAddOrUpate() {\r\n console.log(111111111);\r\n this.$refs.formInfo2.validate(valid => {\r\n // this.markLoading = true\r\n if (valid) {\r\n let data = JSON.parse(JSON.stringify(this.parameter1))\r\n if (data.propulsiveStatus != 3) {\r\n data.actualTime = ''\r\n }\r\n let arr = this.tableData.map(item => {\r\n if (this.isUpdate) {\r\n item.id = ''\r\n }\r\n return item\r\n })\r\n arr.forEach(item => {\r\n item.ids = item.fileList\r\n ? item.fileList.map(file => file.id || file.response.fileId)\r\n : []\r\n })\r\n data.results = arr\r\n data.ids = data.fileList && data.fileList.map(file => file.id || file.response.fileId)\r\n data.pilotId = this.parameter.id\r\n data.approvalComments = ''\r\n if (data.propulsiveStatus != 3 || (data.ids && data.ids.length) || data.classified === 1 || data.classified === '1') {\r\n if (data.results.length == 0) {\r\n this.$confirm('没有录入试点成果内容,是否保存?', '提示', {\r\n confirmButtonText: '保存',\r\n cancelButtonText: '取消',\r\n type: 'warning'\r\n })\r\n .then(() => {\r\n this.markLoading = true\r\n this.isUpdate\r\n ? this.updateInputInfo(data)\r\n : this.inputInfo(data)\r\n })\r\n .catch(() => { })\r\n } else {\r\n this.$confirm('确认保存?', '提示', {\r\n confirmButtonText: '保存',\r\n cancelButtonText: '取消',\r\n type: 'warning'\r\n })\r\n .then(() => {\r\n this.markLoading = true\r\n this.isUpdate\r\n ? this.updateInputInfo(data)\r\n : this.inputInfo(data)\r\n })\r\n .catch(() => { })\r\n }\r\n } else {\r\n this.$confirm('请上传相关验收材料后保存?', '提示', {\r\n confirmButtonText: '立即上传',\r\n cancelButtonText: '取消',\r\n type: 'error'\r\n })\r\n .then(() => {\r\n this.openUploade('record')\r\n })\r\n .catch(() => { })\r\n }\r\n\r\n } else {\r\n this.$confirm('请录入完整信息后保存。', '提示', {\r\n cancelButtonText: '关闭',\r\n showConfirmButton: false,\r\n type: 'warning'\r\n }).then(() => {\r\n this.markLoading = false\r\n })\r\n }\r\n })\r\n },\r\n // 新增\r\n inputInfo(data) {\r\n if (this.$route.name == 'DistrictPromotioneEntry') {\r\n data.status = 0\r\n }\r\n pilot.inputUpdate(data, res => {\r\n this.$emit('sendMsg')\r\n this.handleClose()\r\n this.$message.success('录入更新成功')\r\n this.markLoading = false\r\n this.removeIds.length&&this.saveRemoveFiles()\r\n })\r\n },\r\n // 修改\r\n updateInputInfo(data) {\r\n if (this.$route.name == 'DistrictPromotioneEntry') {\r\n data.status = 0\r\n }\r\n\r\n pilot.modifyEntry(data, res => {\r\n this.$emit('sendMsg')\r\n this.handleClose()\r\n this.$message.success('修改更新成功')\r\n this.markLoading = false\r\n this.removeIds.length&&this.saveRemoveFiles()\r\n })\r\n },\r\n handleAddOrUpdate() {\r\n let routeName = this.$route.name\r\n routeName == 'DistrictPromotioneEntry'\r\n ? this.inputTjAddOrUpate()\r\n : this.inputAddOrUpdata()\r\n },\r\n // 根据id查询涉及区县列表\r\n getFindById(id) {\r\n return new Promise(reslove => {\r\n pilot.getFindById(id, res => {\r\n this.approvalComments = res.approvalComments\r\n ? res.approvalComments.split('$_$')\r\n : []\r\n this.parameter.invs = res.invs\r\n this.districtValue = res.invs ? res.invs.map(val => val.unitId) : []\r\n this.districtName = res.invs ? res.invs.map(val => val.unitName) : []\r\n reslove()\r\n })\r\n })\r\n },\r\n // 根据主表id查询推进表信息\r\n advanceRecordsById(id) {\r\n return new Promise(resolve => {\r\n pilot.advanceRecordsById(id, res => {\r\n if (res.value.length) {\r\n this.parameter1 = res.value[0] || {}\r\n this.parameter1.approvalComments = this.parameter1.approvalComments && this.parameter1.approvalComments.split('$_$')\r\n this.tableData = res.value[0].results || []\r\n if (this.title === '更新' && (res.value[0].status == 7 || res.value[0].status == 9 || res.value[0].status == 11 || res.value[0].status == 12)) {\r\n this.historyData1 = JSON.parse(JSON.stringify(this.parameter1))\r\n // 历史验收材料附件ids\r\n this.checkIds = this.historyData1.fileList && this.historyData1.fileList.map(item => item.id)\r\n // 历史成果附件ids\r\n this.historyData1.results && this.historyData1.results.forEach(item => {\r\n let arr = item.fileList.map(file => file.id)\r\n this.reslultIds = [...this.reslultIds, ...arr]\r\n })\r\n this.parameter1.id = ''\r\n this.parameter1.results && this.parameter1.results.forEach(item => { item.id = '' })\r\n if (res.value[0].status === 12) {\r\n this.recordOptions.forEach(item => {\r\n if (item.value - 0 < res.value[0].propulsiveStatus) {\r\n item.disabled = true\r\n }\r\n })\r\n }\r\n } else {\r\n if (res.value[1]) {\r\n this.historyData1 = res.value[1] || null\r\n // 历史验收材料附件ids\r\n this.checkIds = this.historyData1.fileList && this.historyData1.fileList.map(item => item.id)\r\n // 历史成果附件ids\r\n this.historyData1.results && this.historyData1.results.forEach(item => {\r\n let arr = item.fileList.map(file => file.id)\r\n this.reslultIds = [...this.reslultIds, ...arr]\r\n })\r\n this.historyData1.approvalComments = res.value[1].approvalComments && res.value[1].approvalComments.split('$_$')\r\n if (res.value[1].status === 12) {\r\n this.recordOptions.forEach(item => {\r\n if (item.value - 0 < res.value[1].propulsiveStatus) {\r\n item.disabled = true\r\n }\r\n })\r\n }\r\n }\r\n }\r\n }\r\n resolve()\r\n })\r\n })\r\n },\r\n // 编辑后并通过\r\n handlSaveAndeVerify(data1, status) {\r\n this.status = 5\r\n this.$refs['formInfo'].validate(valid => {\r\n let falg =\r\n (valid && this.classified) || (valid && this.fileList.length != 0)\r\n if (falg) {\r\n this.$confirm('确认通过吗?', this.$t('common.tips'), {\r\n confirmButtonText: this.$t('common.confirm'),\r\n cancelButtonText: this.$t('common.cancel'),\r\n type: 'success'\r\n })\r\n .then(() => {\r\n this.markLoading = true\r\n this.inputBlur().then(() => {\r\n if (this.isRepeat) {\r\n let data = JSON.parse(JSON.stringify(this.parameter))\r\n let unitIdArr = JSON.parse(JSON.stringify(this.unitValue))\r\n let itemId = unitIdArr.pop()\r\n this.getTreeItem(this.treeData, itemId)\r\n let { id, name, code, grade } = this.treeItem\r\n data.unitId = id || ''\r\n data.unitName = name || ''\r\n data.unitCode = code || ''\r\n data.unitGrade = grade || ''\r\n data.docNo = `${data.docName}【${data.docYear}】${data.docNum}号`\r\n let arr = []\r\n data.invs.forEach(id => {\r\n this.districtData.forEach(item => {\r\n if (item.id == id) {\r\n let { id, code, grade, name } = item\r\n arr = [\r\n ...arr,\r\n {\r\n unitId: id,\r\n unitName: name,\r\n unitCode: code,\r\n unitGrade: grade\r\n }\r\n ]\r\n }\r\n })\r\n })\r\n data.invs = arr\r\n if (this.fileList) {\r\n let ids = this.fileList.map(item => {\r\n return item.id ? item.id : item.response.fileId\r\n })\r\n data.ids = ids\r\n }\r\n data.classified = this.classified\r\n pilot.updatePoltproject(data, res => {\r\n this.handleVerify(data1, status)\r\n })\r\n } else {\r\n this.markLoading = false\r\n this.$confirm(this.errorText, '提示', {\r\n cancelButtonText: '关闭',\r\n showConfirmButton: false,\r\n type: 'error'\r\n })\r\n }\r\n })\r\n })\r\n .catch(() => {\r\n this.markLoading = false\r\n })\r\n } else {\r\n if (!valid) {\r\n this.$confirm('请填写完整信息。', '提示', {\r\n cancelButtonText: '关闭',\r\n showConfirmButton: false,\r\n type: 'error'\r\n })\r\n } else if (this.classified != 1 && this.fileList.length == 0) {\r\n this.$confirm('请上传佐证材料后保存。', '提示', {\r\n confirmButtonText: '立即上传',\r\n cancelButtonText: '关闭',\r\n type: 'error'\r\n }).then(() => {\r\n this.openUploade('pilot')\r\n })\r\n }\r\n }\r\n })\r\n },\r\n // 根据id查询附件信息\r\n getIds(id) {\r\n return new Promise(resolve => {\r\n let data = JSON.parse(JSON.stringify(this.reqData))\r\n data.querys = [\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: 'biz_id_',\r\n relation: 'AND',\r\n value: id\r\n }\r\n ]\r\n pilot.getIds(data, res => {\r\n let arr = []\r\n res.rows.forEach(item => {\r\n let { id, fileName, extensionName } = item\r\n let url = `${portal}/file/onlinePreviewController/v1/getFileById_${id}`\r\n let obj = {\r\n id,\r\n name: `${fileName}.${extensionName}`,\r\n url,\r\n fileType: extensionName\r\n }\r\n arr.push(obj)\r\n })\r\n this.fileList = arr\r\n this.$refs.FormResultsDialog.fileList = arr\r\n resolve()\r\n })\r\n })\r\n },\r\n openInputVisible() {\r\n this.status = this.$route.name == 'ReformPilotConfirm' ? 11 : 4\r\n if (this.status == 4) {\r\n this.$refs['formInfo'].validate(valid => {\r\n let falg =\r\n (valid && this.classified) || (valid && this.fileList.length != 0)\r\n if (falg) {\r\n this.$confirm('确认驳回吗?', this.$t('common.tips'), {\r\n confirmButtonText: this.$t('common.confirm'),\r\n cancelButtonText: this.$t('common.cancel'),\r\n type: 'error'\r\n }).then(() => {\r\n // this.markLoading = true\r\n this.inputBlur().then(() => {\r\n if (this.isRepeat) {\r\n this.$refs.RejectInfoDialog.open()\r\n } else {\r\n this.markLoading = false\r\n this.$confirm(this.errorText, '提示', {\r\n cancelButtonText: '关闭',\r\n showConfirmButton: false,\r\n type: 'error'\r\n })\r\n }\r\n })\r\n })\r\n } else {\r\n if (!valid) {\r\n this.$confirm('请填写完整信息。', '提示', {\r\n cancelButtonText: '关闭',\r\n showConfirmButton: false,\r\n type: 'error'\r\n })\r\n } else if (this.classified != 1 && this.fileList.length == 0) {\r\n this.$confirm('请上传佐证材料后保存。', '提示', {\r\n confirmButtonText: '立即上传',\r\n cancelButtonText: '关闭',\r\n type: 'error'\r\n }).then(() => {\r\n this.openUploade('pilot')\r\n })\r\n }\r\n }\r\n })\r\n } else {\r\n this.$refs.formInfo2.validate(valid => {\r\n if (valid) {\r\n let pushArr = this.tableData.map(item => {\r\n item.id = ''\r\n return item\r\n })\r\n pushArr.forEach(item => {\r\n item.ids = item.fileList\r\n ? item.fileList.map(file => file.id || file.response.fileId)\r\n : []\r\n })\r\n if (pushArr.length == 0) {\r\n this.$confirm('没有录入试点成果内容,是否确认驳回?', '提示', {\r\n confirmButtonText: '确定',\r\n cancelButtonText: '取消',\r\n type: 'error'\r\n })\r\n .then(() => {\r\n this.$refs.RejectInfoDialog.open()\r\n })\r\n .catch(() => {\r\n this.markLoading = false\r\n })\r\n } else {\r\n this.$confirm('确认驳回?', '提示', {\r\n confirmButtonText: '确定',\r\n cancelButtonText: '取消',\r\n type: 'error'\r\n })\r\n .then(() => {\r\n this.$refs.RejectInfoDialog.open()\r\n })\r\n .catch(() => { })\r\n }\r\n }\r\n })\r\n }\r\n },\r\n sendRejectInfo(approvalComments) {\r\n if (this.status == 4) {\r\n let data = JSON.parse(JSON.stringify(this.parameter))\r\n let unitIdArr = JSON.parse(JSON.stringify(this.unitValue))\r\n let itemId = unitIdArr.pop()\r\n this.getTreeItem(this.treeData, itemId)\r\n console.log(this.treeItem)\r\n let { id, name, code, grade } = this.treeItem\r\n data.unitId = id || ''\r\n data.unitName = name || ''\r\n data.unitCode = code || ''\r\n data.unitGrade = grade || ''\r\n data.docNo = `${data.docName}【${data.docYear}】${data.docNum}号`\r\n let arr = []\r\n data.invs.forEach(id => {\r\n this.districtData.forEach(item => {\r\n if (item.id == id) {\r\n let { id, code, grade, name } = item\r\n arr = [\r\n ...arr,\r\n {\r\n unitId: id,\r\n unitName: name,\r\n unitCode: code,\r\n unitGrade: grade\r\n }\r\n ]\r\n }\r\n })\r\n })\r\n data.invs = arr\r\n if (this.fileList) {\r\n let ids = this.fileList.map(item => {\r\n return item.id ? item.id : item.response.fileId\r\n })\r\n data.ids = ids\r\n }\r\n data.classified = this.classified\r\n this.markLoading = true\r\n pilot.updatePoltproject(data, res => {\r\n this.handleVerify(approvalComments, 4)\r\n })\r\n } else {\r\n this.markLoading = true\r\n let pushData = this.parameter1\r\n let pushArr = this.tableData.map(item => {\r\n item.id = ''\r\n return item\r\n })\r\n pushArr.forEach(item => {\r\n item.ids = item.fileList\r\n ? item.fileList.map(file => file.id || file.response.fileId)\r\n : []\r\n })\r\n pushData.results = pushArr\r\n pushData.pilotId = this.parameter.id\r\n pushData.status = 11\r\n pushData.approvalComments = approvalComments\r\n this.updateInputInfo(pushData)\r\n }\r\n },\r\n // 通过\r\n handleVerify(approvalComments, status) {\r\n let data = {\r\n status,\r\n id: this.parameter.id\r\n }\r\n if (status == 4 && approvalComments) {\r\n data.approvalComments = approvalComments\r\n }\r\n let msg = status == 5 ? '通过成功' : '驳回成功'\r\n pilot.updateStatusById(data, res => {\r\n if (res.state) {\r\n this.$emit('sendMsg')\r\n this.handleClose()\r\n this.$message.success(msg)\r\n this.removeIds.length&&this.saveRemoveFiles()\r\n }\r\n this.saveLoading = false\r\n this.markLoading = false\r\n })\r\n },\r\n\r\n addResult(item, index) {\r\n console.log(this.reslultIds);\r\n this.tableIndex = index\r\n this.$refs.FormResultsDialog.reslultIds = this.reslultIds\r\n this.$refs.FormResultsDialog.open(item)\r\n },\r\n // 添加成果形式\r\n pushTableData(data,ids) {\r\n let arr = JSON.parse(JSON.stringify(this.tableData))\r\n if (!arr.length || this.tableIndex === undefined) {\r\n arr.push(data)\r\n } else {\r\n arr.splice(this.tableIndex, 1, data)\r\n }\r\n this.tableData = arr\r\n this.removeIds = [...this.removeIds,...ids]\r\n },\r\n // 删除\r\n deleteDate(index) {\r\n this.tableData.splice(index, 1)\r\n },\r\n\r\n handlPushVerify() {\r\n this.$refs.formInfo2.validate(valid => {\r\n if (valid) {\r\n let pushData = this.parameter1\r\n let pushArr = this.tableData.map(item => {\r\n item.id = ''\r\n return item\r\n })\r\n pushArr.forEach(item => {\r\n item.ids = item.fileList\r\n ? item.fileList.map(file => file.id || file.response.fileId)\r\n : []\r\n })\r\n pushData.results = pushArr\r\n pushData.pilotId = this.parameter.id\r\n pushData.approvalComments = ''\r\n pushData.status = 12\r\n if (pushData.results.length == 0) {\r\n this.$confirm('没有录入试点成果内容,是否确认通过?', '提示', {\r\n confirmButtonText: '确定',\r\n cancelButtonText: '取消',\r\n type: 'warning'\r\n })\r\n .then(() => {\r\n this.markLoading = true\r\n this.updateInputInfo(pushData)\r\n })\r\n .catch(() => { })\r\n } else {\r\n this.$confirm('确认通过?', '提示', {\r\n confirmButtonText: '确定',\r\n cancelButtonText: '取消',\r\n type: 'warning'\r\n })\r\n .then(() => {\r\n this.markLoading = true\r\n this.updateInputInfo(pushData)\r\n })\r\n .catch(() => { })\r\n }\r\n }\r\n })\r\n },\r\n handlePushUpdate() {\r\n this.$refs.formInfo2.validate(valid => {\r\n if (valid) {\r\n let pushData = JSON.parse(JSON.stringify(this.parameter1))\r\n let pushArr = this.tableData.map(item => {\r\n item.id = ''\r\n return item\r\n })\r\n pushArr.forEach(item => {\r\n item.ids = item.fileList\r\n ? item.fileList.map(file => file.id || file.response.fileId)\r\n : []\r\n })\r\n pushData.results = pushArr\r\n pushData.approvalComments =\r\n pushData.approvalComments.length === 0\r\n ? ''\r\n : pushData.approvalComments.join('$_$')\r\n pushData.pilotId = this.parameter.id\r\n if (pushData.results.length == 0) {\r\n this.$confirm('没有录入试点成果内容,是否确认修改?', '提示', {\r\n confirmButtonText: '确定',\r\n cancelButtonText: '取消',\r\n type: 'warning'\r\n })\r\n .then(() => {\r\n this.markLoading = true\r\n this.updateInputInfo(pushData)\r\n })\r\n .catch(() => { })\r\n } else {\r\n this.$confirm('确认修改?', '提示', {\r\n confirmButtonText: '确定',\r\n cancelButtonText: '取消',\r\n type: 'warning'\r\n })\r\n .then(() => {\r\n this.markLoading = true\r\n this.updateInputInfo(pushData)\r\n })\r\n .catch(() => { })\r\n }\r\n }\r\n })\r\n },\r\n\r\n // 关闭新增人员窗口\r\n handleClose() {\r\n this.isbtn = false\r\n this.historyShow = false\r\n this.errorText = ''\r\n this.visible = false\r\n this.title = ''\r\n this.parameter = {\r\n pilotProjectName: '',\r\n docNo: '',\r\n pilotLevel: '2',\r\n pilotSupervisor: '',\r\n startTime: '',\r\n acceptanceTime: '',\r\n classified: 1,\r\n invs: [],\r\n pilotTarget: '',\r\n taskDetails: '',\r\n status: '',\r\n id: '',\r\n docYear: '',\r\n docName: '',\r\n docNum: '',\r\n unitId: '',\r\n unitName: '',\r\n unitCode: '',\r\n unitGrade: '',\r\n pilotField: '',\r\n pilotRunway: ''\r\n }\r\n this.districtValue = []\r\n if (this.$refs.formInfo) {\r\n this.$refs.formInfo.resetFields()\r\n }\r\n this.routeName = ''\r\n this.tableData = []\r\n this.parameter1 = {}\r\n this.isEdit2 = true\r\n if (this.$refs.formInfo2) {\r\n this.$refs.formInfo2.resetFields()\r\n }\r\n this.fileList = []\r\n this.tableIndex = undefined\r\n this.unitValue = []\r\n setTimeout(() => {\r\n this.btnIsShow = false\r\n this.isEdit = false\r\n }, 500)\r\n this.approvalComments = []\r\n this.classified = 0\r\n this.historyData1 = null\r\n }\r\n }\r\n}\r\n",null]}