{"remainingRequest":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\reform-fvue\\src\\views\\MajorReformProjects\\MonthlyPlan\\components\\MonthlyPlanDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\reform-fvue\\src\\views\\MajorReformProjects\\MonthlyPlan\\components\\MonthlyPlanDialog.vue","mtime":1744686695569},{"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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 UploadFile from '@/components/uploadFile/index.vue'\r\nimport filePreview from '@/components/FilePreview/filePreview.vue'\r\nimport FileList from '@/components/uploadFile/newFileList.vue'\r\nimport apiList from '@/api/MajorReformProjects/MonthlyPlan'\r\nimport publicApi from '@/api/publicApi'\r\nimport { TableMixin } from '@/mixins/tableMixin'\r\nimport moment from 'moment'\r\nimport RejectInfoBlockDialog from '@/components/dialog/RejectInfoBlockDialog.vue'\r\nimport req from '@/request.js'\r\nimport utils from '@/utils.js'\r\nconst portal = window.context.portal\r\nexport default {\r\n name: 'MonthlyPlanDialog',\r\n components: { RejectInfoBlockDialog, FileList, filePreview, UploadFile },\r\n mixins: [TableMixin],\r\n data() {\r\n // 验证函数\r\n let validate = (rule, value, callback) => {\r\n let index = rule.fullField.split('.')[1]\r\n let isOver = this.formData.pilotMeasuresPushList[index].isOver\r\n\r\n // 当为空值且为必填时,抛出错误,反之通过校验 defaultFileList\r\n\r\n if (rule.type == '附件') {\r\n let classified =\r\n this.formData.pilotMeasuresPushList[index].classified\r\n let fileList =\r\n this.formData.pilotMeasuresPushList[index].defaultFileList\r\n console.log(\r\n isOver == 3 &&\r\n classified == '' &&\r\n (!fileList || !fileList.length),\r\n classified\r\n )\r\n if (\r\n isOver == 3 &&\r\n classified == '' &&\r\n (!fileList || !fileList.length)\r\n ) {\r\n callback(\r\n new Error(\r\n `计划已完成,请上传${rule.type}或选择内网上传`\r\n )\r\n )\r\n } else {\r\n callback()\r\n }\r\n } else {\r\n if (!value && isOver == 3) {\r\n callback(new Error(`计划已完成,请输入${rule.type}`))\r\n } else {\r\n callback()\r\n }\r\n }\r\n }\r\n return {\r\n activities: [],\r\n activeName: '',\r\n form: {},\r\n title: '',\r\n projectInfo: {}, // 项目基础信息\r\n status: null, // 审核状态\r\n btnType: '', // 按钮类型 'read, audit, save'\r\n type: '', // 弹窗类型 0待更新 1责任审核 2市级确认\r\n formVisible: false, // 弹窗展示flag\r\n showDetails: false, // 查看详情flag\r\n saveLoading: false, // 保存按钮flag\r\n markLoading: false,\r\n reqLoading: false,\r\n loadType: '',\r\n activeCollapse: ['1', '3'],\r\n disabled: false,\r\n fillDate: moment().format('YYYY-MM'),\r\n loading: false,\r\n approvalComments: '', // 驳回理由\r\n approvalCommentsList: [],\r\n formData: {\r\n pilotProjectFill: {\r\n projectId: '',\r\n projectName: '',\r\n },\r\n pilotMeasuresPushList: [],\r\n pilotSpecificSchedulePushList: [\r\n {\r\n resultName: '', //成果的名称\r\n measuresPlanType: 1, //成果的类型\r\n basis: '', //相关依据\r\n defaultFileList: [], //附件\r\n classified: '', //文件涉密\r\n pushDate: '', //成果形成时间\r\n },\r\n ],\r\n },\r\n pickerOptions: {\r\n disabledDate: (time) => {\r\n return time.getTime() > Date.now()\r\n },\r\n },\r\n rules: {\r\n isOver: [\r\n {\r\n required: true,\r\n message: '请选择是否完成',\r\n trigger: 'change',\r\n },\r\n ],\r\n completedWork: [{ validator: validate, type: '已完成工作' }],\r\n problems: [{ validator: validate, type: '存在问题' }],\r\n // workPlan: [{validator: validate, type: '下一步工作计划'}],\r\n workPlan: [\r\n {\r\n required: true,\r\n message: '请输入下一步工作计划',\r\n trigger: 'blur',\r\n },\r\n ],\r\n hasFile: [\r\n { validator: validate, type: '附件', trigger: 'change' },\r\n ],\r\n },\r\n addFileIndex: null,\r\n uploadType: '',\r\n historyFillDate: null,\r\n routeName: '',\r\n checkIds: [],\r\n removeIds: [],\r\n czwtOptions: []\r\n }\r\n },\r\n\r\n created() {\r\n this.czwtOptions = utils.getDictItemsFromCache('yd_czwt')\r\n this.routeName = this.$route.name\r\n },\r\n methods: {\r\n // setFillingTime() {\r\n // publicApi.setFillingTime(data, res => {\r\n // console.log(res);\r\n // })\r\n // },\r\n getNowDate() {\r\n return new Promise(resolve => {\r\n publicApi.getNowDate(res => {\r\n if (res) {\r\n let serverTime = Date.parse(res)\r\n let arr = res.split(' ')\r\n let dateArr = arr[0].split('-')\r\n let year = dateArr[0]\r\n let month = dateArr[1]\r\n let date = ''\r\n // if (month === '05' || month == '10') {\r\n if (month % 2 !== 0 || month == 9 || month == 12) {\r\n let time = `${year}-${month}-31 18:00:00`\r\n if (serverTime <= Date.parse(time)) {\r\n let newMonth = month < 2 ? 12 : month - 1\r\n if (newMonth < 10) {\r\n newMonth = '0' + newMonth\r\n }\r\n date = (newMonth === 12 ? year - 1 : year) + '-' + newMonth\r\n } else {\r\n date = year + '-' + month\r\n }\r\n } else {\r\n let time = `${year}-${month}-30 18:00:00`\r\n if (serverTime <= Date.parse(time)) {\r\n let newMonth = month < 2 ? 12 : month - 1\r\n if (newMonth < 10) {\r\n newMonth = '0' + newMonth\r\n }\r\n date = year + '-' + newMonth\r\n } else {\r\n date = year + '-' + month\r\n }\r\n }\r\n\r\n let { projectId, fillDate } = this.projectInfo\r\n let reqData = {\r\n projectId,\r\n fillDate,\r\n flowType: 2,\r\n nowDate: date + '-' + '01'\r\n }\r\n if (fillDate) {\r\n publicApi.setFillingTime(reqData, res => {\r\n let time = res.value === -1 ? reqData.fillDate : reqData.nowDate\r\n resolve(time)\r\n })\r\n } else {\r\n resolve(reqData.nowDate)\r\n }\r\n\r\n }\r\n })\r\n\r\n })\r\n },\r\n // 文件相关\r\n openUploade(index, type, uploadType) {\r\n this.uploadType = uploadType\r\n this.addFileIndex = index\r\n this.$refs.uploadFile.open(type)\r\n },\r\n setFileList(file) {\r\n let formatFile = {\r\n ...file,\r\n id: file.response.fileId,\r\n }\r\n if (\r\n this.formData[this.uploadType][this.addFileIndex]\r\n .defaultFileList\r\n ) {\r\n this.formData[this.uploadType][\r\n this.addFileIndex\r\n ].defaultFileList.push(formatFile)\r\n } else {\r\n this.$set(\r\n this.formData[this.uploadType][this.addFileIndex],\r\n 'defaultFileList',\r\n []\r\n )\r\n this.formData[this.uploadType][\r\n this.addFileIndex\r\n ].defaultFileList.push(formatFile)\r\n }\r\n\r\n if (this.uploadType == 'pilotMeasuresPushList') {\r\n this.formData[this.uploadType][this.addFileIndex].hasFile = true\r\n this.$refs.form.validate('hasFile')\r\n }\r\n console.log(this.formData)\r\n },\r\n changeFileList(data, index, type) {\r\n this.formData[type][index].defaultFileList = data\r\n if (type == 'pilotMeasuresPushList') {\r\n if (!this.formData[type][index].defaultFileList.length) {\r\n this.formData[type][index].hasFile = false\r\n }\r\n this.$refs.form.validate('hasFile')\r\n }\r\n console.log(this.formData)\r\n },\r\n setAipher() {\r\n if (this.uploadType == 'pilotMeasuresPushList') {\r\n this.$refs.form.validate('hasFile')\r\n }\r\n this.$set(\r\n this.formData[this.uploadType][this.addFileIndex],\r\n 'classified',\r\n '文件涉密,已通过内网邮件上传。'\r\n )\r\n this.$set(\r\n this.formData[this.uploadType][this.addFileIndex],\r\n 'hasFile',\r\n true\r\n )\r\n console.log(this.formData)\r\n },\r\n deleteTag(index, type) {\r\n this.$set(this.formData[type][index], 'classified', '')\r\n if (type == 'pilotMeasuresPushList') {\r\n this.$refs.form.validate('hasFile')\r\n }\r\n console.log(this.formData)\r\n },\r\n idExist(id) {\r\n if (\r\n !this.checkIds.includes(id) ||\r\n (this.checkIds && !this.checkIds.length)\r\n ) {\r\n this.removeIds.push(id)\r\n }\r\n },\r\n // ------------\r\n addTableData() {\r\n let data = {\r\n resultName: '', //成果的名称\r\n measuresPlanType: 1, //成果的类型\r\n basis: '', //相关依据\r\n defaultFileList: [], //附件\r\n classified: '', //文件涉密\r\n pushDate: '', //成果形成时间\r\n }\r\n this.formData.pilotSpecificSchedulePushList.push(data)\r\n },\r\n deleteTableData(item, index) {\r\n this.formData.pilotSpecificSchedulePushList.splice(index, 1)\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 },\r\n // type 0 待更新 1责任审核 2市级确认 3 其他\r\n openForm(item, title, type, btnType) {\r\n this.reqLoading = true\r\n this.btnType = btnType\r\n this.status = item.status\r\n this.projectInfo = item\r\n this.title = title\r\n this.type = type\r\n if (title === '待更新' || title === '编辑' || title === '更新') {\r\n this.getNowDate().then(res => {\r\n this.fillDate = res\r\n })\r\n } else {\r\n this.fillDate = item.fillDate\r\n }\r\n if (type == 0) {\r\n // 待更新\r\n this.loadProjectData()\r\n this.reqLoading = false\r\n } else {\r\n // 审核 更新 编辑 详情...\r\n this.loadAuditData()\r\n this.getHistoryDetail(item.projectId)\r\n }\r\n if (this.title == '详情') {\r\n this.showDetails = true\r\n }\r\n this.formVisible = true\r\n },\r\n getFlag(item) {\r\n return (item.isOver == 3 && (item.planType == 5 || item.planType == 4 || item.planType == 6 || item.planType == 7))\r\n },\r\n // 获取待审核信息\r\n loadAuditData(type) {\r\n // 待审核数据\r\n this.loading = true\r\n apiList.getAuditData(this.projectInfo.id, (res) => {\r\n console.log(res)\r\n if (res) {\r\n this.approvalComments =\r\n (res.pilotProjectFill &&\r\n res.pilotProjectFill.approvalComments) ||\r\n ''\r\n if (this.approvalComments) {\r\n this.approvalCommentsList =\r\n this.approvalComments.split('$_$')\r\n }\r\n\r\n if (res && res.pilotMeasuresPushList) {\r\n res.pilotMeasuresPushList.forEach((item) => {\r\n item.isOpen = false\r\n if (\r\n item.defaultFileList &&\r\n item.defaultFileList.length\r\n ) {\r\n item.hasFile = true\r\n } else {\r\n item.hasFile = false\r\n }\r\n if (item.isOver == 1 && item.status == 7) {\r\n item.disabled = true\r\n } else {\r\n item.disabled = false\r\n }\r\n if (!this.getFlag(item)) {\r\n let problemArr = item.problems ? item.problems.split('key_value') : []\r\n if (!problemArr.length) {\r\n item.problemKeys = []\r\n item.problems = ''\r\n } else {\r\n let problemKeyArr = problemArr[0].split('key_key') || []\r\n if (problemArr.length > 1) {\r\n item.problemKeys = problemKeyArr\r\n item.problems = problemArr[1]\r\n } else {\r\n let obj = problemKeyArr.find(item => Object.is(item - 0, NaN))\r\n if (obj) {\r\n item.problemKeys = ['4']\r\n item.problems = problemArr[0]\r\n } else {\r\n item.problemKeys = problemKeyArr\r\n item.problems = ''\r\n }\r\n }\r\n }\r\n }\r\n })\r\n this.formData.pilotMeasuresPushList =\r\n res.pilotMeasuresPushList\r\n }\r\n if (res && res.pilotSpecificSchedulePushList) {\r\n res.pilotSpecificSchedulePushList.forEach((item) => {\r\n if (item.status == 7) {\r\n item.disabled = true\r\n } else {\r\n item.disabled = false\r\n }\r\n })\r\n res.pilotSpecificSchedulePushList[0].disabled = true\r\n this.formData.pilotSpecificSchedulePushList =\r\n res.pilotSpecificSchedulePushList\r\n }\r\n if (res && res.pilotProjectFill) {\r\n this.formData.pilotProjectFill = res.pilotProjectFill\r\n }\r\n this.loading = false\r\n this.reqLoading = false\r\n }\r\n })\r\n },\r\n // 查询历史审核信息\r\n getHistoryDetail(id) {\r\n apiList.getHistoryDetailById(id, (res) => {\r\n if (\r\n res.pilotMeasuresPushHistoryList &&\r\n res.pilotMeasuresPushHistoryList.length\r\n ) {\r\n this.historyFillDate = res\r\n res.pilotMeasuresPushHistoryList.forEach((item) => {\r\n let arr =\r\n (item.defaultFileList &&\r\n item.defaultFileList.map((file) => file.id)) ||\r\n []\r\n this.checkIds = [...arr, ...this.checkIds]\r\n })\r\n }\r\n if (\r\n res.pilotProjectFillHistory &&\r\n res.pilotProjectFillHistory.approvalComments\r\n ) {\r\n this.historyFillDate.pilotProjectFillHistory.approvalComments =\r\n res.pilotProjectFillHistory.approvalComments.split(\r\n '$_$'\r\n )\r\n }\r\n this.reqLoading = false\r\n })\r\n },\r\n // 获取项目初始化信息\r\n loadProjectData() {\r\n let data = {\r\n projectId: this.projectInfo.projectId,\r\n }\r\n this.loading = true\r\n this.formData.pilotMeasuresPushList = []\r\n apiList.getDefaultQuaObj(data, (res) => {\r\n if (res && res.pilotSpecificScheduleList) {\r\n let tempData = res.pilotSpecificScheduleList.map((item) => {\r\n let data = {\r\n measuresId: item.id,\r\n planType: item.planType,\r\n planYear: item.planYear,\r\n planQuarter: item.planQuarter,\r\n planMonth: item.planMonth,\r\n planContent: item.planContent,\r\n isOver: item.isOver || 1,\r\n isOpen: false,\r\n }\r\n return data\r\n })\r\n this.formData.pilotMeasuresPushList = tempData\r\n }\r\n this.markLoading = false\r\n this.loading = false\r\n })\r\n },\r\n // 表单提交保存\r\n submit(status) {\r\n // this.saveLoading = true\r\n let api = apiList.save,\r\n message = '保存为草稿成功'\r\n if (status) {\r\n api = apiList.saveAndSubmit\r\n message = '保存并上报成功'\r\n }\r\n let data = JSON.parse(JSON.stringify(this.formData))\r\n let flag = true\r\n let isOver = 0\r\n data.pilotMeasuresPushList.forEach((item) => {\r\n item.classified =\r\n item.defaultFileList && item.defaultFileList.length\r\n ? ''\r\n : item.classified\r\n if (item.isOver == 3) {\r\n let isFile = !item.defaultFileList\r\n ? false\r\n : !item.defaultFileList.length\r\n ? false\r\n : true\r\n if ((!item.classified && !isFile) || !item.completedWork) {\r\n flag = false\r\n this.expend(item)\r\n this.$nextTick(() => {\r\n this.$refs.form.validate((valid) => { })\r\n })\r\n return\r\n }\r\n }\r\n // if (item.isOver == 2) {\r\n // if (!item.workPlan) {\r\n // flag = false\r\n // isOver = 2\r\n // this.expend(item)\r\n // this.$nextTick(() => {\r\n // this.$refs.form.validate((valid) => { })\r\n // })\r\n // return\r\n // }\r\n // }\r\n let problemsStr = item.problemKeys ? item.problemKeys.join('key_key') : ''\r\n item.problems = !problemsStr ? item.problems : problemsStr + 'key_value' + item.problems\r\n })\r\n this.$refs.form.validate((valid) => {\r\n if (valid && flag) {\r\n let msg = status ? '保存并上报' : '保存为草稿'\r\n this.$confirm(`确认${msg}?`, '提示', {\r\n confirmButtonText: '确定',\r\n cancelButtonText: '取消',\r\n type: 'warning',\r\n }).then(() => {\r\n this.markLoading = true\r\n this.getNowDate().then(res => {\r\n if (!data.pilotProjectFill.id) {\r\n data.pilotProjectFill = {\r\n projectId: this.projectInfo.projectId,\r\n projectName: this.projectInfo.projectName,\r\n }\r\n }\r\n if (\r\n data.pilotProjectFill.status == 2 ||\r\n data.pilotProjectFill.status == 4 ||\r\n data.pilotProjectFill.status == 6 ||\r\n data.pilotProjectFill.status == 7\r\n ) {\r\n data.pilotProjectFill = {\r\n projectId: this.projectInfo.projectId,\r\n projectName: this.projectInfo.projectName,\r\n }\r\n let pilotMeasuresPushList =\r\n data.pilotMeasuresPushList.map((item) => {\r\n return {\r\n hasFile: item.hasFile,\r\n isOver: item.isOver,\r\n measuresId: item.measuresId,\r\n planContent: item.planContent,\r\n planQuarter: item.planQuarter,\r\n planMonth: item.planMonth,\r\n planType: item.planType,\r\n planYear: item.planYear,\r\n problems: item.problems,\r\n workPlan: item.workPlan,\r\n completedWork: item.completedWork,\r\n classified: item.classified,\r\n defaultFileList: item.defaultFileList,\r\n }\r\n })\r\n data.pilotMeasuresPushList = pilotMeasuresPushList\r\n }\r\n data.pilotProjectFill.fillDate = res\r\n api(data, (res) => {\r\n if (res.state) {\r\n this.removeIds.length && this.saveRemoveFiles()\r\n this.$message.success(message)\r\n this.$parent.reload()\r\n this.handleClose()\r\n } else {\r\n this.$message.warning(res.message)\r\n }\r\n this.markLoading = false\r\n })\r\n })\r\n // if (this.status == 4) {\r\n // data.pilotProjectFill.fillDate = this.projectInfo.fillDate\r\n // api(data, (res) => {\r\n // if (res.state) {\r\n // this.removeIds.length && this.saveRemoveFiles()\r\n // this.$message.success(message)\r\n // this.$parent.reload()\r\n // this.handleClose()\r\n // } else {\r\n // this.$message.warning(res.message)\r\n // }\r\n // this.markLoading = false\r\n // })\r\n // } else {\r\n // this.getNowDate().then(res => {\r\n // let date = res + '-' + '01'\r\n // data.pilotProjectFill.fillDate = date\r\n // api(data, (res) => {\r\n // if (res.state) {\r\n // this.removeIds.length && this.saveRemoveFiles()\r\n // this.$message.success(message)\r\n // this.$parent.reload()\r\n // this.handleClose()\r\n // } else {\r\n // this.$message.warning(res.message)\r\n // }\r\n // this.markLoading = false\r\n // })\r\n // })\r\n // }\r\n })\r\n } else {\r\n if (!valid) {\r\n this.$message.warning('计划内容填写不规范,请核查!')\r\n } else {\r\n if (!flag) {\r\n let msg = isOver == 2 ? '推进中' : '已完成'\r\n this.$message.warning(\r\n `${msg}任务计划内容填写有误,请核查!`\r\n )\r\n }\r\n }\r\n this.saveLoading = false\r\n }\r\n })\r\n },\r\n handleVerify() {\r\n let data = JSON.parse(JSON.stringify(this.formData))\r\n let monthList = data.pilotMeasuresPushList\r\n let flag = true\r\n let isOver = 0\r\n monthList.forEach((item) => {\r\n if (item.isOver == 3) {\r\n let isFile = !item.defaultFileList\r\n ? false\r\n : !item.defaultFileList.length\r\n ? false\r\n : true\r\n if ((!item.classified && !isFile) || !item.completedWork) {\r\n flag = false\r\n return\r\n }\r\n }\r\n // if (item.isOver == 2) {\r\n // if (!item.workPlan) {\r\n // flag = false\r\n // isOver = 2\r\n // return\r\n // }\r\n // }\r\n })\r\n this.$refs.form.validate((valid) => {\r\n if (valid && flag) {\r\n let status = this.type == 1 ? 3 : this.type == 2 ? 5 : 7 //3-责任单位领导审核通过 5-市委改革办审核通过\r\n let message = '确认通过吗?'\r\n this.btnLoading = true\r\n this.$confirm(message, this.$t('common.tips'), {\r\n confirmButtonText: this.$t('common.confirm'),\r\n cancelButtonText: this.$t('common.cancel'),\r\n type: 'success',\r\n }).then(() => {\r\n this.markLoading = true\r\n if (!this.formData.pilotProjectFill.id) {\r\n this.formData.pilotProjectFill = this.projectInfo\r\n }\r\n let data = JSON.parse(JSON.stringify(this.formData))\r\n data.pilotMeasuresPushList.forEach((item) => {\r\n let problemsStr = item.problemKeys ? item.problemKeys.join('key_key') : ''\r\n item.problems = !problemsStr ? item.problems : problemsStr + 'key_value' + item.problems\r\n })\r\n data.pilotProjectFill.status = status\r\n apiList.saveAndCommit(data, (res) => {\r\n if (res.state) {\r\n this.removeIds.length && this.saveRemoveFiles()\r\n this.$message.success('通过成功')\r\n this.$parent.reload()\r\n this.handleClose()\r\n } else {\r\n this.$message.warning(res.message)\r\n }\r\n this.markLoading = false\r\n this.saveLoading = false\r\n })\r\n })\r\n } else {\r\n if (!valid) {\r\n this.$message.warning('计划内容填写不规范,请核查!')\r\n } else {\r\n if (!flag) {\r\n let msg = isOver == 2 ? '推进中' : '已完成'\r\n this.$message.warning(\r\n `${msg}任务计划内容填写有误,请核查!`\r\n )\r\n }\r\n }\r\n this.saveLoading = false\r\n }\r\n })\r\n // this.saveLoading = true\r\n // let data = {\r\n // id: this.projectInfo.id,\r\n // status: this.type == 1 ? 3 : 5 //3-责任单位领导审核通过 5-市委改革办审核通过\r\n // }\r\n // apiList.verify(data, res => {\r\n // if (res.state) {\r\n // this.$message.success('审核通过成功')\r\n // this.$parent.reload()\r\n // this.handleClose()\r\n // } else {\r\n // this.$message.warning(res.message)\r\n // }\r\n // this.saveLoading = false\r\n // })\r\n },\r\n // 审核驳回\r\n handleReject() {\r\n let status = this.type == 1 ? 2 : this.type == 2 ? 4 : 6 // 2-审核驳回 4-确认驳回\r\n let message = '确认驳回吗?'\r\n this.btnLoading = true\r\n this.$confirm(message, 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.$refs.RejectInfoBlockDialog.open(\r\n '/majorProjects/pilotQuantitativeObjectivesPush/v1/quantitativeObjectivesPushExamine',\r\n status\r\n )\r\n })\r\n .catch(() => {\r\n this.saveLoading = false\r\n })\r\n },\r\n // 处理填写的驳回意见\r\n sendRejectInfo(rejectInfo, api, status) {\r\n this.markLoading = true\r\n if (!rejectInfo) {\r\n this.markLoading = false\r\n this.saveLoading = false\r\n return\r\n }\r\n if (!this.formData.pilotProjectFill.id) {\r\n this.formData.pilotProjectFill = this.projectInfo\r\n // this.formData.pilotProjectFill = {\r\n // projectId: this.projectInfo.projectId,\r\n // projectName: this.projectInfo.projectName\r\n // }\r\n }\r\n let data = JSON.parse(JSON.stringify(this.formData))\r\n data.pilotMeasuresPushList.forEach((item) => {\r\n let problemsStr = item.problemKeys ? item.problemKeys.join('key_key') : ''\r\n item.problems = !problemsStr ? item.problems : problemsStr + 'key_value' + item.problems\r\n })\r\n data.pilotProjectFill.approvalComments = rejectInfo\r\n data.pilotProjectFill.status = status\r\n // let data = {\r\n // approvalComments: rejectInfo,\r\n // id: this.projectInfo.id,\r\n // status: status //3-责任单位领导审核通过 5-市委改革办审核通过\r\n // }\r\n apiList.saveAndCommit(data, (res) => {\r\n if (res.state) {\r\n this.removeIds.length && this.saveRemoveFiles()\r\n this.$message.success('驳回成功')\r\n this.$parent.reload()\r\n this.handleClose()\r\n } else {\r\n this.$message.warning(res.message)\r\n }\r\n this.markLoading = false\r\n this.saveLoading = false\r\n })\r\n },\r\n handleClose() {\r\n this.removeIds = []\r\n this.saveLoading = false\r\n this.formVisible = false\r\n this.showDetails = false\r\n this.approvalComments = ''\r\n this.approvalCommentsList = []\r\n this.historyFillDate = null\r\n this.fillDate = ''\r\n this.formData = {\r\n pilotProjectFill: {\r\n projectId: '',\r\n projectName: '',\r\n },\r\n pilotMeasuresPushList: [],\r\n pilotSpecificSchedulePushList: [\r\n {\r\n resultName: '', //成果的名称\r\n measuresPlanType: 1, //成果的类型\r\n basis: '', //相关依据\r\n defaultFileList: [], //附件\r\n classified: '', //文件涉密\r\n pushDate: '', //成果形成时间\r\n },\r\n ],\r\n }\r\n },\r\n expend(row) {\r\n row.isOpen = !row.isOpen\r\n let $table = this.$refs.myTable\r\n this.formData.pilotMeasuresPushList.map((item) => {\r\n item.expansion = !item.expansion\r\n // if (row.measuresId != item.measuresId) {\r\n // $table.toggleRowExpansion(item, false)\r\n // item.expansion = false\r\n // } else {\r\n // item.expansion = !item.expansion\r\n // }\r\n })\r\n $table.toggleRowExpansion(row)\r\n },\r\n historyExpend(row) {\r\n let $table = this.$refs.myHistoryTable\r\n this.historyFillDate.pilotMeasuresPushHistoryList.map((item) => {\r\n if (row.measuresId != item.measuresId) {\r\n $table.toggleRowExpansion(item, false)\r\n item.expansion = false\r\n } else {\r\n item.expansion = !item.expansion\r\n }\r\n })\r\n $table.toggleRowExpansion(row)\r\n },\r\n },\r\n}\r\n",null]}