Kaynağa Gözat

Merge branch 'vue_statistics_branch' of http://git.shengws.com/csx/Vue_New into vue_statistics_branch

csx 4 yıl önce
ebeveyn
işleme
685ace1807

+ 32 - 0
src/api/common/common.js Dosyayı Görüntüle

45
     params: params
45
     params: params
46
   })
46
   })
47
 }
47
 }
48
+
49
+export function getConfigurationDetail(id, params) {
50
+  return request({
51
+    url: 'com/api/getconfigurationdetail?id=' + id,
52
+    method: 'get',
53
+    params: params
54
+  })
55
+}
56
+
57
+export function getAllInspectionMinor(params) {
58
+  return request({
59
+    url: 'com/api/getallinspectionminor',
60
+    method: 'get',
61
+    params: params
62
+  })
63
+}
64
+
65
+export function UpdateConfiguration(id, data) {
66
+  return request({
67
+    url: 'com/api/updateconfiguration?id=' + id,
68
+    method: 'post',
69
+    data: data
70
+  })
71
+}
72
+
73
+export function DeleteConfiguration(id, params) {
74
+  return request({
75
+    url: 'com/api/deleteconfiguration?id=' + id,
76
+    method: 'post',
77
+    params: params
78
+  })
79
+}

+ 98 - 22
src/xt_pages/qcd/statisticalConfiguration.vue Dosyayı Görüntüle

33
           <el-table-column label="操作" width="180">
33
           <el-table-column label="操作" width="180">
34
             <template slot-scope="scope">
34
             <template slot-scope="scope">
35
               <el-button size="mini" type="primary" @click="handleEdit(scope.row.id)">编辑</el-button>
35
               <el-button size="mini" type="primary" @click="handleEdit(scope.row.id)">编辑</el-button>
36
-              <el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
36
+              <el-button size="mini" type="danger" @click="handleDelete(scope.row.id)">删除</el-button>
37
             </template>
37
             </template>
38
           </el-table-column>
38
           </el-table-column>
39
         </el-table>
39
         </el-table>
88
           <el-button type="primary" @click="saveInspection('form')">保存</el-button>
88
           <el-button type="primary" @click="saveInspection('form')">保存</el-button>
89
         </div>
89
         </div>
90
       </el-dialog>
90
       </el-dialog>
91
+
92
+
93
+
91
       <el-dialog title="编辑" :visible.sync="editDialog">
94
       <el-dialog title="编辑" :visible.sync="editDialog">
92
-        <el-form :model="form">
93
-          <el-form-item label="检查大项" :label-width="formLabelWidth">
94
-            <el-select v-model="form.inspectionMajor" placeholder="请选择活动区域">
95
+        <el-form :model="editform" ref="editform" :rules="rules">
96
+          <el-form-item label="检查大项" :label-width="formLabelWidth" required prop="inspectionMajor">
97
+            <el-select v-model="editform.inspectionMajor" placeholder="请选择活动区域" @change="changeInspectionTwo">
95
               <el-option
98
               <el-option
96
                   v-for="patient in InspectionMajor"
99
                   v-for="patient in InspectionMajor"
97
-                  :key="patient.id"
98
-                  :value="patient.id"
100
+                  :key="patient.project_id"
101
+                  :value="patient.project_id"
99
                   :label="patient.project_name"
102
                   :label="patient.project_name"
100
                   >
103
                   >
101
                </el-option>
104
                </el-option>
102
             </el-select>
105
             </el-select>
103
           </el-form-item>
106
           </el-form-item>
104
-          <el-form-item label="检查小项" :label-width="formLabelWidth">
105
-            <el-select v-model="form.inspectionMinor" placeholder="请选择活动区域">
107
+          <el-form-item label="检查小项" :label-width="formLabelWidth" required prop="inspectionMinor">
108
+            <el-select v-model="editform.inspectionMinor" placeholder="请选择活动区域"  @change="changeInspectionMonior">
106
                <el-option
109
                <el-option
107
-                  v-for="item in InspectionMinor"
108
-                  :key="item.project_id"
109
-                  :value="item.project_id"
110
+                  v-for="item in InspectionMinorTwo"
111
+                  :key="item.id"
112
+                  :value="item.id"
110
                   :label="item.item_name"
113
                   :label="item.item_name"
111
                   >
114
                   >
112
                 </el-option>
