Browse Source

'完善质检逻辑和页面,优化订单管理页面统计等'

v1
Lj 3 months ago
parent
commit
517808f622
10 changed files with 601 additions and 175 deletions
  1. +357
    -0
      111.json
  2. +6
    -0
      api/model/index.js
  3. +1
    -1
      config.js
  4. +26
    -0
      main.js
  5. +3
    -1
      pages/index/index.vue
  6. +80
    -121
      pages/manager/inspect-result.vue
  7. +32
    -25
      pages/manager/inspect.vue
  8. +54
    -21
      pages/manager/order.vue
  9. +2
    -2
      pages/manager/user.vue
  10. +40
    -4
      pages/subcomponent/inspection-report.vue

+ 357
- 0
111.json View File

@ -0,0 +1,357 @@
{
"success": true,
"message": "订单列表",
"code": 200,
"result": {
"records": [
{
"id": "1938571653868953601",
"createBy": null,
"createTime": "2025-06-27 20:14:35",
"updateBy": null,
"updateTime": "2025-06-30 16:09:45",
"state": 0,
"status": 1,
"userId": "1937353794657214465",
"image": null,
"shopClass": null,
"title": ",",
"name": "1",
"phone": "19330214982",
"price": null,
"address": "北京市 市辖区 东城区",
"addressDetail": "123",
"oneMoney": null,
"twoMoney": null,
"pid": "0",
"hasChild": "1",
"goTime": "2025-06-27 11:00:00",
"wliu": null,
"onePrice": null,
"unit": null,
"num": 4,
"details": null,
"ordeNo": null,
"wliuNo": null,
"shopId": null,
"addressId": "1937379022158454786",
"testingStatus": null,
"testingInstructions": null,
"testingTime": null,
"testingImages": null,
"isBy": "N",
"isUserId": null,
"pinId": null,
"qualifiedNum": null,
"noQualifiedNum": null,
"unrecyclable": null,
"estimatedPrice": "34.00-70",
"type": 0,
"commonOrderList": [
{
"id": "1938571654040920065",
"createBy": null,
"createTime": "2025-06-27 20:14:34",
"updateBy": null,
"updateTime": null,
"state": null,
"status": null,
"userId": null,
"image": "https://oss.ddmhs.top/upload/微信图片_20250327142201_compressed_1750725386304.jpg",
"shopClass": "1926937920342679554",
"title": "成人羽绒服",
"name": null,
"phone": null,
"price": null,
"address": null,
"addressDetail": null,
"oneMoney": null,
"twoMoney": null,
"pid": "1938571653868953601",
"hasChild": "1",
"goTime": null,
"wliu": null,
"onePrice": 10,
"unit": null,
"num": 2,
"details": "品相无要求,允许脏破烂",
"ordeNo": null,
"wliuNo": null,
"shopId": "1934553607584104450",
"addressId": null,
"testingStatus": null,
"testingInstructions": null,
"testingTime": null,
"testingImages": null,
"isBy": "N",
"isUserId": null,
"pinId": "1934782097801625602",
"qualifiedNum": null,
"noQualifiedNum": null,
"unrecyclable": null,
"estimatedPrice": "20.00-40",
"type": 0,
"commonOrderList": null,
"orderCheckList": null,
"pinName": null,
"testingInstructionsText": null
},
{
"id": "1938571655089496065",
"createBy": null,
"createTime": "2025-06-27 20:14:34",
"updateBy": null,
"updateTime": null,
"state": null,
"status": null,
"userId": null,
"image": "https://oss.ddmhs.top/upload/微信图片_20250327142201_compressed_1750725386304.jpg",
"shopClass": "1926937920342679554",
"title": "成人羽绒服",
"name": null,
"phone": null,
"price": null,
"address": null,
"addressDetail": null,
"oneMoney": null,
"twoMoney": null,
"pid": "1938571653868953601",
"hasChild": "1",
"goTime": null,
"wliu": null,
"onePrice": 10,
"unit": null,
"num": 1,
"details": "品相无要求,允许脏破烂",
"ordeNo": null,
"wliuNo": null,
"shopId": "1934553607584104450",
"addressId": null,
"testingStatus": null,
"testingInstructions": null,
"testingTime": null,
"testingImages": null,
"isBy": "N",
"isUserId": null,
"pinId": "1934787027673300993",
"qualifiedNum": null,
"noQualifiedNum": null,
"unrecyclable": null,
"estimatedPrice": "10.00-20",
"type": 0,
"commonOrderList": null,
"orderCheckList": null,
"pinName": null,
"testingInstructionsText": null
},
{
"id": "1938571655802527746",
"createBy": null,
"createTime": "2025-06-27 20:14:34",
"updateBy": null,
"updateTime": null,
"state": null,
"status": null,
"userId": null,
"image": "https://oss.ddmhs.top/upload/9559824354_2091552637_compressed_1750069406515.jpg",
"shopClass": "1926937920342679554",
"title": "成人羽绒裤",
"name": null,
"phone": null,
"price": null,
"address": null,
"addressDetail": null,
"oneMoney": null,
"twoMoney": null,
"pid": "1938571653868953601",
"hasChild": "1",
"goTime": null,
"wliu": null,
"onePrice": 4,
"unit": null,
"num": 1,
"details": "品相无要求,允许脏破烂",
"ordeNo": null,
"wliuNo": null,
"shopId": "1934554028000165889",
"addressId": null,
"testingStatus": null,
"testingInstructions": null,
"testingTime": null,
"testingImages": null,
"isBy": "N",
"isUserId": null,
"pinId": "1934782097801625602",
"qualifiedNum": null,
"noQualifiedNum": null,
"unrecyclable": null,
"estimatedPrice": "4.00-10",
"type": 0,
"commonOrderList": null,
"orderCheckList": null,
"pinName": null,
"testingInstructionsText": null
}
],
"orderCheckList": null,
"pinName": null,
"testingInstructionsText": null
},
{
"id": "1931291436998561793",
"createBy": null,
"createTime": "2025-06-07 18:05:35",
"updateBy": "testadmin",
"updateTime": "2025-06-11 17:09:07",
"state": 0,
"status": 1,
"userId": "1926466450139209729",
"image": "",
"shopClass": null,
"title": "组合订单",
"name": "test",
"phone": "13973220018",
"price": 0.04,
"address": "上海市 市辖区 浦东新区",
"addressDetail": "浦东足球场",
"oneMoney": 0,
"twoMoney": 0,
"pid": "0",
"hasChild": "1",
"goTime": "",
"wliu": "",
"onePrice": null,
"unit": "",
"num": 4,
"details": "",
"ordeNo": "",
"wliuNo": "",
"shopId": "",
"addressId": "",
"testingStatus": null,
"testingInstructions": "",
"testingTime": null,
"testingImages": "",
"isBy": "N",
"isUserId": "",
"pinId": null,
"qualifiedNum": null,
"noQualifiedNum": null,
"unrecyclable": null,
"estimatedPrice": null,
"type": 0,
"commonOrderList": [
{
"id": "1931291437237637121",
"createBy": null,
"createTime": "2025-06-07 18:05:35",
"updateBy": null,
"updateTime": null,
"state": null,
"status": null,
"userId": null,
"image": "https://oss.budingxiaoshuo.com/upload/1748937726110_1748937743252.jpg",
"shopClass": null,
"title": "长款羽绒服",
"name": null,
"phone": null,
"price": 0.02,
"address": null,
"addressDetail": null,
"oneMoney": null,
"twoMoney": null,
"pid": "1931291436998561793",
"hasChild": "0",
"goTime": null,
"wliu": null,
"onePrice": null,
"unit": null,
"num": 2,
"details": null,
"ordeNo": null,
"wliuNo": null,
"shopId": "1929811145330352130",
"addressId": null,
"testingStatus": null,
"testingInstructions": null,
"testingTime": null,
"testingImages": null,
"isBy": "N",
"isUserId": null,
"pinId": null,
"qualifiedNum": null,
"noQualifiedNum": null,
"unrecyclable": null,
"estimatedPrice": null,
"type": 0,
"commonOrderList": null,
"orderCheckList": null,
"pinName": null,
"testingInstructionsText": null
},
{
"id": "1931291437770313729",
"createBy": null,
"createTime": "2025-06-07 18:05:35",
"updateBy": null,
"updateTime": null,
"state": null,
"status": null,
"userId": null,
"image": "https://oss.budingxiaoshuo.com/upload/u40321610211486391468fm253fmtautoapp120fJPEG_1748938036727.webp",
"shopClass": null,
"title": "羽绒棉服",
"name": null,
"phone": null,
"price": 0.02,
"address": null,
"addressDetail": null,
"oneMoney": null,
"twoMoney": null,
"pid": "1931291436998561793",
"hasChild": "0",
"goTime": null,
"wliu": null,
"onePrice": null,
"unit": null,
"num": 2,
"details": null,
"ordeNo": null,
"wliuNo": null,
"shopId": "1929812185941368834",
"addressId": null,
"testingStatus": null,
"testingInstructions": null,
"testingTime": null,
"testingImages": null,
"isBy": "N",
"isUserId": null,
"pinId": null,
"qualifiedNum": null,
"noQualifiedNum": null,
"unrecyclable": null,
"estimatedPrice": null,
"type": 0,
"commonOrderList": null,
"orderCheckList": null,
"pinName": null,
"testingInstructionsText": null
}
],
"orderCheckList": null,
"pinName": null,
"testingInstructionsText": null
}
],
"total": 2,
"size": 20,
"current": 1,
"orders": [],
"optimizeCountSql": true,
"searchCount": true,
"countId": null,
"maxLimit": null,
"pages": 1
},
"timestamp": 1751460139197
}

