Procházet zdrojové kódy

发票撤回功能

zhengkaixin před 11 měsíci
rodič
revize
c9fa3aaad7

+ 11 - 1
apis/pagejs/invoiceApi.js

@@ -71,4 +71,14 @@ export function saveInvoiceByRecordIds(data) {
 		data: data,
 		url: url
 	})
-}
+}
+
+
+export function deleteInvoice(data) {
+	var url = '/mobile/invoiceApi/deleteInvoice';
+	return request({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}

+ 52 - 1
pages/invoiceManagement/invoiceManagement.vue

@@ -59,7 +59,7 @@
 		<!-- 已开发票 -->
 		<view class="invoiced" v-if="current==1">
 			<view class="invoice-item" v-for="(item,i) in list2"
-			 @click="gotoUrl('/pages/invoiceManagement/invoiceDetails?id='+item.id)"
+			@click="btn1(item,0)"
 			 :key="i"  >
 				
 				<view class="infos">
@@ -111,6 +111,16 @@
 							{{item.createTime}}		
 						</view>
 					</view>
+					<view class="item"  v-if="!item.image"
+					style="    justify-content: space-around;">
+						<view class="btn" >
+							<u-button @tap.stop="btn1(item,1)" type="primary">查看</u-button>
+							</view>
+							<view class="btn btn2" >
+								<u-button  @tap.stop="btn2(item)" >撤回</u-button>
+							</view>
+					</view>
+					
 				</view>
 			</view>
 			<!-- <view class="invoice-item"  >
@@ -259,6 +269,46 @@
 			}
 		},
 		methods: {
+			btn1(item,bl){
+				if(bl||item.image){
+					this.gotoUrl('/pages/invoiceManagement/invoiceDetails?id='+item.id)
+					
+				}
+			},
+			btn2(item){
+				debugger
+				uni.showModal({
+					
+					confirmText:`撤回`,
+				content: `确认是否要撤回当前发票申请`,
+					title: "提示",
+					success:res=> {
+						if(res.confirm){
+							this.switchBtnApiMethod(item);
+						}
+					}
+				})
+			},
+			switchBtnApiMethod(node){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.deleteInvoice({
+					id:node.id,
+					
+				}).then((res) => {
+					uni.hideLoading();
+					this.init()
+					
+				}).catch(error => {
+					
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 			ifOrSelectAll(){
 				
 				for(var i in this.list1){
@@ -545,6 +595,7 @@
 				.state{
 					color: rgba(255,61,0,1);
 					font-size: 36rpx;
+					white-space: pre;
 				}
 				.state2{
 					color: rgba(0,185,98,1);

+ 1 - 1
pages/mine/electronicMonitoring.vue

@@ -618,7 +618,7 @@
 					}
 				}
 				
-				if(data1.length<8){
+				if(data1.length<4){
 					
 					axisLabel={
 					

+ 1 - 1
pages/remoteControl/operationLog.vue

@@ -39,7 +39,7 @@
 						来自 {{item.typeN}}
 					</view>
 				</view>
-				<view class="else" style="margin-top: 4rpx;">
+				<view class="else" style="margin-top: 4rpx;text-align: start;">
 					<view class="from">
 						备注:{{item.remark}}
 					</view>