{"remainingRequest":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xypm-web\\src\\views\\CompletionAcceptance\\Settlement.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xypm-web\\src\\views\\CompletionAcceptance\\Settlement.vue","mtime":1723543352512},{"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":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 date from '@/api/date.js'\r\nimport req from '@/request.js'\r\nimport ProjectInfoDialog from '@/components/dialog/ProjectInfoDialog.vue'\r\nimport ContractInfoDialog from '@/components/dialog/ContractInfoDialog.vue'\r\nconst eipUserSelector = () =>\r\n  import('@/components/selector/EipUserSelector.vue')\r\nexport default {\r\n  name: 'Settlement',\r\n  components: {\r\n    ProjectInfoDialog,\r\n    eipUserSelector,\r\n    ContractInfoDialog,\r\n  },\r\n  props: {\r\n    pid: {\r\n      type: String,\r\n      default: '',\r\n    },\r\n    isShow: {\r\n      type: Boolean,\r\n      default: true,\r\n    },\r\n  },\r\n  data() {\r\n    return {\r\n      importData: {\r\n        title: '结算导入',\r\n        templateName: '结算模板.xls',\r\n        downloadUrl: '/../fvue/static/excel/settlement.xlsx',\r\n        importUrl:\r\n          window.context.cqxy +\r\n          '/biz/completionAcceptance/acceptanceSettlement/v1/importExcelData',\r\n        showProject: true,\r\n        showContract: true,\r\n        projectId: '',\r\n        contractName: '',\r\n        //  params:{\r\n        //     contractId: '',\r\n        //   contractName: '',\r\n        //  }\r\n      },\r\n      projectObj: [],\r\n      loading: false,\r\n      searchForm: {\r\n        projectId: '',\r\n        // projectCode: '',\r\n        filingAuthorityDate: '',\r\n        filingAuthorityOpinions: '',\r\n      }, //顶部搜索参数\r\n      data: [], //表格数据\r\n      pageResult: {\r\n        page: 1,\r\n        pageSize: 20,\r\n        total: 0,\r\n      },\r\n      form: {},\r\n      dialogVisible: false,\r\n      dialogTitle: '添加',\r\n      indexArr: [],\r\n      rules: {\r\n        'projectInfo.projectName': {\r\n          required: true,\r\n          message: '请选择项目名称',\r\n          trigger: 'blur',\r\n        },\r\n        'projectInfo.projectCode': {\r\n          required: true,\r\n          message: '请选择项目代码',\r\n          trigger: 'blur',\r\n        },\r\n        'contractInfo.name': {\r\n          required: true,\r\n          message: '请选择所属合同',\r\n          trigger: 'blur',\r\n        },\r\n        'contractInfo.contractNumber': {\r\n          required: true,\r\n          message: '请选择所属合同编号',\r\n          trigger: 'blur',\r\n        },\r\n        filingAuthorityOpinions: {\r\n          required: true,\r\n          message: '请输入结算单位',\r\n          trigger: 'blur',\r\n        },\r\n        filingAuthorityDate: {\r\n          required: true,\r\n          message: '请输入结算时间',\r\n          trigger: 'blur',\r\n        },\r\n        firstInstancePrice: {\r\n          required: true,\r\n          message: '请输入结算一审金额',\r\n          trigger: 'blur',\r\n        },\r\n        handler: {\r\n          required: true,\r\n          message: '请输入经办人',\r\n          trigger: 'blur',\r\n        },\r\n        filingAuthoritySendDate: {\r\n          required: true,\r\n          message: '请选择结算报送时间',\r\n          trigger: 'blur',\r\n        },\r\n        filingAuthorityRegistrantSend: {\r\n          required: true,\r\n          message: '请输入结算报送金额',\r\n          trigger: 'blur',\r\n        },\r\n      },\r\n    }\r\n  },\r\n  computed: {\r\n    deleteUrl: function () {\r\n      return (\r\n        window.context.cqxy +\r\n        '/biz/completionAcceptance/acceptanceSettlement/v1/delete'\r\n      )\r\n    },\r\n  },\r\n  mounted() {\r\n    this.initProjectAll()\r\n  },\r\n  methods: {\r\n    handleReset() {\r\n      this.searchForm.projectId = ''\r\n      this.searchForm.projectCode = ''\r\n      this.searchForm.filingAuthorityOpinions = ''\r\n      this.searchForm.filingAuthorityDate = ''\r\n      this.searchForm.constructUnit = ''\r\n      this.$refs['searchForm'].resetFields()\r\n      this.pageResult = {\r\n        page: 1,\r\n        pageSize: 20,\r\n        total: 0,\r\n      }\r\n      this.$refs['searchForm'].resetFields()\r\n      this.$nextTick(() => {\r\n        this.$refs.AtTable.load()\r\n      })\r\n    },\r\n    //合同数据获取\r\n    handleFocusContractName() {\r\n      this.$refs.contract.open(this.form.projectId)\r\n    },\r\n    handleContract(data) {\r\n      this.form.contractId = data.id\r\n      this.form.contractName = data.name\r\n      this.form.filingAuthorityOpinions = data.secondParty\r\n      this.form.contractInfo = {...data}\r\n      this.$refs.form.clearValidate()\r\n    },\r\n    handleDict(val, obj, str) {\r\n      if (str === 'htgl-zbfs') {\r\n        this.form.biddingChargeTypeValue = obj.name\r\n      } else if (str === 'htgl-htlb') {\r\n        this.form.contractInfo.typeValue = obj.name\r\n      }\r\n    },\r\n    //导入后重新加载数据\r\n    load() {\r\n      this.$refs.AtTable.load()\r\n    },\r\n    //导出\r\n    handleExport() {\r\n      let query = []\r\n      let search = {\r\n        'pm.ID_': this.searchForm.projectId,\r\n        // project_code_: this.searchForm.projectCode,\r\n        filing_authority_opinions_: this.searchForm.filingAuthorityOpinions,\r\n        filing_authority_date_: this.searchForm.filingAuthorityDate,\r\n        // construct_unit_: this.searchForm.constructUnit,\r\n      }\r\n      if (!this.isShow) {\r\n        search['pm.ID_'] = this.pid\r\n      }\r\n      for (let i in search) {\r\n        if (search[i]) {\r\n          query.push({\r\n            group: 'advance',\r\n            operation: 'LIKE',\r\n            property: i,\r\n            relation: 'AND',\r\n            value: search[i],\r\n          })\r\n        }\r\n      }\r\n      let data = {\r\n        pageBean: {\r\n          page: 1,\r\n          pageSize: 20,\r\n          showTotal: true,\r\n        },\r\n        querys: query,\r\n      }\r\n      req\r\n        .downloadPostCopy(\r\n          '${cqxy}/biz/completionAcceptance/acceptanceSettlement/v1/exportDataToExcel',\r\n          data\r\n        )\r\n        .then((res) => {\r\n          if (res.status === 200) {\r\n            this.$message.success('导出成功')\r\n          } else {\r\n            this.$message.error('导出失败')\r\n          }\r\n        })\r\n    },\r\n    handleFile(file) {\r\n      this.form.accessoryInfo = file\r\n    },\r\n    handleAdd() {\r\n      this.dialogTitle = '添加'\r\n      this.form = {\r\n        filingAuthorityDate: '',\r\n        projectId: '',\r\n        handler: '',\r\n        projectInfo: {\r\n          projectName: '',\r\n          projectCode: '',\r\n        },\r\n        accessoryInfo: [],\r\n        contractInfo: {\r\n          name: '',\r\n          contractNumber: '',\r\n        },\r\n        firstInstancePrice: '',\r\n        secondInstancePrice: '',\r\n        filingAuthoritySendDate: date.getDate(),\r\n      }\r\n      this.form.filingAuthorityDate = date.getDate()\r\n      this.dialogVisible = true\r\n      if (this.isShow) {\r\n        let selectedProject = this.projectObj.find((item) => {\r\n          if (item.currentProject && item.currentProject == 1) {\r\n            return item.currentProject == 1\r\n          }\r\n        })\r\n        this.form.projectInfo.projectName = selectedProject.projectName\r\n        this.form.projectInfo.projectCode = selectedProject.projectCode\r\n        this.form.projectId = selectedProject.id\r\n        this.form.handler = selectedProject.projectManager\r\n      } else {\r\n        //根据项目id查询\r\n        this.form.projectInfo.projectName = this.projectObj[0].projectName\r\n        this.form.projectInfo.projectCode = this.projectObj[0].projectCode\r\n        this.form.projectId = this.projectObj[0].id\r\n        this.form.handler = this.projectObj[0].projectManager\r\n      }\r\n    },\r\n    handleRowDBClick(data) {\r\n      this.dialogTitle = '修改'\r\n      this.form = data\r\n      this.dialogVisible = true\r\n    },\r\n    handleFocusProject() {\r\n      this.$refs.project.open()\r\n    },\r\n    openProject() {\r\n      this.$refs.project.open()\r\n    },\r\n    handleSelectProject(data) {\r\n      this.form.projectId = data.id\r\n      this.form.projectInfo.projectCode = data.projectCode\r\n      this.form.projectInfo.projectName = data.projectName\r\n      this.form.handler = data.projectManager\r\n      // this.form.projectInfo = {...data}\r\n      this.form.contractInfo.name = ''\r\n      this.form.contractInfo.contractNumber = ''\r\n      this.form.contractInfo.projectId = data.id\r\n\r\n      this.$refs.form.clearValidate()\r\n    },\r\n    handleSelect(selection) {},\r\n    handleDialogCancel() {\r\n      this.dialogVisible = false\r\n      this.form = {\r\n        projectInfo: {},\r\n        accessoryInfo: [],\r\n        contractInfo: {},\r\n      }\r\n    },\r\n    handleDialogClose() {\r\n      this.form = {\r\n        projectInfo: {},\r\n        accessoryInfo: [],\r\n        contractInfo: {},\r\n      }\r\n      this.dialogVisible = false\r\n    },\r\n    initProjectAll() {\r\n      //初始获取所有项目数据\r\n      if (this.isShow) {\r\n        this.$http.post('${cqxy}/biz/projectManagement/pm/v1/All').then(\r\n          (res) => {\r\n            this.projectObj = res.data.value\r\n          },\r\n          (error) => {\r\n            reject(error)\r\n          }\r\n        )\r\n      } else {\r\n        let params = {\r\n          pageBean: {\r\n            page: 1,\r\n            pageSize: 500,\r\n            total: 0,\r\n          },\r\n          querys: [\r\n            {\r\n              group: 'main',\r\n              operation: 'EQUAL',\r\n              property: 'id',\r\n              relation: 'AND',\r\n              value: this.pid,\r\n            },\r\n          ],\r\n        }\r\n        this.$http\r\n          .post('${cqxy}/biz/projectManagement/pm/v1/page', params)\r\n          .then((res) => {\r\n            if (res.data.state) {\r\n              let resp = res.data.value\r\n              this.projectObj = resp.rows\r\n            }\r\n          })\r\n      }\r\n    },\r\n    //提交保存\r\n    handleDialogSubmit() {\r\n      this.$refs.form.validate((valid) => {\r\n        if (valid) {\r\n          if (this.form.accessoryInfo && this.form.accessoryInfo.length > 0) {\r\n            this.form.accessoryInfo.forEach((item) => {\r\n              if (item.id) {\r\n                delete item.id\r\n              }\r\n            })\r\n          }\r\n          this.loading = true\r\n          this.$http\r\n            .post(\r\n              '${cqxy}/biz/completionAcceptance/acceptanceSettlement/v1/save',\r\n              this.form\r\n            )\r\n            .then((res) => {\r\n              if (res.data.state) {\r\n                this.$refs.form.resetFields()\r\n                this.$message.success(res.data.message)\r\n                this.dialogVisible = false\r\n                this.$refs.AtTable.load()\r\n              } else {\r\n                this.$message.error(res.data.message)\r\n              }\r\n              this.loading = false\r\n            })\r\n        }\r\n        // else if (this.form.accessoryInfo.length === 0) {\r\n        //   this.$message.error('请至少上传一个附件')\r\n        // }\r\n        else {\r\n          this.$message({\r\n            message: '*号必填项,不能为空!',\r\n            type: 'warning',\r\n          })\r\n          return false\r\n        }\r\n      })\r\n    },\r\n    loadData(param, cb) {\r\n      let query = []\r\n      let search = {\r\n        'pm.id_': this.searchForm.projectId,\r\n        // project_code_: this.searchForm.projectCode,\r\n        filing_authority_opinions_: this.searchForm.filingAuthorityOpinions,\r\n        filing_authority_date_: this.searchForm.filingAuthorityDate,\r\n      }\r\n      if (!this.isShow) {\r\n        search['pm.ID_'] = this.pid\r\n        this.importData.projectId = this.pid\r\n      }\r\n      for (let i in search) {\r\n        if (search[i]) {\r\n          query.push({\r\n            group: 'advance',\r\n            operation: 'LIKE',\r\n            property: i,\r\n            relation: 'AND',\r\n            value: search[i],\r\n          })\r\n        }\r\n      }\r\n      if (param.querys && param.querys.length) {\r\n        param.querys.push(...query)\r\n      } else {\r\n        param.querys = query\r\n      }\r\n      this.$http\r\n        .post(\r\n          '${cqxy}/biz/completionAcceptance/acceptanceSettlement/v1/page',\r\n          param\r\n        )\r\n        .then(\r\n          (resp) => {\r\n            let response = resp.data.value\r\n            this.data = response.rows\r\n            this.pageResult = {\r\n              page: response.page,\r\n              pageSize: response.pageSize,\r\n              total: response.total,\r\n            }\r\n          },\r\n          (error) => {\r\n            reject(error)\r\n          }\r\n        )\r\n        .finally(() => {\r\n          if (cb) {\r\n            cb()\r\n          }\r\n        })\r\n    },\r\n    findinfo() {\r\n      this.$refs.AtTable.load()\r\n    },\r\n  },\r\n}\r\n",null]}