shish 6 лет назад
Родитель
Сommit
58d351cd97
1 измененных файлов с 1 добавлено и 11 удалено
  1. 1 11
      store/src/admin/goodsManage/add.vue

+ 1 - 11
store/src/admin/goodsManage/add.vue

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