Browse Source

统计配置开发

XMLWAN 5 years ago
parent
commit
9bbebdc12d
1 changed files with 27 additions and 30 deletions
  1. 27 30
      src/xt_pages/qcd/checkStatistical.vue

+ 27 - 30
src/xt_pages/qcd/checkStatistical.vue View File

14
         </el-col>
14
         </el-col>
15
       </el-row>
15
       </el-row>
16
       <div class="configTable">
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
           <el-table-column label="操作" width="180">
27
           <el-table-column label="操作" width="180">
22
             <template slot-scope="scope">
28
             <template slot-scope="scope">
23
               <el-button size="mini" type="primary" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
29
               <el-button size="mini" type="primary" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
41
       <el-dialog title="新增" :visible.sync="newDialog">
47
       <el-dialog title="新增" :visible.sync="newDialog">
42
         <el-form :model="form" ref="form" :rules="rules">
48
         <el-form :model="form" ref="form" :rules="rules">
43
           <el-form-item label="检查大项" :label-width="formLabelWidth" required prop="inspectionMajor">
49
           <el-form-item label="检查大项" :label-width="formLabelWidth" required prop="inspectionMajor">
44
-            <el-select v-model="form.inspectionMajor" placeholder="请选择活动区域" @change="changeInspectionMonior">
50
+            <el-select v-model="form.inspectionMajor" placeholder="请选择活动区域">
45
                 <el-option
51
                 <el-option
46
                   v-for="it in InspectionMajor"
52
                   v-for="it in InspectionMajor"
47
                   :key="it.project_id"
53
                   :key="it.project_id"
108
         { path: false, name: "检验检查统计配置" }
114
         { path: false, name: "检验检查统计配置" }
109
       ],
115
       ],
110
       tabActiveName: "query",
116
       tabActiveName: "query",
111
-      tableData: [
112
-        {
113
-          date: "2016-05-02",
114
-          name: "王小虎",
115
-          address: "上海市普陀区金沙江路 1518 弄"
116
-        },
117
-        {
118
-          date: "2016-05-04",
119
-          name: "王小虎",
120
-          address: "上海市普陀区金沙江路 1517 弄"
121
-        },
122
-        {
123
-          date: "2016-05-01",
124
-          name: "王小虎",
125
-          address: "上海市普陀区金沙江路 1519 弄"
126
-        },
127
-        {
128
-          date: "2016-05-03",
129
-          name: "王小虎",
130
-          address: "上海市普陀区金沙江路 1516 弄"
131
-        }
132
-      ],
133
       newDialog: false,
117
       newDialog: false,
134
       editDialog: false,
118
       editDialog: false,
135
       formLabelWidth: "120px",
119
       formLabelWidth: "120px",
146
       limit:10,
130
       limit:10,
147
       page:1,
131
       page:1,
148
       total:0,
132
       total:0,
133
+      checkList:[],
149
     };
134
     };
150
   },
135
   },
151
   created() {
136
   created() {
166
       getAllInspectionData().then(response=>{
151
       getAllInspectionData().then(response=>{
167
         if(response.data.state == 1){
152
         if(response.data.state == 1){
168
           var inspection =  response.data.data.inspection
153
           var inspection =  response.data.data.inspection
169
-          console.log("列表",inspection)
154
+          //console.log("列表",inspection)
170
           this.InspectionMajor = inspection
155
           this.InspectionMajor = inspection
171
         }
156
         }
172
       })
157
       })
192
     },
177
     },
193
     handleSizeChange(limit) {
178
     handleSizeChange(limit) {
194
       this.limit = limit;
179
       this.limit = limit;
195
-     
180
+      this.getAllCheckList()
196
     },
181
     },
197
     handleCurrentChange(page) {
182
     handleCurrentChange(page) {
198
       this.page = page;
183
       this.page = page;
199
-     
184
+      this.getAllCheckList()
200
     },
185
     },
201
     getAllCheckList(){
186
     getAllCheckList(){
202
       getAllCheckList(this.page,this.limit).then(response=>{
187
       getAllCheckList(this.page,this.limit).then(response=>{
188
+        if(response.data.state == 1){
189
+          var checklist = response.data.data.checklist
190
+          for(let i=0;i<checklist.length;i++){
191
+            if(checklist[i].sort == 0){
192
+              checklist[i].sort = ""
193
+            }
194
+          }
195
+          console.log("列表",checklist)
196
+          this.checkList = checklist
197
+          this.total = response.data.data.total
198
+          console.log("total",this.total)
199
+        }
203
       })
200
       })
204
     }
201
     }
205
   },
202
   },