Переглянути джерело

Merge branch 'feature/Feature-supply' into develop

莫绍宝 3 роки тому
батько
коміт
94e90c4156

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

@@ -97,4 +97,22 @@ export function getPickupManInfo(params) {
     method: 'post',
     params
   })
+}
+
+// 增加打印次数
+export function addPrint(params) {
+  return request({
+    url: '/pick/printAdd',
+    method: 'post',
+    params
+  })
+}
+
+// 获取汇总
+export function getStatistics(params) {
+  return request({
+    url: '/pick/summary',
+    method: 'get',
+    params
+  })
 }

+ 2 - 2
src/views/supply/deliver/commerce_list.vue

@@ -40,7 +40,7 @@
                   v-model="screenForm.date"
                   type="datetimerange"
                   range-separator="至"
-                  style="width: 100%;"
+                  style="width: 100%; height: 33px;"
                   value-format="yyyy-MM-dd HH:mm:ss"
                   start-placeholder="开始日期"
                   end-placeholder="结束日期">
@@ -58,7 +58,7 @@
               </el-form-item>
             </el-col>
             
-            <el-col :xs="24" :sm="12" :lg="6" class="tr">
+            <el-col :xs="24" :sm="24" :lg="12" class="tr">
               <el-form-item label="">
                 <el-button size="small" @click="resetScreenForm">清空</el-button>
                 <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>

+ 2 - 2
src/views/supply/deliver/home_list.vue

@@ -35,7 +35,7 @@
                   v-model="screenForm.date"
                   type="datetimerange"
                   range-separator="至"
-                  style="width: 100%;"
+                  style="width: 100%; height: 33px;"
                   value-format="yyyy-MM-dd HH:mm:ss"
                   start-placeholder="开始日期"
                   end-placeholder="结束日期">
@@ -53,7 +53,7 @@
               </el-form-item>
             </el-col>
             
-            <el-col :xs="24" :sm="12" :lg="6" class="tr">
+            <el-col :xs="24" :sm="24" :lg="12" class="tr">
               <el-form-item label="">
                 <el-button size="small" @click="resetScreenForm">清空</el-button>
                 <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>

+ 151 - 110
src/views/supply/pickup/check.vue

@@ -1,129 +1,145 @@
 <template>
   <div class="app-container">
     
-    <div class="main-title">
-      <div class="title">仓库提货确认</div>
-    </div>
+    <div v-show="!isShowPrint">
+      <div class="main-title">
+        <div class="title">仓库提货确认</div>
+      </div>
 
