|
|
@@ -8,26 +8,56 @@
|
|
8
|
8
|
<page-content
|
|
9
|
9
|
ref="pageContentRef"
|
|
10
|
10
|
:contentTableConfig="contentTableConfig"
|
|
11
|
|
- pageName="/system/post"
|
|
|
11
|
+ pageName="/sms/template"
|
|
12
|
12
|
:isExport="false"
|
|
13
|
13
|
@newBtnClick="handleNewData"
|
|
14
|
14
|
@editBtnClick="handleEditData"
|
|
15
|
15
|
>
|
|
16
|
|
- <template #postStatus="{ row }">
|
|
|
16
|
+ <template #templateStatus="{ row }">
|
|
17
|
17
|
<el-tag :type="row.status === '0' ? 'error' : 'success'">{{ row.status === '0' ? '禁用' : '启用' }}</el-tag>
|
|
18
|
18
|
</template>
|
|
|
19
|
+ <template #handlerOperation="{ row }">
|
|
|
20
|
+ <el-button type="primary" v-if="row.status=='1'" link @click="handleEdit(row)">编辑</el-button>
|
|
|
21
|
+ <el-button type="primary" v-if="row.status=='1'" link @click="handleEnable(row)">禁用</el-button>
|
|
|
22
|
+ <el-button type="primary" v-if="row.status=='0'" link @click="handleEnable(row)">启用</el-button>
|
|
|
23
|
+ <el-button type="primary" link @click="handleDelete(row)">删除</el-button>
|
|
|
24
|
+ <el-button type="primary" link @click="handleTest(row)">测试</el-button>
|
|
|
25
|
+ </template>
|
|
19
|
26
|
</page-content>
|
|
20
|
27
|
<page-modal
|
|
21
|
28
|
:defaultInfo="defaultInfo"
|
|
22
|
29
|
ref="pageModalRef"
|
|
23
|
|
- pageName="/system/post"
|
|
|
30
|
+ pageName="/sms/template"
|
|
24
|
31
|
:modalConfig="modalConfigRef"
|
|
25
|
32
|
></page-modal>
|
|
|
33
|
+ <el-dialog
|
|
|
34
|
+ v-model="dialogVisible"
|
|
|
35
|
+ title="测试"
|
|
|
36
|
+ width="500"
|
|
|
37
|
+ :before-close="handleClose"
|
|
|
38
|
+ >
|
|
|
39
|
+ <el-form label-width="auto">
|
|
|
40
|
+ <el-form-item label="手机号">
|
|
|
41
|
+ <el-input v-model="templateForm.tel" />
|
|
|
42
|
+ </el-form-item>
|
|
|
43
|
+ <el-form-item label="短信内容">
|
|
|
44
|
+ <el-input v-model="templateForm.content" type="textarea" />
|
|
|
45
|
+ </el-form-item>
|
|
|
46
|
+ </el-form>
|
|
|
47
|
+ <template #footer>
|
|
|
48
|
+ <div class="dialog-footer">
|
|
|
49
|
+ <el-button @click="dialogVisible = false">取消</el-button>
|
|
|
50
|
+ <el-button type="primary" @click="handleSend">
|
|
|
51
|
+ 确定
|
|
|
52
|
+ </el-button>
|
|
|
53
|
+ </div>
|
|
|
54
|
+ </template>
|
|
|
55
|
+ </el-dialog>
|
|
26
|
56
|
</div>
|
|
27
|
57
|
</template>
|
|
28
|
58
|
|
|
29
|
59
|
<script>
|
|
30
|
|
-import { defineComponent } from 'vue'
|
|
|
60
|
+import { defineComponent,onMounted } from 'vue'
|
|
31
|
61
|
|
|
32
|
62
|
import PageSearch from '@/components/page-search'
|
|
33
|
63
|
import PageContent from '@/components/page-content'
|
|
|
@@ -40,8 +70,10 @@ import { modalConfig } from './config/modal.config'
|
|
40
|
70
|
import { usePageSearch } from '@/hooks/use-page-search'
|
|
41
|
71
|
import { usePageModal } from '@/hooks/use-page-modal'
|
|
42
|
72
|
|
|
|
73
|
+import { editPageData, deletePageData } from '@/api/main/system/system';
|
|
|
74
|
+
|
|
43
|
75
|
export default defineComponent({
|
|
44
|
|
- name: 'FollowUpPlan',
|
|
|
76
|
+ name: 'MsgTemplate',
|
|
45
|
77
|
components: {
|
|
46
|
78
|
PageSearch,
|
|
47
|
79
|
PageContent,
|
|
|
@@ -49,7 +81,41 @@ export default defineComponent({
|
|
49
|
81
|
},
|
|
50
|
82
|
setup() {
|
|
51
|
83
|
const [pageContentRef, handleResetClick, handleQueryClick] = usePageSearch()
|
|
|
84
|
+ const { proxy } = getCurrentInstance();
|
|
|
85
|
+ const dialogVisible = ref(false)
|
|
|
86
|
+ const templateForm = ref({})
|
|
|
87
|
+ function handleSend() {
|
|
|
88
|
+ console.log(templateForm.value)
|
|
|
89
|
+ }
|
|
|
90
|
+ function handleDelete(data) {
|
|
|
91
|
+ deletePageData('/sms/template/'+data.templateId).then((data) => {
|
|
|
92
|
+ proxy.$modal.msgSuccess('删除成功');
|
|
|
93
|
+ pageContentRef.value.getPageData()
|
|
|
94
|
+ });
|
|
|
95
|
+ }
|
|
|
96
|
+ function handleEdit(data) {
|
|
|
97
|
+ console.log(data);
|
|
|
98
|
+ defaultInfo.value = data
|
|
|
99
|
+ pageModalRef.value.dialogVisible = true
|
|
|
100
|
+ }
|
|
|
101
|
+ function handleEnable(data) {
|
|
52
|
102
|
|
|
|
103
|
+ const params ={
|
|
|
104
|
+ templateId:data.templateId,
|
|
|
105
|
+ content:data.content,
|
|
|
106
|
+ templateCode:data.templateCode,
|
|
|
107
|
+ templateName:data.templateName,
|
|
|
108
|
+ status:data.status ==='1'?'0':'1'
|
|
|
109
|
+ }
|
|
|
110
|
+ editPageData('/sms/template', params).then((data) => {
|
|
|
111
|
+ proxy.$modal.msgSuccess(data.status ==='1'?'禁用成功':'启用成功');
|
|
|
112
|
+ pageContentRef.value.getPageData()
|
|
|
113
|
+ });
|
|
|
114
|
+ }
|
|
|
115
|
+ function handleTest(data) {
|
|
|
116
|
+ console.log(data)
|
|
|
117
|
+ dialogVisible.value = true
|
|
|
118
|
+ }
|
|
53
|
119
|
// 1.处理逻辑
|
|
54
|
120
|
const newCallback = () => {}
|
|
55
|
121
|
const editCallback = () => {
|
|
|
@@ -65,6 +131,14 @@ export default defineComponent({
|
|
65
|
131
|
const [pageModalRef, defaultInfo, handleNewData, handleEditData] =
|
|
66
|
132
|
usePageModal(newCallback, editCallback)
|
|
67
|
133
|
return {
|
|
|
134
|
+ handleSend,
|
|
|
135
|
+ templateForm,
|
|
|
136
|
+ dialogVisible,
|
|
|
137
|
+ proxy,
|
|
|
138
|
+ handleDelete,
|
|
|
139
|
+ handleEdit,
|
|
|
140
|
+ handleTest,
|
|
|
141
|
+ handleEnable,
|
|
68
|
142
|
searchFormConfig,
|
|
69
|
143
|
contentTableConfig,
|
|
70
|
144
|
pageContentRef,
|