From 3e1616df0025a190014f7be08f26a90cf7311a5e Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期三, 23 七月 2025 17:57:39 +0800 Subject: [PATCH] 规格自动生成货号 --- seller/src/views/goods/goods-seller/goodsOperationSec.vue | 30 +++++++++++++++++++----------- 1 files changed, 19 insertions(+), 11 deletions(-) diff --git a/seller/src/views/goods/goods-seller/goodsOperationSec.vue b/seller/src/views/goods/goods-seller/goodsOperationSec.vue index 20d098b..08ba8d7 100644 --- a/seller/src/views/goods/goods-seller/goodsOperationSec.vue +++ b/seller/src/views/goods/goods-seller/goodsOperationSec.vue @@ -327,9 +327,9 @@ overflow-x: hidden; } "> - <template slot="sn" slot-scope="{ row }"> - <Input v-model="row.sn" clearable placeholder="璇疯緭鍏ヨ揣鍙�" - @on-change="updateSkuTable(row, 'sn')"/> + <template slot="sn" slot-scope="{ row, index }"> + <Input v-model="row.sn" placeholder="璇疯緭鍏ヨ揣鍙�" disabled + @on-change="updateSkuTable(row, 'sn')" /> </template> <div v-if="baseInfoForm.goodsType !== 'VIRTUAL_GOODS'" slot="weight" slot-scope="{ row }"> <Input v-model="row.weight" clearable placeholder="璇疯緭鍏ラ噸閲�" @@ -1703,6 +1703,7 @@ this.baseInfoForm.regeneratorSkuFlag = true; this.newSkuValues[$index] = ""; } + this.renderTableData(this.skuTableData); }, handleClearSku() { this.skuInfo = []; @@ -1756,14 +1757,14 @@ ); } // 棰勫敭妯″紡 - if (this.baseInfoForm.salesModel !== "PRESALE") { - pushData.push( - { - title: "棰勫敭鏃堕棿", - slot: "price", - } - ); - } + // if (this.baseInfoForm.salesModel !== "PRESALE") { + // pushData.push( + // { + // title: "棰勫敭鏃堕棿", + // slot: "price", + // } + // ); + // } if (this.baseInfoForm.salesModel === "WHOLESALE" && this.wholesaleData) { this.wholesaleData.forEach((item, index) => { pushData.push({ @@ -1819,6 +1820,7 @@ * array spec鏁版嵁 */ specIterator(result, spec, skus) { + let table = result; if (spec.length > 0) { //娓呴櫎褰撳墠寰幆鐨勫垎缁� @@ -1860,6 +1862,11 @@ } else { this.skuIndex++; } + + table.forEach((item,index) =>{ + console.log("鍏冪礌:" + item +"index:" + (index +1)) + item.sn = index + 1; + }) return table; }, /** 鏍规嵁鍒嗙被id鑾峰彇绯荤粺璁剧疆瑙勬牸淇℃伅*/ @@ -1917,6 +1924,7 @@ return; } } + // else if (item === "alertQuantity") { // if ( // !/^[0-9]\d*$/.test(row[item]) || -- Gitblit v1.8.0