Commit a01ddf14 by wangzhihui

```

feat: 添加vue-virtual-scroller依赖并重构调拨相关功能

- 添加vue-virtual-scroller依赖包
- 重构allocate.js API文件,添加调拨发货驳回、商品详情及库存明细接口
- 修改StickyTable组件中的数据显示逻辑
- 优化approveComp和rejectComp组件中的业务逻辑
- 调整detail.vue页面的数据展示和接口调用
- 更新index.vue页面的商品信息展示和状态判断逻辑
- 修改record.vue和reviewStatus.vue中的文案显示
```
1 parent 50e3fe4e
......@@ -24,6 +24,7 @@
"vconsole": "^3.7.0",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vue-virtual-scroller": "^1.1.2",
"vuex": "^3.4.0",
"webpack-spritesmith": "^1.1.0"
},
......
......@@ -2,7 +2,7 @@
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-11-20 10:20:52
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2026-02-02 16:29:23
* @LastEditTime: 2026-02-03 10:12:15
* @FilePath: \wx-notification\src\api\purchase.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -18,16 +18,24 @@ export default {
})
},
/**采购发货-驳回 */
shipmentReject(data = {}) {
data.method = 'dj.api.smarcarlife.purchaseOrder.shipmentReject'
// /**采购发货-驳回 */
// shipmentReject(data = {}) {
// data.method = 'dj.api.smarcarlife.purchaseOrder.shipmentReject'
// return window.$HTTP({
// url,
// data,
// returnAll: true
// })
// },
//调拨发货驳回
allocateDeliveryReject(data = {}) {
data.method = 'dj.smartcarlife.api.stock.allocate.delivery.reject'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**运营审核 */
operatorAudit(data = {}) {
data.method = 'dj.smartcarlife.api.stockAllocate.operatorAudit'
......@@ -57,7 +65,7 @@ export default {
},
/**商务驳回-驳回 */
businessReject(data = {}) {
data.method = ' dj.smartcarlife.api.stockAllocate.businessReject'
data.method = 'dj.smartcarlife.api.stockAllocate.businessReject'
return window.$HTTP({
url,
data,
......@@ -90,5 +98,25 @@ export default {
data,
returnAll: true
})
}
},
// 商品详情
getAllocateGoodsDetail(data = {}) {
data.method = 'dj.smartcarlife.api.stock.allocate.h5.goods.detail'
return window.$HTTP({
url,
data,
returnAll: true
})
},
// 商品详情页库存明细接口
getAllocateGoodsStockDetail(data = {}) {
data.method = 'dj.smartcarlife.api.stock.allocate.h5.merchantShopGoodsStock.page'
return window.$HTTP({
url,
data,
returnAll: true
})
},
}
......@@ -14,7 +14,7 @@
<td v-for="(col, colIndex) in columns" :key="colIndex" :class="{ 'fixed-col': colIndex === 0 && fixedFirstColumn }" :style="getCellStyle(colIndex)">
<div class="cell-content">
<slot :name="col.prop" :row="row" :index="rowIndex">
{{ col.formatter ? col.formatter(row) : ((row[col.prop] ||row[col.prop]===0) ? row[col.prop] : '-') }}
{{ col.formatter ? col.formatter(row) : (row[col.prop] || '-') }}
</slot>
</div>
</td>
......
......@@ -21,9 +21,7 @@
<div class="label">备注</div>
<van-field class="textarea" v-model="approveForm.remark" rows="8" :autosize="{ maxHeight: 220 }" label="" type="textarea" maxlength="200" placeholder="请输入备注" show-word-limit />
</div>
<div class="explain" v-if="staffType==2">说明:订单审核后自动流转至下一节点进行复审。</div>
<div class="explain" v-if="staffType==3">说明:订单审核后会自动流转至供应商进行确认并发货。</div>
<div class="explain" v-if="staffType==5">说明:订单审核后自动流转至商务进行复审。</div>
<div class="explain">说明:订单审核后自动流转至下一节点进行复审</div>
</div>
<!-- 先选仓库再选门店 -->
<send-out-comp :isVisible="sendOutVisible" :isYq="isYq" v-if="sendOutVisible" @cancel="handleSendCancel" @submit="handleSendSumit" :sendOutMerchantId="isYq == 1?approveForm.callOutMerchantId:approveForm.callOutYqMerchantId" :yqMerchantId="approveForm.callOutYqMerchantId"></send-out-comp>
......@@ -79,13 +77,17 @@ export default {
this.sendOutVisible = false
},
handleSendSumit(data) {
console.log('handleSendSumit',data)
//门店
if(data.isYq==1){
this.approveForm.callOutMerchantName = data.merchantName
this.approveForm.callOutMerchantId = data.merchantId
}else{
this.approveForm.callOutYqMerchantName = data.merchantName
//仓库
if(data.merchantNo == this.approveForm.callOutYqMerchantId) return
this.approveForm.callOutYqMerchantName = data.merchantName
this.approveForm.callOutYqMerchantId = data.merchantNo
this.approveForm.callOutMerchantName =''
this.approveForm.callOutMerchantId =''
}
console.log(this.approveForm)
......
......@@ -19,7 +19,7 @@
</div>
<van-field class="textarea" v-model="rejectForm.rejectCause" rows="8" :autosize="{ maxHeight: 220 }" label="" type="textarea" maxlength="200" placeholder="请输入驳回原因" show-word-limit />
</div>
<div class="explain" v-if="staffType == 4">说明:驳回后,整个采购订单进行驳回,无法再重新进行发货操作。</div>
<!-- <div class="explain" v-if="staffType == 4">说明:驳回后,整个采购订单进行驳回,无法再重新进行发货操作。</div> -->
</div>
</h-dialog>
</template>
......@@ -97,7 +97,7 @@ export default {
const methodMap = {
2: 'operatorReject',
3: 'businessReject',
4: 'shipmentReject'
4: 'allocateDeliveryReject'
}
return methodMap[this.staffType]
},
......@@ -113,8 +113,9 @@ export default {
this.$refs.myDialog.startLoading()
const params = {
orderCode: this.infoData.orderCode,
operatorName: this.name,
allocateCode: this.infoData.allocateCode,
updatedBy: this.name,
userName:this.name,
...this.rejectForm
}
......
......@@ -104,9 +104,8 @@ export default {
async selectShippingEntityInfoAll() {
let methodName = this.getMethodsByYq()
let params = {}
if(this.isYq ==2) params.yqMerchantId = this.yqMerchantId
if(this.isYq ==1) params.yqMerchantId = this.yqMerchantId
let result = await allocateApi[methodName](params)
console.log(result)
if (result.code == 0) {
result.data.forEach(item => {
item.checked = false
......
......@@ -6,7 +6,7 @@
<div v-for="(item, index) in orderBasicInfoList" :key="index" class="info-item">
<span>{{ item.label }}</span>
<span class="value" v-if="item.formatter">{{ item.formatter(orderInfo) }}</span>
<span class="value" v-else>{{ orderInfo[item.value] || '--' }}</span>
<span class="value" v-else>{{ orderInfo[item.value] || orderInfo[item.value] === 0 ? orderInfo[item.value] : '--' }}</span>
</div>
</div>
<div class="title">库存明细</div>
......@@ -15,45 +15,48 @@
</div>
<scroll-view class="content" @ReachBottom="onReachBottom" ref="scrollView">
<template v-if="flag">
<template v-if="list.length">
<template v-if="StockList.length">
<div class="list">
<div class="item">
<div class="name">门店名称门店名称门店名称门店名称门店名称门店名称门店名称</div>
<template v-for="(item, index) in StockList">
<div class="item" :key="index">
<div class="name">{{item.merchantName}}</div>
<div class="line">
<!-- [1, 4, 6, 12, 14] -->
<div class="label">当前库存</div>
<div class="value">1件</div>
<div class="value">{{item.stock || item.stock === 0 ? parseFloat(item.stock).toFixed(2) + ([1, 4, 6, 12, 14].includes(item.goodsType) ? '米' : '件') : '--'}}</div>
</div>
<div class="line">
<div class="label">膜卷号</div>
<div class="value">XXXXXX</div>
<div class="value">{{item.filmRollNo||item.filmRollNo ===0?item.filmRollNo:'--'}}</div>
</div>
</div>
</template>
</div>
</template>
<div v-else class="no-data">
<img src="@/assets/images/no-data.png" />
<span class="no-data-text">暂无数据</span>
</div>
</template>
</scroll-view>
</div>
</template>
<script>
import utils from '@/utils/util'
import allocateApi from '@/api/allocate'
export default {
data() {
return {
page: {
pageNum: 1,
currentPage: 1,
pageSize: 10
},
flag: false,
list: [{}],
orderInfo: {
allocateNumber: 10,
goodsName: '全铝一体电动踏板(黑耀款)(不带灯)超过换行',
productCode: 'JC-JP-0077',
specificationData: '折叠小桌板 -不带杯架不带无线充不带氛围/默认分配/如指定请备注/星云红',
filmRollNo: '',
callInMerchantNumber: 20,
callInMerchantNumber: 10
},
StockList: [],
id: this.$route.query.id,
orderInfo: {},
keyword:'',
orderBasicInfoList: [
{ label: '商品名称', value: 'goodsName' },
{ label: '商品编码', value: 'productCode' },
......@@ -62,41 +65,53 @@ export default {
label: '调拨数量',
value: 'allocateNumber',
formatter: cellValue => {
// return (cellValue.allocateNumber || cellValue.allocateNumber === 0) ? parseFloat(cellValue.allocateNumber).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
return cellValue.allocateNumber || cellValue.allocateNumber === 0 ? cellValue.allocateNumber + '件' : '--'
return cellValue.allocateNumber || cellValue.allocateNumber == 0 ? parseFloat(cellValue.allocateNumber).toFixed(2) + ([1, 4, 6, 12, 14].includes(cellValue.goodsType) ? '米' : '件') : '--'
}
},
{
label: '调入门店库存',
value: 'callInMerchantNumber',
value: 'inStockQty',
formatter: cellValue => {
return cellValue.callInMerchantNumber || cellValue.callInMerchantNumber === 0 ? cellValue.callInMerchantNumber + '件' : '--'
return cellValue.inStockQty || cellValue.inStockQty == 0 ? parseFloat(cellValue.inStockQty).toFixed(2) + ([1, 4, 6, 12, 14].includes(cellValue.goodsType) ? '米' : '件') : '--'
}
},
{
label: '调出门店库存',
value: 'callOutMerchantNumber',
value: 'outStockQty',
formatter: cellValue => {
return cellValue.callOutMerchantNumber || cellValue.callOutMerchantNumber === 0 ? cellValue.callOutMerchantNumber + '件' : '--'
return cellValue.outStockQty || cellValue.outStockQty == 0 ? parseFloat(cellValue.outStockQty).toFixed(2) + ([1, 4, 6, 12, 14].includes(cellValue.goodsType) ? '米' : '件') : '--'
}
},
{ label: '膜卷号', value: 'filmRollNo' }
]
}
},
created() {
this.getAllocateGoodsDetail()
},
methods: {
getList() {
let list = this.list
groupCustomer.getcustomerRecordList({ ...this.page }).then(({ code, data, message }) => {
getAllocateGoodsDetail() {
allocateApi.getAllocateGoodsDetail({ id: this.id }).then(({ code, data, message }) => {
console.log(data, 'data')
if (code == 0) {
this.orderInfo = data
this.getList()
} else {
Notify(message)
}
})
},
getList(keyword) {
let list = this.StockList
allocateApi.getAllocateGoodsStockDetail({ ...this.page, merchantName: keyword,upgradeGoodsld: this.orderInfo.goodsId}).then(({ code, data, message }) => {
this.hideLoading()
if (code == 0) {
this.recordList = [...list, ...data.list]
if (this.page.pageNum > 1) this.$refs.scrollView.loading = false
this.StockList = [...list, ...data.list]
if (this.page.currentPage > 1) this.$refs.scrollView.loading = false
if (data.list == 0 && this.flag) {
this.$refs.scrollView.finished = true
}
} else {
} else {
Notify(message)
}
this.flag = true
......@@ -104,15 +119,15 @@ export default {
},
onReachBottom() {
console.log('触底')
this.page.pageNum++
this.page.currentPage++
this.getList()
},
onSearch(val) {
const debouncedSearch = utils.debounce(
val => {
this.list = []
this.page.pageNum =1
this.getList(val)
this.StockList = []
this.page.currentPage = 1
this.getList(val)
},
200,
true
......@@ -192,6 +207,23 @@ export default {
font-size: 14px;
}
}
.content{
height:calc(100% - 360px);
.no-data {
display: flex;
flex-direction: column;
align-items: center;
justify-items: center;
img {
width: 72px;
height: 72px;
}
.no-data-text {
color: #999ea8;
font-size: 12px;
}
}
}
.list {
.item {
padding: 16px;
......
<!-- 采购发货 -->
<template>
<div class="layout">
<div class="allocate" :style="{height:isHeight?'calc(100vh - 68px)' : '100%'}">
<div class="allocate" :style="{ height: isHeight ? 'calc(100vh - 68px)' : '100%' }">
<!-- 订单基本信息 -->
<div class="info-section">
<div class="title">
订单基本信息
<div class="status">
<span :style="{ color: getStepText('orderStatusOpts', allocateOrderInfo.status, 'color') }">{{ getStepText('orderStatusOpts', allocateOrderInfo.status, 'label') }}</span>
<span :style="{ color: getStepText('orderStatusOpts', allocateOrderInfo.billStatus, 'color') }">{{ getStepText('orderStatusOpts', allocateOrderInfo.billStatus, 'label') }}</span>
|
<span :style="{ color: getStepText('deliveryStatusOpts', allocateOrderInfo.deliveryStatus, 'color') }">
{{ getStepText('deliveryStatusOpts', allocateOrderInfo.deliveryStatus, 'label') }}
......@@ -17,26 +17,27 @@
<div v-for="(item, index) in orderBasicInfoList" :key="index" class="info-item">
<span>{{ item.label }}</span>
<span class="value" v-if="item.formatter">{{ item.formatter(allocateOrderInfo) }}</span>
<span class="value" v-else>{{ allocateOrderInfo[item.value]||'--' }}</span>
<span class="value" v-else>{{ allocateOrderInfo[item.value] || '--' }}</span>
</div>
</div>
<!-- 订单基本信息 -->
<div class="info-section">
<div class="title">
商品信息<span class="title-tip">点击商品名称可查看商品全部信息</span>
商品信息
<span class="title-tip">点击商品名称可查看商品全部信息</span>
</div>
<StickyTable :columns="tableColumns" :data="allocateOrderInfo.stockAllocateDetailList" :height="allocateOrderInfo.stockAllocateDetailList.length > 5 ? '216px' : 'auto'">
<template #upgradeGoodsName="{ row }">
<span style="color: #347bff; cursor: pointer;" @click="handleProductClick(row)">{{ row.upgradeGoodsName }}</span>
<template #goodsName="{ row }">
<span style="color: #347bff; cursor: pointer" @click="handleProductClick(row)">{{ row.goodsName }}</span>
</template>
</StickyTable>
</div>
<!-- 其他信息 -->
<div class="info-section">
<div class="title">其他信息</div>
<div class="info-item">
<div class="info-item">
<span>备注</span>
<span>{{allocateOrderInfo.remark}}</span>
<span>{{ allocateOrderInfo.remark }}</span>
</div>
</div>
<!-- 审核流程进度 -->
......@@ -51,21 +52,21 @@
</div>
</div>
<div class="footer">
<div class="reject btn" @click="handleReject" v-if="
<div
class="reject btn"
@click="handleReject"
v-if="
(allocateOrderInfo.billStatus === 1 && staffType == 2) ||
(allocateOrderInfo.billStatus === 2 && staffType == 3) ||
(allocateOrderInfo.deliveryStatus === 1 && staffType == 4 && allocateOrderInfo.billStatus == 5)
">
"
>
驳回
</div>
<div class="approve btn" @click="handleApprove"
v-if="(allocateOrderInfo.billStatus === 1 && staffType == 2)
|| (allocateOrderInfo.billStatus === 2 && staffType == 3)
">通过</div>
<div class="approve btn" @click="handleApprove" v-if="(allocateOrderInfo.billStatus === 1 && staffType == 2) || (allocateOrderInfo.billStatus === 2 && staffType == 3)">通过</div>
</div>
<reject-comp :isVisible="rejectVisible" v-if="rejectVisible" :infoData="allocateOrderInfo" @cancel="handleCancel" @success="handleSuccess"></reject-comp>
<approve-comp :isVisible="approveVisible" v-if="approveVisible" :infoData="allocateOrderInfo" @cancel="handleApproveCancel" @success="handleApproveSuccess"></approve-comp>
<detail-comp :isVisible="detailVisible" v-if="detailVisible" :infoData="productInfo" @cancel="handleDetailCancel"></detail-comp>
</div>
</template>
......@@ -91,7 +92,6 @@ export default {
productInfo: {},
approveVisible: false,
rejectVisible: false,
detailVisible: false,
tableColumns: [
{ label: '商品名称', prop: 'goodsName', width: '120px' },
{ label: '商品编码', prop: 'productCode', width: '100px' },
......@@ -99,15 +99,23 @@ export default {
{
label: '调拨数量',
prop: 'allocateNumber',
width: '100px'
width: '100px',
formatter: cellValue => {
return cellValue.allocateNumber || cellValue.allocateNumber === 0 ? parseFloat(cellValue.allocateNumber).toFixed(2) + ([1, 4, 6, 12, 14].includes(cellValue.goodsType) ? '米' : '件') : '--'
}
},
{
label: '调入门店库存',
prop: 'inStockQty',
width: '100px'
width: '120px',
formatter: cellValue => {
return cellValue.inStockQty || cellValue.inStockQty === 0 ? parseFloat(cellValue.inStockQty).toFixed(2) + ([1, 4, 6, 12, 14].includes(cellValue.goodsType) ? '米' : '件') : '--'
}
},
{
label: '调出门店库存', prop: 'outStockQty', width: '100px'
label: '调出门店库存', prop: 'outStockQty', width: '120px', formatter: cellValue => {
return cellValue.outStockQty || cellValue.outStockQty === 0 ? parseFloat(cellValue.outStockQty).toFixed(2) + ([1, 4, 6, 12, 14].includes(cellValue.goodsType) ? '米' : '件') : '--'
}
},
{
label: '膜卷号', prop: 'filmRollNo', width: '90px'
......@@ -119,17 +127,14 @@ export default {
{ label: '调出门店', value: 'callOutMerchantName' },
{
label: '调拨数量',
value: 'totalAllocateNumber',
formatter: cellValue => {
return cellValue.totalAllocateNumber||cellValue.totalAllocateNumber===0?cellValue.totalAllocateNumber:'--'
}
value: 'totalAllocateNumber'
},
{ label: '发起时间', value: 'submitTime' },
{
label: '当前审核节点',
value: '商务审核',
value: '',
formatter: cellValue => {
return cellValue.billStatus == 1 ? '运营审核' : cellValue.status == 2 ? '商务审核' : '--'
return cellValue.billStatus == 1 ? '运营审核' : cellValue.billStatus == 2 ? '商务审核' : '--'
}
}
],
......@@ -196,18 +201,25 @@ export default {
},
computed: {
isHeight() {
const { status, deliveryStatus } = this.allocateOrderInfo || {}
const { billStatus, deliveryStatus } = this.allocateOrderInfo || {}
const staffType = this.staffType
return (
(status === 1 && staffType == 2) ||
(status === 2 && staffType == 5) ||
(status === 8 && staffType == 3) ||
(deliveryStatus === 1 && staffType == 4 && status == 5)
(billStatus === 1 && staffType == 2) ||
(billStatus === 2 && staffType == 3) ||
(deliveryStatus === 1 && staffType == 4 && billStatus == 5)
)
}
},
mounted() { },
methods: {
handleProductClick(row){
this.$router.push({
path: '/cannibalize/detail',
query: {
id: row.id
}
})
},
handleApproveCancel() {
this.approveVisible = false
},
......@@ -244,14 +256,7 @@ export default {
this.allocateOrderInfo = result.data
}
},
handleDetailCancel() {
this.detailVisible = !this.detailVisible
},
handleProductClick(row) {
console.log(row)
this.productInfo = row
this.handleDetailCancel()
},
//驳回
handleReject() {
this.rejectVisible = true
......
......@@ -76,7 +76,7 @@ export default {
9: '#F24724'
},
rejectedForShow: {
1: { rejectedStatus: '采购商户' },
1: { rejectedStatus: '调拨商户' },
2: { rejectedStatus: '运营审核' },
3: { rejectedStatus: '商务审核' }
}
......
......@@ -47,7 +47,7 @@ export default {
statusList: [
{ name: '运营审核', active: false, type: 1 },
{ name: '商务审核', active: false, type: 1 },
{ name: '采购发货审核', active: false, type: 1 }
{ name: '调拨发货审核', active: false, type: 1 }
]
}
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!