{"remainingRequest":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xypm-web\\src\\views\\ProjectInitiation\\DecisionBasisMenu\\AnnualPlan.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xypm-web\\src\\views\\ProjectInitiation\\DecisionBasisMenu\\AnnualPlan.vue","mtime":1723543352528},{"path":"D:\\jenkins\\workspace\\xypm-web\\babel.config.js","mtime":1675214572901},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.array.includes\";\nimport \"core-js/modules/es6.string.includes\";\nimport \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/web.dom.iterable\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport ProjectInfoDialog from '@/components/dialog/ProjectInfoDialog.vue';\nimport req from '@/request.js';\nvar BigNumber = require('bignumber.js');\nexport default {\n  name: 'AnnualPlan',\n  components: {\n    ProjectInfoDialog: ProjectInfoDialog\n  },\n  props: {\n    pid: {\n      type: String,\n      default: ''\n    },\n    isShow: {\n      type: Boolean,\n      default: true\n    }\n  },\n  data: function data() {\n    return {\n      total: {\n        projectName: '合计',\n        projectCode: '----',\n        projectType: '----',\n        totalInvestment: 0,\n        commencementTime: '----',\n        completionTime: '----',\n        year: '----',\n        totalAnnualInvestment: 0,\n        annualTasks: '----'\n      },\n      selected: {\n        numbers: 0,\n        money1: '0',\n        money2: '0'\n      },\n      importData: {\n        title: '年度计划导入',\n        templateName: '年度计划模板.xls',\n        downloadUrl: '/../fvue/static/excel/AnnualPlan.xls',\n        importUrl: window.context.cqxy + '/biz/projectApproval/decisionBasis/decisionAnnualPlan/v1/importExcelData',\n        showProject: true,\n        projectId: ''\n      },\n      loading: false,\n      projectObj: [],\n      //获取的所有项目数组\n      searchForm: {\n        projectId: '',\n        projectCode: '',\n        projectType: '',\n        year: new Date().getFullYear()\n      },\n      //顶部搜索参数\n      data: [],\n      pageResult: {\n        page: 1,\n        pageSize: 200,\n        total: 0\n      },\n      form: {},\n      dialogVisible: false,\n      dialogTitle: '添加',\n      optionYears: [],\n      options: [],\n      //表单验证\n      rules: {\n        projectName: {\n          required: true,\n          message: '项目名称不能为空',\n          trigger: 'blur'\n        }\n        // 'projectInfo.projectCode': {\n        //   required: true,\n        //   message: '项目代码不能为空',\n        //   trigger: 'blur',\n        // },\n        // projectCode: {\n        //   required: true,\n        //   message: '项目类型不能为空',\n        //   trigger: 'blur',\n        // },\n        // projectType: {\n        //   required: true,\n        //   message: '建设类型不能为空',\n        //   trigger: 'blur',\n        // },\n        //  responsibleUnit: {\n        //   required: true,\n        //   message: '责任单位不能为空',\n        //   trigger: 'blur',\n        // },\n        //  totalInvestment: {\n        //   required: true,\n        //   message: '总投资不能为空',\n        //   trigger: 'blur',\n        // },\n        // commencementTime: {\n        //   required: true,\n        //   message: '开工时间不能为空',\n        //   trigger: 'blur',\n        // },\n        // completionTime: {\n        //   required: true,\n        //   message: '完工时间不能为空',\n        //   trigger: 'blur',\n        // },\n      }\n    };\n  },\n\n  computed: {\n    deleteUrl: function deleteUrl() {\n      return window.context.cqxy + '/biz/projectApproval/decisionBasis/decisionAnnualPlan/v1/delete';\n    }\n  },\n  mounted: function mounted() {\n    this.initProjectAll();\n  },\n  created: function created() {\n    this.getYear();\n    this.getProjectData();\n  },\n  methods: {\n    getProjectData: function getProjectData() {\n      var _this = this;\n      var params = {\n        pageBean: {\n          page: 1,\n          pageSize: -1,\n          total: 0\n        },\n        sorter: [{\n          direction: 'DESC',\n          property: 'bdap.year_'\n        }, {\n          direction: 'ASC',\n          property: 'bdap.project_code_'\n        }, {\n          direction: 'DESC',\n          property: 'bdap.TOTAL_INVESTMENT_'\n        }]\n      };\n      this.$http.post('${cqxy}/biz/projectApproval/decisionBasis/decisionAnnualPlan/v1/page', params).then(function (resp) {\n        var response = resp.data.value;\n        _this.options = response.rows;\n      });\n    },\n    handleReset: function handleReset() {\n      var _this2 = this;\n      this.searchForm.projectId = '';\n      this.searchForm.projectCode = '';\n      this.searchForm.projectType = '';\n      this.searchForm.year = '';\n      this.$refs['searchForm'].resetFields();\n      this.pageResult = {\n        page: 1,\n        pageSize: 20,\n        total: 0\n      };\n      this.$nextTick(function () {\n        _this2.$refs.AtTable.load();\n      });\n    },\n    handleSelectProject: function handleSelectProject(data) {\n      this.form.projectInfo = data;\n      this.form.projectName = data.projectName;\n      this.form.projectCode = data.projectType;\n      this.form.projectId = data.id;\n      this.form.commencementTime = data.commencementTime;\n      this.form.completionTime = data.completionTime;\n      this.form.responsibleUnit = data.responsibleUnit;\n      this.form.constructionAddress = data.projectAddress;\n      this.form.constructionScaleContent = data.projectContent;\n      this.form.totalInvestment = data.projectMoney;\n      this.form.remarks = data.remarks;\n      // this.importData.projectId=data.id\n      this.$refs.ruleForm.clearValidate();\n    },\n    //打开选择项目弹框\n    handleFocusProject: function handleFocusProject() {\n      this.$refs.project.open();\n    },\n    //导入后重新加载数据\n    load: function load() {\n      this.$refs.AtTable.load();\n    },\n    //导出\n    handleExport: function handleExport() {\n      var _this3 = this;\n      var query = [];\n      var search = {\n        'bdap.id_': this.searchForm.projectId,\n        'bdap.project_code_': this.searchForm.projectCode,\n        'bdap.project_type_': this.searchForm.projectType,\n        'bdap.year_': this.searchForm.year\n      };\n      if (!this.isShow) {\n        search['bdap.id_'] = this.pid;\n      }\n      for (var i in search) {\n        if (search[i]) {\n          query.push({\n            group: 'advance',\n            operation: 'LIKE',\n            property: i,\n            relation: 'AND',\n            value: search[i]\n          });\n        }\n      }\n      var param = {\n        pageBean: {\n          page: 1,\n          pageSize: -1,\n          showTotal: true\n        },\n        querys: query,\n        sorter: []\n      };\n      req.downloadPostCopy('${cqxy}/biz/projectApproval/decisionBasis/decisionAnnualPlan/v1/exportDataToExcel', param).then(function (res) {\n        if (res.status == 200) {\n          _this3.$message.success('导出成功');\n        } else {\n          _this3.$message.error('导出失败');\n        }\n      });\n    },\n    //获取附件信息\n    accessoryInfo: function accessoryInfo(info) {\n      this.form.accessoryInfo = info;\n    },\n    initProjectAll: function initProjectAll() {\n      var _this4 = this;\n      //初始获取所有项目数据\n      if (this.isShow) {\n        this.$http.post('${cqxy}/biz/projectManagement/pm/v1/All').then(function (res) {\n          _this4.projectObj = res.data.value;\n        }, function (error) {\n          reject(error);\n        });\n      } else {\n        var params = {\n          pageBean: {\n            page: 1,\n            pageSize: 500,\n            total: 0\n          },\n          querys: [{\n            group: 'main',\n            operation: 'EQUAL',\n            property: 'id',\n            relation: 'AND',\n            value: this.pid\n          }]\n        };\n        this.$http.post('${cqxy}/biz/projectManagement/pm/v1/page', params).then(function (res) {\n          if (res.data.state) {\n            var resp = res.data.value;\n            _this4.projectObj = resp.rows;\n          }\n        });\n      }\n    },\n    //查询\n    handleSearch: function handleSearch() {\n      this.$refs.AtTable.load();\n    },\n    afterSaveData: function afterSaveData() {\n      var _this5 = this;\n      setTimeout(function () {\n        _this5.dialogVisible = false;\n        _this5.$refs.AtTable.load();\n      }, 500);\n    },\n    handleAdd: function handleAdd() {\n      this.dialogTitle = '添加';\n      this.dialogVisible = true;\n      this.form = {\n        projectName: '',\n        projectCode: 1,\n        projectId: '',\n        commencementTime: '',\n        completionTime: '',\n        responsibleUnit: '',\n        constructionAddress: '',\n        constructionScaleContent: '',\n        totalInvestment: '',\n        remarks: '',\n        year: new Date().getFullYear(),\n        projectType: 1,\n        projectInfo: {\n          projectName: '',\n          projectCode: ''\n        },\n        accessoryInfo: []\n      };\n      // if (this.isShow) {\n      //   let selectedProject = this.projectObj.find(item => {\n      //     if (item.currentProject && item.currentProject == 1) {\n      //       return item.currentProject == 1\n      //     }\n      //   })\n      //   this.form.projectInfo = selectedProject\n      //   this.form.projectId = selectedProject.id\n      //   this.form.projectCode = selectedProject.projectType\n      //   this.form.projectName = selectedProject.projectName\n      //   this.form.responsibleUnit = selectedProject.responsibleUnit\n      //   this.form.commencementTime = selectedProject.commencementTime\n      //   this.form.completionTime = selectedProject.completionTime\n      //   this.form.responsibleUnit = selectedProject.responsibleUnit\n      //   this.form.constructionAddress = selectedProject.projectAddress\n      //   this.form.constructionScaleContent = selectedProject.projectContent\n      //   this.form.totalInvestment = selectedProject.projectMoney\n      //   this.form.remarks = selectedProject.remarks\n      // } else {\n      //   //根据项目id查询\n      //   this.form.projectInfo = this.projectObj[0]\n      //   this.form.projectId = this.projectObj[0].id\n      //   this.form.projectCode = this.projectObj[0].projectType\n      //   this.form.projectName = this.projectObj[0].projectName\n      //   this.form.responsibleUnit = this.projectObj[0].responsibleUnit\n      //   this.form.commencementTime = this.projectObj[0].commencementTime\n      //   this.form.completionTime = this.projectObj[0].completionTime\n      //   this.form.responsibleUnit = this.projectObj[0].responsibleUnit\n      //   this.form.constructionAddress = this.projectObj[0].projectAddress\n      //   this.form.constructionScaleContent = this.projectObj[0].projectContent\n      //   this.form.totalInvestment = this.projectObj[0].projectMoney\n      //   this.form.remarks = this.projectObj[0].remarks\n      // }\n    },\n    handleRowDBClick: function handleRowDBClick(data) {\n      var _this6 = this;\n      // if (this.getMethodauth('plan_update')) {\n      this.dialogTitle = '修改';\n      this.$http.post('${cqxy}/biz/projectApproval/decisionBasis/decisionAnnualPlan/v1/detail/' + data.id).then(function (res) {\n        _this6.dialogVisible = true;\n        var response = res.data.value;\n        _this6.form = response;\n      });\n      // }\n    },\n    handleSelect: function handleSelect(selection) {\n      selection.forEach(function (item, index) {\n        if (item.projectName === '合计') {\n          selection.splice(index, 1);\n        }\n      });\n      this.selected.numbers = selection.length;\n      var total1 = this.calculationTotalNumber(selection, 'totalInvestment');\n      var total2 = this.calculationTotalNumber(selection, 'totalAnnualInvestment');\n      this.selected.money1 = total1;\n      this.selected.money2 = total2;\n    },\n    //取消\n    handleDialogCancel: function handleDialogCancel() {\n      this.dialogVisible = false;\n    },\n    //关闭窗口\n    handleDialogClose: function handleDialogClose(val) {\n      this.dialogVisible = false;\n    },\n    //提交保存\n    handleDialogSubmit: function handleDialogSubmit(formName) {\n      var _this7 = this;\n      this.$refs[formName].validate(function (valid) {\n        if (valid) {\n          if (_this7.form.accessoryInfo && _this7.form.accessoryInfo.length > 0) {\n            _this7.loading = true;\n            _this7.form.accessoryInfo.forEach(function (item) {\n              if (item.id) {\n                delete item.id;\n              }\n            });\n          }\n          _this7.$http.post('${cqxy}/biz/projectApproval/decisionBasis/decisionAnnualPlan/v1/save', _this7.form).then(function (res) {\n            if (res.status == 200) {\n              setTimeout(function () {\n                _this7.$message.success(res.data.message);\n                _this7.afterSaveData();\n              }, 500);\n            } else {\n              _this7.$message.error(res.data.message);\n            }\n            _this7.loading = false;\n          });\n        }\n        // else if (this.form.accessoryInfo.length === 0) {\n        //   this.$message.error('至少上传一个附件')\n        // }\n        else {\n          _this7.$message({\n            message: '*号必填项,不能为空!',\n            type: 'warning'\n          });\n          return false;\n        }\n      });\n    },\n    loadData: function loadData(param, cb) {\n      var _this8 = this;\n      var query = [];\n      var search = {\n        'bdap.id_': this.searchForm.projectId,\n        'bdap.project_code_': this.searchForm.projectCode,\n        'bdap.project_type_': this.searchForm.projectType,\n        'bdap.year_': this.searchForm.year\n      };\n      if (!this.isShow) {\n        search['bdap.id_'] = this.pid;\n        this.importData.projectId = this.pid;\n      }\n      for (var i in search) {\n        if (search[i]) {\n          query.push({\n            group: 'main',\n            operation: 'LIKE',\n            property: i,\n            relation: 'AND',\n            value: search[i]\n          });\n        }\n      }\n      if (param.querys && param.querys.length) {\n        var _param$querys;\n        (_param$querys = param.querys).push.apply(_param$querys, query);\n      } else {\n        param.querys = query;\n      }\n      this.$http.post('${cqxy}/biz/projectApproval/decisionBasis/decisionAnnualPlan/v1/page', param).then(function (resp) {\n        var response = resp.data.value;\n        _this8.selected = {\n          numbers: 0,\n          money1: '0',\n          money2: '0'\n        };\n        var data = response.rows;\n        _this8.total.totalInvestment = _this8.calculationTotal(data, 'totalInvestment');\n        _this8.total.totalAnnualInvestment = _this8.calculationTotal(data, 'totalAnnualInvestment');\n        if (data.length !== 0) {\n          data.push(_this8.total);\n        }\n        _this8.data = data;\n        _this8.pageResult = {\n          page: response.page,\n          pageSize: response.pageSize,\n          total: response.total\n        };\n      }, function (error) {\n        reject(error);\n      }).finally(function () {\n        if (cb) {\n          cb();\n        }\n      });\n    },\n    getYear: function getYear() {\n      var myDate = new Date();\n      var startYear = myDate.getFullYear() - 5; //起始年份\n      var endYear = myDate.getFullYear() + 1; //结束年份\n      for (var i = endYear; i >= startYear; i--) {\n        this.optionYears.push({\n          label: i,\n          value: i\n        });\n      }\n    },\n    //返回一个boolean类型，是否显示列表按钮\n    getMethodauth: function getMethodauth(elAuth) {\n      var allMethod = window.sessionStorage.allMethod;\n      var methodAuth = window.sessionStorage.methodAuth;\n      var allMethodArray = allMethod && allMethod.split(',');\n      var methodAuthArray = methodAuth && methodAuth.split(',');\n      // 无权限则隐藏按钮\n      if (methodAuthArray && methodAuthArray.includes(elAuth) && allMethodArray && allMethodArray.includes(elAuth)) {\n        return true;\n      } else {\n        return false;\n      }\n    },\n    // 计算列表合同金额合计金额\n    calculationTotal: function calculationTotal(data, key) {\n      var total = new BigNumber(0);\n      if (key && data && data.length !== 0) {\n        data.forEach(function (item) {\n          if (item[key]) {\n            total = total.plus(item[key]);\n          } else {\n            total = total.plus(0);\n          }\n        });\n      }\n      return this.moneyFormatter(total);\n    },\n    calculationTotalNumber: function calculationTotalNumber(data, key) {\n      var total = new BigNumber(0);\n      if (key && data && data.length !== 0) {\n        data.forEach(function (item) {\n          if (item[key]) {\n            total = total.plus(item[key]);\n          } else {\n            total = total.plus(0);\n          }\n        });\n      }\n      return total;\n    },\n    cellClassNameFn: function cellClassNameFn(row) {\n      // 列表项目名称为【合计】隐藏复选框\n      if (row.row.projectName === '合计') {\n        return 'table-column-hidden';\n      }\n    }\n  }\n};",null]}