-    <div>
-      <el-form ref="screenForm" :model="screenForm" label-width="96px" size="small" label-position="right">
-        <el-row :gutter="20">
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="提货人手机号" prop="phone">
-              <el-input v-model="screenForm.phone" placeholder="请输入提货人手机号"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="3">
-            <el-button size="small" type="primary" @click="getCode" :disabled="!screenForm.phone || countDown != 60">{{countDown == 60 ? getCodeText : '重新获取('+countDown+'s)'}}</el-button>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="8">
-            <el-form-item label="验证码" prop="code">
-              <el-input v-model="screenForm.code" placeholder="请输入验证码"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="3">
-            <el-button size="small" type="primary" :disabled="!screenForm.phone || !screenForm.code" @click="getPickupManInfo">确 认</el-button>
-          </el-col>
-        </el-row>
-        <el-row :gutter="20">
-          <el-col :xs="24" :sm="12" :lg="9">
-            <el-form-item label="提货人姓名" prop="name">
-              <el-input v-model="screenForm.name" placeholder="请通过手机验证获取" readonly></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="8">
-            <el-form-item label="提货人身份证" prop="idCard">
-              <el-input v-model="screenForm.idCard" placeholder="请通过手机验证获取" readonly></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="3">
-            <el-button size="small" type="primary" @click="getList">查 询</el-button>
-          </el-col>
-        </el-row>
-        <el-row :gutter="20">
-          <el-col :xs="24" :sm="24" :lg="24">
-            <el-form-item prop="orderNum" label-width="0">
-              <el-radio-group v-model="screenForm.status" size="medium">
-                <el-radio-button label="0">未打印</el-radio-button>
-                <el-radio-button label="1">已打印</el-radio-button>
-              </el-radio-group>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
-    </div>
+      <div>
+        <el-form ref="screenForm" :model="screenForm" label-width="96px" size="small" label-position="right">
+          <el-row :gutter="20">
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="提货人手机号" prop="phone">
+                <el-input v-model="screenForm.phone" placeholder="请输入提货人手机号"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="3">
+              <el-button size="small" type="primary" @click="getCode" :disabled="!screenForm.phone || countDown != 60">{{countDown == 60 ? getCodeText : '重新获取('+countDown+'s)'}}</el-button>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="8">
+              <el-form-item label="验证码" prop="code">
+                <el-input v-model="screenForm.code" placeholder="请输入验证码"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="3">
+              <el-button size="small" type="primary" :disabled="!screenForm.phone || !screenForm.code" @click="getPickupManInfo">确 认</el-button>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :xs="24" :sm="12" :lg="9">
+              <el-form-item label="提货人姓名" prop="name">
+                <el-input v-model="screenForm.name" placeholder="请通过手机验证获取" readonly></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="8">
+              <el-form-item label="提货人身份证" prop="idCard">
+                <el-input v-model="screenForm.idCard" placeholder="请通过手机验证获取" readonly></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="3">
+              <el-button size="small" type="primary" @click="getList">查 询</el-button>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :xs="24" :sm="24" :lg="24">
+              <el-form-item prop="orderNum" label-width="0">
+                <el-radio-group v-model="screenForm.status" size="medium">
+                  <el-radio-button label="0">未打印</el-radio-button>
+                  <el-radio-button label="1">已打印</el-radio-button>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
 
-    <div class="main-title">
-      <div class="title">提货单</div>
-    </div>
+      <div class="main-title">
+        <div class="title">提货单</div>
+      </div>
 
-    <div class="mymain-container">
-      <div class="table">
-        <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
-          <el-table-column align="center" label="状态" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              {{ scope.row.printNum ? '已打单':'未打单' }}
-            </template>
-          </el-table-column>
-          <el-table-column align="center" label="信息密钥" prop="informationKey" min-width="180" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="预约日期" prop="pickTime" min-width="120" show-overflow-tooltip>
-            <template slot-scope="scope">
-              {{ scope.row.pickTime | dateToDayFilter }}
-            </template>
-          </el-table-column>
-          <el-table-column align="center" label="提货时段" min-width="100" show-overflow-tooltip>
-            <template slot-scope="scope">
-              {{ scope.row.pickStatus == '1' ? '上午':'下午' }}
-            </template>
-          </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="invoiceOrderId" min-width="180" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="120" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品大类" prop="mainName" min-width="120" 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>
-          <el-table-column align="center" label="数量" prop="qty" min-width="100" 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="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="使用返利金额" prop="payRebateAmount" min-width="120" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="格力折扣" prop="totalDiscAmount" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="仓库" prop="correspondName" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="提货方式" prop="pickType" min-width="100" show-overflow-tooltip>
-            <template slot-scope="scope">
-              {{ scope.row.pickType == '1' ? '自提':'物流快递' }}
-            </template>
-          </el-table-column>
-          <el-table-column align="center" label="提货人/物流公司" prop="takerName" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              {{ scope.row.pickType == '1' ? scope.row.takerName:scope.row.pickLogistics }}
-            </template>
-          </el-table-column>
-        </el-table>
+      <div class="mymain-container">
+        <div class="table">
+          <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="状态" min-width="100" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.printNum ? '已打单(' + scope.row.printNum + ')' : '未打单' }}
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="信息密钥" prop="informationKey" min-width="180" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="预约日期" prop="pickTime" min-width="120" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.pickTime | dateToDayFilter }}
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="提货时段" min-width="100" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.pickStatus == '1' ? '上午':'下午' }}
+              </template>
+            </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="invoiceOrderId" min-width="180" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="120" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="产品大类" prop="mainName" min-width="120" 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>
+            <el-table-column align="center" label="数量" prop="qty" min-width="100" 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="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="使用返利金额" prop="payRebateAmount" min-width="120" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="格力折扣" prop="totalDiscAmount" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="仓库" prop="correspondName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="提货方式" prop="pickType" min-width="100" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.pickType == '1' ? '自提':'物流快递' }}
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="提货人/物流公司" prop="takerName" min-width="160" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.pickType == '1' ? scope.row.takerName:scope.row.pickLogistics }}
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
       </div>
