{"remainingRequest":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\jd_cgpt_fvue\\src\\views\\Normal\\ProcurementManagement\\purchaseRequisition\\component\\purchaseAddDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\src\\views\\Normal\\ProcurementManagement\\purchaseRequisition\\component\\purchaseAddDialog.vue","mtime":1720730442290},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/web.dom.iterable\";\nimport _defineProperty from \"D:/jenkins/workspace/jd_cgpt_fvue/node_modules/@babel/runtime/helpers/esm/defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 { mapState } from 'vuex';\nimport Breadcrumb from '@/components/Breadcrumb/index.vue';\nimport purchaseMaterial from \"./purchaseMaterial.vue\";\nimport procurementManagement from '@/api/procurementManagement';\nexport default {\n name: 'domesticDialog',\n components: {\n Breadcrumb: Breadcrumb,\n purchaseMaterial: purchaseMaterial\n },\n props: {\n editData: Object\n },\n data: function data() {\n return {\n importData: {\n title: '物料导入',\n templateName: '物料导入模板.xls',\n downloadUrl: '/../fvue/static/excel/采购制单明细导入.xlsx',\n importUrl: window.context.portal + '/bizPurchasingApplicationDetails/v1/excelToData',\n header: '物料导入'\n },\n tableHeight: 400,\n flexAuto: true,\n breadcrumbOpt: [{\n breadcrumbName: '采购制单'\n }, {\n breadcrumbName: '新增'\n }],\n saveing: false,\n dataList: [],\n //资质附件\n methodUnitsList: [],\n qualificationList: [],\n announcementList: [{\n label: '否',\n value: 0\n }, {\n label: '是',\n value: 1\n }],\n rulesForm: {\n acceptanceTime: [{\n required: true,\n message: '请选择承兑时间',\n trigger: 'blur'\n }],\n matNum: [{\n required: true,\n message: '请输入数量',\n trigger: 'blur'\n }],\n isAnnouncement: [{\n required: true,\n message: '请选择是否公示',\n trigger: 'blur'\n }],\n // pendingTime: [\n // {\n // required: true,\n // message: '请选择挂账时间',\n // trigger: 'blur',\n // },\n // ],\n preparedOrgName: [{\n required: true,\n message: '请输入申请单位',\n trigger: 'blur'\n }],\n preparedUserName: [{\n required: true,\n message: '请输入申请人',\n trigger: 'blur'\n }],\n applicationDate: [{\n required: true,\n message: '请选择需求日期',\n trigger: 'blur'\n }],\n applicationType: [{\n required: true,\n message: '请选择申请类型',\n trigger: 'blur'\n }],\n procurementMethod: [{\n required: true,\n message: '请选择定价方式',\n trigger: 'blur'\n }],\n matIfPlat: [{\n required: true,\n message: '请选择是否集中采购',\n trigger: 'blur'\n }],\n isTax: [{\n required: true,\n message: '请选择报价方式',\n trigger: 'blur'\n }],\n payMethod: [{\n required: true,\n message: '请选择付款方式',\n trigger: 'blur'\n }]\n },\n procurementMethod: '',\n dateTime: '',\n loading: false,\n parameter: {\n preparedOrgName: '',\n preparedUserName: '',\n applicationDate: '',\n applicationType: '1',\n preparedUserId: '',\n isAnnouncement: 0,\n acceptanceTime: 6,\n planType: '',\n isTax: '1',\n applicationNum: '',\n procurementMethod: '1',\n applicationSource: '1',\n pendingTime: 1,\n remarks: '',\n detailsList: [],\n payMethod: '1',\n matIfPlat: '0',\n status: '1',\n qualificationList: []\n },\n addressList: []\n };\n },\n computed: _objectSpread({}, mapState({\n headers: function headers(state) {\n return {\n Authorization: \"Bearer \".concat(state.login.currentUser.token)\n };\n },\n action: function action() {\n return window.context.portal + '/biz/universal/v1/minioUpload';\n }\n })),\n created: function created() {\n this.addModifyBtn();\n this.currentUser = JSON.parse(sessionStorage.getItem('currentUserDetail'));\n this.parameter.preparedOrgName = this.currentUser.org[0].orgName;\n this.parameter.preparedUserName = this.currentUser.user.fullname;\n this.parameter.preparedOrgCode = this.currentUser.org[0].orgCode;\n this.parameter.preparedUserId = this.currentUser.user.userId;\n this.parameter.preparedOrgId = this.currentUser.org[0].orgId;\n\n var moment = require('moment');\n\n this.parameter.applicationDate = moment().format('YYYY-MM-DD');\n this.dateTime = moment().format('YYYY-MM-DD');\n this.parameter.preparedDate = moment().format('YYYY-MM-DD');\n this.parameter.matIfPlat = this.$route.query.type;\n this.getAddress();\n },\n mounted: function mounted() {},\n methods: {\n getCode: function getCode() {\n var _this = this;\n\n this.$http.get('${portal}/sys/identity/v1/getNextIdByAlias?alias=cgsq_sqdbh').then(function (res) {\n if (res.data.state) {\n _this.parameter.applicationNum = res.data.value;\n }\n });\n },\n getAddress: function getAddress() {\n var _this2 = this;\n\n var params = {\n pageBean: {\n pageSize: -1,\n page: -1\n }\n };\n this.$http.post('${portal}/bizDeliveryAddress/v1/query', params).then(function (res) {\n _this2.addressList = res.data.rows;\n });\n },\n // 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用,function(file, fileList)\n handleSuccess: function handleSuccess(res, file, fileList) {\n console.log(res, fileList);\n this.dataList.push(res.value);\n },\n //下载按钮回调\n downloadFile: function downloadFile(name, url) {\n console.log(name, 'name');\n var a = document.createElement('a');\n var event = new MouseEvent('click');\n a.download = name;\n a.target = '_blank';\n a.href = url;\n a.dispatchEvent(event);\n },\n // 删除\n deleteHandle: function deleteHandle(index) {\n var _this3 = this;\n\n this.$confirm('是否确认删除该附件', '提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning'\n }).then(function () {\n _this3.dataList.splice(index, 1);\n });\n },\n // 打开资质标签弹窗\n handleOpen: function handleOpen() {\n this.$refs.visible.add();\n },\n // 打开物料弹窗\n openDialog: function openDialog() {\n this.$refs.troubleshooting.add(this.parameter.matIfPlat);\n },\n changeZZ: function changeZZ(val) {\n this.parameter.hasQualification = val;\n },\n // 修改需求日期\n changeApplicationDate: function changeApplicationDate(val) {\n var _this4 = this;\n\n this.parameter.applicationDate = val;\n\n if (this.parameter.detailsList.length != 0) {\n this.parameter.detailsList.forEach(function (item) {\n item.demandDate = _this4.parameter.applicationDate;\n });\n }\n },\n changePayMethod: function changePayMethod(val) {\n this.parameter.payMethod = val;\n },\n changeAcceptanceTime: function changeAcceptanceTime(val) {\n this.parameter.acceptanceTime = val;\n this.parameter.detailsList.forEach(function (item) {\n item.acceptanceTime = val;\n });\n },\n changeApplicationType: function changeApplicationType(val) {\n this.parameter.applicationType = val;\n\n if (val == 2) {\n if (this.parameter.detailsList.length != 0) {\n this.parameter.detailsList.forEach(function (item) {\n item.matNum = 1;\n });\n }\n } else {\n if (this.parameter.detailsList.length != 0) {\n this.parameter.detailsList.forEach(function (item) {\n item.matNum = '';\n });\n }\n }\n },\n addDetail: function addDetail(list) {\n var _this5 = this;\n\n console.log(list, 'llll');\n\n if (this.parameter.detailsList.length == 1) {\n this.parameter.detailsList = list;\n this.parameter.detailsList.forEach(function (item, index) {\n item['matId'] = item.id;\n item.demandDate = _this5.parameter.applicationDate;\n item['pendingTime'] = _this5.parameter.pendingTime;\n item['acceptanceTime'] = _this5.parameter.acceptanceTime;\n item.preparedDate = _this5.dateTime;\n item['maximumPriceLimit'] = 0;\n item['matIfPlat'] = _this5.parameter.matIfPlat;\n item['unloadAddress'] = '';\n item.planCode = _this5.parameter.applicationNum + '-' + (index + 1);\n });\n } else {\n list.forEach(function (item, index) {\n var _this5$parameter$deta;\n\n _this5.parameter.detailsList.push((_this5$parameter$deta = {\n matName: item.matName,\n matCode: item.matCode\n }, _defineProperty(_this5$parameter$deta, \"matCode\", item.matCode), _defineProperty(_this5$parameter$deta, \"matMaterial\", item.matMaterial), _defineProperty(_this5$parameter$deta, \"matSpec\", item.matSpec), _defineProperty(_this5$parameter$deta, \"matNum\", item.matNum), _defineProperty(_this5$parameter$deta, \"matUnit\", item.matUnit), _defineProperty(_this5$parameter$deta, \"procurementMethod\", item.procurementMethod), _defineProperty(_this5$parameter$deta, \"matBrand\", item.matBrand), _defineProperty(_this5$parameter$deta, \"preparedDate\", _this5.dateTime), _defineProperty(_this5$parameter$deta, \"demandDate\", _this5.parameter.applicationDate), _defineProperty(_this5$parameter$deta, \"matBaseExt\", item.matBaseExt), _defineProperty(_this5$parameter$deta, \"matOtherExt\", item.matOtherExt), _defineProperty(_this5$parameter$deta, \"planCode\", _this5.parameter.applicationNum + '-' + (index + 1)), _defineProperty(_this5$parameter$deta, \"id\", item.id), _defineProperty(_this5$parameter$deta, \"matPlatcode\", item.matPlatcode), _defineProperty(_this5$parameter$deta, \"acceptanceTime\", _this5.parameter.acceptanceTime), _defineProperty(_this5$parameter$deta, \"taxRate\", item.matTaxrate), _defineProperty(_this5$parameter$deta, \"matId\", item.id), _defineProperty(_this5$parameter$deta, \"matIfPlat\", _this5.parameter.matIfPlat), _defineProperty(_this5$parameter$deta, \"maximumPriceLimit\", 0), _defineProperty(_this5$parameter$deta, \"unloadAddress\", ''), _defineProperty(_this5$parameter$deta, \"pendingTime\", _this5.parameter.pendingTime), _defineProperty(_this5$parameter$deta, \"key\", new Date()), _this5$parameter$deta));\n });\n }\n\n if (this.parameter.applicationType == 2) {\n this.parameter.detailsList.forEach(function (item) {\n item.matNum = 1;\n });\n }\n\n this.addressList.forEach(function (item) {\n if (item.defaultStatus == 1) {\n _this5.parameter.detailsList.map(function (val) {\n return val.unloadAddress = item.enterpriseContactAddress;\n });\n }\n });\n this.methodUnitsList = this.parameter.detailsList;\n },\n //列表删除行\n addTable: function addTable() {\n var _this$parameter$detai;\n\n this.parameter.detailsList.push((_this$parameter$detai = {\n matName: '',\n matCode: ''\n }, _defineProperty(_this$parameter$detai, \"matCode\", ''), _defineProperty(_this$parameter$detai, \"matMaterial\", ''), _defineProperty(_this$parameter$detai, \"matSpec\", ''), _defineProperty(_this$parameter$detai, \"matNum\", ''), _defineProperty(_this$parameter$detai, \"matUnit\", ''), _defineProperty(_this$parameter$detai, \"procurementMethod\", ''), _defineProperty(_this$parameter$detai, \"matBrand\", ''), _defineProperty(_this$parameter$detai, \"demandDate\", this.parameter.applicationDate), _defineProperty(_this$parameter$detai, \"matBaseExt\", ''), _defineProperty(_this$parameter$detai, \"preparedDate\", this.dateTime), _defineProperty(_this$parameter$detai, \"matOtherExt\", ''), _defineProperty(_this$parameter$detai, \"id\", ''), _defineProperty(_this$parameter$detai, \"taxRate\", ''), _defineProperty(_this$parameter$detai, \"matId\", ''), _defineProperty(_this$parameter$detai, \"key\", new Date()), _this$parameter$detai));\n },\n //列表删除行\n delTable: function delTable(index, row) {\n this.parameter.detailsList.splice(index, 1); // if (row.id) {\n // this.parameter.deleteDetailsId.push(row.id)\n // }\n },\n handleOver: function handleOver() {\n this.flexAuto = !this.flexAuto;\n },\n changeMatIfPlat: function changeMatIfPlat(val) {\n this.parameter.matIfPlat = val;\n this.parameter.detailsList.forEach(function (item) {\n item['matIfPlat'] = val;\n });\n },\n // 选择采购方式\n changeMethod: function changeMethod(val) {\n this.procurementMethod = val;\n },\n //编辑\n addModifyBtn: function addModifyBtn() {\n if (this.$route.query.editRows) {\n this.breadcrumbOpt[1].breadcrumbName = '编辑';\n this.modifychoData(this.$route.query.editRows);\n } else {\n this.breadcrumbOpt[1].breadcrumbName = '新增';\n this.getCode();\n }\n },\n //获取修改回显数据\n modifychoData: function modifychoData(val) {\n var _this6 = this;\n\n this.loading = true;\n procurementManagement.bizPurchasingApplicationSelectOne(val.id).then(function (res) {\n console.log(res.value);\n _this6.parameter = res.value;\n _this6.dataList = _this6.parameter.accessoryList;\n _this6.loading = false;\n });\n },\n // 关闭//面包屑点击\n handleClose: function handleClose() {\n console.log(this.$route);\n\n if (this.$route.query.type == 1) {\n this.$router.push({\n name: 'purchaseRequisition',\n params: {\n tabsActiveName: 'collectivePurchaseRequisition'\n }\n });\n } else {\n this.$router.push({\n name: 'purchaseRequisition',\n params: {\n tabsActiveName: 'selfPurchaseRequisition'\n }\n });\n } // if (this.breadcrumbOpt[1].breadcrumbName === '编辑') {\n // this.$router.push({\n // name: 'purchaseRequisition',\n // params: {\n // pageBean: this.$route.query.pageBean,\n // },\n // })\n // } else {\n // this.$router.push({\n // name: 'purchaseRequisition',\n // })\n // }\n\n\n this.parameter = {};\n },\n // 保存\n handleSave: function handleSave() {\n var _this7 = this;\n\n this.parameter.accessoryList = this.dataList;\n this.parameter.detailsList.forEach(function (item) {\n item.procurementMethod = _this7.parameter.procurementMethod;\n item['matCompanyName'] = _this7.parameter.preparedOrgName;\n delete item.id;\n });\n this.$refs['formInfo'].validate(function (valid) {\n if (valid) {\n _this7.saveing = true;\n procurementManagement.bizPurchasingApplicationSaveOrUpdate(_this7.parameter).then(function (res) {\n _this7.saveing = false;\n\n if (res.state) {\n _this7.$message.success(res.message);\n\n _this7.handleClose();\n }\n });\n }\n });\n },\n changePendingTime: function changePendingTime(val) {\n var _this8 = this;\n\n this.parameter.pendingTime = val;\n this.parameter.detailsList.forEach(function (item) {\n item.pendingTime = _this8.parameter.pendingTime;\n });\n },\n load: function load(data) {\n var _this9 = this;\n\n console.log(data, '1');\n\n if (this.parameter.detailsList.length == 0) {\n this.parameter.detailsList = data;\n this.parameter.detailsList.forEach(function (item) {\n item.acceptanceTime = _this9.parameter.acceptanceTime;\n item.pendingTime = _this9.parameter.pendingTime;\n item.matIfPlat = _this9.parameter.matIfPlat;\n });\n } else {\n data.forEach(function (item) {\n var _this9$parameter$deta;\n\n _this9.parameter.detailsList.push((_this9$parameter$deta = {\n matName: item.matName,\n matCode: item.matCode\n }, _defineProperty(_this9$parameter$deta, \"matCode\", item.matCode), _defineProperty(_this9$parameter$deta, \"matMaterial\", item.matMaterial), _defineProperty(_this9$parameter$deta, \"matSpec\", item.matSpec), _defineProperty(_this9$parameter$deta, \"matNum\", item.matNum), _defineProperty(_this9$parameter$deta, \"matUnit\", item.matUnit), _defineProperty(_this9$parameter$deta, \"procurementMethod\", item.procurementMethod), _defineProperty(_this9$parameter$deta, \"matBrand\", item.matBrand), _defineProperty(_this9$parameter$deta, \"preparedDate\", item.demandDateValue), _defineProperty(_this9$parameter$deta, \"demandDate\", item.demandDate), _defineProperty(_this9$parameter$deta, \"matBaseExt\", item.matBaseExt), _defineProperty(_this9$parameter$deta, \"matOtherExt\", item.matOtherExt), _defineProperty(_this9$parameter$deta, \"id\", item.id), _defineProperty(_this9$parameter$deta, \"matPlatcode\", item.matPlatcode), _defineProperty(_this9$parameter$deta, \"remarks\", item.remarks), _defineProperty(_this9$parameter$deta, \"acceptanceTime\", _this9.parameter.acceptanceTime), _defineProperty(_this9$parameter$deta, \"taxRate\", item.taxRate), _defineProperty(_this9$parameter$deta, \"matId\", item.matId), _defineProperty(_this9$parameter$deta, \"matIfPlat\", _this9.parameter.matIfPlat), _defineProperty(_this9$parameter$deta, \"maximumPriceLimit\", item.maximumPriceLimit), _defineProperty(_this9$parameter$deta, \"unloadAddress\", item.unloadAddress), _defineProperty(_this9$parameter$deta, \"pendingTime\", _this9.parameter.pendingTime), _defineProperty(_this9$parameter$deta, \"key\", new Date()), _this9$parameter$deta));\n });\n }\n\n this.addressList.forEach(function (item) {\n _this9.parameter.detailsList.forEach(function (val) {\n if (item.code == val.unloadAddress) {\n val.unloadAddress = item.enterpriseContactAddress;\n }\n });\n });\n }\n }\n};",null]}