{"remainingRequest":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xypm-web\\src\\views\\BiddingInformation\\TenderingManagement.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xypm-web\\src\\views\\BiddingInformation\\TenderingManagement.vue","mtime":1675214577839},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"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\r\nimport ProjectInfoDialog from '@/components/dialog/ProjectInfoDialog.vue'\r\nimport utils from '@/utils.js'\r\nimport req from '@/request.js'\r\nexport default {\r\n  name: 'TenderingManagement',\r\n  components: {\r\n    ProjectInfoDialog,\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: './../static/excel/ExportTenderingManagement.xlsx',\r\n        importUrl:\r\n          window.context.cqxy +\r\n          '/biz/bidManagement/bidManagement/v1/importExcelData',\r\n          showProject:true,\r\n        projectId: '',\r\n      },\r\n      searchForm: {\r\n        projectId: '',\r\n        documentNumber: '',\r\n        name: '',\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        projectInfo: {\r\n          projectName: '',\r\n          proejctCode: '',\r\n        },\r\n        accessoryInfo: [],\r\n      },\r\n      dialogTitle: '添加',\r\n      dialogVisible: false,\r\n      rules: {\r\n        'projectInfo.projectCode': {\r\n          required: true,\r\n          message: '请选择项目代码',\r\n          trigger: 'blur',\r\n        },\r\n        'projectInfo.projectName': {\r\n          required: true,\r\n          message: '请选择项目名称',\r\n          trigger: 'blur',\r\n        },\r\n        documentNumber: {\r\n          required: true,\r\n          message: '请输入文件编号',\r\n          trigger: 'blur',\r\n        },\r\n        name: {\r\n          required: true,\r\n          message: '请输入投标名称',\r\n          trigger: 'blur',\r\n        },\r\n        bidAmount: {\r\n          required: true,\r\n          message: '请输入投标金额',\r\n          trigger: 'blur',\r\n        },\r\n        bidDate: {\r\n          required: true,\r\n          message: '请选择投标日期',\r\n          trigger: 'blur',\r\n        },\r\n        bidOf: {\r\n          required: true,\r\n          message: '请选择是否中标',\r\n          trigger: 'blur',\r\n        },\r\n        biddingAgency: {\r\n          required: true,\r\n          message: '请输入招标代理机构',\r\n          trigger: 'blur',\r\n        },\r\n        biddingChargePerson: {\r\n          required: true,\r\n          message: '请输入招标负责人',\r\n          trigger: 'blur',\r\n        },\r\n        biddingDate: {\r\n          required: true,\r\n          message: '请选择招标日期',\r\n          trigger: 'blur',\r\n        },\r\n        biddingFixedPrice: {\r\n          required: true,\r\n          message: '请输入招标限价(单位:万元)',\r\n          trigger: 'blur',\r\n        },\r\n        biddingRange: {\r\n          required: true,\r\n          message: '请输入招标范围',\r\n          trigger: 'blur',\r\n        },\r\n        constructionControlUnit: {\r\n          required: true,\r\n          message: '请输入监理单位',\r\n          trigger: 'blur',\r\n        },\r\n        plannedConstructionPeriod: {\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 window.context.cqxy + '/biz/bidManagement/bidManagement/v1/delete'\r\n    },\r\n  },\r\n  mounted() {\r\n    this.initProjectAll()\r\n  },\r\n  methods: {\r\n    //重置\r\n    handleReset() {\r\n      this.searchForm.projectId = ''\r\n      this.searchForm.documentNumber = ''\r\n      this.searchForm.name = ''\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    handleSelectProject(data) {\r\n      this.form.projectInfo.projectName = data.projectName\r\n      this.form.projectInfo.projectCode = data.projectCode\r\n      this.form.projectId = data.id\r\n      this.$refs.form.clearValidate()\r\n    },\r\n    //打开选择项目弹框\r\n    handleFocusProject() {\r\n      this.$refs.project.open()\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        document_number_: this.searchForm.documentNumber,\r\n        name: this.searchForm.name,\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 param = {\r\n        pageBean: {\r\n          page: 1,\r\n          pageSize: -1,\r\n          showTotal: true,\r\n        },\r\n\r\n        querys: query,\r\n        sorter: [],\r\n      }\r\n      req\r\n        .downloadPostCopy(\r\n          '${cqxy}/biz/bidManagement/bidManagement/v1/exportDataToExcel',\r\n          param\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    //获取附件信息\r\n    accessoryInfo(info) {\r\n      this.form.accessoryInfo = info\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    filterHandler(value, row, column) {\r\n      const property = column['property']\r\n      return row[property] === value\r\n    },\r\n    //查询\r\n    handleSearch() {\r\n      this.$refs.AtTable.load()\r\n    },\r\n    afterSaveData() {\r\n      setTimeout(() => {\r\n        this.form = {\r\n          projectInfo: {\r\n            projectName: '',\r\n            proejctCode: '',\r\n          },\r\n          accessoryInfo: [],\r\n        }\r\n        this.dialogVisible = false\r\n        this.$refs.AtTable.load()\r\n      }, 500)\r\n    },\r\n    handleAdd() {\r\n      this.dialogTitle = '添加'\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      } 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      }\r\n    },\r\n    handleRowDBClick(data) {\r\n      this.dialogTitle = '修改'\r\n      this.$http\r\n        .post('${cqxy}/biz/bidManagement/bidManagement/v1/detail/' + data.id)\r\n        .then((res) => {\r\n          this.dialogVisible = true\r\n          let response = res.data.value\r\n          let time = response.plannedConstructionPeriod\r\n          if (time) {\r\n            response.plannedConstructionPeriod = time.split('~')\r\n          }\r\n          this.form = response\r\n        })\r\n    },\r\n    handleSelect(selection) {\r\n    },\r\n    handleDialogCancel() {\r\n      this.dialogVisible = false\r\n      this.form = {\r\n        projectInfo: {\r\n          projectName: '',\r\n          proejctCode: '',\r\n        },\r\n        accessoryInfo: [],\r\n      }\r\n    },\r\n    handleDialogClose() {\r\n      this.dialogVisible = false\r\n      this.form = {\r\n        projectInfo: {\r\n          projectName: '',\r\n          proejctCode: '',\r\n        },\r\n        accessoryInfo: [],\r\n      }\r\n    },\r\n    //提交保存\r\n    handleDialogSubmit() {\r\n      this.$refs.form.validate((valid) => {\r\n        if (valid && this.form.accessoryInfo.length !== 0) {\r\n          let time = this.form.plannedConstructionPeriod\r\n          if (typeof time == 'object') {\r\n            this.form.plannedConstructionPeriod = time.join('~')\r\n          }\r\n          if (this.form.accessoryInfo && this.form.accessoryInfo.length) {\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.$http\r\n            .post('${cqxy}/biz/bidManagement/bidManagement/v1/save', this.form)\r\n            .then((res) => {\r\n              if (res.status == 200) {\r\n                setTimeout(() => {\r\n                  this.$message.success(res.data.message)\r\n                  this.afterSaveData()\r\n                }, 500)\r\n              } else {\r\n                this.$message.error(res.data.message)\r\n              }\r\n            })\r\n        } else if (this.form.accessoryInfo.length === 0) {\r\n          this.$message.error('请至少上传一个附件')\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        document_number_: this.searchForm.documentNumber,\r\n        name: this.searchForm.name,\r\n      }\r\n      this.searchObj = search\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     \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/bidManagement/bidManagement/v1/page', param)\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(() => cb())\r\n    },\r\n  },\r\n}\r\n",null]}