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