update: 优化细节

This commit is contained in:
admin 2024-05-20 13:56:40 +08:00
parent dc95484bf5
commit b0e31d9d9e
13 changed files with 134 additions and 60 deletions

View File

@ -71,7 +71,7 @@
<view class="num">{{
formatMoney(state.summary.totalPaidPrice)
}}</view>
<view>实收金额</view>
<view>已付金额</view>
</view>
</up-col>
<up-col span="4">

View File

@ -247,8 +247,8 @@ const state = reactive({
const currentSpl = ref<any>(null);
const splBtnList = [
{ key: null, name: "全部" },
{ key: false, name: "补单" },
{ key: true, name: "未补单" },
{ key: false, name: "手工补单" },
{ key: true, name: "系统单" },
];
const deliveryMethod = ref<any>(null);
const deliveryMethodBtnList = [
@ -441,7 +441,7 @@ const getFilter = () => {
</script>
<style lang="scss" scoped>
.box {
padding: 60rpx 30rpx;
padding: 60rpx 30rpx 150rpx;
::v-deep .u-cell__value {
font-size: 26rpx;
}

View File

@ -159,7 +159,7 @@ const startSave = () => {
if (model1.formData.id) {
GoodsApi.editShipmentCategory({
id: model1.formData.id,
shmCategoryName: model1.formData.name,
shmCategoryName: model1.formData.shmCategoryName,
parentId: model1.formData.parentId,
}).then((res) => {
if (res.code === 200) {

View File

@ -3,7 +3,7 @@
<u-form
labelPosition="left"
:model="model1"
:rules="rules"
:rules="model1.formData.id ? rules1 : rules2"
ref="form"
:labelWidth="100"
:labelStyle="{ padding: '0rpx 10rpx' }"
@ -33,7 +33,11 @@
border="none"
@change="(e:any) => {handleInput(e, item)}"
:disabled="item.type === 'select'"
:disabledColor="['卡号', '供应商分类'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'"
:disabledColor="
['卡号', '供应商分类'].indexOf(item.name) > -1
? '#ffffff'
: '#f5f7fa'
"
@clear="handleClear(item)"
>
<template #suffix>
@ -71,10 +75,10 @@ import valid from "@/utils/validate";
import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore";
const handleClear = (item: any) => {
(model1.formData as any)[item.key] = '';
}
(model1.formData as any)[item.key] = "";
};
const handleInput = (e: any, item: any) => {
if (item.key === "phone" || item.key === 'bankNumber') {
if (item.key === "phone" || item.key === "bankNumber") {
const temp = e?.replace(valid.valid_number, "");
setTimeout(() => {
model1.formData[item.key] = temp;
@ -84,7 +88,21 @@ const handleInput = (e: any, item: any) => {
const model1 = reactive<any>({
formData: {},
});
const rules = ref({
const rules1 = ref({
"formData.name": {
type: "string",
required: true,
message: "请输入供应商",
trigger: ["blur", "change"],
},
"formData.supplierTypeName": {
type: "string",
required: true,
message: "请选择供应商分类",
trigger: ["blur", "change"],
},
});
const rules2 = ref({
"formData.stockCardName": {
type: "string",
required: true,
@ -127,11 +145,11 @@ const formAttrList = reactive<any>([
key: "stockCardName",
type: "select",
childKey: "stockCard",
required: true,
// required: true,
fn: () => {
if (contrlModalParams.stockCard.list.length === 0) {
uni.showToast({icon: 'none', title: '当前无可用卡号,请添加入库卡'})
return
uni.showToast({ icon: "none", title: "当前无可用卡号,请添加入库卡" });
return;
}
contrlModalParams.stockCard.isShow = true;
contrlModalParams.stockCard.title = "卡号";
@ -262,13 +280,13 @@ const startSave = () => {
if (model1.formData.id) {
SupplierApi.updateSupplierUser(model1.formData).then((res) => {
if (res.code === 200) {
uni.navigateBack()
uni.navigateBack();
}
});
} else {
SupplierApi.addSupplierUser(model1.formData).then((res) => {
if (res.code === 200) {
uni.navigateBack()
uni.navigateBack();
}
});
}
@ -283,7 +301,8 @@ const getSupplierTypeList = () => {
};
const getStockCardList = () => {
StockCardApi.getStockCardListInfo({ vincolante: StockCardType.Receive }).then((res) => {
StockCardApi.getStockCardListInfo({ vincolante: StockCardType.Receive }).then(
(res) => {
if (res.code === 200) {
contrlModalParams.stockCard.list = (res.data as any).map(
(item: any) => {
@ -291,7 +310,8 @@ const getStockCardList = () => {
}
);
}
});
}
);
};
onMounted(() => {
@ -299,10 +319,24 @@ onMounted(() => {
getStockCardList();
});
onLoad((option) => {
onLoad((option:any) => {
//
const title = (option as any).title;
model1.formData = JSON.parse((option as any).item);
const title = option.title;
SupplierApi.getSupplierUserList({ id: option.item }).then(
(res: any) => {
if (res.code === 200) {
if (res.data.length > 0) {
model1.formData = res.data[0]
} else {
uni.showToast({ title: "未查询到供应商" });
}
}
}
);
//
if (!option.item) {
formAttrList[1].required = true
}
if (model1.formData.cardCode) {
model1.formData.stockCardName = model1.formData.cardCode;
}

View File

@ -95,6 +95,12 @@ const model1 = reactive<any>({
formData: {},
});
const rules1 = ref({
"formData.roleName": {
type: "string",
required: true,
message: "请选择用户角色",
trigger: ["blur", "change"],
},
"formData.userName": {
type: "string",
required: true,
@ -109,6 +115,12 @@ const rules1 = ref({
},
});
const rules2 = ref({
"formData.roleName": {
type: "string",
required: true,
message: "请选择用户角色",
trigger: ["blur", "change"],
},
"formData.userName": {
type: "string",
required: true,
@ -159,6 +171,7 @@ const formAttrList1 = reactive<any>([
key: "roleName",
type: "select",
childKey: "role",
required: true,
fn: () => {
contrlModalParams.role.isShow = true;
contrlModalParams.role.title = "选择角色";
@ -204,6 +217,7 @@ const formAttrList2 = reactive<any>([
key: "roleName",
type: "select",
childKey: "role",
required: true,
fn: () => {
contrlModalParams.role.isShow = true;
contrlModalParams.role.title = "选择角色";

View File

@ -56,7 +56,7 @@
<text v-if="cItem.name">{{ cItem.name }}</text
><text
>{{ cItem.isBefore ? cItem.unit : "" }}
{{ cItem.num }}
{{ cItem.name === '送货方式' ? item[`${cItem.enName}`] === DeliveryMethod.Deliver ? '送货' : '自提' : item[`${cItem.enName}`] }}
{{ cItem.isBefore ? "" : cItem.unit }}
</text>
</view>
@ -68,7 +68,7 @@
<script setup lang="ts">
import { ReceiveApi, ShipmentApi } from "@/services";
import PageView from "@/components/PageView/index.vue";
import { ScaleStatus } from "@/utils/enum";
import { DeliveryMethod, ScaleStatus } from "@/utils/enum";
const keyword = ref("");
const gridList1 = reactive([
@ -156,7 +156,7 @@ const gridList1 = reactive([
},
{
name: "作废人",
enName: "updateUserName",
enName: "updateName",
unit: "",
isBefore: false,
isCustomStyle: true,

View File

@ -200,11 +200,11 @@ const state = reactive({
key: 2,
},
{
name: "已审未付",
name: "待结算",
key: 3,
},
{
name: "已审已付",
name: "已结算",
key: 4,
},
],
@ -334,9 +334,9 @@ const getScaleStatus = (type: number) => {
} else if (type === ScaleStatus.ToBeShipmentReview) {
return "待审核";
} else if (type === ScaleStatus.ToBeShipmentPay) {
return "待支付";
return "待结算";
} else if (type === ScaleStatus.ShipmentPaid) {
return "已支付";
return "已结算";
}
};

View File

@ -541,6 +541,14 @@ const save = () => {
return;
}
}
if (parseFloat(model1.order.tare) > parseFloat(model1.order.grossWeight)) {
uni.showToast({
title: `毛重需大于皮重`,
icon: "none",
});
return;
}
check().then((res) => {
if (res) {
startSave();

View File

@ -30,7 +30,7 @@
<view
>{{
item.type === StockCardType.Shipment ? "客户" : "供应商"
}}{{ item.name }}</view
}}{{ item.customUserName }}</view
>
<view>卡号{{ item.cardCode }}</view>
<view

View File

@ -118,10 +118,11 @@ const update = (item: any) => {
};
const edit = (item: any) => {
console.log(JSON.stringify(item))
uni.navigateTo({
url:
"/pagesApp/components/addSupplier?title=编辑供应商&item=" +
JSON.stringify(item), //
item.id, //
});
};
const getList = (v?: boolean) => {

View File

@ -65,7 +65,9 @@
v-if="item.type === 'radio'"
v-model="(model1.order as any)[item.key]"
placement="row"
:disabled="model1.order.scaleStatus === 1 && item.key === 'weighingMethod'"
:disabled="
model1.order.scaleStatus === 1 && item.key === 'weighingMethod'
"
>
<u-radio
v-for="(c, index) in item.child"
@ -128,15 +130,15 @@ import {
SupplierApi,
} from "@/services/index";
import _ from "underscore";
import { onLoad } from "@dcloudio/uni-app";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { ImagesType, OrderType } from "@/utils/enum";
import SupplierDialog from "../components/SupplierDialog.vue";
import ProductDialog from "../components/ProductDialog.vue";
import valid from "@/utils/validate";
import { countDots } from "@/utils";
const handleClear = (item: any) => {
(model1.order as any)[item.key] = '';
}
(model1.order as any)[item.key] = "";
};
//
const showDialog = <
{
@ -222,7 +224,7 @@ const model1 = reactive<{ order: Order }>({
fileLists: [],
scaleStatus: 1,
netWeight: 0,
balanceTotalPrice: 0
balanceTotalPrice: 0,
},
});
@ -290,7 +292,12 @@ const formAttrList = reactive<ComType>([
childKey: "userSelect",
required: true,
fn: () => {
// handleDialog("showSupplier", true);
uni.navigateTo({
url:
"/pagesApp/components/addSupplier?title=编辑供应商&item=" +
model1.order.userId, //
});
uni.hideKeyboard();
},
},
@ -524,9 +531,14 @@ watch(
实际收入实际结算金额-运费-杂费
*/
if (model1.order.scaleStatus === 0) {
return
return;
}
model1.order.netWeight = parseFloat(((parseFloat(grossWeightNew as any) || 0) - (parseFloat(tareNew as any) || 0)).toFixed(2));
model1.order.netWeight = parseFloat(
(
(parseFloat(grossWeightNew as any) || 0) -
(parseFloat(tareNew as any) || 0)
).toFixed(2)
);
if (model1.order.buttonType === 0) {
if (model1.order.subtractNum) {
model1.order.netWeight =
@ -545,11 +557,11 @@ watch(
}
);
SupplierApi.getSupplierUserList({}).then((res) => {
if (res.code === 200) {
contrlModalParams.userSelect.list = res.data;
}
});
// SupplierApi.getSupplierUserList({}).then((res) => {
// if (res.code === 200) {
// contrlModalParams.userSelect.list = res.data;
// }
// });
ReceiveProductApi.getAllReProducts().then((res) => {
if (res.code === 200) {
contrlModalParams.productSelect.list = _.map(
@ -649,7 +661,8 @@ const save = () => {
}
if (
model1.order.price &&
model1.order.price.toString()[model1.order.price.toString().length - 1] === "."
model1.order.price.toString()[model1.order.price.toString().length - 1] ===
"."
) {
uni.showToast({
title: "请输入正确的单价",
@ -762,6 +775,9 @@ onLoad((option) => {
title: "编辑信息",
});
}
});
onShow(() => {
if (model1.order.id) {
ReceiveApi.getDetailById({ id: model1.order.id }).then((res) => {
if (res.code === 200) {
@ -796,7 +812,7 @@ onLoad((option) => {
}
});
}
});
})
</script>
<style lang="scss" scoped>
.c-card {

View File

@ -20,7 +20,7 @@
></view>
<view
><u-tag
text="货单作废"
text="货单作废"
plain
shape="circle"
:borderColor="'rgba(255, 147, 68, 1) !important'"

View File

@ -29,7 +29,7 @@ interface Order {
points?: number; //扣点
buckleMiscellaneous?: number; //扣杂
price?: number; //单价
balanceTotalPrice: number; //结算总价 货款金额
balanceTotalPrice?: number; //结算总价 货款金额
totalPrice?: number; //实际总价 预估价格
weighingMethod?: number; //称重方式0有皮重 1零皮重
multiCategory?: number; //多品类0单品类 1多品类
@ -211,5 +211,6 @@ interface StockCard {
cardCode?: string,
type?: number, // 库存卡类型1=出库2=入库
cardCode?: string,
name?: string
name?: string,
customUserName?:string
}