update: 待过皮重

This commit is contained in:
admin 2024-03-21 13:52:15 +08:00
parent 8faf971040
commit f8a8c15b6f
36 changed files with 317 additions and 313 deletions

View File

@ -92,7 +92,7 @@ onMounted(() => {
border: 1px solid rgba(153, 153, 153, 0.64);
text-align: center;
cursor: pointer;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
margin-bottom: 20rpx;
margin-left: 10rpx;
margin-right: 10rpx;

View File

@ -115,7 +115,7 @@ onMounted(() => {
border: 1px solid rgba(153, 153, 153, 0.64);
text-align: center;
cursor: pointer;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
margin-bottom: 20rpx;
margin-left: 10rpx;
margin-right: 10rpx;

View File

@ -5,11 +5,19 @@
@scrolltolower="loadMore"
:style="{ 'max-height': clientHeight + 'px' }"
>
<slot></slot>
<slot> </slot>
<!-- 加载更多提示 -->
<view v-if="isLoading" class="loading-text">加载中...</view>
<view v-if="noMoreData" class="no-more-data-text">
<u-loadmore :status="'nomore'" :line="true" :fontSize="12" :marginTop="30"/>
<view v-if="noMoreData || isLoading" class="no-more-data-text">
<u-loadmore
:status="isLoading ? 'loading' :'nomore'"
:line="true"
:fontSize="12"
:marginTop="30"
/>
</view>
<view v-if="!isLoading && list.length === 0" style="justify-content: center">
<u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
</u-empty>
</view>
</scroll-view>
</template>
@ -20,14 +28,19 @@ import { onLoad } from "@dcloudio/uni-app";
const props = withDefaults(
defineProps<{
noMoreData: boolean;
isLoading: boolean
list: any;
height: number;
}>(),
{
noMoreData: false,
isLoading: false,
list: [],
height: 80,
}
);
const emit = defineEmits(["loadList"]);
const isLoading = ref(false);
const clientHeight = ref(500);
const loadMore = () => {
@ -50,7 +63,8 @@ const getBarHeight = () => {
const getClineHeight = () => {
uni.getSystemInfo({
success: (res) => {
clientHeight.value = res.windowHeight - uni.upx2px(80) - getBarHeight();
clientHeight.value =
res.windowHeight - uni.upx2px(props.height) - getBarHeight();
},
});
};

View File

@ -105,12 +105,6 @@
"navigationBarTitleText": "待定价"
}
},
{
"path": "tareing",
"style": {
"navigationBarTitleText": "待过皮重"
}
},
{
"path": "payReview",
"style": {

View File

@ -186,7 +186,7 @@ onLoad((option) => {
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 30rpx 25rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
::v-deep .u-form-item {
height: auto;
}

View File

@ -203,7 +203,7 @@ onLoad((option) => {
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 30rpx 25rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
::v-deep .u-form-item {
height: auto;
}

View File

@ -155,7 +155,7 @@ onLoad((option) => {
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 30rpx 25rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
::v-deep .u-form-item {
height: auto;
}

View File

@ -223,7 +223,7 @@ onLoad((option) => {
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 30rpx 25rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
::v-deep .u-form-item {
height: auto;
}

View File

@ -223,7 +223,7 @@ onLoad((option) => {
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 30rpx 25rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
::v-deep .u-form-item {
height: auto;
}

View File

@ -157,7 +157,7 @@ onLoad((option) => {
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 30rpx 25rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
::v-deep .u-form-item {
height: auto;
}

View File

@ -166,7 +166,7 @@ onLoad((option) => {
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 30rpx 25rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
::v-deep .u-form-item {
height: auto;
}

View File

@ -259,7 +259,7 @@ onLoad((option) => {
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 30rpx 25rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
::v-deep .u-form-item {
height: auto;
}

View File

@ -155,7 +155,7 @@ onLoad((option) => {
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 30rpx 25rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
::v-deep .u-form-item {
height: auto;
}

View File

@ -218,7 +218,7 @@ onLoad((option) => {
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 30rpx 25rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
::v-deep .u-form-item {
height: auto;
}

View File

@ -107,7 +107,7 @@ onMounted(() => {
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
font-weight: 400;
font-size: 26rpx;
color: #000000;

View File

@ -119,7 +119,7 @@ onMounted(() => {
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
font-weight: 400;
font-size: 28rpx;
color: #000000;

View File

@ -366,7 +366,7 @@ const handleTime = (v: any) => {
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 30rpx 25rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
::v-deep .u-form-item {
height: auto;
}

View File

@ -106,7 +106,7 @@ onMounted(() => {
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
font-weight: 400;
font-size: 26rpx;
color: #000000;

View File

@ -122,7 +122,7 @@ onMounted(() => {
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
font-weight: 400;
font-size: 26rpx;
color: #000000;

View File

@ -119,7 +119,7 @@ onMounted(() => {
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
font-weight: 400;
font-size: 28rpx;
color: #000000;

View File

@ -387,7 +387,7 @@ const handleTime = (v: any) => {
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 30rpx 25rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
::v-deep .u-form-item {
height: auto;
}

View File

@ -130,7 +130,7 @@ onMounted(() => {
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
font-weight: 400;
font-size: 26rpx;
color: #000000;

View File

@ -108,7 +108,7 @@ onMounted(() => {
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
font-weight: 400;
font-size: 26rpx;
color: #000000;

View File

@ -141,7 +141,7 @@ onMounted(() => {
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
font-weight: 400;
font-size: 28rpx;
color: #000000;

View File

@ -130,7 +130,7 @@ onMounted(() => {
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
font-weight: 400;
font-size: 26rpx;
color: #000000;

View File

@ -20,6 +20,7 @@
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
>
<view class="box">
<view v-for="(item, index) in pageList.list" :key="index">
@ -142,7 +143,7 @@ onMounted(() => {
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
font-weight: 400;
font-size: 26rpx;
color: #000000;

View File

@ -212,7 +212,7 @@ const receiveList = reactive([
num: 0,
fn: () => {
uni.navigateTo({
url: "/pagesReceive/pricing", //
url: "/pagesReceive/pricing?scaleStatus=0", //
});
},
},
@ -221,7 +221,7 @@ const receiveList = reactive([
num: 0,
fn: () => {
uni.navigateTo({
url: "/pagesReceive/tareing", //
url: "/pagesReceive/pricing?scaleStatus=1", //
});
},
},

View File

@ -7,14 +7,16 @@
ref="form"
:labelWidth="80"
:labelStyle="{ padding: '0rpx 10rpx' }"
:errorType="'border-bottom'"
>
<u-form-item
:prop="`order[${item.key}]`"
:prop="`order.${item.key}`"
:label="item.name"
:required="item.required"
v-for="(item, index) in formAttrList"
:key="index"
@click="item.fn"
:borderBottom="false"
>
<u-textarea
v-if="item.type === 'textarea'"
@ -44,15 +46,14 @@
@delete="deletePic" -->
<uni-file-picker
v-if="item.type === 'upload'"
v-model="model1.order.fileList"
limit="10"
:limit="10"
title="最多可上传10张图片"
:auto-upload="false"
fileMediatype="image"
mode="grid"
ref="filesRef"
v-model="model1.order.fileLists"
@delete="handleDelete"
></uni-file-picker>
<u-radio-group
v-if="item.type === 'radio'"
v-model="(model1.order as any)[item.key]"
@ -85,7 +86,7 @@
</block>
</view>
<view class="btn-box">
<u-button text="暂不定价"></u-button>
<u-button text="暂不定价" @click="handleBack()"></u-button>
<u-button type="primary" text="保存" @click="save()"></u-button>
</view>
</template>
@ -112,21 +113,45 @@ const model1 = reactive<{ order: Order }>({
buttonType: 0, // 01
weighingMethod: 0, // 0 1
multiCategory: 0, // 0 1
fileList: [],
fileLists: [],
scaleStatus: 1,
},
});
const rules = ref({
"userInfo.userName": {
const rules = reactive({
"order.userName": {
type: "string",
required: true,
message: "请输入手机号",
message: "请输入选择供应商",
trigger: ["blur", "change"],
},
"userInfo.password": {
"order.productName": {
type: "string",
required: true,
message: "请输入密码",
message: "请选择收货产品名称",
trigger: ["blur", "change"],
},
"order.price": {
type: "number",
required: true,
message: "请输入单价",
trigger: ["blur", "change"],
},
"order.grossWeight": {
type: "number",
required: true,
message: "请输入毛重",
trigger: ["blur", "change"],
},
"order.weighingMethod": {
type: "number",
required: true,
message: "请选择称重方式",
trigger: ["blur", "change"],
},
"order.multiCategory": {
type: "number",
required: true,
message: "请选择品类",
trigger: ["blur", "change"],
},
});
@ -282,67 +307,97 @@ const handleSelect = (key: string, v: any) => {
}
};
onLoad((option) => {
model1.order.id = parseInt((option as any).id);
if (model1.order.id) {
ReceiveApi.getDetailById({ id: model1.order.id }).then((res) => {
if (res.code === 200) {
model1.order = res.data;
}
});
PictureApi.getAnnex({
businessId: model1.order.id.toString(),
orderType: 1,
imagesType: ImagesType.NORMARL,
}).then((res) => {
if (res.code === 200) {
}
});
}
});
const handleBack = () => {
uni.navigateBack();
};
// const files = ref<FileObj[]>([]);
const filesRef = ref();
const handleUpload = () => {
// console.log(event.tempFilePaths)
const list = filesRef.value[0].filesList;
return list.map((item: any) => {
return filesRef.value[0].filesList.map((item: any, index: number) => {
if (item.fileID) {
return;
}
return new Promise((resolve) => {
PictureApi.upload({
files: item,
path: item.path,
}).then((res) => {
if (res.code === 200) {
resolve({
...(res.data as any),
businessId: model1.order.id,
imagesType: ImagesType.NORMARL, //
orderType: OrderType.Receive, //
});
}
});
})
.then((res) => {
if (res.code === 200) {
resolve({
...(res.data as any),
businessId: model1.order.id,
imagesType: ImagesType.NORMARL, //
orderType: OrderType.Receive, //
});
}
})
.catch((e) => {
return;
});
});
});
};
/**
*
*/
const handleDelete = (e: any) => {
console.log(model1.order.fileLists);
if (e.tempFile.fileID) {
PictureApi.deleteById({ id: e.tempFile.fileID }).then((res) => {
if (res.code === 200) {
uni.showToast({ title: "已删除" });
}
});
}
};
/**
* 点击保存 先执行upload接口
* 上传成功后 保存图片资源 和更新订单数据
*/
const save = () => {
Promise.all(handleUpload()).then((res) => {
//
if (res.length > 0) {
PictureApi.addListAnnex({ annexPos: res }).then((res1) => {
if (res1.code === 200) {
uni.showToast({
title: "图片资源上传成功",
icon: "success",
});
}
const form = ref();
const check = () => {
return new Promise((resolve) => {
form.value
.validate()
.then((res: boolean) => {
resolve(res);
})
.catch((errors: any) => {
resolve(false);
uni.showToast({
icon: "none",
title: errors[0].message || "校验失败",
});
});
});
};
const save = () => {
check().then((res) => {
if (res) {
startSave();
}
});
};
const startSave = () => {
Promise.all(handleUpload()).then((res) => {
if (res.filter((item) => item).length > 0) {
PictureApi.addListAnnex({ annexPos: res.filter((item) => item) }).then(
(res1) => {
if (res1.code === 200) {
updateOrder()
}
}
);
}
});
};
const updateOrder = () => {
//
/**
* 0有皮重 1零皮重
@ -375,18 +430,43 @@ const save = () => {
icon: "success",
});
// 0 1
if (model1.order.weighingMethod === 0) {
uni.navigateTo({
url: "/pagesReceive/tareing", //
});
} else if (model1.order.weighingMethod === 1) {
uni.navigateTo({
url: "/pages/index/payReview", //
});
}
uni.redirectTo({
url: "/pagesHome/index", //
});
}
});
};
onLoad((option) => {
model1.order.id = parseInt((option as any).id);
if (model1.order.id) {
ReceiveApi.getDetailById({ id: model1.order.id }).then((res) => {
if (res.code === 200) {
// id
model1.order = {
...res.data,
buttonType: res.data.buttonType !== null ? res.data.buttonType : 0,
weighingMethod:
res.data.weighingMethod !== null ? res.data.weighingMethod : 0,
multiCategory:
res.data.multiCategory !== null ? res.data.multiCategory : 0,
fileLists: model1.order.fileLists.map((item: any) => {
return { ...item, fileID: item.id };
}),
};
}
});
PictureApi.getAnnex({
businessId: model1.order.id.toString(),
orderType: 1,
imagesType: ImagesType.NORMARL,
}).then((res) => {
if (res.code === 200) {
model1.order.fileLists = res.data;
}
});
}
});
</script>
<style lang="scss" scoped>
.c-card {
@ -394,7 +474,7 @@ const save = () => {
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 30rpx 25rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
::v-deep .u-form-item {
height: auto;
}

View File

@ -1,44 +1,64 @@
<template>
<view class="card-box" v-for="(item, index) in pageList.list" :key="index">
<view class="top-flex-box">
<view>
<page-view
@loadList="
(v) => {
getList(v);
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="0"
:isLoading="pageList.isLoading"
>
<view class="card-box" v-for="(item, index) in pageList.list" :key="index">
<view class="top-flex-box">
<view>
<text class="address">{{ item.deviceName || "-" }}</text>
<view>
<text class="address">{{ item.deviceName || "-" }}</text>
</view>
<view>
<text class="number"
>收货单号{{ item.receiptNumber }}</text
>
</view>
<view>
<text class="name">{{ item.userName }}</text>
</view>
</view>
<view>
<text class="number">收货单号{{ item.receiptNumber }}</text>
</view>
<view>
<text class="name">{{ item.userName }}</text>
<u-button
:customStyle="{ border: '1px solid #00dcee', color: '#00dcee' }"
@click="handleScenePhoto(item.id as number)"
text="现场照片"
plain
shape="circle"
type="success"
size="small"
></u-button>
</view>
</view>
<view>
<text class="btn" @click="handleScenePhoto((item.imagesId as number))"
>现场照片</text
>
<text class="desc">过毛时间{{ item.grossTime }}</text>
</view>
<view class="flex-box">
<text>毛重{{ item.grossWeight }}kg</text>
<text>单价{{ state.scaleStatus === 0 ? '未定价' : item.price + '元/KG'}}</text>
</view>
<view class="btn-box">
<u-button
text="点击作废"
color="#E8E8E8"
:customStyle="{ color: '#999' }"
@click="handleModal(true, item.id as number)"
></u-button>
<u-button
type="primary"
:text="state.scaleStatus === 0 ? '点击定价' : '点击编辑'"
@click="pricingDetail(item.id as number)"
></u-button>
</view>
</view>
<view>
<text class="desc">过毛时间{{ item.grossTime }}</text>
</view>
<view class="flex-box">
<text>毛重{{ item.grossWeight }}kg</text>
<text>单价未定价</text>
</view>
<view class="btn-box">
<u-button
text="点击作废"
color="#E8E8E8"
:customStyle="{ color: '#999' }"
@click="handleModal(true, (item.id as number))"
></u-button>
<u-button
type="primary"
text="点击定价"
@click="pricingDetail((item.id as number))"
></u-button>
</view>
</view>
</page-view>
<SmallModal
:title="'确认作废吗?'"
@ -53,13 +73,21 @@
<script setup lang="ts">
import { ReceiveApi } from "@/services/index";
import SmallModal from "@/components/Modal/smallModal.vue";
import PageView from "@/components/PageView/index.vue";
import { onLoad } from "@dcloudio/uni-app";
import { ScaleStatus } from "@/utils/enum";
const pageList: PageResult<Order> = reactive({
isLoading: false,
noMoreData: false,
total: 0,
list: [],
pageNum: 1,
pageSize: 10,
});
const state = reactive({
scaleStatus: 0
})
const isShowCancelModal = ref(false);
const deleteId = ref(0);
const handleModal = (v: boolean, id: number) => {
@ -68,7 +96,7 @@ const handleModal = (v: boolean, id: number) => {
};
const handleScenePhoto = (imagesId: number) => {
uni.navigateTo({
url: "/pagesScenePhoto/index?orderType=1&id=" + imagesId, //
url: `/pagesScenePhoto/index?orderType=1&id=${imagesId}&imagesType=1`, //
});
};
const pricingDetail = (id: number) => {
@ -76,24 +104,58 @@ const pricingDetail = (id: number) => {
url: "/pagesReceive/form/pricingForm?id=" + id, //
});
};
const getOrderList = () => {
ReceiveApi.getOrderPage({ pageNumber: 1, pageSize: 10, scaleStatus: 0 }).then((res) => {
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,
scaleStatus: state.scaleStatus,
};
pageList.isLoading = true;
ReceiveApi.getOrderPage(params).then((res) => {
if (res.code === 200) {
(pageList as any).list = res.data.list;
pageList.isLoading = false;
(pageList as any).list = (pageList as any).list = (
pageList as any
).list.concat(res.data.list);
pageList.total = (res.data as any).total;
}
});
};
const handleOk = () => {
console.log(deleteId.value);
ReceiveApi.deleteOrder({ids:[deleteId.value]}).then((res) => {
ReceiveApi.deleteOrder({ ids: [deleteId.value] }).then((res) => {
if (res.code === 200) {
getOrderList();
getList();
}
});
};
onMounted(() => {
getOrderList();
getList();
});
onLoad((option) => {
//
state.scaleStatus = parseInt((option as any).scaleStatus);
//
if (state.scaleStatus === ScaleStatus.ToBePriced) {
uni.setNavigationBarTitle({
title: '待定价',
});
} else if (state.scaleStatus === ScaleStatus.ToBeTare) {
uni.setNavigationBarTitle({
title: '待过皮重',
});
}
});
</script>
<style lang="scss" scoped>

View File

@ -1,166 +0,0 @@
<template>
<view class="card-box" v-for="(item, index) in pageList.list" :key="index">
<view class="top-flex-box">
<view>
<view>
<text class="address">{{ item.deviceName || "-" }}</text>
</view>
<view>
<text class="number">收货单号{{ item.receiptNumber }}</text>
</view>
<view>
<text class="name">{{ item.userName }}</text>
</view>
</view>
<view>
<text class="btn" @click="handleScenePhoto((item.imagesId as number))"
>现场照片</text
>
</view>
</view>
<view>
<text class="desc">过毛时间{{ item.grossTime }}</text>
</view>
<view class="flex-box">
<text>毛重{{ item.grossWeight }}KG</text>
<text>单价{{ item.price }} /KG</text>
</view>
<view class="btn-box">
<u-button
text="点击作废"
color="#E8E8E8"
:customStyle="{ color: '#999' }"
@click="handleModal(true, (item.id as number))"
></u-button>
<u-button
type="primary"
text="点击编辑"
@click="pricingDetail((item.id as number))"
></u-button>
</view>
</view>
<SmallModal
:title="'确认作废吗?'"
:content="'确认作废后,该订单不能恢复!'"
:okText="'确认作废'"
:isMain="true"
:show="isShowCancelModal"
@handleModal="(v:boolean) => {handleModal(v, deleteId)}"
@handleOk="handleOk()"
/>
</template>
<script setup lang="ts">
import { ReceiveApi } from "@/services/index";
import SmallModal from "@/components/Modal/smallModal.vue";
interface PageResult<T> {
total: number;
list: T[];
pageNum: number;
pageSize: number;
}
const pageList: PageResult<Order> = reactive({
total: 0,
list: [],
pageNum: 1,
pageSize: 10,
});
const isShowCancelModal = ref(false);
const deleteId = ref(0);
const handleModal = (v: boolean, id: number) => {
isShowCancelModal.value = v;
deleteId.value = id;
};
const handleScenePhoto = (imagesId: number) => {
uni.navigateTo({
url: "/pagesScenePhoto/index?orderType=1&id=" + imagesId, //
});
};
const pricingDetail = (id: number) => {
uni.navigateTo({
url: "/pagesReceive/form/pricingForm?id=" + id, //
});
};
const getOrderList = () => {
ReceiveApi.getOrderPage({ pageNumber: 1, pageSize: 10, scaleStatus: 1 }).then((res) => {
if (res.code === 200) {
(pageList as any).list = res.data.list;
}
});
};
const handleOk = () => {
console.log(deleteId.value);
ReceiveApi.deleteOrder([deleteId.value]).then((res) => {
if (res.code === 200) {
getOrderList();
}
});
};
onMounted(() => {
getOrderList();
});
</script>
<style lang="scss" scoped>
.card-box {
padding: 38rpx 50rpx;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 0rpx 25rpx;
margin-top: 35rpx;
font-family: Source Han Sans CN;
font-weight: 400;
font-size: 26rpx;
color: #000000;
line-height: 41rpx;
.top-flex-box {
display: flex;
justify-content: space-between;
align-items: center;
.btn {
border-radius: 24rpx;
border: 1px solid #00dcee;
padding: 10rpx 30rpx;
font-weight: 500;
font-size: 24rpx;
color: #00dcee;
line-height: 41rpx;
cursor: pointer;
}
}
.address {
margin-right: 30rpx;
}
.desc {
font-size: 24rpx;
color: #999999;
margin-top: 30rpx;
display: inline-block;
}
.name {
font-size: 26rpx;
color: #000000;
font-weight: bold;
}
.flex-box {
font-weight: 400;
font-size: 26rpx;
color: #000000;
line-height: 41rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.btn-box {
margin-top: 60rpx;
display: flex;
::v-deep button {
border-radius: 43rpx;
}
::v-deep button + button {
margin-left: 50rpx;
}
}
}
</style>

View File

@ -17,12 +17,16 @@
</view>
</up-col>
</up-row>
<view v-if="list.length === 0" style="justify-content: center">
<u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
</u-empty>
</view>
</view>
</template>
<script setup lang="ts">
import { onLoad } from "@dcloudio/uni-app";
import { PictureApi } from "@/services/index";
import {ImagesType} from '@/utils/enum'
import { ImagesType } from "@/utils/enum";
let list: any = ref([]);
const getType = (v: number) => {
if (v === ImagesType.Tare) {
@ -38,7 +42,7 @@ onLoad((option: any) => {
PictureApi.getAnnex({
businessId: option.id,
orderType: parseInt(option.orderType),
imagesType: ImagesType.Tare,
imagesType: option.imagesType,
}).then((res) => {
if (res.code === 200) {
list.value = res.data;
@ -81,7 +85,7 @@ onLoad((option: any) => {
font-weight: 400;
font-size: 24rpx;
color: #ffffff;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
position: absolute;
top: 30rpx;
left: 9rpx;

View File

@ -430,7 +430,7 @@ onLoad((option) => {
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 30rpx 25rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
::v-deep .u-form-item {
height: auto;
}

View File

@ -304,7 +304,7 @@ onLoad((option) => {
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 30rpx 25rpx;
padding: 10rpx 20rpx;
padding: 0rpx 20rpx;
::v-deep .u-form-item {
height: auto;
}

View File

@ -45,6 +45,15 @@ export const upload = (data: any) => {
});
};
// 删除图片
export const deleteById = (data: any) => {
return http({
method: "POST",
url: "/api/annex/delete",
data,
});
};

View File

@ -1,4 +1,5 @@
interface PageResult<T> {
isLoading?: boolean
noMoreData?: boolean,
total: number;
list: T[];

View File

@ -78,6 +78,7 @@ export const http = <T>(options: UniApp.RequestOptions) => {
},
fail(err) {
console.log(err);
resolve(err as any)
},
});
} else {
@ -105,13 +106,17 @@ export const http = <T>(options: UniApp.RequestOptions) => {
url: "/pages/login/index",
});
return;
}
if ((res1 as any).code === 10001) {
}else if ((res1 as any).code === 10001) {
uni.showToast({
icon: "none",
title: (res1 as Data<T>).message || "请求失败",
});
return
} else if ((res1 as any).code === 5001) {
uni.showToast({
icon: "none",
title: (res1 as Data<T>).message || "请求失败",
});
}
resolve(res1 as Data<T>);
} else {