Ver Fonte

商品规格修改

谢杰标 há 2 anos atrás
pai
commit
a157f3b994
1 ficheiros alterados com 31 adições e 8 exclusões
  1. 31 8
      src/views/Marketing/goods/commodityManageMent/index.vue

+ 31 - 8
src/views/Marketing/goods/commodityManageMent/index.vue

@@ -39,7 +39,10 @@
           type="text"
           @click="setTeacher(props.scope.row)"
           >双师制设置</el-button
-        ><el-button v-if="props.scope.row.examRecord" type="text" @click="$refs.dayPracticeSet.open(props.scope.row.goodsId)"
+        ><el-button
+          v-if="props.scope.row.examRecord"
+          type="text"
+          @click="$refs.dayPracticeSet.open(props.scope.row.goodsId)"
           >每日一练设置</el-button
         >
         <el-button type="text" @click="addClick(props.scope.row, 0)"
@@ -74,6 +77,18 @@
           />
         </div>
       </div>
+      <div style="margin-bottom: 10px">
+        <!-- 搜索框 -->
+        <el-input
+          style="width: 230px; margin: 0px 10px"
+          size="small"
+          v-model="specFormData.templateName"
+          placeholder="商品规格模板名称"
+        ></el-input>
+        <el-button size="small" type="primary" @click="searchGoodsSpecList(specFormData.goodsId)"
+          >查询</el-button
+        >
+      </div>
       <table-list
         :tableSets="dialogTableSet"
         :tableData="dialogTableData"
@@ -368,7 +383,7 @@ export default {
           hidden: true,
         },
       ],
-      dialogTableData: [{}],
+      dialogTableData: [],
       dialogNavText: {
         index: 0,
         num: false,
@@ -387,7 +402,10 @@ export default {
         },
       },
       tableRadio: "",
-      activeGoodsId: {},
+      specFormData: {
+        templateName: "",
+        goodsId: "",
+      },
     };
   },
   mounted() {
@@ -436,13 +454,18 @@ export default {
         .catch(() => {});
     },
     openClassNum(id) {
-      this.activeGoodsId = id;
-      let { specTemplateId } = this.tableData.find((e) => e.goodsId == id);
-      this.tableRadio = specTemplateId || "";
+      this.specFormData.goodsId = id;
+      this.tableRadio = "";
+      // let { specTemplateId } = this.tableData.find((e) => e.goodsId == id);
+      // this.tableRadio = specTemplateId || "";
+      this.searchGoodsSpecList(id);
+      this.dialogVisible = true;
+    },
+    searchGoodsSpecList(id) {
+      // this.specFormData
       getGoodsSpecList(id).then((res) => {
         this.dialogTableData = res.data;
       });
-      this.dialogVisible = true;
     },
     editInfo(v) {
       this.addClick(v, 0);
@@ -604,7 +627,7 @@ export default {
         });
       }
       goodsUpdateSpec({
-        goodsId: this.activeGoodsId,
+        goodsId: this.specFormData.goodsId,
         specTemplateId: this.tableRadio,
       }).then((res) => {
         this.dialogVisible = false;