Compare commits

...

11 Commits

Author SHA1 Message Date
admin b1906b02b0 update: 收入明细更新 2024-04-10 10:26:11 +08:00
admin afdefbb2f4 update: 支付明细对接 2024-04-09 17:21:57 +08:00
admin dab730d30e update: 更新经营概况 2024-04-08 09:52:52 +08:00
admin 5add2a7e6b update: 统计中 收货 出货相关接口对接 2024-04-01 14:49:46 +08:00
admin 1dc643ca8a update: 更新常用应用分页以及非空校验 2024-03-29 15:52:43 +08:00
admin 26e2e82669 update: 更新供应商客户库存卡内容 2024-03-29 10:19:34 +08:00
admin 84e20696b1 update: 更新供应商 客户管理 2024-03-28 16:55:03 +08:00
admin f4d6f63137 update: 收货作废 出货作废 2024-03-28 14:05:00 +08:00
admin 5262b3e78f update: 更新出货明细 2024-03-28 11:20:21 +08:00
admin c13e89055d update: 收货明细 2024-03-28 10:07:15 +08:00
admin 270ca68aae update: 更新收货补单 出货补单对接 2024-03-26 15:30:25 +08:00
74 changed files with 5593 additions and 1226 deletions

View File

@ -0,0 +1,153 @@
<template>
<view class="c-card">
<page-view
@loadList="
(v) => {
getList(v);
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="0"
:isLoading="pageList.isLoading"
>
<view
v-for="(item, index) in pageList.list"
:key="index"
@click="getDetail(item)"
class="box"
>
<view class="bill">
<view
>{{ state.type === "1" ? "收货" : "出货" }}单号{{
state.type === "1" ? item.receiptNumber : item.orderNumber
}}</view
>
<view
>{{ state.type === "1" ? "应付" : "应收" }}金额<text class="num"
>¥{{
state.type === "1" ? item.balanceTotalPrice : item.totalPrice
}}</text
></view
>
</view>
<view class="time"> {{ item.createTime }} </view>
</view>
</page-view>
</view>
</template>
<script setup lang="ts">
import PageView from "@/components/PageView/index.vue";
import { ReceiveApi, ShipmentApi } from "@/services";
import { ScaleStatus } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app";
const pageList: PageResult<Order> = reactive({
isLoading: false,
noMoreData: false,
total: 0,
list: [],
pageNum: 1,
pageSize: 10,
});
const state = reactive({
id: "",
type: "",
name: "",
});
const getDetail = (item: Order | Shipment) => {
uni.navigateTo({
url: `/pagesStatistics/${
state.type === "1" ? "supplier" : "customer"
}/detail?name=${state.name}&obj=${JSON.stringify(item)}`, // 要跳转到的页面路径
});
};
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;
let params: any = {
pageSize: pageList.pageSize,
pageNumber: pageList.pageNum,
scaleStatus: ScaleStatus.ToBePay,
};
if (state.id) {
params.userId = state.id;
}
if (state.type === "1") {
ReceiveApi.getOrderPage(params).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;
}
});
} else if (state.type === "2") {
ShipmentApi.getOrderPage(params).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;
}
});
}
};
onLoad((option: any) => {
const id = option.id;
state.type = option.type;
state.id = id;
state.name = option.name;
getList();
//
uni.setNavigationBarTitle({
title: state.name,
});
});
</script>
<style lang="scss" scoped>
.c-card {
margin: 30rpx 25rpx;
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
padding: 20rpx;
font-family: Source Han Sans CN;
font-weight: 400;
font-size: 26rpx;
color: #000000;
.box {
display: flex;
align-items: baseline;
justify-content: space-between;
padding: 15rpx 0rpx;
.num {
color: rgba(236, 15, 62, 1);
}
.bill {
view {
line-height: 60rpx;
}
}
.time {
font-family: Source Han Sans CN;
font-weight: 400;
font-size: 22rpx;
color: #999999;
}
}
.box + .box {
border-top: 1px solid rgba(233, 233, 233, 0.76);
}
}
</style>

View File

