|
|
@@ -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>
|