Explorar el Código

Merge branch 'feature/Feature-return' into develop

莫绍宝 hace 3 años
padre
commit
8ad095641c

+ 32 - 19
src/views/supply/deliver/components/commerce_detail.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="detail-container">
-    <el-page-header @back="goBack" content="详情"></el-page-header>
+    <div v-show="!isShowPrint">
+      <el-page-header @back="goBack" content="详情"></el-page-header>
 
-    <div id="printMe">
       <div class="main-title">
         <div class="title">发货单信息</div>
       </div>
@@ -112,7 +112,7 @@
       </div>
       <div class="table">
         <el-table
-          :data="detailData.shipDocumentOrders" 
+          :data="detailData.invoicePickBeans" 
           element-loading-text="Loading" 
           border 
           fit 
@@ -164,30 +164,32 @@
         </el-table>
       </div>
 
-    </div>
-    
-    <div class="page-footer">
-      <div class="footer">
-        <!-- <el-button  type="primary" icon="el-icon-printer" v-print="printObj">打 印</el-button> -->
-        <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
-          <el-button slot="reference">关 闭</el-button>
-        </el-popconfirm>
+      <div class="page-footer">
+        <div class="footer">
+          <el-button  type="primary" icon="el-icon-printer" @click="toPrint">打 印</el-button>
+          <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
+            <el-button slot="reference">关 闭</el-button>
+          </el-popconfirm>
+        </div>
       </div>
+
     </div>
 
+    <CommonPrint :printId="printId" :printType="printType" v-if="isShowPrint" @backDetail="backDetail" />
+
   </div>
 </template>
 
 <script>
-import print from 'vue-print-nb'
 import { getEnginDetail } from "@/api/supply/deliver";
