|
@@ -54,7 +54,7 @@
|
|
|
<el-table-column prop="name" label="模板名称"> </el-table-column>
|
|
<el-table-column prop="name" label="模板名称"> </el-table-column>
|
|
|
<el-table-column prop="cname" label="创建人"> </el-table-column>
|
|
<el-table-column prop="cname" label="创建人"> </el-table-column>
|
|
|
<el-table-column prop="ctime" label="创建时间"> </el-table-column>
|
|
<el-table-column prop="ctime" label="创建时间"> </el-table-column>
|
|
|
- <el-table-column prop="zip" width="150" label="操作">
|
|
|
|
|
|
|
+ <el-table-column prop="zip" width="250" label="操作">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
<el-button
|
|
|
class="edit"
|
|
class="edit"
|
|
@@ -63,15 +63,24 @@
|
|
|
v-if="scope.row.edit"
|
|
v-if="scope.row.edit"
|
|
|
>编辑</el-button
|
|
>编辑</el-button
|
|
|
>
|
|
>
|
|
|
- <el-button
|
|
|
|
|
- class="edit"
|
|
|
|
|
- type="text"
|
|
|
|
|
- @click="edit(scope.row)"
|
|
|
|
|
|
|
+ <el-tooltip
|
|
|
v-else
|
|
v-else
|
|
|
- disabled
|
|
|
|
|
- >编辑</el-button
|
|
|
|
|
|
|
+ class="item"
|
|
|
|
|
+ effect="dark"
|
|
|
|
|
+ content="该模版使用的问卷正在被填报,无法修改,可新增模版-选择复用历史模版使用该模版或删除正在使用该模版的问卷!"
|
|
|
|
|
+ placement="top-start"
|
|
|
>
|
|
>
|
|
|
- <el-button class="del" @click="del(scope.row.id)" type="text"
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ class="edit"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ style="color: #ccc; cursor: not-allowed"
|
|
|
|
|
+ >编辑</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-tooltip>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ class="del"
|
|
|
|
|
+ @click="del(scope.row.id)"
|
|
|
|
|
+ type="text"
|
|
|
>删除</el-button
|
|
>删除</el-button
|
|
|
>
|
|
>
|
|
|
</template>
|
|
</template>
|
|
@@ -96,12 +105,17 @@
|
|
|
size="small"
|
|
size="small"
|
|
|
class="preview"
|
|
class="preview"
|
|
|
:inline="false"
|
|
:inline="false"
|
|
|
- label-width="80px"
|
|
|
|
|
|
|
+ label-width="100px"
|
|
|
:rules="rules"
|
|
:rules="rules"
|
|
|
:model="form1"
|
|
:model="form1"
|
|
|
>
|
|
>
|
|
|
- <el-form-item label="选择历史模板" v-if="!form1.id">
|
|
|
|
|
- <el-select v-model="form1.copyid" filterable @change="changeTemplate">
|
|
|
|
|
|
|
+ <el-form-item label="复用历史模板" v-if="!form1.id">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="form1.copyid"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ @change="changeTemplate"
|
|
|
|
|
+ placeholder="请选择历史模板"
|
|
|
|
|
+ >
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="(item, index) in allTemplate"
|
|
v-for="(item, index) in allTemplate"
|
|
|
:key="index"
|
|
:key="index"
|
|
@@ -153,17 +167,24 @@ export default {
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- changeTemplate(val){
|
|
|
|
|
- let selVal = this.allTemplate.filter(function(x){return x.id==val})
|
|
|
|
|
- this.form1.name = selVal[0].name
|
|
|
|
|
|
|
+ switchStatus(row) {
|
|
|
|
|
+ this.$api.editTemplateStatus({id:row.id}).then((res)=>{
|
|
|
|
|
+ row.status = res.data.data
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ changeTemplate(val) {
|
|
|
|
|
+ let selVal = this.allTemplate.filter(function (x) {
|
|
|
|
|
+ return x.id == val;
|
|
|
|
|
+ });
|
|
|
|
|
+ this.form1.name = selVal[0].name;
|
|
|
},
|
|
},
|
|
|
addTtitle() {
|
|
addTtitle() {
|
|
|
this.$refs["form1"].validate((valid) => {
|
|
this.$refs["form1"].validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
- let query = { title: this.form1.name, id: this.form1.id }
|
|
|
|
|
- if(this.form1.copyid){
|
|
|
|
|
- query.id = this.form1.copyid
|
|
|
|
|
- query.copyid = this.form1.copyid
|
|
|
|
|
|
|
+ let query = { title: this.form1.name, id: this.form1.id };
|
|
|
|
|
+ if (this.form1.copyid) {
|
|
|
|
|
+ query.id = this.form1.copyid;
|
|
|
|
|
+ query.copyid = this.form1.copyid;
|
|
|
}
|
|
}
|
|
|
this.$router.push({
|
|
this.$router.push({
|
|
|
path: "/message/template/add",
|
|
path: "/message/template/add",
|
|
@@ -190,7 +211,8 @@ export default {
|
|
|
},
|
|
},
|
|
|
edit(row) {
|
|
edit(row) {
|
|
|
this.$api.getTemplate({ id: row.id }).then((res) => {
|
|
this.$api.getTemplate({ id: row.id }).then((res) => {
|
|
|
- this.form1 = row;
|
|
|
|
|
|
|
+ // this.form1 = row;
|
|
|
|
|
+ this.form1 = res.data.data;
|
|
|
this.dialogVisible = true;
|
|
this.dialogVisible = true;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|