update: 1.支付明细 收入明细 系统数据不可删除 2.出货批量审核优化

This commit is contained in:
admin 2024-06-07 09:35:36 +08:00
parent ebd6e37efa
commit a2eaa00117
4 changed files with 83 additions and 23 deletions

View File

@ -50,6 +50,7 @@
<u-swipe-action-item
:options="options1"
v-for="(item, index) in pageList.list"
:disabled="[1].indexOf(item.paymentType) === -1"
:key="index"
@click="handleItem(item)"
>

View File

@ -45,6 +45,7 @@
<u-swipe-action-item
:options="options1"
v-for="(item, index) in pageList.list"
:disabled="[2,3].indexOf(item.paymentType) === -1"
:key="index"
@click="handleItem(item)"
>

View File

@ -37,7 +37,12 @@
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="ScaleStatus.ShipmentPaid === currentTab ? 160 : 240"
:height="
ScaleStatus.ShipmentPaid === currentTab ||
ScaleStatus.ToBeShipmentReview === currentTab
? 160
: 240
"
:isLoading="pageList.isLoading"
>
<block v-for="(item, index) in pageList.list" :key="index">
@ -45,7 +50,6 @@
<view style="min-width: 20px"
><checkbox
v-if="
ScaleStatus.ToBeShipmentReview === currentTab ||
ScaleStatus.ToBeShipmentPay === currentTab
"
:color="'#00D2E3'"
@ -102,10 +106,7 @@
</block>
</page-view>
</view>
<view
class="btn-box"
v-if="(currentTab === 2 || currentTab === 3) && pageList.list.length > 0"
>
<view class="btn-box" v-if="currentTab === 3 && pageList.list.length > 0">
<u-button
text="全选/取消"
color="#fff"
@ -114,10 +115,21 @@
></u-button>
<u-button
type="primary"
:text="`${currentTab === 2 ? '批量审核' : '批量支付'}`"
@click="handleReviewOrPay(currentTab)"
:text="`批量支付`"
@click="handleReviewOrPay()"
></u-button>
</view>
<block>
<u-action-sheet
:actions="contrlModalParams.select.list"
:title="contrlModalParams.select.title"
:show="contrlModalParams.select.isShow"
@select="(v: any) => handleSelect1('select', v)"
@close="contrlModalParams.select.isShow = false"
:closeOnClickAction="true"
></u-action-sheet>
</block>
</template>
<script setup lang="ts">
import { ShipmentApi } from "@/services/index";
@ -125,6 +137,43 @@ import { ScaleStatus, ScaleStatusBtnType } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app";
import { onShow } from "@dcloudio/uni-app";
import PageView from "@/components/PageView/index.vue";
import type { ComType } from "@/types/global";
const contrlModalParams = reactive<ComType>({
select: {
isShow: false,
title: "标题",
list: [
{
name: "微信",
key: 3,
},
{
name: "现金",
key: 1,
},
{
name: "支付宝",
key: 4,
},
{
name: "转账",
key: 2,
},
],
},
});
const payState = reactive({
paymentMethodName: "",
paymentMethod: "",
});
const handleSelect1 = (key: string, v: any) => {
contrlModalParams.select.isShow = false;
payState.paymentMethodName = v.name;
payState.paymentMethod = v.key;
updateStatus(ScaleStatus.ShipmentPaid);
};
// scaleStatus
const pageList: PageResult<Shipment> = reactive({
isLoading: false,
@ -173,24 +222,34 @@ const handleReview = (id: string, scaleStatus: number) => {
type = ScaleStatusBtnType.ShipmentPay;
}
uni.navigateTo({
url: "/pagesShipment/review/index?id=" + id + `&scaleStatusBtnType=${type}&scaleStatus=${scaleStatus}`, //
url:
"/pagesShipment/review/index?id=" +
id +
`&scaleStatusBtnType=${type}&scaleStatus=${scaleStatus}`, //
});
};
const handleReviewOrPay = (status: number) => {
//
if (ScaleStatus.ToBeShipmentReview === status) {
updateStatus(ScaleStatus.ToBeShipmentPay);
} else if (ScaleStatus.ToBeShipmentPay === status) {
//
updateStatus(ScaleStatus.ShipmentPaid);
const handleReviewOrPay = () => {
const list = pageList.list
.filter((item) => item.isChecked)
if (list.length === 0) {
uni.showToast({ icon: "none", title: "请至少选择一个出货单" });
return;
}
//
contrlModalParams.select.isShow = true;
contrlModalParams.select.title = "结算方式";
};
const updateStatus = (status: number) => {
const list = pageList.list
.filter((item) => item.isChecked)
.map((item) => {
return { ...item, scaleStatus: status };
return {
...item,
scaleStatus: status,
paymentMethodName: payState.paymentMethodName,
paymentMethod: payState.paymentMethod,
};
});
if (list.length === 0) {
uni.showToast({ icon: "none", title: "请至少选择一个出货单" });
@ -244,16 +303,16 @@ const getList = (v?: boolean) => {
// return { ...item, isChecked: false };
// });
pageList.list = pageList.list.concat(
res.data.list.map((item: any) => {
return { ...item, isChecked: false };
})
);
res.data.list.map((item: any) => {
return { ...item, isChecked: false };
})
);
pageList.total = (res.data as any).total;
}
});
};
onShow(() => {
resetPageList()
resetPageList();
getList();
});
onLoad((option) => {

View File

@ -63,7 +63,6 @@ export const http = <T>(options: UniApp.RequestOptions) => {
quality: 80, // 压缩质量
success: (compressRes) => {
const compressedTempFilePath = compressRes.tempFilePath;
console.log('******* 压缩啦', compressedTempFilePath)
uni.uploadFile({
header: {
"x-userToken": store.profile?.token,