修改商品查询页面

This commit is contained in:
zm2000 2026-08-12 14:08:50 +08:00
parent 2aecd0e863
commit 45694c1942
4 changed files with 13 additions and 13 deletions

4
env.js
View File

@ -1,4 +1,4 @@
// export const BASE_URL = 'http://qimen.wms.gztbyc.com' //生产环境接口地址
export const BASE_URL = 'http://192.168.11.56:6060' //开发环境接口地址
export const BASE_URL = 'http://qimen.wms.gztbyc.com' //生产环境接口地址
// export const BASE_URL = 'http://192.168.11.56:6060' //开发环境接口地址
export const API_URL = `${BASE_URL}/system` //后台接口域名
export const IMG_URL = 'https://ye4s.file.gzxunren.com' //全局网络图片地址变量,css背景图片地址变量在uni.scss

View File

@ -65,7 +65,7 @@
<view class="item-info">
<view class="compact-row">
<text class="compact-label">商品编码:</text>
<text class="compact-value">{{ item.goods_code || item.item_code || '--' }}</text>
<text class="compact-value">{{ item.item_code || item.goods_code || '--' }}</text>
</view>
<view class="compact-row">
<text class="compact-label">条码:</text>

View File

@ -10,7 +10,7 @@
<u-input v-model="formData.item_name" placeholder="请输入商品名称" clearable></u-input>
</u-form-item>
<u-form-item label="商品编码">
<u-input v-model="formData.goods_code" placeholder="请输入商品编码" clearable></u-input>
<u-input v-model="formData.item_code" placeholder="请输入商品编码" clearable></u-input>
</u-form-item>
<u-form-item label="商品条码">
<u-input v-model="formData.barcodes" placeholder="多个条码用分号(;)分隔" clearable></u-input>
@ -259,8 +259,8 @@ export default {
...cached
};
this.formData.item_name = String(cached.item_name || cached.product_name || cached.name || '');
this.formData.goods_code = String(cached.goods_code || cached.item_code || '');
this.formData.item_code = String(cached.item_code || '');
this.formData.item_code = String(cached.item_code || cached.goods_code || '');
this.formData.goods_code = String(cached.goods_code || '');
this.formData.barcodes = this.normalizeBarcodeDisplay(cached);
this.formData.brand_name = String(cached.brand_name || '');
this.formData.sku_property = String(cached.sku_property || '');
@ -1227,13 +1227,13 @@ export default {
return;
}
const itemCode = String(this.formData.goods_code || '').trim();
if (!itemCode) {
// 商品编码即 item_code(真实商品编码,如 011000001536),货品编码 goods_code 单独维护
const saveItemCode = String(this.formData.item_code || this.formData.goods_code || '').trim();
if (!saveItemCode) {
this.showToastMessage('请输入商品编码');
return;
}
// 真实商品编码优先取 item_code(如 011000001536),无则回退到商品编码输入值
const saveItemCode = String(this.formData.item_code || '').trim() || itemCode;
const goodsCode = String(this.formData.goods_code || saveItemCode).trim();
const stockUnit = String(this.formData.stock_unit || '').trim();
if (!stockUnit) {
@ -1364,7 +1364,7 @@ export default {
box_height: Number(this.formData.box_height) || 0,
box_volume: Number(this.formData.box_volume) || 0,
box_unit: String((this.rawItem && this.rawItem.box_unit) || ''),
goods_code: itemCode
goods_code: goodsCode
};
if (recordId) {
@ -1412,7 +1412,7 @@ export default {
item_name: itemName,
product_name: itemName,
name: itemName,
goods_code: itemCode,
goods_code: goodsCode,
item_code: saveItemCode,
barcodes: barcodeList,
barcode: barcodeList[0] || (this.rawItem && this.rawItem.barcode) || '',

View File

@ -88,7 +88,7 @@
</view>
<view class="item-row">
<text class="label">商品编码:</text>
<text class="value">{{ item.goods_code || item.item_code || '--' }}</text>
<text class="value">{{ item.item_code || item.goods_code || '--' }}</text>
</view>
<view class="item-row">
<text class="label">条码:</text>