✨ feat: 二维码增加状态放置重复扫描,增加批次号
This commit is contained in:
@@ -926,7 +926,7 @@ body {
|
||||
left: 0;
|
||||
position: relative;
|
||||
margin: 10vh auto 0;
|
||||
background: $--metal-gradient-light;
|
||||
background: $--metal-gradient-light !important;
|
||||
border: 1px solid $--border-color-light;
|
||||
box-shadow: $--metal-shadow;
|
||||
border-radius: 8px;
|
||||
@@ -1362,7 +1362,7 @@ body {
|
||||
// ====================== 描述列表组件(el-descriptions)- 深色模式 ======================
|
||||
.el-descriptions {
|
||||
width: 100%;
|
||||
background: $--color-background; // 黑色背景
|
||||
background: $--color-background !important; // 黑色背景
|
||||
box-shadow: $--metal-shadow;
|
||||
overflow: hidden;
|
||||
color: $--color-text-primary; // 白色文字
|
||||
@@ -1397,7 +1397,7 @@ body {
|
||||
// 描述列表标签项(左侧)
|
||||
.el-descriptions-item__label {
|
||||
padding: $--spacing-lg;
|
||||
background: $--color-background; // 极浅灰背景区分标签
|
||||
background: $--color-background !important; // 极浅灰背景区分标签
|
||||
color: $--color-text-secondary; // 浅灰文字
|
||||
font-weight: 500;
|
||||
border-right: 1px solid $--border-color-lighter;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<span>
|
||||
<el-select v-model="selected" :placeholder="placeholder" filterable clearable :loading="loading" @change="onChange"
|
||||
<el-select v-model="selected" :placeholder="placeholder" filterable clearable :loading="loading"
|
||||
style="width: 100%" :value-key="'rawMaterialId'">
|
||||
<template #empty>
|
||||
<el-button v-if="canAdd" @click="add" icon="el-icon-plus">未搜索到原材料,点击添加</el-button>
|
||||
@@ -114,6 +114,7 @@ export default {
|
||||
},
|
||||
selected(val) {
|
||||
this.$emit("input", val);
|
||||
this.$emit('change', this.rawMaterialList.find(p => p.rawMaterialId === val));
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
@@ -78,6 +78,7 @@
|
||||
<!-- <el-table-column label="是否启用" align="center" prop="isEnabled" /> -->
|
||||
<el-table-column label="编号" align="center" prop="serialNumber" />
|
||||
<el-table-column label="二维码尺寸" align="center" prop="size" />
|
||||
<el-table-column label="状态" align="center" prop="status" />
|
||||
<el-table-column v-if="showQRCode" label="二维码" align="center" prop="content">
|
||||
<template slot-scope="scope">
|
||||
<QRCode :content="scope.row.recordId" :size="scope.row.size"/>
|
||||
@@ -114,7 +115,7 @@
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="二维码内容">
|
||||
<editor v-model="form.content" :min-height="192"/>
|
||||
<textarea v-model="form.content" :min-height="192" style="width: 100%;height: 192px;background-color: #393e43;color: #fff;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用" prop="isEnabled">
|
||||
<!-- 单选框 -->
|
||||
@@ -123,6 +124,9 @@
|
||||
<el-radio :label="0">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-input v-model="form.status" placeholder="请输入状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="编号" prop="serialNumber">
|
||||
<el-input v-model="form.serialNumber" placeholder="请输入编号" />
|
||||
</el-form-item>
|
||||
@@ -177,12 +181,13 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
qrcodeType: undefined,
|
||||
content: undefined,
|
||||
isEnabled: undefined,
|
||||
serialNumber: undefined,
|
||||
size: undefined,
|
||||
status: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@@ -223,7 +228,8 @@ export default {
|
||||
createTime: undefined,
|
||||
createBy: undefined,
|
||||
updateTime: undefined,
|
||||
updateBy: undefined
|
||||
updateBy: undefined,
|
||||
status: undefined,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
||||
@@ -158,6 +158,15 @@
|
||||
@change="(warehouse) => onFromWarehouseChange(cfg, idx, warehouse)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="cfg.ioType === 'in'">
|
||||
<el-form-item label="备用单据" :error="getError(cfg, 'stockIoWaitId')" class="form-item">
|
||||
<el-select clearable filterable size="mini" v-model="cfg.stockIoWaitId" placeholder="请选择备用单据"
|
||||
class="form-select" :disabled="!cfg.ioType">
|
||||
<el-option v-for="item in masterList.filter(i => i.ioType === 'out')"
|
||||
:key="item.stockIoId" :label="item.stockIoCode" :value="item.stockIoId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="8">
|
||||
<el-col :span="12">
|
||||
@@ -182,11 +191,16 @@
|
||||
</el-row>
|
||||
<el-row :gutter="8">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料数量" :error="getError(cfg, 'count')" class="form-item">
|
||||
<el-input-number :controls=false controls-position="right" v-model="cfg.count" :min="1"
|
||||
<el-form-item label="物料数量" :error="getError(cfg, 'quantity')" class="form-item">
|
||||
<el-input-number :controls=false controls-position="right" v-model="cfg.quantity" :min="1"
|
||||
:max="100" size="mini" placeholder="请输入数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="批次号" class="form-item">
|
||||
<el-input v-model="cfg.batchNo" size="mini" placeholder="请输入批次号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="8">
|
||||
@@ -274,6 +288,7 @@ export default {
|
||||
onItemChange(item, idx) {
|
||||
if (item && this.drawerBarcodeData[idx]) {
|
||||
// 设置对应的物料名称
|
||||
console.log(item, '物料信息');
|
||||
const name = item.name || item.materialName || item.productName || item.rawMaterialName;
|
||||
const code = item.code || item.materialCode || item.productCode || item.rawMaterialCode;
|
||||
this.$set(this.drawerBarcodeData[idx], 'itemName', name);
|
||||
@@ -343,6 +358,20 @@ export default {
|
||||
});
|
||||
},
|
||||
// 添加二维码配置 - 增加hover状态初始化
|
||||
// randomBatchNo, 生成10位的批次号
|
||||
randomBatchNo() {
|
||||
const year = new Date().getFullYear();
|
||||
const month = new Date().getMonth() + 1;
|
||||
const day = new Date().getDate();
|
||||
const hour = new Date().getHours();
|
||||
const salt = Math.random().toString(36).substring(2, 4);
|
||||
|
||||
// 如果出现2月、3日,5点等需补全为02,03,05
|
||||
function pad(num) {
|
||||
return num < 10 ? '0' + num : num;
|
||||
}
|
||||
return year + pad(month) + pad(day) + pad(hour) + salt;
|
||||
},
|
||||
handleAdd() {
|
||||
const newConfig = {
|
||||
ioType: undefined,
|
||||
@@ -352,13 +381,15 @@ export default {
|
||||
itemType: undefined,
|
||||
gend: false,
|
||||
itemId: undefined,
|
||||
batchNo: 'auto',
|
||||
count: 1, // 默认数量1
|
||||
// 年月日时 + 随机两个字符
|
||||
batchNo: this.randomBatchNo(),
|
||||
quantity: 1, // 默认数量1
|
||||
totalCount: 1, // 默认数量1
|
||||
unit: '',
|
||||
text: '二维码', // 默认文字
|
||||
hovered: false, // 新增hover状态,用于交互反馈,
|
||||
showForm: true // 新增表单展示开关
|
||||
showForm: true, // 新增表单展示开关
|
||||
stockIoWaitId: undefined,
|
||||
};
|
||||
|
||||
this.drawerBarcodeData.push(newConfig);
|
||||
@@ -443,7 +474,7 @@ export default {
|
||||
// 移库需要额外验证源仓库
|
||||
const transferValid = cfg.ioType !== 'transfer' || !!cfg.fromWarehouseId;
|
||||
// 物料相关验证
|
||||
const itemValid = !!cfg.itemType && !!cfg.itemId && !!cfg.count && cfg.count >= 1;
|
||||
const itemValid = !!cfg.itemType && !!cfg.itemId && !!cfg.quantity && cfg.quantity >= 1;
|
||||
|
||||
return basicValid && transferValid && itemValid;
|
||||
},
|
||||
@@ -464,8 +495,8 @@ export default {
|
||||
return !cfg.itemType ? '请选择物料类型' : '';
|
||||
case 'itemId':
|
||||
return !cfg.itemId ? '请选择物料信息' : '';
|
||||
case 'count':
|
||||
return !cfg.count || cfg.count < 1 ? '请输入有效的数量(至少1)' : '';
|
||||
case 'quantity':
|
||||
return !cfg.quantity || cfg.quantity < 1 ? '请输入有效的数量(至少1)' : '';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -144,10 +144,12 @@ export default {
|
||||
|
||||
.company-name {
|
||||
font-size: 0.95em;
|
||||
width: 100%;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
.english-name {
|
||||
width: 100%;
|
||||
font-size: 0.6em;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
@@ -87,107 +87,107 @@ export default {
|
||||
const labelHeight = labelContainer.offsetHeight;
|
||||
|
||||
// 3. 定义打印样式(确保与预览一致)
|
||||
const printStyles = `
|
||||
/* 基础容器样式 */
|
||||
#label-preview-container {
|
||||
width: ${labelWidth}px !important;
|
||||
height: ${labelHeight}px !important;
|
||||
padding: 1.5rem !important;
|
||||
box-sizing: border-box !important;
|
||||
border: 1px solid #333 !important;
|
||||
background-color: #fff !important;
|
||||
}
|
||||
// const printStyles = `
|
||||
// /* 基础容器样式 */
|
||||
// #label-preview-container {
|
||||
// width: ${labelWidth}px !important;
|
||||
// height: ${labelHeight}px !important;
|
||||
// padding: 1.5rem !important;
|
||||
// box-sizing: border-box !important;
|
||||
// border: 1px solid #333 !important;
|
||||
// background-color: #fff !important;
|
||||
// }
|
||||
|
||||
.company-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 0.3em;
|
||||
}
|
||||
// .company-header {
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
// margin-bottom: 0.3em;
|
||||
// }
|
||||
|
||||
.company-logo {
|
||||
width: 2.8em;
|
||||
height: 2.8em;
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
// .company-logo {
|
||||
// width: 2.8em;
|
||||
// height: 2.8em;
|
||||
// margin-right: 0.5em;
|
||||
// }
|
||||
|
||||
.company-name {
|
||||
font-size: 0.95em;
|
||||
line-height: 1.1;
|
||||
}
|
||||
// .company-name {
|
||||
// font-size: 0.95em;
|
||||
// line-height: 1.1;
|
||||
// }
|
||||
|
||||
.english-name {
|
||||
font-size: 0.6em;
|
||||
opacity: 0.8;
|
||||
}
|
||||
// .english-name {
|
||||
// font-size: 0.6em;
|
||||
// opacity: 0.8;
|
||||
// }
|
||||
|
||||
.product-title {
|
||||
font-size: 1.4em;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
margin-bottom: 0.4em;
|
||||
border-bottom: 1.5px solid #000;
|
||||
padding-bottom: 0.2em;
|
||||
}
|
||||
// .product-title {
|
||||
// font-size: 1.4em;
|
||||
// font-weight: bold;
|
||||
// text-align: center;
|
||||
// margin-bottom: 0.4em;
|
||||
// border-bottom: 1.5px solid #000;
|
||||
// padding-bottom: 0.2em;
|
||||
// }
|
||||
|
||||
|
||||
.footer-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
font-size: 0.7em;
|
||||
margin-top: 0.3em;
|
||||
}
|
||||
// .footer-info {
|
||||
// display: flex;
|
||||
// justify-content: space-between;
|
||||
// align-items: flex-start;
|
||||
// font-size: 0.7em;
|
||||
// margin-top: 0.3em;
|
||||
// }
|
||||
|
||||
.address {
|
||||
line-height: 1.2;
|
||||
width: 65%;
|
||||
}
|
||||
// .address {
|
||||
// line-height: 1.2;
|
||||
// width: 65%;
|
||||
// }
|
||||
|
||||
.english-address {
|
||||
opacity: 0.8;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
// .english-address {
|
||||
// opacity: 0.8;
|
||||
// font-size: 0.9em;
|
||||
// }
|
||||
|
||||
.contact-timestamp {
|
||||
text-align: right;
|
||||
line-height: 1.4;
|
||||
}
|
||||
// .contact-timestamp {
|
||||
// text-align: right;
|
||||
// line-height: 1.4;
|
||||
// }
|
||||
|
||||
|
||||
/* 表格与单元格样式(解决空单元格问题) */
|
||||
table {
|
||||
border-collapse: collapse !important;
|
||||
width: 100% !important;
|
||||
table-layout: fixed !important; /* 固定列宽 */
|
||||
}
|
||||
// /* 表格与单元格样式(解决空单元格问题) */
|
||||
// table {
|
||||
// border-collapse: collapse !important;
|
||||
// width: 100% !important;
|
||||
// table-layout: fixed !important; /* 固定列宽 */
|
||||
// }
|
||||
|
||||
td {
|
||||
border: 1px solid #000 !important;
|
||||
padding: 6px 4px !important; /* 确保单元格大小 */
|
||||
min-height: 28px !important; /* 空单元格最小高度 */
|
||||
vertical-align: middle !important;
|
||||
text-align: center !important;
|
||||
word-break: break-all !important; /* 长文本换行 */
|
||||
font-family: "SimSun", serif !important;
|
||||
font-size: 14px !important;
|
||||
}
|
||||
// td {
|
||||
// border: 1px solid #000 !important;
|
||||
// padding: 6px 4px !important; /* 确保单元格大小 */
|
||||
// min-height: 28px !important; /* 空单元格最小高度 */
|
||||
// vertical-align: middle !important;
|
||||
// text-align: center !important;
|
||||
// word-break: break-all !important; /* 长文本换行 */
|
||||
// font-family: "SimSun", serif !important;
|
||||
// font-size: 14px !important;
|
||||
// }
|
||||
|
||||
/* 标签与值单元格样式 */
|
||||
.label-cell {
|
||||
font-weight: bold !important;
|
||||
background-color: #f5f5f5 !important;
|
||||
}
|
||||
// /* 标签与值单元格样式 */
|
||||
// .label-cell {
|
||||
// font-weight: bold !important;
|
||||
// background-color: #f5f5f5 !important;
|
||||
// }
|
||||
|
||||
.value-cell {
|
||||
background-color: #fff !important;
|
||||
}
|
||||
// .value-cell {
|
||||
// background-color: #fff !important;
|
||||
// }
|
||||
|
||||
/* 列宽分配(根据实际列数调整) */
|
||||
td { width: 25% !important; } /* 4列布局 */
|
||||
td[colspan="2"] { width: 50% !important; }
|
||||
td[colspan="3"] { width: 75% !important; }
|
||||
td[colspan="4"] { width: 100% !important; }
|
||||
`;
|
||||
// /* 列宽分配(根据实际列数调整) */
|
||||
// td { width: 25% !important; } /* 4列布局 */
|
||||
// td[colspan="2"] { width: 50% !important; }
|
||||
// td[colspan="3"] { width: 75% !important; }
|
||||
// td[colspan="4"] { width: 100% !important; }
|
||||
// `;
|
||||
|
||||
// 4. 调用print-js打印
|
||||
printJS({
|
||||
@@ -195,8 +195,8 @@ export default {
|
||||
type: 'html', // 打印类型为HTML
|
||||
header: null, // 不显示页眉
|
||||
footer: null, // 不显示页脚
|
||||
style: printStyles, // 注入打印样式
|
||||
scanStyles: false, // 禁用自动扫描页面样式(避免冲突)
|
||||
// style: printStyles, // 注入打印样式
|
||||
scanStyles: true, // 禁用自动扫描页面样式(避免冲突)
|
||||
targetStyles: ['*'], // 允许所有样式生效
|
||||
printContainer: true, // 打印指定容器
|
||||
onError: (error) => { // 错误处理
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
<script>
|
||||
import ProductInfo from '@/components/KLPService/Renderer/ProductInfo';
|
||||
import RawMaterialInfo from '@/components/KLPService/Renderer/RawMaterialInfo';
|
||||
import { getGenerateRecord } from '@/api/wms/generateRecord';
|
||||
import { addStockIoDetail } from '@/api/wms/stockIoDetail';
|
||||
|
||||
// 通用防抖高阶函数(可放在工具类中全局复用)
|
||||
@@ -150,21 +151,14 @@ export default {
|
||||
},
|
||||
|
||||
// 5. 实际的“JSON解析+提交”业务逻辑(纯业务,无防抖代码)
|
||||
actualParseAndSubmit(validValue) {
|
||||
async actualParseAndSubmit(validValue) {
|
||||
this.isLoading = true;
|
||||
try {
|
||||
// 1. 解析JSON
|
||||
const parsedData = JSON.parse(validValue);
|
||||
const res = await getGenerateRecord(validValue);
|
||||
const parsedData = JSON.stringify(res.data.content);
|
||||
|
||||
|
||||
// if (!this.isValid) {
|
||||
// this.inputHint = "解析的数据格式不完整,请检查二维码是否正确";
|
||||
// this.$message.warning({
|
||||
// message: "数据格式不完整",
|
||||
// duration: 2000,
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
this.result = parsedData;
|
||||
// 3. 解析成功:反馈+提交
|
||||
this.inputHint = "数据解析成功,可以提交操作";
|
||||
this.$message.success({
|
||||
@@ -196,7 +190,10 @@ export default {
|
||||
|
||||
this.isSubmitting = true;
|
||||
|
||||
addStockIoDetail(this.result)
|
||||
addStockIoDetail({
|
||||
...this.result,
|
||||
recordType: 1, // recordType为1标识扫码录入
|
||||
})
|
||||
.then(res => {
|
||||
this.$message.success({
|
||||
message: '操作成功',
|
||||
|
||||
@@ -18,21 +18,13 @@
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleStockBox">添加暂存单据</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleViewStockBox">查看暂存单据</el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
|
||||
|
||||
|
||||
<KLPTable v-loading="loading" :data="stockList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
@@ -64,16 +56,8 @@
|
||||
<el-table-column label="库存数量" align="center" prop="quantity" />
|
||||
<el-table-column label="在途数量" align="center" prop="onTheWay" />
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
<!-- <el-table-column label="批次号" align="center" prop="batchNo" /> -->
|
||||
<el-table-column label="批次号" align="center" prop="batchNo" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['wms:stock:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['wms:stock:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</KLPTable>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" align="center" prop="quantity" />
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
<!-- <el-table-column label="批次号" align="center" prop="batchNo" /> -->
|
||||
<el-table-column label="批次号" align="center" prop="batchNo" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
@@ -131,7 +131,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" align="center" prop="quantity" />
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
<!-- <el-table-column label="批次号" align="center" prop="batchNo" /> -->
|
||||
<el-table-column label="批次号" align="center" prop="batchNo" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
|
||||
Reference in New Issue
Block a user