-
{{scope.column.label}}
-
+
+ {{ scope.column.label }}
+
- {{scope.column.label}}
+ {{ scope.column.label }}
@@ -269,11 +295,15 @@
+
item.property === 'item_unit_price');
+ if (
+ this.configs.config.supplier_market_enable &&
+ 2 == this.configs.store_type
+ ) {
+ const unitPriceIndex = this.expHead.findIndex(
+ (item) => item.property === 'item_unit_price'
+ )
if (unitPriceIndex !== -1) {
- this.expHead[unitPriceIndex].label = this.__('成本价');
+ this.expHead[unitPriceIndex].label = this.__('成本价')
this.expHead.splice(unitPriceIndex + 1, 0, {
label: this.__('建议零售价'),
property: 'item_advice_price',
- });
+ })
}
- const unitIndex = this.virtualHead.findIndex(item => item.property === 'item_unit_price');
+ const unitIndex = this.virtualHead.findIndex(
+ (item) => item.property === 'item_unit_price'
+ )
if (unitIndex !== -1) {
- this.virtualHead[unitIndex].label = this.__('成本价');
+ this.virtualHead[unitIndex].label = this.__('成本价')
this.virtualHead.splice(unitIndex + 1, 0, {
label: this.__('建议零售价'),
property: 'item_advice_price',
- });
+ })
}
}
},
@@ -1663,6 +1715,9 @@
item_advice_price: undefined,
item_unit_points: undefined,
item_quantity: undefined,
+ // 新增:初始化次日补全相关字段
+ is_open_automatic: '0', // 默认0不开启
+ automatic: undefined, // 默认空(后续可输入具体值)
}
this.specData.push(obj)
return
@@ -1765,7 +1820,6 @@
this.row = Object.assign({}, row)
if (row != null) {
-
this.categoryId = row.category_id
this.productForm.category_id = row.category_id
this.productForm.text_category_id = row.category_name
@@ -1788,7 +1842,7 @@
async onCategoryChange(row) {
console.info(row)
if (row.length > 0) {
- const category_id = row[row.length-1];
+ const category_id = row[row.length - 1]
const category = this.findTree(this.categoryOptions, category_id)
if (category != null) {
@@ -1891,12 +1945,19 @@
const specData = this.specData
for (let i = 0; i < specData.length; i++) {
- if (specData[i].item_unit_price <= 0 && specData[i].item_unit_points <= 0) {
+ if (
+ specData[i].item_unit_price <= 0 &&
+ specData[i].item_unit_points <= 0
+ ) {
this.$baseMessage('商品零售价及积分不能同时为0', 'warning')
return
}
- if (this.configs.config.supplier_market_enable && 2 == this.configs.store_type && specData[i].item_advice_price <= 0) {
+ if (
+ this.configs.config.supplier_market_enable &&
+ 2 == this.configs.store_type &&
+ specData[i].item_advice_price <= 0
+ ) {
this.$baseMessage('商品建议零售价不能为0', 'warning')
return
}
@@ -1968,7 +2029,7 @@
},
async getType(type_id) {
const { data } = await get({ type_id: type_id })
- if(data){
+ if (data) {
this.brands = data.brands
this.assists = data.assists
this.specs = data.specs
@@ -1979,7 +2040,6 @@
this.initAssistArr(this.assists)
this.initCheckSpecArr(this.specs)
}
-
},
// 初始化vue属性 assistArr
initAssistArr(assists) {
@@ -2055,20 +2115,20 @@
async getCategoryTree() {
const { data } = await getCategoryTree()
- const treeData = this.tree(data);
+ const treeData = this.tree(data)
console.info(treeData)
//遍历,将空子集设置为null
- this.categoryOptions = treeData;
+ this.categoryOptions = treeData
},
tree(data) {
for (let i = 0; i < data.length; i++) {
- let item = data[i];
+ let item = data[i]
// item.sub 不等于 undefined && item.sub.length 大于 0 时
if (item.sub && item.sub.length > 0) {
- item.sub = this.tree(item.sub);
+ item.sub = this.tree(item.sub)
} else {
- delete item.sub;
+ delete item.sub
}
}
@@ -2076,7 +2136,7 @@
},
findTree(data, idx) {
for (let i = 0; i < data.length; i++) {
- let item = data[i];
+ let item = data[i]
if (item.category_id == idx) {
return item
@@ -2084,9 +2144,9 @@
// item.sub 不等于 undefined && item.sub.length 大于 0 时
if (item.sub && item.sub.length > 0) {
- const tmp = this.findTree(item.sub, idx);
+ const tmp = this.findTree(item.sub, idx)
if (tmp != null) {
- return tmp;
+ return tmp
}
}
}
@@ -2216,7 +2276,7 @@
},
// 获取选中的表头宽度
- getItemWidth (property) {
+ getItemWidth(property) {
let width = null
switch (property) {
@@ -2251,21 +2311,21 @@
return width
},
- batOper (e) {
- const key = e.target.dataset.key;
- let title = "";
- if (key == "item_market_price") {
- title = this.__('批量设置市场价');
- } else if (key == "item_unit_price") {
- title = this.__('批量设置价格');
- } else if (key == "item_unit_points") {
- title = this.__('批量设置积分');
- } else if (key == "item_quantity") {
- title = this.__('批量设置库存');
- } else if (key == "item_weight") {
- title = this.__('批量设置重量');
- } else if (key == "item_advice_price") {
- title = this.__('批量设置建议零售价');
+ batOper(e) {
+ const key = e.target.dataset.key
+ let title = ''
+ if (key == 'item_market_price') {
+ title = this.__('批量设置市场价')
+ } else if (key == 'item_unit_price') {
+ title = this.__('批量设置价格')
+ } else if (key == 'item_unit_points') {
+ title = this.__('批量设置积分')
+ } else if (key == 'item_quantity') {
+ title = this.__('批量设置库存')
+ } else if (key == 'item_weight') {
+ title = this.__('批量设置重量')
+ } else if (key == 'item_advice_price') {
+ title = this.__('批量设置建议零售价')
}
this.$prompt(title, {
@@ -2284,7 +2344,7 @@
this.$forceUpdate()
})
.catch(() => {})
- }
+ },
},
}
@@ -2300,7 +2360,7 @@
}
::v-deep {
- .el-dialog__body{
+ .el-dialog__body {
padding-top: 10px;
}
@@ -2309,10 +2369,10 @@
margin: 0 5px;
}
- .pic-upload-source{
+ .pic-upload-source {
padding: 0;
- .pic-upload-source-box{
+ .pic-upload-source-box {
height: 50px;
line-height: 50px;
}
diff --git a/src/views/product/productList/components/addProductEdit.vue b/src/views/product/productList/components/addProductEdit.vue
index 6d405bc..6928389 100644
--- a/src/views/product/productList/components/addProductEdit.vue
+++ b/src/views/product/productList/components/addProductEdit.vue
@@ -292,6 +292,12 @@
:active-value="1001"
:inactive-value="1002"
/>
+
handleInput(e, scope)"
/>
+ handleInput(e, scope)"
+ />