Explorar el Código

【修改】调整-退货单,预留单

莫绍宝 hace 3 años
padre
commit
897f729910

+ 9 - 0
src/api/common.js

@@ -52,4 +52,13 @@ export function getSmallList(params) {
     method: 'get',
     params
   })
+}
+
+// 获取经销商列表
+export function getDealerList(params) {
+  return request({
+    url: '/customer/list',
+    method: 'get',
+    params
+  })
 }

+ 2 - 1
src/views/setting/account.vue

@@ -220,7 +220,8 @@
 </template>
 
 <script>
-import { getDepartmentList, getAccountList, addAccount, editAccount, deleteAccount, getAccountDetail, getRoleList, getMerchantList, getDealerList, changeAccountStatus, resetPassword } from '@/api/setting'
+import { getDepartmentList, getAccountList, addAccount, editAccount, deleteAccount, getAccountDetail, getRoleList, getMerchantList, changeAccountStatus, resetPassword } from '@/api/setting'
+import { getDealerList } from '@/api/common'
 import { findElem, downloadFiles, handleImport } from '@/utils/util'
 
 export default {

+ 11 - 11
src/views/supply/reserve/components/reserve_form.vue

@@ -64,12 +64,12 @@
             {{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 align="center" label="经销商编码" prop="customerNumber" min-width="120" show-overflow-tooltip>
           <template slot-scope="scope">
-            <div v-if="scope.row.orderId || listItem">{{scope.row.customerId}}</div>
+            <div v-if="scope.row.orderId || listItem">{{scope.row.customerNumber}}</div>
             <el-select 
               v-else
-              v-model="scope.row.customerId"
+              v-model="scope.row.customerNumber"
               placeholder="选择经销商"
               size="small"
               filterable
@@ -79,10 +79,10 @@
               @change="changeDealer(scope.$index)">
               <el-option
                 v-for="item in dealerList"
-                :key="item.id"
-                :label="item.id"
-                :value="item.id">
-                <span>{{ item.id }}</span>
+                :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>
@@ -527,13 +527,13 @@ export default {
 
     // 更改经销商
     changeDealer(index) {
-      if(this.goodsList[index].customerId) {
-        let obj = this.dealerList.find(o => o.id == this.goodsList[index].customerId);
+      if(this.goodsList[index].customerNumber) {
+        let obj = this.dealerList.find(o => o.number == this.goodsList[index].customerNumber);
         this.goodsList[index].customerName = obj.name;
-        this.goodsList[index].customerNumber = obj.number;
+        this.goodsList[index].customerId = obj.id;
       }else {
         this.goodsList[index].customerName = '';
-        this.goodsList[index].customerNumber = '';
+        this.goodsList[index].customerId = '';
       }
     },
 

+ 26 - 2
src/views/supply/return/components/return_form.vue

@@ -103,12 +103,19 @@
     <el-dialog title="添加引用" :visible.sync="isShowDialog" width="80%">
       <el-form ref="screenForm" :model="screenForm" size="small" label-position="left" label-width="70px">
         <el-row :gutter="20">
-          <el-col :xs="12" :sm="12" :lg="12">
+          <el-col :xs="12" :sm="6" :lg="6">
             <el-form-item prop="orderNum" label="发货单号">
               <el-input v-model="screenForm.orderNum" placeholder="请输入发货单号"></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item prop="dealer" label="经销商">
+              <el-select v-model="screenForm.dealer" placeholder="请选择经销商" style="width: 100%;" filterable>
+                <el-option :label="item.name" :value="item.id" v-for="(item, index) in dealerList" :key="index"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="6">
             <el-form-item label="">
               <el-button size="small" @click="resetScreenForm">清空</el-button>
               <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
@@ -166,6 +173,7 @@
 
 <script>
 import { getDetail, getGoodsList, addData } from "@/api/supply/return";
+import { getDealerList } from '@/api/common'
 
 export default {
   name: 'ReturnForm',
@@ -207,9 +215,11 @@ export default {
       isShowDialog: false,
       screenForm: {
         orderNum: '',
+        dealer: '',
       },
       currentPage: 1,
       listTotal: 0,
+      dealerList: [],
       
       tableGoodsList: [],
       tableSelection: [],
@@ -244,6 +254,16 @@ export default {
       this.$emit('backListFormDetail');
     },
 
+    // 获取经销商列表
+    getDealerList() {
+      getDealerList({
+        pageNum: 1,
+        pageSize: -1,
+      }).then(res => {
+        this.dealerList = res.data.records;
+      })
+    },
+
     // 获取详情
     getDetail() {
       getDetail({id: this.listItem.id}).then(res => {
@@ -256,7 +276,7 @@ export default {
       getGoodsList({
         pageNum: this.currentPage,
         pageSize: 10,
-        customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
+        customerId: this.screenForm.dealer,
         id: this.screenForm.orderNum,
       }).then(res => {
         res.data.records.forEach(item => {
@@ -294,6 +314,7 @@ export default {
     // 点击 选择商品
     openDialog() {
       this.isShowDialog = true;
+      this.getDealerList();
       if(this.screenForm.orderNum) {
         this.getGoodsList();
       }
@@ -304,6 +325,9 @@ export default {
       if(!this.screenForm.orderNum) {
         return this.$errorMsg('请填写发货申请单号');
       }
+      if(!this.screenForm.dealer) {
+        return this.$errorMsg('请选择经销商');
+      }
       this.currentPage = 1;
       this.getGoodsList();
     },