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