Commit da0b845d by 前端

Merge branch 'SAAS+V5.5.0' into 'master'

上线合并

See merge request !22
2 parents 0c35c54d 03f6f08b
......@@ -379,7 +379,8 @@ const refundSave = params => {
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
sign: true,
returnAll: true
})
}
......@@ -406,4 +407,29 @@ const refundExport = 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 }
// 退货管理 - 提交审核/作废
const refundUpdateStatus = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path3}stock.refund.updateStatus`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 退货管理 - 获取退货单详情
const refundDetail = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path3}stock.refund.getDetail`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: 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 }
......@@ -50,8 +50,9 @@
v-if="item.type === 'textarea'"
type="textarea"
v-model.trim="formData[item.name]"
:style="{'width': item.width || formItemWidth}"
:placeholder="item.label"
:rows="4"
:rows="item.rows || 4"
:maxlength="item.maxlength"
show-word-limit />
<!-- 选择框 -->
......@@ -384,7 +385,7 @@
</div>
</div>
</div>
<el-form-item style="margin-top: 40px;text-align: center;">
<el-form-item style="margin-top: 40px;text-align: center;" v-if="isShowBtn">
<el-button type="primary"
@click="handleUp"
class="ok-btn">
......@@ -519,6 +520,10 @@ export default {
}
}
},
isShowBtn: {
type: Boolean,
default: true
},
formItemWidth: {
type: String,
default: '100%'
......
......@@ -97,7 +97,7 @@
<div slot="auth-button"
slot-scope="scope">
<el-button type="text"
@click="cancelAllocation(scope.row, scope.$index)">取消</el-button>
@click="cancelAllocation(scope.scope, scope.index)">取消</el-button>
</div>
</GLTable>
</div>
......@@ -271,7 +271,9 @@ export default {
{
name: 'remark',
label: '备注说明',
width: '432px',
type: 'textarea',
rows: 5,
maxlength: 100
}
]
......@@ -526,7 +528,8 @@ export default {
// 取消
cancelAllocation(row, index) {
this.chooseDataList.splice(index, 1)
console.log(row, index)
this.chooseDataList = this.chooseDataList.filter(item => item.id != row.id)
},
handleAddConfirm(data) {
......
<!-- 创建退货 -->
<template>
<div class="addWrap">
<div class="d2-container-content gl-form-min"
style="padding: 10px 20px">
<el-form :inline="true"
size="small"
:model="editRefundForm"
ref="editRefundFormRef"
:rules="formRules"
class="demo-form-inline">
<el-form-item label="退货仓库:"
prop="yqMerchantId">
<el-select v-model="editRefundForm.yqMerchantId"
@change="changeYqMerchant(editRefundForm.yqMerchantId)"
style="width: 300px">
<el-option v-for="item in yqMerchantIdList"
:key="item.merchantNo"
:label="item.merchantName"
:value="item.merchantNo" />
<div class="addWrap" v-loading="loading">
<div class="d2-container-content gl-form-min" style="padding: 10px 20px">
<el-form :inline="true" size="small" :model="editRefundForm" ref="editRefundFormRef" :rules="formRules" class="demo-form-inline">
<el-form-item label="退货仓库:" prop="yqMerchantId">
<el-select v-model="editRefundForm.yqMerchantId" @change="changeYqMerchant(editRefundForm.yqMerchantId)" :disabled="isDisabled" style="width: 300px">
<el-option v-for="item in yqMerchantIdList" :key="item.merchantNo" :label="item.merchantName" :value="item.merchantNo" />
</el-select>
</el-form-item>
<el-form-item label="退货门店:"
prop="merchantId">
<el-select v-model="editRefundForm.merchantId"
@change="changeMerchant(editRefundForm.merchantId)"
style="width: 300px">
<el-option v-for="item in merchantList"
:key="item.merchantId"
:label="item.merchantName"
:value="item.merchantId" />
<el-form-item label="退货门店:" prop="merchantId">
<el-select v-model="editRefundForm.merchantId" @change="changeMerchant(editRefundForm.merchantId)" :disabled="isDisabled" style="width: 300px">
<el-option v-for="item in merchantList" :key="item.merchantId" :label="item.merchantName" :value="item.merchantId" />
</el-select>
</el-form-item>
<el-form-item label="退货类型:"
prop="refundType">
<el-select v-model="editRefundForm.refundType"
style="width: 300px">
<el-option v-for="item in baseData.typeList"
:key="item.confId"
:label="item.confLabel"
:value="item.confId" />
<el-form-item label="退货类型:" prop="refundType">
<el-select v-model="editRefundForm.refundType" style="width: 300px">
<el-option v-for="item in baseData.typeList" :key="item.confId" :label="item.confLabel" :value="item.confId" />
</el-select>
</el-form-item>
</el-form>
</div>
<div class="d2-container-content">
<div class="containerDIV">
<div class="title">退货列表</div>
<div class="right">
<div class="gl-form-min">
<el-form ref="ruleForm"
:model="searchForm"
size="small"
inline="true">
<el-form-item label="退货:">
<el-input v-model="searchForm.upgradeGoodsNameOrSeries"
style="width: 200px"
placeholder="请输入商品名称/系列"
maxlength="20"
clearable />
</el-form-item>
<div>
<div class="containerDIV">
<div class="title">退货列表</div>
<div class="right">
<div class="gl-form-min">
<el-form ref="ruleForm" :model="searchForm" size="small" inline="true">
<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">查询</el-button>
</el-form>
<el-button @click="handleSearch" size="small" type="primary">查询</el-button>
</el-form>
</div>
</div>
</div>
<GLTable ref="recordTable" :getListApi="getListApi" :searchForm="searchFormSearch" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" :pageConf="pageConf">
<div slot="auth-button" slot-scope="scope">
<el-button type="text" @click="refund(scope.scope)" :disabled="setDisabled(scope.scope)">退货</el-button>
</div>
</GLTable>
</div>
<GLTable ref="recordTable"
:getListApi="getListApi"
:searchForm="searchFormSearch"
:tableParams="tableParams"
:beforeSearchFn="beforeSearchFn"
:pageConf="pageConf">
<div slot="auth-button"
slot-scope="scope">
<el-button type="text"
@click="refund(scope.scope)"
:disabled="setDisabled(scope.scope)">退货</el-button>
</div>
</GLTable>
</div>
<div class="d2-container-content">
<p class="title">退货确认单</p>
<GLTable ref="recordTable2"
:tableData="chooseDataList"
:tableParams="tableParams2"
:hasPage="false">
<template slot="profitAndLoss"
slot-scope="scope">
<GLTable ref="recordTable2" :tableData="chooseDataList" :tableParams="tableParams2" :hasPage="false">
<template slot="profitAndLoss" slot-scope="scope">
<span v-if="scope.scope.profitAndLoss || scope.scope.profitAndLoss == 0">
<span v-if="parseFloat(scope.scope.profitAndLoss) > 0"
style="color: blue">{{ '+' + parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span>
<span v-else-if="parseFloat(scope.scope.profitAndLoss) < 0"
style="color: red">{{ parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span>
<span
v-else>{{ parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span>
<span v-if="parseFloat(scope.scope.profitAndLoss) > 0" style="color: blue">{{ '+' + parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span>
<span v-else-if="parseFloat(scope.scope.profitAndLoss) < 0" style="color: red">{{ parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span>
<span v-else>{{ parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span>
</span>
<span v-else>-</span>
</template>
<div slot="auth-button"
slot-scope="scope">
<el-button type="text"
@click="cancelRefund(scope.row, scope.$index)">取消</el-button>
<div slot="auth-button" slot-scope="scope">
<el-button type="text" @click="cancelRefund(scope.scope, scope.index)">取消</el-button>
</div>
</GLTable>
</div>
<glsx-form ref="addRefundForm"
:origin-data="editData"
:form-list="editForm"
form-ref="inveFormRef"
@handleAddConfirm="handleAddConfirm"
@handleClose="handleAddClose"></glsx-form>
<div class="addRefundForm">
<!-- <glsx-form ref="addRefundForm" :origin-data="editData" :form-list="editForm" form-ref="inveFormRef" :isShowBtn="false" @handleAddConfirm="handleAddConfirm" @handleClose="handleAddClose"></glsx-form> -->
<glsx-form ref="addRefundForm" :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" type="primary" plain>
保存
</el-button>
<el-button @click="beforeConfirm('invalid')" class="btn" type="primary" plain v-if="oprType == 'edit'">
作废
</el-button>
<el-button @click="beforeConfirm('review')" type="primary" class="btn">
提交审核
</el-button>
</div>
<!-- 退货 -->
<num-dialog :num-visible="numVisible"
:record-info="recordInfo"
v-if="numVisible"
@dialogClose="dialogClose" />
<num-dialog :num-visible="numVisible" :record-info="recordInfo" v-if="numVisible" @dialogClose="dialogClose" />
</div>
</template>
......@@ -130,6 +90,13 @@ export default {
},
data() {
return {
oprType: 'add',
routeInfo: {},
loading: false,
isDisabled: false,
// 编辑首次进
editFirst: false,
editMerFirst: false,
membraneTypeList: this.$membraneTypeList,
searchForm: {
upgradeGoodsNameOrSeries: ''
......@@ -259,7 +226,8 @@ export default {
},
editData: {
thumbUrlList: []
thumbUrlList: [],
remark: ''
},
editForm: [
{
......@@ -274,13 +242,14 @@ export default {
{
name: 'remark',
label: '备注说明',
width: '432px',
type: 'textarea',
rows: 5,
maxlength: 100
}
]
}
],
numVisible: false,
recordInfo: null,
chooseDataList: [],
......@@ -315,13 +284,31 @@ export default {
yqMerchantIdList: [], //退货仓库
merchantList: [], //退货门店
oldyqMerchantId: '', //之前选择的仓库
oldMerchantId: '' //之前选择的门店
oldMerchantId: '', //之前选择的门店
//保存/作废/提交审核,弹窗提示和状态值适配
btnTypeMap: {
save: {
title: '提示',
confirmMsg: '退货单保存后,系统自动按照退货实际库存进行库存更新;是否确定保存?',
refundStatus: 1
},
invalid: {
title: '退货申请作废确定',
confirmMsg: '作废后无法恢复退货单,是否确认作废?',
refundStatus: 5
},
review: {
title: '提交确定',
confirmMsg: '退货申请单,确认提交申请?',
refundStatus: 2
}
}
}
},
watch: {
'editRefundForm.yqMerchantId'(val, oldval) {
console.log(val, oldval, '监听yqMerchantId')
// console.log(val, oldval, '监听yqMerchantId')
// this.getListApi = this.$apis.stockManage.stockRemainPage
if (this.yqMerchantIdList.length == 1) {
//当只有一个选项时不弹提示框
......@@ -329,31 +316,45 @@ export default {
} else {
if (val != this.oldyqMerchantId) {
//与之前的选项不一样
this.editRefundForm.merchantId = ''
this.switchData(val, oldval, 'yqMerchant')
if (!this.editFirst) {
this.editRefundForm.merchantId = ''
this.switchData(val, oldval, 'yqMerchant')
}
this.editFirst = false
}
}
},
'editRefundForm.merchantId'(val, oldval2) {
console.log(val, oldval2, '监听merchantId')
// console.log(val, oldval2, '监听merchantId')
this.getListApi = this.$apis.stockManage.stockRemainPage
if (this.merchantList.length == 1) {
this.$refs.recordTable.refreshTable()
} else {
if (val != this.oldMerchantId) {
//与之前的选项不一样
this.switchData(val, oldval2, 'merchant')
if (!this.editMerFirst) {
this.switchData(val, oldval2, 'merchant')
}
this.editMerFirst = false
}
}
}
},
mounted() {
this.routeInfo = this.$route.query?.row || {}
if (this.routeInfo?.refundCode) {
this.oprType = 'edit'
this.editFirst = true
this.editMerFirst = true
this.isDisabled = true
this.getDetail()
}
// 获取当前登录账号可见的园区店列表
this.$apis.stockManage.getyqMerchantList({ mainPartnerMerchant: true }).then(res => {
this.yqMerchantIdList = res
if (this.yqMerchantIdList && this.yqMerchantIdList.length == 1) {
if (this.yqMerchantIdList && this.yqMerchantIdList.length == 1 && this.oprType == 'add') {
this.editRefundForm.yqMerchantId = this.yqMerchantIdList[0].merchantNo
this.getServicemerchantrefList(this.editRefundForm.yqMerchantId)
}
......@@ -369,6 +370,37 @@ export default {
// this.switchData(merchantId, 'merchant')
},
getDetail() {
this.$apis.stockManage
.refundDetail({
refundCode: this.routeInfo.refundCode
})
.then(res => {
this.editRefundForm = res
this.editRefundForm.yqMerchantId = this.editRefundForm.yqMerchantId + ''
this.chooseDataList = res.stockRefundDetailList
this.getListApi = this.$apis.stockManage.stockRemainPage
this.$refs.recordTable.refreshTable()
this.chooseDataList.forEach((item, idx) => {
this.chooseDataList[idx].id = item.merchantShopGoodsStockPageResponse.id
this.chooseDataList[idx].productCode = item.merchantShopGoodsStockPageResponse.productCode
this.chooseDataList[idx].yqMerchantId = item.merchantShopGoodsStockPageResponse.yqMerchantId
this.chooseDataList[idx].yqMerchantName = item.merchantShopGoodsStockPageResponse.yqMerchantName
this.chooseDataList[idx].merchantId = item.merchantShopGoodsStockPageResponse.merchantId
this.chooseDataList[idx].merchantName = item.merchantShopGoodsStockPageResponse.merchantName
this.chooseDataList[idx].filmRollNo = item.merchantShopGoodsStockPageResponse.filmRollNo
this.chooseDataList[idx].stock = item.merchantShopGoodsStockPageResponse.stock
this.setDisabled(item)
})
if (res.voucherPic) {
this.editData.thumbUrlList = [{ content: res.voucherPic }]
}
this.editData.remark = res.remark || ''
console.log(this.editData, 'this.editData')
this.getServicemerchantrefList(this.editRefundForm.yqMerchantId)
})
},
// 获取仓库门店
getServicemerchantrefList(merchantId) {
this.$apis.stockManage
......@@ -378,11 +410,11 @@ export default {
.then(res => {
this.merchantList = res || []
//总店
let _headOffice = this.yqMerchantIdList.find(item => item.merchantNo === merchantId)
_headOffice.merchantId = _headOffice.merchantNo
let _headOffice = this.yqMerchantIdList.find(item => item.merchantNo === merchantId) || {}
_headOffice.merchantId = _headOffice?.merchantNo
//门店选项中加入总店
this.merchantList.push(_headOffice)
if (this.merchantList && this.merchantList.length == 1) {
if (this.merchantList && this.merchantList.length == 1 && this.oprType == 'add') {
this.editRefundForm.merchantId = this.merchantList[0].merchantId
}
})
......@@ -500,10 +532,17 @@ export default {
// 取消
cancelRefund(row, index) {
this.chooseDataList.splice(index, 1)
console.log(row, index)
this.chooseDataList = this.chooseDataList.filter(item => item.id != row.id)
},
handleAddConfirm(data) {
/** 保存/作废/提交申请之前,表单校验等
* 按钮类型 - 单据状态
* 保存按钮(save) - 1:待提交
* 提交审核按钮(review) - 2:待总部审核
* 作废按钮(invalid) - 5:作废
**/
beforeConfirm(btnType = 'save') {
this.$refs.editRefundFormRef.validate(valid => {
if (valid) {
if (this.chooseDataList.length == 0) {
......@@ -513,39 +552,73 @@ export default {
})
return
}
const data = this.$refs.addRefundForm.formData
console.log(data)
var params = {}
params.stockRefundDetailList = this.chooseDataList
if (data.thumbUrlList.length > 0) {
params.voucherPic = data.thumbUrlList[0].content
}
if (data.remark) {
params.remark = data.remark
}
params = {
...params,
...this.editRefundForm
}
this.$confirm('退货单保存后,系统自动按照退货实际库存进行库存更新;是否确定保存?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$apis.stockManage.refundSave(params).then(res => {
this.$notify({
type: 'success',
title: res.message || '操作成功'
})
this.handleAddClose()
})
})
.catch(err => {
console.log(err)
})
params.stockRefundDetailList = this.chooseDataList
params.voucherPic = data.thumbUrlList.length > 0 ? data.thumbUrlList[0].content : ''
params.remark = data.remark || ''
console.log(params, 'params')
// 调不同按钮的方法
this.handleConfirm(params, btnType)
}
})
},
/** 保存/作废/审核提交,弹窗提示不一样
* 按钮类型 - 单据状态
* 保存按钮(save) - 创建 - 1:待提交;编辑 - 传详情里面的refundStatus状态
* 提交审核按钮(review) - 2:待总部审核
* 作废按钮(invalid) - 5:作废
**/
handleConfirm(params, btnType = 'save') {
if (this.loading) {
return true
}
const tipTxtObj = {
save: '单据保存成功',
review: '提交审核成功',
invalid: '作废成功'
}
const btnObj = this.btnTypeMap[btnType]
// eslint-disable-next-line prettier/prettier
params.refundStatus = (this.oprType == 'edit' && btnType == 'save') ? this.editRefundForm.refundStatus : btnObj.refundStatus
this.$confirm(btnObj.confirmMsg, btnObj.title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.loading = true
this.$apis.stockManage.refundSave(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.refundCode = res.data.refundCode
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)
}
......@@ -584,4 +657,21 @@ export default {
/* align-items: flex-start; */
/* width: 100%; */
}
/deep/.d2-container-content {
padding-top: 0px;
}
.addRefundForm {
/deep/.d2-container-content {
padding: 0px;
}
/deep/.d2-form .d2-form-block {
border-bottom: none !important;
padding: 20px 0px 0px;
}
}
.btn {
height: 32px;
border-radius: 4px;
padding: 7.5px 18px;
}
</style>
const refundStatusList = [
{
confId: 1,
confLabel: '待提交'
},
{
confId: 2,
confLabel: '待总部审核'
},
{
confId: 3,
confLabel: '驳回待提交'
},
{
confId: 4,
confLabel: '总部审核通过'
},
{
confId: 5,
confLabel: '作废'
}
]
export default {
refundStatusList
}
<!-- 退货详情弹窗弹窗 -->
<template>
<GLDialog bigTitle="详细信息"
width="1500px"
:visible.sync="detailVisible"
:hasFooter="false"
:before-close="handleClose"
class="detailDailog"
mode="big"
okText="关闭"
@onCancel="handleClose"
@onOk="handleClose">
<GLDialog bigTitle="详细信息" width="1500px" :visible.sync="detailVisible" :hasFooter="false" :before-close="handleClose" class="detailDailog" mode="big" okText="关闭" @onCancel="handleClose" @onOk="handleClose">
<div>
<div class="header"
slot="header"
style="padding: 10px 20px">
<div>
单据状态:
<span :class="refundClassName()" />
{{ baseData.refundStatusList.find(item => item.confId == recordInfo.refundStatus)?.confLabel || '-' }}
</div>
<div class="header" slot="header" style="padding: 10px 20px">
<!-- <GLCombiForm ref="showSearch"
class="show-search"
:search-form="searchForm"
......@@ -21,20 +15,12 @@
:form-data="showFormData"></GLCombiForm> -->
</div>
<div class="d2-container-content">
<GLTable ref="recordTable"
:getListApi="getListApi"
:searchForm="searchFormSearch"
:tableParams="tableParams"
:beforeSearchFn="beforeSearchFn">
<template slot="profitAndLoss"
slot-scope="scope">
<GLTable ref="recordTable" :getListApi="getListApi" :searchForm="searchFormSearch" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn">
<template slot="profitAndLoss" slot-scope="scope">
<span v-if="scope.scope.profitAndLoss || scope.scope.profitAndLoss == 0">
<span v-if="parseFloat(scope.scope.profitAndLoss) > 0"
style="color: blue">{{ '+' + parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span>
<span v-else-if="parseFloat(scope.scope.profitAndLoss) < 0"
style="color: red">{{ parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span>
<span
v-else>{{ parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span>
<span v-if="parseFloat(scope.scope.profitAndLoss) > 0" style="color: blue">{{ '+' + parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span>
<span v-else-if="parseFloat(scope.scope.profitAndLoss) < 0" style="color: red">{{ parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span>
<span v-else>{{ parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span>
</span>
<span v-else>-</span>
</template>
......@@ -46,6 +32,7 @@
<script>
// import { membraneTypeList } from '@/utils/constants.js'
import constData from './constant/data.js'
export default {
name: 'DetailDialog',
data() {
......@@ -110,7 +97,9 @@ export default {
}
]
},
baseData: {}
baseData: {
refundStatusList: constData.refundStatusList
}
}
},
......@@ -137,13 +126,24 @@ export default {
})
},
refundClassName() {
console.log(this.recordInfo.refundStatus)
return {
1: 'yellowSpot',
2: 'yellowSpot',
3: 'redSpot',
4: 'greenSpot',
5: 'ashSpot'
}[this.recordInfo.refundStatus]
},
handleClose() {
this.$emit('dialogClose')
}
}
}
</script>
<style scoped>
<style scoped lang="scss">
.count-txt {
font-weight: 700;
color: #2a58ad;
......@@ -154,4 +154,30 @@ export default {
margin-top: 20vh !important;
min-width: 700px;
}
@mixin spotBase {
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 5px;
display: inline-block;
}
.ashSpot {
@include spotBase();
background: #c6c8cc;
}
.greenSpot {
@include spotBase();
background: #2cca74;
}
.yellowSpot {
@include spotBase();
background: #fdb757;
}
.redSpot {
@include spotBase();
background: #eb4e4e;
}
</style>
<template>
<div class="purchase">
<div class="container">
<GLCombiForm ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="showFormData"
@handleOk="handleSearch"
@handleRest="handleReset"></GLCombiForm>
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="table-header">
<h2>退货列表</h2>
<div>
<GLButton type="primary"
plain
size="small"
@click="handleAdd"
fn="创建退货">创建退货</GLButton>
<el-button size="small"
@click="exportExcel">导出</el-button>
<GLButton type="primary" plain size="small" @click="handleAdd" fn="创建退货">创建退货</GLButton>
<el-button size="small" @click="exportExcel">导出</el-button>
</div>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="checkRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun">
<div slot="img"
slot-scope="scope"
v-if="scope.scope.voucherPic">
<img class="img-36"
:src="scope.scope.voucherPic"
@click="handleEnlargeImg(scope.scope.voucherPic)" />
<GLTable ref="checkRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<template slot="refundStatus" slot-scope="scope">
<div>
<span :class="tableParams.tableColumns[refundStatusIdx].className(scope.scope)" />
<span>{{ tableParams.tableColumns[refundStatusIdx].formatter(scope.scope) }}</span>
</div>
</template>
<div slot="img" slot-scope="scope" v-if="scope.scope.voucherPic">
<img class="img-36" :src="scope.scope.voucherPic" @click="handleEnlargeImg(scope.scope.voucherPic)" />
</div>
<div class="table-btns"
slot="auth-button"
slot-scope="scope">
<el-button type="text"
@click="handleDetail(scope.scope)">查看</el-button>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<!-- <el-button type="text" @click="handleDetail(scope.scope)">查看</el-button> -->
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope"></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<!-- 预览图片 -->
<el-dialog :visible="imgVisible"
:before-close="handleCloseImg">
<img width="100%"
:src="previewImgUrl"
alt="图片" />
<el-dialog :visible="imgVisible" :before-close="handleCloseImg">
<img width="100%" :src="previewImgUrl" alt="图片" />
</el-dialog>
<!-- 查看 -->
<detailDialog :detail-visible="detailVisible"
:recordInfo="recordInfo"
v-if="detailVisible"
@dialogClose="dialogClose" />
<detailDialog :detail-visible="detailVisible" :recordInfo="recordInfo" v-if="detailVisible" @dialogClose="dialogClose" />
</div>
</template>
......@@ -64,6 +41,7 @@
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
// import { membraneTypeList } from '@/utils/constants.js'
import constData from './constant/data.js'
import detailDialog from './detailDialog'
export default {
name: 'warehousing',
......@@ -79,7 +57,8 @@ export default {
refundTime: '',
refundCode: '',
yqMerchantId: '',
merchantId: ''
merchantId: '',
refundStatus: ''
},
tableSearchForm: {},
recordInfo: {},
......@@ -122,6 +101,15 @@ export default {
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'merchantIdList'
},
{
label: '单据状态',
name: 'refundStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'refundStatusList'
}
],
// 表格
......@@ -132,11 +120,13 @@ export default {
tableColumns: [
{
label: '退货单号',
prop: 'refundCode'
prop: 'refundCode',
width: 180
},
{
label: '退货时间',
prop: 'refundTime',
width: 180,
formatter: cellValue => {
return dayjs(cellValue.refundTime).format('YYYY-MM-DD HH:mm:ss')
}
......@@ -161,6 +151,24 @@ export default {
prop: 'merchantName'
},
{
label: '单据状态',
prop: 'refundStatus',
width: 150,
addHtml: 'refundStatus',
formatter: cellValue => {
return this.baseData.refundStatusList.find(item => item.confId === cellValue.refundStatus)?.confLabel || '-'
},
className: cellValue => {
return {
1: 'yellowSpot',
2: 'yellowSpot',
3: 'redSpot',
4: 'greenSpot',
5: 'ashSpot'
}[cellValue.refundStatus]
}
},
{
label: '备注',
prop: 'remark',
width: 200,
......@@ -173,7 +181,85 @@ export default {
}
]
},
refundStatusIdx: 6,
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
// 表格按钮
tableButtonList: [
{
type: 'el-button',
name: '查看',
attrs: {
type: 'text'
},
listeners: {
click: row => this.handleDetail(row)
}
},
{
type: 'GLButton',
name: '提交审核',
attrs: {
type: 'text',
fn: '提交审核'
},
condition: row => {
return [1, 3].includes(row.refundStatus)
},
listeners: {
click: row => {
this.$confirm('退货申请单,确认提交申请?', '提交确定', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
console.log(row)
this.updateStatus(row, 2, '提交审核成功')
})
.catch(() => { })
}
}
},
{
type: 'GLButton',
name: '编辑',
attrs: {
type: 'text',
fn: '编辑'
},
condition: row => {
return [1, 3].includes(row.refundStatus)
},
listeners: {
click: row => this.handleEdit(row)
}
},
{
type: 'GLButton',
name: '作废',
attrs: {
type: 'text',
fn: '作废'
},
condition: row => {
return [1, 3].includes(row.refundStatus)
},
listeners: {
click: row => {
this.$confirm('作废后无法恢复退货单,是否确认作废?', '退货申请作废确定', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
console.log(row)
this.updateStatus(row, 5, '作废成功')
})
.catch(() => { })
}
}
}
],
// 基本数据
baseData: {
yqMerchantList: [],
......@@ -187,13 +273,18 @@ export default {
confId: 2,
confLabel: '呆滞退货'
}
]
],
refundStatusList: constData.refundStatusList
},
imgVisible: false,
previewImgUrl: ''
}
},
created() {
this.refundStatusIdx = this.tableParams.tableColumns.findIndex(item => item.prop === 'refundStatus')
},
mounted() {
// 获取当前登录账号可见的园区店列表
this.$apis.stockManage.getyqMerchantList({ mainPartnerMerchant: true }).then(res => {
......@@ -243,8 +334,37 @@ export default {
this.recordInfo = row
this.detailVisible = true
},
updateStatus(row, refundStatus, okMessage = '提交成功') {
this.$apis.stockManage
.refundUpdateStatus({
id: row.id,
refundStatus
})
.then(res => {
this.$notify({
message: res.code == '0' ? okMessage : res.message,
type: res.code == '0' ? 'success' : 'error'
})
this.$refs.checkRef.refreshTable()
})
},
handleAdd() {
this.$router.push({ path: '/sendBack/add' })
this.$router.push({
path: '/sendBack/add',
query: {
$title: '创建退货'
}
})
},
handleEdit(row) {
this.$router.push({
path: '/sendBack/add',
query: {
$title: '编辑退货',
row: row
}
})
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
......@@ -290,7 +410,8 @@ export default {
refundTime: '',
refundCode: '',
yqMerchantId: '',
merchantId: ''
merchantId: '',
refundStatus: ''
}
this.showFormData[this.findFormIdx('merchantId')].optionList = []
this.handleSearch()
......@@ -331,4 +452,30 @@ export default {
}
}
}
@mixin spotBase {
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 5px;
display: inline-block;
}
.ashSpot {
@include spotBase();
background: #c6c8cc;
}
.greenSpot {
@include spotBase();
background: #2cca74;
}
.yellowSpot {
@include spotBase();
background: #fdb757;
}
.redSpot {
@include spotBase();
background: #eb4e4e;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!