{"remainingRequest":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\reform-fvue\\src\\views\\MajorReformProjects\\QuaObj\\components\\QuaObjDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\reform-fvue\\src\\views\\MajorReformProjects\\QuaObj\\components\\QuaObjDialog.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\r\nimport UploadFile from '@/components/uploadFile/index.vue'\r\nimport FileList from '@/components/uploadFile/FileList.vue'\r\nimport RecordPopover from '@/components/dialog/RecordPopover.vue'\r\nimport apiList from '@/api/MajorReformProjects/QuaObj'\r\nimport publicApi from '@/api/publicApi'\r\nimport { TableMixin } from '@/mixins/tableMixin'\r\nimport moment from 'moment'\r\nimport RejectInfoDialog from '@/components/dialog/RejectInfoBlockDialog.vue'\r\nexport default {\r\n name: 'QuaObjDialog',\r\n components: { RejectInfoDialog, RecordPopover, UploadFile, FileList },\r\n mixins: [TableMixin],\r\n data() {\r\n return {\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 activeCollapse: '1',\r\n disabled: false,\r\n historyFillDate: '',\r\n loadingHistory: false,\r\n loadType: '',\r\n fillDate: '',\r\n loading: false,\r\n loadingDefault: false,\r\n approvalComments: '', // 驳回理由\r\n approvalCommentsList: [],\r\n targetHistoryData: [],\r\n targetData: [],\r\n columnData: [\r\n {\r\n label: '目标名称',\r\n key: 'reformQuantitativeObjectives',\r\n type: 'show'\r\n },\r\n {\r\n label: '是否错月数据',\r\n key: 'fillType',\r\n type: 'show',\r\n width: '100'\r\n },\r\n {\r\n label: '当年目标值',\r\n key: 'reformQuantitativeObjectivesYear',\r\n type: 'show',\r\n width: '100'\r\n },\r\n {\r\n label: '当月目标值',\r\n key: 'reformQuantitativeObjectivesMouth',\r\n type: 'show',\r\n width: '100'\r\n },\r\n {\r\n label: '目标单位',\r\n key: 'reformQuantitativeObjectivesUnit',\r\n width: '80',\r\n type: 'show'\r\n },\r\n {\r\n label: '当月进度之值',\r\n key: 'pushProgress',\r\n width: '120',\r\n type: 'entry',\r\n ui: 'input'\r\n },\r\n {\r\n label: '填报时间',\r\n type: 'entry',\r\n key: 'pushDate',\r\n width: '120',\r\n ui: 'date'\r\n }\r\n ],\r\n pickerOptions: {\r\n disabledDate: time => {\r\n return time.getTime() > Date.now()\r\n }\r\n },\r\n pilotProjectFill: null,\r\n // history\r\n pilotProjectFillHistory: null,\r\n idArr: [],\r\n reqFillDate: '',\r\n fileIndex: 0,\r\n isFiles: true\r\n }\r\n },\r\n\r\n created() {\r\n // this.getNowDate()\r\n },\r\n methods: {\r\n openUploade(index) {\r\n this.fileIndex = index\r\n this.$refs.uploadFile.open('ProjectBrand')\r\n },\r\n setAipher() {\r\n this.$set(\r\n this.targetData[this.fileIndex],\r\n 'classified',\r\n 1\r\n )\r\n },\r\n setFileList(file) {\r\n file.id = file.response.fileId\r\n if (this.targetData[this.fileIndex].files) {\r\n this.targetData[this.fileIndex].files.push(file)\r\n } else {\r\n this.$set(\r\n this.targetData[this.fileIndex],\r\n 'files',\r\n []\r\n )\r\n this.targetData[this.fileIndex].files.push(file)\r\n }\r\n this.$set(\r\n this.targetData[this.fileIndex],\r\n 'classified',\r\n 0\r\n )\r\n },\r\n changeFileList(data, index) {\r\n this.targetData[index].files = data\r\n },\r\n changehisToryDate(date) {\r\n this.historyFillDate = date + '-01'\r\n this.loadHistoryData()\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 // debugger\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 console.log(time);\r\n\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 let { id, projectId, fillDate } = this.projectInfo\r\n if (id) {\r\n let data = { projectId, fillDate, flowType: 1, nowDate: date + '-' + '01' }\r\n publicApi.setFillingTime(data, res => {\r\n let time = res.value === -1 ? fillDate : data.nowDate\r\n resolve(time)\r\n })\r\n } else {\r\n resolve(date + '-' + '01')\r\n }\r\n }\r\n })\r\n })\r\n },\r\n\r\n // type 0 待更新 1责任审核 2市级确认 3 其他\r\n openForm(item, title, type, btnType) {\r\n console.log(item,'9999999999999')\r\n if (title == '详情' || title == '审核') {\r\n this.showDetails = true\r\n }\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 (type == 0) {\r\n // 待更新\r\n this.loadProjectData(item)\r\n } else if ((this.status == 7 || this.status == 6 || this.status == 4 || this.status == 2) && title !== '详情') {\r\n // 新一轮更新\r\n this.loadProjectData(item)\r\n this.getLastMonth()\r\n this.loadHistoryData()\r\n // this.changehisToryDate(this.fillDate)\r\n } else {\r\n // 审核 更新 编辑 详情...\r\n this.loadAuditData()\r\n this.getLastMonth()\r\n this.loadHistoryData()\r\n // this.changehisToryDate(this.fillDate)\r\n // this.loadProjectData()\r\n // this.loadAuditData('new')\r\n // this.getLastMonth()\r\n // this.loadHistoryData()\r\n }\r\n // else {\r\n // this.loadAuditData()\r\n // this.getLastMonth()\r\n // this.loadHistoryData()\r\n // }\r\n\r\n this.formVisible = true\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 if (res) {\r\n this.idArr = res.pilotQuantitativeObjectivesPushList.map(item => {\r\n return {\r\n id: item.id,\r\n objectivesMeasuresId: item.objectivesMeasuresId,\r\n pushProgress: item.pushProgress\r\n }\r\n })\r\n this.approvalComments =\r\n (res.pilotProjectFill && res.pilotProjectFill.approvalComments) ||\r\n ''\r\n if (this.approvalComments) {\r\n this.approvalCommentsList = this.approvalComments.split('$_$')\r\n }\r\n if (res.pilotProjectFill && res.pilotProjectFill.fillYear && res.pilotProjectFill.fillMonth) {\r\n let { fillYear, fillMonth } = res.pilotProjectFill\r\n fillMonth = fillMonth < 10 ? `0${fillMonth}` : fillMonth\r\n this.reqFillDate = fillYear + '-' + fillMonth\r\n }\r\n // 非更新时查询本次更新数据\r\n if (!type) {\r\n this.targetData = res.pilotQuantitativeObjectivesPushList\r\n this.fillDate =\r\n res.pilotProjectFill && res.pilotProjectFill.fillDate\r\n this.pilotProjectFill = res.pilotProjectFill\r\n }\r\n this.loading = false\r\n }\r\n })\r\n },\r\n getLastMonth() {\r\n //当前日期的前一个月\r\n let time = new Date()\r\n let year = time.getFullYear()\r\n let month = time.getMonth()\r\n if (month == 0) {\r\n month = 12\r\n year = year - 1\r\n }\r\n if (month < 10) {\r\n month = '0' + month\r\n }\r\n this.historyFillDate = this.reqFillDate == '' ? year + '-' + month + '-01' : this.reqFillDate + '-01'\r\n },\r\n // 获取历史信息\r\n loadHistoryData() {\r\n // 待审核数据\r\n this.loadingHistory = true\r\n let data = {\r\n fillDate: this.historyFillDate,\r\n projectId: this.projectInfo.projectId\r\n }\r\n this.pilotProjectFillHistory = null\r\n apiList.getHistoryData(data, res => {\r\n if (res) {\r\n if (res.pilotProjectFillHistory) {\r\n this.pilotProjectFillHistory = res.pilotProjectFillHistory\r\n this.pilotProjectFillHistory.approvalComments =\r\n res.pilotProjectFillHistory &&\r\n res.pilotProjectFillHistory.approvalComments\r\n ? res.pilotProjectFillHistory.approvalComments.split('$_$')\r\n : []\r\n }\r\n this.targetHistoryData =\r\n res.pilotProjectFillHistory &&\r\n res.pilotQuantitativeObjectivesPushHistoryList\r\n this.loadingHistory = false\r\n }\r\n })\r\n },\r\n // 获取项目初始化信息\r\n loadProjectData() {\r\n\r\n this.getNowDate().then(res => {\r\n console.log(res);\r\n\r\n // if (item.id) {\r\n // let { fillYear, fillMonth } = item\r\n // fillMonth = fillMonth > 10 ? fillMonth : '0' + fillMonth\r\n // this.fillDate = item.status === 2 || item.status === 4 ? fillYear + '-' + fillMonth : res\r\n // } else {\r\n // this.fillDate = res\r\n // }\r\n this.fillDate = res\r\n\r\n let data = {\r\n fillDate: res,\r\n projectId: this.projectInfo.projectId\r\n }\r\n this.loading = true\r\n apiList.getDefaultQuaObj(data, res => {\r\n if (res && res.pilotQuantitativeObjectivesList) {\r\n let tempData = res.pilotQuantitativeObjectivesList\r\n tempData.forEach(item => {\r\n item.pushDate = moment().format('YYYY-MM-DD')\r\n item.passFail = false\r\n let reqFillDate = this.reqFillDate + '-01'\r\n if (this.idArr.length && data.fillDate == reqFillDate) {\r\n this.idArr.forEach(idObj => {\r\n if (item.id == idObj.objectivesMeasuresId) {\r\n item.pushProgress = idObj.pushProgress\r\n }\r\n })\r\n }\r\n })\r\n this.targetData = tempData\r\n }\r\n this.loading = false\r\n })\r\n })\r\n },\r\n // 组织提交数据\r\n farmatter() {\r\n // debugger\r\n let id = this.pilotProjectFill && this.pilotProjectFill.id\r\n let data = {\r\n pilotProjectFill: {\r\n id: id ? id : '',\r\n fillDate: this.fillDate,\r\n projectId: this.projectInfo.projectId,\r\n projectName: this.projectInfo.projectName,\r\n },\r\n pilotQuantitativeObjectivesPushList: []\r\n }\r\n this.targetData.forEach(item => {\r\n if (this.fillDate !== '2024-01-01' || item.fillType != 2) {\r\n if (!item.pushProgress) {\r\n item.passFail = true\r\n data = false\r\n } else {\r\n if (!item.files && !item.classified) {\r\n this.isFiles = false\r\n data = false\r\n } else {\r\n if (item.files) {\r\n if (!item.files.length) {\r\n this.isFiles = false\r\n data = false\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (data) {\r\n if (\r\n this.status == 2 ||\r\n this.status == 4 ||\r\n this.status == 6 ||\r\n this.status == 7 ||\r\n this.status == undefined\r\n ) {\r\n // 初始化的数据 没有id\r\n data.pilotQuantitativeObjectivesPushList.push({\r\n objectivesMeasuresId: item.id,\r\n pushDate: item.pushDate,\r\n pushProgress: item.pushProgress || '',\r\n files: item.files || [],\r\n classified: item.classified || 0,\r\n })\r\n } else {\r\n // 编辑数据 整个回传\r\n this.idArr.forEach(idObj => {\r\n if (item.id == idObj.objectivesMeasuresId) {\r\n item.objectivesMeasuresId = item.id\r\n item.id = idObj.id\r\n }\r\n })\r\n if (!item.objectivesMeasuresId) {\r\n item.objectivesMeasuresId = item.id\r\n }\r\n data.pilotQuantitativeObjectivesPushList.push(item)\r\n }\r\n }\r\n })\r\n this.$forceUpdate()\r\n return data\r\n },\r\n // 表单提交保存\r\n saveGetNowDate(status) {\r\n this.getNowDate().then(res => {\r\n if (res === this.fillDate) {\r\n this.submit(status)\r\n } else {\r\n let oldTime = this.fillDate.slice(0, this.fillDate.length - 3)\r\n let newTime = res.slice(0, res.length - 3)\r\n let msg = `当前时间已超出${oldTime}月数据可填报时间,确认保存为${newTime}月数据吗?`\r\n this.$confirm(msg, this.$t('common.tips'), {\r\n confirmButtonText: this.$t('common.confirm'),\r\n cancelButtonText: this.$t('common.cancel'),\r\n type: 'error'\r\n })\r\n .then(() => {\r\n this.fillDate = res\r\n this.submit(status)\r\n })\r\n }\r\n })\r\n },\r\n submit(status) {\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 this.saveLoading = true\r\n let data = this.farmatter()\r\n if (data) {\r\n api(data, res => {\r\n if (res.state) {\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.saveLoading = false\r\n })\r\n } else {\r\n if (this.isFiles) {\r\n this.$message.warning('请填写目标推进值')\r\n } else {\r\n this.$message.warning('请上传相关佐证材料')\r\n }\r\n this.saveLoading = false\r\n }\r\n },\r\n handleVerify() {\r\n this.saveLoading = true\r\n console.log(this.type);\r\n\r\n let data = {\r\n flowType: this.projectInfo.flowType,\r\n id: this.projectInfo.id,\r\n status: this.type == 1 ? 3 : this.type == 2 ? 5 : 7 //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 this.saveLoading = true\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: 'error'\r\n })\r\n .then(() => {\r\n this.$refs.rejectInfoDialog.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 if (!rejectInfo) {\r\n this.saveLoading = false\r\n return\r\n }\r\n let data = {\r\n flowType: this.projectInfo.flowType,\r\n approvalComments: rejectInfo,\r\n id: this.projectInfo.id,\r\n status: status //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 handleClose() {\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.targetHistoryData = []\r\n this.targetData = []\r\n this.pilotProjectFill = null\r\n this.pilotProjectFillHistory = null\r\n this.fillDate = \"\"\r\n }\r\n }\r\n}\r\n",null]}