Commit 9f78db30 by chenwq

feat(调拨): 新增单据状态与发货状态显示及操作按钮

- 在调拨列表页添加单据状态和发货状态的筛选与展示,使用不同颜色的圆点标识状态
- 新增编辑、提交审核、作废等操作按钮,根据单据状态动态显示
- 调整调拨添加页的代码格式,移除多余换行以提升可读性
- 在SCSS变量中添加红色变量用于状态标识
1 parent da0b845d
$color-yellow:#fdb757; $color-yellow:#F59619;
$color-green:#2cca74; $color-green:#2cca74;
$color-gray:#999; $color-gray:#B8B8B8;
$color-red:#EB4E4E;
//背景图片 100% //背景图片 100%
@mixin bkgMaxSize($url) { @mixin bkgMaxSize($url) {
background-image: url($url); background-image: url($url);
......
<template> <template>
<div class="addWrap"> <div class="addWrap">
<div class="d2-container-content gl-form-min" <div class="d2-container-content gl-form-min" style="padding: 10px 20px">
style="padding: 10px 20px"> <el-form :inline="true" size="small" :model="editAllocationForm" ref="editAllocationFormRef" :rules="formRules" class="demo-form-inline">
<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>调出方</el-form-item>
<el-form-item label="调出仓库:" <el-form-item label="调出仓库:" prop="callOutYqMerchantId">
prop="callOutYqMerchantId"> <el-select v-model="editAllocationForm.callOutYqMerchantId" style="width: 300px">
<el-select v-model="editAllocationForm.callOutYqMerchantId" <el-option v-for="item in callOutYqMerchantList" :key="item.merchantNo" :label="item.merchantName" :value="item.merchantNo" />
style="width: 300px">
<el-option v-for="item in callOutYqMerchantList"
:key="item.merchantNo"
:label="item.merchantName"
:value="item.merchantNo" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="调出门店:" <el-form-item label="调出门店:" prop="callOutMerchantId">
prop="callOutMerchantId"> <el-select v-model="editAllocationForm.callOutMerchantId" style="width: 300px">
<el-select v-model="editAllocationForm.callOutMerchantId" <el-option v-for="item in callOutMerchantList" :key="item.merchantId" :label="item.merchantName" :value="item.merchantId" />
style="width: 300px">
<el-option v-for="item in callOutMerchantList"
:key="item.merchantId"
:label="item.merchantName"
:value="item.merchantId" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<br /> <br />
<el-form-item>调入方</el-form-item> <el-form-item>调入方</el-form-item>
<el-form-item label="调入仓库:" <el-form-item label="调入仓库:" prop="callInYqMerchantId">
prop="callInYqMerchantId"> <el-select v-model="editAllocationForm.callInYqMerchantId" @change="changeCallInYqMerchant(editAllocationForm.callInYqMerchantId)" style="width: 300px">
<el-select v-model="editAllocationForm.callInYqMerchantId" <el-option v-for="item in callInYqMerchantList" :key="item.merchantNo" :label="item.merchantName" :value="item.merchantNo" />
@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-select>
</el-form-item> </el-form-item>
<el-form-item label="调入门店:" <el-form-item label="调入门店:" prop="callInMerchantId">
prop="callInMerchantId"> <el-select v-model="editAllocationForm.callInMerchantId" style="width: 300px">
<el-select v-model="editAllocationForm.callInMerchantId" <el-option v-for="item in callInMerchantList" :key="item.merchantId" :label="item.merchantName" :value="item.merchantId" />
style="width: 300px">
<el-option v-for="item in callInMerchantList"
:key="item.merchantId"
:label="item.merchantName"
:value="item.merchantId" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -57,62 +30,31 @@ ...@@ -57,62 +30,31 @@
<div class="d2-container-content"> <div class="d2-container-content">
<div style="padding: 15px 0"> <div style="padding: 15px 0">
<div class="gl-form-min"> <div class="gl-form-min">
<el-form :inline="true" <el-form :inline="true" size="small" :model="editAllocationForm">
size="small"
:model="editAllocationForm">
<el-form-item label=""> <el-form-item label="">
<el-input v-model="searchForm.upgradeGoodsNameOrSeries" <el-input v-model="searchForm.upgradeGoodsNameOrSeries" style="width: 200px" placeholder="请输入商品名称/系列" maxlength="20" clearable />
style="width: 200px"
placeholder="请输入商品名称/系列"
maxlength="20"
clearable />
</el-form-item> </el-form-item>
<el-button @click="handleSearch" <el-button @click="handleSearch" size="small" type="primary" style="marginleft: 15px">查询</el-button>
size="small"
type="primary"
style="marginleft: 15px">查询</el-button>
</el-form> </el-form>
</div> </div>
</div> </div>
<GLTable ref="allocationTable" <GLTable ref="allocationTable" :getListApi="getListApi" :pageConf="pageConf" :searchForm="searchFormSearch" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn">
:getListApi="getListApi" <div slot="auth-button" slot-scope="scope">
:pageConf="pageConf" <el-button type="text" @click="allocation(scope.scope)" :disabled="setDisabled(scope.scope)">选择</el-button>
:searchForm="searchFormSearch"
:tableParams="tableParams"
:beforeSearchFn="beforeSearchFn">
<div slot="auth-button"
slot-scope="scope">
<el-button type="text"
@click="allocation(scope.scope)"
:disabled="setDisabled(scope.scope)">选择</el-button>
</div> </div>
</GLTable> </GLTable>
</div> </div>
<div class="d2-container-content"> <div class="d2-container-content">
<p class="title">调拨确认单</p> <p class="title">调拨确认单</p>
<GLTable ref="allocationTable2" <GLTable ref="allocationTable2" :tableData="chooseDataList" :tableParams="tableParams2" :hasPage="false">
:tableData="chooseDataList" <div slot="auth-button" slot-scope="scope">
:tableParams="tableParams2" <el-button type="text" @click="cancelAllocation(scope.scope, scope.index)">取消</el-button>
:hasPage="false">
<div slot="auth-button"
slot-scope="scope">
<el-button type="text"
@click="cancelAllocation(scope.scope, scope.index)">取消</el-button>
</div> </div>
</GLTable> </GLTable>
</div> </div>
<glsx-form ref="allocationForm" <glsx-form ref="allocationForm" :rules="allocationFormRules" :origin-data="editData" :form-list="editForm" form-ref="inveFormRef" @handleAddConfirm="handleAddConfirm" @handleClose="handleAddClose"></glsx-form>
:rules="allocationFormRules"
:origin-data="editData"
:form-list="editForm"
form-ref="inveFormRef"
@handleAddConfirm="handleAddConfirm"
@handleClose="handleAddClose"></glsx-form>
<!-- 盘点 --> <!-- 盘点 -->
<allocation-num-dialog :allocation-num-visible="allocationNumVisible" <allocation-num-dialog :allocation-num-visible="allocationNumVisible" :allocation-info="allocationInfo" v-if="allocationNumVisible" @dialogClose="dialogClose" />
:allocation-info="allocationInfo"
v-if="allocationNumVisible"
@dialogClose="dialogClose" />
</div> </div>
</template> </template>
......
...@@ -7,14 +7,27 @@ ...@@ -7,14 +7,27 @@
<div> <div>
<GLButton type="primary" plain size="small" @click="handleAdd" fn="创建调拨">创建调拨</GLButton> <GLButton type="primary" plain size="small" @click="handleAdd" fn="创建调拨">创建调拨</GLButton>
<!-- <el-button type="primary" size="small" @click="handleAdd">创建调拨</el-button> --> <!-- <el-button type="primary" size="small" @click="handleAdd">创建调拨</el-button> -->
<el-button size="small" @click="exportExcel">导出</el-button> <el-button size="small" @click="exportExcel">导出</el-button>
</div> </div>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="allocationRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"> <GLTable ref="allocationRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<template slot="billStatus" slot-scope="scope">
<div>
<span :class="billStatusObj[scope.scope.billStatus]?.class || ''"></span>
<span>{{ scope.scope.billStatusName }}</span>
</div>
</template>
<template slot="deliveryStatus" slot-scope="scope">
<div>
<span :class="deliveryStatusObj[scope.scope.deliveryStatus]?.class || ''"></span>
<span>{{ scope.scope.deliveryStatusName }}</span>
</div>
</template>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">查看</el-button> <!-- <el-button type="text" @click="handleDetail(scope.scope)">查看</el-button> -->
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope"></GLTableButton>
</div> </div>
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
...@@ -43,11 +56,61 @@ export default { ...@@ -43,11 +56,61 @@ export default {
callOutYqMerchantId: '', callOutYqMerchantId: '',
callInYqMerchantId: '', callInYqMerchantId: '',
callOutMerchantId: '', callOutMerchantId: '',
callInMerchantId: '' callInMerchantId: '',
billStatusList: '',
deliveryStatus: ''
}, },
tableSearchForm: {}, tableSearchForm: {},
allocationInfo: {}, allocationInfo: {},
allocationDetailVisible: false, 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: '作废'
}
},
deliveryStatusObj: {
1: {
class: 'ashSpot',
name: '待发货'
},
2: {
class: 'greenSpot',
name: '全部发货'
},
3: {
class: 'yellowSpot',
name: '部分发货'
}
},
showFormData: [ showFormData: [
{ {
label: '调拨单号', label: '调拨单号',
...@@ -110,6 +173,24 @@ export default { ...@@ -110,6 +173,24 @@ export default {
optionId: 'merchantId', optionId: 'merchantId',
optionLabel: 'merchantName', optionLabel: 'merchantName',
optionsName: 'inMerchantList' optionsName: 'inMerchantList'
},
{
label: '单据状态',
name: 'billStatusList',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'billStatusList'
},
{
label: '发货状态',
name: 'deliveryStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'deliveryStatusList'
} }
], ],
// 表格 // 表格
...@@ -121,12 +202,23 @@ export default { ...@@ -121,12 +202,23 @@ export default {
{ {
label: '调拨单号', label: '调拨单号',
prop: 'allocateCode', prop: 'allocateCode',
width: 200 width: 111
},
{
label: '单据时间',
prop: 'submitTime',
width: 112
},
{
label: '单据状态',
prop: 'billStatusName',
addHtml: 'billStatus',
width: 130
}, },
{ {
label: '调拨时间', label: '调拨时间',
prop: 'allocateTime', prop: 'allocateTime',
width: 170, width: 112,
formatter: cellValue => { formatter: cellValue => {
return dayjs(cellValue.allocateTime).format('YYYY-MM-DD HH:mm:ss') return dayjs(cellValue.allocateTime).format('YYYY-MM-DD HH:mm:ss')
} }
...@@ -167,19 +259,129 @@ export default { ...@@ -167,19 +259,129 @@ export default {
width: 150 width: 150
}, },
{ {
label: '发货状态',
prop: 'deliveryStatusName',
addHtml: 'deliveryStatus',
width: 130
},
{
label: '备注', label: '备注',
prop: 'remark', prop: 'remark',
width: 200, width: 200,
line: 1 line: 1
},
{
label: '收货人',
prop: 'receiver'
},
{
label: '收货人电话',
prop: 'phone',
width: 130
},
{
label: '收货地址',
prop: 'address',
width: 140
} }
] ]
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
// 表格按钮
tableButtonList: [
{
type: 'GLButton',
name: '编辑',
attrs: {
type: 'text',
fn: '编辑'
},
condition: row => {
return [0].includes(row.billStatus)
},
listeners: {
click: row => this.handleEdit(row)
}
},
{
type: 'GLButton',
name: '提交审核',
attrs: {
type: 'text',
fn: '提交审核'
},
condition: row => {
return [0].includes(row.billStatus)
},
listeners: {
click: row => {
this.$confirm('退货申请单,确认提交申请?', '提交确定', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
console.log(row)
this.updateStatus(row, 2, '提交审核成功')
})
.catch(() => { })
}
}
},
{
type: 'el-button',
name: '查看',
attrs: {
type: 'text'
},
listeners: {
click: row => this.handleDetail(row)
}
},
{
type: 'GLButton',
name: '作废',
attrs: {
type: 'text',
fn: '作废'
},
condition: row => {
return [0].includes(row.billStatus)
},
listeners: {
click: row => {
this.$confirm('作废后无法恢复退货单,是否确认作废?', '退货申请作废确定', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
console.log(row)
this.updateStatus(row, 5, '作废成功')
})
.catch(() => { })
}
}
}
],
// 基本数据 // 基本数据
baseData: { baseData: {
yqRelatedMerchantList: [], yqRelatedMerchantList: [],
outMerchantList: [], //调出门店 outMerchantList: [], //调出门店
inMerchantList: [] //调入门店 inMerchantList: [], //调入门店
billStatusList: [
{ confId: 0, confLabel: '待提交' },
{ confId: 1, confLabel: '运营审核' },
{ confId: 2, confLabel: '商务审核' },
{ confId: '4,6,7', confLabel: '审核驳回' },
{ confId: 5, confLabel: '审核通过' },
{ confId: -1, confLabel: '作废' }
],
deliveryStatusList: [
{ confId: 1, confLabel: '未发货' },
{ confId: 3, confLabel: '部分发货' },
{ confId: 2, confLabel: '全部发货' }
]
}, },
imgVisible: false, imgVisible: false,
previewImgUrl: '' previewImgUrl: ''
...@@ -206,6 +408,17 @@ export default { ...@@ -206,6 +408,17 @@ export default {
params.allocateTimeEnd = new Date(this.searchForm.allocateTime[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59' params.allocateTimeEnd = new Date(this.searchForm.allocateTime[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
} }
delete params.allocateTime delete params.allocateTime
if (this.searchForm.billStatusList !== '' && this.searchForm.billStatusList !== null && this.searchForm.billStatusList !== undefined) {
if (String(this.searchForm.billStatusList).indexOf(',') !== -1) {
params.billStatusList = this.searchForm.billStatusList.split(',').map(item => Number(item))
} else {
params.billStatusList = [Number(this.searchForm.billStatusList)]
}
} else {
delete params.billStatusList
}
return params return params
}, },
beforeSearchFn() { beforeSearchFn() {
...@@ -251,7 +464,21 @@ export default { ...@@ -251,7 +464,21 @@ export default {
console.log(this.allocationDetailVisible) console.log(this.allocationDetailVisible)
}, },
handleAdd() { handleAdd() {
this.$router.push({ path: '/allocation/add' }) this.$router.push({
path: '/allocation/add',
query: {
$title: '创建调拨'
}
})
},
handleEdit(row) {
this.$router.push({
path: '/allocation/add',
query: {
$title: '编辑调拨',
row: row
}
})
}, },
getOptionsList(formName, hasAll = true, refreshSigle) { getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) { if (refreshSigle) {
...@@ -299,7 +526,9 @@ export default { ...@@ -299,7 +526,9 @@ export default {
callOutYqMerchantId: '', callOutYqMerchantId: '',
callInYqMerchantId: '', callInYqMerchantId: '',
callOutMerchantId: '', callOutMerchantId: '',
callInMerchantId: '' callInMerchantId: '',
billStatusList: '',
deliveryStatus: ''
} }
this.showFormData[this.findFormIdx('callOutMerchantId')].optionList = [] this.showFormData[this.findFormIdx('callOutMerchantId')].optionList = []
this.showFormData[this.findFormIdx('callInMerchantId')].optionList = [] this.showFormData[this.findFormIdx('callInMerchantId')].optionList = []
...@@ -338,5 +567,25 @@ export default { ...@@ -338,5 +567,25 @@ export default {
color: #333; color: #333;
} }
} }
.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>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!