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>
<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="title">筛选</view>
<u-list height="200">
<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>
</u-cell>
</u-list-item>
@ -80,42 +84,41 @@ const state = <
>reactive({
project: {
id: -1,
name: ''
name: "",
},
user: {
id: -1,
name: ''
}
name: "",
},
});
const handleDialog = (key: string, v: boolean) => {
showDialog[key] = v;
};
const changeUser = (obj:any) => {
state.user = obj
}
const changeProduct = (obj:any) => {
const changeUser = (obj: any) => {
state.user = obj;
};
const changeProduct = (obj: any) => {
if (props.isShipment) {
state.project = {...obj, name: obj.shmProductsName}
state.project = { ...obj, name: obj.shmProductsName };
} else {
state.project = {...obj, name: obj.reProductsName}
state.project = { ...obj, name: obj.reProductsName };
}
}
};
const resetState = () => {
state.project = {
id: -1,
name: ''
}
name: "",
};
state.user = {
id: -1,
name: ''
}
}
name: "",
};
};
const handleOk = () => {
emit("changeOther",{userId: state.user.id, productId: state.project.id})
emit("handleDialog", false);
}
emit("changeOther", { userId: state.user.id, productId: state.project.id });
emit("handleDialog", false);
};
</script>
<style lang="scss" scoped>
.c-dialog-filter {
@ -136,10 +139,12 @@ const handleOk = () => {
}
}
.btn-box1 {
flex-direction: row;
position: fixed;
bottom: 0;
left: 0;
margin: 30rpx;
width: calc(100% - 60rpx);
display: flex;
align-items: center;
margin-top: 30rpx;
::v-deep button + button {
margin-left: 50rpx;
}

View File

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

View File

@ -1,5 +1,5 @@
<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="title">{{isShipment? '客户' : '供应商'}}筛选</view>
<view class="search">

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
<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="title">{{ isShipment ? "出货" : "收货" }}产品</view>
<view v-if="isShipment">

View File

@ -1,5 +1,5 @@
<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="title">{{isShipment? '客户' : '供应商'}}筛选</view>
<view class="search">

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
<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="title">{{ isShipment ? "出货" : "收货" }}产品</view>
<view class="dialog-product-layout">

View File

@ -1,5 +1,5 @@
<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="title">{{isShipment? '客户' : '供应商'}}筛选</view>
<view class="search">

View File

@ -122,12 +122,51 @@
@click="handleReviewOrPay(currentTab)"
></u-button>
</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>
<script setup lang="ts">
import { ReceiveApi } from "@/services/index";
import { onLoad } from "@dcloudio/uni-app";
import PageView from "@/components/PageView/index.vue";
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
const pageList: PageResult<Order> = reactive({
isLoading: false,
@ -190,13 +229,13 @@ const handleReview = (id: number, scaleStatus: number, title: string) => {
const handleReviewOrPay = (status: number) => {
//
if (ScaleStatus.ToBeReview === status) {
updateStatus(ScaleStatus.ToBePay);
updateStatus(ScaleStatus.ToBePay, -1);
} 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
.filter((item) => item.isChecked)
.map((item) => {
@ -206,7 +245,12 @@ const updateStatus = (status: number) => {
uni.showToast({icon: 'none', title: '请至少选择一个收货单'})
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) {
resetPageList();
getList();
@ -215,11 +259,16 @@ const updateStatus = (status: number) => {
};
const handleSelect = () => {
state.isAll = !state.isAll;
console.log(state.isAll);
pageList.list = pageList.list.map((item) => {
return { ...item, isChecked: state.isAll };
});
};
const handleSelect1 = (key: string, v: any) => {
contrlModalParams[key].isShow = false;
//
updateStatus(ScaleStatus.Paid, v.key);
};
const getList = (v?: boolean) => {
if (v) {

View File

@ -1,5 +1,5 @@
<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="title">{{ isShipment ? "出货" : "收货" }}产品</view>
<view v-if="isShipment">

View File

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

View File

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

View File

@ -125,13 +125,15 @@
><text
>{{ item.isBefore ? item.unit : "" }}
<text v-if="item.name === '净重误差'">
{{ (state.order.netWeight || 0)- (state.order.settlementNet || 0) }}
{{
(state.order.netWeight || 0) - (state.order.settlementNet || 0)
}}
</text>
<text v-else-if="item.name === '结算方式'">
{{ payMethodMap[item.num] || '暂无' }}
{{ payMethodMap[item.num] || "暂无" }}
</text>
<text v-else> {{ item.num }}</text>
{{ item.isBefore ? "" : item.unit }}
</text>
</view>
@ -206,14 +208,14 @@
<script setup lang="ts">
import { ShipmentApi } from "@/services/index";
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";
const payMethodMap:any = {
'1': '现金',
'2': '转账',
'3': '微信',
'4': '支付宝'
}
const payMethodMap: any = {
"1": "现金",
"2": "转账",
"3": "微信",
"4": "支付宝",
};
const contrlModalParams = reactive<{ [attrName: string]: any }>({
paySelect: {
isShow: false,
@ -385,7 +387,7 @@ const gridList3 = reactive([
},
{
name: "结算人",
enName: "userName",
enName: "updateName",
num: "",
isBefore: false,
},
@ -548,7 +550,11 @@ const handleUpdateOrder = () => {
//
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) {
uni.navigateTo({
url: "/pagesShipment/shipmenting?scaleStatus=1", //
@ -556,25 +562,12 @@ const handleReWeight = () => {
}
});
};
onLoad((option) => {
state.order.id = (option as any).id;
state.scaleStatusBtnType = parseInt((option as any).scaleStatusBtnType);
const init = () => {
if (state.order.id) {
ShipmentApi.getDetailById({ id: state.order.id }).then((res) => {
if (res.code === 200) {
state.order = res.data;
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];
});
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>
<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) {
const format = cFormat || "{y}-{m}-{d}";
@ -234,3 +234,28 @@ export function validateRegex(regexValue: string, value: string) {
const regex = new RegExp(regexValue);
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位",
},
valid_password: {
pattern:
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[A-Za-z\\d]{8,}$/,
pattern: /^(?=.*[a-z])(?=.*\d)[a-zA-Z\d]{8,}$/,
message: "密码由字母、数字组成,且至少8位",
},
valid_password1: {
pattern:
"^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[A-Za-z\\d]{8,}$",
message: "密码必须由字母、数字组成,区分大小写, 且至少8位",
pattern: /^(?=.*[a-z])(?=.*\d)[a-zA-Z\d]{8,}$/,
message: "密码必须由字母、数字组成, 且至少8位",
},
};
export default valid;