zhoux 1 жил өмнө
parent
commit
9bc869bc6c

+ 1 - 1
api/pages/sale/order.js

@@ -23,7 +23,7 @@ module.exports = {
 
   routeUrl: {
     order: {
-      docName:'销售订单',
+      docName:{key:'order' ,title:'销售订单'},
       add: { key: 'add', url: '/package-sales/pages/order-billing/add/add'},
       editOrder: { key: 'editOrder', url: '/package-sales/pages/order-billing/add/add', idKey: 'orderId', formMode: 'edit' },
       invalid: { key: 'invalid', method: 'invalid', primaryKey: 'orderId',question:true , image:'btn-void.png'},

+ 1 - 0
components/dkbase/dk-list/dk-list.wxss

@@ -87,6 +87,7 @@
 .status-detail-class {
   width: 120rpx;
   height: 40rpx;
+  line-height: 40rpx;
   text-align: center;
   font-size: 13px;
   font-weight: 600;

+ 18 - 6
mixins/index.js

@@ -356,20 +356,32 @@ module.exports = {
   printedBill(row) {
     // 查询票据
     let docName = app.globalData['routeUrl'][this.data.routeObjName].docName
-    if (!docName  || !row || !row.id) {
+    if (!docName || !row || !row.id) {
       return;
     }
+    this.setData({
+      loading: true
+    })
     let service = app.globalData['printLayoutService']
     // 查询打印票据
-    this.excute(service, service.selectByCond, { docName: docName }).then(res => {
+    this.excute(service, service.selectByCond, { docName: docName.title }).then(res => {
+      this.setData({
+        loading: false
+      })
       if (res.data.code == Constants.SUCESS_CODE) {
         let tableList = res.data.data.list;
-
         if (tableList && tableList.length > 0) {
           // 如果只有一个票据,直接调取打印
           if (tableList.length == 1) {
-            console.log('ddd', row,this.data.primaryKey,this.data.id);
-            this.print(docName, tableList[0].layoutId, row.id)
+            this.print(docName.key, tableList[0].layoutId, row.id)
+          } else {
+            // 多个跳转到票据打印页面
+            wx.navigateTo({
+              url: '/package-basic-data/pages/print-layout/print-layout',
+              success: function (res) {
+                res.eventChannel.emit('print', { data: tableList, docName: docName.key, dataId: row.id });
+              }
+            })
           }
         }
       }
@@ -384,7 +396,7 @@ module.exports = {
     wx.navigateTo({
       url: '/package-base-select/pages/web-view-select/web-view-select',
       success: function (res) {
-        res.eventChannel.emit('url', 'https://s.dev01.dkiboss.com:7000/wx-print?svc_code='+ app.globalData.company.svcCode+'&doc=' + docName + '&layout_id=' + layoutId + '&data_id=' + dataId);
+        res.eventChannel.emit('url', 'https://s.dev01.dkiboss.com:7000/wx-print?svc_code=' + app.globalData.company.svcCode + '&doc=' + docName + '&layout_id=' + layoutId + '&data_id=' + dataId);
       }
     })
   },

+ 1 - 1
package-base-select/pages/web-view-select/web-view-select.js

@@ -35,7 +35,7 @@ Page({
         var timesRun = 0;
         var interval = setInterval(function () {
           timesRun += 1;
-          if (timesRun > 20 || that.data.filePath) {
+          if (timesRun > 10 || that.data.filePath) {
             clearInterval(interval);
           } else {
             let pdf = 'pdf/' + that.data.uuid + '.pdf'

+ 35 - 2
package-basic-data/pages/print-layout/print-layout.js

@@ -8,7 +8,7 @@
 *		周兴		  	2022-11-22			        1.00		   	新建
 *******************************************************************************/
 const api = require('@/utils/api.js');
-const Constants = require('@/utils/Constants.js');
+const config = require('@/config/config.js');
 
 const app = getApp()
 Page({
@@ -18,14 +18,47 @@ Page({
     data: {
         // 加入企业的列表
         tableList: [],
+        // 业务单据ID
+        dataId:null,
+        // 单据类型
+        docName:null,
         // 语言包
         $t: app.globalData.lang,
     },
-
+    /**
+     * @desc : 调取打印
+     * @author : 周兴
+     * @date : 2024/4/22
+     */
+    print(e) {
+        let layoutId = e.currentTarget.dataset.item.layoutId;
+        let docName = this.data.docName;
+        let dataId = this.data.dataId;
+        let url = config.image_url.replace('/file','');
+        wx.navigateTo({
+            url: '/package-base-select/pages/web-view-select/web-view-select',
+            success: function (res) {
+                res.eventChannel.emit('url', url + '/wx-print?svc_code=' + app.globalData.company.svcCode + '&doc=' + docName + '&layout_id=' + layoutId + '&data_id=' + dataId);
+            }
+        })
+    },
     /**
      * 生命周期函数--监听页面加载
      */
     onLoad(options) {
+        // 接收父页面传递的参数
+        const eventChannel = this.getOpenerEventChannel();
+        if (eventChannel && JSON.stringify(eventChannel) !== '{}') {
+            let _this = this;
+            // 指定类型
+            eventChannel.once('print', function (data) {
+                _this.setData({
+                    tableList: data.data,
+                    dataId:data.dataId,
+                    docName:data.docName
+                })
+            })
+        }
     },
 
 })

+ 2 - 2
package-basic-data/pages/print-layout/print-layout.wxml

@@ -2,7 +2,7 @@
 	<view style="font-size: 26px;margin-bottom: 30rpx;padding-top: 100rpx;padding-left: 20rpx;">
 		{{$t['ticketPirnt']}}
 	</view>
-	<view wx:for="{{tableList}}" wx:key="index" data-item="{{item}}" data-index="{{index}}" catch:tap="clickCompany">
-		<van-cell  title-class="title-class" title="{{item.cpName}}" is-link />
+	<view wx:for="{{tableList}}" wx:key="index" data-item="{{item}}" data-index="{{index}}" catch:tap="print">
+		<van-cell  title-class="title-class" title="{{item.layoutName}}" is-link />
 	</view>
 </view>

+ 6 - 0
package-business-analysis/pages/detail-report/detail-report.wxml

@@ -15,3 +15,9 @@
 <!-- 显示没用更多 -->
 <van-divider wx:if="{{noMore}}" contentPosition="center" borderColor="#DCDCDC">{{$t['noMore']}}~</van-divider>
 
+<view style="position: fixed;bottom: 230rpx;right: 30rpx;" >
+  <view bind:tap="export" class="btn-add-class">
+    <van-icon name="share" color="#FFFFFF" size="60rpx" />
+  </view>
+</view>
+

+ 13 - 4
package-business-analysis/pages/detail-report/detail-report.wxss

@@ -1,4 +1,13 @@
-.van-tabs__scroll{
-    background-color: #F5F5F5 !important;
-  }
-  
+.van-tabs__scroll {
+  background-color: #F5F5F5 !important;
+}
+
+.btn-add-class {
+  background: #8091A9;
+  border-radius: 50%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  padding: 20rpx;
+  box-shadow: 0px 17px 22px 0px #1B365D33;
+}

+ 18 - 16
package-sales/pages/order-billing/detail/detail.wxml

@@ -5,19 +5,19 @@
 <view>
   <view class="tags-class">
 
-  <view style="width: 33%;text-align: right;">
-    <dk-tag fontSize="14px" border="1rpx solid #95A8CB" height="45rpx" color="transparent" textColor="#002340" radius="10rpx" roundFlag="{{true}}" size="medium" value="{{'未收款'}}"></dk-tag>
-  </view>
-  <view style="width: 33%;text-align: center;">
-    <dk-tag fontSize="14px" border="1rpx solid #95A8CB" height="45rpx" color="transparent" textColor="#002340" radius="10rpx" roundFlag="{{true}}"  size="medium" value="{{item.returnQty > 0? '有退货' : '无退货'}}"></dk-tag>
-  </view>
-  <view style="width: 34%;text-align: left;">
-    <dk-tag fontSize="14px" border="1rpx solid #95A8CB" height="45rpx" color="transparent" textColor="#002340" radius="10rpx" roundFlag="{{true}}"  size="medium" value="{{item.outStatusName ? item.outStatusName : item.outStatus}}"></dk-tag>
-  </view>
-   
-   
+    <view style="width: 33%;text-align: right;">
+      <dk-tag fontSize="14px" border="1rpx solid #95A8CB" height="45rpx" color="transparent" textColor="#002340" radius="10rpx" roundFlag="{{true}}" size="medium" value="{{'未收款'}}"></dk-tag>
+    </view>
+    <view style="width: 33%;text-align: center;">
+      <dk-tag fontSize="14px" border="1rpx solid #95A8CB" height="45rpx" color="transparent" textColor="#002340" radius="10rpx" roundFlag="{{true}}" size="medium" value="{{item.returnQty > 0? '有退货' : '无退货'}}"></dk-tag>
+    </view>
+    <view style="width: 34%;text-align: left;">
+      <dk-tag fontSize="14px" border="1rpx solid #95A8CB" height="45rpx" color="transparent" textColor="#002340" radius="10rpx" roundFlag="{{true}}" size="medium" value="{{item.outStatusName ? item.outStatusName : item.outStatus}}"></dk-tag>
+    </view>
+
+
+
 
-    
   </view>
   <view class="detail-top" data-item="{{item}}" bind:tap="toDetail">
     <image class="scan-image" fit="fill" src="{{imageUrl+'/detail_sale_order.png'}}"></image>
@@ -65,10 +65,11 @@
     <view style="display: flex;padding:10rpx;">
       <view style="background-color:#F4F9FF;width:50%;padding:10rpx;border-radius: 16rpx;">
         <view style="font-size:13px;text-align: center;margin-top: 10rpx;">订单金额</view>
-      <dk-cell left="0rpx" center="center" fontSize="13" contentFontSize="18" contentColor="#1B365D" spaceWidth="0" contentFontWeight="700" content="{{item.sumAmount}}"></dk-cell></view>
+        <dk-cell left="0rpx" center="center" fontSize="13" contentFontSize="18" contentColor="#1B365D" spaceWidth="0" contentFontWeight="700" content="{{item.sumAmount}}"></dk-cell>
+      </view>
       <view style="background-color:#F4F9FF;width: 50%;padding:10rpx;border-radius: 16rpx;margin-left: 20rpx;">
         <view style="font-size:13px;text-align: center;margin-top: 10rpx;">实收金额</view>
-      <dk-cell left="0rpx" center="center" fontSize="15" contentFontSize="18" contentColor="#1B365D" spaceWidth="0" contentFontWeight="700" content="{{item.amtHandle}}"></dk-cell>
+        <dk-cell left="0rpx" center="center" fontSize="15" contentFontSize="18" contentColor="#1B365D" spaceWidth="0" contentFontWeight="700" content="{{item.amtHandle}}"></dk-cell>
       </view>
     </view>
 
@@ -76,10 +77,11 @@
     <view style="display: flex;padding:10rpx;">
       <view style="background-color:#F4F9FF;width:50%;padding:10rpx;border-radius: 16rpx;">
         <view style="font-size:13px;text-align: center;margin-top: 10rpx;">退货金额</view>
-      <dk-cell left="0rpx" center="center" fontSize="13" contentFontSize="18" contentColor="#EA4444" spaceWidth="0" contentFontWeight="700" content="{{item.returnAmt}}"></dk-cell></view>
+        <dk-cell left="0rpx" center="center" fontSize="13" contentFontSize="18" contentColor="#EA4444" spaceWidth="0" contentFontWeight="700" content="{{item.returnAmt}}"></dk-cell>
+      </view>
       <view style="background-color:#F4F9FF;width: 50%;padding:10rpx;border-radius: 16rpx;margin-left: 20rpx;">
         <view style="font-size:13px;text-align: center;margin-top: 10rpx;">出库金额</view>
-      <dk-cell left="0rpx" center="center" fontSize="15" contentFontSize="18" contentColor="#1B365D" spaceWidth="0" contentFontWeight="700" content="{{item.outAmt}}"></dk-cell>
+        <dk-cell left="0rpx" center="center" fontSize="15" contentFontSize="18" contentColor="#1B365D" spaceWidth="0" contentFontWeight="700" content="{{item.outAmt}}"></dk-cell>
       </view>
     </view>
   </view>