{"remainingRequest":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\reform-fvue\\src\\views\\MajorReformProjects\\components\\MajorProjectsDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\reform-fvue\\src\\views\\MajorReformProjects\\components\\MajorProjectsDialog.vue","mtime":1682516191954},{"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//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport org from '@/api/org.js'\r\nimport utils from '@/utils.js'\r\nimport dictUtils from '@/components/dict/DictSelectUtils.js'\r\nimport majorProjects from '@/api/MajorReformProjects/majorProjects.js'\r\nimport targetEntryDialog from './targetEntryDialog.vue'\r\nimport moment from 'moment'\r\nexport default {\r\n name: 'MajorProjectsDialog',\r\n components: {\r\n targetEntryDialog,\r\n },\r\n data() {\r\n return {\r\n demandRunwaOoptionsForm: [], // 所属跑道数据(表单内)\r\n reqLoading: false,\r\n activeCollapse1: '1',\r\n visible: false,\r\n title: '新增',\r\n disabled: false,\r\n saveloading: false,\r\n rules: {\r\n projectName: [\r\n {\r\n required: true,\r\n message: '请输入项目名称',\r\n trigger: 'blur',\r\n },\r\n ],\r\n leader: [\r\n {\r\n required: true,\r\n message: '请输入牵头市领导',\r\n trigger: 'blur',\r\n },\r\n ],\r\n unitId: [\r\n {\r\n required: true,\r\n message: '请选择责任单位',\r\n trigger: 'blur',\r\n },\r\n ],\r\n projectType: [\r\n {\r\n required: true,\r\n message: '请选择项目类型',\r\n trigger: 'blur',\r\n },\r\n ],\r\n projectField: [\r\n {\r\n required: true,\r\n message: '请选择所属领域',\r\n trigger: 'blur',\r\n },\r\n ],\r\n projectRunway: [\r\n {\r\n required: true,\r\n message: '请选择所属跑道',\r\n trigger: 'blur',\r\n },\r\n ],\r\n // reformQuantitativeObjectives: [\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 treeData: [],\r\n typeList: [],\r\n parameter: {\r\n projectName: '',\r\n leader: '',\r\n projectType: '1',\r\n projectField: '1',\r\n projectRunway: '1',\r\n closing: '1',\r\n unitId: '',\r\n unitName: '',\r\n unitCode: '',\r\n startDate: '',\r\n endDate: '',\r\n unitGrade: '',\r\n pilotQuantitativeObjectivesList: [{}], //量化目标\r\n pilotSpecificMeasuresList: [{}], //具体举措\r\n pilotSpecificScheduleList: [\r\n {\r\n planYear: moment().format('YYYY'),\r\n planMonth: moment().format('M'),\r\n progressStatus: 1,\r\n planType: '',\r\n planContent: '',\r\n plannedCompletionTime: '',\r\n },\r\n ], //进度计划\r\n },\r\n unitValue: [], //责任值\r\n kmList: [],\r\n fileList: [],\r\n ggbb_ssly: [],\r\n markLoading: false,\r\n }\r\n },\r\n created() {\r\n this.kmList = dictUtils.getDictItemsFromCache('subjec_type')\r\n this.ggbb_ssly = dictUtils.getDictItemsFromCache('ggbb_ssly')\r\n this.treeData = JSON.parse(sessionStorage.getItem('responsibilityTree'))\r\n this.demandRunwaOoptionsForm = this.ggbb_ssly[0].lowerDic['ggbb_sspd']\r\n },\r\n mounted() {},\r\n methods: {\r\n // 获取字典值翻译\r\n getDictName(code, value) {\r\n return utils.getDictName(code, value)\r\n },\r\n // 所属跑道选择\r\n hanldeCommonSelect(val, obj, key) {\r\n this.demandRunwaOoptionsForm = obj.lowerDic['ggbb_sspd']\r\n this.parameter.projectRunway = ''\r\n },\r\n addData(val, index) {\r\n console.log(val, index)\r\n this.parameter.pilotQuantitativeObjectivesList[\r\n index\r\n ].pilotObjectivesDetailsList = val\r\n console.log(this.parameter.pilotQuantitativeObjectivesList)\r\n // this.$set(this.parameter.pilotQuantitativeObjectivesList,index,val)\r\n },\r\n tableDel(type, row) {\r\n if (this.title == '新增' || row.key) {\r\n this.parameter[type] = this.parameter[type].filter(\r\n (item) => item.key !== row.key\r\n )\r\n } else {\r\n console.log(type)\r\n this.$confirm('确认删除这条记录?', '提示', {\r\n cancelButtonText: '关闭',\r\n type: 'error',\r\n }).then(() => {\r\n if (type == 'pilotQuantitativeObjectivesList') {\r\n majorProjects.deleteLhmb(row.id, (res) => {\r\n if (res.state) {\r\n this.$message.success('删除数据成功')\r\n this.parameter[type] = this.parameter[\r\n type\r\n ].filter((item) => item.id !== row.id)\r\n }\r\n })\r\n } else if (type == 'pilotSpecificMeasuresList') {\r\n majorProjects.deleteJtjc(row.id, (res) => {\r\n if (res.state) {\r\n this.$message.success('删除数据成功')\r\n this.parameter[type] = this.parameter[\r\n type\r\n ].filter((item) => item.id !== row.id)\r\n }\r\n })\r\n } else if (type == 'pilotSpecificScheduleList') {\r\n majorProjects.deleteJdjh(row.id, (res) => {\r\n if (res.state) {\r\n this.$message.success('删除数据成功')\r\n this.parameter[type] = this.parameter[\r\n type\r\n ].filter((item) => item.id !== row.id)\r\n }\r\n })\r\n }\r\n })\r\n\r\n //\r\n }\r\n },\r\n tableAdd(type) {\r\n if (type == 'pilotQuantitativeObjectivesList') {\r\n this.parameter[type].push({\r\n key: this.parameter[type].length + new Date(),\r\n target: '',\r\n unit: '',\r\n targetValY: null,\r\n targetValM: null,\r\n currentVal: null,\r\n })\r\n } else if (type == 'pilotSpecificScheduleList') {\r\n this.parameter[type].push({\r\n key: this.parameter[type].length + new Date(),\r\n planYear: moment().format('YYYY'),\r\n planMonth: moment().format('M'),\r\n progressStatus: 1,\r\n planType: '',\r\n planContent: '',\r\n plannedCompletionTime: '',\r\n })\r\n } else {\r\n this.parameter[type].push({\r\n key: this.parameter[type].length + new Date(),\r\n measure: '',\r\n })\r\n }\r\n },\r\n handlePreview() {},\r\n handleRemove() {},\r\n beforeRemove() {},\r\n handleExceed() {},\r\n edit(val) {\r\n this.title = '编辑'\r\n this.visible = true\r\n this.reqLoading = true\r\n majorProjects.detailId(val, (res) => {\r\n if (res) {\r\n this.parameter = res\r\n this.parameter.closing = this.parameter.closing.toString()\r\n this.parameter.pilotSpecificScheduleList.forEach((e) => {\r\n e.planYear = (e.planYear && e.planYear.toString()) || ''\r\n e.planMonth =\r\n (e.planMonth && e.planMonth.toString()) || ''\r\n })\r\n this.parameter.projectRunway = this.parameter.projectRunway\r\n ? this.parameter.projectRunway.toString()\r\n : ''\r\n this.ggbb_ssly.forEach((item) => {\r\n if (item.value == this.parameter.projectField) {\r\n this.demandRunwaOoptionsForm =\r\n item.lowerDic['ggbb_sspd']\r\n }\r\n })\r\n this.unitValue = this.getParentsById(\r\n this.treeData,\r\n this.parameter.unitId\r\n )\r\n }\r\n this.reqLoading = false\r\n })\r\n },\r\n detail(val) {\r\n this.title = '详情'\r\n this.visible = true\r\n this.disabled = true\r\n this.reqLoading = true\r\n majorProjects.detailId(val, (res) => {\r\n if (res) {\r\n this.parameter = res\r\n this.parameter.closing = this.parameter.closing.toString()\r\n this.parameter.pilotSpecificScheduleList.forEach((e) => {\r\n e.planYear = e.planYear.toString()\r\n e.planMonth = e.planMonth.toString()\r\n })\r\n this.parameter.projectRunway = this.parameter.projectRunway\r\n ? this.parameter.projectRunway.toString()\r\n : ''\r\n this.unitValue = this.getParentsById(\r\n this.treeData,\r\n this.parameter.unitId\r\n )\r\n }\r\n this.reqLoading = false\r\n })\r\n },\r\n getParentsById(list, id) {\r\n console.log(111)\r\n for (let i in list) {\r\n if (list[i].id == id) {\r\n //这里的no根据你的需求可进行改变\r\n //查询到就返回该数组对象的value\r\n return [list[i].id]\r\n }\r\n if (list[i].children) {\r\n let node = this.getParentsById(list[i].children, id)\r\n if (node !== undefined) {\r\n //查询到把父节把父节点加到数组前面\r\n node.unshift(list[i].id)\r\n console.log(node)\r\n return node\r\n }\r\n }\r\n }\r\n },\r\n\r\n add(val) {\r\n // this.parameter.parentId = val\r\n this.title = '新增'\r\n this.visible = true\r\n this.demandRunwaOoptionsForm =\r\n this.ggbb_ssly[0].lowerDic['ggbb_sspd']\r\n },\r\n changeUnit(value) {\r\n this.$nextTick(() => {\r\n let nodesObj = this.$refs['cascader'].getCheckedNodes()\r\n console.log(nodesObj)\r\n if (nodesObj.length) {\r\n this.parameter.unitId = nodesObj[0].data.id\r\n this.parameter.unitName = nodesObj[0].label\r\n this.parameter.unitCode = nodesObj[0].data.code\r\n this.parameter.unitGrade = nodesObj[0].level\r\n } else {\r\n this.parameter.unitId = ''\r\n this.parameter.unitName = ''\r\n this.parameter.unitCode = ''\r\n this.parameter.unitGrade = ''\r\n }\r\n })\r\n },\r\n // 关闭新增人员窗口\r\n handleClose() {\r\n this.activeCollapse1 = '1'\r\n this.visible = false\r\n this.disabled = false\r\n this.title = ''\r\n this.unitValue = []\r\n this.saveloading = false\r\n this.parameter = {\r\n projectName: '',\r\n projectField: '1',\r\n projectRunway: '1',\r\n leader: '',\r\n projectType: '1',\r\n closing: '1',\r\n unitId: '',\r\n unitName: '',\r\n unitCode: '',\r\n unitGrade: '',\r\n pilotQuantitativeObjectivesList: [{}], //量化目标\r\n pilotSpecificMeasuresList: [{}], //具体举措\r\n pilotSpecificScheduleList: [{}], //进度计划\r\n }\r\n },\r\n //打卡目标录入\r\n targetEntry(ind, val) {\r\n console.log(this.title)\r\n console.log(val)\r\n this.$refs.targetEntryDialog.add(ind, val, this.title)\r\n },\r\n //通过季度确认计划完成时间\r\n setTime(val) {\r\n console.log()\r\n let year = moment().format('YYYY')\r\n switch (val.planMonth) {\r\n case '1':\r\n val.plannedCompletionTime =\r\n year + '-' + '03' + '-' + new Date(year, 3, 0).getDate() //获取第四季度最后一天日期\r\n break\r\n case '2':\r\n val.plannedCompletionTime =\r\n year + '-' + '06' + '-' + new Date(year, 6, 0).getDate() //获取第四季度最后一天日期\r\n break\r\n case '3':\r\n val.plannedCompletionTime =\r\n year + '-' + '09' + '-' + new Date(year, 9, 0).getDate() //获取第四季度最后一天日期\r\n break\r\n case '4':\r\n val.plannedCompletionTime =\r\n year + '-' + 12 + '-' + new Date(year, 12, 0).getDate() //获取第四季度最后一天日期\r\n break\r\n }\r\n },\r\n // 保存\r\n handleSave() {\r\n console.log(this.parameter)\r\n\r\n this.parameter.pilotSpecificScheduleList.forEach((e) => {\r\n delete e.key\r\n })\r\n this.parameter.pilotSpecificMeasuresList.forEach((e) => {\r\n delete e.key\r\n })\r\n this.parameter.pilotQuantitativeObjectivesList.forEach((e) => {\r\n delete e.key\r\n })\r\n let flag = true\r\n this.parameter.pilotQuantitativeObjectivesList.forEach((item) => {\r\n if (!item.pilotObjectivesDetailsList) {\r\n flag = false\r\n }\r\n })\r\n console.log(flag)\r\n this.$refs.formInfo.validate((valid) => {\r\n if (valid && flag) {\r\n this.markLoading = true\r\n // this.saveloading = true\r\n if (this.title === '新增') {\r\n majorProjects.addData(this.parameter, (res) => {\r\n if (res.state) {\r\n this.$notify({\r\n type: 'success',\r\n message: '新增成功',\r\n duration: 2000,\r\n })\r\n this.$emit('getData')\r\n this.handleClose()\r\n }\r\n this.markLoading = false\r\n })\r\n } else if (this.title === '编辑') {\r\n majorProjects.editData(this.parameter, (res) => {\r\n if (res.state) {\r\n this.$notify({\r\n type: 'success',\r\n message: '修改成功',\r\n duration: 2000,\r\n })\r\n this.$emit('getData')\r\n this.handleClose()\r\n }\r\n this.markLoading = false\r\n })\r\n }\r\n } else {\r\n if (!valid) {\r\n this.$message.warning('信息录入有误,请检查后保存')\r\n } else {\r\n this.$message.warning(\r\n '改革方案明确的量化目标值未录入,请录入后保存'\r\n )\r\n }\r\n }\r\n })\r\n },\r\n },\r\n}\r\n",null]}