{"remainingRequest":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\reform-fvue\\src\\views\\MajorReformProjects\\ProjectCreate\\components\\MajorProjectsDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\reform-fvue\\src\\views\\MajorReformProjects\\ProjectCreate\\components\\MajorProjectsDialog.vue","mtime":1684901815839},{"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\r\nimport org from '@/api/org.js'\r\nimport utils from '@/utils.js'\r\nimport targetEntryDialog from './targetEntryDialog.vue'\r\nimport dictUtils from '@/components/dict/DictSelectUtils.js'\r\nimport majorProjects from '@/api/MajorReformProjects/majorProjects.js'\r\nimport RejectInfoDialog from '@/components/dialog/RejectInfoDialog.vue'\r\nimport moment from 'moment'\r\nimport {TableMixin} from '@/mixins/tableMixin'\r\nexport default {\r\n name: 'MajorProjectsDialog',\r\n components: {\r\n targetEntryDialog,\r\n RejectInfoDialog\r\n },\r\n mixins: [TableMixin],\r\n data() {\r\n return {\r\n approvalComments: '',\r\n approvalCommentsList: [],\r\n displayType: '', // createEntry, pushEntry, pushComfire, createComfire展示类型\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: 'change'\r\n }\r\n ],\r\n leader: [\r\n {\r\n required: true,\r\n message: '请输入牵头市领导',\r\n trigger: 'change'\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: 'change'\r\n }\r\n ],\r\n projectField: [\r\n {\r\n required: true,\r\n message: '请选择所属领域',\r\n trigger: 'change'\r\n }\r\n ],\r\n projectRunway: [\r\n {\r\n required: true,\r\n message: '请选择所属跑道',\r\n trigger: 'change'\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 yd_jhlx: [], //计划类型\r\n markLoading: false,\r\n clickType: null,\r\n currentUser: null,\r\n treeItem: null,\r\n monthOptions: [\r\n {name: '一月', value: '1'},\r\n {name: '二月', value: '2'},\r\n {name: '三月', value: '3'},\r\n {name: '四月', value: '4'},\r\n {name: '五月', value: '5'},\r\n {name: '六月', value: '6'},\r\n {name: '七月', value: '7'},\r\n {name: '八月', value: '8'},\r\n {name: '九月', value: '9'},\r\n {name: '十月', value: '10'},\r\n {name: '十一月', value: '11'},\r\n {name: '十二月', value: '12'},\r\n {name: '持续实施', value: '13'}\r\n ]\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 this.yd_jhlx = dictUtils.getDictItemsFromCache('yd_jhlx') //\r\n // 计划类型前四项改革办可操作,市级部门不可操作\r\n this.yd_jhlx.forEach(item => {\r\n item.value = parseInt(item.value)\r\n if (item.value <= 3) {\r\n item.disabled = true\r\n }\r\n })\r\n },\r\n mounted() {\r\n setTimeout(() => {\r\n if (this.$store.state.user.currentOrgDetail == null) {\r\n this.$store\r\n .dispatch('user/loadCurrentUserDetail')\r\n .then(currentOrgDetail => {\r\n this.currentOrg = currentOrgDetail\r\n })\r\n } else {\r\n this.currentOrg = this.$store.state.user.currentOrgDetail\r\n }\r\n }, 100)\r\n },\r\n methods: {\r\n // 根据月份获取大写月份\r\n getMonthText(id) {\r\n let name = ''\r\n this.monthOptions.forEach(item => {\r\n if (id == item.value) {\r\n name = item.name\r\n }\r\n })\r\n return name\r\n },\r\n\r\n // 当前登录人组织与填报\r\n filterAuth(data) {\r\n if (\r\n data.planType &&\r\n data.planType <= 3 &&\r\n this.displayType == 'pushEntry'\r\n ) {\r\n return true\r\n } else {\r\n return false\r\n }\r\n },\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 this.parameter.pilotQuantitativeObjectivesList[\r\n index\r\n ].pilotObjectivesDetailsList = 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 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[type].filter(\r\n item => item.id !== row.id\r\n )\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[type].filter(\r\n item => item.id !== row.id\r\n )\r\n }\r\n })\r\n } else if (type == 'pilotSpecificScheduleList') {\r\n console.log(this.$route.name == 'ProjectCreationEntry')\r\n if (this.$route.name == 'ProjectCreationEntry' || this.$route.name == 'ProjectCreateConfirm') {\r\n majorProjects.deleteMonth(row.id, res => {\r\n if (res.state) {\r\n this.$message.success('删除数据成功')\r\n this.parameter[type] = this.parameter[type].filter(\r\n item => item.id !== row.id\r\n )\r\n }\r\n })\r\n } else {\r\n majorProjects.deleteJdjh(row.id, res => {\r\n if (res.state) {\r\n this.$message.success('删除数据成功')\r\n this.parameter[type] = this.parameter[type].filter(\r\n item => item.id !== row.id\r\n )\r\n }\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 edit(val, type, clickType) {\r\n this.displayType = type\r\n this.clickType = clickType\r\n if (type == 'createEntry') {\r\n this.title = '编辑'\r\n } else if (type == 'pushEntry') {\r\n this.title =\r\n this.$route.name == 'ProjectPromotioneEntry'\r\n ? '我的作战图'\r\n : this.$route.name == 'ProjectPromotioneReview'\r\n ? '审核'\r\n : '上报'\r\n } else if (type == 'pushComfire') {\r\n this.title = '审核'\r\n this.disabled = true\r\n } else if (type == 'createComfire' && !clickType) {\r\n this.title = '审核'\r\n } else if (type == 'createComfire' && clickType) {\r\n this.title = '编辑'\r\n }\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.approvalComments = this.parameter.approvalComments\r\n if (this.approvalComments) {\r\n this.approvalCommentsList = this.approvalComments.split('$_$')\r\n }\r\n this.parameter.closing =\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 = (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 = 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, type) {\r\n this.displayType = type\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.approvalComments = this.parameter.approvalComments\r\n if (this.approvalComments) {\r\n this.approvalCommentsList = this.approvalComments.split('$_$')\r\n }\r\n // this.parameter.closing = this.parameter.closing.toString()\r\n this.parameter.closing =\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 = (e.planMonth && e.planMonth.toString()) || ''\r\n // e.planYear = e.planYear.toString()\r\n // e.planMonth = e.planMonth.toString()\r\n })\r\n console.log(res)\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 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 return node\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 = 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 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.approvalComments = ''\r\n this.approvalCommentsList = []\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.clickType = null\r\n this.displayType = ''\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 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 },\r\n //打卡目标录入\r\n targetEntry(ind, val) {\r\n let title = '录入'\r\n if (this.title == '详情' || this.displayType == 'pushComfire') {\r\n title = '详情'\r\n }\r\n this.$refs.targetEntryDialog.add(ind, val, title)\r\n },\r\n // 通过\r\n handleVerify() {\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: 'warning'\r\n }).then(() => {\r\n // let status = this.displayType == 'pushComfire' ? 3 : 5\r\n let status = this.$route.name == 'ProjectPromotioneReview' ? 3 : 5\r\n this.parameter.approvalResults = 0\r\n this.parameter.approvalComments = ''\r\n this.handleUpdateStatus(status)\r\n })\r\n },\r\n handleVerifyAndSend() {\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: 'warning'\r\n }).then(() => {\r\n let status = 5\r\n this.parameter.approvalResults = 0\r\n this.parameter.approvalComments = ''\r\n this.parameter.sendStatus = 1\r\n this.handleUpdateStatus(status)\r\n })\r\n },\r\n // 驳回确认\r\n handleReject() {\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.$refs.RejectInfoDialog.open()\r\n })\r\n },\r\n // 驳回提交数据\r\n sendRejectInfo(rejectInfo) {\r\n // let status = this.displayType == 'pushComfire' ? 2 : 4\r\n let status = this.$route.name == 'ProjectPromotioneReview' ? 2 : 4\r\n if (!rejectInfo) {\r\n this.saveLoading = false\r\n return\r\n }\r\n this.parameter.approvalResults = 1\r\n this.parameter.approvalComments = rejectInfo\r\n this.handleUpdateStatus(status)\r\n },\r\n // 更新项目状态\r\n handleUpdateStatus(status) {\r\n this.saveLoading = true\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 this.parameter.status = status\r\n let message = ''\r\n switch (status) {\r\n case 0:\r\n message = '保存成功'\r\n break\r\n case 1:\r\n message = '上报成功'\r\n break\r\n case 2:\r\n message = '审核驳回成功'\r\n break\r\n case 3:\r\n message = '审核通过成功'\r\n break\r\n case 4:\r\n message = '确认驳回成功'\r\n break\r\n case 5:\r\n message =\r\n this.parameter.sendStatus == 1\r\n ? '确认通过并分发成功'\r\n : '确认通过成功'\r\n break\r\n default:\r\n break\r\n }\r\n this.$refs.formInfo.validate(valid => {\r\n if (valid) {\r\n // if (valid && flag) {\r\n this.markLoading = true\r\n majorProjects.updateStatus(this.parameter, res => {\r\n if (res.state) {\r\n this.$notify({\r\n type: 'success',\r\n message: 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 {\r\n this.$message.warning('信息录入有误,请检查后保存')\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 this.saveLoading = false\r\n },\r\n // 根据id获取节点\r\n getUnitItem(data, id) {\r\n data.forEach(item => {\r\n if (item.id == id) {\r\n this.treeItem = item\r\n } else {\r\n if (item.children) {\r\n this.getUnitItem(item.children, id)\r\n }\r\n }\r\n })\r\n },\r\n // 保存\r\n handleSave() {\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 this.$refs.formInfo.validate(valid => {\r\n if (valid) {\r\n // if (valid && flag) {\r\n this.markLoading = true\r\n // this.saveloading = true\r\n this.getUnitItem(this.treeData, this.parameter.unitId)\r\n this.parameter.unitGrade = this.treeItem.grade\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 {\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 this.$message.warning('信息录入有误,请检查后保存')\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]}