update: 细节修复

This commit is contained in:
admin 2024-04-25 16:30:50 +08:00
parent 00ffb5d5d7
commit efd1325723
45 changed files with 414 additions and 272 deletions

View File

@ -1,10 +1,14 @@
<template> <template>
<u-popup :show="show" mode="left" :closeable="true" @close="handleClose"> <u-popup :show="show" mode="right" :closeable="true" @close="handleClose">
<view class="c-dialog-filter"> <view class="c-dialog-filter">
<view class="title">筛选</view> <view class="title">筛选</view>
<u-list height="200"> <u-list height="200">
<u-list-item> <u-list-item>
<u-cell :title="`${isShipment ? '客户' : '供应商'}`" @click="handleDialog('showSupplier', true)" :value="state.user.name"> <u-cell
:title="`${isShipment ? '客户' : '供应商'}`"
@click="handleDialog('showSupplier', true)"
:value="state.user.name"
>
<template #right-icon> </template> <template #right-icon> </template>
</u-cell> </u-cell>
</u-list-item> </u-list-item>
@ -80,42 +84,41 @@ const state = <
>reactive({ >reactive({
project: { project: {
id: -1, id: -1,
name: '' name: "",
}, },
user: { user: {
id: -1, id: -1,
name: '' name: "",
} },
}); });
const handleDialog = (key: string, v: boolean) => { const handleDialog = (key: string, v: boolean) => {
showDialog[key] = v; showDialog[key] = v;
}; };
const changeUser = (obj: any) => { const changeUser = (obj: any) => {
state.user = obj state.user = obj;
} };
const changeProduct = (obj: any) => { const changeProduct = (obj: any) => {
if (props.isShipment) { if (props.isShipment) {
state.project = {...obj, name: obj.shmProductsName} state.project = { ...obj, name: obj.shmProductsName };
} else { } else {
state.project = {...obj, name: obj.reProductsName} state.project = { ...obj, name: obj.reProductsName };
}
} }
};
const resetState = () => { const resetState = () => {
state.project = { state.project = {
id: -1, id: -1,
name: '' name: "",
} };
state.user = { state.user = {
id: -1, id: -1,
name: '' name: "",
} };
} };
const handleOk = () => { const handleOk = () => {
emit("changeOther",{userId: state.user.id, productId: state.project.id}) emit("changeOther", { userId: state.user.id, productId: state.project.id });
emit("handleDialog", false); emit("handleDialog", false);
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.c-dialog-filter { .c-dialog-filter {
@ -136,10 +139,12 @@ const handleOk = () => {
} }
} }
.btn-box1 { .btn-box1 {
flex-direction: row; position: fixed;
bottom: 0;
left: 0;
margin: 30rpx;
width: calc(100% - 60rpx);
display: flex; display: flex;
align-items: center;
margin-top: 30rpx;
::v-deep button + button { ::v-deep button + button {
margin-left: 50rpx; margin-left: 50rpx;
} }

View File

@ -1,5 +1,5 @@
<template> <template>
<u-popup :show="show" mode="left" :closeable="true" @close="handleClose"> <u-popup :show="show" mode="right" :closeable="true" @close="handleClose">
<view class="c-dialog-filter"> <view class="c-dialog-filter">
<view class="title">{{ isShipment ? "出货" : "收货" }}产品</view> <view class="title">{{ isShipment ? "出货" : "收货" }}产品</view>
<view v-if="isShipment"> <view v-if="isShipment">
@ -13,7 +13,7 @@
<text <text
v-for="(child, childIndex) in cItem.childrenLists" v-for="(child, childIndex) in cItem.childrenLists"
:key="childIndex" :key="childIndex"
:class="{ active: state.current === child.childIndex }" :class="{ active: state.current === child.id }"
@click="handleSelect(child)" @click="handleSelect(child)"
>{{ child.shmProductsName }}</text >{{ child.shmProductsName }}</text
> >
@ -40,6 +40,15 @@
> >
</view> </view>
</view> </view>
<view class="bottom">
<u-button
text="清空"
color="#E8E8E8"
:customStyle="{ color: '#999' }"
shape="circle"
@click="reset"
></u-button>
</view>
</u-popup> </u-popup>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -53,6 +62,11 @@ const emit = defineEmits(["handleDialog", "changeProduct"]);
const handleClose = () => { const handleClose = () => {
emit("handleDialog", false); emit("handleDialog", false);
}; };
const reset = () => {
state.current = -1;
emit("changeProduct", { id: -1 });
emit("handleDialog", false);
};
const state = reactive<any>({ const state = reactive<any>({
list: [], list: [],
current: -1, current: -1,
@ -65,11 +79,6 @@ const handleSelect = (item: any) => {
}; };
const getList = () => { const getList = () => {
if (props.isShipment) { if (props.isShipment) {
// GoodsApi.getShipmentProductList().then((res) => {
// if (res.code === 200) {
// state.list = res.data;
// }
// });
GoodsApi.getChildrenList().then((res) => { GoodsApi.getChildrenList().then((res) => {
if (res.code === 200) { if (res.code === 200) {
@ -162,4 +171,12 @@ onMounted(() => {
} }
} }
} }
.bottom {
position: fixed;
bottom: 0;
left: 0;
margin: 30rpx;
width: calc(100% - 60rpx);
}
</style> </style>

View File

@ -1,5 +1,5 @@
<template> <template>
<u-popup :show="show" mode="left" :closeable="true" @close="handleClose"> <u-popup :show="show" mode="right" :closeable="true" @close="handleClose">
<view class="c-dialog-filter"> <view class="c-dialog-filter">
<view class="title">{{isShipment? '客户' : '供应商'}}筛选</view> <view class="title">{{isShipment? '客户' : '供应商'}}筛选</view>
<view class="search"> <view class="search">

View File

@ -20,7 +20,7 @@
></u-icon> ></u-icon>
<text class="btn" @click="handleDialog('showFilter', true)" <text class="btn" @click="handleDialog('showFilter', true)"
>出货产品</text >{{ state.shmProductsName || '出货产品' }}</text
> >
</view> </view>
</view> </view>
@ -129,6 +129,7 @@ const state = reactive<{
scaleStatus: number; scaleStatus: number;
userId: number; userId: number;
productId: number; productId: number;
shmProductsName: '',
x: Array<any>; x: Array<any>;
y: Array<any>; y: Array<any>;
}>({ }>({
@ -137,6 +138,7 @@ const state = reactive<{
scaleStatus: -1, scaleStatus: -1,
userId: -1, userId: -1,
productId: -1, productId: -1,
shmProductsName: '',
x: [], x: [],
y: [], y: [],
}); });
@ -148,6 +150,7 @@ const changeTime = (obj: any) => {
}; };
const changeProduct = (obj: any) => { const changeProduct = (obj: any) => {
state.productId = obj.id; state.productId = obj.id;
state.shmProductsName = obj.shmProductsName
getList(); getList();
}; };
const handleDialog = (key: string, v: boolean) => { const handleDialog = (key: string, v: boolean) => {

View File

@ -18,7 +18,11 @@
name="arrow-down" name="arrow-down"
@click="handleDialog('showTime', true)" @click="handleDialog('showTime', true)"
></u-icon> ></u-icon>
<text class="status">单据状态</text> <text class="status">{{
state.scaleStatus === -1
? "单据状态"
: getScaleStatus(1, state.scaleStatus)
}}</text>
<u-icon <u-icon
name="arrow-down" name="arrow-down"
@click="handleDialog('showStatus', true)" @click="handleDialog('showStatus', true)"
@ -29,7 +33,9 @@
<up-row> <up-row>
<up-col span="4"> <up-col span="4">
<view class="inner-box" style="border: none"> <view class="inner-box" style="border: none">
<view class="num highlight">{{ formatMoney(state.summary.totalAmount) }}</view> <view class="num highlight">{{
formatMoney(state.summary.totalAmount)
}}</view>
<view>收货总量/kg</view> <view>收货总量/kg</view>
</view> </view>
</up-col> </up-col>
@ -41,7 +47,9 @@
</up-col> </up-col>
<up-col span="4"> <up-col span="4">
<view class="inner-box"> <view class="inner-box">
<view class="num">{{ formatMoney(state.summary.totalUnpaid) }}</view> <view class="num">{{
formatMoney(state.summary.totalUnpaid)
}}</view>
<view>未付/kg</view> <view>未付/kg</view>
</view> </view>
</up-col> </up-col>
@ -52,19 +60,25 @@
<up-row> <up-row>
<up-col span="4"> <up-col span="4">
<view class="inner-box" style="border: none"> <view class="inner-box" style="border: none">
<view class="num highlight">{{ formatMoney(state.summary.totalPayment) }}</view> <view class="num highlight">{{
formatMoney(state.summary.totalPayment)
}}</view>
<view>结算金额/</view> <view>结算金额/</view>
</view> </view>
</up-col> </up-col>
<up-col span="4"> <up-col span="4">
<view class="inner-box"> <view class="inner-box">
<view class="num">{{ formatMoney(state.summary.totalPaidPrice) }}</view> <view class="num">{{
formatMoney(state.summary.totalPaidPrice)
}}</view>
<view>实收金额</view> <view>实收金额</view>
</view> </view>
</up-col> </up-col>
<up-col span="4"> <up-col span="4">
<view class="inner-box"> <view class="inner-box">
<view class="num">{{ formatMoney(state.summary.totalUnpaidPrice) }}</view> <view class="num">{{
formatMoney(state.summary.totalUnpaidPrice)
}}</view>
<view>应付金额</view> <view>应付金额</view>
</view> </view>
</up-col> </up-col>
@ -74,13 +88,17 @@
<up-row> <up-row>
<up-col span="6"> <up-col span="6">
<view class="inner-box" style="border: none"> <view class="inner-box" style="border: none">
<view class="num">{{ formatMoney(state.summary.totalReceipt) }}</view> <view class="num">{{
formatMoney(state.summary.totalReceipt)
}}</view>
<view>收货单</view> <view>收货单</view>
</view> </view>
</up-col> </up-col>
<up-col span="6"> <up-col span="6">
<view class="inner-box"> <view class="inner-box">
<view class="num">{{ formatMoney(state.summary.averagePrice) }}</view> <view class="num">{{
formatMoney(state.summary.averagePrice)
}}</view>
<view>均价/kg</view> <view>均价/kg</view>
</view> </view>
</up-col> </up-col>
@ -136,7 +154,12 @@ import TimeDialog from "./components/TimeDialog.vue";
import StatusDialog from "./components/StatusDialog.vue"; import StatusDialog from "./components/StatusDialog.vue";
import FilterDialog from "./components/FilterDialog.vue"; import FilterDialog from "./components/FilterDialog.vue";
import { ReceiveApi } from "@/services"; import { ReceiveApi } from "@/services";
import { formatDate, formatMoney, getCurrentMonthStartAndEnd } from "@/utils"; import {
formatDate,
formatMoney,
getCurrentMonthStartAndEnd,
getScaleStatus,
} from "@/utils";
const tableTitleList = reactive([ const tableTitleList = reactive([
{ {
name: "收货产品", name: "收货产品",
@ -187,7 +210,7 @@ const state = reactive<{
endTime: formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}"), endTime: formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}"),
scaleStatus: -1, scaleStatus: -1,
userId: -1, userId: -1,
productId:-1 productId: -1,
}); });
const changeTime = (obj: any) => { const changeTime = (obj: any) => {
@ -196,6 +219,7 @@ const changeTime = (obj: any) => {
getList(); getList();
}; };
//
const changeStatus = (obj: any) => { const changeStatus = (obj: any) => {
state.scaleStatus = obj.id; state.scaleStatus = obj.id;
getList(); getList();
@ -203,7 +227,7 @@ const changeStatus = (obj: any) => {
const changeOther = (obj: any) => { const changeOther = (obj: any) => {
state.userId = obj.userId; state.userId = obj.userId;
state.productId = obj.productId state.productId = obj.productId;
getList(); getList();
}; };
@ -217,13 +241,13 @@ const getList = () => {
endTime: state.endTime + " 23:59:59", endTime: state.endTime + " 23:59:59",
}; };
if (state.scaleStatus > -1) { if (state.scaleStatus > -1) {
params.scaleStatus = state.scaleStatus params.scaleStatus = state.scaleStatus;
} }
if (state.userId > -1) { if (state.userId > -1) {
params.userId = state.userId params.userId = state.userId;
} }
if (state.productId > -1) { if (state.productId > -1) {
params.productId = state.productId params.productId = state.productId;
} }
ReceiveApi.OrderInReceipt(params).then((res) => { ReceiveApi.OrderInReceipt(params).then((res) => {
if (res.code === 200) { if (res.code === 200) {

View File

@ -18,7 +18,11 @@
name="arrow-down" name="arrow-down"
@click="handleDialog('showTime', true)" @click="handleDialog('showTime', true)"
></u-icon> ></u-icon>
<text class="status">单据状态</text> <text class="status">{{
state.scaleStatus === -1
? "单据状态"
: getScaleStatus(1, state.scaleStatus)
}}</text>
<u-icon <u-icon
name="arrow-down" name="arrow-down"
@click="handleDialog('showStatus', true)" @click="handleDialog('showStatus', true)"
@ -29,19 +33,25 @@
<up-row> <up-row>
<up-col span="4"> <up-col span="4">
<view class="inner-box" style="border: none"> <view class="inner-box" style="border: none">
<view class="num highlight">{{ formatMoney(state.summary.totalAmount) }}</view> <view class="num highlight">{{
formatMoney(state.summary.totalAmount)
}}</view>
<view>出货总量/kg</view> <view>出货总量/kg</view>
</view> </view>
</up-col> </up-col>
<up-col span="4"> <up-col span="4">
<view class="inner-box"> <view class="inner-box">
<view class="num">{{ formatMoney(state.summary.totalPayShipment) }}</view> <view class="num">{{
formatMoney(state.summary.totalPayShipment)
}}</view>
<view>已收/kg</view> <view>已收/kg</view>
</view> </view>
</up-col> </up-col>
<up-col span="4"> <up-col span="4">
<view class="inner-box"> <view class="inner-box">
<view class="num">{{ formatMoney(state.summary.totalUnPayShipment) }}</view> <view class="num">{{
formatMoney(state.summary.totalUnPayShipment)
}}</view>
<view>未收/kg</view> <view>未收/kg</view>
</view> </view>
</up-col> </up-col>
@ -52,19 +62,25 @@
<up-row> <up-row>
<up-col span="4"> <up-col span="4">
<view class="inner-box" style="border: none"> <view class="inner-box" style="border: none">
<view class="num highlight">{{ formatMoney(state.summary.totalCollection) }}</view> <view class="num highlight">{{
formatMoney(state.summary.totalCollection)
}}</view>
<view>结算金额/</view> <view>结算金额/</view>
</view> </view>
</up-col> </up-col>
<up-col span="4"> <up-col span="4">
<view class="inner-box"> <view class="inner-box">
<view class="num">{{ formatMoney(state.summary.totalPayCollection) }}</view> <view class="num">{{
formatMoney(state.summary.totalPayCollection)
}}</view>
<view>实收金额</view> <view>实收金额</view>
</view> </view>
</up-col> </up-col>
<up-col span="4"> <up-col span="4">
<view class="inner-box"> <view class="inner-box">
<view class="num">{{ formatMoney(state.summary.totalUnPayCollection) }}</view> <view class="num">{{
formatMoney(state.summary.totalUnPayCollection)
}}</view>
<view>应收金额</view> <view>应收金额</view>
</view> </view>
</up-col> </up-col>
@ -121,7 +137,6 @@
:isShipment="true" :isShipment="true"
@handleDialog="(v:boolean) => {handleDialog('showStatus', v)}" @handleDialog="(v:boolean) => {handleDialog('showStatus', v)}"
@changeStatus="changeStatus" @changeStatus="changeStatus"
/> />
<!-- 筛选弹框 --> <!-- 筛选弹框 -->
@ -137,7 +152,12 @@ import TimeDialog from "./components/TimeDialog.vue";
import StatusDialog from "./components/StatusDialog.vue"; import StatusDialog from "./components/StatusDialog.vue";
import FilterDialog from "./components/FilterDialog.vue"; import FilterDialog from "./components/FilterDialog.vue";
import { ShipmentApi } from "@/services"; import { ShipmentApi } from "@/services";
import { formatDate, formatMoney, getCurrentMonthStartAndEnd } from "@/utils"; import {
formatDate,
formatMoney,
getCurrentMonthStartAndEnd,
getScaleStatus,
} from "@/utils";
const tableTitleList = reactive([ const tableTitleList = reactive([
{ {
name: "客户", name: "客户",

View File

@ -20,7 +20,7 @@
></u-icon> ></u-icon>
<text class="btn" @click="handleDialog('showFilter', true)" <text class="btn" @click="handleDialog('showFilter', true)"
>收货产品</text >{{ state.reProductsName || '收货产品' }}</text
> >
</view> </view>
</view> </view>
@ -114,6 +114,7 @@ const getOptions = (x: Array<any>, y: Array<any>) => {
}; };
const changeProduct = (obj: any) => { const changeProduct = (obj: any) => {
state.productId = obj.id; state.productId = obj.id;
state.reProductsName = obj.reProductsName;
getList(); getList();
}; };
const showDialog = < const showDialog = <
@ -133,6 +134,7 @@ const state = reactive<{
scaleStatus: number; scaleStatus: number;
userId: number; userId: number;
productId: number; productId: number;
reProductsName: string;
x: Array<any>; x: Array<any>;
y: Array<any>; y: Array<any>;
}>({ }>({
@ -141,6 +143,7 @@ const state = reactive<{
scaleStatus: -1, scaleStatus: -1,
userId: -1, userId: -1,
productId: -1, productId: -1,
reProductsName: '', //
x: [], x: [],
y: [], y: [],
}); });

View File

@ -1,5 +1,5 @@
<template> <template>
<u-popup :show="show" mode="left" :closeable="true" @close="handleClose"> <u-popup :show="show" mode="right" :closeable="true" @close="handleClose">
<view class="c-dialog-filter"> <view class="c-dialog-filter">
<view class="title">筛选</view> <view class="title">筛选</view>
<u-list height="200"> <u-list height="200">
@ -14,7 +14,7 @@
</u-list-item> </u-list-item>
<u-list-item boder="none"> <u-list-item boder="none">
<u-cell <u-cell
:title="`${(state.type.key === 2 || isShipment) ? '客户' : '供应商'}`" :title="`${state.type.key === 2 || isShipment ? '客户' : '供应商'}`"
@click="handleDialog('showSupplier', true)" @click="handleDialog('showSupplier', true)"
:value="state.user.name" :value="state.user.name"
> >
@ -47,7 +47,7 @@
:show="showDialog.showSupplier" :show="showDialog.showSupplier"
@handleDialog="(v:boolean) => {handleDialog('showSupplier', v)}" @handleDialog="(v:boolean) => {handleDialog('showSupplier', v)}"
@changeUser="changeUser" @changeUser="changeUser"
:isShipment="(state.type.key === 2 || isShipment) ? true : false" :isShipment="state.type.key === 2 || isShipment ? true : false"
></SupplierDialog> ></SupplierDialog>
<!-- 客户类型 --> <!-- 客户类型 -->
<u-action-sheet <u-action-sheet
@ -64,7 +64,7 @@
import SupplierDialog from "./SupplierDialog.vue"; import SupplierDialog from "./SupplierDialog.vue";
const props = defineProps<{ const props = defineProps<{
show: boolean; show: boolean;
isShipment: boolean isShipment: boolean;
}>(); }>();
const emit = defineEmits(["handleDialog", "changeOther"]); const emit = defineEmits(["handleDialog", "changeOther"]);
const handleClose = () => { const handleClose = () => {
@ -102,12 +102,12 @@ const state = <
}, },
], ],
}); });
const supplierDialog = ref(null) const supplierDialog = ref(null);
const handleDialog = (key: string, v: boolean) => { const handleDialog = (key: string, v: boolean) => {
showDialog[key] = v; showDialog[key] = v;
}; };
const handleSelectStatus = (v: any) => { const handleSelectStatus = (v: any) => {
resetState() resetState();
state.isShowStatus = false; state.isShowStatus = false;
state.type = v; state.type = v;
}; };
@ -144,10 +144,12 @@ const handleOk = () => {
} }
} }
.btn-box1 { .btn-box1 {
flex-direction: row; position: fixed;
bottom: 0;
left: 0;
margin: 30rpx;
width: calc(100% - 60rpx);
display: flex; display: flex;
align-items: center;
margin-top: 30rpx;
::v-deep button + button { ::v-deep button + button {
margin-left: 50rpx; margin-left: 50rpx;
} }

View File

@ -473,10 +473,12 @@ const getFilter = () => {
} }
.btn-box1 { .btn-box1 {
flex-direction: row; position: fixed;
bottom: 0;
left: 0;
margin: 30rpx;
width: calc(100% - 60rpx);
display: flex; display: flex;
align-items: center;
margin-top: 30rpx;
::v-deep button + button { ::v-deep button + button {
margin-left: 50rpx; margin-left: 50rpx;
} }

View File

@ -1,5 +1,5 @@
<template> <template>
<u-popup :show="show" mode="left" :closeable="true" @close="handleClose"> <u-popup :show="show" mode="right" :closeable="true" @close="handleClose">
<view class="c-dialog-filter"> <view class="c-dialog-filter">
<view class="title">{{ isShipment ? "出货" : "收货" }}产品</view> <view class="title">{{ isShipment ? "出货" : "收货" }}产品</view>
<view v-if="isShipment"> <view v-if="isShipment">

View File

@ -1,5 +1,5 @@
<template> <template>
<u-popup :show="show" mode="left" :closeable="true" @close="handleClose"> <u-popup :show="show" mode="right" :closeable="true" @close="handleClose">
<view class="c-dialog-filter"> <view class="c-dialog-filter">
<view class="title">{{isShipment? '客户' : '供应商'}}筛选</view> <view class="title">{{isShipment? '客户' : '供应商'}}筛选</view>
<view class="search"> <view class="search">

View File

@ -172,17 +172,13 @@ const startSave = () => {
if (model1.formData.id) { if (model1.formData.id) {
CustomerApi.updateCustomUser(model1.formData).then((res) => { CustomerApi.updateCustomUser(model1.formData).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.redirectTo({ uni.navigateBack()
url: "/pagesApp/customerMgt", //
});
} }
}); });
} else { } else {
CustomerApi.addCustomUser(model1.formData).then((res) => { CustomerApi.addCustomUser(model1.formData).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.redirectTo({ uni.navigateBack()
url: "/pagesApp/customerMgt", //
});
} }
}); });
} }

View File

@ -74,6 +74,7 @@
mode="datetime" mode="datetime"
@confirm="(v: any) => {handleTime(v)}" @confirm="(v: any) => {handleTime(v)}"
@cancel="contrlModalParams.isShowSplTime = false" @cancel="contrlModalParams.isShowSplTime = false"
:closeOnClickOverlay="true"
></u-datetime-picker> ></u-datetime-picker>
<block v-for="(item, index) in formAttrList" :key="index"> <block v-for="(item, index) in formAttrList" :key="index">
<u-action-sheet <u-action-sheet
@ -385,9 +386,6 @@ const startSave = () => {
if (res.code === 200) { if (res.code === 200) {
model1.order.id = res.data; model1.order.id = res.data;
upload(); upload();
// uni.redirectTo({
// url: "/pagesHome/index", //
// });
uni.navigateBack() uni.navigateBack()
} }
}); });

View File

@ -76,6 +76,7 @@
mode="datetime" mode="datetime"
@confirm="(v: any) => {handleTime(v)}" @confirm="(v: any) => {handleTime(v)}"
@cancel="contrlModalParams.isShowSplTime = false" @cancel="contrlModalParams.isShowSplTime = false"
:closeOnClickOverlay="true"
></u-datetime-picker> ></u-datetime-picker>
<block <block
v-for="(item, index) in model1.order.buttonType === 3 v-for="(item, index) in model1.order.buttonType === 3
@ -507,9 +508,6 @@ const startSave = () => {
if (res.code === 200) { if (res.code === 200) {
model1.order.id = res.data; model1.order.id = res.data;
upload(); upload();
// uni.redirectTo({
// url: "/pagesHome/index", //
// });
uni.navigateBack() uni.navigateBack()
} }
}); });

View File

@ -277,17 +277,13 @@ const startSave = () => {
if (model1.formData.id) { if (model1.formData.id) {
GoodsApi.EditReceiveProduct(model1.formData).then((res) => { GoodsApi.EditReceiveProduct(model1.formData).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.redirectTo({ uni.navigateBack()
url: "/pagesApp/receiveProduct", //
});
} }
}); });
} else { } else {
GoodsApi.addReProducts(model1.formData).then((res) => { GoodsApi.addReProducts(model1.formData).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.redirectTo({ uni.navigateBack()
url: "/pagesApp/receiveProduct", //
});
} }
}); });
} }

View File

@ -172,18 +172,14 @@ const startSave = () => {
ProfileApi.updateRole({ ...deleteBaseKey(model1.formData), list }).then( ProfileApi.updateRole({ ...deleteBaseKey(model1.formData), list }).then(
(res) => { (res) => {
if (res.code === 200) { if (res.code === 200) {
uni.redirectTo({ uni.navigateBack()
url: "/pagesApp/role", //
});
} }
} }
); );
} else { } else {
ProfileApi.addRole({ ...model1.formData, list }).then((res) => { ProfileApi.addRole({ ...model1.formData, list }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.redirectTo({ uni.navigateBack()
url: "/pagesApp/role", //
});
} }
}); });
} }