+import CommonPrint from "@/views/supply/deliver/components/common_print";
 
 export default {
   name: 'commerceDetail',
   componentName: 'commerceDetail',
   props: ['listItem'],
-  directives: {
-    print
+  components: {
+    CommonPrint,
   },
   filters: {
     statusFilter(val) {
@@ -217,10 +219,10 @@ export default {
   },
   data() {
     return {
-      printObj: {
-        id: 'printMe'
-      },
       detailData: {},
+      printType: 2,
+      printId: '',
+      isShowPrint: false,
     }
   },
 
@@ -237,8 +239,8 @@ export default {
     // 获取详情
     getDetail() {
       getEnginDetail({id: this.listItem.id}).then(res => {
-        if(res.data.shipDocumentOrders) {
-          res.data.shipDocumentOrders.forEach(item => {
+        if(res.data.invoicePickBeans) {
+          res.data.invoicePickBeans.forEach(item => {
             item.notOutNumber = item.salesStatus ? 0 : item.refundableQty;
             item.sums1 = ['notOutNumber', 'refundableQty'];
             item.sums2 = ['price', 'afterTaxPrice', 'payAmount', 'totalDiscAmount', 'singlePayPrice'];
@@ -248,6 +250,17 @@ export default {
       })
     },
 
+    // 点击打印
+    toPrint() {
+      this.printId = this.listItem.id;
+      this.isShowPrint = true;
+    },
+
+    backDetail() {
+      this.printId = '';
+      this.isShowPrint = false;
+    },
+
   }
 }
 </script>

+ 120 - 0
src/views/supply/deliver/components/common_print.vue

@@ -0,0 +1,120 @@
+<template>
+  <div class="detail-container">
+    <div class="top-container">
+      <el-radio-group v-model="currentType" size="medium" @change="changeType()">
+        <el-radio-button v-for="(item, index) in typeList" :key="index" :label="item.value">{{item.label}}</el-radio-button>
+      </el-radio-group>
+    </div>
+
+    <div id="printMe">
+      
+      <PrintFoshan :detailData="detailData" :company="company" v-if="currentType === 1" />
+      <PrintGuangzhou :detailData="detailData" :company="company" v-if="currentType === 2" />
+      <PrintShaoguan :detailData="detailData" :company="company" v-if="currentType === 3" />
+
+    </div>
+    
+    <div class="page-footer">
+      <div class="footer">
+        <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 { getDeliverDetail, getEnginDetail } from "@/api/supply/deliver";
+import { addPrint } from "@/api/supply/pickup";
+import { getCompanyList } from "@/api/user";
+import PrintFoshan from "@/components/Common/print-foshan";
+import PrintGuangzhou from "@/components/Common/print-guangzhou";
+import PrintShaoguan from "@/components/Common/print-shaoguan";
+
+export default {
+  name: 'ReturnDetail',
+  componentName: 'ReturnDetail',
+  props: ['printId', 'printType'],
+  components: {
+    PrintFoshan,
+    PrintGuangzhou,
+    PrintShaoguan,
+  },
+  directives: {
+    print
+  },
+  data() {
+    return {
+      currentType: 1,
+      typeList: [
+        { label: '佛山', value: 1 },
+        { label: '广州', value: 2 },
+        { label: '韶关', value: 3 },
+      ],
+      printObj: {
+        id: 'printMe',
+        closeCallback: () => {
+          this.addPrint();
+        }
+      },
+      detailData: {},
+      company: '',
+    }
+  },
+
+  created() {
+    this.getDetail();
+    this.getCompanyList();
+  },
+
+  methods: {
+    // 返回列表
+    goBack() {
+      this.$emit('backDetail');
+    },
+
+    changeType() {
+
+    },
+
+    // 获取详情
+    getDetail() {
+      if(this.printType === 1) {
+        getDeliverDetail({id: this.printId}).then(res => {
+          this.detailData = res.data;
+        })
+      }else {
+        getEnginDetail({id: this.printId}).then(res => {
+          this.detailData = res.data;
+        })
+      }
+    },
+
+    getCompanyList() {
+      getCompanyList().then(res => {
+        this.company = res.data ? res.data[0].companyName : '';
+      })
+    },
+
+    // 添加次数
+    addPrint() {
+      addPrint({ids: this.printId}).then(res => {
+        // this.$successMsg('提交成功');
+        this.$parent.getList();
+      })
+    }
+  }
+}
+</script>
+
+<style scoped lang="scss">
+  .detail-container {
+    width: 100%;
+    height: 100%;
+  }
+  .top-container {
+    margin-bottom: 20px;
+  }
+</style>

+ 32 - 30
src/views/supply/deliver/components/deliver_detail.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="detail-container">
-    <el-page-header @back="goBack" content="详情"></el-page-header>
+    <div v-show="!isShowPrint">
+      <el-page-header @back="goBack" content="详情"></el-page-header>
 
-    <div id="printMe">
       <div class="main-title">
         <div class="title">发货单信息</div>
       </div>
@@ -112,7 +112,7 @@
       </div>
       <div class="table">
         <el-table
-          :data="detailData.shipDocumentOrders" 
+          :data="detailData.invoicePickBeans" 
           element-loading-text="Loading" 
           border 
           fit 
@@ -165,30 +165,33 @@
         </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-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
-          <el-button slot="reference">关 闭</el-button>
-        </el-popconfirm>
+      <div class="page-footer">
+        <div class="footer">
+          <el-button  type="primary" icon="el-icon-printer" @click="toPrint">打 印</el-button>
+          <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
+            <el-button slot="reference">关 闭</el-button>
+          </el-popconfirm>
+        </div>
       </div>
+
     </div>
 
+    <CommonPrint :printId="printId" :printType="printType" v-if="isShowPrint" @backDetail="backDetail" />
+
   </div>
 </template>
 
 <script>
-import print from 'vue-print-nb'
 import { getDeliverDetail } from "@/api/supply/deliver";
+import CommonPrint from "@/views/supply/deliver/components/common_print";
 
 export default {
   name: 'DeliverDetail',
   componentName: 'DeliverDetail',
   props: ['listItem'],
-  directives: {
-    print
+  components: {
+    CommonPrint,
   },
   filters: {
     statusFilter(val) {
@@ -218,25 +221,13 @@ export default {
   },
   data() {
     return {
-      printObj: {
-        id: 'printMe'
-      },
       detailData: {},
+      printType: 1,
+      printId: '',
+      isShowPrint: false,
     }
   },
 
-  computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
-  },
-
   created() {
     this.getDetail();
   },
@@ -250,8 +241,8 @@ export default {
     // 获取详情
     getDetail() {
       getDeliverDetail({id: this.listItem.id}).then(res => {
-        if(res.data.shipDocumentOrders) {
-          res.data.shipDocumentOrders.forEach(item => {
+        if(res.data.invoicePickBeans) {
+          res.data.invoicePickBeans.forEach(item => {
             item.notOutNumber = item.salesStatus ? 0 : item.refundableQty;
             item.sums1 = ['notOutNumber', 'refundableQty'];
             item.sums2 = ['price', 'afterTaxPrice', 'payAmount', 'totalDiscAmount', 'singlePayPrice'];
@@ -261,6 +252,17 @@ export default {
       })
     },
 
+    // 点击打印
+    toPrint() {
+      this.printId = this.listItem.id;
+      this.isShowPrint = true;
+    },
+
+    backDetail() {
+      this.printId = '';
+      this.isShowPrint = false;
+    },
+
   }
 }
 </script>

+ 32 - 19
src/views/supply/deliver/components/home_detail.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="detail-container">
-    <el-page-header @back="goBack" content="详情"></el-page-header>
+    <div v-show="!isShowPrint">
+      <el-page-header @back="goBack" content="详情"></el-page-header>
 
-    <div id="printMe">
       <div class="main-title">
         <div class="title">发货单信息</div>
       </div>
@@ -112,7 +112,7 @@
       </div>
       <div class="table">
         <el-table
-          :data="detailData.shipDocumentOrders" 
+          :data="detailData.invoicePickBeans" 
           element-loading-text="Loading" 
           border 
           fit 
@@ -165,30 +165,32 @@
         </el-table>
       </div>
 
-    </div>
-    
-    <div class="page-footer">
-      <div class="footer">
-        <!-- <el-button  type="primary" icon="el-icon-printer" v-print="printObj">打 印</el-button> -->
-        <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
-          <el-button slot="reference">关 闭</el-button>
-        </el-popconfirm>
+      <div class="page-footer">
+        <div class="footer">
+          <el-button  type="primary" icon="el-icon-printer" @click="toPrint">打 印</el-button>
+          <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
+            <el-button slot="reference">关 闭</el-button>
+          </el-popconfirm>
+        </div>
       </div>
+
     </div>
 
+    <CommonPrint :printId="printId" :printType="printType" v-if="isShowPrint" @backDetail="backDetail" />
+
   </div>
 </template>
 
 <script>
-import print from 'vue-print-nb'
 import { getEnginDetail } from "@/api/supply/deliver";
+import CommonPrint from "@/views/supply/deliver/components/common_print";
 
 export default {
   name: 'HomeDetail',
   componentName: 'HomeDetail',
   props: ['listItem'],
-  directives: {
-    print
+  components: {
+    CommonPrint,
   },
   filters: {
     statusFilter(val) {
@@ -218,10 +220,10 @@ export default {
   },
   data() {
     return {
-      printObj: {
-        id: 'printMe'
-      },
       detailData: {},
+      printType: 2,
+      printId: '',
+      isShowPrint: false,
     }
   },
 
@@ -238,8 +240,8 @@ export default {
     // 获取详情
     getDetail() {
       getEnginDetail({id: this.listItem.id}).then(res => {
-        if(res.data.shipDocumentOrders) {
-          res.data.shipDocumentOrders.forEach(item => {
+        if(res.data.invoicePickBeans) {
+          res.data.invoicePickBeans.forEach(item => {
             item.notOutNumber = item.salesStatus ? 0 : item.refundableQty;
             item.sums1 = ['notOutNumber', 'refundableQty'];
             item.sums2 = ['price', 'afterTaxPrice', 'payAmount', 'totalDiscAmount', 'singlePayPrice'];
@@ -249,6 +251,17 @@ export default {
       })
     },
 
+    // 点击打印
+    toPrint() {
+      this.printId = this.listItem.id;
+      this.isShowPrint = true;
+    },
+
+    backDetail() {
+      this.printId = '';
+      this.isShowPrint = false;
+    },
+
   }
 }
 </script>

+ 0 - 1
src/views/supply/sales/components/sales_detail.vue

@@ -59,7 +59,6 @@
               {{ (scope.row.orderType == 'TRADE' || scope.row.orderType == 'HOME') ? scope.row.enginOrderNo : scope.row.mainOrderId }}
             </template>
           </el-table-column>
-          <el-table-column align="center" label="金蝶出库单号" prop="kingBillNo" min-width="180" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>

+ 0 - 1
src/views/supply/sales/components/sales_examine.vue

@@ -53,7 +53,6 @@
         show-summary
         :summary-method="$getSummaries">
         <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-        <el-table-column align="center" label="金蝶出库单号" prop="kingBillNo" min-width="180" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>