dev2 #1
@ -12,17 +12,17 @@
|
||||
v-model="filter.barcode"
|
||||
class="input_item"
|
||||
clearable
|
||||
placeholder="请输入商品编码"
|
||||
placeholder="请输入商品条码"
|
||||
prefix-icon="el-icon-barcode"
|
||||
/>
|
||||
<el-select
|
||||
v-model="filter.barcodeEmty"
|
||||
clearable
|
||||
placeholder="编码是否为空"
|
||||
placeholder="条码是否为空"
|
||||
class="input_item"
|
||||
>
|
||||
<el-option label="无编码" value="yes" />
|
||||
<el-option label="有编码" value="no" />
|
||||
<el-option label="无条码" value="yes" />
|
||||
<el-option label="有条码" value="no" />
|
||||
</el-select>
|
||||
<el-button size="medium" type="primary" @click="handleSearch">
|
||||
查询
|
||||
@ -46,7 +46,7 @@
|
||||
<!-- 操作列:编辑 + 新增保存按钮 -->
|
||||
<el-table-column label="操作" width="100">
|
||||
<template #default="scope">
|
||||
<!-- 保存按钮:点击提交当前行编码修改 -->
|
||||
<!-- 保存按钮:点击提交当前行条码修改 -->
|
||||
<el-button
|
||||
plain
|
||||
size="mini"
|
||||
@ -135,7 +135,7 @@ export default {
|
||||
filter: {
|
||||
name: '',
|
||||
barcode: '',
|
||||
barcodeEmty: '', // 编码是否为空: 'yes'无编码, 'no'有编码
|
||||
barcodeEmty: '', // 条码是否为空: 'yes'无条码, 'no'有条码
|
||||
},
|
||||
multipleSelection: [],
|
||||
}
|
||||
@ -166,7 +166,7 @@ export default {
|
||||
this.tableData = (res.records || []).map(item => ({
|
||||
...item,
|
||||
saveLoading: false, // 保存按钮加载状态
|
||||
originalBarcode: item.barcode, // 存储原始编码,用于对比是否修改
|
||||
originalBarcode: item.barcode, // 存储原始条码,用于对比是否修改
|
||||
}))
|
||||
this.pagination.total = res.total || 0
|
||||
this.pagination.pages = res.pages || 0
|
||||
@ -226,17 +226,17 @@ export default {
|
||||
this.$refs.batchEditBarcode.open(this.multipleSelection);
|
||||
},
|
||||
|
||||
// 单条保存(提交当前行编码修改)
|
||||
// 单条保存(提交当前行条码修改)
|
||||
async handleSaveSingle(row) {
|
||||
// 编码未修改则不提交
|
||||
// 条码未修改则不提交
|
||||
if (row.barcode === row.originalBarcode) {
|
||||
this.$message.info('商品编码未修改,无需保存');
|
||||
this.$message.info('商品条码未修改,无需保存');
|
||||
return;
|
||||
}
|
||||
|
||||
// 校验:编码格式
|
||||
// 校验:条码格式
|
||||
if (row.barcode && row.barcode.length > 50) {
|
||||
this.$message.warning('商品编码长度不能超过50个字符');
|
||||
this.$message.warning('商品条码长度不能超过50个字符');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -247,21 +247,21 @@ export default {
|
||||
// 调用接口提交(复用批量编辑接口,单条也按数组格式传参)
|
||||
const updateData = [{
|
||||
id: row.id,
|
||||
barcode: row.barcode || '', // 空值也提交(清除编码)
|
||||
barcode: row.barcode || '', // 空值也提交(清除条码)
|
||||
}];
|
||||
let res=await GoodsToolApi.saveBatchBarcode(updateData);
|
||||
if(res.status==200){
|
||||
// 保存成功:更新原始编码,提示用户
|
||||
// 保存成功:更新原始条码,提示用户
|
||||
row.originalBarcode = row.barcode;
|
||||
this.$message.success('商品编码保存成功');
|
||||
this.$message.success('商品条码保存成功');
|
||||
}else{
|
||||
this.$message.error('操作异常');
|
||||
}
|
||||
} catch (error) {
|
||||
// 保存失败:回滚编码,提示错误
|
||||
// 保存失败:回滚条码,提示错误
|
||||
row.barcode = row.originalBarcode;
|
||||
this.$message.error('保存失败,请重试');
|
||||
console.error('单条保存编码失败:', error);
|
||||
console.error('单条保存条码失败:', error);
|
||||
} finally {
|
||||
// 无论成功失败,关闭加载状态
|
||||
row.saveLoading = false;
|
||||
@ -271,7 +271,7 @@ export default {
|
||||
|
||||
handleBarcodeChange(row) {
|
||||
if (row.barcode && row.barcode.length > 50) {
|
||||
this.$message.warning('商品编码长度不能超过50个字符');
|
||||
this.$message.warning('商品条码长度不能超过50个字符');
|
||||
}
|
||||
},
|
||||
|
||||
@ -335,7 +335,7 @@ export default {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
// 调整编码输入框样式,使其更贴合表格
|
||||
// 调整条码输入框样式,使其更贴合表格
|
||||
.barcode-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@ -12,6 +12,14 @@
|
||||
<div class="item-content" v-if="!showLoading">
|
||||
<div class="item-title">基本信息</div>
|
||||
<div class="item-info">
|
||||
<div class="item-block">
|
||||
<div class="item-lable">入驻编号</div>
|
||||
<el-input
|
||||
class="item-input"
|
||||
v-model="form.id"
|
||||
disabled
|
||||
/>
|
||||
</div>
|
||||
<div class="item-block">
|
||||
<div class="item-lable">店铺 ID</div>
|
||||
<el-input
|
||||
@ -769,9 +777,9 @@
|
||||
<el-step title="审核状态" :description="formatApprovalStatus(form.approval_status)"></el-step>
|
||||
<el-step title="合同状态" :description="form.has_ec_signed == 1 ? '成功' : '未签署'"></el-step>
|
||||
<el-step title="进件状态" :description="form.has_apply_mer == 1 ? '成功' : '未进件'"></el-step>
|
||||
<el-step title="店铺创建状态" :description="form.store_status == 1 ? '已创建' : '未创建'"></el-step>
|
||||
<el-step title="分账业务申请状态" :description="form.has_apply_split == 1 ? '已申请' : '未申请'"></el-step>
|
||||
<el-step title="分账接收方绑定状态" :description="form.has_apply_split == 1 ? '已绑定' : '未绑定'"></el-step>
|
||||
<el-step title="店铺创建状态" :description="form.store_status == 1 ? '已创建' : '未创建'"></el-step>
|
||||
<el-step title="入驻完成" :description="form.approval_status == 1 ? '已完成' : '未完成'"></el-step>
|
||||
</el-steps>
|
||||
<!-- <div class="item-info">
|
||||
@ -1049,6 +1057,7 @@ export default {
|
||||
formConfig: JSON.parse(JSON.stringify(config)),
|
||||
cityData: JSON.parse(JSON.stringify(city.cityData)),
|
||||
form: {
|
||||
id:'',
|
||||
login_mobile: '66',
|
||||
store_id: '1',
|
||||
store_name: '',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user