@ -1,13 +1,13 @@
<template>
<view class="c-layout">
<StatisticCard :list="list" />
<!-- {{ list }} -->
<view class="card-box">
<view class="c-tab">
<text
v-for="(item, index) in tabList"
:key="index"
:class="{ active: currentTab === item.name }"
:class="{ active: currentTab === item.id }"
@click="handleTab(item)"
>
{{ item.name }}
@ -16,119 +16,172 @@
<view class="c-grid">
<view class="box">
<view v-for="(item, index) in gridList1" :key="index">
<text>{{ item.name }}</text><text>{{ item.isBefore ? item.unit : ''}} {{ randomNum(index)}} {{ item.isBefore ? '' : item.unit }} </text>
<text v-if="item.name">{{ item.name }}</text
><text
>{{ item.isBefore ? item.unit : "" }} {{ item.num }}
{{ item.isBefore ? "" : item.unit }}
</text>
</view>
</view>
<view class="box">
<view class="box">
<view v-for="(item, index) in gridList2" :key="index">
<text v-if="item.name">{{ item.name }}</text><text v-if="item.num">{{ item.isBefore ? item.unit : ''}} {{ randomNum(index) }} {{ item.isBefore ? '' : item.unit }} </text>
<text v-if="item.name">{{ item.name }}</text
><text
>{{ item.isBefore ? item.unit : "" }} {{ item.num }}
{{ item.isBefore ? "" : item.unit }}
</text>
</view>
</view>
<view class="box">
<view v-for="(item, index) in gridList3" :key="index">
<text>{{ item.name }}</text><text>{{ item.isBefore ? item.unit : ''}} {{ randomNum(index) }} {{ item.isBefore ? '' : item.unit }} </text>
<text>{{ item.name }}</text
><text
>{{ item.isBefore ? item.unit : "" }} {{ item.num }}
{{ item.isBefore ? "" : item.unit }}
</text>
</view>
</view>
</view>
</view>
</view>
<TimeRangeFilter :show="isShowTimeDialog" @handleDialog="handleDialog"/>
<TimeRangeFilter
:show="isShowTimeDialog"
@handleDialog="handleDialog"
@handleOk="handleOk"
/>
</template>
<script setup lang="ts">
import StatisticCard from "@/components/StatisticCard/index.vue";
import TimeRangeFilter from './components/TimeRangeFilter.vue'
import TimeRangeFilter from "./components/TimeRangeFilter.vue";
import { FinanceApi, ReceiveApi, ShipmentApi } from "@/services";
import { timeRange } from "@/utils";
const list = reactive([
{
num: 8923.0,
num: 0,
name: "客户应收款总额",
},
{
num: 8923.0,
num: 0,
name: "供应商应付款总额",
},
]);
const currentTab = ref("昨日");
const currentTab = ref(3);
const tabList = reactive([
{
id: 2,
name: "昨日",
},
{
id: 3,
name: "本月",
},
{
id: 4,
name: "本年",
},
{
id: 5,
name: "自定义",
},
]);
const handleTab = (item: any) => {
if (item.name === '自定义') {
handleDialog(true)
if (item.id === 5) {
handleDialog(true);
} else {
currentTab.value = item.name;
currentTab.value = item.id;
getOverview();
}
};
const randomNum = (index:number) => {
return Math.floor(Math.random() * (10000 - 1 + 1)) + 1 + index
}
const handleOk = (v: any) => {
state.startTime = v.startTime;
state.endTime = v.endTime;
currentTab.value = 5;
getOverview();
};
const randomNum = (index: number) => {
return Math.floor(Math.random() * (10000 - 1 + 1)) + 1 + index;
};
const gridList1 = reactive([
{
name: "出货收入",
num: "6000.00",
unit: '¥',
isBefore: true
name: "总收入",
enName: "totalIncome",
num: "",
unit: "¥",
isBefore: true,
},
{
name: "实际收入",
num: "6000.00",
unit: '¥',
isBefore: true
name: "出货收入",
enName: "totalShipment",
num: "",
unit: "¥",
isBefore: true,
},
{
name: "其他收入",
enName: "totalOther",
num: "",
unit: "¥",
isBefore: true,
},
{},
{
name: "总支出",
enName: "totalExpenditure",
num: "",
unit: "¥",
isBefore: true,
},
{
name: "收货支出",
num: "6000.00",
unit: '¥',
isBefore: true
enName: "totalReap",
num: "",
unit: "¥",
isBefore: true,
},
{
name: "实际支出",
num: "6000.00",
unit: '¥',
isBefore: true
name: "其他支出",
enName: "totalOther",
num: "",
unit: "¥",
isBefore: true,
},
{
name: "杂费支出",
num: "6000.00",
unit: '¥',
isBefore: true
enName: "totalIncidentals",
num: "",
unit: "¥",
isBefore: true,
},
{
name: "运费支出",
num: "6000.00",
unit: '¥',
isBefore: true
enName: "totalFreight",
num: "",
unit: "¥",
isBefore: true,
},
]);
const gridList2 = reactive([
{
{
name: "出货实收金额",
num: "6000.00",
unit: '¥',
isBefore: true
enName: "actualReceived",
num: "",
unit: "¥",
isBefore: true,
},
{
name: "出货应收金额",
num: "6000.00",
unit: '¥',
isBefore: true
enName: "receivable",
num: "",
unit: "¥",
isBefore: true,
},
{
name: "出货笔数",
enName: "orderOutNum",
num: "2",
},
{
@ -137,96 +190,200 @@ const gridList2 = reactive([
},
{
name: "出货总重量",
num: "6000.00",
unit: 'KG',
isBefore: false
enName: "outTotalWeight",
num: "",
unit: "KG",
isBefore: false,
},
{
name: "出货净重(客户)",
num: "6000.00",
unit: 'KG',
isBefore: false
enName: "customerTotalWeight",
num: "",
unit: "KG",
isBefore: false,
},
{
name: "出货重量(已结)",
num: "6000.00",
unit: 'KG',
isBefore: false
enName: "payOutTotalWeight",
num: "",
unit: "KG",
isBefore: false,
},
{
name: "结算总重量",
num: "6000.00",
unit: 'KG',
isBefore: false
enName: "totalSettlement",
num: "",
unit: "KG",
isBefore: false,
},
{
name: "出货重量(未结)",
num: "6000.00",
unit: 'KG',
isBefore: false
enName: "unPayOutTotalWeight",
num: "",
unit: "KG",
isBefore: false,
},
{
name: "结算重量(已结)",
num: "6000.00",
unit: 'KG',
isBefore: false
enName: "payTotalSettlement",
num: "",
unit: "KG",
isBefore: false,
},
{
name: "净重误差",
num: "6000.00",
unit: 'KG',
isBefore: false
enName: "netError",
num: "",
unit: "KG",
isBefore: false,
},
{
name: "结算总量(未结)",
num: "6000.00",
unit: 'KG',
isBefore: false
enName: "unPayTotalSettlement",
num: "",
unit: "KG",
isBefore: false,
},
]);
const gridList3 = reactive([
{
name: "收货总重量",
num: "6000.00",
unit: 'KG',
isBefore: false
enName: "payTotalWeight",
num: "",
unit: "KG",
isBefore: false,
},
{
name: "收货笔数",
num: "2",
unit: '',
isBefore: false
enName: "orderInNum",
num: "",
unit: "",
isBefore: false,
},
{
name: "收货重量(已付)",
num: "6000.00",
unit: 'KG',
isBefore: false
enName: "paymentTotalPrice",
num: "",
unit: "KG",
isBefore: false,
},
{
name: "收货实付金额",
num: "6000.00",
unit: '¥',
isBefore: true
enName: "totalWeight",
num: "",
unit: "¥",
isBefore: true,
},
{
name: "收货重量(未付)",
num: "6000.00",
unit: 'KG',
isBefore: false
enName: "unPayTotalWeight",
num: "",
unit: "KG",
isBefore: false,
},
{
name: "收货应付金额",
num: "6000.00",
unit: '¥',
isBefore: true
enName: "unPaymentTotalPrice",
num: "",
unit: "¥",
isBefore: true,
},
]);
const isShowTimeDialog = ref(false)
const isShowTimeDialog = ref(false);
const handleDialog = (v: boolean) => {
isShowTimeDialog.value = v
isShowTimeDialog.value = v;
};
const state = reactive({
startTime: "",
endTime: "",
});
const getReceiveOverView = () => {
ReceiveApi.getOverview({
startTime: state.startTime,
endTime: state.endTime,
}).then((res: any) => {
if (res.code === 200) {
gridList3.map((item) => {
item.num = res.data[item.enName as string];
});
}
});
};
const getShipmentOverView = () => {
ShipmentApi.getOverview({
startTime: state.startTime,
endTime: state.endTime,
}).then((res: any) => {
if (res.code === 200) {
gridList2.map((item) => {
item.num = res.data[item.enName as string];
});
}
});
};
const getPaymentCount = () => {
FinanceApi.getPaymentCount({
startTime: state.startTime,
endTime: state.endTime,
}).then((res: any) => {
if (res.code === 200) {
gridList1.map((item) => {
if (Object.keys(res.data).includes(item.enName + "")) {
item.num = res.data[item.enName as string];
}
});
}
});
};
const getRevenueCount = () => {
FinanceApi.getRevenueCount({
startTime: state.startTime,
endTime: state.endTime,
}).then((res: any) => {
if (res.code === 200) {
gridList1.map((item) => {
if (Object.keys(res.data).includes(item.enName + "")) {
item.num = res.data[item.enName as string];
}
});
}
});
};
const getOverview = () => {
if (currentTab.value < 5) {
const range = timeRange(currentTab.value);
state.startTime = range.startTime + " 00:00:00";
state.endTime = range.endTime + " 23:59:59";
} else if (currentTab.value === 5) {
state.startTime = state.startTime + " 00:00:00";
state.endTime = state.endTime + " 23:59:59";
}
getReceiveOverView();
getShipmentOverView();
getPaymentCount();
getRevenueCount();
};
// /
const getTotal = () => {
ReceiveApi.getTotal().then((res:any) => {
if(res.code === 200) {
const {unPayCustomerTotal, unPaySupplierTotal} = res.data
list[0].num = unPayCustomerTotal
list[1].num = unPaySupplierTotal
}
})
}
onMounted(() => {
getTotal()
getOverview();
});
</script>
<style lang="scss" scoped>
.card-box {
@ -237,7 +394,7 @@ const handleDialog = (v: boolean) => {
.c-tab {
font-family: Source Han Sans CN;
font-weight: 400;
font-size: 27rpx;
font-size: 28rpx;
color: #999999;
line-height: 41rpx;
display: flex;
@ -256,7 +413,7 @@ const handleDialog = (v: boolean) => {
.c-grid {
font-family: Source Han Sans CN;
font-weight: 400;
font-size: 21rpx;
font-size: 24rpx;
color: #000000;
.box {
padding: 30rpx;
@ -268,7 +425,7 @@ const handleDialog = (v: boolean) => {
}
}
.box + .box {
border-top: 18rpx solid #F8F8F8;
border-top: 18rpx solid #f8f8f8;
}
}
}

View File

@ -4,7 +4,7 @@
<view class="title">筛选</view>
<u-list height="200">
<u-list-item>
<u-cell :title="`${isShipment ? '客户' : '供应商'}`" @click="handleDialog('showSupplier', true)">
<u-cell :title="`${isShipment ? '客户' : '供应商'}`" @click="handleDialog('showSupplier', true)" :value="state.user.name">
<template #right-icon> </template>
</u-cell>
</u-list-item>
@ -12,20 +12,27 @@
<u-cell
:title="`${isShipment ? '出货产品' : '收货产品'}`"
@click="handleDialog('showProduct', true)"
:value="state.project.name"
>
<template #right-icon> </template>
</u-cell>
</u-list-item>
</u-list>
<view class="btn-layout">
<view class="btn">
<up-button type="primary" text="确定" @click="handleOk()"></up-button>
</view>
</view>
<view class="btn-layout">
<view class="btn">
<u-button>重置</u-button>
</view>
<view class="btn-box1">
<u-button
text="重置"
color="#E8E8E8"
:customStyle="{ color: '#999' }"
shape="circle"
@click="resetState"
></u-button>
<u-button
type="primary"
text="确定"
shape="circle"
@click="handleOk()"
></u-button>
</view>
</view>
</u-popup>
@ -35,6 +42,7 @@
:show="showDialog.showSupplier"
@handleDialog="(v:boolean) => {handleDialog('showSupplier', v)}"
@changeUser="changeUser"
:isShipment="isShipment"
></SupplierDialog>
<!-- 收货产品弹框 -->
<ProductDialog
@ -72,10 +80,11 @@ const state = <
>reactive({
project: {
id: -1,
reProductsName: ''
name: ''
},
user: {
id: -1
id: -1,
name: ''
}
});
@ -86,9 +95,18 @@ const changeUser = (obj:any) => {
state.user = obj
}
const changeProduct = (obj:any) => {
state.project = obj
state.project = {...obj, name: obj.reProductsName}
}
const resetState = () => {
state.project = {
id: -1,
name: ''
}
state.user = {
id: -1,
name: ''
}
}
const handleOk = () => {
emit("changeOther",{userId: state.user.id, productId: state.project.id})
emit("handleDialog", false);
@ -112,17 +130,13 @@ const handleOk = () => {
font-size: 27rpx !important;
}
}
.btn-layout {
align-items: center;
justify-content: center;
.btn-box1 {
flex-direction: row;
display: flex;
margin-top: 35rpx;
.btn {
width: 80%;
text-align: center;
::v-deep button {
border-radius: 43rpx;
}
align-items: center;
margin-top: 30rpx;
::v-deep button + button {
margin-left: 50rpx;
}
}
}

View File

@ -49,6 +49,7 @@ const props = defineProps<{
}>();
const emit = defineEmits(["handleDialog", "changeProduct"]);
const handleClose = () => {
debugger
emit("handleDialog", false);
};
@ -84,8 +85,7 @@ onMounted(() => {
<style lang="scss" scoped>
.c-dialog-filter {
width: 95vw;
padding: 25rpx;
z-index: 9999999999;
margin: 25rpx;
.title {
font-weight: 500;
font-size: 32rpx;

View File

@ -1,9 +1,13 @@
<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="search">
<u-search placeholder=" 请输入供应商名称 / 卡号搜索" v-model="keyword"></u-search>
<u-search
:placeholder="`请输入${isShipment? '客户' : '供应商'}名称 / 卡号搜索`"
v-model="keyword"
@search="handleSearch()"
></u-search>
</view>
<view class="dialog-product-layout">
<!-- 自定义索引列表 -->
@ -19,12 +23,12 @@
class="address-book"
v-for="(item, index) in addressBook"
:key="index"
:id="item.id"
:id="item.name"
>
<view class="address-book-index">{{ item.id }}</view>
<view class="address-book-index">{{ item.name }}</view>
<view
class="contact-container"
v-for="(cItem, index) in item.data"
v-for="(cItem, index) in item.list"
:key="index"
>
<!-- <img
@ -32,9 +36,12 @@
src="http://www.lixia.gov.cn/picture/0/s_97b76c734a6f40f8abba95615cbff1e1.jpg"
alt=""
/> -->
<view class="contact-detail-container">
<view class="contact-name">{{ cItem.zh_title }}</view>
<view class="contact-address">{{ cItem.address }}</view>
<view
class="contact-detail-container"
@click="handleClick(cItem)"
>
<view class="contact-name">{{ cItem.name }}</view>
<view class="contact-address">{{ cItem.cardCode }}</view>
<!-- <view class="contact-phone">{{ item.phone }}</view> -->
</view>
</view>
@ -58,15 +65,18 @@
</u-popup>
</template>
<script setup lang="ts">
import { CustomerApi, SupplierApi } from "@/services";
const props = defineProps<{
show: boolean;
isShipment: boolean;
}>();
const emit = defineEmits(["handleDialog"]);
const emit = defineEmits(["handleDialog", "changeUser"]);
const handleClose = () => {
emit("handleDialog", false);
};
const keyword = ref()
const keyword = ref("");
const indexList = [
"A",
@ -95,113 +105,75 @@ const indexList = [
"X",
"Y",
"Z",
"#",
];
const toView = ref("");
const addressBook = [
{
id: "A",
data: [
{
zh_title: "阿联酋迪拉姆",
en_title: "aa",
address: "910289591",
phone: "111111",
},
{
zh_title: "阿尔巴尼亚列克",
en_title: "aaaaa",
address: "ALL",
phone: "222222",
},
],
},
{
id: "B",
data: [
{
zh_title: "孟加拉国塔卡",
en_title: "bbb",
address: "BDT",
phone: "111111",
},
{
zh_title: "保加利亚列瓦",
en_title: "bbb",
address: "BGN",
phone: "222222",
},
],
},
{
id: "C",
data: [
{
zh_title: "加拿大元",
en_title: "ccc",
address: "CAD",
phone: "111111",
},
{
zh_title: "瑞士法郎",
en_title: "ccc",
address: "CHF",
phone: "222222",
},
],
},
{
id: "D",
data: [
{
zh_title: "丹麦克朗",
en_title: "ddd",
address: "DKK",
phone: "111111",
},
{
zh_title: "多米尼加比索",
en_title: "ddd",
address: "DOP",
phone: "222222",
},
{
zh_title: "丹麦克朗",
en_title: "ddd",
address: "DKK",
phone: "111111",
},
{
zh_title: "多米尼加比索",
en_title: "ddd",
address: "DOP",
phone: "222222",
},
{
zh_title: "丹麦克朗",
en_title: "ddd",
address: "DKK",
phone: "111111",
},
{
zh_title: "多米尼加比索",
en_title: "ddd",
address: "DOP",
phone: "222222",
},
],
},
{
id: "Z",
data: [
{ zh_title: "z", en_title: "zz", address: "zzz", phone: "111111" },
{ zh_title: "zzz", en_title: "ddd", address: "ddd", phone: "222222" },
],
},
];
const addressBook = ref();
// [
// {
// id: "A",
// data: [
// {
// zh_title: "",
// en_title: "aa",
// address: "910289591",
// phone: "111111",
// },
// {
// zh_title: "",
// en_title: "aaaaa",
// address: "ALL",
// phone: "222222",
// },
// ],
// }
// ];
const toSelectIndex = (item: any) => {
toView.value = item;
};
const handleClick = (item: any) => {
emit("changeUser", item);
emit("handleDialog", false);
};
const handleSearch = () => {
getList();
};
const getList = () => {
if (props.isShipment) {
CustomerApi.getCustomUserListLettera({ name: keyword.value }).then(
(res: any) => {
if (res.code === 200) {
addressBook.value = res.data.reduce((pre: any, curr: any) => {
if (curr.list.length > 0) {
pre.push(curr);
}
return pre;
}, []);
}
}
);
} else {
SupplierApi.getSupplierUserListLettera({ name: keyword.value }).then(
(res: any) => {
if (res.code === 200) {
addressBook.value = res.data.reduce((pre: any, curr: any) => {
if (curr.list.length > 0) {
pre.push(curr);
}
return pre;
}, []);
}
}
);
}
};
onMounted(() => {
getList();
});
</script>
<style lang="scss" scoped>
.c-dialog-filter {
@ -255,7 +227,7 @@ const toSelectIndex = (item: any) => {
width: 80%;
font-size: 22rpx;
.contact-address {
color: rgba(0,0,0,0.65);
color: rgba(0, 0, 0, 0.65);
}
}
}

View File

@ -43,7 +43,7 @@
</u-popup>
</template>
<script setup lang="ts">
import { formatDate, getCurrentMonthStartAndEnd, getCurrentYearStartAndEnd } from "@/utils";
import { formatDate, getCurrentMonthStartAndEnd, getCurrentYearStartAndEnd, timeRange } from "@/utils";
const props = defineProps<{
show: boolean;
@ -81,23 +81,10 @@ const handleCustom = () => {
}
const handleSelect = (item: any) => {
const today = new Date();
const yesterday = new Date((today as any) - (24 * 60 * 60 * 1000));
state.currentStates = item.id;
console.log(item);
if (item.id === 1) {
state.startTime = formatDate(today, "{y}-{m}-{d}");
state.endTime = formatDate(today, "{y}-{m}-{d}");
} else if (item.id === 2) {
state.startTime = formatDate(yesterday, "{y}-{m}-{d}");
state.endTime = formatDate(yesterday, "{y}-{m}-{d}");
} else if (item.id === 3) {
state.startTime = formatDate(getCurrentMonthStartAndEnd().start, "{y}-{m}-{d}");
state.endTime = formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}");
} else if (item.id === 4) {
state.startTime = formatDate(getCurrentYearStartAndEnd().start, "{y}-{m}-{d}");
state.endTime = formatDate(getCurrentYearStartAndEnd().end, "{y}-{m}-{d}");
}
const range = timeRange(item.id)
state.startTime = range.startTime;
state.endTime = range.endTime
emit("changeTime", {startTime: state.startTime, endTime: state.endTime});
emit("handleDialog", false);
};

View File

@ -4,7 +4,7 @@
<view>
<view class="box">
<text @click="handleClose">取消</text>
<text class="btn" @click="handleClose">完成</text>
<text class="btn" @click="handleOk">完成</text>
</view>
<uni-calendar
:insert="true"
@ -19,17 +19,43 @@
</u-popup>
</template>
<script setup lang="ts">
import { formatDate } from '@/utils';
const props = defineProps<{
show: boolean,
}>()
const emit = defineEmits(['handleDialog']);
const emit = defineEmits(['handleDialog', 'handleOk']);
const handleClose = () => {
emit('handleDialog', false)
}
const handleOk = () => {
emit('handleOk', {startTime: state.startTime, endTime: state.endTime})
emit('handleDialog', false)
}
const showCalendar = ref(false)
const state = reactive({
startTime: '',
endTime: ''
})
const handleChangeDate = (v: any) => {
console.log(v);
const time1 = v.range.before;
const time2 = v.range.after;
if (time1 && time2) {
const date1 = new Date(time1);
const date2 = new Date(time2);
if (date1 < date2) {
state.startTime = formatDate(time1, "{y}-{m}-{d}");
state.endTime = formatDate(time2, "{y}-{m}-{d}");
} else if (date1 > date2) {
state.startTime = formatDate(time2, "{y}-{m}-{d}");
state.endTime = formatDate(time1, "{y}-{m}-{d}");
} else {
state.startTime = formatDate(time1, "{y}-{m}-{d}");
state.endTime = formatDate(time2, "{y}-{m}-{d}");
}
}
};
</script>
<style lang="scss" scoped>

View File

@ -1,54 +0,0 @@
<template>
<view class="c-card">
<view v-for="item in 10" :key="item" @click="getDetail()">
<view class="bill">
<view>收货单号CHD2024012212314</view>
<view>应收金额<text class="num">¥1800.00</text></view>
</view>
<view class="time"> 2024-01-22 14:28:36 </view>
</view>
</view>
</template>
<script setup lang="ts">
const getDetail = () => {
uni.navigateTo({
url: "/pagesStatistics/customer/detail", //
});
}
</script>
<style lang="scss" scoped>
.c-card {
margin: 30rpx 25rpx;
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
padding: 20rpx;
font-family: Source Han Sans CN;
font-weight: 400;
font-size: 21rpx;
color: #000000;
> view {
display: flex;
align-items: baseline;
justify-content: space-between;
padding: 15rpx 0rpx;
.num {
color: rgba(236, 15, 62, 1);
}
.bill {
view {
line-height: 40rpx;
}
}
.time {
font-family: Source Han Sans CN;
font-weight: 400;
font-size: 21rpx;
color: #999999;
}
}
> view + view {
border-top: 1px solid rgba(233, 233, 233, 0.76);
}
}
</style>

View File

@ -2,23 +2,27 @@
<view class="c-card">
<view class="top">
<view class="left">
<view>上海奉贤两网融合大磅</view>
<view>重一</view>
<view>{{ state.order.deviceName || "-" }}</view>
<view>{{ state.order.productName || "" }}</view>
</view>
<view>
<text class="btn" @click="handleScenePhoto()">现场照片</text>
<text class="btn" @click="handleScenePhoto(state.order.id)"
>现场照片</text
>
</view>
</view>
<view class="content">
<view class="baseinfo">
<view class="time"> 过磅时间2023-09-01 13:23:33 </view>
<view class="person">
<view>定价人谭兵</view>
<view>审核人谭兵</view>
<view>审核人{{ state.order.pricingUserName || "-" }}</view>
<view class="time"> 过磅时间{{ state.order.tareTime }} </view>
</view>
</view>
<view style="padding: 30rpx 0rpx">
<view> <text>收货单号</text><text> SHD20230901132333 </text></view>
<view>
<text>出货单号</text
><text>{{ state.order.orderNumber }} </text></view
>
<view class="box">
<view v-for="(item, index) in gridList1" :key="index">
<text v-if="item.name">{{ item.name }}</text
@ -33,7 +37,7 @@
<view class="moreInfo">
<view class="baseinfo">
<view>客户收货</view>
<view class="time"> 收货时间2023-09-01 13:23:33 </view>
<view class="time"> 收货时间{{ state.order.updateTime }} </view>
</view>
<view class="box">
<view v-for="(item, index) in gridList2" :key="index">
@ -51,24 +55,28 @@
</view>
</template>
<script setup lang="ts">
import { onLoad } from "@dcloudio/uni-app";
import { reactive } from "vue";
const gridList1 = reactive([
{
name: "毛重",
num: "4080.00",
enName: "grossWeight",
num: "",
unit: "KG",
isBefore: false,
},
{
name: "皮重",
num: "3450.00",
enName: "tare",
num: "",
unit: "KG",
isBefore: false,
},
{
name: "净重",
num: "640.00",
enName: "netWeight",
num: "",
unit: "KG",
isBefore: false,
},
@ -76,73 +84,106 @@ const gridList1 = reactive([
const gridList2 = reactive([
{
name: "结算重量",
num: "640.00",
enName: "settlementWeight",
num: "",
unit: "KG",
isBefore: false,
},
{
name: "结算单价",
num: "2.48",
enName: "unitPrice",
num: "",
unit: "元/KG",
isBefore: false,
},
{
name: "预估总价",
num: "1587.00",
enName: "estimatePrice",
num: "",
unit: "元",
isBefore: false,
},
{
name: "货款金额",
num: "1587.00",
unit: "元",
isBefore: false,
},
{
name: "杂费",
num: "0",
enName: "totalPrice",
num: "",
unit: "元",
isBefore: false,
},
{
name: "运费",
num: "0",
enName: "freight",
num: "",
unit: "元",
isBefore: false,
},
{
name: "杂费",
enName: "incidentals",
num: "",
unit: "元",
isBefore: false,
},
{
name: "实际收入",
num: "1587.00",
enName: "realIncome",
num: "",
unit: "元",
isBefore: false,
},
{},
{
name: "净重误差",
num: "0.00",
enName: "netWeightError",
num: "",
unit: "KG",
isBefore: false,
},
{},
{
name: "结算状态",
num: "未结算",
enName: "scaleStatus",
num: "",
unit: "",
isBefore: false,
},
{
name: "应收金额",
num: "1587.00",
enName: "totalPrice",
num: "",
unit: "元",
isBefore: false,
},
]);
const handleScenePhoto = () => {
const handleScenePhoto = (id: string) => {
uni.navigateTo({
url: "/pagesScenePhoto/index", //
url: "/pagesScenePhoto/index?orderType=1&imagesType=1&id=" + id, //
});
};
const state = reactive<any>({
order: {},
});
onLoad((option: any) => {
//
uni.setNavigationBarTitle({
title: option.name,
});
const order = JSON.parse(option.obj);
state.order = order;
gridList1.map((item: any) => {
item.num = order[item.enName as string];
});
gridList2.map((item: any) => {
if (item.name === "结算状态") {
item.num =
["待出货", "待过毛", "待审核", "已审未付", "已审已付"][
order[item.enName as string]
] || "-";
} else {
item.num = order[item.enName as string];
}
});
});
</script>
<style lang="scss" scoped>
.c-card {
@ -152,7 +193,7 @@ const handleScenePhoto = () => {
border-radius: 13rpx;
font-family: Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #000000;
.top {
display: flex;
@ -166,7 +207,7 @@ const handleScenePhoto = () => {
&:nth-child(2) {
color: rgba(236, 15, 62, 1);
font-weight: 400;
font-size: 27rpx;
font-size: 28rpx;
}
}
}
@ -187,7 +228,7 @@ const handleScenePhoto = () => {
.time {
font-family: Source Han Sans CN;
font-weight: 400;
font-size: 21rpx;
font-size: 24rpx;
color: #999999;
line-height: 40rpx;
}

View File

@ -1,33 +1,52 @@
<template>
<Search :name="'客户名称'" />
<Search :name="'客户名称'" @handleSearch="handleSearch"/>
<view class="c-card">
<StatisticCard :list="list" />
<view class="detail">
<view v-for="(item, index) in 10" :key="index" @click="getDetail(item)">
<text>张小明{{ item }}</text>
<text class="num">¥1800.00 <text class="tip"></text></text>
<view v-for="(item, index) in billList" :key="index" @click="getDetail(item)">
<text>{{ item.supplierName }}</text>
<text class="num">¥{{ item.unPayTotalPrice }} <text class="tip"></text></text>
</view>
<u-empty v-if="billList.length === 0" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
</u-empty>
</view>
</view>
</template>
<script setup lang="ts">
import Search from "@/components/Search/index.vue";
import StatisticCard from "@/components/StatisticCard/index.vue";
import { ShipmentApi } from "@/services";
const list = reactive([
{
num: 2,
num: 0,
name: "欠款客户",
},
{
num: 8923,
num: 0,
name: "欠款金额",
},
]);
const getDetail = (item: any) => {
uni.navigateTo({
url: "/pagesStatistics/customer/billDetail", //
url: "/pagesStatistics/billDetail?type=2&id=" + item.userId +`&name=${item.supplierName}`, //
});
};
const handleSearch = (v:string) => {
getList(v)
}
const billList = ref<any>([])
const getList = (v: string) => {
ShipmentApi.getReconciliation({userName: v}).then((res:any) => {
if (res.code === 200) {
list[0].num = res.data.supplierNum
list[1].num = res.data.unPayTotalPrice
billList.value = res.data.unPaySupplierVos
}
})
}
onMounted(() => {
getList('')
})
</script>
<style lang="scss" scoped>
.c-card {
@ -41,7 +60,7 @@ const getDetail = (item: any) => {
padding: 20rpx;
font-family: Source Han Sans CN;
font-weight: 400;
font-size: 21rpx;
font-size: 28rpx;
color: #000000;
> view {
display: flex;

View File

@ -2,14 +2,14 @@
<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="请选择结束时间"
@ -25,7 +25,17 @@
</view>
</view>
<!-- <c-echarts :option="option" :height="'90vh'" /> -->
<c-echarts
v-if="state.x.length > 0"
:option="getOptions(state.x, state.y)"
:height="'90vh'"
/>
<u-empty
v-else
mode="data"
icon="http://cdn.uviewui.com/uview/empty/data.png"
>
</u-empty>
<!-- 单据弹框 -->
<ProductTypeDialog
:isShipment="true"
@ -48,58 +58,56 @@ import CEcharts from "@/components/Echarts/echarts.vue";
import ProductTypeDialog from "./components/ProductTypeDialog.vue";
import { formatDate, getCurrentMonthStartAndEnd } from "@/utils";
import { ShipmentApi } from "@/services";
const option = ref({
tooltip: {
trigger: "axis",
axisPointer: {
type: "cross",
},
},
grid: {
left: "10px",
right: "20px",
top: "10px",
bottom: "30px",
containLabel: true,
},
xAxis: {
type: "value",
boundaryGap: [0, 0.01],
},
yAxis: {
type: "category",
data: [1, 2, 3, 4, 5],
axisLabel: {
// inside: true,
// color: '#fff'
},
axisTick: {
show: false,
},
axisLine: {
show: true,
lineStyle: {
color: "#83bff6",
import _ from "underscore";
const getOptions = (x: Array<any>, y: Array<any>) => {
return {
tooltip: {
trigger: "axis",
axisPointer: {
type: "cross",
},
},
},
series: [
{
data: [100, 110, 113, 126, 143, 158, 165, 167, 152, 102, ,],
type: "bar",
areaStyle: {
grid: {
left: "10px",
right: "20px",
top: "10px",
bottom: "30px",
containLabel: true,
},
xAxis: {
type: "value",
boundaryGap: [0, 0.01],
},
yAxis: {
type: "category",
data: y,
axisLabel: {
// inside: true,
// color: '#fff'
},
axisTick: {
show: false,
},
axisLine: {
show: true,
lineStyle: {
color: "#83bff6",
},
},
barWidth: 24,
},
],
color: ["#00D2E3"],
});
const params = reactive({
startTime: "2024-01-01",
endTime: "2024-01-01",
});
series: [
{
data: x,
type: "bar",
areaStyle: {
show: true,
},
barWidth: 24,
},
],
color: ["#00D2E3"],
};
};
const showDialog = <
{
[key: string]: boolean;
@ -114,12 +122,16 @@ const state = reactive<{
scaleStatus: number;
userId: number;
productId: number;
x: Array<any>;
y: Array<any>;
}>({
startTime: formatDate(getCurrentMonthStartAndEnd().start, "{y}-{m}-{d}"),
endTime: formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}"),
scaleStatus: -1,
userId: -1,
productId: -1,
x: [],
y: [],
});
const changeTime = (obj: any) => {
@ -150,6 +162,8 @@ const getList = () => {
}
ShipmentApi.getOrderInRanking(params).then((res) => {
if (res.code === 200) {
state.y = _.pluck(res.data, "userName");
state.x = _.pluck(res.data, "totalAmount");
}
});
};
@ -169,7 +183,7 @@ onMounted(() => {
font-size: 28rpx;
color: #000000;
::v-deep .u-input {
padding: 0rpx 16.03rpx !important;
padding: 0rpx 16rpx !important;
input {
font-family: Source Han Sans CN;
font-weight: 400;

View File

@ -267,7 +267,7 @@ onMounted(() => {
}
}
.box {
padding: 19.23rpx;
padding: 28rpx 20rpx;
// display: flex;
// justify-content: space-between;
align-items: center;
@ -290,7 +290,7 @@ onMounted(() => {
border-left: 1px solid #e9e9e9;
.num {
font-weight: bold;
font-size: 27rpx;
font-size: 28rpx;
}
}
::v-deep .uni-table {

View File

@ -268,7 +268,7 @@ onMounted(() => {
}
}
.box {
padding: 19.23rpx;
padding: 28rpx 20rpx;
// display: flex;
// justify-content: space-between;
align-items: center;

View File

@ -1,54 +0,0 @@
<template>
<view class="c-card">
<view v-for="item in 10" :key="item" @click="getDetail()">
<view class="bill">
<view>收货单号CHD2024012212314</view>
<view>应付金额<text class="num">¥1800.00</text></view>
</view>
<view class="time"> 2024-01-22 14:28:36 </view>
</view>
</view>
</template>
<script setup lang="ts">
const getDetail = () => {
uni.navigateTo({
url: "/pagesStatistics/supplier/detail", //
});
}
</script>
<style lang="scss" scoped>
.c-card {
margin: 30rpx 25rpx;
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
padding: 20rpx;
font-family: Source Han Sans CN;
font-weight: 400;
font-size: 21rpx;
color: #000000;
> view {
display: flex;
align-items: baseline;
justify-content: space-between;
padding: 15rpx 0rpx;
.num {
color: rgba(236, 15, 62, 1);
}
.bill {
view {
line-height: 40rpx;
}
}
.time {
font-family: Source Han Sans CN;
font-weight: 400;
font-size: 21rpx;
color: #999999;
}
}
> view + view {
border-top: 1px solid rgba(233, 233, 233, 0.76);
}
}
</style>

View File

@ -2,23 +2,28 @@
<view class="c-card">
<view class="top">
<view class="left">
<view>上海奉贤两网融合大磅</view>
<view>重一</view>
<view>{{ state.order.deviceName || "-" }}</view>
<view>{{ state.order.productName || "" }}</view>
</view>
<view>
<text class="btn" @click="handleScenePhoto()">现场照片</text>
<text class="btn" @click="handleScenePhoto(state.order.id)"
>现场照片</text
>
</view>
</view>
<view class="content">
<view class="baseinfo">
<view class="time"> 过磅时间2023-09-01 13:23:33 </view>
<view class="time"> 过磅时间{{ state.order.grossTime }}</view>
<view class="person">
<view>定价人谭兵</view>
<view>审核人谭兵</view>
<view>定价人{{ state.order.pricingUserName || "-" }}</view>
<view>审核人{{ state.order.reviewerUserName || "-" }}</view>
</view>
</view>
<view style="padding: 30rpx 0rpx">
<view> <text>收货单号</text><text> SHD20230901132333 </text></view>
<view>
<text>收货单号</text
><text> {{ state.order.receiptNumber }} </text></view
>
<view class="box">
<view v-for="(item, index) in gridList1" :key="index">
<text v-if="item.name">{{ item.name }}</text
@ -34,71 +39,110 @@
</view>
</template>
<script setup lang="ts">
const gridList1 = reactive([
import { PaymentMethod } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app";
const gridList1 = reactive<any>([
{
name: "毛重",
num: "4080.00",
enName: "grossWeight",
num: "",
unit: "KG",
isBefore: false,
},
{
name: "皮重",
num: "3450.00",
enName: "tare",
num: "",
unit: "KG",
isBefore: false,
},
{
name: "扣杂",
num: "0.00",
enName: "buckleMiscellaneous",
num: "",
unit: "KG",
isBefore: false,
},
{
name: "",
num: "",
unit: "",
},
{},
{
name: "净重",
num: "640.00",
enName: "netWeight",
num: "",
unit: "KG",
isBefore: false,
},
{
name: "单价",
num: "2.48",
unit: "元/kg",
enName: "price",
num: "",
unit: "元/KG",
isBefore: false,
},
{
name: "预估总价",
num: "1587.00",
enName: "totalPrice",
num: "",
unit: "元",
isBefore: false,
},
{
name: "货款金额",
num: "1587.00",
enName: "balanceTotalPrice",
num: "",
unit: "元",
isBefore: false,
},
{
name: "付款状态",
enName: "paymentMethod",
num: "未支付",
isBefore: false,
},
{
name: "应付金额",
num: "1587.00",
enName: "balanceTotalPrice",
num: "",
unit: "元",
isBefore: false,
},
]);
const handleScenePhoto = () => {
const handleScenePhoto = (id: any) => {
uni.navigateTo({
url: "/pagesScenePhoto/index", //
url: "/pagesScenePhoto/index?orderType=1&imagesType=1&id=" + id, //
});
};
const state = reactive<Order>({
order: {},
});
onLoad((option: any) => {
//
uni.setNavigationBarTitle({
title: option.name,
});
const order = JSON.parse(option.obj);
state.order = order;
gridList1.map((item: any) => {
if (item.name === "扣杂" || item.name === "扣点") {
if (order.buttonType === 0) {
item.name = "扣杂";
item.enName = "buckleMiscellaneous";
item.unit = "KG";
} else if (order.buttonType === 1) {
item.name = "扣点";
item.enName = "points";
item.unit = "%";
}
} else if (item.name === "付款状态") {
item.num =
["未支付", "现金", "银行卡", "微信", "支付宝"][
order[item.enName as string]
] || "未支付";
} else {
item.num = order[item.enName as string];
}
});
});
</script>
<style lang="scss" scoped>
.c-card {
@ -108,7 +152,7 @@ const handleScenePhoto = () => {
border-radius: 13rpx;
font-family: Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #000000;
.top {
display: flex;
@ -122,7 +166,7 @@ const handleScenePhoto = () => {
&:nth-child(2) {
color: rgba(236, 15, 62, 1);
font-weight: 400;
font-size: 27rpx;
font-size: 28rpx;
}
}
}
@ -143,7 +187,7 @@ const handleScenePhoto = () => {
.time {
font-family: Source Han Sans CN;
font-weight: 400;
font-size: 21rpx;
font-size: 24rpx;
color: #999999;
line-height: 40rpx;
}

View File

@ -1,33 +1,52 @@
<template>
<Search :name="'供应商名称'" />
<Search :name="'供应商名称'" @handleSearch="handleSearch"/>
<view class="c-card">
<StatisticCard :list="list" />
<view class="detail">
<view v-for="(item, index) in 10" :key="index" @click="getDetail(item)">
<text>华明基地{{ item }}</text>
<text class="num">¥1800.00 <text class="tip"></text></text>
<view v-for="(item, index) in billList" :key="index" @click="getDetail(item)">
<text>{{ item.supplierName }}</text>
<text class="num">¥{{ item.unPayTotalPrice }} <text class="tip"></text></text>
</view>
<u-empty v-if="billList.length === 0" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
</u-empty>
</view>
</view>
</template>
<script setup lang="ts">
import Search from "@/components/Search/index.vue";
import StatisticCard from "@/components/StatisticCard/index.vue";
import { ReceiveApi } from "@/services";
const list = reactive([
{
num: 2,
num: 0,
name: "应付供应商",
},
{
num: 8923,
num: 0,
name: "应付金额",
},
]);
const handleSearch = (v:string) => {
getList(v)
}
const billList = ref<any>([])
const getDetail = (item: any) => {
uni.navigateTo({
url: "/pagesStatistics/supplier/billDetail", //
url: "/pagesStatistics/billDetail?type=1&id="+ item.userId +`&name=${item.supplierName}`, //
});
};
const getList = (v: string) => {
ReceiveApi.getReconciliation({userName: v}).then((res:any) => {
if (res.code === 200) {
list[0].num = res.data.supplierNum
list[1].num = res.data.unPayTotalPrice
billList.value = res.data.unPaySupplierVos
}
})
}
onMounted(() => {
getList('')
})
</script>
<style lang="scss" scoped>
.c-card {
@ -41,7 +60,7 @@ const getDetail = (item: any) => {
padding: 20rpx;
font-family: Source Han Sans CN;
font-weight: 400;
font-size: 21rpx;
font-size: 28rpx;
color: #000000;
> view {
display: flex;

View File

@ -25,9 +25,11 @@
</view>
</view>
<!-- <view>
<c-echarts :option="option" :height="'90vh'" />
</view> -->
<view v-if="state.x.length > 0">
<c-echarts :option="getOptions(state.x, state.y)" :height="'90vh'" />
</view>
<u-empty v-else mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
</u-empty>
<!-- 时间弹框 -->
<TimeDialog
@ -48,57 +50,60 @@
</template>
<script setup lang="ts">
import TimeDialog from "./components/TimeDialog.vue";
import CEcharts from "@/components/Echarts/echarts.vue";
import CEcharts from "../components/Echarts/echarts.vue";
import ProductTypeDialog from "./components/ProductTypeDialog.vue";
import { ReceiveApi } from "@/services";
import { formatDate, getCurrentMonthStartAndEnd } from "@/utils";
const option = ref({
tooltip: {
trigger: "axis",
axisPointer: {
type: "cross",
},
},
grid: {
left: "10px",
right: "20px",
top: "10px",
bottom: "30px",
containLabel: true,
},
xAxis: {
type: "value",
boundaryGap: [0, 0.01],
},
yAxis: {
type: "category",
data: [1, 2, 3, 4, 5],
axisLabel: {
// inside: true,
// color: '#fff'
},
axisTick: {
show: false,
},
axisLine: {
show: true,
lineStyle: {
color: "#83bff6",
import _ from "underscore";
const getOptions = (x: Array<any>, y: Array<any>) => {
return {
tooltip: {
trigger: "axis",
axisPointer: {
type: "cross",
},
},
},
series: [
{
data: [100, 110, 113, 126, 143, 158, 165, 167, 152, 102, ,],
type: "bar",
areaStyle: {
grid: {
left: "10px",
right: "20px",
top: "10px",
bottom: "30px",
containLabel: true,
},
xAxis: {
type: "value",
boundaryGap: [0, 0.01],
},
yAxis: {
type: "category",
data: y,
axisLabel: {
// inside: true,
// color: '#fff'
},
axisTick: {
show: false,
},
axisLine: {
show: true,
lineStyle: {
color: "#83bff6",
},
},
barWidth: 24,
},
],
color: ["#00D2E3"],
});
series: [
{
data: x,
type: "bar",
areaStyle: {
show: true,
},
barWidth: 24,
},
],
color: ["#00D2E3"],
};
};
const changeProduct = (obj: any) => {
state.productId = obj.productId;
getList();
@ -120,12 +125,16 @@ const state = reactive<{
scaleStatus: number;
userId: number;
productId: number;
x: Array<any>;
y: Array<any>;
}>({
startTime: formatDate(getCurrentMonthStartAndEnd().start, "{y}-{m}-{d}"),
endTime: formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}"),
scaleStatus: -1,
userId: -1,
productId: -1,
x: [],
y: [],
});
const changeTime = (obj: any) => {
@ -148,8 +157,10 @@ const getList = () => {
if (state.productId > -1) {
params.productId = state.productId;
}
ReceiveApi.OrderInRanking(params).then((res) => {
ReceiveApi.OrderInRanking(params).then((res: any) => {
if (res.code === 200) {
state.y = _.pluck(res.data, "userName");
state.x = _.pluck(res.data, "totalAmount");
}
});
};

View File

@ -1,5 +1,10 @@
<template>
<LEchart class="echart" ref="chart" @finished="init" :customStyle="{height: height, 'z-index': 1}"></LEchart>
<LEchart
class="echart"
ref="chart"
@finished="init"
:customStyle="{ height: height, 'z-index': 1 }"
></LEchart>
</template>
<script setup lang="ts">
import LEchart from "../../uni_modules/lime-echart/components/l-echart/l-echart.vue";
@ -15,19 +20,28 @@ const echarts = require("../../uni_modules/lime-echart/static/echarts.min");
import * as echarts from "echarts";
// #endif
// #endif
let chart = ref(); // dom
let chart = ref<any>(); // dom
const props = defineProps<{
option: object,
height: string
}>()
option: object;
height: string;
}>();
watchEffect(() => {
chart.value.init(echarts, (chart: any) => {
chart.setOption(props.option);
});
if (chart.value) {
chart.value.init(echarts, (chart: any) => {
chart.setOption(props.option);
});
}
});
watch(
() => props.option,
(newValue, oldValue) => {
chart.value.setOption(props.option);
}
);
//
const init = () => {
console.log("渲染完成");

View File

@ -13,12 +13,13 @@
:clearabled="true"
:showAction="false"
placeholderColor="#C1C1C1"
@search="handleSearch()"
></u-search>
</view>
</template>
<script setup lang="ts">
const isShowSearch = ref(false);
const keyword = ref();
const keyword = ref('');
const props = withDefaults(
defineProps<{
name: string;
@ -27,6 +28,11 @@ const props = withDefaults(
name: '搜索内容',
}
);
const emit = defineEmits(["handleSearch"]);
const handleSearch = () => {
emit("handleSearch", keyword.value)
}
</script>
<style lang="scss" scoped>
.search {

View File

@ -13,7 +13,7 @@
<script setup lang="ts">
const props = withDefaults(
defineProps<{
list: Array;
list: any;
}>(),
{
list: [],
@ -29,7 +29,7 @@ const props = withDefaults(
align-items: center;
font-family: Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
font-size: 28rpx;
color: #000000;
text-align: center;
background: #ffffff;
@ -40,12 +40,12 @@ const props = withDefaults(
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 {
font-weight: bold;
font-size: 27rpx;
font-size: 28rpx;
}
}
</style>

View File

@ -229,9 +229,9 @@
}
},
{
"path": "supplier/billDetail",
"path": "billDetail",
"style": {
"navigationBarTitleText": "供应商账单详情"
"navigationBarTitleText": "账单详情"
}
},
{
@ -240,12 +240,6 @@
"navigationBarTitleText": "供应商详情"
}
},
{
"path": "customer/billDetail",
"style": {
"navigationBarTitleText": "客户账单详情"
}
},
{
"path": "customer/detail",
"style": {
@ -353,6 +347,18 @@
"navigationBarTitleText": "权限管理"
}
},
{
"path": "paymentDetail",
"style": {
"navigationBarTitleText": "支付明细"
}
},
{
"path": "incomeDetail",
"style": {
"navigationBarTitleText": "收入明细"
}
},
{
"path": "components/addSupplierType",
"style": {
@ -412,7 +418,32 @@
"style": {
"navigationBarTitleText": "新增权限"
}
},
{
"path": "components/addPayment",
"style": {
"navigationBarTitleText": "新增支付明细"
}
},
{
"path": "components/payContent",
"style": {
"navigationBarTitleText": "支付详情"
}
},
{
"path": "components/addIncomeDetail",
"style": {
"navigationBarTitleText": "新增收入明细"
}
},
{
"path": "components/incomeContent",
"style": {
"navigationBarTitleText": "收入详情"
}
}
]
}
// {

View File

@ -0,0 +1,156 @@
<template>
<u-popup :show="show" mode="left" :closeable="true" @close="handleClose">
<view class="c-dialog-filter">
<view class="title">筛选</view>
<u-list height="200">
<u-list-item v-if="!isShipment">
<u-cell
:title="`类型`"
@click="state.isShowStatus = true"
:value="state.type.name"
>
<template #right-icon> </template>
</u-cell>
</u-list-item>
<u-list-item boder="none">
<u-cell
:title="`${(state.type.key === 2 || isShipment) ? '客户' : '供应商'}`"
@click="handleDialog('showSupplier', true)"
:value="state.user.name"
>
<template #right-icon> </template>
</u-cell>
</u-list-item>
</u-list>
<view class="btn-box1">
<u-button
text="重置"
color="#E8E8E8"
:customStyle="{ color: '#999' }"
shape="circle"
@click="resetState"
></u-button>
<u-button
type="primary"
text="确定"
shape="circle"
@click="handleOk()"
></u-button>
</view>
</view>
</u-popup>
<!-- 供应商选择弹框 -->
<SupplierDialog
ref="supplierDialog"
:show="showDialog.showSupplier"
@handleDialog="(v:boolean) => {handleDialog('showSupplier', v)}"
@changeUser="changeUser"
:isShipment="(state.type.key === 2 || isShipment) ? true : false"
></SupplierDialog>
<!-- 客户类型 -->
<u-action-sheet
:closeOnClickOverlay="true"
:closeOnClickAction="true"
:actions="state.statusList"
:title="'类型'"
:show="state.isShowStatus"
@select="handleSelectStatus"
@close="state.isShowStatus = false"
></u-action-sheet>
</template>
<script setup lang="ts">
import SupplierDialog from "./SupplierDialog.vue";
const props = defineProps<{
show: boolean;
isShipment: boolean
}>();
const emit = defineEmits(["handleDialog", "changeOther"]);
const handleClose = () => {
emit("handleDialog", false);
};
const showDialog = <
{
[key: string]: boolean;
}
>reactive({
showSupplier: false,
});
const state = <
{
[key: string]: any;
}
>reactive({
type: {
key: 1,
name: "供应商",
},
user: {
id: -1,
name: "",
},
statusList: [
{
name: "供应商",
key: 1,
},
{
name: "客户",
key: 2,
},
],
});
const supplierDialog = ref(null)
const handleDialog = (key: string, v: boolean) => {
showDialog[key] = v;
};
const handleSelectStatus = (v: any) => {
resetState()
state.isShowStatus = false;
state.type = v;
};
const changeUser = (obj: any) => {
state.user = obj;
};
const resetState = () => {
state.user = {
id: -1,
name: "",
};
};
const handleOk = () => {
emit("changeOther", { userId: state.user.id, type: state.type.key});
emit("handleDialog", false);
};
</script>
<style lang="scss" scoped>
.c-dialog-filter {
width: 95vw;
padding: 25rpx;
.title {
font-weight: 500;
font-size: 32rpx;
color: #000000;
text-align: center;
}
::v-deep .u-list {
height: 50vh !important;
.u-cell__title-text {
font-family: Source Han Sans CN;
font-weight: 400;
font-size: 27rpx !important;
}
}
.btn-box1 {
flex-direction: row;
display: flex;
align-items: center;
margin-top: 30rpx;
::v-deep button + button {
margin-left: 50rpx;
}
}
}
</style>

View File

@ -0,0 +1,390 @@
<template>
<u-popup
:show="show"
mode="bottom"
:round="10"
:closeable="false"
@close="handleClose"
>
<view class="box">
<view v-if="!isShipment">
<u-cell-group :border="false">
<u-cell
v-for="(item, index) in formAttrList"
:key="index"
:title="item.name"
:titleStyle="{
fontSize: '26rpx',
color: 'rgba(0, 0, 0, 1)',
fontWeight: 'bold',
}"
isLink
@click="item.fn"
:value="getValue(item.name)"
></u-cell>
</u-cell-group>
<view class="title">收货单类型</view>
<view class="btn-box">
<view v-for="(item, index) in splBtnList" :key="index">
<u-button
:text="item.name"
plain
shape="circle"
type="info"
size="small"
:customStyle="
item.key === currentSpl
? { border: '1px solid #00dcee', color: '#00dcee' }
: ''
"
@click="currentSpl = item.key"
></u-button>
</view>
</view>
<view class="title">收货单价区间</view>
<view class="range">
<view>
<u-input
shape="circle"
:fontSize="12"
:placeholderStyle="{ fontSize: '12px' }"
placeholder="最低价"
type="number"
size="small"
v-model="state.minPrice"
></u-input
></view>
-
<view>
<u-input
shape="circle"
:fontSize="12"
:placeholderStyle="{ fontSize: '12px' }"
placeholder="最高价"
type="number"
size="small"
v-model="state.maxPrice"
></u-input
></view>
</view>
</view>
<!-- 出货参数 -->
<view v-else>
<u-cell-group :border="false">
<u-cell
v-for="(item, index) in formAttrList1"
:key="index"
:title="item.name"
:titleStyle="{
fontSize: '26rpx',
color: 'rgba(0, 0, 0, 1)',
fontWeight: 'bold',
}"
isLink
@click="item.fn"
:value="getValue(item.name)"
></u-cell>
</u-cell-group>
<view class="title">提货方式</view>
<view class="btn-box">
<view v-for="(item, index) in deliveryMethodBtnList" :key="index">
<u-button
:text="item.name"
plain
shape="circle"
type="info"
size="small"
:customStyle="
item.key === deliveryMethod
? { border: '1px solid #00dcee', color: '#00dcee' }
: ''
"
@click="deliveryMethod = item.key"
></u-button>
</view>
</view>
</view>
<view class="btn-box1">
<u-button
text="重置"
color="#E8E8E8"
:customStyle="{ color: '#999' }"
shape="circle"
@click="resetState"
></u-button>
<u-button
type="primary"
text="确定"
shape="circle"
@click="getFilter()"
></u-button>
</view>
</view>
<block v-for="(item, index) in formAttrList" :key="index">
<u-action-sheet
: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>
<block v-for="(item, index) in formAttrList1" :key="index">
<u-action-sheet
: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-popup>
</template>
<script setup lang="ts">
import { CustomerApi, GoodsApi, ProfileApi, SupplierApi } from "@/services";
import _ from "underscore";
const props = defineProps<{
show: boolean;
isShipment: boolean
}>();
const emit = defineEmits(["handleDialog", "handleOk"]);
const handleClose = () => {
emit("handleDialog", false);
};
const state = reactive({
userId: null, // ID
userName: "", //
pricingUserId: null, // id
pricingUserName: "", //
productId: null, // id,
productName: "", //
minPrice: null,
maxPrice: null,
});
const currentSpl = ref<any>(null);
const splBtnList = [
{ key: null, name: "全部" },
{ key: false, name: "补单" },
{ key: true, name: "未补单" },
];
const deliveryMethod = ref<any>(null);
const deliveryMethodBtnList = [
{ key: null, name: "全部" },
{ key: 0, name: "送货" },
{ key: 1, name: "自提" },
];
const formAttrList = reactive<any>([
{
name: "供应商",
childKey: "supplier",
fn: () => {
console.log("********");
contrlModalParams.supplier.isShow = true;
contrlModalParams.supplier.title = "供应商";
},
},
{
name: "收货产品",
childKey: "product",
fn: () => {
contrlModalParams.product.isShow = true;
contrlModalParams.product.title = "收货产品";
},
},
{
name: "定价人",
childKey: "user",
fn: () => {
contrlModalParams.user.isShow = true;
contrlModalParams.user.title = "定价人";
},
},
]);
const formAttrList1 = reactive<any>([
{
name: "客户",
childKey: "customer",
fn: () => {
contrlModalParams.customer.isShow = true;
contrlModalParams.customer.title = "客户";
},
},
{
name: "出货产品",
childKey: "shipmentProduct",
fn: () => {
contrlModalParams.shipmentProduct.isShow = true;
contrlModalParams.shipmentProduct.title = "出货产品";
},
},
]);
const handleSelect = (key: string, v: any) => {
contrlModalParams[key].isShow = false;
if (key === "supplier") {
state.userName = v.name;
state.userId = v.id;
} else if (key === "product") {
state.productName = v.name;
state.productId = v.id;
} else if (key === "user") {
state.pricingUserName = v.name;
state.pricingUserId = v.id;
} else if (key === "customer") {
state.userName = v.name;
state.userId = v.id;
} else if (key === "shipmentProduct") {
state.productName = v.name;
state.productId = v.id;
}
};
const getValue = (v: string) => {
if (v === "供应商") {
return state.userName;
} else if (v === "收货产品") {
return state.productName;
} else if (v === "定价人") {
return state.pricingUserName;
} else if (v === "客户") {
return state.userName;
} else if (v === "出货产品") {
return state.productName;
}
};
const contrlModalParams = reactive<any>({
supplier: {
isShow: false,
title: "标题",
list: [],
},
product: {
isShow: false,
title: "标题",
list: [],
},
user: {
isShow: false,
title: "标题",
list: [],
},
customer: {
isShow: false,
title: "标题",
list: [],
},
shipmentProduct: {
isShow: false,
title: "标题",
list: [],
},
});
//
ProfileApi.getUserList({}).then((res: any) => {
if (res.code === 200) {
contrlModalParams.user.list = res.data;
}
});
//
SupplierApi.getSupplierUserList({}).then((res: any) => {
if (res.code === 200) {
contrlModalParams.supplier.list = res.data;
}
});
//
GoodsApi.getReceiveProductList().then((res: any) => {
if (res.code === 200) {
contrlModalParams.product.list = _.map(
res.data as any,
function (item: any) {
return { name: item.reProductsName, ...item };
}
);
}
});
//
CustomerApi.getCustomUserList({}).then((res) => {
if (res.code === 200) {
contrlModalParams.customer.list = res.data;
}
});
//
GoodsApi.getShipmentProductList().then((res) => {
if (res.code === 200) {
contrlModalParams.shipmentProduct.list = _.map(
res.data as any,
function (item: any) {
return { name: item.shmProductsName, ...item };
}
);
}
});
//
const resetState = () => {
state.userId = null; // ID
state.userName = ""; //
state.pricingUserId = null; // id
state.pricingUserName = ""; //
state.productId = null; // id,
state.productName = ""; //
state.minPrice = null;
state.maxPrice = null;
currentSpl.value = null;
deliveryMethod.value = null
};
const getFilter = () => {
emit("handleOk", { ...state, repairFlag: currentSpl.value, deliveryMethod: deliveryMethod.value });
emit("handleDialog", false);
};
</script>
<style lang="scss" scoped>
.box {
padding: 60rpx 30rpx;
::v-deep .u-cell__value {
font-size: 26rpx;
}
.title {
font-size: 26rpx;
color: rgba(0, 0, 0, 1);
font-weight: bold;
padding-left: 30rpx;
padding-top: 20rpx;
padding-bottom: 20rpx;
}
.btn-box {
flex-direction: row;
display: flex;
align-items: center;
padding-left: 30rpx;
> view + view {
margin-left: 20rpx;
}
}
.range {
display: flex;
justify-content: space-between;
align-items: center;
padding-left: 30rpx;
> view {
width: 40%;
}
}
.btn-box1 {
flex-direction: row;
display: flex;
align-items: center;
margin-top: 30rpx;
::v-deep button + button {
margin-left: 50rpx;
}
}
}
</style>

View File

@ -0,0 +1,241 @@
<template>
<u-popup :show="show" mode="left" :closeable="true" @close="handleClose">
<view class="c-dialog-filter">
<view class="title">{{isShipment? '客户' : '供应商'}}筛选</view>
<view class="search">
<u-search
:placeholder="`请输入${isShipment? '客户' : '供应商'}名称 / 卡号搜索`"
v-model="keyword"
@search="handleSearch()"
></u-search>
</view>
<view class="dialog-product-layout">
<!-- 自定义索引列表 -->
<view class="address-book-container">
<!-- 左侧通讯录 -->
<scroll-view
class="scroll-container"
:scroll-y="true"
:scroll-into-view="toView"
:scroll-with-animation="true"
>
<view
class="address-book"
v-for="(item, index) in addressBook"
:key="index"
:id="item.name"
>
<view class="address-book-index">{{ item.name }}</view>
<view
class="contact-container"
v-for="(cItem, index) in item.list"
:key="index"
>
<!-- <img
class="contact-img"
src="http://www.lixia.gov.cn/picture/0/s_97b76c734a6f40f8abba95615cbff1e1.jpg"
alt=""
/> -->
<view
class="contact-detail-container"
@click="handleClick(cItem)"
>
<view class="contact-name">{{ cItem.name }}</view>
<view class="contact-address">{{ cItem.cardCode }}</view>
<!-- <view class="contact-phone">{{ item.phone }}</view> -->
</view>
</view>
</view>
</scroll-view>
<!-- 右侧字母导航条 -->
<view class="letter-nav">
<view
class="item"
:class="{ active: toView === item }"
v-for="(item, index) in indexList"
:key="index"
@click="toSelectIndex(item)"
>{{ item }}</view
>
</view>
</view>
</view>
</view>
</u-popup>
</template>
<script setup lang="ts">
import { CustomerApi, SupplierApi } from "@/services";
const props = defineProps<{
show: boolean;
isShipment: boolean;
}>();
const emit = defineEmits(["handleDialog", "changeUser"]);
const handleClose = () => {
emit("handleDialog", false);
};
const keyword = ref("");
const indexList = [
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z",
"#",
];
const toView = ref("");
const addressBook = ref();
// [
// {
// id: "A",
// data: [
// {
// zh_title: "",
// en_title: "aa",
// address: "910289591",
// phone: "111111",
// },
// {
// zh_title: "",
// en_title: "aaaaa",
// address: "ALL",
// phone: "222222",
// },
// ],
// }
// ];
const toSelectIndex = (item: any) => {
toView.value = item;
};
const handleClick = (item: any) => {
emit("changeUser", item);
emit("handleDialog", false);
};
const handleSearch = () => {
getList();
};
const getList = () => {
if (props.isShipment) {
CustomerApi.getCustomUserListLettera({ name: keyword.value }).then(
(res: any) => {
if (res.code === 200) {
addressBook.value = res.data.reduce((pre: any, curr: any) => {
if (curr.list.length > 0) {
pre.push(curr);
}
return pre;
}, []);
}
}
);
} else {
SupplierApi.getSupplierUserListLettera({ name: keyword.value }).then(
(res: any) => {
if (res.code === 200) {
addressBook.value = res.data.reduce((pre: any, curr: any) => {
if (curr.list.length > 0) {
pre.push(curr);
}
return pre;
}, []);
}
}
);
}
};
watch(
() => props.isShipment,
(newValue, oldValue) => {
getList();
}
);
onMounted(() => {
getList();
});
</script>
<style lang="scss" scoped>
.c-dialog-filter {
width: 95vw;
padding: 25rpx;
.title {
font-weight: 500;
font-size: 32rpx;
color: #000000;
text-align: center;
}
.search {
margin: 30rpx 0px;
}
}
.dialog-product-layout {
height: 80vh;
.address-book-container {
height: 100%;
}
.address-book-index {
font-size: 24rpx;
}
.contact-img {
width: 20px;
height: 20px;
}
.scroll-container {
height: 100%;
}
.letter-nav {
position: fixed;
right: 25rpx;
top: 100px;
font-size: 22rpx;
text-align: center;
.item:hover,
.active {
color: $u-primary;
}
}
.contact-container {
display: flex;
align-items: center;
margin: 2%;
}
.contact-detail-container {
display: flex;
align-items: center;
justify-content: space-between;
width: 80%;
font-size: 22rpx;
.contact-address {
color: rgba(0, 0, 0, 0.65);
}
}
}
</style>

View File

@ -0,0 +1,169 @@
<template>
<u-popup
:show="show"
mode="bottom"
:round="10"
:closeable="true"
@close="handleClose"
>
<view class="c-dialog">
<view class="box"><text>常用时间选择</text></view>
<view class="box-btn">
<text
v-for="(item, index) in state.statusList"
:key="index"
:class="{ active: state.currentStates === item.id }"
@click="handleSelect(item)"
>{{ item.name }}</text
></view
>
<view class="box box-border"
><text>其它时间选择</text
><text class="btn" @click="handleCustom()">自定义</text></view
>
<view v-if="showCalendar">
<view class="line"></view>
<view class="box">
<text @click="showCalendar = false">取消</text>
<text class="btn" @click="confirm()">完成</text>
</view>
<view>{{ state.startTime }} - {{ state.endTime }}</view>
<uni-calendar
:insert="true"
:lunar="true"
:start-date="'2014-1-1'"
:end-date="'2034-1-1'"
:range="true"
@change="handleChangeDate"
color="#00D2E3"
/>
</view>
</view>
</u-popup>
</template>
<script setup lang="ts">
import { formatDate, getCurrentMonthStartAndEnd, getCurrentYearStartAndEnd, timeRange } from "@/utils";
const props = defineProps<{
show: boolean;
}>();
const state = reactive<any>({
startTime: "",
endTime: "",
currentStates: -1,
statusList: [
{
id: 1,
name: "今日",
},
{
id: 2,
name: "昨日",
},
{
id: 3,
name: "本月",
},
{
id: 4,
name: "本年",
},
],
});
const emit = defineEmits(["handleDialog", "changeTime"]);
const handleClose = () => {
emit("handleDialog", false);
};
const handleCustom = () => {
showCalendar.value = true
state.currentStates = -1
}
const handleSelect = (item: any) => {
state.currentStates = item.id;
const range = timeRange(item.id)
state.startTime = range.startTime;
state.endTime = range.endTime
emit("changeTime", {startTime: state.startTime, endTime: state.endTime, name: item.name});
emit("handleDialog", false);
};
const showCalendar = ref(false);
const handleChangeDate = (v: any) => {
const time1 = v.range.before;
const time2 = v.range.after;
if (time1 && time2) {
const date1 = new Date(time1);
const date2 = new Date(time2);
if (date1 < date2) {
state.startTime = formatDate(time1, "{y}-{m}-{d}");
state.endTime = formatDate(time2, "{y}-{m}-{d}");
} else if (date1 > date2) {
state.startTime = formatDate(time2, "{y}-{m}-{d}");
state.endTime = formatDate(time1, "{y}-{m}-{d}");
} else {
state.startTime = formatDate(time1, "{y}-{m}-{d}");
state.endTime = formatDate(time2, "{y}-{m}-{d}");
}
}
};
const confirm = () => {
showCalendar.value = false
emit("changeTime", {startTime: state.startTime, endTime: state.endTime, name: '自定义'});
emit("handleDialog", false);
}
</script>
<style lang="scss" scoped>
::v-deep .u-popup__content {
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 32rpx 32rpx 0rpx 0rpx;
}
.c-dialog {
margin: 65.38rpx 44.87rpx;
font-family: Source Han Sans CN;
font-weight: 500;
font-size: 26rpx;
color: #000000;
.box-btn,
.box {
line-height: 80rpx;
display: flex;
justify-content: space-between;
}
.box-btn {
line-height: 40rpx;
margin-bottom: 30rpx;
text {
font-weight: 400;
font-size: 26rpx;
color: #999999;
width: 140rpx;
background: #ffffff;
border-radius: 6rpx;
border: 1px solid rgba(153, 153, 153, 0.64);
text-align: center;
cursor: pointer;
}
.active {
border-color: $u-primary;
color: $u-primary;
}
}
.btn {
font-weight: 500;
font-size: 26rpx;
color: $u-primary;
}
.box-border {
border-top: 1px solid rgba(233, 233, 233, 0.76);
}
.line {
height: 18rpx;
background: #f8f8f8;
}
}
</style>

View File

@ -7,9 +7,10 @@
ref="form"
:labelWidth="100"
:labelStyle="{ padding: '0rpx 10rpx' }"
:errorType="'border-bottom'"
>
<u-form-item
:prop="`formData[${item.key}]`"
:prop="`formData.${item.key}`"
:label="item.name"
:required="item.required"
v-for="(item, index) in formAttrList"
@ -61,7 +62,7 @@
<script setup lang="ts">
import { CustomerApi, StockCardApi } from "@/services";
import { formatDate } from "@/utils";
import { DeviceType, ImagesType, OrderType } from "@/utils/enum";
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore";
@ -69,16 +70,22 @@ const model1 = reactive<any>({
formData: {},
});
const rules = ref({
"userInfo.userName": {
"formData.stockCardName": {
type: "string",
required: true,
message: "请输入手机号",
message: "请选择出库卡",
trigger: ["blur", "change"],
},
"userInfo.password": {
"formData.name": {
type: "string",
required: true,
message: "请输入密码",
message: "请输入客户名称",
trigger: ["blur", "change"],
},
"formData.contacts": {
type: "string",
required: true,
message: "请输入联系人",
trigger: ["blur", "change"],
},
});
@ -130,8 +137,32 @@ const handleSelect = (key: string, v: any) => {
model1.formData.stockCardId = v.id;
}
};
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 = () => {
if (model1.formData.id) {
CustomerApi.updateCustomUser(model1.formData).then((res) => {
if (res.code === 200) {
@ -152,9 +183,9 @@ const save = () => {
};
const getStockCardList = () => {
StockCardApi.getStockCardList({ pageNum: 1, pageSize: 10 }).then((res) => {
StockCardApi.getStockCardListInfo({ vincolante: StockCardType.Receive }).then((res) => {
if (res.code === 200) {
contrlModalParams.stockCard.list = (res.data as any).list.map(
contrlModalParams.stockCard.list = (res.data as any).map(
(item: any) => {
return { ...item, name: item.cardCode };
}

View File

@ -0,0 +1,399 @@
<template>
<view class="c-card">
<u-form
labelPosition="left"
:model="model1"
:rules="rules"
ref="form"
:labelWidth="80"
:labelStyle="{ padding: '0rpx 10rpx' }"
:errorType="'border-bottom'"
>
<u-form-item
:prop="`order.${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.order as any)[item.key]"
:placeholder="`请输入${item.name}`"
></u-textarea>
<u-input
v-if="item.type === 'select' || item.type === 'input'"
v-model="(model1.order as any)[item.key]"
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
:customStyle="{}"
border="none"
:disabled="item.disabled"
>
<template #suffix>
<text>
{{ item.unit }}
</text>
</template>
</u-input>
<!-- @afterRead="afterRead"
@delete="deletePic" -->
<uni-file-picker
v-if="item.type === 'upload'"
v-model="model1.order.fileLists"
limit="9"
title="最多可上传9张图片"
:auto-upload="false"
fileMediatype="image"
mode="grid"
ref="filesRef"
@delete="handleDelete"
></uni-file-picker>
<u-radio-group
v-if="item.type === 'radio'"
v-model="(model1.order as any)[item.key]"
placement="row"
>
<u-radio activeColor="#00DCEE" label="供应商" :name="3"></u-radio>
&nbsp;&nbsp;&nbsp;
<u-radio activeColor="#00DCEE" label="客户" :name="2"></u-radio>
</u-radio-group>
<template #right v-if="item.type === 'select'">
<u-icon name="arrow-right"></u-icon>
</template>
</u-form-item>
</u-form>
<u-datetime-picker
:show="contrlModalParams.isShowSplTime"
v-model="contrlModalParams.settlementTime"
mode="datetime"
@confirm="(v: any) => {handleTime(v)}"
@cancel="contrlModalParams.isShowSplTime = false"
></u-datetime-picker>
<block
v-for="(item, index) in formAttrList"
:key="index"
>
<u-action-sheet
v-if="item.type === 'select' && item.key !== 'settlementTime'"
: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,
DeviceApi,
FinanceApi,
PictureApi,
ProfileApi,
ReceiveApi,
ReceiveProductApi,
SupplierApi,
} from "@/services";
import { formatDate } from "@/utils";
import { DeviceType, ImagesType, OrderType } from "@/utils/enum";
import _ from "underscore";
const model1 = reactive<any>({
order: {
buttonType: 3,
fileLists: [],
settlementTime: "",
},
supplierList: [],
customerList: []
});
const rules = reactive({
"order.supCusName": {
type: "string",
required: true,
message: "请选择客户",
trigger: ["blur", "change"],
},
"order.settlementTime": {
type: "string",
required: true,
message: "请选择结算时间",
trigger: ["blur", "change"],
},
"order.incidentals": {
type: "string",
required: true,
message: "请输入jin",
trigger: ["blur", "change"],
},
"order.freight": {
type: "string",
required: true,
message: "请输入运费",
trigger: ["blur", "change"],
},
"order.paymentMethodName": {
type: "string",
required: true,
message: "请选择结算方式",
trigger: ["blur", "change"],
},
});
const contrlModalParams = reactive<any>({
isShowSplTime: false,
spltime: "",
user: {
isShow: false,
title: "标题",
list: [],
},
paySelect: {
isShow: false,
title: "标题",
list: [
{
name: "微信",
id: 3,
},
{
name: "现金",
id: 1,
},
{
name: "支付宝",
id: 4,
},
{
name: "转账",
id: 2,
},
],
},
});
const formAttrList = reactive<any>([
{
name: "客户",
key: "customerName",
type: "select",
childKey: "user",
required: true,
unit: "",
fn: () => {
contrlModalParams.user.isShow = true;
contrlModalParams.user.title = "客户";
},
},
{
name: "结算时间",
key: "settlementTime",
type: "select",
unit: "",
required: true,
fn: () => {
contrlModalParams.isShowSplTime = true;
},
},
{
name: "金额",
key: "totalPrice",
type: "input",
required: true,
unit: "元",
},
{
name: "结算方式",
key: "paymentMethodName",
type: "select",
childKey: "paySelect",
required: true,
unit: "",
fn: () => {
contrlModalParams.paySelect.isShow = true;
contrlModalParams.paySelect.title = "结算方式";
},
},
{
name: "备注",
key: "remakes",
type: "textarea",
},
{
name: "支付单据",
key: "photo",
type: "upload",
},
]);
//
watch(
[
() => model1.order.buttonType,
],
([buttonTypeNew]) => {
if (buttonTypeNew === 3) {
contrlModalParams.user.list = model1.supplierList;
} else if (buttonTypeNew === 2) {
contrlModalParams.user.list = model1.customerList;
}
}
);
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: "已删除" });
}
});
}
};
const filesRef = ref();
const handleUpload = () => {
// console.log(event.tempFilePaths)
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.Income, //
});
}
})
.catch((e) => {
return;
});
});
});
};
const handleSelect = (key: string, v: any) => {
contrlModalParams[key].isShow = false;
if (key === "user") {
model1.order.customerName = v.name;
model1.order.customerId = v.id;
} else if (key === "paySelect") {
model1.order.paymentMethodName = v.name;
model1.order.paymentMethod = v.id;
}
};
//
// SupplierApi.getSupplierUserList({}).then((res) => {
// if (res.code === 200) {
// model1.supplierList = res.data;
// contrlModalParams.user.list = res.data;
// }
// });
//
CustomerApi.getCustomUserList({}).then((res) => {
if (res.code === 200) {
model1.customerList = res.data;
contrlModalParams.user.list = res.data;
}
});
const upload = () => {
Promise.all(handleUpload()).then((res) => {
//
if (res.length > 0) {
PictureApi.addListAnnex({ annexPos: res }).then((res1) => {
if (res1.code === 200) {
console.log("*** 资源文件更新成功");
}
});
}
});
};
/**
* 校验
*/
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 = () => {
model1.order.paymentType = 1 //
FinanceApi.addIncome(model1.order).then((res) => {
if (res.code === 200) {
model1.order.id = res.data;
upload();
uni.redirectTo({
url: "/pagesHome/index", //
});
}
});
};
const handleTime = (v: any) => {
model1.order.settlementTime = formatDate(v.value, "{y}-{m}-{d} {h}:{i}:{s}");
contrlModalParams.isShowSplTime = false;
};
</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>

View File

@ -0,0 +1,505 @@
<template>
<view class="c-card">
<u-form
labelPosition="left"
:model="model1"
:rules="model1.order.buttonType === 3 ? rules1 : rules2"
ref="form"
:labelWidth="80"
:labelStyle="{ padding: '0rpx 10rpx' }"
:errorType="'border-bottom'"
>
<u-form-item
:prop="`order.${item.key}`"
:label="item.name"
:required="item.required"
v-for="(item, index) in model1.order.buttonType === 3
? formAttrList1
: formAttrList2"
:key="index"
@click="item.fn"
>
<u-textarea
v-if="item.type === 'textarea'"
v-model="(model1.order as any)[item.key]"
:placeholder="`请输入${item.name}`"
></u-textarea>
<u-input
v-if="item.type === 'select' || item.type === 'input'"
v-model="(model1.order as any)[item.key]"
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
:customStyle="{}"
border="none"
:disabled="item.disabled"
>
<template #suffix>
<text>
{{ item.unit }}
</text>
</template>
</u-input>
<!-- @afterRead="afterRead"
@delete="deletePic" -->
<uni-file-picker
v-if="item.type === 'upload'"
v-model="model1.order.fileLists"
limit="9"
title="最多可上传9张图片"
:auto-upload="false"
fileMediatype="image"
mode="grid"
ref="filesRef"
@delete="handleDelete"
></uni-file-picker>
<u-radio-group
v-if="item.type === 'radio'"
v-model="(model1.order as any)[item.key]"
placement="row"
>
<u-radio activeColor="#00DCEE" label="供应商" :name="3"></u-radio>
&nbsp;&nbsp;&nbsp;
<u-radio activeColor="#00DCEE" label="客户" :name="2"></u-radio>
</u-radio-group>
<template #right v-if="item.type === 'select'">
<u-icon name="arrow-right"></u-icon>
</template>
</u-form-item>
</u-form>
<u-datetime-picker
:show="contrlModalParams.isShowSplTime"
v-model="contrlModalParams.settlementTime"
mode="datetime"
@confirm="(v: any) => {handleTime(v)}"
@cancel="contrlModalParams.isShowSplTime = false"
></u-datetime-picker>
<block
v-for="(item, index) in model1.order.buttonType === 3
? formAttrList1
: formAttrList2"
:key="index"
>
<u-action-sheet
v-if="item.type === 'select' && item.key !== 'settlementTime'"
: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,
DeviceApi,
FinanceApi,
PictureApi,
ProfileApi,
ReceiveApi,
ReceiveProductApi,
SupplierApi,
} from "@/services";
import { formatDate } from "@/utils";
import { DeviceType, ImagesType, OrderType } from "@/utils/enum";
import _ from "underscore";
const model1 = reactive<any>({
order: {
buttonType: 3,
fileLists: [],
settlementTime: "",
},
supplierList: [],
customerList: []
});
const rules1 = reactive({
"order.supCusName": {
type: "string",
required: true,
message: "请选择供应商",
trigger: ["blur", "change"],
},
"order.settlementTime": {
type: "string",
required: true,
message: "请选择结算时间",
trigger: ["blur", "change"],
},
"order.totalPrice": {
type: "string",
required: true,
message: "请输入金额",
trigger: ["blur", "change"],
},
"order.paymentMethodName": {
type: "string",
required: true,
message: "请选择结算方式",
trigger: ["blur", "change"],
},
});
const rules2 = reactive({
"order.supCusName": {
type: "string",
required: true,
message: "请选择客户",
trigger: ["blur", "change"],
},
"order.settlementTime": {
type: "string",
required: true,
message: "请选择结算时间",
trigger: ["blur", "change"],
},
"order.incidentals": {
type: "string",
required: true,
message: "请输入杂费",
trigger: ["blur", "change"],
},
"order.freight": {
type: "string",
required: true,
message: "请输入运费",
trigger: ["blur", "change"],
},
"order.paymentMethodName": {
type: "string",
required: true,
message: "请选择结算方式",
trigger: ["blur", "change"],
},
});
const contrlModalParams = reactive<any>({
isShowSplTime: false,
spltime: "",
user: {
isShow: false,
title: "标题",
list: [],
},
paySelect: {
isShow: false,
title: "标题",
list: [
{
name: "微信",
id: 3,
},
{
name: "现金",
id: 1,
},
{
name: "支付宝",
id: 4,
},
{
name: "转账",
id: 2,
},
],
},
});
const formAttrList1 = reactive<any>([
{
name: "付款类型",
key: "buttonType",
required: true,
type: "radio",
},
{
name: "供应商",
key: "supCusName",
type: "select",
childKey: "user",
required: true,
unit: "",
fn: () => {
contrlModalParams.user.isShow = true;
contrlModalParams.user.title = "供应商";
},
},
{
name: "结算时间",
key: "settlementTime",
type: "select",
unit: "",
required: true,
fn: () => {
contrlModalParams.isShowSplTime = true;
},
},
{
name: "金额",
key: "totalPrice",
type: "input",
required: true,
unit: "元",
},
{
name: "结算方式",
key: "paymentMethodName",
type: "select",
childKey: "paySelect",
required: true,
unit: "",
fn: () => {
contrlModalParams.paySelect.isShow = true;
contrlModalParams.paySelect.title = "结算方式";
},
},
{
name: "备注",
key: "remakes",
type: "textarea",
},
{
name: "支付单据",
key: "photo",
type: "upload",
},
]);
const formAttrList2 = reactive<any>([
{
name: "付款类型",
key: "buttonType",
required: true,
type: "radio",
},
{
name: "客户",
key: "supCusName",
type: "select",
childKey: "user",
required: true,
unit: "",
fn: () => {
contrlModalParams.user.isShow = true;
contrlModalParams.user.title = "客户";
},
},
{
name: "结算时间",
key: "settlementTime",
type: "select",
unit: "",
required: true,
fn: () => {
contrlModalParams.isShowSplTime = true;
},
},
{
name: "杂费",
key: "incidentals",
type: "input",
required: true,
unit: "元",
},
{
name: "运费",
key: "freight",
type: "input",
required: true,
unit: "元",
},
{
name: "结算方式",
key: "paymentMethodName",
type: "select",
childKey: "paySelect",
required: true,
unit: "",
fn: () => {
contrlModalParams.paySelect.isShow = true;
contrlModalParams.paySelect.title = "结算方式";
},
},
{
name: "备注",
key: "remakes",
type: "textarea",
},
{
name: "支付单据",
key: "photo",
type: "upload",
},
]);
//
watch(
[
() => model1.order.buttonType,
],
([buttonTypeNew]) => {
if (buttonTypeNew === 3) {
contrlModalParams.user.list = model1.supplierList;
} else if (buttonTypeNew === 2) {
contrlModalParams.user.list = model1.customerList;
}
}
);
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: "已删除" });
}
});
}
};
const filesRef = ref();
const handleUpload = () => {
// console.log(event.tempFilePaths)
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.Pay, //
});
}
})
.catch((e) => {
return;
});
});
});
};
const handleSelect = (key: string, v: any) => {
contrlModalParams[key].isShow = false;
if (key === "user") {
model1.order.supCusName = v.name;
model1.order.supCusId = v.id;
} else if (key === "paySelect") {
model1.order.paymentMethodName = v.name;
model1.order.paymentMethod = v.id;
}
};
//
SupplierApi.getSupplierUserList({}).then((res) => {
if (res.code === 200) {
model1.supplierList = res.data;
contrlModalParams.user.list = res.data;
}
});
//
CustomerApi.getCustomUserList({}).then((res) => {
if (res.code === 200) {
model1.customerList = res.data;
}
});
const upload = () => {
Promise.all(handleUpload()).then((res) => {
//
if (res.length > 0) {
PictureApi.addListAnnex({ annexPos: res }).then((res1) => {
if (res1.code === 200) {
console.log("*** 资源文件更新成功");
}
});
}
});
};
/**
* 校验
*/
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 = () => {
model1.order.paymentType = model1.order.buttonType
if (model1.order.buttonType === 2) {
model1.order.totalPrice = parseInt(model1.order.freight) + parseInt(model1.order.incidentals)
}
FinanceApi.addPaymentDetails(model1.order).then((res) => {
if (res.code === 200) {
model1.order.id = res.data;
upload();
uni.redirectTo({
url: "/pagesHome/index", //
});
}
});
};
const handleTime = (v: any) => {
model1.order.settlementTime = formatDate(v.value, "{y}-{m}-{d} {h}:{i}:{s}");
contrlModalParams.isShowSplTime = false;
};
</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>

View File

@ -7,9 +7,10 @@
ref="form"
:labelWidth="100"
:labelStyle="{ padding: '0rpx 10rpx' }"
:errorType="'border-bottom'"
>
<u-form-item
:prop="`formData[${item.key}]`"
:prop="`formData.${item.key}`"
:label="item.name"
:required="item.required"
v-for="(item, index) in formAttrList"
@ -53,7 +54,6 @@
:closeOnClickAction="true"
:scroll="true"
></u-action-sheet>
</block>
</view>
<view class="btn-box">
@ -71,16 +71,40 @@ const model1 = reactive<any>({
formData: {},
});
const rules = ref({
"userInfo.userName": {
"formData.reProductsName": {
type: "string",
required: true,
message: "请输入手机号",
message: "请输入货产品",
trigger: ["blur", "change"],
},
"userInfo.password": {
"formData.reCategoryName": {
type: "string",
required: true,
message: "请输入密码",
message: "请选择收货分类",
trigger: ["blur", "change"],
},
"formData.substationName": {
type: "string",
required: true,
message: "请输入所属分站",
trigger: ["blur", "change"],
},
"formData.minPrice": {
type: "string",
required: true,
message: "请输入最低价",
trigger: ["blur", "change"],
},
"formData.maxPrice": {
type: "string",
required: true,
message: "请输入最高价",
trigger: ["blur", "change"],
},
"formData.commonPrice": {
type: "string",
required: true,
message: "请输入常用价格",
trigger: ["blur", "change"],
},
});
@ -150,7 +174,32 @@ const handleSelect = (key: string, v: any) => {
}
};
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 = () => {
if (model1.formData.id) {
GoodsApi.EditReceiveProduct(model1.formData).then((res) => {
if (res.code === 200) {

View File

@ -7,9 +7,10 @@
ref="form"
:labelWidth="100"
:labelStyle="{ padding: '0rpx 10rpx' }"
:errorType="'border-bottom'"
>
<u-form-item
:prop="`formData[${item.key}]`"
:prop="`formData.${item.key}`"
:label="item.name"
:required="item.required"
v-for="(item, index) in formAttrList"
@ -69,16 +70,10 @@ const model1 = reactive<any>({
formData: {},
});
const rules = ref({
"userInfo.userName": {
"formData.reCategoryName": {
type: "string",
required: true,
message: "请输入手机号",
trigger: ["blur", "change"],
},
"userInfo.password": {
type: "string",
required: true,
message: "请输入密码",
message: "请输入收货分类",
trigger: ["blur", "change"],
},
});
@ -86,14 +81,17 @@ const contrlModalParams = reactive<any>({
cardType: {
isShow: false,
title: "标题",
list: [{
id: 1,
name: '出库卡'
},{
id: 2,
name: '入库卡'
}],
}
list: [
{
id: 1,
name: "出库卡",
},
{
id: 2,
name: "入库卡",
},
],
},
});
const formAttrList = reactive<any>([
@ -112,8 +110,32 @@ const handleSelect = (key: string, v: any) => {
model1.formData.type = v.id;
}
};
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 = () => {
if (model1.formData.id) {
GoodsApi.editReceiveCategory(model1.formData).then((res) => {
if (res.code === 200) {
@ -133,15 +155,14 @@ const save = () => {
}
};
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 = '入库卡'
model1.formData.typeName = "出库卡";
} else if (model1.formData.type === 2) {
model1.formData.typeName = "入库卡";
}
//
uni.setNavigationBarTitle({

View File

@ -7,9 +7,10 @@
ref="form"
:labelWidth="100"
:labelStyle="{ padding: '0rpx 10rpx' }"
:errorType="'border-bottom'"
>
<u-form-item
:prop="`formData[${item.key}]`"
:prop="`formData.${item.key}`"
:label="item.name"
:required="item.required"
v-for="(item, index) in formAttrList"
@ -96,18 +97,12 @@ const model1 = reactive<any>({
formData: {},
});
const rules = ref({
"userInfo.userName": {
"formData.roleName": {
type: "string",
required: true,
message: "请输入手机号",
message: "请输入角色名称",
trigger: ["blur", "change"],
},
"userInfo.password": {
type: "string",
required: true,
message: "请输入密码",
trigger: ["blur", "change"],
},
}
});
const contrlModalParams = reactive<any>({
checkedMap: {},
@ -121,6 +116,7 @@ const formAttrList = reactive<any>([
name: "角色名称",
key: "roleName",
type: "input",
required: true,
},
{
name: "权限配置",
@ -138,8 +134,32 @@ const formAttrList = reactive<any>([
// model1.formData.roleIds = [v.id];
// }
// };
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 = () => {
let list: any = [];
contrlModalParams.menu.list.forEach((item: any) => {
item.childrenList.forEach((c: any) => {
@ -149,13 +169,15 @@ const save = () => {
});
});
if (model1.formData.id) {
ProfileApi.updateRole({...deleteBaseKey(model1.formData), list}).then((res) => {
if (res.code === 200) {
uni.redirectTo({
url: "/pagesApp/role", //
});
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) {

View File

@ -7,9 +7,10 @@
ref="form"
:labelWidth="100"
:labelStyle="{ padding: '0rpx 10rpx' }"
:errorType="'border-bottom'"
>
<u-form-item
:prop="`formData[${item.key}]`"
:prop="`formData.${item.key}`"
:label="item.name"
:required="item.required"
v-for="(item, index) in formAttrList"
@ -81,21 +82,21 @@ import { formatDate } from "@/utils";
import { DeviceType, ImagesType, OrderType } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore";
const { proxy } = getCurrentInstance();
const { proxy }: any = getCurrentInstance();
const model1 = reactive<any>({
formData: {},
});
const rules = ref({
"userInfo.userName": {
"formData.shmProductsName": {
type: "string",
required: true,
message: "请输入手机号",
message: "请输入出货产品",
trigger: ["blur", "change"],
},
"userInfo.password": {
"formData.reCategoryName": {
type: "string",
required: true,
message: "请输入密码",
message: "请选择出货分类",
trigger: ["blur", "change"],
},
});
@ -154,21 +155,45 @@ const handleChange = (e: any) => {
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
model1.formData.shmCategoryId = e.value[1].id;
model1.formData.reCategoryName = e.value[1].shmCategoryName;
contrlModalParams["reCategory"].isShow = false;
}
};
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 = () => {
if (model1.formData.id) {
// GoodsApi.EditReceiveProduct(model1.formData).then((res) => {
// if (res.code === 200) {
// uni.redirectTo({
// url: "/pagesApp/shipmentProduct", //
// });
// }
// });
GoodsApi.editShipmentProduct(model1.formData).then((res) => {
if (res.code === 200) {
uni.redirectTo({
url: "/pagesApp/shipmentProduct", //
});
}
});
} else {
GoodsApi.addShipmentProduct(model1.formData).then((res) => {
if (res.code === 200) {

View File

@ -7,9 +7,10 @@
ref="form"
:labelWidth="100"
:labelStyle="{ padding: '0rpx 10rpx' }"
:errorType="'border-bottom'"
>
<u-form-item
:prop="`formData[${item.key}]`"
:prop="`formData.${item.key}`"
:label="item.name"
:required="item.required"
v-for="(item, index) in formAttrList"
@ -69,16 +70,16 @@ const model1 = reactive<any>({
formData: {},
});
const rules = ref({
"userInfo.userName": {
"formData.parentName": {
type: "string",
required: true,
message: "请输入手机号",
message: "请选择上级菜单",
trigger: ["blur", "change"],
},
"userInfo.password": {
"formData.shmCategoryName": {
type: "string",
required: true,
message: "请输入密码",
message: "请输入出货分类",
trigger: ["blur", "change"],
},
});
@ -86,11 +87,13 @@ const contrlModalParams = reactive<any>({
parent: {
isShow: false,
title: "标题",
list: [{
id: 0,
name: '主分类'
}],
}
list: [
{
id: 0,
name: "主分类",
},
],
},
});
const formAttrList = reactive<any>([
@ -120,8 +123,32 @@ const handleSelect = (key: string, v: any) => {
model1.formData.parentId = v.id;
}
};
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 = () => {
if (model1.formData.id) {
GoodsApi.editReceiveCategory(model1.formData).then((res) => {
if (res.code === 200) {
@ -131,7 +158,7 @@ const save = () => {
}
});
} else {
GoodsApi.addShmCategory({...model1.formData}).then((res) => {
GoodsApi.addShmCategory({ ...model1.formData }).then((res) => {
if (res.code === 200) {
uni.redirectTo({
url: "/pagesApp/shipmentType", //
@ -141,7 +168,6 @@ const save = () => {
}
};
onLoad((option) => {
//
const title = (option as any).title;

View File

@ -7,9 +7,10 @@
ref="form"
:labelWidth="100"
:labelStyle="{ padding: '0rpx 10rpx' }"
:errorType="'border-bottom'"
>
<u-form-item
:prop="`formData[${item.key}]`"
:prop="`formData.${item.key}`"
:label="item.name"
:required="item.required"
v-for="(item, index) in formAttrList"
@ -60,7 +61,7 @@
</template>
<script setup lang="ts">
import { StockCardApi } from "@/services";
import { formatDate } from "@/utils";
import { deleteBaseKey, formatDate } from "@/utils";
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore";
@ -69,31 +70,34 @@ const model1 = reactive<any>({
formData: {},
});
const rules = ref({
"userInfo.userName": {
"formData.cardCode": {
type: "string",
required: true,
message: "请输入手机号",
message: "请输入号",
trigger: ["blur", "change"],
},
"userInfo.password": {
"formData.typeName": {
type: "string",
required: true,
message: "请输入密码",
message: "请选择类型",
trigger: ["blur", "change"],
},
}
});
const contrlModalParams = reactive<any>({
cardType: {
isShow: false,
title: "标题",
list: [{
id: 1,
name: '出库卡'
},{
id: 2,
name: '入库卡'
}],
}
list: [
{
id: 1,
name: "出库卡",
},
{
id: 2,
name: "入库卡",
},
],
},
});
const formAttrList = reactive<any>([
@ -123,10 +127,34 @@ const handleSelect = (key: string, v: any) => {
model1.formData.type = v.id;
}
};
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 = () => {
if (model1.formData.id) {
StockCardApi.updateStockCard(model1.formData).then((res) => {
StockCardApi.updateStockCard({...deleteBaseKey(model1.formData)}).then((res) => {
if (res.code === 200) {
uni.redirectTo({
url: "/pagesApp/stockCard", //
@ -144,15 +172,14 @@ const save = () => {
}
};
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 = '入库卡'
model1.formData.typeName = "出库卡";
} else if (model1.formData.type === 2) {
model1.formData.typeName = "入库卡";
}
//
uni.setNavigationBarTitle({

View File

@ -7,9 +7,10 @@
ref="form"
:labelWidth="100"
:labelStyle="{ padding: '0rpx 10rpx' }"
:errorType="'border-bottom'"
>
<u-form-item
:prop="`formData[${item.key}]`"
:prop="`formData.${item.key}`"
:label="item.name"
:required="item.required"
v-for="(item, index) in formAttrList"
@ -61,7 +62,7 @@
<script setup lang="ts">
import { StockCardApi, SupplierApi } from "@/services";
import { formatDate } from "@/utils";
import { DeviceType, ImagesType, OrderType } from "@/utils/enum";
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore";
@ -69,16 +70,22 @@ const model1 = reactive<any>({
formData: {},
});
const rules = ref({
"userInfo.userName": {
"formData.stockCardName": {
type: "string",
required: true,
message: "请输入手机号",
message: "请选择卡号",
trigger: ["blur", "change"],
},
"userInfo.password": {
"formData.name": {
type: "string",
required: true,
message: "请输入密码",
message: "请输入供应商",
trigger: ["blur", "change"],
},
"formData.supplierTypeName": {
type: "string",
required: true,
message: "请选择供应商分类",
trigger: ["blur", "change"],
},
});
@ -195,7 +202,32 @@ const handleSelect = (key: string, v: any) => {
}
};
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 = () => {
if (model1.formData.id) {
SupplierApi.updateSupplierUser(model1.formData).then((res) => {
if (res.code === 200) {
@ -224,9 +256,9 @@ const getSupplierTypeList = () => {
};
const getStockCardList = () => {
StockCardApi.getStockCardList({ pageNum: 1, pageSize: 10 }).then((res) => {
StockCardApi.getStockCardListInfo({ vincolante: StockCardType.Receive }).then((res) => {
if (res.code === 200) {
contrlModalParams.stockCard.list = (res.data as any).list.map(
contrlModalParams.stockCard.list = (res.data as any).map(
(item: any) => {
return { ...item, name: item.cardCode };
}

View File

@ -7,9 +7,10 @@
ref="form"
:labelWidth="100"
:labelStyle="{ padding: '0rpx 10rpx' }"
:errorType="'border-bottom'"
>
<u-form-item
:prop="`formData[${item.key}]`"
:prop="`formData.${item.key}`"
:label="item.name"
:required="item.required"
v-for="(item, index) in formAttrList"
@ -69,31 +70,28 @@ const model1 = reactive<any>({
formData: {},
});
const rules = ref({
"userInfo.userName": {
"formData.name": {
type: "string",
required: true,
message: "请输入手机号",
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: '入库卡'
}],
}
list: [
{
id: 1,
name: "出库卡",
},
{
id: 2,
name: "入库卡",
},
],
},
});
const formAttrList = reactive<any>([
@ -113,7 +111,33 @@ const handleSelect = (key: string, v: any) => {
}
};
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 = () => {
if (model1.formData.id) {
SupplierApi.updateSupplierType(model1.formData).then((res) => {
if (res.code === 200) {
@ -133,15 +157,14 @@ const save = () => {
}
};
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 = '入库卡'
model1.formData.typeName = "出库卡";
} else if (model1.formData.type === 2) {
model1.formData.typeName = "入库卡";
}
//
uni.setNavigationBarTitle({

View File

@ -7,9 +7,10 @@
ref="form"
:labelWidth="100"
:labelStyle="{ padding: '0rpx 10rpx' }"
:errorType="'border-bottom'"
>
<u-form-item
:prop="`formData[${item.key}]`"
:prop="`formData.${item.key}`"
:label="item.name"
:required="item.required"
v-for="(item, index) in formAttrList"
@ -70,13 +71,13 @@ const model1 = reactive<any>({
formData: {},
});
const rules = ref({
"userInfo.userName": {
"formData.userName": {
type: "string",
required: true,
message: "请输入手机号",
message: "请输入用户名",
trigger: ["blur", "change"],
},
"userInfo.password": {
"formData.password": {
type: "string",
required: true,
message: "请输入密码",
@ -92,14 +93,16 @@ const contrlModalParams = reactive<any>({
gender: {
isShow: false,
title: "标题",
list: [{
id: 1,
name: '男'
},
{
id: 2,
name: '女'
}],
list: [
{
id: 1,
name: "男",
},
{
id: 2,
name: "女",
},
],
},
});
@ -160,7 +163,33 @@ const handleSelect = (key: string, v: any) => {
}
};
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 = () => {
if (model1.formData.id) {
ProfileApi.updateUserById(model1.formData).then((res) => {
if (res.code === 200) {
@ -170,7 +199,7 @@ const save = () => {
}
});
} else {
ProfileApi.addUser({userType: 1, ...model1.formData}).then((res) => {
ProfileApi.addUser({ userType: 1, ...model1.formData }).then((res) => {
if (res.code === 200) {
uni.redirectTo({
url: "/pagesApp/user", //

View File

@ -0,0 +1,76 @@
<template>
<view class="box">
<view>{{ obj.supCusName }}</view>
<view
>结算时间<text>{{ obj.settlementTime }}</text></view
>
<view
>单据编号<text>{{ obj.revenueNumber }}</text></view
>
<view
>收款类型<text>{{ getPayment(obj) }}</text></view
>
<view
>结算金额<text
> {{ obj.totalPrice }}</text
>
</view>
<view
>结算方式<text>{{ getPaymentMethod(obj) }}</text></view
>
<view
>收款人<text>{{ obj.revenueName }}</text></view
>
<view
>出货单号
<text>{{ obj.orderNumber }}</text></view
>
<up-image :show-loading="true" v-for="(item, index) in obj.fileLists" :key="index" :src="item.url" width="80px" height="80px"></up-image>
</view>
</template>
<script setup lang="ts">
import { FinanceApi, PictureApi } from "@/services";
import { ImagesType, OrderType } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app";
const obj = ref<any>({});
const getPayment = (item: any) => {
return ["出货单收款", "其他收款"][
item.paymentType
];
};
const getPaymentMethod = (item: any) => {
return ["", "现金", "转账", "微信", "支付宝"][item.paymentMethod];
};
onLoad((option: any) => {
//
FinanceApi.getRevenueDetailsById({ id: option.id }).then((res) => {
if (res.code === 200) {
obj.value = res.data;
}
});
PictureApi.getAnnex({
businessId: option.id,
orderType: OrderType.Income,
imagesType: ImagesType.NORMARL,
}).then((res) => {
if (res.code === 200) {
obj.value.fileLists = res.data;
}
});
});
</script>
<style lang="scss" scoped>
.box {
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
font-size: 26rpx;
margin: 26rpx;
padding: 26rpx;
line-height: 50rpx;
text {
font-size: 24rpx;
color: rgba(0, 0, 0, 0.7);
}
}
</style>

View File

@ -0,0 +1,80 @@
<template>
<view class="box">
<view>{{ obj.supCusName }}</view>
<view
>结算时间<text>{{ obj.settlementTime }}</text></view
>
<view
>单据编号<text>{{ obj.paymentNumber }}</text></view
>
<view
>付款类型<text>{{ getPayment(obj) }}</text></view
>
<view
>付款金额<text v-if="obj.paymentType === 0 || obj.paymentType === 3"
> {{ obj.totalPrice }}</text
>
<text v-else
>运费 {{ obj.freight }}&nbsp;&nbsp;&nbsp;杂费
{{ obj.incidentals }}</text
>
</view>
<view
>结算方式<text>{{ getPaymentMethod(obj) }}</text></view
>
<view
>付款人<text>{{ obj.paymentName }}</text></view
>
<view v-if="obj.paymentType === 0 || obj.paymentType === 1"
>{{ obj.paymentType === 0 ? "收货" : "出货" }}单号
<text>{{ obj.orderNumber }}</text></view
>
<up-image :show-loading="true" v-for="(item, index) in obj.fileLists" :key="index" :src="item.url" width="80px" height="80px"></up-image>
</view>
</template>
<script setup lang="ts">
import { FinanceApi, PictureApi } from "@/services";
import { ImagesType, OrderType } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app";
const obj = ref<any>({});
const getPayment = (item: any) => {
return ["供应商付款", "客户付款", "客户(手动)", "供应商(手动)"][
item.paymentType
];
};
const getPaymentMethod = (item: any) => {
return ["", "现金", "转账", "微信", "支付宝"][item.paymentMethod];
};
onLoad((option: any) => {
//
FinanceApi.getByPaymentId({ id: option.id }).then((res) => {
if (res.code === 200) {
obj.value = res.data;
}
});
PictureApi.getAnnex({
businessId: option.id,
orderType: OrderType.Pay,
imagesType: ImagesType.NORMARL,
}).then((res) => {
if (res.code === 200) {
obj.value.fileLists = res.data;
}
});
});
</script>
<style lang="scss" scoped>
.box {
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
font-size: 26rpx;
margin: 26rpx;
padding: 26rpx;
line-height: 50rpx;
text {
font-size: 24rpx;
color: rgba(0, 0, 0, 0.7);
}
}
</style>

View File

@ -12,26 +12,38 @@
></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.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>
<page-view
@loadList="
(v) => {
getList(v);
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="100"
:isLoading="pageList.isLoading"
>
<view class="box">
<view v-for="(item, index) in pageList.list" :key="index">
<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>
</view>
</view>
</page-view>
</view>
</template>
<script setup lang="ts">
import { CustomerApi } from "@/services";
const keyword = ref("");
import { UsersType } from "@/utils/enum";
import PageView from "@/components/PageView/index.vue";
const state = reactive<any>({
name: "",
});
@ -41,6 +53,13 @@ const pageList: PageResult<Customer> = reactive({
pageNum: 1,
pageSize: 10,
});
const resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
const add = () => {
uni.navigateTo({
url: "/pagesApp/components/addCustomer", //
@ -53,36 +72,46 @@ const edit = (item: any) => {
JSON.stringify(item), //
});
};
const handleSearch = () => {
resetPageList();
getList();
};
const deleteCustomer = (item: any) => {
CustomerApi.updateCustomUser({ isDeleted: true, id: item.id }).then((res) => {
if (res.code === 200) {
getCustomUserPage();
getList();
}
});
};
const handleSearch = () => {
getCustomUserPage();
};
const getCustomUserPage = () => {
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: 10,
pageNum: 1,
pageSize: pageList.pageSize,
pageNum: pageList.pageNum,
name: state.name,
};
if (state.supplierTypeId > -1) {
params.supplierTypeId = state.supplierTypeId;
}
pageList.isLoading = true;
CustomerApi.getCustomUserPage(params).then((res) => {
if (res.code === 200) {
if (res.code === 200) {
(pageList as any).list = (res.data as any).list;
}
pageList.isLoading = false;
(pageList as any).list = (res.data as any).list;
pageList.total = (res.data as any).total;
}
});
};
onMounted(() => {
getCustomUserPage();
getList();
});
</script>
<style lang="scss" scoped>
@ -92,12 +121,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;
@ -107,9 +142,9 @@ onMounted(() => {
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
padding: 0rpx 20rpx;
padding: 10rpx 20rpx;
font-weight: 400;
font-size: 26rpx;
font-size: 28rpx;
color: #000000;
line-height: 41rpx;
margin-top: 30rpx;
@ -118,6 +153,7 @@ onMounted(() => {
align-items: center;
justify-content: space-between;
padding: 20rpx 0rpx;
.op-box {
display: flex;
.btn + .btn {
@ -127,10 +163,15 @@ onMounted(() => {
background: #ff9d55;
border-radius: 24rpx;
font-weight: 500;
font-size: 26rpx;
font-size: 28rpx;
color: #ffffff;
padding: 6rpx 30rpx;
}
.btn_text {
font-weight: 500;
font-size: 24rpx;
color: #00dcee;
}
}
}
> view + view {

View File

@ -0,0 +1,333 @@
<template>
<view class="search">
<u-search
placeholder="请输入出货单号"
v-model="keyword"
:showAction="false"
:bgColor="'#fff'"
:borderColor="'rgba(0, 0, 0, 0.1)'"
:placeholderColor="'#C1C1C1'"
@search="handleSearch()"
></u-search>
<view class="btn" @click="handleAdd()"> 创建 </view>
</view>
<view class="filter">
<!-- -->
<view @click="handleDialog('showTime', true)"
><text>{{ state.name }}</text
><u-icon name="arrow-down"></u-icon
></view>
<view @click="state.isShowStatus = true"
><text>费用类型</text><u-icon name="arrow-down"></u-icon
></view>
<view class="btn" @click="handleDialog('showFilter', true)">筛选</view>
</view>
<view class="show-time">
<view v-if="state.name === '昨日' || state.name === '今日'">{{
state.startTime
}}</view>
<view v-else>{{ state.startTime }} - {{ state.endTime }}</view>
</view>
<page-view
@loadList="
(v) => {
getList(v);
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="140"
:isLoading="pageList.isLoading"
>
<view class="list">
<u-swipe-action>
<u-swipe-action-item
:options="options1"
v-for="(item, index) in pageList.list"
:key="index"
@click="handleItem(item)"
>
<view
class="item"
:style="{ border: index === 0 ? 'none' : '' }"
@click="getDetail(item)"
>
<u-row justify="space-between">
<u-col span="9">
<view class="">
<view class=""> {{ item.customerName || "-" }} </view>
<view class=""> {{ item.revenueNumber }} </view>
<view class="time">
结算时间{{ item.settlementTime }}
</view>
</view>
</u-col>
<u-col span="3">
<view class="amount">
<view> {{ item.totalPrice }}</view>
<view class="tip">{{ getPayment(item) }}</view>
</view>
</u-col>
</u-row>
</view>
</u-swipe-action-item>
</u-swipe-action>
</view>
</page-view>
<!-- 时间弹框 -->
<TimeDialog
ref="timeDialog"
:show="showDialog.showTime"
@handleDialog="(v:boolean) => {handleDialog('showTime', v)}"
@changeTime="changeTime"
/>
<!-- 费用类型 -->
<u-action-sheet
:closeOnClickOverlay="true"
:closeOnClickAction="true"
:actions="state.statusList"
:title="'单据状态'"
:show="state.isShowStatus"
@select="handleSelectStatus"
@close="state.isShowStatus = false"
></u-action-sheet>
<!-- 筛选弹框 -->
<FilterDialog
:show="showDialog.showFilter"
@handleDialog="(v:boolean) => {handleDialog('showFilter', v)}"
@changeOther="changeOther"
:isShipment="true"
/>
</template>
<script setup lang="ts">
import { FinanceApi } from "@/services";
import PageView from "@/components/PageView/index.vue";
import { formatDate, getCurrentMonthStartAndEnd } from "@/utils";
import TimeDialog from "./components/TimeDialog.vue";
import FilterDialog from "./components/CustomFilterDialog.vue";
const options1 = ref([
{
text: "删除",
style: {
backgroundColor: "rgba(217, 4, 30, 1)",
fontSize: "24rpx",
},
},
]);
const keyword = ref("");
const state = reactive({
startTime: formatDate(getCurrentMonthStartAndEnd().start, "{y}-{m}-{d}"),
endTime: formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}"),
name: "本月",
currentPaymentType: -1,
isShowStatus: false,
statusList: [
{
name: "全部",
key: -1,
},
{
name: "出货单收款",
key: 0,
},
{
name: "其他收款",
key: 1,
}
],
userId: -1,
userType: -1,
params: {},
});
const getPayment = (item: any) => {
return ["出货单收款", "其他收款"][
item.paymentType
];
};
const showDialog = <
{
[key: string]: boolean;
}
>reactive({
showTime: false,
showFilter: false,
});
const handleDialog = (key: string, v: boolean) => {
showDialog[key] = v;
};
const handleSelectStatus = (v: any) => {
state.isShowStatus = false;
state.currentPaymentType = v.key;
resetPageList();
getList();
};
const changeOther = (obj: any) => {
state.userId = obj.userId;
state.userType = obj.type;
resetPageList();
getList();
};
const pageList: PageResult<any> = reactive({
total: 0,
list: [],
pageNum: 1,
pageSize: 10,
});
const resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
const handleSearch = () => {
resetPageList();
getList();
};
const handleAdd = () => {
uni.navigateTo({
url: "/pagesApp/components/addIncomeDetail", //
});
};
//
const handleItem = (item: any) => {
FinanceApi.deleteRevenueDes({ id: item.id }).then((res) => {
if (res.code === 200) {
uni.showToast({
title: "删除成功",
});
resetPageList();
getList();
}
});
};
//
const getDetail = (item: any) => {
uni.navigateTo({
url: "/pagesApp/components/incomeContent?id=" + item.id, //
});
};
const changeTime = (obj: any) => {
state.startTime = obj.startTime;
state.endTime = obj.endTime;
state.name = obj.name;
resetPageList();
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 = {
pageSize: pageList.pageSize,
pageNumber: pageList.pageNum,
startTime: state.startTime + " 00:00:00",
endTime: state.endTime + " 23:59:59",
oddNumbers: keyword.value,
};
if (state.currentPaymentType > -1) {
params.paymentType = state.currentPaymentType;
}
if (state.userId > -1) {
params.customerId = state.userId;
}
pageList.isLoading = true;
FinanceApi.getRevenueDetailsPage(params).then((res: any) => {
if (res.code === 200) {
pageList.isLoading = false;
(pageList as any).list = (pageList as any).list = pageList.list.concat(
res.data.list
);
pageList.total = (res.data as any).total;
}
});
};
onMounted(() => {
getList();
});
</script>
<style lang="scss" scoped>
.search {
display: flex;
align-items: center;
justify-content: space-between;
margin: 26rpx 26rpx 0rpx 26rpx;
.btn {
background: #00dcee;
border-radius: 24rpx;
border: 1px solid #00dcee;
font-weight: 500;
font-size: 26rpx;
color: #ffffff;
margin-left: 50rpx;
padding: 6rpx 30rpx;
}
}
.filter {
margin: 0rpx 26rpx 0rpx 26rpx;
padding: 18rpx;
display: flex;
align-items: center;
justify-content: space-between;
font-weight: 400;
font-size: 26rpx;
color: #000000;
> view {
display: inline-block;
display: flex;
align-items: center;
text {
margin-right: 10rpx;
}
}
.btn {
font-size: 26rpx;
color: #00dcee;
}
}
.show-time {
font-weight: 400;
font-size: 26rpx;
color: #000000;
margin: 0rpx 26rpx 20rpx 50rpx;
}
.list {
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 0rpx 26rpx;
padding: 0rpx 18rpx;
.item {
font-size: 26rpx;
line-height: 40rpx;
border-top: 1px solid rgba(233, 233, 233, 0.76);
padding: 26rpx 26rpx;
.time {
font-size: 24rpx;
color: #999;
}
}
.amount {
text-align: right;
.tip {
font-size: 24rpx;
color: #ff7e20;
}
}
}
</style>

View File

@ -0,0 +1,342 @@
<template>
<view class="search">
<u-search
placeholder="请输入收货/出货单号"
v-model="keyword"
:showAction="false"
:bgColor="'#fff'"
:borderColor="'rgba(0, 0, 0, 0.1)'"
:placeholderColor="'#C1C1C1'"
@search="handleSearch()"
></u-search>
<view class="btn" @click="handleAdd()"> 创建 </view>
</view>
<view class="filter">
<!-- -->
<view @click="handleDialog('showTime', true)"
><text>{{ state.name }}</text
><u-icon name="arrow-down"></u-icon
></view>
<view @click="state.isShowStatus = true"
><text>费用类型</text><u-icon name="arrow-down"></u-icon
></view>
<view class="btn" @click="handleDialog('showFilter', true)">筛选</view>
</view>
<view class="show-time">
<view v-if="state.name === '昨日' || state.name === '今日'">{{
state.startTime
}}</view>
<view v-else>{{ state.startTime }} - {{ state.endTime }}</view>
</view>
<page-view
@loadList="
(v) => {
getList(v);
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="140"
:isLoading="pageList.isLoading"
>
<view class="list">
<u-swipe-action>
<u-swipe-action-item
:options="options1"
v-for="(item, index) in pageList.list"
:key="index"
@click="handleItem(item)"
>
<view
class="item"
:style="{ border: index === 0 ? 'none' : '' }"
@click="getDetail(item)"
>
<u-row justify="space-between">
<u-col span="9">
<view class="">
<view class=""> {{ item.supCusName || "-" }} </view>
<view class=""> {{ item.paymentNumber }} </view>
<view class="time">
结算时间{{ item.settlementTime }}
</view>
</view>
</u-col>
<u-col span="3">
<view class="amount">
<view> {{ item.totalPrice }}</view>
<view class="tip">{{ getPayment(item) }}</view>
</view>
</u-col>
</u-row>
</view>
</u-swipe-action-item>
</u-swipe-action>
</view>
</page-view>
<!-- 时间弹框 -->
<TimeDialog
ref="timeDialog"
:show="showDialog.showTime"
@handleDialog="(v:boolean) => {handleDialog('showTime', v)}"
@changeTime="changeTime"
/>
<!-- 费用类型 -->
<u-action-sheet
:closeOnClickOverlay="true"
:closeOnClickAction="true"
:actions="state.statusList"
:title="'单据状态'"
:show="state.isShowStatus"
@select="handleSelectStatus"
@close="state.isShowStatus = false"
></u-action-sheet>
<!-- 筛选弹框 -->
<FilterDialog
:show="showDialog.showFilter"
@handleDialog="(v:boolean) => {handleDialog('showFilter', v)}"
@changeOther="changeOther"
:isShipment="false"
/>
</template>
<script setup lang="ts">
import { FinanceApi } from "@/services";
import PageView from "@/components/PageView/index.vue";
import { formatDate, getCurrentMonthStartAndEnd } from "@/utils";
import TimeDialog from "./components/TimeDialog.vue";
import FilterDialog from "./components/CustomFilterDialog.vue";
const options1 = ref([
{
text: "删除",
style: {
backgroundColor: "rgba(217, 4, 30, 1)",
fontSize: "24rpx",
},
},
]);
const keyword = ref("");
const state = reactive({
startTime: formatDate(getCurrentMonthStartAndEnd().start, "{y}-{m}-{d}"),
endTime: formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}"),
name: "本月",
currentPaymentType: -1,
isShowStatus: false,
statusList: [
{
name: "全部",
key: -1,
},
{
name: "供应商付款",
key: 0,
},
{
name: "客户付款",
key: 1,
},
{
name: "供应商(手动)",
key: 3,
},
{
name: "客户(手动)",
key: 2,
},
],
userId: -1,
userType: -1,
params: {},
});
const getPayment = (item: any) => {
return ["供应商付款", "客户付款", "客户(手动)", "供应商(手动)"][
item.paymentType
];
};
const showDialog = <
{
[key: string]: boolean;
}
>reactive({
showTime: false,
showFilter: false,
});
const handleDialog = (key: string, v: boolean) => {
showDialog[key] = v;
};
const handleSelectStatus = (v: any) => {
state.isShowStatus = false;
state.currentPaymentType = v.key;
resetPageList();
getList();
};
const changeOther = (obj: any) => {
state.userId = obj.userId;
state.userType = obj.type;
resetPageList();
getList();
};
const pageList: PageResult<any> = reactive({
total: 0,
list: [],
pageNum: 1,
pageSize: 10,
});
const resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
const handleSearch = () => {
resetPageList();
getList();
};
const handleAdd = () => {
uni.navigateTo({
url: "/pagesApp/components/addPayment", //
});
};
//
const handleItem = (item: any) => {
FinanceApi.deletePaymentDs({ id: item.id }).then((res) => {
if (res.code === 200) {
uni.showToast({
title: "删除成功",
});
resetPageList();
getList();
}
});
};
//
const getDetail = (item: any) => {
uni.navigateTo({
url: "/pagesApp/components/payContent?id=" + item.id, //
});
};
const changeTime = (obj: any) => {
state.startTime = obj.startTime;
state.endTime = obj.endTime;
state.name = obj.name;
resetPageList();
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 = {
pageSize: pageList.pageSize,
pageNumber: pageList.pageNum,
startTime: state.startTime + " 00:00:00",
endTime: state.endTime + " 23:59:59",
oddNumbers: keyword.value,
};
if (state.currentPaymentType > -1) {
params.paymentType = state.currentPaymentType;
}
if (state.userId > -1) {
params.supCusId = state.userId;
params.userType = state.userType;
}
pageList.isLoading = true;
FinanceApi.getPaymentDetailsPage(params).then((res: any) => {
if (res.code === 200) {
pageList.isLoading = false;
(pageList as any).list = (pageList as any).list = pageList.list.concat(
res.data.list
);
pageList.total = (res.data as any).total;
}
});
};
onMounted(() => {
getList();
});
</script>
<style lang="scss" scoped>
.search {
display: flex;
align-items: center;
justify-content: space-between;
margin: 26rpx 26rpx 0rpx 26rpx;
.btn {
background: #00dcee;
border-radius: 24rpx;
border: 1px solid #00dcee;
font-weight: 500;
font-size: 26rpx;
color: #ffffff;
margin-left: 50rpx;
padding: 6rpx 30rpx;
}
}
.filter {
margin: 0rpx 26rpx 0rpx 26rpx;
padding: 18rpx;
display: flex;
align-items: center;
justify-content: space-between;
font-weight: 400;
font-size: 26rpx;
color: #000000;
> view {
display: inline-block;
display: flex;
align-items: center;
text {
margin-right: 10rpx;
}
}
.btn {
font-size: 26rpx;
color: #00dcee;
}
}
.show-time {
font-weight: 400;
font-size: 26rpx;
color: #000000;
margin: 0rpx 26rpx 20rpx 50rpx;
}
.list {
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 0rpx 26rpx;
padding: 0rpx 18rpx;
.item {
font-size: 26rpx;
line-height: 40rpx;
border-top: 1px solid rgba(233, 233, 233, 0.76);
padding: 26rpx 26rpx;
.time {
font-size: 24rpx;
color: #999;
}
}
.amount {
text-align: right;
.tip {
font-size: 24rpx;
color: #ff7e20;
}
}
}
</style>

View File

@ -8,62 +8,75 @@
:bgColor="'#fff'"
:borderColor="'rgba(0, 0, 0, 0.1)'"
:placeholderColor="'#C1C1C1'"
@search="handleSearch()"
></u-search>
</view>
<view class="box" v-for="(item, index) in pageList.list" :key="index">
<view class="base">
<view>
<view class="no"> 收货单号{{ item.receiptNumber }} </view>
<view class="supplier"> {{ item.deviceName }} </view>
<page-view
@loadList="
(v) => {
getList(v);
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="100"
:isLoading="pageList.isLoading"
>
<view class="box" v-for="(item, index) in pageList.list" :key="index">
<view class="base">
<view>
<view class="no"> 收货单号{{ item.receiptNumber }} </view>
<view class="supplier"> {{ item.deviceName }} </view>
</view>
<view>
<text class="btn" @click="handleScenePhoto(item.id as any)"
>现场照片</text
>
</view>
</view>
<view>
<text class="btn" @click="handleScenePhoto(item.imagesId as number)"
>现场照片</text
<view class="name">{{ item.userName }}</view>
<view class="type">{{ item.productName }}</view>
<view class="flex-box">
<text>定价人{{ item.pricingUserName }}</text>
<text>过磅时间{{ item.tareTime }}</text>
</view>
<view class="more">
<view
v-for="(cItem, index) in gridList1"
:key="index"
:style="cItem.isCustomStyle ? 'font-size: 22rpx;color:#999' : ''"
>
<block v-if="cItem.name === '扣杂'">
<text v-if="cItem.name">
{{ item.buttonType === 0 ? "扣杂" : "扣点" }} </text
><text>
{{
item.buttonType === 0
? item[cItem.enName as string]
: item["points"]
}}
{{ item.buttonType === 0 ? cItem.unit : "%" }}
</text>
</block>
<block v-if="cItem.name !== '扣杂'">
<text v-if="cItem.name">{{ cItem.name }}</text
><text
>{{ cItem.isBefore ? cItem.unit : "" }}
{{ item[cItem.enName as string] }}
{{ cItem.isBefore ? "" : cItem.unit }}
</text>
</block>
</view>
</view>
</view>
<view class="name">{{ item.userName }}</view>
<view class="type">{{ item.productName }}</view>
<view class="flex-box">
<text>定价人{{ item.pricingUserName }}</text>
<text>过磅时间{{ item.tareTime }}</text>
</view>
<view class="more">
<view
v-for="(cItem, index) in gridList1"
:key="index"
:style="cItem.isCustomStyle ? 'font-size: 22rpx;color:#999' : ''"
>
<block v-if="cItem.name === '扣杂'">
<text v-if="cItem.name">
{{ item.buttonType === 0 ? "扣杂" : "扣点" }} </text
><text>
{{
item.buttonType === 0
? item[cItem.enName as string]
: item["points"]
}}
{{ item.buttonType === 0 ? cItem.unit : "%" }}
</text>
</block>
<block v-if="cItem.name !== '扣杂'">
<text v-if="cItem.name">{{ cItem.name }}</text
><text
>{{ cItem.isBefore ? cItem.unit : "" }}
{{ item[cItem.enName as string] }}
{{ cItem.isBefore ? "" : cItem.unit }}
</text>
</block>
</view>
</view>
</view>
</page-view>
</view>
</template>
<script setup lang="ts">
import { ReceiveApi } from "@/services";
import PageView from "@/components/PageView/index.vue";
const keyword = ref("");
const gridList1 = reactive([
@ -126,38 +139,59 @@ const gridList1 = reactive([
isCustomStyle: true,
},
]);
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, //
});
};
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 resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
const getOrderList = () => {
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;
ReceiveApi.getOrderPage({
pageNumber: 1,
pageSize: 10,
pageSize: pageList.pageSize,
pageNumber: pageList.pageNum,
userName: keyword.value,
isDeleted: true,
}).then((res) => {
if (res.code === 200) {
(pageList as any).list = res.data.list;
pageList.isLoading = false;
(pageList as any).list = pageList.list.concat(
res.data.list
);
pageList.total = (res.data as any).total;
}
});
};
onMounted(() => {
getOrderList();
getList();
});
</script>
<style lang="scss" scoped>

View File

@ -8,117 +8,213 @@
:bgColor="'#fff'"
:borderColor="'rgba(0, 0, 0, 0.1)'"
:placeholderColor="'#C1C1C1'"
@search="handleSearch()"
></u-search>
<view class="btn" @click="handleAdd()"> 创建 </view>
</view>
<view class="filter">
<!-- -->
<view><text>本月</text><u-icon name="arrow-down"></u-icon></view>
<view @click="state.isShowStatus = true"><text>单据状态</text><u-icon name="arrow-down"></u-icon></view>
<view @click="state.isShowSort = true"><text>排序</text><u-icon name="arrow-down"></u-icon></view>
<view class="btn">筛选</view>
<view @click="handleDialog('showTime', true)"
><text>{{ state.name }}</text
><u-icon name="arrow-down"></u-icon
></view>
<view @click="state.isShowStatus = true"
><text>单据状态</text><u-icon name="arrow-down"></u-icon
></view>
<view @click="state.isShowSort = true"
><text>排序</text><u-icon name="arrow-down"></u-icon
></view>
<view class="btn" @click="handleDialog('showFilter', true)">筛选</view>
</view>
<view class="time">2024-01-01</view>
<view class="time">
<view v-if="state.name === '昨日' || state.name === '今日'">{{
state.startTime
}}</view>
<view v-else>{{ state.startTime }} - {{ state.endTime }}</view>
</view>
<view class="box" v-for="(item, index) in pageList.list" :key="index">
<view class="base">
<view>
<view class="no"> 收货单号{{ item.receiptNumber }} </view>
<view class="supplier"> {{ item.deviceName || "-" }} </view>
<page-view
@loadList="
(v) => {
getList(v);
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="200"
:isLoading="pageList.isLoading"
>
<view class="box" v-for="(item, index) in pageList.list" :key="index">
<view class="base">
<view>
<view class="no"> 收货单号{{ item.receiptNumber }} </view>
<view class="supplier"> {{ item.deviceName || "-" }} </view>
</view>
<view>
<text class="btn" @click="handleScenePhoto((item as any).id)"
>现场照片</text
>
</view>
</view>
<view>
<text class="btn" @click="handleScenePhoto((item as any).id)"
>现场照片</text
<view class="name"
>{{ item.userName }}
<text>{{ getScaleStatus((item as any).scaleStatus) }}</text>
<text v-if="item.repairTime">补单</text>
</view>
<view class="type">{{ item.productName }}</view>
<view class="flex-box">
<text>定价人{{ item.userName }}</text>
<text>创建时间{{ item.createTime }}</text>
</view>
<view class="more">
<view
v-for="(cItem, index) in gridList1"
:key="index"
:style="cItem.isCustomStyle ? 'font-size: 22rpx;color:#999' : ''"
>
<block v-if="cItem.name === '扣杂'">
<text v-if="cItem.name">
{{ item.buttonType === 0 ? "扣杂" : "扣点" }} </text
><text>
{{
item.buttonType === 0
? item[cItem.enName as string]
: item["points"]
}}
{{ item.buttonType === 0 ? cItem.unit : "%" }}
</text>
</block>
<block v-if="cItem.name !== '扣杂'">
<text v-if="cItem.name">{{ cItem.name }}</text
><text
>{{ cItem.isBefore ? cItem.unit : "" }}
{{ item[cItem.enName as string] }}
{{ cItem.isBefore ? "" : cItem.unit }}
</text>
</block>
</view>
</view>
</view>
<view class="name"
>{{ item.userName }}
<text>{{ getScaleStatus((item as any).scaleStatus) }}</text>
<text v-if="item.repairTime">补单</text>
</view>
<view class="type">{{ item.productName }}</view>
<view class="flex-box">
<text>定价人{{ item.userName }}</text>
<text>创建时间{{ item.createTime }}</text>
</view>
<view class="more">
<view
v-for="(cItem, index) in gridList1"
:key="index"
:style="cItem.isCustomStyle ? 'font-size: 22rpx;color:#999' : ''"
>
<block v-if="cItem.name === '扣杂'">
<text v-if="cItem.name">
{{ item.buttonType === 0 ? '扣杂' : '扣点' }}
</text
><text>
{{ item.buttonType === 0 ? item[cItem.enName as string] : item['points'] }}
{{ item.buttonType === 0 ? cItem.unit : '%' }}
</text>
</block>
<block v-if="cItem.name !== '扣杂'">
<text v-if="cItem.name">{{ cItem.name }}</text
><text
>{{ cItem.isBefore ? cItem.unit : "" }}
{{ item[cItem.enName as string] }}
{{ cItem.isBefore ? "" : cItem.unit }}
</text>
</block>
</view>
</view>
</view>
</page-view>
</view>
<u-action-sheet :closeOnClickOverlay="true" :closeOnClickAction="true" :actions="state.statusList" :title="'单据状态'" :show="state.isShowStatus" @select="handleSelectStatus"></u-action-sheet>
<u-action-sheet :closeOnClickOverlay="true" :closeOnClickAction="true" :actions="state.sortList" :title="'排序'" :show="state.isShowSort" @select="handleSelectSort"></u-action-sheet>
<u-action-sheet
:closeOnClickOverlay="true"
:closeOnClickAction="true"
:actions="state.statusList"
:title="'单据状态'"
:show="state.isShowStatus"
@select="handleSelectStatus"
@close="state.isShowStatus = false"
></u-action-sheet>
<u-action-sheet
:closeOnClickOverlay="true"
:closeOnClickAction="true"
:actions="state.sortList"
:title="'排序'"
:show="state.isShowSort"
@select="handleSelectSort"
@close="state.isShowSort = false"
></u-action-sheet>
<!-- 时间弹框 -->
<TimeDialog
ref="timeDialog"
:show="showDialog.showTime"
@handleDialog="(v:boolean) => {handleDialog('showTime', v)}"
@changeTime="changeTime"
/>
<!-- 筛选 -->
<FilterDialog
:show="showDialog.showFilter"
:isShipment="false"
@handleOk="handleOk"
@handleDialog="(v:boolean) => {handleDialog('showFilter', v)}"
/>
</template>
<script setup lang="ts">
import { ReceiveApi } from "@/services";
import { ScaleStatus } from "@/utils/enum";
import PageView from "@/components/PageView/index.vue";
import { formatDate, getCurrentMonthStartAndEnd, filterNullUndefined } from "@/utils";
import TimeDialog from "./components/TimeDialog.vue";
import FilterDialog from "./components/FilterDialog.vue";
const showDialog = <
{
[key: string]: boolean;
}
>reactive({
showTime: false,
showFilter: false,
});
const handleDialog = (key: string, v: boolean) => {
showDialog[key] = v;
};
const changeTime = (obj: any) => {
state.startTime = obj.startTime;
state.endTime = obj.endTime;
state.name = obj.name;
resetPageList();
getList();
};
const state = reactive({
startTime: formatDate(getCurrentMonthStartAndEnd().start, "{y}-{m}-{d}"),
endTime: formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}"),
name: "本月",
currentScaleStatus: undefined,
currentSortName: undefined,
isShowStatus: false,
statusList: [{
name: '待定价',
key: 0
},{
name: '待过皮',
key: 1
},{
name: '待审核',
key: 2
},{
name: '已审核待支付',
key: 3
},{
name: '已支付',
key: 4
}],
statusList: [
{
name: "待定价",
key: 0,
},
{
name: "待过皮",
key: 1,
},
{
name: "待审核",
key: 2,
},
{
name: "已审核待支付",
key: 3,
},
{
name: "已支付",
key: 4,
},
],
isShowSort: false,
sortList: [{
name: '按创建时间降序',
key: 'create_time'
},
{
name: '按更新时间降序',
key: 'update_time'
}]
})
sortList: [
{
name: "按创建时间降序",
key: "create_time",
},
{
name: "按更新时间降序",
key: "update_time",
},
],
params: {},
});
const handleSelectStatus = (v: any) => {
state.isShowStatus = false
state.currentScaleStatus = v.key
getOrderList()
}
state.isShowStatus = false;
state.currentScaleStatus = v.key;
resetPageList();
getList();
};
const handleSelectSort = (v: any) => {
state.isShowSort = false
state.currentSortName = v.key
getOrderList()
}
state.isShowSort = false;
state.currentSortName = v.key;
resetPageList();
getList();
};
const keyword = ref("");
const gridList1 = reactive([
@ -191,7 +287,7 @@ const gridList1 = reactive([
]);
const handleScenePhoto = (id: string) => {
uni.navigateTo({
url: "/pagesScenePhoto/index?orderType=1&id=" + id, //
url: "/pagesScenePhoto/index?orderType=1&imagesType=1&id=" + id, //
});
};
const getScaleStatus = (type: number) => {
@ -212,37 +308,71 @@ const handleAdd = () => {
uni.navigateTo({
url: "/pagesApp/receiveSpl", //
});
}
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 getOrderList = () => {
let params: any = { pageNumber: 1, pageSize: 10}
const resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
const handleOk = (obj: any) => {
state.params = obj;
resetPageList();
getList();
};
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;
}
}
let params: any = {
pageSize: pageList.pageSize,
pageNumber: pageList.pageNum,
startTime: state.startTime + " 00:00:00",
endTime: state.endTime + " 23:59:59",
};
if (state.currentScaleStatus !== undefined) {
params.scaleStatus = state.currentScaleStatus
params.scaleStatus = state.currentScaleStatus;
}
if (state.currentSortName !== undefined) {
params.sortName = state.currentSortName
params.sortName = state.currentSortName;
}
ReceiveApi.getOrderPage(params).then((res) => {
if (keyword.value !== undefined) {
params.receiptNumber = keyword.value;
}
pageList.isLoading = true;
ReceiveApi.getOrderPage({ ...params, ...filterNullUndefined(state.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.list.concat(
res.data.list
);
pageList.total = (res.data as any).total;
}
});
};
onMounted(() => {
getOrderList();
getList();
});
</script>
<style lang="scss" scoped>
@ -289,7 +419,8 @@ onMounted(() => {
font-weight: 400;
font-size: 26rpx;
color: #000000;
margin: 30rpx 0rpx;
margin: 30rpx 0rpx 0rpx 30rpx;
}
.box + .box {
margin-top: 30rpx;

View File

@ -13,23 +13,36 @@
<view class="btn" @click="add"> 新增 </view>
</view>
<view class="box" v-for="(item, index) in pageList.list" :key="index">
<view>
<page-view
@loadList="
(v) => {
getList(v);
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="100"
:isLoading="pageList.isLoading"
>
<view class="box" v-for="(item, index) in pageList.list" :key="index">
<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>{{ 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>
</page-view>
</view>
</template>
<script setup lang="ts">
import { GoodsApi } from "@/services";
import { UsersType } from "@/utils/enum";
import PageView from "@/components/PageView/index.vue";
const state = reactive<any>({
name: "",
supplierTypeId: -1,
@ -41,24 +54,33 @@ const pageList: PageResult<{
minPrice: number;
maxPrice: number;
}> = reactive({
isLoading: false,
noMoreData: false,
total: 0,
list: [],
pageNum: 1,
pageSize: 10,
});
const resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
const handleSearch = () => {
resetPageList();
getList();
};
const update = (item: any) => {
GoodsApi.EditReceiveProduct({ isDeleted: true, id: item.id }).then(
(res) => {
if (res.code === 200) {
getList();
}
GoodsApi.EditReceiveProduct({ isDeleted: true, id: item.id }).then((res) => {
if (res.code === 200) {
resetPageList();
getList();
}
);
});
};
const edit = (item: any) => {
@ -68,17 +90,28 @@ const edit = (item: any) => {
JSON.stringify(item), //
});
};
const 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 = {
pageSize: 10,
pageNum: 1,
pageSize: pageList.pageSize,
pageNum: pageList.pageNum,
reProductsName: state.name,
};
GoodsApi.getReceiveProductListByPage(params).then((res) => {
pageList.isLoading = true;
GoodsApi.getReceiveProductListByPage(params).then((res:any) => {
if (res.code === 200) {
if (res.code === 200) {
(pageList as any).list = (res.data as any).list;
}
pageList.isLoading = false;
(pageList as any).list = (pageList as any).list = pageList.list.concat(
res.data.list
);
pageList.total = (res.data as any).total;
}
});
};

View File

@ -7,9 +7,10 @@
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"
@ -30,10 +31,11 @@
:clearable="true"
:customStyle="{}"
border="none"
:disabled="item.disabled"
>
<template #suffix>
<text v-if="item.key === 'subtractNum'">
{{ model1.order.buttonType === 1 ? item.unit : "%" }}
{{ model1.order.buttonType === 0 ? item.unit : "%" }}
</text>
<text v-else>
{{ item.unit }}
@ -44,13 +46,14 @@
@delete="deletePic" -->
<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="filesRef"
@delete="handleDelete"
></uni-file-picker>
<u-radio-group
@ -58,9 +61,9 @@
v-model="(model1.order as any)[item.key]"
placement="row"
>
<u-radio activeColor="#00DCEE" label="按固定重量" :name="1"></u-radio>
<u-radio activeColor="#00DCEE" label="按固定重量" :name="0"></u-radio>
&nbsp;&nbsp;&nbsp;
<u-radio activeColor="#00DCEE" label="按百分比" :name="2"></u-radio>
<u-radio activeColor="#00DCEE" label="按百分比" :name="1"></u-radio>
</u-radio-group>
<template #right v-if="item.type === 'select'">
<u-icon name="arrow-right"></u-icon>
@ -97,6 +100,7 @@ import {
ProfileApi,
ReceiveApi,
ReceiveProductApi,
SupplierApi,
} from "@/services";
import { formatDate } from "@/utils";
import { DeviceType, ImagesType, OrderType } from "@/utils/enum";
@ -105,22 +109,58 @@ import _ from "underscore";
const model1 = reactive<any>({
order: {
buttonType: 0,
fileList: [],
fileLists: [],
splTime: "",
subtractType: 1,
},
});
const rules = ref({
"userInfo.userName": {
const rules = reactive({
"order.repairTime": {
type: "string",
required: true,
message: "请输入手机号",
message: "请选择补单时间",
trigger: ["blur", "change"],
},
"userInfo.password": {
"order.deviceName": {
type: "string",
required: true,
message: "请输入密码",
message: "请选择站点磅秤",
trigger: ["blur", "change"],
},
"order.userName": {
type: "string",
required: true,
message: "请选择供应商",
trigger: ["blur", "change"],
},
"order.productName": {
type: "string",
required: true,
message: "请选择收货产品",
trigger: ["blur", "change"],
},
"order.grossWeight": {
type: "string",
required: true,
message: "请输入毛重",
trigger: ["blur", "change"],
},
"order.tare": {
type: "string",
required: true,
message: "请输入皮重",
trigger: ["blur", "change"],
},
"order.price": {
type: "string",
required: true,
message: "请输入单价",
trigger: ["blur", "change"],
},
"order.balanceTotalPrice": {
type: "string",
required: true,
message: "请输入货款金额",
trigger: ["blur", "change"],
},
});
@ -227,6 +267,7 @@ const formAttrList = reactive<any>([
key: "netWeight",
type: "input",
unit: "KG",
disabled: true
},
{
name: "单价",
@ -240,9 +281,10 @@ const formAttrList = reactive<any>([
key: "totalPrice",
type: "input",
unit: "元",
disabled: true
},
{
name: "款金额",
name: "款金额",
key: "balanceTotalPrice",
type: "input",
required: true,
@ -259,25 +301,74 @@ const formAttrList = reactive<any>([
type: "upload",
},
]);
//
watch(
[
() => model1.order.grossWeight,
() => model1.order.tare,
() => model1.order.price,
() => model1.order.subtractNum,
() => model1.order.buttonType,
],
([grossWeightNew, tareNew]) => {
/**
* 过磅净重 毛重-皮重
结算重量 过磅净重-扣杂
预估总价 结算单价*结算重量
实际收入实际结算金额-运费-杂费
*/
model1.order.netWeight = (grossWeightNew || 0) - (tareNew || 0);
if (model1.order.buttonType === 0) {
if (model1.order.subtractNum) {
model1.order.netWeight =
model1.order.netWeight - model1.order.subtractNum;
}
} else if (model1.order.buttonType === 1) {
if (model1.order.subtractNum) {
model1.order.netWeight =
model1.order.netWeight * ((100 - model1.order.subtractNum) / 100);
}
}
model1.order.totalPrice =
(model1.order.price || 0) * (model1.order.netWeight || 0);
}
);
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: "已删除" });
}
});
}
};
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 as any).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;
});
});
});
};
@ -296,10 +387,9 @@ const handleSelect = (key: string, v: any) => {
}
};
//
ProfileApi.getUserList({ userType: 2 }).then((res) => {
SupplierApi.getSupplierUserList({}).then((res) => {
if (res.code === 200) {
contrlModalParams.user.list = res.data;
console.log(contrlModalParams.user.list);
}
});
//
@ -330,16 +420,42 @@ const upload = () => {
if (res.length > 0) {
PictureApi.addListAnnex({ annexPos: res }).then((res1) => {
if (res1.code === 200) {
uni.showToast({
title: "图片资源上传成功",
icon: "success",
});
console.log("*** 资源文件更新成功");
}
});
}
});
};
/**
* 校验
*/
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 = () => {
if (model1.order.buttonType === 0) {
model1.order.buckleMiscellaneous = model1.order.subtractNum;
} else if (model1.order.buttonType === 1) {
@ -349,8 +465,8 @@ const save = () => {
if (res.code === 200) {
model1.order.id = res.data;
upload();
uni.navigateTo({
url: "/pages/index/index", //
uni.redirectTo({
url: "/pagesHome/index", //
});
}
});

View File

@ -12,34 +12,54 @@
></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>
<page-view
@loadList="
(v) => {
getList(v);
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="100"
:isLoading="pageList.isLoading"
>
<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>
</page-view>
</view>
</template>
<script setup lang="ts">
import { GoodsApi } from "@/services";
import { StockCardType } from "@/utils/enum";
const keyword = ref("");
import PageView from "@/components/PageView/index.vue";
const state = reactive<any>({
name: "",
});
const pageList: PageResult<{reCategoryName: string}> = reactive({
const pageList: PageResult<{ reCategoryName: string }> = reactive({
isLoading: false,
noMoreData: false,
total: 0,
list: [],
pageNum: 1,
pageSize: 10,
});
const resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
const add = () => {
uni.navigateTo({
url: "/pagesApp/components/addReceiveType", //
@ -55,27 +75,40 @@ const edit = (item: any) => {
const deleteType = (item: any) => {
GoodsApi.editReceiveCategory({ isDeleted: true, id: item.id }).then((res) => {
if (res.code === 200) {
resetPageList();
getList();
}
});
};
const handleSearch = () => {
resetPageList();
getList();
};
const 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 = {
pageSize: 10,
pageNum: 1,
pageSize: pageList.pageSize,
pageNum: pageList.pageNum,
reCategoryName: state.name,
};
if (state.supplierTypeId > -1) {
params.supplierTypeId = state.supplierTypeId;
}
GoodsApi.getPage(params).then((res) => {
pageList.isLoading = true;
GoodsApi.getPage(params).then((res:any) => {
if (res.code === 200) {
if (res.code === 200) {
(pageList as any).list = (res.data as any).list;
}
pageList.isLoading = false;
(pageList as any).list = (pageList as any).list = pageList.list.concat(
res.data.list
);
pageList.total = (res.data as any).total;
}
});
};

View File

@ -19,6 +19,9 @@
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="100"
:isLoading="pageList.isLoading"
>
<view class="box">
<view v-for="(item, index) in pageList.list" :key="index">
@ -27,7 +30,7 @@
</view>
<view class="op-box">
<view class="btn" @click="edit(item)"> 编辑 </view>
<view class="btn" @click="deleteCustomer(item)"> 删除 </view>
<view class="btn" @click="deleteRole(item)"> 删除 </view>
</view>
</view>
</view>
@ -52,6 +55,13 @@ const pageList: PageResult<{
pageNum: 1,
pageSize: 10,
});
const resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
const add = () => {
uni.navigateTo({
url: "/pagesApp/components/addRole", //
@ -64,14 +74,16 @@ const edit = (item: any) => {
JSON.stringify(item), //
});
};
const deleteCustomer = (item: any) => {
StockCardApi.updateStockCard({ isDeleted: true, id: item.id }).then((res) => {
const deleteRole = (item: any) => {
ProfileApi.updateRole({ isDeleted: true, id: item.id }).then((res) => {
if (res.code === 200) {
resetPageList()
getList();
}
});
};
const handleSearch = () => {
resetPageList()
getList();
};
const getList = (v?: boolean) => {
@ -86,11 +98,12 @@ const getList = (v?: boolean) => {
let params: any = {
roleName: state.name,
};
pageList.isLoading = true;
ProfileApi.getRoleList(params).then((res) => {
if (res.code === 200) {
if (res.code === 200) {
pageList.isLoading = false;
(pageList as any).list = res.data as any;
pageList.total = (res.data as any).total
}
}
});

View File

@ -8,9 +8,20 @@
:bgColor="'#fff'"
:borderColor="'rgba(0, 0, 0, 0.1)'"
:placeholderColor="'#C1C1C1'"
@search="handleSearch()"
></u-search>
</view>
<page-view
@loadList="
(v) => {
getList(v);
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="100"
:isLoading="pageList.isLoading"
>
<view class="box" v-for="(item, index) in pageList.list" :key="index">
<view class="base">
<view>
@ -44,11 +55,13 @@
</view>
</view>
</view>
</page-view>
</view>
</template>
<script setup lang="ts">
import { ShipmentApi } from '@/services';
import { ScaleStatus } from '@/utils/enum';
import { ReceiveApi, ShipmentApi } from "@/services";
import PageView from "@/components/PageView/index.vue";
import { ScaleStatus } from "@/utils/enum";
const keyword = ref("");
const gridList1 = reactive([
@ -151,25 +164,52 @@ const gridList1 = reactive([
]);
const handleScenePhoto = (id: string) => {
uni.navigateTo({
url: "/pagesScenePhoto/index?orderType=1&id=" + id, //
url: "/pagesScenePhoto/index?orderType=1&imagesType=1&id=" + id, //
});
};
interface PageResult<T> {
total: number;
list: T[];
pageNum: number;
pageSize: number;
}
const pageList: PageResult<Shipment> = reactive({
const pageList: PageResult<Order> = reactive({
isLoading: false,
noMoreData: false,
total: 0,
list: [],
pageNum: 1,
pageSize: 10,
});
const getOrderList = () => {
ShipmentApi.getOrderPage({ pageNumber: 1, pageSize: 10, isDeleted: true,}).then((res) => {
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,
userName: keyword.value,
isDeleted: true,
}).then((res: any) => {
if (res.code === 200) {
(pageList as any).list = res.data.list;
pageList.isLoading = false;
(pageList as any).list = pageList.list.concat(
res.data.list
);
pageList.total = (res.data as any).total;
}
});
};
@ -187,27 +227,13 @@ const getScaleStatus = (type: number) => {
}
};
onMounted(() => {
getOrderList();
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 {
margin-top: 30rpx;
background: #ffffff;
@ -258,6 +284,16 @@ onMounted(() => {
color: #ec0f3e;
margin-bottom: 20rpx;
}
.flex-box {
display: flex;
align-items: center;
justify-content: space-between;
font-weight: 400;
font-size: 26rpx;
color: #999999;
border-bottom: 1rpx solid rgba(233, 233, 233, 0.76);
padding-bottom: 20rpx;
}
}
.more {
display: grid;
@ -266,6 +302,7 @@ onMounted(() => {
font-weight: 400;
font-size: 26rpx;
color: #000000;
padding: 25rpx 0rpx 0rpx 0rpx;
> view {
line-height: 50rpx;
}

View File

@ -8,76 +8,106 @@
:bgColor="'#fff'"
:borderColor="'rgba(0, 0, 0, 0.1)'"
:placeholderColor="'#C1C1C1'"
@search="handleSearch()"
></u-search>
<view class="btn" @click="handleAdd()"> 创建 </view>
</view>
<view class="filter">
<!-- -->
<view><text>本月</text><u-icon name="arrow-down"></u-icon></view>
<view @click="handleDialog('showTime', true)"
><text>{{ state.name }}</text
><u-icon name="arrow-down"></u-icon
></view>
<view @click="state.isShowStatus = true"
><text>单据状态</text><u-icon name="arrow-down"></u-icon
></view>
<view @click="state.isShowSort = true"
><text>排序</text><u-icon name="arrow-down"></u-icon
></view>
<view class="btn">筛选</view>
<view class="btn" @click="handleDialog('showFilter', true)">筛选</view>
</view>
<view class="time">2024-01-01</view>
<view class="time">
<view v-if="state.name === '昨日' || state.name === '今日'">{{
state.startTime
}}</view>
<view v-else>{{ state.startTime }} - {{ state.endTime }}</view>
</view>
<view class="box" v-for="(item, index) in pageList.list" :key="index">
<view class="base">
<view>
<view class="no"> 出货单号{{ item.orderNumber }} </view>
<view class="supplier"> {{ item.deviceName || "-" }} </view>
<page-view
@loadList="
(v) => {
getList(v);
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="200"
:isLoading="pageList.isLoading"
>
<view class="box" v-for="(item, index) in pageList.list" :key="index">
<view class="base">
<view>
<view class="no"> 出货单号{{ item.orderNumber }} </view>
<view class="supplier"> {{ item.deviceName || "-" }} </view>
</view>
<view>
<text class="btn" @click="handleScenePhoto((item as any).id)"
>现场照片</text
>
</view>
</view>
<view>
<text class="btn" @click="handleScenePhoto((item as any).id)"
>现场照片</text
<view class="name"
>{{ item.userName }}
<text>{{ getScaleStatus((item as any).scaleStatus) }}</text>
<text v-if="item.repairTime">补单</text>
</view>
<view class="type">{{ item.productName }}</view>
<view class="flex-box">
<text>定价人{{ item.userName }}</text>
<text>创建时间{{ item.createTime }}</text>
</view>
<view class="more">
<view
v-for="(cItem, index) in gridList1"
:key="index"
:style="cItem.isCustomStyle ? 'font-size: 22rpx;color:#999' : ''"
>
<block v-if="cItem.name === '扣杂'">
<text v-if="cItem.name">
{{ item.buttonType === 0 ? "扣杂" : "扣点" }} </text
><text>
{{
item.buttonType === 0
? item[cItem.enName as string]
: item["points"]
}}
{{ item.buttonType === 0 ? cItem.unit : "%" }}
</text>
</block>
<block v-else-if="cItem.name === '送货方式'">
<text v-if="cItem.name">{{ cItem.name }}</text
><text
>{{ cItem.isBefore ? cItem.unit : "" }}
<text v-if="item[cItem.enName as string] === DeliveryMethod.Deliver">送货</text>
<text v-if="item[cItem.enName as string] === DeliveryMethod.SelfPickup">自提</text>
{{ cItem.isBefore ? "" : cItem.unit }}
</text>
</block>
<block v-else>
<text v-if="cItem.name">{{ cItem.name }}</text
><text
>{{ cItem.isBefore ? cItem.unit : "" }}
{{ item[cItem.enName as string] }}
{{ cItem.isBefore ? "" : cItem.unit }}
</text>
</block>
</view>
</view>
</view>
<view class="name"
>{{ item.userName }}
<text>{{ getScaleStatus((item as any).scaleStatus) }}</text>
<text v-if="item.repairTime">补单</text>
</view>
<view class="type">{{ item.productName }}</view>
<view class="flex-box">
<text>定价人{{ item.userName }}</text>
<text>创建时间{{ item.createTime }}</text>
</view>
<view class="more">
<view
v-for="(cItem, index) in gridList1"
:key="index"
:style="cItem.isCustomStyle ? 'font-size: 22rpx;color:#999' : ''"
>
<block v-if="cItem.name === '扣杂'">
<text v-if="cItem.name">
{{ item.buttonType === 0 ? "扣杂" : "扣点" }} </text
><text>
{{
item.buttonType === 0
? item[cItem.enName as string]
: item["points"]
}}
{{ item.buttonType === 0 ? cItem.unit : "%" }}
</text>
</block>
<block v-if="cItem.name !== '扣杂'">
<text v-if="cItem.name">{{ cItem.name }}</text
><text
>{{ cItem.isBefore ? cItem.unit : "" }}
{{ item[cItem.enName as string] }}
{{ cItem.isBefore ? "" : cItem.unit }}
</text>
</block>
</view>
</view>
</view>
</page-view>
</view>
<u-action-sheet
@ -87,6 +117,7 @@
:title="'单据状态'"
:show="state.isShowStatus"
@select="handleSelectStatus"
@close="state.isShowStatus = false"
></u-action-sheet>
<u-action-sheet
:closeOnClickOverlay="true"
@ -95,12 +126,58 @@
:title="'排序'"
:show="state.isShowSort"
@select="handleSelectSort"
@close="state.isShowSort = false"
></u-action-sheet>
<!-- 时间弹框 -->
<TimeDialog
ref="timeDialog"
:show="showDialog.showTime"
@handleDialog="(v:boolean) => {handleDialog('showTime', v)}"
@changeTime="changeTime"
/>
<!-- 筛选 -->
<FilterDialog
:show="showDialog.showFilter"
:isShipment="true"
@handleOk="handleOk"
@handleDialog="(v:boolean) => {handleDialog('showFilter', v)}"
/>
</template>
<script setup lang="ts">
import { ShipmentApi } from "@/services";
import { ScaleStatus } from "@/utils/enum";
import { ReceiveApi, ShipmentApi } from "@/services";
import { DeliveryMethod, ScaleStatus } from "@/utils/enum";
import PageView from "@/components/PageView/index.vue";
import {
formatDate,
getCurrentMonthStartAndEnd,
filterNullUndefined,
} from "@/utils";
import TimeDialog from "./components/TimeDialog.vue";
import FilterDialog from "./components/FilterDialog.vue";
const showDialog = <
{
[key: string]: boolean;
}
>reactive({
showTime: false,
showFilter: false,
});
const handleDialog = (key: string, v: boolean) => {
showDialog[key] = v;
};
const changeTime = (obj: any) => {
state.startTime = obj.startTime;
state.endTime = obj.endTime;
state.name = obj.name;
resetPageList();
getList();
};
const state = reactive({
startTime: formatDate(getCurrentMonthStartAndEnd().start, "{y}-{m}-{d}"),
endTime: formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}"),
name: "本月",
currentScaleStatus: undefined,
currentSortName: undefined,
isShowStatus: false,
@ -137,16 +214,19 @@ const state = reactive({
key: "update_time",
},
],
params: {},
});
const handleSelectStatus = (v: any) => {
state.isShowStatus = false;
state.currentScaleStatus = v.key;
getOrderList();
resetPageList();
getList();
};
const handleSelectSort = (v: any) => {
state.isShowSort = false;
state.currentSortName = v.key;
getOrderList();
resetPageList();
getList();
};
const keyword = ref("");
@ -238,7 +318,7 @@ const gridList1 = reactive([
]);
const handleScenePhoto = (id: string) => {
uni.navigateTo({
url: "/pagesScenePhoto/index?orderType=1&id=" + id, //
url: "/pagesScenePhoto/index?orderType=1&imagesType=1&id=" + id, //
});
};
const getScaleStatus = (type: number) => {
@ -260,35 +340,73 @@ const handleAdd = () => {
url: "/pagesApp/shipmentSpl", //
});
};
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 getOrderList = () => {
let params: any = { pageNumber: 1, pageSize: 10 };
const resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
const handleOk = (obj: any) => {
state.params = obj;
resetPageList();
getList();
};
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;
}
}
let params: any = {
pageSize: pageList.pageSize,
pageNumber: pageList.pageNum,
startTime: state.startTime + " 00:00:00",
endTime: state.endTime + " 23:59:59",
};
if (state.currentScaleStatus !== undefined) {
params.scaleStatus = state.currentScaleStatus;
}
if (state.currentSortName !== undefined) {
params.sortName = state.currentSortName;
}
ShipmentApi.getOrderPage(params).then((res) => {
if (keyword.value !== undefined) {
params.orderNumber = keyword.value;
}
pageList.isLoading = true;
ShipmentApi.getOrderPage({
...params,
...filterNullUndefined(state.params),
}).then((res: any) => {
if (res.code === 200) {
(pageList as any).list = res.data.list;
pageList.isLoading = false;
(pageList as any).list = (pageList as any).list = pageList.list.concat(
res.data.list
);
pageList.total = (res.data as any).total;
}
});
};
onMounted(() => {
getOrderList();
getList();
});
</script>
<style lang="scss" scoped>
@ -335,7 +453,7 @@ onMounted(() => {
font-weight: 400;
font-size: 26rpx;
color: #000000;
margin: 30rpx 0rpx;
margin: 30rpx 0rpx 0rpx 30rpx;
}
.box + .box {
margin-top: 30rpx;

View File

@ -13,23 +13,38 @@
<view class="btn" @click="add"> 新增 </view>
</view>
<view class="box" v-for="(item, index) in pageList.list" :key="index">
<view>
<page-view
@loadList="
(v) => {
getList(v);
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="100"
:isLoading="pageList.isLoading"
>
<view class="box" v-for="(item, index) in pageList.list" :key="index">
<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>{{ 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>
</page-view>
</view>
</template>
<script setup lang="ts">
import { GoodsApi } from "@/services";
import { UsersType } from "@/utils/enum";
import PageView from "@/components/PageView/index.vue";
const state = reactive<any>({
name: "",
supplierTypeId: -1,
@ -41,24 +56,32 @@ const pageList: PageResult<{
parentName: string;
shmCategoryName: string;
}> = reactive({
isLoading: false,
noMoreData: false,
total: 0,
list: [],
pageNum: 1,
pageSize: 10,
});
const resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
const handleSearch = () => {
resetPageList();
getList();
};
const update = (item: any) => {
GoodsApi.EditReceiveProduct({ isDeleted: true, id: item.id }).then(
(res) => {
if (res.code === 200) {
getList();
}
GoodsApi.EditReceiveProduct({ isDeleted: true, id: item.id }).then((res) => {
if (res.code === 200) {
resetPageList();
getList();
}
);
});
};
const edit = (item: any) => {
@ -68,17 +91,26 @@ const edit = (item: any) => {
JSON.stringify(item), //
});
};
const 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 = {
pageSize: 10,
pageNum: 1,
pageSize: pageList.pageSize,
pageNum: pageList.pageNum,
name: state.name,
};
GoodsApi.getShipmentProductByPage(params).then((res) => {
GoodsApi.getShipmentProductByPage(params).then((res: any) => {
if (res.code === 200) {
if (res.code === 200) {
(pageList as any).list = (res.data as any).list;
}
(pageList as any).list = (pageList as any).list = pageList.list.concat(
res.data.list
);
pageList.total = (res.data as any).total;
}
});
};

View File

@ -7,9 +7,10 @@
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"
@ -30,6 +31,7 @@
:clearable="true"
:customStyle="{}"
border="none"
:disabled="item.disabled"
>
<template #suffix>
<text v-if="item.key === 'subtractNum'">
@ -44,13 +46,14 @@
@delete="deletePic" -->
<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="filesRef"
@delete="handleDelete"
></uni-file-picker>
<u-radio-group
@ -58,9 +61,9 @@
v-model="(model1.order as any)[item.key]"
placement="row"
>
<u-radio activeColor="#00DCEE" label="按固定重量" :name="1"></u-radio>
<u-radio activeColor="#00DCEE" label="送货" :name="0"></u-radio>
&nbsp;&nbsp;&nbsp;
<u-radio activeColor="#00DCEE" label="按百分比" :name="2"></u-radio>
<u-radio activeColor="#00DCEE" label="自提" :name="1"></u-radio>
</u-radio-group>
<template #right v-if="item.type === 'select'">
<u-icon name="arrow-right"></u-icon>
@ -92,6 +95,7 @@
</template>
<script setup lang="ts">
import {
CustomerApi,
DeviceApi,
GoodsApi,
PictureApi,
@ -106,23 +110,53 @@ import _ from "underscore";
const model1 = reactive<any>({
order: {
buttonType: 0,
fileList: [],
deliveryMethod: 0,
fileLists: [],
splTime: "",
subtractType: 1,
},
});
const rules = ref({
"userInfo.userName": {
const rules = reactive({
"order.repairTime": {
type: "string",
required: true,
message: "请输入手机号",
message: "请选择补单时间",
trigger: ["blur", "change"],
},
"userInfo.password": {
"order.deviceName": {
type: "string",
required: true,
message: "请输入密码",
message: "请选择过磅设备",
trigger: ["blur", "change"],
},
"order.userName": {
type: "string",
required: true,
message: "请选择客户",
trigger: ["blur", "change"],
},
"order.productName": {
type: "string",
required: true,
message: "请选择出货产品",
trigger: ["blur", "change"],
},
"order.number": {
type: "string",
required: true,
message: "请输入数量",
trigger: ["blur", "change"],
},
"order.grossWeight": {
type: "string",
required: true,
message: "请输入毛重",
trigger: ["blur", "change"],
},
"order.tare": {
type: "string",
required: true,
message: "请输入皮重",
trigger: ["blur", "change"],
},
});
@ -178,7 +212,7 @@ const formAttrList = reactive<any>([
unit: "",
fn: () => {
contrlModalParams.user.isShow = true;
contrlModalParams.user.title = "供应商";
contrlModalParams.user.title = "客户";
},
},
{
@ -219,6 +253,7 @@ const formAttrList = reactive<any>([
key: "netWeight",
type: "input",
required: true,
disabled: true,
unit: "KG",
},
{
@ -280,28 +315,62 @@ const formAttrList = reactive<any>([
type: "upload",
},
]);
//
watch(
[
() => model1.order.grossWeight,
() => model1.order.tare,
],
([grossWeightNew, tareNew]) => {
/**
* 过磅净重 毛重-皮重
结算重量 过磅净重-扣杂
预估总价 结算单价*结算重量
实际收入实际结算金额-运费-杂费
*/
model1.order.netWeight = (grossWeightNew || 0) - (tareNew || 0);
}
);
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 as any).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.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: "已删除" });
}
});
}
};
const handleSelect = (key: string, v: any) => {
contrlModalParams[key].isShow = false;
if (key === "user") {
@ -316,11 +385,10 @@ const handleSelect = (key: string, v: any) => {
model1.order.deviceId = v.id;
}
};
//
ProfileApi.getUserList({ userType: 3 }).then((res) => {
//
CustomerApi.getCustomUserList({}).then((res) => {
if (res.code === 200) {
contrlModalParams.user.list = res.data;
console.log(contrlModalParams.user.list);
}
});
//
@ -351,27 +419,50 @@ const upload = () => {
if (res.length > 0) {
PictureApi.addListAnnex({ annexPos: res }).then((res1) => {
if (res1.code === 200) {
uni.showToast({
title: "图片资源上传成功",
icon: "success",
});
console.log("*** 资源文件更新成功");
}
});
}
});
};
/**
* 校验
*/
const form = ref();
const check = () => {
return new Promise((resolve) => {
form.value
.validate()
.then((res: boolean) => {
resolve(res);
})
.catch((errors: any) => {
debugger
resolve(false);
uni.showToast({
icon: "none",
title: errors[0].message || "校验失败",
});
});
});
};
const save = () => {
if (model1.order.buttonType === 0) {
model1.order.buckleMiscellaneous = model1.order.subtractNum;
} else if (model1.order.buttonType === 1) {
model1.order.points = model1.order.subtractNum;
}
check().then((res) => {
if (res) {
startSave();
}
});
};
const startSave = () => {
ShipmentApi.addOrderOut(model1.order).then((res) => {
if (res.code === 200) {
model1.order.id = res.data;
upload();
uni.navigateTo({
url: "/pages/index/index", //
uni.redirectTo({
url: "/pagesHome/index", //
});
}
});

View File

@ -19,6 +19,9 @@
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="100"
:isLoading="pageList.isLoading"
>
<view class="box">
<view v-for="(item, index) in pageList.list" :key="index">
@ -38,19 +41,26 @@
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({
isLoading: false,
noMoreData: false,
total: 0,
list: [],
pageNum: 1,
pageSize: 10,
});
const resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
const add = () => {
uni.navigateTo({
url: "/pagesApp/components/addShipmentType", //
@ -71,19 +81,20 @@ const deleteType = (item: any) => {
});
};
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
pageList.pageNum++;
if (Math.ceil(pageList.total / pageList.pageSize) <= pageList.pageNum) {
pageList.noMoreData = true;
}
} else {
pageList.noMoreData = true
return
pageList.noMoreData = true;
return;
}
}
let params: any = {
@ -96,10 +107,10 @@ const getList = (v?: boolean) => {
}
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
}
(pageList as any).list = (pageList as any).list.concat(
(res.data as any).list
);
pageList.total = (res.data as any).total;
}
});
};

View File

@ -12,26 +12,45 @@
></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>
<page-view
@loadList="
(v) => {
getList(v);
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="100"
:isLoading="pageList.isLoading"
>
<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>
</page-view>
</view>
</template>
<script setup lang="ts">
import { StockCardApi } from "@/services";
import { StockCardType } from "@/utils/enum";
const keyword = ref("");
import PageView from "@/components/PageView/index.vue";
const state = reactive<any>({
name: "",
@ -42,6 +61,13 @@ const pageList: PageResult<StockCard> = reactive({
pageNum: 1,
pageSize: 10,
});
const resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
const add = () => {
uni.navigateTo({
url: "/pagesApp/components/addStockCard", //
@ -57,18 +83,28 @@ const edit = (item: any) => {
const deleteCustomer = (item: any) => {
StockCardApi.updateStockCard({ isDeleted: true, id: item.id }).then((res) => {
if (res.code === 200) {
resetPageList();
getList();
}
});
};
const handleSearch = () => {
resetPageList();
getList();
};
const 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 = {
pageSize: 10,
pageNum: 1,
name: state.name,
pageSize: pageList.pageSize,
pageNum: pageList.pageNum,
cardCode: state.name,
};
if (state.supplierTypeId > -1) {
params.supplierTypeId = state.supplierTypeId;

View File

@ -16,18 +16,30 @@
<view class="btn" @click="addSupplier"> 新增 </view>
</view>
<view class="box" v-for="(item, index) in pageList.list" :key="index">
<view>
<page-view
@loadList="
(v) => {
getList(v);
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="100"
:isLoading="pageList.isLoading"
>
<view class="box" v-for="(item, index) in pageList.list" :key="index">
<view>
<view>{{ item.name }}</view>
<view>卡号{{ item.cardCode }}</view>
</view>
<view class="op-box">
<view class="btn" @click="edit(item)"> 编辑 </view>
<view class="btn" @click="update(item)"> 删除 </view>
<view>
<view>{{ item.name }}</view>
<view>卡号{{ item.cardCode }}</view>
</view>
<view class="op-box">
<view class="btn" @click="edit(item)"> 编辑 </view>
<view class="btn" @click="update(item)"> 删除 </view>
</view>
</view>
</view>
</view>
</page-view>
</view>
<u-action-sheet
:actions="state.typeList"
@ -42,6 +54,7 @@
<script setup lang="ts">
import { SupplierApi } from "@/services";
import { UsersType } from "@/utils/enum";
import PageView from "@/components/PageView/index.vue";
const state = reactive<any>({
name: "",
supplierTypeId: -1,
@ -54,19 +67,29 @@ const pageList: PageResult<User> = reactive({
pageNum: 1,
pageSize: 10,
});
const resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
const handleSelect = (v: any) => {
state.supplierTypeId = v.id;
getUserList();
resetPageList();
getList();
};
const handleSearch = () => {
getUserList();
resetPageList();
getList();
};
const update = (item: any) => {
SupplierApi.updateSupplierUser({ isDeleted: true, id: item.id }).then(
(res) => {
if (res.code === 200) {
getUserList();
resetPageList();
getList();
}
}
);
@ -79,27 +102,38 @@ const edit = (item: any) => {
JSON.stringify(item), //
});
};
const getUserList = () => {
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: 10,
pageNum: 1,
pageSize: pageList.pageSize,
pageNum: pageList.pageNum,
name: state.name,
};
if (state.supplierTypeId > -1) {
params.supplierTypeId = state.supplierTypeId;
}
SupplierApi.getSupplierUserPage(params).then((res) => {
pageList.isLoading = true;
SupplierApi.getSupplierUserPage(params).then((res: any) => {
if (res.code === 200) {
if (res.code === 200) {
(pageList as any).list = (res.data as any).list;
}
pageList.isLoading = false;
(pageList as any).list = (pageList as any).list = pageList.list.concat(
res.data.list
);
pageList.total = (res.data as any).total;
}
});
};
const getSupplierTypeList = () => {
SupplierApi.getSupplierTypeList().then((res) => {
SupplierApi.getSupplierTypeList().then((res: any) => {
if (res.code === 200) {
state.typeList = res.data;
state.typeList = [{ id: -1, name: "全部" }].concat(res.data);
}
});
};
@ -109,7 +143,7 @@ const addSupplier = () => {
});
};
onMounted(() => {
getUserList();
getList();
getSupplierTypeList();
});
</script>
@ -141,7 +175,7 @@ onMounted(() => {
background: #ffffff;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
padding: 0rpx 20rpx;
padding: 10rpx 20rpx;
font-weight: 400;
font-size: 28rpx;
color: #000000;

View File

@ -19,6 +19,9 @@
}
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="100"
:isLoading="pageList.isLoading"
>
<view class="box">
<view v-for="(item, index) in pageList.list" :key="index">
@ -50,6 +53,13 @@ const pageList: PageResult<StockCard> = reactive({
pageNum: 1,
pageSize: 10,
});
const resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
const add = () => {
uni.navigateTo({
url: "/pagesApp/components/addSupplierType", //
@ -66,20 +76,22 @@ const deleteType = (item: any) => {
SupplierApi.updateSupplierType({ isDeleted: true, id: item.id }).then(
(res) => {
if (res.code === 200) {
resetPageList();
getList();
}
}
);
};
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
if (Math.ceil(pageList.total / pageList.pageSize) <= pageList.pageNum) {
pageList.noMoreData = true;
}
} else {
pageList.noMoreData = true;
@ -94,10 +106,14 @@ const getList = (v?: boolean) => {
if (state.supplierTypeId > -1) {
params.supplierTypeId = state.supplierTypeId;
}
SupplierApi.getSupplierTypePage(params).then((res) => {
pageList.isLoading = true;
SupplierApi.getSupplierTypePage(params).then((res: any) => {
if (res.code === 200) {
if (res.code === 200) {
(pageList as any).list = (res.data as any).list;
pageList.isLoading = false;
(pageList as any).list = (pageList as any).list = pageList.list.concat(
res.data.list
);
pageList.total = (res.data as any).total;
}
}

View File

@ -21,6 +21,8 @@
"
:noMoreData="pageList.noMoreData"
:list="pageList.list"
:height="100"
:isLoading="pageList.isLoading"
>
<view class="box">
<view v-for="(item, index) in pageList.list" :key="index">
@ -105,14 +107,14 @@ const getList = (v?: boolean) => {
pageNum: pageList.pageNum,
name: state.name,
};
pageList.isLoading = true;
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;
}
pageList.isLoading = false;
(pageList as any).list = (pageList as any).list.concat(
(res.data as any).list
);
pageList.total = (res.data as any).total;
}
});
};

View File

@ -395,24 +395,6 @@ const appList = reactive([
});
},
},
// {
// icon: "12.png",
// title: "",
// fn: () => {
// // uni.navigateTo({
// // url: "/pagesApp/shipmentDetail", //
// // });
// },
// },
// {
// icon: "13.png",
// title: "",
// fn: () => {
// // uni.navigateTo({
// // url: "/pagesApp/receiveCl", //
// // });
// },
// },
{
icon: "14.png",
title: "人员管理",
@ -449,6 +431,24 @@ const appList = reactive([
});
},
},
{
icon: "12.png",
title: "支付明细",
fn: () => {
uni.navigateTo({
url: "/pagesApp/paymentDetail", //
});
},
},
{
icon: "13.png",
title: "收入明细",
fn: () => {
uni.navigateTo({
url: "/pagesApp/incomeDetail", //
});
},
},
]);

View File

@ -123,9 +123,7 @@ const getList = (v?: boolean) => {
ReceiveApi.getOrderPage(params).then((res) => {
if (res.code === 200) {
pageList.isLoading = false;
(pageList as any).list = (pageList as any).list = (
pageList as any
).list.concat(res.data.list);
(pageList as any).list = pageList.list.concat(res.data.list);
pageList.total = (res.data as any).total;
}
});

View File

@ -61,7 +61,7 @@
</view>
<view class="more">
<view v-if="getIsShow()"> 收货单号SHD20230901132333 </view>
<view v-if="getIsShow()"> 收货单号{{ state.order.receiptNumber }} </view>
<view v-if="getIsShow()"></view>
<view v-for="(item, index) in gridList1" :key="index">
<text v-if="item.name">{{ item.name }}</text

View File

@ -429,7 +429,7 @@ const handleUpload = () => {
resolve({
...(res.data as any),
businessId: model1.order.id,
imagesType: ImagesType.Settlement, //
imagesType: ImagesType.NORMARL, //
orderType: OrderType.Shipment, //
});
}
@ -553,7 +553,7 @@ onLoad((option) => {
PictureApi.getAnnex({
businessId: model1.order.id,
orderType: OrderType.Shipment,
imagesType: ImagesType.Settlement,
imagesType: ImagesType.NORMARL,
}).then((res) => {
if (res.code === 200) {
model1.order.fileLists = res.data;

View File

@ -440,7 +440,7 @@ const gridList3 = reactive([
},
{
name: "实际收入",
enName: "incidentals",
enName: "realIncome",
num: "",
unit: "元",
isBefore: false,

View File

@ -35,4 +35,15 @@ export const getCustomUserList = (data: any) => {
})
}
// 客户字母分组
export const getCustomUserListLettera = (data: any) => {
return http({
method: 'GET',
url: '/api/custom/user/getCustomUserListLettera',
data,
})
}

88
src/services/finance.ts Normal file
View File

@ -0,0 +1,88 @@
import { http } from '@/utils/http'
// 经营概况-支付明细
export const getPaymentCount = (data: any) => {
return http({
method: 'GET',
url: '/api/paymentdtails/getPaymentCount',
data,
})
}
// 经营概况-收入明细
export const getRevenueCount = (data: any) => {
return http({
method: 'GET',
url: '/api/revenuedetails/getRevenueCount',
data,
})
}
// 支付明细新增
export const addPaymentDetails = (data: any) => {
return http({
method: 'POST',
url: '/api/paymentdtails/addPaymentDetails',
data,
})
}
// 删除
export const deletePaymentDs = (data: any) => {
return http({
method: 'POST',
url: '/api/paymentdtails/deletePaymentDs',
data,
})
}
// 分页查询支付明细
export const getPaymentDetailsPage = (data: any) => {
return http({
method: 'GET',
url: '/api/paymentdtails/getPaymentDetailsPage',
data,
})
}
// 支付明细-查看详情
export const getByPaymentId = (data: any) => {
return http({
method: 'GET',
url: '/api/paymentdtails/getByPaymentId',
data,
})
}
// 收货明细分页查询
export const getRevenueDetailsPage = (data: any) => {
return http({
method: 'GET',
url: '/api/revenuedetails/getRevenueDetailsPage',
data,
})
}
// 收入明细查看详情
export const getRevenueDetailsById = (data: any) => {
return http({
method: 'GET',
url: '/api/revenuedetails/getRevenueDetailsById',
data,
})
}
// 收入明细新增
export const addIncome = (data: any) => {
return http({
method: 'POST',
url: '/api/revenuedetails/addRevenueDes',
data,
})
}
// 收入明细逻辑删除
export const deleteRevenueDes = (data: any) => {
return http({
method: 'POST',
url: '/api/revenuedetails/deleteRevenueDes',
data,
})
}

View File

@ -168,6 +168,15 @@ export const addShipmentProduct = (data: any) => {
})
}
// 出货产品编辑
export const editShipmentProduct = (data: any) => {
return http({
method: 'POST',
url: '/api/shmproducts/edit',
data,
})
}
// 出货产品分页查询
export const getShipmentProductByPage = (data: any) => {
return http({

View File

@ -7,4 +7,5 @@ export * as DeviceApi from './device'
export * as StockCardApi from './stockCard'
export * as GoodsApi from './goods'
export * as SupplierApi from './supplier'
export * as CustomerApi from './customer'
export * as CustomerApi from './customer'
export * as FinanceApi from './finance'

View File

@ -59,10 +59,10 @@ export const addRole = (data: { roleCode: string; roleName: string }) => {
};
// 修改角色
export const updateRole = (data: {
id: string;
roleCode: string;
roleName: string;
isDeleted: string;
id?: string;
roleCode?: string;
roleName?: string;
isDeleted?: boolean;
}) => {
return http({
method: "POST",

View File

@ -108,6 +108,33 @@ export const reTare = (data: any) => {
});
};
// 收货单概况
export const getOverview = (data: any) => {
return http({
method: "GET",
url: "/api/orderIn/getOverview",
data
});
};
// 供应商对账
export const getReconciliation = (data: any) => {
return http({
method: "GET",
url: "/api/orderIn/getReconciliation",
data
});
};
// 概况总应收应付
export const getTotal = () => {
return http({
method: "GET",
url: "/api/orderIn/getTotal"
});
};

View File

@ -104,6 +104,24 @@ export const reGrossWeight = (data: any) => {
});
};
// 收货单概况
export const getOverview = (data: any) => {
return http({
method: "GET",
url: "/api/orderOut/getOverview",
data
});
};
// 供应商对账
export const getReconciliation = (data: any) => {
return http({
method: "GET",
url: "/api/orderOut/getReconciliation",
data
});
};

View File

@ -24,3 +24,12 @@ export const updateStockCard = (data: any) => {
data,
})
}
// 查询供应商/客户库存卡列表
export const getStockCardListInfo = (data: any) => {
return http({
method: 'GET',
url: '/api/card/getStockCardListInfo',
data,
})
}

View File

@ -70,3 +70,11 @@ export const getSupplierUserList = (data: any) => {
})
}
export const getSupplierUserListLettera = (data: any) => {
return http({
method: 'GET',
url: '/api/supplier/user/getSupplierUserListLettera',
data
})
}

View File

@ -29,7 +29,7 @@ interface Order {
points?: number; //扣点
buckleMiscellaneous?: number; //扣杂
price?: string; //单价
balanceTotalPrice?: string; //结算总价 货款金额
balanceTotalPrice?: string; //结算总价 货款金额
totalPrice?: string; //实际总价 预估价格
weighingMethod?: number; //称重方式0有皮重 1零皮重
multiCategory?: number; //多品类0单品类 1多品类

View File

@ -3,6 +3,8 @@
export enum OrderType {
Receive = 1,
Shipment = 2,
Pay = 3,
Income = 4
}
// 扣杂状态0扣杂1扣点
export enum ButtonType {
@ -20,12 +22,13 @@ export enum MultiCategory {
Multiple = 1,
}
// 0:普通资源1皮重 2毛重 3 结算单据
// 0:普通资源1皮重 2毛重
export enum ImagesType {
NORMARL = 0,
Tare = 1,
GROSSWEIGHT = 2,
Settlement = 3
// Settlement = 3,
// Payment = 4
}
//磅单状态:0待定价1待过皮2待审核3已审核待支付4已支付
// 磅单状态0待出货1:待过毛2待审核3已审未付4已审已付
@ -82,4 +85,13 @@ export enum DeviceType {
export enum StockCardType {
Shipment = 1,
Receive = 2
}
// 今日 昨日 本月 本年 自定义
export enum TimeRange {
Today = 1,
Yesterday = 2,
Month = 3,
Year = 4,
Custom = 5
}

View File

@ -1,3 +1,5 @@
import { TimeRange } from "./enum";
export function formatDate(time: any, cFormat: string) {
const format = cFormat || "{y}-{m}-{d}";
const date = new Date(time);
@ -128,3 +130,33 @@ export function pageListInit() {
pageSize: 10,
};
}
// 过滤掉属性值为null的
export function filterNullUndefined(obj: Object) {
return Object.entries(obj).reduce((acc: any, [key, value]) => {
if (value !== null && value !== undefined && value !== "") {
acc[key] = value;
}
return acc;
}, {});
}
export function timeRange(id: number) {
const today = new Date();
const yesterday = new Date((today as any) - 24 * 60 * 60 * 1000);
let startTime = "";
let endTime = "";
if (id === TimeRange.Today) {
startTime = formatDate(today, "{y}-{m}-{d}");
endTime = formatDate(today, "{y}-{m}-{d}");
} else if (id === TimeRange.Yesterday) {
startTime = formatDate(yesterday, "{y}-{m}-{d}");
endTime = formatDate(yesterday, "{y}-{m}-{d}");
} else if (id === TimeRange.Month) {
startTime = formatDate(getCurrentMonthStartAndEnd().start, "{y}-{m}-{d}");
endTime = formatDate(getCurrentMonthStartAndEnd().end, "{y}-{m}-{d}");
} else if (id === TimeRange.Year) {
startTime = formatDate(getCurrentYearStartAndEnd().start, "{y}-{m}-{d}");
endTime = formatDate(getCurrentYearStartAndEnd().end, "{y}-{m}-{d}");
}
return { startTime: startTime, endTime: endTime };
}