Commit d881f15d by wangzhihui

```

feat(stockManage): 新增补库存标签码功能

- 添加labelCodeRecode接口用于补库存标签码
- 添加labelCodeRecodeLog接口用于查询补库存标签码日志
- 在库存管理页面增加补码和日志操作按钮
- 新增补库存标签码弹窗组件complementCodeDialog
- 新增补库存标签码日志弹窗组件complementLogDialog
- 实现出库方式和入库方式字段展示及格式化
- 调整库存页面日期选择器为日期范围选择
```
1 parent f4c474b4
...@@ -547,9 +547,33 @@ const getTransferAuitInfo = params => { ...@@ -547,9 +547,33 @@ const getTransferAuitInfo = params => {
}) })
} }
// 补库存标签码
const labelCodeRecode = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}labelCode.recode`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 补库存标签码日志查询
const labelCodeRecodeLog = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}labelCode.recodeLog`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
labelCodeRecode,
labelCodeRecodeLog,
getTransferGoodsInfo, getTransferGoodsInfo,
getTransferAuitInfo, getTransferAuitInfo,
getTransferShipmentList, getTransferShipmentList,
......
...@@ -283,6 +283,19 @@ export default { ...@@ -283,6 +283,19 @@ export default {
} }
}, },
{ {
label: "出库方式",
prop: "reduceMethod",
width: "200px",
formatter: (cellValue) => {
// 出库方式: 2-扫码出库, 4-手工出库
return cellValue.reduceMethod == 2 ? "扫码出库" : cellValue.reduceMethod == 4 ? "手工出库" : "-";
},
}, {
label: "备注",
prop: " remark",
width: "200px",
},
{
label: '支付时间', label: '支付时间',
prop: 'successDate', prop: 'successDate',
formatter: cellValue => { formatter: cellValue => {
......
<!-- 补库存标签码弹窗 -->
<template>
<GLDialog title="补库存标签码" :visible.sync="dialogVisible" class="complementCodeDialog" width="500px" mode="mid"
:destroy-on-close="true" :close-on-click-modal="false" okText="下载" cancelText="取消" @onOk="handleConfirm"
@onCancel="handleClose" :before-close="handleClose">
<div v-loading="isLoading" class="complement-dialog-content">
<el-form ref="form" label-width="120px" :model="form" :rules="rules">
<el-form-item label="产品名称:">
<span>{{ row.upgradeGoodsName || '-' }}</span>
</el-form-item>
<el-form-item label="产品编码:">
<span>{{ row.productCode || '-' }}</span>
</el-form-item>
<el-form-item label="产品ID:">
<span>{{ row.upgradeCommodityCode || '-' }}</span>
</el-form-item>
<el-form-item v-if="row.isFilm" :error="errorMsg" label="库存数量:" prop="stockNum">
<el-input v-model="form.stockNum" placeholder="请输入" style="width: 200px" @input="handleInput">
<template #append>
米
</template>
</el-input>
</el-form-item>
</el-form>
</div>
</GLDialog>
</template>
<script>
import { limitPrice } from '@/common/format'
export default {
name: 'ComplementCodeDialog',
props: {
visibleSync: {
type: Boolean,
default: false
},
row: {
type: Object,
default: () => ({})
}
},
data() {
return {
form: {
stockNum: ''
},
rules: {
stockNum: [{ required: true, message: '请输入库存数量', trigger: 'blur' }]
},
errorMsg: '',
isLoading: false
}
},
computed: {
dialogVisible: {
get() {
return this.visibleSync
},
set(newVal) {
this.$emit('update:visibleSync', newVal)
}
}
},
methods: {
handleClose(done) {
this.dialogVisible = false
if (typeof done === 'function') done()
},
handleInput(val) {
let formatted = val.replace(/[^\d.]/g, '')
formatted = limitPrice(formatted, this.form.stockNum, 10, 2, 0)
this.form.stockNum = formatted
if (this.form.stockNum && Number(this.form.stockNum) > Number(this.row.stock)) {
this.errorMsg = '输入值不能高于当前库存数量'
} else {
this.errorMsg = ''
}
},
handleConfirm() {
if (this.isLoading) return
if (this.row.isFilm) {
if (!this.form.stockNum) {
this.$message.warning('请输入库存数量')
return
}
if (Number(this.form.stockNum) > Number(this.row.stock)) {
this.errorMsg = '输入值不能高于当前库存数量'
this.$message.error('输入值不能高于当前库存数量')
return
}
} else {
if (!this.row.stock || Number(this.row.stock) <= 0) {
this.$message.error('当前产品库存必须大于0,才允许补库存标签码')
return
}
}
const params = {
merchantId: this.row.merchantId,
upgradeGoodsId: this.row.upgradeGoodsId,
goodsType: this.row.goodsType
}
if (this.row.isFilm) {
params.stockNum = this.form.stockNum
}
this.isLoading = true
this.$apis.stockManage
.labelCodeRecode(params)
.then(res => {
this.isLoading = false
const url = (res && res.labelImageUrl) || (typeof res === 'string' ? res : '')
if (url) {
this.downloadFile(url, `补码标签_${this.row.upgradeGoodsName || this.row.productCode}.png`)
this.dialogVisible = false
this.$message.success('补库存标签码成功并开始下载')
} else {
this.$message.error('未获取到标签码下载链接')
}
})
.catch(() => {
this.isLoading = false
})
},
downloadFile(url, fileName) {
const link = document.createElement('a')
link.style.display = 'none'
link.href = url + '?response-content-type=application/octet-stream'
link.download = fileName
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
}
}
}
</script>
<style scoped lang="scss">
.complement-dialog-content {
padding: 20px;
}
.qrcode-wrapper {
display: flex;
justify-content: center;
align-items: center;
padding: 10px;
}
.qrcode-capture-box {
width: 280px;
padding: 20px;
background: #fff;
border: 1px solid #eee;
border-radius: 8px;
display: flex;
flex-direction: column;
align-items: center;
.info-section {
width: 100%;
margin-bottom: 15px;
font-size: 14px;
color: #333;
line-height: 1.8;
.info-item {
word-break: break-all;
}
}
.qrcode-img {
margin-bottom: 10px;
}
.qr-text {
font-size: 16px;
font-weight: bold;
color: #333;
margin-top: 5px;
}
}
::v-deep .el-form-item__error {
position: relative;
margin-top: 4px;
}
</style>
<!-- 补库存标签码日志弹窗 -->
<template>
<GLDialog title="补库存标签码日志" :visible.sync="dialogVisible" class="complementLogDialog" width="700px" mode="mid"
:destroy-on-close="true" :close-on-click-modal="false" okText="关闭" :hasFooter="false" :before-close="handleClose"
@onOk="handleClose" @onCancel="handleClose">
<div class="complement-log-content">
<div class="section-title">
产品基础信息
</div>
<div class="info-box">
<el-row>
<el-col class="info-item" :span="24">
<span class="label">产品名称:</span>
<span class="value">{{ row.upgradeGoodsName || '-' }}</span>
</el-col>
<el-col class="info-item" :span="24">
<span class="label">产品编码:</span>
<span class="value">{{ row.productCode || '-' }}</span>
</el-col>
<el-col class="info-item" :span="24">
<span class="label">产品ID:</span>
<span class="value">{{ row.upgradeCommodityCode || '-' }}</span>
</el-col>
</el-row>
</div>
<div class="section-title" style="margin-top: 20px;">
操作日志
</div>
<div class="d2-container-content">
<GLTable ref="logTable" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams"
:pageConf="pageConf" :beforeSearchFn="beforeSearchFn"></GLTable>
</div>
</div>
</GLDialog>
</template>
<script>
import * as dayjs from 'dayjs'
export default {
name: 'ComplementLogDialog',
props: {
visibleSync: {
type: Boolean,
default: false
},
row: {
type: Object,
default: () => ({})
}
},
data() {
const tableColumns = []
if (this.row && this.row.isFilm) {
tableColumns.push({
label: '库存数量',
prop: 'stockNum',
formatter: cellValue => {
return cellValue.stockNum || cellValue.stockNum == 0 ? `${cellValue.stockNum}米` : '-'
}
})
}
tableColumns.push(
{
label: '操作人',
prop: 'createdBy'
},
{
label: '操作时间',
prop: 'createdDate',
formatter: cellValue => {
return cellValue.createdDate ? dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss') : '-'
}
}
)
return {
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
tableSearchForm: {},
getListApi: this.$apis.stockManage.labelCodeRecodeLog,
tableParams: {
listName: 'list',
tableColumns: tableColumns
}
}
},
computed: {
dialogVisible: {
get() {
return this.visibleSync
},
set(newVal) {
this.$emit('update:visibleSync', newVal)
}
}
},
methods: {
handleClose(done) {
this.dialogVisible = false
if (typeof done === 'function') done()
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = {
upgradeGoodsId: this.row.upgradeGoodsId,
merchantId: this.row.merchantId
}
resolve()
})
}
}
}
</script>
<style scoped lang="scss">
.complement-log-content {
padding: 0 10px 20px 10px;
.section-title {
font-size: 16px;
font-weight: bold;
color: #333;
margin-bottom: 15px;
}
.info-box {
padding: 0 20px;
.info-item {
margin-bottom: 12px;
font-size: 14px;
.label {
color: #666;
display: inline-block;
width: 80px;
text-align: right;
}
.value {
color: #333;
}
}
}
}
</style>
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
<div class="container"> <div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset"> <GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset">
<template #queryDateHtml> <template #queryDateHtml>
<el-date-picker v-model="searchForm.queryDate" type="date" placeholder="请选择" :picker-options="stockQueryDatePickerOptions"></el-date-picker> <el-date-picker v-model="searchForm.selectData" type="daterange" range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期" :picker-options="stockQueryDatePickerOptions"></el-date-picker>
</template> </template>
</GLCombiForm> </GLCombiForm>
<div class="table-header"> <div class="table-header">
...@@ -22,6 +24,8 @@ ...@@ -22,6 +24,8 @@
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleInventoryDetails(scope.scope)">库存明细</el-button> <el-button type="text" @click="handleInventoryDetails(scope.scope)">库存明细</el-button>
<el-button type="text" @click="handleDetail(scope.scope)">统计</el-button> <el-button type="text" @click="handleDetail(scope.scope)">统计</el-button>
<el-button type="text" @click="handleComplement(scope.scope)">补码</el-button>
<el-button type="text" @click="handleLog(scope.scope)">日志</el-button>
</div> </div>
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
...@@ -31,6 +35,8 @@ ...@@ -31,6 +35,8 @@
<stockDetailDialog :visible.sync="stockDetailDialogVisible" :recordInfo="stockInfo" v-if="stockDetailDialogVisible" /> <stockDetailDialog :visible.sync="stockDetailDialogVisible" :recordInfo="stockInfo" v-if="stockDetailDialogVisible" />
<!-- 库存对账单 --> <!-- 库存对账单 -->
<statementOfAccountDialog :visible.sync="statementOfAccountDialogVisible" v-if="statementOfAccountDialogVisible" :yqMerchantList="baseData.yqMerchantList" @handleRelateProConfirm="handleRelateProConfirm"></statementOfAccountDialog> <statementOfAccountDialog :visible.sync="statementOfAccountDialogVisible" v-if="statementOfAccountDialogVisible" :yqMerchantList="baseData.yqMerchantList" @handleRelateProConfirm="handleRelateProConfirm"></statementOfAccountDialog>
<ComplementCodeDialog v-if="complementDialogVisible" :row="stockInfo" :visibleSync.sync="complementDialogVisible"></ComplementCodeDialog>
<ComplementLogDialog v-if="complementLogDialogVisible" :row="stockInfo" :visibleSync.sync="complementLogDialogVisible"></ComplementLogDialog>
</div> </div>
</template> </template>
...@@ -41,12 +47,16 @@ import url from '@/assets/empty.png' ...@@ -41,12 +47,16 @@ import url from '@/assets/empty.png'
import stockMonthDialog from './stockMonthDialog' import stockMonthDialog from './stockMonthDialog'
import stockDetailDialog from './stockDetailDialog' import stockDetailDialog from './stockDetailDialog'
import statementOfAccountDialog from './statementOfAccountDialog' import statementOfAccountDialog from './statementOfAccountDialog'
import ComplementCodeDialog from './complementCodeDialog'
import ComplementLogDialog from './complementLogDialog'
export default { export default {
name: 'warehousing', name: 'warehousing',
components: { components: {
stockMonthDialog, stockMonthDialog,
stockDetailDialog, stockDetailDialog,
statementOfAccountDialog statementOfAccountDialog,
ComplementCodeDialog,
ComplementLogDialog
}, },
data() { data() {
return { return {
...@@ -60,13 +70,16 @@ export default { ...@@ -60,13 +70,16 @@ export default {
goodsType: '', goodsType: '',
goodsSeries: '', goodsSeries: '',
productCode: '', productCode: '',
queryDate: '' queryDate: '',
selectData: []
}, },
tableSearchForm: {}, tableSearchForm: {},
stockInfo: {}, stockInfo: {},
stockMonthVisible: false, stockMonthVisible: false,
stockDetailDialogVisible: false, stockDetailDialogVisible: false,
statementOfAccountDialogVisible: false, statementOfAccountDialogVisible: false,
complementDialogVisible: false,
complementLogDialogVisible: false,
showFormData: [ showFormData: [
{ {
label: '产品名称', label: '产品名称',
...@@ -108,7 +121,7 @@ export default { ...@@ -108,7 +121,7 @@ export default {
}, },
{ {
label: '选择日期', label: '选择日期',
name: 'queryDate', name: 'selectData',
addHtml: 'queryDateHtml' addHtml: 'queryDateHtml'
} }
], ],
...@@ -116,7 +129,9 @@ export default { ...@@ -116,7 +129,9 @@ export default {
getListApi: this.$apis.stockManage.getMerchantGoodsStockMonthReport, getListApi: this.$apis.stockManage.getMerchantGoodsStockMonthReport,
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableOption: true, tableOption: {
width:240
},
tableColumns: [ tableColumns: [
{ {
label: '产品名称', label: '产品名称',
...@@ -137,6 +152,12 @@ export default { ...@@ -137,6 +152,12 @@ export default {
line: 1 line: 1
}, },
{ {
label: '产品ID',
prop: 'upgradeCommodityCode',
width: 180,
line: 1
},
{
label: '系列', label: '系列',
prop: 'goodsSeries', prop: 'goodsSeries',
width: 150, width: 150,
...@@ -192,7 +213,7 @@ export default { ...@@ -192,7 +213,7 @@ export default {
}, },
stockQueryDatePickerOptions: { stockQueryDatePickerOptions: {
disabledDate(time) { disabledDate(time) {
const minDate = new Date(2026, 1, 1) const minDate = new Date(2026, 1, 1) // 2026年2月1日 (月份从0开始,1代表2月)
minDate.setHours(0, 0, 0, 0) minDate.setHours(0, 0, 0, 0)
const today = new Date() const today = new Date()
...@@ -219,6 +240,15 @@ export default { ...@@ -219,6 +240,15 @@ export default {
}, },
methods: { methods: {
handleComplement(row) {
this.stockInfo = row
this.complementDialogVisible = true
},
// 日志
handleLog(row) {
this.stockInfo = row
this.complementLogDialogVisible = true
},
getMerchantGoodsStockMonthCount() { getMerchantGoodsStockMonthCount() {
var params = this.$common.utils.deepClone(this.searchForm) var params = this.$common.utils.deepClone(this.searchForm)
params.dataMonth = dayjs(new Date()).format('YYYY-MM') params.dataMonth = dayjs(new Date()).format('YYYY-MM')
...@@ -229,9 +259,10 @@ export default { ...@@ -229,9 +259,10 @@ export default {
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
if (this.searchForm.queryDate) { if (this.searchForm.selectData && this.searchForm.selectData.length > 0) {
this.searchForm.queryDate = dayjs(this.searchForm.queryDate).format('YYYY-MM-DD') + ' 23:59:59' this.searchForm.queryDate = dayjs(this.searchForm.selectData[1]).format('YYYY-MM-DD') + ' 23:59:59'
} }
delete this.searchForm.selectData
this.tableSearchForm = this.$common.utils.deepClone(this.searchForm) this.tableSearchForm = this.$common.utils.deepClone(this.searchForm)
this.tableSearchForm.dataMonth = dayjs(new Date()).format('YYYY-MM') this.tableSearchForm.dataMonth = dayjs(new Date()).format('YYYY-MM')
resolve() resolve()
...@@ -310,7 +341,8 @@ export default { ...@@ -310,7 +341,8 @@ export default {
goodsType: '', goodsType: '',
goodsSeries: '', goodsSeries: '',
productCode: '', productCode: '',
queryDate: '' queryDate: '',
selectData: []
} }
this.handleSearch() this.handleSearch()
}, },
......
...@@ -265,6 +265,16 @@ export default { ...@@ -265,6 +265,16 @@ export default {
label: '入库门店', label: '入库门店',
prop: 'merchantName', prop: 'merchantName',
width: 200 width: 200
},
{
label: "入库方式",
prop: "warehousingMethod",
width: "200px",
formatter: (cellValue) => {
// 入库方式: 1-扫码入库, 3-手工入库
return cellValue.warehousingMethod == 1 ? "扫码入库" : "手工入库";
},
} }
] ]
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!