115
                 </el-option>
113
             </el-select>
116
             </el-select>
114
           </el-form-item>
117
           </el-form-item>
115
-          <el-form-item label="指控范围" :label-width="formLabelWidth">
116
-            <el-input style="width:200px" v-model="form.min_range"></el-input>&nbsp;
118
+          <el-form-item label="指控范围" :label-width="formLabelWidth" required prop="large_range">
119
+            <el-input style="width:200px" v-model="editform.min_range"></el-input>&nbsp;
117
             -
120
             -
118
-            <el-input style="width:200px" v-model="form.large_range"></el-input>
121
+            <el-input style="width:200px" v-model="editform.large_range"></el-input>
119
           </el-form-item>
122
           </el-form-item>
120
           <el-form-item label="排序" :label-width="formLabelWidth">
123
           <el-form-item label="排序" :label-width="formLabelWidth">
121
-            <el-input style="width:200px" v-model="form.sort"></el-input>
124
+            <el-input style="width:200px" v-model="editform.sort"></el-input>
122
           </el-form-item>
125
           </el-form-item>
123
         </el-form>
126
         </el-form>
124
         <div slot="footer" class="dialog-footer">
127
         <div slot="footer" class="dialog-footer">
125
           <el-button @click="editDialog = false">取 消</el-button>
128
           <el-button @click="editDialog = false">取 消</el-button>
126
-          <el-button type="primary" @click="editDialog = false">保存</el-button>
129
+          <el-button type="primary" @click="EditConfiguration('editform')">保存</el-button>
127
         </div>
130
         </div>
128
       </el-dialog>
131
       </el-dialog>
129
     </div>
132
     </div>
137
 import PieChart from "../qcd/components/BarChart";
140
 import PieChart from "../qcd/components/BarChart";
138
 import { uParseTime } from "@/utils/tools";
141
 import { uParseTime } from "@/utils/tools";
139
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
142
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
140
-import { getInspectionMajor,getInspectionMinor,getInspectionRange,saveConfiguration,getConfigurationList }from "@/api/common/common";
143
+import { getInspectionMajor,getInspectionMinor,getInspectionRange,saveConfiguration,getConfigurationList,getConfigurationDetail,getAllInspectionMinor,UpdateConfiguration,DeleteConfiguration }from "@/api/common/common";
141
 export default {
144
 export default {
142
   name: "dialysisTotal",
145
   name: "dialysisTotal",
143
   data() {
146
   data() {
150
       tabActiveName: "control",
153
       tabActiveName: "control",
151
       InspectionMajor:[],
154
       InspectionMajor:[],
152
       InspectionMinor:[],
155
       InspectionMinor:[],
156
+      InspectionMinorTwo:[],
153
       configuraData: [],
157
       configuraData: [],
154
       newDialog: false,
158
       newDialog: false,
155
       editDialog: false,
159
       editDialog: false,
161
         large_range: "",
165
         large_range: "",
162
         sort:"",
166
         sort:"",
163
       },
167
       },
168
+      editform:{
169
+         id:0,
170
+         inspectionMajor: "",
171
+         inspectionMinor: "",
172
+         min_range: "",
173
+         large_range: "",
174
+         sort:"",
175
+      },
164
       rules: {
176
       rules: {
165
         inspectionMajor: [{ required: true, message: "检查大项不能为空" }],
177
         inspectionMajor: [{ required: true, message: "检查大项不能为空" }],
166
         inspectionMinor: [{ required: true, message: "检查小项不能为空" }],
178
         inspectionMinor: [{ required: true, message: "检查小项不能为空" }],
177
         this.$router.push({ path: "/qcd/patientanalysis/checkStatistical" });
189
         this.$router.push({ path: "/qcd/patientanalysis/checkStatistical" });
178
       }
190
       }
179
     },
191
     },
192
+
193
+    //编辑
180
     handleEdit(id) {
194
     handleEdit(id) {
181
       this.editDialog = true;
195
       this.editDialog = true;
182
       getConfigurationDetail(id).then(response=>{
196
       getConfigurationDetail(id).then(response=>{
183
          if(response.data.state == 1){
197
          if(response.data.state == 1){
198
+           var configurationdetail = response.data.data.configurationdetail
199
+           console.log("详情",configurationdetail)
200
+           this.editform.id = configurationdetail.id
201
+           this.editform.inspectionMajor = configurationdetail.inspection_major
202
+           this.editform.inspectionMinor = configurationdetail.inspection_minor
203
+           this.editform.large_range = configurationdetail.large_range
204
+           this.editform.min_range = configurationdetail.min_range
205
+           this.editform.sort = configurationdetail.sort
184
          }
206
          }
185
       })
207
       })
186
     },
208
     },
