xiexaing 1 年間 前
コミット
a0e5a6674a

+ 16 - 13
src/views/Marketing/productPackManage/component/editGoodsPack.vue

@@ -71,7 +71,10 @@
               </el-option>
             </el-select>
           </el-form-item>
-          <el-form-item label="上传主图" props="mainImg">
+          <el-form-item
+            label="上传主图"
+            prop="mainImg"
+          >
             <div
               style="
                 width: 120px;
@@ -113,7 +116,7 @@
           </el-form-item>
           <el-form-item label="状态" prop="status">
             <el-radio-group v-model="ruleForm.status">
-              <el-radio :label="1">启</el-radio>
+              <el-radio :label="1">启</el-radio>
               <el-radio :label="0">关闭</el-radio>
             </el-radio-group>
           </el-form-item>
@@ -127,7 +130,7 @@
       </span>
     </el-dialog>
 
-    <matchingDialog ref="matchingDialog" @close="isEditDialog = false"  />
+    <matchingDialog ref="matchingDialog" @close="isEditDialog = false" />
   </div>
 </template>
   
@@ -149,16 +152,16 @@ export default {
           { required: true, message: "请输入商品包名称", trigger: "blur" },
         ],
         educationTypeId: [
-          { required: true, message: "请选择教育类型", trigger: "blur" },
+          { required: true, message: "请选择教育类型", trigger: "blur"  },
         ],
         businessId: [
-          { required: true, message: "请选择业务层次", trigger: "blur" },
+          { required: true, message: "请选择业务层次", trigger: "blur"  },
         ],
         gradeType: [
           { required: true, message: "请选择班级类型", trigger: "blur" },
         ],
-        mainImg: [{ required: true, message: "主图", trigger: "blur" }],
-        status: [{ required: true, message: "状态", trigger: "blur" }],
+        status: [{ required: true, message: "状态", trigger: "blur"  }],
+        mainImg : [{ required: true, message: "未上传主图", trigger: "blur"  }]
       },
       gradeType: [
         {
@@ -183,7 +186,7 @@ export default {
     // 获取业务层次-项目类型列表
     "ruleForm.educationTypeId": {
       handler: function () {
-        if (this.isBusinessId) this.$set(this.ruleForm, 'businessId', null)
+        if (this.isBusinessId) this.$set(this.ruleForm, "businessId", null);
         this.$api
           .inquirebusinessList({
             status: 1,
@@ -191,10 +194,11 @@ export default {
           })
           .then((res) => {
             this.newBusinessList = res.rows;
-            this.isBusinessId = true
           });
+        this.isBusinessId = true;
       },
-      immediate: false
+      immediate: true,
+      deep: true
     },
   },
   mounted() {},
@@ -211,17 +215,16 @@ export default {
         this.ruleForm = {};
         return;
       }
-      console.log(row, "row");
       this.dialogTitle = "修改";
       this.ruleForm = JSON.parse(JSON.stringify(row));
-      this.isBusinessId = false
+      this.newBusinessList = [];
+      this.isBusinessId = false;
     },
     close() {
       this.$emit("refresh");
     },
     submitForm() {
       this.$refs["ruleForm"].validate((valid) => {
-        console.log(valid, "rule");
         if (valid) {
           this.disabledBtn = true;
           const _request =

+ 7 - 5
src/views/Marketing/productPackManage/component/matchingDialog.vue

@@ -20,12 +20,12 @@
       <div>
         <div>
           教育类型:{{ queryData.educationName }}
-          <span style="margin: 0 25px;">业务层次:{{queryData.projectName}} </span>
+          <span style="margin: 0 25px;">业务层次:{{queryData.projectName + ' - ' + queryData.businessName }} </span>
           班级类型:{{
             queryData.gradeType === 1
               ? "基础班"
               : queryData.gradeType === 2
-              ? "强化班"
+              ? "强化班" 
               : "私塾班"
           }}
         </div>
@@ -263,6 +263,8 @@ export default {
     getSeachData(type) {
       this.subLoading = true
       var data = {
+        educationTypeId: Number(this.queryData.educationTypeId),
+        businessId: Number(this.queryData.businessId),
         goodsType: type,
         goodsName: this.goodsName || "",
         goodsStatus: 1,
@@ -315,7 +317,7 @@ export default {
           .then((res) => {
             this.$message.success("提交成功");
             this.disBoxs = false;
-            this.close();
+            this.initData();
           });
       }
       if (this.statusPop === 2) {
@@ -331,18 +333,18 @@ export default {
           .then((res) => {
             this.$message.success("提交成功");
             this.disBoxs = false;
-            this.close();
+            this.initData();
           });
       }
     },
     close() {
-      this.isMatchingDialog = false;
       this.$emit("close");
     },
     initData() {
       this.loading = true;
       this.$api
         .inquireCourseSubject({
+          educationTypeId: Number(this.queryData.educationTypeId),
           businessId: Number(this.queryData.businessId),
           status: 1,
         })

+ 25 - 3
src/views/Marketing/productPackManage/index.vue

@@ -53,7 +53,13 @@ import editGoodsPack from "./component/editGoodsPack.vue";
 import matchingDialog from "./component/matchingDialog.vue";
 export default {
   name: "OfflineOrder",
-  components: { searchBoxNew, tableList, pagination, editGoodsPack, matchingDialog },
+  components: {
+    searchBoxNew,
+    tableList,
+    pagination,
+    editGoodsPack,
+    matchingDialog,
+  },
   data() {
     return {
       loading: false, //当前表单加载是否加载动画
@@ -83,7 +89,7 @@ export default {
           edu: "educationId",
         },
         {
-          prop: "status",
+          prop: "goodsStatus",
           placeholder: "商品包状态",
           scope: "select",
           options: [
@@ -122,6 +128,7 @@ export default {
         },
       ],
       formData: {
+        status: "0,1",
         pageSize: 10,
         pageNum: 1,
       },
@@ -146,6 +153,7 @@ export default {
           prop: "mainImg",
           scope: "img",
           hidden: true,
+          width: "100",
         },
         {
           label: "班级类型",
@@ -170,8 +178,18 @@ export default {
         {
           label: "状态",
           prop: "status",
-          scope: "status",
+          scope: "isOptions",
           hidden: true,
+          options: [
+            {
+              label: "开启",
+              value: 1,
+            },
+            {
+              label: "关闭",
+              value: 0,
+            },
+          ],
         },
       ],
       tableData: [], //表单数据
@@ -200,10 +218,14 @@ export default {
       }
       if (int === 2) {
         this.formData = {
+          status: "0,1",
           pageSize: 10,
           pageNum: 1,
         };
       }
+      if (this.formData.goodsStatus == 0 || this.formData.goodsStatus) {
+        this.formData.status = this.formData.goodsStatus;
+      }
       var data = JSON.parse(JSON.stringify(this.formData));
       this.$api
         .inquireorderbusinessconfigList(data)