{"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\\PurchaseScheduleDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Manage\\material\\components\\PurchaseScheduleDialog.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.function.name\";\nimport \"core-js/modules/web.dom.iterable\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 step from '@/components/step.vue';\nimport purchaseSchedule from \"../api/PurchaseSchedule\";\nimport purchasingManage from '@/api/manager/material/purchasingManage.js';\nimport dictContracts from '@/components/dict/DictSelectUtils.js';\nimport purchasingApi from \"../api/PurchasingApi\";\nimport SelectMaterialDialog from '@/views/Manage/material/components/SelectMaterialDialog.vue';\nexport default {\n name: 'PurchasingManageDialog',\n components: {\n step: step,\n SelectMaterialDialog: SelectMaterialDialog\n },\n props: {},\n data: function data() {\n return {\n handleSaveShow: false,\n statusInput: false,\n handleSelectChangeData: [],\n purchaseVisible: false,\n planPurchasingList: [],\n //供应商信息\n vendorData: [],\n //\n handleSelectChangeLength: 0,\n //采购物资明细\n purMaterialsData: [],\n //申请采购明细\n purchaseDetailsList: [],\n purchaseDetailsListId: [],\n userSelectOptions: [],\n //步骤条数据\n width: '197px',\n active: 0,\n stepArr: [{\n title: '基本信息'\n }, {\n title: '采购明细'\n } // {\n // title: '完成'\n // }\n ],\n value: '',\n ismilitary: -1,\n isGradeA: -1,\n isGradeB: -1,\n iscarrierA: -1,\n iscarrierB: -1,\n infoLsit: [{\n type: '',\n num: '',\n memo: ''\n }, {\n type: '',\n num: '',\n memo: ''\n }],\n //表格数据\n gridData: [{\n date: '2016-05-02',\n title: '水电费',\n number: 1,\n department: '技术部',\n time: '2016-05-02',\n name: '王小虎',\n address: '上海市普陀区金沙江路 1518 弄'\n }, {\n date: '2016-05-02',\n title: '水电费',\n number: 1,\n department: '技术部',\n time: '2016-05-02',\n name: '王小虎',\n address: '上海市普陀区金沙江路 1518 弄'\n }],\n currnetRow: null,\n k: 0,\n title: '新增',\n showFormDia: false,\n showMaterialDia: false,\n isEdit: false,\n activeName: 'PurchasingDetail',\n purchasingDetailList: [],\n planDetailList: [],\n params: {\n orgName: '',\n supplierList: [],\n orgId: '',\n // planDate: '',\n planTitle: '' // planUser: '',\n // planUserName: '',\n // totalPrice: ''\n\n },\n rules: {\n planTitle: [{\n required: true,\n message: '请输入订单标题',\n trigger: 'blur'\n }],\n orgName: [{\n required: true,\n message: '请输入采购部门',\n trigger: 'blur'\n }],\n planUser: [{\n required: true,\n message: '请输入采购执行人',\n trigger: 'blur'\n }],\n planDate: [{\n required: true,\n message: '请输入下单日期',\n trigger: 'blur'\n }],\n totalPrice: [{\n required: true,\n message: '请输入预计金额',\n trigger: 'blur'\n }],\n supplierList: [{\n required: true,\n message: '请选择供应商',\n trigger: 'change'\n }]\n }\n };\n },\n created: function created() {\n var _this = this;\n\n CommonApi.loadSelectOptions({\n name: 'manageCommonService.getAllUsers',\n query: '' // query: '96240625-934F-490B-8AA6-0BC775B18468'\n\n }, function (res) {\n // console.log('=========userSelectOptions=====', res)\n _this.userSelectOptions = res;\n }); //供应商信息\n\n this.vendorSele();\n },\n methods: {\n saveMaterial: function saveMaterial(arr) {\n var _this2 = this;\n\n this.purMaterialsData = [];\n console.log(arr);\n arr.forEach(function (m) {\n _this2.purMaterialsData.push(m);\n });\n this.$refs.materialDia.showDia = false;\n this.$refs.materialDia.materialSelection = [];\n },\n qualificationDetail: function qualificationDetail(index, row) {\n this.purMaterialsData.splice(index, 1);\n },\n qualificationMaterial: function qualificationMaterial() {\n this.$refs.materialDia.showDia = true;\n this.$refs.materialDia.selectionEcho();\n },\n selectionEcho: function selectionEcho() {\n var _this3 = this;\n\n this.$refs.multipleSelection.clearSelection();\n this.planDetailList.forEach(function (key) {\n _this3.purchaseDetailsList.forEach(function (row) {\n if (row.id == key.id) {\n _this3.$refs.multipleSelection.toggleRowSelection(row, true);\n }\n });\n });\n },\n handleSelectChange: function handleSelectChange(val) {\n console.log(val);\n this.handleSelectChangeData = val;\n },\n //添加\n toAdd: function toAdd() {\n this.planDetailList = this.handleSelectChangeData;\n this.purchaseVisible = false;\n },\n //删除\n deleteDetail: function deleteDetail(index, row) {\n this.planDetailList.splice(index, 1);\n },\n selectMaterial: function selectMaterial() {\n this.purchaseVisible = true;\n this.selectionEcho();\n },\n //选择采购申请单回显\n // selectionEcho() {\n // this.$nextTick(function() {\n // this.planDetailList.forEach(key => {\n // if (this.planDetailList.length == 0) {\n // // this.$refs.multipleSelection.clearSelection()\n // } else {\n // this.purchaseDetailsList.forEach(row => {\n // // console.log(key.purchasingId == row.id)\n // if (row.id == key.purchasingId) {\n // this.$refs.multipleSelection.toggleRowSelection(row, true)\n // }\n // })\n // }\n // })\n // })\n // },\n //供应商信息\n vendorSele: function vendorSele() {\n var _this4 = this;\n\n var vendor = {\n groupRelation: 'AND',\n groupTree: {},\n pageBean: {\n page: 1,\n pageSize: 10,\n showTotal: true\n },\n params: {},\n querys: [{\n group: 'main',\n operation: 'EQUAL',\n parentGroup: '',\n property: '',\n relation: 'AND',\n value: {}\n }],\n sorter: [{\n direction: 'ASC',\n property: 'sn'\n }]\n };\n purchaseSchedule.pageQueryQuery(vendor, function (res) {\n console.log(res);\n _this4.vendorData = res.rows;\n });\n },\n //根据选中的采购申请单ids获取合并后的物资信息\n mergeIdsData: function mergeIdsData() {\n var _this5 = this;\n\n this.purchaseDetailsListId = [];\n this.planDetailList.forEach(function (item) {\n _this5.purchaseDetailsListId.push(item.id);\n }); // this.purchaseDetailsListId = this.purchaseDetailsListId.toString()\n // console.log({ids: this.purchaseDetailsListId})\n\n purchaseSchedule.purchasingFindByIds(this.purchaseDetailsListId, function (res) {\n console.log(res);\n _this5.purMaterialsData = res.value.map(function (item) {\n return {\n // description: item.description,\n materialId: item.materialInfoId,\n model: item.model,\n id: item.id,\n name: item.name,\n pkVal: item.pkVal,\n quantity: item.quantity,\n price: item.price,\n actualQuantity: '',\n unit: item.unit\n };\n }); // this.purMaterialsData = res.value\n // console.log(this.purMaterialsData)\n });\n },\n //申请采购明细选中数据\n // handleSelectChange(val) {\n // this.handleSelectChangeLength = val.length\n // console.log('val', val)\n // this.purchaseDetailsListId = []\n // this.planPurchasingList = []\n // val.forEach(item => {\n // this.purchaseDetailsListId.push(item.id)\n // })\n // this.planPurchasingList = val.map(item => {\n // return {\n // purchasingId: item.id\n // }\n // })\n // this.planDetailList = this.planPurchasingList\n // // this.purchaseDetailsListId = this.purchaseDetailsListId.toString()\n // // console.log(this.purchaseDetailsListId)\n // // console.log(this.planPurchasingList)\n // },\n //申请采购明细\n purchaseDetails: function purchaseDetails() {\n var _this6 = this;\n\n var purchaseDetailsData = {\n groupRelation: 'AND',\n pageBean: {\n page: 1,\n pageSize: 10,\n showTotal: true\n },\n querys: [{\n group: 'main',\n operation: 'EQUAL',\n parentGroup: '',\n property: 'status',\n relation: 'AND',\n value: '1'\n }],\n sorter: [{\n direction: 'ASC',\n property: 'sn'\n }]\n };\n purchaseSchedule.applyPurchasingQuery(purchaseDetailsData, function (res) {\n console.log(res); // this.total = res.total\n\n _this6.purchaseDetailsList = res.rows; // this.commonApiData()\n // this.loading = false\n });\n },\n //不走条事件\n // toWorktable() {\n // this.active = 0\n // this.ismilitary = -1\n // this.isGradeA = -1\n // this.isGradeB = -1\n // this.iscarrierA = -1\n // this.iscarrierB = -1\n // this.$router.go('-1')\n // },\n previousStep: function previousStep() {\n if (this.active == 0) {\n // this.toWorktable()\n this.handleClose();\n } else {\n this.active -= 1;\n this.handleSaveShow = false; // this.selectionEcho()\n }\n },\n nextStep: function nextStep() {\n var _this7 = this;\n\n this.$refs.formInfo.validate(function (valid) {\n if (valid) {\n if (_this7.active == 1) {} else {\n console.log(_this7.planDetailList);\n\n if (_this7.planDetailList.length == 0) {\n _this7.$message.error('请选择采购申请单');\n } else {\n _this7.active += 1;\n\n if (_this7.title == '新增') {\n _this7.mergeIdsData();\n }\n\n if (_this7.statusInput == true) {\n _this7.handleSaveShow = true;\n } // this.statusInput = false\n // this.handleSelectChangeLength = 0\n\n }\n }\n }\n });\n },\n //取消按钮\n cancelBtn: function cancelBtn() {\n this.handleClose();\n },\n //\n add: function add() {\n var userinfo = this.$store.state.user.currentUserDetail;\n console.log(userinfo); // this.params.applicationDept = userinfo.org[0].orgId\n // this.params.applicationDeptName = userinfo.org[0].orgName\n // this.params.applicant = userinfo.user.fullname\n\n this.params.orgId = userinfo.org[0].orgId;\n this.params.orgName = userinfo.org[0].orgName;\n var date = new Date();\n this.params.planDate = date.format('yyyy-MM-dd');\n this.showFormDia = true; //申请采购明细\n\n this.purchaseDetails();\n },\n handleClose: function handleClose() {\n this.params = {\n orgName: '',\n supplierList: [],\n orgId: '',\n // planDate: '',\n planTitle: '',\n // planUser: '',\n // planUserName: '',\n // totalPrice: '',\n detailList: []\n };\n this.$refs.formInfo.clearValidate();\n this.purchasingDetailList = [];\n this.title = '新增';\n this.showFormDia = false;\n this.active = 0; // this.$refs.multipleSelection.clearSelection()\n\n this.statusInput = false;\n this.handleSaveShow = false;\n this.planDetailList = [];\n },\n handleSave: function handleSave() {\n var _this8 = this;\n\n var method;\n\n if (this.title == '新增') {\n // 新增\n method = purchaseSchedule.materialOrder;\n }\n\n if (this.title == '修改') {\n // 修改\n method = purchaseSchedule.editMaterialOrder;\n } // \n\n\n this.userSelectOptions.forEach(function (item) {\n if (item.id == _this8.params.planUser) {\n _this8.params.planUserName = item.fullname;\n }\n });\n this.params.detailList = this.purMaterialsData;\n this.params.planPurchasingList = this.purchaseDetailsListId.map(function (item) {\n return {\n purchasingId: item\n };\n });\n this.params.supplierList = this.params.supplierList.map(function (item) {\n return {\n supplierId: item\n };\n });\n method(this.params, function (res) {\n // console.log(res)\n // console.log(this.title)\n if (res.state) {\n _this8.$notify({\n type: 'success',\n message: _this8.title + '成功',\n duration: 2000\n });\n\n _this8.$parent.loadData();\n\n _this8.handleClose();\n } else {\n _this8.$message.warning(response.message);\n }\n });\n },\n Update: function Update(row) {\n var _this9 = this;\n\n this.title = '修改'; // console.log(this.title)\n\n this.showFormDia = true;\n purchaseSchedule.entitiesQuery(row.id, function (res) {\n console.log(res);\n _this9.params.id = res.id;\n _this9.params.orgName = res.orgName; // this.params.planDate = res.planDate\n\n _this9.params.planTitle = res.planTitle; // this.params.planUser = res.planUser\n\n _this9.params.supplierList = [];\n res.supplierList.map(function (item) {\n _this9.params.supplierList.push(item.supplierId);\n });\n\n if (res.purchasingList) {\n _this9.planDetailList = res.purchasingList;\n } else {\n _this9.planDetailList = [];\n } // this.planDetailList = res.purchasingList\n // this.selectionEcho()\n // console.log(this.params.supplierList)\n // this.params.totalPrice = res.totalPrice\n\n\n _this9.purMaterialsData = res.detailList;\n\n if (row.status == '2') {\n _this9.statusInput = true;\n }\n });\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(index, row) {\n // this.purchasingDetailList.splice(index, 1)\n // },\n // selectMaterial() {\n // this.$refs.materialDia.showDia = true\n // },\n // saveMaterial(arr) {\n // arr.forEach(m => {\n // this.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]}