update: 更新出货入库

This commit is contained in:
admin 2024-03-12 14:42:34 +08:00
parent 5b43226d3f
commit 136f99b639
7 changed files with 300 additions and 52 deletions

View File

@ -356,6 +356,78 @@ const appList = reactive([
});
},
},
{
icon: "app1.png",
title: "收货产品",
fn: () => {
// uni.navigateTo({
// url: "/pagesApp/receiveSpl", //
// });
},
},
{
icon: "app2.png",
title: "收货分类",
fn: () => {
// uni.navigateTo({
// url: "/pagesApp/shipmentSpl", //
// });
},
},
{
icon: "app4.png",
title: "出货产品",
fn: () => {
// uni.navigateTo({
// url: "/pagesApp/receiveDetail", //
// });
},
},
{
icon: "app3.png",
title: "支付明细",
fn: () => {
// uni.navigateTo({
// url: "/pagesApp/shipmentDetail", //
// });
},
},
{
icon: "app5.png",
title: "收入明细",
fn: () => {
// uni.navigateTo({
// url: "/pagesApp/receiveCl", //
// });
},
},
{
icon: "app6.png",
title: "人员管理",
fn: () => {
// uni.navigateTo({
// url: "/pagesApp/shipmentCl", //
// });
},
},
{
icon: "app7.png",
title: "权限管理",
fn: () => {
// uni.navigateTo({
// url: "/pagesApp/supplierMgt", //
// });
},
},
{
icon: "app8.png",
title: "库存卡管理",
fn: () => {
// uni.navigateTo({
// url: "/pagesApp/customerMgt", //
// });
},
},
]);
const tabMenuList = reactive([

View File

@ -11,7 +11,7 @@
<u-form-item
:prop="`order[${item.key}]`"
:label="item.name"
required
:required="item.required"
v-for="(item, index) in formAttrList"
:key="index"
@click="item.fn"
@ -38,18 +38,20 @@
<text v-else>
{{ item.unit }}
</text>
</template>
</u-input>
<!-- @afterRead="afterRead"
@delete="deletePic" -->
<u-upload
<uni-file-picker
v-if="item.type === 'upload'"
:fileList="[]"
name="1"
multiple
:maxCount="10"
></u-upload>
v-model="model1.order.fileList"
limit="10"
title="最多可上传10张图片"
:auto-upload="false"
fileMediatype="image"
mode="grid"
ref="filesRef"
></uni-file-picker>
<u-radio-group
v-if="item.type === 'radio'"
@ -69,24 +71,33 @@
:show="contrlModalParams.isShowSplTime"
v-model="contrlModalParams.spltime"
mode="datetime"
@confirm="contrlModalParams.isShowSplTime = false"
@confirm="(v: any) => {handleTime(v)}"
@cancel="contrlModalParams.isShowSplTime = false"
></u-datetime-picker>
<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="保存"></u-button>
<u-button type="primary" text="保存" @click="save()"></u-button>
</view>
</template>
<script setup lang="ts">
const model1 = reactive({
import { PictureApi, ReceiveApi } from "@/services";
import { formatDate } from "@/utils";
import { ImagesType, OrderType } from "@/utils/enum";
const model1 = reactive<any>({
order: {
fileList: [],
splTime: "",
subtractType: 1,
},
@ -105,10 +116,10 @@ const rules = ref({
trigger: ["blur", "change"],
},
});
const contrlModalParams = reactive({
const contrlModalParams = reactive<any>({
isShowSplTime: false,
spltime: "",
select: {
device: {
isShow: false,
title: "标题",
selectList: [
@ -120,22 +131,35 @@ const contrlModalParams = reactive({
},
],
},
user: {
isShow: false,
title: "标题",
list: [],
},
product: {
isShow: false,
title: "标题",
list: [],
},
});
const formAttrList = reactive([
{
name: "补单时间",
key: "splTime",
key: "repairTime",
type: "select",
unit: "",
required: true,
fn: () => {
contrlModalParams.isShowSplTime = true;
},
},
{
name: "站点磅秤",
key: "stationScale",
key: "deviceName",
type: "select",
childKey: 'device',
required: true,
unit: "",
fn: () => {
contrlModalParams.select.isShow = true;
@ -144,8 +168,10 @@ const formAttrList = reactive([
},
{
name: "供应商",
key: "supplier",
key: "userName",
type: "select",
childKey: 'user',
required: true,
unit: "",
fn: () => {
contrlModalParams.select.isShow = true;
@ -154,14 +180,16 @@ const formAttrList = reactive([
},
{
name: "车牌号",
key: "carNo",
key: "carNumber",
type: "input",
unit: "",
},
{
name: "收货产品",
key: "receiveProduct",
key: "productName",
type: "select",
childKey: 'product',
required: true,
unit: "",
fn: () => {
contrlModalParams.select.isShow = true;
@ -172,17 +200,19 @@ const formAttrList = reactive([
name: "毛重",
key: "grossWeight",
type: "input",
required: true,
unit: "KG",
},
{
name: "皮重",
key: "tare",
type: "input",
required: true,
unit: "KG",
},
{
name: "扣杂",
key: "subtractType",
key: "buttonType",
type: "radio",
},
{
@ -199,25 +229,27 @@ const formAttrList = reactive([
},
{
name: "单价",
key: "unitPrice",
key: "price",
type: "input",
required: true,
unit: "元/KG",
},
{
name: "预估总价",
key: "estimatedTotalPrice",
key: "totalPrice",
type: "input",
unit: "元",
},
{
name: "贷款金额",
key: "loanAmount",
key: "balanceTotalPrice",
type: "input",
required: true,
unit: "元",
},
{
name: "备注",
key: "remark",
key: "notes",
type: "textarea",
},
{
@ -226,6 +258,59 @@ const formAttrList = reactive([
type: "upload",
},
]);
const filesRef = ref();
const handleUpload = () => {
// console.log(event.tempFilePaths)
const list = filesRef.value[0].filesList;
return list.map((item: any) => {
return new Promise((resolve) => {
PictureApi.upload({
files: item,
path: item.path,
}).then((res) => {
if (res.code === 200) {
resolve({
...(res.data as any),
businessId: (model1.order as any).id,
imagesType: ImagesType.NORMARL, //
orderType: OrderType.Receive, //
});
}
});
});
});
};
const save = () => {
Promise.all(handleUpload()).then((res) => {
//
if (res.length > 0) {
PictureApi.addListAnnex({ annexPos: res }).then((res1) => {
if (res1.code === 200) {
uni.showToast({
title: "图片资源上传成功",
icon: "success",
});
}
});
}
});
if (model1.order.buttonType === 0) {
model1.order.buckleMiscellaneous = model1.order.subtractNum;
} else if (model1.order.buttonType === 1) {
model1.order.points = model1.order.subtractNum;
}
ReceiveApi.addOrderIn(model1.order).then((res) => {
if (res.code === 200) {
uni.navigateTo({
url: "/pages/index/index", //
});
}
});
};
const handleTime = (v: any) => {
model1.order.repairTime = formatDate(v.value, "{y}-{m}-{d} {h}:{i}:{s}");
contrlModalParams.isShowSplTime = false;
};
</script>
<style lang="scss" scoped>
.c-card {

View File

@ -291,7 +291,7 @@ onLoad((option) => {
}
});
PictureApi.getAnnex({
businessId: model1.order.id,
businessId: model1.order.id.toString(),
orderType: 1,
imagesType: ImagesType.NORMARL,
}).then((res) => {

View File

@ -83,6 +83,7 @@
border: '1px solid #00DCEE',
'border-radius': '43rpx',
}"
@click="handleReWeight()"
></u-button>
</view>
<view v-if="state.order.scaleStatus === 3">
@ -309,6 +310,16 @@ const handleUpdateOrder = () => {
url: "/pagesReceive/form/pricingForm?id=" + state.order.id, //
});
};
//
const handleReWeight = () => {
ReceiveApi.reTare({ id: state.order.id }).then((res) => {
if (res.code === 200) {
uni.navigateTo({
url: "/pagesReceive/tareing", //
});
}
});
};
onLoad((option) => {
state.order.id = parseInt((option as any).id);
state.scaleStatus = parseInt((option as any).scaleStatus);

View File

@ -30,7 +30,10 @@
></u-tag
></view>
<!-- 点击待出货结算-->
<view v-if="state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentSettlement"
<view
v-if="
state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentSettlement
"
><u-tag
text="编辑信息"
plain
@ -44,7 +47,13 @@
</view>
</view>
<!-- 出库 过磅时间对应过皮时间 -->
<view class="flex-box" v-if="state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentSettlement || state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentNoPay">
<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 +67,22 @@
</view> -->
<view class="more">
<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-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 +97,12 @@
<view class="mt-30">
<u-line></u-line>
</view>
<view class="more" v-if="state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentSettlement">
<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
@ -85,7 +113,13 @@
</view>
</view>
<view class="more" v-if="state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentNoPay || state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentPay">
<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
@ -97,11 +131,20 @@
</view>
</view>
<view class="op-btn">
<view class="c-btn-review" v-if="state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentSettlement">
<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.scaleStatusBtnType === ScaleStatusBtnType.ShipmentSettlement">
<view
v-if="
state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentSettlement
"
>
<u-button
text="重新过毛"
plain
@ -110,12 +153,13 @@
border: '1px solid #00DCEE',
'border-radius': '43rpx',
}"
@click="handleReWeight()"
></u-button>
</view>
<view>
<u-button
v-if="state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentNoPay"
@click="handleSettlement"
v-if="state.scaleStatusBtnType === ScaleStatusBtnType.ShipmentNoPay"
@click="handleSettlement"
text="立即结算"
type="primary"
:customStyle="{ 'border-radius': '43rpx' }"
@ -209,10 +253,9 @@ const state = reactive<{
[attrName: string]: any;
}>({
order: {
id: '',
id: "",
buttonType: 0,
netWeight: 0,
},
sheetList: [
{
@ -402,9 +445,12 @@ const gridList3 = reactive([
// // 4
const handleSettlement = () => {
uni.navigateTo({
url: "/pagesShipment/form/settlementForm?id=" + state.order.id + `&scaleStatusBtnType=${ScaleStatusBtnType.ShipmentPay}`, //
url:
"/pagesShipment/form/settlementForm?id=" +
state.order.id +
`&scaleStatusBtnType=${ScaleStatusBtnType.ShipmentPay}`, //
});
}
};
const handleScenePhoto = (imagesId: number) => {
uni.navigateTo({
url: "/pagesScenePhoto/index?orderType=1&id=" + imagesId, //
@ -413,7 +459,10 @@ const handleScenePhoto = (imagesId: number) => {
// // 3
const handleReviewNoPay = () => {
uni.navigateTo({
url: "/pagesShipment/form/settlementForm?id=" + state.order.id + `&scaleStatusBtnType=${ScaleStatusBtnType.ShipmentNoPay}`, //
url:
"/pagesShipment/form/settlementForm?id=" +
state.order.id +
`&scaleStatusBtnType=${ScaleStatusBtnType.ShipmentNoPay}`, //
});
// ShipmentApi.updateOrderIn({ ...state.order, scaleStatus: 3 }).then((res) => {
// if (res.code === 200) {
@ -426,7 +475,10 @@ const handleReviewNoPay = () => {
//
const handleReviewPay = () => {
uni.navigateTo({
url: "/pagesShipment/form/settlementForm?id=" + state.order.id + `&scaleStatusBtnType=${ScaleStatusBtnType.ShipmentPay}`, //
url:
"/pagesShipment/form/settlementForm?id=" +
state.order.id +
`&scaleStatusBtnType=${ScaleStatusBtnType.ShipmentPay}`, //
});
};
@ -474,8 +526,18 @@ const handleUpdateOrder = () => {
url: "/pagesShipment/form/shipmentForm?id=" + state.order.id, //
});
};
onLoad((option) => {
//
const handleReWeight = () => {
ShipmentApi.reGrossWeight({ id: state.order.id }).then((res) => {
if (res.code === 200) {
uni.navigateTo({
url: "/pagesShipment/grossWeight", //
});
}
});
};
onLoad((option) => {
state.order.id = (option as any).id;
state.scaleStatusBtnType = parseInt((option as any).scaleStatusBtnType);
if (state.order.id) {
@ -500,8 +562,10 @@ onLoad((option) => {
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
if (item.name === "净重误差") {
item.num =
(state.order as any).netWeight -
(state.order as any).settlementNet;
}
item.num = state.order[item.enName as string];
});

View File

@ -30,8 +30,8 @@ export const getDetailById = (data: {id: number}) => {
};
// 新增收货单
export const addOrderIn = (data: any) => {
return http<Result>({
export const addOrderIn = (data: Order) => {
return http({
method: "POST",
url: "/api/orderIn/addOrderIn",
data,
@ -97,6 +97,14 @@ export const OrderInRanking = () => {
});
};
// 重新过皮
export const reTare = (data: any) => {
return http({
method: "POST",
url: "/api/orderIn/skinning",
data,
});
};

View File

@ -91,6 +91,14 @@ export const updateOrderIn = (data: any) => {
data,
});
};
// 重新过毛
export const reGrossWeight = (data: any) => {
return http({
method: "POST",
url: "/api/orderOut/hairdressing",
data,
});
};