{"remainingRequest":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Manage\\material\\components\\MaterialIntoWareHoseManageDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Manage\\material\\components\\MaterialIntoWareHoseManageDialog.vue","mtime":1686792516249},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.number.constructor\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.array.find\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 step from '@/components/step.vue';\nimport materialIntoManage from '@/api/manager/material/materialIntoWarehouseManage.js';\nimport SelectMaterialDialog from '@/views/Manage/material/components/SelectMaterialDialog.vue';\nimport dictContracts from '@/components/dict/DictSelectUtils.js';\nimport CommonApi from '@/views/Manage/CommonApi.js';\nimport ordersDialog from \"./ordersDialog.vue\";\nexport default {\n name: 'MaterialIntoManageDialog',\n components: {\n SelectMaterialDialog: SelectMaterialDialog,\n step: step,\n ordersDialog: ordersDialog\n },\n props: {},\n data: function data() {\n return {\n handleSaveShow: false,\n statusInput: false,\n title: '新增',\n width: '197px',\n active: 0,\n stepArr: [{\n title: '入库单信息'\n }, {\n title: '入库物资明细'\n }],\n userSelectOptions: [],\n showFormDia: false,\n isEdit: false,\n params: {\n id: null,\n // applicant: '',\n // applicantName: '',\n org: '',\n // orgName: '',\n warehouse: '',\n // approvedDate: null,\n // inoutDate: null,\n // signAmount: 0,\n supplierName: '',\n orderId: '',\n orderName: '',\n status: '2'\n },\n rules: {\n applicant: [{\n required: true,\n message: '请输入签收人',\n trigger: 'change'\n }],\n orgName: [{\n required: true,\n message: '请输入签收部门',\n trigger: 'change'\n }],\n approvedDate: [{\n required: true,\n message: '请输入签收时间',\n trigger: 'change'\n }],\n inoutDate: [{\n required: true,\n message: '请输入入库时间',\n trigger: 'change'\n }],\n warehouse: [{\n required: true,\n message: '请选择仓库',\n trigger: 'change'\n }],\n orderName: [{\n required: true,\n message: '请选择采购订单',\n trigger: 'change'\n }],\n supplierName: [{\n required: true,\n message: '请选择供应商',\n trigger: 'change'\n }] // status: [\n // {\n // required: true,\n // message: '请选择入库状态',\n // trigger: 'change'\n // }\n // ]\n\n },\n warehouses: [],\n purchasingDetailList: [],\n gys: [],\n // 供应商\n addData: false,\n updateOrderOrigin: '' //更新时的原订单\n\n };\n },\n created: function created() {\n var _this = this;\n\n CommonApi.loadSelectOptions({\n name: 'manageCommonService.getAllUsers',\n query: '96240625-934F-490B-8AA6-0BC775B18468'\n }, function (res) {\n _this.userSelectOptions = res;\n });\n this.warehouses = dictContracts.getDictItemsFromCache('cmgt_ckmc');\n materialIntoManage.findAllCustom(function (res) {\n _this.gys = res;\n });\n },\n updated: function updated() {\n var _this2 = this;\n\n this.$nextTick(function () {\n if (_this2.$refs.table) {\n _this2.$refs.table.doLayout();\n }\n });\n },\n methods: {\n orderData: function orderData(data) {\n this.params.orderId = data.id;\n this.params.orderName = data.planTitle;\n },\n openDialog: function openDialog() {\n var _this3 = this;\n\n this.$nextTick(function () {\n _this3.$refs.ordersDialog.open();\n });\n },\n //签收人\n userChange: function userChange(v, s) {\n var vobj = this.userSelectOptions.find(function (u) {\n return u.id === v;\n });\n\n if (vobj) {\n // this.params.applicantName = vobj.fullname\n this.params.org = vobj.orgId; // this.params.orgName = vobj.orgName\n }\n },\n previousStep: function previousStep() {\n if (this.active == 0) {\n // this.toWorktable()\n this.handleClose();\n } else {\n this.active -= 1;\n }\n },\n nextStep: function nextStep() {\n var _this4 = this;\n\n if (this.active == 1) {\n this.handleSave();\n } else {\n this.$refs.formInfo.validate(function (valid) {\n if (valid) {\n _this4.active += 1; // 新增是每次点击都查询\n // 如果是编辑只在更改了订单时查询\n\n if (_this4.title == '新增') {\n _this4.getDetailList();\n } else if (_this4.updateOrderOrigin !== _this4.params.orderId) {\n _this4.getDetailList();\n }\n\n if (_this4.statusInput == true) {\n _this4.handleSaveShow = true;\n }\n }\n });\n }\n },\n getDetailList: function getDetailList() {\n var _this5 = this;\n\n this.purchasingDetailList = [];\n materialIntoManage.getDetailList(this.params.orderId).then(function (res) {\n if (res && res.detailList && res.detailList.length) {\n res.detailList.forEach(function (item) {\n // item.price = 0\n item.number = item.quantity;\n item.amount = parseFloat((item.quantity * item.price).toFixed(2));\n });\n console.log(res.detailList);\n _this5.purchasingDetailList = res.detailList;\n }\n });\n },\n add: function add() {\n var userinfo = this.$store.state.user.currentUserDetail;\n console.log(userinfo); // this.params.orgName = userinfo.org[0].orgName\n\n this.params.org = userinfo.org[0].orgId; // this.params.applicant = userinfo.user.id\n // this.params.applicantName = userinfo.user.fullname\n\n this.params.warehouse = '1';\n this.params.supplierName = this.gys[0] ? this.gys[0].name : '';\n var date = new Date(); // this.params.inoutDate = date.format('yyyy-MM-dd')\n // this.params.approvedDate = date.format('yyyy-MM-dd')\n\n this.showFormDia = true;\n },\n Update: function Update(row) {\n console.log(row);\n this.title = '修改';\n this.statusInput = true;\n this.showFormDia = true;\n this.params = row;\n this.updateOrderOrigin = row.orderId;\n this.purchasingDetailList = row.detailList; // if (row.status == '2' || row.status == '3') {\n // this.statusInput = true\n // }\n },\n handleClose: function handleClose() {\n this.params = {\n id: null,\n // applicant: '',\n // applicantName: '',\n org: '',\n // orgName: '',\n warehouse: '',\n // approvedDate: null,\n // inoutDate: null,\n // signAmount: 0,\n supplierName: '',\n orderId: '',\n orderName: '',\n applyTitle: '',\n status: '2'\n };\n this.$refs.formInfo.clearValidate();\n this.active = 0;\n this.purchasingDetailList = [];\n this.title = '新增';\n this.showFormDia = false;\n this.statusInput = false;\n this.handleSaveShow = false;\n },\n handleSave: function handleSave() {\n var _this6 = this;\n\n var method;\n\n if (!this.params.id) {\n // 新增\n method = materialIntoManage.addIntoWarehouse;\n }\n\n if (this.params.id) {\n // 修改\n method = materialIntoManage.editIntoWarehouse;\n }\n\n var list = this.purchasingDetailList.map(function (item) {\n var obj = {\n materialId: item.materialId,\n name: item.name,\n unit: item.unit,\n model: item.model,\n quantity: item.quantity,\n description: item.description,\n signWarehouseId: item.signWarehouseId,\n amount: item.amount,\n number: item.number,\n price: item.price\n };\n return obj;\n });\n this.params.detailList = list;\n method(this.params, function (res) {\n if (res.state) {\n _this6.$notify({\n type: 'success',\n message: _this6.title + '成功',\n duration: 2000\n });\n\n _this6.$parent.loadData();\n\n _this6.handleClose();\n } else {\n _this6.$message.warning(res.message);\n }\n });\n },\n numInputChange: function numInputChange(row, e) {\n row.amount = parseFloat((row.quantity * row.price).toFixed(2));\n },\n getSummaries: function getSummaries(param) {\n var columns = param.columns,\n data = param.data;\n var sums = [];\n columns.forEach(function (column, index) {\n if (index === 0) {\n sums[index] = '合计';\n return;\n }\n\n if (column.property == 'amount') {\n var values = data.map(function (item) {\n return Number(item[column.property]);\n });\n\n if (!values.every(function (value) {\n return isNaN(value);\n })) {\n sums[index] = values.reduce(function (prev, curr) {\n var value = Number(curr);\n\n if (!isNaN(value)) {\n return prev + curr;\n } else {\n return prev;\n }\n }, 0);\n sums[index] = sums[index].toFixed(2);\n sums[index] += ' 元';\n } else {\n sums[index] = '--';\n }\n } else {\n sums[index] = '';\n }\n });\n this.$nextTick(function () {}); // console.log(sums)\n\n return sums;\n }\n }\n};",null]}