|
|
@@ -12,7 +12,7 @@
|
|
|
</view>
|
|
|
<block v-if="!$util.isEmpty(list.data)">
|
|
|
<view v-for="(item, index) in list.data" :key="index">
|
|
|
- <view style="background-color: white;margin-bottom:15upx;padding:18upx 0 18upx 30upx;font-size:28upx;">
|
|
|
+ <view style="background-color: white;margin-bottom:15upx;padding:18upx 0 18upx 30upx;font-size:28upx;position:relative;">
|
|
|
<view style="font-weight:bold;font-size:32upx;">
|
|
|
<text>{{item.typeName}}</text>
|
|
|
<text style="margin-left:20upx;">¥{{item.amount?parseFloat(item.amount):0}}</text>
|
|
|
@@ -29,6 +29,12 @@
|
|
|
<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>
|
|
|
</view>
|
|
|
</view>
|
|
|
</block>
|
|
|
@@ -68,7 +74,7 @@
|
|
|
|
|
|
<script>
|
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
-import { getExpendList,getTypeList,changePayTime } from '@/api/expend'
|
|
|
+import { getExpendList,getTypeList,changePayTime,deleteExpend } from '@/api/expend'
|
|
|
import list from '@/mixins/list'
|
|
|
import { getAllStaff } from "@/api/shop-admin"
|
|
|
import DateSelect from "@/components/module/dateSelect"
|
|
|
@@ -218,7 +224,26 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
this.completes(res)
|
|
|
- }
|
|
|
+ },
|
|
|
+ async deleteExpend(item, index) {
|
|
|
+ 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 || '删除失败');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
async onPullDownRefresh() {
|
|
|
this.resetList();
|
|
|
@@ -243,4 +268,18 @@ export default {
|
|
|
.class-popup-style{
|
|
|
z-index:99999;
|
|
|
}
|
|
|
+.expend-delete-btn {
|
|
|
+ position: absolute;
|
|
|
+ right: 30upx;
|
|
|
+ top: 80%;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ width: 120upx;
|
|
|
+ height: 60upx;
|
|
|
+ background: #fff;
|
|
|
+ border: 2upx solid #ccc;
|
|
|
+ border-radius: 16upx;
|
|
|
+ color: #ac2929;
|
|
|
+ font-size: 30upx;
|
|
|
+ line-height: 56rpx;
|
|
|
+}
|
|
|
</style>
|