瀏覽代碼

Merge branch 'feature/Feature-basic_data' of https://gogs.zfire.top/zfire-front/supply-front into feature/Feature-basic_data

chen 3 年之前
父節點
當前提交
7aa3c6f469

+ 18 - 0
src/api/supply/reserve.js

@@ -52,4 +52,22 @@ export function editData(params) {
     method: 'post',
     data: params
   })
+}
+
+// 查询经销商列表
+export function checkDealerList(params) {
+  return request({
+    url: '/reserve/detailCustomer',
+    method: 'get',
+    params
+  })
+}
+
+// 查询物料列表
+export function checkMaterialList(params) {
+  return request({
+    url: '/reserve/detailMaterialNumber',
+    method: 'get',
+    params
+  })
 }

+ 1 - 16
src/views/supply/apply/components/apply_detail.vue

@@ -84,12 +84,6 @@
       <el-table :data="detailData.orders" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
         <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
         <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="发货仓库" prop="stockIds" min-width="160" show-overflow-tooltip>
-          <template slot-scope="scope">
-            <el-tag size="mini" style="margin: 0 5px;" v-for="(item, index) in scope.row.stockIds" :key="index">{{item.name}}</el-tag>
-          </template>
-        </el-table-column>
-        <el-table-column align="center" label="库存数" prop="stockNumber" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="销售订单号" prop="orderId" min-width="180" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="产品编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
@@ -124,7 +118,7 @@
     </div>
     
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
           <el-button slot="reference">关 闭</el-button>
         </el-popconfirm>
@@ -163,15 +157,6 @@ export default {
   },
 
   computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
     isExamine() {
       return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === "FAIL"
     },

+ 2 - 64
src/views/supply/apply/components/apply_examine.vue

@@ -76,14 +76,6 @@
       <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
         <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
         <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="发货仓库" prop="stockIds" min-width="160" show-overflow-tooltip>
-          <template slot-scope="scope">
-            <el-select v-model="scope.row.stockIds" placeholder="请选择发货仓库" size="small" multiple filterable @change="changeWarehouse(scope.$index)">
-              <el-option :label="item.name" :value="item.id" v-for="(item, index) in positionList" :key="index"></el-option>
-            </el-select>
-          </template>
-        </el-table-column>
-        <el-table-column align="center" label="库存数" prop="stockNumber" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="销售订单号" prop="orderId" min-width="180" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="产品编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
@@ -129,7 +121,7 @@
     </div>
     
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <el-button type="primary" @click="clickSubmitForm" :loading="formLoading">{{ formLoading ? '提交中 ...' : '提 交' }}</el-button>
         <el-popconfirm
           title="确定关闭吗?"
@@ -145,7 +137,7 @@
 </template>
 
 <script>
-import { getApplyDetail, examineApply, getPositionList, checkStock } from "@/api/supply/apply";
+import { getApplyDetail, examineApply } from "@/api/supply/apply";
 
 export default {
   name: 'ApplyExamine',
@@ -176,22 +168,9 @@ export default {
         status: true,
         remark: '',
       },
-      positionList: [],
     }
   },
 
-  computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
-  },
-
   created() {
     this.getDetail();
   },
@@ -209,41 +188,12 @@ export default {
 
         res.data.orders.forEach((item, index) => {
           item.approvalNumber = item.invoiceNum;
-          if(item.stockIds && item.stockIds.length > 0) {
-            item.stockIds = item.stockIds.map((it, idx) => {
-              return it.id;
-            });
-          }
         });
 
         this.goodsList = res.data.orders;
-        this.getPositionList();
-      })
-    },
-
-    // 获取仓位列表
-    getPositionList() {
-      getPositionList({
-        correspondId: this.detailData.correspondId
-      }).then((res) => {
-        this.positionList = res.data;
       })
     },
 
