jingbb 1 éve
szülő
commit
d00db7da4d

+ 10 - 1
src/views/production/materialprocurement/materialProcurementList.vue

@@ -99,7 +99,9 @@
       <div class="table-operator">
         <a-button type="danger" size="small" @click='addList'>新增</a-button>
         <a-button  size="small" @click='addEdit'>修改</a-button>
-        <a-button size="small" @click="delecteList">删除</a-button>
+        <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="delecteList()">
+            <a-button size="small" >删除</a-button>
+        </a-popconfirm>
         <a-button size="small">提交</a-button>
         <a-button  size="small">审核</a-button>
         <a-button  size="small">弃审</a-button>
@@ -139,6 +141,7 @@
     import { httpAction ,getAction,postAction,putAction,deleteAction,downFile} from '@/api/manage'
     import {queryDepartTreeList} from '@/api/api'
     import materialProcurementAdd from './modules/materialProcurementAdd'
+    import alertModal from '../../../plugins/modal'
     //---------workflow  by fhf end -------------
     export default {
       name: "AssetAllocationList",
@@ -290,7 +293,9 @@
        },
       methods: {
         getTableList(){
+          alertModal.loading("执行中,请稍后!")
           getAction('/materialRequisition/madeMaterialRequisition/list',this.queryParam).then(res=>{
+                    alertModal.closeLoading();
                     if(res.success){
                        this.dataSource =res.result.records
                        this.ipagination = {
@@ -341,7 +346,9 @@
           if(this.selectedRowKeys.length==0){
             this.$manage.warning('请选择数据')
           }else if(this.selectedRowKeys.length==1){
+            alertModal.loading("执行中,请稍后!")
             deleteAction('/materialRequisition/madeMaterialRequisition/delete', {id: this.selectedRowKeys[0]}).then((res) => {
+                  alertModal.closeLoading();
                   if (res.success) {
                     this.$message.success('删除成功!');
                     this.getTableList()
@@ -351,7 +358,9 @@
                 });
           }else{
             var ids =  this.selectedRowKeys.toString()
+            alertModal.loading("执行中,请稍后!")
             deleteAction('/materialRequisition/madeMaterialRequisition/deleteBatch', {ids: ids}).then((res) => {
+                  alertModal.closeLoading();
                   if (res.success) {
                     this.$message.success('删除成功!');
                     this.getTableList()

+ 28 - 24
src/views/production/materialprocurement/modules/materialProcurementAdd.vue

@@ -623,33 +623,37 @@
             handleOk(){
                 var mergedObj = this.form
                 mergedObj.madeMaterialRequisitionDetailList = this.dataSource
-                debugger
-                this.loading = true
-                if(this.defaultMethod=='add'){
-                    postAction('/materialRequisition/madeMaterialRequisition/add', mergedObj).then((res) => {
-                        if (res.success) {
-                            this.$message.success('添加成功!');
-                            this.handleCancel()
-                            this.$emit('ok')
-                        } else {
-                            this.$message.error(res.message);
-                        }
-                    }).finally(() => {
-                            this.loading = false
-                    })
+                if(this.dataSource.length==0){
+                    this.$message.warning('请添加子表数据!')
                 }else{
-                    postAction('/materialRequisition/madeMaterialRequisition/edit', mergedObj).then((res) => {
-                        if (res.success) {
-                            this.$message.success('编辑成功!');
-                            this.handleCancel()
-                            this.$emit('ok')
-                        } else {
-                            this.$message.error(res.message);
-                        }
-                    }).finally(() => {
+                    this.loading = true
+                    if(this.defaultMethod=='add'){
+                        postAction('/materialRequisition/madeMaterialRequisition/add', mergedObj).then((res) => {
+                            if (res.success) {
+                                this.$message.success('添加成功!');
+                                this.handleCancel()
+                                this.$emit('ok')
+                            } else {
+                                this.$message.error(res.message);
+                            }
+                        }).finally(() => {
                             this.loading = false
-                    })
+                        })
+                    }else{
+                        postAction('/materialRequisition/madeMaterialRequisition/edit', mergedObj).then((res) => {
+                            if (res.success) {
+                                this.$message.success('编辑成功!');
+                                this.handleCancel()
+                                this.$emit('ok')
+                            } else {
+                                this.$message.error(res.message);
+                            }
+                        }).finally(() => {
+                            this.loading = false
+                        })
+                    }
                 }
+                
             },
             onSelectChange(selectedRowKeys, selectionRows) {
                 this.selectedRowKeys = selectedRowKeys;