-    </div>
-    <div class="pagination clearfix">
-      <div class="fr">
-        <el-pagination
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="currentPage"
-          :page-sizes="[10, 20, 30, 50]"
-          :page-size="10"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="listTotal">
-        </el-pagination>
+      <div class="pagination clearfix">
+        <div class="fr">
+          <el-pagination
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            :page-sizes="[10, 20, 30, 50]"
+            :page-size="10"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="listTotal">
+          </el-pagination>
+        </div>
+      </div>
+
+      <div class="page-footer">
+        <div class="footer" :class="classObj">
+          <el-button type="primary" @click="printData" :disabled="multipleSelection.length < 1">打印发货单</el-button>
+        </div>
       </div>
+
     </div>
 
+    <PickupPrint :listItem="queryItem" v-if="isShowPrint" @backListFormDetail="backList" />
+
   </div>
 </template>
 
 <script>
-import { getPickupList, getCode, getPickupManInfo } from "@/api/supply/pickup";
+import { getPickupList, getCode, getPickupManInfo, addPrint } from "@/api/supply/pickup";
+import PickupPrint from "@/views/supply/pickup/components/pickup_print";
 
 export default {
+  components: {
+    PickupPrint
+  },
   data() {
     return {
       currentPage: 1, // 当前页码
@@ -144,6 +160,11 @@ export default {
       getCodeText: '获取验证码',
       countDown: 60,
 			timer: null,
+
+      multipleSelection: [],
+
+      queryItem: {},
+      isShowPrint: false,
     }
   },
 
@@ -225,6 +246,26 @@ export default {
       this.currentPage = val;
       this.getList();
     },
+
+    backList() {
+      this.queryItem = {};
+      this.isShowPrint = false;
+    },
+
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+
+    // 点击打印
+    printData() {
+      if(!item.printNum) {
+        this.queryItem = item;
+        this.isShowPrint = true;
+        // addPrint({ids: item.id}).then(res => {
+
+        // })
+      }
+    },
   }
 }
 </script>

+ 152 - 0
src/views/supply/pickup/components/pickup_print.vue

