From 11f7661538f75c2d4eefd32408eba6dc0d77052b Mon Sep 17 00:00:00 2001 From: xuxueyang <xuxy@fengyuntec.com> Date: 星期一, 29 七月 2024 11:17:38 +0800 Subject: [PATCH] add 供应商的入位 --- sub_pages/customer/trade/list.vue | 2 environments/index.js | 4 pages/order/order-delivery-detail.vue | 325 +++++++++++++++++++++++++ sub_pages/supplier/order-settlement/order-settlement.vue | 12 pages/home/supplier-home.vue | 50 +++ pages.json | 14 + pages/order/order-delivery.vue | 263 ++++++++++++++++++++ pages/user/supplier-user.vue | 52 ++- store/index.js | 3 9 files changed, 691 insertions(+), 34 deletions(-) diff --git a/environments/index.js b/environments/index.js index 7a40f75..199d56d 100644 --- a/environments/index.js +++ b/environments/index.js @@ -1,7 +1,7 @@ export default { - // httpBaseUri: 'https://www.hmyxianhua.com/flower', - httpBaseUri: 'http://47.99.58.211/flower', + httpBaseUri: 'https://www.hmyxianhua.com/flower', + // httpBaseUri: 'http://47.99.58.211/flower', // httpBaseUri: 'http://localhost:8080/flower', clientId: '', secret: '', diff --git a/pages.json b/pages.json index c752a79..bfcf15c 100644 --- a/pages.json +++ b/pages.json @@ -121,6 +121,18 @@ "style": { "navigationBarTitleText": "" } + }, + { + "path": "pages/order/order-delivery-detail", + "style": { + "navigationBarTitleText": "订单详情" + } + }, + { + "path": "pages/order/order-delivery", + "style": { + "navigationBarTitleText": "订单列表" + } } ], "subPackages": [{ @@ -171,7 +183,6 @@ "navigationBarBackgroundColor": "#E6F2EB" } }, - // #endif { "path": "protocol", "style": { @@ -179,6 +190,7 @@ "enablePullDownRefresh": false } } + // #endif ] }, { diff --git a/pages/home/supplier-home.vue b/pages/home/supplier-home.vue index 4393190..1e42fca 100644 --- a/pages/home/supplier-home.vue +++ b/pages/home/supplier-home.vue @@ -38,7 +38,7 @@ <view class="flex tj-container" v-if="selftype==='partner'">. <view class="tj-each"> <view class="num total"> - ¥0.00 + ¥{{tj.income||'0.00'}} </view> </view> <view class="tj-each" style="flex: 1;"> @@ -78,7 +78,7 @@ <view class="flex tj-container"> <view class="tj-each"> <view class="num"> - 0扎 + {{dto.orderCountToday||0}}扎 </view> <view class="name"> 今日订单数 @@ -86,7 +86,7 @@ </view> <view class="tj-each"> <view class="num"> - 0扎 + {{dto.orderCountYesterday||0}}扎 </view> <view class="name"> 昨日订单数 @@ -94,7 +94,7 @@ </view> <view class="tj-each"> <view class="num"> - 0扎 + {{dto.orderCountMonth||0}}扎 </view> <view class="name"> 本月订单数 @@ -105,15 +105,15 @@ <view class="item-container flex m-t-12" style="padding: 34rpx 44rpx;"> <view class="rate-view flex1" style="max-width: 140rpx;"> <view class="title">售后率</view> - <view class="title" style="color: red;">0.00%</view> + <view class="title" style="color: red;">{{tj.salesRate||0}}%</view> </view> - <view class="tj-panel pink flex1"> + <view class="tj-panel pink flex1" @click="goto('/pages/order/order-delivery?status=ARRIVED',true)"> <view class="name">今日待配送</view> - <view class="title">0扎</view> + <view class="title">{{tj.deliverCount||0}}扎</view> </view> - <view class="tj-panel green flex1"> + <view class="tj-panel green flex1" @click="goto('/pages/order/order-delivery?status=',true)"> <view class="name green">今日配送汇总</view> - <view class="title">0扎</view> + <view class="title">{{tj.deliverTotal||0}}扎</view> </view> </view> <view class="m-t-12" @click="getNoticeMore"> @@ -198,6 +198,8 @@ }, scrollable: false, + cacheUserId:'', + tj:{} }; }, @@ -208,6 +210,9 @@ onLoad(options) { const url = options.q ? decodeURIComponent(options.q) : ''; const urlcode = options.url && decodeURIComponent(options.url) || '' + }, + onShow(){ + this.getTj() }, created() { //公告 @@ -253,6 +258,33 @@ }, methods: { + getTj() { + // /api/supplier/delivery + + if (this.currentInfo.id && this.currentInfo.id !== this.cacheUserId) { + this.cacheUserId = this.currentInfo.id + let that = this + setTimeout(() => { + //其他统计 + // #ifdef PUB_SUPPLIER + this.$http.request('get', '/api/supplier/delivery/statistics', {}).then(res => { + if (res.code === 0) { + that.tj = res.data || {} + } + }) + // #endif + // #ifdef PUB_PARTNER + this.$http.request('get', '/api/partner/order/statistics', {}).then(res => { + if (res.code === 0) { + that.tj = res.data || {} + } + }) + // #endif + + }, 200) + } + + }, async toFlowManage() { diff --git a/pages/order/order-delivery-detail.vue b/pages/order/order-delivery-detail.vue new file mode 100644 index 0000000..55591f4 --- /dev/null +++ b/pages/order/order-delivery-detail.vue @@ -0,0 +1,325 @@ +<script> + export default { + data() { + return { + tabIndex: 0, + query: {}, + id: '', + status: '', + dto: { + id: '', + arriveImageList: [], + arriveRemarks: '' + } + } + }, + async onLoad(options) { + if (options.id) { + this.id = options.id || '' + this.status = options.status || '' + this.query.id = this.id + } + this.listApi = '/api/supplier/delivery/list/items' + await this.getList() + + }, + methods: { + async deleteBanner(index) { + await this.$message.confirm('是否确认删除此图片') + this.dto.arriveImageList.splice(index, 1) + }, + uploadIcon(key) { + const that = this + uni.chooseImage({ + count: 1, // 最多可以选择的图片张数,默认9 + sizeType: ['compressed'], //original 原图,compressed 压缩图,默认二者都有 + sourceType: ['camera', 'album'], //album 从相册选图,camera 使用相机,默认二者都有。如需直接开相机或直接选相册,请只使用一个选项 + success: function(res) { + let errMsg = res.errMsg + let tempFiles = res.tempFiles + if (errMsg === 'chooseImage:ok') { + if (tempFiles[0].size > 1024 * 1024 * 5) { + that.$message.confirm('图片最多支持5M大小,超出大小限制') + return + } + that.$message.showLoading() + that.$http.upload(tempFiles[0].path).then(async res => { + console.log('res1', res) + var pic = res.data && res.data.length > 0 && res.data[ + 0] + .url || '' + that.$message.hideLoading() + that.dto[key].push(pic) + that.$forceUpdate() + }).catch(res => { + that.$message.hideLoading() + console.error(res) + }) + } + } + }) + + }, + async submit(status) { + await this.$message.confirm('是否确认入位') + this.$message.showLoading() + const { + code + } = await this.$http.request('post', '/api/supplier/delivery/list/arrive', { + data: { + ...this.dto, + id: this.id + } + }) + this.$message.hideLoading() + if (code === 0) { + await this.$store.dispatch('sign_add', 'delivery') + //返回上一步 + uni.navigateBack() + } + }, + + } + } +</script> + +<template> + <view class="list-container order-delivery supplier"> + <view class="p15"> + <no-data v-if="!list||list.length==0" style="width: 100%;"></no-data> + <view v-for="(item,index) in list" :key="index" @click="toDetail(item)" + class="m-b-24 order-sale-list list-container"> + <view class="order-sale-item list-item"> + <view class="title flex"> + <view>订单单号:{{item.orderNo}}</view> + <view class="m-l-a m-r-0 status">{{item.statusStr}}</view> + </view> + <view class="line"></view> + <view class="flower flex"> + <image class="image img100 m-r-6" :src="item.flowerCover" @click="previewImg(item.flowerCover)"> + </image> + <view class="flex1"> + <view class=" flex"> + <view class="title">{{item.flowerName }} + </view> + </view> + <view class="each-list flex"> + <view class="each-item"> + <view class="label">颜色</view> + <view class="value">{{ item.flowerColor || '-' }}</view> + + </view> + <view class="each-item"> + <view class="label">规格</view> + <view class="value">{{ item.flowerUnit || '-' }}</view> + </view> + </view> + </view> + <view class="each-list price"> + <view class="each-item"> + <view class="value">¥{{ item.price || '-' }}</view> + </view> + <view class="each-item"> + <view class="value">x {{ item.num || 0 }}</view> + </view> + </view> + + </view> + + <view class="line"></view> + <view class="delivery-form"> + <view class="form-item"> + <view class="label">仓库名称</view> + <view class="value red">{{item.warehouseName}}</view> + </view> + <view class="form-item"> + <view class="label">库位名称</view> + <view class="value red">{{item.warehouseLocationCode}}</view> + </view> + + </view> + + </view> + </view> + </view> + <view v-if="status=='PENDING'"> + <!-- 提交图片 --> + <view class="delivery-form p20 bg-white br-4"> + <view class="form-item flex before-line bottom-border-no"> + <view class="label " style="width: 400rpx;">图片</view> + <view class="m-l-a m-r-0 flex"> + <view class="component-button-upload" @click="uploadIcon('arriveImageList')"> + + </view> + </view> + </view> + <view class="flex p20" style="padding-top: 0rpx;padding-bottom: 10rpx" + v-if="dto.arriveImageList&&dto.arriveImageList.length>0"> + <view class="m-t-12 m-r-10 " v-for="(tBanner,index) of dto.arriveImageList" :key="index"> + <image class="banner-img" :src="tBanner" @click.stop="previewImg(tBanner)"> + + </image> + <view class="t-red text-center" @click.stop="deleteBanner(index)">删除</view> + </view> + </view> + + <view class="form-item flex m-t-12 "> + <view class="label m-r-20">备注</view> + <view class="m-l-a m-r-0 flex1"> + <view class="m-t-12 m-b-12"> + <u-textarea v-model="dto.arriveRemarks" clearable placeholder="请输入备注"> + + </u-textarea> + </view> + </view> + </view> + </view> + </view> + <view class="button-space"> + + </view> + <view class="button-green-1 button-fixed-bottom" v-if="status=='PENDING'" @click="submit('ARRIVED')"> + 确认入位 + </view> + </view> +</template> + +<style lang="scss" scope> + .order-delivery { + .banner-img { + width: 96rpx; + height: 96rpx; + border-radius: 4rpx; + border: 2rpx dashed #CECECE; + } + .order-sale-list { + .order-sale-item { + background-color: #fff; + margin-bottom: 20rpx; + padding: 22rpx; + + .buttons { + display: flex; + margin-left: auto; + width: fit-content; + + .button { + // width: 216rpx; + padding: 10rpx 20rpx; + line-height: 34rpx; + font-size: 24rpx; + height: 34rpx; + background: #20613D; + text-align: center; + border-radius: 30rpx; + + } + + .button-1 { + background: #fff; + color: #333; + border: 2rpx solid #333; + + } + + .button-0 { + color: #fff; + border: 2rpx solid #20613D; + } + } + + .title { + font-weight: 600; + font-size: 28rpx; + color: #000000; + line-height: 40rpx; + } + + .status { + color: #20613D; + } + + .line { + min-height: 2rpx; + background-color: #EEEEEE; + margin-top: 16rpx; + margin-bottom: 16rpx; + } + + .flower { + font-weight: 400; + font-size: 24rpx; + color: #666666; + line-height: 40rpx; + + .image { + width: 115rpx; + height: 106rpx; + } + + .title { + font-weight: 600; + font-size: 28rpx; + color: #000000; + line-height: 40rpx; + } + + .desc {} + + .price { + color: #CF0000; + } + } + .form{ + .form-item{ + height: unset; + // min-height: ; + } + } + .delivery-form { + display: flex; + flex-wrap: wrap; + + .form-item { + flex: 1; + min-width: 40%; + max-width: 50%; + display: flex; + + .label { + font-weight: 400; + font-size: 22rpx; + color: #666666; + line-height: 34rpx; + min-width: 120rpx + } + + .label::after { + content: ":"; + font-weight: 400; + font-size: 24rpx; + color: #666666; + line-height: 34rpx; + } + + .value { + font-weight: 400; + font-size: 22rpx; + color: #333; + line-height: 34rpx; + } + + .value.red { + color: #CF0000; + } + } + + .form-item.width100 { + max-width: unset; + } + } + } + } + + } +</style> \ No newline at end of file diff --git a/pages/order/order-delivery.vue b/pages/order/order-delivery.vue new file mode 100644 index 0000000..e739447 --- /dev/null +++ b/pages/order/order-delivery.vue @@ -0,0 +1,263 @@ +<template> + <view class="list-container order-sale supplier"> + <view class="component-tab-container m-t-12"> + <view class="tab-item" :class="[query.status==''?'cur':'']" @click="changeIndex('')">全部订单</view> + <view class="tab-item" :class="[query.status=='PENDING'?'cur':'']" @click="changeIndex('PENDING')">待入位 + </view> + <view class="tab-item" :class="[query.status=='ARRIVED'?'cur':'']" @click="changeIndex('ARRIVED')">已入位 + </view> + + </view> + <view class="p15" style="min-height: calc(100vh - 160rpx);"> + <no-data v-if="!list||list.length==0" style="width: 100%;"></no-data> + <view v-for="(item,index) in list" :key="index" class="m-b-24 order-sale-list list-container"> + <view class="order-sale-item list-item"> + <view class="title flex"> + <view>订单单号:{{item.orderNo}}</view> + <view class="m-l-a m-r-0 status">{{item.statusStr}}</view> + </view> + <view class="line" v-if="false"></view> + <view class="flower flex" v-if="false"> + <image class="image img100 m-r-6" :src="item.flowerCover" @click="previewImg(item.flowerCover)"> + </image> + <view class="flex1"> + <view class=" flex"> + <view class="title">{{item.flowerName }} + </view> + </view> + <view class="each-list flex"> + <view class="each-item"> + <view class="label">颜色</view> + <view class="value">{{ item.flowerColor || '-' }}</view> + + </view> + <view class="each-item"> + <view class="label">规格</view> + <view class="value">{{ item.flowerUnit || '-' }}</view> + </view> + </view> + </view> + <view class="each-list price"> + <view class="each-item"> + <view class="value">¥{{ item.price || '-' }}</view> + </view> + <view class="each-item"> + <view class="value">x {{ item.num || 0 }}</view> + </view> + </view> + + </view> + + <view class="line"></view> + <view class="delivery-form"> + <view class="form-item" style="max-width: 100%;"> + <view class="label">下单时间</view> + <view class="value">{{item.paymentTime}}</view> + </view> + </view> + <view class="delivery-form"> + <view class="form-item"> + <view class="label">仓库名称</view> + <view class="value red">{{item.warehouseName}}</view> + </view> + <view class="form-item"> + <view class="label">库位名称</view> + <view class="value red">{{item.warehouseLocationCode}}</view> + </view> + + </view> + + <view class="line"></view> + <view class="buttons"> + <view class="button button-1 m-r-10" v-if="item.status==='PENDING'" + @click="toDetail(item,'PENDING')">确认入位</view> + <view class="button button-0" @click="toDetail(item,'')">查看详情</view> + </view> + + + </view> + </view> + </view> + + <!-- 判断是否到底了,自动吧 --> + <footer-msg :more="page.total>0&&page.total>page.current*page.size"></footer-msg> + + </view> +</template> + +<script> + export default { + data() { + return { + tabIndex: 0, + query: { + status: '', + }, + + } + }, + onLoad(options) { + if (options.status) { + this.query.status = options.status || '' + } + this.listApi = '/api/supplier/delivery/list/today' + this.getList() + + }, + onReachBottom() { + this.page.current += 1 + this.getMore() + }, + async onShow() { + if (this.sign['delivery']) { + await this.$store.dispatch('sign_clear', 'delivery'); + this.refreshList() + } + }, + async onPullDownRefresh() { + this.page.current = 1 + await this.getList() + uni.stopPullDownRefresh() + }, + methods: { + changeIndex(status) { + if (this.query.status !== status) { + this.query.status = status + // 刷新 query + this.refreshList() + } + }, + toDetail(item, status) { + uni.navigateTo({ + url: `/pages/order/order-delivery-detail?id=${item.id}&status=${status}` + }) + } + } + } +</script> + +<style lang="scss" scope> + .order-sale-list { + .order-sale-item { + background-color: #fff; + margin-bottom: 20rpx; + padding: 22rpx; + + .buttons { + display: flex; + margin-left: auto; + width: fit-content; + + .button { + // width: 216rpx; + padding: 10rpx 20rpx; + line-height: 34rpx; + font-size: 24rpx; + height: 34rpx; + background: #20613D; + text-align: center; + border-radius: 30rpx; + + } + + .button-1 { + background: #fff; + color: #333; + border: 2rpx solid #333; + + } + + .button-0 { + color: #fff; + border: 2rpx solid #20613D; + } + } + + .title { + font-weight: 600; + font-size: 28rpx; + color: #000000; + line-height: 40rpx; + } + + .status { + color: #20613D; + } + + .line { + min-height: 2rpx; + background-color: #EEEEEE; + margin-top: 16rpx; + margin-bottom: 16rpx; + } + + .flower { + font-weight: 400; + font-size: 24rpx; + color: #666666; + line-height: 40rpx; + + .image { + width: 115rpx; + height: 106rpx; + } + + .title { + font-weight: 600; + font-size: 28rpx; + color: #000000; + line-height: 40rpx; + } + + .desc {} + + .price { + color: #CF0000; + } + } + + .delivery-form { + display: flex; + flex-wrap: wrap; + + .form-item { + flex: 1; + min-width: 40%; + max-width: 50%; + display: flex; + + .label { + font-weight: 400; + font-size: 22rpx; + color: #666666; + line-height: 34rpx; + min-width: 120rpx + } + + .label::after { + content: ":"; + font-weight: 400; + font-size: 24rpx; + color: #666666; + line-height: 34rpx; + } + + .value { + font-weight: 400; + font-size: 22rpx; + color: #333; + line-height: 34rpx; + } + + .value.red { + color: #CF0000; + } + } + + .form-item.width100 { + max-width: unset; + } + } + } + } +</style> \ No newline at end of file diff --git a/pages/user/supplier-user.vue b/pages/user/supplier-user.vue index a61e88f..99e3571 100644 --- a/pages/user/supplier-user.vue +++ b/pages/user/supplier-user.vue @@ -118,26 +118,26 @@ </image> <view>地址管理</view> </view> - <view class="service-icons" @click="goto('/pages/help/content?id=售后规则',false)"> + <view class="service-icons" @click="goto('/pages/help/content?id=售后规则',false)"> <image src="../../static/images/customer/service/service-icon-4.png" class="service-icon "> </image> <view>售后规则</view> </view> </view> <view class="flex service-icons-container"> - <view class="service-icons" @click="goto('/pages/help/content?id=新手帮助',false)"> + <view class="service-icons" @click="goto('/pages/help/content?id=新手帮助',false)"> <image src="../../static/images/customer/service/service-icon-5.png" class="t2 service-icon "> </image> <view>新手帮助</view> </view> - <!-- <view class="service-icons" @click.stop="$meesage.showToast('敬请期待')"> + <!-- <view class="service-icons" @click.stop="$meesage.showToast('敬请期待')"> <image src="../../static/images/customer/service/service-icon-6.png" class="t2 service-icon "> </image> <view>运费详查</view> </view> --> - + <view class="service-icons"></view> - + <view class="service-icons"></view> <view class="service-icons"></view> </view> @@ -265,25 +265,25 @@ // StatusBar:0, tel: '15974805814', tj: {}, + cacheUserId: '', + }; }, + // watch: { + // currentInfo(nv, ov) { + // if (!cacheUserId) { + // } + // } + // }, + onShow(){ + this.getTj() + }, onLoad(options) { // const url = options.q ? decodeURIComponent(options.q) : ''; // const urlcode = options.url && decodeURIComponent(options.url) || '' - // #ifdef PUB_CUSTOMER - if (this.currentInfo.id) { - let that = this - setTimeout(() => { - this.$http.request('get', '/api/customer/center/tj', {}).then(res => { - if (res.code === 0) { - that.tj = res.data || {} - } - }) - }, 200) - } - // #endif + }, created() { @@ -294,6 +294,24 @@ uni.stopPullDownRefresh() }, methods: { + getTj() { + // /api/supplier/delivery + + if (this.currentInfo.id && this.currentInfo.id !== this.cacheUserId) { + this.cacheUserId = this.currentInfo.id + let that = this + setTimeout(() => { + // #ifdef PUB_CUSTOMER + this.$http.request('get', '/api/customer/center/tj', {}).then(res => { + if (res.code === 0) { + that.tj = res.data || {} + } + }) + // #endif + }, 200) + } + + }, async clearlogout() { await this.$message.confirm('是否退出登录?') diff --git a/store/index.js b/store/index.js index b75405f..ba659d7 100644 --- a/store/index.js +++ b/store/index.js @@ -28,7 +28,8 @@ 'info': 0, 'flower': 0, 'shopping': 0, - 'follow': 0 + 'follow': 0, + 'delivery':0 }, defaultaddress: {} }, diff --git a/sub_pages/customer/trade/list.vue b/sub_pages/customer/trade/list.vue index 56aa5f0..37ef47f 100644 --- a/sub_pages/customer/trade/list.vue +++ b/sub_pages/customer/trade/list.vue @@ -134,7 +134,7 @@ </view> <view class="button-space"></view> <view> - <view class="button-green" style="background-color: #fff;color: #000;width: 200rpx;left: 40rpx;right: unset;" + <view class="button-green" style="background-color: #fff;border: 2rpx solid #666; color: #666;width: 200rpx;left: 40rpx;right: unset;" @click="closeParamPopAndQuery"> 查询 </view> diff --git a/sub_pages/supplier/order-settlement/order-settlement.vue b/sub_pages/supplier/order-settlement/order-settlement.vue index f89a9da..f0db574 100644 --- a/sub_pages/supplier/order-settlement/order-settlement.vue +++ b/sub_pages/supplier/order-settlement/order-settlement.vue @@ -1,10 +1,10 @@ <template> <view class="list-container order-settlement supplier"> <view class="component-tab-container m-t-12"> - <view class="tab-item" :class="[tabIndex==0?'cur':'']" @click="changeIndex(0)">本月</view> + <view class="tab-item" :class="[tabIndex==0?'cur':'']" @click="changeIndex(0)">今日</view> <view class="tab-item" :class="[tabIndex==1?'cur':'']" @click="changeIndex(1)">全部</view> </view> - + <view class="p15" style="min-height: calc(100vh - 160rpx);"> <no-data v-if="!list||list.length==0" style="width: 100%;"></no-data> <view v-for="(item,index) in list" :key="index" class="m-b-24 order-settlement-list list-container"> @@ -75,7 +75,7 @@ } }, onLoad() { - this.listApi = '' + this.listApi = '/api/supplier/delivery/list/today' this.getList() }, @@ -93,6 +93,12 @@ if (this.tabIndex !== index) { this.tabIndex = index // 刷新 query + if (index == 0) { + this.listApi = '/api/supplier/delivery/list/today' + } + if (index == 1) { + this.listApi = '/api/supplier/delivery/list' + } this.refreshList() } }, -- Gitblit v1.9.3