{"remainingRequest":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xypm-web\\src\\views\\ProcessManagement\\ScheduleManagement\\administrativePay.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xypm-web\\src\\views\\ProcessManagement\\ScheduleManagement\\administrativePay.vue","mtime":1723543352528},{"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\r\nimport ProjectInfoDialog from '@/components/dialog/ProjectInfoDialog.vue'\r\nimport utils from '@/utils.js'\r\nimport req from '@/request.js'\r\nconst BigNumber = require('bignumber.js')\r\nexport default {\r\n  name: 'administrativePay',\r\n  components: {\r\n    ProjectInfoDialog,\r\n  },\r\n  data() {\r\n    return {\r\n      total: {\r\n        projectName: '合计',\r\n        paysName: '----',\r\n        paysType: '----',\r\n        paysValue: 0,\r\n        paysDate: '----',\r\n        remarks: '----',\r\n      },\r\n      selected: {\r\n        numbers: 0,\r\n        money: '0',\r\n      },\r\n      showType: false,\r\n      rules: {\r\n        projectName: {\r\n          required: true,\r\n          message: '请选择项目名称',\r\n          trigger: 'blur',\r\n        },\r\n        paysName: {\r\n          required: true,\r\n          message: '请输入缴费名称',\r\n          trigger: 'blur',\r\n        },\r\n        paysType: {\r\n          required: true,\r\n          message: '请选择缴费类型',\r\n          trigger: 'blur',\r\n        },\r\n        paysValue: {\r\n          required: true,\r\n          message: '请输入缴费金额',\r\n          trigger: 'blur',\r\n        },\r\n        paysDate: {\r\n          required: true,\r\n          message: '请输入缴费日期',\r\n          trigger: 'blur',\r\n        },\r\n      },\r\n      form: {\r\n        paysName: '',\r\n        paysValue: '',\r\n        paysType: '',\r\n        paysDate: '',\r\n        remarks: '',\r\n        accessoryInfo: [], //附件信息\r\n      },\r\n      loading: false,\r\n      searchForm: {\r\n        paysName: '',\r\n      },\r\n      dialogTitle: '行政缴费',\r\n      dialogVisible: false,\r\n      data: [],\r\n      pageResult: {\r\n        page: 1,\r\n        pageSize: 20,\r\n        total: 0,\r\n      },\r\n    }\r\n  },\r\n  computed: {\r\n    deleteUrl: function () {\r\n      return (\r\n        window.context.cqxy + '/biz/contract/administrativePayment/v1/delete'\r\n      )\r\n    },\r\n  },\r\n  methods: {\r\n    changeType(value, obj) {\r\n      if (value == '其它费用') {\r\n        this.showType = true\r\n        this.rules.paysType.message = '请输入缴费类型'\r\n      }\r\n    },\r\n    handleSelectProject(data) {\r\n      this.form.projectName = data.projectName\r\n      this.form.projectId = data.id\r\n    },\r\n    handleFocusProject() {\r\n      this.$refs.project.open()\r\n    },\r\n    loadData(param, cb) {\r\n      let query = []\r\n      let search = {\r\n        pays_name_: this.searchForm.paysName,\r\n      }\r\n      for (let i in search) {\r\n        if (search[i]) {\r\n          query.push({\r\n            group: 'defaultQueryGroup',\r\n            operation: 'LIKE',\r\n            property: 'pays_name_',\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('${cqxy}/biz/contract/administrativePayment/v1/query', param)\r\n        .then(\r\n          (resp) => {\r\n            let response = resp.data\r\n            this.selected = {\r\n              numbers: 0,\r\n              money: '0',\r\n            }\r\n            let data = response.rows\r\n            let total = this.calculationTotal(data, 'paysValue')\r\n            this.total.paysValue = total\r\n            if (data.length !== 0) {\r\n              data.push(this.total)\r\n            }\r\n            this.data = data\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    handleAdd() {\r\n      this.dialogVisible = true\r\n      this.form = {\r\n        projectName: this.$route.params.projectName,\r\n        projectId: this.$route.params.id,\r\n        paysName: '',\r\n        paysValue: '',\r\n        paysDate: '',\r\n        remarks: '',\r\n        accessoryInfo: [],\r\n      }\r\n      this.showType = false\r\n    },\r\n    handleSelect(selection) {\r\n      selection.forEach((item, index) => {\r\n        if (item.projectName === '合计') {\r\n          selection.splice(index, 1)\r\n        }\r\n      })\r\n      this.selected.numbers = selection.length\r\n      let total = this.calculationTotal(selection, 'paysValue')\r\n      this.selected.money = total\r\n    },\r\n    handleDialogCancel() {\r\n      this.dialogVisible = false\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            let mth = 'post'\r\n            if (this.form.id) {\r\n              mth = 'put'\r\n            } else {\r\n              mth = 'post'\r\n            }\r\n            this.$http[mth](\r\n              '${cqxy}/biz/contract/administrativePayment/v1/',\r\n              this.form\r\n            ).then((res) => {\r\n              if (res.data.state) {\r\n                this.$message.success('保存成功')\r\n                this.dialogVisible = false\r\n                this.$refs.AtTable.load()\r\n              }\r\n            })\r\n          } else {\r\n            this.$message.warning('请上传相关发票')\r\n          }\r\n        }\r\n      })\r\n    },\r\n    handleRowDBClick(data) {\r\n      this.form = data\r\n      this.dialogVisible = true\r\n    },\r\n    handelSearch() {\r\n      this.$refs.AtTable.load()\r\n    },\r\n    handleReset() {\r\n      this.searchForm.paysName = ''\r\n      this.$refs.AtTable.load()\r\n    },\r\n    handleFile(file) {\r\n      this.form.accessoryInfo = file\r\n    },\r\n    handleBack() {\r\n      this.$router.push({\r\n        name: 'ProjectFlowChart',\r\n        params: {\r\n          id: this.$route.params.id,\r\n          alias: 'contractInformation',\r\n        },\r\n      })\r\n    },\r\n    // 计算列表合同金额合计金额\r\n    calculationTotal(data, key) {\r\n      let total = new BigNumber(0)\r\n      if (key && data && data.length !== 0) {\r\n        data.forEach((item) => {\r\n          if (item[key]) {\r\n            total = total.plus(item[key])\r\n          } else {\r\n            total = total.plus(0)\r\n          }\r\n        })\r\n      }\r\n      return this.moneyFormatter(total)\r\n    },\r\n    cellClassNameFn(row) {\r\n      // 列表项目名称为【合计】隐藏复选框\r\n      if (row.row.projectName === '合计') {\r\n        return 'table-column-hidden'\r\n      }\r\n    },\r\n  },\r\n}\r\n",null]}