Commit 3de177e1 by 前端

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

上线合并

See merge request !29
2 parents 5a119008 ccfd609b
......@@ -495,7 +495,6 @@ const getTransferShipmentList = params => {
})
}
// 调拨发货 批量发货
const batchDelicery = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
......@@ -508,7 +507,6 @@ const batchDelicery = params => {
})
}
// 调拨发货驳回
const deliveryReject = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
......@@ -521,7 +519,6 @@ const deliveryReject = params => {
})
}
// 获取查看调拨详情商品信息
const getTransferGoodsInfo = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
......@@ -534,7 +531,6 @@ const getTransferGoodsInfo = params => {
})
}
// 获取查看调拨详情审批记录信息
const getTransferAuitInfo = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
......@@ -547,9 +543,34 @@ 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,
returnAll: 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 {
labelCodeRecode,
labelCodeRecodeLog,
getTransferGoodsInfo,
getTransferAuitInfo,
getTransferShipmentList,
......
......@@ -258,7 +258,7 @@ export default {
prop: '',
width: 100,
formatter: cellValue => {
return cellValue.eventType == '1' ? this.baseData.upgradeFlagList.find(item => item.confId === cellValue.upgradeFlag)?.confLabel : '-'
return cellValue.eventType == '1' ? this.baseData.upgradeFlagList.find(item => item.confId === cellValue.upgradeFlag)?.confLabel : '--'
}
},
{
......@@ -279,14 +279,27 @@ export default {
prop: 'storeUsage',
width: 200,
formatter: cellValue => {
return cellValue.storeUsage || '-'
return cellValue.storeUsage || '--'
}
},
{
label: '出库方式',
prop: 'reduceMethod',
width: '200px',
formatter: cellValue => {
// 出库方式: 2-扫码出库, 4-手工出库
return cellValue.reduceMethod == 2 ? '扫码出库' : cellValue.reduceMethod == 4 ? '手工出库' : '--'
}
},
{
label: '备注',
prop: ' remark'
},
{
label: '支付时间',
prop: 'successDate',
formatter: cellValue => {
return cellValue.successDate ? dayjs(cellValue.successDate).format('YYYY-MM-DD HH:mm:ss') : '-'
return cellValue.successDate ? dayjs(cellValue.successDate).format('YYYY-MM-DD HH:mm:ss') : '--'
},
width: 180
},
......
<!-- 补库存标签码弹窗 -->
<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">
<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: '请输入库存数量' },
{ validator: this.validateStockNum, trigger: 'blur' },
{ validator: this.validateStockNum, trigger: 'change' }
]
},
isLoading: false
}
},
computed: {
dialogVisible: {
get() {
return this.visibleSync
},
set(newVal) {
this.$emit('update:visibleSync', newVal)
}
}
},
methods: {
validateStockNum(rule, val, callback) {
// 1. 必填校验
if (!val) {
return callback(new Error('请输入库存数量'))
}
// 2. 格式化输入:只能输入数字,保留2位小数
let formatted = val.replace(/[^\d.]/g, '')
formatted = limitPrice(formatted, this.form.stockNum, 10, 2, 0)
// 使用 $nextTick 更新表单数据,保持视图同步
this.$nextTick(() => {
this.form.stockNum = formatted
})
const numVal = Number(formatted)
// 3. 校验数值有效性
if (isNaN(numVal)) {
return callback(new Error('请输入有效的数字'))
}
if (numVal <= 0) {
return callback(new Error('库存数量必须大于0'))
}
// 4. 校验是否超过当前库存上限
const maxStock = Number(this.row.stock)
if (!isNaN(maxStock) && numVal > maxStock) {
return callback(new Error('输入值不能高于当前库存数量'))
}
// 校验通过
callback()
},
handleClose(done) {
this.dialogVisible = false
if (typeof done === 'function') done()
},
handleConfirm() {
this.$refs.form.validate(valid => {
if (valid) {
if (this.isLoading) return
if (!this.row.isFilm) {
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,
merchantId: this.row.yqMerchantId
}
if (this.row.isFilm) {
params.stockNum = this.form.stockNum
}
this.isLoading = true
this.$apis.stockManage
.labelCodeRecode({ dataString: JSON.stringify(params) })
.then(res => {
this.isLoading = false
if (res && res.code == 0) {
const url = res.data.labelImageUrl
if (url) {
this.downloadFile(url)
this.dialogVisible = false
this.$message.success('补库存标签码成功并开始下载')
}
} else {
this.$message.error(res.message)
}
})
.catch(() => {
this.isLoading = false
})
}
})
},
downloadFile(url, fileName) {
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
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.yqMerchantId
}
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,7 @@
<div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset">
<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>
</GLCombiForm>
<div class="table-header">
......@@ -22,6 +22,10 @@
<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="handleDetail(scope.scope)">统计</el-button>
<template v-if="scope.scope.canScanEnable">
<el-button type="text" @click="handleComplement(scope.scope)">补码</el-button>
<el-button type="text" @click="handleLog(scope.scope)">日志</el-button>
</template>
</div>
</GLTable>
<!-- 表格区域 end -->
......@@ -31,6 +35,8 @@
<stockDetailDialog :visible.sync="stockDetailDialogVisible" :recordInfo="stockInfo" v-if="stockDetailDialogVisible" />
<!-- 库存对账单 -->
<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>
</template>
......@@ -41,12 +47,16 @@ import url from '@/assets/empty.png'
import stockMonthDialog from './stockMonthDialog'
import stockDetailDialog from './stockDetailDialog'
import statementOfAccountDialog from './statementOfAccountDialog'
import ComplementCodeDialog from './complementCodeDialog'
import ComplementLogDialog from './complementLogDialog'
export default {
name: 'warehousing',
components: {
stockMonthDialog,
stockDetailDialog,
statementOfAccountDialog
statementOfAccountDialog,
ComplementCodeDialog,
ComplementLogDialog
},
data() {
return {
......@@ -60,13 +70,16 @@ export default {
goodsType: '',
goodsSeries: '',
productCode: '',
queryDate: ''
queryDate: '',
selectData: []
},
tableSearchForm: {},
stockInfo: {},
stockMonthVisible: false,
stockDetailDialogVisible: false,
statementOfAccountDialogVisible: false,
complementDialogVisible: false,
complementLogDialogVisible: false,
showFormData: [
{
label: '产品名称',
......@@ -108,7 +121,7 @@ export default {
},
{
label: '选择日期',
name: 'queryDate',
name: 'selectData',
addHtml: 'queryDateHtml'
}
],
......@@ -116,7 +129,9 @@ export default {
getListApi: this.$apis.stockManage.getMerchantGoodsStockMonthReport,
tableParams: {
listName: 'list',
tableOption: true,
tableOption: {
width: 240
},
tableColumns: [
{
label: '产品名称',
......@@ -125,18 +140,25 @@ export default {
line: 1
},
{
label: '规格',
prop: 'specificationData',
label: '产品编码',
prop: 'productCode',
width: 180,
line: 1
},
{
label: '产品编码',
prop: 'productCode',
width: 180,
label: '产品ID',
prop: 'upgradeCommodityCode',
width: 320,
line: 1
},
{
label: '规格',
prop: 'specificationData',
width: 150,
line: 1
},
{
label: '系列',
prop: 'goodsSeries',
width: 150,
......@@ -192,7 +214,7 @@ export default {
},
stockQueryDatePickerOptions: {
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)
const today = new Date()
......@@ -219,19 +241,28 @@ export default {
},
methods: {
handleComplement(row) {
this.stockInfo = row
this.complementDialogVisible = true
},
// 日志
handleLog(row) {
this.stockInfo = row
this.complementLogDialogVisible = true
},
getMerchantGoodsStockMonthCount() {
var params = this.$common.utils.deepClone(this.searchForm)
params.dataMonth = dayjs(new Date()).format('YYYY-MM')
this.$apis.stockManage.getMerchantGoodsStockMonthCount(params).then(res => {
console.log(res, '???....')
this.totalInventory = res
})
},
beforeSearchFn() {
return new Promise(resolve => {
if (this.searchForm.queryDate) {
this.searchForm.queryDate = dayjs(this.searchForm.queryDate).format('YYYY-MM-DD') + ' 23:59:59'
if (this.searchForm.selectData && this.searchForm.selectData.length > 0) {
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.dataMonth = dayjs(new Date()).format('YYYY-MM')
resolve()
......@@ -310,7 +341,8 @@ export default {
goodsType: '',
goodsSeries: '',
productCode: '',
queryDate: ''
queryDate: '',
selectData: []
}
this.handleSearch()
},
......
<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">
<div>
<div>
......@@ -16,19 +11,11 @@
<span class="txt-blue">¥{{ totalObj.totalIncreaseStockMoney || '0' }}</span>
</div>
</div>
<el-button size="small"
@click="exportExcel">导出</el-button>
<el-button size="small" @click="exportExcel">导出</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="warehousingRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"></GLTable>
<GLTable ref="warehousingRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"></GLTable>
<!-- 表格区域 end -->
</div>
</div>
......@@ -212,7 +199,7 @@ export default {
label: '入库数量',
prop: 'increaseStockNum',
formatter: cellValue => {
return cellValue.increaseStockNum || cellValue.increaseStockNum == 0 ? parseFloat(cellValue.increaseStockNum).toFixed(2) + (this.$membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
return cellValue.increaseStockNum || cellValue.increaseStockNum == 0 ? parseFloat(cellValue.increaseStockNum).toFixed(2) + (this.$membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '--'
},
width: 120
},
......@@ -220,7 +207,7 @@ export default {
label: '入库金额/元',
prop: 'increaseStockMoney',
formatter: cellValue => {
return cellValue.increaseStockMoney || cellValue.increaseStockMoney == 0 ? '¥' + cellValue.increaseStockMoney.toFixed(2) : '-'
return cellValue.increaseStockMoney || cellValue.increaseStockMoney == 0 ? '¥' + cellValue.increaseStockMoney.toFixed(2) : '--'
},
width: 120
},
......@@ -253,7 +240,7 @@ export default {
prop: '',
minWidth: 150,
formatter: cellValue => {
return cellValue.increaseStockType == '4' ? this.baseData.upgradeFlagList.find(item => item.confId === cellValue.upgradeFlag)?.confLabel : '-'
return cellValue.increaseStockType == '4' ? this.baseData.upgradeFlagList.find(item => item.confId === cellValue.upgradeFlag)?.confLabel : '--'
}
},
{
......@@ -265,6 +252,15 @@ export default {
label: '入库门店',
prop: 'merchantName',
width: 200
},
{
label: '入库方式',
prop: 'warehousingMethod',
width: '200px',
formatter: cellValue => {
// 入库方式: 1-扫码入库, 3-手工入库
return cellValue.warehousingMethod == 1 ? '扫码入库' : cellValue.warehousingMethod == 3 ? '手工入库' : '--'
}
}
]
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!