lzy преди 2 седмици
родител
ревизия
0214621edb
променени са 31 файла, в които са добавени 321 реда и са изтрити 15 реда
  1. 12 0
      ruoyi-admin/src/main/java/com/ruoyi/system1/controller/CourseCategoryController.java
  2. 9 0
      ruoyi-admin/src/main/java/com/ruoyi/system1/controller/CourseController.java
  3. 12 0
      ruoyi-admin/src/main/java/com/ruoyi/system1/controller/ShopController.java
  4. 10 0
      ruoyi-admin/src/main/java/com/ruoyi/system1/controller/TeacherController.java
  5. 1 0
      ruoyi-admin/src/main/java/com/ruoyi/system1/mapper/CourseCategoryMapper.java
  6. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/system1/mapper/CourseMapper.java
  7. 2 0
      ruoyi-admin/src/main/java/com/ruoyi/system1/mapper/ShopAdminMapper.java
  8. 3 0
      ruoyi-admin/src/main/java/com/ruoyi/system1/mapper/ShopMapper.java
  9. 1 0
      ruoyi-admin/src/main/java/com/ruoyi/system1/mapper/TeacherMapper.java
  10. 3 0
      ruoyi-admin/src/main/java/com/ruoyi/system1/service/ICourseCategoryService.java
  11. 2 0
      ruoyi-admin/src/main/java/com/ruoyi/system1/service/ICourseService.java
  12. 2 0
      ruoyi-admin/src/main/java/com/ruoyi/system1/service/IShopService.java
  13. 2 0
      ruoyi-admin/src/main/java/com/ruoyi/system1/service/ITeacherService.java
  14. 5 0
      ruoyi-admin/src/main/java/com/ruoyi/system1/service/impl/CourseCategoryServiceImpl.java
  15. 5 0
      ruoyi-admin/src/main/java/com/ruoyi/system1/service/impl/CourseServiceImpl.java
  16. 20 1
      ruoyi-admin/src/main/java/com/ruoyi/system1/service/impl/ShopServiceImpl.java
  17. 8 0
      ruoyi-admin/src/main/java/com/ruoyi/system1/service/impl/TeacherServiceImpl.java
  18. 3 0
      ruoyi-admin/src/main/resources/mapper/system1/CourseCategoryMapper.xml
  19. 3 0
      ruoyi-admin/src/main/resources/mapper/system1/CourseMapper.xml
  20. 2 0
      ruoyi-admin/src/main/resources/mapper/system1/ShopAdminMapper.xml
  21. 3 0
      ruoyi-admin/src/main/resources/mapper/system1/ShopMapper.xml
  22. 5 0
      ruoyi-admin/src/main/resources/mapper/system1/TeacherMapper.xml
  23. 8 0
      ruoyi-ui/src/api/system1/category.js
  24. 7 0
      ruoyi-ui/src/api/system1/course.js
  25. 7 0
      ruoyi-ui/src/api/system1/shop.js
  26. 10 0
      ruoyi-ui/src/api/system1/teacher.js
  27. 2 0
      ruoyi-ui/src/views/system1/coupon/index.vue
  28. 79 5
      ruoyi-ui/src/views/system1/course/index.vue
  29. 22 2
      ruoyi-ui/src/views/system1/section/index.vue
  30. 24 3
      ruoyi-ui/src/views/system1/shop/index.vue
  31. 48 3
      ruoyi-ui/src/views/system1/teacher/index.vue

+ 12 - 0
ruoyi-admin/src/main/java/com/ruoyi/system1/controller/CourseCategoryController.java

@@ -46,6 +46,16 @@ public class CourseCategoryController extends BaseController
         return getDataTable(list);
     }
 
+
+    @PreAuthorize("@ss.hasPermi('system1:category:All')")
+    @GetMapping("/All")
+    public TableDataInfo All()
+    {
+        startPage();
+        List<CourseCategory> courseCategories = courseCategoryService.selectCourseCategoryAll();
+        return getDataTable(courseCategories);
+    }
+
     /**
      * 导出课程分类列表
      */
@@ -59,6 +69,8 @@ public class CourseCategoryController extends BaseController
         util.exportExcel(response, list, "课程分类数据");
     }
 
+
+
     /**
      * 获取课程分类详细信息
      */

+ 9 - 0
ruoyi-admin/src/main/java/com/ruoyi/system1/controller/CourseController.java

@@ -46,6 +46,15 @@ public class CourseController extends BaseController
         return getDataTable(list);
     }
 
+    @PreAuthorize("@ss.hasPermi('system1:course:All')")
+    @GetMapping("/All")
+    public TableDataInfo All()
+    {
+        startPage();
+        List<Course> list = courseService.selectCourseAll();
+        return getDataTable(list);
+    }
+
     /**
      * 导出课程列表
      */

+ 12 - 0
ruoyi-admin/src/main/java/com/ruoyi/system1/controller/ShopController.java

@@ -46,6 +46,18 @@ public class ShopController extends BaseController
         return getDataTable(list);
     }
 
+    @PreAuthorize("@ss.hasPermi('system1:shop:All')")
+    @GetMapping("/All")
+    public TableDataInfo listAll()
+    {
+        startPage();
+        List<Shop> list = shopService.selectShopAll();
+        return getDataTable(list);
+    }
+
+
+
+
     /**
      * 导出店铺列表
      */

+ 10 - 0
ruoyi-admin/src/main/java/com/ruoyi/system1/controller/TeacherController.java

@@ -46,6 +46,16 @@ public class TeacherController extends BaseController
         return getDataTable(list);
     }
 
+    @PreAuthorize("@ss.hasPermi('system1:teacher:All')")
+    @GetMapping("/All")
+    public TableDataInfo list(Long shopId)
+    {
+        startPage();
+        System.err.println(shopId);
+        List<Teacher> teachers = teacherService.selectTeacherAll(shopId);
+        return getDataTable(teachers);
+    }
+
     /**
      * 导出教师列表
      */

+ 1 - 0
ruoyi-admin/src/main/java/com/ruoyi/system1/mapper/CourseCategoryMapper.java

@@ -21,6 +21,7 @@ public interface CourseCategoryMapper
      */
     public CourseCategory selectCourseCategoryById(Long id);
 
+    public List<CourseCategory> selectCourseCategoryAll();
     /**
      * 查询课程分类列表
      * 

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/system1/mapper/CourseMapper.java

@@ -28,7 +28,7 @@ public interface CourseMapper
      * @return 课程集合
      */
     public List<Course> selectCourseList(Course course);
-
+    public List<Course> selectCourseAll();
     /**
      * 新增课程
      * 

+ 2 - 0
ruoyi-admin/src/main/java/com/ruoyi/system1/mapper/ShopAdminMapper.java

@@ -27,6 +27,8 @@ public interface ShopAdminMapper
      */
     public List<ShopAdmin> selectShopAdminList(ShopAdmin shopAdmin);
 
+
+
     /**
      * 新增店铺管理员
      * 

+ 3 - 0
ruoyi-admin/src/main/java/com/ruoyi/system1/mapper/ShopMapper.java

@@ -2,6 +2,7 @@ package com.ruoyi.system1.mapper;
 
 import java.util.List;
 import com.ruoyi.system1.domain.Shop;
+import com.ruoyi.system1.domain.ShopAdmin;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
@@ -29,6 +30,8 @@ public interface ShopMapper
      */
     public List<Shop> selectShopList(Shop shop);
 
+    public List<Shop> selectShopAll();
+
     /**
      * 新增店铺
      * 

+ 1 - 0
ruoyi-admin/src/main/java/com/ruoyi/system1/mapper/TeacherMapper.java

@@ -29,6 +29,7 @@ public interface TeacherMapper
      */
     public List<Teacher> selectTeacherList(Teacher teacher);
 
+    public List<Teacher> selectTeacherAll(Long shopId);
     /**
      * 新增教师
      * 

+ 3 - 0
ruoyi-admin/src/main/java/com/ruoyi/system1/service/ICourseCategoryService.java

@@ -19,6 +19,9 @@ public interface ICourseCategoryService
      */
     public CourseCategory selectCourseCategoryById(Long id);
 
+
+    public List<CourseCategory> selectCourseCategoryAll();
+
     /**
      * 查询课程分类列表
      * 

+ 2 - 0
ruoyi-admin/src/main/java/com/ruoyi/system1/service/ICourseService.java

@@ -27,6 +27,8 @@ public interface ICourseService
      */
     public List<Course> selectCourseList(Course course);
 
+    public List<Course> selectCourseAll();
+
     /**
      * 新增课程
      * 

+ 2 - 0
ruoyi-admin/src/main/java/com/ruoyi/system1/service/IShopService.java

@@ -27,6 +27,8 @@ public interface IShopService
      */
     public List<Shop> selectShopList(Shop shop);
 
+    public List<Shop> selectShopAll();
+
     /**
      * 新增店铺
      * 

+ 2 - 0
ruoyi-admin/src/main/java/com/ruoyi/system1/service/ITeacherService.java

@@ -19,6 +19,8 @@ public interface ITeacherService
      */
     public Teacher selectTeacherById(Long id);
 
+    public List<Teacher> selectTeacherAll(Long shopId);
+
     /**
      * 查询教师列表
      * 

+ 5 - 0
ruoyi-admin/src/main/java/com/ruoyi/system1/service/impl/CourseCategoryServiceImpl.java

@@ -33,6 +33,11 @@ public class CourseCategoryServiceImpl implements ICourseCategoryService
         return courseCategoryMapper.selectCourseCategoryById(id);
     }
 
+    @Override
+    public List<CourseCategory> selectCourseCategoryAll() {
+        return courseCategoryMapper.selectCourseCategoryAll();
+    }
+
     /**
      * 查询课程分类列表
      * 

+ 5 - 0
ruoyi-admin/src/main/java/com/ruoyi/system1/service/impl/CourseServiceImpl.java

@@ -46,6 +46,11 @@ public class CourseServiceImpl implements ICourseService
         return courseMapper.selectCourseList(course);
     }
 
+    @Override
+    public List<Course> selectCourseAll() {
+        return courseMapper.selectCourseAll();
+    }
+
     /**
      * 新增课程
      * 

+ 20 - 1
ruoyi-admin/src/main/java/com/ruoyi/system1/service/impl/ShopServiceImpl.java

@@ -3,6 +3,8 @@ package com.ruoyi.system1.service.impl;
 import java.util.Date;
 import java.util.List;
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.system1.domain.ShopAdmin;
+import com.ruoyi.system1.mapper.ShopAdminMapper;
 import com.ruoyi.system1.util.SnowflakeIdWorker;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -10,6 +12,8 @@ import com.ruoyi.system1.mapper.ShopMapper;
 import com.ruoyi.system1.domain.Shop;
 import com.ruoyi.system1.service.IShopService;
 
+import javax.annotation.Resource;
+
 /**
  * 店铺Service业务层处理
  * 
@@ -46,20 +50,35 @@ public class ShopServiceImpl implements IShopService
         return shopMapper.selectShopList(shop);
     }
 
+    @Override
+    public List<Shop> selectShopAll() {
+        return shopMapper.selectShopAll();
+    }
+
     /**
      * 新增店铺
      * 
      * @param shop 店铺
      * @return 结果
      */
+
+    @Resource
+    private ShopAdminMapper shopAdminMapper;
     @Override
     public int insertShop(Shop shop)
     {
+        System.err.println(shop);
         SnowflakeIdWorker snowflakeIdWorker=new SnowflakeIdWorker(1,1);
         shop.setId(snowflakeIdWorker.nextId());
         shop.setCreateTime(new Date());
         shop.setCreateTime(DateUtils.getNowDate());
-        return shopMapper.insertShop(shop);
+        shopMapper.insertShop(shop);
+        System.err.println(shop);
+        ShopAdmin shopAdmin=new ShopAdmin();
+        shopAdmin.setShopId(shop.getId());
+        shopAdmin.setUserId(shop.getAdminUserId());
+
+        return shopAdminMapper.insertShopAdmin(shopAdmin);
     }
 
     /**

+ 8 - 0
ruoyi-admin/src/main/java/com/ruoyi/system1/service/impl/TeacherServiceImpl.java

@@ -34,6 +34,12 @@ public class TeacherServiceImpl implements ITeacherService
         return teacherMapper.selectTeacherById(id);
     }
 
+    @Override
+    public List<Teacher> selectTeacherAll(Long shopId) {
+        return  teacherMapper.selectTeacherAll(shopId);
+    }
+
+
     /**
      * 查询教师列表
      * 
@@ -46,6 +52,8 @@ public class TeacherServiceImpl implements ITeacherService
         return teacherMapper.selectTeacherList(teacher);
     }
 
+
+
     /**
      * 新增教师
      * 

+ 3 - 0
ruoyi-admin/src/main/resources/mapper/system1/CourseCategoryMapper.xml

@@ -25,6 +25,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectCourseCategoryVo"/>
         where id = #{id}
     </select>
+    <select id="selectCourseCategoryAll" resultType="com.ruoyi.system1.domain.CourseCategory">
+        <include refid="selectCourseCategoryVo"></include>
+    </select>
 
     <insert id="insertCourseCategory" parameterType="CourseCategory" useGeneratedKeys="true" keyProperty="id">
         insert into course_category

+ 3 - 0
ruoyi-admin/src/main/resources/mapper/system1/CourseMapper.xml

@@ -33,6 +33,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectCourseVo"/>
         where id = #{id}
     </select>
+    <select id="selectCourseAll" resultType="com.ruoyi.system1.domain.Course">
+        <include refid="selectCourseVo"></include>
+    </select>
 
     <insert id="insertCourse" parameterType="Course">
         insert into course

+ 2 - 0
ruoyi-admin/src/main/resources/mapper/system1/ShopAdminMapper.xml

@@ -24,6 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where shop_id = #{shopId}
     </select>
 
+
+
     <insert id="insertShopAdmin" parameterType="ShopAdmin">
         insert into shop_admin
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 3 - 0
ruoyi-admin/src/main/resources/mapper/system1/ShopMapper.xml

@@ -29,6 +29,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectShopVo"/>
         where id = #{id}
     </select>
+    <select id="selectShopAll" resultType="com.ruoyi.system1.domain.Shop">
+        <include refid="selectShopVo"></include>
+    </select>
 
     <insert id="insertShop" parameterType="Shop">
         insert into shop

+ 5 - 0
ruoyi-admin/src/main/resources/mapper/system1/TeacherMapper.xml

@@ -32,6 +32,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id}
     </select>
 
+    <select id="selectTeacherAll" resultType="com.ruoyi.system1.domain.Teacher">
+        <include refid="selectTeacherVo"/>
+            where shop_id = #{shopId}
+    </select>
+
     <insert id="insertTeacher" parameterType="Teacher">
         insert into teacher
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 8 - 0
ruoyi-ui/src/api/system1/category.js

@@ -9,6 +9,14 @@ export function listCategory(query) {
   })
 }
 
+export function listCategoryAll() {
+  return request({
+    url: '/system1/category/All',
+    method: 'get',
+  })
+}
+
+
 // 查询课程分类详细
 export function getCategory(id) {
   return request({

+ 7 - 0
ruoyi-ui/src/api/system1/course.js

@@ -9,6 +9,13 @@ export function listCourse(query) {
   })
 }
 
+export function listCourseAll() {
+  return request({
+    url: '/system1/course/All',
+    method: 'get',
+  })
+}
+
 // 查询课程详细
 export function getCourse(id) {
   return request({

+ 7 - 0
ruoyi-ui/src/api/system1/shop.js

@@ -9,6 +9,13 @@ export function listShop(query) {
   })
 }
 
+export function listAll() {
+  return request({
+    url: '/system1/shop/All',
+    method: 'get',
+  })
+}
+
 // 查询店铺详细
 export function getShop(id) {
   return request({

+ 10 - 0
ruoyi-ui/src/api/system1/teacher.js

@@ -9,6 +9,16 @@ export function listTeacher(query) {
   })
 }
 
+export function All(shopId) {
+  return request({
+    url: '/system1/teacher/All',
+    method: 'get',
+    params: {
+        shopId:shopId
+    }
+  })
+}
+
 // 查询教师详细
 export function getTeacher(id) {
   return request({

+ 2 - 0
ruoyi-ui/src/views/system1/coupon/index.vue

@@ -200,6 +200,7 @@ export default {
       total: 0,
       // 优惠券表格数据
       couponList: [],
+
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -267,6 +268,7 @@ export default {
       this.open = false
       this.reset()
     },
+
     All(){
       this.loading=true
       listUserAll().then(response => {

+ 79 - 5
ruoyi-ui/src/views/system1/course/index.vue

@@ -128,14 +128,51 @@
         <el-form-item label="课程名称" prop="title">
           <el-input v-model="form.title" placeholder="请输入课程名称" />
         </el-form-item>
-        <el-form-item label="所属店铺" prop="shopId">
-          <el-input v-model="form.shopId" placeholder="请输入所属店铺" />
+        <el-form-item label="所属店铺" prop="userId">
+          <el-select
+            v-model="form.shopId"
+            placeholder="请选择店铺"
+            @change="handleShopChange"
+            size="large"
+            style="width: 240px"
+          >
+            <el-option
+              v-for="user1 in course"
+              :key="user1.id"
+              :label="user1.name"
+              :value="user1.id"
+            />
+          </el-select>
         </el-form-item>
-        <el-form-item label="主讲老师" prop="teacherId">
-          <el-input v-model="form.teacherId" placeholder="请输入主讲老师" />
+        <el-form-item label="主讲师"  prop="teacherId">
+          <el-select
+            v-model="form.teacherId"
+            placeholder="请选择讲师"
+            size="large"
+            style="width: 240px"
+          >
+            <el-option
+              v-for="user1 in teacher"
+              :key="user1.id"
+              :label="user1.name"
+              :value="user1.id"
+            />
+          </el-select>
         </el-form-item>
         <el-form-item label="分类" prop="categoryId">
-          <el-input v-model="form.categoryId" placeholder="请输入分类" />
+          <el-select
+            v-model="form.categoryId"
+            placeholder="请选择讲师"
+            size="large"
+            style="width: 240px"
+          >
+            <el-option
+              v-for="user1 in category"
+              :key="user1.id"
+              :label="user1.name"
+              :value="user1.id"
+            />
+          </el-select>
         </el-form-item>
         <el-form-item label="原价" prop="price">
           <el-input v-model="form.price" placeholder="请输入原价" />
@@ -179,6 +216,9 @@
 
 <script>
 import { listCourse, getCourse, delCourse, addCourse, updateCourse } from "@/api/system1/course"
+import {listAll} from "../../../api/system1/shop";
+import {All} from "../../../api/system1/teacher";
+import {listCategoryAll} from "../../../api/system1/category";
 
 export default {
   name: "Course",
@@ -198,16 +238,19 @@ export default {
       total: 0,
       // 课程表格数据
       courseList: [],
+      category: [],
       // 弹出层标题
       title: "",
       // 是否显示弹出层
       open: false,
+      teacher: [],
       // 查询参数
       queryParams: {
         pageNum: 1,
         pageSize: 10,
         title: null,
       },
+      course:[],
       // 表单参数
       form: {},
       // 表单校验
@@ -232,8 +275,32 @@ export default {
   },
   created() {
     this.getList()
+    this.All()
+    this.category1()
   },
   methods: {
+    All(){
+      listAll().then(response=>{
+        this.course=response.rows
+      })
+    },
+    category1(){
+      listCategoryAll().then(response=>{
+        this.category=response.rows
+      })
+    },
+
+    handleShopChange(shopId) {
+      if (shopId) {
+        All(shopId).then(response=>{
+          this.teacher=response.rows
+        })
+      } else {
+        this.teachers = []
+      }
+      // 重置已选的讲师
+      this.form.teacherId = null
+    },
     /** 查询课程列表 */
     getList() {
       this.loading = true
@@ -243,6 +310,11 @@ export default {
         this.loading = false
       })
     },
+    shopAll(){
+      All().then(response =>{
+        this.teacher=response.rows
+      })
+    },
     // 取消按钮
     cancel() {
       this.open = false
@@ -270,6 +342,7 @@ export default {
       this.queryParams.pageNum = 1
       this.getList()
     },
+
     /** 重置按钮操作 */
     resetQuery() {
       this.resetForm("queryForm")
@@ -297,6 +370,7 @@ export default {
         this.title = "修改课程"
       })
     },
+
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate(valid => {

+ 22 - 2
ruoyi-ui/src/views/system1/section/index.vue

@@ -100,8 +100,20 @@
     <!-- 添加或修改课程章节对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="课程ID" prop="courseId">
-          <el-input v-model="form.courseId" placeholder="请输入课程Id" />
+        <el-form-item label="课程" pprop="courseId">
+          <el-select
+            v-model="form.courseId"
+            placeholder="请选择店铺"
+            size="large"
+            style="width: 240px"
+          >
+            <el-option
+              v-for="user1 in course"
+              :key="user1.id"
+              :label="user1.title"
+              :value="user1.id"
+            />
+          </el-select>
         </el-form-item>
         <el-form-item label="小节标题" prop="title">
           <el-input v-model="form.title" placeholder="请输入小节标题" />
@@ -127,6 +139,7 @@
 
 <script>
 import { listSection, getSection, delSection, addSection, updateSection } from "@/api/system1/section"
+import {listCourseAll} from "../../../api/system1/course";
 
 export default {
   name: "Section",
@@ -146,6 +159,7 @@ export default {
       total: 0,
       // 课程章节表格数据
       sectionList: [],
+      course: [],
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -177,8 +191,14 @@ export default {
   },
   created() {
     this.getList()
+    this.All()
   },
   methods: {
+    All(){
+      listCourseAll().then(response =>{
+        this.course=response.rows
+      })
+    },
     /** 查询课程章节列表 */
     getList() {
       this.loading = true

+ 24 - 3
ruoyi-ui/src/views/system1/shop/index.vue

@@ -120,7 +120,7 @@
           <image-upload v-model="form.logo"/>
         </el-form-item>
         <el-form-item label="状态" prop="type">
-          <el-radio-group v-model="form.type">
+          <el-radio-group v-model="form.status">
             <el-radio :label="0">待审核</el-radio>
             <el-radio :label="1">已通过</el-radio>
             <el-radio :label="2">已拒绝</el-radio>
@@ -130,8 +130,20 @@
         <el-form-item label="店铺简介" prop="description">
           <el-input v-model="form.description" type="textarea" placeholder="请输入内容" />
         </el-form-item>
-        <el-form-item label="主管理员ID" prop="adminUserId">
-          <el-input v-model="form.adminUserId" placeholder="请输入主管理员ID" />
+        <el-form-item label="所属用户" prop="userId">
+          <el-select
+            v-model="form.adminUserId"
+            placeholder="请选择用户"
+            size="large"
+            style="width: 240px"
+          >
+            <el-option
+              v-for="user1 in user"
+              :key="user1.id"
+              :label="user1.nickname"
+              :value="user1.id"
+            />
+          </el-select>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -144,6 +156,8 @@
 
 <script>
 import { listShop, getShop, delShop, addShop, updateShop } from "@/api/system1/shop"
+import {listUserAll} from "../../../api/system1/user";
+import {All} from "../../../api/system1/teacher";
 
 export default {
   name: "Shop",
@@ -188,6 +202,7 @@ export default {
   },
   created() {
     this.getList()
+    this.All()
   },
   methods: {
     /** 查询店铺列表 */
@@ -199,6 +214,12 @@ export default {
         this.loading = false
       })
     },
+    All(){
+      this.loading=true
+      listUserAll(shopId).then(response => {
+        this.user=response.rows
+      })
+    },
     // 取消按钮
     cancel() {
       this.open = false

+ 48 - 3
ruoyi-ui/src/views/system1/teacher/index.vue

@@ -123,11 +123,37 @@
         <el-form-item label="老师简介" prop="intro">
           <el-input v-model="form.intro" type="textarea" placeholder="请输入内容" />
         </el-form-item>
+
         <el-form-item label="所属店铺" prop="shopId">
-          <el-input v-model="form.shopId" placeholder="请输入所属店铺" />
+          <el-select
+            v-model="form.shopId"
+            placeholder="请选择店铺"
+            size="large"
+            style="width: 240px"
+          >
+            <el-option
+              v-for="user1 in course"
+              :key="user1.id"
+              :label="user1.name"
+              :value="user1.id"
+            />
+          </el-select>
         </el-form-item>
-        <el-form-item label="关联的用户ID" prop="userId">
-          <el-input v-model="form.userId" placeholder="请输入关联的用户ID" />
+
+        <el-form-item label="用户ID" prop="userId">
+          <el-select
+            v-model="form.userId"
+            placeholder="请选择用户"
+            size="large"
+            style="width: 240px"
+          >
+            <el-option
+              v-for="user1 in user"
+              :key="user1.id"
+              :label="user1.nickname"
+              :value="user1.id"
+            />
+          </el-select>
         </el-form-item>
         <el-form-item label="状态" prop="status">
           <el-radio-group v-model="form.status">
@@ -147,11 +173,14 @@
 
 <script>
 import { listTeacher, getTeacher, delTeacher, addTeacher, updateTeacher } from "@/api/system1/teacher"
+import {listUserAll} from "../../../api/system1/user";
+import {listAll} from "../../../api/system1/shop";
 
 export default {
   name: "Teacher",
   data() {
     return {
+      course: [],
       // 遮罩层
       loading: true,
       // 选中数组
@@ -166,6 +195,7 @@ export default {
       total: 0,
       // 教师表格数据
       teacherList: [],
+      user: [],
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -188,8 +218,23 @@ export default {
   },
   created() {
     this.getList()
+    this.All()
+    this.All1()
+
   },
   methods: {
+    All(){
+      this.loading=true
+      listUserAll().then(response => {
+        this.user=response.rows
+        console.log(this.user)
+      })
+    },
+    All1(){
+      listAll().then(response=>{
+        this.course=response.rows
+      })
+    },
     /** 查询教师列表 */
     getList() {
       this.loading = true