Browse Source

统计配置开发

XMLWAN 5 years ago
parent
commit
3e61218ed4

+ 29 - 0
src/api/common/common.js View File

77
     params: params
77
     params: params
78
   })
78
   })
79
 }
79
 }
80
+
81
+export function getAllInspectionData(params) {
82
+  return request({
83
+    url: 'com/api/getallinspectiondata',
84
+    method: 'get',
85
+    params: params
86
+  })
87
+}
88
+
89
+export function SaveCheckConfiguration(data) {
90
+  console.log('data', data)
91
+  return request({
92
+    url: '/com/api/savecheckconfiguration',
93
+    method: 'post',
94
+    data: data
95
+  })
96
+}
97
+
98
+export function getAllCheckList(page, limit) {
99
+  const params = {
100
+    page: page,
101
+    limit: limit
102
+  }
103
+  return request({
104
+    url: '/com/api/getallchecklist',
105
+    method: 'get',
106
+    params: params
107
+  })
108
+}

+ 86 - 19
src/xt_pages/qcd/checkStatistical.vue View File

25
             </template>
25
             </template>
26
           </el-table-column>
26
           </el-table-column>
27
         </el-table>
27
         </el-table>
28
+
29
+          <el-pagination
30
+              @size-change="handleSizeChange"
31
+              @current-change="handleCurrentChange"
32
+              :page-sizes="[10, 20, 30, 100]"
33
+              :page-size="10"
34
+              background
35
+              style="margin-top:20px;float: right"
36
+              layout="total, sizes, prev, pager, next, jumper"
37
+              :total="total">
38
+          </el-pagination>
28
       </div>
39
       </div>
29
 
40
 
30
       <el-dialog title="新增" :visible.sync="newDialog">
41
       <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>
42
+        <el-form :model="form" ref="form" :rules="rules">
43
+          <el-form-item label="检查大项" :label-width="formLabelWidth" required prop="inspectionMajor">
44
+            <el-select v-model="form.inspectionMajor" placeholder="请选择活动区域" @change="changeInspectionMonior">
45
+                <el-option
46
+                  v-for="it in InspectionMajor"
47
+                  :key="it.project_id"
48
+                  :value="it.project_id"
49
+                  :label="it.project_name"
50
+                  >
51
+                </el-option>
36
             </el-select>
52
             </el-select>
37
           </el-form-item>
53
           </el-form-item>
38
-          <el-form-item label="检查频次(天)" :label-width="formLabelWidth">
39
-            <el-input style="width:200px" v-model="form.name"></el-input>
54
+          <el-form-item label="检查频次(天)" :label-width="formLabelWidth" required prop="frequency">
55
+            <el-input style="width:200px" v-model="form.frequency"></el-input>
40
           </el-form-item>
56
           </el-form-item>
41
           <el-form-item label="排序" :label-width="formLabelWidth">
57
           <el-form-item label="排序" :label-width="formLabelWidth">
42
-            <el-input style="width:200px" v-model="form.name"></el-input>
58
+            <el-input style="width:200px" v-model="form.sort"></el-input>
43
           </el-form-item>
59
           </el-form-item>
44
         </el-form>
60
         </el-form>
45
         <div slot="footer" class="dialog-footer">
61
         <div slot="footer" class="dialog-footer">
46
           <el-button @click="newDialog = false">取 消</el-button>
62
           <el-button @click="newDialog = false">取 消</el-button>
47
-          <el-button type="primary" @click="newDialog = false">确 定</el-button>
63
+          <el-button type="primary" @click="SaveCheckConfiguration('form')">保存</el-button>
48
         </div>
64
         </div>
49
       </el-dialog>
65
       </el-dialog>
66
+
67
+
68
+
50
       <el-dialog title="编辑" :visible.sync="editDialog">
69
       <el-dialog title="编辑" :visible.sync="editDialog">
51
         <el-form :model="form">
70
         <el-form :model="form">
52
           <el-form-item label="检查大项" :label-width="formLabelWidth">
71
           <el-form-item label="检查大项" :label-width="formLabelWidth">
78
 import PieChart from "../qcd/components/BarChart";
97
 import PieChart from "../qcd/components/BarChart";
79
 import { uParseTime } from "@/utils/tools";
98
 import { uParseTime } from "@/utils/tools";
