Commit f66b2779 by chenwq

feat(退货管理): 新增退货审核功能及相关页面

- 添加审核页面及路由配置
- 实现审核通过/驳回功能
- 完善退货详情页审批记录展示
- 新增状态常量定义文件
- 扩展API接口支持审核操作
1 parent 30574b45
...@@ -145,12 +145,24 @@ export function technicianUpdate(data) { ...@@ -145,12 +145,24 @@ export function technicianUpdate(data) {
// 分页查询退货单列表 // 分页查询退货单列表
export function stockRefundPage(data) { export function stockRefundPage(data) {
data.method = 'dj.smartcarlife.api.stock.refund.page' data.method = "dj.smartcarlife.api.stock.refund.page"
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 分页查询退货单详细信息 // 分页查询退货单详细信息
export function stockRefundDetailPage(data) { export function stockRefundDetailPage(data) {
data.method = 'dj.smartcarlife.api.stock.refund.detail.page' data.method = "dj.smartcarlife.api.stock.refund.detail.page"
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
}
\ No newline at end of file \ No newline at end of file
}
// 退货管理 - 退货详情 - 退货单详情
export function stockRefundDetail(data) {
data.method = "dj.smartcarlife.api.stock.refund.getDetail"
return request(data, RequestMethods.POST)
}
// 退货管理 - 审核
export function stockRefundUpdateStatus(data) {
data.method = "dj.smartcarlife.api.stock.refund.updateStatus"
return request(data, RequestMethods.POST)
}
...@@ -284,8 +284,33 @@ export const routerName = { ...@@ -284,8 +284,33 @@ export const routerName = {
parentId: "90808", parentId: "90808",
label: "查看", label: "查看",
handle: "look" handle: "look"
},
{
authId: "9080803",
parentId: "90808",
label: "审核",
handle: "handleReview",
addRoutePath: [
{
authId: "908080301",
name: "审核",
parentId: "90808"
}
]
} }
], ],
component: _import("stockManage/returnManage/index") component: _import("stockManage/returnManage/index")
}, },
908080301: {
path: "/returnManage/reviewPage",
name: "reviewPage",
meta: {
title: "审核",
authId: "908080301",
parentId: "90808",
cache: false,
activePath: "/returnManage"
},
component: _import("stockManage/returnManage/reviewPage")
}
} }
const refundStatusList = [
{ confId: 2, confLabel: "待审批" },
{ confId: 4, confLabel: "审批成功" },
{ confId: 3, confLabel: "已驳回" }
]
export default {
refundStatusList
}
...@@ -2,29 +2,13 @@ ...@@ -2,29 +2,13 @@
<template> <template>
<div> <div>
<d2-container> <d2-container>
<div <div class="header" slot="header" style="padding: 10px 20px">
class="header" <d2-search ref="showSearch" class="show-search" :search-form="searchForm" :form-data="showFormData" />
slot="header"
style="padding: 10px 20px"
>
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData"
/>
<div class="up-btns"> <div class="up-btns">
<el-button <el-button :id="tableParams.btnId" size="small" type="primary">
:id="tableParams.btnId"
size="small"
type="primary"
>
查询 查询
</el-button> </el-button>
<el-button <el-button size="small" @click="handleReset"> 重置 </el-button>
size="small"
@click="handleReset"
> 重置 </el-button>
</div> </div>
</div> </div>
<div class="d2-container-content"> <div class="d2-container-content">
...@@ -34,54 +18,30 @@ ...@@ -34,54 +18,30 @@
<auth-button category="Button" <auth-button category="Button"
:show-btn-ids="['9080401']" /> :show-btn-ids="['9080401']" />
</span> --> </span> -->
<auth-button <auth-button category="Button" :show-btn-ids="['9080801']" />
category="Button"
:show-btn-ids="['9080801']"
/>
</d2-table-header> </d2-table-header>
<d2-table <d2-table ref="recordTable" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams" :before-search-fn="beforeSearchFn">
ref="recordTable" <div slot="img" slot-scope="scope" v-if="scope.scope.voucherPic">
:get-list-api="getListApi" <img class="pro-img" :src="scope.scope.voucherPic" @click="handleEnlargeImg(scope.scope.voucherPic)" />
:search-form="searchFormSearch" </div>
:table-params="tableParams" <div slot="auth-button" slot-scope="scope">
:before-search-fn="beforeSearchFn" <!-- 查看 -->
> <span>
<div <auth-button :data="scope.scope" :show-btn-ids="['9080802']" />
slot="img" </span>
slot-scope="scope" <!-- 审核 -->
v-if="scope.scope.voucherPic" <span style="margin-left: 10px" v-if="scope.scope.refundStatus == '2'">
> <auth-button :data="scope.scope" :show-btn-ids="['9080803']" />
<img </span>
class="pro-img"
:src="scope.scope.voucherPic"
@click="handleEnlargeImg(scope.scope.voucherPic)"
/>
</div> </div>
<auth-button
slot="auth-button"
slot-scope="scope"
:data="scope.scope"
/>
</d2-table> </d2-table>
</div> </div>
</d2-container> </d2-container>
<!-- 查看 --> <!-- 查看 -->
<return-detail-dialog <return-detail-dialog :inventory-detail-visible="inventoryDetailVisible" :record-info="recordInfo" v-if="inventoryDetailVisible" @dialogClose="dialogClose" />
:inventory-detail-visible="inventoryDetailVisible"
:record-info="recordInfo"
v-if="inventoryDetailVisible"
@dialogClose="dialogClose"
/>
<!-- 预览图片 --> <!-- 预览图片 -->
<el-dialog <el-dialog :visible="imgVisible" :before-close="handleCloseImg">
:visible="imgVisible" <img width="100%" :src="previewImgUrl" alt="图片" />
:before-close="handleCloseImg"
>
<img
width="100%"
:src="previewImgUrl"
alt="图片"
/>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -90,6 +50,7 @@ ...@@ -90,6 +50,7 @@
import { Util, deepClone } from "@/common/util" import { Util, deepClone } from "@/common/util"
import { mapActions, mapState } from "vuex" import { mapActions, mapState } from "vuex"
import { getProductTypeBySceneId } from "@api/product" import { getProductTypeBySceneId } from "@api/product"
import constant from "./constant/data"
import { import {
getyqMerchantList, getyqMerchantList,
stockRefundPage, stockRefundPage,
...@@ -101,12 +62,15 @@ export default { ...@@ -101,12 +62,15 @@ export default {
components: { components: {
returnDetailDialog returnDetailDialog
}, },
data () { data() {
return { return {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
searchForm: { searchForm: {
fromDj: true,
refundTime: "", refundTime: "",
refundCode: "", refundCode: "",
reviewTime: "",
refundStatus: "",
yqMerchantId: "", yqMerchantId: "",
merchantId: "" merchantId: ""
}, },
...@@ -157,6 +121,22 @@ export default { ...@@ -157,6 +121,22 @@ 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"
},
{
label: "审核时间",
name: "reviewTime",
type: "datePicker",
isClear: true,
pickerOptions: "rangePickerOptions"
} }
], ],
getListApi: stockRefundPage, getListApi: stockRefundPage,
...@@ -205,6 +185,31 @@ export default { ...@@ -205,6 +185,31 @@ export default {
prop: "merchantName" prop: "merchantName"
}, },
{ {
label: "审核时间",
prop: "reviewTime",
width: "150px",
formatter: (cellValue) => {
return cellValue.reviewTime
? Util.dateFormate(cellValue.reviewTime, "YYYY-MM-DD HH:mm:ss")
: "-"
}
},
{
label: "单据状态",
prop: "refundStatus",
width: "150px",
formatter: (cellValue) => {
return this.baseData.refundStatusList.find(item => item.confId === cellValue.refundStatus)?.confLabel || '-'
},
className: (cellValue) => {
return {
2: 'yellowSpot',
3: 'redSpot',
4: 'greenSpot'
}[cellValue.refundStatus]
}
},
{
label: "备注", label: "备注",
prop: "remark" prop: "remark"
}, },
...@@ -219,7 +224,8 @@ export default { ...@@ -219,7 +224,8 @@ export default {
baseData: { baseData: {
productTypeList: [], productTypeList: [],
yqMerchantList: [], yqMerchantList: [],
merchantIdList: [] merchantIdList: [],
refundStatusList: constant.refundStatusList
}, },
inventoryDetailVisible: false, inventoryDetailVisible: false,
...@@ -233,7 +239,7 @@ export default { ...@@ -233,7 +239,7 @@ export default {
dowloadList: (state) => state.d2admin.user.dowloadList dowloadList: (state) => state.d2admin.user.dowloadList
}) })
}, },
mounted () { mounted() {
// this.getBaseData() // this.getBaseData()
// 获取全部类目 // 获取全部类目
getProductTypeBySceneId({ sceneType: "" }).then((res) => { getProductTypeBySceneId({ sceneType: "" }).then((res) => {
...@@ -259,7 +265,7 @@ export default { ...@@ -259,7 +265,7 @@ export default {
// this.getOptionsList() // this.getOptionsList()
// }, // },
beforeSearchFn () { beforeSearchFn() {
return new Promise((resolve) => { return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.searchForm) this.searchFormSearch = deepClone(this.searchForm)
if (this.searchFormSearch.refundTime) { if (this.searchFormSearch.refundTime) {
...@@ -271,12 +277,22 @@ export default { ...@@ -271,12 +277,22 @@ export default {
Util.dateFormate(this.searchFormSearch.refundTime[1], "YYYY-MM-DD") + Util.dateFormate(this.searchFormSearch.refundTime[1], "YYYY-MM-DD") +
" 23:59:59" " 23:59:59"
} }
if (this.searchFormSearch.reviewTime) {
this.searchFormSearch.reviewTimeStart = Util.dateFormate(
this.searchFormSearch.reviewTime[0],
"YYYY-MM-DD"
) + " 00:00:00"
this.searchFormSearch.reviewTimeEnd =
Util.dateFormate(this.searchFormSearch.reviewTime[1], "YYYY-MM-DD") +
" 23:59:59"
}
delete this.searchFormSearch.refundTime delete this.searchFormSearch.refundTime
delete this.searchFormSearch.reviewTime
resolve() resolve()
}) })
}, },
getOptionsList () { getOptionsList() {
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === "select") { if (item.type === "select") {
if ( if (
...@@ -300,7 +316,7 @@ export default { ...@@ -300,7 +316,7 @@ export default {
}, },
// 获取仓库门店 // 获取仓库门店
getServicemerchantrefList (merchantId) { getServicemerchantrefList(merchantId) {
getServicemerchantrefList({ getServicemerchantrefList({
yqMerchantId: merchantId yqMerchantId: merchantId
}).then((res) => { }).then((res) => {
...@@ -319,10 +335,13 @@ export default { ...@@ -319,10 +335,13 @@ export default {
// handleSearch() { // handleSearch() {
// this.$refs.recordTable.refreshTable() // this.$refs.recordTable.refreshTable()
// }, // },
handleReset () { handleReset() {
this.searchForm = { this.searchForm = {
fromDj: true,
refundTime: "", refundTime: "",
refundCode: "", refundCode: "",
reviewTime: "",
refundStatus: "",
yqMerchantId: "", yqMerchantId: "",
merchantId: "" merchantId: ""
} }
...@@ -331,8 +350,7 @@ export default { ...@@ -331,8 +350,7 @@ export default {
this.$refs.recordTable.refreshTable() this.$refs.recordTable.refreshTable()
}, },
async handleExport() {
async handleExport () {
await this.beforeSearchFn() await this.beforeSearchFn()
var params = this.searchFormSearch var params = this.searchFormSearch
params.method = "dj.smartcarlife.api.stock.refund.export.async" params.method = "dj.smartcarlife.api.stock.refund.export.async"
...@@ -349,23 +367,34 @@ export default { ...@@ -349,23 +367,34 @@ export default {
}, },
// 查看 // 查看
look (row) { look(row) {
this.recordInfo = row this.recordInfo = row
this.inventoryDetailVisible = true this.inventoryDetailVisible = true
}, },
dialogClose (flag) { // 审核
handleReview(row) {
this.$router.push({
name: "reviewPage",
query: {
refundCode: row?.refundCode || '',
id: row?.id || ''
}
})
},
dialogClose(flag) {
this.inventoryDetailVisible = !this.inventoryDetailVisible this.inventoryDetailVisible = !this.inventoryDetailVisible
}, },
handleEnlargeImg (url) { handleEnlargeImg(url) {
if (url) { if (url) {
this.previewImgUrl = url this.previewImgUrl = url
this.imgVisible = !this.imgVisible this.imgVisible = !this.imgVisible
} }
}, },
handleCloseImg () { handleCloseImg() {
this.imgVisible = !this.imgVisible this.imgVisible = !this.imgVisible
} }
} }
......
<!-- 退货详情弹窗弹窗 --> <!-- 退货详情弹窗弹窗 -->
<template> <template>
<d2-dialog title="详细信息" :is-visible="inventoryDetailVisible" class="inventoryDetailDailog" width="70%" :no-cancel="true" <d2-dialog title="详细信息" :is-visible="inventoryDetailVisible" class="inventoryDetailDailog" width="1080px" :no-cancel="true" btn-ok-label="关闭" @closeDialog="handleClose" @confirmDialog="handleClose">
btn-ok-label="关闭" @closeDialog="handleClose" @confirmDialog="handleClose">
<div> <div>
<div class="header" slot="header" style="padding: 10px 20px;"> <div class="title-box">退货信息
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :search-select-obj="searchSelectObj" <div class="title-txt">单据状态:
:form-data="showFormData" /> <span :class="refundClassName()" />
{{ getStatus() }}
</div>
</div>
<div class="header" slot="header">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :search-select-obj="searchSelectObj" :form-data="showFormData" />
</div> </div>
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table ref="recordTable" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams" <d2-table ref="recordTable" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams" :before-search-fn="beforeSearchFn">
:before-search-fn="beforeSearchFn">
<template slot="profitAndLoss" slot-scope="scope"> <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" style="color:blue">{{ '+' + <span v-if="parseFloat(scope.scope.profitAndLoss) > 0" style="color:blue">{{ '+' +
...@@ -25,6 +28,38 @@ ...@@ -25,6 +28,38 @@
</template> </template>
</d2-table> </d2-table>
</div> </div>
<div class="title-box" style="margin-top: 20px;">审批记录</div>
<div class="examine-record">
<div class="record-div" v-if="logList && logList.length">
<div class="record-div-d" v-for="(item, index) in logList" :key="index">
<span class="dot"></span>
<span class="span-txt-one">
{{ item.afterStatus == 4 ? '成功' : '驳回' }}
</span>
<span class="span-txt-two reviewer ellipsis">审核人:
<el-tooltip class="item" popper-class="remark-popper-class" effect="dark" :content="item.createdBy" placement="bottom">
<el-button type="text" class="one-line-ellipsis" style="width: 76px; color: #333333;">
{{ item.createdBy }}
</el-button>
</el-tooltip>
</span>
<span class="span-txt-two">审核时间:{{ item.createdDateFormat }}</span>
<span class="span-txt-two">{{ item.afterStatus == 3 ? '驳回原因:' : '备注:' }}
<el-tooltip v-if="item.remark" class="item" popper-class="remark-popper-class" effect="dark" :content="item.remark" placement="bottom">
<el-button type="text" style="color: #333333;">
{{ item.remark ? (item.remark.length > 30 ? (item.remark.slice(0, 30) + '...') : item.remark) : '-' }}
</el-button>
</el-tooltip>
<span v-else>-</span>
</span>
</div>
</div>
<div class="emptyCom" v-else>
<img :src="emptyImgUrl" class="emptyImg" alt="">
<span class="tips">暂无数据</span>
</div>
</div>
</div> </div>
</d2-dialog> </d2-dialog>
</template> </template>
...@@ -32,7 +67,8 @@ ...@@ -32,7 +67,8 @@
<script> <script>
import { Util, deepClone } from '@/common/util' import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { stockRefundDetailPage } from '@api/stockManage' import { stockRefundDetailPage, stockRefundDetail } from '@api/stockManage'
import constant from "./constant/data"
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
export default { export default {
name: 'InventoryDetailDialog', name: 'InventoryDetailDialog',
...@@ -63,7 +99,7 @@ export default { ...@@ -63,7 +99,7 @@ export default {
label: '规格', label: '规格',
prop: 'specificationData', prop: 'specificationData',
width: '160px' width: '160px'
},{ }, {
label: '商品编码', label: '商品编码',
prop: 'type', prop: 'type',
width: '250px' width: '250px'
...@@ -85,7 +121,7 @@ export default { ...@@ -85,7 +121,7 @@ export default {
formatter: (cellValue) => { formatter: (cellValue) => {
return (cellValue.refundStock || cellValue.refundStock == 0) ? parseFloat(cellValue.refundStock).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-' return (cellValue.refundStock || cellValue.refundStock == 0) ? parseFloat(cellValue.refundStock).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
} }
}, { }, {
label: '膜卷号', label: '膜卷号',
prop: 'filmRollNo', prop: 'filmRollNo',
formatter: (cellValue) => { formatter: (cellValue) => {
...@@ -93,8 +129,10 @@ export default { ...@@ -93,8 +129,10 @@ export default {
} }
}] }]
}, },
emptyImgUrl: require("@/assets/empty-5.png"),
logList: [],
baseData: { baseData: {
refundStatusList: constant.refundStatusList
} }
} }
}, },
...@@ -114,6 +152,7 @@ export default { ...@@ -114,6 +152,7 @@ export default {
}, },
mounted() { mounted() {
this.getDetail()
}, },
methods: { methods: {
...@@ -122,6 +161,24 @@ export default { ...@@ -122,6 +161,24 @@ export default {
close: 'd2admin/page/close' close: 'd2admin/page/close'
}), }),
getDetail() {
stockRefundDetail({
refundCode: this.recordInfo.refundCode
}).then((res) => {
console.log(res)
this.logList = res.logList || []
if (this.logList && this.logList.length > 0) {
this.logList = this.logList.map(item => {
item.createdDateFormat = item.createdDate
? Util.dateFormate(item.createdDate, 'YYYY-MM-DD HH:mm:ss')
: ""
return item
})
console.log(this.logList, 'logList')
}
})
},
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.searchForm.refundCode = this.recordInfo.refundCode this.searchForm.refundCode = this.recordInfo.refundCode
...@@ -130,6 +187,18 @@ export default { ...@@ -130,6 +187,18 @@ export default {
}) })
}, },
refundClassName() {
return {
2: 'yellowSpot',
3: 'redSpot',
4: 'greenSpot'
}[this.recordInfo.refundStatus]
},
getStatus() {
return this.baseData.refundStatusList.find(item => item.confId == this.recordInfo.refundStatus)?.confLabel || '-'
},
handleClose() { handleClose() {
this.$emit('dialogClose') this.$emit('dialogClose')
} }
...@@ -138,7 +207,10 @@ export default { ...@@ -138,7 +207,10 @@ export default {
} }
</script> </script>
<style scoped> <style scoped lang="scss">
::v-deep .el-dialog__body {
padding: 0 20px;
}
.count-txt { .count-txt {
font-weight: 700; font-weight: 700;
color: #2a58ad; color: #2a58ad;
...@@ -149,4 +221,108 @@ export default { ...@@ -149,4 +221,108 @@ export default {
margin-top: 20vh !important; margin-top: 20vh !important;
min-width: 700px; min-width: 700px;
} }
.title-box {
display: flex;
justify-content: space-between;
align-items: center;
height: 50px;
color: #333333;
font-size: 16px;
font-weight: 600;
border-bottom: 1px solid #e5e5e5;
}
.title-txt {
color: #666666;
font-size: 14px;
font-weight: 500;
}
@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;
}
.examine-record {
width: 1040px;
min-height: 60px;
border-radius: 4px;
border: 1px solid #fafafa;
background: #fafafa;
margin-top: 20px;
}
.record-div {
margin: 16px 20px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #666666;
letter-spacing: 0;
.record-div-d {
margin-top: 10px;
}
.span-txt-one {
margin-left: 14px;
width: 203px;
height: 21px;
}
.reviewer {
display: inline-block;
width: 140px;
}
.span-txt-two {
margin-left: 20px;
}
.greenSp {
color: #4aca74;
}
.redSp {
color: #eb4e4e;
}
}
.emptyCom {
display: flex;
flex-direction: column;
flex-wrap: wrap;
justify-content: center;
align-items: center;
.emptyImg {
margin-top: 20px;
width: 64px;
}
.tips {
font-size: 14px;
color: #999999;
margin: 20px 0;
}
}
</style> </style>
<!-- 编辑 - 对账单模版信息 -->
<template>
<div>
<d2-container class="edit-page edit-tmpl">
<div class="d2-container-content">
<d2-table ref="recordTable" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams" :before-search-fn="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>
<span v-else>-</span>
</template>
</d2-table>
</div>
<div class="footer">
<el-button @click="handleSecondConfirm('pass')" type="primary" :loading="$store.state.d2admin.loading.value">通过</el-button>
<el-button @click="handleSecondConfirm('invalid')" :loading="$store.state.d2admin.loading.value" type="primary" plain>驳回</el-button>
<el-button @click="handleCancel">取消</el-button>
</div>
</d2-container>
<!-- 通过 / 驳回 -->
<glsk-form-dialog v-if="editVisible" :selectVisible="editVisible" :dialogConfig="editDialogConfig" label-width="104px" dialog-width="520px" :editData="editData" :formRules="editRules" :editFormData="editFormData" :slotArr="slotArr" :base-data="baseData" @handleClose="editVisible = false" @handleConfirm="handleEditConfirm">
<template #dialogTxt>
<div class="dialog-txt">{{ editDialogConfig.dialogTxt }}</div>
</template>
</glsk-form-dialog>
</div>
</template>
<script>
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex'
import { stockRefundDetailPage, stockRefundUpdateStatus } from '@api/stockManage'
import { baseConfig } from '@/main'
export default {
name: 'InventoryDetailDialog',
components: {
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
membraneTypeList: baseConfig.membraneTypeList,
countObj: {},
routerInfo: {},
searchForm: {
refundCode: ''
},
searchFormSearch: {},
searchSelectObj: {},
showFormData: [],
getListApi: stockRefundDetailPage,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: false,
tableColumns: [{
label: '商品名称',
prop: 'upgradeGoodsName'
// width: '200px'
}, {
label: '规格',
prop: 'specificationData',
width: '160px'
}, {
label: '商品编码',
prop: 'type',
width: '250px'
}, {
label: '系列',
prop: 'goodsName'
}, {
label: '所属分类',
prop: 'goodsTypeName'
}, {
label: '系统库存',
prop: 'stock',
formatter: (cellValue) => {
return (cellValue.stock || cellValue.stock == 0) ? parseFloat(cellValue.stock).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
}
}, {
label: '退货库存',
prop: 'refundStock',
formatter: (cellValue) => {
return (cellValue.refundStock || cellValue.refundStock == 0) ? parseFloat(cellValue.refundStock).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
}
}, {
label: '膜卷号',
prop: 'filmRollNo',
formatter: (cellValue) => {
return cellValue?.filmRollNo || '-'
}
}]
},
baseData: {
},
// 通过弹窗
editVisible: false,
slotArr: ['dialogTxt'],
editData: {
reviewRemark: ''
},
editFormData: [{
name: 'dialogTxt',
label: '',
addHtml: "dialogTxt"
},
{
name: 'reviewRemark',
label: '驳回原因',
type: 'input',
maxlength: 100,
inputType: 'textarea',
showLimit: true,
rows: 4
}],
btnType: 'pass',
editDialogConfig: {
title: '通过',
dialogTxt: '退货申请单,确定审核通过?'
},
editRules: {
reviewRemark: [{ required: true, message: '请输入驳回原因', trigger: 'blur' }]
}
}
},
props: {
// inventoryDetailVisible: {
// type: Boolean,
// default: false
// },
recordInfo: {
type: Object,
default: () => { }
}
},
computed: {
},
mounted() {
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
beforeSearchFn() {
return new Promise(resolve => {
this.routerInfo = this.$route.query
this.searchForm.refundCode = this.$route.query.refundCode || ''
this.searchFormSearch = deepClone(this.searchForm)
resolve()
})
},
// 编辑
editDialogVisible() {
this.editVisible = !this.editVisible
},
handleSecondConfirm(btnType = 'pass') {
this.editData = {
reviewRemark: ''
}
this.btnType = btnType
this.editDialogConfig.title = btnType === 'pass' ? '通过' : '驳回'
const idx = this.editFormData.findIndex(item => item.name === 'reviewRemark')
this.editFormData[idx].label = btnType === 'pass' ? '备注' : '驳回原因'
this.editDialogConfig.dialogTxt = btnType === 'pass' ? '退货申请单,确定审核通过?' : '退货申请单,确定审核驳回?'
this.editRules.reviewRemark[0].required = btnType == 'invalid'
this.editDialogVisible()
},
handleEditConfirm() {
this.loading = true
const params = {
id: this.routerInfo.id || '',
reviewRemark: this.editData.reviewRemark,
refundStatus: this.btnType == 'pass' ? '4' : '3'
}
stockRefundUpdateStatus(params).then((res) => {
this.notice.okTips('操作成功!')
this.handleCancel()
}).finally(() => {
this.loading = false
})
},
handleCancel() {
this.$router.push({
name: "returnManage"
})
}
}
}
</script>
<style lang="scss" scoped>
.edit-page.edit-tmpl {
margin: 0 20px 20px;
background: #ffffff;
.title {
height: 50px;
line-height: 50px;
padding: 0 20px;
border-bottom: 1px solid #e5e5e5;
font-size: 16px;
font-weight: 600;
color: #333333;
}
}
.edit-tmpl {
.add-mer-btn {
margin-left: 12px;
}
}
.dialog-txt {
width: 480px;
height: 43px;
line-height: 43px;
text-align: center;
background: #fafafa;
color: #333333;
font-size: 16px;
font-weight: 600;
}
.footer {
text-align: center;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!