{"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\\components\\ImportExportData\\ImportFile.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xypm-web\\src\\components\\ImportExportData\\ImportFile.vue","mtime":1679946713780},{"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":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":["import \"core-js/modules/es6.string.ends-with\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.function.name\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 projectContractSelector from '@/components/selector/ProjectContractSelector.vue';\nimport PriceLimitDialog from '@/components/dialog/PriceLimitDialog.vue';\nimport req from '@/request.js';\nimport HtFormItem from \"../control/HtFormItem.vue\";\nexport default {\n  name: 'importFile',\n  components: {\n    projectContractSelector: projectContractSelector,\n    PriceLimitDialog: PriceLimitDialog\n  },\n  props: {\n    importData: {\n      type: Object,\n      default: function _default() {\n        return [];\n      }\n    }\n  },\n  data: function data() {\n    return {\n      options: [],\n      disabled: false,\n      form: {},\n      importDataParams: {},\n      dialogImportVisible: false,\n      fullscreenLoading: false\n    };\n  },\n  created: function created() {\n    console.log(this.importData, 'importData');\n\n    if (this.importData.title == '年度计划导入') {\n      this.importData.showProject = false;\n    }\n  },\n  computed: {\n    uploadHeaders: function uploadHeaders() {\n      return {\n        Authorization: this.$store.state.login.currentUser && 'Bearer ' + this.$store.state.login.currentUser.token\n      };\n    }\n  },\n  // watch:{\n  //    importDataParams(){\n  //      return this.importDataParams=this.importData\n  //    }\n  // },\n  methods: {\n    //打开清单名称\n    handleFocusPriceLimit: function handleFocusPriceLimit() {\n      this.$refs.price.open(this.form.projectId);\n    },\n    //获取清单\n    handleSelectPrice: function handleSelectPrice(data) {\n      this.form = {\n        projectId: this.form.projectId,\n        priceLimitId: data.id,\n        priceLimitName: data.name\n      };\n    },\n    // selectContract(cid, obj) {\n    //   this.form.contractId = cid\n    //   this.form.contractName = obj.name\n    // },\n    changeContrant: function changeContrant(val) {\n      var _this = this;\n\n      this.form.contractId = val;\n      this.options.forEach(function (item) {\n        if (item.id == val) {\n          _this.form.contractName = item.name;\n        }\n      });\n    },\n    // changed(pid) {\n    //   this.form.projectId = pid\n    //   this.$refs.contract.getProjectData(this.importData.projectId)\n    //   if (this.importData.showContract) {\n    //     this.$refs.contract.contractId = ''\n    //     this.$refs.contract.getProjectData(pid)\n    //   }\n    // },\n    openDialog: function openDialog() {\n      this.dialogImportVisible = true; // if(this.importData.projectId && this.importData.contractId){\n      //   this.form = {\n      //     projectId: this.importData.projectId,\n      //     contractId: this.importData.contractId\n      //   }\n      // }else if (this.importData.projectId) {\n      //   this.form = {\n      //     projectId: this.importData.projectId\n      //   }\n      // } else if (this.importData.contractId) {\n      //   this.form = {\n      //     contractId: this.importData.contractId\n      //   }\n      // }\n\n      this.form = {\n        projectId: this.importData.projectId,\n        contractId: this.importData.contractId,\n        contractName: this.form.contractName,\n        title: this.importData.title\n      };\n\n      if (this.importData.showContract) {\n        this.getProjectData(this.importData.projectId);\n      }\n    },\n    getProjectData: function getProjectData(val) {\n      var _this2 = this;\n\n      var param = {\n        pageBean: {\n          page: 1,\n          pageSize: -1,\n          showTotal: true\n        },\n        querys: [{\n          group: \"main\",\n          operation: \"EQUAL\",\n          parentGroup: \"\",\n          property: \"pm.ID_\",\n          relation: \"AND\",\n          value: val\n        }]\n      }; //  let param = {\n      //   'pm.ID_': val.projectId,\n      //   register_date_: this.searchForm.registerDate,\n      //   register_person_name_: this.searchForm.registerPersonName,\n      // }\n\n      this.$http.post('${cqxy}/biz/contract/v1/page', param).then(function (res) {\n        var resp = res.data.value.rows;\n        var newArr = [];\n        resp.forEach(function (item) {\n          var obj = item.contract;\n          newArr.push(obj);\n        });\n        _this2.options = newArr;\n      });\n    },\n    cancelConfirm: function cancelConfirm() {\n      this.$refs.upload.clearFiles();\n      this.dialogImportVisible = false;\n      this.$refs.upload.uploadFiles = [];\n    },\n    submitImport: function submitImport() {\n      console.log(this.importData.showProject, 'this.importData.showProject');\n\n      if (!this.$refs.upload.uploadFiles || this.$refs.upload.uploadFiles.length == 0) {\n        this.$message.warning('请选择要导入的数据文件!');\n        return false;\n      } else if (this.importData.showProject == true && (this.form.projectId == '' || this.form.projectId == undefined)) {\n        this.$message.warning('请选择一条项目');\n        return false;\n      } else if (this.importData.showContract && this.form.contractId == '') {\n        this.$message.warning('请选择一条合同');\n        return false;\n      } else if (this.importData.showPriceName == true && this.form.priceLimitId == '') {\n        this.$message.warning('请选择一条清单信息');\n        return false;\n      }\n\n      this.$refs.upload.submit(); // this.form.projectId = ''\n      // this.form.contractId = ''\n      // this.form.priceLimitId = ''\n      // this.form.priceLimitName = ''\n    },\n    hadleUploadResult: function hadleUploadResult(response) {\n      this.fullscreenLoading = false;\n\n      if (response.state) {\n        this.$message.success(response.message);\n        this.dialogImportVisible = false; // this.$parent.$refs.AtTable.load()\n\n        this.$emit('load', response.value);\n      } else {\n        this.$message.error(response.message);\n      }\n    },\n    onExceed: function onExceed() {\n      this.$message.warning('只能选择一个Excel文件!');\n    },\n    beforeUpload: function beforeUpload(file) {\n      this.fileInfo = file;\n\n      if (!file.name.endsWith('.xlsx') && !file.name.endsWith('.xls')) {\n        this.$message.warning('只能导入Excel文件!');\n        return false;\n      }\n\n      this.fullscreenLoading = true;\n    }\n  }\n};",null]}