|
@@ -154,7 +154,6 @@ import { mapGetters } from "vuex";
|
|
|
import TuiListCell from "@/components/plugin/list-cell";
|
|
import TuiListCell from "@/components/plugin/list-cell";
|
|
|
import AppUploader from "@/components/app-uploader";
|
|
import AppUploader from "@/components/app-uploader";
|
|
|
const form = require("@/utils/formValidation.js");
|
|
const form = require("@/utils/formValidation.js");
|
|
|
-// api
|
|
|
|
|
import { getCategory } from "@/utils/config";
|
|
import { getCategory } from "@/utils/config";
|
|
|
import { getDetailB, addB, updateB } from "@/api/goods";
|
|
import { getDetailB, addB, updateB } from "@/api/goods";
|
|
|
export default {
|
|
export default {
|
|
@@ -165,21 +164,17 @@ export default {
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- // 上架状态
|
|
|
|
|
status: 1,
|
|
status: 1,
|
|
|
form: {
|
|
form: {
|
|
|
goodsName: "",
|
|
goodsName: "",
|
|
|
stock: "",
|
|
stock: "",
|
|
|
price: "",
|
|
price: "",
|
|
|
categoryIdList: [],
|
|
categoryIdList: [],
|
|
|
- // goodsStyle: '1',
|
|
|
|
|
- // content: '',
|
|
|
|
|
autoRise: "1",
|
|
autoRise: "1",
|
|
|
needSend: "0",
|
|
needSend: "0",
|
|
|
freightType: "0",
|
|
freightType: "0",
|
|
|
shopImg: [],
|
|
shopImg: [],
|
|
|
briefContent: ""
|
|
briefContent: ""
|
|
|
- // goodsStyleList: [],
|
|
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
@@ -187,7 +182,6 @@ export default {
|
|
|
...mapGetters({ categoryData: "getCategory" })
|
|
...mapGetters({ categoryData: "getCategory" })
|
|
|
},
|
|
},
|
|
|
onLoad() {
|
|
onLoad() {
|
|
|
-
|
|
|
|
|
// this.init()
|
|
// this.init()
|
|
|
},
|
|
},
|
|
|
watch:{
|
|
watch:{
|
|
@@ -195,7 +189,6 @@ export default {
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
'form.categoryIdList'(val){
|
|
'form.categoryIdList'(val){
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -222,6 +215,7 @@ export default {
|
|
|
if (this.form.stock == -1) {
|
|
if (this.form.stock == -1) {
|
|
|
this.$set(this.form, "stock", "");
|
|
this.$set(this.form, "stock", "");
|
|
|
}
|
|
}
|
|
|
|
|
+ this.$set(this.form, "sold", res.data.sold);
|
|
|
this.$set(this.form, "shopImg", res.data.imgList)
|
|
this.$set(this.form, "shopImg", res.data.imgList)
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -231,12 +225,10 @@ export default {
|
|
|
this.$msg("请选择分类");
|
|
this.$msg("请选择分类");
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
if (this.form.shopImg.length == 0) {
|
|
if (this.form.shopImg.length == 0) {
|
|
|
this.$msg("请上传图片");
|
|
this.$msg("请上传图片");
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
let host = this.option.id ? updateB : addB;
|
|
let host = this.option.id ? updateB : addB;
|
|
|
let form = JSON.parse(JSON.stringify(this.form));
|
|
let form = JSON.parse(JSON.stringify(this.form));
|
|
|
form.shopImg = this.$util.imgSubstr(form.shopImg);
|
|
form.shopImg = this.$util.imgSubstr(form.shopImg);
|
|
@@ -254,7 +246,6 @@ export default {
|
|
|
this.$msg("操作成功!");
|
|
this.$msg("操作成功!");
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- // operate
|
|
|
|
|
selCategoryFn(item) {
|
|
selCategoryFn(item) {
|
|
|
let index = this.form.categoryIdList.findIndex(e => e == item.id);
|
|
let index = this.form.categoryIdList.findIndex(e => e == item.id);
|
|
|
if (index == -1) {
|
|
if (index == -1) {
|
|
@@ -302,7 +293,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
-
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.app-content {
|
|
.app-content {
|
|
|
min-height: calc(100vh - 100px);
|
|
min-height: calc(100vh - 100px);
|