update: 收货明细

This commit is contained in:
admin 2024-03-13 15:35:25 +08:00
parent b675e78a3f
commit c9aaa4f1d4
1 changed files with 122 additions and 33 deletions

View File

@ -9,12 +9,13 @@
:borderColor="'rgba(0, 0, 0, 0.1)'"
:placeholderColor="'#C1C1C1'"
></u-search>
<view class="btn"> 创建 </view>
<view class="btn" @click="handleAdd()"> 创建 </view>
</view>
<view class="filter">
<!-- -->
<view><text>本月</text><u-icon name="arrow-down"></u-icon></view>
<view><text>单据状态</text><u-icon name="arrow-down"></u-icon></view>
<view><text>排序</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>
@ -24,14 +25,20 @@
<view class="base">
<view>
<view class="no"> 收货单号{{ item.receiptNumber }} </view>
<view class="supplier"> {{ item.deviceName || '-' }} </view>
<view class="supplier"> {{ item.deviceName || "-" }} </view>
</view>
<view>
<text class="btn" @click="handleScenePhoto((item as any).id)">现场照片</text>
<text class="btn" @click="handleScenePhoto((item as any).id)"
>现场照片</text
>
</view>
</view>
<view class="name">{{ item.userName }} <text>{{ getScaleStatus((item as any).scaleStatus) }}</text></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>
@ -39,80 +46,147 @@
</view>
<view class="more">
<view v-for="(item, index) in gridList1" :key="index" :style="item.isCustomStyle ? 'font-size: 24rpx;color:#999' : ''">
<text v-if="item.name">{{ item.name }}</text
><text
>{{ item.isBefore ? item.unit : "" }}
{{ item.num }}
{{ item.isBefore ? "" : item.unit }}
</text>
<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>
<u-action-sheet :closeOnClickOverlay="true" :closeOnClickAction="true" :actions="state.statusList" :title="'单据状态'" :show="state.isShowStatus" @select="handleSelectStatus"></u-action-sheet>
<u-action-sheet :closeOnClickOverlay="true" :closeOnClickAction="true" :actions="state.sortList" :title="'排序'" :show="state.isShowSort" @select="handleSelectSort"></u-action-sheet>
</template>
<script setup lang="ts">
import { ReceiveApi } from '@/services';
import { ScaleStatus } from '@/utils/enum';
import { ReceiveApi } from "@/services";
import { ScaleStatus } from "@/utils/enum";
const state = reactive({
currentScaleStatus: undefined,
currentSortName: undefined,
isShowStatus: false,
statusList: [{
name: '待定价',
key: 0
},{
name: '待过皮',
key: 1
},{
name: '待审核',
key: 2
},{
name: '已审核待支付',
key: 3
},{
name: '已支付',
key: 4
}],
isShowSort: false,
sortList: [{
name: '按创建时间降序',
key: 'create_time'
},
{
name: '按更新时间降序',
key: 'update_time'
}]
})
const handleSelectStatus = (v: any) => {
state.isShowStatus = false
state.currentScaleStatus = v.key
getOrderList()
}
const handleSelectSort = (v: any) => {
state.isShowSort = false
state.currentSortName = v.key
getOrderList()
}
const keyword = ref("");
const gridList1 = reactive([
{
name: "毛重",
num: "4080.00",
enName: "grossWeight",
num: 0,
unit: "KG",
isBefore: false,
},
{
name: "皮重",
num: "3450.00",
enName: "tare",
num: 0,
unit: "KG",
isBefore: false,
},
{
name: "扣杂",
num: "640.00",
enName: "buckleMiscellaneous",
num: 0,
unit: "KG",
isBefore: false,
},
{},
{
name: "净重",
num: "640.00",
enName: "netWeight",
num: 0,
unit: "KG",
isBefore: false,
},
{
name: "单价",
num: "2.48",
enName: "price",
num: 0,
unit: "元/千克",
isBefore: false,
},
{
name: "结算总价",
num: "2.48",
enName: "balanceTotalPrice",
num: 0,
unit: "元",
isBefore: false,
},
{
name: "实际总价",
num: "2.48",
enName: "totalPrice",
num: 0,
unit: "元",
isBefore: false,
},
{
name: "过毛",
num: "2023-09-01 13:23:33",
enName: "grossTime",
num: "",
unit: "",
isBefore: false,
isCustomStyle: true
isCustomStyle: true,
},
{
name: "过皮",
num: "2023-09-01 13:23:33",
enName: "tareTime",
num: "",
unit: "",
isBefore: false,
isCustomStyle: true
isCustomStyle: true,
},
]);
const handleScenePhoto = (id: string) => {
@ -122,16 +196,22 @@ const handleScenePhoto = (id: string) => {
};
const getScaleStatus = (type: number) => {
if (type === ScaleStatus.ToBePriced) {
return '待定价'
return "待定价";
} else if (type === ScaleStatus.ToBeTare) {
return '待过毛重'
return "待过皮";
} else if (type === ScaleStatus.ToBeReview) {
return '待审核'
return "待审核";
} else if (type === ScaleStatus.ToBePay) {
return '待支付'
return "待支付";
} else if (type === ScaleStatus.Paid) {
return '已支付'
return "已支付";
}
};
const handleAdd = () => {
uni.navigateTo({
url: "/pagesApp/receiveSpl", //
});
}
interface PageResult<T> {
total: number;
@ -146,7 +226,16 @@ const pageList: PageResult<Order> = reactive({
pageSize: 10,
});
const getOrderList = () => {
ReceiveApi.getOrderPage({ pageNumber: 1, pageSize: 10 }).then((res) => {
let params: any = { pageNumber: 1, pageSize: 10}
if (state.currentScaleStatus !== undefined) {
params.scaleStatus = state.currentScaleStatus
}
if (state.currentSortName !== undefined) {
params.sortName = state.currentSortName
}
ReceiveApi.getOrderPage(params).then((res) => {
if (res.code === 200) {
(pageList as any).list = res.data.list;
}