فهرست منبع

Signed-off-by: Changpeng Duan <838560574@qq.com>

Changpeng Duan 5 سال پیش
والد
کامیت
b94f16d64c

+ 14 - 1
pc/src/Global.js

@@ -68,6 +68,17 @@ nonTfmtDate = function (datetime, length) {
     return datetime
 };
 
+// 格式化时间去掉T
+nonTfmtDatetoLength = function (datetime, length) {
+    if ((datetime == '') || (datetime == undefined))
+        return '';
+    if ((datetime == '1900-01-01') || (datetime == '1900-01-01 00:00:00.000'))
+        return '';
+    length = !length ? 10 : length;//缺省参数
+    datetime = new Date(+new Date(datetime) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '').substr(0,length);
+    return datetime
+};
+
 // 获取当前时间
 globalcurrent = function () {
     let date = new Date();
@@ -236,7 +247,9 @@ turnClassResToOption = function (data) {
     let ids = data.map(item => {
         return {
             label: item.ClassSelf.ClassName,
-            key: parseInt(item.ClassSelf.ClassId)
+            key: parseInt(item.ClassSelf.ClassId),
+            value: parseInt(item.ClassSelf.ClassId),
+            ClassColor: item.ClassSelf.ClassColor,
         }
     })
     return ids

+ 74 - 0
pc/src/api/getApiRes.js

@@ -139,7 +139,76 @@ export function ClassVisibleStatusEdit(postdata) {
     let url = headapi + '/v1/Class/ClassVisibleStatusEdit';
     return getApiBasic(url, postdata);
 }
+// order
+// 管理员今日预约添加
+export function OrderAddByManager(postdata) {
+    let url = headapi + '/v1/Order/OrderAddByManager';
+    return getApiBasic(url, postdata);
+}
+// 管理员今日预约取消
+export function OrderCancelByManager(postdata) {
+    let url = headapi + '/v1/Order/OrderCancelByManager';
+    return getApiBasic(url, postdata);
+}
+// 预约记录查询
+export function OrderListQuery(postdata) {
+    let url = headapi + '/v1/Order/OrderListQuery';
+    return getApiBasic(url, postdata);
+}
+// 今日预约统计
+export function OrderStatistics(postdata) {
+    let url = headapi + '/v1/Order/OrderStatistics';
+    return getApiBasic(url, postdata);
+}
+// 今日课程预约总览
+export function TodayClassOrderQuery(postdata) {
+    let url = headapi + '/v1/Order/TodayClassOrderQuery';
+    return getApiBasic(url, postdata);
+}
+// 今日会员预约列表查询
+export function TodayVipOrderQuery(postdata) {
+    let url = headapi + '/v1/Order/TodayVipOrderQuery';
+    return getApiBasic(url, postdata);
+}
+
+// SchoolTimeTable
+// 课程表基本信息添加
+export function STTBasicAdd(postdata) {
+    let url = headapi + '/v1/SchoolTimeTable/STTBasicAdd';
+    return getApiBasic(url, postdata);
+}
+// 课程表基本信息修改
+export function STTBasicEdit(postdata) {
+    let url = headapi + '/v1/SchoolTimeTable/STTBasicEdit';
+    return getApiBasic(url, postdata);
+}
 
+// 课程表基本列表查询
+export function STTBasicListQuery(postdata) {
+    let url = headapi + '/v1/SchoolTimeTable/STTBasicListQuery';
+    return getApiBasic(url, postdata);
+}
+// 课程表上下线状态修改
+export function STTBasicOfflineEdit(postdata) {
+    let url = headapi + '/v1/SchoolTimeTable/STTBasicOfflineEdit';
+    return getApiBasic(url, postdata);
+}
+// 课程表状态修改
+export function STTBasicStatusEdit(postdata) {
+    let url = headapi + '/v1/SchoolTimeTable/STTBasicStatusEdit';
+    return getApiBasic(url, postdata);
+}
+
+// 课程表详情批量保存
+export function STTDetailBatchSave(postdata) {
+    let url = headapi + '/v1/SchoolTimeTable/STTDetailBatchSave';
+    return getApiBasic(url, postdata);
+}
+// 课程表详情列表查询
+export function STTDetailListQuery(postdata) {
+    let url = headapi + '/v1/SchoolTimeTable/STTDetailListQuery';
+    return getApiBasic(url, postdata);
+}
 
 // shop
 // √ 店铺添加
@@ -214,6 +283,11 @@ export function SttPlanDetailListQuery(postdata) {
     let url = headapi + '/v1/SttPlan/SttPlanDetailListQuery';
     return getApiBasic(url, postdata);
 }
+// 课程表模板发布
+export function SttPlanPublish(postdata) {
+    let url = headapi + '/v1/SttPlan/SttPlanPublish';
+    return getApiBasic(url, postdata);
+}
 
 // 课程表模板详情批量保存
 export function SttPlanDetailBatchSave(postdata) {

+ 0 - 1
pc/src/components/Headside.vue

@@ -81,7 +81,6 @@
                 ManagerSelfQuery(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
-                        console.log(res);
                         that.user.name = json.Rs.Name;
                         localStorage.shopId = json.Rs.ShopId;
                     } else {

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 53 - 0
pc/src/components/preview.vue


+ 1 - 1
pc/src/router/index.js

@@ -54,7 +54,7 @@ const routes = [
                 }
             },{
                 path: '/editLessonTable',
-                name: 'EditLessonTable.vue',
+                name: 'EditLessonTable',
                 component: () => import('@/views/EditLessonTable.vue'),
                 meta: {
                     title: "编辑课程表模板",

+ 34 - 8
pc/src/views/EditLessonTable.vue

@@ -138,7 +138,7 @@
         SttPlanBasicEdit,
         testTable,
         testTableLong,
-        testSelect
+        testSelect, ClassListQuery
     } from "../api/getApiRes";
 
     let qs = require('qs');
@@ -172,11 +172,7 @@
                     fileList: [],
                     multipleSelection: [],
                     detectedmac: '',
-                    options: [
-                        {value: 99, label: '全部'},
-                        {value: 1, label: '进行中'},
-                        {value: 2, label: '已完成'},
-                    ],
+                    options: [],
                     time1: globalBt(),
                 },
                 multipleSelection: [],
@@ -222,6 +218,8 @@
             }
         },
         mounted() {
+            // 加载课程选项
+            this.panelSelect();
             if (this.$route.query.id == 0) {
                 //  深拷贝赋初始值
                 this.deepValue();
@@ -232,6 +230,28 @@
             }
         },
         methods: {
+            // 加载选项
+            panelSelect() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    vipType: '',
+                    start: 1,
+                    expDay: 0,
+                    tableMax: 9999,
+                };
+                let postdata = qs.stringify(param);
+                ClassListQuery(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        // that.dialogdata = json.Rs;
+                        that.panel.options = turnClassResToOption(json.Rs)
+                        console.log( that.panel.options);
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
             confirmEditLessonTable() {
                 let that = this;
                 if (!this.panel.name) {
@@ -315,6 +335,7 @@
                 for (let i = 0; i < this.tabs.length; i++) {
                     for (let j = 0; j < this.tabs[i].tableData.length; j++) {
                         thisRow = this.tabs[i].tableData[j];
+                        thisRow.lessonIndex = parseInt(j);
                         thisRow.PlanId = parseInt(this.$route.query.id);
                         thisRow.WeekDay = parseInt(i + 1);
                         thisRow.BeginStr = getHoursAndMin(thisRow.timeLong[0]);
@@ -442,14 +463,19 @@
             },
         },
         watch: {
-            $route() {
-                this.temId = this.$route.query.id
+            $route(to) {
+                if (to.name == 'EditLessonTable') {
+                    this.temId = this.$route.query.id;
+                }
             },
             temId(e) {
                 if (parseInt(e) == 0) {
                     this.pageTitle = '新增课程表模板'
+                    this.deepValue();
+                    this.panel.name = '';
                 } else {
                     this.pageTitle = '编辑课程表模板'
+                    this.getTableQuery();
                 }
             },
         },

+ 70 - 38
pc/src/views/LessonTable.vue

@@ -5,7 +5,7 @@
         </div>
         <div class="change">
             <el-button type="primary" @click="addLessonTable">新增课程表模板</el-button>
-            <el-button type="" @click="copy">复制</el-button>
+            <el-button type="" @click="copyDialog">复制</el-button>
             <el-button type="" @click="delList">删除</el-button>
         </div>
         <div class="table">
@@ -69,8 +69,8 @@
                         sortable
                 >
                     <template slot-scope="scope">
-                        <span v-if="scope.row.Status == 1">已发布</span>
-                        <span v-if="scope.row.Status == 0">未发布</span>
+                        <span v-if="scope.row.Status == 2">已发布</span>
+                        <span v-if="scope.row.Status == 1">未发布</span>
                     </template>
                 </el-table-column>
                 <el-table-column
@@ -84,9 +84,9 @@
                         <el-button type="success" size="mini" v-if="scope.row.Status == 1"
                                    @click="openLessonTable(scope.row)">发布
                         </el-button>
-                        <el-button type="warning" size="mini" v-if="scope.row.Status == 2" @click="unpubilc(scope.row)">
-                            取消发布
-                        </el-button>
+                        <!--                        <el-button type="warning" size="mini" v-if="scope.row.Status == 2" @click="unpubilc(scope.row)">-->
+                        <!--                            取消发布-->
+                        <!--                        </el-button>-->
                     </template>
                 </el-table-column>
 
@@ -101,7 +101,16 @@
         </div>
 
         <el-dialog title="课程表模板复制" :visible.sync="dialogCopyVisible" width="640px">
-            
+            <el-form ref="form" :model="copyForm" label-width="160px">
+                <el-form-item label="新模板名称">
+                    <el-input v-model="copyForm.name" placeholder="请输入新模板名称"></el-input>
+
+                </el-form-item>
+            </el-form>
+            <div class="dialogFooter">
+                <el-button type="primary" size="small" @click="copy">确定</el-button>
+                <el-button @click="dialogCopyVisible = false" size="small">取消</el-button>
+            </div>
         </el-dialog>
 
         <el-dialog title="发布课程表" :visible.sync="dialogVisible" width="640px">
@@ -122,16 +131,6 @@
                 </el-date-picker>
                 <br>
                 <br>
-                <span>
-                    微信可见
-                </span>
-                <el-switch
-                        v-model="form.wechat"
-                        :active-value="1"
-                        :inactive-value="0"
-                        active-color="#409EFF"
-                        inactive-color="#D9D9D9">
-                </el-switch>
                 <span>
                     微信可预约
                 </span>
@@ -148,17 +147,26 @@
                 <el-button @click="dialogVisible = false" size="small">取消</el-button>
             </div>
         </el-dialog>
+        <el-dialog title="预览本周" :visible.sync="previewVisible" width="1200px">
+            <preview></preview>
+            <div class="dialogFooter">
+                <el-button @click="previewVisible = false" size="small">关闭</el-button>
+            </div>
+        </el-dialog>
+
     </div>
 </template>
 
 <script>
     import Global from '../Global.js'
+    import preview from '@/components/preview.vue'
     import {
         SttPlanBasicListQuery,
         ClassVisibleStatusEdit,
         SttPlanBasicShopEdit,
         SttPlanBasicStatusEdit,
         SttPlanCopy,
+        SttPlanPublish,
         testTable,
         testSelect,
     } from "../api/getApiRes";
@@ -169,6 +177,7 @@
             return {
                 dialogVisible: false,
                 dialogCopyVisible: false,
+                previewVisible: false,//todo
                 dialogdata: [],
                 dialogValue: [],
                 // panel 配置项目
@@ -186,6 +195,10 @@
                     wechat: 1,
                     appoint: 1,
                 },
+                copyForm: {
+                    Id: '',
+                    name: '',
+                },
                 tableData: []
             }
         },
@@ -247,12 +260,12 @@
                     return false
                 }
 
-                let detectorid = that.multipleSelection[0].Id;
+                let row = that.multipleSelection[0];
 
                 let param = {
                     token: localStorage.token,
-                    detectorid: detectorid,
-                    status: 9,//0禁用1启用9删除
+                    planId: row.PlanId,
+                    status: 9,//9删除
                 };
                 let postdata = qs.stringify(param);
 
@@ -261,12 +274,12 @@
                     cancelButtonText: '取消',
                     type: 'warning'
                 }).then(() => {
-                    testSelect(postdata).then(res => {
+                    SttPlanBasicStatusEdit(postdata).then(res => {
                         let json = res;
                         if (json.Code == 0) {
                             that.$message({
                                 showClose: true,
-                                message: '选中的会员已删除!',
+                                message: '选中的课程表模板已删除!',
                                 type: 'success'
                             });
                             // 重载列表
@@ -282,10 +295,8 @@
                     });
                 });
             },
-
-            copy() {
+            copyDialog() {
                 let that = this;
-                // checkNum
                 if (!this.multipleSelection.length) {
                     that.$message({
                         showClose: true,
@@ -302,13 +313,27 @@
                     });
                     return false
                 }
-
-                let detectorid = that.multipleSelection[0].Id;
+                let row = that.multipleSelection[0];
+                this.copyForm.name = '';
+                this.copyForm.Id = row.PlanId;
+                this.dialogCopyVisible = true;
+            },
+            copy() {
+                let that = this;
+                // checkNum
+                if (!that.copyForm.name) {
+                    this.$message.error('错了哦,新模版名不能为空');
+                    return false
+                }
+                if (that.copyForm.name.length > 20) {
+                    this.$message.error('错了哦,新模版名字的字数超过20个字');
+                    return false
+                }
 
                 let param = {
                     token: localStorage.token,
-                    detectorid: detectorid,
-                    status: 3,//0禁用1启用9删除
+                    planId: that.copyForm.Id,
+                    planName: that.copyForm.name,
                 };
                 let postdata = qs.stringify(param);
 
@@ -317,7 +342,7 @@
                     cancelButtonText: '取消',
                     type: 'warning'
                 }).then(() => {
-                    testSelect(postdata).then(res => {
+                    SttPlanCopy(postdata).then(res => {
                         let json = res;
                         if (json.Code == 0) {
                             that.$message({
@@ -325,6 +350,8 @@
                                 message: '选中的课程表已复制!',
                                 type: 'success'
                             });
+                            // 关闭弹窗
+                            that.dialogCopyVisible = false;
                             // 重载列表
                             that.getTableQuery();
                         } else {
@@ -341,13 +368,12 @@
             // 发布课程表
             openLessonTable(row) {
                 this.dialogVisible = true;
-                this.form.name = row.name;
-                this.form.Id = row.Id;
+                this.form.name = row.PlanName;
+                this.form.Id = row.PlanId;
                 this.form.week = '';
             },
             // 发布
             public() {
-                console.log(this.form.week);
                 let that = this;
                 if (!this.form.week) {
                     this.$message({
@@ -360,13 +386,12 @@
 
                 let param = {
                     token: localStorage.token,
-                    detectorid: this.form.Id,
-                    week: this.form.week,
-                    wechat: this.form.wechat,
-                    appoint: this.form.appoint,
+                    planId: this.form.Id,
+                    incomingDate: nonTfmtDatetoLength(this.form.week, 10),//对应日期 字符串 年-月-日 格式
+                    wxOrder: this.form.appoint,
                 };
                 let postdata = qs.stringify(param);
-                testSelect(postdata).then(res => {
+                SttPlanPublish(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         that.$message({
@@ -507,6 +532,9 @@
                 this.getTableQuery()
             },
         },
+        components: {
+            preview
+        }
     }
 </script>
 
@@ -597,4 +625,8 @@
         text-decoration: underline;
         cursor: pointer;
     }
+
+    em {
+        font-style: normal;
+    }
 </style>

+ 56 - 6
pc/src/views/Main.vue

@@ -77,13 +77,14 @@
             </div>
 
             <div class="appoint">
-                <div class="title" >
+                <div class="title">
                     <h5>预约课程</h5>
                     <span>{{getNowDate}}</span>
                 </div>
                 <div class="appointCard">
-                    <el-card class="box-card" v-for="c in classList" >
-                        <div class="cardTitle blue"  :style="{ color:c.color }">
+<!--                    TodayClassOrder-->
+                    <el-card class="box-card" v-for="c in classList">
+                        <div class="cardTitle blue" :style="{ color:c.color }">
                             {{c.name}}
                         </div>
                         <span>
@@ -103,10 +104,11 @@
                     <span @click="goPage('appoint')">查看全部</span>
                 </div>
                 <ul>
+<!--                    TodayVipOrder-->
                     <li v-for="as in appointList">
                         <div class="asTitle">
                             <img src="../assets/img/main/Oval.png" alt="">
-                          <span>
+                            <span>
                                 {{as.tel}}
                           </span>
                         </div>
@@ -124,7 +126,11 @@
 </template>
 
 <script>
-    import {testTable} from "../api/getApiRes";
+    import {
+        testTable,
+        TodayClassOrderQuery,
+        TodayVipOrderQuery,
+    } from "../api/getApiRes";
 
     let qs = require('qs');
     export default {
@@ -134,19 +140,23 @@
                 getNowDate: getNowDate(),
                 classList: [],
                 appointList: [],
+                TodayClassOrder: [],
+                TodayVipOrder: [],
             }
         },
         mounted() {
             let that = this;
 
             // 下课管理
+            this.getTodayClassOrderQuery();
+            this.getTodayVipOrderQuery();
             this.ClassQuery();
             this.appointQuery();
             this.timer = setInterval(() => {
                 that.appointQuery();
             }, 10000);
         },
-        destroyed () {
+        destroyed() {
             clearInterval(this.timer);//页面销毁时清除定时器
         },
         methods: {
@@ -156,6 +166,44 @@
                     query: {}
                 })
             },
+            getTodayClassOrderQuery(){
+                let that = this;
+                that.loading = true;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                TodayClassOrderQuery(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.loading = false;
+                        if (json.Rs) {
+                            that.TodayClassOrder = json.Rs;
+                        }
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
+            getTodayVipOrderQuery(){
+                let that = this;
+                that.loading = true;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                TodayVipOrderQuery(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.loading = false;
+                        if (json.Rs) {
+                            that.TodayVipOrder = json.Rs;
+                        }
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
             // 下课管理
             ClassQuery() {
                 let that = this;
@@ -601,6 +649,7 @@
         color: #000000;
         font-size: 14px;
     }
+
     .asTitle img {
         float: left;
         margin-right: 5px;
@@ -646,6 +695,7 @@
     .asContent span s.blue {
         background-color: #E5F2FF;
     }
+
     .box-card em {
         font-style: normal;
     }

+ 27 - 24
pc/src/views/lessonManage.vue

@@ -28,53 +28,53 @@
                         width="50">
                 </el-table-column>
                 <el-table-column
-                        prop="name"
+                        prop="Name"
                         label="日期"
                 >
                     <template slot-scope="scope">
                         <div class="rowHeight">
                         <span class="readyTime" v-if="scope.row.Status == 0">
-                               {{scope.row.name}}
+                               {{scope.row.Name}}
                         </span>
                             <span class="CurTime" v-if="scope.row.Status == 1">
-                               {{scope.row.name}}
+                               {{scope.row.Name}}
                         </span>
                             <i class="curIcon" v-if="scope.row.Status == 1"></i>
                             <span class="runTime" v-if="scope.row.Status == 2">
-                            {{scope.row.name}}
+                            {{scope.row.Name}}
                         </span>
                         </div>
                     </template>
                 </el-table-column>
                 <el-table-column
-                        prop="name"
+                        prop="Name"
                         label="课程表名称"
                         sortable
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="create"
+                        prop="EndDate"
                         label="最后编辑时间"
                         sortable
                 >
                 </el-table-column>
-                <el-table-column
-                        prop="wxVisible"
-                        label="微信可见"
-                        width="140px"
-                >
-                    <template slot-scope="scope">
-                        <el-switch
-                                v-model="scope.row.wxVisible"
-                                :active-value="1"
-                                :inactive-value="0"
-                                active-color="#409EFF"
-                                inactive-color="#D9D9D9"
-                                @change=changeWechat($event,scope.row)
-                        >
-                        </el-switch>
-                    </template>
-                </el-table-column>
+<!--                <el-table-column-->
+<!--                        prop="wxVisible"-->
+<!--                        label="微信可见"-->
+<!--                        width="140px"-->
+<!--                >-->
+<!--                    <template slot-scope="scope">-->
+<!--                        <el-switch-->
+<!--                                v-model="scope.row.wxVisible"-->
+<!--                                :active-value="1"-->
+<!--                                :inactive-value="0"-->
+<!--                                active-color="#409EFF"-->
+<!--                                inactive-color="#D9D9D9"-->
+<!--                                @change=changeWechat($event,scope.row)-->
+<!--                        >-->
+<!--                        </el-switch>-->
+<!--                    </template>-->
+<!--                </el-table-column>-->
                 <el-table-column
                         prop="Status"
                         label="操作"
@@ -144,6 +144,7 @@
 <script>
     import Global from '../Global.js'
     import {
+        STTBasicListQuery,
         testTable,
         testSelect
     } from "../api/getApiRes";
@@ -391,13 +392,15 @@
                     tableMax: 9999,//
                 };
                 let postdata = qs.stringify(param);
-                testTable(postdata).then(res => {
+                STTBasicListQuery(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
+                        console.log(23);
                         that.loading = false;
                         if (json.Rs) {
                             that.allTableData = json.Rs;
                             that.recordsTotal = json.Rs.length;
+                            console.log(123);
                         } else {
                             that.allTableData = [];
                             that.recordsTotal = 0;

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است