编辑商品详情

This commit is contained in:
15386982806
2024-01-16 17:54:28 +08:00
parent c47394a162
commit 7ba94c7fe1
4 changed files with 41 additions and 40 deletions

View File

@@ -3,14 +3,10 @@ var BASE = {
* @description api请求基础路径
*/
API_DEV: {
// common: "https://common-api.pickmall.cn",
// buyer: "https://buyer-api.pickmall.cn",
// seller: "https://store-api.pickmall.cn",
// manager: "https://admin-api.pickmall.cn"
common: "http://192.168.31.225:8890",
buyer: "http://192.168.31.225:8888",
seller: "http://192.168.31.225:8889",
manager: "http://192.168.31.225:8887"
common: "https://common-api.pickmall.cn",
buyer: "https://buyer-api.pickmall.cn",
seller: "https://store-api.pickmall.cn",
manager: "https://admin-api.pickmall.cn"
},
API_PROD: {
common: "https://common-api.pickmall.cn",

View File

@@ -3,14 +3,10 @@ var BASE = {
* @description api请求基础路径
*/
API_DEV: {
// common: "https://common-api.pickmall.cn",
// buyer: "https://buyer-api.pickmall.cn",
// seller: "https://store-api.pickmall.cn",
// manager: "https://admin-api.pickmall.cn",
common: "http://192.168.31.225:8890",
buyer: "http://192.168.31.225:8888",
seller: "http://192.168.31.225:8889",
manager: "http://192.168.31.225:8887"
common: "https://common-api.pickmall.cn",
buyer: "https://buyer-api.pickmall.cn",
seller: "https://store-api.pickmall.cn",
manager: "https://admin-api.pickmall.cn",
},
API_PROD: {
common: "https://common-api.pickmall.cn",

View File

@@ -3,14 +3,10 @@ var BASE = {
* @description api请求基础路径
*/
API_DEV: {
// common: "https://common-api.pickmall.cn",
// buyer: "https://buyer-api.pickmall.cn",
// seller: "https://store-api.pickmall.cn",
// manager: "https://admin-api.pickmall.cn",
common: "http://192.168.31.225:8890",
buyer: "http://192.168.31.225:8888",
seller: "http://192.168.31.225:8889",
manager: "http://192.168.31.225:8887"
common: "https://common-api.pickmall.cn",
buyer: "https://buyer-api.pickmall.cn",
seller: "https://store-api.pickmall.cn",
manager: "https://admin-api.pickmall.cn",
},
API_PROD: {
common: "https://common-api.pickmall.cn",

View File

@@ -196,7 +196,7 @@
</Card>
</div>
</Form>
{{skuInfo}}
<!--{{skuInfo}}-->
<Button class="add-sku-btn" size="small" type="primary" @click="addSkuItem">添加规格项
</Button>
&nbsp;
@@ -1197,9 +1197,20 @@ export default {
this.$Message.error("已存在相同规格项!");
return;
}
// if (this.zz(0, val) > 20) {
// this.$Message.error("规格项最多十个字符长度!");
// return;
// }
if (this.zz(0, val) > 20) {
this.$Message.error("规格最多十个字符长度!");
return;
this.$Message.error("规格最多十个字符长度!");
// val = val.toString().slice(0, 4);
this.$forceUpdate();// 调用该方法会触发组件的重新渲染
// val = this.truncateString(val);
this.skuInfo[index].name = this.truncateString(val);
// this.$set(this.skuInfo[$index].spec_values[index], 'value', this.truncateString(val));
// this.$set(item, 'value', this.truncateString(val));
this.$forceUpdate();// 调用该方法会触发组件的重新渲染
// return;
}
this.skuTableData = this.skuTableData.map((e) => {
e[val] = e[this.currentSkuItem];
@@ -1238,12 +1249,20 @@ export default {
break;
}
}
console.log('根据统计得到的字节数进行切片并返回结果', str, str.substr(0, Math.floor((count - 1) / 2)));
return str.substr(0, Math.floor((count - 1) / 2)); // 根据统计得到的字节数进行切片并返回结果
// console.log('根据统计得到的字节数进行切片并返回结果', str, str.substr(0, Math.floor((count - 1) / 2)));
return str.substr(0, Math.floor((count + 1) / 2)); // 根据统计得到的字节数进行切片并返回结果
}
},
// 编辑规格值
skuValueChange(val, index, item, $index) {
if (this.skuTableData.find((i) => i[val.name] === val.value)) {
this.$Message.error("已存在相同规格值!");
return;
}
if (val.value === '') {
this.$Message.error("规格值不能为空!");
return;
}
if (this.zz(0, val.value) > 20) {
this.$Message.error("规格值最多十个字符长度!");
// val.value = val.value.toString().slice(0, 4);
@@ -1253,17 +1272,12 @@ export default {
// this.$set(this.skuInfo[$index].spec_values[index], 'value', this.truncateString(val.value));
// this.$set(item, 'value', this.truncateString(val.value));
this.$forceUpdate();// 调用该方法会触发组件的重新渲染
return;
}
console.log('编辑规格值改变', item);
if (this.skuTableData.find((i) => i[val.name] === val.value)) {
this.$Message.error("已存在相同规格值!");
return;
}
if (val.value === '') {
this.$Message.error("规格值不能为空!");
return;
// return;
}
// console.log('编辑规格值改变', item);
let curVal = this.currentSkuVal;
this.skuTableData = this.skuTableData.map((e) => {
if (e[val.name] === curVal) {
@@ -1467,7 +1481,6 @@ export default {
key: columnName,
});
});
console.log('渲染头部', this.skuInfo);
// 有成本价和价格的情况
if (this.baseInfoForm.salesModel !== "WHOLESALE") {
pushData.push(