{"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\\PurchasingManageDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Manage\\material\\components\\PurchasingManageDialog.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/web.dom.iterable\";\nimport \"core-js/modules/es6.function.name\";\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//\nimport CommonApi from '@/views/Manage/CommonApi.js';\nimport purchasingManage from '@/api/manager/material/purchasingManage.js';\nimport purchasingApi from \"../api/PurchasingApi\";\nimport dictContracts from '@/components/dict/DictSelectUtils.js';\nimport SelectMaterialDialog from '@/views/Manage/material/components/SelectMaterialDialog.vue';\nexport default {\n name: 'PurchasingManageDialog',\n components: {\n SelectMaterialDialog: SelectMaterialDialog\n },\n props: {},\n data: function data() {\n return {\n statusInput: false,\n pageName: '采购需求申请',\n userSelectOptions: [],\n currnetRow: null,\n k: 0,\n title: '新增',\n showFormDia: false,\n showMaterialDia: false,\n isEdit: false,\n activeName: 'PurchasingDetail',\n purchasingDetailList: [],\n params: {\n // applicant: '',\n // applicantName: '',\n applicationCase: '',\n applicationDate: '',\n applicationDept: '',\n // applicationDeptName: '',\n applyTitle: '',\n approver: '',\n approvedDate: '',\n id: null,\n memo: '',\n pkVal: '',\n detailList: [],\n sn: 0,\n applyType: '1',\n version: 0 // description: '',\n // id: '',\n // isDele: '',\n // lastTime: '',\n // materialId: '',\n // model: '',\n // name: '',\n // pkVal: '',\n // sn: 0,\n // unit: ''\n\n },\n rules: {\n applyTitle: [{\n required: true,\n message: '请输入申请标题',\n trigger: 'blur'\n }],\n applicationDept: [{\n required: true,\n message: '请输入申请部门',\n trigger: 'blur'\n }],\n applicant: [{\n required: true,\n message: '请输入申请人',\n trigger: 'blur'\n }],\n applicationCase: [{\n required: true,\n message: '请输入申请事由',\n trigger: 'blur'\n }],\n quantity: [{\n required: true,\n message: '请输入采购数量',\n trigger: 'blur'\n }],\n applicationDate: [{\n required: true,\n message: '请选择申请时间',\n trigger: 'blur'\n }]\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 // console.log('=========userSelectOptions=====', res)\n _this.userSelectOptions = res;\n });\n },\n methods: {\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; // this.params.orgId = vobj.orgId\n }\n },\n //新增申请采购明细列表\n requestPurchaseList: function requestPurchaseList() {\n var _this2 = this;\n\n purchasingApi.findByOrgUseDetail().then(function (res) {\n console.log(res);\n _this2.purchasingDetailList = res.value.map(function (item) {\n return {\n createTime: item.createTime,\n materialInfoId: item.materialId,\n model: item.model,\n id: item.id,\n name: item.name,\n pkVal: item.pkVal,\n isDele: item.isDele,\n unit: item.unit\n };\n });\n console.log(_this2.purchasingDetailList); // this.purchasingDetailList = res.value\n });\n },\n //编辑申请采购明细列表\n detailListFun: function detailListFun() {\n var _this3 = this;\n\n purchasingApi.getDetailListDetail(this.params.id).then(function (res) {\n // console.log(res)\n _this3.purchasingDetailList = res.value; // this.purchasingDetailList = res.value.map(item => {\n // return {\n // createTime: item.createTime,\n // materialInfoId: item.materialId,\n // model: item.model,\n // id: item.id,\n // name: item.name,\n // pkVal: item.pkVal,\n // isDele: item.isDele,\n // unit: item.unit\n // }\n // })\n\n console.log(_this3.purchasingDetailList);\n });\n },\n add: function add() {\n var userinfo = this.$store.state.user.currentUserDetail;\n console.log(userinfo);\n this.params.applicationDept = userinfo.org[0].orgId; // this.params.applicationDeptName = userinfo.org[0].orgName\n // this.params.applicant = userinfo.user.fullname\n\n var date = new Date();\n this.params.applicationDate = date.format('yyyy-MM-dd');\n this.showFormDia = true;\n this.requestPurchaseList();\n },\n handleClose: function handleClose() {\n this.params = {\n // applicant: '',\n applicationCase: '',\n applicationDate: '',\n applicationDept: '',\n // applicationDeptName: '',\n applyTitle: '',\n approver: '',\n approvedDate: '',\n id: null,\n memo: '',\n pkVal: '',\n detailList: [],\n sn: 0,\n applyType: '1',\n version: 0\n };\n this.$refs.formInfo.clearValidate();\n this.purchasingDetailList = [];\n this.title = '新增';\n this.showFormDia = false;\n this.statusInput = false;\n },\n handleSave: function handleSave() {\n var _this4 = this;\n\n this.$refs.formInfo.validate(function (valid) {\n if (valid) {\n var method = '';\n\n if (_this4.title == '新增') {\n // 新增\n method = purchasingApi.purchasingAdd;\n }\n\n if (_this4.title == '修改') {\n // 修改\n method = purchasingApi.purchasingUpdate;\n } // console.log(this.purchasingDetailList)\n\n\n _this4.params.detailList = _this4.purchasingDetailList;\n console.log(_this4.params); // return\n\n var bool = _this4.purchasingDetailList.every(function (item) {\n return item.quantity !== undefined && item.quantity !== ''; //判断条件\n });\n\n if (bool == false) {\n _this4.$message.error('采购数量不能为空');\n } else {\n method(_this4.params, function (res) {\n console.log(res);\n\n if (res.state) {\n _this4.$notify({\n type: 'success',\n message: _this4.title + '成功',\n duration: 2000\n }); // this.$emit('loadData')\n\n\n _this4.$parent.loadData();\n\n console.log(22222222);\n\n _this4.handleClose();\n } else {\n _this4.$message.warning(response.message);\n }\n });\n }\n }\n });\n },\n Update: function Update(row, detail) {\n console.log(row, detail);\n this.title = '修改';\n this.showFormDia = true; // this.params.memo = row.memo\n\n this.params.applyTitle = row.applyTitle;\n this.params.applicant = row.applicant;\n this.params.applicationDate = row.applicationDate;\n this.params.applicationDept = row.applicationDept; // this.params.applicationDeptName = row.applicationDeptName\n\n this.params.applicationCase = row.applicationCase;\n this.params.id = row.id;\n\n if (row.status == '2') {\n this.statusInput = true;\n } // this.purchasingDetailList = detail\n\n\n this.detailListFun();\n this.$parent.loadData();\n },\n addRow: function addRow() {\n //\n var row = {\n quantity: 0,\n name: '',\n model: '',\n memo: '',\n id: null,\n purchasingId: null,\n materialInfoId: null\n };\n this.purchasingDetailList.push(row);\n },\n deleteDetail: function deleteDetail(index, row) {\n this.purchasingDetailList.splice(index, 1);\n },\n selectMaterial: function selectMaterial() {\n this.$refs.materialDia.showDia = true;\n this.$refs.materialDia.selectionEcho();\n },\n saveMaterial: function saveMaterial(arr) {\n var _this5 = this;\n\n this.purchasingDetailList = [];\n console.log(arr);\n arr.forEach(function (m) {\n _this5.purchasingDetailList.push(m);\n });\n this.$refs.materialDia.showDia = false;\n this.$refs.materialDia.materialSelection = [];\n },\n tableCurrentChange: function tableCurrentChange(row) {\n if (this.currnetRow) {\n this.currnetRow.isEdit = false;\n }\n\n row.isEdit = true;\n this.currnetRow = row;\n this.k++;\n },\n tableHeaderClick: function tableHeaderClick(col) {\n if (!(col.index && col.index === 999)) {\n this.purchasingDetailList.forEach(function (item) {\n item.isEdit = false;\n });\n this.currnetRow = null;\n }\n }\n }\n};",null]}