Compare commits
16 Commits
2dd4b8e43c
...
30faf31b8a
Author | SHA1 | Date |
---|---|---|
![]() |
30faf31b8a | |
![]() |
27bb35590b | |
![]() |
d9d0024c73 | |
![]() |
970f6ee148 | |
![]() |
f8a8c15b6f | |
![]() |
8faf971040 | |
![]() |
ee042a1b33 | |
![]() |
9ddfeecae0 | |
![]() |
824b4de324 | |
![]() |
92a2a38e18 | |
![]() |
8bc4e2f487 | |
![]() |
6877be2963 | |
![]() |
028b83b6a8 | |
![]() |
05dcacd062 | |
![]() |
6a26907192 | |
![]() |
8e3dd63aa2 |
|
@ -4,13 +4,13 @@
|
|||
<view class="title">筛选</view>
|
||||
<u-list height="200">
|
||||
<u-list-item>
|
||||
<u-cell :title="`供应商`" @click="handleDialog('showSupplier', true)">
|
||||
<u-cell :title="`${isShipment ? '客户' : '供应商'}`" @click="handleDialog('showSupplier', true)">
|
||||
<template #right-icon> </template>
|
||||
</u-cell>
|
||||
</u-list-item>
|
||||
<u-list-item boder="none">
|
||||
<u-cell
|
||||
:title="`收货产品`"
|
||||
:title="`${isShipment ? '出货产品' : '收货产品'}`"
|
||||
@click="handleDialog('showProduct', true)"
|
||||
>
|
||||
<template #right-icon> </template>
|
||||
|
@ -42,6 +42,7 @@
|
|||
@handleDialog="(v:boolean) => {handleDialog('showProduct', v)}"
|
||||
@changeProduct="changeProduct"
|
||||
ref="productRef"
|
||||
:isShipment="isShipment"
|
||||
></ProductDialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
@ -49,6 +50,7 @@ import SupplierDialog from "./SupplierDialog.vue";
|
|||
import ProductDialog from "./ProductDialog.vue";
|
||||
const props = defineProps<{
|
||||
show: boolean;
|
||||
isShipment: boolean;
|
||||
}>();
|
||||
const emit = defineEmits(["handleDialog", "changeOther"]);
|
||||
const handleClose = () => {
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
<template>
|
||||
<u-popup :show="show" mode="left" :closeable="true" @close="handleClose">
|
||||
<view class="c-dialog-filter">
|
||||
<view class="title">收货产品</view>
|
||||
<view class="title">{{ isShipment ? "出货" : "收货" }}产品</view>
|
||||
<view class="dialog-product-layout">
|
||||
<text v-for="(item, index) in state.list" :class="{ active: state.current === item.id }" @click="handleSelect(item)" :key="index"
|
||||
>{{ item.reProductsName }}</text
|
||||
<text
|
||||
v-for="(item, index) in state.list"
|
||||
:class="{ active: state.current === item.id }"
|
||||
@click="handleSelect(item)"
|
||||
:key="index"
|
||||
>{{isShipment ? item.shmProductsName : item.reProductsName }}</text
|
||||
>
|
||||
</view>
|
||||
<!-- <view class="btn-confirm">
|
||||
|
@ -16,36 +20,44 @@
|
|||
</u-popup>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ReceiveProductApi } from '@/services';
|
||||
import { ReceiveProductApi, GoodsApi } from "@/services";
|
||||
|
||||
const props = defineProps<{
|
||||
show: boolean,
|
||||
}>()
|
||||
const emit = defineEmits(['handleDialog', 'changeProduct']);
|
||||
show: boolean;
|
||||
isShipment: boolean;
|
||||
}>();
|
||||
const emit = defineEmits(["handleDialog", "changeProduct"]);
|
||||
const handleClose = () => {
|
||||
emit('handleDialog', false)
|
||||
}
|
||||
emit("handleDialog", false);
|
||||
};
|
||||
const state = reactive<any>({
|
||||
list: [],
|
||||
current: -1,
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
const handleSelect = (item:any) => {
|
||||
state.current = item.id
|
||||
emit('changeProduct', item)
|
||||
emit('handleDialog', false)
|
||||
}
|
||||
const handleSelect = (item: any) => {
|
||||
state.current = item.id;
|
||||
emit("changeProduct", item);
|
||||
emit("handleDialog", false);
|
||||
};
|
||||
const getList = () => {
|
||||
ReceiveProductApi.getAllReProducts().then(res => {
|
||||
if (res.code === 200) {
|
||||
state.list = res.data
|
||||
if (props.isShipment) {
|
||||
GoodsApi.getShipmentProductList().then((res) => {
|
||||
if (res.code === 200) {
|
||||
state.list = res.data;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ReceiveProductApi.getAllReProducts().then((res) => {
|
||||
if (res.code === 200) {
|
||||
state.list = res.data;
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-dialog-filter {
|
||||
|
@ -58,53 +70,53 @@ onMounted(() => {
|
|||
text-align: center;
|
||||
}
|
||||
}
|
||||
// 产品dialog
|
||||
.dialog-product-layout {
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 42rpx 25rpx;
|
||||
padding: 19rpx;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
flex-flow: row wrap;
|
||||
max-height: 70vh;
|
||||
overflow: auto;
|
||||
// 产品dialog
|
||||
.dialog-product-layout {
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 42rpx 25rpx;
|
||||
padding: 19rpx;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
flex-flow: row wrap;
|
||||
max-height: 70vh;
|
||||
overflow: auto;
|
||||
|
||||
text {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
background: #ffffff;
|
||||
border-radius: 6rpx;
|
||||
border: 1px solid rgba(153, 153, 153, 0.64);
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
padding: 10rpx 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
margin-left: 10rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.active {
|
||||
border-color: $u-primary;
|
||||
color: $u-primary;
|
||||
text {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
background: #ffffff;
|
||||
border-radius: 6rpx;
|
||||
border: 1px solid rgba(153, 153, 153, 0.64);
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
padding: 0rpx 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
margin-left: 10rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.active {
|
||||
border-color: $u-primary;
|
||||
color: $u-primary;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-confirm {
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
|
||||
border-radius: 13rpx 13rpx 0rpx 0rpx;
|
||||
position: absolute;
|
||||
bottom: 0rpx;
|
||||
width: 100%;
|
||||
left: 0rpx;
|
||||
padding: 27.56rpx;
|
||||
.btn {
|
||||
text-align: center;
|
||||
::v-deep button {
|
||||
width: 80%;
|
||||
border-radius: 43rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-confirm {
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
|
||||
border-radius: 13rpx 13rpx 0rpx 0rpx;
|
||||
position: absolute;
|
||||
bottom: 0rpx;
|
||||
width: 100%;
|
||||
left: 0rpx;
|
||||
padding: 27.56rpx;
|
||||
.btn {
|
||||
text-align: center;
|
||||
::v-deep button {
|
||||
width: 80%;
|
||||
border-radius: 43rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,36 +1,85 @@
|
|||
<template>
|
||||
<u-popup :show="show" mode="bottom" :round="10" :closeable="true" @close="handleClose" :zIndex="999999999999999999">
|
||||
<u-popup
|
||||
:show="show"
|
||||
mode="bottom"
|
||||
:round="10"
|
||||
:closeable="true"
|
||||
@close="handleClose"
|
||||
:zIndex="999999999999999999"
|
||||
>
|
||||
<view class="c-dialog-filter">
|
||||
<view class="title">收货产品</view>
|
||||
<view class="dialog-product-layout">
|
||||
<text v-for="item in 20" :class="{ active: item === 2 }" :key="item"
|
||||
>钢板料{{ item }}</text
|
||||
<view class="title">{{ isShipment ? "出货" : "收货" }}产品</view>
|
||||
<view class="dialog-product-layout" v-if="!isShipment">
|
||||
<text
|
||||
v-for="item in state.list"
|
||||
:class="{ active: state.currentId === item.id }"
|
||||
:key="item.id"
|
||||
@click="handleSelect(item.id)"
|
||||
>{{ item.reProductsName }}</text
|
||||
>
|
||||
</view>
|
||||
<view class="btn-confirm">
|
||||
<view v-if="isShipment">
|
||||
<block v-for="(item, index) in state.list" :key="index">
|
||||
<view style="font-size: 26rpx">{{ item.shmCategoryName }}</view>
|
||||
<view class="dialog-product-layout">
|
||||
<text
|
||||
v-for="cItem in item.childrenList"
|
||||
:class="{ active: state.currentId === item.id }"
|
||||
:key="cItem.id"
|
||||
@click="handleSelect(cItem.id)"
|
||||
>{{ cItem.shmCategoryName }}</text
|
||||
>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- <view class="btn-confirm">
|
||||
<view class="btn">
|
||||
<u-button type="primary" :text="'确认'"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</u-popup>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ReceiveProductApi } from '@/services';
|
||||
import { GoodsApi, ReceiveProductApi } from "@/services";
|
||||
|
||||
const props = defineProps<{
|
||||
show: boolean,
|
||||
}>()
|
||||
const emit = defineEmits(['handleDialog']);
|
||||
show: boolean;
|
||||
isShipment: boolean;
|
||||
}>();
|
||||
const emit = defineEmits(["handleDialog", "changeProduct"]);
|
||||
const handleClose = () => {
|
||||
emit('handleDialog', false)
|
||||
}
|
||||
emit("handleDialog", false);
|
||||
};
|
||||
|
||||
ReceiveProductApi.getAllReProducts().then(res => {
|
||||
if (res.code === 200) {
|
||||
|
||||
const state = reactive<any>({
|
||||
list: [],
|
||||
currentId: -1
|
||||
});
|
||||
|
||||
const handleSelect = (id: number) => {
|
||||
state.currentId = id
|
||||
emit("changeProduct", {productId: id})
|
||||
emit("handleDialog", false);
|
||||
}
|
||||
const getList = () => {
|
||||
if (props.isShipment) {
|
||||
GoodsApi.getShipmentCategory().then((res) => {
|
||||
if (res.code === 200) {
|
||||
state.list = res.data;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
GoodsApi.getReceiveProductList().then((res) => {
|
||||
if (res.code === 200) {
|
||||
state.list = res.data;
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-dialog-filter {
|
||||
|
@ -44,53 +93,51 @@ ReceiveProductApi.getAllReProducts().then(res => {
|
|||
text-align: center;
|
||||
}
|
||||
}
|
||||
// 产品dialog
|
||||
.dialog-product-layout {
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 42rpx 25rpx;
|
||||
padding: 19rpx;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
flex-flow: row wrap;
|
||||
max-height: 70vh;
|
||||
overflow: auto;
|
||||
// 产品dialog
|
||||
.dialog-product-layout {
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 42rpx 25rpx;
|
||||
padding: 19rpx;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
flex-flow: row wrap;
|
||||
max-height: 70vh;
|
||||
overflow: auto;
|
||||
|
||||
text {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
background: #ffffff;
|
||||
border-radius: 6rpx;
|
||||
border: 1px solid rgba(153, 153, 153, 0.64);
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
padding: 10rpx 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
margin-left: 10rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.active {
|
||||
border-color: $u-primary;
|
||||
color: $u-primary;
|
||||
text {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
background: #ffffff;
|
||||
border-radius: 6rpx;
|
||||
border: 1px solid rgba(153, 153, 153, 0.64);
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
padding: 0rpx 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
margin-left: 10rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.active {
|
||||
border-color: $u-primary;
|
||||
color: $u-primary;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-confirm {
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
|
||||
border-radius: 13rpx 13rpx 0rpx 0rpx;
|
||||
width: 100%;
|
||||
left: 0rpx;
|
||||
padding: 27.56rpx;
|
||||
.btn {
|
||||
text-align: center;
|
||||
::v-deep button {
|
||||
width: 80%;
|
||||
border-radius: 43rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-confirm {
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
|
||||
border-radius: 13rpx 13rpx 0rpx 0rpx;
|
||||
position: absolute;
|
||||
bottom: 0rpx;
|
||||
width: 100%;
|
||||
left: 0rpx;
|
||||
padding: 27.56rpx;
|
||||
.btn {
|
||||
text-align: center;
|
||||
::v-deep button {
|
||||
width: 80%;
|
||||
border-radius: 43rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<view class="box"><text>单据状态</text></view>
|
||||
<view class="box-btn"
|
||||
><text
|
||||
v-for="(item, index) in state.statusList"
|
||||
v-for="(item, index) in isShipment ? state.statusList2 : state.statusList1"
|
||||
:key="index"
|
||||
:class="{ active: state.currentStates === item.id }"
|
||||
@click="handleSelect(item)"
|
||||
|
@ -23,11 +23,12 @@
|
|||
<script setup lang="ts">
|
||||
const props = defineProps<{
|
||||
show: boolean;
|
||||
isShipment: boolean;
|
||||
}>();
|
||||
|
||||
const state = reactive({
|
||||
currentStates: -1,
|
||||
statusList: [
|
||||
statusList1: [
|
||||
{
|
||||
id: -1,
|
||||
name: "全部",
|
||||
|
@ -45,6 +46,20 @@ const state = reactive({
|
|||
name: "未审核",
|
||||
},
|
||||
],
|
||||
statusList2: [
|
||||
{
|
||||
id: -1,
|
||||
name: "全部",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: "已结算",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "未结算",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const emit = defineEmits(["handleDialog", "changeStatus"]);
|
||||
|
@ -52,10 +67,10 @@ const handleClose = () => {
|
|||
emit("handleDialog", false);
|
||||
};
|
||||
const handleSelect = (item: any) => {
|
||||
state.currentStates = item.id
|
||||
emit("changeStatus", item)
|
||||
state.currentStates = item.id;
|
||||
emit("changeStatus", item);
|
||||
emit("handleDialog", false);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .u-popup__content {
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
placeholder="请选择结束时间"
|
||||
></u-input>
|
||||
<u-icon
|
||||
name="arrow-down-fill"
|
||||
name="arrow-down"
|
||||
@click="handleDialog('showTime', true)"
|
||||
></u-icon>
|
||||
|
||||
|
@ -25,14 +25,29 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<c-echarts :option="option" :height="'90vh'" />
|
||||
<!-- 单据弹框 -->
|
||||
<ProductTypeDialog :show="showDialog.showFilter" @handleDialog="(v:boolean) => {handleDialog('showFilter', v)}"/>
|
||||
<!-- <c-echarts :option="option" :height="'90vh'" /> -->
|
||||
<!-- 单据弹框 -->
|
||||
<ProductTypeDialog
|
||||
:isShipment="true"
|
||||
:show="showDialog.showFilter"
|
||||
@handleDialog="(v:boolean) => {handleDialog('showFilter', v)}"
|
||||
@changeProduct="changeProduct"
|
||||
/>
|
||||
|
||||
<!-- 时间弹框 -->
|
||||
<TimeDialog
|
||||
ref="timeDialog"
|
||||
:show="showDialog.showTime"
|
||||
@handleDialog="(v:boolean) => {handleDialog('showTime', v)}"
|
||||
@changeTime="changeTime"
|
||||
/>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
import TimeDialog from "./components/TimeDialog.vue";
|
||||
import CEcharts from "@/components/Echarts/echarts.vue";
|
||||
import ProductTypeDialog from './components/ProductTypeDialog.vue'
|
||||
import ProductTypeDialog from "./components/ProductTypeDialog.vue";
|
||||
import { formatDate, getCurrentMonthStartAndEnd } from "@/utils";
|
||||
import { ShipmentApi } from "@/services";
|
||||
const option = ref({
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
|
@ -93,9 +108,54 @@ const showDialog = <
|
|||
showTime: false,
|
||||
showFilter: false,
|
||||
});
|
||||
const state = reactive<{
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
scaleStatus: number;
|
||||
userId: number;
|
||||
productId: number;
|
||||
}>({
|
||||
startTime: formatDate(getCurrentMonthStartAndEnd().start, "{y}-{m}-{d}"),
|
||||
endTime: formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}"),
|
||||
scaleStatus: -1,
|
||||
userId: -1,
|
||||
productId: -1,
|
||||
});
|
||||
|
||||
const changeTime = (obj: any) => {
|
||||
state.startTime = obj.startTime;
|
||||
state.endTime = obj.endTime;
|
||||
getList();
|
||||
};
|
||||
const changeProduct = (obj: any) => {
|
||||
state.productId = obj.productId;
|
||||
getList();
|
||||
};
|
||||
const handleDialog = (key: string, v: boolean) => {
|
||||
showDialog[key] = v;
|
||||
};
|
||||
const getList = () => {
|
||||
let params: any = {
|
||||
startTime: state.startTime + " 00:00:00",
|
||||
endTime: state.endTime + " 23:59:59",
|
||||
};
|
||||
if (state.scaleStatus > -1) {
|
||||
params.scaleStatus = state.scaleStatus;
|
||||
}
|
||||
if (state.userId > -1) {
|
||||
params.userId = state.userId;
|
||||
}
|
||||
if (state.productId > -1) {
|
||||
params.productId = state.productId;
|
||||
}
|
||||
ShipmentApi.getOrderInRanking(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
}
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.layout-box {
|
||||
|
@ -106,14 +166,14 @@ const handleDialog = (key: string, v: boolean) => {
|
|||
justify-items: center;
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 27rpx;
|
||||
font-size: 28rpx;
|
||||
color: #000000;
|
||||
::v-deep .u-input {
|
||||
padding: 0rpx 16.03rpx !important;
|
||||
input {
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 21rpx !important;
|
||||
font-size: 24rpx !important;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,6 +118,7 @@
|
|||
<!-- 单据弹框 -->
|
||||
<StatusDialog
|
||||
:show="showDialog.showStatus"
|
||||
:isShipment="false"
|
||||
@handleDialog="(v:boolean) => {handleDialog('showStatus', v)}"
|
||||
@changeStatus="changeStatus"
|
||||
/>
|
||||
|
@ -127,6 +128,7 @@
|
|||
:show="showDialog.showFilter"
|
||||
@handleDialog="(v:boolean) => {handleDialog('showFilter', v)}"
|
||||
@changeOther="changeOther"
|
||||
:isShipment="false"
|
||||
/>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
|
|
@ -2,41 +2,46 @@
|
|||
<view class="layout-box">
|
||||
<view class="filter">
|
||||
<u-input
|
||||
v-model="params.startTime"
|
||||
v-model="state.startTime"
|
||||
disabled
|
||||
disabledColor="#ffffff"
|
||||
placeholder="请选择开始时间"
|
||||
></u-input>
|
||||
<text>-</text>
|
||||
<u-input
|
||||
v-model="params.endTime"
|
||||
v-model="state.endTime"
|
||||
disabled
|
||||
disabledColor="#ffffff"
|
||||
placeholder="请选择结束时间"
|
||||
></u-input>
|
||||
<u-icon name="arrow-down-fill" @click="handleDialog('showTime',true)"></u-icon>
|
||||
<u-icon
|
||||
name="arrow-down"
|
||||
@click="handleDialog('showTime', true)"
|
||||
></u-icon>
|
||||
<text class="status">单据状态</text>
|
||||
<u-icon name="arrow-down-fill" @click="handleDialog('showStatus', true)"></u-icon>
|
||||
<u-icon
|
||||
name="arrow-down"
|
||||
@click="handleDialog('showStatus', true)"
|
||||
></u-icon>
|
||||
<text class="btn" @click="handleDialog('showFilter', true)">筛选</text>
|
||||
</view>
|
||||
|
||||
<view class="box">
|
||||
<up-row>
|
||||
<up-col span="4">
|
||||
<view class="inner-box" style="border: none">
|
||||
<view class="num">892339.9</view>
|
||||
<view class="num">{{ state.summary.totalAmount }}</view>
|
||||
<view>出货总量/kg</view>
|
||||
</view>
|
||||
</up-col>
|
||||
<up-col span="4">
|
||||
<view class="inner-box">
|
||||
<view class="num">892339.9</view>
|
||||
<view class="num">{{ state.summary.totalPayShipment }}</view>
|
||||
<view>已收/kg</view>
|
||||
</view>
|
||||
</up-col>
|
||||
<up-col span="4">
|
||||
<view class="inner-box">
|
||||
<view class="num">892339.9</view>
|
||||
<view class="num">{{ state.summary.totalUnPayShipment }}</view>
|
||||
<view>未收/kg</view>
|
||||
</view>
|
||||
</up-col>
|
||||
|
@ -47,19 +52,19 @@
|
|||
<up-row>
|
||||
<up-col span="4">
|
||||
<view class="inner-box" style="border: none">
|
||||
<view class="num">892339.9</view>
|
||||
<view>结算金额/kg</view>
|
||||
<view class="num">{{ state.summary.totalCollection }}</view>
|
||||
<view>结算金额/元</view>
|
||||
</view>
|
||||
</up-col>
|
||||
<up-col span="4">
|
||||
<view class="inner-box">
|
||||
<view class="num">892339.9</view>
|
||||
<view class="num">{{ state.summary.totalPayCollection }}</view>
|
||||
<view>实收金额</view>
|
||||
</view>
|
||||
</up-col>
|
||||
<up-col span="4">
|
||||
<view class="inner-box">
|
||||
<view class="num">892339.9</view>
|
||||
<view class="num">{{ state.summary.totalUnPayCollection }}</view>
|
||||
<view>应收金额</view>
|
||||
</view>
|
||||
</up-col>
|
||||
|
@ -69,14 +74,14 @@
|
|||
<up-row>
|
||||
<up-col span="6">
|
||||
<view class="inner-box" style="border: none">
|
||||
<view class="num">892339.9</view>
|
||||
<view class="num">{{ state.summary.totalReceipt }}</view>
|
||||
<view>出货单</view>
|
||||
</view>
|
||||
</up-col>
|
||||
<up-col span="6">
|
||||
<view class="inner-box">
|
||||
<view class="num">892339.9</view>
|
||||
<view>均价(元/kg)</view>
|
||||
<view class="num">{{ state.summary.averagePrice }}</view>
|
||||
<view>均价(元/kg)</view>
|
||||
</view>
|
||||
</up-col>
|
||||
</up-row>
|
||||
|
@ -86,47 +91,59 @@
|
|||
<uni-table stripe emptyText="暂无更多数据">
|
||||
<!-- 表头行 -->
|
||||
<uni-tr>
|
||||
<uni-th align="center" v-for="(item, index) in tableTitleList" :key="index">{{
|
||||
<uni-th v-for="(item, index) in tableTitleList" :key="index">{{
|
||||
item.name
|
||||
}}</uni-th>
|
||||
</uni-tr>
|
||||
<!-- 表格数据行 -->
|
||||
<uni-tr v-for="(item, index) in 10" :key="index">
|
||||
<uni-td>张家港华仁再生</uni-td>
|
||||
<uni-td>1636.00</uni-td>
|
||||
<uni-td>5646.00</uni-td>
|
||||
<uni-td>5636.00</uni-td>
|
||||
<uni-td>5636.00</uni-td>
|
||||
<uni-tr v-for="(item, index) in state.summary.rankings" :key="index">
|
||||
<uni-td>{{ item.userName }}</uni-td>
|
||||
<uni-td>{{ item.totalAmount }}</uni-td>
|
||||
<uni-td>{{ item.totalPayment }}</uni-td>
|
||||
<uni-td>{{ item.totalOrderNumber }}</uni-td>
|
||||
<uni-td>{{ item.totalOrderNumber }}</uni-td>
|
||||
</uni-tr>
|
||||
</uni-table>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 时间弹框 -->
|
||||
<TimeDialog ref="timeDialog" :show="showDialog.showTime" @handleDialog="(v:boolean) => {handleDialog('showTime', v)}"/>
|
||||
<TimeDialog
|
||||
ref="timeDialog"
|
||||
:show="showDialog.showTime"
|
||||
@handleDialog="(v:boolean) => {handleDialog('showTime', v)}"
|
||||
@changeTime="changeTime"
|
||||
/>
|
||||
|
||||
<!-- 单据弹框 -->
|
||||
<StatusDialog :show="showDialog.showStatus" @handleDialog="(v:boolean) => {handleDialog('showStatus', v)}"/>
|
||||
<StatusDialog
|
||||
:show="showDialog.showStatus"
|
||||
:isShipment="true"
|
||||
@handleDialog="(v:boolean) => {handleDialog('showStatus', v)}"
|
||||
@changeStatus="changeStatus"
|
||||
|
||||
/>
|
||||
|
||||
<!-- 筛选弹框 -->
|
||||
<FilterDialog :show="showDialog.showFilter" @handleDialog="(v:boolean) => {handleDialog('showFilter', v)}"/>
|
||||
|
||||
<FilterDialog
|
||||
:show="showDialog.showFilter"
|
||||
@handleDialog="(v:boolean) => {handleDialog('showFilter', v)}"
|
||||
@changeOther="changeOther"
|
||||
:isShipment="true"
|
||||
/>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import TimeDialog from './components/TimeDialog.vue'
|
||||
import StatusDialog from './components/StatusDialog.vue'
|
||||
import FilterDialog from './components/FilterDialog.vue'
|
||||
const params = reactive({
|
||||
startTime: "2024-01-01",
|
||||
endTime: "2024-01-01",
|
||||
});
|
||||
|
||||
import TimeDialog from "./components/TimeDialog.vue";
|
||||
import StatusDialog from "./components/StatusDialog.vue";
|
||||
import FilterDialog from "./components/FilterDialog.vue";
|
||||
import { ShipmentApi } from "@/services";
|
||||
import { formatDate, getCurrentMonthStartAndEnd } from "@/utils";
|
||||
const tableTitleList = reactive([
|
||||
{
|
||||
name: "客户",
|
||||
},
|
||||
{
|
||||
name: "结算重量",
|
||||
name: "结算重量/kg",
|
||||
},
|
||||
{
|
||||
name: "结算金额",
|
||||
|
@ -140,21 +157,84 @@ const tableTitleList = reactive([
|
|||
]);
|
||||
const showDialog = <
|
||||
{
|
||||
[key: string]: boolean
|
||||
[key: string]: boolean;
|
||||
}
|
||||
>reactive(
|
||||
{
|
||||
showTime: false,
|
||||
showStatus: false,
|
||||
showFilter: false
|
||||
>reactive({
|
||||
showTime: false,
|
||||
showStatus: false,
|
||||
showFilter: false,
|
||||
});
|
||||
|
||||
const state = reactive<{
|
||||
summary: ShipmentSummaryCount;
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
scaleStatus: number;
|
||||
userId: number;
|
||||
productId: number;
|
||||
}>({
|
||||
summary: {
|
||||
totalAmount: 0, // 收货汇总:审核过收货总量
|
||||
totalPayShipment: 0, // 已支付的出货总
|
||||
totalUnPayShipment: 0, // 未支付的出货总量
|
||||
totalCollection: 0, // 总收款
|
||||
totalPayCollection: 0, // 已经收到的收款
|
||||
totalUnPayCollection: 0, // 未收到的收款
|
||||
totalReceipt: 0, // 收货单数量已审核的
|
||||
averagePrice: 0, // 平均单价
|
||||
rankings: [],
|
||||
},
|
||||
startTime: formatDate(getCurrentMonthStartAndEnd().start, "{y}-{m}-{d}"),
|
||||
endTime: formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}"),
|
||||
scaleStatus: -1,
|
||||
userId: -1,
|
||||
productId: -1,
|
||||
});
|
||||
|
||||
const changeTime = (obj: any) => {
|
||||
state.startTime = obj.startTime;
|
||||
state.endTime = obj.endTime;
|
||||
getList();
|
||||
};
|
||||
|
||||
const changeStatus = (obj: any) => {
|
||||
state.scaleStatus = obj.id;
|
||||
getList();
|
||||
};
|
||||
|
||||
const changeOther = (obj: any) => {
|
||||
state.userId = obj.userId;
|
||||
state.productId = obj.productId;
|
||||
getList();
|
||||
};
|
||||
|
||||
const handleDialog = (key: string, v: boolean) => {
|
||||
showDialog[key] = v;
|
||||
};
|
||||
|
||||
const getList = () => {
|
||||
let params: any = {
|
||||
startTime: state.startTime + " 00:00:00",
|
||||
endTime: state.endTime + " 23:59:59",
|
||||
};
|
||||
if (state.scaleStatus > -1) {
|
||||
params.scaleStatus = state.scaleStatus;
|
||||
}
|
||||
)
|
||||
|
||||
const handleDialog = (key: string, v:boolean) => {
|
||||
showDialog[key] = v
|
||||
}
|
||||
|
||||
|
||||
if (state.userId > -1) {
|
||||
params.userId = state.userId;
|
||||
}
|
||||
if (state.productId > -1) {
|
||||
params.productId = state.productId;
|
||||
}
|
||||
ShipmentApi.getOrderInReceipt(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
state.summary = res.data;
|
||||
}
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.layout-box {
|
||||
|
@ -164,15 +244,14 @@ const handleDialog = (key: string, v:boolean) => {
|
|||
align-items: center;
|
||||
justify-items: center;
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 27rpx;
|
||||
font-size: 28rpx;
|
||||
color: #000000;
|
||||
::v-deep .u-input {
|
||||
padding: 0rpx 16.03rpx !important;
|
||||
input {
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 21rpx !important;
|
||||
font-size: 24rpx !important;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
|
@ -195,7 +274,7 @@ const handleDialog = (key: string, v:boolean) => {
|
|||
align-items: center;
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
font-size: 26rpx;
|
||||
color: #000000;
|
||||
text-align: center;
|
||||
background: #ffffff;
|
||||
|
@ -207,7 +286,7 @@ const handleDialog = (key: string, v:boolean) => {
|
|||
text-align: center;
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
font-size: 26rpx;
|
||||
color: #000000;
|
||||
border-left: 1px solid #e9e9e9;
|
||||
.num {
|
||||
|
@ -216,21 +295,20 @@ const handleDialog = (key: string, v:boolean) => {
|
|||
}
|
||||
}
|
||||
::v-deep .uni-table {
|
||||
min-width: auto !important;
|
||||
min-width: 500px !important;
|
||||
.uni-table-th {
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 22rpx;
|
||||
font-size: 24rpx;
|
||||
color: #000000;
|
||||
padding: 5px 5px;
|
||||
}
|
||||
.uni-table-td {
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 21rpx;
|
||||
font-size: 24rpx;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
@ -2,20 +2,20 @@
|
|||
<view class="layout-box">
|
||||
<view class="filter">
|
||||
<u-input
|
||||
v-model="params.startTime"
|
||||
v-model="state.startTime"
|
||||
disabled
|
||||
disabledColor="#ffffff"
|
||||
placeholder="请选择开始时间"
|
||||
></u-input>
|
||||
<text>-</text>
|
||||
<u-input
|
||||
v-model="params.endTime"
|
||||
v-model="state.endTime"
|
||||
disabled
|
||||
disabledColor="#ffffff"
|
||||
placeholder="请选择结束时间"
|
||||
></u-input>
|
||||
<u-icon
|
||||
name="arrow-down-fill"
|
||||
name="arrow-down"
|
||||
@click="handleDialog('showTime', true)"
|
||||
></u-icon>
|
||||
|
||||
|
@ -25,14 +25,33 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<c-echarts :option="option" :height="'90vh'" />
|
||||
<!-- 单据弹框 -->
|
||||
<ProductTypeDialog :show="showDialog.showFilter" @handleDialog="(v:boolean) => {handleDialog('showFilter', v)}"/>
|
||||
<!-- <view>
|
||||
<c-echarts :option="option" :height="'90vh'" />
|
||||
</view> -->
|
||||
|
||||
<!-- 时间弹框 -->
|
||||
<TimeDialog
|
||||
ref="timeDialog"
|
||||
:show="showDialog.showTime"
|
||||
@handleDialog="(v:boolean) => {handleDialog('showTime', v)}"
|
||||
@changeTime="changeTime"
|
||||
/>
|
||||
<!-- 单据弹框 -->
|
||||
<view>
|
||||
<ProductTypeDialog
|
||||
:show="showDialog.showFilter"
|
||||
@handleDialog="(v:boolean) => {handleDialog('showFilter', v)}"
|
||||
:isShipment="false"
|
||||
@changeProduct="changeProduct"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
import TimeDialog from "./components/TimeDialog.vue";
|
||||
import CEcharts from "@/components/Echarts/echarts.vue";
|
||||
import ProductTypeDialog from './components/ProductTypeDialog.vue'
|
||||
import ProductTypeDialog from "./components/ProductTypeDialog.vue";
|
||||
import { ReceiveApi } from "@/services";
|
||||
import { formatDate, getCurrentMonthStartAndEnd } from "@/utils";
|
||||
const option = ref({
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
|
@ -80,11 +99,10 @@ const option = ref({
|
|||
],
|
||||
color: ["#00D2E3"],
|
||||
});
|
||||
|
||||
const params = reactive({
|
||||
startTime: "2024-01-01",
|
||||
endTime: "2024-01-01",
|
||||
});
|
||||
const changeProduct = (obj: any) => {
|
||||
state.productId = obj.productId;
|
||||
getList();
|
||||
};
|
||||
const showDialog = <
|
||||
{
|
||||
[key: string]: boolean;
|
||||
|
@ -96,6 +114,48 @@ const showDialog = <
|
|||
const handleDialog = (key: string, v: boolean) => {
|
||||
showDialog[key] = v;
|
||||
};
|
||||
const state = reactive<{
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
scaleStatus: number;
|
||||
userId: number;
|
||||
productId: number;
|
||||
}>({
|
||||
startTime: formatDate(getCurrentMonthStartAndEnd().start, "{y}-{m}-{d}"),
|
||||
endTime: formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}"),
|
||||
scaleStatus: -1,
|
||||
userId: -1,
|
||||
productId: -1,
|
||||
});
|
||||
|
||||
const changeTime = (obj: any) => {
|
||||
state.startTime = obj.startTime;
|
||||
state.endTime = obj.endTime;
|
||||
getList();
|
||||
};
|
||||
|
||||
const getList = () => {
|
||||
let params: any = {
|
||||
startTime: state.startTime + " 00:00:00",
|
||||
endTime: state.endTime + " 23:59:59",
|
||||
};
|
||||
if (state.scaleStatus > -1) {
|
||||
params.scaleStatus = state.scaleStatus;
|
||||
}
|
||||
if (state.userId > -1) {
|
||||
params.userId = state.userId;
|
||||
}
|
||||
if (state.productId > -1) {
|
||||
params.productId = state.productId;
|
||||
}
|
||||
ReceiveApi.OrderInRanking(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
}
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.layout-box {
|
||||
|
@ -106,14 +166,14 @@ const handleDialog = (key: string, v: boolean) => {
|
|||
justify-items: center;
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 27rpx;
|
||||
font-size: 28rpx;
|
||||
color: #000000;
|
||||
::v-deep .u-input {
|
||||
padding: 0rpx 16.03rpx !important;
|
||||
input {
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 21rpx !important;
|
||||
font-size: 24rpx !important;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
<template>
|
||||
<scroll-view
|
||||
:scroll-y="true"
|
||||
class="scroll-view-custom"
|
||||
@scrolltolower="loadMore"
|
||||
:style="{ height: clientHeight + 'px' }"
|
||||
>
|
||||
<slot> </slot>
|
||||
<!-- 加载更多提示 -->
|
||||
<view
|
||||
v-if="noMoreData || isLoading"
|
||||
class="no-more-data-text"
|
||||
style="padding: 20rpx"
|
||||
>
|
||||
<u-loadmore
|
||||
:status="isLoading ? 'loading' : 'nomore'"
|
||||
:line="true"
|
||||
:fontSize="12"
|
||||
:marginTop="30"
|
||||
/>
|
||||
</view>
|
||||
<view
|
||||
v-if="!isLoading && list.length === 0"
|
||||
style="justify-content: center; padding: 20rpx"
|
||||
>
|
||||
<u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
|
||||
</u-empty>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
noMoreData: boolean;
|
||||
isLoading: boolean;
|
||||
list: any;
|
||||
height: number;
|
||||
}>(),
|
||||
{
|
||||
noMoreData: false,
|
||||
isLoading: false,
|
||||
list: [],
|
||||
height: 80,
|
||||
}
|
||||
);
|
||||
const emit = defineEmits(["loadList"]);
|
||||
|
||||
const clientHeight = ref(500);
|
||||
|
||||
const loadMore = () => {
|
||||
console.log("**** 加载更多");
|
||||
if (props.noMoreData) return; // 如果没有更多数据,直接返回
|
||||
emit("loadList", true);
|
||||
};
|
||||
|
||||
const getBarHeight = () => {
|
||||
const res = uni.getSystemInfoSync();
|
||||
console.log(res);
|
||||
if (res.platform === "ios" || res.osName === "ios") {
|
||||
return 44;
|
||||
} else if (res.platform === "android") {
|
||||
return 48;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
//获取可视区域高度
|
||||
const getClineHeight = () => {
|
||||
uni.getSystemInfo({
|
||||
success: (res) => {
|
||||
clientHeight.value =
|
||||
res.windowHeight - uni.upx2px(props.height) - getBarHeight();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.height,
|
||||
(newValue, oldValue) => {
|
||||
getClineHeight();
|
||||
}
|
||||
);
|
||||
// ,{ deep: true, immediate:true}
|
||||
|
||||
onLoad(() => {
|
||||
// #ifdef APP-PLUS || MP-WEIXIN
|
||||
getClineHeight();
|
||||
// #endif
|
||||
});
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.no-more-data-text {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
</style>
|
|
@ -1,19 +1,20 @@
|
|||
// 不同的环境变量配置
|
||||
const development = {
|
||||
// VITE_APP_BASE_URL: 'http://47.100.31.83:8081',
|
||||
VITE_APP_BASE_URL: 'http://47.100.31.83:8081',
|
||||
|
||||
appid: '',
|
||||
// VITE_APP_BASE_URL: 'https://47.100.31.83:8081',
|
||||
// appid: '',
|
||||
VITE_APP_BASE_URL: 'https://ifanda.52zaisheng.cn/prod',
|
||||
appid: 'wx9251d74fe0e87028',
|
||||
}
|
||||
|
||||
const test = {
|
||||
VITE_APP_BASE_URL: 'http://47.100.31.83:8081',
|
||||
VITE_APP_BASE_URL: 'https://47.100.31.83:8081',
|
||||
appid: 'wxd5xxxxee0fce1c81',
|
||||
}
|
||||
|
||||
const production = {
|
||||
VITE_APP_BASE_URL: 'http://124.70.167.140:8081',
|
||||
appid: 'wx3xxxx1ce403cab3',
|
||||
VITE_APP_BASE_URL: 'https://ifanda.52zaisheng.cn/prod',
|
||||
appid: 'wx9251d74fe0e87028',
|
||||
}
|
||||
|
||||
export default {
|
||||
|
|
155
src/pages.json
|
@ -12,13 +12,14 @@
|
|||
}
|
||||
},
|
||||
"pages": [
|
||||
// {
|
||||
// "path": "pages/index/index",
|
||||
// "style": {
|
||||
// "navigationStyle": "custom", // 控制头部是否显示
|
||||
// "navigationBarTitleText": "工作台"
|
||||
// }
|
||||
// },
|
||||
{
|
||||
"path": "pagesHome/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom", // 控制头部是否显示
|
||||
"navigationBarTitleText": "工作台"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/login/index",
|
||||
"style": {
|
||||
|
@ -83,18 +84,18 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pagesHome",
|
||||
"pages": [
|
||||
{
|
||||
"path": "index",
|
||||
"style": {
|
||||
"navigationStyle": "custom", // 控制头部是否显示
|
||||
"navigationBarTitleText": "工作台"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// {
|
||||
// "root": "pagesHome",
|
||||
// "pages": [
|
||||
// {
|
||||
// "path": "index",
|
||||
// "style": {
|
||||
// "navigationStyle": "custom", // 控制头部是否显示
|
||||
// "navigationBarTitleText": "工作台"
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
"root": "pagesReceive",
|
||||
"pages": [
|
||||
|
@ -104,12 +105,6 @@
|
|||
"navigationBarTitleText": "待定价"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "tareing",
|
||||
"style": {
|
||||
"navigationBarTitleText": "待过皮重"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "payReview",
|
||||
"style": {
|
||||
|
@ -309,9 +304,117 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "客户管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "receiveProduct",
|
||||
"style": {
|
||||
"navigationBarTitleText": "收货产品"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "receiveType",
|
||||
"style": {
|
||||
"navigationBarTitleText": "收货分类"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "shipmentProduct",
|
||||
"style": {
|
||||
"navigationBarTitleText": "出货产品"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "stockCard",
|
||||
"style": {
|
||||
"navigationBarTitleText": "库存卡管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "shipmentType",
|
||||
"style": {
|
||||
"navigationBarTitleText": "出货分类管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "supplierType",
|
||||
"style": {
|
||||
"navigationBarTitleText": "供应商分类"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "user",
|
||||
"style": {
|
||||
"navigationBarTitleText": "人员管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "role",
|
||||
"style": {
|
||||
"navigationBarTitleText": "权限管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "components/addSupplierType",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增供应商分类"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "components/addSupplier",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增供应商"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "components/addShipmentType",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增出货分类"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "components/addCustomer",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增客户"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "components/addReceiveProduct",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增收货产品"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "components/addReceiveType",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增收货分类"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "components/addShipmentProduct",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增出货产品"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "components/addStockCard",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增库存卡"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "components/addUser",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增人员"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "components/addRole",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增权限"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
// {
|
||||
// "root": "uni_modules",
|
||||
// "pages": [
|
||||
|
|
|
@ -0,0 +1,211 @@
|
|||
<template>
|
||||
<view class="c-card">
|
||||
<u-form
|
||||
labelPosition="left"
|
||||
:model="model1"
|
||||
:rules="rules"
|
||||
ref="form"
|
||||
:labelWidth="100"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData[${item.key}]`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
>
|
||||
<u-textarea
|
||||
v-if="item.type === 'textarea'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
></u-textarea>
|
||||
<u-input
|
||||
v-if="item.type === 'select' || item.type === 'input'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请${item.type === 'select' ? '选择' : '输入'}${
|
||||
item.name
|
||||
}`"
|
||||
:clearable="true"
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text>
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<block v-for="(item, index) in formAttrList" :key="index">
|
||||
<u-action-sheet
|
||||
v-if="item.type === 'select'"
|
||||
:actions="contrlModalParams[item.childKey].list"
|
||||
:title="contrlModalParams[item.childKey].title"
|
||||
:show="contrlModalParams[item.childKey].isShow"
|
||||
@select="(v: any) => handleSelect(item.childKey, v)"
|
||||
@close="contrlModalParams[item.childKey].isShow = false"
|
||||
:closeOnClickAction="true"
|
||||
></u-action-sheet>
|
||||
</block>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<u-button type="primary" text="保存" @click="save()"></u-button>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { CustomerApi, StockCardApi } from "@/services";
|
||||
import { formatDate } from "@/utils";
|
||||
import { DeviceType, ImagesType, OrderType } from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import _ from "underscore";
|
||||
|
||||
const model1 = reactive<any>({
|
||||
formData: {},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
const contrlModalParams = reactive<any>({
|
||||
supplierType: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
list: [],
|
||||
},
|
||||
stockCard: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
list: [],
|
||||
},
|
||||
});
|
||||
|
||||
const formAttrList = reactive<any>([
|
||||
{
|
||||
name: "卡号",
|
||||
key: "stockCardName",
|
||||
type: "select",
|
||||
childKey: "stockCard",
|
||||
required: true,
|
||||
fn: () => {
|
||||
contrlModalParams.stockCard.isShow = true;
|
||||
contrlModalParams.stockCard.title = "卡号";
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "客户名称",
|
||||
key: "name",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "联系人",
|
||||
key: "contacts",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
]);
|
||||
|
||||
const handleSelect = (key: string, v: any) => {
|
||||
contrlModalParams[key].isShow = false;
|
||||
if (key === "stockCard") {
|
||||
model1.formData.stockCardName = v.name;
|
||||
model1.formData.stockCardId = v.id;
|
||||
}
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
if (model1.formData.id) {
|
||||
CustomerApi.updateCustomUser(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/customerMgt", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
CustomerApi.addCustomUser(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/customerMgt", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const getStockCardList = () => {
|
||||
StockCardApi.getStockCardList({ pageNum: 1, pageSize: 10 }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
contrlModalParams.stockCard.list = (res.data as any).list.map(
|
||||
(item: any) => {
|
||||
return { ...item, name: item.cardCode };
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getStockCardList();
|
||||
});
|
||||
|
||||
onLoad((option) => {
|
||||
// 接收传递的标题参数
|
||||
const title = (option as any).title;
|
||||
model1.formData = JSON.parse((option as any).item);
|
||||
if (model1.formData.cardCode) {
|
||||
model1.formData.stockCardName = model1.formData.cardCode;
|
||||
}
|
||||
// 设置页面标题
|
||||
uni.setNavigationBarTitle({
|
||||
title: title,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-card {
|
||||
background: #ffffff;
|
||||
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 30rpx 25rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
::v-deep .u-form-item {
|
||||
height: auto;
|
||||
}
|
||||
::v-deep .u-form-item + .u-form-item {
|
||||
border-top: 1rpx solid rgba(233, 233, 233, 0.76);
|
||||
}
|
||||
}
|
||||
.btn-box {
|
||||
margin-top: 60rpx;
|
||||
display: flex;
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
|
||||
border-radius: 13rpx 13rpx 0rpx 0rpx;
|
||||
padding: 25rpx 50rpx;
|
||||
position: sticky;
|
||||
bottom: 0rpx;
|
||||
z-index: 999;
|
||||
::v-deep button {
|
||||
border-radius: 43rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,228 @@
|
|||
<template>
|
||||
<view class="c-card">
|
||||
<u-form
|
||||
labelPosition="left"
|
||||
:model="model1"
|
||||
:rules="rules"
|
||||
ref="form"
|
||||
:labelWidth="100"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData[${item.key}]`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
>
|
||||
<u-textarea
|
||||
v-if="item.type === 'textarea'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
></u-textarea>
|
||||
<u-input
|
||||
v-if="item.type === 'select' || item.type === 'input'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请${item.type === 'select' ? '选择' : '输入'}${
|
||||
item.name
|
||||
}`"
|
||||
:clearable="true"
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text>
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<block v-for="(item, index) in formAttrList" :key="index">
|
||||
<u-action-sheet
|
||||
v-if="item.type === 'select'"
|
||||
:actions="contrlModalParams[item.childKey].list"
|
||||
:title="contrlModalParams[item.childKey].title"
|
||||
:show="contrlModalParams[item.childKey].isShow"
|
||||
@select="(v: any) => handleSelect(item.childKey, v)"
|
||||
@close="contrlModalParams[item.childKey].isShow = false"
|
||||
:closeOnClickAction="true"
|
||||
:scroll="true"
|
||||
></u-action-sheet>
|
||||
|
||||
</block>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<u-button type="primary" text="保存" @click="save()"></u-button>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { GoodsApi } from "@/services";
|
||||
import { formatDate } from "@/utils";
|
||||
import { DeviceType, ImagesType, OrderType } from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import _ from "underscore";
|
||||
|
||||
const model1 = reactive<any>({
|
||||
formData: {},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
const contrlModalParams = reactive<any>({
|
||||
reCategory: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
list: [],
|
||||
},
|
||||
});
|
||||
|
||||
const formAttrList = reactive<any>([
|
||||
{
|
||||
name: "收货产品",
|
||||
key: "reProductsName",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "收货分类",
|
||||
key: "reCategoryName",
|
||||
type: "select",
|
||||
childKey: "reCategory",
|
||||
required: true,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams.reCategory.isShow = true;
|
||||
contrlModalParams.reCategory.title = "收货分类";
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "所属分站",
|
||||
key: "substationName",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "最低价",
|
||||
key: "minPrice",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "最高价",
|
||||
key: "maxPrice",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "常用价格",
|
||||
key: "commonPrice",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
]);
|
||||
|
||||
const handleSelect = (key: string, v: any) => {
|
||||
contrlModalParams[key].isShow = false;
|
||||
if (key === "reCategory") {
|
||||
model1.formData.reCategoryName = v.name;
|
||||
model1.formData.reCategoryId = v.id;
|
||||
}
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
if (model1.formData.id) {
|
||||
GoodsApi.EditReceiveProduct(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/receiveProduct", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
GoodsApi.addReProducts(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/receiveProduct", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const getTypeList = () => {
|
||||
GoodsApi.allReCategory().then((res) => {
|
||||
if (res.code === 200) {
|
||||
contrlModalParams.reCategory.list = (res.data as any).map((item: any) => {
|
||||
return { ...item, name: item.reCategoryName };
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getTypeList();
|
||||
});
|
||||
|
||||
onLoad((option) => {
|
||||
// 接收传递的标题参数
|
||||
const title = (option as any).title;
|
||||
model1.formData = JSON.parse((option as any).item);
|
||||
if (model1.formData.cardCode) {
|
||||
model1.formData.stockCardName = model1.formData.cardCode;
|
||||
}
|
||||
// 设置页面标题
|
||||
uni.setNavigationBarTitle({
|
||||
title: title,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-card {
|
||||
background: #ffffff;
|
||||
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 30rpx 25rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
::v-deep .u-form-item {
|
||||
height: auto;
|
||||
}
|
||||
::v-deep .u-form-item + .u-form-item {
|
||||
border-top: 1rpx solid rgba(233, 233, 233, 0.76);
|
||||
}
|
||||
}
|
||||
.btn-box {
|
||||
margin-top: 60rpx;
|
||||
display: flex;
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
|
||||
border-radius: 13rpx 13rpx 0rpx 0rpx;
|
||||
padding: 25rpx 50rpx;
|
||||
position: sticky;
|
||||
bottom: 0rpx;
|
||||
z-index: 999;
|
||||
::v-deep button {
|
||||
border-radius: 43rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,180 @@
|
|||
<template>
|
||||
<view class="c-card">
|
||||
<u-form
|
||||
labelPosition="left"
|
||||
:model="model1"
|
||||
:rules="rules"
|
||||
ref="form"
|
||||
:labelWidth="100"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData[${item.key}]`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
>
|
||||
<u-textarea
|
||||
v-if="item.type === 'textarea'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
></u-textarea>
|
||||
<u-input
|
||||
v-if="item.type === 'select' || item.type === 'input'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请${item.type === 'select' ? '选择' : '输入'}${
|
||||
item.name
|
||||
}`"
|
||||
:clearable="true"
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text>
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<block v-for="(item, index) in formAttrList" :key="index">
|
||||
<u-action-sheet
|
||||
v-if="item.type === 'select'"
|
||||
:actions="contrlModalParams[item.childKey].list"
|
||||
:title="contrlModalParams[item.childKey].title"
|
||||
:show="contrlModalParams[item.childKey].isShow"
|
||||
@select="(v: any) => handleSelect(item.childKey, v)"
|
||||
@close="contrlModalParams[item.childKey].isShow = false"
|
||||
:closeOnClickAction="true"
|
||||
></u-action-sheet>
|
||||
</block>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<u-button type="primary" text="保存" @click="save()"></u-button>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { GoodsApi } from "@/services";
|
||||
import { formatDate } from "@/utils";
|
||||
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import _ from "underscore";
|
||||
|
||||
const model1 = reactive<any>({
|
||||
formData: {},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
const contrlModalParams = reactive<any>({
|
||||
cardType: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
list: [{
|
||||
id: 1,
|
||||
name: '出库卡'
|
||||
},{
|
||||
id: 2,
|
||||
name: '入库卡'
|
||||
}],
|
||||
}
|
||||
});
|
||||
|
||||
const formAttrList = reactive<any>([
|
||||
{
|
||||
name: "收货分类",
|
||||
key: "reCategoryName",
|
||||
type: "input",
|
||||
required: true,
|
||||
},
|
||||
]);
|
||||
|
||||
const handleSelect = (key: string, v: any) => {
|
||||
contrlModalParams[key].isShow = false;
|
||||
if (key === "cardType") {
|
||||
model1.formData.typeName = v.name;
|
||||
model1.formData.type = v.id;
|
||||
}
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
if (model1.formData.id) {
|
||||
GoodsApi.editReceiveCategory(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/receiveType", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
GoodsApi.getStockCardList(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/receiveType", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
onLoad((option) => {
|
||||
// 接收传递的标题参数
|
||||
const title = (option as any).title;
|
||||
model1.formData = JSON.parse((option as any).item);
|
||||
if (model1.formData.type === 1) {
|
||||
model1.formData.typeName = '出库卡'
|
||||
}else if (model1.formData.type === 2) {
|
||||
model1.formData.typeName = '入库卡'
|
||||
}
|
||||
// 设置页面标题
|
||||
uni.setNavigationBarTitle({
|
||||
title: title,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-card {
|
||||
background: #ffffff;
|
||||
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 30rpx 25rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
::v-deep .u-form-item {
|
||||
height: auto;
|
||||
}
|
||||
::v-deep .u-form-item + .u-form-item {
|
||||
border-top: 1rpx solid rgba(233, 233, 233, 0.76);
|
||||
}
|
||||
}
|
||||
.btn-box {
|
||||
margin-top: 60rpx;
|
||||
display: flex;
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
|
||||
border-radius: 13rpx 13rpx 0rpx 0rpx;
|
||||
padding: 25rpx 50rpx;
|
||||
position: sticky;
|
||||
bottom: 0rpx;
|
||||
z-index: 999;
|
||||
::v-deep button {
|
||||
border-radius: 43rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,256 @@
|
|||
<template>
|
||||
<view class="c-card">
|
||||
<u-form
|
||||
labelPosition="left"
|
||||
:model="model1"
|
||||
:rules="rules"
|
||||
ref="form"
|
||||
:labelWidth="100"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData[${item.key}]`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
>
|
||||
<u-textarea
|
||||
v-if="item.type === 'textarea'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
></u-textarea>
|
||||
<u-input
|
||||
v-if="item.type === 'select' || item.type === 'input'"
|
||||
:password="item.name === 'password'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请${item.type === 'select' ? '选择' : '输入'}${
|
||||
item.name
|
||||
}`"
|
||||
:clearable="true"
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text>
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<u-collapse>
|
||||
<u-collapse-item
|
||||
v-for="item in contrlModalParams.menu.list"
|
||||
:key="item.id"
|
||||
:title="item.name"
|
||||
>
|
||||
<view v-if="item.childrenList">
|
||||
<view
|
||||
v-for="cItem in item.childrenList"
|
||||
:key="cItem.id"
|
||||
class="flex-box"
|
||||
>
|
||||
<view>{{ cItem.name }}</view>
|
||||
<view>
|
||||
<u-switch
|
||||
size="18"
|
||||
activeColor="#00D2E3"
|
||||
v-model="cItem.checked"
|
||||
></u-switch
|
||||
></view> </view
|
||||
></view>
|
||||
<view v-else>
|
||||
<u-empty mode="data"> </u-empty>
|
||||
</view>
|
||||
</u-collapse-item>
|
||||
</u-collapse>
|
||||
<!-- <block v-for="(item, index) in formAttrList" :key="index">
|
||||
<u-action-sheet
|
||||
v-if="item.type === 'select'"
|
||||
:actions="contrlModalParams[item.childKey].list"
|
||||
:title="contrlModalParams[item.childKey].title"
|
||||
:show="contrlModalParams[item.childKey].isShow"
|
||||
@select="(v: any) => handleSelect(item.childKey, v)"
|
||||
@close="contrlModalParams[item.childKey].isShow = false"
|
||||
:closeOnClickAction="true"
|
||||
></u-action-sheet>
|
||||
</block> -->
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<u-button type="primary" text="保存" @click="save()"></u-button>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ProfileApi, StockCardApi } from "@/services";
|
||||
import { deleteBaseKey, formatDate } from "@/utils";
|
||||
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import _ from "underscore";
|
||||
|
||||
const model1 = reactive<any>({
|
||||
formData: {},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
const contrlModalParams = reactive<any>({
|
||||
checkedMap: {},
|
||||
menu: {
|
||||
list: [],
|
||||
},
|
||||
});
|
||||
|
||||
const formAttrList = reactive<any>([
|
||||
{
|
||||
name: "角色名称",
|
||||
key: "roleName",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
name: "权限配置",
|
||||
key: "config",
|
||||
type: "text",
|
||||
childKey: "menu",
|
||||
fn: () => {},
|
||||
},
|
||||
]);
|
||||
|
||||
// const handleSelect = (key: string, v: any) => {
|
||||
// contrlModalParams[key].isShow = false;
|
||||
// if (key === "role") {
|
||||
// model1.formData.roleName = v.name;
|
||||
// model1.formData.roleIds = [v.id];
|
||||
// }
|
||||
// };
|
||||
|
||||
const save = () => {
|
||||
let list: any = [];
|
||||
contrlModalParams.menu.list.forEach((item: any) => {
|
||||
item.childrenList.forEach((c: any) => {
|
||||
if (c.checked) {
|
||||
list.push({ menusId: c.id, state: c.checked ? 1 : 0 });
|
||||
}
|
||||
});
|
||||
});
|
||||
if (model1.formData.id) {
|
||||
ProfileApi.updateRole({...deleteBaseKey(model1.formData), list}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/role", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ProfileApi.addRole({ ...model1.formData, list }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/role", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 获得所有菜单
|
||||
const getRoleList = () => {
|
||||
ProfileApi.getMenuList({}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
contrlModalParams.menu.list = (res.data as any).map((item: any) => {
|
||||
item.childrenList = item.childrenList.map((cItem: any) => {
|
||||
console.log(contrlModalParams.checkedMap[cItem.id]);
|
||||
return {
|
||||
...cItem,
|
||||
checked: contrlModalParams.checkedMap[cItem.id] ? true : false,
|
||||
};
|
||||
});
|
||||
return { ...item };
|
||||
});
|
||||
|
||||
console.log(contrlModalParams.menu.list);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const getMenusRole = (roleId: number) => {
|
||||
ProfileApi.getMenusRole({ roleId }).then((res) => {
|
||||
if (res.data) {
|
||||
res.data.forEach((item: any) => {
|
||||
contrlModalParams.checkedMap[item.menusId] = item.state === 1;
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getRoleList();
|
||||
});
|
||||
|
||||
onLoad((option) => {
|
||||
// 接收传递的标题参数;
|
||||
const title = (option as any).title;
|
||||
model1.formData = JSON.parse((option as any).item);
|
||||
if (model1.formData.id) {
|
||||
getMenusRole(model1.formData.id);
|
||||
}
|
||||
|
||||
// 设置页面标题;
|
||||
if (title) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: title,
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-card {
|
||||
background: #ffffff;
|
||||
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 30rpx 25rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
::v-deep .u-form-item {
|
||||
height: auto;
|
||||
}
|
||||
::v-deep .u-form-item + .u-form-item {
|
||||
border-top: 1rpx solid rgba(233, 233, 233, 0.76);
|
||||
}
|
||||
}
|
||||
.btn-box {
|
||||
margin-top: 60rpx;
|
||||
display: flex;
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
|
||||
border-radius: 13rpx 13rpx 0rpx 0rpx;
|
||||
padding: 25rpx 50rpx;
|
||||
position: sticky;
|
||||
bottom: 0rpx;
|
||||
z-index: 999;
|
||||
::v-deep button {
|
||||
border-radius: 43rpx;
|
||||
}
|
||||
}
|
||||
.flex-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.flex-box + .flex-box {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,248 @@
|
|||
<template>
|
||||
<view class="c-card">
|
||||
<u-form
|
||||
labelPosition="left"
|
||||
:model="model1"
|
||||
:rules="rules"
|
||||
ref="form"
|
||||
:labelWidth="100"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData[${item.key}]`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
>
|
||||
<u-textarea
|
||||
v-if="item.type === 'textarea'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
></u-textarea>
|
||||
<u-input
|
||||
v-if="
|
||||
item.type === 'select' ||
|
||||
item.type === 'input' ||
|
||||
item.type === 'cascader'
|
||||
"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请${item.type === 'select' ? '选择' : '输入'}${
|
||||
item.name
|
||||
}`"
|
||||
:clearable="true"
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text>
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template
|
||||
#right
|
||||
v-if="item.type === 'select' || item.type === 'cascader'"
|
||||
>
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<!-- <block v-for="(item, index) in formAttrList" :key="index">
|
||||
<u-action-sheet
|
||||
v-if="item.type === 'select'"
|
||||
:actions="contrlModalParams[item.childKey].list"
|
||||
:title="contrlModalParams[item.childKey].title"
|
||||
:show="contrlModalParams[item.childKey].isShow"
|
||||
@select="(v: any) => handleSelect(item.childKey, v)"
|
||||
@close="contrlModalParams[item.childKey].isShow = false"
|
||||
:closeOnClickAction="true"
|
||||
></u-action-sheet>
|
||||
</block> -->
|
||||
<u-picker
|
||||
:show="contrlModalParams['reCategory'].isShow"
|
||||
:title="contrlModalParams['reCategory'].title"
|
||||
ref="uPicker"
|
||||
:columns="contrlModalParams['reCategory'].list"
|
||||
@cancel="contrlModalParams['reCategory'].isShow = false"
|
||||
@change="handleChange"
|
||||
keyName="shmCategoryName"
|
||||
@confirm="confirm"
|
||||
></u-picker>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<u-button type="primary" text="保存" @click="save()"></u-button>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { GoodsApi } from "@/services";
|
||||
import { formatDate } from "@/utils";
|
||||
import { DeviceType, ImagesType, OrderType } from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import _ from "underscore";
|
||||
const { proxy } = getCurrentInstance();
|
||||
const model1 = reactive<any>({
|
||||
formData: {},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
const contrlModalParams = reactive<any>({
|
||||
reCategory: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
list: [],
|
||||
},
|
||||
});
|
||||
|
||||
const formAttrList = reactive<any>([
|
||||
{
|
||||
name: "出货产品",
|
||||
key: "shmProductsName",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "出货分类",
|
||||
key: "reCategoryName",
|
||||
type: "cascader",
|
||||
childKey: "reCategory",
|
||||
required: true,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams.reCategory.isShow = true;
|
||||
contrlModalParams.reCategory.title = "出货分类";
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
// const handleSelect = (key: string, v: any) => {
|
||||
// contrlModalParams[key].isShow = false;
|
||||
// if (key === "reCategory") {
|
||||
// model1.formData.reCategoryName = v.name;
|
||||
// model1.formData.reCategoryId = v.id;
|
||||
// }
|
||||
// };
|
||||
|
||||
const handleChange = (e: any) => {
|
||||
const {
|
||||
columnIndex,
|
||||
value,
|
||||
values, // values为当前变化列的数组内容
|
||||
index,
|
||||
picker = proxy.$refs.uPicker,
|
||||
} = e;
|
||||
console.log(columnIndex, value, values, index, picker);
|
||||
if (columnIndex === 0) {
|
||||
// picker为选择器this实例,变化第二列对应的选项
|
||||
picker.setColumnValues(1, value[0].childrenList || []);
|
||||
}
|
||||
};
|
||||
|
||||
const confirm = (e: any) => {
|
||||
if (e.value[1]) {
|
||||
model1.formData.shmCategoryId = e.value[1].id
|
||||
model1.formData.reCategoryName = e.value[1].shmCategoryName
|
||||
contrlModalParams['reCategory'].isShow = false
|
||||
}
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
if (model1.formData.id) {
|
||||
// GoodsApi.EditReceiveProduct(model1.formData).then((res) => {
|
||||
// if (res.code === 200) {
|
||||
// uni.redirectTo({
|
||||
// url: "/pagesApp/shipmentProduct", // 要跳转到的页面路径
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
} else {
|
||||
GoodsApi.addShipmentProduct(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/shipmentProduct", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const getTypeList = () => {
|
||||
GoodsApi.getShipmentCategory().then((res) => {
|
||||
if (res.code === 200) {
|
||||
contrlModalParams.reCategory.list = [
|
||||
(res.data as any).map((item: any) => {
|
||||
return { ...item, name: item.reCategoryName };
|
||||
}),
|
||||
];
|
||||
contrlModalParams.reCategory.list.push(
|
||||
contrlModalParams.reCategory.list[0][0].childrenList
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getTypeList();
|
||||
});
|
||||
|
||||
onLoad((option) => {
|
||||
// 接收传递的标题参数
|
||||
const title = (option as any).title;
|
||||
model1.formData = JSON.parse((option as any).item) || {};
|
||||
if (option) {
|
||||
if (model1.formData.shmCategoryName) {
|
||||
model1.formData.reCategoryName = model1.formData.shmCategoryName;
|
||||
}
|
||||
}
|
||||
|
||||
// 设置页面标题
|
||||
if (title) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: title,
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-card {
|
||||
background: #ffffff;
|
||||
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 30rpx 25rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
::v-deep .u-form-item {
|
||||
height: auto;
|
||||
}
|
||||
::v-deep .u-form-item + .u-form-item {
|
||||
border-top: 1rpx solid rgba(233, 233, 233, 0.76);
|
||||
}
|
||||
}
|
||||
.btn-box {
|
||||
margin-top: 60rpx;
|
||||
display: flex;
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
|
||||
border-radius: 13rpx 13rpx 0rpx 0rpx;
|
||||
padding: 25rpx 50rpx;
|
||||
position: sticky;
|
||||
bottom: 0rpx;
|
||||
z-index: 999;
|
||||
::v-deep button {
|
||||
border-radius: 43rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,182 @@
|
|||
<template>
|
||||
<view class="c-card">
|
||||
<u-form
|
||||
labelPosition="left"
|
||||
:model="model1"
|
||||
:rules="rules"
|
||||
ref="form"
|
||||
:labelWidth="100"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData[${item.key}]`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
>
|
||||
<u-textarea
|
||||
v-if="item.type === 'textarea'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
></u-textarea>
|
||||
<u-input
|
||||
v-if="item.type === 'select' || item.type === 'input'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请${item.type === 'select' ? '选择' : '输入'}${
|
||||
item.name
|
||||
}`"
|
||||
:clearable="true"
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text>
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<block v-for="(item, index) in formAttrList" :key="index">
|
||||
<u-action-sheet
|
||||
v-if="item.type === 'select'"
|
||||
:actions="contrlModalParams[item.childKey].list"
|
||||
:title="contrlModalParams[item.childKey].title"
|
||||
:show="contrlModalParams[item.childKey].isShow"
|
||||
@select="(v: any) => handleSelect(item.childKey, v)"
|
||||
@close="contrlModalParams[item.childKey].isShow = false"
|
||||
:closeOnClickAction="true"
|
||||
></u-action-sheet>
|
||||
</block>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<u-button type="primary" text="保存" @click="save()"></u-button>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { GoodsApi } from "@/services";
|
||||
import { formatDate } from "@/utils";
|
||||
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import _ from "underscore";
|
||||
|
||||
const model1 = reactive<any>({
|
||||
formData: {},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
const contrlModalParams = reactive<any>({
|
||||
parent: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
list: [{
|
||||
id: 0,
|
||||
name: '主分类'
|
||||
}],
|
||||
}
|
||||
});
|
||||
|
||||
const formAttrList = reactive<any>([
|
||||
{
|
||||
name: "上级菜单",
|
||||
key: "parentName",
|
||||
type: "select",
|
||||
required: true,
|
||||
childKey: "parent",
|
||||
fn: () => {
|
||||
contrlModalParams.parent.isShow = true;
|
||||
contrlModalParams.parent.title = "库存卡类型";
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "出货分类",
|
||||
key: "shmCategoryName",
|
||||
type: "input",
|
||||
required: true,
|
||||
},
|
||||
]);
|
||||
|
||||
const handleSelect = (key: string, v: any) => {
|
||||
contrlModalParams[key].isShow = false;
|
||||
if (key === "parent") {
|
||||
model1.formData.parentName = v.name;
|
||||
model1.formData.parentId = v.id;
|
||||
}
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
if (model1.formData.id) {
|
||||
GoodsApi.editReceiveCategory(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/shipmentType", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
GoodsApi.addShmCategory({...model1.formData}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/shipmentType", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
onLoad((option) => {
|
||||
// 接收传递的标题参数
|
||||
const title = (option as any).title;
|
||||
// 设置页面标题
|
||||
uni.setNavigationBarTitle({
|
||||
title: title,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-card {
|
||||
background: #ffffff;
|
||||
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 30rpx 25rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
::v-deep .u-form-item {
|
||||
height: auto;
|
||||
}
|
||||
::v-deep .u-form-item + .u-form-item {
|
||||
border-top: 1rpx solid rgba(233, 233, 233, 0.76);
|
||||
}
|
||||
}
|
||||
.btn-box {
|
||||
margin-top: 60rpx;
|
||||
display: flex;
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
|
||||
border-radius: 13rpx 13rpx 0rpx 0rpx;
|
||||
padding: 25rpx 50rpx;
|
||||
position: sticky;
|
||||
bottom: 0rpx;
|
||||
z-index: 999;
|
||||
::v-deep button {
|
||||
border-radius: 43rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,191 @@
|
|||
<template>
|
||||
<view class="c-card">
|
||||
<u-form
|
||||
labelPosition="left"
|
||||
:model="model1"
|
||||
:rules="rules"
|
||||
ref="form"
|
||||
:labelWidth="100"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData[${item.key}]`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
>
|
||||
<u-textarea
|
||||
v-if="item.type === 'textarea'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
></u-textarea>
|
||||
<u-input
|
||||
v-if="item.type === 'select' || item.type === 'input'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请${item.type === 'select' ? '选择' : '输入'}${
|
||||
item.name
|
||||
}`"
|
||||
:clearable="true"
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text>
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<block v-for="(item, index) in formAttrList" :key="index">
|
||||
<u-action-sheet
|
||||
v-if="item.type === 'select'"
|
||||
:actions="contrlModalParams[item.childKey].list"
|
||||
:title="contrlModalParams[item.childKey].title"
|
||||
:show="contrlModalParams[item.childKey].isShow"
|
||||
@select="(v: any) => handleSelect(item.childKey, v)"
|
||||
@close="contrlModalParams[item.childKey].isShow = false"
|
||||
:closeOnClickAction="true"
|
||||
></u-action-sheet>
|
||||
</block>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<u-button type="primary" text="保存" @click="save()"></u-button>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { StockCardApi } from "@/services";
|
||||
import { formatDate } from "@/utils";
|
||||
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import _ from "underscore";
|
||||
|
||||
const model1 = reactive<any>({
|
||||
formData: {},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
const contrlModalParams = reactive<any>({
|
||||
cardType: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
list: [{
|
||||
id: 1,
|
||||
name: '出库卡'
|
||||
},{
|
||||
id: 2,
|
||||
name: '入库卡'
|
||||
}],
|
||||
}
|
||||
});
|
||||
|
||||
const formAttrList = reactive<any>([
|
||||
{
|
||||
name: "卡号",
|
||||
key: "cardCode",
|
||||
type: "input",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "类型",
|
||||
key: "typeName",
|
||||
type: "select",
|
||||
childKey: "cardType",
|
||||
required: true,
|
||||
fn: () => {
|
||||
contrlModalParams.cardType.isShow = true;
|
||||
contrlModalParams.cardType.title = "库存卡类型";
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
const handleSelect = (key: string, v: any) => {
|
||||
contrlModalParams[key].isShow = false;
|
||||
if (key === "cardType") {
|
||||
model1.formData.typeName = v.name;
|
||||
model1.formData.type = v.id;
|
||||
}
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
if (model1.formData.id) {
|
||||
StockCardApi.updateStockCard(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/stockCard", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
StockCardApi.addStockCard(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/stockCard", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
onLoad((option) => {
|
||||
// 接收传递的标题参数
|
||||
const title = (option as any).title;
|
||||
model1.formData = JSON.parse((option as any).item);
|
||||
if (model1.formData.type === 1) {
|
||||
model1.formData.typeName = '出库卡'
|
||||
}else if (model1.formData.type === 2) {
|
||||
model1.formData.typeName = '入库卡'
|
||||
}
|
||||
// 设置页面标题
|
||||
uni.setNavigationBarTitle({
|
||||
title: title,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-card {
|
||||
background: #ffffff;
|
||||
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 30rpx 25rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
::v-deep .u-form-item {
|
||||
height: auto;
|
||||
}
|
||||
::v-deep .u-form-item + .u-form-item {
|
||||
border-top: 1rpx solid rgba(233, 233, 233, 0.76);
|
||||
}
|
||||
}
|
||||
.btn-box {
|
||||
margin-top: 60rpx;
|
||||
display: flex;
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
|
||||
border-radius: 13rpx 13rpx 0rpx 0rpx;
|
||||
padding: 25rpx 50rpx;
|
||||
position: sticky;
|
||||
bottom: 0rpx;
|
||||
z-index: 999;
|
||||
::v-deep button {
|
||||
border-radius: 43rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,284 @@
|
|||
<template>
|
||||
<view class="c-card">
|
||||
<u-form
|
||||
labelPosition="left"
|
||||
:model="model1"
|
||||
:rules="rules"
|
||||
ref="form"
|
||||
:labelWidth="100"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData[${item.key}]`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
>
|
||||
<u-textarea
|
||||
v-if="item.type === 'textarea'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
></u-textarea>
|
||||
<u-input
|
||||
v-if="item.type === 'select' || item.type === 'input'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请${item.type === 'select' ? '选择' : '输入'}${
|
||||
item.name
|
||||
}`"
|
||||
:clearable="true"
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text>
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<block v-for="(item, index) in formAttrList" :key="index">
|
||||
<u-action-sheet
|
||||
v-if="item.type === 'select'"
|
||||
:actions="contrlModalParams[item.childKey].list"
|
||||
:title="contrlModalParams[item.childKey].title"
|
||||
:show="contrlModalParams[item.childKey].isShow"
|
||||
@select="(v: any) => handleSelect(item.childKey, v)"
|
||||
@close="contrlModalParams[item.childKey].isShow = false"
|
||||
:closeOnClickAction="true"
|
||||
></u-action-sheet>
|
||||
</block>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<u-button type="primary" text="保存" @click="save()"></u-button>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { StockCardApi, SupplierApi } from "@/services";
|
||||
import { formatDate } from "@/utils";
|
||||
import { DeviceType, ImagesType, OrderType } from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import _ from "underscore";
|
||||
|
||||
const model1 = reactive<any>({
|
||||
formData: {},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
const contrlModalParams = reactive<any>({
|
||||
supplierType: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
list: [],
|
||||
},
|
||||
stockCard: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
list: [],
|
||||
},
|
||||
});
|
||||
|
||||
const formAttrList = reactive<any>([
|
||||
{
|
||||
name: "基本信息",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
name: "卡号",
|
||||
key: "stockCardName",
|
||||
type: "select",
|
||||
childKey: "stockCard",
|
||||
required: true,
|
||||
fn: () => {
|
||||
contrlModalParams.stockCard.isShow = true;
|
||||
contrlModalParams.stockCard.title = "卡号";
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "供应商名称",
|
||||
key: "name",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "供应商分类",
|
||||
key: "supplierTypeName",
|
||||
type: "select",
|
||||
childKey: "supplierType",
|
||||
required: true,
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams.supplierType.isShow = true;
|
||||
contrlModalParams.supplierType.title = "供应商分类";
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "联系人",
|
||||
key: "contacts",
|
||||
type: "input",
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "联系电话",
|
||||
key: "phone",
|
||||
type: "input",
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "身份证号码",
|
||||
key: "card",
|
||||
type: "input",
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "详细地址",
|
||||
key: "address",
|
||||
type: "input",
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "银行卡信息",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
name: "户名",
|
||||
key: "bankTitle",
|
||||
type: "input",
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "银行名称",
|
||||
key: "bankName",
|
||||
type: "input",
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "银行卡号",
|
||||
key: "bankNumber",
|
||||
type: "input",
|
||||
unit: "",
|
||||
},
|
||||
{
|
||||
name: "开户支行",
|
||||
key: "branchName",
|
||||
type: "input",
|
||||
unit: "",
|
||||
},
|
||||
]);
|
||||
|
||||
const handleSelect = (key: string, v: any) => {
|
||||
contrlModalParams[key].isShow = false;
|
||||
if (key === "supplierType") {
|
||||
model1.formData.supplierTypeName = v.name;
|
||||
model1.formData.supplierTypeId = v.id;
|
||||
} else if (key === "stockCard") {
|
||||
model1.formData.stockCardName = v.name;
|
||||
model1.formData.stockCardId = v.id;
|
||||
}
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
if (model1.formData.id) {
|
||||
SupplierApi.updateSupplierUser(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/supplierMgt", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
SupplierApi.addSupplierUser(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/supplierMgt", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const getSupplierTypeList = () => {
|
||||
SupplierApi.getSupplierTypeList().then((res) => {
|
||||
if (res.code === 200) {
|
||||
contrlModalParams.supplierType.list = res.data;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const getStockCardList = () => {
|
||||
StockCardApi.getStockCardList({ pageNum: 1, pageSize: 10 }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
contrlModalParams.stockCard.list = (res.data as any).list.map(
|
||||
(item: any) => {
|
||||
return { ...item, name: item.cardCode };
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getSupplierTypeList();
|
||||
getStockCardList();
|
||||
});
|
||||
|
||||
onLoad((option) => {
|
||||
// 接收传递的标题参数
|
||||
const title = (option as any).title;
|
||||
model1.formData = JSON.parse((option as any).item);
|
||||
if (model1.formData.cardCode) {
|
||||
model1.formData.stockCardName = model1.formData.cardCode;
|
||||
}
|
||||
// 设置页面标题
|
||||
uni.setNavigationBarTitle({
|
||||
title: title,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-card {
|
||||
background: #ffffff;
|
||||
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 30rpx 25rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
::v-deep .u-form-item {
|
||||
height: auto;
|
||||
}
|
||||
::v-deep .u-form-item + .u-form-item {
|
||||
border-top: 1rpx solid rgba(233, 233, 233, 0.76);
|
||||
}
|
||||
}
|
||||
.btn-box {
|
||||
margin-top: 60rpx;
|
||||
display: flex;
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
|
||||
border-radius: 13rpx 13rpx 0rpx 0rpx;
|
||||
padding: 25rpx 50rpx;
|
||||
position: sticky;
|
||||
bottom: 0rpx;
|
||||
z-index: 999;
|
||||
::v-deep button {
|
||||
border-radius: 43rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,180 @@
|
|||
<template>
|
||||
<view class="c-card">
|
||||
<u-form
|
||||
labelPosition="left"
|
||||
:model="model1"
|
||||
:rules="rules"
|
||||
ref="form"
|
||||
:labelWidth="100"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData[${item.key}]`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
>
|
||||
<u-textarea
|
||||
v-if="item.type === 'textarea'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
></u-textarea>
|
||||
<u-input
|
||||
v-if="item.type === 'select' || item.type === 'input'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请${item.type === 'select' ? '选择' : '输入'}${
|
||||
item.name
|
||||
}`"
|
||||
:clearable="true"
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text>
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<block v-for="(item, index) in formAttrList" :key="index">
|
||||
<u-action-sheet
|
||||
v-if="item.type === 'select'"
|
||||
:actions="contrlModalParams[item.childKey].list"
|
||||
:title="contrlModalParams[item.childKey].title"
|
||||
:show="contrlModalParams[item.childKey].isShow"
|
||||
@select="(v: any) => handleSelect(item.childKey, v)"
|
||||
@close="contrlModalParams[item.childKey].isShow = false"
|
||||
:closeOnClickAction="true"
|
||||
></u-action-sheet>
|
||||
</block>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<u-button type="primary" text="保存" @click="save()"></u-button>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { StockCardApi, SupplierApi } from "@/services";
|
||||
import { formatDate } from "@/utils";
|
||||
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import _ from "underscore";
|
||||
|
||||
const model1 = reactive<any>({
|
||||
formData: {},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
const contrlModalParams = reactive<any>({
|
||||
cardType: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
list: [{
|
||||
id: 1,
|
||||
name: '出库卡'
|
||||
},{
|
||||
id: 2,
|
||||
name: '入库卡'
|
||||
}],
|
||||
}
|
||||
});
|
||||
|
||||
const formAttrList = reactive<any>([
|
||||
{
|
||||
name: "供应商分类",
|
||||
key: "name",
|
||||
type: "input",
|
||||
required: true,
|
||||
},
|
||||
]);
|
||||
|
||||
const handleSelect = (key: string, v: any) => {
|
||||
contrlModalParams[key].isShow = false;
|
||||
if (key === "cardType") {
|
||||
model1.formData.typeName = v.name;
|
||||
model1.formData.type = v.id;
|
||||
}
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
if (model1.formData.id) {
|
||||
SupplierApi.updateSupplierType(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/supplierType", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
SupplierApi.addSupplierType(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/supplierType", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
onLoad((option) => {
|
||||
// 接收传递的标题参数
|
||||
const title = (option as any).title;
|
||||
model1.formData = JSON.parse((option as any).item);
|
||||
if (model1.formData.type === 1) {
|
||||
model1.formData.typeName = '出库卡'
|
||||
}else if (model1.formData.type === 2) {
|
||||
model1.formData.typeName = '入库卡'
|
||||
}
|
||||
// 设置页面标题
|
||||
uni.setNavigationBarTitle({
|
||||
title: title,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-card {
|
||||
background: #ffffff;
|
||||
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 30rpx 25rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
::v-deep .u-form-item {
|
||||
height: auto;
|
||||
}
|
||||
::v-deep .u-form-item + .u-form-item {
|
||||
border-top: 1rpx solid rgba(233, 233, 233, 0.76);
|
||||
}
|
||||
}
|
||||
.btn-box {
|
||||
margin-top: 60rpx;
|
||||
display: flex;
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
|
||||
border-radius: 13rpx 13rpx 0rpx 0rpx;
|
||||
padding: 25rpx 50rpx;
|
||||
position: sticky;
|
||||
bottom: 0rpx;
|
||||
z-index: 999;
|
||||
::v-deep button {
|
||||
border-radius: 43rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,243 @@
|
|||
<template>
|
||||
<view class="c-card">
|
||||
<u-form
|
||||
labelPosition="left"
|
||||
:model="model1"
|
||||
:rules="rules"
|
||||
ref="form"
|
||||
:labelWidth="100"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`formData[${item.key}]`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
>
|
||||
<u-textarea
|
||||
v-if="item.type === 'textarea'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请输入${item.name}`"
|
||||
></u-textarea>
|
||||
<u-input
|
||||
v-if="item.type === 'select' || item.type === 'input'"
|
||||
:password="item.name === 'password'"
|
||||
v-model="(model1.formData as any)[item.key]"
|
||||
:placeholder="`请${item.type === 'select' ? '选择' : '输入'}${
|
||||
item.name
|
||||
}`"
|
||||
:clearable="true"
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
>
|
||||
<template #suffix>
|
||||
<text>
|
||||
{{ item.unit }}
|
||||
</text>
|
||||
</template>
|
||||
</u-input>
|
||||
<template #right v-if="item.type === 'select'">
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</template>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<block v-for="(item, index) in formAttrList" :key="index">
|
||||
<u-action-sheet
|
||||
v-if="item.type === 'select'"
|
||||
:actions="contrlModalParams[item.childKey].list"
|
||||
:title="contrlModalParams[item.childKey].title"
|
||||
:show="contrlModalParams[item.childKey].isShow"
|
||||
@select="(v: any) => handleSelect(item.childKey, v)"
|
||||
@close="contrlModalParams[item.childKey].isShow = false"
|
||||
:closeOnClickAction="true"
|
||||
></u-action-sheet>
|
||||
</block>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<u-button type="primary" text="保存" @click="save()"></u-button>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ProfileApi, StockCardApi } from "@/services";
|
||||
import { formatDate } from "@/utils";
|
||||
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import _ from "underscore";
|
||||
|
||||
const model1 = reactive<any>({
|
||||
formData: {},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
const contrlModalParams = reactive<any>({
|
||||
role: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
list: [],
|
||||
},
|
||||
gender: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
list: [{
|
||||
id: 1,
|
||||
name: '男'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '女'
|
||||
}],
|
||||
},
|
||||
});
|
||||
|
||||
const formAttrList = reactive<any>([
|
||||
{
|
||||
name: "姓名",
|
||||
key: "name",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
name: "性别",
|
||||
key: "genderName",
|
||||
type: "select",
|
||||
childKey: "gender",
|
||||
fn: () => {
|
||||
contrlModalParams.gender.isShow = true;
|
||||
contrlModalParams.gender.title = "选择性别";
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "用户角色",
|
||||
key: "roleName",
|
||||
type: "select",
|
||||
childKey: "role",
|
||||
fn: () => {
|
||||
contrlModalParams.role.isShow = true;
|
||||
contrlModalParams.role.title = "选择角色";
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "用户名",
|
||||
key: "userName",
|
||||
type: "input",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "密码",
|
||||
key: "password",
|
||||
type: "input",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "联系手机",
|
||||
key: "phone",
|
||||
type: "input",
|
||||
},
|
||||
]);
|
||||
|
||||
const handleSelect = (key: string, v: any) => {
|
||||
contrlModalParams[key].isShow = false;
|
||||
if (key === "role") {
|
||||
model1.formData.roleName = v.name;
|
||||
model1.formData.roleIds = [v.id];
|
||||
}
|
||||
if (key === "gender") {
|
||||
model1.formData.genderName = v.name;
|
||||
model1.formData.genderId = v.id;
|
||||
}
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
if (model1.formData.id) {
|
||||
ProfileApi.updateUserById(model1.formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/user", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ProfileApi.addUser({userType: 1, ...model1.formData}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesApp/user", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const getRoleList = () => {
|
||||
ProfileApi.getRoleList({}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
contrlModalParams.role.list = (res.data as any).map((item: any) => {
|
||||
return { ...item, name: item.roleName };
|
||||
});
|
||||
console.log(contrlModalParams.role.list);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getRoleList();
|
||||
});
|
||||
|
||||
onLoad((option) => {
|
||||
// 接收传递的标题参数;
|
||||
const title = (option as any).title;
|
||||
model1.formData = JSON.parse((option as any).item);
|
||||
if (model1.formData.type === 1) {
|
||||
model1.formData.typeName = "出库卡";
|
||||
} else if (model1.formData.type === 2) {
|
||||
model1.formData.typeName = "入库卡";
|
||||
}
|
||||
// 设置页面标题;
|
||||
if (title) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: title,
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-card {
|
||||
background: #ffffff;
|
||||
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 30rpx 25rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
::v-deep .u-form-item {
|
||||
height: auto;
|
||||
}
|
||||
::v-deep .u-form-item + .u-form-item {
|
||||
border-top: 1rpx solid rgba(233, 233, 233, 0.76);
|
||||
}
|
||||
}
|
||||
.btn-box {
|
||||
margin-top: 60rpx;
|
||||
display: flex;
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
|
||||
border-radius: 13rpx 13rpx 0rpx 0rpx;
|
||||
padding: 25rpx 50rpx;
|
||||
position: sticky;
|
||||
bottom: 0rpx;
|
||||
z-index: 999;
|
||||
::v-deep button {
|
||||
border-radius: 43rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -3,28 +3,87 @@
|
|||
<view class="search">
|
||||
<u-search
|
||||
placeholder="请输入客户名称"
|
||||
v-model="keyword"
|
||||
v-model="state.name"
|
||||
:showAction="false"
|
||||
:bgColor="'#fff'"
|
||||
:borderColor="'rgba(0, 0, 0, 0.1)'"
|
||||
:placeholderColor="'#C1C1C1'"
|
||||
@search="handleSearch()"
|
||||
></u-search>
|
||||
<view class="btn"> 新增 </view>
|
||||
<view class="btn" @click="add"> 新增 </view>
|
||||
</view>
|
||||
<view class="box">
|
||||
<view v-for="item in 10" :key="item">
|
||||
<view v-for="(item, index) in pageList.list" :key="index">
|
||||
<view>
|
||||
<view>客户名称</view>
|
||||
<view>联系人:张三</view>
|
||||
<view>卡号:235466566</view>
|
||||
<view>{{ item.name }}</view>
|
||||
<view>联系人:{{ item.contacts }}</view>
|
||||
<view>卡号:{{ item.cardCode }}</view>
|
||||
</view>
|
||||
<view class="op-box">
|
||||
<view class="btn" @click="edit(item)"> 编辑 </view>
|
||||
<view class="btn" @click="deleteCustomer(item)"> 删除 </view>
|
||||
</view>
|
||||
<view class="btn"> 删除 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { CustomerApi } from "@/services";
|
||||
|
||||
const keyword = ref("");
|
||||
|
||||
const state = reactive<any>({
|
||||
name: "",
|
||||
});
|
||||
const pageList: PageResult<Customer> = reactive({
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const add = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/components/addCustomer", // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const edit = (item: any) => {
|
||||
uni.navigateTo({
|
||||
url:
|
||||
"/pagesApp/components/addCustomer?title=编辑客户&item=" +
|
||||
JSON.stringify(item), // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const deleteCustomer = (item: any) => {
|
||||
CustomerApi.updateCustomUser({ isDeleted: true, id: item.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
getCustomUserPage();
|
||||
}
|
||||
});
|
||||
};
|
||||
const handleSearch = () => {
|
||||
getCustomUserPage();
|
||||
};
|
||||
const getCustomUserPage = () => {
|
||||
let params: any = {
|
||||
pageSize: 10,
|
||||
pageNum: 1,
|
||||
name: state.name,
|
||||
};
|
||||
if (state.supplierTypeId > -1) {
|
||||
params.supplierTypeId = state.supplierTypeId;
|
||||
}
|
||||
CustomerApi.getCustomUserPage(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = (res.data as any).list;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getCustomUserPage();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-card {
|
||||
|
@ -38,7 +97,7 @@ const keyword = ref("");
|
|||
border-radius: 24rpx;
|
||||
border: 1px solid #00dcee;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
margin-left: 50rpx;
|
||||
padding: 6rpx 30rpx;
|
||||
|
@ -48,9 +107,9 @@ const keyword = ref("");
|
|||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
padding: 10rpx 25rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
font-weight: 400;
|
||||
font-size: 22rpx;
|
||||
font-size: 26rpx;
|
||||
color: #000000;
|
||||
line-height: 41rpx;
|
||||
margin-top: 30rpx;
|
||||
|
@ -59,18 +118,19 @@ const keyword = ref("");
|
|||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0rpx;
|
||||
.btn {
|
||||
background: #ff9d55;
|
||||
border-radius: 24rpx;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #ffffff;
|
||||
padding: 6rpx 30rpx;
|
||||
}
|
||||
.btn_text {
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #00dcee;
|
||||
.op-box {
|
||||
display: flex;
|
||||
.btn + .btn {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.btn {
|
||||
background: #ff9d55;
|
||||
border-radius: 24rpx;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
padding: 6rpx 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
> view + view {
|
||||
|
|
|
@ -113,7 +113,7 @@ const gridList1 = reactive([
|
|||
},
|
||||
{
|
||||
name: "作废人",
|
||||
enName: "updateUserName",
|
||||
enName: "updateName",
|
||||
unit: "",
|
||||
isBefore: false,
|
||||
isCustomStyle: true,
|
||||
|
|
|
@ -0,0 +1,159 @@
|
|||
<template>
|
||||
<view class="c-card">
|
||||
<view class="search">
|
||||
<u-search
|
||||
placeholder="请输入收货产品名称"
|
||||
v-model="state.name"
|
||||
:showAction="false"
|
||||
:bgColor="'#fff'"
|
||||
:borderColor="'rgba(0, 0, 0, 0.1)'"
|
||||
:placeholderColor="'#C1C1C1'"
|
||||
@search="handleSearch()"
|
||||
></u-search>
|
||||
<view class="btn" @click="add"> 新增 </view>
|
||||
</view>
|
||||
|
||||
<view class="box" v-for="(item, index) in pageList.list" :key="index">
|
||||
<view>
|
||||
<view>
|
||||
<view>{{ item.reProductsName }}</view>
|
||||
<view>{{ item.minPrice }} ~ {{ item.maxPrice }} 元</view>
|
||||
</view>
|
||||
<view class="op-box">
|
||||
<view class="btn" @click="edit(item)"> 编辑 </view>
|
||||
<view class="btn" @click="update(item)"> 删除 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { GoodsApi } from "@/services";
|
||||
import { UsersType } from "@/utils/enum";
|
||||
const state = reactive<any>({
|
||||
name: "",
|
||||
supplierTypeId: -1,
|
||||
isShowType: false,
|
||||
typeList: [],
|
||||
});
|
||||
const pageList: PageResult<{
|
||||
reProductsName: string;
|
||||
minPrice: number;
|
||||
maxPrice: number;
|
||||
}> = reactive({
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
|
||||
const handleSearch = () => {
|
||||
getList();
|
||||
};
|
||||
|
||||
const update = (item: any) => {
|
||||
GoodsApi.EditReceiveProduct({ isDeleted: true, id: item.id }).then(
|
||||
(res) => {
|
||||
if (res.code === 200) {
|
||||
getList();
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const edit = (item: any) => {
|
||||
uni.navigateTo({
|
||||
url:
|
||||
"/pagesApp/components/addReceiveProduct?title=编辑收货产品&item=" +
|
||||
JSON.stringify(item), // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const getList = () => {
|
||||
let params: any = {
|
||||
pageSize: 10,
|
||||
pageNum: 1,
|
||||
reProductsName: state.name,
|
||||
};
|
||||
GoodsApi.getReceiveProductListByPage(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = (res.data as any).list;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
const add = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/components/addReceiveProduct", // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-card {
|
||||
margin: 30rpx 25rpx;
|
||||
.search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.type {
|
||||
display: flex;
|
||||
margin-right: 20rpx;
|
||||
font-size: 28rpx;
|
||||
color: #000000;
|
||||
}
|
||||
.btn {
|
||||
background: #00dcee;
|
||||
border-radius: 24rpx;
|
||||
border: 1px solid #00dcee;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #ffffff;
|
||||
margin-left: 50rpx;
|
||||
padding: 6rpx 30rpx;
|
||||
}
|
||||
}
|
||||
.box {
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #000000;
|
||||
line-height: 41rpx;
|
||||
margin-top: 30rpx;
|
||||
> view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0rpx;
|
||||
|
||||
.op-box {
|
||||
display: flex;
|
||||
.btn + .btn {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.btn {
|
||||
background: #ff9d55;
|
||||
border-radius: 24rpx;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #ffffff;
|
||||
padding: 6rpx 30rpx;
|
||||
}
|
||||
.btn_text {
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #00dcee;
|
||||
}
|
||||
}
|
||||
}
|
||||
> view + view {
|
||||
border-top: 1px solid rgba(233, 233, 233, 0.76);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -366,7 +366,7 @@ const handleTime = (v: any) => {
|
|||
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 30rpx 25rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
::v-deep .u-form-item {
|
||||
height: auto;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,140 @@
|
|||
<template>
|
||||
<view class="c-card">
|
||||
<view class="search">
|
||||
<u-search
|
||||
placeholder="请输入收货分类"
|
||||
v-model="state.name"
|
||||
:showAction="false"
|
||||
:bgColor="'#fff'"
|
||||
:borderColor="'rgba(0, 0, 0, 0.1)'"
|
||||
:placeholderColor="'#C1C1C1'"
|
||||
@search="handleSearch()"
|
||||
></u-search>
|
||||
<view class="btn" @click="add"> 新增 </view>
|
||||
</view>
|
||||
<view class="box">
|
||||
<view v-for="(item, index) in pageList.list" :key="index">
|
||||
<view>
|
||||
<view>{{ item.reCategoryName }}</view>
|
||||
</view>
|
||||
<view class="op-box">
|
||||
<view class="btn" @click="edit(item)"> 编辑 </view>
|
||||
<view class="btn" @click="deleteType(item)"> 删除 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { GoodsApi } from "@/services";
|
||||
import { StockCardType } from "@/utils/enum";
|
||||
|
||||
const keyword = ref("");
|
||||
|
||||
const state = reactive<any>({
|
||||
name: "",
|
||||
});
|
||||
const pageList: PageResult<{reCategoryName: string}> = reactive({
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const add = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/components/addReceiveType", // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const edit = (item: any) => {
|
||||
uni.navigateTo({
|
||||
url:
|
||||
"/pagesApp/components/addReceiveType?title=编辑收货分类&item=" +
|
||||
JSON.stringify(item), // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const deleteType = (item: any) => {
|
||||
GoodsApi.editReceiveCategory({ isDeleted: true, id: item.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
const handleSearch = () => {
|
||||
getList();
|
||||
};
|
||||
const getList = () => {
|
||||
let params: any = {
|
||||
pageSize: 10,
|
||||
pageNum: 1,
|
||||
reCategoryName: state.name,
|
||||
};
|
||||
if (state.supplierTypeId > -1) {
|
||||
params.supplierTypeId = state.supplierTypeId;
|
||||
}
|
||||
GoodsApi.getPage(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = (res.data as any).list;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-card {
|
||||
margin: 30rpx 25rpx;
|
||||
.search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.btn {
|
||||
background: #00dcee;
|
||||
border-radius: 24rpx;
|
||||
border: 1px solid #00dcee;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
margin-left: 50rpx;
|
||||
padding: 6rpx 30rpx;
|
||||
}
|
||||
}
|
||||
.box {
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #000000;
|
||||
line-height: 41rpx;
|
||||
margin-top: 30rpx;
|
||||
> view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0rpx;
|
||||
.op-box {
|
||||
display: flex;
|
||||
.btn + .btn {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.btn {
|
||||
background: #ff9d55;
|
||||
border-radius: 24rpx;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
padding: 6rpx 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
> view + view {
|
||||
border-top: 1px solid rgba(233, 233, 233, 0.76);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,156 @@
|
|||
<template>
|
||||
<view class="c-card">
|
||||
<view class="search">
|
||||
<u-search
|
||||
placeholder="请输入角色名称"
|
||||
v-model="state.name"
|
||||
:showAction="false"
|
||||
:bgColor="'#fff'"
|
||||
:borderColor="'rgba(0, 0, 0, 0.1)'"
|
||||
:placeholderColor="'#C1C1C1'"
|
||||
@search="handleSearch()"
|
||||
></u-search>
|
||||
<view class="btn" @click="add"> 新增 </view>
|
||||
</view>
|
||||
<page-view
|
||||
@loadList="
|
||||
(v) => {
|
||||
getList(v);
|
||||
}
|
||||
"
|
||||
:noMoreData="pageList.noMoreData"
|
||||
>
|
||||
<view class="box">
|
||||
<view v-for="(item, index) in pageList.list" :key="index">
|
||||
<view>
|
||||
<view>{{ item.roleName }}</view>
|
||||
</view>
|
||||
<view class="op-box">
|
||||
<view class="btn" @click="edit(item)"> 编辑 </view>
|
||||
<view class="btn" @click="deleteCustomer(item)"> 删除 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</page-view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ProfileApi, StockCardApi } from "@/services";
|
||||
import PageView from "@/components/PageView/index.vue";
|
||||
|
||||
const keyword = ref("");
|
||||
|
||||
const state = reactive<any>({
|
||||
name: "",
|
||||
});
|
||||
const pageList: PageResult<{
|
||||
roleName: string;
|
||||
}> = reactive({
|
||||
noMoreData: false,
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const add = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/components/addRole", // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const edit = (item: any) => {
|
||||
uni.navigateTo({
|
||||
url:
|
||||
"/pagesApp/components/addRole?title=新增角色&item=" +
|
||||
JSON.stringify(item), // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const deleteCustomer = (item: any) => {
|
||||
StockCardApi.updateStockCard({ isDeleted: true, id: item.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
const handleSearch = () => {
|
||||
getList();
|
||||
};
|
||||
const getList = (v?: boolean) => {
|
||||
if (v) {
|
||||
if (Math.ceil(pageList.total / pageList.pageSize) > pageList.pageNum) {
|
||||
pageList.pageNum++;
|
||||
} else {
|
||||
pageList.noMoreData = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
let params: any = {
|
||||
roleName: state.name,
|
||||
};
|
||||
ProfileApi.getRoleList(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = res.data as any;
|
||||
pageList.total = (res.data as any).total
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-card {
|
||||
margin: 30rpx 25rpx;
|
||||
.search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.btn {
|
||||
background: #00dcee;
|
||||
border-radius: 24rpx;
|
||||
border: 1px solid #00dcee;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
margin-left: 50rpx;
|
||||
padding: 6rpx 30rpx;
|
||||
}
|
||||
}
|
||||
.box {
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #000000;
|
||||
line-height: 41rpx;
|
||||
margin-top: 30rpx;
|
||||
> view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0rpx;
|
||||
.op-box {
|
||||
display: flex;
|
||||
.btn + .btn {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.btn {
|
||||
background: #ff9d55;
|
||||
border-radius: 24rpx;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
padding: 6rpx 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
> view + view {
|
||||
border-top: 1px solid rgba(233, 233, 233, 0.76);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,159 @@
|
|||
<template>
|
||||
<view class="c-card">
|
||||
<view class="search">
|
||||
<u-search
|
||||
placeholder="请输入出货产品名称"
|
||||
v-model="state.name"
|
||||
:showAction="false"
|
||||
:bgColor="'#fff'"
|
||||
:borderColor="'rgba(0, 0, 0, 0.1)'"
|
||||
:placeholderColor="'#C1C1C1'"
|
||||
@search="handleSearch()"
|
||||
></u-search>
|
||||
<view class="btn" @click="add"> 新增 </view>
|
||||
</view>
|
||||
|
||||
<view class="box" v-for="(item, index) in pageList.list" :key="index">
|
||||
<view>
|
||||
<view>
|
||||
<view>{{ item.shmProductsName }}</view>
|
||||
<view>分类:{{ item.parentName }} / {{ item.shmCategoryName }} </view>
|
||||
</view>
|
||||
<view class="op-box">
|
||||
<view class="btn" @click="edit(item)"> 编辑 </view>
|
||||
<view class="btn" @click="update(item)"> 删除 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { GoodsApi } from "@/services";
|
||||
import { UsersType } from "@/utils/enum";
|
||||
const state = reactive<any>({
|
||||
name: "",
|
||||
supplierTypeId: -1,
|
||||
isShowType: false,
|
||||
typeList: [],
|
||||
});
|
||||
const pageList: PageResult<{
|
||||
shmProductsName: string;
|
||||
parentName: string;
|
||||
shmCategoryName: string;
|
||||
}> = reactive({
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
|
||||
const handleSearch = () => {
|
||||
getList();
|
||||
};
|
||||
|
||||
const update = (item: any) => {
|
||||
GoodsApi.EditReceiveProduct({ isDeleted: true, id: item.id }).then(
|
||||
(res) => {
|
||||
if (res.code === 200) {
|
||||
getList();
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const edit = (item: any) => {
|
||||
uni.navigateTo({
|
||||
url:
|
||||
"/pagesApp/components/addShipmentProduct?title=编辑收货产品&item=" +
|
||||
JSON.stringify(item), // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const getList = () => {
|
||||
let params: any = {
|
||||
pageSize: 10,
|
||||
pageNum: 1,
|
||||
name: state.name,
|
||||
};
|
||||
GoodsApi.getShipmentProductByPage(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = (res.data as any).list;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
const add = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/components/addShipmentProduct", // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-card {
|
||||
margin: 30rpx 25rpx;
|
||||
.search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.type {
|
||||
display: flex;
|
||||
margin-right: 20rpx;
|
||||
font-size: 28rpx;
|
||||
color: #000000;
|
||||
}
|
||||
.btn {
|
||||
background: #00dcee;
|
||||
border-radius: 24rpx;
|
||||
border: 1px solid #00dcee;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #ffffff;
|
||||
margin-left: 50rpx;
|
||||
padding: 6rpx 30rpx;
|
||||
}
|
||||
}
|
||||
.box {
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #000000;
|
||||
line-height: 41rpx;
|
||||
margin-top: 30rpx;
|
||||
> view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0rpx;
|
||||
|
||||
.op-box {
|
||||
display: flex;
|
||||
.btn + .btn {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.btn {
|
||||
background: #ff9d55;
|
||||
border-radius: 24rpx;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #ffffff;
|
||||
padding: 6rpx 30rpx;
|
||||
}
|
||||
.btn_text {
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #00dcee;
|
||||
}
|
||||
}
|
||||
}
|
||||
> view + view {
|
||||
border-top: 1px solid rgba(233, 233, 233, 0.76);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -387,7 +387,7 @@ const handleTime = (v: any) => {
|
|||
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 30rpx 25rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
::v-deep .u-form-item {
|
||||
height: auto;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,164 @@
|
|||
<template>
|
||||
<view class="c-card">
|
||||
<view class="search">
|
||||
<u-search
|
||||
placeholder="请输入出货分类"
|
||||
v-model="state.name"
|
||||
:showAction="false"
|
||||
:bgColor="'#fff'"
|
||||
:borderColor="'rgba(0, 0, 0, 0.1)'"
|
||||
:placeholderColor="'#C1C1C1'"
|
||||
@search="handleSearch()"
|
||||
></u-search>
|
||||
<view class="btn" @click="add"> 新增 </view>
|
||||
</view>
|
||||
<page-view
|
||||
@loadList="
|
||||
(v) => {
|
||||
getList(v);
|
||||
}
|
||||
"
|
||||
:noMoreData="pageList.noMoreData"
|
||||
>
|
||||
<view class="box">
|
||||
<view v-for="(item, index) in pageList.list" :key="index">
|
||||
<view>
|
||||
<view>{{ item.reCategoryName }}</view>
|
||||
</view>
|
||||
<view class="op-box">
|
||||
<view class="btn" @click="edit(item)"> 编辑 </view>
|
||||
<view class="btn" @click="deleteType(item)"> 删除 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</page-view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { GoodsApi } from "@/services";
|
||||
import PageView from "@/components/PageView/index.vue";
|
||||
|
||||
|
||||
const keyword = ref("");
|
||||
|
||||
const state = reactive<any>({
|
||||
name: "",
|
||||
});
|
||||
const pageList: PageResult<{ reCategoryName: string }> = reactive({
|
||||
noMoreData: false,
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const add = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/components/addShipmentType", // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const edit = (item: any) => {
|
||||
uni.navigateTo({
|
||||
url:
|
||||
"/pagesApp/components/addShipmentType?title=编辑出货分类&item=" +
|
||||
JSON.stringify(item), // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const deleteType = (item: any) => {
|
||||
GoodsApi.editReceiveCategory({ isDeleted: true, id: item.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
const handleSearch = () => {
|
||||
getList();
|
||||
};
|
||||
|
||||
const getList = (v?: boolean) => {
|
||||
if (v) {
|
||||
if (Math.ceil(pageList.total / pageList.pageSize) > pageList.pageNum) {
|
||||
pageList.pageNum ++
|
||||
if ( Math.ceil(pageList.total / pageList.pageSize) <= pageList.pageNum) {
|
||||
pageList.noMoreData = true
|
||||
}
|
||||
} else {
|
||||
pageList.noMoreData = true
|
||||
return
|
||||
}
|
||||
}
|
||||
let params: any = {
|
||||
pageSize: pageList.pageSize,
|
||||
pageNum: pageList.pageNum,
|
||||
reCategoryName: state.name,
|
||||
};
|
||||
if (state.supplierTypeId > -1) {
|
||||
params.supplierTypeId = state.supplierTypeId;
|
||||
}
|
||||
GoodsApi.getPage(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = (pageList as any).list.concat((res.data as any).list);
|
||||
pageList.total = (res.data as any).total
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-card {
|
||||
margin: 30rpx 25rpx;
|
||||
.search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.btn {
|
||||
background: #00dcee;
|
||||
border-radius: 24rpx;
|
||||
border: 1px solid #00dcee;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
margin-left: 50rpx;
|
||||
padding: 6rpx 30rpx;
|
||||
}
|
||||
}
|
||||
.box {
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #000000;
|
||||
line-height: 41rpx;
|
||||
margin-top: 30rpx;
|
||||
> view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0rpx;
|
||||
.op-box {
|
||||
display: flex;
|
||||
.btn + .btn {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.btn {
|
||||
background: #ff9d55;
|
||||
border-radius: 24rpx;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
padding: 6rpx 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
> view + view {
|
||||
border-top: 1px solid rgba(233, 233, 233, 0.76);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,142 @@
|
|||
<template>
|
||||
<view class="c-card">
|
||||
<view class="search">
|
||||
<u-search
|
||||
placeholder="请输入库存卡号"
|
||||
v-model="state.name"
|
||||
:showAction="false"
|
||||
:bgColor="'#fff'"
|
||||
:borderColor="'rgba(0, 0, 0, 0.1)'"
|
||||
:placeholderColor="'#C1C1C1'"
|
||||
@search="handleSearch()"
|
||||
></u-search>
|
||||
<view class="btn" @click="add"> 新增 </view>
|
||||
</view>
|
||||
<view class="box">
|
||||
<view v-for="(item, index) in pageList.list" :key="index">
|
||||
<view>
|
||||
<view>{{item.type === StockCardType.Shipment ? '客户' : '供应商'}}:{{ item.name }}</view>
|
||||
<view>卡号:{{ item.cardCode }}</view>
|
||||
<view>类型:{{ item.type === StockCardType.Shipment ? '出库卡' : '入库卡' }}</view>
|
||||
</view>
|
||||
<view class="op-box">
|
||||
<view class="btn" @click="edit(item)"> 编辑 </view>
|
||||
<view class="btn" @click="deleteCustomer(item)"> 删除 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { StockCardApi } from "@/services";
|
||||
import { StockCardType } from "@/utils/enum";
|
||||
|
||||
const keyword = ref("");
|
||||
|
||||
const state = reactive<any>({
|
||||
name: "",
|
||||
});
|
||||
const pageList: PageResult<StockCard> = reactive({
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const add = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/components/addStockCard", // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const edit = (item: any) => {
|
||||
uni.navigateTo({
|
||||
url:
|
||||
"/pagesApp/components/addStockCard?title=编辑库存卡&item=" +
|
||||
JSON.stringify(item), // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const deleteCustomer = (item: any) => {
|
||||
StockCardApi.updateStockCard({ isDeleted: true, id: item.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
const handleSearch = () => {
|
||||
getList();
|
||||
};
|
||||
const getList = () => {
|
||||
let params: any = {
|
||||
pageSize: 10,
|
||||
pageNum: 1,
|
||||
name: state.name,
|
||||
};
|
||||
if (state.supplierTypeId > -1) {
|
||||
params.supplierTypeId = state.supplierTypeId;
|
||||
}
|
||||
StockCardApi.getStockCardList(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = (res.data as any).list;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-card {
|
||||
margin: 30rpx 25rpx;
|
||||
.search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.btn {
|
||||
background: #00dcee;
|
||||
border-radius: 24rpx;
|
||||
border: 1px solid #00dcee;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
margin-left: 50rpx;
|
||||
padding: 6rpx 30rpx;
|
||||
}
|
||||
}
|
||||
.box {
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #000000;
|
||||
line-height: 41rpx;
|
||||
margin-top: 30rpx;
|
||||
> view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0rpx;
|
||||
.op-box {
|
||||
display: flex;
|
||||
.btn + .btn {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.btn {
|
||||
background: #ff9d55;
|
||||
border-radius: 24rpx;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
padding: 6rpx 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
> view + view {
|
||||
border-top: 1px solid rgba(233, 233, 233, 0.76);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -1,6 +1,9 @@
|
|||
<template>
|
||||
<view class="c-card">
|
||||
<view class="search">
|
||||
<view class="type" @click="state.isShowType = true"
|
||||
>全部分类<u-icon name="arrow-down"></u-icon>
|
||||
</view>
|
||||
<u-search
|
||||
placeholder="请输入供应商名称"
|
||||
v-model="state.name"
|
||||
|
@ -10,24 +13,40 @@
|
|||
:placeholderColor="'#C1C1C1'"
|
||||
@search="handleSearch()"
|
||||
></u-search>
|
||||
<view class="btn"> 新增 </view>
|
||||
<view class="btn" @click="addSupplier"> 新增 </view>
|
||||
</view>
|
||||
|
||||
<view class="box" v-for="(item, index) in pageList.list" :key="index">
|
||||
<view>
|
||||
<view>
|
||||
<view>{{ item.name }}</view>
|
||||
<view>卡号:{{ item.cardCode }}</view>
|
||||
</view>
|
||||
<view class="btn"> 删除 </view>
|
||||
<view class="op-box">
|
||||
<view class="btn" @click="edit(item)"> 编辑 </view>
|
||||
<view class="btn" @click="update(item)"> 删除 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-action-sheet
|
||||
:actions="state.typeList"
|
||||
:title="'供应商分类'"
|
||||
:show="state.isShowType"
|
||||
:closeOnClickOverlay="true"
|
||||
:closeOnClickAction="true"
|
||||
@close="state.isShowType = false"
|
||||
@select="handleSelect"
|
||||
></u-action-sheet>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ProfileApi } from "@/services";
|
||||
import { SupplierApi } from "@/services";
|
||||
import { UsersType } from "@/utils/enum";
|
||||
const state = reactive({
|
||||
const state = reactive<any>({
|
||||
name: "",
|
||||
supplierTypeId: -1,
|
||||
isShowType: false,
|
||||
typeList: [],
|
||||
});
|
||||
const pageList: PageResult<User> = reactive({
|
||||
total: 0,
|
||||
|
@ -35,16 +54,41 @@ const pageList: PageResult<User> = reactive({
|
|||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const handleSelect = (v: any) => {
|
||||
state.supplierTypeId = v.id;
|
||||
getUserList();
|
||||
};
|
||||
const handleSearch = () => {
|
||||
getUserList()
|
||||
getUserList();
|
||||
};
|
||||
|
||||
const update = (item: any) => {
|
||||
SupplierApi.updateSupplierUser({ isDeleted: true, id: item.id }).then(
|
||||
(res) => {
|
||||
if (res.code === 200) {
|
||||
getUserList();
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const edit = (item: any) => {
|
||||
uni.navigateTo({
|
||||
url:
|
||||
"/pagesApp/components/addSupplier?title=编辑供应商&item=" +
|
||||
JSON.stringify(item), // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const getUserList = () => {
|
||||
ProfileApi.getInventoryUserPage({
|
||||
let params: any = {
|
||||
pageSize: 10,
|
||||
pageNum: 1,
|
||||
userType: UsersType.Purchaser,
|
||||
name: state.name,
|
||||
}).then((res) => {
|
||||
};
|
||||
if (state.supplierTypeId > -1) {
|
||||
params.supplierTypeId = state.supplierTypeId;
|
||||
}
|
||||
SupplierApi.getSupplierUserPage(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = (res.data as any).list;
|
||||
|
@ -52,8 +96,21 @@ const getUserList = () => {
|
|||
}
|
||||
});
|
||||
};
|
||||
const getSupplierTypeList = () => {
|
||||
SupplierApi.getSupplierTypeList().then((res) => {
|
||||
if (res.code === 200) {
|
||||
state.typeList = res.data;
|
||||
}
|
||||
});
|
||||
};
|
||||
const addSupplier = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/components/addSupplier", // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
getUserList();
|
||||
getSupplierTypeList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
@ -63,12 +120,18 @@ onMounted(() => {
|
|||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.type {
|
||||
display: flex;
|
||||
margin-right: 20rpx;
|
||||
font-size: 28rpx;
|
||||
color: #000000;
|
||||
}
|
||||
.btn {
|
||||
background: #00dcee;
|
||||
border-radius: 24rpx;
|
||||
border: 1px solid #00dcee;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
font-size: 28rpx;
|
||||
color: #ffffff;
|
||||
margin-left: 50rpx;
|
||||
padding: 6rpx 30rpx;
|
||||
|
@ -78,9 +141,9 @@ onMounted(() => {
|
|||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
padding: 10rpx 25rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
font-size: 28rpx;
|
||||
color: #000000;
|
||||
line-height: 41rpx;
|
||||
margin-top: 30rpx;
|
||||
|
@ -89,18 +152,25 @@ onMounted(() => {
|
|||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0rpx;
|
||||
.btn {
|
||||
background: #ff9d55;
|
||||
border-radius: 24rpx;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
padding: 6rpx 30rpx;
|
||||
}
|
||||
.btn_text {
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #00dcee;
|
||||
|
||||
.op-box {
|
||||
display: flex;
|
||||
.btn + .btn {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.btn {
|
||||
background: #ff9d55;
|
||||
border-radius: 24rpx;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #ffffff;
|
||||
padding: 6rpx 30rpx;
|
||||
}
|
||||
.btn_text {
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #00dcee;
|
||||
}
|
||||
}
|
||||
}
|
||||
> view + view {
|
||||
|
|
|
@ -0,0 +1,164 @@
|
|||
<template>
|
||||
<view class="c-card">
|
||||
<view class="search">
|
||||
<u-search
|
||||
placeholder="请输入供应商分类"
|
||||
v-model="state.name"
|
||||
:showAction="false"
|
||||
:bgColor="'#fff'"
|
||||
:borderColor="'rgba(0, 0, 0, 0.1)'"
|
||||
:placeholderColor="'#C1C1C1'"
|
||||
@search="handleSearch()"
|
||||
></u-search>
|
||||
<view class="btn" @click="add"> 新增 </view>
|
||||
</view>
|
||||
<page-view
|
||||
@loadList="
|
||||
(v) => {
|
||||
getList(v);
|
||||
}
|
||||
"
|
||||
:noMoreData="pageList.noMoreData"
|
||||
>
|
||||
<view class="box">
|
||||
<view v-for="(item, index) in pageList.list" :key="index">
|
||||
<view>
|
||||
<view>{{ item.name }}</view>
|
||||
</view>
|
||||
<view class="op-box">
|
||||
<view class="btn" @click="edit(item)"> 编辑 </view>
|
||||
<view class="btn" @click="deleteType(item)"> 删除 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</page-view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { StockCardApi, SupplierApi } from "@/services";
|
||||
import PageView from "@/components/PageView/index.vue";
|
||||
|
||||
const keyword = ref("");
|
||||
|
||||
const state = reactive<any>({
|
||||
name: "",
|
||||
});
|
||||
const pageList: PageResult<StockCard> = reactive({
|
||||
noMoreData: false,
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const add = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/components/addSupplierType", // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const edit = (item: any) => {
|
||||
uni.navigateTo({
|
||||
url:
|
||||
"/pagesApp/components/addSupplierType?title=编辑供应商分类&item=" +
|
||||
JSON.stringify(item), // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const deleteType = (item: any) => {
|
||||
SupplierApi.updateSupplierType({ isDeleted: true, id: item.id }).then(
|
||||
(res) => {
|
||||
if (res.code === 200) {
|
||||
getList();
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
const handleSearch = () => {
|
||||
getList();
|
||||
};
|
||||
const getList = (v?: boolean) => {
|
||||
if (v) {
|
||||
if (Math.ceil(pageList.total / pageList.pageSize) > pageList.pageNum) {
|
||||
pageList.pageNum++;
|
||||
if ( Math.ceil(pageList.total / pageList.pageSize) <= pageList.pageNum) {
|
||||
pageList.noMoreData = true
|
||||
}
|
||||
} else {
|
||||
pageList.noMoreData = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
let params: any = {
|
||||
pageSize: pageList.pageSize,
|
||||
pageNum: pageList.pageNum,
|
||||
name: state.name,
|
||||
};
|
||||
if (state.supplierTypeId > -1) {
|
||||
params.supplierTypeId = state.supplierTypeId;
|
||||
}
|
||||
SupplierApi.getSupplierTypePage(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = (res.data as any).list;
|
||||
pageList.total = (res.data as any).total;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-card {
|
||||
margin: 30rpx 25rpx;
|
||||
.search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.btn {
|
||||
background: #00dcee;
|
||||
border-radius: 24rpx;
|
||||
border: 1px solid #00dcee;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
margin-left: 50rpx;
|
||||
padding: 6rpx 30rpx;
|
||||
}
|
||||
}
|
||||
.box {
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #000000;
|
||||
line-height: 41rpx;
|
||||
margin-top: 30rpx;
|
||||
> view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0rpx;
|
||||
.op-box {
|
||||
display: flex;
|
||||
.btn + .btn {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.btn {
|
||||
background: #ff9d55;
|
||||
border-radius: 24rpx;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
padding: 6rpx 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
> view + view {
|
||||
border-top: 1px solid rgba(233, 233, 233, 0.76);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,177 @@
|
|||
<template>
|
||||
<view class="c-card">
|
||||
<view class="search">
|
||||
<u-search
|
||||
placeholder="请输入人员名称"
|
||||
v-model="state.name"
|
||||
:showAction="false"
|
||||
:bgColor="'#fff'"
|
||||
:borderColor="'rgba(0, 0, 0, 0.1)'"
|
||||
:placeholderColor="'#C1C1C1'"
|
||||
@search="handleSearch()"
|
||||
></u-search>
|
||||
<view class="btn" @click="add"> 新增 </view>
|
||||
</view>
|
||||
|
||||
<page-view
|
||||
@loadList="
|
||||
(v) => {
|
||||
getList(v);
|
||||
}
|
||||
"
|
||||
:noMoreData="pageList.noMoreData"
|
||||
:list="pageList.list"
|
||||
>
|
||||
<view class="box">
|
||||
<view v-for="(item, index) in pageList.list" :key="index">
|
||||
<view>
|
||||
<view>{{ item.name || item.userName }}</view>
|
||||
<view>{{ item.phone || "-" }}</view>
|
||||
<view>{{
|
||||
item.roleVos.length > 0 ? item.roleVos[0].roleName : "-"
|
||||
}}</view>
|
||||
</view>
|
||||
<view class="op-box">
|
||||
<view class="btn" @click="edit(item)"> 编辑 </view>
|
||||
<view class="btn" @click="deleteCustomer(item)"> 下线 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</page-view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import PageView from "@/components/PageView/index.vue";
|
||||
import { ProfileApi, StockCardApi } from "@/services";
|
||||
import { pageListInit } from "@/utils";
|
||||
import { StockCardType } from "@/utils/enum";
|
||||
|
||||
const keyword = ref("");
|
||||
|
||||
const state = reactive<any>({
|
||||
name: "",
|
||||
});
|
||||
const pageList: PageResult<User> = reactive({
|
||||
noMoreData: false,
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const add = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/components/addUser", // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const edit = (item: any) => {
|
||||
uni.navigateTo({
|
||||
url:
|
||||
"/pagesApp/components/addUser?title=编辑人员&item=" +
|
||||
JSON.stringify(item), // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const deleteCustomer = (item: any) => {
|
||||
ProfileApi.updateUserByIdOffline({ id: item.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
const resetPageList = () => {
|
||||
pageList.noMoreData = false;
|
||||
pageList.total = 0;
|
||||
pageList.list = [];
|
||||
pageList.pageNum = 1;
|
||||
pageList.pageSize = 10;
|
||||
};
|
||||
const handleSearch = () => {
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
const getList = (v?: boolean) => {
|
||||
if (v) {
|
||||
if (Math.ceil(pageList.total / pageList.pageSize) > pageList.pageNum) {
|
||||
pageList.pageNum++;
|
||||
if (Math.ceil(pageList.total / pageList.pageSize) <= pageList.pageNum) {
|
||||
pageList.noMoreData = true;
|
||||
}
|
||||
} else {
|
||||
pageList.noMoreData = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
let params: any = {
|
||||
pageSize: pageList.pageSize,
|
||||
pageNum: pageList.pageNum,
|
||||
name: state.name,
|
||||
};
|
||||
ProfileApi.getUserListByPage(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = (pageList as any).list.concat(
|
||||
(res.data as any).list
|
||||
);
|
||||
pageList.total = (res.data as any).total;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-card {
|
||||
margin: 30rpx 25rpx;
|
||||
.search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.btn {
|
||||
background: #00dcee;
|
||||
border-radius: 24rpx;
|
||||
border: 1px solid #00dcee;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
margin-left: 50rpx;
|
||||
padding: 6rpx 30rpx;
|
||||
}
|
||||
}
|
||||
.box {
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #000000;
|
||||
line-height: 41rpx;
|
||||
margin-top: 30rpx;
|
||||
> view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0rpx;
|
||||
.op-box {
|
||||
display: flex;
|
||||
.btn + .btn {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.btn {
|
||||
background: #ff9d55;
|
||||
border-radius: 24rpx;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
padding: 6rpx 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
> view + view {
|
||||
border-top: 1px solid rgba(233, 233, 233, 0.76);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -54,7 +54,7 @@
|
|||
</view>
|
||||
|
||||
<!-- 出货入库 -->
|
||||
<text class="title title-shipment">出货入库</text>
|
||||
<text class="title title-shipment">出货销售</text>
|
||||
<view class="data-shipment">
|
||||
<up-row justify="center" gutter="10">
|
||||
<up-col span="3" v-for="(item, index) in shipmentList" :key="index" @click="(item as any).fn()">
|
||||
|
@ -212,7 +212,7 @@ const receiveList = reactive([
|
|||
num: 0,
|
||||
fn: () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesReceive/pricing", // 要跳转到的页面路径
|
||||
url: "/pagesReceive/pricing?scaleStatus=0", // 要跳转到的页面路径
|
||||
});
|
||||
},
|
||||
},
|
||||
|
@ -221,7 +221,7 @@ const receiveList = reactive([
|
|||
num: 0,
|
||||
fn: () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesReceive/tareing", // 要跳转到的页面路径
|
||||
url: "/pagesReceive/pricing?scaleStatus=1", // 要跳转到的页面路径
|
||||
});
|
||||
},
|
||||
},
|
||||
|
@ -250,7 +250,7 @@ const shipmentList = reactive([
|
|||
num: 0,
|
||||
fn: () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesShipment/shipmenting", // 要跳转到的页面路径
|
||||
url: "/pagesShipment/shipmenting?scaleStatus=0", // 要跳转到的页面路径
|
||||
});
|
||||
},
|
||||
},
|
||||
|
@ -259,7 +259,7 @@ const shipmentList = reactive([
|
|||
num: 0,
|
||||
fn: () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesShipment/grossWeight", // 要跳转到的页面路径
|
||||
url: "/pagesShipment/shipmenting?scaleStatus=1", // 要跳转到的页面路径
|
||||
});
|
||||
},
|
||||
},
|
||||
|
@ -293,15 +293,6 @@ const appList = reactive([
|
|||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "02.png",
|
||||
title: "出货补单",
|
||||
fn: () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/shipmentSpl", // 要跳转到的页面路径
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "03.png",
|
||||
title: "收货明细",
|
||||
|
@ -311,15 +302,6 @@ const appList = reactive([
|
|||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "04.png",
|
||||
title: "出货明细",
|
||||
fn: () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/shipmentDetail", // 要跳转到的页面路径
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "05.png",
|
||||
title: "收货作废",
|
||||
|
@ -329,15 +311,6 @@ const appList = reactive([
|
|||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "06.png",
|
||||
title: "出货作废",
|
||||
fn: () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/shipmentCl", // 要跳转到的页面路径
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "07.png",
|
||||
title: "供应商管理",
|
||||
|
@ -347,6 +320,36 @@ const appList = reactive([
|
|||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "02.png",
|
||||
title: "出货补单",
|
||||
fn: () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/shipmentSpl", // 要跳转到的页面路径
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
icon: "04.png",
|
||||
title: "出货明细",
|
||||
fn: () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/shipmentDetail", // 要跳转到的页面路径
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
icon: "06.png",
|
||||
title: "出货作废",
|
||||
fn: () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/shipmentCl", // 要跳转到的页面路径
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
icon: "08.png",
|
||||
title: "客户管理",
|
||||
|
@ -360,74 +363,94 @@ const appList = reactive([
|
|||
icon: "09.png",
|
||||
title: "收货产品",
|
||||
fn: () => {
|
||||
// uni.navigateTo({
|
||||
// url: "/pagesApp/receiveSpl", // 要跳转到的页面路径
|
||||
// });
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/receiveProduct", // 要跳转到的页面路径
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "10.png",
|
||||
title: "收货分类",
|
||||
fn: () => {
|
||||
// uni.navigateTo({
|
||||
// url: "/pagesApp/shipmentSpl", // 要跳转到的页面路径
|
||||
// });
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/receiveType", // 要跳转到的页面路径
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "11.png",
|
||||
title: "出货产品",
|
||||
fn: () => {
|
||||
// uni.navigateTo({
|
||||
// url: "/pagesApp/receiveDetail", // 要跳转到的页面路径
|
||||
// });
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/shipmentProduct", // 要跳转到的页面路径
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "12.png",
|
||||
title: "支付明细",
|
||||
icon: "18.png",
|
||||
title: "出货分类",
|
||||
fn: () => {
|
||||
// uni.navigateTo({
|
||||
// url: "/pagesApp/shipmentDetail", // 要跳转到的页面路径
|
||||
// });
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "13.png",
|
||||
title: "收入明细",
|
||||
fn: () => {
|
||||
// uni.navigateTo({
|
||||
// url: "/pagesApp/receiveCl", // 要跳转到的页面路径
|
||||
// });
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/shipmentType", // 要跳转到的页面路径
|
||||
});
|
||||
},
|
||||
},
|
||||
// {
|
||||
// icon: "12.png",
|
||||
// title: "支付明细",
|
||||
// fn: () => {
|
||||
// // uni.navigateTo({
|
||||
// // url: "/pagesApp/shipmentDetail", // 要跳转到的页面路径
|
||||
// // });
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// icon: "13.png",
|
||||
// title: "收入明细",
|
||||
// fn: () => {
|
||||
// // uni.navigateTo({
|
||||
// // url: "/pagesApp/receiveCl", // 要跳转到的页面路径
|
||||
// // });
|
||||
// },
|
||||
// },
|
||||
{
|
||||
icon: "14.png",
|
||||
title: "人员管理",
|
||||
fn: () => {
|
||||
// uni.navigateTo({
|
||||
// url: "/pagesApp/shipmentCl", // 要跳转到的页面路径
|
||||
// });
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/user", // 要跳转到的页面路径
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "15.png",
|
||||
title: "权限管理",
|
||||
fn: () => {
|
||||
// uni.navigateTo({
|
||||
// url: "/pagesApp/supplierMgt", // 要跳转到的页面路径
|
||||
// });
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/role", // 要跳转到的页面路径
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "17.png",
|
||||
title: "供应商分类",
|
||||
fn: () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/supplierType", // 要跳转到的页面路径
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "16.png",
|
||||
title: "库存卡管理",
|
||||
fn: () => {
|
||||
// uni.navigateTo({
|
||||
// url: "/pagesApp/customerMgt", // 要跳转到的页面路径
|
||||
// });
|
||||
uni.navigateTo({
|
||||
url: "/pagesApp/stockCard", // 要跳转到的页面路径
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
]);
|
||||
|
||||
const tabMenuList = reactive([
|
||||
|
|
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 4.3 KiB |
|
@ -7,14 +7,16 @@
|
|||
ref="form"
|
||||
:labelWidth="80"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
:errorType="'border-bottom'"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`order[${item.key}]`"
|
||||
:prop="`order.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
:borderBottom="false"
|
||||
>
|
||||
<u-textarea
|
||||
v-if="item.type === 'textarea'"
|
||||
|
@ -44,15 +46,14 @@
|
|||
@delete="deletePic" -->
|
||||
<uni-file-picker
|
||||
v-if="item.type === 'upload'"
|
||||
v-model="model1.order.fileList"
|
||||
limit="10"
|
||||
title="最多可上传10张图片"
|
||||
:limit="9"
|
||||
title="最多可上传9张图片"
|
||||
:auto-upload="false"
|
||||
fileMediatype="image"
|
||||
mode="grid"
|
||||
ref="filesRef"
|
||||
v-model="model1.order.fileLists"
|
||||
@delete="handleDelete"
|
||||
></uni-file-picker>
|
||||
|
||||
<u-radio-group
|
||||
v-if="item.type === 'radio'"
|
||||
v-model="(model1.order as any)[item.key]"
|
||||
|
@ -81,21 +82,22 @@
|
|||
@select="(v: any) => handleSelect(item.childKey, v)"
|
||||
@close="contrlModalParams[item.childKey].isShow = false"
|
||||
:closeOnClickAction="true"
|
||||
:safeAreaInsetBottom="true"
|
||||
></u-action-sheet>
|
||||
</block>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<u-button text="暂不定价"></u-button>
|
||||
<u-button text="暂不定价" @click="handleBack()"></u-button>
|
||||
<u-button type="primary" text="保存" @click="save()"></u-button>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { ComType } from "@/types/global";
|
||||
import {
|
||||
ProfileApi,
|
||||
ReceiveProductApi,
|
||||
ReceiveApi,
|
||||
PictureApi,
|
||||
SupplierApi,
|
||||
} from "@/services/index";
|
||||
import _ from "underscore";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
|
@ -112,21 +114,45 @@ const model1 = reactive<{ order: Order }>({
|
|||
buttonType: 0, // 0扣杂1扣点
|
||||
weighingMethod: 0, // 0:有皮重 1:零皮重
|
||||
multiCategory: 0, // 0:单品类 1:多品类
|
||||
fileList: [],
|
||||
fileLists: [],
|
||||
scaleStatus: 1,
|
||||
},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
const rules = reactive({
|
||||
"order.userName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
message: "请选择供应商",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
"order.productName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
message: "请选择收货产品名称",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"order.price": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请输入单价",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"order.grossWeight": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请输入毛重",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"order.weighingMethod": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请选择称重方式",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"order.multiCategory": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请选择品类",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
|
@ -256,7 +282,7 @@ const formAttrList = reactive<ComType>([
|
|||
},
|
||||
]);
|
||||
|
||||
ProfileApi.getUserList({ userType: 2 }).then((res) => {
|
||||
SupplierApi.getSupplierUserList({}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
contrlModalParams.userSelect.list = res.data;
|
||||
}
|
||||
|
@ -282,67 +308,98 @@ const handleSelect = (key: string, v: any) => {
|
|||
}
|
||||
};
|
||||
|
||||
onLoad((option) => {
|
||||
model1.order.id = parseInt((option as any).id);
|
||||
if (model1.order.id) {
|
||||
ReceiveApi.getDetailById({ id: model1.order.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
model1.order = res.data;
|
||||
}
|
||||
});
|
||||
PictureApi.getAnnex({
|
||||
businessId: model1.order.id.toString(),
|
||||
orderType: 1,
|
||||
imagesType: ImagesType.NORMARL,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
const handleBack = () => {
|
||||
uni.navigateBack();
|
||||
};
|
||||
|
||||
// const files = ref<FileObj[]>([]);
|
||||
const filesRef = ref();
|
||||
const handleUpload = () => {
|
||||
// console.log(event.tempFilePaths)
|
||||
const list = filesRef.value[0].filesList;
|
||||
return list.map((item: any) => {
|
||||
return filesRef.value[0].filesList.map((item: any, index: number) => {
|
||||
if (item.fileID) {
|
||||
return;
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
PictureApi.upload({
|
||||
files: item,
|
||||
path: item.path,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
resolve({
|
||||
...(res.data as any),
|
||||
businessId: model1.order.id,
|
||||
imagesType: ImagesType.NORMARL, // 普通资源
|
||||
orderType: OrderType.Receive, // 入库单
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
resolve({
|
||||
...(res.data as any),
|
||||
businessId: model1.order.id,
|
||||
imagesType: ImagesType.NORMARL, // 普通资源
|
||||
orderType: OrderType.Receive, // 入库单
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
return;
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
const handleDelete = (e: any) => {
|
||||
console.log(model1.order.fileLists);
|
||||
if (e.tempFile.fileID) {
|
||||
PictureApi.deleteById({ id: e.tempFile.fileID }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({ title: "已删除" });
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 点击保存 先执行upload接口
|
||||
* 上传成功后 保存图片资源 和更新订单数据
|
||||
*/
|
||||
const save = () => {
|
||||
Promise.all(handleUpload()).then((res) => {
|
||||
// 上传多个资源
|
||||
if (res.length > 0) {
|
||||
PictureApi.addListAnnex({ annexPos: res }).then((res1) => {
|
||||
if (res1.code === 200) {
|
||||
uni.showToast({
|
||||
title: "图片资源上传成功",
|
||||
icon: "success",
|
||||
});
|
||||
}
|
||||
const form = ref();
|
||||
const check = () => {
|
||||
return new Promise((resolve) => {
|
||||
form.value
|
||||
.validate()
|
||||
.then((res: boolean) => {
|
||||
resolve(res);
|
||||
})
|
||||
.catch((errors: any) => {
|
||||
resolve(false);
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: errors[0].message || "校验失败",
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
const save = () => {
|
||||
check().then((res) => {
|
||||
if (res) {
|
||||
startSave();
|
||||
}
|
||||
});
|
||||
};
|
||||
const startSave = () => {
|
||||
Promise.all(handleUpload()).then((res) => {
|
||||
if (res.filter((item) => item).length > 0) {
|
||||
PictureApi.addListAnnex({ annexPos: res.filter((item) => item) }).then(
|
||||
(res1) => {
|
||||
if (res1.code === 200) {
|
||||
console.log("*** 资源文件更新成功");
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
updateOrder();
|
||||
};
|
||||
|
||||
const updateOrder = () => {
|
||||
// 更新定价单
|
||||
/**
|
||||
* 0:有皮重 1:零皮重
|
||||
|
@ -370,23 +427,56 @@ const save = () => {
|
|||
ReceiveApi.updateOne({ ...model1.order }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
// 定价后 若是零皮-》跳转到【付款审核】 有皮重->【待过皮重】
|
||||
uni.showToast({
|
||||
title: "定价成功",
|
||||
icon: "success",
|
||||
});
|
||||
// 0:有皮重 1:零皮重
|
||||
if (model1.order.weighingMethod === 0) {
|
||||
uni.navigateTo({
|
||||
url: "/pagesReceive/tareing", // 要跳转到的页面路径
|
||||
// 当上一页为审核页
|
||||
if (prePage.value === "review") {
|
||||
uni.redirectTo({
|
||||
url:
|
||||
"/pagesReceive/review/index?id=" +
|
||||
model1.order.id +
|
||||
`&scaleStatus=` +
|
||||
model1.order.scaleStatus, // 要跳转到的页面路径
|
||||
});
|
||||
} else if (model1.order.weighingMethod === 1) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/index/payReview", // 要跳转到的页面路径
|
||||
} else {
|
||||
// 0:有皮重 1:零皮重
|
||||
uni.redirectTo({
|
||||
url: "/pagesHome/index", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
const prePage = ref("");
|
||||
onLoad((option) => {
|
||||
model1.order.id = parseInt((option as any).id);
|
||||
prePage.value = (option as any).prePage;
|
||||
if (model1.order.id) {
|
||||
ReceiveApi.getDetailById({ id: model1.order.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
// 基于id查询重新赋值
|
||||
model1.order = {
|
||||
...res.data,
|
||||
buttonType: res.data.buttonType !== null ? res.data.buttonType : 0,
|
||||
weighingMethod:
|
||||
res.data.weighingMethod !== null ? res.data.weighingMethod : 0,
|
||||
multiCategory:
|
||||
res.data.multiCategory !== null ? res.data.multiCategory : 0,
|
||||
fileLists: model1.order.fileLists.map((item: any) => {
|
||||
return { ...item, fileID: item.id };
|
||||
}),
|
||||
};
|
||||
}
|
||||
});
|
||||
PictureApi.getAnnex({
|
||||
businessId: model1.order.id.toString(),
|
||||
orderType: 1,
|
||||
imagesType: ImagesType.NORMARL,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
model1.order.fileLists = res.data;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.c-card {
|
||||
|
@ -394,7 +484,7 @@ const save = () => {
|
|||
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 30rpx 25rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
::v-deep .u-form-item {
|
||||
height: auto;
|
||||
}
|
||||
|
@ -409,7 +499,7 @@ const save = () => {
|
|||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
|
||||
border-radius: 13rpx 13rpx 0rpx 0rpx;
|
||||
padding: 25rpx 50rpx;
|
||||
position: fixed;
|
||||
position: sticky;
|
||||
bottom: 0rpx;
|
||||
z-index: 999;
|
||||
::v-deep button {
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
:clearabled="true"
|
||||
:showAction="false"
|
||||
placeholderColor="#C1C1C1"
|
||||
@search="handleSearch()"
|
||||
></u-search>
|
||||
</view>
|
||||
|
||||
|
@ -28,90 +29,119 @@
|
|||
</text>
|
||||
</view>
|
||||
|
||||
<block v-for="(item, index) in pageList.list" :key="index">
|
||||
<view class="c-layout">
|
||||
<view
|
||||
><checkbox
|
||||
value="cb"
|
||||
:color="'#00D2E3'"
|
||||
:checked="state.checkMap[(item.id as number)]"
|
||||
style="transform: scale(0.5)"
|
||||
/></view>
|
||||
<view class="inner-box">
|
||||
<view class="top-flex-box">
|
||||
<view>
|
||||
<page-view
|
||||
@loadList="
|
||||
(v) => {
|
||||
getList(v);
|
||||
}
|
||||
"
|
||||
:noMoreData="pageList.noMoreData"
|
||||
:list="pageList.list"
|
||||
:height="ScaleStatus.Paid === currentTab ? 160 : 240 "
|
||||
:isLoading="pageList.isLoading"
|
||||
>
|
||||
<block v-for="(item, index) in pageList.list" :key="index">
|
||||
<view class="c-layout">
|
||||
<view style="min-width: 20px;">
|
||||
<checkbox
|
||||
v-if="
|
||||
ScaleStatus.ToBeReview === currentTab ||
|
||||
ScaleStatus.ToBePay === currentTab
|
||||
"
|
||||
value="cb"
|
||||
:color="'#00D2E3'"
|
||||
:checked="item.isChecked"
|
||||
style="transform: scale(0.5)"
|
||||
@click="item.isChecked = !item.isChecked"
|
||||
/></view>
|
||||
<view class="inner-box">
|
||||
<view class="top-flex-box">
|
||||
<view>
|
||||
<text class="number">收货单号:{{ item.receiptNumber }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="name">{{ item.userName }}</text>
|
||||
<view>
|
||||
<text class="number">收货单号:{{ item.receiptNumber }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="name">{{ item.userName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom-flex-box">
|
||||
<view>
|
||||
<view class="bottom-flex-box">
|
||||
<view>
|
||||
<text class="desc"
|
||||
>过磅总净重:{{ item.netWeight || 0 }}KG</text
|
||||
>
|
||||
<view>
|
||||
<text class="desc"
|
||||
>过磅总净重:{{ item.netWeight || 0 }}KG</text
|
||||
>
|
||||
</view>
|
||||
<view class="flex-box">
|
||||
<text>货款金额:{{ item.balanceTotalPrice || 0 }}元</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-box">
|
||||
<text>货款金额:{{ item.totalPrice || 0 }}元</text>
|
||||
<view>
|
||||
<text class="btn">
|
||||
<text
|
||||
v-if="currentTab === 2"
|
||||
@click="handleReview(item.id as number, 2, '去审核')"
|
||||
>去审核</text
|
||||
>
|
||||
<text
|
||||
v-if="currentTab === 3"
|
||||
@click="handleReview(item.id as number, 3, '去支付')"
|
||||
>去支付</text
|
||||
>
|
||||
<text
|
||||
v-if="currentTab === 4"
|
||||
@click="handleReview(item.id as number, 4, '查看详情')"
|
||||
>查看</text
|
||||
>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<text class="btn">
|
||||
<text
|
||||
v-if="currentTab === 2"
|
||||
@click="handleReview(item.id as number, 2)"
|
||||
>去审核</text
|
||||
>
|
||||
<text v-if="currentTab === 3" @click="handleReview(item.id as number, 3)">去支付</text>
|
||||
<text v-if="currentTab === 4" @click="handleReview(item.id as number, 4)">查看</text>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-gap
|
||||
height="10"
|
||||
bgColor="#f8f8f8"
|
||||
v-if="index < pageList.list.length - 1"
|
||||
></u-gap>
|
||||
</block>
|
||||
<u-gap
|
||||
height="10"
|
||||
bgColor="#f8f8f8"
|
||||
v-if="index < pageList.list.length - 1"
|
||||
></u-gap>
|
||||
</block>
|
||||
</page-view>
|
||||
</view>
|
||||
<view class="btn-box" v-if="(currentTab === 2 || currentTab === 3) && pageList.list.length > 0">
|
||||
<view
|
||||
class="btn-box"
|
||||
v-if="(currentTab === 2 || currentTab === 3) && pageList.list.length > 0"
|
||||
>
|
||||
<u-button
|
||||
text="全选/取消"
|
||||
color="#fff"
|
||||
:customStyle="{ color: '#00DCEE', border: '1px solid #00DCEE' }"
|
||||
@click="handleSelect"
|
||||
></u-button>
|
||||
<u-button type="primary" :text="`${currentTab === 2 ? '批量审核' : '批量支付'}`"></u-button>
|
||||
<u-button
|
||||
type="primary"
|
||||
:text="`${currentTab === 2 ? '批量审核' : '批量支付'}`"
|
||||
@click="handleReviewOrPay(currentTab)"
|
||||
></u-button>
|
||||
</view>
|
||||
</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";
|
||||
// scaleStatus
|
||||
interface PageResult<T> {
|
||||
total: number;
|
||||
list: T[];
|
||||
pageNum: number;
|
||||
pageSize: number;
|
||||
}
|
||||
const pageList: PageResult<Order> = reactive({
|
||||
isLoading: false,
|
||||
noMoreData: false,
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const keyword = ref();
|
||||
const keyword = ref('');
|
||||
const isShowSearch = ref(false);
|
||||
const state = reactive<{
|
||||
[attrName: string]: any;
|
||||
}>({
|
||||
checkMap: {},
|
||||
isAll: false,
|
||||
});
|
||||
const tabList = reactive([
|
||||
|
@ -128,40 +158,96 @@ const tabList = reactive([
|
|||
key: 4,
|
||||
},
|
||||
]);
|
||||
|
||||
const resetPageList = () => {
|
||||
pageList.noMoreData = false;
|
||||
pageList.total = 0;
|
||||
pageList.list = [];
|
||||
pageList.pageNum = 1;
|
||||
pageList.pageSize = 10;
|
||||
};
|
||||
const currentTab = ref(2);
|
||||
const handleTab = (item: any) => {
|
||||
currentTab.value = item.key;
|
||||
getOrderList();
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
const handleReview = (id: number, scaleStatus: number) => {
|
||||
|
||||
const handleSearch = () => {
|
||||
resetPageList();
|
||||
getList();
|
||||
}
|
||||
const handleReview = (id: number, scaleStatus: number, title: string) => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesReceive/review/index?id=" + id + `&scaleStatus=`+ scaleStatus, // 要跳转到的页面路径
|
||||
url:
|
||||
"/pagesReceive/review/index?id=" +
|
||||
id +
|
||||
`&scaleStatus=` +
|
||||
scaleStatus +
|
||||
`&title=${title}`, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const handleReviewOrPay = (status: number) => {
|
||||
// 批量审核
|
||||
if (ScaleStatus.ToBeReview === status) {
|
||||
updateStatus(ScaleStatus.ToBePay);
|
||||
} else if (ScaleStatus.ToBePay === status) {
|
||||
// 批量支付
|
||||
updateStatus(ScaleStatus.Paid);
|
||||
}
|
||||
};
|
||||
const updateStatus = (status: number) => {
|
||||
const list = pageList.list
|
||||
.filter((item) => item.isChecked)
|
||||
.map((item) => {
|
||||
return { ...item, scaleStatus: status };
|
||||
});
|
||||
ReceiveApi.updateOrderIn({ orderInPos: list }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
resetPageList();
|
||||
getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
const handleSelect = () => {
|
||||
state.isAll = !state.isAll;
|
||||
Object.keys(state.checkMap).forEach((item) => {
|
||||
state.checkMap[item] = state.isAll;
|
||||
console.log(state.isAll);
|
||||
pageList.list = pageList.list.map((item) => {
|
||||
return { ...item, isChecked: state.isAll };
|
||||
});
|
||||
};
|
||||
const getOrderList = () => {
|
||||
ReceiveApi.getOrderPage({ pageNumber: 1, pageSize: 10, scaleStatus: currentTab.value }).then(
|
||||
(res) => {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = res.data.list;
|
||||
(res.data.list as any).forEach((item: any) => {
|
||||
state.checkMap[parseInt(item.id)] = false;
|
||||
});
|
||||
}
|
||||
|
||||
const getList = (v?: boolean) => {
|
||||
if (v) {
|
||||
if (Math.ceil(pageList.total / pageList.pageSize) > pageList.pageNum) {
|
||||
pageList.pageNum++;
|
||||
} else {
|
||||
pageList.noMoreData = true;
|
||||
return;
|
||||
}
|
||||
);
|
||||
}
|
||||
pageList.isLoading = true;
|
||||
ReceiveApi.getOrderPage({
|
||||
pageSize: pageList.pageSize,
|
||||
pageNumber: pageList.pageNum,
|
||||
scaleStatus: currentTab.value,
|
||||
userName: keyword.value
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = (res.data.list as any).map((item: any) => {
|
||||
return { ...item, isChecked: false };
|
||||
});
|
||||
pageList.total = (res.data as any).total;
|
||||
pageList.isLoading = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
getOrderList();
|
||||
getList();
|
||||
});
|
||||
onLoad((option) => {
|
||||
currentTab.value = parseInt((option as any).scaleStatus);
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.search {
|
||||
|
|
|
@ -1,44 +1,64 @@
|
|||
<template>
|
||||
<view class="card-box" v-for="(item, index) in pageList.list" :key="index">
|
||||
<view class="top-flex-box">
|
||||
<view>
|
||||
<page-view
|
||||
@loadList="
|
||||
(v) => {
|
||||
getList(v);
|
||||
}
|
||||
"
|
||||
:noMoreData="pageList.noMoreData"
|
||||
:list="pageList.list"
|
||||
:height="0"
|
||||
:isLoading="pageList.isLoading"
|
||||
>
|
||||
<view class="card-box" v-for="(item, index) in pageList.list" :key="index">
|
||||
<view class="top-flex-box">
|
||||
<view>
|
||||
<text class="address">{{ item.deviceName || "-" }}</text>
|
||||
<view>
|
||||
<text class="address">{{ item.deviceName || "-" }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="number"
|
||||
>收货单号:{{ item.receiptNumber }}</text
|
||||
>
|
||||
</view>
|
||||
<view>
|
||||
<text class="name">{{ item.userName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<text class="number">收货单号:{{ item.receiptNumber }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="name">{{ item.userName }}</text>
|
||||
<u-button
|
||||
:customStyle="{ border: '1px solid #00dcee', color: '#00dcee' }"
|
||||
@click="handleScenePhoto(item.id as number)"
|
||||
text="现场照片"
|
||||
plain
|
||||
shape="circle"
|
||||
type="success"
|
||||
size="small"
|
||||
></u-button>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<text class="btn" @click="handleScenePhoto((item.imagesId as number))"
|
||||
>现场照片</text
|
||||
>
|
||||
<text class="desc">过毛时间:{{ item.grossTime }}</text>
|
||||
</view>
|
||||
<view class="flex-box">
|
||||
<text>毛重:{{ item.grossWeight }}kg</text>
|
||||
<text>单价:{{ state.scaleStatus === 0 ? '未定价' : item.price + '元/KG'}}</text>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<u-button
|
||||
text="点击作废"
|
||||
color="#E8E8E8"
|
||||
:customStyle="{ color: '#999' }"
|
||||
@click="handleModal(true, item.id as number)"
|
||||
></u-button>
|
||||
<u-button
|
||||
type="primary"
|
||||
:text="state.scaleStatus === 0 ? '点击定价' : '点击编辑'"
|
||||
@click="pricingDetail(item.id as number)"
|
||||
></u-button>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<text class="desc">过毛时间:{{ item.grossTime }}</text>
|
||||
</view>
|
||||
<view class="flex-box">
|
||||
<text>毛重:{{ item.grossWeight }}kg</text>
|
||||
<text>单价:未定价</text>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<u-button
|
||||
text="点击作废"
|
||||
color="#E8E8E8"
|
||||
:customStyle="{ color: '#999' }"
|
||||
@click="handleModal(true, (item.id as number))"
|
||||
></u-button>
|
||||
<u-button
|
||||
type="primary"
|
||||
text="点击定价"
|
||||
@click="pricingDetail((item.id as number))"
|
||||
></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</page-view>
|
||||
|
||||
<SmallModal
|
||||
:title="'确认作废吗?'"
|
||||
|
@ -53,13 +73,21 @@
|
|||
<script setup lang="ts">
|
||||
import { ReceiveApi } from "@/services/index";
|
||||
import SmallModal from "@/components/Modal/smallModal.vue";
|
||||
import PageView from "@/components/PageView/index.vue";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { ScaleStatus } from "@/utils/enum";
|
||||
|
||||
const pageList: PageResult<Order> = reactive({
|
||||
isLoading: false,
|
||||
noMoreData: false,
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const state = reactive({
|
||||
scaleStatus: 0
|
||||
})
|
||||
const isShowCancelModal = ref(false);
|
||||
const deleteId = ref(0);
|
||||
const handleModal = (v: boolean, id: number) => {
|
||||
|
@ -67,33 +95,67 @@ const handleModal = (v: boolean, id: number) => {
|
|||
deleteId.value = id;
|
||||
};
|
||||
const handleScenePhoto = (imagesId: number) => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesScenePhoto/index?orderType=1&id=" + imagesId, // 要跳转到的页面路径
|
||||
uni.redirectTo({
|
||||
url: `/pagesScenePhoto/index?orderType=1&id=${imagesId}&imagesType=1`, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const pricingDetail = (id: number) => {
|
||||
uni.navigateTo({
|
||||
uni.redirectTo({
|
||||
url: "/pagesReceive/form/pricingForm?id=" + id, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const getOrderList = () => {
|
||||
ReceiveApi.getOrderPage({ pageNumber: 1, pageSize: 10, scaleStatus: 0 }).then((res) => {
|
||||
|
||||
const getList = (v?: boolean) => {
|
||||
if (v) {
|
||||
if (Math.ceil(pageList.total / pageList.pageSize) > pageList.pageNum) {
|
||||
pageList.pageNum++;
|
||||
} else {
|
||||
pageList.noMoreData = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
let params: any = {
|
||||
pageSize: pageList.pageSize,
|
||||
pageNumber: pageList.pageNum,
|
||||
scaleStatus: state.scaleStatus,
|
||||
};
|
||||
pageList.isLoading = true;
|
||||
ReceiveApi.getOrderPage(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = res.data.list;
|
||||
pageList.isLoading = false;
|
||||
(pageList as any).list = (pageList as any).list = (
|
||||
pageList as any
|
||||
).list.concat(res.data.list);
|
||||
pageList.total = (res.data as any).total;
|
||||
}
|
||||
});
|
||||
};
|
||||
const handleOk = () => {
|
||||
console.log(deleteId.value);
|
||||
ReceiveApi.deleteOrder({ids:[deleteId.value]}).then((res) => {
|
||||
ReceiveApi.deleteOrder({ ids: [deleteId.value] }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
getOrderList();
|
||||
getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getOrderList();
|
||||
getList();
|
||||
});
|
||||
|
||||
onLoad((option) => {
|
||||
// 接收传递的标题参数
|
||||
state.scaleStatus = parseInt((option as any).scaleStatus);
|
||||
// 设置页面标题
|
||||
if (state.scaleStatus === ScaleStatus.ToBePriced) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '待定价',
|
||||
});
|
||||
} else if (state.scaleStatus === ScaleStatus.ToBeTare) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '待过皮重',
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
plain
|
||||
shape="circle"
|
||||
:bgColor="'rgba(237, 254, 255, 1)'"
|
||||
@click="handleScenePhoto(state.order.imagesId as number)"
|
||||
@click="handleScenePhoto(state.order.id)"
|
||||
></u-tag
|
||||
></view>
|
||||
<view
|
||||
|
@ -43,13 +43,17 @@
|
|||
></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-box" v-if="state.order.scaleStatus === 2">
|
||||
<view
|
||||
class="flex-box"
|
||||
v-if="state.order.scaleStatus === ScaleStatus.ToBeReview"
|
||||
>
|
||||
<text>定价人:{{ state.order.pricingUserName || "-" }}</text>
|
||||
<text>创建时间:{{ state.order.createTime }}</text>
|
||||
<text>过磅时间:{{ state.order.grossTime }}</text>
|
||||
</view>
|
||||
<!-- 入库 过磅时间对应过毛时间 -->
|
||||
<view class="flex-box" v-if="getIsShow()" style="border: none">
|
||||
<text>过磅时间:{{ state.order.grossTime || "-" }}</text>
|
||||
<!-- {{ state.order.createTime }} -->
|
||||
</view>
|
||||
<view class="flex-box" v-if="getIsShow()">
|
||||
<text>定价人:{{ state.order.pricingUserName || "-" }}</text>
|
||||
|
@ -61,10 +65,24 @@
|
|||
<view v-if="getIsShow()"></view>
|
||||
<view v-for="(item, index) in gridList1" :key="index">
|
||||
<text v-if="item.name">{{ item.name }}:</text
|
||||
><text
|
||||
>{{ item.isBefore ? item.unit : "" }}
|
||||
><text>
|
||||
{{ item.isBefore ? item.unit : "" }}
|
||||
{{ item.num }}
|
||||
{{ item.isBefore ? "" : item.unit }}
|
||||
<text
|
||||
v-if="item.name === '货款金额' && ScaleStatus.ToBeReview === state.order.scaleStatus"
|
||||
@click="handleEdit()"
|
||||
:style="{
|
||||
color: 'rgba(0, 220, 238, 1)',
|
||||
border: '1px solid #00DCEE',
|
||||
'border-radius': '20rpx',
|
||||
fontSize: '12px',
|
||||
padding: '1px 10px',
|
||||
marginLeft: '10rpx'
|
||||
}"
|
||||
>
|
||||
编辑
|
||||
</text>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -123,11 +141,27 @@
|
|||
@handleModal="(v:boolean) => {handleModal(v, deleteId)}"
|
||||
@handleOk="handleOk()"
|
||||
/>
|
||||
<u-modal
|
||||
showCancelButton
|
||||
:confirmColor="'#00D2E3'"
|
||||
:show="isInput"
|
||||
:title="'修改货款金额'"
|
||||
@confirm="handleConfirm"
|
||||
@cancel="isInput = false"
|
||||
>
|
||||
<up-input
|
||||
placeholder="请输入货款金额"
|
||||
type="number"
|
||||
v-model="amount"
|
||||
></up-input>
|
||||
</u-modal>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ReceiveApi } from "@/services/index";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import SmallModal from "@/components/Modal/smallModal.vue";
|
||||
import { ScaleStatus } from "@/utils/enum";
|
||||
const keyword = ref("");
|
||||
const contrlModalParams = reactive<{ [attrName: string]: any }>({
|
||||
paySelect: {
|
||||
|
@ -236,7 +270,7 @@ const gridList1 = reactive([
|
|||
isBefore: false,
|
||||
},
|
||||
{
|
||||
name: "货款总价",
|
||||
name: "货款金额",
|
||||
enName: "balanceTotalPrice",
|
||||
num: "",
|
||||
unit: "元",
|
||||
|
@ -246,21 +280,42 @@ const gridList1 = reactive([
|
|||
const getIsShow = () => {
|
||||
return state.order.scaleStatus === 3 || state.order.scaleStatus === 4;
|
||||
};
|
||||
const handleScenePhoto = (imagesId: number) => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesScenePhoto/index?orderType=1&id=" + imagesId, // 要跳转到的页面路径
|
||||
const handleScenePhoto = (id: any) => {
|
||||
uni.redirectTo({
|
||||
url: "/pagesScenePhoto/index?orderType=1&imagesType=1&id=" + id, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
// 审核暂不支付 // 更新状态为3
|
||||
const handleReviewNoPay = () => {
|
||||
ReceiveApi.updateOne({ ...state.order, scaleStatus: 3 }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.navigateTo({
|
||||
uni.redirectTo({
|
||||
url: "/pagesReceive/payReview?scaleStatus=3", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
const isInput = ref(false);
|
||||
const amount = ref(null);
|
||||
const handleEdit = () => {
|
||||
isInput.value = true;
|
||||
};
|
||||
const handleConfirm = () => {
|
||||
ReceiveApi.updateOrderIn({
|
||||
orderInPos: [
|
||||
{
|
||||
...state.order,
|
||||
balanceTotalPrice: amount.value,
|
||||
},
|
||||
],
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({ title: "修改成功" });
|
||||
gridList1[gridList1.length - 1].num = amount.value || "";
|
||||
isInput.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
// 审核立即支付
|
||||
const handleReviewPay = () => {
|
||||
contrlModalParams.paySelect.isShow = true;
|
||||
|
@ -280,7 +335,7 @@ const handleSelect = (key: string, v: any) => {
|
|||
title: "支付成功",
|
||||
icon: "success",
|
||||
});
|
||||
uni.navigateTo({
|
||||
uni.redirectTo({
|
||||
url: "/pagesReceive/payReview?scaleStatus=4", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
|
@ -299,7 +354,7 @@ const handleModal = (v: boolean, id: number) => {
|
|||
const handleOk = () => {
|
||||
ReceiveApi.deleteOrder({ ids: [deleteId.value] }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.navigateTo({
|
||||
uni.redirectTo({
|
||||
url: "/pagesReceive/payReview?scaleStatus=2", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
|
@ -307,15 +362,15 @@ const handleOk = () => {
|
|||
};
|
||||
const handleUpdateOrder = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesReceive/form/pricingForm?id=" + state.order.id, // 要跳转到的页面路径
|
||||
url: "/pagesReceive/form/pricingForm?prePage=review&id=" + state.order.id, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
// 重新过皮
|
||||
const handleReWeight = () => {
|
||||
ReceiveApi.reTare({ id: state.order.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.navigateTo({
|
||||
url: "/pagesReceive/tareing", // 要跳转到的页面路径
|
||||
uni.redirectTo({
|
||||
url: "/pagesReceive/pricing?scaleStatus=1", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -323,6 +378,9 @@ const handleReWeight = () => {
|
|||
onLoad((option) => {
|
||||
state.order.id = parseInt((option as any).id);
|
||||
state.scaleStatus = parseInt((option as any).scaleStatus);
|
||||
uni.setNavigationBarTitle({
|
||||
title: (option as any).title,
|
||||
});
|
||||
if (state.order.id) {
|
||||
ReceiveApi.getDetailById({ id: state.order.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
|
|
|
@ -1,166 +0,0 @@
|
|||
<template>
|
||||
<view class="card-box" v-for="(item, index) in pageList.list" :key="index">
|
||||
<view class="top-flex-box">
|
||||
<view>
|
||||
<view>
|
||||
<text class="address">{{ item.deviceName || "-" }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="number">收货单号:{{ item.receiptNumber }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="name">{{ item.userName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<text class="btn" @click="handleScenePhoto((item.imagesId as number))"
|
||||
>现场照片</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<text class="desc">过毛时间:{{ item.grossTime }}</text>
|
||||
</view>
|
||||
<view class="flex-box">
|
||||
<text>毛重:{{ item.grossWeight }}KG</text>
|
||||
<text>单价:{{ item.price }} 元/KG</text>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<u-button
|
||||
text="点击作废"
|
||||
color="#E8E8E8"
|
||||
:customStyle="{ color: '#999' }"
|
||||
@click="handleModal(true, (item.id as number))"
|
||||
></u-button>
|
||||
<u-button
|
||||
type="primary"
|
||||
text="点击编辑"
|
||||
@click="pricingDetail((item.id as number))"
|
||||
></u-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<SmallModal
|
||||
:title="'确认作废吗?'"
|
||||
:content="'确认作废后,该订单不能恢复!'"
|
||||
:okText="'确认作废'"
|
||||
:isMain="true"
|
||||
:show="isShowCancelModal"
|
||||
@handleModal="(v:boolean) => {handleModal(v, deleteId)}"
|
||||
@handleOk="handleOk()"
|
||||
/>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ReceiveApi } from "@/services/index";
|
||||
import SmallModal from "@/components/Modal/smallModal.vue";
|
||||
|
||||
interface PageResult<T> {
|
||||
total: number;
|
||||
list: T[];
|
||||
pageNum: number;
|
||||
pageSize: number;
|
||||
}
|
||||
const pageList: PageResult<Order> = reactive({
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const isShowCancelModal = ref(false);
|
||||
const deleteId = ref(0);
|
||||
const handleModal = (v: boolean, id: number) => {
|
||||
isShowCancelModal.value = v;
|
||||
deleteId.value = id;
|
||||
};
|
||||
const handleScenePhoto = (imagesId: number) => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesScenePhoto/index?orderType=1&id=" + imagesId, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const pricingDetail = (id: number) => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesReceive/form/pricingForm?id=" + id, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const getOrderList = () => {
|
||||
ReceiveApi.getOrderPage({ pageNumber: 1, pageSize: 10, scaleStatus: 1 }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = res.data.list;
|
||||
}
|
||||
});
|
||||
};
|
||||
const handleOk = () => {
|
||||
console.log(deleteId.value);
|
||||
ReceiveApi.deleteOrder([deleteId.value]).then((res) => {
|
||||
if (res.code === 200) {
|
||||
getOrderList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getOrderList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.card-box {
|
||||
padding: 38rpx 50rpx;
|
||||
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 0rpx 25rpx;
|
||||
margin-top: 35rpx;
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #000000;
|
||||
line-height: 41rpx;
|
||||
.top-flex-box {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.btn {
|
||||
border-radius: 24rpx;
|
||||
border: 1px solid #00dcee;
|
||||
padding: 10rpx 30rpx;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #00dcee;
|
||||
line-height: 41rpx;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.address {
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
.desc {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
margin-top: 30rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
.name {
|
||||
font-size: 26rpx;
|
||||
color: #000000;
|
||||
font-weight: bold;
|
||||
}
|
||||
.flex-box {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #000000;
|
||||
line-height: 41rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.btn-box {
|
||||
margin-top: 60rpx;
|
||||
display: flex;
|
||||
::v-deep button {
|
||||
border-radius: 43rpx;
|
||||
}
|
||||
::v-deep button + button {
|
||||
margin-left: 50rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -17,12 +17,16 @@
|
|||
</view>
|
||||
</up-col>
|
||||
</up-row>
|
||||
<view v-if="list.length === 0" style="justify-content: center">
|
||||
<u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
|
||||
</u-empty>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { PictureApi } from "@/services/index";
|
||||
import {ImagesType} from '@/utils/enum'
|
||||
import { ImagesType } from "@/utils/enum";
|
||||
let list: any = ref([]);
|
||||
const getType = (v: number) => {
|
||||
if (v === ImagesType.Tare) {
|
||||
|
@ -38,7 +42,7 @@ onLoad((option: any) => {
|
|||
PictureApi.getAnnex({
|
||||
businessId: option.id,
|
||||
orderType: parseInt(option.orderType),
|
||||
imagesType: ImagesType.Tare,
|
||||
imagesType: option.imagesType,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
list.value = res.data;
|
||||
|
@ -81,7 +85,7 @@ onLoad((option: any) => {
|
|||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #ffffff;
|
||||
padding: 10rpx 20rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
position: absolute;
|
||||
top: 30rpx;
|
||||
left: 9rpx;
|
||||
|
|
|
@ -7,14 +7,16 @@
|
|||
ref="form"
|
||||
:labelWidth="80"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
:errorType="'border-bottom'"
|
||||
>
|
||||
<block v-for="(item, index) in formAttrList" :key="index">
|
||||
<u-form-item
|
||||
:prop="`order[${item.key}]`"
|
||||
:prop="`order.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
@click="item.fn"
|
||||
v-if="item.key !== 'paymentMethodName'"
|
||||
:borderBottom="false"
|
||||
>
|
||||
<u-textarea
|
||||
v-if="item.type === 'textarea'"
|
||||
|
@ -30,6 +32,7 @@
|
|||
:clearable="true"
|
||||
:customStyle="{}"
|
||||
border="none"
|
||||
:disabled="item.disabled"
|
||||
>
|
||||
<template #suffix>
|
||||
<text v-if="item.key === 'subtractNum'">
|
||||
|
@ -42,13 +45,14 @@
|
|||
</u-input>
|
||||
<uni-file-picker
|
||||
v-if="item.type === 'upload'"
|
||||
v-model="model1.order.fileList"
|
||||
limit="10"
|
||||
title="最多可上传10张图片"
|
||||
v-model="model1.order.fileLists"
|
||||
limit="9"
|
||||
title="最多可上传9张图片"
|
||||
:auto-upload="false"
|
||||
fileMediatype="image"
|
||||
mode="grid"
|
||||
ref="filesShipmentRef"
|
||||
ref="filesRef"
|
||||
@delete="handleDelete"
|
||||
></uni-file-picker>
|
||||
|
||||
<u-radio-group
|
||||
|
@ -134,29 +138,66 @@ import {
|
|||
} from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
const model1 = reactive<{
|
||||
scaleStatusBtnType: number,
|
||||
order: Shipment
|
||||
scaleStatusBtnType: number;
|
||||
order: Shipment;
|
||||
}>({
|
||||
scaleStatusBtnType: 2,
|
||||
order: {
|
||||
id: '',
|
||||
id: "",
|
||||
splTime: "",
|
||||
takeType: 1,
|
||||
fileList: [],
|
||||
fileLists: [],
|
||||
buttonType: 0,
|
||||
deliveryMethod: 0,
|
||||
settlementGross: 0,
|
||||
settlementTare: 0,
|
||||
settlementWeight: 0,
|
||||
unitPrice: 0,
|
||||
estimatePrice: 0,
|
||||
subtractNum: 0,
|
||||
},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
type: "string",
|
||||
const rules = reactive({
|
||||
"order.settlementGross": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
message: "请输入结算毛重",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
type: "string",
|
||||
"order.settlementTare": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
message: "请输入结算皮重",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"order.settlementNet": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请输入过磅净重",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"order.unitPrice": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请输入结算单价",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"order.settlementWeight": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请输入结算重量",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"order.estimatePrice": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请输入预估总价",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"order.totalPrice": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请输入结算金额",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
|
@ -207,6 +248,7 @@ const formAttrList = reactive<ComType>([
|
|||
key: "settlementNet",
|
||||
type: "input",
|
||||
required: true,
|
||||
disabled: true,
|
||||
unit: "kg",
|
||||
fn: () => {},
|
||||
},
|
||||
|
@ -251,12 +293,14 @@ const formAttrList = reactive<ComType>([
|
|||
key: "settlementWeight",
|
||||
type: "input",
|
||||
required: true,
|
||||
disabled: true,
|
||||
unit: "KG",
|
||||
},
|
||||
{
|
||||
name: "预估总价",
|
||||
key: "estimatePrice",
|
||||
required: true,
|
||||
disabled: true,
|
||||
type: "input",
|
||||
unit: "元",
|
||||
},
|
||||
|
@ -300,6 +344,7 @@ const formAttrList = reactive<ComType>([
|
|||
key: "realIncome",
|
||||
type: "input",
|
||||
unit: "元",
|
||||
disabled: true,
|
||||
},
|
||||
{
|
||||
name: "结算方式",
|
||||
|
@ -324,25 +369,74 @@ const formAttrList = reactive<ComType>([
|
|||
type: "upload",
|
||||
},
|
||||
]);
|
||||
const filesShipmentRef = ref();
|
||||
|
||||
// 监听毛重 皮重
|
||||
watch(
|
||||
[
|
||||
() => model1.order.settlementGross,
|
||||
() => model1.order.settlementTare,
|
||||
() => model1.order.unitPrice,
|
||||
() => model1.order.subtractNum,
|
||||
() => model1.order.buttonType,
|
||||
() => model1.order.freight,
|
||||
() => model1.order.incidentals,
|
||||
() => model1.order.totalPrice
|
||||
|
||||
],
|
||||
([settlementGrossNew, settlementTareNew]) => {
|
||||
/**
|
||||
* 过磅净重: 毛重-皮重
|
||||
结算重量: 过磅净重-扣杂
|
||||
预估总价: 结算单价*结算重量
|
||||
实际收入:实际结算金额-运费-杂费
|
||||
*/
|
||||
model1.order.settlementNet = (settlementGrossNew || 0) - (settlementTareNew || 0);
|
||||
if (model1.order.buttonType === 0) {
|
||||
if (model1.order.subtractNum) {
|
||||
model1.order.settlementWeight =
|
||||
model1.order.settlementNet - model1.order.subtractNum;
|
||||
} else {
|
||||
model1.order.settlementWeight = model1.order.settlementNet;
|
||||
}
|
||||
} else if (model1.order.buttonType === 1) {
|
||||
if (model1.order.subtractNum) {
|
||||
model1.order.settlementWeight =
|
||||
model1.order.settlementNet * ((100 - model1.order.subtractNum)/100);
|
||||
} else {
|
||||
model1.order.settlementWeight = model1.order.settlementNet;
|
||||
}
|
||||
}
|
||||
model1.order.estimatePrice =
|
||||
(model1.order.unitPrice || 0) * (model1.order.settlementWeight || 0);
|
||||
model1.order.realIncome = (model1.order.totalPrice || 0) - (model1.order.freight || 0) - (model1.order.incidentals || 0)
|
||||
}
|
||||
);
|
||||
|
||||
const filesRef = ref();
|
||||
const handleUpload = () => {
|
||||
// console.log(event.tempFilePaths)
|
||||
const list = filesShipmentRef.value[0].filesList;
|
||||
return list.map((item: any) => {
|
||||
return filesRef.value[0].filesList.map((item: any, index: number) => {
|
||||
if (item.fileID) {
|
||||
return;
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
PictureApi.upload({
|
||||
files: item,
|
||||
path: item.path,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
resolve({
|
||||
...(res.data as any),
|
||||
businessId: model1.order.id,
|
||||
imagesType: ImagesType.Settlement, // 单据资源
|
||||
orderType: OrderType.Shipment, // 出库单
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
resolve({
|
||||
...(res.data as any),
|
||||
businessId: model1.order.id,
|
||||
imagesType: ImagesType.Settlement, // 单据资源
|
||||
orderType: OrderType.Shipment, // 出库单
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
return;
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -351,29 +445,65 @@ const handleSelect = (key: string, v: any) => {
|
|||
contrlModalParams[key].isShow = false;
|
||||
if (key === "select") {
|
||||
model1.order.paymentMethodName = v.name;
|
||||
model1.order.paymentMethod = v.id;
|
||||
model1.order.paymentMethod = v.key;
|
||||
}
|
||||
};
|
||||
|
||||
const handleDelete = (e: any) => {
|
||||
if (e.tempFile.fileID) {
|
||||
PictureApi.deleteById({ id: e.tempFile.fileID }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({ title: "已删除" });
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 校验
|
||||
*/
|
||||
const form = ref();
|
||||
const check = () => {
|
||||
return new Promise((resolve) => {
|
||||
form.value
|
||||
.validate()
|
||||
.then((res: boolean) => {
|
||||
resolve(res);
|
||||
})
|
||||
.catch((errors: any) => {
|
||||
resolve(false);
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: errors[0].message || "校验失败",
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 点击保存 先执行upload接口
|
||||
* 上传成功后 保存图片资源 和更新订单数据
|
||||
*/
|
||||
const save = () => {
|
||||
check().then((res) => {
|
||||
if (res) {
|
||||
startSave();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const startSave = () => {
|
||||
Promise.all(handleUpload()).then((res) => {
|
||||
// 上传多个资源
|
||||
if (res.length > 0) {
|
||||
PictureApi.addListAnnex({ annexPos: res }).then((res1) => {
|
||||
if (res1.code === 200) {
|
||||
uni.showToast({
|
||||
title: "图片资源上传成功",
|
||||
icon: "success",
|
||||
});
|
||||
console.log("*** 资源文件更新成功");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
updateOrder();
|
||||
};
|
||||
|
||||
const updateOrder = () => {
|
||||
// 根据不同按钮点击到form 状态不同
|
||||
let scaleStatus = ref(0);
|
||||
if (model1.scaleStatusBtnType === ScaleStatusBtnType.ShipmentNoPay) {
|
||||
|
@ -382,7 +512,7 @@ const save = () => {
|
|||
if (model1.scaleStatusBtnType === ScaleStatusBtnType.ShipmentPay) {
|
||||
scaleStatus.value = ScaleStatus.ShipmentPaid;
|
||||
}
|
||||
model1.order.signTime = formatDate(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
|
||||
model1.order.signTime = formatDate(new Date(), "{y}-{m}-{d} {h}:{i}:{s}");
|
||||
// 更新出货单
|
||||
ShipmentApi.updateOrderIn({
|
||||
orderOutPos: [{ ...model1.order, scaleStatus: scaleStatus.value }],
|
||||
|
@ -392,7 +522,7 @@ const save = () => {
|
|||
title: "编辑成功",
|
||||
icon: "success",
|
||||
});
|
||||
uni.navigateTo({
|
||||
uni.redirectTo({
|
||||
url:
|
||||
"/pagesShipment/review/index?id=" +
|
||||
model1.order.id +
|
||||
|
@ -408,8 +538,15 @@ onLoad((option) => {
|
|||
if (model1.order.id) {
|
||||
ShipmentApi.getDetailById({ id: model1.order.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
model1.order = { ...res.data };
|
||||
console.log(model1.order);
|
||||
model1.order = {
|
||||
...res.data,
|
||||
buttonType: res.data.buttonType !== null ? res.data.buttonType : 0,
|
||||
deliveryMethod:
|
||||
res.data.deliveryMethod !== null ? res.data.deliveryMethod : 0,
|
||||
fileLists: model1.order.fileLists.map((item: any) => {
|
||||
return { ...item, fileID: item.id };
|
||||
}),
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -419,6 +556,7 @@ onLoad((option) => {
|
|||
imagesType: ImagesType.Settlement,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
model1.order.fileLists = res.data;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -430,7 +568,7 @@ onLoad((option) => {
|
|||
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 30rpx 25rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
::v-deep .u-form-item {
|
||||
height: auto;
|
||||
}
|
||||
|
|
|
@ -7,14 +7,16 @@
|
|||
ref="form"
|
||||
:labelWidth="80"
|
||||
:labelStyle="{ padding: '0rpx 10rpx' }"
|
||||
:errorType="'border-bottom'"
|
||||
>
|
||||
<u-form-item
|
||||
:prop="`order[${item.key}]`"
|
||||
:prop="`order.${item.key}`"
|
||||
:label="item.name"
|
||||
:required="item.required"
|
||||
v-for="(item, index) in formAttrList"
|
||||
:key="index"
|
||||
@click="item.fn"
|
||||
:borderBottom="false"
|
||||
>
|
||||
<u-textarea
|
||||
v-if="item.type === 'textarea'"
|
||||
|
@ -44,15 +46,17 @@
|
|||
multiple
|
||||
:maxCount="10"
|
||||
></u-upload> -->
|
||||
|
||||
<uni-file-picker
|
||||
v-if="item.type === 'upload'"
|
||||
v-model="model1.order.fileList"
|
||||
limit="10"
|
||||
title="最多可上传10张图片"
|
||||
v-model="model1.order.fileLists"
|
||||
:limit="9"
|
||||
title="最多可上传9张图片"
|
||||
:auto-upload="false"
|
||||
fileMediatype="image"
|
||||
mode="grid"
|
||||
ref="filesShipmentRef"
|
||||
ref="filesRef"
|
||||
@delete="handleDelete"
|
||||
></uni-file-picker>
|
||||
|
||||
<u-radio-group
|
||||
|
@ -69,80 +73,111 @@
|
|||
</template>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<u-action-sheet
|
||||
:actions="contrlModalParams.select.selectList"
|
||||
:title="contrlModalParams.select.title"
|
||||
:show="contrlModalParams.select.isShow"
|
||||
@select="contrlModalParams.select.isShow = false"
|
||||
@close="contrlModalParams.select.isShow = false"
|
||||
></u-action-sheet>
|
||||
<block v-for="(item, index) in formAttrList" :key="index">
|
||||
<u-action-sheet
|
||||
v-if="item.type === 'select'"
|
||||
:actions="contrlModalParams[item.childKey].list"
|
||||
:title="contrlModalParams[item.childKey].title"
|
||||
:show="contrlModalParams[item.childKey].isShow"
|
||||
@select="(v: any) => handleSelect(item.childKey, v)"
|
||||
@close="contrlModalParams[item.childKey].isShow = false"
|
||||
:closeOnClickAction="true"
|
||||
:safeAreaInsetBottom="true"
|
||||
></u-action-sheet>
|
||||
</block>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<u-button type="primary" text="保存" @click="save()"></u-button>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { PictureApi, ShipmentApi } from "@/services";
|
||||
import { CustomerApi, GoodsApi, PictureApi, ShipmentApi } from "@/services";
|
||||
import type { ComType } from "@/types/global";
|
||||
import { ImagesType, OrderType, ScaleStatus } from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import _ from "underscore";
|
||||
const model1 = reactive<any>({
|
||||
order: {
|
||||
id: 0,
|
||||
splTime: "",
|
||||
takeType: 1,
|
||||
fileList: [],
|
||||
fileLists: [],
|
||||
},
|
||||
});
|
||||
const rules = ref({
|
||||
"userInfo.userName": {
|
||||
const rules = reactive({
|
||||
"order.userName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入手机号",
|
||||
message: "请选择客户",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"userInfo.password": {
|
||||
"order.productName": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
message: "请选择出货产品名称",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"order.tare": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请输入皮重",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"order.number": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请输入数量",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"order.weighingMethod": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请选择称重方式",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
"order.deliveryMethod": {
|
||||
type: "number",
|
||||
required: true,
|
||||
message: "请选择提货方式",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
});
|
||||
const contrlModalParams = reactive({
|
||||
select: {
|
||||
const contrlModalParams = reactive<ComType>({
|
||||
userSelect: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
selectList: [
|
||||
{
|
||||
name: "选项一",
|
||||
},
|
||||
{
|
||||
name: "选项二",
|
||||
},
|
||||
],
|
||||
list: [],
|
||||
},
|
||||
productSelect: {
|
||||
isShow: false,
|
||||
title: "标题",
|
||||
list: [],
|
||||
},
|
||||
});
|
||||
|
||||
const formAttrList = reactive([
|
||||
const formAttrList = reactive<ComType>([
|
||||
{
|
||||
name: "客户",
|
||||
key: "userId",
|
||||
key: "userName",
|
||||
type: "select",
|
||||
required: true,
|
||||
childKey: "userSelect",
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams.select.isShow = true;
|
||||
contrlModalParams.select.title = "客户";
|
||||
contrlModalParams.userSelect.isShow = true;
|
||||
contrlModalParams.userSelect.title = "客户";
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "出货产品",
|
||||
key: "productId",
|
||||
key: "productName",
|
||||
type: "select",
|
||||
required: true,
|
||||
childKey: "productSelect",
|
||||
unit: "",
|
||||
fn: () => {
|
||||
contrlModalParams.select.isShow = true;
|
||||
contrlModalParams.select.title = "出货产品";
|
||||
contrlModalParams.productSelect.isShow = true;
|
||||
contrlModalParams.productSelect.title = "出货产品";
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -153,8 +188,8 @@ const formAttrList = reactive([
|
|||
unit: "件",
|
||||
},
|
||||
{
|
||||
name: "毛重",
|
||||
key: "grossWeight",
|
||||
name: "皮重",
|
||||
key: "tare",
|
||||
type: "input",
|
||||
required: true,
|
||||
unit: "KG",
|
||||
|
@ -208,91 +243,193 @@ const formAttrList = reactive([
|
|||
type: "upload",
|
||||
},
|
||||
]);
|
||||
const filesShipmentRef = ref();
|
||||
|
||||
CustomerApi.getCustomUserList({}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
contrlModalParams.userSelect.list = res.data;
|
||||
}
|
||||
});
|
||||
GoodsApi.getShipmentProductList().then((res) => {
|
||||
if (res.code === 200) {
|
||||
contrlModalParams.productSelect.list = _.map(
|
||||
res.data as any,
|
||||
function (item: any) {
|
||||
return { name: item.shmProductsName, ...item };
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
const handleSelect = (key: string, v: any) => {
|
||||
contrlModalParams[key].isShow = false;
|
||||
if (key === "userSelect") {
|
||||
model1.order.userName = v.name;
|
||||
model1.order.userId = v.id;
|
||||
} else if (key === "productSelect") {
|
||||
model1.order.productName = v.name;
|
||||
model1.order.productId = v.id;
|
||||
}
|
||||
};
|
||||
|
||||
const filesRef = ref();
|
||||
const handleUpload = () => {
|
||||
// console.log(event.tempFilePaths)
|
||||
const list = filesShipmentRef.value[0].filesList;
|
||||
return list.map((item: any) => {
|
||||
return filesRef.value[0].filesList.map((item: any, index: number) => {
|
||||
if (item.fileID) {
|
||||
return;
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
PictureApi.upload({
|
||||
files: item,
|
||||
path: item.path,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
resolve({
|
||||
...(res.data as any),
|
||||
businessId: model1.order.id,
|
||||
imagesType: ImagesType.NORMARL, // 普通资源
|
||||
orderType: OrderType.Shipment, // 入库单
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
resolve({
|
||||
...(res.data as any),
|
||||
businessId: model1.order.id,
|
||||
imagesType: ImagesType.NORMARL, // 普通资源
|
||||
orderType: OrderType.Shipment, // 入库单
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
return;
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const handleDelete = (e: any) => {
|
||||
console.log(model1.order.fileLists);
|
||||
if (e.tempFile.fileID) {
|
||||
PictureApi.deleteById({ id: e.tempFile.fileID }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({ title: "已删除" });
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 点击保存 先执行upload接口
|
||||
* 上传成功后 保存图片资源 和更新订单数据
|
||||
*/
|
||||
const form = ref();
|
||||
const check = () => {
|
||||
return new Promise((resolve) => {
|
||||
form.value
|
||||
.validate()
|
||||
.then((res: boolean) => {
|
||||
resolve(res);
|
||||
})
|
||||
.catch((errors: any) => {
|
||||
resolve(false);
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: errors[0].message || "校验失败",
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
const save = () => {
|
||||
check().then((res) => {
|
||||
if (res) {
|
||||
startSave();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const startSave = () => {
|
||||
Promise.all(handleUpload()).then((res) => {
|
||||
// 上传多个资源
|
||||
if (res.length > 0) {
|
||||
PictureApi.addListAnnex({ annexPos: res }).then((res1) => {
|
||||
if (res1.code === 200) {
|
||||
uni.showToast({
|
||||
title: "图片资源上传成功",
|
||||
icon: "success",
|
||||
});
|
||||
console.log("*** 资源文件更新成功");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
updateOrder();
|
||||
};
|
||||
|
||||
let scaleStatus = 0;
|
||||
if (ScaleStatus.ToBeShipment === model1.order.scaleStatus) {
|
||||
scaleStatus = ScaleStatus.ToBeGrossWeight;
|
||||
} else if (ScaleStatus.ToBeGrossWeight === model1.order.scaleStatus) {
|
||||
scaleStatus = ScaleStatus.ToBeShipmentReview;
|
||||
const updateOrder = () => {
|
||||
// 编辑更新状态值
|
||||
let status = 0;
|
||||
if (state.scaleStatus === ScaleStatus.ToBeShipment) {
|
||||
status = ScaleStatus.ToBeGrossWeight;
|
||||
} else if (state.scaleStatus === ScaleStatus.ToBeGrossWeight) {
|
||||
status = ScaleStatus.ToBeShipmentReview;
|
||||
} else {
|
||||
status = model1.order.status;
|
||||
}
|
||||
// 更新出货单
|
||||
ShipmentApi.updateOrderIn({
|
||||
orderOutPos: [{ ...model1.order, scaleStatus: scaleStatus }],
|
||||
orderOutPos: [{ ...model1.order, scaleStatus: status }],
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: "编辑成功",
|
||||
icon: "success",
|
||||
});
|
||||
debugger
|
||||
if (scaleStatus === ScaleStatus.ToBeGrossWeight) {
|
||||
uni.navigateTo({
|
||||
url: "/pagesShipment/grossWeight", // 要跳转到的页面路径
|
||||
if (state.scaleStatus === ScaleStatus.ToBeShipment) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesShipment/shipmenting?scaleStatus=" + status, // 要跳转到的页面路径
|
||||
});
|
||||
} else if (scaleStatus === ScaleStatus.ToBeShipmentReview) {
|
||||
uni.navigateTo({
|
||||
url: "/pagesShipment/shipmentSettlement?scaleStatus=2", // 要跳转到的页面路径
|
||||
} else if (state.scaleStatus === ScaleStatus.ToBeGrossWeight) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesShipment/shipmentSettlement?scaleStatus=" + status, // 要跳转到的页面路径
|
||||
});
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url:
|
||||
"/pagesShipment/review/index?id=" +
|
||||
model1.order.id +
|
||||
`&scaleStatusBtnType=1`, // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const state = reactive({
|
||||
scaleStatus: 0,
|
||||
});
|
||||
onLoad((option) => {
|
||||
model1.order.id = (option as any).id;
|
||||
state.scaleStatus = parseInt((option as any).scaleStatus);
|
||||
if (state.scaleStatus === ScaleStatus.ToBeShipment) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: "待出货编辑",
|
||||
});
|
||||
} else if (state.scaleStatus === ScaleStatus.ToBeGrossWeight) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: "待过毛重编辑",
|
||||
});
|
||||
} else {
|
||||
uni.setNavigationBarTitle({
|
||||
title: "审核结算编辑",
|
||||
});
|
||||
}
|
||||
if (model1.order.id) {
|
||||
ShipmentApi.getDetailById({ id: model1.order.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
model1.order = res.data;
|
||||
model1.order = {
|
||||
...res.data,
|
||||
deliveryMethod:
|
||||
res.data.deliveryMethod !== null ? res.data.deliveryMethod : 0,
|
||||
fileLists: model1.order.fileLists.map((item: any) => {
|
||||
return { ...item, fileID: item.id };
|
||||
}),
|
||||
};
|
||||
console.log(model1.order);
|
||||
}
|
||||
});
|
||||
PictureApi.getAnnex({
|
||||
businessId: model1.order.id,
|
||||
orderType: 1,
|
||||
orderType: OrderType.Shipment,
|
||||
imagesType: ImagesType.NORMARL,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
model1.order.fileLists = res.data;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -304,7 +441,7 @@ onLoad((option) => {
|
|||
// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
|
||||
border-radius: 13rpx;
|
||||
margin: 30rpx 25rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
::v-deep .u-form-item {
|
||||
height: auto;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
plain
|
||||
shape="circle"
|
||||
:bgColor="'rgba(237, 254, 255, 1)'"
|
||||
@click="handleScenePhoto(state.order.imagesId as number)"
|
||||
@click="handleScenePhoto(state.order.id)"
|
||||
></u-tag
|
||||
></view>
|
||||
<view
|
||||
|
@ -124,7 +124,14 @@
|
|||
<text v-if="item.name">{{ item.name }}:</text
|
||||
><text
|
||||
>{{ item.isBefore ? item.unit : "" }}
|
||||
{{ item.num }}
|
||||
<text v-if="item.name === '净重误差'">
|
||||
{{ (state.order.netWeight || 0)- (state.order.settlementNet || 0) }}
|
||||
</text>
|
||||
<text v-else-if="item.name === '结算方式'">
|
||||
{{ payMethodMap[item.num] || '暂无' }}
|
||||
</text>
|
||||
<text v-else> {{ item.num }}</text>
|
||||
|
||||
{{ item.isBefore ? "" : item.unit }}
|
||||
</text>
|
||||
</view>
|
||||
|
@ -200,7 +207,13 @@
|
|||
import { ShipmentApi } from "@/services/index";
|
||||
import { ScaleStatusBtnType } from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
const keyword = ref("");
|
||||
import SmallModal from "@/components/Modal/smallModal.vue";
|
||||
const payMethodMap:any = {
|
||||
'1': '现金',
|
||||
'2': '转账',
|
||||
'3': '微信',
|
||||
'4': '支付宝'
|
||||
}
|
||||
const contrlModalParams = reactive<{ [attrName: string]: any }>({
|
||||
paySelect: {
|
||||
isShow: false,
|
||||
|
@ -432,7 +445,13 @@ const gridList3 = reactive([
|
|||
unit: "元",
|
||||
isBefore: false,
|
||||
},
|
||||
{},
|
||||
{
|
||||
name: "结算方式",
|
||||
enName: "paymentMethod",
|
||||
num: "",
|
||||
unit: "",
|
||||
isBefore: false,
|
||||
},
|
||||
// 客户过磅净重-机器过磅净重
|
||||
{
|
||||
name: "净重误差",
|
||||
|
@ -451,9 +470,9 @@ const handleSettlement = () => {
|
|||
`&scaleStatusBtnType=${ScaleStatusBtnType.ShipmentPay}`, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const handleScenePhoto = (imagesId: number) => {
|
||||
const handleScenePhoto = (id: string) => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesScenePhoto/index?orderType=1&id=" + imagesId, // 要跳转到的页面路径
|
||||
url: "/pagesScenePhoto/index?orderType=1&imagesType=1&id=" + id, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
// 出货未结算 // 先填写结算信息后更新状态为3
|
||||
|
@ -532,7 +551,7 @@ const handleReWeight = () => {
|
|||
ShipmentApi.reGrossWeight({ id: state.order.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.navigateTo({
|
||||
url: "/pagesShipment/grossWeight", // 要跳转到的页面路径
|
||||
url: "/pagesShipment/shipmenting?scaleStatus=1", // 要跳转到的页面路径
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
<template>
|
||||
<view class="search">
|
||||
<view v-if="!isShowSearch" @click="isShowSearch = true">
|
||||
<u-icon color="#C1C1C1" name="search"></u-icon
|
||||
><text>请输入客户名称</text>
|
||||
<u-icon color="#C1C1C1" name="search"></u-icon><text>请输入客户名称</text>
|
||||
</view>
|
||||
<u-search
|
||||
v-else
|
||||
|
@ -13,6 +12,7 @@
|
|||
:clearabled="true"
|
||||
:showAction="false"
|
||||
placeholderColor="#C1C1C1"
|
||||
@search="handleSearch()"
|
||||
></u-search>
|
||||
</view>
|
||||
|
||||
|
@ -28,83 +28,111 @@
|
|||
</text>
|
||||
</view>
|
||||
|
||||
<block v-for="(item, index) in pageList.list" :key="index">
|
||||
<view class="c-layout">
|
||||
<view
|
||||
><checkbox
|
||||
:color="'#00D2E3'"
|
||||
:checked="state.checkMap[item.id + '']"
|
||||
style="transform: scale(0.5)"
|
||||
@click="state.checkMap[item.id + ''] = !state.checkMap[item.id + '']"
|
||||
/></view>
|
||||
<view class="inner-box">
|
||||
<view class="top-flex-box">
|
||||
<view>
|
||||
<page-view
|
||||
@loadList="
|
||||
(v) => {
|
||||
getList(v);
|
||||
}
|
||||
"
|
||||
:noMoreData="pageList.noMoreData"
|
||||
:list="pageList.list"
|
||||
:height="ScaleStatus.ShipmentPaid === currentTab ? 160 : 240"
|
||||
:isLoading="pageList.isLoading"
|
||||
>
|
||||
<block v-for="(item, index) in pageList.list" :key="index">
|
||||
<view class="c-layout">
|
||||
<view style="min-width: 20px;"
|
||||
><checkbox
|
||||
v-if="
|
||||
ScaleStatus.ToBeShipmentReview === currentTab ||
|
||||
ScaleStatus.ToBeShipmentPay === currentTab
|
||||
"
|
||||
:color="'#00D2E3'"
|
||||
:checked="item.isChecked"
|
||||
style="transform: scale(0.5)"
|
||||
@click="item.isChecked = !item.isChecked"
|
||||
/></view>
|
||||
<view class="inner-box">
|
||||
<view class="top-flex-box">
|
||||
<view>
|
||||
<text class="number">出货单号:{{ item.orderNumber }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="name">{{ item.userName }}</text>
|
||||
<view>
|
||||
<text class="number">出货单号:{{ item.orderNumber }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="name">{{ item.userName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom-flex-box">
|
||||
<view>
|
||||
<view class="bottom-flex-box">
|
||||
<view>
|
||||
<text class="desc"
|
||||
>过磅总净重:{{ item.netWeight || 0 }}KG</text
|
||||
>
|
||||
<view>
|
||||
<text class="desc"
|
||||
>过磅总净重:{{ item.netWeight || 0 }}KG</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<text class="btn">
|
||||
<text
|
||||
v-if="currentTab === 2"
|
||||
@click="handleReview(item.id, 2)"
|
||||
>出货结算</text
|
||||
>
|
||||
<text
|
||||
v-if="currentTab === 3"
|
||||
@click="handleReview(item.id, 3)"
|
||||
>去结算</text
|
||||
>
|
||||
<text
|
||||
v-if="currentTab === 4"
|
||||
@click="handleReview(item.id, 4)"
|
||||
>查看</text
|
||||
>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<text class="btn">
|
||||
<text
|
||||
v-if="currentTab === 2"
|
||||
@click="handleReview(item.id, 2)"
|
||||
>出货结算</text
|
||||
>
|
||||
<text v-if="currentTab === 3" @click="handleReview(item.id, 3)">去结算</text>
|
||||
<text v-if="currentTab === 4" @click="handleReview(item.id, 4)">查看</text>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-gap
|
||||
height="10"
|
||||
bgColor="#f8f8f8"
|
||||
v-if="index < pageList.list.length - 1"
|
||||
></u-gap>
|
||||
</block>
|
||||
<u-gap
|
||||
height="10"
|
||||
bgColor="#f8f8f8"
|
||||
v-if="index < pageList.list.length - 1"
|
||||
></u-gap>
|
||||
</block>
|
||||
</page-view>
|
||||
</view>
|
||||
<view class="btn-box" v-if="(currentTab === 2 || currentTab === 3) && pageList.list.length > 0">
|
||||
<view
|
||||
class="btn-box"
|
||||
v-if="(currentTab === 2 || currentTab === 3) && pageList.list.length > 0"
|
||||
>
|
||||
<u-button
|
||||
text="全选/取消"
|
||||
color="#fff"
|
||||
:customStyle="{ color: '#00DCEE', border: '1px solid #00DCEE' }"
|
||||
@click="handleSelect"
|
||||
></u-button>
|
||||
<u-button type="primary" :text="`${currentTab === 2 ? '批量审核' : '批量支付'}`"></u-button>
|
||||
<u-button
|
||||
type="primary"
|
||||
:text="`${currentTab === 2 ? '批量审核' : '批量支付'}`"
|
||||
@click="handleReviewOrPay(currentTab)"
|
||||
></u-button>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ShipmentApi } from "@/services/index";
|
||||
import { ScaleStatusBtnType } from "@/utils/enum";
|
||||
import { ScaleStatus, ScaleStatusBtnType } from "@/utils/enum";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import PageView from "@/components/PageView/index.vue";
|
||||
// scaleStatus
|
||||
interface PageResult<T> {
|
||||
total: number;
|
||||
list: T[];
|
||||
pageNum: number;
|
||||
pageSize: number;
|
||||
}
|
||||
const pageList: PageResult<Shipment> = reactive({
|
||||
isLoading: false,
|
||||
noMoreData: false,
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const keyword = ref();
|
||||
const keyword = ref("");
|
||||
const isShowSearch = ref(false);
|
||||
const state = reactive<{
|
||||
[attrName: string]: any;
|
||||
|
@ -129,46 +157,96 @@ const tabList = reactive([
|
|||
const currentTab = ref(2);
|
||||
const handleTab = (item: any) => {
|
||||
currentTab.value = item.key;
|
||||
getOrderList();
|
||||
getList();
|
||||
};
|
||||
const handleReview = (id: string, scaleStatus: number) => {
|
||||
let type = ScaleStatusBtnType.ShipmentSettlement
|
||||
let type = ScaleStatusBtnType.ShipmentSettlement;
|
||||
if (scaleStatus === 2) {
|
||||
type = ScaleStatusBtnType.ShipmentSettlement
|
||||
type = ScaleStatusBtnType.ShipmentSettlement;
|
||||
} else if (scaleStatus === 3) {
|
||||
type = ScaleStatusBtnType.ShipmentNoPay
|
||||
type = ScaleStatusBtnType.ShipmentNoPay;
|
||||
} else if (scaleStatus === 4) {
|
||||
type = ScaleStatusBtnType.ShipmentPay
|
||||
type = ScaleStatusBtnType.ShipmentPay;
|
||||
}
|
||||
console.log('**************', type)
|
||||
uni.navigateTo({
|
||||
url: "/pagesShipment/review/index?id=" + id + `&scaleStatusBtnType=${type}`, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
|
||||
const handleReviewOrPay = (status: number) => {
|
||||
// 批量审核
|
||||
if (ScaleStatus.ToBeShipmentReview === status) {
|
||||
updateStatus(ScaleStatus.ToBeShipmentPay);
|
||||
} else if (ScaleStatus.ToBeShipmentPay === status) {
|
||||
// 批量支付
|
||||
updateStatus(ScaleStatus.ShipmentPaid);
|
||||
}
|
||||
};
|
||||
const updateStatus = (status: number) => {
|
||||
const list = pageList.list
|
||||
.filter((item) => item.isChecked)
|
||||
.map((item) => {
|
||||
return { ...item, scaleStatus: status };
|
||||
});
|
||||
ShipmentApi.updateOrderIn({ orderOutPos: list }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
resetPageList();
|
||||
getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleSelect = () => {
|
||||
state.isAll = !state.isAll;
|
||||
Object.keys(state.checkMap).forEach((item) => {
|
||||
state.checkMap[item] = state.isAll;
|
||||
console.log(state.isAll);
|
||||
pageList.list = pageList.list.map((item) => {
|
||||
return { ...item, isChecked: state.isAll };
|
||||
});
|
||||
console.log(state.checkMap)
|
||||
};
|
||||
const getOrderList = () => {
|
||||
ShipmentApi.getOrderPage({ pageNumber: 1, pageSize: 10, scaleStatus: currentTab.value }).then(
|
||||
(res) => {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = res.data.list;
|
||||
(res.data.list as any).forEach((item: any) => {
|
||||
state.checkMap[item.id] = false;
|
||||
});
|
||||
}
|
||||
const resetPageList = () => {
|
||||
pageList.noMoreData = false;
|
||||
pageList.total = 0;
|
||||
pageList.list = [];
|
||||
pageList.pageNum = 1;
|
||||
pageList.pageSize = 10;
|
||||
};
|
||||
const handleSearch = () => {
|
||||
resetPageList();
|
||||
getList();
|
||||
};
|
||||
const getList = (v?: boolean) => {
|
||||
if (v) {
|
||||
if (Math.ceil(pageList.total / pageList.pageSize) > pageList.pageNum) {
|
||||
pageList.pageNum++;
|
||||
} else {
|
||||
pageList.noMoreData = true;
|
||||
return;
|
||||
}
|
||||
);
|
||||
}
|
||||
pageList.isLoading = true;
|
||||
ShipmentApi.getOrderPage({
|
||||
pageSize: pageList.pageSize,
|
||||
pageNumber: pageList.pageNum,
|
||||
scaleStatus: currentTab.value,
|
||||
userName: keyword.value,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = (res.data.list as any).map((item: any) => {
|
||||
return { ...item, isChecked: false };
|
||||
});
|
||||
pageList.total = (res.data as any).total;
|
||||
pageList.isLoading = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
getOrderList();
|
||||
getList();
|
||||
});
|
||||
onLoad((option) => {
|
||||
currentTab.value = parseInt((option as any).scaleStatus);
|
||||
})
|
||||
console.log(option);
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.search {
|
||||
|
|
|
@ -1,43 +1,61 @@
|
|||
<template>
|
||||
<view class="card-box" v-for="(item, index) in pageList.list" :key="index">
|
||||
<view class="top-flex-box">
|
||||
<view>
|
||||
<page-view
|
||||
:noMoreData="pageList.noMoreData"
|
||||
:list="pageList.list"
|
||||
:height="0"
|
||||
:isLoading="pageList.isLoading"
|
||||
@loadList="
|
||||
(v) => {
|
||||
getList(v);
|
||||
}
|
||||
"
|
||||
>
|
||||
<view class="card-box" v-for="(item, index) in pageList.list" :key="index">
|
||||
<view class="top-flex-box">
|
||||
<view>
|
||||
<text class="address">{{ item.deviceName || "-" }}</text>
|
||||
<view>
|
||||
<text class="address">{{ item.deviceName || "-" }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="number">出货单号:{{ item.orderNumber }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="name">{{ item.cardNumber }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<text class="number">出货单号:{{ item.orderNumber }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="name">{{ item.cardId }}</text>
|
||||
<u-button
|
||||
:customStyle="{ border: '1px solid #00dcee', color: '#00dcee' }"
|
||||
@click="handleScenePhoto(item.id)"
|
||||
text="现场照片"
|
||||
plain
|
||||
shape="circle"
|
||||
type="success"
|
||||
size="small"
|
||||
></u-button>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<text class="btn" @click="handleScenePhoto((item.imagesId as number))"
|
||||
>现场照片</text
|
||||
>
|
||||
<text class="desc">过磅时间:{{ item.tareTime }}</text>
|
||||
</view>
|
||||
<view class="flex-box">
|
||||
<text>皮重:{{ item.tare }}kg</text>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<u-button
|
||||
text="点击作废"
|
||||
color="#E8E8E8"
|
||||
:customStyle="{ color: '#999' }"
|
||||
@click="handleModal(true, item.id as any)"
|
||||
></u-button>
|
||||
<u-button
|
||||
type="primary"
|
||||
text="点击编辑"
|
||||
@click="pricingDetail(item.id as any)"
|
||||
></u-button>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<text class="desc">过磅时间:{{ item.tareTime }}</text>
|
||||
</view>
|
||||
<view class="flex-box">
|
||||
<text>皮重:{{ item.tare }}kg</text>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<u-button
|
||||
text="点击作废"
|
||||
color="#E8E8E8"
|
||||
:customStyle="{ color: '#999' }"
|
||||
@click="handleModal(true, (item.id as any))"
|
||||
></u-button>
|
||||
<u-button
|
||||
type="primary"
|
||||
text="点击编辑"
|
||||
@click="pricingDetail((item.id as any))"
|
||||
></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</page-view>
|
||||
|
||||
<SmallModal
|
||||
:title="'确认作废吗?'"
|
||||
|
@ -52,14 +70,13 @@
|
|||
<script setup lang="ts">
|
||||
import { ShipmentApi } from "@/services/index";
|
||||
import SmallModal from "@/components/Modal/smallModal.vue";
|
||||
import PageView from "@/components/PageView/index.vue";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { ScaleStatus } from "@/utils/enum";
|
||||
|
||||
interface PageResult<T> {
|
||||
total: number;
|
||||
list: T[];
|
||||
pageNum: number;
|
||||
pageSize: number;
|
||||
}
|
||||
const pageList: PageResult<Shipment> = reactive({
|
||||
isLoading: false,
|
||||
noMoreData: false,
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
|
@ -71,34 +88,72 @@ const handleModal = (v: boolean, id: number) => {
|
|||
isShowCancelModal.value = v;
|
||||
deleteId.value = id;
|
||||
};
|
||||
const handleScenePhoto = (imagesId: number) => {
|
||||
uni.navigateTo({
|
||||
url: "/pagesScenePhoto/index?orderType=2&id=" + imagesId, // 要跳转到的页面路径
|
||||
const handleScenePhoto = (id: any) => {
|
||||
uni.redirectTo({
|
||||
url: `/pagesScenePhoto/index?orderType=1&id=${id}&imagesType=1`, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const pricingDetail = (id: string) => {
|
||||
console.log(state.scaleStatus)
|
||||
uni.navigateTo({
|
||||
url: "/pagesShipment/form/shipmentForm?id=" + id, // 要跳转到的页面路径
|
||||
url: "/pagesShipment/form/shipmentForm?id=" + id + `&scaleStatus=${state.scaleStatus}`, // 要跳转到的页面路径
|
||||
});
|
||||
};
|
||||
const getOrderList = () => {
|
||||
ShipmentApi.getOrderPage({ pageNumber: 1, pageSize: 10, scaleStatus: 0 }).then((res) => {
|
||||
const getList = (v?: boolean) => {
|
||||
if (v) {
|
||||
if (Math.ceil(pageList.total / pageList.pageSize) > pageList.pageNum) {
|
||||
pageList.pageNum++;
|
||||
} else {
|
||||
pageList.noMoreData = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
pageList.isLoading = true;
|
||||
ShipmentApi.getOrderPage({
|
||||
pageSize: pageList.pageSize,
|
||||
pageNumber: pageList.pageNum,
|
||||
scaleStatus: state.scaleStatus,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = res.data.list;
|
||||
if (res.code === 200) {
|
||||
pageList.isLoading = false;
|
||||
(pageList as any).list = (pageList as any).list = (
|
||||
pageList as any
|
||||
).list.concat(res.data.list);
|
||||
pageList.total = (res.data as any).total;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
const handleOk = () => {
|
||||
console.log(deleteId.value);
|
||||
ShipmentApi.deleteOrder({ids:[deleteId.value]}).then((res) => {
|
||||
ShipmentApi.deleteOrder({ ids: [deleteId.value] }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
getOrderList();
|
||||
getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getOrderList();
|
||||
getList();
|
||||
});
|
||||
|
||||
const state = reactive({
|
||||
scaleStatus: 0
|
||||
})
|
||||
onLoad((option) => {
|
||||
// 接收传递的标题参数
|
||||
state.scaleStatus = parseInt((option as any).scaleStatus);
|
||||
// 设置页面标题
|
||||
if (state.scaleStatus === ScaleStatus.ToBeShipment) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '待出货',
|
||||
});
|
||||
} else if (state.scaleStatus === ScaleStatus.ToBeGrossWeight) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '待过毛重',
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
import { http } from '@/utils/http'
|
||||
|
||||
// 添加客户
|
||||
export const addCustomUser = (data: any) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/api/custom/user/addCustomUser',
|
||||
data,
|
||||
})
|
||||
}
|
||||
// 修改客户
|
||||
export const updateCustomUser = (data: any) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/api/custom/user/updateCustomUser',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 查询客户分页
|
||||
export const getCustomUserPage = (data: any) => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/api/custom/user/getCustomUserPage',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 查询客户列表
|
||||
export const getCustomUserList = (data: any) => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/api/custom/user/getCustomUserList',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -36,6 +36,14 @@ export const getPage = (data: any) => {
|
|||
})
|
||||
}
|
||||
|
||||
// 收货分类查询所有
|
||||
export const allReCategory = () => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/api/recategory/allReCategory',
|
||||
})
|
||||
}
|
||||
|
||||
// 收货分类修改信息
|
||||
export const editReceiveCategory = (data: any) => {
|
||||
return http({
|
||||
|
@ -91,11 +99,10 @@ export const getReceiveProductListByPage = (data: any) => {
|
|||
}
|
||||
|
||||
// 收货产品查询所有
|
||||
export const getReceiveProductList = (data: any) => {
|
||||
export const getReceiveProductList = () => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/api/reproducts/allReProducts',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -109,11 +116,10 @@ export const addShmCategory = (data: any) => {
|
|||
}
|
||||
|
||||
// 出货分类树显示
|
||||
export const getShipmentCategory = (data: any) => {
|
||||
export const getShipmentCategory = () => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/api/shmcategory/getChinaList',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -5,4 +5,6 @@ export * as PictureApi from './picture'
|
|||
export * as ReceiveProductApi from './receiveProduct'
|
||||
export * as DeviceApi from './device'
|
||||
export * as StockCardApi from './stockCard'
|
||||
export * as GoodsApi from './goods'
|
||||
export * as GoodsApi from './goods'
|
||||
export * as SupplierApi from './supplier'
|
||||
export * as CustomerApi from './customer'
|
|
@ -45,6 +45,15 @@ export const upload = (data: any) => {
|
|||
});
|
||||
};
|
||||
|
||||
// 删除图片
|
||||
export const deleteById = (data: any) => {
|
||||
return http({
|
||||
method: "POST",
|
||||
url: "/api/annex/delete",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -72,10 +72,11 @@ export const updateRole = (data: {
|
|||
};
|
||||
|
||||
// 查询角色列表
|
||||
export const getRoleList = () => {
|
||||
export const getRoleList = (data: any) => {
|
||||
return http({
|
||||
method: "GET",
|
||||
url: "/api/role/getRoleList",
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -108,7 +109,7 @@ export const addMenusRole = (data: {
|
|||
|
||||
// 查询角色菜单权限
|
||||
export const getMenusRole = (data: any) => {
|
||||
return http({
|
||||
return http<[]>({
|
||||
method: "GET",
|
||||
url: "/api/role/getMenusRole",
|
||||
data
|
||||
|
@ -215,3 +216,21 @@ export const getInventoryUserPage = (data: any) => {
|
|||
});
|
||||
};
|
||||
|
||||
// 用户下线
|
||||
export const updateUserByIdOffline = (data: any) => {
|
||||
return http<User>({
|
||||
method: "POST",
|
||||
url: "/api/user/updateUserByIdOffline",
|
||||
data
|
||||
});
|
||||
};
|
||||
// 用户编辑
|
||||
export const updateUserById = (data: any) => {
|
||||
return http<User>({
|
||||
method: "POST",
|
||||
url: "/api/user/updateUserById",
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -91,10 +91,11 @@ export const OrderInReceipt = (data:any) => {
|
|||
};
|
||||
|
||||
// 收货单排行榜
|
||||
export const OrderInRanking = () => {
|
||||
export const OrderInRanking = (data: any) => {
|
||||
return http({
|
||||
method: "GET",
|
||||
url: "/api/orderIn/OrderInRanking"
|
||||
url: "/api/orderIn/OrderInRanking",
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ type PageParams = {
|
|||
startTime?: string; // 开始时间
|
||||
endTime?: string; // 结束时间
|
||||
isDeleted?: boolean;
|
||||
userName?: string;
|
||||
|
||||
};
|
||||
// 根据条件获取出库单,并且进行分页
|
||||
|
@ -53,19 +54,21 @@ export const countOrderByMonth = () => {
|
|||
url: "/api/orderOut/countOrderByMonth"
|
||||
});
|
||||
};
|
||||
// 出库分类统计
|
||||
|
||||
export const getOrderInReceipt = () => {
|
||||
return http<Shipment>({
|
||||
// 出库分类统计
|
||||
export const getOrderInReceipt = (data: any) => {
|
||||
return http<ShipmentSummaryCount>({
|
||||
method: "GET",
|
||||
url: "/api/orderOut/OrderInReceipt"
|
||||
url: "/api/orderOut/OrderInReceipt",
|
||||
data
|
||||
});
|
||||
};
|
||||
// 出货单排行榜
|
||||
export const getOrderInRanking = () => {
|
||||
export const getOrderInRanking = (data:any) => {
|
||||
return http<Shipment>({
|
||||
method: "GET",
|
||||
url: "/api/orderOut/OrderInRanking"
|
||||
url: "/api/orderOut/OrderInRanking",
|
||||
data
|
||||
});
|
||||
};
|
||||
// 单个或则批量作废
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
import { http } from '@/utils/http'
|
||||
|
||||
// 供应商分类
|
||||
export const addSupplierType = (data: any) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/api/supplier/type/addSupplierType',
|
||||
data,
|
||||
})
|
||||
}
|
||||
// 供应商分类修改
|
||||
export const updateSupplierType = (data: any) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/api/supplier/type/updateSupplierType',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 查询供应商分类分页
|
||||
export const getSupplierTypePage = (data: any) => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/api/supplier/type/getSupplierTypePage',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 查询供应商分类列表
|
||||
export const getSupplierTypeList = () => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/api/supplier/type/getSupplierTypeList',
|
||||
})
|
||||
}
|
||||
|
||||
// 查询供应商分类列表
|
||||
export const addSupplierUser = (data: any) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/api/supplier/user/addSupplierUser',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 修改供应商
|
||||
export const updateSupplierUser = (data: any) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/api/supplier/user/updateSupplierUser',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
//查询供应商分页
|
||||
export const getSupplierUserPage = (data: any) => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/api/supplier/user/getSupplierUserPage',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
//查询供应商列表
|
||||
export const getSupplierUserList = (data: any) => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/api/supplier/user/getSupplierUserList',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
Before Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 4.1 KiB |
|
@ -1,4 +1,3 @@
|
|||
|
||||
body {
|
||||
}
|
||||
.c-layout {
|
||||
|
@ -30,4 +29,9 @@ body {
|
|||
}
|
||||
.mt-30 {
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.u-action-sheet > view:nth-child(2) {
|
||||
max-height: 600rpx;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
interface PageResult<T> {
|
||||
isLoading?: boolean
|
||||
noMoreData?: boolean,
|
||||
total: number;
|
||||
list: T[];
|
||||
pageNum: number;
|
||||
|
@ -59,6 +61,18 @@ interface ReceiveSummaryCount {
|
|||
averagePrice?: number; // 平均单价
|
||||
rankings?: Array;
|
||||
}
|
||||
|
||||
interface ShipmentSummaryCount {
|
||||
totalAmount?: number; // 收货汇总:审核过收货总量
|
||||
totalPayShipment?: number; // 已支付的出货总
|
||||
totalUnPayShipment?: number; // 未支付的出货总量
|
||||
totalCollection?: number; // 总收款
|
||||
totalPayCollection?: number; // 已经收到的收款
|
||||
totalUnPayCollection?: number; // 未收到的收款
|
||||
totalReceipt?: number; // 收货单数量已审核的
|
||||
averagePrice?: number; // 平均单价
|
||||
rankings?: Array;
|
||||
}
|
||||
// 分页结构
|
||||
interface OrderPage<T> {
|
||||
total: number;
|
||||
|
@ -85,6 +99,7 @@ type PageParams = {
|
|||
repairFlag?: boolean; // 是否为补单,true 是未补单,false是补单
|
||||
scaleStatus?: number; // 磅单状态:0:待定价1:待过皮2:待审核3:已审核待支付4:已支付
|
||||
isDeleted?: boolean;
|
||||
userName?: string; // 供应商名称
|
||||
};
|
||||
|
||||
interface Shipment {
|
||||
|
@ -105,21 +120,21 @@ interface Shipment {
|
|||
number?: number; //数量
|
||||
notes?: string; //备注
|
||||
settlementNotes?: string; //结算备注
|
||||
deliveryMethod?: string; //提货方式:0:送货1:自提
|
||||
deliveryMethod?: number; //提货方式:0:送货1:自提
|
||||
phone?: string; //手机号
|
||||
box?: string; //箱号
|
||||
title?: string; //封号
|
||||
freight?: string; //运费
|
||||
incidentals?: string; //杂费
|
||||
freight?: number; //运费
|
||||
incidentals?: number; //杂费
|
||||
pricingPerson?: string; //定价人
|
||||
reviewerId?: string; //审核人
|
||||
buttonType: number; //扣点状态:默认0:扣杂1扣点
|
||||
points?: string; //扣点
|
||||
buckleMiscellaneous?: string; //扣杂
|
||||
unitPrice?: string; //结算单价
|
||||
estimatePrice?: string; //预估金额 结算总价
|
||||
totalPrice?: string; //结算金额 实际金额
|
||||
realIncome?: string; //实际收入 实际收入 实收金额
|
||||
unitPrice?: number; //结算单价
|
||||
estimatePrice?: number; //预估金额 结算总价
|
||||
totalPrice?: number; //结算金额 实际金额
|
||||
realIncome?: number; //实际收入 实际收入 实收金额
|
||||
errorPrice?: string; //误差金额
|
||||
repairTime?: string; //补单时间
|
||||
createTime?: string; //undefined
|
||||
|
@ -187,3 +202,12 @@ interface ReceiveProduct {
|
|||
|
||||
isDeleted?: boolean; //逻辑删除 TRUE=是 FALSE=否
|
||||
}
|
||||
|
||||
// 库存卡
|
||||
|
||||
interface StockCard {
|
||||
cardCode?: string,
|
||||
type?: number, // 库存卡类型1=出库2=入库
|
||||
cardCode?: string,
|
||||
name?: string
|
||||
}
|
||||
|
|
|
@ -19,4 +19,12 @@ interface User {
|
|||
updateUserName: string;
|
||||
isDeleted: boolean;
|
||||
cardCode?: string; // 卡号
|
||||
roleVos?: array
|
||||
}
|
||||
|
||||
interface Customer {
|
||||
name?: string,
|
||||
stockCardId?: number,
|
||||
contacts?:string,
|
||||
cardCode?: string,
|
||||
}
|
||||
|
|
|
@ -77,3 +77,9 @@ export enum DeviceType {
|
|||
Printer = 0,
|
||||
Weighbridge = 1
|
||||
}
|
||||
|
||||
// 1=出库(客户)2=入库(供应商)
|
||||
export enum StockCardType {
|
||||
Shipment = 1,
|
||||
Receive = 2
|
||||
}
|
|
@ -78,6 +78,7 @@ export const http = <T>(options: UniApp.RequestOptions) => {
|
|||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
resolve(err as any)
|
||||
},
|
||||
});
|
||||
} else {
|
||||
|
@ -105,13 +106,17 @@ export const http = <T>(options: UniApp.RequestOptions) => {
|
|||
url: "/pages/login/index",
|
||||
});
|
||||
return;
|
||||
}
|
||||
if ((res1 as any).code === 10001) {
|
||||
}else if ((res1 as any).code === 10001) {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: (res1 as Data<T>).message || "请求失败",
|
||||
});
|
||||
return
|
||||
} else if ((res1 as any).code === 5001) {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: (res1 as Data<T>).message || "请求失败",
|
||||
});
|
||||
}
|
||||
resolve(res1 as Data<T>);
|
||||
} else {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
export function formatDate(time: any, cFormat: string) {
|
||||
const format = cFormat || "{y}-{m}-{d}";
|
||||
const date = new Date(time);
|
||||
const formatObj:any = {
|
||||
const formatObj: any = {
|
||||
//年
|
||||
y: date.getFullYear(),
|
||||
//月
|
||||
|
@ -39,8 +39,8 @@ export function getCurrentMonthStartAndEnd() {
|
|||
let currentMonthEnd = new Date(now.getFullYear(), now.getMonth() + 1, 0);
|
||||
|
||||
return {
|
||||
start: currentMonthStart,
|
||||
end: currentMonthEnd
|
||||
start: currentMonthStart,
|
||||
end: currentMonthEnd,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -50,8 +50,81 @@ export function getCurrentYearStartAndEnd() {
|
|||
let currentYearEnd = (new Date(now.getFullYear() + 1, 0, 1) as any) - 1; // 下一年的一月一日减一毫秒
|
||||
|
||||
return {
|
||||
start: currentYearStart,
|
||||
end: currentYearEnd
|
||||
start: currentYearStart,
|
||||
end: currentYearEnd,
|
||||
};
|
||||
}
|
||||
|
||||
export function deleteBaseKey(obj: any) {
|
||||
delete obj.createTime;
|
||||
delete obj.createUserId;
|
||||
delete obj.createUserName;
|
||||
delete obj.updateTime;
|
||||
delete obj.updateUserId;
|
||||
delete obj.updateUserName;
|
||||
return obj;
|
||||
}
|
||||
|
||||
export function moneyFormat(num: number, decimal = 2, split = ",") {
|
||||
/*
|
||||
parameter:
|
||||
num:格式化目标数字
|
||||
decimal:保留几位小数,默认2位
|
||||
split:千分位分隔符,默认为,
|
||||
moneyFormat(123456789.87654321, 2, ',') // 123,456,789.88
|
||||
*/
|
||||
if (isFinite(num)) {
|
||||
// num是数字
|
||||
if (num === 0) {
|
||||
// 为0
|
||||
return num.toFixed(decimal);
|
||||
} else {
|
||||
// 非0
|
||||
var res = "";
|
||||
var dotIndex = String(num).indexOf(".");
|
||||
if (dotIndex === -1) {
|
||||
// 整数
|
||||
if (decimal === 0) {
|
||||
res = String(num).replace(/(\d)(?=(?:\d{3})+$)/g, `$1${split}`);
|
||||
} else {
|
||||
res =
|
||||
String(num).replace(/(\d)(?=(?:\d{3})+$)/g, `$1${split}`) +
|
||||
"." +
|
||||
"0".repeat(decimal);
|
||||
}
|
||||
} else {
|
||||
// 非整数
|
||||
// js四舍五入 Math.round():正数时4舍5入,负数时5舍6入
|
||||
// Math.round(1.5) = 2
|
||||
// Math.round(-1.5) = -1
|
||||
// Math.round(-1.6) = -2
|
||||
// 保留decimals位小数
|
||||
const numStr = String(
|
||||
(
|
||||
Math.round(num * Math.pow(10, decimal)) / Math.pow(10, decimal)
|
||||
).toFixed(decimal)
|
||||
); // 四舍五入,然后固定保留2位小数
|
||||
const decimals = numStr.slice(dotIndex, dotIndex + decimal + 1); // 截取小数位
|
||||
res =
|
||||
String(numStr.slice(0, dotIndex)).replace(
|
||||
/(\d)(?=(?:\d{3})+$)/g,
|
||||
`$1${split}`
|
||||
) + decimals;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
return "--";
|
||||
}
|
||||
}
|
||||
|
||||
// 分页内容重置
|
||||
export function pageListInit() {
|
||||
return {
|
||||
noMoreData: false,
|
||||
total: 0,
|
||||
list: [],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
};
|
||||
}
|
||||
|
|