View File

@ -191,17 +191,13 @@ const startSave = () => {
if (model1.formData.id) { if (model1.formData.id) {
GoodsApi.editShipmentProduct(model1.formData).then((res) => { GoodsApi.editShipmentProduct(model1.formData).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.redirectTo({ uni.navigateBack()
url: "/pagesApp/shipmentProduct", //
});
} }
}); });
} else { } else {
GoodsApi.addShipmentProduct(model1.formData).then((res) => { GoodsApi.addShipmentProduct(model1.formData).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.redirectTo({ uni.navigateBack()
url: "/pagesApp/shipmentProduct", //
});
} }
}); });
} }

View File

@ -160,17 +160,13 @@ const startSave = () => {
parentId: model1.formData.parentId, parentId: model1.formData.parentId,
}).then((res) => { }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.redirectTo({ uni.navigateBack()
url: "/pagesApp/shipmentType", //
});
} }
}); });
} else { } else {
GoodsApi.addShmCategory({ ...model1.formData }).then((res) => { GoodsApi.addShmCategory({ ...model1.formData }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.redirectTo({ uni.navigateBack()
url: "/pagesApp/shipmentType", //
});
} }
}); });
} }

View File

@ -158,17 +158,13 @@ const startSave = () => {
if (model1.formData.id) { if (model1.formData.id) {
StockCardApi.updateStockCard({...deleteBaseKey(model1.formData)}).then((res) => { StockCardApi.updateStockCard({...deleteBaseKey(model1.formData)}).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.redirectTo({ uni.navigateBack()
url: "/pagesApp/stockCard", //
});
} }
}); });
} else { } else {
StockCardApi.addStockCard(model1.formData).then((res) => { StockCardApi.addStockCard(model1.formData).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.redirectTo({ uni.navigateBack()
url: "/pagesApp/stockCard", //
});
} }
}); });
} }

