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