Commit 64d75caf by chenwq

feat(调拨管理): 新增调拨单详情、编辑和状态更新功能

- 新增调拨单详情展示页面,包含单据状态、收货信息等
- 新增调拨单编辑功能,支持保存、作废和提交审核操作
- 新增调拨单状态更新接口和前端交互
- 优化表单组件,支持自定义placeholder
- 提取调拨单状态常量到独立文件,统一管理状态配置
- 修复调拨列表页操作按钮逻辑,调整状态流转
- 完善调拨详情弹窗的收货信息展示和样式
1 parent 9f78db30
...@@ -195,6 +195,44 @@ const stockAllocateDetailPage = params => { ...@@ -195,6 +195,44 @@ const stockAllocateDetailPage = params => {
sign: true sign: true
}) })
} }
// 调拨详情
const stockAllocateInfo = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.smartcarlife.api.stock.allocate.h5.detail`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 更新调拨单
const updateStockAllocate = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.smartcarlife.api.stock.allocate.update`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 更新调拨单状态
const updateStockAllocateStatus = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.smartcarlife.api.stock.allocate.updateStatus`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
//导出 //导出
const exportExcel = params => { const exportExcel = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
...@@ -270,7 +308,8 @@ const saveStockAllocate = params => { ...@@ -270,7 +308,8 @@ const saveStockAllocate = params => {
url: 'rop-scrm-boutiquecoupon/router', url: 'rop-scrm-boutiquecoupon/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true,
returnAll: true
}) })
} }
...@@ -432,4 +471,43 @@ const refundDetail = params => { ...@@ -432,4 +471,43 @@ const refundDetail = params => {
sign: true sign: true
}) })
} }
export default { inventoryWarningList, exportaInventExcel, exportaAllocateExcel, exportCheckExcel, exportReduceExcel, exportMerchantExcel, exportExcel, saveStockAllocate, stockAllocateDetailPage, stockAllocatePage, yqRelatedList, saveStockCheck, stockRemainPage, stockCheckDetailPage, stockCheckPage, getMerchantGoodsStockCount, getMerchantGoodsStockReduceRecord, getReportByGoods, getyqMerchantList, getGoodsWarehousingCount, getGoodsWarehousingList, getMerchantGoodsStockMonthCount, getMerchantGoodsStockMonthReport, merchantShopGoodsStockPage, getServicemerchantrefList, checkShipper, exportStatementOfAccount, getRoleTechnician, technicianUpdate, refundDetailPage, refundSave, refundPage, refundExport, refundUpdateStatus, refundDetail } export default {
inventoryWarningList,
exportaInventExcel,
exportaAllocateExcel,
exportCheckExcel,
exportReduceExcel,
exportMerchantExcel,
exportExcel,
saveStockAllocate,
stockAllocateDetailPage,
stockAllocateInfo,
updateStockAllocate,
updateStockAllocateStatus,
stockAllocatePage,
yqRelatedList,
saveStockCheck,
stockRemainPage,
stockCheckDetailPage,
stockCheckPage,
getMerchantGoodsStockCount,
getMerchantGoodsStockReduceRecord,
getReportByGoods,
getyqMerchantList,
getGoodsWarehousingCount,
getGoodsWarehousingList,
getMerchantGoodsStockMonthCount,
getMerchantGoodsStockMonthReport,
merchantShopGoodsStockPage,
getServicemerchantrefList,
checkShipper,
exportStatementOfAccount,
getRoleTechnician,
technicianUpdate,
refundDetailPage,
refundSave,
refundPage,
refundExport,
refundUpdateStatus,
refundDetail
}
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
:style="{'margin-bottom': !item.type ? '0px' : '22px'}"> :style="{'margin-bottom': !item.type ? '0px' : '22px'}">
<el-input v-if="item.type === 'input'" <el-input v-if="item.type === 'input'"
v-model.trim="formData[item.name]" v-model.trim="formData[item.name]"
:placeholder="item.label" :placeholder="item.placeholder || '请输入' + item.label"
:maxlength="item.maxlength" :maxlength="item.maxlength"
:style="{'width': item.width || formItemWidth}" :style="{'width': item.width || formItemWidth}"
:disabled="item.isDisabled" :disabled="item.isDisabled"
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
type="textarea" type="textarea"
v-model.trim="formData[item.name]" v-model.trim="formData[item.name]"
:style="{'width': item.width || formItemWidth}" :style="{'width': item.width || formItemWidth}"
:placeholder="item.label" :placeholder="item.placeholder || '请输入' + item.label"
:rows="item.rows || 4" :rows="item.rows || 4"
:maxlength="item.maxlength" :maxlength="item.maxlength"
show-word-limit /> show-word-limit />
......
<!-- 盘点详情弹窗弹窗 --> <!-- 盘点详情弹窗弹窗 -->
<template> <template>
<GLDialog bigTitle="详细信息" <GLDialog bigTitle="详细信息" width="1008px" :visible.sync="allocationDetailVisible" class="inventoryDetailDailog" mode="big" okText="关闭" @onCancel="handleClose" @onOk="handleClose" :before-close="handleClose" :hasFooter="false">
width="1500px"
:visible.sync="allocationDetailVisible"
class="inventoryDetailDailog"
mode="big"
okText="关闭"
@onCancel="handleClose"
@onOk="handleClose"
:before-close="handleClose"
:hasFooter="false">
<div> <div>
<div>
单据状态:
<span :class="billStatusName()" />
{{ baseData.billStatusObj[allocationInfo.billStatus]?.name || '-' }}
</div>
<div class="receipt-box">
<div v-for="(item, index) in infoForm" :class="item.class" :key="index">
<span :style="{ 'flex-shrink': 0, display: 'inline-block', ...item.labelStyle }">{{ item.label }}</span>
<el-tooltip v-if="allocationInfo[item.name]" class="item" effect="light" :content="allocationInfo[item.name]" placement="top">
<span class="ellipsis">{{ allocationInfo[item.name] }}</span>
</el-tooltip>
<span v-else>-</span>
</div>
</div>
<div class="header" slot="header" style="padding: 10px 20px"></div>
<div class="d2-container-content"> <div class="d2-container-content">
<GLTable ref="recordTable" <GLTable ref="recordTable" :getListApi="getListApi" :searchForm="searchFormSearch" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" :pageConf="pageConf"></GLTable>
:getListApi="getListApi"
:searchForm="searchFormSearch"
:tableParams="tableParams"
:beforeSearchFn="beforeSearchFn"></GLTable>
</div> </div>
</div> </div>
<!-- <span slot="footer" class="dialog-footer"> <!-- <span slot="footer" class="dialog-footer">
...@@ -27,11 +29,17 @@ ...@@ -27,11 +29,17 @@
<script> <script>
// import { membraneTypeList } from '@/utils/constants.js' // import { membraneTypeList } from '@/utils/constants.js'
import constData from './constant/data.js'
export default { export default {
name: 'allocationDetailDialog', name: 'allocationDetailDialog',
data() { data() {
return { return {
// membraneTypeList: membraneTypeList, // membraneTypeList: membraneTypeList,
infoForm: [
{ name: 'receiver', label: '收货人:', class: 'receiver', labelStyle: { width: '56px' } },
{ name: 'phone', label: '收货人电话:', class: 'phone', labelStyle: { width: '84px' } },
{ name: 'address', label: '收货地址:', class: 'address', labelStyle: { width: '70px' } }
],
searchForm: { searchForm: {
id: '' id: ''
}, },
...@@ -82,7 +90,10 @@ export default { ...@@ -82,7 +90,10 @@ export default {
} }
] ]
}, },
baseData: {} pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
baseData: {
billStatusObj: constData.billStatusObj
}
} }
}, },
...@@ -111,13 +122,19 @@ export default { ...@@ -111,13 +122,19 @@ export default {
}) })
}, },
billStatusName() {
console.log(this.allocationInfo.billStatus)
return this.baseData.billStatusObj[this.allocationInfo.billStatus]?.class || '-'
},
handleClose() { handleClose() {
this.$emit('dialogClose') this.$emit('dialogClose')
} }
} }
} }
</script> </script>
<style scoped> <style scoped lang="scss">
@import '@/assets/css/mixin.scss';
.count-txt { .count-txt {
font-weight: 700; font-weight: 700;
color: #2a58ad; color: #2a58ad;
...@@ -128,4 +145,51 @@ export default { ...@@ -128,4 +145,51 @@ export default {
margin-top: 20vh !important; margin-top: 20vh !important;
min-width: 700px; min-width: 700px;
} }
.receipt-box {
display: flex;
margin-top: 9.5px;
color: #666666;
font-size: 14px;
.receiver {
display: flex;
width: 210px;
margin-right: 20px;
}
.phone {
display: flex;
width: 257px;
margin-right: 20px;
}
.address {
display: flex;
width: 461px;
}
.ellipsis {
display: inline-block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.greenSpot {
@include dot;
background: $color-green;
}
.yellowSpot {
@include dot;
background: $color-yellow;
}
.ashSpot {
@include dot;
background: $color-gray;
}
.redSpot {
@include dot;
background: $color-red;
}
</style> </style>
const billStatusList = [
{ confId: 0, confLabel: '待提交' },
{ confId: 1, confLabel: '运营审核' },
{ confId: 2, confLabel: '商务审核' },
{ confId: '4,6,7', confLabel: '审核驳回' },
{ confId: 5, confLabel: '审核通过' },
{ confId: -1, confLabel: '作废' }
]
const billStatusObj = {
0: {
class: 'yellowSpot',
name: '待提交'
},
1: {
class: 'yellowSpot',
name: '运营审核'
},
2: {
class: 'yellowSpot',
name: '商务审核'
},
4: {
class: 'redSpot',
name: '审核驳回'
},
5: {
class: 'greenSpot',
name: '审核通过'
},
6: {
class: 'redSpot',
name: '审核驳回'
},
7: {
class: 'redSpot',
name: '审核驳回'
},
'-1': {
class: 'ashSpot',
name: '作废'
}
}
export default {
billStatusList,
billStatusObj
}
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
</template> </template>
<script> <script>
import constData from './constant/data.js'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import allocationDetailDialog from './allocationDetailDialog' import allocationDetailDialog from './allocationDetailDialog'
...@@ -63,40 +64,7 @@ export default { ...@@ -63,40 +64,7 @@ export default {
tableSearchForm: {}, tableSearchForm: {},
allocationInfo: {}, allocationInfo: {},
allocationDetailVisible: false, allocationDetailVisible: false,
billStatusObj: { billStatusObj: constData.billStatusObj,
0: {
class: 'yellowSpot',
name: '待提交'
},
1: {
class: 'yellowSpot',
name: '运营审核'
},
2: {
class: 'yellowSpot',
name: '商务审核'
},
4: {
class: 'redSpot',
name: '审核驳回'
},
5: {
class: 'greenSpot',
name: '审核通过'
},
6: {
class: 'redSpot',
name: '审核驳回'
},
7: {
class: 'redSpot',
name: '审核驳回'
},
'-1': {
class: 'ashSpot',
name: '作废'
}
},
deliveryStatusObj: { deliveryStatusObj: {
1: { 1: {
class: 'ashSpot', class: 'ashSpot',
...@@ -220,7 +188,7 @@ export default { ...@@ -220,7 +188,7 @@ export default {
prop: 'allocateTime', prop: 'allocateTime',
width: 112, width: 112,
formatter: cellValue => { formatter: cellValue => {
return dayjs(cellValue.allocateTime).format('YYYY-MM-DD HH:mm:ss') return cellValue.allocateTime ? dayjs(cellValue.allocateTime).format('YYYY-MM-DD HH:mm:ss') : '--'
} }
}, },
{ {
...@@ -251,12 +219,14 @@ export default { ...@@ -251,12 +219,14 @@ export default {
{ {
label: '承运单号', label: '承运单号',
prop: 'deliveryNumber', prop: 'deliveryNumber',
width: 150 width: 150,
line: 1
}, },
{ {
label: '承运公司', label: '承运公司',
prop: 'deliveryCompany', prop: 'deliveryCompany',
width: 150 width: 150,
line: 1
}, },
{ {
label: '发货状态', label: '发货状态',
...@@ -272,7 +242,9 @@ export default { ...@@ -272,7 +242,9 @@ export default {
}, },
{ {
label: '收货人', label: '收货人',
prop: 'receiver' prop: 'receiver',
width: 200,
line: 1
}, },
{ {
label: '收货人电话', label: '收货人电话',
...@@ -282,7 +254,8 @@ export default { ...@@ -282,7 +254,8 @@ export default {
{ {
label: '收货地址', label: '收货地址',
prop: 'address', prop: 'address',
width: 140 width: 200,
line: 1
} }
] ]
}, },
...@@ -315,14 +288,14 @@ export default { ...@@ -315,14 +288,14 @@ export default {
}, },
listeners: { listeners: {
click: row => { click: row => {
this.$confirm('退货申请单,确认提交申请?', '提交确定', { this.$confirm('调拨申请单,确认提交申请?', '提交确定', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) })
.then(() => { .then(() => {
console.log(row) console.log(row)
this.updateStatus(row, 2, '提交审核成功') this.updateStatus(row, 1, '提交审核成功')
}) })
.catch(() => { }) .catch(() => { })
} }
...@@ -350,14 +323,14 @@ export default { ...@@ -350,14 +323,14 @@ export default {
}, },
listeners: { listeners: {
click: row => { click: row => {
this.$confirm('作废后无法恢复退货单,是否确认作废?', '退货申请作废确定', { this.$confirm('作废后无法恢复调拨单,是否确认作废?', '调拨申请作废确定', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) })
.then(() => { .then(() => {
console.log(row) console.log(row)
this.updateStatus(row, 5, '作废成功') this.updateStatus(row, '-1', '作废成功')
}) })
.catch(() => { }) .catch(() => { })
} }
...@@ -369,14 +342,7 @@ export default { ...@@ -369,14 +342,7 @@ export default {
yqRelatedMerchantList: [], yqRelatedMerchantList: [],
outMerchantList: [], //调出门店 outMerchantList: [], //调出门店
inMerchantList: [], //调入门店 inMerchantList: [], //调入门店
billStatusList: [ billStatusList: constData.billStatusList,
{ confId: 0, confLabel: '待提交' },
{ confId: 1, confLabel: '运营审核' },
{ confId: 2, confLabel: '商务审核' },
{ confId: '4,6,7', confLabel: '审核驳回' },
{ confId: 5, confLabel: '审核通过' },
{ confId: -1, confLabel: '作废' }
],
deliveryStatusList: [ deliveryStatusList: [
{ confId: 1, confLabel: '未发货' }, { confId: 1, confLabel: '未发货' },
{ confId: 3, confLabel: '部分发货' }, { confId: 3, confLabel: '部分发货' },
...@@ -463,6 +429,20 @@ export default { ...@@ -463,6 +429,20 @@ export default {
this.allocationDetailVisible = true this.allocationDetailVisible = true
console.log(this.allocationDetailVisible) console.log(this.allocationDetailVisible)
}, },
updateStatus(row, billStatus, okMessage = '提交成功') {
this.$apis.stockManage
.updateStockAllocateStatus({
id: row.id,
billStatus
})
.then(res => {
this.$notify({
message: res.code == '0' ? okMessage : res.message,
type: res.code == '0' ? 'success' : 'error'
})
this.$refs.allocationRef.refreshTable()
})
},
handleAdd() { handleAdd() {
this.$router.push({ this.$router.push({
path: '/allocation/add', path: '/allocation/add',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!