Commit 349260d2 by 李伟康

feat(stockManage): 新增退货管理模块并优化库存相关列表展示

- 新增退货管理路由配置,包含页面权限和按钮权限控制
- 新增退货管理主页面及详情弹窗页面
- 在调拨明细、库存预警、库存明细、出库列表、入库列表等页面中
  添加商品规格列,统一规格字段展示
- 优化库存列表页面的商品名称列与规格列的显示逻辑
1 parent 6ab393a1
......@@ -260,5 +260,32 @@ export const routerName = {
}
],
component: _import("stockManage/BenefitCardManage/index")
}
},
90808: {
path: "/returnManage",
name: "returnManage",
meta: {
title: "退货管理",
authId: "90808",
parentId: "908",
cache: false
},
auth: [
{
authId: "9080801",
parentId: "90808",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9080802",
parentId: "90808",
label: "查看",
handle: "look"
}
],
component: _import("stockManage/returnManage/index")
},
}
......@@ -46,6 +46,10 @@ export default {
label: '商品名称',
prop: 'goodsName'
// width: '200px'
},{
label: '规格',
prop: 'specificationData',
width: '160px'
}, {
label: '商品编码',
prop: 'productCode',
......
......@@ -128,6 +128,10 @@ export default {
label: '商品名称',
prop: 'upgradeGoodsName',
width: '160px'
},{
label: '规格',
prop: 'specificationData',
width: '160px'
}, {
label: '商品编码',
prop: 'productCode',
......
......@@ -61,6 +61,10 @@ export default {
prop: 'goodsName'
// width: '200px'
}, {
label: '规格',
prop: 'specificationData',
width: '160px'
},{
label: '商品编码',
prop: 'productCode',
width: '250px'
......
......@@ -218,6 +218,10 @@ export default {
prop: 'upgradeGoodsName',
width: '160px'
}, {
label: '规格',
prop: 'specificationData',
width: '160px'
}, {
label: '商品编码',
prop: 'productCode',
width: '250px'
......
<!-- 退货管理 -->
<template>
<div>
<d2-container>
<div class="header" slot="header" style="padding: 10px 20px">
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData"
/>
<div class="up-btns">
<el-button :id="tableParams.btnId" size="small" type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<!-- <span slot="left"
v-if="!userInfo.beSuper && userInfo.beYQMerchant">
<auth-button category="Button"
:show-btn-ids="['9080401']" />
</span> -->
<auth-button category="Button" :show-btn-ids="['9080402']" />
</d2-table-header>
<d2-table
ref="recordTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
<div slot="img" slot-scope="scope" v-if="scope.scope.voucherPic">
<img
class="pro-img"
:src="scope.scope.voucherPic"
@click="handleEnlargeImg(scope.scope.voucherPic)"
/>
</div>
<auth-button
slot="auth-button"
slot-scope="scope"
:data="scope.scope"
/>
</d2-table>
</div>
</d2-container>
<!-- 查看 -->
<return-detail-dialog
:inventory-detail-visible="inventoryDetailVisible"
:record-info="recordInfo"
v-if="inventoryDetailVisible"
@dialogClose="dialogClose"
/>
<!-- 预览图片 -->
<el-dialog :visible="imgVisible" :before-close="handleCloseImg">
<img width="100%" :src="previewImgUrl" alt="图片" />
</el-dialog>
</div>
</template>
<script>
import { Util, deepClone } from "@/common/util"
import { mapActions, mapState } from "vuex"
import { getProductTypeBySceneId } from "@api/product"
import {
getyqMerchantList,
stockCheckPage,
getServicemerchantrefList
} from "@api/stockManage"
import returnDetailDialog from "./returnDetailDialog"
export default {
name: "InventoryList",
components: {
returnDetailDialog
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
searchForm: {
checkTime: "",
checkCode: "",
yqMerchantId: "",
merchantId: ""
},
searchFormSearch: {},
searchSelectObj: {
orderOrTrade: {
attr: "inputtedOrderCode",
value: ""
}
},
showFormData: [
{
label: "退货单号",
name: "checkCode",
type: "input",
maxlength: "20",
isClear: true
},
{
label: "退货时间",
name: "checkTime",
type: "datePicker",
isClear: true,
pickerOptions: "rangePickerOptions"
},
{
label: "退货仓库",
name: "yqMerchantId",
type: "select",
optionList: [],
optionId: "merchantNo",
optionLabel: "merchantName",
optionsName: "yqMerchantList",
changeAttr: (value, targetItem) => {
value
? this.getServicemerchantrefList(value)
: (this.baseData.merchantIdList = [])
this.searchForm.merchantId = ""
this.getOptionsList()
}
},
{
label: "退货门店",
name: "merchantId",
type: "select",
noDataText: "请先选择退货仓库",
optionList: [],
optionId: "merchantId",
optionLabel: "merchantName",
optionsName: "merchantIdList"
}
],
getListApi: stockCheckPage,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
tableOption: true,
tableColumns: [
{
label: "退货单号",
prop: "checkCode",
width: "200px"
},
{
label: "退货时间",
prop: "checkTime",
width: "150px",
formatter: (cellValue) => {
return cellValue.checkTime
? Util.dateFormate(cellValue.checkTime, "YYYY-MM-DD HH:mm:ss")
: ""
}
},
{
label: "退货人",
prop: "operator",
width: "150px"
},
{
label: "退货类型",
prop: "operator",
width: "150px"
},
{
label: "退货仓库",
prop: "yqMerchantName"
},
{
label: "退货门店",
prop: "merchantName"
},
{
label: "备注",
prop: "remark"
},
{
label: "凭证",
prop: "voucherPic",
width: "100px",
addHtml: "img"
}
]
},
baseData: {
productTypeList: [],
yqMerchantList: [],
merchantIdList: []
},
inventoryDetailVisible: false,
recordInfo: null,
imgVisible: false,
previewImgUrl: ""
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
mounted() {
// this.getBaseData()
// 获取全部类目
getProductTypeBySceneId({ sceneType: "" }).then((res) => {
this.baseData.productTypeList = res
this.getOptionsList()
})
// 获取退货仓库
getyqMerchantList({ mainPartnerMerchant: true }).then((res) => {
this.baseData.yqMerchantList = res
this.getOptionsList()
})
},
methods: {
...mapActions({
get: "d2admin/base/get",
close: "d2admin/page/close"
}),
...mapActions("d2admin/user", ["actionSetDownloadList"]),
// async getBaseData() {
// this.getOptionsList()
// },
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.searchForm)
if (this.searchFormSearch.checkTime) {
this.searchFormSearch.checkTimeStart = Util.dateFormate(
this.searchFormSearch.checkTime[0],
"YYYY-MM-DD HH:mm:ss"
)
this.searchFormSearch.checkTimeEnd =
Util.dateFormate(this.searchFormSearch.checkTime[1], "YYYY-MM-DD") +
" 23:59:59"
}
delete this.searchFormSearch.checkTime
resolve()
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
) {
const temp = {}
temp[this.showFormData[index].optionId] = ""
temp[this.showFormData[index].optionLabel] = "全部"
this.baseData[item.optionsName].unshift(temp)
}
this.$set(
this.showFormData[index],
"optionList",
this.baseData[item.optionsName]
)
}
})
},
// 获取仓库门店
getServicemerchantrefList(merchantId) {
getServicemerchantrefList({
yqMerchantId: merchantId
}).then((res) => {
this.baseData.merchantIdList = res || []
// 总店
const _headOffice = this.baseData.yqMerchantList.find(
(item) => item.merchantNo === merchantId
)
_headOffice.merchantId = _headOffice.merchantNo
// 门店选项中加入总店
this.baseData.merchantIdList.push(_headOffice)
this.getOptionsList()
})
},
// handleSearch() {
// this.$refs.recordTable.refreshTable()
// },
handleReset() {
this.searchForm = {
checkTime: "",
checkCode: "",
yqMerchantId: "",
merchantId: ""
}
this.baseData.merchantIdList = []
this.getOptionsList()
this.$refs.recordTable.refreshTable()
},
gotoAdd() {
// this.close({ tagName: '/orderList' })
this.$router.push({ name: "addInventory" })
},
handleExport() {
var params = this.searchFormSearch
params.method = "dj.smartcarlife.api.stock.check.export.async"
const list = [
...this.dowloadList,
{
name: "退货列表",
exportParam: JSON.stringify(params),
status: "waiting",
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: "dowloadList" })
},
// 查看
look(row) {
this.recordInfo = row
this.inventoryDetailVisible = true
},
dialogClose(flag) {
this.inventoryDetailVisible = !this.inventoryDetailVisible
},
handleEnlargeImg(url) {
if (url) {
this.previewImgUrl = url
this.imgVisible = !this.imgVisible
}
},
handleCloseImg() {
this.imgVisible = !this.imgVisible
}
}
}
</script>
<style scoped>
.count-txt {
font-weight: 700;
color: #2a58ad;
margin: 0 2px;
}
.leftSpan {
display: inline-block;
box-sizing: border-box;
margin-right: 10px;
}
.pro-img {
width: 36px;
height: 36px;
cursor: pointer;
}
</style>
<!-- 退货详情弹窗弹窗 -->
<template>
<d2-dialog title="详细信息" :is-visible="inventoryDetailVisible" class="inventoryDetailDailog" width="70%" :no-cancel="true"
btn-ok-label="关闭" @closeDialog="handleClose" @confirmDialog="handleClose">
<div>
<div class="header" slot="header" style="padding: 10px 20px;">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :search-select-obj="searchSelectObj"
:form-data="showFormData" />
</div>
<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>
</d2-dialog>
</template>
<script>
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex'
import { stockCheckDetailPage } 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: {},
searchForm: {
id: ''
},
searchFormSearch: {},
searchSelectObj: {},
showFormData: [],
getListApi: stockCheckDetailPage,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
// singleSelectUniqueKey: 'id',
tableOption: false,
tableColumns: [{
label: '商品名称',
prop: 'goodsName'
// width: '200px'
}, {
label: '规格',
prop: 'specificationData',
width: '160px'
},{
label: '商品编码',
prop: 'productCode',
width: '250px'
}, {
label: '系列',
prop: 'sourceMaterialName'
}, {
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: 'checkStock',
formatter: (cellValue) => {
return (cellValue.checkStock || cellValue.checkStock == 0) ? parseFloat(cellValue.checkStock).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
}
}, {
label: '膜卷号',
prop: 'filmRollNo',
formatter: (cellValue) => {
return cellValue?.filmRollNo || '-'
}
}]
},
baseData: {
}
}
},
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.searchForm.id = this.recordInfo.id
this.searchFormSearch = deepClone(this.searchForm)
resolve()
})
},
handleClose() {
this.$emit('dialogClose')
}
}
}
</script>
<style scoped>
.count-txt {
font-weight: 700;
color: #2a58ad;
margin: 0 2px;
}
.inventoryDetailDailog .el-dialog {
margin-top: 20vh !important;
min-width: 700px;
}
</style>
......@@ -141,7 +141,11 @@ export default {
label: '商品名称',
prop: 'upgradeGoodsName',
width: '160px'
}, {
},{
label: '规格',
prop: 'specificationData',
width: '160px'
},{
label: '商品编码',
prop: 'productCode',
width: '250px'
......
......@@ -195,6 +195,10 @@ export default {
label: '商品名称',
prop: 'upgradeGoodsName',
width: '160px'
}, {
label: '规格',
prop: 'specificationData',
width: '160px'
}, {
label: '商品编码',
prop: 'productCode',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!