+ 6
- 0
api/model/index.js View File

@ -232,6 +232,12 @@ const api = {
method: 'GET', method: 'GET',
auth: true, auth: true,
}, },
orderStatusStatistics: {
url: '/recycle-admin/applet/info_team_order/orderStatusStatistics',
method: 'POST',
auth: true,
},
} }
export default api export default api

+ 1
- 1
config.js View File

@ -1,5 +1,5 @@
// config.js // config.js
const type = 'dev'
const type = 'prod'
const config = { const config = {
local: { local: {


+ 26
- 0
main.js View File

@ -24,6 +24,32 @@ export function createApp() {
setupGlobalProperties(app); setupGlobalProperties(app);
app.config.globalProperties.$api = api; app.config.globalProperties.$api = api;
app.use(uView); app.use(uView);
// 全局混入分享
app.mixin({
onShareAppMessage() {
const userInfo = uni.getStorageSync('userInfo') || {};
console.log('分享到朋友圈的 shareId:', userInfo); // 打印 shareId
const logoName = uni.getStorageSync('logoName') || ''
console.log('logoName',logoName)
const logoImage = uni.getStorageSync('logoImage') || ''
return {
title: '欢迎体验'+(logoName),
path: '/pages/index/index?shareId=' + (userInfo.shareId || ''),
imageUrl: logoImage
}
},
onShareTimeline() {
const userInfo = uni.getStorageSync('userInfo') || {};
console.log('分享到朋友圈的 shareId:', userInfo.shareId); // 打印 shareId
return {
title: '欢迎体验'+(logoName),
query: 'shareId=' + (userInfo.shareId || ''),
imageUrl: logoImage
}
}
});
return { return {
app app
} }


+ 3
- 1
pages/index/index.vue View File

@ -67,10 +67,12 @@
computed: { computed: {
logoImage() { logoImage() {
const item = this.configData.find(i => i.keyName === 'logo_image') const item = this.configData.find(i => i.keyName === 'logo_image')
uni.setStorageSync('logoImage', item ? item.keyContent : '')
return item ? item.keyContent : '' return item ? item.keyContent : ''
}, },
logoName() { logoName() {
const item = this.configData.find(i => i.keyName === 'logo_name') const item = this.configData.find(i => i.keyName === 'logo_name')
uni.setStorageSync('logoName', item ? item.keyContent : '')
return item ? item.keyContent : '' return item ? item.keyContent : ''
} }
}, },
@ -186,12 +188,12 @@
getApp().globalData.login_status = true; getApp().globalData.login_status = true;
if (res.result.userInfo) { if (res.result.userInfo) {
const userInfo = res.result.userInfo; const userInfo = res.result.userInfo;
console.log(userInfo, 'userInfo')
if (!userInfo.headImage || !userInfo.nickName) { if (!userInfo.headImage || !userInfo.nickName) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/wxUserInfo' url: '/pages/wxUserInfo'
}); });
} else { } else {
uni.setStorageSync('userInfo', userInfo)
uni.reLaunch({ uni.reLaunch({
url: '/pages/component/home' url: '/pages/component/home'
}); });


+ 80
- 121
pages/manager/inspect-result.vue View File

@ -49,9 +49,9 @@
</view> </view>
<!-- 选择理由模块 --> <!-- 选择理由模块 -->
<view v-if="inspectData && inspectData.list"> <view v-if="inspectData && inspectData.list">
<view v-for="item in (inspectData.list.find(i => i.id === 'quality_issue')?.commonOrderList || [])"
<view v-for="(item, index) in (inspectData.list.find(i => i.id === 'quality_issue')?.commonOrderList || [])"
:key="item.id || item.testingStatus" class="row-reason"> :key="item.id || item.testingStatus" class="row-reason">
<text class="reason-label">质量问题</text>
<text class="reason-label">质量问题{{ index + 1 }}</text>
<view class="reason-select" @tap="selectReason(item)"> <view class="reason-select" @tap="selectReason(item)">
<text class="reason-placeholder" :class="{ 'selected': hasSelectedReason(item) }"> <text class="reason-placeholder" :class="{ 'selected': hasSelectedReason(item) }">
{{ hasSelectedReason(item) ? '已选择' : '请选择理由' }} {{ hasSelectedReason(item) ? '已选择' : '请选择理由' }}
@ -65,7 +65,7 @@
<!-- 不可回收产品卡片 --> <!-- 不可回收产品卡片 -->
<view v-if="hasUnrecyclableItems" class="result-card"> <view v-if="hasUnrecyclableItems" class="result-card">
<view class="card-title">不可回收产品</view> <view class="card-title">不可回收产品</view>
<view v-for="item in unrecyclableList" :key="item.id" class="result-row">
<view v-for="item in unrecyclableList" :key="item.id" class="result-group">
<view class="row-main"> <view class="row-main">
<view class="goods-name-section"> <view class="goods-name-section">
<text class="goods-name">不可回收</text> <text class="goods-name">不可回收</text>
@ -74,13 +74,17 @@
<text class="row-count">x{{ item.count }}</text> <text class="row-count">x{{ item.count }}</text>
<text class="row-total">¥{{ item.total }}</text> <text class="row-total">¥{{ item.total }}</text>
</view> </view>
<view class="row-reason">
<text class="reason-label">不可回收</text>
<view class="reason-select" @tap="selectReasonForUnrecyclable(item)">
<text class="reason-placeholder" :class="{ 'selected': hasSelectedReason(item) }">
{{ hasSelectedReason(item) ? '已选择' : '请选择理由' }}
</text>
<uni-icons type="right" size="18" color="#bbb" />
<!-- 选择理由模块 -->
<view v-if="inspectData && inspectData.list">
<view v-for="(commonItem,index) in (inspectData.list.find(i => i.id === 'unrecyclable')?.commonOrderList || [])"
:key="commonItem.id || commonItem.testingStatus" class="row-reason">
<text class="reason-label">不可回收{{ index +1 }}</text>
<view class="reason-select" @tap="selectReason(commonItem)">
<text class="reason-placeholder" :class="{ 'selected': hasSelectedReason(commonItem) }">
{{ hasSelectedReason(commonItem) ? '已选择' : '请选择理由' }}
</text>
<uni-icons type="right" size="18" color="#bbb" />
</view>
</view> </view>
</view> </view>
</view> </view>
@ -297,15 +301,16 @@ export default {
return return
} }
} }
//
// console.log('this.inspectData["list"]', this.inspectData["list"])
//
// this.inspectData["list"].forEach(item => {
// console.log('item1', item)
// // delete item['categoryId']
// })
//
const inspectDatas = {...this.inspectData,list:JSON.stringify(this.inspectData["list"], null, 2)}
// id
const processedList = this.inspectData["list"].map(item => {
if (item.id === 'quality_issue' || item.id === 'unrecyclable') {
// id
return { ...item, id: '' }
}
return item
})
const inspectDatas = {...this.inspectData, list: JSON.stringify(processedList, null, 2)}
console.log('最终的质检数据:', inspectDatas); console.log('最终的质检数据:', inspectDatas);
this.$api('submitQualityInfo', inspectDatas , res => { this.$api('submitQualityInfo', inspectDatas , res => {
if (res && res.code === 200) { if (res && res.code === 200) {
@ -316,19 +321,17 @@ export default {
uni.showToast({ title: '完成质检', icon: 'success' }) uni.showToast({ title: '完成质检', icon: 'success' })
}, },
selectReason(item) { selectReason(item) {
// inspectData.list
// 使itemcommonOrderList
let popupItem = item let popupItem = item
let type = 0 //
// testingStatus
if (item.testingStatus === 1) { if (item.testingStatus === 1) {
const qualityItem = this.inspectData["list"].find(i => i.id === 'quality_issue')
if (qualityItem && qualityItem.commonOrderList) {
popupItem = qualityItem.commonOrderList.find(i => i.id === item.id) || item
}
type = 1 //
} else if (item.testingStatus === 2) { } else if (item.testingStatus === 2) {
const unrecyclableItem = this.inspectData["list"].find(i => i.id === 'unrecyclable')
if (unrecyclableItem && unrecyclableItem.commonOrderList) {
popupItem = unrecyclableItem.commonOrderList.find(i => i.id === item.id) || item
}
type = 2 //
} }
this.currentReasonItem = popupItem this.currentReasonItem = popupItem
// //
if (popupItem.testingStatus === 1) { if (popupItem.testingStatus === 1) {
@ -338,38 +341,55 @@ export default {
} else { } else {
this.currentReasonTitle = this.getGoodsName(popupItem.shopId || popupItem.id) this.currentReasonTitle = this.getGoodsName(popupItem.shopId || popupItem.id)
} }
this.reasonImages = popupItem.images || []
// 使testingImages
if (popupItem.testingImages && popupItem.testingImages.trim() !== '') {
this.reasonImages = popupItem.testingImages.split(',').filter(img => img.trim() !== '')
} else {
this.reasonImages = []
}
// reasonChecked // reasonChecked
this.selectReasonForUnqualified(popupItem, 0)
this.selectReasonForUnqualified(popupItem, type)
this.lockScroll() this.lockScroll()
this.$refs.reasonPopup.open() this.$refs.reasonPopup.open()
}, },
selectReasonForQualified(item) { selectReasonForQualified(item) {
this.currentReasonItem = item this.currentReasonItem = item
this.currentReasonTitle = this.getGoodsName(item.shopId || item.id) this.currentReasonTitle = this.getGoodsName(item.shopId || item.id)
this.reasonImages = item.images || []
// 使testingImages
if (item.testingImages && item.testingImages.trim() !== '') {
this.reasonImages = item.testingImages.split(',').filter(img => img.trim() !== '')
} else {
this.reasonImages = []
}
// reasonChecked // reasonChecked
this.selectReasonForUnqualified(item, 1) this.selectReasonForUnqualified(item, 1)
this.lockScroll() this.lockScroll()
this.$refs.reasonPopup.open() this.$refs.reasonPopup.open()
}, },
selectReasonForUnrecyclable(item) {
this.currentReasonItem = item
this.currentReasonTitle = '不可回收'
this.reasonImages = item.images || []
// reasonChecked
this.selectReasonForUnqualified(item, 2)
this.lockScroll()
this.$refs.reasonPopup.open()
},
selectReasonForUnqualified(item, type) { selectReasonForUnqualified(item, type) {
// classId
let classId = ''
if (type === 1) {
//
classId = 'quality_issue'
} else if (type === 2) {
//
classId = 'unrecyclable'
} else {
// 使shopClass
classId = item.shopClass || ''
}
console.log('[selectReasonForUnqualified] classId:', classId, 'type:', type)
this.$api('getcheckoutReasons', { this.$api('getcheckoutReasons', {
classId: item.shopClass,
classId: classId,
type: type type: type
}, res => { }, res => {
if (res.code == 200) { if (res.code == 200) {
this.reasonOptions = res.result; this.reasonOptions = res.result;
if (item.testingInstructions) {
if (item.testingInstructions && item.testingInstructions.trim() !== '') {
this.reasonChecked = item.testingInstructions.split(',').map(s => s.trim()).filter(Boolean) this.reasonChecked = item.testingInstructions.split(',').map(s => s.trim()).filter(Boolean)
} else { } else {
this.reasonChecked = [] this.reasonChecked = []
@ -379,7 +399,19 @@ export default {
console.log('[selectReasonForUnqualified] reasonOptions:', this.reasonOptions) console.log('[selectReasonForUnqualified] reasonOptions:', this.reasonOptions)
console.log('[selectReasonForUnqualified] reasonChecked:', this.reasonChecked) console.log('[selectReasonForUnqualified] reasonChecked:', this.reasonChecked)
}) })
} else {
console.error('[selectReasonForUnqualified] API返回错误:', res)
uni.showToast({
title: '获取理由列表失败',
icon: 'none'
})
} }
}, err => {
console.error('[selectReasonForUnqualified] API调用失败:', err)
uni.showToast({
title: '获取理由列表失败',
icon: 'none'
})
}) })
}, },
closeReasonPopup() { closeReasonPopup() {
@ -469,88 +501,14 @@ export default {
saveReason() { saveReason() {
if (this.currentReasonItem) { if (this.currentReasonItem) {
console.log('this.currentReasonItem', this.currentReasonItem) console.log('this.currentReasonItem', this.currentReasonItem)
this.currentReasonItem.images = [...this.reasonImages]
//
this.currentReasonItem.testingInstructions = this.reasonChecked.join(',') this.currentReasonItem.testingInstructions = this.reasonChecked.join(',')
this.updateInspectData()
this.currentReasonItem.testingImages = this.reasonImages.join(',')
} }
this.closeReasonPopup() this.closeReasonPopup()
}, },
updateInspectData() {
if (!this.inspectData || !this.currentReasonItem) return
// IDID
const selectedReasonIds = []
this.reasonChecked.forEach((checked, index) => {
if (checked) {
selectedReasonIds.push(this.reasonOptions[index].reason.toString())
}
})
// ID
const testingInstructions = selectedReasonIds.join(',')
// URL
const testingImages = this.reasonImages.join(',')
// inspectData
if (this.isQualifiedItem(this.currentReasonItem)) {
this.updateQualifiedItemInspectData(testingInstructions, testingImages)
} else if (this.isUnqualifiedItem(this.currentReasonItem)) {
this.updateUnqualifiedItemInspectData(testingInstructions, testingImages)
} else if (this.isUnrecyclableItem(this.currentReasonItem)) {
this.updateUnrecyclableItemInspectData(testingInstructions, testingImages)
}
console.log('[updateInspectData] after update', JSON.stringify(this.inspectData, null, 2))
},
isQualifiedItem(item) {
return this.qualifiedList.some(qualified => qualified.shopId === item.shopId)
},
isUnqualifiedItem(item) {
return this.unqualifiedGroups.some(group =>
group.items.some(unqualified => unqualified.id === item.id)
)
},
isUnrecyclableItem(item) {
return this.unrecyclableList.some(unrecyclable => unrecyclable.id === item.id)
},
updateQualifiedItemInspectData(testingInstructions, testingImages) {
const inspectItem = this.inspectData["list"].find(item => item.id == this.currentReasonItem.id)
if (inspectItem && inspectItem.commonOrderList) {
// 0
inspectItem.commonOrderList.forEach(commonItem => {
if (commonItem.testingStatus === 0) {
commonItem.testingInstructions = testingInstructions
commonItem.testingImages = testingImages
}
})
}
},
updateUnqualifiedItemInspectData(testingInstructions, testingImages) {
// commonOrderListID
this.unqualifiedGroups.forEach(group => {
const targetItem = group.items.find(item => item.id === this.currentReasonItem.id)
if (targetItem) {
// inspectData
const inspectItem = this.inspectData["list"].find(item => item.id == group.id)
if (inspectItem && inspectItem.commonOrderList) {
// IDcommonOrderList
const commonItem = inspectItem.commonOrderList.find(common => common.id === targetItem.id)
if (commonItem) {
commonItem.testingInstructions = testingInstructions
commonItem.testingImages = testingImages
}
}
}
})
},
updateUnrecyclableItemInspectData(testingInstructions, testingImages) {
const inspectItem = this.inspectData["list"].find(item => item.id == this.currentReasonItem.id)
if (inspectItem && inspectItem.commonOrderList) {
// 2
inspectItem.commonOrderList.forEach(commonItem => {
if (commonItem.testingStatus === 2) {
commonItem.testingInstructions = testingInstructions
commonItem.testingImages = testingImages
}
})
}
},
lockScroll() { lockScroll() {
// //
this.isPopupOpen = true this.isPopupOpen = true
@ -579,7 +537,8 @@ export default {
hasSelectedReason(item) { hasSelectedReason(item) {
// console.log('item', item) // console.log('item', item)
// //
return (item.images && item.images.length > 0)
return (item.testingInstructions && item.testingInstructions.trim() !== '') ||
(item.testingImages && item.testingImages.trim() !== '')
} }
} }
} }


+ 32
- 25
pages/manager/inspect.vue View File

@ -403,16 +403,15 @@ export default {
changeNum(item, key, delta) { changeNum(item, key, delta) {
if (key === 'qualified') { if (key === 'qualified') {
const currentCategoryId = this.categories[this.currentCategory]?.id const currentCategoryId = this.categories[this.currentCategory]?.id
//
if (delta > 0) {
if (item.id === 'unrecyclable-1' || item.id === 'quality-issue-1') {
const newQualified = Math.max(0, (item.qualified || 0) + delta)
this.$set(item, 'qualified', newQualified)
this.updateInspectResult(item, 'qualified', delta, currentCategoryId)
this.$forceUpdate()
return
}
//
if (item.id === 'unrecyclable-1' || item.id === 'quality-issue-1') {
const newQualified = Math.max(0, (item.qualified || 0) + delta)
this.$set(item, 'qualified', newQualified)
this.updateInspectResult(item, 'qualified', delta, currentCategoryId)
this.$forceUpdate()
return
} }
//
const newQualified = Math.max(0, (item.qualified || 0) + delta) const newQualified = Math.max(0, (item.qualified || 0) + delta)
this.$set(item, 'qualified', newQualified) this.$set(item, 'qualified', newQualified)
this.updateInspectResult(item, 'qualified', delta, currentCategoryId) this.updateInspectResult(item, 'qualified', delta, currentCategoryId)
@ -462,25 +461,29 @@ export default {
price: 0, price: 0,
qualifiedNum: 0, qualifiedNum: 0,
noQualifiedNum: 0, noQualifiedNum: 0,
unrecyclable: 0,
unrecyclable: 0, // 0
shopId: '', shopId: '',
pinId: '', pinId: '',
categoryId: '', categoryId: '',
commonOrderList: [
{
testingInstructions: '',
testingImages: '',
testingStatus: 2
}
]
commonOrderList: [] //
} }
this.inspectResult.list.push(inspectItem) this.inspectResult.list.push(inspectItem)
} }
if (!inspectItem) return if (!inspectItem) return
if (type === 'qualified' && delta > 0) { if (type === 'qualified' && delta > 0) {
inspectItem.unrecyclable++ inspectItem.unrecyclable++
// commonOrderList
inspectItem.commonOrderList.push({
testingInstructions: '',
testingImages: '',
testingStatus: 2
})
} else if (type === 'qualified' && delta < 0) { } else if (type === 'qualified' && delta < 0) {
inspectItem.unrecyclable = Math.max(0, inspectItem.unrecyclable - 1) inspectItem.unrecyclable = Math.max(0, inspectItem.unrecyclable - 1)
// commonOrderList
if (inspectItem.commonOrderList.length > 0) {
inspectItem.commonOrderList.pop()
}
// 0 // 0
if (inspectItem.unrecyclable === 0) { if (inspectItem.unrecyclable === 0) {
const idx = this.inspectResult.list.findIndex(listItem => listItem === inspectItem) const idx = this.inspectResult.list.findIndex(listItem => listItem === inspectItem)
@ -500,26 +503,30 @@ export default {
id: 'quality_issue', id: 'quality_issue',
price: 0, price: 0,
qualifiedNum: 0, qualifiedNum: 0,
noQualifiedNum: 0,
noQualifiedNum: 0, // 0
unrecyclable: 0, unrecyclable: 0,
shopId: '', shopId: '',
pinId: '', pinId: '',
categoryId: '', categoryId: '',
commonOrderList: [
{
testingInstructions: '',
testingImages: '',
testingStatus: 1
}
]
commonOrderList: [] //
} }
this.inspectResult.list.push(inspectItem) this.inspectResult.list.push(inspectItem)
} }
if (!inspectItem) return if (!inspectItem) return
if (type === 'qualified' && delta > 0) { if (type === 'qualified' && delta > 0) {
inspectItem.noQualifiedNum++ inspectItem.noQualifiedNum++
// commonOrderList
inspectItem.commonOrderList.push({
testingInstructions: '',
testingImages: '',
testingStatus: 1
})
} else if (type === 'qualified' && delta < 0) { } else if (type === 'qualified' && delta < 0) {
inspectItem.noQualifiedNum = Math.max(0, inspectItem.noQualifiedNum - 1) inspectItem.noQualifiedNum = Math.max(0, inspectItem.noQualifiedNum - 1)
// commonOrderList
if (inspectItem.commonOrderList.length > 0) {
inspectItem.commonOrderList.pop()
}
// 0 // 0
if (inspectItem.noQualifiedNum === 0) { if (inspectItem.noQualifiedNum === 0) {
const idx = this.inspectResult.list.findIndex(listItem => listItem === inspectItem) const idx = this.inspectResult.list.findIndex(listItem => listItem === inspectItem)


+ 54
- 21
pages/manager/order.vue View File

@ -36,7 +36,10 @@
:class="['tab-item', {active: currentTab === idx}]" :class="['tab-item', {active: currentTab === idx}]"
@tap="onTabChange(idx)" @tap="onTabChange(idx)"
> >
{{ tab.label }}
<view class="tab-label-wrap">
{{ tab.label }}
<view v-if="tab.count > 0" class="tab-badge">{{ tab.count }}</view>
</view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
@ -157,11 +160,11 @@ export default {
navBarHeight: 44, navBarHeight: 44,
navBarRealHeight: 44, navBarRealHeight: 44,
tabs: [ tabs: [
{ label: '全部', value: -1 },
{ label: '已预约', value: 0 },
{ label: '待质检', value: 1 },
{ label: '已结款', value: 2 },
{ label: '已驳回', value: 3 }
{ label: '全部', value: -1, count: 0 },
{ label: '已预约', value: 0, count: 0 },
{ label: '待质检', value: 1, count: 0 },
{ label: '已结款', value: 2, count: 0 },
{ label: '已驳回', value: 3, count: 0 }
], ],
currentTab: 0, currentTab: 0,
orderList: [], orderList: [],
@ -194,6 +197,7 @@ export default {
this.userId = options.userId; this.userId = options.userId;
} }
this.fetchOrderList() this.fetchOrderList()
this.fetchOrderStatusStatistics()
}, },
computed: { computed: {
filteredOrders() { filteredOrders() {
@ -265,16 +269,16 @@ export default {
// status = 0 // status = 0
statusParam = 0 statusParam = 0
} else if (tabValue === 0) { } else if (tabValue === 0) {
// status = 0
// status = 1
statusParam = 1 statusParam = 1
} else if (tabValue === 1) { } else if (tabValue === 1) {
// status = 1
// status = 2
statusParam = 2 statusParam = 2
} else if (tabValue === 2) { } else if (tabValue === 2) {
// status = 2
// status = 3
statusParam = 3 statusParam = 3
} else if (tabValue === 3) { } else if (tabValue === 3) {
// status = 3
// status = 4
statusParam = 4 statusParam = 4
} }
@ -290,16 +294,7 @@ export default {
this.$api && this.$api('getOrderList', params, res => { this.$api && this.$api('getOrderList', params, res => {
if (res && res.code === 200 && res.result && res.result.records) { if (res && res.code === 200 && res.result && res.result.records) {
console.log(res.result,'res.result.records') console.log(res.result,'res.result.records')
// state3 status=3state1
const filteredRecords = res.result.records.filter(order => {
// state3
if (order.state === 3) return false
// status=3state1
// if (order.status === 3 && order.state === 1) return false
return true
})
const newOrders = filteredRecords.map(order => {
const newOrders = res.result.records.map(order => {
const statusInfo = this.getOrderStatusInfo(order.status, order.state) const statusInfo = this.getOrderStatusInfo(order.status, order.state)
return { return {
id: order.id, id: order.id,
@ -415,6 +410,19 @@ export default {
} }
}) })
}, },
fetchOrderStatusStatistics() {
const token = uni.getStorageSync('token') || '';
this.$api && this.$api('orderStatusStatistics', { token }, res => {
if (res.code === 200 && res.result) {
const stat = res.result;
this.tabs[1].count = stat.appointed || 0;
this.tabs[2].count = stat.waitingInspection || 0;
this.tabs[3].count = stat.completed || 0;
this.tabs[4].count = stat.rejected || 0;
this.tabs[0].count = (stat.appointed || 0) + (stat.waitingInspection || 0) + (stat.completed || 0) + (stat.rejected || 0);
}
});
},
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.pageNo = 1; this.pageNo = 1;
@ -714,4 +722,29 @@ export default {
font-size: 30rpx; font-size: 30rpx;
color: #ccc; color: #ccc;
} }
</style>
.tab-label-wrap {
position: relative;
display: inline-block;
}
.tab-badge {
position: absolute;
top: 5px;
right: -14px;
display: flex;
align-items: center;
justify-content: center;
background: #ff4d4f;
color: #fff;
font-size: 12px;
border-radius: 50%;
min-width: 18px;
height: 18px;
padding: 0 5px;
font-weight: bold;
box-sizing: border-box;
z-index: 1;
}
</style>

+ 2
- 2
pages/manager/user.vue View File

@ -41,7 +41,7 @@
</view> </view>
<view class="user-info-row"> <view class="user-info-row">
<text class="user-label">角色</text> <text class="user-label">角色</text>
<template v-if="user.role">
<template v-if="user.isTuiTypeTitle">
<text class="role-tag" v-if="user.isTuiTypeTitle"> <text class="role-tag" v-if="user.isTuiTypeTitle">
{{ user.isTuiTypeTitle }} {{ user.isTuiTypeTitle }}
</text> </text>
@ -171,7 +171,7 @@ export default {
id: user.id, id: user.id,
name: user.name || user.nickName || '-', name: user.name || user.nickName || '-',
phone: user.phone || '-', phone: user.phone || '-',
role: user.isUser === 'Y' ? '推广官' : '',
// role: user.isUser === 'Y' ? '广' : '',
blocked: user.isBlack === 'Y', blocked: user.isBlack === 'Y',
avatar: user.headImage || user.avatar || user.avatarUrl || '', avatar: user.headImage || user.avatar || user.avatarUrl || '',
isTuiTypeTitle: user.isTuiTypeTitle, isTuiTypeTitle: user.isTuiTypeTitle,


+ 40
- 4
pages/subcomponent/inspection-report.vue View File

@ -38,7 +38,7 @@
<view v-if="showQualified && goodsList.length" class="inspection-card"> <view v-if="showQualified && goodsList.length" class="inspection-card">
<view class="report-title">质检合格</view> <view class="report-title">质检合格</view>
<view class="goods-list"> <view class="goods-list">
<view class="goods-item" v-for="(item, i) in goodsList" :key="i" @tap="goToInspectionDetail('qualified')">
<view class="goods-item" v-for="(item, i) in displayedGoodsList" :key="i" @tap="goToInspectionDetail('qualified')">
<image class="goods-img" :src="item.img" mode="aspectFit" /> <image class="goods-img" :src="item.img" mode="aspectFit" />
<view class="goods-info"> <view class="goods-info">
<view class="goods-row"> <view class="goods-row">
@ -57,6 +57,10 @@
</view> </view>
</view> </view>
</view> </view>
<view v-if="goodsList.length > 2" class="collapse-btn" @tap="qualifiedCollapsed = !qualifiedCollapsed">
<text>{{ qualifiedCollapsed ? '展开(共' + goodsList.length + '件)' : '收起' }}</text>
<uni-icons :type="qualifiedCollapsed ? 'arrowdown' : 'arrowup'" size="16" color="#bbb" />
</view>
<view class="summary-row"> <view class="summary-row">
<text>件数<text class="highlight">{{totalCount}}</text> </text> <text>件数<text class="highlight">{{totalCount}}</text> </text>
<text>结算金额<text class="highlight">{{totalAmount}}</text></text> <text>结算金额<text class="highlight">{{totalAmount}}</text></text>
@ -65,7 +69,7 @@
<view v-if="showProblem && problemList.length" class="inspection-card problem-card"> <view v-if="showProblem && problemList.length" class="inspection-card problem-card">
<view class="report-title">质量问题</view> <view class="report-title">质量问题</view>
<view class="goods-list"> <view class="goods-list">
<view class="goods-item" v-for="(item, i) in problemList" :key="i" @tap="goToInspectionDetail('problem')">
<view class="goods-item" v-for="(item, i) in displayedProblemList" :key="i" @tap="goToInspectionDetail('problem')">
<image class="goods-img" :src="item.img" mode="aspectFit" /> <image class="goods-img" :src="item.img" mode="aspectFit" />
<view class="goods-info"> <view class="goods-info">
<view class="goods-row"> <view class="goods-row">
@ -84,6 +88,10 @@
</view> </view>
</view> </view>
</view> </view>
<view v-if="problemList.length > 2" class="collapse-btn" @tap="problemCollapsed = !problemCollapsed">
<text>{{ problemCollapsed ? '展开(共' + problemList.length + '件)' : '收起' }}</text>
<uni-icons :type="problemCollapsed ? 'arrowdown' : 'arrowup'" size="16" color="#bbb" />
</view>
<view class="summary-row"> <view class="summary-row">
<text>件数<text class="highlight">{{problemCount}}</text> </text> <text>件数<text class="highlight">{{problemCount}}</text> </text>
<text>结算金额<text class="highlight"> 0</text></text> <text>结算金额<text class="highlight"> 0</text></text>
@ -92,7 +100,7 @@
<view v-if="showUnrecyclable && unrecyclableList.length" class="inspection-card problem-card"> <view v-if="showUnrecyclable && unrecyclableList.length" class="inspection-card problem-card">
<view class="report-title">不可回收</view> <view class="report-title">不可回收</view>
<view class="goods-list"> <view class="goods-list">
<view class="goods-item" v-for="(item, i) in problemList" :key="i" @tap="goToInspectionDetail('problem')">
<view class="goods-item" v-for="(item, i) in displayedUnrecyclableList" :key="i" @tap="goToInspectionDetail('problem')">
<image class="goods-img" :src="item.img" mode="aspectFit" /> <image class="goods-img" :src="item.img" mode="aspectFit" />
<view class="goods-info"> <view class="goods-info">
<view class="goods-row"> <view class="goods-row">
@ -111,6 +119,10 @@
</view> </view>
</view> </view>
</view> </view>
<view v-if="unrecyclableList.length > 2" class="collapse-btn" @tap="unrecyclableCollapsed = !unrecyclableCollapsed">
<text>{{ unrecyclableCollapsed ? '展开(共' + unrecyclableList.length + '件)' : '收起' }}</text>
<uni-icons :type="unrecyclableCollapsed ? 'arrowdown' : 'arrowup'" size="16" color="#bbb" />
</view>
<view class="summary-row"> <view class="summary-row">
<text>件数<text class="highlight">{{problemCount}}</text> </text> <text>件数<text class="highlight">{{problemCount}}</text> </text>
<text>结算金额<text class="highlight"> 0</text></text> <text>结算金额<text class="highlight"> 0</text></text>
@ -141,6 +153,9 @@ export default {
showUnrecyclable: false, showUnrecyclable: false,
orderId : 0, orderId : 0,
fixedHeaderHeight: 0, // fixedHeaderHeight: 0, //
qualifiedCollapsed: true,
problemCollapsed: true,
unrecyclableCollapsed: true,
} }
}, },
computed: { computed: {
@ -164,7 +179,16 @@ export default {
fixedHeaderHeight() { fixedHeaderHeight() {
// + + (140rpxpx) // + + (140rpxpx)
return this.statusBarHeight + this.navBarHeight + 70 return this.statusBarHeight + this.navBarHeight + 70
}
},
displayedGoodsList() {
return this.qualifiedCollapsed ? this.goodsList.slice(0, 2) : this.goodsList;
},
displayedProblemList() {
return this.problemCollapsed ? this.problemList.slice(0, 2) : this.problemList;
},
displayedUnrecyclableList() {
return this.unrecyclableCollapsed ? this.unrecyclableList.slice(0, 2) : this.unrecyclableList;
},
}, },
onLoad(options) { onLoad(options) {
const sysInfo = uni.getSystemInfoSync() const sysInfo = uni.getSystemInfoSync()
@ -556,4 +580,16 @@ export default {
.problem-price-row { .problem-price-row {
color: #bbb !important; color: #bbb !important;
} }
.collapse-btn {
text-align: center;
color: #bbb;
font-size: 24rpx;
margin: 10rpx 0;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
gap: 8rpx;
}
</style> </style>

Loading…
Cancel
Save