✨ feat: 二维码增加状态放置重复扫描,增加批次号
This commit is contained in:
@@ -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: '操作成功',
|
||||
|
||||
Reference in New Issue
Block a user