View File

@ -258,17 +258,13 @@ const startSave = () => {
if (model1.formData.id) { if (model1.formData.id) {
SupplierApi.updateSupplierUser(model1.formData).then((res) => { SupplierApi.updateSupplierUser(model1.formData).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.redirectTo({ uni.navigateBack()
url: "/pagesApp/supplierMgt", //
});
} }
}); });
} else { } else {
SupplierApi.addSupplierUser(model1.formData).then((res) => { SupplierApi.addSupplierUser(model1.formData).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.redirectTo({ uni.navigateBack()
url: "/pagesApp/supplierMgt", //
});
} }
}); });
} }

View File

@ -60,9 +60,7 @@
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { StockCardApi, SupplierApi } from "@/services"; import { SupplierApi } from "@/services";
import { formatDate } from "@/utils";
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore"; import _ from "underscore";
@ -141,17 +139,13 @@ const startSave = () => {
if (model1.formData.id) { if (model1.formData.id) {
SupplierApi.updateSupplierType(model1.formData).then((res) => { SupplierApi.updateSupplierType(model1.formData).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.redirectTo({ uni.navigateBack()
url: "/pagesApp/supplierType", //
});
} }
}); });
} else { } else {
SupplierApi.addSupplierType(model1.formData).then((res) => { SupplierApi.addSupplierType(model1.formData).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.redirectTo({ uni.navigateBack()
url: "/pagesApp/supplierType", //
});
} }
}); });
} }

