Browse Source

发票列表修改

zhaoxiaohai 2 years ago
parent
commit
184a9aaf45

+ 13 - 13
packageA/invoice/modules/InvoiceList/index.js

@@ -1,11 +1,14 @@
 const _Http = getApp().globalData.http;
 Component({
     properties: {
-        disabled: Boolean
+        disabled: Boolean,
+        apiId: {
+            type: Number,
+            value: 20221223153403
+        }
     },
     data: {
         show: false,
-        sa_invoiceapplyid: 0,
         "content": {
             nocache: true,
             pageNumber: 1,
@@ -19,31 +22,27 @@ Component({
         getList(id, init) {
             let content = this.data.content;
             content.sa_invoiceapplyid = id;
+            content.sa_orderid = id;
             if (init) content.pageNumber = 1;
             _Http.basic({
-                "id": "20221223153403",
+                id: this.data.apiId,
                 content
             }).then(res => {
                 console.log("发票列表", res)
                 if (res.msg != '成功') return wx.showToast({
                     title: res.msg,
                     icon: "none"
-                })
-                /* res.data = res.data.map(value => {
-                  if (value.attinfos.length != 0) {
-                    value.attinfos = file.fileList(value.attinfos)
-                    let image = value.attinfos.find(v => v.fileType == "image");
-                    value.cover = image ? image.cover : "";
-                  }
-                  return value;
-                }) */
+                });
+               /*  res.data[0].paperpdfurl = "https://yostest2.obs.cn-east-2.myhuaweicloud.com:443/202302211676966719291B15c18260.pdf";
+                res.data[0].pdfurl = "https://yostest2.obs.cn-east-2.myhuaweicloud.com:443/202302211676966719291B15c18260.pdf"; */
                 this.setData({
                     list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
                     "content.pageNumber": res.pageNumber + 1,
                     "content.pageSize": res.pageSize,
                     "content.pageTotal": res.pageTotal,
                     "content.total": res.total,
-                    sa_invoiceapplyid: id
+                    sa_invoiceapplyid: id,
+                    sa_orderid: id
                 })
             })
         },
@@ -93,6 +92,7 @@ Component({
                     const filePath = res.tempFilePath
                     wx.openDocument({
                         filePath: filePath,
+                        showMenu: true,
                         complete(res) {
                             console.log("打开文档", res)
                             wx.hideLoading()

+ 3 - 1
packageA/invoice/modules/InvoiceList/index.json

@@ -1,4 +1,6 @@
 {
   "component": true,
-  "usingComponents": {}
+  "usingComponents": {
+    "van-tag": "@vant/weapp/tag/index"
+  }
 }

+ 16 - 0
packageA/invoice/modules/InvoiceList/index.scss

@@ -6,6 +6,7 @@
 }
 
 .item {
+	position: relative;
 	width: 100vw;
 	display: flex;
 	background-color: #ffffff;
@@ -13,6 +14,21 @@
 	box-sizing: border-box;
 	margin-bottom: 20rpx;
 
+	.abs {
+		position: absolute;
+		right: 30rpx;
+		font-size: 36rpx;
+		font-weight: bold;
+	}
+
+	.but {
+		position: absolute !important;
+		right: 30rpx;
+		top: 120rpx;
+		border-radius: 16rpx;
+		padding: 15rpx !important;
+	}
+
 	.dec {
 		flex: 1;
 		width: 0;

+ 6 - 12
packageA/invoice/modules/InvoiceList/index.wxml

@@ -2,26 +2,20 @@
 	<view class="count">发票清单</view>
 </view>
 
-<navigator url="#" class="item" wx:for="{{list}}" wx:key="index" data-item="{{item}}" bindtap="previewpdf">
+<view url="#" class="item" wx:for="{{list}}" wx:key="index">
+	<van-tag class="abs" wx:if="{{item.rb==1}}" type="primary">蓝</van-tag>
+	<van-tag class="abs" wx:else type="danger">红</van-tag>
+	<van-button custom-class="but" type="default" plain wx:if="{{item.pdfurl ||item.paperpdfurl}}" data-item="{{item}}" bindtap="previewpdf">查看发票</van-button>
 	<view class="dec">
 		<view class="title line-1">
 			发票ID:{{item.sa_invoiceapplyid}}
 		</view>
-		<view class="subfield">
-			红蓝字:{{item.rb==1?'蓝':'红'}}
-		</view>
 		<view class="subfield">
 			发票流水号:{{item.invoiceserialnum||" --"}}
 		</view>
 		<view class="subfield">
 			开票金额:{{item.sumtaxincludedamount}}元
 		</view>
-		<view class="subfield">
-			发票代码:{{item.invoicecode||" --"}}
-		</view>
-		<view class="subfield">
-			发票号码:{{item.invoiceno||" --"}}
-		</view>
 		<view class="subfield">
 			发票状态:{{item.status||" --"}}
 		</view>
@@ -29,10 +23,10 @@
 			备注:{{item.remarks||" --"}}
 		</view>
 	</view>
-</navigator>
+</view>
 <block wx:if="{{list.length==0}}">
 	<Yl_Empty />
 	<view style="height: 150rpx;" />
 </block>
 
-<van-action-sheet show="{{ show }}" actions="{{ actions }}" z-index="99999999" cancel-text="取消" bind:close="onClose" bind:select="onSelect" bind:click-overlay='onClose' />
+<van-action-sheet show="{{ show }}" actions="{{ actions }}" z-index="99999999" cancel-text="取消" bind:cancel="onClose" bind:select="onSelect" bind:click-overlay='onClose' />