diff --git a/src/views/emis/emisElectronicPagApply/applyForm.vue b/src/views/emis/emisElectronicPagApply/applyForm.vue index fff9d0be..e2aa7012 100644 --- a/src/views/emis/emisElectronicPagApply/applyForm.vue +++ b/src/views/emis/emisElectronicPagApply/applyForm.vue @@ -13,8 +13,8 @@ --> - - + + import { listEmisElectronicPagApply, getEmisElectronicPagApply, delEmisElectronicPagApply, addEmisElectronicPagApply, updateEmisElectronicPagApply } from "@/api/emis/emisElectronicPagApply"; import { parseTime,genJsSeqNo } from "@/utils/custom"; - export default { - name: "emisElectronicPagApplyForm", + name: "ApplyForm", props:{ id:undefined }, @@ -96,7 +95,7 @@ export default { // 表单校验 rules: { materialCode: [ - { required: true, message: "申购类型不能为空", trigger: ["blur",'change'] } + { required: true, message: "物料品名不能为空", trigger: ["blur",'change'] } ], applyCount: [ { required: true, message: "申请数量不能为空", trigger: "blur" } @@ -128,9 +127,18 @@ export default { this.form.applySiteName=this.$store.getters.ownerSiteName; this.form.applySeq=genJsSeqNo(); }, + handleMaterialCodeChange(){ + if(this.form.materialCode=='1001'){ + this.form.unitMoney="1"; + }else{ + this.form.unitMoney="0"; + } + }, handleApplyCountInput(value, item, type){ - value = value.replace(/[^\d]/g, '') - this.form.sumMoney=parseFloat(this.form.applyCount)*1.0; + // console.log(this.form.applyCount); + // value = value.replace(/[^\d]/g, '') + + this.form.sumMoney=parseFloat(this.form.applyCount)*parseFloat(this.form.unitMoney); }, // 取消按钮 cancel() { diff --git a/src/views/emis/emisElectronicPagApply/emisElectronicPagApplyView.vue b/src/views/emis/emisElectronicPagApply/emisElectronicPagApplyView.vue deleted file mode 100644 index a5513b0a..00000000 --- a/src/views/emis/emisElectronicPagApply/emisElectronicPagApplyView.vue +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - diff --git a/src/views/emis/emisElectronicPagApply/manualSendForm.vue b/src/views/emis/emisElectronicPagApply/manualSendForm.vue index 759cac60..7f29a413 100644 --- a/src/views/emis/emisElectronicPagApply/manualSendForm.vue +++ b/src/views/emis/emisElectronicPagApply/manualSendForm.vue @@ -8,8 +8,8 @@ - - + + - + - + - + @@ -36,6 +36,17 @@ + + + + + + + + + + + @@ -74,11 +85,15 @@ export default { // 表单校验 rules: { materialCode: [ - { required: true, message: "申购类型不能为空", trigger: ["blur",'change'] } + { required: true, message: "物料品名不能为空", trigger: ["blur",'change'] } ], applyCount: [ - { required: true, message: "申请数量不能为空", trigger: "blur" } + { required: true, message: "下发数量不能为空", trigger: "blur" } ], + applySiteCode: [ + { required: true, message: "下发站点不能为空", trigger: ["blur",'change'] } + ], + } }; }, @@ -106,9 +121,19 @@ export default { // this.form.applySiteName=this.$store.getters.ownerSiteName; this.form.applySeq=genJsSeqNo(); }, + handleMaterialCodeChange(){ + if(this.form.materialCode=='1001'){ + this.form.unitMoney="1"; + }else{ + this.form.unitMoney="0"; + } + }, + handleApplyCountInput(value, item, type){ value = value.replace(/[^\d]/g, '') - this.form.sumMoney=parseFloat(this.form.applyCount)*1.0; + // this.form.sumMoney=parseFloat(this.form.applyCount)*1.0; + this.form.sumMoney=parseFloat(this.form.applyCount)*parseFloat(this.form.unitMoney); + }, // 取消按钮 cancel() { diff --git a/src/views/emis/emisElectronicPagApply/sendList.vue b/src/views/emis/emisElectronicPagApply/sendList.vue index 5a535a90..eb86112b 100644 --- a/src/views/emis/emisElectronicPagApply/sendList.vue +++ b/src/views/emis/emisElectronicPagApply/sendList.vue @@ -69,7 +69,6 @@ type="primary" plain size="mini" - :disabled="single" @click="handleSend" v-hasPermi="['emis:emisElectronicPagApply:send']" >发放 @@ -80,7 +79,6 @@ plain size="mini" @click="handleCancel" - :disabled="single" v-hasPermi="['emis:emisElectronicPagApply:cancel']" >取消 @@ -356,29 +354,32 @@ export default { }, handleSend(){ - const id =this.ids[0]; - if (id != null) { + if (this.ids && this.ids.length>0) { this.$confirm("确认发放?", "提示", { cancelButtonText: "返回", confirmButtonText: "确认发放", type: "warning", distinguishCancelAndClose: true, closeOnClickModal: false - }).then(() => { + }).then(async () => { + + for(let i=0;i { - this.$modal.msgSuccess("发放成功"); - this.getList(); - }); + let res=await sendByApply(postData) + } + + this.$modal.msgSuccess("发放成功"); + this.getList(); }); } }, - - handleCancel(){ - const id =this.ids[0]; - if (id != null) { + handleCancel(){ + // const id =this.ids[0]; + if (this.ids && this.ids.length>0) { this.$confirm("确认取消?", "提示", { cancelButtonText: "返回", @@ -386,59 +387,24 @@ export default { type: "warning", distinguishCancelAndClose: true, closeOnClickModal: false - }).then(() => { - let postData={id:id}; - cancelApply(postData).then(response => { - this.$modal.msgSuccess("取消成功"); - this.open = false; - this.getList(); - }); + }).then(async () => { + + for(let i=0;i { - this.form = response.data; - this.open = true; - this.title = "修改"; - }); - // 子组件打开模式 - // this.currentId= row.id || this.ids; - // this.openEmisElectronicPagApply = true; - // this.titleEmisElectronicPagApply = "修改"; - }, - handleView(row) { - this.id=row.id; - this.titleView="查看"; - this.openView=true; - // this.router.push({ path: '/emis/emisElectronicPagApply/viewDetail', query: { id: row.id }}) - }, - /** 提交按钮 */ - submitForm() { - this.$refs["form"].validate(valid => { - if (valid) { - if (this.form.id != null) { - updateEmisElectronicPagApply(this.form).then(response => { - this.$modal.msgSuccess("修改成功"); - this.open = false; - this.getList(); - }); - } else { - addEmisElectronicPagApply(this.form).then(response => { - this.$modal.msgSuccess("新增成功"); - this.open = false; - this.getList(); - }); - } - } - }); - }, handleFormChanged(){ this.openForm = false; this.getList();