瀏覽代碼

统计配置开发

XMLWAN 4 年之前
父節點
當前提交
3e61218ed4
共有 3 個文件被更改,包括 118 次插入22 次删除
  1. 29 0
      src/api/common/common.js
  2. 86 19
      src/xt_pages/qcd/checkStatistical.vue
  3. 3 3
      src/xt_pages/qcd/statisticalConfiguration.vue

+ 29 - 0
src/api/common/common.js 查看文件

@@ -77,3 +77,32 @@ export function DeleteConfiguration(id, params) {
77 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 查看文件

@@ -25,28 +25,47 @@
25 25
             </template>
26 26
           </el-table-column>
27 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 39
       </div>
29 40
 
30 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 52
             </el-select>
37 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 56
           </el-form-item>
41 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 59
           </el-form-item>
44 60
         </el-form>
45 61
         <div slot="footer" class="dialog-footer">
46 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 64
         </div>
49 65
       </el-dialog>
66
+
67
+
68
+
50 69
       <el-dialog title="编辑" :visible.sync="editDialog">
51 70
         <el-form :model="form">
52 71
           <el-form-item label="检查大项" :label-width="formLabelWidth">
@@ -78,6 +97,7 @@ import { GetOICData } from "@/api/qcd";
78 97
 import PieChart from "../qcd/components/BarChart";
79 98
 import { uParseTime } from "@/utils/tools";
80 99
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
100
+import {getAllInspectionData,SaveCheckConfiguration,getAllCheckList} from "@/api/common/common"
81 101
 export default {
82 102
   name: "dialysisTotal",
83 103
   data() {
@@ -114,18 +134,25 @@ export default {
114 134
       editDialog: false,
115 135
       formLabelWidth: "120px",
116 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 156
   methods: {
130 157
     handleTabClick(tab, event) {
131 158
       if (this.tabActiveName == "control") {
@@ -134,6 +161,46 @@ export default {
134 161
     },
135 162
     handleEdit() {
136 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 206
   components: {

+ 3 - 3
src/xt_pages/qcd/statisticalConfiguration.vue 查看文件

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