View File

@ -212,17 +212,13 @@ const startSave = () => {
if (model1.formData.id) { if (model1.formData.id) {
ProfileApi.updateUserById(model1.formData).then((res) => { ProfileApi.updateUserById(model1.formData).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.redirectTo({ uni.navigateBack()
url: "/pagesApp/user", //
});
} }
}); });
} else { } else {
ProfileApi.addUser({ userType: 1, ...model1.formData }).then((res) => { ProfileApi.addUser({ userType: 1, ...model1.formData }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.redirectTo({ uni.navigateBack()
url: "/pagesApp/user", //
});
} }
}); });
} }

View File

@ -36,7 +36,7 @@ const obj = ref<any>({
}); });
const list = ref<any>([]) const list = ref<any>([])
const getPayment = (item: any) => { const getPayment = (item: any) => {
return ["出货单收款", "其他收款"][ return ["出货单收款", "其他收款(手动)"][
item.paymentType item.paymentType
]; ];
}; };

View File

@ -56,6 +56,7 @@ import { UsersType } from "@/utils/enum";
import PageView from "@/components/PageView/index.vue"; import PageView from "@/components/PageView/index.vue";
import type { Customer } from "@/types/user"; import type { Customer } from "@/types/user";
import SmallModal from "@/components/Modal/smallModal.vue"; import SmallModal from "@/components/Modal/smallModal.vue";
import { onShow } from "@dcloudio/uni-app";
const isShowCancelModal = ref(false); const isShowCancelModal = ref(false);
const deleteId = ref(0); const deleteId = ref(0);
const handleModal = (v: boolean, id: number) => { const handleModal = (v: boolean, id: number) => {
@ -131,7 +132,8 @@ const getList = (v?: boolean) => {
} }
}); });
}; };
onMounted(() => { onShow(() => {
resetPageList()
getList(); getList();
}); });
</script> </script>

