Sfoglia il codice sorgente

Merge branch 'purchaseDev' of http://172.16.100.139/new-business/drp-web into purchaseDev

002201 2 anni fa
parent
commit
f9fe7be12f

+ 1 - 1
package.json

@@ -43,7 +43,7 @@
     "@riophae/vue-treeselect": "0.4.0",
     "axios": "0.24.0",
     "clipboard": "2.0.8",
-    "core-js": "3.25.3",
+    "core-js": "^3.25.3",
     "echarts": "^5.4.0",
     "element-ui": "2.15.12",
     "file-saver": "2.0.5",

+ 16 - 0
src/api/purchase/deliveryAddress.js

@@ -37,4 +37,20 @@ export function delAddress(ids) {
     url: `/pu/delivery/address/delete/${ids}`,
     method: 'DELETE',
   })
+}
+// 收货地址档案同步NC
+export function toNc(data) {
+  return request({
+    url: `/pu/delivery/address/toNc`,
+    method: 'post',
+    data: data
+  })
+}
+// 收货地址档案启用停用
+export function enable(data) {
+  return request({
+    url: `/pu/delivery/address/enable`,
+    method: 'post',
+    data: data
+  })
 }

+ 1 - 1
src/views/purchase/DemandSummary/index.vue

@@ -171,7 +171,7 @@
             <el-row :gutter="10">
               <el-col :span="1.5">
                 <el-form-item label="物料编码">
-                  <el-input clearable size="mini" v-model="queryParams.names" @focus="chooseMaterial" style="width: 200px">
+                  <el-input clearable size="mini" v-model="queryParams.names" @clear="queryParams.materialCode = ''" @focus="chooseMaterial" style="width: 200px">
                     <el-button size="mini" slot="append" icon="el-icon-more" @click="chooseMaterial"></el-button>
                   </el-input>
                   <el-input v-show="false" v-model="queryParams.materialCode"></el-input>

+ 25 - 5
src/views/purchase/MaterialClassDivision/index.vue

@@ -184,7 +184,7 @@
         <div class="btn_grooup">
           <el-button type="primary" size="mini" @click="addDivision">新增</el-button>
 
-          <el-dropdown size="mini" @command="handleCommand">
+          <!-- <el-dropdown size="mini" @command="handleCommand">
             <el-button size="mini" type="primary" style="margin-left: 10px;">
               导入<i class="el-icon-arrow-down el-icon--right"></i>
             </el-button>
@@ -202,9 +202,9 @@
               <el-dropdown-item command="Excel导出">Excel导出</el-dropdown-item>
               <el-dropdown-item command="导出明细">导出明细</el-dropdown-item>
             </el-dropdown-menu>
-          </el-dropdown>
+          </el-dropdown> -->
 
-          <el-button type="primary" size="mini">删除</el-button>
+          <el-button type="primary" size="mini" @click="deletes">删除</el-button>
         </div>
         <el-table 
           :data="tableList" 
@@ -335,7 +335,8 @@ export default {
       tableList: [],
       total: 0,
       rowDetail: {},
-      disable: false
+      disable: false,
+      allSelection: []
     }
   },
   created() {
@@ -374,7 +375,26 @@ export default {
       }
       this.getList(this.queryParams)
     },
-    handleSelectionChange() {},
+    deletes() {
+      if (this.allSelection.length == 0) {
+        this.$modal.msgWarning("请至少选择一条数据!");
+      } else {
+        let param = this.allSelection.map(item => item.id)
+        let rows = param.join()
+        this.$modal.confirm('确认删除选择数据?').then(() => {
+          delDivision(rows).then(res => {
+            if (res.code === 200) {
+              this.$modal.msgSuccess("删除成功");
+              this.getList(this.queryParams)
+            }
+          })
+        }).catch(() => { })
+      }
+    },
+    handleSelectionChange(selection) {
+      console.log('选中', selection)
+      this.allSelection = selection
+    },
     handleCommand(command) {
       alert(command)
     },

+ 2 - 0
src/views/purchase/PurchaseDemandList/add.vue

