|
@@ -14,57 +14,87 @@
|
14
|
14
|
</el-col>
|
15
|
15
|
</el-row>
|
16
|
16
|
<div class="configTable">
|
17
|
|
- <el-table :data="tableData" border style="width: 100%">
|
18
|
|
- <el-table-column prop="date" label="日期" width="180"></el-table-column>
|
19
|
|
- <el-table-column prop="name" label="姓名" width="180"></el-table-column>
|
20
|
|
- <el-table-column prop="address" label="地址"></el-table-column>
|
|
17
|
+ <el-table :data="checkList" border style="width: 100%">
|
|
18
|
+ <el-table-column prop="date" label="检验检查项" width="180">
|
|
19
|
+ <template slot-scope="scope">{{ scope.row.project_name }}</template>
|
|
20
|
+ </el-table-column>
|
|
21
|
+ <el-table-column prop="name" label="检查频次(天)" width="180">
|
|
22
|
+ <template slot-scope="scope">{{ scope.row.inspection_frequency }}</template>
|
|
23
|
+ </el-table-column>
|
|
24
|
+ <el-table-column prop="address" label="排序">
|
|
25
|
+ <template slot-scope="scope">{{ scope.row.sort }}</template>
|
|
26
|
+ </el-table-column>
|
21
|
27
|
<el-table-column label="操作" width="180">
|
22
|
28
|
<template slot-scope="scope">
|
23
|
|
- <el-button size="mini" type="primary" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
24
|
|
- <el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
|
|
29
|
+ <el-button size="mini" type="primary" @click="handleEdit(scope.row.id)">编辑</el-button>
|
|
30
|
+ <el-button size="mini" type="danger" @click="handleDelete(scope.row.id,scope.$index)">删除</el-button>
|
25
|
31
|
</template>
|
26
|
32
|
</el-table-column>
|
27
|
33
|
</el-table>
|
|
34
|
+
|
|
35
|
+ <el-pagination
|
|
36
|
+ @size-change="handleSizeChange"
|
|
37
|
+ @current-change="handleCurrentChange"
|
|
38
|
+ :page-sizes="[10, 20, 30, 100]"
|
|
39
|
+ :page-size="10"
|
|
40
|
+ background
|
|
41
|
+ style="margin-top:20px;float: right"
|
|
42
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
43
|
+ :total="total">
|
|
44
|
+ </el-pagination>
|
28
|
45
|
</div>
|
29
|
46
|
|
30
|
47
|
<el-dialog title="新增" :visible.sync="newDialog">
|
31
|
|
- <el-form :model="form">
|
32
|
|
- <el-form-item label="检查大项" :label-width="formLabelWidth">
|
33
|
|
- <el-select v-model="form.region" placeholder="请选择活动区域">
|
34
|
|
- <el-option label="区域一" value="shanghai"></el-option>
|
35
|
|
- <el-option label="区域二" value="beijing"></el-option>
|
|
48
|
+ <el-form :model="form" ref="form" :rules="rules">
|
|
49
|
+ <el-form-item label="检查大项" :label-width="formLabelWidth" required prop="inspectionMajor">
|
|
50
|
+ <el-select v-model="form.inspectionMajor" placeholder="请选择活动区域">
|
|
51
|
+ <el-option
|
|
52
|
+ v-for="it in InspectionMajor"
|
|
53
|
+ :key="it.project_id"
|
|
54
|
+ :value="it.project_id"
|
|
55
|
+ :label="it.project_name"
|
|
56
|
+ >
|
|
57
|
+ </el-option>
|
36
|
58
|
</el-select>
|
37
|
59
|
</el-form-item>
|
38
|
|
- <el-form-item label="检查频次(天)" :label-width="formLabelWidth">
|
39
|
|
- <el-input style="width:200px" v-model="form.name"></el-input>
|
|
60
|
+ <el-form-item label="检查频次(天)" :label-width="formLabelWidth" required prop="frequency">
|
|
61
|
+ <el-input style="width:200px" v-model="form.frequency"></el-input>
|
40
|
62
|
</el-form-item>
|
41
|
63
|
<el-form-item label="排序" :label-width="formLabelWidth">
|
42
|
|
- <el-input style="width:200px" v-model="form.name"></el-input>
|
|
64
|
+ <el-input style="width:200px" v-model="form.sort"></el-input>
|
43
|
65
|
</el-form-item>
|
44
|
66
|
</el-form>
|
45
|
67
|
<div slot="footer" class="dialog-footer">
|
46
|
68
|
<el-button @click="newDialog = false">取 消</el-button>
|
47
|
|
- <el-button type="primary" @click="newDialog = false">确 定</el-button>
|
|
69
|
+ <el-button type="primary" @click="SaveCheckConfiguration('form')">保存</el-button>
|
48
|
70
|
</div>
|
49
|
71
|
</el-dialog>
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
50
|
75
|
<el-dialog title="编辑" :visible.sync="editDialog">
|
51
|
|
- <el-form :model="form">
|
52
|
|
- <el-form-item label="检查大项" :label-width="formLabelWidth">
|
53
|
|
- <el-select v-model="form.region" placeholder="请选择活动区域">
|
54
|
|
- <el-option label="区域一" value="shanghai"></el-option>
|
55
|
|
- <el-option label="区域二" value="beijing"></el-option>
|
|
76
|
+ <el-form :model="editform" ref="editform" :rules="rules">
|
|
77
|
+ <el-form-item label="检查大项" :label-width="formLabelWidth" required prop="inspectionMajor">
|
|
78
|
+ <el-select v-model="editform.inspectionMajor" placeholder="请选择活动区域">
|
|
79
|
+ <el-option
|
|
80
|
+ v-for="it in InspectionMajor"
|
|
81
|
+ :key="it.project_id"
|
|
82
|
+ :value="it.project_id"
|
|
83
|
+ :label="it.project_name"
|
|
84
|
+ >
|
|
85
|
+ </el-option>
|
56
|
86
|
</el-select>
|
57
|
87
|
</el-form-item>
|
58
|
|
- <el-form-item label="检查频次(天)" :label-width="formLabelWidth">
|
59
|
|
- <el-input style="width:200px" v-model="form.name"></el-input>
|
|
88
|
+ <el-form-item label="检查频次(天)" :label-width="formLabelWidth" required prop="frequency">
|
|
89
|
+ <el-input style="width:200px" v-model="editform.frequency"></el-input>
|
60
|
90
|
</el-form-item>
|
61
|
|
- <el-form-item label="排序" :label-width="formLabelWidth">
|
62
|
|
- <el-input style="width:200px" v-model="form.name"></el-input>
|
|
91
|
+ <el-form-item label="排序" :label-width="formLabelWidth" >
|
|
92
|
+ <el-input style="width:200px" v-model="editform.sort"></el-input>
|
63
|
93
|
</el-form-item>
|
64
|
94
|
</el-form>
|
65
|
95
|
<div slot="footer" class="dialog-footer">
|
66
|
96
|
<el-button @click="editDialog = false">取 消</el-button>
|
67
|
|
- <el-button type="primary" @click="editDialog = false">确 定</el-button>
|
|
97
|
+ <el-button type="primary" @click="UpdateCheck('editform')">保存</el-button>
|
68
|
98
|
</div>
|
69
|
99
|
</el-dialog>
|
70
|
100
|
</div>
|
|
@@ -78,6 +108,7 @@ import { GetOICData } from "@/api/qcd";
|
78
|
108
|
import PieChart from "../qcd/components/BarChart";
|
79
|
109
|
import { uParseTime } from "@/utils/tools";
|
80
|
110
|
import BreadCrumb from "@/xt_pages/components/bread-crumb";
|
|
111
|
+import {getAllInspectionData,SaveCheckConfiguration,getAllCheckList,getCheckDetail,UpdateCheck,DeleteCheck} from "@/api/common/common"
|
81
|
112
|
export default {
|
82
|
113
|
name: "dialysisTotal",
|
83
|
114
|
data() {
|
|
@@ -88,52 +119,146 @@ export default {
|
88
|
119
|
{ path: false, name: "检验检查统计配置" }
|
89
|
120
|
],
|
90
|
121
|
tabActiveName: "query",
|
91
|
|
- tableData: [
|
92
|
|
- {
|
93
|
|
- date: "2016-05-02",
|
94
|
|
- name: "王小虎",
|
95
|
|
- address: "上海市普陀区金沙江路 1518 弄"
|
96
|
|
- },
|
97
|
|
- {
|
98
|
|
- date: "2016-05-04",
|
99
|
|
- name: "王小虎",
|
100
|
|
- address: "上海市普陀区金沙江路 1517 弄"
|
101
|
|
- },
|
102
|
|
- {
|
103
|
|
- date: "2016-05-01",
|
104
|
|
- name: "王小虎",
|
105
|
|
- address: "上海市普陀区金沙江路 1519 弄"
|
106
|
|
- },
|
107
|
|
- {
|
108
|
|
- date: "2016-05-03",
|
109
|
|
- name: "王小虎",
|
110
|
|
- address: "上海市普陀区金沙江路 1516 弄"
|
111
|
|
- }
|
112
|
|
- ],
|
113
|
122
|
newDialog: false,
|
114
|
123
|
editDialog: false,
|
115
|
124
|
formLabelWidth: "120px",
|
116
|
125
|
form: {
|
117
|
|
- name: "",
|
118
|
|
- region: "",
|
119
|
|
- date1: "",
|
120
|
|
- date2: "",
|
121
|
|
- delivery: false,
|
122
|
|
- type: [],
|
123
|
|
- resource: "",
|
124
|
|
- desc: ""
|
125
|
|
- }
|
|
126
|
+ inspectionMajor:"",
|
|
127
|
+ frequency:"",
|
|
128
|
+ sort:"",
|
|
129
|
+ },
|
|
130
|
+ editform:{
|
|
131
|
+ id:0,
|
|
132
|
+ inspectionMajor:"",
|
|
133
|
+ frequency:"",
|
|
134
|
+ sort:"",
|
|
135
|
+ },
|
|
136
|
+ InspectionMajor:[],
|
|
137
|
+ rules: {
|
|
138
|
+ inspectionMajor: [{ required: true, message: "检查大项不能为空" }],
|
|
139
|
+ frequency: [{ required: true, message: "检查频次不能为空" }],
|
|
140
|
+ },
|
|
141
|
+ limit:10,
|
|
142
|
+ page:1,
|
|
143
|
+ total:0,
|
|
144
|
+ checkList:[],
|
126
|
145
|
};
|
127
|
146
|
},
|
128
|
|
- created() {},
|
|
147
|
+ created() {
|
|
148
|
+ //获取大项
|
|
149
|
+ this.getAllInspectionData(),
|
|
150
|
+ this.getAllCheckList()
|
|
151
|
+ },
|
129
|
152
|
methods: {
|
130
|
153
|
handleTabClick(tab, event) {
|
131
|
154
|
if (this.tabActiveName == "control") {
|
132
|
155
|
this.$router.push({ path: "/qcd/patientanalysis/statisticalConfig" });
|
133
|
156
|
}
|
134
|
157
|
},
|
135
|
|
- handleEdit() {
|
|
158
|
+ handleEdit(id) {
|
136
|
159
|
this.editDialog = true;
|
|
160
|
+ getCheckDetail(id).then(response=>{
|
|
161
|
+ if(response.data.state == 1){
|
|
162
|
+ var checkdetail = response.data.data.checkdetail
|
|
163
|
+ console.log("checkdetail",checkdetail)
|
|
164
|
+ this.editform.id = checkdetail.id
|
|
165
|
+ this.editform.inspectionMajor = checkdetail.inspection_major
|
|
166
|
+ this.editform.frequency = checkdetail.inspection_frequency
|
|
167
|
+ this.editform.sort = checkdetail.sort
|
|
168
|
+ }
|
|
169
|
+ })
|
|
170
|
+ },
|
|
171
|
+ getAllInspectionData(){
|
|
172
|
+ getAllInspectionData().then(response=>{
|
|
173
|
+ if(response.data.state == 1){
|
|
174
|
+ var inspection = response.data.data.inspection
|
|
175
|
+ //console.log("列表",inspection)
|
|
176
|
+ this.InspectionMajor = inspection
|
|
177
|
+ }
|
|
178
|
+ })
|
|
179
|
+ },
|
|
180
|
+ //新增
|
|
181
|
+ SaveCheckConfiguration(formName){
|
|
182
|
+ this.$refs[formName].validate(valid=>{
|
|
183
|
+ if(valid){
|
|
184
|
+ SaveCheckConfiguration(this.form).then(response=>{
|
|
185
|
+ if(response.data.state === 1){
|
|
186
|
+ var configuration = response.data.data.configuration
|
|
187
|
+ this.$message.success("保存成功")
|
|
188
|
+ this.newDialog = false
|
|
189
|
+ this.form.inspectionMajor = ""
|
|
190
|
+ this.form.frequency = ""
|
|
191
|
+ this.form.sort = ""
|
|
192
|
+ }else{
|
|
193
|
+ this.$message.error("检验检查项已存在,不能重复添加")
|
|
194
|
+ }
|
|
195
|
+ })
|
|
196
|
+ }
|
|
197
|
+ })
|
|
198
|
+ },
|
|
199
|
+ handleSizeChange(limit) {
|
|
200
|
+ this.limit = limit;
|
|
201
|
+ this.getAllCheckList()
|
|
202
|
+ },
|
|
203
|
+ handleCurrentChange(page) {
|
|
204
|
+ this.page = page;
|
|
205
|
+ this.getAllCheckList()
|
|
206
|
+ },
|
|
207
|
+ getAllCheckList(){
|
|
208
|
+ getAllCheckList(this.page,this.limit).then(response=>{
|
|
209
|
+ if(response.data.state == 1){
|
|
210
|
+ var checklist = response.data.data.checklist
|
|
211
|
+ for(let i=0;i<checklist.length;i++){
|
|
212
|
+ if(checklist[i].sort == 0){
|
|
213
|
+ checklist[i].sort = ""
|
|
214
|
+ }
|
|
215
|
+ }
|
|
216
|
+ console.log("列表",checklist)
|
|
217
|
+ this.checkList = checklist
|
|
218
|
+ this.total = response.data.data.total
|
|
219
|
+ console.log("total",this.total)
|
|
220
|
+ }
|
|
221
|
+ })
|
|
222
|
+ },
|
|
223
|
+ UpdateCheck(formName){
|
|
224
|
+ var sort = this.editform.sort
|
|
225
|
+ var sorts = parseInt(sort)
|
|
226
|
+ this.editform.sort = sorts
|
|
227
|
+ this.$refs[formName].validate(valid=>{
|
|
228
|
+ if(valid){
|
|
229
|
+ UpdateCheck(this.editform.id,this.editform).then(response=>{
|
|
230
|
+
|
|
231
|
+ if(response.data.state == 1){
|
|
232
|
+ var configuration = response.data.data.configuration
|
|
233
|
+ this.editDialog = false
|
|
234
|
+ this.getAllCheckList()
|
|
235
|
+ this.$message.success("保存成功")
|
|
236
|
+ }else{
|
|
237
|
+ this.$message.error("检验检查项已存在")
|
|
238
|
+ }
|
|
239
|
+ })
|
|
240
|
+ }
|
|
241
|
+ })
|
|
242
|
+ },
|
|
243
|
+ handleDelete(id,index){
|
|
244
|
+ this.$confirm(
|
|
245
|
+ "确认要删除所选记录吗? <br>删除后,该信息将无法恢复",
|
|
246
|
+ "删除提示",
|
|
247
|
+ {
|
|
248
|
+ dangerouslyUseHTMLString: true,
|
|
249
|
+ confirmButtonText: "确定",
|
|
250
|
+ cancelButtonText: "取消",
|
|
251
|
+ type: "warning"
|
|
252
|
+ }
|
|
253
|
+ ).then(() => {
|
|
254
|
+ DeleteCheck(id,index).then(response => {
|
|
255
|
+ if (response.data.state === 1) {
|
|
256
|
+ var msg = response.data.data.msg
|
|
257
|
+ console.log("msg",msg)
|
|
258
|
+ this.checkList.splice(index,1)
|
|
259
|
+ }
|
|
260
|
+ });
|
|
261
|
+ });
|
137
|
262
|
}
|
138
|
263
|
},
|
139
|
264
|
components: {
|