update: 出货入库接口对接
This commit is contained in:
parent
5780a0a2f1
commit
5b43226d3f
|
@ -8,74 +8,115 @@
|
|||
:labelWidth="80"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`order[${item.key}]`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
>
|
||||
<u-textarea
|
||||
v-if="item.type === 'textarea'"
|
||||
v-model="(model1.order as any)[(item.key as any)]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
></u-textarea>
|
||||
<u-input
|
||||
v-if="item.type === 'select' || item.type === 'input'"
|
||||
v-model="(model1.order as any)[(item.key as any)]"
|
||||
:placeholder="`请${item.type === 'select' ? '选择' : '输入'}${
|
||||
item.name
|
||||
}`"
|
||||
:clearable="true"
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
<block v-for="(item, index) in formAttrList" :key="index">
|
||||
<u-form-item
|
||||
:prop="`order[${item.key}]`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
@click="item.fn"
|
||||
v-if="item.key !== 'paymentMethodName'"
|
||||
>
|
||||
<template #suffix>
|
||||
{{ item.unit }}
|
||||
</template>
|
||||
</u-input>
|
||||
<!-- @afterRead="afterRead"
|
||||
@delete="deletePic" -->
|
||||
<!-- <u-upload
|
||||
v-if="item.type === 'upload'"
|
||||
:fileList="[]"
|
||||
name="1"
|
||||
multiple
|
||||
:maxCount="10"
|
||||
></u-upload> -->
|
||||
<uni-file-picker
|
||||
v-if="item.type === 'upload'"
|
||||
v-model="model1.order.fileList"
|
||||
limit="10"
|
||||
title="最多可上传10张图片"
|
||||
:auto-upload="false"
|
||||
fileMediatype="image"
|
||||
mode="grid"
|
||||
ref="filesShipmentRef"
|
||||
></uni-file-picker>
|
||||
<u-textarea
|
||||
v-if="item.type === 'textarea'"
|
||||
v-model="(model1.order as any)[(item.key as any)]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
></u-textarea>
|
||||
<u-input
|
||||
v-if="item.type === 'select' || item.type === 'input'"
|
||||
v-model="(model1.order as any)[(item.key as any)]"
|
||||
:placeholder="`请${item.type === 'select' ? '选择' : '输入'}${
|
||||
item.name
|
||||
}`"
|
||||
:clearable="true"
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.key === 'subtractNum'">
|
||||
{{ model1.order.buttonType === 0 ? item.unit : "%" }}
|
||||
</text>
|
||||
<text v-else>
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<uni-file-picker
|
||||
v-if="item.type === 'upload'"
|
||||
v-model="model1.order.fileList"
|
||||
limit="10"
|
||||
title="最多可上传10张图片"
|
||||
:auto-upload="false"
|
||||
fileMediatype="image"
|
||||
mode="grid"
|
||||
ref="filesShipmentRef"
|
||||
></uni-file-picker>
|
||||
|
||||
<u-radio-group
|
||||
v-if="item.type === 'radio'"
|
||||
v-model="(model1.order as any)[(item.key as any)]"
|
||||
placement="row"
|
||||
<u-radio-group
|
||||
v-if="item.type === 'radio'"
|
||||
v-model="(model1.order as any)[item.key]"
|
||||
placement="row"
|
||||
>
|
||||
<u-radio
|
||||
v-for="(c, index) in item.child"
|
||||
:key="index"
|
||||
activeColor="#00DCEE"
|
||||
:label="c.name"
|
||||
:name="c.id"
|
||||
:customStyle="{ marginRight: '10px' }"
|
||||
></u-radio>
|
||||
</u-radio-group>
|
||||
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
<!-- 控制结算方式是否显示 -->
|
||||
<u-form-item
|
||||
:prop="`order[${item.key}]`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
@click="item.fn"
|
||||
v-if="
|
||||
item.key === 'paymentMethodName' &&
|
||||
model1.scaleStatusBtnType === ScaleStatusBtnType.ShipmentPay
|
||||
"
|
||||
>
|
||||
<u-radio activeColor="#00DCEE" label="送货" :name="0"></u-radio>
|
||||
|
||||
<u-radio activeColor="#00DCEE" label="自提" :name="1"></u-radio>
|
||||
</u-radio-group>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
<u-input
|
||||
v-if="item.type === 'select' || item.type === 'input'"
|
||||
v-model="(model1.order as any)[(item.key as any)]"
|
||||
:placeholder="`请${item.type === 'select' ? '选择' : '输入'}${
|
||||
item.name
|
||||
}`"
|
||||
:clearable="true"
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.key === 'subtractNum'">
|
||||
{{ model1.order.buttonType === 0 ? item.unit : "%" }}
|
||||
</text>
|
||||
<text v-else>
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
</block>
|
||||
</u-form>
|
||||
<u-action-sheet
|
||||
:actions="contrlModalParams.select.selectList"
|
||||
:title="contrlModalParams.select.title"
|
||||
:show="contrlModalParams.select.isShow"
|
||||
@select="contrlModalParams.select.isShow = false"
|
||||
@close="contrlModalParams.select.isShow = false"
|
||||
></u-action-sheet>
|
||||
<block v-for="(item, index) in formAttrList" :key="index">
|
||||
<u-action-sheet
|
||||
v-if="item.type === 'select'"
|
||||
: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>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<u-button type="primary" text="保存" @click="save()"></u-button>
|
||||
|
@ -83,14 +124,26 @@
|
|||
</template>
|
||||
<script setup lang="ts">
|
||||
import { PictureApi, ShipmentApi } from "@/services";
|
||||
import { ImagesType, OrderType, ScaleStatus } from "@/utils/enum";
|
||||
import type { ComType } from "@/types/global";
|
||||
import { formatDate } from "@/utils";
|
||||
import {
|
||||
ImagesType,
|
||||
OrderType,
|
||||
ScaleStatus,
|
||||
ScaleStatusBtnType,
|
||||
} from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
const model1 = reactive<Shipment>({
|
||||
const model1 = reactive<{
|
||||
scaleStatusBtnType: number,
|
||||
order: Shipment
|
||||
}>({
|
||||
scaleStatusBtnType: 2,
|
||||
order: {
|
||||
id: 0,
|
||||
id: '',
|
||||
splTime: "",
|
||||
takeType: 1,
|
||||
fileList: [],
|
||||
buttonType: 0,
|
||||
},
|
||||
});
|
||||
const rules = ref({
|
||||
|
@ -107,103 +160,166 @@ const rules = ref({
|
|||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
const contrlModalParams = reactive({
|
||||
const contrlModalParams = reactive<ComType>({
|
||||
select: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
selectList: [
|
||||
list: [
|
||||
{
|
||||
name: "选项一",
|
||||
name: "微信",
|
||||
key: 3,
|
||||
},
|
||||
{
|
||||
name: "选项二",
|
||||
name: "现金",
|
||||
key: 1,
|
||||
},
|
||||
{
|
||||
name: "支付宝",
|
||||
key: 4,
|
||||
},
|
||||
{
|
||||
name: "转账",
|
||||
key: 2,
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const formAttrList = reactive([
|
||||
{
|
||||
name: "客户",
|
||||
key: "userId",
|
||||
type: "select",
|
||||
required: true,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams.select.isShow = true;
|
||||
contrlModalParams.select.title = "客户";
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "出货产品",
|
||||
key: "productId",
|
||||
type: "select",
|
||||
required: true,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams.select.isShow = true;
|
||||
contrlModalParams.select.title = "出货产品";
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "数量",
|
||||
key: "number",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "件",
|
||||
},
|
||||
const formAttrList = reactive<ComType>([
|
||||
{
|
||||
name: "毛重",
|
||||
key: "grossWeight",
|
||||
key: "settlementGross",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "kg",
|
||||
fn: () => {},
|
||||
},
|
||||
{
|
||||
name: "皮重",
|
||||
key: "settlementTare",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "kg",
|
||||
fn: () => {},
|
||||
},
|
||||
{
|
||||
name: "过磅净重",
|
||||
key: "settlementNet",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "kg",
|
||||
fn: () => {},
|
||||
},
|
||||
{
|
||||
name: "结算单价",
|
||||
key: "unitPrice",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "元/kg",
|
||||
fn: () => {},
|
||||
},
|
||||
// {
|
||||
// name: "验货净重",
|
||||
// key: "number",
|
||||
// type: "input",
|
||||
// required: true,
|
||||
// unit: "件",
|
||||
// },
|
||||
{
|
||||
name: "扣杂",
|
||||
key: "buttonType",
|
||||
type: "radio",
|
||||
child: [
|
||||
{
|
||||
id: 0,
|
||||
name: "按固定重量",
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
name: "按百分比",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "杂质扣除",
|
||||
key: "subtractNum",
|
||||
type: "input",
|
||||
unit: "KG",
|
||||
},
|
||||
{
|
||||
name: "结算重量",
|
||||
key: "settlementWeight",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "KG",
|
||||
},
|
||||
{
|
||||
name: "预估总价",
|
||||
key: "estimatePrice",
|
||||
required: true,
|
||||
type: "input",
|
||||
unit: "元",
|
||||
},
|
||||
{
|
||||
name: "结算金额",
|
||||
key: "totalPrice",
|
||||
required: true,
|
||||
type: "input",
|
||||
unit: "元",
|
||||
},
|
||||
{
|
||||
name: "提货方式",
|
||||
key: "deliveryMethod",
|
||||
required: true,
|
||||
type: "radio",
|
||||
},
|
||||
{
|
||||
name: "车辆信息",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
name: "车牌号",
|
||||
key: "carNumber",
|
||||
type: "input",
|
||||
unit: "",
|
||||
child: [
|
||||
{
|
||||
id: 0,
|
||||
name: "送货",
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
name: "自提",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "司机电话",
|
||||
key: "phone",
|
||||
name: "运费",
|
||||
key: "freight",
|
||||
type: "input",
|
||||
unit: "",
|
||||
unit: "元",
|
||||
},
|
||||
{
|
||||
name: "集装箱",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
name: "箱号",
|
||||
key: "box",
|
||||
name: "杂费",
|
||||
key: "incidentals",
|
||||
type: "input",
|
||||
unit: "",
|
||||
unit: "元",
|
||||
},
|
||||
{
|
||||
name: "封号",
|
||||
key: "title",
|
||||
name: "实际收入",
|
||||
key: "realIncome",
|
||||
type: "input",
|
||||
unit: "元",
|
||||
},
|
||||
{
|
||||
name: "结算方式",
|
||||
key: "paymentMethodName",
|
||||
required: true,
|
||||
type: "select",
|
||||
unit: "",
|
||||
childKey: "select",
|
||||
fn: () => {
|
||||
contrlModalParams.select.isShow = true;
|
||||
contrlModalParams.select.title = "结算方式";
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "备注",
|
||||
key: "notes",
|
||||
key: "settlementNotes",
|
||||
type: "textarea",
|
||||
},
|
||||
{
|
||||
name: "上传照片",
|
||||
name: "结算单据",
|
||||
key: "photo",
|
||||
type: "upload",
|
||||
},
|
||||
|
@ -222,8 +338,8 @@ const handleUpload = () => {
|
|||
resolve({
|
||||
...(res.data as any),
|
||||
businessId: model1.order.id,
|
||||
imagesType: ImagesType.NORMARL, // 普通资源
|
||||
orderType: OrderType.Shipment, // 入库单
|
||||
imagesType: ImagesType.Settlement, // 单据资源
|
||||
orderType: OrderType.Shipment, // 出库单
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -231,6 +347,14 @@ const handleUpload = () => {
|
|||
});
|
||||
};
|
||||
|
||||
const handleSelect = (key: string, v: any) => {
|
||||
contrlModalParams[key].isShow = false;
|
||||
if (key === "select") {
|
||||
model1.order.paymentMethodName = v.name;
|
||||
model1.order.paymentMethod = v.id;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 点击保存 先执行upload接口
|
||||
* 上传成功后 保存图片资源 和更新订单数据
|
||||
|
@ -250,11 +374,18 @@ const save = () => {
|
|||
}
|
||||
});
|
||||
|
||||
// 根据不同按钮点击到form 状态不同
|
||||
let scaleStatus = ref(0);
|
||||
if (model1.scaleStatusBtnType === ScaleStatusBtnType.ShipmentNoPay) {
|
||||
scaleStatus.value = ScaleStatus.ToBeShipmentPay;
|
||||
}
|
||||
if (model1.scaleStatusBtnType === ScaleStatusBtnType.ShipmentPay) {
|
||||
scaleStatus.value = ScaleStatus.ShipmentPaid;
|
||||
}
|
||||
model1.order.signTime = formatDate(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
|
||||
// 更新出货单
|
||||
ShipmentApi.updateOrderIn({
|
||||
orderOutPos: [
|
||||
{ ...model1.order, scaleStatus: ScaleStatus.ToBeGrossWeight },
|
||||
],
|
||||
orderOutPos: [{ ...model1.order, scaleStatus: scaleStatus.value }],
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
|
@ -262,7 +393,10 @@ const save = () => {
|
|||
icon: "success",
|
||||
});
|
||||
uni.navigateTo({
|
||||
url: "/pagesShipment/grossWeight", // 要跳转到的页面路径
|
||||
url:
|
||||
"/pagesShipment/review/index?id=" +
|
||||
model1.order.id +
|
||||
`&scaleStatusBtnType=${model1.scaleStatusBtnType}`, // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -270,16 +404,19 @@ const save = () => {
|
|||
|
||||
onLoad((option) => {
|
||||
model1.order.id = (option as any).id;
|
||||
model1.scaleStatusBtnType = parseInt((option as any).scaleStatusBtnType);
|
||||
if (model1.order.id) {
|
||||
ShipmentApi.getDetailById({ id: model1.order.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
model1.order = res.data;
|
||||
model1.order = { ...res.data };
|
||||
console.log(model1.order);
|
||||
}
|
||||
});
|
||||
|
||||
PictureApi.getAnnex({
|
||||
businessId: model1.order.id,
|
||||
orderType: 1,
|
||||
imagesType: ImagesType.NORMARL,
|
||||
orderType: OrderType.Shipment,
|
||||
imagesType: ImagesType.Settlement,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
import { PictureApi, ShipmentApi } from "@/services";
|
||||
import { ImagesType, OrderType, ScaleStatus } from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
const model1 = reactive<Shipment>({
|
||||
const model1 = reactive<any>({
|
||||
order: {
|
||||
id: 0,
|
||||
splTime: "",
|
||||
|
@ -250,20 +250,31 @@ const save = () => {
|
|||
}
|
||||
});
|
||||
|
||||
let scaleStatus = 0;
|
||||
if (ScaleStatus.ToBeShipment === model1.order.scaleStatus) {
|
||||
scaleStatus = ScaleStatus.ToBeGrossWeight;
|
||||
} else if (ScaleStatus.ToBeGrossWeight === model1.order.scaleStatus) {
|
||||
scaleStatus = ScaleStatus.ToBeShipmentReview;
|
||||
}
|
||||
// 更新出货单
|
||||
ShipmentApi.updateOrderIn({
|
||||
orderOutPos: [
|
||||
{ ...model1.order, scaleStatus: ScaleStatus.ToBeGrossWeight },
|
||||
],
|
||||
orderOutPos: [{ ...model1.order, scaleStatus: scaleStatus }],
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: "编辑成功",
|
||||
icon: "success",
|
||||
});
|
||||
uni.navigateTo({
|
||||
url: "/pagesShipment/grossWeight", // 要跳转到的页面路径
|
||||
});
|
||||
debugger
|
||||
if (scaleStatus === ScaleStatus.ToBeGrossWeight) {
|
||||
uni.navigateTo({
|
||||
url: "/pagesShipment/grossWeight", // 要跳转到的页面路径
|
||||
});
|
||||
} else if (scaleStatus === ScaleStatus.ToBeShipmentReview) {
|
||||
uni.navigateTo({
|
||||
url: "/pagesShipment/shipmentSettlement?scaleStatus=2", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
@click="handleModal(true, state.order.id as string)"
|
||||
></u-tag
|
||||
></view>
|
||||
<!-- 待审核才会有编辑信息-->
|
||||
<view v-if="state.order.scaleStatus === 2"
|
||||
<!-- 点击待出货结算-->
|
||||
<view v-if="state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentSettlement"
|
||||
><u-tag
|
||||
text="编辑信息"
|
||||
plain
|
||||
|
@ -44,7 +44,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- 出库 过磅时间对应过皮时间 -->
|
||||
<view class="flex-box" v-if="state.order.scaleStatus === 2">
|
||||
<view class="flex-box" v-if="state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentSettlement || state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentNoPay">
|
||||
<text>审核人:{{ state.order.pricingUserName || "-" }}</text>
|
||||
<text>过磅时间:{{ state.order.tareTime }}</text>
|
||||
</view>
|
||||
|
@ -58,8 +58,8 @@
|
|||
</view> -->
|
||||
|
||||
<view class="more">
|
||||
<view v-if="getIsShow()"> 出货单号:SHD20230901132333 </view>
|
||||
<view v-if="getIsShow()"></view>
|
||||
<view v-if="state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentSettlement || state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentNoPay"> 出货单号:{{ state.order.orderNumber }} </view>
|
||||
<view v-if="state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentSettlement || state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentNoPay"></view>
|
||||
<view v-for="(item, index) in gridList1" :key="index">
|
||||
<text v-if="item.name">{{ item.name }}:</text
|
||||
><text
|
||||
|
@ -74,7 +74,7 @@
|
|||
<view class="mt-30">
|
||||
<u-line></u-line>
|
||||
</view>
|
||||
<view class="more">
|
||||
<view class="more" v-if="state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentSettlement">
|
||||
<view v-for="(item, index) in gridList2" :key="index">
|
||||
<text v-if="item.name">{{ item.name }}:</text
|
||||
><text
|
||||
|
@ -84,13 +84,24 @@
|
|||
</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="more" v-if="state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentNoPay || state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentPay">
|
||||
<view v-for="(item, index) in gridList3" :key="index">
|
||||
<text v-if="item.name">{{ item.name }}:</text
|
||||
><text
|
||||
>{{ item.isBefore ? item.unit : "" }}
|
||||
{{ item.num }}
|
||||
{{ item.isBefore ? "" : item.unit }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="op-btn">
|
||||
<view class="c-btn-review" v-if="state.order.scaleStatus === 2">
|
||||
<view class="c-btn-review" v-if="state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentSettlement">
|
||||
<view @click="handleReviewNoPay"> 出货未结算 </view>
|
||||
<view class="active" @click="handleReviewPay"> 出货并结算 </view>
|
||||
</view>
|
||||
<view v-if="state.order.scaleStatus === 2">
|
||||
<view v-if="state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentSettlement">
|
||||
<u-button
|
||||
text="重新过毛"
|
||||
plain
|
||||
|
@ -101,12 +112,13 @@
|
|||
}"
|
||||
></u-button>
|
||||
</view>
|
||||
<view v-if="state.order.scaleStatus === 3">
|
||||
<view>
|
||||
<u-button
|
||||
text="确认支付"
|
||||
v-if="state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentNoPay"
|
||||
@click="handleSettlement"
|
||||
text="立即结算"
|
||||
type="primary"
|
||||
:customStyle="{ 'border-radius': '43rpx' }"
|
||||
@click="handleReviewPay"
|
||||
></u-button>
|
||||
</view>
|
||||
<view>
|
||||
|
@ -142,6 +154,7 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { ShipmentApi } from "@/services/index";
|
||||
import { ScaleStatusBtnType } from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
const keyword = ref("");
|
||||
const contrlModalParams = reactive<{ [attrName: string]: any }>({
|
||||
|
@ -195,7 +208,12 @@ const state = reactive<{
|
|||
order: Shipment;
|
||||
[attrName: string]: any;
|
||||
}>({
|
||||
order: {},
|
||||
order: {
|
||||
id: '',
|
||||
buttonType: 0,
|
||||
netWeight: 0,
|
||||
|
||||
},
|
||||
sheetList: [
|
||||
{
|
||||
key: "paySelect",
|
||||
|
@ -204,7 +222,7 @@ const state = reactive<{
|
|||
key: "printSelect",
|
||||
},
|
||||
],
|
||||
scaleStatus: 2,
|
||||
scaleStatusBtnType: 0,
|
||||
});
|
||||
const gridList1 = reactive([
|
||||
{
|
||||
|
@ -246,21 +264,21 @@ const gridList2 = reactive([
|
|||
{},
|
||||
{
|
||||
name: "毛重",
|
||||
enName: "signGrossWeight",
|
||||
enName: "settlementGross",
|
||||
num: "",
|
||||
unit: "KG",
|
||||
isBefore: false,
|
||||
},
|
||||
{
|
||||
name: "皮重",
|
||||
enName: "signTare",
|
||||
enName: "settlementTare",
|
||||
num: "",
|
||||
unit: "KG",
|
||||
isBefore: false,
|
||||
},
|
||||
{
|
||||
name: "结算重量",
|
||||
enName: "signWeight",
|
||||
enName: "settlementWeight",
|
||||
num: "",
|
||||
unit: "KG",
|
||||
isBefore: false,
|
||||
|
@ -301,9 +319,92 @@ const gridList2 = reactive([
|
|||
isBefore: false,
|
||||
},
|
||||
]);
|
||||
const getIsShow = () => {
|
||||
return state.order.scaleStatus === 2 || state.order.scaleStatus === 4;
|
||||
};
|
||||
|
||||
const gridList3 = reactive([
|
||||
{
|
||||
name: "客户名称",
|
||||
enName: "userName",
|
||||
num: "",
|
||||
isBefore: false,
|
||||
},
|
||||
{
|
||||
name: "结算人",
|
||||
enName: "userName",
|
||||
num: "",
|
||||
isBefore: false,
|
||||
},
|
||||
{
|
||||
name: "结算时间",
|
||||
enName: "signTime",
|
||||
num: "",
|
||||
isBefore: false,
|
||||
},
|
||||
{},
|
||||
{
|
||||
name: "结算重量",
|
||||
enName: "settlementWeight",
|
||||
num: 0,
|
||||
unit: "KG",
|
||||
isBefore: false,
|
||||
},
|
||||
{
|
||||
name: "结算单价",
|
||||
enName: "unitPrice",
|
||||
num: "",
|
||||
unit: "元/KG",
|
||||
isBefore: false,
|
||||
},
|
||||
{
|
||||
name: "预估总价",
|
||||
enName: "estimatePrice",
|
||||
num: "",
|
||||
unit: "元",
|
||||
isBefore: false,
|
||||
},
|
||||
{
|
||||
name: "结算金额",
|
||||
enName: "totalPrice",
|
||||
num: "",
|
||||
unit: "元",
|
||||
isBefore: false,
|
||||
},
|
||||
{
|
||||
name: "运费",
|
||||
enName: "freight",
|
||||
num: "",
|
||||
unit: "元",
|
||||
isBefore: false,
|
||||
},
|
||||
{
|
||||
name: "杂费",
|
||||
enName: "incidentals",
|
||||
num: "",
|
||||
unit: "元",
|
||||
isBefore: false,
|
||||
},
|
||||
{
|
||||
name: "实际收入",
|
||||
enName: "incidentals",
|
||||
num: "",
|
||||
unit: "元",
|
||||
isBefore: false,
|
||||
},
|
||||
{},
|
||||
// 客户过磅净重-机器过磅净重
|
||||
{
|
||||
name: "净重误差",
|
||||
enName: "netWeightError",
|
||||
num: "",
|
||||
unit: "KG",
|
||||
isBefore: false,
|
||||
},
|
||||
]);
|
||||
// 立即结算 // 先填写结算信息后更新状态为4
|
||||
const handleSettlement = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesShipment/form/settlementForm?id=" + state.order.id + `&scaleStatusBtnType=${ScaleStatusBtnType.ShipmentPay}`, // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
const handleScenePhoto = (imagesId: number) => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesScenePhoto/index?orderType=1&id=" + imagesId, // 要跳转到的页面路径
|
||||
|
@ -312,7 +413,7 @@ const handleScenePhoto = (imagesId: number) => {
|
|||
// 出货未结算 // 先填写结算信息后更新状态为3
|
||||
const handleReviewNoPay = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesShipment/form/settlementForm?id=" + state.order.id, // 要跳转到的页面路径
|
||||
url: "/pagesShipment/form/settlementForm?id=" + state.order.id + `&scaleStatusBtnType=${ScaleStatusBtnType.ShipmentNoPay}`, // 要跳转到的页面路径
|
||||
});
|
||||
// ShipmentApi.updateOrderIn({ ...state.order, scaleStatus: 3 }).then((res) => {
|
||||
// if (res.code === 200) {
|
||||
|
@ -324,7 +425,9 @@ const handleReviewNoPay = () => {
|
|||
};
|
||||
// 审核立即支付
|
||||
const handleReviewPay = () => {
|
||||
contrlModalParams.paySelect.isShow = true;
|
||||
uni.navigateTo({
|
||||
url: "/pagesShipment/form/settlementForm?id=" + state.order.id + `&scaleStatusBtnType=${ScaleStatusBtnType.ShipmentPay}`, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
|
||||
const handleSelect = (key: string, v: any) => {
|
||||
|
@ -372,26 +475,36 @@ const handleUpdateOrder = () => {
|
|||
});
|
||||
};
|
||||
onLoad((option) => {
|
||||
|
||||
state.order.id = (option as any).id;
|
||||
state.scaleStatus = parseInt((option as any).scaleStatus);
|
||||
state.scaleStatusBtnType = parseInt((option as any).scaleStatusBtnType);
|
||||
if (state.order.id) {
|
||||
ShipmentApi.getDetailById({ id: state.order.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
state.order = res.data;
|
||||
// gridList1.map((item) => {
|
||||
// if (item.name === "扣杂" || item.name === "扣点") {
|
||||
// if (state.order.buttonType === 0) {
|
||||
// item.name = "扣杂";
|
||||
// item.enName = "buckleMiscellaneous";
|
||||
// item.unit = "KG";
|
||||
// } else if (state.order.buttonType === 1) {
|
||||
// item.name = "扣点";
|
||||
// item.enName = "points";
|
||||
// item.unit = "%";
|
||||
// }
|
||||
// }
|
||||
// item.num = state.order[item.enName as string];
|
||||
// });
|
||||
gridList1.map((item) => {
|
||||
// if (item.name === "扣杂" || item.name === "扣点") {
|
||||
// if (state.order.buttonType === 0) {
|
||||
// item.name = "扣杂";
|
||||
// item.enName = "buckleMiscellaneous";
|
||||
// item.unit = "KG";
|
||||
// } else if (state.order.buttonType === 1) {
|
||||
// item.name = "扣点";
|
||||
// item.enName = "points";
|
||||
// item.unit = "%";
|
||||
// }
|
||||
// }
|
||||
item.num = state.order[item.enName as string];
|
||||
});
|
||||
gridList2.map((item) => {
|
||||
item.num = state.order[item.enName as string];
|
||||
});
|
||||
gridList3.map((item) => {
|
||||
if (item.name === '净重误差') {
|
||||
item.num = (state.order as any).netWeight - (state.order as any).settlementNet
|
||||
}
|
||||
item.num = state.order[item.enName as string];
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -32,10 +32,10 @@
|
|||
<view class="c-layout">
|
||||
<view
|
||||
><checkbox
|
||||
value="cb"
|
||||
:color="'#00D2E3'"
|
||||
:checked="state.checkMap[(item.id as number)]"
|
||||
:checked="state.checkMap[item.id + '']"
|
||||
style="transform: scale(0.5)"
|
||||
@click="state.checkMap[item.id + ''] = !state.checkMap[item.id + '']"
|
||||
/></view>
|
||||
<view class="inner-box">
|
||||
<view class="top-flex-box">
|
||||
|
@ -60,11 +60,11 @@
|
|||
<text class="btn">
|
||||
<text
|
||||
v-if="currentTab === 2"
|
||||
@click="handleReview(item.id as number, 2)"
|
||||
@click="handleReview(item.id, 2)"
|
||||
>出货结算</text
|
||||
>
|
||||
<text v-if="currentTab === 3" @click="handleReview(item.id as number, 3)">去结算</text>
|
||||
<text v-if="currentTab === 4" @click="handleReview(item.id as number, 4)">查看</text>
|
||||
<text v-if="currentTab === 3" @click="handleReview(item.id, 3)">去结算</text>
|
||||
<text v-if="currentTab === 4" @click="handleReview(item.id, 4)">查看</text>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -89,6 +89,7 @@
|
|||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ShipmentApi } from "@/services/index";
|
||||
import { ScaleStatusBtnType } from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
// scaleStatus
|
||||
interface PageResult<T> {
|
||||
|
@ -97,7 +98,7 @@ interface PageResult<T> {
|
|||
pageNum: number;
|
||||
pageSize: number;
|
||||
}
|
||||
const pageList: PageResult<Order> = reactive({
|
||||
const pageList: PageResult<Shipment> = reactive({
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
|
@ -130,9 +131,17 @@ const handleTab = (item: any) => {
|
|||
currentTab.value = item.key;
|
||||
getOrderList();
|
||||
};
|
||||
const handleReview = (id: number, scaleStatus: number) => {
|
||||
const handleReview = (id: string, scaleStatus: number) => {
|
||||
let type = ScaleStatusBtnType.ShipmentSettlement
|
||||
if (scaleStatus === 2) {
|
||||
type = ScaleStatusBtnType.ShipmentSettlement
|
||||
} else if (scaleStatus === 3) {
|
||||
type = ScaleStatusBtnType.ShipmentNoPay
|
||||
} else if (scaleStatus === 4) {
|
||||
type = ScaleStatusBtnType.ShipmentPay
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: "/pagesShipment/review/index?id=" + id + `&scaleStatus=`+ scaleStatus, // 要跳转到的页面路径
|
||||
url: "/pagesShipment/review/index?id=" + id + `&scaleStatusBtnType=${type}`, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const handleSelect = () => {
|
||||
|
@ -140,6 +149,7 @@ const handleSelect = () => {
|
|||
Object.keys(state.checkMap).forEach((item) => {
|
||||
state.checkMap[item] = state.isAll;
|
||||
});
|
||||
console.log(state.checkMap)
|
||||
};
|
||||
const getOrderList = () => {
|
||||
ShipmentApi.getOrderPage({ pageNumber: 1, pageSize: 10, scaleStatus: currentTab.value }).then(
|
||||
|
@ -147,7 +157,7 @@ const getOrderList = () => {
|
|||
if (res.code === 200) {
|
||||
(pageList as any).list = res.data.list;
|
||||
(res.data.list as any).forEach((item: any) => {
|
||||
state.checkMap[parseInt(item.id)] = false;
|
||||
state.checkMap[item.id] = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ export const addAnnex = (data: any) => {
|
|||
};
|
||||
|
||||
// 获取图片资源
|
||||
export const getAnnex = (data: {businessId: number, orderType: number, imagesType: ImagesType | any}) => {
|
||||
export const getAnnex = (data: {businessId: string, orderType: number, imagesType: ImagesType | any}) => {
|
||||
return http<Resource>({
|
||||
method: "GET",
|
||||
url: "/api/annex/getAnnex",
|
||||
|
|
|
@ -16,7 +16,7 @@ interface Order {
|
|||
tare?: string; //皮重
|
||||
grossTime?: string; //过毛日期
|
||||
tareTime?: string; //过皮日期
|
||||
netWeight?: string; //净重
|
||||
netWeight?: number; //净重
|
||||
buttonType?: number; //扣杂状态:0扣杂1扣点
|
||||
points?: number; //扣点
|
||||
buckleMiscellaneous?: number; //扣杂
|
||||
|
@ -70,7 +70,7 @@ type PageParams = {
|
|||
};
|
||||
|
||||
interface Shipment {
|
||||
id?: string;
|
||||
id: string;
|
||||
userId?: number; //供应商id
|
||||
productId?: number; //产品id
|
||||
cardId?: number; //库存卡id
|
||||
|
@ -83,7 +83,7 @@ interface Shipment {
|
|||
grossTime?: string; //过毛时间
|
||||
tare?: number; //皮重
|
||||
tareTime?: string; //过皮时间
|
||||
netWeight?: string; //净重
|
||||
netWeight?: number; //净重
|
||||
number?: number; //数量
|
||||
notes?: string; //备注
|
||||
settlementNotes?: string; //结算备注
|
||||
|
@ -95,7 +95,7 @@ interface Shipment {
|
|||
incidentals?: string; //杂费
|
||||
pricingPerson?: string; //定价人
|
||||
reviewerId?: string; //审核人
|
||||
buttonType?: string; //扣点状态:默认0:扣杂1扣点
|
||||
buttonType: number; //扣点状态:默认0:扣杂1扣点
|
||||
points?: string; //扣点
|
||||
buckleMiscellaneous?: string; //扣杂
|
||||
unitPrice?: string; //结算单价
|
||||
|
@ -109,6 +109,12 @@ interface Shipment {
|
|||
updateUserId?: string; //undefined
|
||||
updateTime?: string; //undefined
|
||||
isDeleted?: string; //删除标识true删除,false未删除
|
||||
settlementWeight?: number, // 结算重量
|
||||
settlementGross?: number, // 结算毛重
|
||||
settlementTare?: number, // 结算皮重
|
||||
settlementNet?: number, // 结算净重
|
||||
signTime?: string, // 签收时间
|
||||
paymentMethod?: string; //支付方式:0:未支付,1:现金支付,2:银行卡支付,3:线上支付(微信)4:支付宝
|
||||
[attrName: string]: any;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,11 +20,12 @@ export enum MultiCategory {
|
|||
Multiple = 1,
|
||||
}
|
||||
|
||||
// 0:普通资源1:皮重 2毛重
|
||||
// 0:普通资源1:皮重 2毛重 3 结算单据
|
||||
export enum ImagesType {
|
||||
NORMARL = 0,
|
||||
Tare = 1,
|
||||
GROSSWEIGHT = 2,
|
||||
Settlement = 3
|
||||
}
|
||||
//磅单状态:0:待定价1:待过皮2:待审核3:已审核待支付4:已支付
|
||||
// 磅单状态:0:待出货1:待过毛2:待审核3:已审未付4:已审已付
|
||||
|
@ -40,6 +41,12 @@ export enum ScaleStatus {
|
|||
ToBeShipmentPay = 3,
|
||||
ShipmentPaid = 4
|
||||
}
|
||||
// 1 出货结算 2 出货未结算 3 出货并结算
|
||||
export enum ScaleStatusBtnType {
|
||||
ShipmentSettlement = 1,
|
||||
ShipmentNoPay = 2,
|
||||
ShipmentPay = 3
|
||||
}
|
||||
// 支付方式:0:未支付,1:现金支付,2:银行卡支付,3:线上支付(微信)4:支付宝
|
||||
export enum PaymentMethod {
|
||||
NoPay = 0,
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
export function formatDate(time: any, cFormat: string) {
|
||||
const format = cFormat || "{y}-{m}-{d}";
|
||||
const date = new Date(time);
|
||||
const formatObj:any = {
|
||||
//年
|
||||
y: date.getFullYear(),
|
||||
//月
|
||||
m: date.getMonth() + 1,
|
||||
//日
|
||||
d: date.getDate(),
|
||||
//小时
|
||||
h: date.getHours(),
|
||||
//分钟
|
||||
i: date.getMinutes(),
|
||||
//秒
|
||||
s: date.getSeconds(),
|
||||
//星期
|
||||
a: date.getDay(),
|
||||
};
|
||||
const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
|
||||
const value = formatObj[key];
|
||||
// Note: getDay() returns 0 on Sunday
|
||||
if (key === "a") {
|
||||
//如果key是a,就是星期,格式化成一~日
|
||||
//例如formatDate(new Date(), '{y}-{m}-{d}-{h}-{i}-{s}-{a}');
|
||||
//会输出2021-10-29-00-00-00-五
|
||||
//星期的value会返回0-6,['日', '一', '二', '三', '四', '五', '六'][2]代表周二
|
||||
return ["日", "一", "二", "三", "四", "五", "六"][value];
|
||||
}
|
||||
//padStart用于字符串头部补全,2个字符,如果不够前面补0
|
||||
return value.toString().padStart(2, "0");
|
||||
});
|
||||
return time_str;
|
||||
}
|
Loading…
Reference in New Issue