Ver código fonte

【修改】
1.金额格式逗号分割
2.零售/工程发货申请单 - 批量审批

莫绍宝 3 anos atrás
pai
commit
5bd173866e

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

@@ -72,6 +72,15 @@ export function deleteApply(params) {
   })
 }
 
+// 零售发货申请单 - 批量审批
+export function examineBatchApply(params) {
+  return request({
+    url: '/invoice/allApprovalInvoice',
+    method: 'post',
+    params
+  })
+}
+
 // 零售发货申请单 - 新增
 export function addApply(params) {
   return request({
@@ -209,6 +218,15 @@ export function deleteEngin(params) {
   })
 }
 
+// 工程发货申请单 - 批量审批
+export function examineBatchEngin(params) {
+  return request({
+    url: '/invoice/allApprovalInvoiceProject',
+    method: 'post',
+    params
+  })
+}
+
 
 // 零售退货申请单 - 新增
 export function addApplyReturn(params) {

+ 5 - 2
src/filters/index.js

@@ -76,10 +76,13 @@ export function uppercaseFirst(string) {
 export function numToFixed(num) {
 	if(!num) return '0.00';
   if(isNaN(Number(num))) return num;
-	return Number(num).toFixed(2);
+	num = num.toFixed(2)
+  if(num.includes('.')){
+    return num.slice(0,-3).replace(/(\d)(?=(\d{3})+$)/g,'$1,') + num.slice(-3)
+  }
+  return num.replace(/(\d)(?=(\d{3})+$)/g,'$1,')
 }
 
-
 /**
  * 截取到“日”的日期
  * yyyy-MM-dd HH:mm:ss  =>  yyyy-MM-dd

+ 7 - 2
src/utils/common.js

@@ -80,7 +80,8 @@ export const getSummaries = (param) => {
           } else {
             return prev;
           }
-        }, 0).toFixed(2);
+        }, 0);
+        sums[index] = numToFixed(sums[index]);
         sums[index];
       }
     }
@@ -99,7 +100,11 @@ export const getSummaries = (param) => {
  export const numToFixed = (num) => {
 	if(!num) return '0.00';
   if(isNaN(Number(num))) return num;
-	return Number(num).toFixed(2);
+	num = num.toFixed(2)
+  if(num.includes('.')){
+    return num.slice(0,-3).replace(/(\d)(?=(\d{3})+$)/g,'$1,') + num.slice(-3)
+  }
+  return num.replace(/(\d)(?=(\d{3})+$)/g,'$1,')
 }
 
 

+ 42 - 2
src/views/supply/apply/apply_list.vue

@@ -96,6 +96,7 @@
           <div class="fl">
             <el-button size="mini" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">发货申请</el-button>
             <el-button size="mini" type="primary" icon="el-icon-plus" @click="toReturnForm()" v-if="$checkBtnRole('add', $route.meta.roles)">退货申请</el-button>
+            <el-button size="mini" type="warning" icon="el-icon-finished" @click="batchExamine" :disabled="multipleSelection.length < 1" v-if="$checkBtnRole('examine', $route.meta.roles)">批量审批</el-button>
           </div>
           <div class="fr">
             <ExportButton :exUrl="'invoice/listExport'" :exParams="exParams" />
@@ -110,8 +111,10 @@
             fit 
             highlight-current-row 
             stripe
+            @selection-change="handleSelectionChange"
             show-summary
             :summary-method="$getSummaries">
+            <el-table-column align="center" type="selection" width="55"></el-table-column>
             <el-table-column align="left" label="订单类型" prop="type" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{scope.row.type | orderTypeFilter}}
@@ -271,6 +274,8 @@
         </div>
       </div>
     </div>
+
+    <ExamineDialog :isShow.sync="isShowExamineDialog" :examineForm.sync="examineForm" />
     
     <ApplyDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
     <ApplyExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
@@ -281,12 +286,13 @@
 </template>
 
 <script>
-import { getApplyList, submitApply, deleteApply, abandonApply } from "@/api/supply/apply";
+import { getApplyList, submitApply, deleteApply, abandonApply, examineBatchApply } from "@/api/supply/apply";
 import { getSalesmanList } from '@/api/common'
 import ApplyDetail from "@/views/supply/apply/components/apply_detail";
 import ApplyExamine from "@/views/supply/apply/components/apply_examine";
 import ApplyForm from "@/views/supply/apply/components/apply_form";
 import ApplyReturnForm from "@/views/supply/apply/components/apply_return_form";
+import ExamineDialog from "@/components/Common/examine-dialog";
 
 let that
 export default {
@@ -294,7 +300,8 @@ export default {
     ApplyDetail,
     ApplyExamine,
     ApplyForm,
-    ApplyReturnForm
+    ApplyReturnForm,
+    ExamineDialog,
   },
   filters: {
     statusFilter(val) {
@@ -344,6 +351,13 @@ export default {
       isShowExamine: false,
       isShowForm: false,
       isShowReturnForm: false,
+
+      multipleSelection: [],
+      isShowExamineDialog: false,
+      examineForm: {
+        status: '',
+        remark: '',
+      },
     }
   },
 
@@ -497,6 +511,32 @@ export default {
         this.getList();
       })
     },
+
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+
+    // 打开 批量审批
+    batchExamine() {
+      this.isShowExamineDialog = true;
+    },
+
+    // 提交 批量审批
+    submitExamineForm() {
+      let ids = this.multipleSelection.map(item => {
+        return item.id;
+      });
+      ids = Array.from(new Set(ids));
+      examineBatchApply({
+        ids: ids.join(','),
+        examineStatus: this.examineForm.status,
+        approvalRemark: this.examineForm.remark,
+      }).then(res => {
+        this.isShowEditDateDialog = false;
+        this.getList();
+        this.$successMsg('审批成功');
+      })
+    },
   }
 }
 </script>

+ 5 - 4
src/views/supply/apply/components/apply_return_form.vue

@@ -83,13 +83,14 @@
             <el-input v-model="scope.row.invoiceNum" size="small" type="number"></el-input>
           </template>
         </el-table-column>
-        <el-table-column align="center" label="仓库" prop="correspondId" min-width="140" show-overflow-tooltip>
+        <el-table-column align="center" label="仓库" prop="correspondName" min-width="100" show-overflow-tooltip></el-table-column>
+        <!-- <el-table-column align="center" label="仓库" prop="correspondId" min-width="140" show-overflow-tooltip>
           <template slot-scope="scope">
             <el-select v-model="scope.row.correspondId" placeholder="请选择仓库" size="small" filterable clearable style="width: 100%">
               <el-option :label="item.name" :value="item.id" v-for="(item, index) in warehouseList" :key="index"></el-option>
             </el-select>
           </template>
-        </el-table-column>
+        </el-table-column> -->
         <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip>
           <template slot-scope="scope">
             <el-input v-model="scope.row.remark" size="small"></el-input>
@@ -486,10 +487,10 @@ export default {
           //   return this.$errorMsg('请选择仓库');
           // }
           let goodsList = this.goodsList.map(item => {
-            let obj = this.warehouseList.find(o => o.id === item.correspondId);
+            // let obj = this.warehouseList.find(o => o.id === item.correspondId);
             return {
               correspondId: item.correspondId,
-              correspondName: obj.name,
+              correspondName: item.correspondName,
               refundableQty: item.invoiceNum,
               remark: item.remark,
               salesOrderId: item.id,

+ 5 - 4
src/views/supply/apply/components/engin_return_form.vue

@@ -145,13 +145,14 @@
             <el-input v-model="scope.row.invoiceNum" size="small"></el-input>
           </template>
         </el-table-column>
-        <el-table-column align="center" label="仓库" prop="correspondId" min-width="140" show-overflow-tooltip>
+        <el-table-column align="center" label="仓库" prop="correspondName" min-width="100" show-overflow-tooltip></el-table-column>
+        <!-- <el-table-column align="center" label="仓库" prop="correspondId" min-width="140" show-overflow-tooltip>
           <template slot-scope="scope">
             <el-select v-model="scope.row.correspondId" placeholder="请选择仓库" size="small" filterable clearable style="width: 100%">
               <el-option :label="item.name" :value="item.id" v-for="(item, index) in warehouseList" :key="index"></el-option>
             </el-select>
           </template>
-        </el-table-column>
+        </el-table-column> -->
         <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip>
           <template slot-scope="scope">
             <el-input v-model="scope.row.remark" size="small"></el-input>
@@ -711,10 +712,10 @@ export default {
           //   return this.$errorMsg('请选择仓库');
           // }
           let goodsList = this.goodsList.map(item => {
-            let obj = this.warehouseList.find(o => o.id === item.correspondId);
+            // let obj = this.warehouseList.find(o => o.id === item.correspondId);
             return {
               correspondId: item.correspondId,
-              correspondName: obj.name,
+              correspondName: item.correspondName,
               refundableQty: item.invoiceNum,
               remark: item.remark,
               salesOrderId: item.id,

+ 44 - 4
src/views/supply/apply/engin_list.vue

@@ -96,6 +96,7 @@
           <div class="fl">
             <el-button size="mini" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">发货申请</el-button>
             <el-button size="mini" type="primary" icon="el-icon-plus" @click="toReturnForm()" v-if="$checkBtnRole('add', $route.meta.roles)">退货申请</el-button>
+            <el-button size="mini" type="warning" icon="el-icon-finished" @click="batchExamine" :disabled="multipleSelection.length < 1" v-if="$checkBtnRole('examine', $route.meta.roles)">批量审批</el-button>
           </div>
           <div class="fr">
             <ExportButton :exUrl="'invoice/listProjectExport'" :exParams="exParams" />
@@ -110,8 +111,10 @@
             fit 
             highlight-current-row 
             stripe
+            @selection-change="handleSelectionChange"
             show-summary
             :summary-method="$getSummaries">
+            <el-table-column align="center" type="selection" width="55"></el-table-column>
             <el-table-column align="left" label="订单类型" prop="type" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{scope.row.type | orderTypeFilter}}
@@ -155,10 +158,10 @@
                 <span>{{scope.row.customerName}}</span>
               </template>
             </el-table-column>
-            <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip>
+            <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip>
               <template slot-scope="scope">
-                <CopyButton :copyText="scope.row.materialNumber" />
-                <span>{{scope.row.materialNumber}}</span>
+                <CopyButton :copyText="scope.row.materialCode" />
+                <span>{{scope.row.materialCode}}</span>
               </template>
             </el-table-column>
             <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="140" show-overflow-tooltip>
@@ -278,6 +281,8 @@
         </div>
       </div>
     </div>
+
+    <ExamineDialog :isShow.sync="isShowExamineDialog" :examineForm.sync="examineForm" />
     
     <EnginDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
     <EnginExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
@@ -288,12 +293,13 @@
 </template>
 
 <script>
-import { getEnginList, submitEngin, deleteEngin, abandonEngin } from "@/api/supply/apply";
+import { getEnginList, submitEngin, deleteEngin, abandonEngin, examineBatchEngin } from "@/api/supply/apply";
 import { getSalesmanList } from '@/api/common'
 import EnginDetail from "@/views/supply/apply/components/engin_detail";
 import EnginExamine from "@/views/supply/apply/components/engin_examine";
 import EnginForm from "@/views/supply/apply/components/engin_form";
 import EnginReturnForm from "@/views/supply/apply/components/engin_return_form";
+import ExamineDialog from "@/components/Common/examine-dialog";
 
 let that
 export default {
@@ -302,6 +308,7 @@ export default {
     EnginExamine,
     EnginForm,
     EnginReturnForm,
+    ExamineDialog,
   },
   filters: {
     statusFilter(val) {
@@ -351,6 +358,13 @@ export default {
       isShowExamine: false,
       isShowForm: false,
       isShowReturnForm: false,
+
+      multipleSelection: [],
+      isShowExamineDialog: false,
+      examineForm: {
+        status: '',
+        remark: '',
+      },
     }
   },
 
@@ -504,6 +518,32 @@ export default {
         this.getList();
       })
     },
+
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+
+    // 打开 批量审批
+    batchExamine() {
+      this.isShowExamineDialog = true;
+    },
+
+    // 提交 批量审批
+    submitExamineForm() {
+      let ids = this.multipleSelection.map(item => {
+        return item.id;
+      });
+      ids = Array.from(new Set(ids));
+      examineBatchEngin({
+        ids: ids.join(','),
+        examineStatus: this.examineForm.status,
+        approvalRemark: this.examineForm.remark,
+      }).then(res => {
+        this.isShowEditDateDialog = false;
+        this.getList();
+        this.$successMsg('审批成功');
+      })
+    },
   }
 }
 </script>

+ 1 - 1
src/views/supply/deliver/deliver_list.vue

@@ -103,7 +103,7 @@
             </el-table-column>
             <el-table-column align="left" label="发货日期" prop="orderTime" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="left" label="仓库" prop="correspondName" min-width="80" show-overflow-tooltip></el-table-column>
-            <el-table-column align="left" label="订单号" prop="mainOrderId" min-width="180" show-overflow-tooltip>
+            <el-table-column align="left" label="订单号" prop="mainOrderId" min-width="140" show-overflow-tooltip>
               <template slot-scope="scope">
                 <CopyButton :copyText="scope.row.mainOrderId" />
                 <span>{{scope.row.mainOrderId}}</span>