update: 收货作废 出货作废

This commit is contained in:
admin 2024-03-28 14:05:00 +08:00
parent 5262b3e78f
commit f4d6f63137
2 changed files with 148 additions and 87 deletions

View File

@ -8,62 +8,75 @@
:bgColor="'#fff'"
:borderColor="'rgba(0, 0, 0, 0.1)'"
:placeholderColor="'#C1C1C1'"
@search="handleSearch()"
></u-search>
</view>
<view class="box" v-for="(item, index) in pageList.list" :key="index">
<view class="base">
<view>
<view class="no"> 收货单号{{ item.receiptNumber }} </view>
<view class="supplier"> {{ item.deviceName }} </view>
<page-view
@loadList="
(v) => {
getList(v);
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="100"
:isLoading="pageList.isLoading"
>
<view class="box" v-for="(item, index) in pageList.list" :key="index">
<view class="base">
<view>
<view class="no"> 收货单号{{ item.receiptNumber }} </view>
<view class="supplier"> {{ item.deviceName }} </view>
</view>
<view>
<text class="btn" @click="handleScenePhoto(item.id as any)"
>现场照片</text
>
</view>
</view>
<view>
<text class="btn" @click="handleScenePhoto(item.imagesId as number)"
>现场照片</text
<view class="name">{{ item.userName }}</view>
<view class="type">{{ item.productName }}</view>
<view class="flex-box">
<text>定价人{{ item.pricingUserName }}</text>
<text>过磅时间{{ item.tareTime }}</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>
<view class="name">{{ item.userName }}</view>
<view class="type">{{ item.productName }}</view>
<view class="flex-box">
<text>定价人{{ item.pricingUserName }}</text>
<text>过磅时间{{ item.tareTime }}</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>
</template>
<script setup lang="ts">
import { ReceiveApi } from "@/services";
import PageView from "@/components/PageView/index.vue";
const keyword = ref("");
const gridList1 = reactive([
@ -126,29 +139,45 @@ const gridList1 = reactive([
isCustomStyle: true,
},
]);
const handleScenePhoto = (imagesId: number) => {
const handleScenePhoto = (id: string) => {
uni.navigateTo({
url: "/pagesScenePhoto/index?orderType=1&id=" + imagesId, //
url: "/pagesScenePhoto/index?orderType=1&imagesType=1&id=" + id, //
});
};
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 resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
const getOrderList = () => {
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;
}
}
ReceiveApi.getOrderPage({
pageNumber: 1,
pageSize: 10,
pageSize: pageList.pageSize,
pageNumber: pageList.pageNum,
userName: keyword.value,
isDeleted: true,
}).then((res) => {
if (res.code === 200) {
@ -157,7 +186,7 @@ const getOrderList = () => {
});
};
onMounted(() => {
getOrderList();
getList();
});
</script>
<style lang="scss" scoped>

View File

@ -8,9 +8,20 @@
:bgColor="'#fff'"
:borderColor="'rgba(0, 0, 0, 0.1)'"
:placeholderColor="'#C1C1C1'"
@search="handleSearch()"
></u-search>
</view>
<page-view
@loadList="
(v) => {
getList(v);
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="100"
:isLoading="pageList.isLoading"
>
<view class="box" v-for="(item, index) in pageList.list" :key="index">
<view class="base">
<view>
@ -44,11 +55,13 @@
</view>
</view>
</view>
</page-view>
</view>
</template>
<script setup lang="ts">
import { ShipmentApi } from '@/services';
import { ScaleStatus } from '@/utils/enum';
import { ReceiveApi, ShipmentApi } from "@/services";
import PageView from "@/components/PageView/index.vue";
import { ScaleStatus } from "@/utils/enum";
const keyword = ref("");
const gridList1 = reactive([
@ -151,23 +164,45 @@ 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, //
});
};
interface PageResult<T> {
total: number;
list: T[];
pageNum: number;
pageSize: number;
}
const pageList: PageResult<Shipment> = reactive({
const pageList: PageResult<Order> = reactive({
isLoading: false,
noMoreData: false,
total: 0,
list: [],
pageNum: 1,
pageSize: 10,
});
const getOrderList = () => {
ShipmentApi.getOrderPage({ pageNumber: 1, pageSize: 10, isDeleted: true,}).then((res) => {
const resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
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;
}
}
ShipmentApi.getOrderPage({
pageSize: pageList.pageSize,
pageNumber: pageList.pageNum,
userName: keyword.value,
isDeleted: true,
}).then((res) => {
if (res.code === 200) {
(pageList as any).list = res.data.list;
}
@ -187,27 +222,13 @@ const getScaleStatus = (type: number) => {
}
};
onMounted(() => {
getOrderList();
getList();
});
</script>
<style lang="scss" scoped>
.c-card {
margin: 30rpx 25rpx;
.search {
display: flex;
align-items: center;
justify-content: space-between;
.btn {
background: #00dcee;
border-radius: 24rpx;
border: 1px solid #00dcee;
font-weight: 500;
font-size: 26rpx;
color: #ffffff;
margin-left: 50rpx;
padding: 6rpx 30rpx;
}
}
.box {
margin-top: 30rpx;
background: #ffffff;
@ -258,6 +279,16 @@ onMounted(() => {
color: #ec0f3e;
margin-bottom: 20rpx;
}
.flex-box {
display: flex;
align-items: center;
justify-content: space-between;
font-weight: 400;
font-size: 26rpx;
color: #999999;
border-bottom: 1rpx solid rgba(233, 233, 233, 0.76);
padding-bottom: 20rpx;
}
}
.more {
display: grid;
@ -266,6 +297,7 @@ onMounted(() => {
font-weight: 400;
font-size: 26rpx;
color: #000000;
padding: 25rpx 0rpx 0rpx 0rpx;
> view {
line-height: 50rpx;
}