Browse Source

bug 修复

lilei 2 năm trước cách đây
mục cha
commit
3c889f4283
3 tập tin đã thay đổi với 60 bổ sung2 xóa
  1. 20 0
      src/api/pickUp.js
  2. 39 1
      src/views/salesReturnManagement/billOfLading/detail.vue
  3. 1 1
      vue.config.js

+ 20 - 0
src/api/pickUp.js

@@ -74,4 +74,24 @@ export const pickUpDetailQueryList = (params) => {
     data: params,
     method: 'post'
   })
+}
+
+// 导出
+export const pickUpExport = (params) => {
+  return axios({
+    url: '/pickUp/excel',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 打印
+export const pickUpDetailPrint = params => {
+  const url = `/pickUp/print`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
 }

+ 39 - 1
src/views/salesReturnManagement/billOfLading/detail.vue

@@ -6,6 +6,28 @@
         <template slot="subTitle">
           <a id="billOfLadingDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
         </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra">
+          <a-button
+            key="3"
+            type="default"
+            class="button-info"
+            id="billOfLadingDetail-preview-btn"
+            @click="handlePrint('preview')">打印预览</a-button>
+          <a-button
+            key="2"
+            type="primary"
+            class="button-info"
+            id="billOfLadingDetail-print-btn"
+            @click="handlePrint('print')">快捷打印</a-button>
+          <a-divider type="vertical" />
+          <a-button
+            key="1"
+            type="primary"
+            class="button-warning"
+            id="billOfLadingDetail-export-btn"
+            @click="handlePrint('export')">导出Excel</a-button>
+        </template>
       </a-page-header>
       <a-form-model
         ref="ruleForm"
@@ -117,7 +139,8 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect, Upload } from '@/components'
-import { pickUpDetail, pickUpDetailQueryList } from '@/api/pickUp'
+import { printFun, exportExcel } from '@/libs/JGPrint.js'
+import { pickUpDetail, pickUpDetailQueryList, pickUpExport, pickUpDetailPrint } from '@/api/pickUp'
 import { getProcessInstance } from '@/api/expenseManagement'
 export default {
   name: 'ProductInfoEdit',
@@ -191,6 +214,21 @@ export default {
     }
   },
   methods: {
+    // 打印预览/快捷打印
+    handlePrint (type) {
+      const _this = this
+      const params = { pickUpSn: this.$route.params.sn }
+      _this.spinning = true
+      // 导出
+      if (type == 'export') {
+        exportExcel(pickUpExport, params, '提货单', function () {
+          _this.spinning = false
+        })
+      } else {
+        // 打印或预览
+        printFun(pickUpDetailPrint, params, type, '提货单', () => { _this.spinning = false })
+      }
+    },
     // 关联销售退货单
     getReturnOrderList () {
       pickUpDetailQueryList({ pickUpSn: this.$route.params.sn }).then(res => {

+ 1 - 1
vue.config.js

@@ -107,7 +107,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.0.215:8602/ocs-admin',
+        target: 'http://192.168.0.183:8602/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  Á·Ï°
         // target: 'http://p.ocs.360arrow.com/ocs-admin', //  Ô¤·¢²¼
         ws: false,