@@ -815,8 +815,10 @@ export default {
       }
     },
     submit() {
+      this.$modal.loading("提交中...");
       submitDemand(this.basicForm).then(res => {
         if (res.code === 200) {
+          this.$modal.closeLoading();
           this.$modal.msgSuccess("提交成功");
           this.back()
         }

+ 71 - 10
src/views/purchase/deliveryAddress/index.vue

@@ -142,7 +142,7 @@
         <div class="btn_grooup">
           <el-button type="primary" size="mini" @click="addAddress">新增</el-button>
 
-          <el-dropdown size="mini" @command="handleCommand">
+          <!-- <el-dropdown size="mini" @command="handleCommand">
             <el-button size="mini" type="primary" style="margin-left: 10px;">
               导入<i class="el-icon-arrow-down el-icon--right"></i>
             </el-button>
@@ -160,12 +160,12 @@
               <el-dropdown-item command="Excel导出">Excel导出</el-dropdown-item>
               <el-dropdown-item command="导出明细">导出明细</el-dropdown-item>
             </el-dropdown-menu>
-          </el-dropdown>
+          </el-dropdown> -->
 
-          <el-button type="primary" size="mini">启用</el-button>
-          <el-button type="primary" size="mini">停用</el-button>
-          <el-button type="primary" size="mini">同步NC</el-button>
-          <el-button type="primary" size="mini">删除</el-button>
+          <el-button type="primary" size="mini" @click="startUse">启用</el-button>
+          <el-button type="primary" size="mini" @click="stopUse">停用</el-button>
+          <el-button type="primary" size="mini" @click="toNC">同步NC</el-button>
+          <el-button type="primary" size="mini" @click="deletes">删除</el-button>
         </div>
         <el-table 
           :data="tableList" 
@@ -236,7 +236,7 @@
 <script>
 import Add from './add.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
-import {getAddressList, delAddress} from '@/api/purchase/deliveryAddress.js'
+import {getAddressList, delAddress, toNc, enable } from '@/api/purchase/deliveryAddress.js'
 import Refers from '@/components/Refers/refers.vue'
 import TreeRefers from '@/components/Refers/treeRefer.vue'
 export default {
@@ -296,7 +296,8 @@ export default {
       tableList: [],
       total: 0,
       rowDetail: {},
-      disable: false
+      disable: false,
+      allSelection:[]
     }
   },
   created() {
@@ -336,7 +337,67 @@ export default {
       }
       this.getList(this.queryParams)
     },
-    handleSelectionChange() {},
+    toNC() {
+      if (this.allSelection.length == 0 || this.allSelection.length > 1) {
+        this.$modal.msgWarning("同步NC只能进行单条操作!");
+      } else {
+        console.log('参数', this.allSelection)
+        toNc(this.allSelection[0]).then(res => {
+          if (res.code === 200) {
+            this.$modal.msgSuccess("操作成功!");
+            this.getList(this.queryParams)
+          }
+        })
+      }
+    },
+    startUse() {
+      if (this.allSelection.length == 0 || this.allSelection.length > 1) {
+        this.$modal.msgWarning("启用停用只能进行单条操作!");
+      } else {
+        console.log('参数', this.allSelection)
+        let param = {id: this.allSelection[0].id, status: 'Y' }
+        enable(param).then(res => {
+          if (res.code === 200) {
+            this.$modal.msgSuccess("操作成功!");
+            this.getList(this.queryParams)
+          }
+        })
+      }
+    },
+    stopUse() {
+      if (this.allSelection.length == 0 || this.allSelection.length > 1) {
+        this.$modal.msgWarning("启用停用只能进行单条操作!");
+      } else {
+        console.log('参数', this.allSelection)
+        let param = { id: this.allSelection[0].id, status: 'N' }
+        enable(param).then(res => {
+          if (res.code === 200) {
+            this.$modal.msgSuccess("操作成功!");
+            this.getList(this.queryParams)
+          }
+        })
+      }
+    },
+    deletes() {
+      if (this.allSelection.length == 0) {
+        this.$modal.msgWarning("请至少选择一条数据!");
+      } else {
+        let param = this.allSelection.map(item => item.id)
+        let rows = param.join()
+        this.$modal.confirm('确认删除选择数据?').then(() => {
+          delAddress(rows).then(res => {
+            if (res.code === 200) {
+              this.$modal.msgSuccess("删除成功");
+              this.getList(this.queryParams)
+            }
+          })
+        }).catch(() => { })
+      }
+    },
+    handleSelectionChange(selection) {
+      console.log('选中', selection)
+      this.allSelection = selection
+    },
     handleCommand(command) {
       alert(command)
     },
@@ -359,7 +420,7 @@ export default {
     },
     deleteids(row) {
       console.log('row', row)
-      this.$modal.confirm('确认信息').then(() => {
+      this.$modal.confirm('确认删除选择数据').then(() => {
         delAddress(row.id).then(res => {
           if (res.code === 200) {
             this.$modal.msgSuccess("删除成功");

+ 1 - 53
src/views/purchase/purchase-order/add/index.vue

@@ -1,7 +1,6 @@
 <script>
 import orderApi from "@/api/business/purchase/purchase-order";
 import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
-import { async } from "q";
 import { Columns, TabColumns } from "./column";
 
 const NewColumns = initColumns(Columns);
@@ -65,33 +64,6 @@ export default {
       },
       deep: true,
     },
-    // "params.puOrg": {
-    //   handler(nVal, oVal) {
-    //     console.log('nVal', nVal, 'oVal',oVal);
-    //     console.log(this.isCopy, 'this.isCopy');
-    //     // 组织变化
-    //     // if (this.visible && nVal.puOrg != oVal.puOrg) {
-    //     if (this.visible && oVal && nVal != oVal) {
-    //       for (const key in this.params) {
-    //         if (Array.isArray(this.params[key])) {
-    //           this.params[key] = [];
-    //         } else if (
-    //           key != "puOrg" &&
-    //           key != "puOrgName" &&
-    //           key != "buyer" &&
-    //           key != "buyerName" &&
-    //           key != "puDept" &&
-    //           key != "puDeptName" &&
-    //           key != "status"
-    //         ) {
-    //           this.params[key] = "";
-    //         } else {
-    //         }
-    //       }
-    //     }
-    //   },
-    //   deep: true,
-    // },
   },
   methods: {
     beforeOpen() {
@@ -307,31 +279,7 @@ export default {
           }
       })
     },
-    // 保存并新增
-    async handleSubmit() {
-      this.judgeSaveCondition(async()=>{
-        try {
-          const createById = this.params.buyer;
-          const createByName = this.params.buyerName;
-          const updateById = this.$store.state.user.id;
-          const updateByName = this.$store.state.user.name;
-          const { code, msg } = await orderApi.create({
-            createById,
-            createByName,
-            updateById,
-            updateByName,
-            ...this.params,
-          });
-          if (code === 200) {
-            this.setVisible(false);
-          }
-        } catch (err) {
-          this.$notify.error({ title: "error", message: err });
-        } finally {
-          // this.setVisible(false);
-        }
-      })
-    },
+   
     // 主表参照改变之后
    async handleReferChange(val, type, source){
       // 供应商选择  

+ 51 - 67
src/views/purchase/purchase-order/column.js

@@ -1,12 +1,9 @@
 import {
-  initPage,
-  initParams,
   initColumns,
   initDicts,
 } from "@/utils/init";
 
 export const TableColumns = [
-  // { key: "id", title: "主键" },
   // { key: "puOrg", title: "采购组织" },
   { key: "puOrgName", title: "采购组织", inputType: "Input" },
   {
@@ -24,7 +21,6 @@ export const TableColumns = [
     referName: "documents_status", // 字典名
   },
   { key: "billDate", title: "订单日期",width:100,},
-  // { key: "supplier", title: "供应商" },
   { key: "supplierName", title: "供应商", inputType: "Input" },
   { key: "paymentAgreementName", title: "付款协议" },
   {
@@ -36,11 +32,8 @@ export const TableColumns = [
   },
   // { key: "paymentAgreement", title: "付款协议" },
   
-  // { key: "buyer", title: "采购员" },ut
   { key: "buyerName", title: "采购员" ,width:100,},
-  // { key: "puDept", title: "采购部门" },
   { key: "puDeptName", title: "采购部门" },
-  // { key: "customer", title: "收货客户" },
   { key: "customerName", title: "收货客户" },
   // { 
   //   key: "isDeliver", 
@@ -73,7 +66,6 @@ export const TableColumns = [
   //   title: "由销售订单协同生成",
   //   inputType: 'Checkbox',
   // },
-  // { key: "personal", title: "人员" },
   { key: "personalName", title: "人员" ,width:120,},
   // { key: "isSendSrm", title: "是否同步SRM" },
   {
@@ -86,11 +78,8 @@ export const TableColumns = [
   { key: "deductionMoney", title: "订单抵扣余款金额" ,},
   // { key: "warehouse", title: "WMS入库仓库" },
   { key: "warehouseName", title: "收货仓库" }, //WMS入库仓库名称
-  // { key: "goodsAllocation", title: "货位" },
   { key: "goodsAllocationName", title: "货位" },
-  // { key: "customerDept", title: "客户部门" },
   { key: "customerDeptName", title: "客户部门" },
-  // { key: "supplierContacts", title: "供应商业务联系人" },
   { key: "supplierContactsName", title: "供应商业务联系人" },
   {
     key: "isUrgency",
@@ -98,7 +87,6 @@ export const TableColumns = [
     inputType: 'Checkbox',
     width:80,
   },
-  // { key: "agent", title: "代理人" }, // 建议删除
   { key: "agentName", title: "代理人" },
   {
     key: "isClose",
@@ -148,37 +136,37 @@ export const TabColumns = [
       { key: "rowNo", title: "行号",width:80, },
       // { key: "orderId", title: "采购订单ID" },
       { key: "material", title: "物料ID" },
-      { key: "materialName", title: "物料名称", width: 180 },
-      { key: "materialCode", title: "物料编码", width: 180 },
-      // { key: "materialClassify", title: "物料分类", width: 180 },
-      { key: "materialManufacturersCode", title: "厂家物料编码", width: 180 },
-      { key: "specification", title: "规格", width: 180 },
-      { key: "model", title: "型号", width: 180 },
+      { key: "materialName", title: "物料名称",  },
+      { key: "materialCode", title: "物料编码",  },
+      // { key: "materialClassify", title: "物料分类",  },
+      { key: "materialManufacturersCode", title: "厂家物料编码",  },
+      { key: "specification", title: "规格",  },
+      { key: "model", title: "型号",  },
       {
         key: "isMedcine",
         title: "医药物料",
         inputType: 'Checkbox',
         width:80,
       },
-      { key: "manufacturerName", title: "生产厂家代理人", width: 180 },
+      { key: "manufacturerName", title: "生产厂家代理人",  },
       { 
         key: "isDrug", 
         title: "物料药品属性",
         inputType: 'Checkbox',
         width:80, 
       },
-      { key: "unitName", title: "单位", width: 180 },
-      { key: "qty", title: "数量" },
+      { key: "unitName", title: "单位", width: 120 },
+      { key: "qty", title: "数量",width:120, },
       // { key: "currency", title: "币种" },
       { key: "currencyName", title: "币种" },
-      { key: "taxPrice", title: "含税单价" },
-      { key: "money", title: "价税合计" },
-      { key: "tax", title: "税率" },
-      { key: "taxDeductMoneya", title: "折扣金额" },
-      { key: "arrivalQty", title: "已到货数量" },
-      { key: "unarrivedQty", title: "未到货数量" },
-      { key: "price", title: "无税单价" },
-      { key: "notaxMoney", title: "无税金额" },
+      { key: "taxPrice", title: "含税单价" ,width:120,},
+      { key: "money", title: "价税合计" ,width:120,},
+      { key: "tax", title: "税率" ,width:120,},
+      { key: "taxDeductMoneya", title: "折扣金额",width:120, },
+      { key: "arrivalQty", title: "已到货数量" ,width:120,},
+      { key: "unarrivedQty", title: "未到货数量" ,width:120,},
+      { key: "price", title: "无税单价" ,width:120,},
+      { key: "notaxMoney", title: "无税金额" ,width:120,},
       { key: "priceSource", title: "价格目录ID" },
       {
         key: "isStorage",
@@ -210,14 +198,14 @@ export const TabColumns = [
         inputType: 'Checkbox',
         width:80,
       },
-      { key: "warehouse", title: "收货仓库", width: 180 },
-      { key: "place", title: "收货地点", width: 180 },
-      { key: "address", title: "收货地址", width: 180 },
-      { key: "productBatch", title: "产品批号", width: 180 },
-      { key: "manufactureDate", title: "生产日期", width: 180 },
-      { key: "efficacyLoseDate", title: "有效期至/失效日期", width: 180 },
-      { key: "approvalNumber", title: "批准文号", width: 180 },
-      { key: "registration", title: "注册证号", width: 180 },
+      { key: "warehouse", title: "收货仓库",  },
+      { key: "place", title: "收货地点",  },
+      { key: "address", title: "收货地址",  },
+      { key: "productBatch", title: "产品批号",  },
+      { key: "manufactureDate", title: "生产日期",  },
+      { key: "efficacyLoseDate", title: "有效期至/失效日期",  },
+      { key: "approvalNumber", title: "批准文号",  },
+      { key: "registration", title: "注册证号",  },
       {
         key: "storageCondition",
         title: "存储条件",
@@ -248,18 +236,18 @@ export const TabColumns = [
         inputType: 'Checkbox',
         width:80,
       },
-      { key: "originalQty", title: "原始数量" },
-      { key: "originalMoney", title: "原始金额" },
-      { key: "directProductBatch", title: "直运产品批号", width: 180 },
-      { key: "discountRule", title: "折扣规则编码", width: 180 },
-      { key: "reservedQty", title: "预留数量" },
-      { key: "reservedPeriod", title: "预留周期", width: 180 },
+      { key: "originalQty", title: "原始数量" ,width:120,},
+      { key: "originalMoney", title: "原始金额" ,width:120,},
+      { key: "reservedQty", title: "预留数量",width:120, },
+      { key: "reservedPeriod", title: "预留周期",  },
       { key: "taxDeductClassify", title: "扣税类别" },
-      { key: "exchangeRate", title: "折本汇率" },
-      { key: "source", title: "上游单据号", width: 180 },
-      { key: "sourceId", title: "上游单据ID", width: 180 },
-      { key: "demandCode", title: "采购需求单号", width: 180 },
-      { key: "arrivalDatePlan", title: "计划到货日期", width: 180 },
+      { key: "exchangeRate", title: "折本汇率" ,width:100,},
+      { key: "directProductBatch", title: "直运产品批号",  },
+      { key: "discountRule", title: "折扣规则编码",  },
+      { key: "source", title: "上游单据号",  },
+      { key: "sourceId", title: "上游单据ID",  },
+      { key: "demandCode", title: "采购需求单号",  },
+      { key: "arrivalDatePlan", title: "计划到货日期",  },
       {
         key: "priceType",
         title: "价格类型",
@@ -272,10 +260,10 @@ export const TabColumns = [
         inputType: 'Checkbox',
         width:80,
        },
-      { key: "materialClassifyOneName", title: "物料一级分类", width: 180 },
-      { key: "materialClassifyTwoName", title: "物料二级分类", width: 180 },
-      { key: "materialClassifyThreeName", title: "物料三级分类", width: 180 },
-      { key: "materialClassifyFourName", title: "物料四级分类", width: 180 },
+      { key: "materialClassifyOneName", title: "物料一级分类",  },
+      { key: "materialClassifyTwoName", title: "物料二级分类",  },
+      { key: "materialClassifyThreeName", title: "物料三级分类",  },
+      { key: "materialClassifyFourName", title: "物料四级分类",  },
       { key: "createByName", title: "创建人",width:100, },
       { key: "updateByName", title: "更新人" ,width:100,},
       
@@ -285,24 +273,20 @@ export const TabColumns = [
     title: '执行结果',
     key: 'puOrderExecuteList',
     tableColumns: [
-      // { key: "id", title: "主键" },
-      // { key: "orderId", title: "采购订单ID", width: 180 },
+      // { key: "orderId", title: "采购订单ID",  },
       { key: "rowno", title: "行号",width:80, },
-      { key: "material", title: "物料ID", width: 180 },
-      { key: "materialName", title: "物料名称", width: 180 },
+      { key: "material", title: "物料ID", },
+      { key: "materialName", title: "物料名称", },
       { key: "specification", title: "规格" },
-      { key: "qty", title: "数量" },
-      { key: "stroageQty", title: "累计到货主数量" },
-      { key: "stockQty", title: "累计入库主数量" },
-      { key: "invoiceQty", title: "累计开票主数量" },
-      { key: "rollbackQty", title: "累计退货主数量" },
-      { key: "backStockQty", title: "累计退库主数量" },
+      { key: "qty", title: "数量",width:120, },
+      { key: "stroageQty", title: "累计到货主数量",width:120,  },
+      { key: "stockQty", title: "累计入库主数量",width:120,  },
+      { key: "invoiceQty", title: "累计开票主数量",width:120,  },
+      { key: "rollbackQty", title: "累计退货主数量",width:120,  },
+      { key: "backStockQty", title: "累计退库主数量",width:120,  },
       { key: "floatQty", title: "未到货数量" },
-      // { key: "tenantId", title: "租户号" },
-      // { key: "revision", title: "乐观锁" },
-      { key: "createByName", title: "创建人名称", width: 180 },
-      { key: "updateByName", title: "更新人名称", width: 180 },
-      // { key: "delFlag", title: "删除标记" }
+      { key: "createByName", title: "创建人名称", },
+      { key: "updateByName", title: "更新人名称", },
     ]
   },
 ];

+ 1 - 2
src/views/purchase/purchase-order/edit/index.vue

@@ -1,8 +1,7 @@
 <script>
-// import { Columns, TabColumns } from "../add/column";
 import { editColumns, editTabColumns, forbidden, SelectColumns } from "./initColumn";
 import orderApi from "@/api/business/purchase/purchase-order";
-import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
+import {  initDicts, initRules, initParams } from "@/utils/init";
 
 export default {
   name: "EditPurchaseOrderDrawer",

+ 12 - 12
src/views/purchase/purchase-order/index.vue

@@ -5,10 +5,8 @@ import orderApi from "@/api/business/purchase/purchase-order";
 import {
   initPage,
   initParams,
-  initColumns,
   initDicts,
 } from "@/utils/init";
-import { clearTimeout } from "timers";
 
 
 export default {
@@ -23,6 +21,7 @@ export default {
     const initTabColumns = () => TabColumns;
     return {
       loading: false,
+      tabLoading:false,
       isSimpleSearch: true,
       pageSizes: [10, 20, 50, 100],
       page: initPage(),
@@ -154,6 +153,7 @@ export default {
       this.timeOut = setTimeout(async () =>{
 
         try {
+          this.tabLoading = true;
           this.primaryResource = row;
           this.checkedTabList = [];
           const { code, msg, data } = await orderApi.details(row.id);
@@ -164,6 +164,9 @@ export default {
             }
           }
         } catch (err) {}
+        finally{
+          this.tabLoading = false;
+        }
       },this.timer)
       
     },
@@ -273,6 +276,7 @@ export default {
     },
     // 退回接口
     handleReturn(id,documentIds){
+
       this.$prompt('请输入退回原因', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
@@ -281,8 +285,8 @@ export default {
         }).then(async ({ value }) => {
 
           let data = {
-            id,
-            documentIds,
+            id:Number(id),
+            documentIds:documentIds.map(ids =>Number(ids)),
             baskCause: value,
           };
 
@@ -309,7 +313,6 @@ export default {
 
         if (this.checkedList[0].status == 0) {
           // 未审批状态下整单关闭
-
           return false
         }
       }
@@ -321,14 +324,11 @@ export default {
       // 未审批状态下整单关闭
       try {
 
-        this.handleDeleteList(async() =>{
-
-          let puOrderIds = this.checkedList.map(order => {
-
-            return order.id;
+        this.handleConfirmTips(async() =>{
 
-          })
+          let puOrderIds = this.checkedList.map(order => Number(order.id));
 
+          // console.log(puOrderIds,'puOrderIds');
           let { code } = await orderApi.close({ puOrderIds });
 
           if (code === 200) {
@@ -602,7 +602,7 @@ export default {
       @pagination="fetchList(params, page)"
     />
    
-    <div style="position: relative; padding-top: 10px;">
+    <div style="position: relative; padding-top: 10px;" v-loading="tabLoading">
       <el-row style="position: absolute; top: 30px; right: 20px;z-index: 10;">
         <el-button 
           size="mini" 

+ 37 - 27
src/views/purchase/transferOrder/add.vue

@@ -796,48 +796,58 @@ export default {
 
     },
     toNC() {
-      againToNC(this.row).then(res => {})
+      againToNC(this.row).then(res => {
+        this.getDetails(this.row)
+      }).catch(err => {
+        this.getDetails(this.row)
+      })
     },
     submit() {
+      this.$modal.loading("提交中...");
       this.basicForm.stAllotMaterialList = this.materialInfo
       this.basicForm.stAllotReceiveDeliverList = this.receiveInfo
       this.basicForm.stAllotReceiveExecuteList = this.priceList
       this.basicForm.stAllotReceiveExpenseList = this.resultList
       submitOrder(this.basicForm).then(res => {
         if (res.code === 200) {
+          this.$modal.closeLoading();
           this.$modal.msgSuccess("提交成功");
           this.back()
         }
       })
     },
     save() {
-      if(this.pageStu == 'add') {
-        this.basicForm.stAllotMaterialList = this.materialInfo
-        this.basicForm.stAllotReceiveDeliverList = this.receiveInfo
-        this.basicForm.stAllotReceiveExecuteList = this.priceList
-        this.basicForm.stAllotReceiveExpenseList = this.resultList
-        addOrder(this.basicForm).then(res => {
-          if (res.code === 200) {
-            this.$modal.msgSuccess("保存成功");
-            this.$emit('jugislist', true)
-            let queryParams = {
-              pageNum: 1,
-              pageSize: 5
+      if(this.materialInfo.length !== 0) {
+        if(this.pageStu == 'add') {
+          this.basicForm.stAllotMaterialList = this.materialInfo
+          this.basicForm.stAllotReceiveDeliverList = this.receiveInfo
+          this.basicForm.stAllotReceiveExecuteList = this.priceList
+          this.basicForm.stAllotReceiveExpenseList = this.resultList
+          addOrder(this.basicForm).then(res => {
+            if (res.code === 200) {
+              this.$modal.msgSuccess("保存成功");
+              this.$emit('jugislist', true)
+              let queryParams = {
+                pageNum: 1,
+                pageSize: 5
+              }
+              this.$emit('refresh', queryParams)
             }
-            this.$emit('refresh', queryParams)
-          }
-        })
-      } else if (this.pageStu == 'edit') {
-        this.basicForm.stAllotMaterialList = this.materialInfo
-        this.basicForm.stAllotReceiveDeliverList = this.receiveInfo
-        this.basicForm.stAllotReceiveExecuteList = this.priceList
-        this.basicForm.stAllotReceiveExpenseList = this.resultList
-        editOrder(this.basicForm).then(res => {
-          if (res.code === 200) {
-            this.$modal.msgSuccess("编辑成功");
-            this.back()
-          }
-        })
+          })
+        } else if (this.pageStu == 'edit') {
+          this.basicForm.stAllotMaterialList = this.materialInfo
+          this.basicForm.stAllotReceiveDeliverList = this.receiveInfo
+          this.basicForm.stAllotReceiveExecuteList = this.priceList
+          this.basicForm.stAllotReceiveExpenseList = this.resultList
+          editOrder(this.basicForm).then(res => {
+            if (res.code === 200) {
+              this.$modal.msgSuccess("编辑成功");
+              this.back()
+            }
+          })
+        }
+      } else {
+        this.$modal.msgWarning("明细行不能为空");
       }
     },
     back() {