فهرست منبع

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

chen 3 سال پیش
والد
کامیت
5abcc3dcc8

+ 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
+  })
 }

+ 9 - 0
src/api/supply/sales.js

@@ -34,4 +34,13 @@ export function examineJudge(params) {
     method: 'post',
     params
   })
+}
+
+// 批量审批
+export function examineBatch(params) {
+  return request({
+    url: '/sale/order/allApproval',
+    method: 'post',
+    params
+  })
 }

+ 71 - 0
src/components/Common/examine-dialog.vue

@@ -0,0 +1,71 @@
+<template>
+  <div>
+    <el-dialog title="批量审批" :visible.sync="isShow" :show-close="false" width="400px" :close-on-click-modal="false">
+      <el-form ref="examineForm" :model="examineForm" :rules="examineFormRules" label-position="left" label-width="80px">
+        <el-form-item label="审批状态" prop="status">
+          <el-radio-group v-model="examineForm.status">
+            <el-radio :label="'OK'">通过</el-radio>
+            <el-radio :label="'FAIL'">驳回</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="审批备注" prop="remark">
+          <el-input
+            type="textarea"
+            :autosize="{ minRows: 2, maxRows: 4}"
+            placeholder="请输入审批备注"
+            v-model="examineForm.remark">
+          </el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="cancelForm">取 消</el-button>
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+
+export default {
+  name: 'EditDateDialog',
+  props: {
+    isShow: {
+      type: Boolean,
+      default: false
+    },
+    examineForm: {
+      type: Object,
+      default: {
+        date: '',
+      }
+    }
+  },
+  data() {
+    return {
+      examineFormRules: {
+        status: [
+          { required: true, message: '请选择审批状态', trigger: 'change' }
+        ],
+      },
+    }
+  },
+  methods: {
+    cancelForm() {
+      this.$emit('update:isShow', false);
+    },
+
+    submitForm() {
+      this.$refs.examineForm.validate((valid) => {
+        if (valid) {
+          this.$parent.submitExamineForm();
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style>
+
+</style>

+ 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 {

+ 7 - 13
src/views/supply/apply/components/engin_form.vue

@@ -43,7 +43,10 @@
       <el-row :gutter="20">
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="工程登录编号" prop="loginNum">
-            <el-input v-model="mainForm.loginNum" placeholder="请输入工程登录编号"></el-input>
+            <div style="display: flex;">
+              <el-input v-model="mainForm.loginNum" placeholder="请输入工程登录编号"></el-input>
+              <el-button style="margin-left: 10px;" @click="openDialog">引用</el-button>
+            </div>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
@@ -124,14 +127,6 @@
 
     <div class="main-title">
       <div class="title">货品信息</div>
-      <div>
-        <span style="font-size: 14px; margin-right: 10px">仓库</span>
-        <el-select v-model="screenForm.warehouse" placeholder="请选择发货仓库" size="small" filterable clearable :disabled="goodsList.length > 0">
-          <el-option :label="item.name" :value="item.id" v-for="(item, index) in warehouseList" :key="index"></el-option>
-        </el-select>
-        <el-divider direction="vertical"></el-divider>
-        <el-button type="primary" size="small" icon="el-icon-plus" @click="openDialog">添加引用</el-button>
-      </div>
     </div>
 
     <div class="table" style="margin-top: 20px">
@@ -513,11 +508,10 @@ export default {
 
     // 点击 选择商品
     openDialog() {
-      if(!this.screenForm.warehouse) {
-        return this.$errorMsg('请选择仓库');
-      }
       this.isShowDialog = true;
-      this.getGoodsList();
+      if(this.screenForm.warehouse) {
+        this.getGoodsList();
+      }
     },
 
     // 提交筛选表单

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

@@ -18,21 +18,21 @@
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">单据状态</div>
-            <div class="value">{{detailData.type | statusFilter}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">销售类型</div>
-            <div class="value">{{detailData.salesType}}</div>
+            <div class="value">{{detailData.examineStatus | statusFilter}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">发货申请单号</div>
-            <div class="value">{{detailData.invoiceOrderNo}}</div>
+            <div class="value">{{detailData.id}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">订单类型</div>
             <div class="value">{{detailData.orderType | orderTypeFilter}}</div>
           </el-col>
           <el-col :span="8" class="item">
+            <div class="label"></div>
+            <div class="value"></div>
+          </el-col>
+          <el-col :span="8" class="item">
             <div class="label">经销商编码</div>
             <div class="value">{{detailData.customerNumber}}</div>
           </el-col>
@@ -111,20 +111,20 @@
         <div class="title">货品信息</div>
       </div>
       <div class="table">
-        <el-table :data="detailData.retreatDocumentOrder" element-loading-text="Loading" border fit highlight-current-row stripe>
+        <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="enginOrderNo" min-width="180" 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="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="数量" prop="refundableQty" 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>
+          <el-table-column align="center" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="未出库数量" min-width="100" show-overflow-tooltip>
             <template slot-scope="scope">
               {{scope.row.salesStatus ? 0 : scope.row.refundableQty}}
             </template>
           </el-table-column>
-          <el-table-column align="center" label="含税单价" prop="price" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="含税单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="无税单价" prop="afterTaxPrice" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="价税合计" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="税率(%)" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
@@ -166,10 +166,14 @@ export default {
   },
   filters: {
     statusFilter(val) {
-      const MAP = {
-        1: '已受理'
-      }
-      return MAP[val];
+      const statusList = [
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
+      ]
+      let obj = statusList.find(o => o.value == val);
+      return obj ? obj.label : ''
     },
     orderTypeFilter(val) {
       const MAP = {

+ 3 - 3
src/views/supply/engin/commerce_list.vue

@@ -137,11 +137,11 @@
                 <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleWithdraw(scope.row.parentId)" v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'WAIT'" >
                   <el-button slot="reference" type="text">撤回</el-button>
                 </el-popconfirm>
-                <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
-                <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审批</el-button>
-                <el-popconfirm style="margin-left: 10px;" title="确定弃审吗?" @onConfirm="handleAbandon(scope.row.parentId)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
+                <el-popconfirm style="margin-right: 10px;" title="确定弃审吗?" @onConfirm="handleAbandon(scope.row.parentId)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
                   <el-button slot="reference" type="text">弃审</el-button>
                 </el-popconfirm>
+                <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
+                <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审批</el-button>
                 <el-button type="text" @click="toReturn(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles)">退订</el-button>
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
                 <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.parentId)" v-if="$checkBtnRole('del', $route.meta.roles)">

+ 25 - 3
src/views/supply/engin/components/home_examine.vue

@@ -50,7 +50,11 @@
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">销售类型</div>
-          <div class="value">{{detailData.saleTypeName}}</div>
+          <div class="value">
+            <el-select v-model="detailData.saleTypeId" placeholder="选择销售类型" style="width: 100%" clearable>
+              <el-option v-for="item in salesTypeList" :key="item.id" :label="item.saleName" :value="item.id"></el-option>
+            </el-select>
+          </div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">联系人</div>
@@ -187,6 +191,7 @@
 
 <script>
 import { getOrderDetail, examineHome } from "@/api/supply/engin";
+import { getTypeList } from '@/api/common'
 
 export default {
   name: 'HomeExamine',
@@ -213,11 +218,14 @@ export default {
       formLoading: false,
       examineForm: {
         remark: '',
-      }
+      },
+
+      salesTypeList: [],
     }
   },
 
   created() {
+    this.getSalesTypeList();
     this.getDetail();
   },
 
@@ -238,6 +246,16 @@ export default {
       return currentdate;
     },
 
+    // 获取销售类型列表
+    getSalesTypeList() {
+      getTypeList({
+        pageNum: 1,
+        pageSize: -1
+      }).then((res) => {
+        this.salesTypeList = res.data.records;
+      })
+    },
+
     // 返回列表
     goBack() {
       this.$emit('backListFormDetail');
@@ -257,9 +275,13 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        let params = this.detailData;
+        let saleTypeItem = this.salesTypeList.find(o => o.id == this.detailData.saleTypeId);
+        let params = JSON.parse(JSON.stringify(this.detailData));
         params.examineNote = this.examineForm.remark;
         params.examineResult = val;
+        params.saleTypeId = this.detailData.saleTypeId;
+        params.saleTypeCode = saleTypeItem.saleCode;
+        params.saleTypeName = saleTypeItem.saleName;
         examineHome(params).then(res => {
           this.$successMsg();
           this.goBack();

+ 3 - 3
src/views/supply/engin/home_list.vue

@@ -137,11 +137,11 @@
                 <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleWithdraw(scope.row.parentId)" v-if="scope.row.examineStatus === 'WAIT'" >
                   <el-button slot="reference" type="text">撤回</el-button>
                 </el-popconfirm>
-                <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'FAIL')">编辑</el-button>
-                <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审批</el-button>
-                <el-popconfirm style="margin-left: 10px;" title="确定弃审吗?" @onConfirm="handleAbandon(scope.row.parentId)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
+                <el-popconfirm style="margin-right: 10px;" title="确定弃审吗?" @onConfirm="handleAbandon(scope.row.parentId)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
                   <el-button slot="reference" type="text">弃审</el-button>
                 </el-popconfirm>
+                <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'FAIL')">编辑</el-button>
+                <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审批</el-button>
                 <el-button type="text" @click="toReturn(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus !== 'FAIL'">退订</el-button>
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
                 <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.parentId)" v-if="$checkBtnRole('del', $route.meta.roles)">

+ 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 = '';
       }
     },
 

+ 2 - 2
src/views/supply/retail/components/retail_detail.vue

@@ -119,7 +119,7 @@
     <div class="page-footer">
       <div class="footer" :class="classObj">
         <el-button type="primary" @click="openDirectDialog" :disabled="detailData.examineStatus !== 'OK'">提前开票</el-button>
-        <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.examineStatus !== 'OK'">直调发货</el-button>
+        <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.examineStatus !== 'OK' || detailData.directTransferStatus === true">直调发货</el-button>
         <el-button type="primary" @click="handleFinish" :disabled="detailData.examineStatus !== 'OK'">直调完成</el-button>
         <el-button @click="goBack">关 闭</el-button>
       </div>
@@ -173,7 +173,7 @@
         </el-table-column>
         <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="返利" prop="rebateAmount" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="返利" prop="payRebateAmount" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
         </el-table>

+ 5 - 5
src/views/supply/retail/retail_list.vue

@@ -131,16 +131,16 @@
             <el-table-column align="center" label="审核日期" prop="examineTime" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="操作" width="180" fixed="right">
               <template slot-scope="scope">
-                <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
                 <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审批</el-button>
-                <el-popconfirm style="margin-left: 10px;" title="确定弃审吗?" @onConfirm="handleAbandon(scope.row.id)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
+                <el-popconfirm style="margin-right: 10px;" title="确定申请吗?" @onConfirm="handleSubmit(scope.row.id)" v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" >
+                  <el-button slot="reference" type="text">申请</el-button>
+                </el-popconfirm>
+                <el-popconfirm style="margin-right: 10px;" title="确定弃审吗?" @onConfirm="handleAbandon(scope.row.id)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
                   <el-button slot="reference" type="text">弃审</el-button>
                 </el-popconfirm>
+                <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
                 <el-button type="text" @click="toReturn(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'">退订</el-button>
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
-                <el-popconfirm style="margin-left: 10px;" title="确定申请吗?" @onConfirm="handleSubmit(scope.row.id)" v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" >
-                  <el-button slot="reference" type="text">申请</el-button>
-                </el-popconfirm>
                 <el-popconfirm style="margin-left: 10px;" title="确定关闭吗?" @onConfirm="handleClose(scope.row.id)" v-if="$checkBtnRole('examine', $route.meta.roles) && !scope.row.closeTime" >
                   <el-button slot="reference" type="text">关闭</el-button>
                 </el-popconfirm>

+ 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();
     },

+ 59 - 6
src/views/supply/sales/sales_list.vue

@@ -29,8 +29,13 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="存货名称" prop="chName">
-                <el-input v-model="screenForm.chName" placeholder="请输入存货名称"></el-input>
+              <el-form-item label="产品名称" prop="chName">
+                <el-input v-model="screenForm.chName" placeholder="请输入产品名称"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="产品编码" prop="chNum">
+                <el-input v-model="screenForm.chNum" placeholder="请输入产品编码"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
@@ -39,6 +44,11 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="仓库名称" prop="warehouse">
+                <el-input v-model="screenForm.warehouse" placeholder="请输入仓库名称"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="发货日期" prop="date">
                 <el-date-picker
                   v-model="screenForm.date"
@@ -52,7 +62,7 @@
               </el-form-item>
             </el-col>
             
-            <el-col :xs="24" :sm="12" :lg="12" class="tr">
+            <el-col :xs="24" :sm="24" :lg="24" class="tr">
               <el-form-item label="">
                 <el-button size="small" @click="resetScreenForm">清空</el-button>
                 <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
@@ -65,14 +75,15 @@
       <div class="mymain-container">
         <div class="btn-group clearfix">
           <div class="fl">
-            <!-- <el-button size="small" type="warning" icon="el-icon-close">退单</el-button> -->
+            <el-button size="small" type="warning" icon="el-icon-finished" @click="batchExamine" :disabled="multipleSelection.length < 1">批量审批</el-button>
           </div>
           <div class="fr">
             <ExportButton :exUrl="'sale/order/export'" :exParams="exParams" />
           </div>
         </div>
         <div class="table">
-          <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe @selection-change="handleSelectionChange">
+            <el-table-column align="center" type="selection" width="55"></el-table-column>
             <el-table-column align="center" label="状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{scope.row.examineStatus | statusFilter}}
@@ -117,6 +128,8 @@
         </div>
       </div>
     </div>
+
+    <ExamineDialog :isShow.sync="isShowExamineDialog" :examineForm.sync="examineForm" />
     
     <SalesDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
     <SalesExamine :listItem="queryItem" v-if="isShowExamine" @backListFormExamine="backList" />
@@ -125,15 +138,17 @@
 </template>
 
 <script>
-import { getList, examineJudge } from "@/api/supply/sales";
+import { getList, examineJudge, examineBatch } from "@/api/supply/sales";
 import SalesDetail from "@/views/supply/sales/components/sales_detail";
 import SalesExamine from "@/views/supply/sales/components/sales_examine";
+import ExamineDialog from "@/components/Common/examine-dialog";
 
 let that
 export default {
   components: {
     SalesDetail,
     SalesExamine,
+    ExamineDialog,
   },
   filters: {
     statusFilter(val) {
@@ -160,7 +175,9 @@ export default {
         jxsName: '',
         jxsNum: '',
         chName: '',
+        chNum: '',
         model: '',
+        warehouse: '',
         date: '',
         status: '',
       },
@@ -174,6 +191,13 @@ export default {
       queryItem: {},
       isShowDetail: false,
       isShowExamine: false,
+
+      multipleSelection: [],
+      isShowExamineDialog: false,
+      examineForm: {
+        status: '',
+        remark: '',
+      }
     }
   },
 
@@ -185,7 +209,9 @@ export default {
         customerName: this.screenForm.jxsName,
         customerNumber: this.screenForm.jxsNum,
         materialName: this.screenForm.chName,
+        materialNumber: this.screenForm.chNum,
         specification: this.screenForm.model,
+        correspondName: this.screenForm.warehouse,
         startTime: this.screenForm.date ? this.screenForm.date[0] : '',
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
       }
@@ -213,7 +239,9 @@ export default {
         customerName: this.screenForm.jxsName,
         customerNumber: this.screenForm.jxsNum,
         materialName: this.screenForm.chName,
+        materialNumber: this.screenForm.chNum,
         specification: this.screenForm.model,
+        correspondName: this.screenForm.warehouse,
         startTime: this.screenForm.date ? this.screenForm.date[0] : '',
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
       };
@@ -284,6 +312,31 @@ export default {
       this.isShowDetail = false;
       this.isShowExamine = false;
     },
+
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+
+    // 打开 批量审批
+    batchExamine() {
+      this.isShowExamineDialog = true;
+    },
+
+    // 提交 批量审批
+    submitExamineForm() {
+      let ids = this.multipleSelection.map(item => {
+        return item.id;
+      });
+      examineBatch({
+        ids: ids.join(','),
+        examineStatus: this.examineForm.status,
+        approvalRemark: this.examineForm.remark,
+      }).then(res => {
+        this.isShowEditDateDialog = false;
+        this.getList();
+        this.$successMsg('修改成功');
+      })
+    },
   }
 }
 </script>