View File

@ -18,7 +18,12 @@
><u-icon name="arrow-down"></u-icon ><u-icon name="arrow-down"></u-icon
></view> ></view>
<view @click="state.isShowStatus = true" <view @click="state.isShowStatus = true"
><text>费用类型</text><u-icon name="arrow-down"></u-icon ><text>{{
state.currentPaymentType === -1
? "费用类型"
: getPayment({ paymentType: state.currentPaymentType })
}}</text
><u-icon name="arrow-down"></u-icon
></view> ></view>
<view class="btn" @click="handleDialog('showFilter', true)">筛选</view> <view class="btn" @click="handleDialog('showFilter', true)">筛选</view>
</view> </view>
@ -53,7 +58,7 @@
@click="getDetail(item)" @click="getDetail(item)"
> >
<u-row justify="space-between"> <u-row justify="space-between">
<u-col span="9"> <u-col span="8">
<view class=""> <view class="">
<view class=""> {{ item.customerName || "-" }} </view> <view class=""> {{ item.customerName || "-" }} </view>
<view class=""> {{ item.revenueNumber }} </view> <view class=""> {{ item.revenueNumber }} </view>
@ -62,7 +67,7 @@
</view> </view>
</view> </view>
</u-col> </u-col>
<u-col span="3"> <u-col span="4">
<view class="amount"> <view class="amount">
<view> {{ item.totalPrice }}</view> <view> {{ item.totalPrice }}</view>
<view class="tip">{{ getPayment(item) }}</view> <view class="tip">{{ getPayment(item) }}</view>
@ -136,7 +141,7 @@ const state = reactive({
key: 0, key: 0,
}, },
{ {
name: "其他收款", name: "其他收款(手动)",
key: 1, key: 1,
}, },
], ],
@ -146,7 +151,7 @@ const state = reactive({
}); });
const getPayment = (item: any) => { const getPayment = (item: any) => {
return ["出货单收款", "其他收款"][item.paymentType]; return ["出货单收款", "其他收款(手动)"][item.paymentType];
}; };
const showDialog = < const showDialog = <
{ {

View File

@ -18,7 +18,7 @@
><u-icon name="arrow-down"></u-icon ><u-icon name="arrow-down"></u-icon
></view> ></view>
<view @click="state.isShowStatus = true" <view @click="state.isShowStatus = true"
><text>费用类型</text><u-icon name="arrow-down"></u-icon ><text>{{state.currentPaymentType === -1 ? '费用类型' : getPayment({paymentType: state.currentPaymentType})}}</text><u-icon name="arrow-down"></u-icon
></view> ></view>
<view class="btn" @click="handleDialog('showFilter', true)">筛选</view> <view class="btn" @click="handleDialog('showFilter', true)">筛选</view>
</view> </view>
@ -152,7 +152,6 @@ const state = reactive({
userType: -1, userType: -1,
params: {}, params: {},
}); });
const getPayment = (item: any) => { const getPayment = (item: any) => {
return ["供应商付款", "客户付款", "客户(手动)", "供应商(手动)"][ return ["供应商付款", "客户付款", "客户(手动)", "供应商(手动)"][
item.paymentType item.paymentType

View File

@ -53,6 +53,7 @@ import { GoodsApi } from "@/services";
import { UsersType } from "@/utils/enum"; import { UsersType } from "@/utils/enum";
import PageView from "@/components/PageView/index.vue"; import PageView from "@/components/PageView/index.vue";
import SmallModal from "@/components/Modal/smallModal.vue"; import SmallModal from "@/components/Modal/smallModal.vue";
import { onShow } from "@dcloudio/uni-app";
const isShowCancelModal = ref(false); const isShowCancelModal = ref(false);
const deleteId = ref(0); const deleteId = ref(0);
const handleModal = (v: boolean, id: number) => { const handleModal = (v: boolean, id: number) => {
@ -140,7 +141,8 @@ const add = () => {
url: "/pagesApp/components/addReceiveProduct", // url: "/pagesApp/components/addReceiveProduct", //
}); });
}; };
onMounted(() => { onShow(() => {
resetPageList()
getList(); getList();
}); });
</script> </script>

View File

@ -78,6 +78,8 @@
mode="datetime" mode="datetime"
@confirm="(v: any) => {handleTime(v)}" @confirm="(v: any) => {handleTime(v)}"
@cancel="contrlModalParams.isShowSplTime = false" @cancel="contrlModalParams.isShowSplTime = false"
:closeOnClickOverlay="true"
@close="contrlModalParams.isShowSplTime = false"
></u-datetime-picker> ></u-datetime-picker>
<block v-for="(item, index) in formAttrList" :key="index"> <block v-for="(item, index) in formAttrList" :key="index">
<u-action-sheet <u-action-sheet
@ -592,9 +594,7 @@ const startSave = () => {
if (res.code === 200) { if (res.code === 200) {
model1.order.id = res.data; model1.order.id = res.data;
upload(); upload();
uni.redirectTo({ uni.navigateBack()
url: "/pagesHome/index", //
});
} }
}); });
}; };

View File

@ -51,6 +51,7 @@
import { ProfileApi, StockCardApi } from "@/services"; import { ProfileApi, StockCardApi } from "@/services";
import PageView from "@/components/PageView/index.vue"; import PageView from "@/components/PageView/index.vue";
import SmallModal from "@/components/Modal/smallModal.vue"; import SmallModal from "@/components/Modal/smallModal.vue";
import { onShow } from "@dcloudio/uni-app";
const isShowCancelModal = ref(false); const isShowCancelModal = ref(false);
const deleteId = ref(0); const deleteId = ref(0);
const handleModal = (v: boolean, id: number) => { const handleModal = (v: boolean, id: number) => {
@ -128,7 +129,8 @@ const getList = (v?: boolean) => {
}); });
}; };
onMounted(() => { onShow(() => {
resetPageList()
getList(); getList();
}); });
</script> </script>

View File

@ -55,6 +55,7 @@ import { GoodsApi } from "@/services";
import PageView from "@/components/PageView/index.vue"; import PageView from "@/components/PageView/index.vue";
import SmallModal from "@/components/Modal/smallModal.vue"; import SmallModal from "@/components/Modal/smallModal.vue";
import { onShow } from "@dcloudio/uni-app";
const isShowCancelModal = ref(false); const isShowCancelModal = ref(false);
const deleteId = ref(0); const deleteId = ref(0);
const handleModal = (v: boolean, id: number) => { const handleModal = (v: boolean, id: number) => {
@ -139,7 +140,8 @@ const add = () => {
url: "/pagesApp/components/addShipmentProduct", // url: "/pagesApp/components/addShipmentProduct", //
}); });
}; };
onMounted(() => { onShow(() => {
resetPageList()
getList(); getList();
}); });
</script> </script>

View File