190
       getInspectionMajor().then(response=>{
212
       getInspectionMajor().then(response=>{
191
         if(response.data.state == 1){
213
         if(response.data.state == 1){
192
           var inspection =  response.data.data.inspection
214
           var inspection =  response.data.data.inspection
193
-          console.log("inspection",inspection)
215
+          console.log("大项",inspection)
194
           this.InspectionMajor = inspection
216
           this.InspectionMajor = inspection
195
-
217
+         
196
         }
218
         }
197
       })
219
       })
198
     },
220
     },
199
     //获取小项
221
     //获取小项
200
     changeInspection(id){
222
     changeInspection(id){
201
-      console.log("id----",id)
202
       getInspectionMinor(id).then(response=>{
223
       getInspectionMinor(id).then(response=>{
203
         if(response.data.state == 1){
224
         if(response.data.state == 1){
204
          var inspection =  response.data.data.inspection
225
          var inspection =  response.data.data.inspection
205
-         console.log("inspection",inspection)
226
+         console.log("小项",inspection)
206
          this.InspectionMinor = inspection
227
          this.InspectionMinor = inspection
207
         }
228
         }
208
       })
229
       })
209
     },
230
     },
231
+    changeInspectionTwo(id){
232
+      this.InspectionMinorTwo = []
233
+       getInspectionMinor(id).then(response=>{
234
+        if(response.data.state == 1){
235
+         var inspection =  response.data.data.inspection
236
+         console.log("小项",inspection)
237
+         this.InspectionMinorTwo = inspection
238
+        }
239
+      })
240
+    },
210
     // 获取指控范围
241
     // 获取指控范围
211
     changeInspectionMonior(id){
242
     changeInspectionMonior(id){
212
        getInspectionRange(id).then(response=>{
243
        getInspectionRange(id).then(response=>{
261
           this.total = total
292
           this.total = total
262
         }
293
         }
263
       })
294
       })
264
-    }
295
+    },
296
+    //获取小项
297
+    getAllInspectionMinor(){
298
+      getAllInspectionMinor().then(response=>{
299
+        if(response.data.state == 1){
300
+          var minor =  response.data.data.minor
301
+          this.InspectionMinorTwo = minor
302
+          console.log("minor",minor)
303
+        }
304
+      })
305
+    },
306
+    EditConfiguration(formName){
307
+       var sorts =  this.editform.sort
308
+       var sort = parseInt(sorts)
309
+       this.editform.sort = sort
310
+      UpdateConfiguration(this.editform.id,this.editform).then(response=>{
311
+        if(response.data.state == 1){
312
+         var standard =  response.data.data.standard
313
+         console.log("standard",standard)
314
+         this.$message.success("保存成功")
315
+         this.editDialog = false
316
+         this.getConfigurationList()
317
+        }
318
+      })
319
+    },
320
+   handleDelete(id) {
321
+      this.$confirm(
322
+        "确认要删除所选记录吗? <br>删除后,该信息将无法恢复",
323
+        "删除提示",
324
+        {
325
+          dangerouslyUseHTMLString: true,
326
+          confirmButtonText: "确定",
327
+          cancelButtonText: "取消",
328
+          type: "warning"
329
+        }
330
+      ).then(() => {
331
+        DeleteConfiguration(id).then(response => {
332
+          if (response.data.state === 1) {
333
+            
334
+          }
335
+        });
336
+      });
337
+    },
265
   },
338
   },
266
   components: {
339
   components: {
267
     PieChart,
340
     PieChart,
272
        this.getInspectionMajor()
345
        this.getInspectionMajor()
273
     //获取表格里面的数据
346
     //获取表格里面的数据
274
     this.getConfigurationList()
347
     this.getConfigurationList()
348
+    //获取所有小项的数据
349
+    this.getAllInspectionMinor()
275
    },
350
    },
351
+
276
 };
352
 };
277
 </script>
353
 </script>
278
 <style lang="scss">
354
 <style lang="scss">