update: 1.支付明细 收入明细 系统数据不可删除 2.出货批量审核优化
This commit is contained in:
parent
ebd6e37efa
commit
a2eaa00117
|
@ -50,6 +50,7 @@
|
||||||
<u-swipe-action-item
|
<u-swipe-action-item
|
||||||
:options="options1"
|
:options="options1"
|
||||||
v-for="(item, index) in pageList.list"
|
v-for="(item, index) in pageList.list"
|
||||||
|
:disabled="[1].indexOf(item.paymentType) === -1"
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="handleItem(item)"
|
@click="handleItem(item)"
|
||||||
>
|
>
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
<u-swipe-action-item
|
<u-swipe-action-item
|
||||||
:options="options1"
|
:options="options1"
|
||||||
v-for="(item, index) in pageList.list"
|
v-for="(item, index) in pageList.list"
|
||||||
|
:disabled="[2,3].indexOf(item.paymentType) === -1"
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="handleItem(item)"
|
@click="handleItem(item)"
|
||||||
>
|
>
|
||||||
|
|
|
@ -37,7 +37,12 @@
|
||||||
"
|
"
|
||||||
:noMoreData="pageList.noMoreData"
|
:noMoreData="pageList.noMoreData"
|
||||||
:list="pageList.list"
|
:list="pageList.list"
|
||||||
:height="ScaleStatus.ShipmentPaid === currentTab ? 160 : 240"
|
:height="
|
||||||
|
ScaleStatus.ShipmentPaid === currentTab ||
|
||||||
|
ScaleStatus.ToBeShipmentReview === currentTab
|
||||||
|
? 160
|
||||||
|
: 240
|
||||||
|
"
|
||||||
:isLoading="pageList.isLoading"
|
:isLoading="pageList.isLoading"
|
||||||
>
|
>
|
||||||
<block v-for="(item, index) in pageList.list" :key="index">
|
<block v-for="(item, index) in pageList.list" :key="index">
|
||||||
|
@ -45,7 +50,6 @@
|
||||||
<view style="min-width: 20px"
|
<view style="min-width: 20px"
|
||||||
><checkbox
|
><checkbox
|
||||||
v-if="
|
v-if="
|
||||||
ScaleStatus.ToBeShipmentReview === currentTab ||
|
|
||||||
ScaleStatus.ToBeShipmentPay === currentTab
|
ScaleStatus.ToBeShipmentPay === currentTab
|
||||||
"
|
"
|
||||||
:color="'#00D2E3'"
|
:color="'#00D2E3'"
|
||||||
|
@ -102,10 +106,7 @@
|
||||||
</block>
|
</block>
|
||||||
</page-view>
|
</page-view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="btn-box" v-if="currentTab === 3 && pageList.list.length > 0">
|
||||||
class="btn-box"
|
|
||||||
v-if="(currentTab === 2 || currentTab === 3) && pageList.list.length > 0"
|
|
||||||
>
|
|
||||||
<u-button
|
<u-button
|
||||||
text="全选/取消"
|
text="全选/取消"
|
||||||
color="#fff"
|
color="#fff"
|
||||||
|
@ -114,10 +115,21 @@
|
||||||
></u-button>
|
></u-button>
|
||||||
<u-button
|
<u-button
|
||||||
type="primary"
|
type="primary"
|
||||||
:text="`${currentTab === 2 ? '批量审核' : '批量支付'}`"
|
:text="`批量支付`"
|
||||||
@click="handleReviewOrPay(currentTab)"
|
@click="handleReviewOrPay()"
|
||||||
></u-button>
|
></u-button>
|
||||||
</view>
|
</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>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ShipmentApi } from "@/services/index";
|
import { ShipmentApi } from "@/services/index";
|
||||||
|
@ -125,6 +137,43 @@ import { ScaleStatus, ScaleStatusBtnType } from "@/utils/enum";
|
||||||
import { onLoad } from "@dcloudio/uni-app";
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
import { onShow } from "@dcloudio/uni-app";
|
import { onShow } from "@dcloudio/uni-app";
|
||||||
import PageView from "@/components/PageView/index.vue";
|
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
|
// scaleStatus
|
||||||
const pageList: PageResult<Shipment> = reactive({
|
const pageList: PageResult<Shipment> = reactive({
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
|
@ -173,24 +222,34 @@ const handleReview = (id: string, scaleStatus: number) => {
|
||||||
type = ScaleStatusBtnType.ShipmentPay;
|
type = ScaleStatusBtnType.ShipmentPay;
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
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) => {
|
const handleReviewOrPay = () => {
|
||||||
// 批量审核
|
const list = pageList.list
|
||||||
if (ScaleStatus.ToBeShipmentReview === status) {
|
.filter((item) => item.isChecked)
|
||||||
updateStatus(ScaleStatus.ToBeShipmentPay);
|
if (list.length === 0) {
|
||||||
} else if (ScaleStatus.ToBeShipmentPay === status) {
|
uni.showToast({ icon: "none", title: "请至少选择一个出货单" });
|
||||||
// 批量支付
|
return;
|
||||||
updateStatus(ScaleStatus.ShipmentPaid);
|
|
||||||
}
|
}
|
||||||
|
// 批量支付
|
||||||
|
contrlModalParams.select.isShow = true;
|
||||||
|
contrlModalParams.select.title = "结算方式";
|
||||||
};
|
};
|
||||||
const updateStatus = (status: number) => {
|
const updateStatus = (status: number) => {
|
||||||
const list = pageList.list
|
const list = pageList.list
|
||||||
.filter((item) => item.isChecked)
|
.filter((item) => item.isChecked)
|
||||||
.map((item) => {
|
.map((item) => {
|
||||||
return { ...item, scaleStatus: status };
|
return {
|
||||||
|
...item,
|
||||||
|
scaleStatus: status,
|
||||||
|
paymentMethodName: payState.paymentMethodName,
|
||||||
|
paymentMethod: payState.paymentMethod,
|
||||||
|
};
|
||||||
});
|
});
|
||||||
if (list.length === 0) {
|
if (list.length === 0) {
|
||||||
uni.showToast({ icon: "none", title: "请至少选择一个出货单" });
|
uni.showToast({ icon: "none", title: "请至少选择一个出货单" });
|
||||||
|
@ -244,16 +303,16 @@ const getList = (v?: boolean) => {
|
||||||
// return { ...item, isChecked: false };
|
// return { ...item, isChecked: false };
|
||||||
// });
|
// });
|
||||||
pageList.list = pageList.list.concat(
|
pageList.list = pageList.list.concat(
|
||||||
res.data.list.map((item: any) => {
|
res.data.list.map((item: any) => {
|
||||||
return { ...item, isChecked: false };
|
return { ...item, isChecked: false };
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
pageList.total = (res.data as any).total;
|
pageList.total = (res.data as any).total;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
resetPageList()
|
resetPageList();
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
onLoad((option) => {
|
onLoad((option) => {
|
||||||
|
|
|
@ -63,7 +63,6 @@ export const http = <T>(options: UniApp.RequestOptions) => {
|
||||||
quality: 80, // 压缩质量
|
quality: 80, // 压缩质量
|
||||||
success: (compressRes) => {
|
success: (compressRes) => {
|
||||||
const compressedTempFilePath = compressRes.tempFilePath;
|
const compressedTempFilePath = compressRes.tempFilePath;
|
||||||
console.log('******* 压缩啦', compressedTempFilePath)
|
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
header: {
|
header: {
|
||||||
"x-userToken": store.profile?.token,
|
"x-userToken": store.profile?.token,
|
||||||
|
|
Loading…
Reference in New Issue