@@ -0,0 +1,152 @@
+<template>
+  <div class="detail-container">
+    <div id="printMe">
+      <div class="print-table-1">
+        <el-row :gutter="0">
+          <el-col :span="6" class="item">
+            <div class="label">经销商编码:</div>
+            <div class="value">{{detailData.id}}</div>
+          </el-col>
+          <el-col :span="6" class="item">
+            <div class="label">出库日期:</div>
+            <div class="value">{{detailData.createBy}}</div>
+          </el-col>
+          <el-col :span="6" class="item">
+            <div class="label">仓库:</div>
+            <div class="value">{{detailData.retreatTime}}</div>
+          </el-col>
+          <el-col :span="6" class="item">
+            <div class="label">信息密钥:</div>
+            <div class="value">{{detailData.customerNumber}}</div>
+          </el-col>
+          <el-col :span="24" class="item">
+            <div class="label">经销商:</div>
+            <div class="value">{{detailData.customerName}}</div>
+          </el-col>
+        </el-row>
+      </div>
+
+      <div class="table" style="margin-top: 20px">
+        <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="200" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="发货单号" prop="invoiceId" min-width="180" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="仓库名称" prop="correspondName" min-width="120" 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>
+          <el-table-column align="center" label="数量" prop="num" min-width="100" 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="payAmount" 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="noTotalAmount" 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>
+          <el-table-column align="center" label="使用返利金额" prop="payRebateAmount" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="折扣金额" prop="totalDiscAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="退补标记" prop="status" min-width="100" 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="serviceName" 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>
+      </div>
+    </div>
+    
+    <div class="page-footer">
+      <div class="footer" :class="classObj">
+        <el-button  type="primary" icon="el-icon-printer" v-print="printObj">打 印</el-button>
+        <el-button @click="goBack">关 闭</el-button>
+      </div>
+    </div>
+
+  </div>
+</template>
+
+<script>
+import print from 'vue-print-nb'
+import { getDetail } from "@/api/supply/return";
+
+export default {
+  name: 'ReturnDetail',
+  componentName: 'ReturnDetail',
+  props: ['listItem'],
+  directives: {
+    print
+  },
+  data() {
+    return {
+      printObj: {
+        id: 'printMe'
+      },
+      detailData: {},
+    }
+  },
+
+  computed: {
+    sidebar() {
+      return this.$store.state.app.sidebar
+    },
+    classObj() {
+      return {
+        hideSidebar: !this.sidebar.opened,
+        openSidebar: this.sidebar.opened
+      }
+    },
+  },
+
+  created() {
+    this.getDetail();
+  },
+
+  methods: {
+    // 返回列表
+    goBack() {
+      this.$emit('backListFormDetail');
+    },
+
+    // 获取详情
+    getDetail() {
+      getDetail({id: this.listItem.id}).then(res => {
+        this.detailData = res.data;
+      })
+    },
+  }
+}
+</script>
+
+<style scoped lang="scss">
+  .detail-container {
+    width: 100%;
+    height: 100%;
+  }
+  .print-table-1 {
+    .item {
+      display: flex;
+      .label {
+        width: 120px;
+        height: 40px;
+        display: flex;
+        align-items: center;
+        padding: 0 10px;
+        box-sizing: border-box;
+        font-size: 14px;
+        color: #333333;
+      }
+      .value {
+        flex: 1;
+        height: 40px;
+        display: flex;
+        align-items: center;
+        padding: 0 10px;
+        box-sizing: border-box;
+        font-size: 14px;
+        color: #333333;
+        input {
+          border: none;
+          padding: 0;
+        }
+      }
+    }
+  }
+</style>

+ 34 - 17
src/views/supply/pickup/statistics.vue

@@ -24,109 +24,126 @@
         <el-col :span="8">
           <el-card shadow="hover">
             <div class="title">每日预约出货单</div>
-            <div class="num"><span>123</span>(单)</div>
+            <div class="num"><span>{{detailData.pickOrderNum || 0}}</span>(单)</div>
           </el-card>
         </el-col>
         <el-col :span="8">
           <el-card shadow="hover">
             <div class="title">每日提货货品种类</div>
-            <div class="num"><span>123</span>(种)</div>
+            <div class="num"><span>{{detailData.pickCategoryNum || 0}}</span>(种)</div>
           </el-card>
         </el-col>
         <el-col :span="8">
           <el-card shadow="hover">
             <div class="title">每日预约经销商</div>
-            <div class="num"><span>123</span>(家)</div>
+            <div class="num"><span>{{detailData.pickCustomNum || 0}}</span>(家)</div>
           </el-card>
         </el-col>
         <el-col :span="8">
           <el-card shadow="hover">
             <div class="title">每日提货经销商</div>
-            <div class="num"><span>123</span>(家)</div>
+            <div class="num"><span>{{detailData.pickOrderCustomNum || 0}}</span>(家)</div>
           </el-card>
         </el-col>
         <el-col :span="8">
           <el-card shadow="hover">
             <div class="title">每日出库货品种类</div>
-            <div class="num"><span>123</span>(种)</div>
+            <div class="num"><span>{{detailData.pickCategoryNum || 0}}</span>(种)</div>
           </el-card>
         </el-col>
         <el-col :span="8">
           <el-card shadow="hover">
             <div class="title">每日出库货品台数</div>
-            <div class="num"><span>123</span>(台)</div>
+            <div class="num"><span>{{detailData.shipOrderNum || 0}}</span>(台)</div>
           </el-card>
         </el-col>
         <el-col :span="8">
           <el-card shadow="hover">
             <div class="title">每日出库家用空调货品单数</div>
-            <div class="num"><span>123</span>(单)</div>
+            <div class="num"><span>{{detailData.shipHomeConditionerNum || 0}}</span>(单)</div>
           </el-card>
         </el-col>
         <el-col :span="8">
           <el-card shadow="hover">
             <div class="title">每日出库商用空调货品单数</div>