-    // 修改仓位
-    changeWarehouse(index) {
-      if(this.goodsList[index].stockIds && this.goodsList[index].stockIds.length > 0) {
-        checkStock({
-          materialId: this.goodsList[index].materialId,
-          StockIds: this.goodsList[index].stockIds.join(',')
-        }).then(res => {
-          this.goodsList[index].stockNumber = res.data;
-        })
-      }else {
-        this.goodsList[index].stockNumber = 0;
-      }
-    },
-
     // 检查文件类型
     checkFileType(url) {
       if(!url) return '';
@@ -274,18 +224,6 @@ export default {
     // 提交审批
     clickSubmitForm() {
       for(let i=0; i<this.goodsList.length; i++) {
-        if(this.goodsList[i].stockIds && this.goodsList[i].stockIds.length < 1) {
-          this.$errorMsg('请选择发货仓库');
-          return;
-        }
-        if(this.goodsList[i].stockNumber < 1) {
-          this.$errorMsg('库存不足');
-          return;
-        }
-        if(this.goodsList[i].approvalNumber > this.goodsList[i].stockNumber) {
-          this.$errorMsg('审批数量不可大于库存数');
-          return;
-        }
         if(this.goodsList[i].approvalNumber > this.goodsList[i].invoiceNum) {
           this.$errorMsg('审批数量不可大于申请数量');
           return;

+ 2 - 59
src/views/supply/apply/components/engin_examine.vue

@@ -120,14 +120,6 @@
       <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
         <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
         <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="发货仓库" prop="stockIds" min-width="160" show-overflow-tooltip>
-          <template slot-scope="scope">
-            <el-select v-model="scope.row.stockIds" placeholder="请选择发货仓库" size="small" multiple filterable @change="changeWarehouse(scope.$index)">
-              <el-option :label="item.name" :value="item.id" v-for="(item, index) in positionList" :key="index"></el-option>
-            </el-select>
-          </template>
-        </el-table-column>
-        <el-table-column align="center" label="库存数" prop="stockNumber" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="订单日期" prop="theTime" min-width="160" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="销售订单号" prop="enginOrderNo" min-width="180" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
@@ -170,7 +162,7 @@
     </div>
     
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <el-button type="primary" @click="clickSubmitForm('OK')">审批通过</el-button>
         <el-button type="warning" @click="clickSubmitForm('FAIL')">审批驳回</el-button>
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
@@ -183,7 +175,7 @@
 </template>
 
 <script>
-import { getEnginDetail, examineEngin, getPositionList, checkStock } from "@/api/supply/apply";
+import { getEnginDetail, examineEngin } from "@/api/supply/apply";
 
 export default {
   name: 'EnginExamine',
@@ -218,22 +210,9 @@ export default {
       examineForm: {
         remark: '',
       },
-      positionList: [],
     }
   },
 
-  computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
-  },
-
   created() {
     this.getDetail();
   },
@@ -265,42 +244,10 @@ export default {
       getEnginDetail({id: this.listItem.id}).then(res => {
         this.detailData = res.data;
 
-        res.data.orders.forEach((item, index) => {
-          if(item.stockIds && item.stockIds.length > 0) {
-            item.stockIds = item.stockIds.map((it, idx) => {
-              return it.id;
-            });
-          }
-        });
-
         this.goodsList = res.data.orders;
-        this.getPositionList();
       })
     },
 
-    // 获取仓位列表
-    getPositionList() {
-      getPositionList({
-        correspondId: this.detailData.correspondId
-      }).then((res) => {
-        this.positionList = res.data;
-      })
-    },
-
-    // 修改仓位
-    changeWarehouse(index) {
-      if(this.goodsList[index].stockIds && this.goodsList[index].stockIds.length > 0) {
-        checkStock({
-          materialId: this.goodsList[index].materialId,
-          StockIds: this.goodsList[index].stockIds.join(',')
-        }).then(res => {
-          this.goodsList[index].stockNumber = res.data;
-        })
-      }else {
-        this.goodsList[index].stockNumber = 0;
-      }
-    },
-
     // 检查文件类型
     checkFileType(url) {
       if(!url) return '';
@@ -335,10 +282,6 @@ export default {
           this.$errorMsg('请填写审批数量');
           return;
         }
-        if(this.goodsList[i].approvalNumber > this.goodsList[i].stockNumber) {
-          this.$errorMsg('审批数量不可大于库存数');
-          return;
-        }
         if(this.goodsList[i].approvalNumber > this.goodsList[i].invoiceNum) {
           this.$errorMsg('审批数量不可大于申请数量');
           return;

+ 1 - 18
src/views/supply/deliver/components/commerce_detail.vue

@@ -114,11 +114,6 @@
         <el-table :data="detailData.retreatDocumentOrder" element-loading-text="Loading" border fit highlight-current-row stripe>
           <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
           <el-table-column align="center" label="订单号" prop="mainOrderId" min-width="180" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="仓库" prop="stockIds" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-tag size="mini" style="margin: 0 5px;" v-for="(item, index) in scope.row.stockIds" :key="index">{{item.name}}</el-tag>
-            </template>
-          </el-table-column>
           <el-table-column align="center" label="产品编号" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
@@ -142,7 +137,7 @@
     </div>
     
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <!-- <el-button  type="primary" icon="el-icon-printer" v-print="printObj">打 印</el-button> -->
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
           <el-button slot="reference">关 闭</el-button>
@@ -195,18 +190,6 @@ export default {
     }
   },
 
-  computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
-  },
-
   created() {
     this.getDetail();
   },

+ 0 - 5
src/views/supply/deliver/components/deliver_detail.vue

@@ -114,11 +114,6 @@
         <el-table :data="detailData.shipDocumentOrders" element-loading-text="Loading" border fit highlight-current-row stripe>
           <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
           <el-table-column align="center" label="订单号" prop="mainOrderId" min-width="200" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="仓库" prop="stockIds" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-tag size="mini" style="margin: 0 5px;" v-for="(item, index) in scope.row.stockIds" :key="index">{{item.name}}</el-tag>
-            </template>
-          </el-table-column>
           <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="产品编号" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>

+ 1 - 18
src/views/supply/deliver/components/home_detail.vue

@@ -114,11 +114,6 @@
         <el-table :data="detailData.shipDocumentOrders" element-loading-text="Loading" border fit highlight-current-row stripe>
           <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
           <el-table-column align="center" label="订单号" prop="mainOrderId" min-width="180" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="仓库" prop="stockIds" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-tag size="mini" style="margin: 0 5px;" v-for="(item, index) in scope.row.stockIds" :key="index">{{item.name}}</el-tag>
-            </template>
-          </el-table-column>
           <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="产品编号" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
@@ -143,7 +138,7 @@
     </div>
     
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <!-- <el-button  type="primary" icon="el-icon-printer" v-print="printObj">打 印</el-button> -->
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
           <el-button slot="reference">关 闭</el-button>
@@ -200,18 +195,6 @@ export default {
     }
   },
 
-  computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
-  },
-
   created() {
     this.getDetail();
   },

+ 1 - 1
src/views/supply/implement/implement_list.vue

@@ -83,7 +83,7 @@
             <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="产品编码" prop="materialNumber" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="订单未发货数量" prop="refundableQty" min-width="120" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="总数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>

+ 127 - 23
src/views/supply/reserve/components/reserve_form.vue

@@ -10,30 +10,31 @@
       <el-row :gutter="20">
         <el-col :xs="24" :sm="12" :lg="6">
           <el-form-item label="单据编号" prop="orderNum">
-            <el-input v-model="mainForm.orderNum" placeholder="系统自动生成" readonly></el-input>
+            <el-input v-model="mainForm.orderNum" placeholder="系统自动生成" disabled></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="6" style="height: 51px;">
           <el-form-item label="单据日期" prop="orderDate">
             <el-date-picker
               v-model="mainForm.orderDate"
+              disabled
               type="date"
               value-format="yyyy-MM-dd"
               style="width: 100%;"
-              placeholder="选择日期">
+              placeholder="系统自动生成">
             </el-date-picker>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="6">
           <el-form-item label="制单人" prop="createMan">
-            <el-input v-model="mainForm.createMan" placeholder="请输入制单人" readonly></el-input>
+            <el-input v-model="mainForm.createMan" placeholder="请输入制单人" disabled></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="6" style="height: 51px;">
           <el-form-item label="制单日期" prop="createDate">
             <el-date-picker
               v-model="mainForm.createDate"
-              readonly
+              disabled
               type="datetime"
               value-format="yyyy-MM-dd HH:mm:ss"
               style="width: 100%;"
@@ -50,8 +51,8 @@
     </el-form>
 
     <div style="margin-top: 20px">
-      <el-button type="primary" size="small" icon="el-icon-plus" @click="openDialog">添加引用</el-button>
-      <el-button type="danger" size="small" icon="el-icon-minus" @click="deleteGoods" :disabled="tableSelection.length < 1">批量删除</el-button>
+      <el-button type="primary" size="small" icon="el-icon-plus" @click="openDialog" v-if="!listItem">添加引用</el-button>
+      <el-button type="danger" size="small" icon="el-icon-minus" @click="deleteGoods" :disabled="tableSelection.length < 1" v-if="!listItem">批量删除</el-button>
     </div>
     <div class="table" style="margin-top: 20px">
       <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400" @selection-change="tableSelectionChange">
@@ -62,10 +63,56 @@
             {{scope.row.orderTime | dateToDayFilter}}
           </template>
         </el-table-column>
-        <el-table-column align="center" label="经销商编码" prop="customerId" min-width="120" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="经销商编码" prop="customerId" min-width="120" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <div v-if="scope.row.orderId || listItem">{{scope.row.customerId}}</div>
+            <el-select 
+              v-else
+              v-model="scope.row.customerId"
+              placeholder="选择经销商"
+              size="small"
+              filterable
+              remote
+              clearable
+              :remote-method="checkDealerList"
+              @change="changeDealer(scope.$index)">
+              <el-option
+                v-for="item in dealerList"
+                :key="item.id"
+                :label="item.id"
+                :value="item.id">
+                <span>{{ item.id }}</span>
+                <span style="color: #8492a6; font-size: 13px; margin-left: 6px">{{ item.name }}</span>
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
         <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <div v-if="scope.row.orderId || listItem">{{scope.row.materialCode}}</div>
+            <el-select 
+              v-else
+              v-model="scope.row.materialCode"
+              placeholder="选择产品"
+              size="small"
+              filterable
+              remote
+              clearable
+              :remote-method="checkMaterialList"
+              @change="changeMaterial(scope.$index)">
+              <el-option
+                v-for="item in materialList"
+                :key="item.number"
+                :label="item.number"
+                :value="item.number">
+                <span>{{ item.number }}</span>
+                <span style="color: #8492a6; font-size: 13px; margin-left: 6px">{{ item.name }}</span>
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
         <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
@@ -90,10 +137,11 @@
           </template>
         </el-table-column>
       </el-table>
+      <div class="add" v-if="!listItem"><el-button type="text" icon="el-icon-plus" @click="addGoods">添加行</el-button></div>
     </div>
     
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <el-button type="primary" @click="clickSubmitForm">保 存</el-button>
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
           <el-button slot="reference">关 闭</el-button>
@@ -210,7 +258,7 @@
 </template>
 
 <script>
-import { getDetail, getGoodsList, addData, editData } from "@/api/supply/reserve";
+import { getDetail, getGoodsList, addData, editData, checkDealerList, checkMaterialList } from "@/api/supply/reserve";
 import { getDictList } from '@/api/common'
 
 let that
@@ -264,19 +312,10 @@ export default {
       
       dialogGoodsList: [],
       dialogSelection: [],
-    }
-  },
 
-  computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
+      dealerList: [],
+      materialList: [],
+    }
   },
 
   beforeCreate() {
@@ -350,6 +389,7 @@ export default {
       }).then(res => {
         res.data.records.forEach(item => {
           item.status = 1;
+          item.reservedStatus = 1;
         });
         let oldGoodsList = this.goodsList;
         let newGoodsList = res.data.records;
@@ -452,12 +492,68 @@ export default {
       }
     },
 
+    // 添加产品
+    addGoods() {
+      this.goodsList.push({
+        reservedStatus: 2,
+        status: 1
+      })
+    },
+
+    // 查询经销商列表
+    checkDealerList(query) {
+      checkDealerList({
+        number: query,
+      }).then(res => {
+        this.dealerList = res.data || [];
+      })
+    },
+
+    // 更改经销商
+    changeDealer(index) {
+      if(this.goodsList[index].customerId) {
+        let obj = this.dealerList.find(o => o.id == this.goodsList[index].customerId);
+        this.goodsList[index].customerName = obj.name;
+        this.goodsList[index].customerNumber = obj.number;
+      }else {
+        this.goodsList[index].customerName = '';
+        this.goodsList[index].customerNumber = '';
+      }
+    },
+
+    // 查询产品
+    checkMaterialList(query) {
+      checkMaterialList({
+        number: query,
+      }).then(res => {
+        this.materialList = res.data || [];
+      })
+    },
+
+    // 更改产品
+    changeMaterial(index) {
+      if(this.goodsList[index].materialCode) {
+        let obj = this.materialList.find(o => o.number == this.goodsList[index].materialCode);
+        this.goodsList[index].materialName = obj.name;
+        this.goodsList[index].materialId = obj.id;
+        this.goodsList[index].materialOldNumber = obj.oldNumber;
+        this.goodsList[index].specification = obj.specification;
+        this.goodsList[index].unit = obj.baseUnitId;
+      }else {
+        this.goodsList[index].materialName = '';
+        this.goodsList[index].materialId = '';
+        this.goodsList[index].materialOldNumber = '';
+        this.goodsList[index].specification = '';
+        this.goodsList[index].unit = '';
+      }
+    },
+
     // 提交
     clickSubmitForm() {
       this.$refs.mainForm.validate((valid) => {
         if (valid) {
           let params = {
-            orderTime: this.mainForm.orderDate + ' 00:00:00',
+            // orderTime: this.mainForm.orderDate + ' 00:00:00',
             remark: this.mainForm.remark,
             reservedOrderItems: this.goodsList,
           }
@@ -501,4 +597,12 @@ export default {
       padding-left: 10px;
     }
   }
+  .add {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    border: 1px solid #EBEEF5;
+    border-top: none;
+    height: 50px;
+  }
 </style>

+ 2 - 2
src/views/supply/reserve/reserve_list.vue

@@ -75,7 +75,7 @@
             <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">新增</el-button>
           </div>
           <div class="fr">
-            <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
+            <ExportButton :exUrl="'reserve/export'" :exParams="exParams" />
           </div>
         </div>
         <div class="table">
@@ -93,7 +93,7 @@
                 {{scope.row.orderTime | dateToDayFilter}}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="产品大类" prop="mainName" min-width="160" show-overflow-tooltip></el-table-column>
+            <!-- <el-table-column align="center" label="产品大类" prop="mainName" min-width="160" show-overflow-tooltip></el-table-column> -->
             <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>