ソースを参照

【新增】销售出库单-批量审批

莫绍宝 3 年 前
コミット
7651476f2c

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

+ 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();
+      }
     },
 
     // 提交筛选表单

+ 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-close" @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>