-            <div class="num"><span>123</span>(单)</div>
+            <div class="num"><span>{{detailData.shipTradeConditionerNum || 0}}</span>(单)</div>
           </el-card>
         </el-col>
         <el-col :span="8">
           <el-card shadow="hover">
             <div class="title">每日出库生活电器品单数</div>
-            <div class="num"><span>123</span>(单)</div>
+            <div class="num"><span>{{detailData.pickLifeNum || 0}}</span>(单)</div>
           </el-card>
         </el-col>
         <el-col :span="8">
           <el-card shadow="hover">
             <div class="title">每日出库家用空调货品台数</div>
-            <div class="num"><span>123</span>(台)</div>
+            <div class="num"><span>{{detailData.shipHomeConditionerTower || 0}}</span>(台)</div>
           </el-card>
         </el-col>
         <el-col :span="8">
           <el-card shadow="hover">
             <div class="title">每日出库商用空调货品台数</div>
-            <div class="num"><span>123</span>(台)</div>
+            <div class="num"><span>{{detailData.shipTradeConditionerTower || 0}}</span>(台)</div>
           </el-card>
         </el-col>
         <el-col :span="8">
           <el-card shadow="hover">
             <div class="title">每日出库生活电器品台数</div>
-            <div class="num"><span>123</span>(台)</div>
+            <div class="num"><span>{{detailData.pickLifeTower || 0}}</span>(台)</div>
           </el-card>
         </el-col>
         <el-col :span="8">
           <el-card shadow="hover">
             <div class="title">每日出库家用空调货品金额</div>
-            <div class="num"><span>123</span>(元)</div>
+            <div class="num"><span>{{detailData.shipHomeConditionerPrice || 0}}</span>(元)</div>
           </el-card>
         </el-col>
         <el-col :span="8">
           <el-card shadow="hover">
             <div class="title">每日出库商用空调货品金额</div>
-            <div class="num"><span>123</span>(元)</div>
+            <div class="num"><span>{{detailData.shipTradeConditionerPrice || 0}}</span>(元)</div>
           </el-card>
         </el-col>
         <el-col :span="8">
           <el-card shadow="hover">
             <div class="title">每日出库生活电器品金额</div>
-            <div class="num"><span>123</span>(元)</div>
+            <div class="num"><span>{{detailData.pickLifePrice || 0}}</span>(元)</div>
           </el-card>
         </el-col>
       </el-row>
     </div>
 
-
   </div>
 </template>
 
 <script>
