update: 出货销售更新细节
This commit is contained in:
parent
02ff0c44fe
commit
c5e191c697
|
@ -34,7 +34,7 @@
|
|||
:customStyle="{}"
|
||||
border="none"
|
||||
:value="(model1.order as any)[item.key]"
|
||||
@change="(e:any) => {hanldeInput(e, item)}"
|
||||
@change="(e:any) => {handleInput(e, item)}"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.key === 'subtractNum'">
|
||||
|
@ -167,7 +167,7 @@ const changeProduct = (obj: any) => {
|
|||
model1.order.productId = obj.id; // 收货产品Id,
|
||||
};
|
||||
// 单价 毛重 杂质扣除校验
|
||||
const hanldeInput = (e: any, item: any) => {
|
||||
const handleInput = (e: any, item: any) => {
|
||||
if (item.key === "price" || item.key === "grossWeight") {
|
||||
const tempPrice = e?.replace(valid.valid_decimal.pattern, "");
|
||||
if (countDots(tempPrice).length > 1) {
|
||||
|
@ -462,10 +462,6 @@ const handleDelete = (e: any) => {
|
|||
*/
|
||||
const form = ref();
|
||||
const check = () => {
|
||||
// if (valid.carNo.pattern.test(model1.order.carNumber)) {
|
||||
// console.log('********')
|
||||
// return false;
|
||||
// }
|
||||
return new Promise((resolve) => {
|
||||
form.value
|
||||
.validate()
|
||||
|
|
|
@ -0,0 +1,161 @@
|
|||
<template>
|
||||
<u-popup :show="show" mode="left" :closeable="true" @close="handleClose">
|
||||
<view class="c-dialog-filter">
|
||||
<view class="title">{{ isShipment ? "出货" : "收货" }}产品</view>
|
||||
<view v-if="isShipment">
|
||||
<view v-for="(item, index) in state.list" :key="index">
|
||||
<view class="first-title">{{ item.shmCategoryName }}</view>
|
||||
<view class="dialog-product-layout">
|
||||
<view v-if="item.childrenList">
|
||||
<text
|
||||
v-for="(cItem, cIndex) in item.childrenList"
|
||||
:key="cIndex"
|
||||
:class="{ active: state.current === cItem.id }"
|
||||
@click="handleSelect(cItem)"
|
||||
>{{ cItem.shmCategoryName }}</text
|
||||
>
|
||||
</view>
|
||||
|
||||
<view v-else style="flex: auto;">
|
||||
<u-empty
|
||||
mode="data"
|
||||
icon="http://cdn.uviewui.com/uview/empty/data.png"
|
||||
>
|
||||
</u-empty>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="dialog-product-layout" v-else>
|
||||
<text
|
||||
v-for="(item, index) in state.list"
|
||||
:class="{ active: state.current === item.id }"
|
||||
@click="handleSelect(item)"
|
||||
:key="index"
|
||||
>{{ isShipment ? item.shmProductsName : item.reProductsName }}</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ReceiveProductApi, GoodsApi } from "@/services";
|
||||
|
||||
const props = defineProps<{
|
||||
show: boolean;
|
||||
isShipment: boolean;
|
||||
}>();
|
||||
const emit = defineEmits(["handleDialog", "changeProduct"]);
|
||||
const handleClose = () => {
|
||||
emit("handleDialog", false);
|
||||
};
|
||||
const state = reactive<any>({
|
||||
list: [],
|
||||
current: -1,
|
||||
});
|
||||
|
||||
const handleSelect = (item: any) => {
|
||||
state.current = item.id;
|
||||
emit("changeProduct", item);
|
||||
emit("handleDialog", false);
|
||||
};
|
||||
const getList = () => {
|
||||
if (props.isShipment) {
|
||||
// GoodsApi.getShipmentProductList().then((res) => {
|
||||
// if (res.code === 200) {
|
||||
// state.list = res.data;
|
||||
// }
|
||||
// });
|
||||
|
||||
GoodsApi.getShipmentCategory().then((res) => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === 200) {
|
||||
state.list = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ReceiveProductApi.getAllReProducts().then((res) => {
|
||||
if (res.code === 200) {
|
||||
state.list = res.data;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-dialog-filter {
|
||||
width: 95vw;
|
||||
padding: 25rpx;
|
||||
height: 90vh;
|
||||
overflow-y: scroll;
|
||||
.title {
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #000000;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
.first-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
.second-title {
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(0, 0, 0, 0.7);
|
||||
margin: 20rpx;
|
||||
}
|
||||
// 产品dialog
|
||||
.dialog-product-layout {
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 30rpx 24rpx;
|
||||
padding: 20rpx;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
flex-flow: row wrap;
|
||||
max-height: 70vh;
|
||||
overflow: auto;
|
||||
|
||||
text {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
background: #ffffff;
|
||||
border-radius: 6rpx;
|
||||
border: 1px solid rgba(153, 153, 153, 0.64);
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
padding: 0rpx 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
margin-left: 10rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.active {
|
||||
border-color: $u-primary;
|
||||
color: $u-primary;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-confirm {
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
|
||||
border-radius: 13rpx 13rpx 0rpx 0rpx;
|
||||
position: absolute;
|
||||
bottom: 0rpx;
|
||||
width: 100%;
|
||||
left: 0rpx;
|
||||
padding: 27.56rpx;
|
||||
.btn {
|
||||
text-align: center;
|
||||
::v-deep button {
|
||||
width: 80%;
|
||||
border-radius: 43rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -33,6 +33,7 @@
|
|||
:customStyle="{}"
|
||||
border="none"
|
||||
:disabled="item.disabled"
|
||||
@change="(e:any) => {handleInput(e, item)}"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.key === 'subtractNum'">
|
||||
|
@ -94,6 +95,7 @@
|
|||
:clearable="true"
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
@change="(e:any) => {handleInput(e, item)}"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.key === 'subtractNum'">
|
||||
|
@ -136,7 +138,41 @@ import {
|
|||
ScaleStatus,
|
||||
ScaleStatusBtnType,
|
||||
} from "@/utils/enum";
|
||||
import valid from "@/utils/validate";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
// 毛重 皮重 过磅净重 结算单价 结算重量 预估总价 结算金额校验
|
||||
const handleInput = (e: any, item: any) => {
|
||||
if (
|
||||
[
|
||||
"settlementGross",
|
||||
"settlementTare",
|
||||
"settlementNet",
|
||||
"unitPrice",
|
||||
"settlementWeight",
|
||||
"estimatePrice",
|
||||
"totalPrice",
|
||||
"freight",
|
||||
"incidentals",
|
||||
"subtractNum",
|
||||
].indexOf(item.key) > -1
|
||||
) {
|
||||
const temp = e?.replace(valid.valid_decimal.pattern, "");
|
||||
if (item.key === "subtractNum") {
|
||||
if (
|
||||
model1.order.buttonType === 1 &&
|
||||
(parseInt(temp) > 100 || parseInt(temp) < 0)
|
||||
) {
|
||||
uni.showToast({
|
||||
title: `${item.name}正确范围是0-100`,
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
}
|
||||
setTimeout(() => {
|
||||
model1.order[item.key] = temp;
|
||||
}, 100);
|
||||
}
|
||||
};
|
||||
const model1 = reactive<{
|
||||
scaleStatusBtnType: number;
|
||||
order: Shipment;
|
||||
|
@ -161,43 +197,43 @@ const rules = reactive({
|
|||
"order.settlementGross": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请输入结算毛重",
|
||||
message: "结算毛重为空或输入错误",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"order.settlementTare": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请输入结算皮重",
|
||||
message: "结算皮重为空或输入错误",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"order.settlementNet": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请输入过磅净重",
|
||||
message: "过磅净重为空或输入错误",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"order.unitPrice": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请输入结算单价",
|
||||
message: "结算单价为空或输入错误",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"order.settlementWeight": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请输入结算重量",
|
||||
message: "结算重量为空或输入错误",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"order.estimatePrice": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请输入预估总价",
|
||||
message: "预估总价为空或输入错误",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"order.totalPrice": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请输入结算金额",
|
||||
message: "结算金额为空或输入错误",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
|
@ -234,6 +270,7 @@ const formAttrList = reactive<ComType>([
|
|||
required: true,
|
||||
unit: "kg",
|
||||
fn: () => {},
|
||||
isNumber: true,
|
||||
},
|
||||
{
|
||||
name: "皮重",
|
||||
|
@ -242,6 +279,7 @@ const formAttrList = reactive<ComType>([
|
|||
required: true,
|
||||
unit: "kg",
|
||||
fn: () => {},
|
||||
isNumber: true,
|
||||
},
|
||||
{
|
||||
name: "过磅净重",
|
||||
|
@ -251,6 +289,7 @@ const formAttrList = reactive<ComType>([
|
|||
disabled: true,
|
||||
unit: "kg",
|
||||
fn: () => {},
|
||||
isNumber: true,
|
||||
},
|
||||
{
|
||||
name: "结算单价",
|
||||
|
@ -259,6 +298,7 @@ const formAttrList = reactive<ComType>([
|
|||
required: true,
|
||||
unit: "元/kg",
|
||||
fn: () => {},
|
||||
isNumber: true,
|
||||
},
|
||||
// {
|
||||
// name: "验货净重",
|
||||
|
@ -287,6 +327,7 @@ const formAttrList = reactive<ComType>([
|
|||
key: "subtractNum",
|
||||
type: "input",
|
||||
unit: "KG",
|
||||
isNumber: true,
|
||||
},
|
||||
{
|
||||
name: "结算重量",
|
||||
|
@ -295,6 +336,7 @@ const formAttrList = reactive<ComType>([
|
|||
required: true,
|
||||
disabled: true,
|
||||
unit: "KG",
|
||||
isNumber: true,
|
||||
},
|
||||
{
|
||||
name: "预估总价",
|
||||
|
@ -303,6 +345,7 @@ const formAttrList = reactive<ComType>([
|
|||
disabled: true,
|
||||
type: "input",
|
||||
unit: "元",
|
||||
isNumber: true,
|
||||
},
|
||||
{
|
||||
name: "结算金额",
|
||||
|
@ -310,6 +353,7 @@ const formAttrList = reactive<ComType>([
|
|||
required: true,
|
||||
type: "input",
|
||||
unit: "元",
|
||||
isNumber: true,
|
||||
},
|
||||
{
|
||||
name: "提货方式",
|
||||
|
@ -332,12 +376,14 @@ const formAttrList = reactive<ComType>([
|
|||
key: "freight",
|
||||
type: "input",
|
||||
unit: "元",
|
||||
isNumber: true,
|
||||
},
|
||||
{
|
||||
name: "杂费",
|
||||
key: "incidentals",
|
||||
type: "input",
|
||||
unit: "元",
|
||||
isNumber: true,
|
||||
},
|
||||
{
|
||||
name: "实际收入",
|
||||
|
@ -345,6 +391,7 @@ const formAttrList = reactive<ComType>([
|
|||
type: "input",
|
||||
unit: "元",
|
||||
disabled: true,
|
||||
isNumber: true,
|
||||
},
|
||||
{
|
||||
name: "结算方式",
|
||||
|
@ -380,8 +427,7 @@ watch(
|
|||
() => model1.order.buttonType,
|
||||
() => model1.order.freight,
|
||||
() => model1.order.incidentals,
|
||||
() => model1.order.totalPrice
|
||||
|
||||
() => model1.order.totalPrice,
|
||||
],
|
||||
([settlementGrossNew, settlementTareNew]) => {
|
||||
/**
|
||||
|
@ -390,7 +436,8 @@ watch(
|
|||
预估总价: 结算单价*结算重量
|
||||
实际收入:实际结算金额-运费-杂费
|
||||
*/
|
||||
model1.order.settlementNet = (settlementGrossNew || 0) - (settlementTareNew || 0);
|
||||
model1.order.settlementNet =
|
||||
(settlementGrossNew || 0) - (settlementTareNew || 0);
|
||||
if (model1.order.buttonType === 0) {
|
||||
if (model1.order.subtractNum) {
|
||||
model1.order.settlementWeight =
|
||||
|
@ -401,14 +448,20 @@ watch(
|
|||
} else if (model1.order.buttonType === 1) {
|
||||
if (model1.order.subtractNum) {
|
||||
model1.order.settlementWeight =
|
||||
model1.order.settlementNet * ((100 - model1.order.subtractNum)/100);
|
||||
model1.order.settlementNet * ((100 - model1.order.subtractNum) / 100);
|
||||
} else {
|
||||
model1.order.settlementWeight = model1.order.settlementNet;
|
||||
}
|
||||
}
|
||||
model1.order.estimatePrice =
|
||||
(model1.order.unitPrice || 0) * (model1.order.settlementWeight || 0);
|
||||
model1.order.realIncome = (model1.order.totalPrice || 0) - (model1.order.freight || 0) - (model1.order.incidentals || 0)
|
||||
model1.order.estimatePrice = parseInt(
|
||||
(
|
||||
(model1.order.unitPrice || 0) * (model1.order.settlementWeight || 0)
|
||||
).toFixed(2)
|
||||
);
|
||||
model1.order.realIncome =
|
||||
(model1.order.totalPrice || 0) -
|
||||
(model1.order.freight || 0) -
|
||||
(model1.order.incidentals || 0);
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -482,6 +535,23 @@ const check = () => {
|
|||
* 上传成功后 保存图片资源 和更新订单数据
|
||||
*/
|
||||
const save = () => {
|
||||
for (let i = 0; i < formAttrList.length; i++) {
|
||||
if (formAttrList[i].isNumber) {
|
||||
if (
|
||||
model1.order[formAttrList[i].key] &&
|
||||
model1.order[formAttrList[i].key][
|
||||
model1.order[formAttrList[i].key].length - 1
|
||||
] === "."
|
||||
) {
|
||||
uni.showToast({
|
||||
title: "请输入正确的" + formAttrList[i].name,
|
||||
icon: "none",
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
check().then((res) => {
|
||||
if (res) {
|
||||
startSave();
|
||||
|
@ -512,6 +582,18 @@ const updateOrder = () => {
|
|||
if (model1.scaleStatusBtnType === ScaleStatusBtnType.ShipmentPay) {
|
||||
scaleStatus.value = ScaleStatus.ShipmentPaid;
|
||||
}
|
||||
/**
|
||||
* buttonType
|
||||
* 0扣杂1扣点
|
||||
* buttonType===0 buckleMiscellaneous
|
||||
* buttonType===1 points
|
||||
*
|
||||
*/
|
||||
if (model1.order.buttonType === 0) {
|
||||
model1.order.buckleMiscellaneous = model1.order.subtractNum;
|
||||
} else if (model1.order.buttonType === 1) {
|
||||
model1.order.points = model1.order.subtractNum;
|
||||
}
|
||||
model1.order.signTime = formatDate(new Date(), "{y}-{m}-{d} {h}:{i}:{s}");
|
||||
// 更新出货单
|
||||
ShipmentApi.updateOrderIn({
|
||||
|
@ -543,6 +625,10 @@ onLoad((option) => {
|
|||
buttonType: res.data.buttonType !== null ? res.data.buttonType : 0,
|
||||
deliveryMethod:
|
||||
res.data.deliveryMethod !== null ? res.data.deliveryMethod : 0,
|
||||
subtractNum:
|
||||
res.data.buttonType === 0
|
||||
? res.data.buckleMiscellaneous
|
||||
: res.data.points,
|
||||
fileLists: model1.order.fileLists.map((item: any) => {
|
||||
return { ...item, fileID: item.id };
|
||||
}),
|
||||
|
|
|
@ -32,11 +32,25 @@
|
|||
:clearable="true"
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
:disabled="item.disabled"
|
||||
@change="(e:any) => {handleInput(e, item)}"
|
||||
>
|
||||
<template #suffix>
|
||||
{{ item.unit }}
|
||||
</template>
|
||||
</u-input>
|
||||
<!-- 自定义selectui -->
|
||||
<u-input
|
||||
v-if="item.type === 'selectCustom'"
|
||||
v-model="(model1.order as any)[item.key]"
|
||||
:placeholder="`请选择${item.name}`"
|
||||
:clearable="true"
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
disabled
|
||||
disabledColor="#ffffff"
|
||||
>
|
||||
</u-input>
|
||||
<!-- @afterRead="afterRead"
|
||||
@delete="deletePic" -->
|
||||
<!-- <u-upload
|
||||
|
@ -68,7 +82,7 @@
|
|||
|
||||
<u-radio activeColor="#00DCEE" label="自提" :name="1"></u-radio>
|
||||
</u-radio-group>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<template #right v-if="item.type === 'select' || item.type === 'selectCustom'">
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
|
@ -89,6 +103,15 @@
|
|||
<view class="btn-box">
|
||||
<u-button type="primary" text="保存" @click="save()"></u-button>
|
||||
</view>
|
||||
|
||||
<!-- 出货产品弹框 -->
|
||||
<ProductDialog
|
||||
:show="showDialog.showProduct"
|
||||
@handleDialog="(v:boolean) => {handleDialog('showProduct', v)}"
|
||||
@changeProduct="changeProduct"
|
||||
ref="productRef"
|
||||
:isShipment="true"
|
||||
></ProductDialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { CustomerApi, GoodsApi, PictureApi, ShipmentApi } from "@/services";
|
||||
|
@ -96,6 +119,36 @@ import type { ComType } from "@/types/global";
|
|||
import { ImagesType, OrderType, ScaleStatus } from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import _ from "underscore";
|
||||
import ProductDialog from "../components/ProductDialog.vue";
|
||||
import valid from "@/utils/validate";
|
||||
// 供应商选择
|
||||
const showDialog = <
|
||||
{
|
||||
[key: string]: boolean;
|
||||
}
|
||||
>reactive({
|
||||
showProduct: false,
|
||||
});
|
||||
|
||||
const handleDialog = (key: string, v: boolean) => {
|
||||
showDialog[key] = v;
|
||||
};
|
||||
|
||||
// 收货产品选择
|
||||
const changeProduct = (obj: any) => {
|
||||
model1.order.productName = obj.shmCategoryName; // 收货产品名称
|
||||
model1.order.productId = obj.id; // 收货产品Id,
|
||||
};
|
||||
|
||||
// 数量
|
||||
const handleInput = (e: any, item: any) => {
|
||||
if (item.key === "number" || item.key === "phone") {
|
||||
const tempPrice = e?.replace(valid.valid_number, "");
|
||||
setTimeout(() => {
|
||||
model1.order[item.key] = tempPrice;
|
||||
}, 100);
|
||||
}
|
||||
};
|
||||
const model1 = reactive<any>({
|
||||
order: {
|
||||
id: 0,
|
||||
|
@ -126,7 +179,7 @@ const rules = reactive({
|
|||
"order.number": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请输入数量",
|
||||
message: "数量为空或数量输入错误",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"order.weighingMethod": {
|
||||
|
@ -159,25 +212,28 @@ const formAttrList = reactive<ComType>([
|
|||
{
|
||||
name: "客户",
|
||||
key: "userName",
|
||||
type: "select",
|
||||
type: "selectCustom",
|
||||
required: true,
|
||||
childKey: "userSelect",
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams.userSelect.isShow = true;
|
||||
contrlModalParams.userSelect.title = "客户";
|
||||
// contrlModalParams.userSelect.isShow = true;
|
||||
// contrlModalParams.userSelect.title = "客户";
|
||||
uni.hideKeyboard();
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "出货产品",
|
||||
key: "productName",
|
||||
type: "select",
|
||||
type: "selectCustom",
|
||||
required: true,
|
||||
childKey: "productSelect",
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams.productSelect.isShow = true;
|
||||
contrlModalParams.productSelect.title = "出货产品";
|
||||
// contrlModalParams.productSelect.isShow = true;
|
||||
// contrlModalParams.productSelect.title = "出货产品";
|
||||
handleDialog("showProduct", true);
|
||||
uni.hideKeyboard();
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -193,6 +249,7 @@ const formAttrList = reactive<ComType>([
|
|||
type: "input",
|
||||
required: true,
|
||||
unit: "KG",
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
name: "提货方式",
|
||||
|
@ -330,6 +387,18 @@ const check = () => {
|
|||
});
|
||||
};
|
||||
const save = () => {
|
||||
if (model1.order.carNumber) {
|
||||
if (!valid.carNo.pattern.test(model1.order.carNumber)) {
|
||||
uni.showToast({ icon: "none", title: "请输入正确的车牌号" });
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (model1.order.phone) {
|
||||
if (!valid.mobile.pattern.test(model1.order.phone)) {
|
||||
uni.showToast({ icon: "none", title: "请输入正确的手机号" });
|
||||
return;
|
||||
}
|
||||
}
|
||||
check().then((res) => {
|
||||
if (res) {
|
||||
startSave();
|
||||
|
@ -353,11 +422,12 @@ const startSave = () => {
|
|||
|
||||
const updateOrder = () => {
|
||||
// 编辑更新状态值
|
||||
// else if (state.scaleStatus === ScaleStatus.ToBeGrossWeight) {
|
||||
// status = ScaleStatus.ToBeShipmentReview;
|
||||
// }
|
||||
let status = 0;
|
||||
if (state.scaleStatus === ScaleStatus.ToBeShipment) {
|
||||
status = ScaleStatus.ToBeGrossWeight;
|
||||
} else if (state.scaleStatus === ScaleStatus.ToBeGrossWeight) {
|
||||
status = ScaleStatus.ToBeShipmentReview;
|
||||
} else {
|
||||
status = model1.order.status;
|
||||
}
|
||||
|
@ -370,13 +440,9 @@ const updateOrder = () => {
|
|||
title: "编辑成功",
|
||||
icon: "success",
|
||||
});
|
||||
if (state.scaleStatus === ScaleStatus.ToBeShipment) {
|
||||
if (state.scaleStatus === ScaleStatus.ToBeShipment || state.scaleStatus === ScaleStatus.ToBeGrossWeight) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesShipment/shipmenting?scaleStatus=" + status, // 要跳转到的页面路径
|
||||
});
|
||||
} else if (state.scaleStatus === ScaleStatus.ToBeGrossWeight) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesShipment/shipmentSettlement?scaleStatus=" + status, // 要跳转到的页面路径
|
||||
url: "/pagesShipment/shipmenting?scaleStatus=" + state.scaleStatus, // 要跳转到的页面路径
|
||||
});
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
>
|
||||
<block v-for="(item, index) in pageList.list" :key="index">
|
||||
<view class="c-layout">
|
||||
<view style="min-width: 20px;"
|
||||
<view style="min-width: 20px"
|
||||
><checkbox
|
||||
v-if="
|
||||
ScaleStatus.ToBeShipmentReview === currentTab ||
|
||||
|
@ -168,7 +168,7 @@ const handleReview = (id: string, scaleStatus: number) => {
|
|||
} else if (scaleStatus === 4) {
|
||||
type = ScaleStatusBtnType.ShipmentPay;
|
||||
}
|
||||
console.log('**************', type)
|
||||
console.log("**************", type);
|
||||
uni.navigateTo({
|
||||
url: "/pagesShipment/review/index?id=" + id + `&scaleStatusBtnType=${type}`, // 要跳转到的页面路径
|
||||
});
|
||||
|
@ -189,6 +189,10 @@ const updateStatus = (status: number) => {
|
|||
.map((item) => {
|
||||
return { ...item, scaleStatus: status };
|
||||
});
|
||||
if (list.length === 0) {
|
||||
uni.showToast({ icon: "none", title: "请至少选择一个出货单" });
|
||||
return;
|
||||
}
|
||||
ShipmentApi.updateOrderIn({ orderOutPos: list }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
resetPageList();
|
||||
|
@ -237,7 +241,6 @@ const getList = (v?: boolean) => {
|
|||
return { ...item, isChecked: false };
|
||||
});
|
||||
pageList.total = (res.data as any).total;
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<text class="number">出货单号:{{ item.orderNumber }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="name">{{ item.cardNumber }}</text>
|
||||
<text class="name">{{ item.userName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
|
@ -89,7 +89,7 @@ const handleModal = (v: boolean, id: number) => {
|
|||
deleteId.value = id;
|
||||
};
|
||||
const handleScenePhoto = (id: any) => {
|
||||
uni.redirectTo({
|
||||
uni.navigateTo({
|
||||
url: `/pagesScenePhoto/index?orderType=1&id=${id}&imagesType=1`, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue