xjc 1 rok pred
rodič
commit
e90cf62caf
5 zmenil súbory, kde vykonal 2815 pridanie a 1676 odobranie
  1. 4 0
      src/api.js
  2. 841 510
      src/views/apply/Change.vue
  3. 837 506
      src/views/apply/New.vue
  4. 841 510
      src/views/apply/Update.vue
  5. 292 150
      src/views/classes/Index.vue

+ 4 - 0
src/api.js

@@ -305,4 +305,8 @@ export default {
 	getIndexData: params => {
 		return axios.get(`${baseURL}/api/admin/index`, params)
 	},
+	// 学员分班
+	allocationClass: params => {
+		return axios.put(`${baseURL}/api/admin/signup/allocation`, params)
+	},
 }

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 841 - 510
src/views/apply/Change.vue


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 837 - 506
src/views/apply/New.vue


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 841 - 510
src/views/apply/Update.vue


+ 292 - 150
src/views/classes/Index.vue

@@ -1,171 +1,313 @@
 <style lang="scss">
-    .apply{
-       .filter{
-            background: #fff;
-            padding: 20px 20px 10px; 
-            border:1px solid #EDEDED;
-            border-radius:2px;
-            margin-bottom: 10px;
-            margin-top: 10px;
-            .el-form-item{
-                margin-bottom: 10px;
-            }
-            .el-input,.el-select{
-                width: 150px;
-            }
-    
-       }
-       thead{
-           th{
-               background: #eee;
-           }
-       }
+.apply {
+  .filter {
+    background: #fff;
+    padding: 20px 20px 10px;
+    border: 1px solid #ededed;
+    border-radius: 2px;
+    margin-bottom: 10px;
+    margin-top: 10px;
+    .el-form-item {
+      margin-bottom: 10px;
     }
-    .table{
-        button{
-            padding:6px;
-        }
+    .el-input,
+    .el-select {
+      width: 150px;
     }
-    .el-table__fixed-right::before, .el-table__fixed::before{
-        background: none;
+  }
+  thead {
+    th {
+      background: #eee;
     }
+  }
+}
+.table {
+  button {
+    padding: 6px;
+  }
+}
+.el-table__fixed-right::before,
+.el-table__fixed::before {
+  background: none;
+}
 </style>
 <template>
-    <section class="apply">
-        <p>培训计划  >  班级管理</p>
-        <div class="filter">
-            <el-form label-width="80px" :inline="true" size="small">
-                <el-form-item label="班级名称">
-                        <el-input clearable placeholder="班级名称" v-model="form.name"></el-input>
-                </el-form-item>
-                <el-form-item label="类别">
-                    <Subject @subChange='subChange'/>
-                </el-form-item>
-             
-                <el-form-item>
-                       <el-button @click="form.page=1,getData()" type="primary" icon="el-icon-search">搜索</el-button>
-                       <el-button @click="$router.push({path:'/classes/add'})"  type="primary">新增</el-button>
-                </el-form-item>
-            </el-form>
-        </div>
+  <section class="apply">
+    <p>培训计划 > 班级管理</p>
+    <div class="filter">
+      <el-form label-width="80px" :inline="true" size="small">
+        <el-form-item label="班级名称">
+          <el-input
+            clearable
+            placeholder="班级名称"
+            v-model="form.name"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="类别">
+          <Subject @subChange="subChange" />
+        </el-form-item>
 
+        <el-form-item>
+          <el-button
+            @click="(form.page = 1), getData()"
+            type="primary"
+            icon="el-icon-search"
+            >搜索</el-button
+          >
+          <el-button
+            @click="$router.push({ path: '/classes/add' })"
+            type="primary"
+            >新增</el-button
+          >
+        </el-form-item>
+      </el-form>
+    </div>
 
-        <el-table
-                class="table"
-                :data="list" height="450px"
-                border  v-loading="loading"
-                style="width: 100%">
-                <!-- <el-table-column
+    <el-table
+      class="table"
+      :data="list"
+      height="450px"
+      border
+      v-loading="loading"
+      style="width: 100%"
+    >
+      <!-- <el-table-column
                 type="selection" fixed="left"
                 width="55">
                 </el-table-column> -->
-                <el-table-column
-                prop="name"  width="200"
-                label="班级名称">
-                </el-table-column>
-                <el-table-column
+      <el-table-column prop="name" width="200" label="班级名称">
+      </el-table-column>
+      <!-- <el-table-column
                 prop="subject_item" width="300"
                 label="培训项目">
-                </el-table-column>
-                <el-table-column
-                prop="signup_limit" width="80"
-                label="计划人数">
-                </el-table-column>
-                <el-table-column
-                prop="signuped_count" width="100"
-                label="已报名人数">
-                </el-table-column>
-                <el-table-column
-                prop="remark"
-                label="备注">
-                </el-table-column>
-                <el-table-column
-                prop="remind"
-                label="提醒">
-                </el-table-column>
-                <el-table-column
-                prop="ctime"  width="200"
-                label="创建时间">
-                </el-table-column>
-                <el-table-column fixed="right"
-                prop="zip"  width="200"
-                label="操作">
-                <template slot-scope="scope">
-                    <!--<el-button @click="download(scope.row.id)" size="mini"  type="success">导出学员</el-button>-->
-                    <el-button @click="$router.push({path:'/classes/add',query:{id:scope.row.id}})" size="mini" type="warning">编辑</el-button>
-                    <el-button @click="del(scope.row.id)" size="mini"  type="danger">删除</el-button>
-                </template>
-                </el-table-column>
+                </el-table-column> -->
+      <el-table-column prop="signup_limit" width="80" label="计划人数">
+      </el-table-column>
+      <el-table-column prop="signuped_count" width="100" label="已报名人数">
+        <template slot-scope="scope">
+          <el-link type="primary" @click="showSignupUser(scope.row)">{{
+            scope.row.signuped_count
+          }}</el-link>
+        </template>
+      </el-table-column>
+      <el-table-column prop="remark" label="备注"> </el-table-column>
+      <el-table-column prop="remind" label="提醒"> </el-table-column>
+      <el-table-column prop="ctime" width="200" label="创建时间">
+      </el-table-column>
+      <el-table-column fixed="right" prop="zip" width="200" label="操作">
+        <template slot-scope="scope">
+          <el-button @click="download(scope.row.id)" size="mini" type="success"
+            >导出档案</el-button
+          >
+          <el-button
+            @click="
+              $router.push({
+                path: '/classes/add',
+                query: { id: scope.row.id },
+              })
+            "
+            size="mini"
+            type="warning"
+            >编辑</el-button
+          >
+          <el-button @click="del(scope.row.id)" size="mini" type="danger"
+            >删除</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+    <Page ref="pageButton" :total="total" @pageChange="gopage" />
+    <!-- 查看已报名学员 -->
+    <el-dialog title="已报名学员信息" :visible.sync="dialogVisible" width="80%">
+      <div>
+        <el-table :data="signupList" style="width: 100%">
+        <el-table-column type="selection" fixed="left" width="45">
+        </el-table-column>
+          <el-table-column prop="name" label="姓名" width="100px">
+          </el-table-column>
+          <el-table-column prop="phone" label="联系电话"> </el-table-column>
+          <el-table-column prop="order_status_1" label="状态">
+          </el-table-column>
+          <el-table-column prop="pay_status_1" label="支付状态"> </el-table-column>
+          <el-table-column prop="price" label="支付金额"> </el-table-column>
+          <el-table-column prop="admin_remark" label="管理员备注"> </el-table-column>
+          <el-table-column prop="subject_item0" label="报名类型"> </el-table-column>
+          <el-table-column prop="subject_item1" label="作业类别"> </el-table-column>
+          <el-table-column prop="subject_item2" label="准操项目"> </el-table-column>
+          <el-table-column prop="train_type" label="培训类型"> </el-table-column>
+          <el-table-column prop="zip" width="220" fixed="right" label="操作">
+            <template slot-scope="scope">
+              <el-button
+                @click="
+                  goTo({ path: '/sign/detail', query: { id: scope.row.id } })
+                "
+                size="mini"
+                type="success"
+                >详情</el-button
+              >
+              <el-button
+                @click="
+                  goTo({ path: '/sign/edit', query: { id: scope.row.id } })
+                "
+                size="mini"
+                type="warning"
+                >编辑</el-button
+              >
+              <el-button
+                @click="mark(scope.row.id, scope.row.admin_remark)"
+                size="mini"
+                type="primary"
+                >备注</el-button
+              >
+              <el-button @click="del(scope.row.id)" size="mini" type="danger" disabled
+                >删除</el-button
+              >
+            </template>
+          </el-table-column>
         </el-table>
-        <Page  ref="pageButton"  :total='total' @pageChange='gopage'/>
-    </section>
+      </div>
+      <div slot="footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="dialogVisible = false"
+          >确 定</el-button
+        >
+      </div>
+    </el-dialog>
+  </section>
 </template>
 <script>
-import Page from '../../components/Page';
-import Subject from '../../components/Subject';
+import Page from "../../components/Page";
+import Subject from "../../components/Subject";
 export default {
-  components:{
-        Page,Subject
-    },
-  data(){
-    return{
-      form:{name:'',page:1,page_size:20},
-      activeName:"1",
-      total:1,
-      list:[],
-      loading:false
-    }
+  components: {
+    Page,
+    Subject,
   },
-  methods:{
-      gopage(size){
-          if(size){
-              this.form.page_size=size
-          }
-            this.form.page=this.$refs.pageButton.page
-            this.getData()
-      },
-      getData(){
-          var parm=this.form;
-          this.loading=true
-          this.$api.getClass(parm).then(res=>{
-              this.list=res.data.data.list
-              this.total=res.data.data.total
-              this.loading=false
-          })
-      },
-      subChange(data){
-          this.form.subject_item=data.join('|')
-      },
-      del(id){
-            this.$confirm('确定删除吗', '提示', {
-                    type: 'warning'
-                }).then(() => {
-                   this.$api.deleteClass({id:id}).then((res)=>{
-                        this.$message({
-                            message: '删除成功',
-                            type: 'success'
-                        })
-                        this.getData()
-                })
-            })
-      },
-      download(id){
-          this.$api.downloadClassUser({id:id}).then(res=>{
-                        var elink = document.createElement('a');
-                        let blob=new Blob([res.data], {type: 'application/vnd.ms-excel'});
-                        let objUrl=URL.createObjectURL(blob);
-                        let file_name=res.headers['content-disposition'].split('=')[1];
-                        elink.download = file_name;
-                        elink.style.display = 'none';                
-                        elink.href = objUrl;
-                        document.body.appendChild(elink);
-                        elink.click();
-                        document.body.removeChild(elink);     
-          })
+  data() {
+    return {
+      form: { name: "", page: 1, page_size: 20 },
+      activeName: "1",
+      total: 1,
+      list: [],
+      loading: false,
+      dialogVisible: false,
+      signupList: [],
+    };
+  },
+  methods: {
+    goTo(path) {
+      let url = this.$router.resolve(path);
+      window.open(url.href, "_blank");
+    },
+    gopage(size) {
+      if (size) {
+        this.form.page_size = size;
       }
+      this.form.page = this.$refs.pageButton.page;
+      this.getData();
+    },
+    getData() {
+      var parm = this.form;
+      this.loading = true;
+      this.$api.getClass(parm).then((res) => {
+        this.list = res.data.data.list;
+        this.total = res.data.data.total;
+        this.loading = false;
+      });
+    },
+    subChange(data) {
+      this.form.subject_item = data.join("|");
+    },
+    del(id) {
+      this.$confirm("确定删除吗", "提示", {
+        type: "warning",
+      }).then(() => {
+        this.$api.deleteClass({ id: id }).then((res) => {
+          this.$message({
+            message: "删除成功",
+            type: "success",
+          });
+          this.getData();
+        });
+      });
+    },
+    mark(id, val) {
+      this.$prompt("", "管理员备注", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        inputValue: val,
+      }).then(({ value }) => {
+        this.$api.updateSign({ id: id, admin_remark: value }).then((res) => {
+          if (res.data.code == 0) {
+            this.$message({ message: "备注成功!", type: "success" });
+            this.getData();
+          } else {
+            this.$message.error(res.data.message);
+          }
+        });
+      });
+    },
+    download(id) {
+      this.$api.downloadClassUser({ id: id }).then((res) => {
+        var elink = document.createElement("a");
+        let blob = new Blob([res.data], { type: "application/vnd.ms-excel" });
+        let objUrl = URL.createObjectURL(blob);
+        let file_name = res.headers["content-disposition"].split("=")[1];
+        elink.download = file_name;
+        elink.style.display = "none";
+        elink.href = objUrl;
+        document.body.appendChild(elink);
+        elink.click();
+        document.body.removeChild(elink);
+      });
+    },
+    showSignupUser(row) {
+      console.log(row, 222222222222);
+      this.$api.getSignList({ class_id: row.id }).then((res) => {
+        let data = res.data.data.list;
+        for (let i = 0; i < data.length; i++) {
+          let item = data[i],
+            status = "",
+            pay_status = "",
+            verify = "",
+            bill_type = "";
+          if (item.pay_status) {
+            pay_status = "已支付";
+          } else {
+            pay_status = "未支付";
+          }
+          if (item.verify) {
+            verify = "已认证";
+          } else {
+            verify = "未认证";
+          }
+          if (item.bill_type == 0) bill_type = "不需要发票";
+          if (item.bill_type == 1) bill_type = "个人发票";
+          if (item.bill_type == 2) bill_type = "公司发票";
+          if (item.order_status == -2) status = "审核未通过";
+          if (item.order_status == -1) status = "待提交资料";
+          if (item.order_status == 0) status = "待审核";
+          if (item.order_status == 1) status = "已审核,待付款";
+          if (item.order_status == 2) status = "已付款,待培训";
+          if (item.order_status == 3) status = "已培训,待考试";
+          if (item.order_status == 7) status = "考试完成";
+          if (item.order_status == 9) status = "已取消";
+          item.order_status_1 = status;
+          item.pay_status_1 = pay_status;
+          item.verify_1 = verify;
+          item.bill_type_1 = bill_type;
+          if (!item.pay_status) {
+            item.price = "";
+          }
+        }
+        this.signupList = res.data.data.list;
+        this.total = res.data.data.total;
+        this.dialogVisible = true;
+      });
+    },
   },
-  created(){
-      this.getData()
-  }
-}
+  created() {
+    this.getData();
+  },
+};
 </script>