@ -78,6 +78,8 @@
mode="datetime" mode="datetime"
@confirm="(v: any) => {handleTime(v)}" @confirm="(v: any) => {handleTime(v)}"
@cancel="contrlModalParams.isShowSplTime = false" @cancel="contrlModalParams.isShowSplTime = false"
:closeOnClickOverlay="true"
@close="contrlModalParams.isShowSplTime = false"
></u-datetime-picker> ></u-datetime-picker>
<block v-for="(item, index) in formAttrList" :key="index"> <block v-for="(item, index) in formAttrList" :key="index">
<u-action-sheet <u-action-sheet
@ -547,9 +549,7 @@ const startSave = () => {
if (res.code === 200) { if (res.code === 200) {
model1.order.id = res.data; model1.order.id = res.data;
upload(); upload();
uni.redirectTo({ uni.navigateBack()
url: "/pagesHome/index", //
});
} }
}); });
}; };

View File

@ -73,6 +73,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { GoodsApi } from "@/services"; import { GoodsApi } from "@/services";
import SmallModal from "@/components/Modal/smallModal.vue"; import SmallModal from "@/components/Modal/smallModal.vue";
import { onShow } from "@dcloudio/uni-app";
const isShowCancelModal = ref(false); const isShowCancelModal = ref(false);
const deleteId = ref(0); const deleteId = ref(0);
const handleModal = (v: boolean, id: number) => { const handleModal = (v: boolean, id: number) => {
@ -131,7 +132,8 @@ const getList = (v?: boolean) => {
}); });
}; };
onMounted(() => { onShow(() => {
resetPageList()
getList(); getList();
}); });
</script> </script>

View File

@ -62,6 +62,7 @@ import { StockCardApi } from "@/services";
import { StockCardType } from "@/utils/enum"; import { StockCardType } from "@/utils/enum";
import PageView from "@/components/PageView/index.vue"; import PageView from "@/components/PageView/index.vue";
import SmallModal from "@/components/Modal/smallModal.vue"; import SmallModal from "@/components/Modal/smallModal.vue";
import { onShow } from "@dcloudio/uni-app";
const isShowCancelModal = ref(false); const isShowCancelModal = ref(false);
const deleteId = ref(0); const deleteId = ref(0);
const handleModal = (v: boolean, id: number) => { const handleModal = (v: boolean, id: number) => {
@ -138,7 +139,8 @@ const getList = (v?: boolean) => {
}); });
}; };
onMounted(() => { onShow(() => {
resetPageList()
getList(); getList();
}); });
</script> </script>

View File

@ -66,6 +66,7 @@ import { SupplierApi } from "@/services";
import { UsersType } from "@/utils/enum"; import { UsersType } from "@/utils/enum";
import PageView from "@/components/PageView/index.vue"; import PageView from "@/components/PageView/index.vue";
import SmallModal from "@/components/Modal/smallModal.vue"; import SmallModal from "@/components/Modal/smallModal.vue";
import { onShow } from "@dcloudio/uni-app";
const isShowCancelModal = ref(false); const isShowCancelModal = ref(false);
const deleteId = ref(0); const deleteId = ref(0);
const handleModal = (v: boolean, id: number) => { const handleModal = (v: boolean, id: number) => {
@ -162,7 +163,8 @@ const addSupplier = () => {
url: "/pagesApp/components/addSupplier", // url: "/pagesApp/components/addSupplier", //
}); });
}; };
onMounted(() => { onShow(() => {
resetPageList()
getList(); getList();
getSupplierTypeList(); getSupplierTypeList();
}); });

View File

@ -51,6 +51,7 @@
import { StockCardApi, SupplierApi } from "@/services"; import { StockCardApi, SupplierApi } from "@/services";
import PageView from "@/components/PageView/index.vue"; import PageView from "@/components/PageView/index.vue";
import SmallModal from "@/components/Modal/smallModal.vue"; import SmallModal from "@/components/Modal/smallModal.vue";
import { onShow } from "@dcloudio/uni-app";
const isShowCancelModal = ref(false); const isShowCancelModal = ref(false);
const deleteId = ref(0); const deleteId = ref(0);
const handleModal = (v: boolean, id: number) => { const handleModal = (v: boolean, id: number) => {
@ -135,7 +136,8 @@ const getList = (v?: boolean) => {
}); });
}; };
onMounted(() => { onShow(() => {
resetPageList()
getList(); getList();
}); });
</script> </script>

View File

@ -57,6 +57,7 @@ import PageView from "@/components/PageView/index.vue";
import { ProfileApi } from "@/services"; import { ProfileApi } from "@/services";
import type { User } from "@/types/user"; import type { User } from "@/types/user";
import SmallModal from "@/components/Modal/smallModal.vue"; import SmallModal from "@/components/Modal/smallModal.vue";
import { onShow } from "@dcloudio/uni-app";
const isShowCancelModal = ref(false); const isShowCancelModal = ref(false);
const deleteId = ref(0); const deleteId = ref(0);
@ -138,7 +139,8 @@ const getList = (v?: boolean) => {
}); });
}; };
onMounted(() => { onShow(() => {
resetPageList()
getList(); getList();
}); });
</script> </script>

View File

@ -1,5 +1,5 @@
<template> <template>
<u-popup :show="show" mode="left" :closeable="true" @close="handleClose"> <u-popup :show="show" mode="right" :closeable="true" @close="handleClose">
<view class="c-dialog-filter"> <view class="c-dialog-filter">
<view class="title">{{ isShipment ? "出货" : "收货" }}产品</view> <view class="title">{{ isShipment ? "出货" : "收货" }}产品</view>
<view class="dialog-product-layout"> <view class="dialog-product-layout">

View File

@ -1,5 +1,5 @@
<template> <template>
<u-popup :show="show" mode="left" :closeable="true" @close="handleClose"> <u-popup :show="show" mode="right" :closeable="true" @close="handleClose">
<view class="c-dialog-filter"> <view class="c-dialog-filter">
<view class="title">{{isShipment? '客户' : '供应商'}}筛选</view> <view class="title">{{isShipment? '客户' : '供应商'}}筛选</view>
<view class="search"> <view class="search">

View File

