Commit 64d75caf by chenwq

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

- 新增调拨单详情展示页面,包含单据状态、收货信息等
- 新增调拨单编辑功能,支持保存、作废和提交审核操作
- 新增调拨单状态更新接口和前端交互
- 优化表单组件,支持自定义placeholder
- 提取调拨单状态常量到独立文件,统一管理状态配置
- 修复调拨列表页操作按钮逻辑,调整状态流转
- 完善调拨详情弹窗的收货信息展示和样式
1 parent 9f78db30
......@@ -195,6 +195,44 @@ const stockAllocateDetailPage = params => {
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 => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
......@@ -270,7 +308,8 @@ const saveStockAllocate = params => {
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
sign: true,
returnAll: true
})
}
......@@ -432,4 +471,43 @@ const refundDetail = params => {
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 @@
:style="{'margin-bottom': !item.type ? '0px' : '22px'}">
<el-input v-if="item.type === 'input'"
v-model.trim="formData[item.name]"
:placeholder="item.label"
:placeholder="item.placeholder || '请输入' + item.label"
:maxlength="item.maxlength"
:style="{'width': item.width || formItemWidth}"
:disabled="item.isDisabled"
......@@ -51,7 +51,7 @@
type="textarea"
v-model.trim="formData[item.name]"
:style="{'width': item.width || formItemWidth}"
:placeholder="item.label"
:placeholder="item.placeholder || '请输入' + item.label"
:rows="item.rows || 4"
:maxlength="item.maxlength"
show-word-limit />
......
<template>
<div class="addWrap">
<div class="d2-container-content gl-form-min" style="padding: 10px 20px">
<el-form :inline="true" size="small" :model="editAllocationForm" ref="editAllocationFormRef" :rules="formRules" class="demo-form-inline">
<el-form-item>调出方</el-form-item>
<el-form-item label="调出仓库:" prop="callOutYqMerchantId">
<el-select v-model="editAllocationForm.callOutYqMerchantId" style="width: 300px">
<el-option v-for="item in callOutYqMerchantList" :key="item.merchantNo" :label="item.merchantName" :value="item.merchantNo" />
</el-select>
</el-form-item>
<el-form-item label="调出门店:" prop="callOutMerchantId">
<el-select v-model="editAllocationForm.callOutMerchantId" style="width: 300px">
<el-option v-for="item in callOutMerchantList" :key="item.merchantId" :label="item.merchantName" :value="item.merchantId" />
</el-select>
</el-form-item>
<br />
<el-form-item>调入方</el-form-item>
<el-form-item label="调入仓库:" prop="callInYqMerchantId">
<el-select v-model="editAllocationForm.callInYqMerchantId" @change="changeCallInYqMerchant(editAllocationForm.callInYqMerchantId)" style="width: 300px">
<el-option v-for="item in callInYqMerchantList" :key="item.merchantNo" :label="item.merchantName" :value="item.merchantNo" />
</el-select>
</el-form-item>
<el-form-item label="调入门店:" prop="callInMerchantId">
<el-select v-model="editAllocationForm.callInMerchantId" style="width: 300px">
<el-option v-for="item in callInMerchantList" :key="item.merchantId" :label="item.merchantName" :value="item.merchantId" />
</el-select>
</el-form-item>
</el-form>
</div>
<div class="d2-container-content">
<div style="padding: 15px 0">
<div style="padding: 10px 20px">
<el-form :inline="true" size="small" :model="editAllocationForm" ref="editAllocationFormRef" :rules="formRules" class="demo-form-inline">
<el-form-item>调出方:</el-form-item>
<el-form-item label="调出仓库:" prop="callOutYqMerchantId">
<el-select v-model="editAllocationForm.callOutYqMerchantId" style="width: 300px">
<el-option v-for="item in callOutYqMerchantList" :key="item.merchantNo" :label="item.merchantName" :value="item.merchantNo" />
</el-select>
</el-form-item>
<el-form-item label="调出门店:" prop="callOutMerchantId">
<el-select v-model="editAllocationForm.callOutMerchantId" style="width: 300px">
<el-option v-for="item in callOutMerchantList" :key="item.merchantId" :label="item.merchantName" :value="item.merchantId" />
</el-select>
</el-form-item>
<br />
<el-form-item>调入方:</el-form-item>
<el-form-item label="调入仓库:" prop="callInYqMerchantId">
<el-select v-model="editAllocationForm.callInYqMerchantId" @change="changeCallInYqMerchant(editAllocationForm.callInYqMerchantId)" style="width: 300px">
<el-option v-for="item in callInYqMerchantList" :key="item.merchantNo" :label="item.merchantName" :value="item.merchantNo" />
</el-select>
</el-form-item>
<el-form-item label="调入门店:" prop="callInMerchantId">
<el-select v-model="editAllocationForm.callInMerchantId" style="width: 300px">
<el-option v-for="item in callInMerchantList" :key="item.merchantId" :label="item.merchantName" :value="item.merchantId" />
</el-select>
</el-form-item>
</el-form>
</div>
<div>
<div class="gl-form-min">
<div>调拨列表</div>
<el-form :inline="true" size="small" :model="editAllocationForm">
<el-form-item label="">
<el-form-item label="调拨:">
<el-input v-model="searchForm.upgradeGoodsNameOrSeries" style="width: 200px" placeholder="请输入商品名称/系列" maxlength="20" clearable />
</el-form-item>
<el-button @click="handleSearch" size="small" type="primary" style="marginleft: 15px">查询</el-button>
<el-button @click="handleSearch" size="small" type="primary">查询</el-button>
</el-form>
</div>
</div>
......@@ -52,7 +53,24 @@
</div>
</GLTable>
</div>
<glsx-form ref="allocationForm" :rules="allocationFormRules" :origin-data="editData" :form-list="editForm" form-ref="inveFormRef" @handleAddConfirm="handleAddConfirm" @handleClose="handleAddClose"></glsx-form>
<div class="addRefundForm">
<!-- <glsx-form ref="allocationForm" :rules="allocationFormRules" :origin-data="editData" :form-list="editForm" form-ref="inveFormRef" @handleAddConfirm="handleAddConfirm" @handleClose="handleAddClose"></glsx-form> -->
<glsx-form ref="allocationForm" :rules="allocationFormRules" :origin-data="editData" :form-list="editForm" form-ref="inveFormRef" :isShowBtn="false"></glsx-form>
</div>
<div style="margin-top: 40px;text-align: center;">
<el-button class="btn" @click="handleAddClose">
取消
</el-button>
<el-button @click="beforeConfirm('save')" class="btn" plain>
保存
</el-button>
<el-button @click="beforeConfirm('invalid')" class="btn" plain v-if="oprType == 'edit'">
作废
</el-button>
<el-button @click="beforeConfirm('review')" type="primary" class="btn">
提交审核
</el-button>
</div>
<!-- 盘点 -->
<allocation-num-dialog :allocation-num-visible="allocationNumVisible" :allocation-info="allocationInfo" v-if="allocationNumVisible" @dialogClose="dialogClose" />
</div>
......@@ -68,6 +86,13 @@ export default {
},
data() {
return {
oprType: 'add',
routeInfo: {},
loading: false,
// isDisabled: false,
// 编辑首次进
editFirst: false,
editMerFirst: false,
callOutYqMerchantList: [],
callInYqMerchantList: [],
callOutMerchantList: [],
......@@ -191,24 +216,37 @@ export default {
},
editData: {
// thumbUrlList: [],
receiver: '',
phone: '',
address: '',
remark: ''
},
editForm: [
{
formBlock: [
{
name: 'deliveryNumber',
label: '承运单号',
name: 'receiver',
label: '收货人',
type: 'input',
maxlength: 30,
width: '284px',
placeholder: '请输入'
},
{
name: 'phone',
label: '收货人电话',
type: 'input',
maxlength: 50,
width: '300px'
maxlength: 12,
width: '284px',
placeholder: '请输入'
},
{
name: 'deliveryCompany',
label: '承运公司',
name: 'address',
label: '收货地址',
type: 'input',
maxlength: 20,
width: '300px'
maxlength: 30,
width: '284px',
placeholder: '请输入'
},
{
name: 'remark',
......@@ -216,7 +254,8 @@ export default {
width: '432px',
type: 'textarea',
rows: 5,
maxlength: 100
maxlength: 200,
placeholder: '请输入'
}
]
}
......@@ -263,23 +302,48 @@ export default {
]
},
allocationFormRules: {
deliveryNumber: [
receiver: [
{
required: true,
message: '请输入承运单号',
message: '请输入收货人',
trigger: 'change'
}
],
deliveryCompany: [
phone: [
{
required: true,
message: '请输入承运公司',
message: '请输入收货人电话',
trigger: 'change'
}
],
address: [
{
required: true,
message: '请输入收货地址',
trigger: 'change'
}
]
},
oldyqMerchantId: '', //之前选择的调出仓库
oldMerchantId: '' //之前选择的调出门店
oldMerchantId: '', //之前选择的调出门店
//保存/作废/提交审核,弹窗提示和状态值适配
btnTypeMap: {
save: {
title: '提示',
confirmMsg: '调拨单保存后,系统自动按照调拨数量对调出和调入门店进行库存更新;是否确定保存?',
billStatus: 0
},
invalid: {
title: '调拨申请作废确定',
confirmMsg: '作废后无法恢复调拨单,是否确认作废?',
billStatus: '-1'
},
review: {
title: '提交确定',
confirmMsg: '调拨申请单,确认提交申请?',
billStatus: 1
}
}
}
},
created() {
......@@ -289,7 +353,7 @@ export default {
},
watch: {
'editAllocationForm.callOutYqMerchantId'(val, oldval) {
console.log(val, oldval, '监听callOutYqMerchantId')
// console.log(val, oldval, '监听callOutYqMerchantId')
// this.getListApi = this.$apis.stockManage.stockRemainPage
if (this.callOutYqMerchantList.length == 1) {
//当只有一个选项时不弹提示框
......@@ -297,8 +361,11 @@ export default {
} else {
if (val != this.oldyqMerchantId) {
//与之前的选项不一样
this.editAllocationForm.callOutMerchantId = ''
this.switchData(val, oldval, 'yqMerchant')
if (!this.editFirst) {
this.editAllocationForm.callOutMerchantId = ''
this.switchData(val, oldval, 'yqMerchant')
}
this.editFirst = false
}
}
},
......@@ -312,34 +379,37 @@ export default {
} else {
if (val != this.oldMerchantId) {
//与之前的选项不一样
this.switchData(val, oldval, 'merchant')
if (!this.editMerFirst) {
this.switchData(val, oldval, 'merchant')
}
this.editMerFirst = false
}
}
}
},
mounted() {
// this.editAllocationForm.callOutYqMerchantId = this.callOutYqMerchantList[0].merchantNo
this.routeInfo = this.$route.query?.row || {}
console.log(this.routeInfo)
if (this.routeInfo?.id) {
this.oprType = 'edit'
this.editFirst = true
this.editMerFirst = true
// this.isDisabled = true
this.getDetail()
}
// 调出仓库
this.$apis.stockManage.getyqMerchantList({ mainPartnerMerchant: true }).then(res => {
this.callOutYqMerchantList = this.$common.utils.deepClone(res)
this.callInYqMerchantList = this.$common.utils.deepClone(res)
if (this.callOutYqMerchantList && this.callOutYqMerchantList.length == 1) {
if (this.callOutYqMerchantList && this.callOutYqMerchantList.length == 1 && this.oprType == 'add') {
this.editAllocationForm.callOutYqMerchantId = this.callOutYqMerchantList[0].merchantNo
this.getServicemerchantrefList(this.editAllocationForm.callOutYqMerchantId, 'out')
}
if (this.callInYqMerchantList && this.callInYqMerchantList.length == 1) {
if (this.callInYqMerchantList && this.callInYqMerchantList.length == 1 && this.oprType == 'add') {
this.editAllocationForm.callInYqMerchantId = this.callInYqMerchantList[0].merchantNo
this.getServicemerchantrefList(this.editAllocationForm.callInYqMerchantId, 'in')
}
})
//调入仓库
// this.$apis.stockManage.yqRelatedList({ includeSelf: false }).then(res => {
// this.callInYqMerchantList = res
// if (this.callInYqMerchantList && this.callInYqMerchantList.length == 1) {
// this.editAllocationForm.callInYqMerchantId = this.callInYqMerchantList[0].merchantId
// this.getServicemerchantrefList(this.editAllocationForm.callInYqMerchantId, 'in')
// }
// })
},
methods: {
......@@ -443,7 +513,7 @@ export default {
//设置禁选
setDisabled(row) {
const index = this.chooseDataList.findIndex(item => item.id == row.id)
const index = this.chooseDataList.findIndex(item => item.goodsId == row.upgradeGoodsId)
if (index == -1) {
return false
} else {
......@@ -467,6 +537,33 @@ export default {
obj.sourceMaterialName = obj.goodsSeries
return obj
},
getDetail() {
this.$apis.stockManage
.stockAllocateInfo({
allocateCode: this.routeInfo.allocateCode
})
.then(res => {
console.log(res)
this.routeInfo.id = res.id
this.editAllocationForm = res
this.editAllocationForm.callOutYqMerchantId = this.editAllocationForm.callOutYqMerchantId + ''
this.editAllocationForm.callInYqMerchantId = this.editAllocationForm.callInYqMerchantId + ''
this.chooseDataList = res.stockAllocateDetailList
// this.getListApi = this.$apis.stockManage.stockRemainPage
this.$refs.allocationTable.refreshTable()
this.chooseDataList.forEach((item, idx) => {
this.setDisabled(item)
})
// this.editData.receiver = res.receiver || ''
// this.editData.phone = res.phone || ''
// this.editData.address = res.address || ''
// this.editData.remark = res.remark || ''
Object.assign(this.editData, res)
// console.log(this.editData, 'this.editData')
this.getServicemerchantrefList(this.editAllocationForm.callOutYqMerchantId, 'out')
this.getServicemerchantrefList(this.editAllocationForm.callInYqMerchantId, 'in')
})
},
// 取消
cancelAllocation(row, index) {
......@@ -474,7 +571,13 @@ export default {
this.chooseDataList = this.chooseDataList.filter(item => item.id != row.id)
},
handleAddConfirm(data) {
/** 保存/作废/提交申请之前,表单校验等
* 按钮类型 - 单据状态
* 保存按钮(save) - 1:待提交
* 提交审核按钮(review) - 2:待总部审核
* 作废按钮(invalid) - 5:作废
**/
beforeConfirm(btnType = 'save') {
this.$refs.editAllocationFormRef.validate(valid => {
if (valid) {
if (this.chooseDataList.length == 0) {
......@@ -484,51 +587,95 @@ export default {
})
return
}
const data = this.$refs.allocationForm.formData
var params = {}
params.stockCheckDetailList = this.chooseDataList
if (data.remark) {
params.remark = data.remark
}
params.deliveryNumber = data.deliveryNumber
params.deliveryCompany = data.deliveryCompany
params = {
...params,
...data,
...this.editAllocationForm
}
this.$confirm('调拨单保存后,系统自动按照调拨数量对调出和调入门店进行库存更新;是否确定保存?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$apis.stockManage.saveStockAllocate(params).then(res => {
this.$notify({
type: 'success',
title: res.message || '操作成功'
})
this.handleAddClose()
})
})
.catch(err => {
console.log(err)
})
params.stockCheckDetailList = this.chooseDataList
params.remark = data.remark || ''
console.log(params, 'params')
// 调不同按钮的方法
this.handleConfirm(params, btnType)
}
})
},
/** 保存/作废/审核提交,弹窗提示不一样
* 按钮类型 - 单据状态
* 保存按钮(save) - 创建 - 0:待提交
* 提交审核按钮(review) - 1:待审核
* 作废按钮(invalid) - -1:作废
**/
handleConfirm(params, btnType = 'save') {
if (this.loading) {
return true
}
const tipTxtObj = {
save: '保存成功',
review: '提交审核成功',
invalid: '作废成功'
}
const btnObj = this.btnTypeMap[btnType]
params.billStatus = btnObj.billStatus
this.$confirm(btnObj.confirmMsg, btnObj.title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.loading = true
this.$apis.stockManage[this.routeInfo.id ? 'updateStockAllocate' : 'saveStockAllocate'](params).then(res => {
this.$notify({
type: res.code == 0 ? 'success' : 'error',
title: res.code == 0 ? (tipTxtObj[btnType] || '操作成功') : res.message
})
if (res.code == 0) {
if (btnType == 'save') {
this.routeInfo.allocateCode = res.data
this.oprType = 'edit'
this.editFirst = true
this.editMerFirst = true
// this.isDisabled = true
this.getDetail()
} else {
this.handleAddClose()
}
}
})
})
.catch(err => {
console.log(err)
}).finally(() => {
this.loading = false
})
},
handleAddClose(isRefresh = false) {
this.$router.go(-1)
}
}
}
</script>
<style scoped>
<style lang="scss" scoped>
.d2-container-content {
background: #fff;
padding: 20px;
margin-bottom: 20px;
}
.gl-form-min {
display: flex;
justify-content: space-between;
align-items: center;
color: #333333;
font-size: 16px;
margin-right: 104px;
.el-form--inline .el-form-item {
margin-right: 8px;
}
}
.count-txt {
font-weight: 700;
color: #2a58ad;
......@@ -547,4 +694,19 @@ export default {
box-sizing: border-box;
margin-right: 10px;
}
.addRefundForm {
/deep/.d2-container-content {
padding: 0px;
}
/deep/.d2-form .d2-form-block {
border-bottom: none !important;
padding: 16px 20px 0;
}
}
.btn {
height: 32px;
border-radius: 4px;
padding: 7.5px 18px;
}
</style>
<!-- 盘点详情弹窗弹窗 -->
<template>
<GLDialog bigTitle="详细信息"
width="1500px"
:visible.sync="allocationDetailVisible"
class="inventoryDetailDailog"
mode="big"
okText="关闭"
@onCancel="handleClose"
@onOk="handleClose"
:before-close="handleClose"
:hasFooter="false">
<GLDialog bigTitle="详细信息" width="1008px" :visible.sync="allocationDetailVisible" class="inventoryDetailDailog" mode="big" okText="关闭" @onCancel="handleClose" @onOk="handleClose" :before-close="handleClose" :hasFooter="false">
<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">
<GLTable ref="recordTable"
:getListApi="getListApi"
:searchForm="searchFormSearch"
:tableParams="tableParams"
:beforeSearchFn="beforeSearchFn"></GLTable>
<GLTable ref="recordTable" :getListApi="getListApi" :searchForm="searchFormSearch" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" :pageConf="pageConf"></GLTable>
</div>
</div>
<!-- <span slot="footer" class="dialog-footer">
......@@ -27,11 +29,17 @@
<script>
// import { membraneTypeList } from '@/utils/constants.js'
import constData from './constant/data.js'
export default {
name: 'allocationDetailDialog',
data() {
return {
// 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: {
id: ''
},
......@@ -82,7 +90,10 @@ export default {
}
]
},
baseData: {}
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
baseData: {
billStatusObj: constData.billStatusObj
}
}
},
......@@ -111,13 +122,19 @@ export default {
})
},
billStatusName() {
console.log(this.allocationInfo.billStatus)
return this.baseData.billStatusObj[this.allocationInfo.billStatus]?.class || '-'
},
handleClose() {
this.$emit('dialogClose')
}
}
}
</script>
<style scoped>
<style scoped lang="scss">
@import '@/assets/css/mixin.scss';
.count-txt {
font-weight: 700;
color: #2a58ad;
......@@ -128,4 +145,51 @@ export default {
margin-top: 20vh !important;
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>
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 @@
</template>
<script>
import constData from './constant/data.js'
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import allocationDetailDialog from './allocationDetailDialog'
......@@ -63,40 +64,7 @@ export default {
tableSearchForm: {},
allocationInfo: {},
allocationDetailVisible: false,
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: '作废'
}
},
billStatusObj: constData.billStatusObj,
deliveryStatusObj: {
1: {
class: 'ashSpot',
......@@ -220,7 +188,7 @@ export default {
prop: 'allocateTime',
width: 112,
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 {
{
label: '承运单号',
prop: 'deliveryNumber',
width: 150
width: 150,
line: 1
},
{
label: '承运公司',
prop: 'deliveryCompany',
width: 150
width: 150,
line: 1
},
{
label: '发货状态',
......@@ -272,7 +242,9 @@ export default {
},
{
label: '收货人',
prop: 'receiver'
prop: 'receiver',
width: 200,
line: 1
},
{
label: '收货人电话',
......@@ -282,7 +254,8 @@ export default {
{
label: '收货地址',
prop: 'address',
width: 140
width: 200,
line: 1
}
]
},
......@@ -315,14 +288,14 @@ export default {
},
listeners: {
click: row => {
this.$confirm('退货申请单,确认提交申请?', '提交确定', {
this.$confirm('调拨申请单,确认提交申请?', '提交确定', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
console.log(row)
this.updateStatus(row, 2, '提交审核成功')
this.updateStatus(row, 1, '提交审核成功')
})
.catch(() => { })
}
......@@ -350,14 +323,14 @@ export default {
},
listeners: {
click: row => {
this.$confirm('作废后无法恢复退货单,是否确认作废?', '退货申请作废确定', {
this.$confirm('作废后无法恢复调拨单,是否确认作废?', '调拨申请作废确定', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
console.log(row)
this.updateStatus(row, 5, '作废成功')
this.updateStatus(row, '-1', '作废成功')
})
.catch(() => { })
}
......@@ -369,14 +342,7 @@ export default {
yqRelatedMerchantList: [],
outMerchantList: [], //调出门店
inMerchantList: [], //调入门店
billStatusList: [
{ confId: 0, confLabel: '待提交' },
{ confId: 1, confLabel: '运营审核' },
{ confId: 2, confLabel: '商务审核' },
{ confId: '4,6,7', confLabel: '审核驳回' },
{ confId: 5, confLabel: '审核通过' },
{ confId: -1, confLabel: '作废' }
],
billStatusList: constData.billStatusList,
deliveryStatusList: [
{ confId: 1, confLabel: '未发货' },
{ confId: 3, confLabel: '部分发货' },
......@@ -463,6 +429,20 @@ export default {
this.allocationDetailVisible = true
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() {
this.$router.push({
path: '/allocation/add',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!