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