+import { getStatistics } from "@/api/supply/pickup";
+
 export default {
   data() {
     return {
-      screenForm: { // 筛选表单数据
+      screenForm: {
         date: '',
       },
+      detailData: {},
     }
   },
+
+  created() {
+    this.getDetail();
+  },
+
+  methods: {
+    getDetail() {
+      getStatistics({
+        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
+        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
+      }).then(res => {
+        this.detailData = res.data;
+      })
+    }
+  }
 }
 </script>
 

+ 2 - 2
src/views/supply/sales/components/sales_detail.vue

@@ -51,7 +51,7 @@
           <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="数量" prop="approvalNumber" min-width="100" 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="totalAmount" 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>
       </div>
 
@@ -66,7 +66,7 @@
           </el-col>
           <el-col :xs="12" :sm="8" :lg="8" class="item">
             <div class="label">审批结果</div>
-            <div class="value">{{detailData.status | statusFilter}}</div>
+            <div class="value">{{detailData.examineStatus | statusFilter}}</div>
           </el-col>
           <el-col :xs="12" :sm="8" :lg="8" class="item">
             <div class="label">审批时间</div>

+ 56 - 30
src/views/supply/sales/components/sales_examine.vue

@@ -9,7 +9,7 @@
       <el-row :gutter="0">
         <el-col :span="8" class="item">
           <div class="label">出库单号</div>
-          <div class="value">{{detailData.retailOrderId}}</div>
+          <div class="value">{{detailData.id}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">单据日期</div>
@@ -17,7 +17,7 @@
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">单据状态</div>
-        <div class="value">{{detailData.status | statusFilter}}</div>
+        <div class="value">{{detailData.examineStatus | statusFilter}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">仓库</div>
@@ -50,7 +50,7 @@
         <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="数量" prop="approvalNumber" min-width="100" 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="totalAmount" 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>
     </div>
 
@@ -64,13 +64,8 @@
           <div class="value">{{userName}}</div>
         </el-col>
         <el-col :span="12" class="item">
-          <div class="label">审批结果</div>
-          <div class="value">
-            <el-radio-group v-model="examineForm.status">
-              <el-radio :label="true">通过</el-radio>
-              <el-radio :label="false">驳回</el-radio>
-            </el-radio-group>
-          </div>
+          <div class="label">审批日期</div>
+          <div class="value">{{getDate()}}</div>
         </el-col>
         <el-col :span="24" class="item">
           <div class="label">审批说明</div>
@@ -83,12 +78,9 @@
     
     <div class="page-footer">
       <div class="footer" :class="classObj">
-        <el-button type="primary" @click="clickSubmitForm" :loading="formLoading">{{ formLoading ? '提交中 ...' : '提 交' }}</el-button>
-        <el-popconfirm
-          title="确定关闭吗?"
-          @onConfirm="goBack"
-          style="margin-left: 10px;"
-        >
+        <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;">
           <el-button slot="reference">关 闭</el-button>
         </el-popconfirm>
       </div>
@@ -104,13 +96,24 @@ export default {
   name: 'SalesDetail',
   componentName: 'SalesDetail',
   props: ['listItem'],
+  filters: {
+    statusFilter(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 : ''
+    }
+  },
   data() {
     return {
       userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
       detailData: {},
       formLoading: false,
       examineForm: {
-        status: true,
         remark: '',
       }
     }
@@ -133,6 +136,22 @@ export default {
   },
 
   methods: {
+    getDate() {
+      var date = new Date();
+      var seperator1 = "-";
+      var year = date.getFullYear();
+      var month = date.getMonth() + 1;
+      var strDate = date.getDate();
+      if (month >= 1 && month <= 9) {
+          month = "0" + month;
+      }
+      if (strDate >= 0 && strDate <= 9) {
+          strDate = "0" + strDate;
+      }
+      var currentdate = year + seperator1 + month + seperator1 + strDate;
+      return currentdate;
+    },
+
     // 返回列表
     goBack() {
       this.$emit('backListFormExamine');
@@ -146,19 +165,26 @@ export default {
     },
 
     // 提交审批
-    clickSubmitForm() {
-      this.formLoading = true;
-      examineData({
-        id: this.listItem.id,
-        status: this.examineForm.status ? 2 : 3,
-        approvalRemark: this.examineForm.remark,
-      }).then(res => {
-        this.$successMsg('审批成功');
-        this.goBack();
-        this.$parent.getList();
-      }).finally(res => {
-        this.formLoading = false;
-      })
+    clickSubmitForm(val) {
+      this.$confirm('此操作将审批订单, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let params = {
+          id: this.listItem.id,
+          approvalRemark: this.examineForm.remark,
+          examineStatus: val,
+        };
+        this.formLoading = true;
+        examineData(params).then(res => {
+          this.$successMsg();
+          this.goBack();
+          this.$parent.getList();
+        }).finally(res => {
+          this.formLoading = false;
+        })
+      }).catch(() => {});
     },
   }
 }

+ 3 - 3
src/views/supply/sales/sales_list.vue

@@ -85,19 +85,19 @@
             </el-table-column>
             <el-table-column align="center" label="出库单号" prop="id" min-width="180" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="发货单号" prop="orderNo" min-width="180" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="仓库" prop="correspondName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="仓库" prop="correspondName" min-width="120" show-overflow-tooltip></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="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>
             <el-table-column align="center" label="数量" prop="approvalNumber" min-width="100" 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="totalAmount" 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-column align="center" label="操作" width="120" fixed="right">
               <template slot-scope="scope">
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
-                <el-button type="text" @click="toExamine(scope.row)">审批</el-button>
+                <el-button type="text" @click="toExamine(scope.row)" v-if="scope.row.examineStatus === 'WAIT'">审批</el-button>
               </template>
             </el-table-column>
           </el-table>