update: 更新出货明细
This commit is contained in:
parent
c13e89055d
commit
5262b3e78f
|
@ -7,65 +7,103 @@
|
|||
@close="handleClose"
|
||||
>
|
||||
<view class="box">
|
||||
<u-cell-group :border="false">
|
||||
<u-cell
|
||||
v-for="(item, index) in formAttrList"
|
||||
:key="index"
|
||||
:title="item.name"
|
||||
:titleStyle="{
|
||||
fontSize: '26rpx',
|
||||
color: 'rgba(0, 0, 0, 1)',
|
||||
fontWeight: 'bold',
|
||||
}"
|
||||
isLink
|
||||
@click="item.fn"
|
||||
:value="getValue(item.name)"
|
||||
></u-cell>
|
||||
</u-cell-group>
|
||||
<view class="title">收货单类型</view>
|
||||
<view class="btn-box">
|
||||
<view v-for="(item, index) in splBtnList" :key="index">
|
||||
<u-button
|
||||
:text="item.name"
|
||||
plain
|
||||
shape="circle"
|
||||
type="info"
|
||||
size="small"
|
||||
:customStyle="
|
||||
item.key === currentSpl
|
||||
? { border: '1px solid #00dcee', color: '#00dcee' }
|
||||
: ''
|
||||
"
|
||||
@click="currentSpl = item.key"
|
||||
|
||||
></u-button>
|
||||
<view v-if="!isShipment">
|
||||
<u-cell-group :border="false">
|
||||
<u-cell
|
||||
v-for="(item, index) in formAttrList"
|
||||
:key="index"
|
||||
:title="item.name"
|
||||
:titleStyle="{
|
||||
fontSize: '26rpx',
|
||||
color: 'rgba(0, 0, 0, 1)',
|
||||
fontWeight: 'bold',
|
||||
}"
|
||||
isLink
|
||||
@click="item.fn"
|
||||
:value="getValue(item.name)"
|
||||
></u-cell>
|
||||
</u-cell-group>
|
||||
<view class="title">收货单类型</view>
|
||||
<view class="btn-box">
|
||||
<view v-for="(item, index) in splBtnList" :key="index">
|
||||
<u-button
|
||||
:text="item.name"
|
||||
plain
|
||||
shape="circle"
|
||||
type="info"
|
||||
size="small"
|
||||
:customStyle="
|
||||
item.key === currentSpl
|
||||
? { border: '1px solid #00dcee', color: '#00dcee' }
|
||||
: ''
|
||||
"
|
||||
@click="currentSpl = item.key"
|
||||
></u-button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="title">收货单价区间</view>
|
||||
<view class="range">
|
||||
<view>
|
||||
<u-input
|
||||
shape="circle"
|
||||
:fontSize="12"
|
||||
:placeholderStyle="{ fontSize: '12px' }"
|
||||
placeholder="最低价"
|
||||
type="number"
|
||||
size="small"
|
||||
v-model="state.minPrice"
|
||||
></u-input
|
||||
></view>
|
||||
-
|
||||
<view>
|
||||
<u-input
|
||||
shape="circle"
|
||||
:fontSize="12"
|
||||
:placeholderStyle="{ fontSize: '12px' }"
|
||||
placeholder="最高价"
|
||||
type="number"
|
||||
size="small"
|
||||
v-model="state.maxPrice"
|
||||
></u-input
|
||||
></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="title">收货单价区间</view>
|
||||
<view class="range">
|
||||
<view>
|
||||
<u-input
|
||||
shape="circle"
|
||||
:fontSize="12"
|
||||
:placeholderStyle="{ fontSize: '12px' }"
|
||||
placeholder="最低价"
|
||||
type="number"
|
||||
size="small"
|
||||
v-model="state.minPrice"
|
||||
></u-input
|
||||
></view>
|
||||
-
|
||||
<view>
|
||||
<u-input
|
||||
shape="circle"
|
||||
:fontSize="12"
|
||||
:placeholderStyle="{ fontSize: '12px' }"
|
||||
placeholder="最高价"
|
||||
type="number"
|
||||
size="small"
|
||||
v-model="state.maxPrice"
|
||||
></u-input
|
||||
></view>
|
||||
<!-- 出货参数 -->
|
||||
<view v-else>
|
||||
<u-cell-group :border="false">
|
||||
<u-cell
|
||||
v-for="(item, index) in formAttrList1"
|
||||
:key="index"
|
||||
:title="item.name"
|
||||
:titleStyle="{
|
||||
fontSize: '26rpx',
|
||||
color: 'rgba(0, 0, 0, 1)',
|
||||
fontWeight: 'bold',
|
||||
}"
|
||||
isLink
|
||||
@click="item.fn"
|
||||
:value="getValue(item.name)"
|
||||
></u-cell>
|
||||
</u-cell-group>
|
||||
|
||||
<view class="title">提货方式</view>
|
||||
<view class="btn-box">
|
||||
<view v-for="(item, index) in deliveryMethodBtnList" :key="index">
|
||||
<u-button
|
||||
:text="item.name"
|
||||
plain
|
||||
shape="circle"
|
||||
type="info"
|
||||
size="small"
|
||||
:customStyle="
|
||||
item.key === deliveryMethod
|
||||
? { border: '1px solid #00dcee', color: '#00dcee' }
|
||||
: ''
|
||||
"
|
||||
@click="deliveryMethod = item.key"
|
||||
></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="btn-box1">
|
||||
|
@ -76,7 +114,12 @@
|
|||
shape="circle"
|
||||
@click="resetState"
|
||||
></u-button>
|
||||
<u-button type="primary" text="确定" shape="circle" @click="getFilter()"></u-button>
|
||||
<u-button
|
||||
type="primary"
|
||||
text="确定"
|
||||
shape="circle"
|
||||
@click="getFilter()"
|
||||
></u-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
@ -90,13 +133,24 @@
|
|||
:closeOnClickAction="true"
|
||||
></u-action-sheet>
|
||||
</block>
|
||||
<block v-for="(item, index) in formAttrList1" :key="index">
|
||||
<u-action-sheet
|
||||
:actions="contrlModalParams[item.childKey].list"
|
||||
:title="contrlModalParams[item.childKey].title"
|
||||
:show="contrlModalParams[item.childKey].isShow"
|
||||
@select="(v: any) => handleSelect(item.childKey, v)"
|
||||
@close="contrlModalParams[item.childKey].isShow = false"
|
||||
:closeOnClickAction="true"
|
||||
></u-action-sheet>
|
||||
</block>
|
||||
</u-popup>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { GoodsApi, ProfileApi, SupplierApi } from "@/services";
|
||||
import { CustomerApi, GoodsApi, ProfileApi, SupplierApi } from "@/services";
|
||||
import _ from "underscore";
|
||||
const props = defineProps<{
|
||||
show: boolean;
|
||||
isShipment: boolean
|
||||
}>();
|
||||
const emit = defineEmits(["handleDialog", "handleOk"]);
|
||||
const handleClose = () => {
|
||||
|
@ -110,7 +164,7 @@ const state = reactive({
|
|||
productId: null, // 产品id,
|
||||
productName: "", // 产品名称
|
||||
minPrice: null,
|
||||
maxPrice: null
|
||||
maxPrice: null,
|
||||
});
|
||||
const currentSpl = ref<any>(null);
|
||||
const splBtnList = [
|
||||
|
@ -118,6 +172,12 @@ const splBtnList = [
|
|||
{ key: false, name: "补单" },
|
||||
{ key: true, name: "未补单" },
|
||||
];
|
||||
const deliveryMethod = ref<any>(null);
|
||||
const deliveryMethodBtnList = [
|
||||
{ key: null, name: "全部" },
|
||||
{ key: 0, name: "送货" },
|
||||
{ key: 1, name: "自提" },
|
||||
];
|
||||
const formAttrList = reactive<any>([
|
||||
{
|
||||
name: "供应商",
|
||||
|
@ -145,6 +205,25 @@ const formAttrList = reactive<any>([
|
|||
},
|
||||
},
|
||||
]);
|
||||
|
||||
const formAttrList1 = reactive<any>([
|
||||
{
|
||||
name: "客户",
|
||||
childKey: "customer",
|
||||
fn: () => {
|
||||
contrlModalParams.customer.isShow = true;
|
||||
contrlModalParams.customer.title = "客户";
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "出货产品",
|
||||
childKey: "shipmentProduct",
|
||||
fn: () => {
|
||||
contrlModalParams.shipmentProduct.isShow = true;
|
||||
contrlModalParams.shipmentProduct.title = "出货产品";
|
||||
},
|
||||
},
|
||||
]);
|
||||
const handleSelect = (key: string, v: any) => {
|
||||
contrlModalParams[key].isShow = false;
|
||||
if (key === "supplier") {
|
||||
|
@ -156,6 +235,12 @@ const handleSelect = (key: string, v: any) => {
|
|||
} else if (key === "user") {
|
||||
state.pricingUserName = v.name;
|
||||
state.pricingUserId = v.id;
|
||||
} else if (key === "customer") {
|
||||
state.userName = v.name;
|
||||
state.userId = v.id;
|
||||
} else if (key === "shipmentProduct") {
|
||||
state.productName = v.name;
|
||||
state.productId = v.id;
|
||||
}
|
||||
};
|
||||
const getValue = (v: string) => {
|
||||
|
@ -165,6 +250,10 @@ const getValue = (v: string) => {
|
|||
return state.productName;
|
||||
} else if (v === "定价人") {
|
||||
return state.pricingUserName;
|
||||
} else if (v === "客户") {
|
||||
return state.userName;
|
||||
} else if (v === "出货产品") {
|
||||
return state.productName;
|
||||
}
|
||||
};
|
||||
const contrlModalParams = reactive<any>({
|
||||
|
@ -183,17 +272,30 @@ const contrlModalParams = reactive<any>({
|
|||
title: "标题",
|
||||
list: [],
|
||||
},
|
||||
customer: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
list: [],
|
||||
},
|
||||
shipmentProduct: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
list: [],
|
||||
},
|
||||
});
|
||||
// 定价人
|
||||
ProfileApi.getUserList({}).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
contrlModalParams.user.list = res.data;
|
||||
}
|
||||
});
|
||||
// 供应商
|
||||
SupplierApi.getSupplierUserList({}).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
contrlModalParams.supplier.list = res.data;
|
||||
}
|
||||
});
|
||||
// 收货产品
|
||||
GoodsApi.getReceiveProductList().then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
contrlModalParams.product.list = _.map(
|
||||
|
@ -204,6 +306,24 @@ GoodsApi.getReceiveProductList().then((res: any) => {
|
|||
);
|
||||
}
|
||||
});
|
||||
// 客户信息
|
||||
CustomerApi.getCustomUserList({}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
contrlModalParams.customer.list = res.data;
|
||||
}
|
||||
});
|
||||
// 产品信息
|
||||
GoodsApi.getShipmentProductList().then((res) => {
|
||||
if (res.code === 200) {
|
||||
contrlModalParams.shipmentProduct.list = _.map(
|
||||
res.data as any,
|
||||
function (item: any) {
|
||||
return { name: item.shmProductsName, ...item };
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 重置 确定
|
||||
const resetState = () => {
|
||||
|
@ -216,17 +336,18 @@ const resetState = () => {
|
|||
state.minPrice = null;
|
||||
state.maxPrice = null;
|
||||
currentSpl.value = null;
|
||||
deliveryMethod.value = null
|
||||
};
|
||||
|
||||
const getFilter = () => {
|
||||
emit("handleOk", {...state, repairFlag: currentSpl.value});
|
||||
emit("handleOk", { ...state, repairFlag: currentSpl.value, deliveryMethod: deliveryMethod.value });
|
||||
emit("handleDialog", false);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.box {
|
||||
padding: 60rpx 30rpx;
|
||||
::v-deep .u-cell__value{
|
||||
::v-deep .u-cell__value {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.title {
|
||||
|
|
|
@ -130,6 +130,7 @@
|
|||
<!-- 筛选 -->
|
||||
<FilterDialog
|
||||
:show="showDialog.showFilter"
|
||||
:isShipment="false"
|
||||
@handleOk="handleOk"
|
||||
@handleDialog="(v:boolean) => {handleDialog('showFilter', v)}"
|
||||
/>
|
||||
|
@ -418,7 +419,8 @@ onMounted(() => {
|
|||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #000000;
|
||||
margin: 30rpx 0rpx 0rpx 0rpx;
|
||||
margin: 30rpx 0rpx 0rpx 30rpx;
|
||||
|
||||
}
|
||||
.box + .box {
|
||||
margin-top: 30rpx;
|
||||
|
|
|
@ -8,76 +8,106 @@
|
|||
:bgColor="'#fff'"
|
||||
:borderColor="'rgba(0, 0, 0, 0.1)'"
|
||||
:placeholderColor="'#C1C1C1'"
|
||||
@search="handleSearch()"
|
||||
></u-search>
|
||||
<view class="btn" @click="handleAdd()"> 创建 </view>
|
||||
</view>
|
||||
<view class="filter">
|
||||
<!-- -->
|
||||
<view><text>本月</text><u-icon name="arrow-down"></u-icon></view>
|
||||
<view @click="handleDialog('showTime', true)"
|
||||
><text>{{ state.name }}</text
|
||||
><u-icon name="arrow-down"></u-icon
|
||||
></view>
|
||||
<view @click="state.isShowStatus = true"
|
||||
><text>单据状态</text><u-icon name="arrow-down"></u-icon
|
||||
></view>
|
||||
<view @click="state.isShowSort = true"
|
||||
><text>排序</text><u-icon name="arrow-down"></u-icon
|
||||
></view>
|
||||
<view class="btn">筛选</view>
|
||||
<view class="btn" @click="handleDialog('showFilter', true)">筛选</view>
|
||||
</view>
|
||||
|
||||
<view class="time">2024-01-01</view>
|
||||
<view class="time">
|
||||
<view v-if="state.name === '昨日' || state.name === '今日'">{{
|
||||
state.startTime
|
||||
}}</view>
|
||||
<view v-else>{{ state.startTime }} - {{ state.endTime }}</view>
|
||||
</view>
|
||||
|
||||
<view class="box" v-for="(item, index) in pageList.list" :key="index">
|
||||
<view class="base">
|
||||
<view>
|
||||
<view class="no"> 出货单号:{{ item.orderNumber }} </view>
|
||||
<view class="supplier"> {{ item.deviceName || "-" }} </view>
|
||||
<page-view
|
||||
@loadList="
|
||||
(v) => {
|
||||
getList(v);
|
||||
}
|
||||
"
|
||||
:noMoreData="pageList.noMoreData"
|
||||
:list="pageList.list"
|
||||
:height="200"
|
||||
:isLoading="pageList.isLoading"
|
||||
>
|
||||
<view class="box" v-for="(item, index) in pageList.list" :key="index">
|
||||
<view class="base">
|
||||
<view>
|
||||
<view class="no"> 出货单号:{{ item.orderNumber }} </view>
|
||||
<view class="supplier"> {{ item.deviceName || "-" }} </view>
|
||||
</view>
|
||||
<view>
|
||||
<text class="btn" @click="handleScenePhoto((item as any).id)"
|
||||
>现场照片</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<text class="btn" @click="handleScenePhoto((item as any).id)"
|
||||
>现场照片</text
|
||||
|
||||
<view class="name"
|
||||
>{{ item.userName }}
|
||||
<text>{{ getScaleStatus((item as any).scaleStatus) }}</text>
|
||||
<text v-if="item.repairTime">补单</text>
|
||||
</view>
|
||||
<view class="type">{{ item.productName }}</view>
|
||||
<view class="flex-box">
|
||||
<text>定价人:{{ item.userName }}</text>
|
||||
<text>创建时间:{{ item.createTime }}</text>
|
||||
</view>
|
||||
|
||||
<view class="more">
|
||||
<view
|
||||
v-for="(cItem, index) in gridList1"
|
||||
:key="index"
|
||||
:style="cItem.isCustomStyle ? 'font-size: 22rpx;color:#999' : ''"
|
||||
>
|
||||
<block v-if="cItem.name === '扣杂'">
|
||||
<text v-if="cItem.name">
|
||||
{{ item.buttonType === 0 ? "扣杂" : "扣点" }}: </text
|
||||
><text>
|
||||
{{
|
||||
item.buttonType === 0
|
||||
? item[cItem.enName as string]
|
||||
: item["points"]
|
||||
}}
|
||||
{{ item.buttonType === 0 ? cItem.unit : "%" }}
|
||||
</text>
|
||||
</block>
|
||||
<block v-else-if="cItem.name === '送货方式'">
|
||||
<text v-if="cItem.name">{{ cItem.name }}:</text
|
||||
><text
|
||||
>{{ cItem.isBefore ? cItem.unit : "" }}
|
||||
<text v-if="item[cItem.enName as string] === DeliveryMethod.Deliver">送货</text>
|
||||
<text v-if="item[cItem.enName as string] === DeliveryMethod.SelfPickup">自提</text>
|
||||
{{ cItem.isBefore ? "" : cItem.unit }}
|
||||
</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<text v-if="cItem.name">{{ cItem.name }}:</text
|
||||
><text
|
||||
>{{ cItem.isBefore ? cItem.unit : "" }}
|
||||
{{ item[cItem.enName as string] }}
|
||||
{{ cItem.isBefore ? "" : cItem.unit }}
|
||||
</text>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="name"
|
||||
>{{ item.userName }}
|
||||
<text>{{ getScaleStatus((item as any).scaleStatus) }}</text>
|
||||
<text v-if="item.repairTime">补单</text>
|
||||
</view>
|
||||
<view class="type">{{ item.productName }}</view>
|
||||
<view class="flex-box">
|
||||
<text>定价人:{{ item.userName }}</text>
|
||||
<text>创建时间:{{ item.createTime }}</text>
|
||||
</view>
|
||||
|
||||
<view class="more">
|
||||
<view
|
||||
v-for="(cItem, index) in gridList1"
|
||||
:key="index"
|
||||
:style="cItem.isCustomStyle ? 'font-size: 22rpx;color:#999' : ''"
|
||||
>
|
||||
<block v-if="cItem.name === '扣杂'">
|
||||
<text v-if="cItem.name">
|
||||
{{ item.buttonType === 0 ? "扣杂" : "扣点" }}: </text
|
||||
><text>
|
||||
{{
|
||||
item.buttonType === 0
|
||||
? item[cItem.enName as string]
|
||||
: item["points"]
|
||||
}}
|
||||
{{ item.buttonType === 0 ? cItem.unit : "%" }}
|
||||
</text>
|
||||
</block>
|
||||
<block v-if="cItem.name !== '扣杂'">
|
||||
<text v-if="cItem.name">{{ cItem.name }}:</text
|
||||
><text
|
||||
>{{ cItem.isBefore ? cItem.unit : "" }}
|
||||
{{ item[cItem.enName as string] }}
|
||||
{{ cItem.isBefore ? "" : cItem.unit }}
|
||||
</text>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</page-view>
|
||||
</view>
|
||||
|
||||
<u-action-sheet
|
||||
|
@ -87,6 +117,7 @@
|
|||
:title="'单据状态'"
|
||||
:show="state.isShowStatus"
|
||||
@select="handleSelectStatus"
|
||||
@close="state.isShowStatus = false"
|
||||
></u-action-sheet>
|
||||
<u-action-sheet
|
||||
:closeOnClickOverlay="true"
|
||||
|
@ -95,12 +126,58 @@
|
|||
:title="'排序'"
|
||||
:show="state.isShowSort"
|
||||
@select="handleSelectSort"
|
||||
@close="state.isShowSort = false"
|
||||
></u-action-sheet>
|
||||
|
||||
<!-- 时间弹框 -->
|
||||
<TimeDialog
|
||||
ref="timeDialog"
|
||||
:show="showDialog.showTime"
|
||||
@handleDialog="(v:boolean) => {handleDialog('showTime', v)}"
|
||||
@changeTime="changeTime"
|
||||
/>
|
||||
<!-- 筛选 -->
|
||||
<FilterDialog
|
||||
:show="showDialog.showFilter"
|
||||
:isShipment="true"
|
||||
@handleOk="handleOk"
|
||||
@handleDialog="(v:boolean) => {handleDialog('showFilter', v)}"
|
||||
/>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ShipmentApi } from "@/services";
|
||||
import { ScaleStatus } from "@/utils/enum";
|
||||
import { ReceiveApi, ShipmentApi } from "@/services";
|
||||
import { DeliveryMethod, ScaleStatus } from "@/utils/enum";
|
||||
import PageView from "@/components/PageView/index.vue";
|
||||
import {
|
||||
formatDate,
|
||||
getCurrentMonthStartAndEnd,
|
||||
filterNullUndefined,
|
||||
} from "@/utils";
|
||||
import TimeDialog from "./components/TimeDialog.vue";
|
||||
import FilterDialog from "./components/FilterDialog.vue";
|
||||
const showDialog = <
|
||||
{
|
||||
[key: string]: boolean;
|
||||
}
|
||||
>reactive({
|
||||
showTime: false,
|
||||
showFilter: false,
|
||||
});
|
||||
|
||||
const handleDialog = (key: string, v: boolean) => {
|
||||
showDialog[key] = v;
|
||||
};
|
||||
const changeTime = (obj: any) => {
|
||||
state.startTime = obj.startTime;
|
||||
state.endTime = obj.endTime;
|
||||
state.name = obj.name;
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
const state = reactive({
|
||||
startTime: formatDate(getCurrentMonthStartAndEnd().start, "{y}-{m}-{d}"),
|
||||
endTime: formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}"),
|
||||
name: "本月",
|
||||
currentScaleStatus: undefined,
|
||||
currentSortName: undefined,
|
||||
isShowStatus: false,
|
||||
|
@ -137,16 +214,19 @@ const state = reactive({
|
|||
key: "update_time",
|
||||
},
|
||||
],
|
||||
params: {},
|
||||
});
|
||||
const handleSelectStatus = (v: any) => {
|
||||
state.isShowStatus = false;
|
||||
state.currentScaleStatus = v.key;
|
||||
getOrderList();
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
const handleSelectSort = (v: any) => {
|
||||
state.isShowSort = false;
|
||||
state.currentSortName = v.key;
|
||||
getOrderList();
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
|
||||
const keyword = ref("");
|
||||
|
@ -238,7 +318,7 @@ const gridList1 = reactive([
|
|||
]);
|
||||
const handleScenePhoto = (id: string) => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesScenePhoto/index?orderType=1&id=" + id, // 要跳转到的页面路径
|
||||
url: "/pagesScenePhoto/index?orderType=1&imagesType=1&id=" + id, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const getScaleStatus = (type: number) => {
|
||||
|
@ -260,35 +340,73 @@ const handleAdd = () => {
|
|||
url: "/pagesApp/shipmentSpl", // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
interface PageResult<T> {
|
||||
total: number;
|
||||
list: T[];
|
||||
pageNum: number;
|
||||
pageSize: number;
|
||||
}
|
||||
const pageList: PageResult<Order> = reactive({
|
||||
isLoading: false,
|
||||
noMoreData: false,
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const getOrderList = () => {
|
||||
let params: any = { pageNumber: 1, pageSize: 10 };
|
||||
|
||||
const resetPageList = () => {
|
||||
pageList.noMoreData = false;
|
||||
pageList.total = 0;
|
||||
pageList.list = [];
|
||||
pageList.pageNum = 1;
|
||||
pageList.pageSize = 10;
|
||||
};
|
||||
|
||||
const handleOk = (obj: any) => {
|
||||
state.params = obj;
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
|
||||
const handleSearch = () => {
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
const getList = (v?: boolean) => {
|
||||
if (v) {
|
||||
if (Math.ceil(pageList.total / pageList.pageSize) > pageList.pageNum) {
|
||||
pageList.pageNum++;
|
||||
} else {
|
||||
pageList.noMoreData = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
let params: any = {
|
||||
pageSize: pageList.pageSize,
|
||||
pageNumber: pageList.pageNum,
|
||||
startTime: state.startTime + " 00:00:00",
|
||||
endTime: state.endTime + " 23:59:59",
|
||||
};
|
||||
if (state.currentScaleStatus !== undefined) {
|
||||
params.scaleStatus = state.currentScaleStatus;
|
||||
}
|
||||
if (state.currentSortName !== undefined) {
|
||||
params.sortName = state.currentSortName;
|
||||
}
|
||||
|
||||
ShipmentApi.getOrderPage(params).then((res) => {
|
||||
if (keyword.value !== undefined) {
|
||||
params.orderNumber = keyword.value;
|
||||
}
|
||||
pageList.isLoading = true;
|
||||
ShipmentApi.getOrderPage({
|
||||
...params,
|
||||
...filterNullUndefined(state.params),
|
||||
}).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = res.data.list;
|
||||
pageList.isLoading = false;
|
||||
(pageList as any).list = (pageList as any).list = pageList.list.concat(
|
||||
res.data.list
|
||||
);
|
||||
pageList.total = (res.data as any).total;
|
||||
}
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
getOrderList();
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
@ -335,7 +453,7 @@ onMounted(() => {
|
|||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #000000;
|
||||
margin: 30rpx 0rpx;
|
||||
margin: 30rpx 0rpx 0rpx 30rpx;
|
||||
}
|
||||
.box + .box {
|
||||
margin-top: 30rpx;
|
||||
|
|
Loading…
Reference in New Issue