|
@@ -1,94 +1,204 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div class="app-container">
|
3
|
3
|
<el-form :inline="true">
|
4
|
|
- <el-form-item label="姓名:">
|
|
4
|
+ <el-form-item label="诊所名称:">
|
5
|
5
|
<el-input
|
6
|
|
- v-model="form.doctorName"
|
7
|
|
- placeholder="请输入姓名查找"
|
|
6
|
+ v-model="clinicName"
|
|
7
|
+ placeholder="请输入诊所名称查找"
|
8
|
8
|
></el-input>
|
9
|
9
|
</el-form-item>
|
10
|
10
|
<el-form-item>
|
11
|
11
|
<el-button type="primary" @click="initList" icon="el-icon-search"
|
12
|
|
- >搜索</el-button
|
|
12
|
+ >搜索
|
|
13
|
+ </el-button
|
13
|
14
|
>
|
14
|
15
|
<el-button @click="reset">重置</el-button>
|
15
|
16
|
</el-form-item>
|
16
|
17
|
</el-form>
|
17
|
18
|
|
18
|
19
|
<el-row style="margin-bottom: 20px;">
|
19
|
|
- <el-button type="primary" plain icon="el-icon-plus" size="mini"
|
20
|
|
- >新增</el-button
|
|
20
|
+ <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="add()"
|
|
21
|
+ >新增
|
|
22
|
+ </el-button
|
21
|
23
|
>
|
22
|
24
|
</el-row>
|
23
|
25
|
|
24
|
26
|
<el-table :data="tableData" style="width: 100%">
|
25
|
|
- <el-table-column prop="date" label="日期" align="center">
|
|
27
|
+ <el-table-column prop="clinicCode" label="诊所编号" align="center">
|
26
|
28
|
</el-table-column>
|
27
|
|
- <el-table-column prop="name" label="姓名" align="center">
|
|
29
|
+ <el-table-column prop="clinicName" label="诊所名称" align="center">
|
|
30
|
+ </el-table-column>
|
|
31
|
+ <el-table-column prop="clinicIp" label="IP地址" align="center">
|
|
32
|
+ </el-table-column>
|
|
33
|
+ <el-table-column prop="phone" label="手机号" align="center">
|
|
34
|
+ </el-table-column>
|
|
35
|
+ <el-table-column prop="serverUser" label="服务器登录名" align="center">
|
|
36
|
+ </el-table-column>
|
|
37
|
+ <el-table-column prop="serverPassword" label="服务器密码" align="center">
|
|
38
|
+ </el-table-column>
|
|
39
|
+ <el-table-column prop="versionInfo" label="服务器版本编号" align="center">
|
|
40
|
+ </el-table-column>
|
|
41
|
+ <el-table-column prop="versionRefer" label="购买版本" align="center">
|
|
42
|
+ </el-table-column>
|
|
43
|
+ <el-table-column prop="creatTime" label="购买时间" align="center" width="170px">
|
|
44
|
+ </el-table-column>
|
|
45
|
+ <el-table-column prop="expireTime" label="到期时间" align="center" width="170px">
|
|
46
|
+ </el-table-column>
|
|
47
|
+ <el-table-column prop="isExpire" label="是否到期" align="center" width="170px">
|
|
48
|
+ <template slot-scope="scope">
|
|
49
|
+ <p v-if="scope.row.isExpire > 30 " style="color: green"> 剩余天数({{scope.row.isExpire}}) </p>
|
|
50
|
+ <p v-else-if="scope.row.isExpire > 1 && scope.row.isExpire < 31" style="color: orange"> 剩余天数({{scope.row.isExpire}}) </p>
|
|
51
|
+ <span v-else style="color: red">已到期</span>
|
|
52
|
+ </template>
|
28
|
53
|
</el-table-column>
|
29
|
54
|
<el-table-column prop="address" label="地址" align="center">
|
30
|
55
|
</el-table-column>
|
31
|
56
|
<el-table-column fixed="right" label="操作" align="center">
|
32
|
57
|
<template slot-scope="scope">
|
33
|
|
- <el-button type="text" size="small">编辑</el-button>
|
34
|
|
- <el-button type="text" size="small" style="color: red"
|
35
|
|
- >删除</el-button
|
36
|
|
- >
|
|
58
|
+ <el-button type="text" size="small" @click="upgrade(scope.row)">升级</el-button>
|
|
59
|
+ <el-button type="text" size="small" @click="edit(scope.row)">编辑</el-button>
|
|
60
|
+ <el-button type="text" size="small" style="color: red" @click="deleteData(scope.row.id)">删除
|
|
61
|
+ </el-button>
|
37
|
62
|
</template>
|
38
|
63
|
</el-table-column>
|
39
|
64
|
</el-table>
|
40
|
65
|
|
41
|
66
|
<pagination
|
42
|
|
- v-show="total > 0"
|
43
|
|
- :total="total"
|
44
|
|
- :page.sync="form.pageNum"
|
45
|
|
- :limit.sync="form.pageSize"
|
46
|
|
- @pagination="initList"
|
|
67
|
+ v-show="total > 0"
|
|
68
|
+ :total="total"
|
|
69
|
+ :page.sync="form.pageNum"
|
|
70
|
+ :limit.sync="form.pageSize"
|
|
71
|
+ @pagination="initList"
|
|
72
|
+ />
|
|
73
|
+ <addClinic
|
|
74
|
+ :onOpen="onOpen"
|
|
75
|
+ :title="title"
|
|
76
|
+ :pageType="pageType"
|
|
77
|
+ :dictType="dictType"
|
|
78
|
+ ref="addClinicRef"
|
|
79
|
+ @closeDialog="closeDialog"
|
|
80
|
+ />
|
|
81
|
+ <upgrade
|
|
82
|
+ :upgradeOpen="upgradeOpen"
|
|
83
|
+ :title="title"
|
|
84
|
+ ref="upgradeOpenRef"
|
|
85
|
+ @closeDialog="closeDialog"
|
47
|
86
|
/>
|
48
|
87
|
</div>
|
49
|
88
|
</template>
|
50
|
89
|
|
51
|
90
|
<script>
|
|
91
|
+import {clinictList,delClinict} from '@/api/allApi.js'
|
|
92
|
+import addClinic from "./addClinic.vue";
|
|
93
|
+import upgrade from "./upgrade.vue";
|
|
94
|
+
|
52
|
95
|
export default {
|
53
|
96
|
name: 'EitcErmPcIndex',
|
54
|
|
-
|
|
97
|
+ computed: {
|
|
98
|
+ },
|
|
99
|
+ components: {
|
|
100
|
+ upgrade,
|
|
101
|
+ addClinic
|
|
102
|
+ },
|
55
|
103
|
data() {
|
56
|
104
|
return {
|
|
105
|
+ onOpen: false,
|
|
106
|
+ upgradeOpen: false,
|
|
107
|
+ title: ``,
|
|
108
|
+ dictType: ``,
|
57
|
109
|
form: {
|
58
|
110
|
pageNum: 1,
|
59
|
111
|
pageSize: 10
|
60
|
112
|
},
|
61
|
|
- tableData: [
|
62
|
|
- {
|
63
|
|
- date: '2016-05-02',
|
64
|
|
- name: '王小虎',
|
65
|
|
- address: '上海市普陀区金沙江路 1518 弄'
|
66
|
|
- },
|
67
|
|
- {
|
68
|
|
- date: '2016-05-04',
|
69
|
|
- name: '王小虎',
|
70
|
|
- address: '上海市普陀区金沙江路 1517 弄'
|
71
|
|
- },
|
72
|
|
- {
|
73
|
|
- date: '2016-05-01',
|
74
|
|
- name: '王小虎',
|
75
|
|
- address: '上海市普陀区金沙江路 1519 弄'
|
76
|
|
- },
|
77
|
|
- {
|
78
|
|
- date: '2016-05-03',
|
79
|
|
- name: '王小虎',
|
80
|
|
- address: '上海市普陀区金沙江路 1516 弄'
|
81
|
|
- }
|
82
|
|
- ],
|
83
|
|
- total: 0
|
|
113
|
+ clinicName: '',
|
|
114
|
+ data: {},
|
|
115
|
+ editData: {},
|
|
116
|
+ tableData: [],
|
|
117
|
+ total: 0,
|
|
118
|
+ pageType: 1,
|
84
|
119
|
}
|
85
|
120
|
},
|
86
|
121
|
|
87
|
|
- mounted() {},
|
|
122
|
+ mounted() {
|
|
123
|
+ this.initList('')
|
|
124
|
+ },
|
88
|
125
|
|
89
|
126
|
methods: {
|
90
|
|
- initList() {},
|
91
|
|
- reset() {}
|
|
127
|
+ /**
|
|
128
|
+ * 编辑
|
|
129
|
+ */
|
|
130
|
+ edit(val) {
|
|
131
|
+ this.onOpen = true;
|
|
132
|
+ this.pageType = 2;
|
|
133
|
+ this.$refs.addClinicRef.formData = val;
|
|
134
|
+ },
|
|
135
|
+ /**
|
|
136
|
+ * 新增
|
|
137
|
+ */
|
|
138
|
+ add(){
|
|
139
|
+ this.onOpen = true;
|
|
140
|
+ this.pageType = 1;
|
|
141
|
+ },
|
|
142
|
+ /**
|
|
143
|
+ * 升级页面
|
|
144
|
+ */
|
|
145
|
+ upgrade(val){
|
|
146
|
+ this.upgradeOpen = true;
|
|
147
|
+ val.versionInfoOld = val.versionInfo
|
|
148
|
+ this.$refs.upgradeOpenRef.formData = val;
|
|
149
|
+ console.log(val)
|
|
150
|
+ },
|
|
151
|
+ async initList() {
|
|
152
|
+ let obj = {}
|
|
153
|
+ if (this.clinicName.length>0){
|
|
154
|
+ obj = {clinicName: this.clinicName}
|
|
155
|
+ }
|
|
156
|
+ const res = await clinictList(obj)
|
|
157
|
+ this.tableData = res.rows;
|
|
158
|
+ this.tableData.forEach(x=>{
|
|
159
|
+ const today = new Date();
|
|
160
|
+ let endTime = new Date(Date.parse(x.expireTime.replace(/-/g, "/"))).getTime();
|
|
161
|
+ x.isExpire =Math.ceil(Math.abs((today - endTime)) / (1000 * 60 * 60 * 24));
|
|
162
|
+ })
|
|
163
|
+ },
|
|
164
|
+ /**
|
|
165
|
+ * 重置
|
|
166
|
+ */
|
|
167
|
+ reset() {
|
|
168
|
+ this.clinicName = ''
|
|
169
|
+ },
|
|
170
|
+ /**
|
|
171
|
+ * 关闭弹窗
|
|
172
|
+ */
|
|
173
|
+ closeDialog(){
|
|
174
|
+ this.onOpen = false;
|
|
175
|
+ this.upgradeOpen = false;
|
|
176
|
+ },
|
|
177
|
+ /**
|
|
178
|
+ * 删除
|
|
179
|
+ */
|
|
180
|
+ deleteData(id) {
|
|
181
|
+ this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
|
|
182
|
+ confirmButtonText: '确定',
|
|
183
|
+ cancelButtonText: '取消',
|
|
184
|
+ type: 'warning'
|
|
185
|
+ }).then(() => {
|
|
186
|
+ delClinict(id).then(res => {
|
|
187
|
+ if (res.code !== 200) return this.$message.error(res.msg);
|
|
188
|
+ this.initList()
|
|
189
|
+ this.$message({
|
|
190
|
+ type: 'success',
|
|
191
|
+ message: '删除成功!'
|
|
192
|
+ });
|
|
193
|
+ })
|
|
194
|
+ }).catch(() => {
|
|
195
|
+ this.$message({
|
|
196
|
+ type: 'info',
|
|
197
|
+ message: '已取消删除'
|
|
198
|
+ });
|
|
199
|
+ });
|
|
200
|
+
|
|
201
|
+ }
|
92
|
202
|
}
|
93
|
203
|
}
|
94
|
|
-</script>
|
|
204
|
+</script>
|