@ -122,12 +122,51 @@
@click="handleReviewOrPay(currentTab)" @click="handleReviewOrPay(currentTab)"
></u-button> ></u-button>
</view> </view>
<!-- 支付方式 -->
<block>
<u-action-sheet
:actions="contrlModalParams['paySelect'].list"
:title="contrlModalParams['paySelect'].title"
:show="contrlModalParams['paySelect'].isShow"
@select="(v: any) => handleSelect1('paySelect', v)"
@close="contrlModalParams['paySelect'].isShow = false"
:closeOnClickAction="true"
></u-action-sheet>
</block>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ReceiveApi } from "@/services/index"; import { ReceiveApi } from "@/services/index";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
import PageView from "@/components/PageView/index.vue"; import PageView from "@/components/PageView/index.vue";
import { ScaleStatus } from "@/utils/enum"; import { ScaleStatus } from "@/utils/enum";
const contrlModalParams = reactive<{ [attrName: string]: any }>({
paySelect: {
isShow: false,
title: "请选择支付方式",
// 1:23线4
list: [
{
name: "微信",
key: 3,
},
{
name: "现金",
key: 1,
},
{
name: "支付宝",
key: 4,
},
{
name: "转账",
key: 2,
},
],
},
});
// scaleStatus // scaleStatus
const pageList: PageResult<Order> = reactive({ const pageList: PageResult<Order> = reactive({
isLoading: false, isLoading: false,
@ -190,13 +229,13 @@ const handleReview = (id: number, scaleStatus: number, title: string) => {
const handleReviewOrPay = (status: number) => { const handleReviewOrPay = (status: number) => {
// //
if (ScaleStatus.ToBeReview === status) { if (ScaleStatus.ToBeReview === status) {
updateStatus(ScaleStatus.ToBePay); updateStatus(ScaleStatus.ToBePay, -1);
} else if (ScaleStatus.ToBePay === status) { } else if (ScaleStatus.ToBePay === status) {
// //
updateStatus(ScaleStatus.Paid); contrlModalParams.paySelect.isShow = true
} }
}; };
const updateStatus = (status: number) => { const updateStatus = (status: number, key: number) => {
const list = pageList.list const list = pageList.list
.filter((item) => item.isChecked) .filter((item) => item.isChecked)
.map((item) => { .map((item) => {
@ -206,7 +245,12 @@ const updateStatus = (status: number) => {
uni.showToast({icon: 'none', title: '请至少选择一个收货单'}) uni.showToast({icon: 'none', title: '请至少选择一个收货单'})
return return
} }
ReceiveApi.updateOrderIn({ orderInPos: list }).then((res) => {
let paramsList:any = list;
if (ScaleStatus.Paid === status) {
paramsList = list.map(item => {return {...item, paymentMethod: key}})
}
ReceiveApi.updateOrderIn({ orderInPos: paramsList }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
resetPageList(); resetPageList();
getList(); getList();
@ -215,11 +259,16 @@ const updateStatus = (status: number) => {
}; };
const handleSelect = () => { const handleSelect = () => {
state.isAll = !state.isAll; state.isAll = !state.isAll;
console.log(state.isAll);
pageList.list = pageList.list.map((item) => { pageList.list = pageList.list.map((item) => {
return { ...item, isChecked: state.isAll }; return { ...item, isChecked: state.isAll };
}); });
}; };
const handleSelect1 = (key: string, v: any) => {
contrlModalParams[key].isShow = false;
//
updateStatus(ScaleStatus.Paid, v.key);
};
const getList = (v?: boolean) => { const getList = (v?: boolean) => {
if (v) { if (v) {

View File

@ -1,5 +1,5 @@
<template> <template>
<u-popup :show="show" mode="left" :closeable="true" @close="handleClose"> <u-popup :show="show" mode="right" :closeable="true" @close="handleClose">
<view class="c-dialog-filter"> <view class="c-dialog-filter">
<view class="title">{{ isShipment ? "出货" : "收货" }}产品</view> <view class="title">{{ isShipment ? "出货" : "收货" }}产品</view>
<view v-if="isShipment"> <view v-if="isShipment">

View File

@ -10,12 +10,13 @@
:errorType="'border-bottom'" :errorType="'border-bottom'"
> >
<block v-for="(item, index) in formAttrList" :key="index"> <block v-for="(item, index) in formAttrList" :key="index">
<!-- 自提的时候 隐藏运费和杂费 -->
<u-form-item <u-form-item
:prop="`order.${item.key}`" :prop="`order.${item.key}`"
:label="item.name" :label="item.name"
:required="item.required" :required="item.required"
@click="item.fn" @click="item.fn"
v-if="item.key !== 'paymentMethodName'" v-if="isShowFormItem(item)"
:borderBottom="false" :borderBottom="false"
> >
<u-textarea <u-textarea
@ -33,6 +34,7 @@
:customStyle="{}" :customStyle="{}"
border="none" border="none"
:disabled="item.disabled || item.type === 'select'" :disabled="item.disabled || item.type === 'select'"
:disabledColor="item.name === '结算方式' ? '#ffffff' : '#f5f7fa'"
@change="(e:any) => {handleInput(e, item)}" @change="(e:any) => {handleInput(e, item)}"
> >
<template #suffix> <template #suffix>
@ -75,44 +77,6 @@
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right"></u-icon>
</template> </template>
</u-form-item> </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-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"
@change="(e:any) => {handleInput(e, item)}"
:disabled="item.disabled || item.type === 'select'"
:disabledColor="item.name === '结算方式'?'#ffffff':'#f5f7fa'"
>
<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> </block>
</u-form> </u-form>
<block v-for="(item, index) in formAttrList" :key="index"> <block v-for="(item, index) in formAttrList" :key="index">
@ -143,6 +107,19 @@ import {
} from "@/utils/enum"; } from "@/utils/enum";
import valid from "@/utils/validate"; import valid from "@/utils/validate";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
const isShowFormItem = (item: any) => {
if (model1.scaleStatusBtnType === ScaleStatusBtnType.ShipmentPay) {
return true;
} else {
return (
item.key !== "paymentMethodName" &&
!(
model1.order.deliveryMethod === 1 &&
["freight", "incidentals"].indexOf(item.key) > -1
)
);
}
};
// //
const handleInput = (e: any, item: any) => { const handleInput = (e: any, item: any) => {
if ( if (
@ -360,19 +337,20 @@ const formAttrList = reactive<ComType>([
}, },
{ {
name: "提货方式", name: "提货方式",
key: "deliveryMethod", key: "deliveryMethodName",
type: "radio", type: "input",
unit: "", unit: "",
child: [ disabled: true,
{ // child: [
id: 0, // {
name: "送货", // id: 0,
}, // name: "",
{ // },
id: 1, // {
name: "自提", // id: 1,
}, // name: "",
], // },
// ],
}, },
{ {
name: "运费", name: "运费",
@ -420,6 +398,19 @@ const formAttrList = reactive<ComType>([
}, },
]); ]);
// const handleIsShowInput = (item: any) => {
// if () {
// return true
// } else {
// if (model1.order.deliveryMethod === 0 && ['freight', 'incidentals'].indexOf(item.key) > -1) {
// return false
// } {
// return true
// }
// }
// }
// //
watch( watch(
[ [
@ -431,8 +422,14 @@ watch(
() => model1.order.freight, () => model1.order.freight,
() => model1.order.incidentals, () => model1.order.incidentals,
() => model1.order.totalPrice, () => model1.order.totalPrice,
() => model1.order.deliveryMethod,
], ],
([settlementGrossNew, settlementTareNew]) => { ([settlementGrossNew, settlementTareNew]) => {
//
if (model1.order.deliveryMethod === 1) {
model1.order.freight = 0;
model1.order.incidentals = 0;
}
/** /**
* 过磅净重 毛重-皮重 * 过磅净重 毛重-皮重
结算重量 过磅净重-扣杂 结算重量 过磅净重-扣杂
@ -611,11 +608,15 @@ const updateOrder = () => {
title: "编辑成功", title: "编辑成功",
icon: "success", icon: "success",
}); });
uni.redirectTo({
url: uni.navigateBack({
"/pagesShipment/review/index?id=" + delta: 1,
model1.order.id + success: (res) => {
`&scaleStatusBtnType=${model1.scaleStatusBtnType}`, // uni.$emit("shipmentReviewUrlParams", {
id: model1.order.id,
scaleStatusBtnType: model1.scaleStatusBtnType,
});
},
}); });
} }
}); });
@ -636,6 +637,7 @@ onLoad((option) => {
res.data.buttonType === 0 res.data.buttonType === 0
? res.data.buckleMiscellaneous ? res.data.buckleMiscellaneous
: res.data.points, : res.data.points,
deliveryMethodName: res.data.deliveryMethod === 0 ? "送货" : "自提",
fileLists: model1.order.fileLists.map((item: any) => { fileLists: model1.order.fileLists.map((item: any) => {
return { ...item, fileID: item.id }; return { ...item, fileID: item.id };
}), }),

View File

@ -414,13 +414,13 @@ const updateOrder = () => {
// else if (state.scaleStatus === ScaleStatus.ToBeGrossWeight) { // else if (state.scaleStatus === ScaleStatus.ToBeGrossWeight) {
// status = ScaleStatus.ToBeShipmentReview; // status = ScaleStatus.ToBeShipmentReview;
// } // }
debugger
let status = 0; let status = 0;
if (state.scaleStatus === ScaleStatus.ToBeShipment) { if (state.scaleStatus === ScaleStatus.ToBeShipment) {
status = ScaleStatus.ToBeGrossWeight; status = ScaleStatus.ToBeGrossWeight;
} else { } else {
status = model1.order.status; status = model1.order.scaleStatus;
} }
//
ShipmentApi.updateOrderIn({ ShipmentApi.updateOrderIn({
orderOutPos: [{ ...model1.order, scaleStatus: status }], orderOutPos: [{ ...model1.order, scaleStatus: status }],
}).then((res) => { }).then((res) => {
@ -429,19 +429,21 @@ const updateOrder = () => {
title: "编辑成功", title: "编辑成功",
icon: "success", icon: "success",
}); });
if (state.scaleStatus === ScaleStatus.ToBeShipment || state.scaleStatus === ScaleStatus.ToBeGrossWeight) {
// uni.redirectTo({
// url: "/pagesShipment/shipmenting?scaleStatus=" + state.scaleStatus, //
// });
uni.navigateBack() uni.navigateBack()
} else { // if (state.scaleStatus === ScaleStatus.ToBeShipment || state.scaleStatus === ScaleStatus.ToBeGrossWeight) {
uni.redirectTo({ // // uni.redirectTo({
url: // // url: "/pagesShipment/shipmenting?scaleStatus=" + state.scaleStatus, //
"/pagesShipment/review/index?id=" + // // });
model1.order.id +
`&scaleStatusBtnType=1`, // // } else {
}); // uni.navigateBack()
} // // uni.redirectTo({
// // url:
// // "/pagesShipment/review/index?id=" +
// // model1.order.id +
// // `&scaleStatusBtnType=1`, //
// // });
// }
} }
}); });
}; };
@ -462,7 +464,7 @@ onLoad((option) => {
}); });
} else { } else {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "审核结算编辑", title: "编辑出货",
}); });
} }
if (model1.order.id) { if (model1.order.id) {

View File

@ -125,10 +125,12 @@
><text ><text
>{{ item.isBefore ? item.unit : "" }} >{{ item.isBefore ? item.unit : "" }}
<text v-if="item.name === '净重误差'"> <text v-if="item.name === '净重误差'">
{{ (state.order.netWeight || 0)- (state.order.settlementNet || 0) }} {{
(state.order.netWeight || 0) - (state.order.settlementNet || 0)
}}
</text> </text>
<text v-else-if="item.name === '结算方式'"> <text v-else-if="item.name === '结算方式'">
{{ payMethodMap[item.num] || '暂无' }} {{ payMethodMap[item.num] || "暂无" }}
</text> </text>
<text v-else> {{ item.num }}</text> <text v-else> {{ item.num }}</text>
@ -206,14 +208,14 @@
<script setup lang="ts"> <script setup lang="ts">
import { ShipmentApi } from "@/services/index"; import { ShipmentApi } from "@/services/index";
import { ScaleStatusBtnType } from "@/utils/enum"; import { ScaleStatusBtnType } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad, onShow } from "@dcloudio/uni-app";
import SmallModal from "@/components/Modal/smallModal.vue"; import SmallModal from "@/components/Modal/smallModal.vue";
const payMethodMap: any = { const payMethodMap: any = {
'1': '现金', "1": "现金",
'2': '转账', "2": "转账",
'3': '微信', "3": "微信",
'4': '支付宝' "4": "支付宝",
} };
const contrlModalParams = reactive<{ [attrName: string]: any }>({ const contrlModalParams = reactive<{ [attrName: string]: any }>({
paySelect: { paySelect: {
isShow: false, isShow: false,
@ -385,7 +387,7 @@ const gridList3 = reactive([
}, },
{ {
name: "结算人", name: "结算人",
enName: "userName", enName: "updateName",
num: "", num: "",
isBefore: false, isBefore: false,
}, },
@ -548,7 +550,11 @@ const handleUpdateOrder = () => {
// //
const handleReWeight = () => { const handleReWeight = () => {
ShipmentApi.reGrossWeight({ id: state.order.id, userId: state.order.userId, deviceId: state.order.deviceId }).then((res) => { ShipmentApi.reGrossWeight({
id: state.order.id,
userId: state.order.userId,
deviceId: state.order.deviceId,
}).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.navigateTo({ uni.navigateTo({
url: "/pagesShipment/shipmenting?scaleStatus=1", // url: "/pagesShipment/shipmenting?scaleStatus=1", //
@ -556,25 +562,12 @@ const handleReWeight = () => {
} }
}); });
}; };
onLoad((option) => { const init = () => {
state.order.id = (option as any).id;
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 (state.order.buttonType === 0) {
// item.name = "";
// item.enName = "buckleMiscellaneous";
// item.unit = "KG";
// } else if (state.order.buttonType === 1) {
// item.name = "";
// item.enName = "points";
// item.unit = "%";
// }
// }
item.num = state.order[item.enName as string]; item.num = state.order[item.enName as string];
}); });
gridList2.map((item) => { gridList2.map((item) => {
@ -591,6 +584,23 @@ onLoad((option) => {
} }
}); });
} }
}
onShow(() => {
init()
});
onLoad((option) => {
state.order.id = (option as any).id;
state.scaleStatusBtnType = parseInt((option as any).scaleStatusBtnType);
uni.$on("shipmentReviewUrlParams", (data) => {
console.log(data);
state.order.id = data.id;
state.scaleStatusBtnType = data.scaleStatusBtnType;
init()
});
});
onUnmounted(() => {
uni.$off("shipmentReviewUrlParams", () => {});
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -1,4 +1,4 @@
import { TimeRange } from "./enum"; import { OrderType, TimeRange } from "./enum";
export function formatDate(time: any, cFormat: string) { export function formatDate(time: any, cFormat: string) {
const format = cFormat || "{y}-{m}-{d}"; const format = cFormat || "{y}-{m}-{d}";
@ -234,3 +234,28 @@ export function validateRegex(regexValue: string, value: string) {
const regex = new RegExp(regexValue); const regex = new RegExp(regexValue);
return regex.test(value); return regex.test(value);
} }
/***
*
*/
export function getScaleStatus(type: number, value: number) {
if (type === OrderType.Receive) {
if (value === -1) {
return "全部";
} else if (value === 4) {
return "已支付";
} else if (value === 3) {
return "已审未付";
} else if (value === 2) {
return "未审核";
}
} else if (type === OrderType.Shipment) {
if (value === -1) {
return "全部";
} else if (value === 4) {
return "已结算";
} else if (value === 3) {
return "未结算";
}
}
}

View File

@ -48,14 +48,12 @@ const valid = {
message: "密码由字母、数字组成,且至少8位", message: "密码由字母、数字组成,且至少8位",
}, },
valid_password: { valid_password: {
pattern: pattern: /^(?=.*[a-z])(?=.*\d)[a-zA-Z\d]{8,}$/,
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[A-Za-z\\d]{8,}$/,
message: "密码由字母、数字组成,且至少8位", message: "密码由字母、数字组成,且至少8位",
}, },
valid_password1: { valid_password1: {
pattern: pattern: /^(?=.*[a-z])(?=.*\d)[a-zA-Z\d]{8,}$/,
"^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[A-Za-z\\d]{8,}$", message: "密码必须由字母、数字组成, 且至少8位",
message: "密码必须由字母、数字组成,区分大小写, 且至少8位",
}, },
}; };
export default valid; export default valid;