80
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
99
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
100
+import {getAllInspectionData,SaveCheckConfiguration,getAllCheckList} from "@/api/common/common"
81
 export default {
101
 export default {
82
   name: "dialysisTotal",
102
   name: "dialysisTotal",
83
   data() {
103
   data() {
114
       editDialog: false,
134
       editDialog: false,
115
       formLabelWidth: "120px",
135
       formLabelWidth: "120px",
116
       form: {
136
       form: {
117
-        name: "",
118
-        region: "",
119
-        date1: "",
120
-        date2: "",
121
-        delivery: false,
122
-        type: [],
123
-        resource: "",
124
-        desc: ""
125
-      }
137
+        inspectionMajor:"",
138
+        frequency:"",
139
+        sort:"",
140
+      },
141
+     InspectionMajor:[],
142
+     rules: {
143
+        inspectionMajor: [{ required: true, message: "检查大项不能为空" }],
144
+        frequency: [{ required: true, message: "检查频次不能为空" }],
145
+      },
146
+      limit:10,
147
+      page:1,
148
+      total:0,
126
     };
149
     };
127
   },
150
   },
128
-  created() {},
151
+  created() {
152
+    //获取大项
153
+    this.getAllInspectionData(),
154
+    this.getAllCheckList()
155
+  },
129
   methods: {
156
   methods: {
130
     handleTabClick(tab, event) {
157
     handleTabClick(tab, event) {
131
       if (this.tabActiveName == "control") {
158
       if (this.tabActiveName == "control") {
134
     },
161
     },
135
     handleEdit() {
162
     handleEdit() {
136
       this.editDialog = true;
163
       this.editDialog = true;
164
+    },
165
+    getAllInspectionData(){
166
+      getAllInspectionData().then(response=>{
167
+        if(response.data.state == 1){
168
+          var inspection =  response.data.data.inspection
169
+          console.log("列表",inspection)
170
+          this.InspectionMajor = inspection
171
+        }
172
+      })
173
+    },
174
+    //新增
175
+    SaveCheckConfiguration(formName){
176
+       this.$refs[formName].validate(valid=>{
177
+         if(valid){
178
+           SaveCheckConfiguration(this.form).then(response=>{
179
+              if(response.data.state === 1){
180
+                var configuration =  response.data.data.configuration
181
+                this.$message.success("保存成功")
182
+                this.newDialog = false
183
+                this.form.inspectionMajor = ""
184
+                this.form.frequency = ""
185
+                this.form.sort = ""
186
+              }else{
187
+                this.$message.error("检验检查项已存在,不能重复添加")
188
+              }
189
+           })
190
+         }
191
+       })
192
+    },
193
+    handleSizeChange(limit) {
194
+      this.limit = limit;
195
+     
196
+    },
197
+    handleCurrentChange(page) {
198
+      this.page = page;
199
+     
200
+    },
201
+    getAllCheckList(){
202
+      getAllCheckList(this.page,this.limit).then(response=>{
203
+      })
137
     }
204
     }
138
   },
205
   },
139
   components: {
206
   components: {

+ 3 - 3
src/xt_pages/qcd/statisticalConfiguration.vue View File

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.row.id)">删除</el-button>
36
+              <el-button size="mini" type="danger" @click="handleDelete(scope.row.id,scope.$index)">删除</el-button>
37
             </template>
37
             </template>
38
           </el-table-column>
38
           </el-table-column>
39
         </el-table>
39
         </el-table>
317
         }
317
         }
318
       })
318
       })
319
     },
319
     },
320
-   handleDelete(id) {
320
+   handleDelete(id,index) {
321
       this.$confirm(
321
       this.$confirm(
322
         "确认要删除所选记录吗? <br>删除后,该信息将无法恢复",
322
         "确认要删除所选记录吗? <br>删除后,该信息将无法恢复",
323
         "删除提示",
323
         "删除提示",
328
           type: "warning"
328
           type: "warning"
329
         }
329
         }
330
       ).then(() => {
330
       ).then(() => {
331
-        DeleteConfiguration(id).then(response => {
331
+        DeleteConfiguration(id,index).then(response => {
332
           if (response.data.state === 1) {
332
           if (response.data.state === 1) {
333
            var msg =  response.data.data.msg
333
            var msg =  response.data.data.msg
334
            console.log("msg",msg)
334
            console.log("msg",msg)