点击加载sku数据
-
+
@@ -349,7 +335,7 @@
![]()
+ @click="handleView(item.url)" />
@@ -359,16 +345,11 @@
+ @on-select-change="selectTree" @on-check-change="changeSelect">
-
+
@@ -376,12 +357,7 @@
-
+
@@ -393,12 +369,12 @@
+ @click="refresh('template')">
+ prop="weight">
- kg
+ kg
其他信息
@@ -426,24 +402,24 @@
@@ -488,8 +465,8 @@ import cloneObj from "@/utils/index";
import vuedraggable from "vuedraggable";
import tinymec from "@/views/lili-components/editor/index.vue";
-import {uploadFile} from "@/libs/axios";
-import {regular} from "@/utils";
+import { uploadFile } from "@/libs/axios";
+import { regular } from "@/utils";
import DPlayer from 'dplayer';
// import ossManage from "@/views/sys/oss-manage/ossManage";
import ossManage from "@/views/shop/ossManages";
@@ -657,9 +634,9 @@ export default {
validateError: [],
baseInfoFormRule: {
goodsName: [regular.REQUIRED, regular.WHITE_SPACE, regular.VARCHAR60],
- price: [regular.REQUIRED, {validator: checkPrice}],
+ price: [regular.REQUIRED, { validator: checkPrice }],
sellingPoint: [regular.REQUIRED, regular.VARCHAR60],
- goodsUnit: [{required: true, message: "请选择计量单位"}],
+ goodsUnit: [{ required: true, message: "请选择计量单位" }],
name: [regular.REQUIRED, regular.VARCHAR5],
value: [regular.REQUIRED, regular.VARCHAR60],
templateId: [regular.REQUIRED],
@@ -811,7 +788,7 @@ export default {
) {
this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[
paramsIndex
- ] = {
+ ] = {
paramName: "",
paramValue: "",
isIndex: "",
@@ -822,7 +799,7 @@ export default {
}
this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[
paramsIndex
- ] = {
+ ] = {
paramName: params.paramName,
paramValue: value,
isIndex: params.isIndex,
@@ -1002,7 +979,7 @@ export default {
this.selectedSku.images !== undefined &&
this.selectedSku.images.length > 5;
if (check) {
- this.$Notice.warning({title: "图片数量不能大于五张"});
+ this.$Notice.warning({ title: "图片数量不能大于五张" });
return false;
}
},
@@ -1073,7 +1050,7 @@ export default {
response.result.recommend
? (response.result.recommend = 1)
: (response.result.recommend = 0);
- this.baseInfoForm = {...this.baseInfoForm, ...response.result};
+ this.baseInfoForm = { ...this.baseInfoForm, ...response.result };
this.baseInfoForm.release = 1; //即使是被放入仓库,修改的时候也会显示会立即发布
this.categoryId = response.result.categoryPath.split(",")[2];
@@ -1121,7 +1098,7 @@ export default {
this.baseInfoForm.categoryPath = cateId.toString();
}
this.firstData.goodsType &&
- (this.baseInfoForm.goodsType = this.firstData.goodsType);
+ (this.baseInfoForm.goodsType = this.firstData.goodsType);
/** 查询商品参数 */
this.GET_GoodsParams();
},
@@ -1262,7 +1239,7 @@ export default {
}
// 写入对象,下标,具体对象
this.$set(this.skuInfo, this.skuInfo.length, {
- spec_values: [{name: "", value: "", images: []}],
+ spec_values: [{ name: "", value: "", images: [] }],
name: "",
});
@@ -1832,6 +1809,25 @@ export default {
this.$Message.error("存在重复规格值!");
return;
}
+ console.log(this.baseInfoForm.goodsParamsDTOList)
+ let checkFlag = false;
+ this.goodsParams.forEach(group => {
+ group.params.forEach(param => {
+ if(param.required){
+ const check = this.baseInfoForm.goodsParamsDTOList.some(paramsGroup =>
+ paramsGroup.some(paramsItem => paramsItem.paramId === param.id)
+ );
+ if(!check){
+ checkFlag = !check;
+
+ }
+ }
+ })
+ })
+ if(checkFlag){
+ this.$Message.error("存在未填写的参数项");
+ return;
+ }
this.submitLoading = true;
this.$refs["baseInfoForm"].validate((valid) => {
if (valid) {
@@ -1998,7 +1994,7 @@ export default {
API_GOODS.saveDraftGoods(this.baseInfoForm).then((res) => {
if (res.success) {
this.$Message.info("保存成功!");
- this.$router.push({name: "template-goods"});
+ this.$router.push({ name: "template-goods" });
}
});
},
@@ -2068,9 +2064,7 @@ export default {
text-align: left;
}
-#dplayer {
-
-}
+#dplayer {}
/* .tox-notifications-container{
display: none !important;