shish 1 rok temu
rodzic
commit
0bf3a3e386
1 zmienionych plików z 11 dodań i 23 usunięć
  1. 11 23
      ghsApp/src/admin/expend/list.vue

+ 11 - 23
ghsApp/src/admin/expend/list.vue

@@ -29,12 +29,7 @@
 				<view style="margin-top:8upx;">支付:{{item.payWay==0?'线下微信':item.payWay == 4 ? '现金':item.payWay == 1?'线下支付宝':item.payWay == 5 ? '银行卡':''}}</view>
 				<view v-if="item.bx == 0" style="margin-top:8upx;">报销:待报销</view>
 				<view v-else style="margin-top:8upx;">报销:已报销</view>
-				<button
-					@click="deleteExpend(item, index)"
-					class="expend-delete-btn"
-				>
-					删除
-				</button>
+				<button @click="delExpend(item)" class="expend-delete-btn" > 删除 </button>
 			</view>
 		</view>
 	</block>
@@ -225,25 +220,18 @@ export default {
 			}
 			this.completes(res)
 		},
-		async deleteExpend(item, index) {
+		delExpend(item) {
 			const that = this;
-			uni.showModal({
-				title: '提示',
-				content: '确认要删除?系统将会记录由谁删除',
-				success: async function (res) {
-					if (res.confirm) {
-						const result = await deleteExpend({ id: item.id, staffId: item.staffId });
-						if (result.code === 1) {
-							that.$msg('删除成功');
-							that.resetList();
-							that.init();
-						} else {
-							that.$msg(result.msg || '删除失败');
-						}
+			this.$util.confirmModal({content:'确认要删除?系统将会记录由谁删除'},() => {
+				deleteExpend({ id: item.id, staffId: item.staffId }).then(res=>{
+					if (result.code === 1) {
+						that.$msg('删除成功');
+						that.resetList();
+						that.init();
 					}
-				}
-			});
-		},
+				})
+			})
+		}
 	},
 	async onPullDownRefresh() {
 		this.resetList();