update: 更新收货入库细节
This commit is contained in:
parent
b1534cf31e
commit
02ff0c44fe
|
@ -83,21 +83,23 @@ const getList = (v?: boolean) => {
|
||||||
if (state.type === "1") {
|
if (state.type === "1") {
|
||||||
ReceiveApi.getOrderPage(params).then((res) => {
|
ReceiveApi.getOrderPage(params).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
pageList.isLoading = false;
|
||||||
(pageList as any).list = (res.data.list as any).map((item: any) => {
|
(pageList as any).list = (res.data.list as any).map((item: any) => {
|
||||||
return { ...item, isChecked: false };
|
return { ...item, isChecked: false };
|
||||||
});
|
});
|
||||||
pageList.total = (res.data as any).total;
|
pageList.total = (res.data as any).total;
|
||||||
pageList.isLoading = false;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (state.type === "2") {
|
} else if (state.type === "2") {
|
||||||
ShipmentApi.getOrderPage(params).then((res) => {
|
ShipmentApi.getOrderPage(params).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
pageList.isLoading = false;
|
||||||
(pageList as any).list = (res.data.list as any).map((item: any) => {
|
(pageList as any).list = (res.data.list as any).map((item: any) => {
|
||||||
return { ...item, isChecked: false };
|
return { ...item, isChecked: false };
|
||||||
});
|
});
|
||||||
pageList.total = (res.data as any).total;
|
pageList.total = (res.data as any).total;
|
||||||
pageList.isLoading = false;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,7 +150,7 @@ const rules = reactive({
|
||||||
});
|
});
|
||||||
const contrlModalParams = reactive<any>({
|
const contrlModalParams = reactive<any>({
|
||||||
isShowSplTime: false,
|
isShowSplTime: false,
|
||||||
spltime: "",
|
spltime: Number(new Date()),
|
||||||
user: {
|
user: {
|
||||||
isShow: false,
|
isShow: false,
|
||||||
title: "标题",
|
title: "标题",
|
||||||
|
|
|
@ -180,7 +180,7 @@ const rules2 = reactive({
|
||||||
});
|
});
|
||||||
const contrlModalParams = reactive<any>({
|
const contrlModalParams = reactive<any>({
|
||||||
isShowSplTime: false,
|
isShowSplTime: false,
|
||||||
spltime: "",
|
spltime: Number(new Date()),
|
||||||
user: {
|
user: {
|
||||||
isShow: false,
|
isShow: false,
|
||||||
title: "标题",
|
title: "标题",
|
||||||
|
|
|
@ -110,7 +110,7 @@ const model1 = reactive<any>({
|
||||||
order: {
|
order: {
|
||||||
buttonType: 0,
|
buttonType: 0,
|
||||||
fileLists: [],
|
fileLists: [],
|
||||||
splTime: "",
|
splTime:'',
|
||||||
subtractType: 1,
|
subtractType: 1,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -166,7 +166,7 @@ const rules = reactive({
|
||||||
});
|
});
|
||||||
const contrlModalParams = reactive<any>({
|
const contrlModalParams = reactive<any>({
|
||||||
isShowSplTime: false,
|
isShowSplTime: false,
|
||||||
spltime: "",
|
spltime: Number(new Date()),
|
||||||
device: {
|
device: {
|
||||||
isShow: false,
|
isShow: false,
|
||||||
title: "标题",
|
title: "标题",
|
||||||
|
|
|
@ -162,7 +162,7 @@ const rules = reactive({
|
||||||
});
|
});
|
||||||
const contrlModalParams = reactive<any>({
|
const contrlModalParams = reactive<any>({
|
||||||
isShowSplTime: false,
|
isShowSplTime: false,
|
||||||
spltime: "",
|
spltime: Number(new Date()),
|
||||||
device: {
|
device: {
|
||||||
isShow: false,
|
isShow: false,
|
||||||
title: "标题",
|
title: "标题",
|
||||||
|
|
|
@ -108,7 +108,6 @@ const getList = (v?: boolean) => {
|
||||||
}
|
}
|
||||||
pageList.isLoading = true;
|
pageList.isLoading = true;
|
||||||
SupplierApi.getSupplierTypePage(params).then((res: any) => {
|
SupplierApi.getSupplierTypePage(params).then((res: any) => {
|
||||||
if (res.code === 200) {
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
pageList.isLoading = false;
|
pageList.isLoading = false;
|
||||||
(pageList as any).list = (pageList as any).list = pageList.list.concat(
|
(pageList as any).list = (pageList as any).list = pageList.list.concat(
|
||||||
|
@ -116,7 +115,6 @@ const getList = (v?: boolean) => {
|
||||||
);
|
);
|
||||||
pageList.total = (res.data as any).total;
|
pageList.total = (res.data as any).total;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,122 @@
|
||||||
|
<template>
|
||||||
|
<u-popup :show="show" mode="left" :closeable="true" @close="handleClose">
|
||||||
|
<view class="c-dialog-filter">
|
||||||
|
<view class="title">{{ isShipment ? "出货" : "收货" }}产品</view>
|
||||||
|
<view class="dialog-product-layout">
|
||||||
|
<text
|
||||||
|
v-for="(item, index) in state.list"
|
||||||
|
:class="{ active: state.current === item.id }"
|
||||||
|
@click="handleSelect(item)"
|
||||||
|
:key="index"
|
||||||
|
>{{isShipment ? item.shmProductsName : item.reProductsName }}</text
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="btn-confirm">
|
||||||
|
<view class="btn">
|
||||||
|
<u-button type="primary" :text="'确认'"></u-button>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ReceiveProductApi, GoodsApi } from "@/services";
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
show: boolean;
|
||||||
|
isShipment: boolean;
|
||||||
|
}>();
|
||||||
|
const emit = defineEmits(["handleDialog", "changeProduct"]);
|
||||||
|
const handleClose = () => {
|
||||||
|
emit("handleDialog", false);
|
||||||
|
};
|
||||||
|
const state = reactive<any>({
|
||||||
|
list: [],
|
||||||
|
current: -1,
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleSelect = (item: any) => {
|
||||||
|
state.current = item.id;
|
||||||
|
emit("changeProduct", item);
|
||||||
|
emit("handleDialog", false);
|
||||||
|
};
|
||||||
|
const getList = () => {
|
||||||
|
if (props.isShipment) {
|
||||||
|
GoodsApi.getShipmentProductList().then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
state.list = res.data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ReceiveProductApi.getAllReProducts().then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
state.list = res.data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.c-dialog-filter {
|
||||||
|
width: 95vw;
|
||||||
|
padding: 25rpx;
|
||||||
|
.title {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #000000;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 产品dialog
|
||||||
|
.dialog-product-layout {
|
||||||
|
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||||
|
border-radius: 13rpx;
|
||||||
|
margin: 42rpx 25rpx;
|
||||||
|
padding: 19rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
flex-flow: row wrap;
|
||||||
|
max-height: 70vh;
|
||||||
|
overflow: auto;
|
||||||
|
|
||||||
|
text {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #999999;
|
||||||
|
background: #ffffff;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
border: 1px solid rgba(153, 153, 153, 0.64);
|
||||||
|
text-align: center;
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 0rpx 20rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
.active {
|
||||||
|
border-color: $u-primary;
|
||||||
|
color: $u-primary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-confirm {
|
||||||
|
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
|
||||||
|
border-radius: 13rpx 13rpx 0rpx 0rpx;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0rpx;
|
||||||
|
width: 100%;
|
||||||
|
left: 0rpx;
|
||||||
|
padding: 27.56rpx;
|
||||||
|
.btn {
|
||||||
|
text-align: center;
|
||||||
|
::v-deep button {
|
||||||
|
width: 80%;
|
||||||
|
border-radius: 43rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,241 @@
|
||||||
|
<template>
|
||||||
|
<u-popup :show="show" mode="left" :closeable="true" @close="handleClose">
|
||||||
|
<view class="c-dialog-filter">
|
||||||
|
<view class="title">{{isShipment? '客户' : '供应商'}}筛选</view>
|
||||||
|
<view class="search">
|
||||||
|
<u-search
|
||||||
|
:placeholder="`请输入${isShipment? '客户' : '供应商'}名称 / 卡号搜索`"
|
||||||
|
v-model="keyword"
|
||||||
|
@search="handleSearch()"
|
||||||
|
></u-search>
|
||||||
|
</view>
|
||||||
|
<view class="dialog-product-layout">
|
||||||
|
<!-- 自定义索引列表 -->
|
||||||
|
<view class="address-book-container">
|
||||||
|
<!-- 左侧通讯录 -->
|
||||||
|
<scroll-view
|
||||||
|
class="scroll-container"
|
||||||
|
:scroll-y="true"
|
||||||
|
:scroll-into-view="toView"
|
||||||
|
:scroll-with-animation="true"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
class="address-book"
|
||||||
|
v-for="(item, index) in addressBook"
|
||||||
|
:key="index"
|
||||||
|
:id="item.name"
|
||||||
|
>
|
||||||
|
<view class="address-book-index">{{ item.name }}</view>
|
||||||
|
<view
|
||||||
|
class="contact-container"
|
||||||
|
v-for="(cItem, index) in item.list"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<!-- <img
|
||||||
|
class="contact-img"
|
||||||
|
src="http://www.lixia.gov.cn/picture/0/s_97b76c734a6f40f8abba95615cbff1e1.jpg"
|
||||||
|
alt=""
|
||||||
|
/> -->
|
||||||
|
<view
|
||||||
|
class="contact-detail-container"
|
||||||
|
@click="handleClick(cItem)"
|
||||||
|
>
|
||||||
|
<view class="contact-name">{{ cItem.name }}</view>
|
||||||
|
<view class="contact-address">{{ cItem.cardCode }}</view>
|
||||||
|
<!-- <view class="contact-phone">{{ item.phone }}</view> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
|
||||||
|
<!-- 右侧字母导航条 -->
|
||||||
|
<view class="letter-nav">
|
||||||
|
<view
|
||||||
|
class="item"
|
||||||
|
:class="{ active: toView === item }"
|
||||||
|
v-for="(item, index) in indexList"
|
||||||
|
:key="index"
|
||||||
|
@click="toSelectIndex(item)"
|
||||||
|
>{{ item }}</view
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { CustomerApi, SupplierApi } from "@/services";
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
show: boolean;
|
||||||
|
isShipment: boolean;
|
||||||
|
}>();
|
||||||
|
const emit = defineEmits(["handleDialog", "changeUser"]);
|
||||||
|
const handleClose = () => {
|
||||||
|
emit("handleDialog", false);
|
||||||
|
};
|
||||||
|
|
||||||
|
const keyword = ref("");
|
||||||
|
|
||||||
|
const indexList = [
|
||||||
|
"A",
|
||||||
|
"B",
|
||||||
|
"C",
|
||||||
|
"D",
|
||||||
|
"E",
|
||||||
|
"F",
|
||||||
|
"G",
|
||||||
|
"H",
|
||||||
|
"I",
|
||||||
|
"J",
|
||||||
|
"K",
|
||||||
|
"L",
|
||||||
|
"M",
|
||||||
|
"N",
|
||||||
|
"O",
|
||||||
|
"P",
|
||||||
|
"Q",
|
||||||
|
"R",
|
||||||
|
"S",
|
||||||
|
"T",
|
||||||
|
"U",
|
||||||
|
"V",
|
||||||
|
"W",
|
||||||
|
"X",
|
||||||
|
"Y",
|
||||||
|
"Z",
|
||||||
|
"#",
|
||||||
|
];
|
||||||
|
const toView = ref("");
|
||||||
|
const addressBook = ref();
|
||||||
|
// [
|
||||||
|
// {
|
||||||
|
// id: "A",
|
||||||
|
// data: [
|
||||||
|
// {
|
||||||
|
// zh_title: "阿联酋迪拉姆",
|
||||||
|
// en_title: "aa",
|
||||||
|
// address: "910289591",
|
||||||
|
// phone: "111111",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// zh_title: "阿尔巴尼亚列克",
|
||||||
|
// en_title: "aaaaa",
|
||||||
|
// address: "ALL",
|
||||||
|
// phone: "222222",
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// }
|
||||||
|
// ];
|
||||||
|
|
||||||
|
const toSelectIndex = (item: any) => {
|
||||||
|
toView.value = item;
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleClick = (item: any) => {
|
||||||
|
emit("changeUser", item);
|
||||||
|
emit("handleDialog", false);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSearch = () => {
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
const getList = () => {
|
||||||
|
if (props.isShipment) {
|
||||||
|
CustomerApi.getCustomUserListLettera({ name: keyword.value }).then(
|
||||||
|
(res: any) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
addressBook.value = res.data.reduce((pre: any, curr: any) => {
|
||||||
|
if (curr.list.length > 0) {
|
||||||
|
pre.push(curr);
|
||||||
|
}
|
||||||
|
return pre;
|
||||||
|
}, []);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
SupplierApi.getSupplierUserListLettera({ name: keyword.value }).then(
|
||||||
|
(res: any) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
addressBook.value = res.data.reduce((pre: any, curr: any) => {
|
||||||
|
if (curr.list.length > 0) {
|
||||||
|
pre.push(curr);
|
||||||
|
}
|
||||||
|
return pre;
|
||||||
|
}, []);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.isShipment,
|
||||||
|
(newValue, oldValue) => {
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.c-dialog-filter {
|
||||||
|
width: 95vw;
|
||||||
|
padding: 25rpx;
|
||||||
|
.title {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #000000;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.search {
|
||||||
|
margin: 30rpx 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.dialog-product-layout {
|
||||||
|
height: 80vh;
|
||||||
|
.address-book-container {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.address-book-index {
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
.contact-img {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
.scroll-container {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.letter-nav {
|
||||||
|
position: fixed;
|
||||||
|
right: 25rpx;
|
||||||
|
top: 100px;
|
||||||
|
font-size: 22rpx;
|
||||||
|
text-align: center;
|
||||||
|
.item:hover,
|
||||||
|
.active {
|
||||||
|
color: $u-primary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.contact-container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin: 2%;
|
||||||
|
}
|
||||||
|
.contact-detail-container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 80%;
|
||||||
|
font-size: 22rpx;
|
||||||
|
.contact-address {
|
||||||
|
color: rgba(0, 0, 0, 0.65);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -23,15 +23,18 @@
|
||||||
v-model="(model1.order as any)[item.key]"
|
v-model="(model1.order as any)[item.key]"
|
||||||
:placeholder="`请输入${item.name}`"
|
:placeholder="`请输入${item.name}`"
|
||||||
></u-textarea>
|
></u-textarea>
|
||||||
<u-input
|
<!-- v-model="(model1.order as any)[item.key]" -->
|
||||||
v-if="item.type === 'select' || item.type === 'input'"
|
<up-input
|
||||||
v-model="(model1.order as any)[item.key]"
|
v-model="(model1.order as any)[item.key]"
|
||||||
|
v-if="item.type === 'select' || item.type === 'input'"
|
||||||
:placeholder="`请${item.type === 'select' ? '选择' : '输入'}${
|
:placeholder="`请${item.type === 'select' ? '选择' : '输入'}${
|
||||||
item.name
|
item.name
|
||||||
}`"
|
}`"
|
||||||
:clearable="true"
|
:clearable="true"
|
||||||
:customStyle="{}"
|
:customStyle="{}"
|
||||||
border="none"
|
border="none"
|
||||||
|
:value="(model1.order as any)[item.key]"
|
||||||
|
@change="(e:any) => {hanldeInput(e, item)}"
|
||||||
>
|
>
|
||||||
<template #suffix>
|
<template #suffix>
|
||||||
<text v-if="item.key === 'subtractNum'">
|
<text v-if="item.key === 'subtractNum'">
|
||||||
|
@ -41,6 +44,18 @@
|
||||||
{{ item.unit }}
|
{{ item.unit }}
|
||||||
</text>
|
</text>
|
||||||
</template>
|
</template>
|
||||||
|
</up-input>
|
||||||
|
<!-- 自定义selectui -->
|
||||||
|
<u-input
|
||||||
|
v-if="item.type === 'selectCustom'"
|
||||||
|
v-model="(model1.order as any)[item.key]"
|
||||||
|
:placeholder="`请选择${item.name}`"
|
||||||
|
:clearable="true"
|
||||||
|
:customStyle="{}"
|
||||||
|
border="none"
|
||||||
|
disabled
|
||||||
|
disabledColor="#ffffff"
|
||||||
|
>
|
||||||
</u-input>
|
</u-input>
|
||||||
<!-- @afterRead="afterRead"
|
<!-- @afterRead="afterRead"
|
||||||
@delete="deletePic" -->
|
@delete="deletePic" -->
|
||||||
|
@ -68,7 +83,10 @@
|
||||||
:customStyle="{ marginRight: '10px' }"
|
:customStyle="{ marginRight: '10px' }"
|
||||||
></u-radio>
|
></u-radio>
|
||||||
</u-radio-group>
|
</u-radio-group>
|
||||||
<template #right v-if="item.type === 'select'">
|
<template
|
||||||
|
#right
|
||||||
|
v-if="item.type === 'select' || item.type === 'selectCustom'"
|
||||||
|
>
|
||||||
<u-icon name="arrow-right"></u-icon>
|
<u-icon name="arrow-right"></u-icon>
|
||||||
</template>
|
</template>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
@ -90,6 +108,23 @@
|
||||||
<u-button text="暂不定价" @click="handleBack()"></u-button>
|
<u-button text="暂不定价" @click="handleBack()"></u-button>
|
||||||
<u-button type="primary" text="保存" @click="save()"></u-button>
|
<u-button type="primary" text="保存" @click="save()"></u-button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 供应商选择弹框 -->
|
||||||
|
<SupplierDialog
|
||||||
|
ref="supplierDialog"
|
||||||
|
:show="showDialog.showSupplier"
|
||||||
|
@handleDialog="(v:boolean) => {handleDialog('showSupplier', v)}"
|
||||||
|
@changeUser="changeUser"
|
||||||
|
:isShipment="false"
|
||||||
|
></SupplierDialog>
|
||||||
|
<!-- 收货产品弹框 -->
|
||||||
|
<ProductDialog
|
||||||
|
:show="showDialog.showProduct"
|
||||||
|
@handleDialog="(v:boolean) => {handleDialog('showProduct', v)}"
|
||||||
|
@changeProduct="changeProduct"
|
||||||
|
ref="productRef"
|
||||||
|
:isShipment="false"
|
||||||
|
></ProductDialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ComType } from "@/types/global";
|
import type { ComType } from "@/types/global";
|
||||||
|
@ -102,6 +137,66 @@ import {
|
||||||
import _ from "underscore";
|
import _ from "underscore";
|
||||||
import { onLoad } from "@dcloudio/uni-app";
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
import { ImagesType, OrderType } from "@/utils/enum";
|
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 showDialog = <
|
||||||
|
{
|
||||||
|
[key: string]: boolean;
|
||||||
|
}
|
||||||
|
>reactive({
|
||||||
|
showSupplier: false,
|
||||||
|
showProduct: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleDialog = (key: string, v: boolean) => {
|
||||||
|
showDialog[key] = v;
|
||||||
|
};
|
||||||
|
|
||||||
|
const changeUser = (obj: any) => {
|
||||||
|
model1.order.userName = obj.name; // 供应商名称
|
||||||
|
model1.order.userId = obj.id; // 供应商Id,
|
||||||
|
};
|
||||||
|
|
||||||
|
// 收货产品选择
|
||||||
|
const changeProduct = (obj: any) => {
|
||||||
|
model1.order.productName = obj.reProductsName; // 收货产品名称
|
||||||
|
model1.order.productId = obj.id; // 收货产品Id,
|
||||||
|
};
|
||||||
|
// 单价 毛重 杂质扣除校验
|
||||||
|
const hanldeInput = (e: any, item: any) => {
|
||||||
|
if (item.key === "price" || item.key === "grossWeight") {
|
||||||
|
const tempPrice = e?.replace(valid.valid_decimal.pattern, "");
|
||||||
|
if (countDots(tempPrice).length > 1) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请输入正确的" + item.name,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
model1.order[item.key] = tempPrice;
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
if (item.key === "subtractNum") {
|
||||||
|
const temp = e?.replace(valid.valid_decimal.pattern, "");
|
||||||
|
if (
|
||||||
|
model1.order.buttonType === 1 &&
|
||||||
|
(parseInt(temp) > 100 || parseInt(temp) < 0)
|
||||||
|
) {
|
||||||
|
uni.showToast({
|
||||||
|
title: `${item.name}正确范围是0-100`,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
model1.order[item.key] = temp;
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const model1 = reactive<{ order: Order }>({
|
const model1 = reactive<{ order: Order }>({
|
||||||
order: {
|
order: {
|
||||||
id: 0,
|
id: 0,
|
||||||
|
@ -118,6 +213,7 @@ const model1 = reactive<{ order: Order }>({
|
||||||
scaleStatus: 1,
|
scaleStatus: 1,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
"order.userName": {
|
"order.userName": {
|
||||||
type: "string",
|
type: "string",
|
||||||
|
@ -131,12 +227,14 @@ const rules = reactive({
|
||||||
message: "请选择收货产品名称",
|
message: "请选择收货产品名称",
|
||||||
trigger: ["blur", "change"],
|
trigger: ["blur", "change"],
|
||||||
},
|
},
|
||||||
"order.price": {
|
"order.price": [
|
||||||
|
{
|
||||||
type: "number",
|
type: "number",
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入单价",
|
message: "单价为空或单价输入错误",
|
||||||
trigger: ["blur", "change"],
|
trigger: ["blur", "change"],
|
||||||
},
|
},
|
||||||
|
],
|
||||||
"order.grossWeight": {
|
"order.grossWeight": {
|
||||||
type: "number",
|
type: "number",
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -158,7 +256,7 @@ const rules = reactive({
|
||||||
});
|
});
|
||||||
const contrlModalParams = reactive<ComType>({
|
const contrlModalParams = reactive<ComType>({
|
||||||
isShowSplTime: false,
|
isShowSplTime: false,
|
||||||
spltime: "",
|
spltime: Number(new Date()),
|
||||||
userSelect: {
|
userSelect: {
|
||||||
isShow: false,
|
isShow: false,
|
||||||
title: "标题",
|
title: "标题",
|
||||||
|
@ -175,13 +273,13 @@ const formAttrList = reactive<ComType>([
|
||||||
{
|
{
|
||||||
name: "供应商",
|
name: "供应商",
|
||||||
key: "userName",
|
key: "userName",
|
||||||
type: "select",
|
type: "selectCustom",
|
||||||
unit: "",
|
unit: "",
|
||||||
childKey: "userSelect",
|
childKey: "userSelect",
|
||||||
required: true,
|
required: true,
|
||||||
fn: () => {
|
fn: () => {
|
||||||
contrlModalParams.userSelect.isShow = true;
|
// handleDialog("showSupplier", true);
|
||||||
contrlModalParams.userSelect.title = "供应商";
|
uni.hideKeyboard();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -193,13 +291,15 @@ const formAttrList = reactive<ComType>([
|
||||||
{
|
{
|
||||||
name: "收货产品",
|
name: "收货产品",
|
||||||
key: "productName",
|
key: "productName",
|
||||||
type: "select",
|
type: "selectCustom",
|
||||||
unit: "",
|
unit: "",
|
||||||
childKey: "productSelect",
|
childKey: "productSelect",
|
||||||
required: true,
|
required: true,
|
||||||
fn: () => {
|
fn: () => {
|
||||||
contrlModalParams.productSelect.isShow = true;
|
handleDialog("showProduct", true);
|
||||||
contrlModalParams.productSelect.title = "收货产品";
|
uni.hideKeyboard();
|
||||||
|
// contrlModalParams.productSelect.isShow = true;
|
||||||
|
// contrlModalParams.productSelect.title = "收货产品";
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -362,6 +462,10 @@ const handleDelete = (e: any) => {
|
||||||
*/
|
*/
|
||||||
const form = ref();
|
const form = ref();
|
||||||
const check = () => {
|
const check = () => {
|
||||||
|
// if (valid.carNo.pattern.test(model1.order.carNumber)) {
|
||||||
|
// console.log('********')
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
form.value
|
form.value
|
||||||
.validate()
|
.validate()
|
||||||
|
@ -378,6 +482,34 @@ const check = () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const save = () => {
|
const save = () => {
|
||||||
|
if (model1.order.carNumber) {
|
||||||
|
if (!valid.carNo.pattern.test(model1.order.carNumber)) {
|
||||||
|
uni.showToast({ icon: "none", title: "请输入正确的车牌号" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
model1.order.price &&
|
||||||
|
model1.order.price[model1.order.price.length - 1] === "."
|
||||||
|
) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请输入正确的单价",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
model1.order.grossWeight?.toString() &&
|
||||||
|
model1.order.grossWeight?.toString()[
|
||||||
|
model1.order.grossWeight?.toString().length - 1
|
||||||
|
] === "."
|
||||||
|
) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请输入正确的毛重",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
check().then((res) => {
|
check().then((res) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
startSave();
|
startSave();
|
||||||
|
@ -449,6 +581,7 @@ const prePage = ref("");
|
||||||
onLoad((option) => {
|
onLoad((option) => {
|
||||||
model1.order.id = parseInt((option as any).id);
|
model1.order.id = parseInt((option as any).id);
|
||||||
prePage.value = (option as any).prePage;
|
prePage.value = (option as any).prePage;
|
||||||
|
|
||||||
if (model1.order.id) {
|
if (model1.order.id) {
|
||||||
ReceiveApi.getDetailById({ id: model1.order.id }).then((res) => {
|
ReceiveApi.getDetailById({ id: model1.order.id }).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
@ -460,6 +593,10 @@ onLoad((option) => {
|
||||||
res.data.weighingMethod !== null ? res.data.weighingMethod : 0,
|
res.data.weighingMethod !== null ? res.data.weighingMethod : 0,
|
||||||
multiCategory:
|
multiCategory:
|
||||||
res.data.multiCategory !== null ? res.data.multiCategory : 0,
|
res.data.multiCategory !== null ? res.data.multiCategory : 0,
|
||||||
|
subtractNum:
|
||||||
|
res.data.buttonType === 0
|
||||||
|
? res.data.buckleMiscellaneous
|
||||||
|
: res.data.points,
|
||||||
fileLists: model1.order.fileLists.map((item: any) => {
|
fileLists: model1.order.fileLists.map((item: any) => {
|
||||||
return { ...item, fileID: item.id };
|
return { ...item, fileID: item.id };
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -202,6 +202,10 @@ const updateStatus = (status: number) => {
|
||||||
.map((item) => {
|
.map((item) => {
|
||||||
return { ...item, scaleStatus: status };
|
return { ...item, scaleStatus: status };
|
||||||
});
|
});
|
||||||
|
if(list.length === 0) {
|
||||||
|
uni.showToast({icon: 'none', title: '请至少选择一个收货单'})
|
||||||
|
return
|
||||||
|
}
|
||||||
ReceiveApi.updateOrderIn({ orderInPos: list }).then((res) => {
|
ReceiveApi.updateOrderIn({ orderInPos: list }).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
resetPageList();
|
resetPageList();
|
||||||
|
@ -234,11 +238,11 @@ const getList = (v?: boolean) => {
|
||||||
userName: keyword.value
|
userName: keyword.value
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
pageList.isLoading = false;
|
||||||
(pageList as any).list = (res.data.list as any).map((item: any) => {
|
(pageList as any).list = (res.data.list as any).map((item: any) => {
|
||||||
return { ...item, isChecked: false };
|
return { ...item, isChecked: false };
|
||||||
});
|
});
|
||||||
pageList.total = (res.data as any).total;
|
pageList.total = (res.data as any).total;
|
||||||
pageList.isLoading = false;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -232,11 +232,12 @@ const getList = (v?: boolean) => {
|
||||||
userName: keyword.value,
|
userName: keyword.value,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
pageList.isLoading = false;
|
||||||
(pageList as any).list = (res.data.list as any).map((item: any) => {
|
(pageList as any).list = (res.data.list as any).map((item: any) => {
|
||||||
return { ...item, isChecked: false };
|
return { ...item, isChecked: false };
|
||||||
});
|
});
|
||||||
pageList.total = (res.data as any).total;
|
pageList.total = (res.data as any).total;
|
||||||
pageList.isLoading = false;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -114,7 +114,6 @@ const getList = (v?: boolean) => {
|
||||||
pageNumber: pageList.pageNum,
|
pageNumber: pageList.pageNum,
|
||||||
scaleStatus: state.scaleStatus,
|
scaleStatus: state.scaleStatus,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.code === 200) {
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
pageList.isLoading = false;
|
pageList.isLoading = false;
|
||||||
(pageList as any).list = (pageList as any).list = (
|
(pageList as any).list = (pageList as any).list = (
|
||||||
|
@ -122,7 +121,6 @@ const getList = (v?: boolean) => {
|
||||||
).list.concat(res.data.list);
|
).list.concat(res.data.list);
|
||||||
pageList.total = (res.data as any).total;
|
pageList.total = (res.data as any).total;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const handleOk = () => {
|
const handleOk = () => {
|
||||||
|
|
|
@ -18,7 +18,7 @@ interface Order {
|
||||||
productName?: string; //undefined
|
productName?: string; //undefined
|
||||||
imagesId?: number | undefined; //弃用
|
imagesId?: number | undefined; //弃用
|
||||||
imageUrls?: string; //弃用
|
imageUrls?: string; //弃用
|
||||||
carNumber?: string; //车牌号
|
carNumber: string; //车牌号
|
||||||
receiptNumber?: string; //收货单号
|
receiptNumber?: string; //收货单号
|
||||||
grossWeight?: number; //毛重
|
grossWeight?: number; //毛重
|
||||||
tare?: string; //皮重
|
tare?: string; //皮重
|
||||||
|
|
|
@ -199,3 +199,8 @@ export function signFigures (num:number, rank = 6) {
|
||||||
}
|
}
|
||||||
return (ans * sign)
|
return (ans * sign)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 判断字符串中有几个.
|
||||||
|
export function countDots(str:any) {
|
||||||
|
return (str.match(/\./g) || []).length;
|
||||||
|
}
|
||||||
|
|
|
@ -1,18 +1,29 @@
|
||||||
const valid = {
|
const valid = {
|
||||||
mobile: {
|
mobile: {
|
||||||
pattern: /^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/,
|
pattern: /^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/,
|
||||||
message: '请输入正确的手机号码',
|
message: "请输入正确的手机号码",
|
||||||
},
|
},
|
||||||
password: {
|
password: {
|
||||||
pattern: /^((?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!;:@#$%?^&*_-]))([a-zA-Z0-9!;:@#$%?^&*_-]){6,16}$/,
|
pattern:
|
||||||
message: '密码必须包含大小写字母、数字、特殊字符',
|
/^((?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!;:@#$%?^&*_-]))([a-zA-Z0-9!;:@#$%?^&*_-]){6,16}$/,
|
||||||
|
message: "密码必须包含大小写字母、数字、特殊字符",
|
||||||
},
|
},
|
||||||
username: /^[a-zA-Z]{4,12}$/, //长度4~12,英文大小写字母
|
username: /^[a-zA-Z]{4,12}$/, //长度4~12,英文大小写字母
|
||||||
email: /^(\w+(_|-|.)*)+@(\w+(-)?)+(.\w{2,})+$/,//用户名 @ 域名(域名后缀至少2个字符)
|
email: /^(\w+(_|-|.)*)+@(\w+(-)?)+(.\w{2,})+$/, //用户名 @ 域名(域名后缀至少2个字符)
|
||||||
valid_number: /[^\d]/g,
|
valid_number: /[^\d]/g,
|
||||||
// valid_password: /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\\W_]+$)(?![a-z0-9]+$)(?![a-z\\W_]+$)(?![0-9\\W_]+$)[A-Za-z\d`~!@#$%^&*()_+<>?:"{},.\/\\;'[\]]{6,20}$/, // 8位 大小写 数字 和下划线
|
// valid_password: /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\\W_]+$)(?![a-z0-9]+$)(?![a-z\\W_]+$)(?![0-9\\W_]+$)[A-Za-z\d`~!@#$%^&*()_+<>?:"{},.\/\\;'[\]]{6,20}$/, // 8位 大小写 数字 和下划线
|
||||||
valid_no_space: /\s+/g, //不可输入空格
|
valid_no_space: /\s+/g, //不可输入空格
|
||||||
valid_no_cn:/[\u4E00-\u9FA5]/g, // 不可输入中文
|
valid_no_cn: /[\u4E00-\u9FA5]/g, // 不可输入中文
|
||||||
valid_number_en: /^[a-zA-Z0-9]+$/, // 只能输入数字和英文
|
valid_number_en: /^[a-zA-Z0-9]+$/, // 只能输入数字和英文
|
||||||
}
|
carNo: {
|
||||||
export default valid
|
// /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/
|
||||||
|
// /^[\x{4e00}-\x{9fa5}]{1}[A-Z]{1}[A-Z0-9]{5}$/u
|
||||||
|
pattern: /^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[a-zA-Z](([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼ABCDEFGHJK]((?![IO])[a-zA-Z0-9](?![IO]))[0-9]{4})|([0-9]{5}[ABCDEFGHJK]))|[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z0-9]{1}[A-Z0-9]{1}[A-Z0-9应]{4,5}[A-Z0-9挂学警港澳领使急]{1})$/,
|
||||||
|
message: "请输入正确的车牌号",
|
||||||
|
},
|
||||||
|
valid_decimal: {
|
||||||
|
pattern: /[^0-9.]/g,
|
||||||
|
message: "请输入正确的数字",
|
||||||
|
}
|
||||||
|
};
|
||||||
|
export default valid;
|
||||||
|
|
Loading…
Reference in New Issue