浏览代码

2021-09-03 lrl

lirl 3 年之前
父节点
当前提交
5de6225243

+ 14 - 15
src/views/energyPlan/components/supplyAndDemand/planProjectRoundGx.vue

@@ -540,8 +540,8 @@
                     :page-size="pageSize"
                     :current-page.sync="pageNum"
                     @size-change="tableSizeChange"
-                    @current-change="getTableData()"
-                    style="text-align: left;margin-top: 10px;"
+                    @current-change="getTableDetailDatas()"
+                    style="text-align: right;margin-top: 10px;"
                 ></el-pagination>
             </div>
         </div>
@@ -1196,7 +1196,7 @@ export default {
                 });
         },
         // 获取表格中的数据
-        getTableData (pageNum) {
+        getTableData () {
             let that = this,
                 params = {
                     timegranid: that.filterForm.data.timegranid,
@@ -1210,9 +1210,8 @@ export default {
                     fid: '',
                     type: 'gx'
                 };
-            that.pageNum = pageNum || that.pageNum;
             that.leftTableLoading = true;
-            let url = 'pass/ems/v1/emsprodplanmonths/getDates/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+            let url = 'pass/ems/v1/emsprodplanmonths/getDates/?pageNum=1&pageSize=' + that.pageSize;
             that.axios.get(url, {
                 params: params
             })
@@ -1236,7 +1235,6 @@ export default {
                         }
                         that.leftTableData = arr;
                         that.dialog.fRow = null;
-                        that.total = res.data.total;
                     } else {
                         that.$message.error(res.message);
                     }
@@ -1249,7 +1247,7 @@ export default {
         tableSizeChange (val) {
             let that = this;
             that.pageSize = val;
-            that.getTableData(1);
+            that.getTableDetailDatas(1);
         },
         // 点击查询
         getTableDetailData (row) {
@@ -1299,15 +1297,16 @@ export default {
             });
             }
         },
-        getTableDetailDatas (workprocType, sqno) {
+        getTableDetailDatas (pageNum) {
             let that = this;
             let params = {
             may: that.filterForm.data.clock,
-            workprocType: workprocType,
-            sqno: sqno
+            workprocType: that.rightTableData[0].workprocType,
+            sqno: that.rightTableData[0].sqno
          };
+            that.pageNum = pageNum || that.pageNum;
             that.tableLoading = true;
-            let url = 'pass/ems/v1/emsprodplanrounds/';
+            let url = 'pass/ems/v1/emsprodplanrounds/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
             that.axios.get(url, {
                 params: params
             })
@@ -1448,7 +1447,7 @@ export default {
                                         message: '保存成功',
                                         type: 'success'
                                     });
-                                     that.getTableDetailDatas(that.multipleSelection[0].workprocType, that.multipleSelection[0].sqno);
+                                     that.getTableDetailDatas();
                                 } else {
                                     that.$message.error(res.message);
                                 }
@@ -1576,7 +1575,7 @@ export default {
                     type: 'success'
                      });
                     that.getTableData();
-                   that.getTableDetailDatas(that.multipleSelection[0].workprocType, that.multipleSelection[0].sqno);
+                   that.getTableDetailDatas();
                 } else {
                 that.$message.error(res.message);
             }
@@ -1631,7 +1630,7 @@ export default {
                     type: 'success'
                      });
                    that.getTableData();
-                   that.getTableDetailDatas(that.multipleSelection[0].workprocType, that.multipleSelection[0].sqno);
+                   that.getTableDetailDatas();
                 } else {
                 that.$message.error(res.message);
             }
@@ -1669,7 +1668,7 @@ export default {
                     message: '删除成功',
                     type: 'success'
                  });
-                that.getTableDetailDatas(that.multipleSelection[0].workprocType, that.multipleSelection[0].sqno);
+                that.getTableDetailDatas();
                 that.dialog.editorBox.show = false;
                 } else {
                 that.$message.error(res.message);

+ 30 - 24
src/views/energyPlan/components/supplyAndDemand/planProjectRoundLG.vue

@@ -539,7 +539,7 @@
                                     v-if="filterForm.data.show"
                                 ></el-table-column>
                                 <el-table-column
-                                sortable
+                                 sortable
                                     prop="workprocType"
                                     label="工序类别"
                                     min-width="100px"
@@ -557,8 +557,8 @@
                     :page-size="pageSize"
                     :current-page.sync="pageNum"
                     @size-change="tableSizeChange"
-                    @current-change="getTableData()"
-                    style="text-align: left;margin-top: 10px;"
+                    @current-change="getTableDetailDatas()"
+                    style="text-align: right;margin-top: 10px;"
                 ></el-pagination>
             </div>
         </div>
@@ -658,7 +658,9 @@
             prop="specifications"
                 >
             <el-select
-                     filterable clearable
+                     allow-create
+                     filterable
+                     clearable
                      v-model="dialog.editorBox.form.data.specifications"
                      placeholder=""
                     style="width: 100%;"
@@ -695,7 +697,9 @@
                 :rules="tableFormRules.chemicalStandard"
                 >
                <el-select
-                     filterable clearable
+                     allow-create
+                     filterable
+                     clearable
                      v-model="dialog.editorBox.form.data.chemicalStandard"
                      placeholder=""
                      style="width: 100%;"
@@ -732,7 +736,9 @@
                  :rules="dialog.editorBox.form.surfaceStandard"
                 >
                <el-select
-                     filterable clearable
+                     allow-create
+                     filterable
+                     clearable
                      v-model="dialog.editorBox.form.data.surfaceStandard"
                      placeholder=""
                      style="width: 100%;"
@@ -1247,7 +1253,7 @@ export default {
                 });
         },
         // 获取表格中的数据
-        getTableData (pageNum) {
+        getTableData () {
             let that = this,
                 params = {
                     timegranid: that.filterForm.data.timegranid,
@@ -1261,9 +1267,8 @@ export default {
                     fid: '',
                     type: 'lg'
                 };
-            that.pageNum = pageNum || that.pageNum;
             that.leftTableLoading = true;
-            let url = 'pass/ems/v1/emsprodplanmonths/getDates/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+            let url = 'pass/ems/v1/emsprodplanmonths/getDates/?pageNum=1&pageSize=' + that.pageSize;
             that.axios.get(url, {
                 params: params
             })
@@ -1287,7 +1292,6 @@ export default {
                         }
                         that.leftTableData = arr;
                         that.dialog.fRow = null;
-                        that.total = res.data.total;
                     } else {
                         that.$message.error(res.message);
                     }
@@ -1300,17 +1304,17 @@ export default {
         tableSizeChange (val) {
             let that = this;
             that.pageSize = val;
-            that.getTableData(1);
+            that.getTableDetailDatas(1);
         },
-        // 点击查询
+        // 点击表格查询
         getTableDetailData (row) {
             let that = this;
-             if (row) {
+            if (row) {
             let params = {
             parentid: row.id
         };
             that.tableLoading = true;
-            let url = 'pass/ems/v1/emsprodplanrounds/';
+            let url = 'pass/ems/v1/emsprodplanrounds/'
             that.axios.get(url, {
                 params: params
             })
@@ -1357,15 +1361,16 @@ export default {
             });
              }
         },
-        getTableDetailDatas (workprocType, sqno) {
+        getTableDetailDatas (pageNum) {
             let that = this;
             let params = {
             may: that.filterForm.data.clock,
-            workprocType: workprocType,
-            sqno: sqno
+            workprocType: that.rightTableData[0].workprocType,
+            sqno: that.rightTableData[0].sqno
          };
+            that.pageNum = pageNum || that.pageNum;
             that.tableLoading = true;
-            let url = 'pass/ems/v1/emsprodplanrounds/';
+            let url = 'pass/ems/v1/emsprodplanrounds/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
             that.axios.get(url, {
                 params: params
             })
@@ -1397,7 +1402,8 @@ export default {
                     surfaceStandard: item.surfaceStandard,
                     sqno: item.sqno,
                     goinfo: item.goinfo,
-                    fetchPlanWeight: item.fetchPlanWeight
+                    fetchPlanWeight: item.fetchPlanWeight,
+                    workprocType: item.workprocType
                  });
                     }
                     that.rightTableData = arr;
@@ -1512,7 +1518,7 @@ export default {
                                         message: '修改成功',
                                         type: 'success'
                                     });
-                                    that.getTableDetailDatas(that.multipleSelection[0].workprocType, that.multipleSelection[0].sqno);
+                                    that.getTableDetailDatas();
                                 } else {
                                     that.$message.error(res.message);
                                 }
@@ -1570,8 +1576,8 @@ export default {
                     message: '操作成功',
                     type: 'success'
                      });
-                    that.getTableData();
-                   that.getTableDetailDatas(that.multipleSelection[0].workprocType, that.multipleSelection[0].sqno);
+                   that.getTableDetailDatas();
+                   that.getTableData();
                 } else {
                 that.$message.error(res.message);
             }
@@ -1629,7 +1635,7 @@ export default {
                     type: 'success'
                      });
                    that.getTableData();
-                   that.getTableDetailDatas(that.multipleSelection[0].workprocType, that.multipleSelection[0].sqno);
+                   that.getTableDetailDatas();
                 } else {
                 that.$message.error(res.message);
             }
@@ -1740,7 +1746,7 @@ export default {
                     message: '删除成功',
                    type: 'success'
                  });
-                that.getTableDetailDatas(that.multipleSelection[0].workprocType, that.multipleSelection[0].sqno);
+                that.getTableDetailDatas();
                 that.dialog.editorBox.show = false;
                 } else {
                 that.$message.error(res.message);

+ 13 - 15
src/views/energyPlan/components/supplyAndDemand/planProjectRoundXG.vue

@@ -628,8 +628,8 @@
                     :page-size="pageSize"
                     :current-page.sync="pageNum"
                     @size-change="tableSizeChange"
-                    @current-change="getTableData()"
-                    style="text-align: left;margin-top: 10px;"
+                    @current-change="getTableDetailDatas()"
+                    style="text-align: right;margin-top: 10px;"
                 ></el-pagination>
             </div>
         </div>
@@ -1352,7 +1352,7 @@ export default {
                 });
         },
         // 获取表格中的数据
-        getTableData (pageNum) {
+        getTableData () {
             let that = this,
                 params = {
                     timegranid: that.filterForm.data.timegranid,
@@ -1366,7 +1366,6 @@ export default {
                     fid: '',
                     type: 'xg'
                 };
-            that.pageNum = pageNum || that.pageNum;
             that.leftTableLoading = true;
             let url = 'pass/ems/v1/emsprodplanmonths/getDates/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
             that.axios.get(url, {
@@ -1392,7 +1391,6 @@ export default {
                         }
                         that.leftTableData = arr;
                         that.dialog.fRow = null;
-                        that.total = res.data.total;
                     } else {
                         that.$message.error(res.message);
                     }
@@ -1449,7 +1447,7 @@ export default {
         tableSizeChange (val) {
             let that = this;
             that.pageSize = val;
-            that.getTableData(1);
+            that.getTableDetailDatas(1);
         },
         // 点击查询
         getTableDetailData (row) {
@@ -1509,15 +1507,15 @@ export default {
             });
             }
         },
-        getTableDetailDatas (workprocType, sqno) {
+        getTableDetailDatas (pageNum) {
             let that = this;
             let params = {
-            may: that.filterForm.data.clock,
-            workprocType: workprocType,
-            sqno: sqno
+             may: that.filterForm.data.clock,
+            workprocType: that.rightTableData[0].workprocType,
+            sqno: that.rightTableData[0].sqno
          };
             that.tableLoading = true;
-            let url = 'pass/ems/v1/emsprodplanrounds/';
+            let url = 'pass/ems/v1/emsprodplanrounds/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
             that.axios.get(url, {
                 params: params
             })
@@ -1718,7 +1716,7 @@ export default {
                                         message: '修改成功',
                                         type: 'success'
                                     });
-                                that.getTableDetailDatas(that.multipleSelection[0].workprocType, that.multipleSelection[0].sqno);
+                                that.getTableDetailDatas();
                                 } else {
                                 that.$message.error(res.message);
                                 }
@@ -1778,7 +1776,7 @@ export default {
                     type: 'success'
                      });
                    that.getTableData();
-                   that.getTableDetailDatas(that.multipleSelection[0].workprocType, that.multipleSelection[0].sqno);
+                   that.getTableDetailDatas();
                 } else {
                 that.$message.error(res.message);
                 }
@@ -1837,7 +1835,7 @@ export default {
                     type: 'success'
                      });
                    that.getTableData();
-                   that.getTableDetailDatas(that.multipleSelection[0].workprocType, that.multipleSelection[0].sqno);
+                   that.getTableDetailDatas();
                 } else {
                 that.$message.error(res.message);
             }
@@ -1875,7 +1873,7 @@ export default {
                     message: '删除成功',
                    type: 'success'
                  });
-               that.getTableDetailDatas(that.multipleSelection[0].workprocType, that.multipleSelection[0].sqno);
+               that.getTableDetailDatas();
                 that.dialog.editorBox.show = false;
                 } else {
                 that.$message.error(res.message);

+ 243 - 326
src/views/energyQuality/components/power/powerMonitoringDayData.vue

@@ -11,32 +11,15 @@
                 >
                     <el-row>
                         <el-col :span="6">
-                            <el-form-item label="监测计划">
+                            <el-form-item label="监测项目名称" label-width="80px">
                                 <el-select
                                     filterable clearable
-                                    v-model="filterForm.data.monitoringplan"
+                                    v-model="filterForm.data.itemname"
                                     placeholder=""
                                     style="width: 100%;"
                                 >
                                     <el-option
-                                        v-for="item of nameObj.monitoringplan.arr"
-                                        :key="item.id"
-                                        :value="item.id"
-                                        :label="item.name"
-                                    ></el-option>
-                                </el-select>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="6">
-                            <el-form-item label="监测部门">
-                                <el-select
-                                    filterable clearable
-                                    v-model="filterForm.data.detectiondepartment"
-                                    placeholder=""
-                                    style="width: 100%;"
-                                >
-                                    <el-option
-                                        v-for="item of nameObj.detectiondepartment.arr"
+                                        v-for="item of nameObj.itemname.arr"
                                         :key="item.id"
                                         :value="item.id"
                                         :label="item.name"
@@ -48,12 +31,12 @@
                             <el-form-item label="系统名称">
                                 <el-select
                                     filterable clearable
-                                    v-model="filterForm.data.systemname"
+                                    v-model="filterForm.data.powersystemname"
                                     placeholder=""
                                     style="width: 100%;"
                                 >
                                     <el-option
-                                        v-for="item of nameObj.systemname.arr"
+                                        v-for="item of nameObj.powersystemname.arr"
                                         :key="item.id"
                                         :value="item.id"
                                         :label="item.name"
@@ -82,36 +65,35 @@
                     <el-row>
                         <el-col :span="6">
                             <el-form-item label="监测日期">
-                                <el-date-picker
-                                    type="date"
+                               <zj-timegran-date
                                     v-model="filterForm.data.monitordate"
-                                    placeholder=""
                                     style="width: 100%;"
-                                    format="yyyy-MM-dd"
-                                    value-format="yyyy-MM-dd"
-                                ></el-date-picker>
+                                    :type="'daterange'"
+                                    :defaultOffset="-1"
+                                ></zj-timegran-date>
                             </el-form-item>
                         </el-col>
                         <el-col :span="6">
-                            <el-form-item label="批次号">
-                                <el-select
-                                    filterable clearable
-                                    v-model="filterForm.data.batchno"
-                                    placeholder=""
+                            <el-form-item label="化验单号">
+                                <el-input clearable
                                     style="width: 100%;"
+                                    v-model="filterForm.data.batchno"
                                 >
-                                    <el-option
-                                        v-for="index of 12"
-                                        :key="index"
-                                        :value="index"
-                                        :label="'第' + index + '次'"
-                                    ></el-option>
-                                </el-select>
+                                </el-input>
                             </el-form-item>
                         </el-col>
                     </el-row>
                 </el-form>
                 <div class="box-top-gjl">
+                    <el-button
+                        class="button"
+                        type="primary"
+                        size="mini"
+                        icon="el-icon-plus"
+                        v-privilege="activeMenu + 'PUT'"
+                        :loading="loading"
+                        @click="but_edit_plural()"
+                    >保存</el-button>
                     <div style="float:right; text-align: right;">
                         <el-button
                             class="button"
@@ -143,6 +125,12 @@
                 </div>
             </div>
             <div class="box-bottom">
+                <el-form
+                    size="mini"
+                    ref="dialog_form_arr"
+                    label-width="0px"
+                    :model="tableFormDataObj"
+                >
                 <el-table
                     stripe
                     id="singleTable"
@@ -154,67 +142,115 @@
                     border
                     size="mini"
                     highlight-current-row
+                    @selection-change="handleSelectionChange"
                 >
+                    <el-table-column
+                                sortable
+                                type="selection"
+                                width="40"
+                                align="center"
+                                fixed="left"
+                    >
+                    </el-table-column>
+                    <el-table-column
+                            prop="seq"
+                            label="序号"
+                            fixed="left"
+                            width="50px"
+                            :show-overflow-tooltip="true"
+                    ></el-table-column>
                     <el-table-column
                         sortable
                         prop="detectiondepartment"
                         label="监测部门"
                         min-width="100px"
                         :show-overflow-tooltip="true"
-                    ></el-table-column>
+                    >
+                     <template slot-scope="scope">
+                            <span>{{ nameObj.detectiondepartment.obj[scope.row.detectiondepartment] ? nameObj.detectiondepartment.obj[scope.row.detectiondepartment] : scope.row.detectiondepartment }}</span>
+                        </template>
+                    </el-table-column>
                     <el-table-column
                         sortable
-                        prop="systemname"
+                        prop="powersystemname"
                         label="系统名称"
                         min-width="100px"
                         :show-overflow-tooltip="true"
-                    ></el-table-column>
+                    >
+                    <template slot-scope="scope">
+                            <span>{{ nameObj.powersystemname.obj[scope.row.powersystemname] ? nameObj.powersystemname.obj[scope.row.powersystemname] : scope.row.powersystemname }}</span>
+                        </template>
+                    </el-table-column>
                     <el-table-column
                         sortable
                         prop="powermonitorname"
                         label="监测点名称"
                         min-width="100px"
                         :show-overflow-tooltip="true"
-                    ></el-table-column>
+                    >
+                    <template slot-scope="scope">
+                            <span>{{ nameObj.powermonitorname.obj[scope.row.powermonitorname] ? nameObj.powermonitorname.obj[scope.row.powermonitorname] : scope.row.powermonitorname }}</span>
+                    </template>
+                    </el-table-column>
                     <el-table-column
                         sortable
                         prop="itemname"
                         label="监测项目名称"
                         min-width="100px"
                         :show-overflow-tooltip="true"
-                    ></el-table-column>
+                    >
+                     <template slot-scope="scope">
+                            <span>{{ nameObj.itemname.obj[scope.row.itemname] ? nameObj.itemname.obj[scope.row.itemname] : scope.row.itemname }}</span>
+                    </template>
+                    </el-table-column>
                     <el-table-column
                         sortable
-                        prop="monitordate"
-                        label="监测日期"
+                        prop="monitoringvalue"
+                        label="监测"
                         min-width="100px"
                         :show-overflow-tooltip="true"
-                    ></el-table-column>
+                    >
+                    <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="scope.row.isSelection"
+                                >
+                                    <el-input clearable
+                                        style="width: 90%;"
+                                        v-model="tableFormDataObj[scope.row.seq].monitoringvalue"
+                                        refcous="true"
+                                    ></el-input>
+                                    <template slot="error" slot-scope="scope">
+                                        <p class="error" :title="scope.error">{{ scope.error }}</p>
+                                    </template>
+                                </el-form-item>
+                                <span v-else>{{scope.row.monitoringvalue}}</span>
+                            </template>
+                    </el-table-column>
                     <el-table-column
                         sortable
-                        prop="batchno"
-                        label="批次号"
+                        prop="unit"
+                        label="单位"
                         min-width="100px"
                         :show-overflow-tooltip="true"
                     ></el-table-column>
                     <el-table-column
                         sortable
-                        prop="datadate"
-                        label="监测时间"
+                        prop="monitordate"
+                        label="监测日期"
                         min-width="100px"
                         :show-overflow-tooltip="true"
                     ></el-table-column>
                     <el-table-column
                         sortable
-                        prop="monitoringvalue"
-                        label="监测值"
+                        prop="batchno"
+                        label="化验单号"
                         min-width="100px"
                         :show-overflow-tooltip="true"
                     ></el-table-column>
                     <el-table-column
                         sortable
-                        prop="unit"
-                        label="单位"
+                        prop="datadate"
+                        label="监测时间"
                         min-width="100px"
                         :show-overflow-tooltip="true"
                     ></el-table-column>
@@ -231,26 +267,25 @@
                         label="备注"
                         min-width="100px"
                         :show-overflow-tooltip="true"
-                    ></el-table-column>
-                    <el-table-column
-                        class-name="gn-TableDownloadExcel-none"
-                        label="操作"
-                        align="center"
-                        width="75px"
-                        fixed="right"
                     >
-                        <template slot-scope="scope">
-                            <div>
-                                <el-button
-                                    type="primary"
-                                    size="mini"
-                                    v-privilege="activeMenu + 'PUT'"
-                                    @click="but_edit(scope.row)"
-                                >修改</el-button>
-                            </div>
-                        </template>
+                    <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="scope.row.isSelection"
+                                >
+                                    <el-input clearable
+                                        style="width: 90%;"
+                                        v-model="tableFormDataObj[scope.row.seq].note"
+                                        refcous="true"
+                                    ></el-input>
+                                    <template slot="error" slot-scope="scope">
+                                        <p class="error" :title="scope.error">{{ scope.error }}</p>
+                                    </template>
+                                </el-form-item>
+                                <span v-else>{{scope.row.note}}</span>
+                            </template>
                     </el-table-column>
                 </el-table>
+                </el-form>
                 <el-pagination
                     layout="total, sizes, prev, pager, next, jumper"
                     :total="total"
@@ -263,231 +298,15 @@
                 ></el-pagination>
             </div>
         </div>
-        <el-dialog
-            :title="'信息 - ' + (dialog.editorBox.type === 'add' ? '新增' : '修改')"
-            :visible.sync="dialog.editorBox.show"
-            width="600px"
-            :close-on-click-modal="false"
-            :show-close="!loading"
-        >
-            <div>
-                <el-form
-                    ref="dialog_form"
-                    :model="dialog.editorBox.form.data"
-                    :rules="dialog.editorBox.form.rules"
-                    size="mini"
-                    label-width="85px"
-                >
-                    <el-row>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="监测部门"
-                                prop="detectiondepartment"
-                            >
-                                <el-select
-                                    filterable clearable
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.detectiondepartment"
-                                    disabled
-                                >
-                                    <el-option
-                                        v-for="item of nameObj.detectiondepartment.arr"
-                                        :key="item.id"
-                                        :value="item.id"
-                                        :label="item.name"
-                                    ></el-option>
-                                </el-select>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="系统名称"
-                                prop="systemname"
-                            >
-                                <el-select
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.systemname"
-                                    disabled
-                                >
-                                    <el-option
-                                        v-for="item of nameObj.systemname.arr"
-                                        :key="item.id"
-                                        :value="item.id"
-                                        :label="item.name"
-                                    ></el-option>
-                                </el-select>
-                            </el-form-item>
-                        </el-col>
-                    </el-row>
-                    <el-row>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="监测点名称"
-                                prop="powermonitorname"
-                            >
-                                <el-select
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.powermonitorname"
-                                    disabled
-                                >
-                                    <el-option
-                                        v-for="item of nameObj.powermonitorname.arr"
-                                        :key="item.id"
-                                        :value="item.id"
-                                        :label="item.name"
-                                    ></el-option>
-                                </el-select>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="监测项目名称"
-                                prop="itemname"
-                            >
-                                <el-select
-                                    filterable clearable
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.itemname"
-                                    disabled
-                                >
-                                    <el-option
-                                        v-for="item of nameObj.itemname.arr"
-                                        :key="item.id"
-                                        :value="item.id"
-                                        :label="item.name"
-                                    ></el-option>
-                                </el-select>
-                            </el-form-item>
-                        </el-col>
-                    </el-row>
-                    <el-row>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="监测日期"
-                                prop="monitordate"
-                            >
-                                <el-date-picker
-                                    type="date"
-                                    v-model="dialog.editorBox.form.data.monitordate"
-                                    placeholder=""
-                                    style="width: 100%;"
-                                    format="yyyy-MM-dd"
-                                    value-format="yyyy-MM-dd"
-                                ></el-date-picker>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="批次号"
-                                prop="batchno"
-                            >
-                                <el-select
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.batchno"
-                                >
-                                    <el-option
-                                        v-for="index of 12"
-                                        :key="index"
-                                        :value="index"
-                                        :label="'第' + index + '次'"
-                                    ></el-option>
-                                </el-select>
-                            </el-form-item>
-                        </el-col>
-                    </el-row>
-                    <el-row>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="监测时间"
-                                prop="datadate"
-                            >
-                                <el-date-picker
-                                    type="datetime"
-                                    v-model="dialog.editorBox.form.data.datadate"
-                                    placeholder=""
-                                    style="width: 100%;"
-                                    format="yyyy-MM-dd HH:mm:ss"
-                                    value-format="yyyy-MM-dd HH:mm:ss"
-                                ></el-date-picker>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="监测值"
-                                prop="monitoringvalue"
-                            >
-                                <el-input clearable
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.monitoringvalue"
-                                >
-                                </el-input>
-                            </el-form-item>
-                        </el-col>
-                    </el-row>
-                    <el-row>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="单位"
-                                prop="unit"
-                            >
-                                <el-input clearable
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.unit"
-                                    disabled
-                                >
-                                </el-input>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="分析人"
-                                prop="analyst"
-                            >
-                                <el-input clearable
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.analyst"
-                                >
-                                </el-input>
-                            </el-form-item>
-                        </el-col>
-                    </el-row>
-                    <el-row>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="备注"
-                                prop="note"
-                            >
-                                <el-input clearable
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.note"
-                                >
-                                </el-input>
-                            </el-form-item>
-                        </el-col>
-                    </el-row>
-                </el-form>
-            </div>
-            <span
-                slot="footer"
-                class="dialog-footer"
-            >
-                <el-button
-                    @click="dialog.editorBox.show = false"
-                    :loading="loading"
-                >取 消</el-button>
-                <el-button
-                    type="primary"
-                    @click="dataSave"
-                    :loading="loading"
-                >保 存</el-button>
-            </span>
-        </el-dialog>
     </div>
 </template>
-
 <script>
+import timegranDate from '@/components/zg/timegranDate.vue'
 export default {
     name: 'powerMonitoringDayData',
+     components: {
+        'zj-timegran-date': timegranDate
+    },
     data () {
         return {
             activeMenu: '',
@@ -498,6 +317,7 @@ export default {
                     detectiondepartment: '',
                     systemname: '',
                     powermonitorname: '',
+                    powersystemname: '',
                     monitordate: '',
                     batchno: ''
                 },
@@ -508,7 +328,10 @@ export default {
             pageNum: 1,
             pageSize: 20,
             total: 0,
+            loading: false,
             singleTableHeight: 100,
+            tableFormDataObj: {},
+            multipleSelection: [],
             tableData: [
                 // {
                 //     detectiondepartment: '',
@@ -530,20 +353,8 @@ export default {
                     arr: []
                 },
                 detectiondepartment: {
-                    obj: {
-                        'TestCenter': '检化验中心',
-                        'CentreWaterTreatment': '中央水处理'
-                    },
-                    arr: [
-                        {
-                            id: 'TestCenter',
-                            name: '检化验中心'
-                        },
-                        {
-                            id: 'CentreWaterTreatment',
-                            name: '中央水处理'
-                        }
-                    ]
+                    obj: {},
+                    arr: []
                 },
                 systemname: {
                     obj: {},
@@ -553,12 +364,15 @@ export default {
                     obj: {},
                     arr: []
                 },
+                powersystemname: {
+                    obj: {},
+                    arr: []
+                },
                 itemname: {
                     obj: {},
                     arr: []
                 }
             },
-            loading: false,
             tableLoading: false,
             dialog: {
                 editorBox: {
@@ -569,6 +383,7 @@ export default {
                             detectiondepartment: '',
                             systemname: '',
                             powermonitorname: '',
+                            powersystemname: '',
                             itemname: '',
                             monitordate: '',
                             batchno: '',
@@ -612,6 +427,7 @@ export default {
         that.getSystemNameData();
         that.getPowermonitorNameData();
         that.getItemNameData();
+        that.getDetectiondepartmentData();
     },
     methods: {
         //  计算树区域高度
@@ -650,7 +466,7 @@ export default {
         // 获取系统名称
         getMonitoringPlanData () {
             let that = this
-            let url = 'pass/ems/v1/tcm0325s/getidandname/';
+            let url = 'pass/ems/v1/tcm0325s/getCodeAndName/';
             that.axios.get(url)
                 .then(function (res) {
                     if (res.code === '0') {
@@ -663,8 +479,8 @@ export default {
                             })
                             obj[item.powercode] = item.powername;
                         }
-                        that.nameObj.monitoringplan.arr = arr;
-                        that.nameObj.monitoringplan.obj = obj;
+                        that.nameObj.powersystemname.arr = arr;
+                        that.nameObj.powersystemname.obj = obj;
                     } else {
                         that.$message.error(res.message);
                     }
@@ -681,10 +497,10 @@ export default {
                         let obj = {};
                         for (let item of res.data) {
                             arr.push({
-                                id: item.id,
-                                name: item.name
+                                id: item.powermonitorcode,
+                                name: item.powermonitorname
                             })
-                            obj[item.id] = item.name;
+                            obj[item.powermonitorcode] = item.powermonitorname;
                         }
                         that.nameObj.powermonitorname.arr = arr;
                         that.nameObj.powermonitorname.obj = obj;
@@ -704,10 +520,10 @@ export default {
                         let obj = {};
                         for (let item of res.data) {
                             arr.push({
-                                id: item.id,
-                                name: item.name
+                                id: item.itemcode,
+                                name: item.itemname
                             })
-                            obj[item.id] = item.name;
+                            obj[item.itemcode] = item.itemname;
                         }
                         that.nameObj.itemname.arr = arr;
                         that.nameObj.itemname.obj = obj;
@@ -716,16 +532,81 @@ export default {
                     }
                 });
         },
+        getDetectiondepartmentData () {
+            let that = this
+            let url = 'pass/ems/v1/tcmcodeitems/DETECTIONDEPARTMENT';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.itemcode,
+                                name: item.itemname
+                            })
+                            obj[item.itemcode] = item.itemname;
+                        }
+                        that.nameObj.detectiondepartment.arr = arr;
+                        that.nameObj.detectiondepartment.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        but_edit_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                that.$refs['dialog_form_arr'].validate((valid, obj) => {
+                   if (valid) {
+                    that.loading = true;
+                    let SubmitData = [];
+                    console.log(that.tableFormDataObj)
+                    for (let key in that.tableFormDataObj) {
+                        SubmitData.push({
+                            powermonitorname: that.tableFormDataObj[key].powermonitorname,
+                            batchno: that.tableFormDataObj[key].batchno,
+                            sitem: that.tableFormDataObj[key].itemname,
+                            powersystemname: that.tableFormDataObj[key].powersystemname,
+                            monitordate: that.tableFormDataObj[key].monitordate,
+                            unit: that.tableFormDataObj[key].unit,
+                            analyst: that.tableFormDataObj[key].analyst,
+                            monitoringvalue: that.tableFormDataObj[key].monitoringvalue,
+                            note: that.tableFormDataObj[key].note
+                        })
+                    }
+                        that.axios.put('pass/ems/v1/tcm0348s/', SubmitData)
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                message: '修改成功',
+                                 type: 'success'
+                                });
+                                that.getTableData();
+                                that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                        })
+                        .catch(function () {
+                            that.loading = false;
+                        });
+                   }
+                });
+            }
+        },
         // 获取表格中的数据
         getTableData (pageNum) {
             let that = this,
                 params = {
-                    monitoringplan: that.filterForm.data.monitoringplan,
-                    detectiondepartment: that.filterForm.data.detectiondepartment,
-                    systemname: that.filterForm.data.systemname,
                     powermonitorname: that.filterForm.data.powermonitorname,
-                    monitordate: that.filterForm.data.monitordate,
-                    batchno: that.filterForm.data.batchno
+                    monitoringvalue: that.filterForm.data.monitoringvalue,
+                    batchno: that.filterForm.data.batchno,
+                    sitem: that.filterForm.data.itemname,
+                    startTime: that.filterForm.data.monitordate[0],
+                    endTime: that.filterForm.data.monitordate[1],
+                    powersystemname: that.filterForm.data.powersystemname
                 };
             that.pageNum = pageNum || that.pageNum;
             that.tableLoading = true;
@@ -736,13 +617,15 @@ export default {
                 .then(function (res) {
                     if (res.code === '0') {
                         let arr = [];
-                        for (let item of res.data.list) {
+                        for (let i = 0; i < res.data.list.length; i++) {
+                            let item = res.data.list[i];
                             arr.push({
+                                seq: i,
                                 recordid: item.recordid,
-                                detectiondepartment: item.detectiondepartment,
-                                systemname: item.systemname,
+                                detectiondepartment: item.powerdetecdepartment,
+                                powersystemname: item.powersystemname,
                                 powermonitorname: item.powermonitorname,
-                                itemname: item.itemname,
+                                itemname: item.sitem,
                                 monitordate: item.monitordate,
                                 batchno: item.batchno,
                                 datadate: item.datadate,
@@ -752,8 +635,10 @@ export default {
                                 note: item.note
                             })
                         }
+                        // for (let item of res.data.list) {
                         that.tableData = arr;
                         that.total = res.data.total;
+                        // }
                     } else {
                         that.$message.error(res.message);
                     }
@@ -790,6 +675,29 @@ export default {
             that.dialog.editorBox.type = 'edit';
             that.dialog.editorBox.show = true;
         },
+        handleSelectionChange (val) {
+            let that = this;
+            let tableFormDataObj = {};
+            for (let item of that.tableData) {
+                item.isSelection = false;
+            }
+            for (let item of val) {
+                let obj = {};
+                let xId = item.seq;
+                if (that.tableFormDataObj[xId]) {
+                    tableFormDataObj[xId] = that.tableFormDataObj[xId];
+                } else {
+                    for (let key in item) {
+                        obj[key] = item[key];
+                    }
+                    tableFormDataObj[xId] = obj;
+                }
+                item.isSelection = true;
+            }
+            that.tableFormDataObj = tableFormDataObj;
+            console.log(that.tableFormDataObj)
+            this.multipleSelection = val;
+        },
         dataSave () {
             let that = this;
             let SubmitData = {
@@ -847,5 +755,14 @@ export default {
             }
         }
     }
+    .el-table__body .el-form-item--mini.el-form-item {
+        margin: 0px;
+        .error {
+            overflow: hidden;
+            color: #f56c6c;
+            font-size: 12px;
+            line-height: 1;
+        }
+    }
 }
 </style>

+ 156 - 30
src/views/energyQuality/components/power/powerMonitoringItem.vue

@@ -1,6 +1,6 @@
 <template>
 <!-- 动力监测项目维护 -->
-    <div class="powerMonitoringItem">
+    <div class="powerMonitoringDayData">
         <div class="box">
             <div class="box-top">
                 <el-form
@@ -58,6 +58,18 @@
                         v-privilege="activeMenu + 'ADD'"
                         @click="but_add"
                     >新增</el-button>
+                    <el-button
+                        type="primary"
+                        size="mini"
+                        v-privilege="activeMenu + 'PUT'"
+                        @click="but_edit_plural()"
+                        >修改</el-button>
+                        <el-button
+                        type="danger"
+                        size="mini"
+                        v-privilege="activeMenu + 'DELETE'"
+                        @click="but_del()"
+                        >删除</el-button>
                     <div style="float:right; text-align: right;">
                         <el-button
                             class="button"
@@ -89,6 +101,12 @@
                 </div>
             </div>
             <div class="box-bottom">
+                <el-form
+                    size="mini"
+                    ref="dialog_form_arr"
+                    label-width="0px"
+                    :model="tableFormDataObj"
+                >
                 <el-table stripe
                     id="singleTable"
                     ref="singleTable"
@@ -99,7 +117,16 @@
                     border
                     size="mini"
                     highlight-current-row
+                    @selection-change="handleSelectionChange"
                 >
+                   <el-table-column
+                        sortable
+                        type="selection"
+                        width="40"
+                        align="center"
+                        fixed="left"
+                    >
+                   </el-table-column>
                     <el-table-column
                     sortable
                         prop="itemcode"
@@ -122,9 +149,26 @@
                         min-width="100px"
                         :show-overflow-tooltip="true"
                     >
-                        <template slot-scope="scope">
-                            <span>{{ nameObj.checkstate.obj[scope.row.checkstate] ? nameObj.checkstate.obj[scope.row.checkstate] : scope.row.checkstate }}</span>
-                        </template>
+                    <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="scope.row.isSelection"
+                                >
+                                    <el-select
+                                    filterable clearable
+                                    v-model="tableFormDataObj[scope.row.itemcode].checkstate"
+                                    placeholder=""
+                                    style="width: 100%;"
+                                >
+                                    <el-option
+                                        v-for="item of nameObj.checkstate.arr"
+                                        :key="item.id"
+                                        :value="item.id"
+                                        :label="item.name"
+                                    ></el-option>
+                                </el-select>
+                                </el-form-item>
+                                <span v-else>{{ nameObj.checkstate.obj[scope.row.checkstate] ? nameObj.checkstate.obj[scope.row.checkstate] : scope.row.checkstate }}</span>
+                    </template>
                     </el-table-column>
                     <el-table-column
                     sortable
@@ -133,7 +177,7 @@
                         min-width="100px"
                         :show-overflow-tooltip="true"
                     ></el-table-column>
-                    <el-table-column
+                    <!-- <el-table-column
                         class-name="gn-TableDownloadExcel-none"
                         label="操作"
                         align="center"
@@ -156,8 +200,9 @@
                                 >删除</el-button>
                             </div>
                         </template>
-                    </el-table-column>
+                    </el-table-column> -->
                 </el-table>
+                </el-form>
                 <el-pagination
                     layout="total, sizes, prev, pager, next, jumper"
                     :total="total"
@@ -267,6 +312,7 @@ export default {
             pageSize: 20,
             total: 0,
             singleTableHeight: 100,
+            tableFormDataObj: {},
             tableData: [
                 // {
                 //     itemcode: 'sdafsd',
@@ -393,6 +439,28 @@ export default {
                     that.tableLoading = false;
                 });
         },
+        handleSelectionChange (val) {
+            let that = this;
+            let tableFormDataObj = {};
+            for (let item of that.tableData) {
+                item.isSelection = false;
+            }
+            for (let item of val) {
+                let obj = {};
+                let xId = item.itemcode;
+                if (that.tableFormDataObj[xId]) {
+                    tableFormDataObj[xId] = that.tableFormDataObj[xId];
+                } else {
+                    for (let key in item) {
+                        obj[key] = item[key];
+                    }
+                    tableFormDataObj[xId] = obj;
+                }
+                item.isSelection = true;
+            }
+            that.tableFormDataObj = tableFormDataObj;
+            this.multipleSelection = val;
+        },
         // 改变表格显示条数
         tableSizeChange (val) {
             let that = this;
@@ -432,29 +500,6 @@ export default {
             that.dialog.editorBox.type = 'edit';
             that.dialog.editorBox.show = true;
         },
-        but_del (row) {
-            let that = this;
-            that.$confirm('是否删除该条数据?', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                state: 'warning'
-            }).then(() => {
-                that.axios.delete('pass/ems/v1/tcm0323s/' + row.itemcode)
-                    .then(function (res) {
-                        if (res.code === '0') {
-                            that.$message({
-                                message: '删除成功',
-                                type: 'success'
-                            });
-                            that.getTableData();
-                        } else {
-                            that.$message.error(res.message);
-                        }
-                    }).catch(function () {
-                    });
-            }).catch(() => {
-            });
-        },
         dataSave () {
             let that = this;
             let SubmitData = {
@@ -512,13 +557,85 @@ export default {
                     }
                 }
             });
+        },
+        but_edit_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                that.$refs['dialog_form_arr'].validate((valid, obj) => {
+                   if (valid) {
+                    that.loading = true;
+                    let SubmitData = [];
+                    for (let key in that.tableFormDataObj) {
+                        SubmitData.push({
+                        itemcode: that.tableFormDataObj[key].itemcode,
+                        itemname: that.tableFormDataObj[key].itemname,
+                        checkstate: that.tableFormDataObj[key].checkstate,
+                        unit: that.tableFormDataObj[key].unit
+                        })
+                    }
+                        that.axios.put('pass/ems/v1/tcm0323s/', SubmitData)
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                message: '修改成功',
+                                 type: 'success'
+                                });
+                                that.getTableData();
+                                that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                        })
+                        .catch(function () {
+                            that.loading = false;
+                        });
+                   }
+                });
+            }
+        },
+        but_del () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                that.$refs['dialog_form_arr'].validate((valid, obj) => {
+                   if (valid) {
+                    that.loading = true;
+                    let SubmitData = [];
+                    for (let key in that.tableFormDataObj) {
+                        SubmitData.push({
+                        itemcode: that.tableFormDataObj[key].itemcode,
+                        itemname: that.tableFormDataObj[key].itemname,
+                        checkstate: that.tableFormDataObj[key].checkstate,
+                        unit: that.tableFormDataObj[key].unit
+                        })
+                    }
+                        that.axios.delete('pass/ems/v1/tcm0323s/', SubmitData)
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                message: '删除成功',
+                                 type: 'success'
+                                });
+                                that.getTableData();
+                                that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                        })
+                        .catch(function () {
+                            that.loading = false;
+                        });
+                   }
+                });
+            }
         }
     }
 }
 </script>
 
 <style lang="less">
-.powerMonitoringItem {
+.powerMonitoringDayData {
     min-width: 700px;
     height: 100%;
     .box {
@@ -537,5 +654,14 @@ export default {
             }
         }
     }
+    .el-table__body .el-form-item--mini.el-form-item {
+        margin: 0px;
+        .error {
+            overflow: hidden;
+            color: #f56c6c;
+            font-size: 12px;
+            line-height: 1;
+        }
+    }
 }
 </style>

+ 146 - 25
src/views/energyQuality/components/power/powerMonitoringStations.vue

@@ -70,6 +70,18 @@
                         v-privilege="activeMenu + 'ADD'"
                         @click="but_add"
                     >新增</el-button>
+                    <!-- <el-button
+                        type="primary"
+                        size="mini"
+                        v-privilege="activeMenu + 'PUT'"
+                        @click="but_edit_plural()"
+                        >修改</el-button> -->
+                        <el-button
+                        type="danger"
+                        size="mini"
+                        v-privilege="activeMenu + 'DELETE'"
+                        @click="but_del()"
+                        >删除</el-button>
                     <div style="float:right; text-align: right;">
                         <el-button
                             class="button"
@@ -101,6 +113,12 @@
                 </div>
             </div>
             <div class="box-bottom">
+                <el-form
+                    size="mini"
+                    ref="dialog_form_arr"
+                    label-width="0px"
+                    :model="tableFormDataObj"
+                >
                 <el-table stripe
                     id="singleTable"
                     ref="singleTable"
@@ -111,7 +129,16 @@
                     border
                     size="mini"
                     highlight-current-row
+                    @selection-change="handleSelectionChange"
                 >
+                   <el-table-column
+                        sortable
+                        type="selection"
+                        width="40"
+                        align="center"
+                        fixed="left"
+                    >
+                   </el-table-column>
                     <el-table-column
                     sortable
                         prop="powermonitorcode"
@@ -145,7 +172,7 @@
                         min-width="100px"
                         :show-overflow-tooltip="true"
                     ></el-table-column>
-                    <el-table-column
+                    <!-- <el-table-column
                         class-name="gn-TableDownloadExcel-none"
                         label="操作"
                         align="center"
@@ -168,8 +195,9 @@
                                 >删除</el-button>
                             </div>
                         </template>
-                    </el-table-column>
+                    </el-table-column> -->
                 </el-table>
+                </el-form>
                 <el-pagination
                     layout="total, sizes, prev, pager, next, jumper"
                     :total="total"
@@ -285,6 +313,7 @@ export default {
             pageSize: 20,
             total: 0,
             singleTableHeight: 100,
+            tableFormDataObj: {},
             tableData: [
                 // {
                 //     powermonitorcode: 'sdafsd',
@@ -378,6 +407,43 @@ export default {
                     }
                 });
         },
+        but_edit_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                that.$refs['dialog_form_arr'].validate((valid, obj) => {
+                   if (valid) {
+                    that.loading = true;
+                    let SubmitData = [];
+                    for (let key in that.tableFormDataObj) {
+                        SubmitData.push({
+                        powerdetecdepartment: that.tableFormDataObj[key].powerdetecdepartment,
+                        powercode: that.tableFormDataObj[key].powercode,
+                        powername: that.tableFormDataObj[key].powername,
+                        usestate: that.tableFormDataObj[key].usestate,
+                        sort: that.tableFormDataObj[key].sort
+                        })
+                    }
+                        that.axios.put('pass/ems/v1/tcm0325s/', SubmitData)
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                message: '修改成功',
+                                 type: 'success'
+                                });
+                                that.getTableData();
+                                that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                        })
+                        .catch(function () {
+                            that.loading = false;
+                        });
+                   }
+                });
+            }
+        },
         // 获取表格中的数据
         getTableData (pageNum) {
             let that = this,
@@ -414,6 +480,61 @@ export default {
                     that.tableLoading = false;
                 });
         },
+        but_del () {
+          let that = this;
+          if (that.multipleSelection.length > 0) {
+              that.$refs['dialog_form_arr'].validate((valid, obj) => {
+                  if (valid) {
+                    that.loading = true;
+                    let SubmitData = [];
+                    for (let key in that.tableFormDataObj) {
+                        SubmitData.push({
+                        powermonitorcode: that.tableFormDataObj[key].powermonitorcode
+                        })
+                    }
+                    that.axios.delete('pass/ems/v1/tcm0316s/', SubmitData)
+                    .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                message: '删除成功',
+                                 type: 'success'
+                                });
+                                that.getTableData();
+                                that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                        })
+                        .catch(function () {
+                            that.loading = false;
+                        });
+                  }
+              });
+          }
+        },
+        handleSelectionChange (val) {
+            let that = this;
+            let tableFormDataObj = {};
+            for (let item of that.tableData) {
+                item.isSelection = false;
+            }
+            for (let item of val) {
+                let obj = {};
+                let xId = item.powermonitorcode;
+                if (that.tableFormDataObj[xId]) {
+                    tableFormDataObj[xId] = that.tableFormDataObj[xId];
+                } else {
+                    for (let key in item) {
+                        obj[key] = item[key];
+                    }
+                    tableFormDataObj[xId] = obj;
+                }
+                item.isSelection = true;
+            }
+            that.tableFormDataObj = tableFormDataObj;
+            this.multipleSelection = val;
+        },
         // 改变表格显示条数
         tableSizeChange (val) {
             let that = this;
@@ -453,29 +574,29 @@ export default {
             that.dialog.editorBox.type = 'edit';
             that.dialog.editorBox.show = true;
         },
-        but_del (row) {
-            let that = this;
-            that.$confirm('是否删除该条数据?', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                state: 'warning'
-            }).then(() => {
-                that.axios.delete('pass/ems/v1/tcm0316s/' + row.powermonitorcode)
-                    .then(function (res) {
-                        if (res.code === '0') {
-                            that.$message({
-                                message: '删除成功',
-                                type: 'success'
-                            });
-                            that.getTableData();
-                        } else {
-                            that.$message.error(res.message);
-                        }
-                    }).catch(function () {
-                    });
-            }).catch(() => {
-            });
-        },
+        // but_del (row) {
+        //     let that = this;
+        //     that.$confirm('是否删除该条数据?', '提示', {
+        //         confirmButtonText: '确定',
+        //         cancelButtonText: '取消',
+        //         state: 'warning'
+        //     }).then(() => {
+        //         that.axios.delete('pass/ems/v1/tcm0316s/' + row.powermonitorcode)
+        //             .then(function (res) {
+        //                 if (res.code === '0') {
+        //                     that.$message({
+        //                         message: '删除成功',
+        //                         type: 'success'
+        //                     });
+        //                     that.getTableData();
+        //                 } else {
+        //                     that.$message.error(res.message);
+        //                 }
+        //             }).catch(function () {
+        //             });
+        //     }).catch(() => {
+        //     });
+        // },
         dataSave () {
             let that = this;
             let SubmitData = {

+ 205 - 235
src/views/energyQuality/components/power/powerQualitySystem.vue

@@ -1,6 +1,6 @@
 <template>
 <!-- 动力系统维护 -->
-    <div class="powerQualitySystem">
+    <div class="powerMonitoringDayData">
         <div class="box">
             <div class="box-top">
                 <el-form
@@ -87,6 +87,18 @@
                         v-privilege="activeMenu + 'ADD'"
                         @click="but_add"
                     >新增</el-button>
+                    <el-button
+                        type="primary"
+                        size="mini"
+                        v-privilege="activeMenu + 'PUT'"
+                        @click="but_edit_plural()"
+                        >修改</el-button>
+                        <el-button
+                        type="danger"
+                        size="mini"
+                        v-privilege="activeMenu + 'DELETE'"
+                        @click="but_del()"
+                        >删除</el-button>
                     <div style="float:right; text-align: right;">
                         <el-button
                             class="button"
@@ -118,6 +130,12 @@
                 </div>
             </div>
             <div class="box-bottom">
+                <el-form
+                    size="mini"
+                    ref="dialog_form_arr"
+                    label-width="0px"
+                    :model="tableFormDataObj"
+                >
                 <el-table
                     stripe
                     id="singleTable"
@@ -129,7 +147,16 @@
                     border
                     size="mini"
                     highlight-current-row
+                    @selection-change="handleSelectionChange"
                 >
+                   <el-table-column
+                        sortable
+                        type="selection"
+                        width="40"
+                        align="center"
+                        fixed="left"
+                    >
+                   </el-table-column>
                     <el-table-column
                         sortable
                         prop="powerdetecdepartment"
@@ -162,9 +189,26 @@
                         min-width="100px"
                         :show-overflow-tooltip="true"
                     >
-                        <template slot-scope="scope">
-                            <span>{{ nameObj.usestate.obj[scope.row.usestate] ? nameObj.usestate.obj[scope.row.usestate] : scope.row.usestate }}</span>
-                        </template>
+                    <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="scope.row.isSelection"
+                                >
+                                    <el-select
+                                    filterable clearable
+                                    v-model="tableFormDataObj[scope.row.powercode].usestate"
+                                    placeholder=""
+                                    style="width: 100%;"
+                                >
+                                    <el-option
+                                        v-for="item of nameObj.usestate.arr"
+                                        :key="item.id"
+                                        :value="item.id"
+                                        :label="item.name"
+                                    ></el-option>
+                                </el-select>
+                                </el-form-item>
+                                <span v-else>{{ nameObj.usestate.obj[scope.row.usestate] ? nameObj.usestate.obj[scope.row.usestate] : scope.row.usestate }}</span>
+                    </template>
                     </el-table-column>
                     <el-table-column
                         sortable
@@ -173,31 +217,8 @@
                         min-width="100px"
                         :show-overflow-tooltip="true"
                     ></el-table-column>
-                    <el-table-column
-                        class-name="gn-TableDownloadExcel-none"
-                        label="操作"
-                        align="center"
-                        width="140px"
-                        fixed="right"
-                    >
-                        <template slot-scope="scope">
-                            <div>
-                                <el-button
-                                    type="primary"
-                                    size="mini"
-                                    v-privilege="activeMenu + 'PUT'"
-                                    @click="but_edit(scope.row)"
-                                >修改</el-button>
-                                <el-button
-                                    type="danger"
-                                    size="mini"
-                                    v-privilege="activeMenu + 'DELETE'"
-                                    @click="but_del(scope.row)"
-                                >删除</el-button>
-                            </div>
-                        </template>
-                    </el-table-column>
                 </el-table>
+                </el-form>
                 <el-pagination
                     layout="total, sizes, prev, pager, next, jumper"
                     :total="total"
@@ -210,117 +231,6 @@
                 ></el-pagination>
             </div>
         </div>
-        <el-dialog
-            :title="'信息 - ' + (dialog.editorBox.type === 'add' ? '新增' : '修改')"
-            :visible.sync="dialog.editorBox.show"
-            width="600px"
-            :close-on-click-modal="false"
-            :show-close="!loading"
-        >
-            <div>
-                <el-form
-                    ref="dialog_form"
-                    :model="dialog.editorBox.form.data"
-                    :rules="dialog.editorBox.form.rules"
-                    size="mini"
-                    label-width="90px"
-                >
-                    <el-row>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="监测部门"
-                                prop="powerdetecdepartment"
-                            >
-                                <el-select
-                                    filterable clearable
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.powerdetecdepartment"
-                                >
-                                    <el-option
-                                        v-for="item of nameObj.powerdetecdepartment.arr"
-                                        :key="item.id"
-                                        :value="item.id"
-                                        :label="item.name"
-                                    ></el-option>
-                                </el-select>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="动力系统代码"
-                                prop="powercode"
-                            >
-                                <el-input clearable
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.powercode"
-                                    :disabled="dialog.editorBox.type !== 'add'"
-                                ></el-input>
-                            </el-form-item>
-                        </el-col>
-                    </el-row>
-                    <el-row>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="动力系统名称"
-                                prop="powername"
-                            >
-                                <el-input clearable
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.powername"
-                                ></el-input>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="使用状态"
-                                prop="usestate"
-                            >
-                                <el-select
-                                    filterable clearable
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.usestate"
-                                >
-                                    <el-option
-                                        v-for="item of nameObj.usestate.arr"
-                                        :key="item.id"
-                                        :value="item.id"
-                                        :label="item.name"
-                                    ></el-option>
-                                </el-select>
-                            </el-form-item>
-                        </el-col>
-                    </el-row>
-                    <el-row>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="排序"
-                                prop="sort"
-                            >
-                                <el-input clearable
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.sort"
-                                >
-                                </el-input>
-                            </el-form-item>
-                        </el-col>
-                    </el-row>
-                </el-form>
-            </div>
-            <span
-                slot="footer"
-                class="dialog-footer"
-            >
-                <el-button
-                    @click="dialog.editorBox.show = false"
-                    :loading="loading"
-                >取 消</el-button>
-                <el-button
-                    type="primary"
-                    @click="dataSave"
-                    :loading="loading"
-                >保 存</el-button>
-            </span>
-        </el-dialog>
     </div>
 </template>
 
@@ -348,6 +258,7 @@ export default {
             pageSize: 20,
             total: 0,
             singleTableHeight: 100,
+            multipleSelection: [],
             tableData: [
                 // {
                 //     powerdetecdepartment: '检化验中心',
@@ -357,22 +268,11 @@ export default {
                 //     sort: ''
                 // }
             ],
+            tableFormDataObj: {},
             nameObj: {
                 powerdetecdepartment: {
-                    obj: {
-                        'TestCenter': '检化验中心',
-                        'CentreWaterTreatment': '中央水处理'
-                    },
-                    arr: [
-                        {
-                            id: 'TestCenter',
-                            name: '检化验中心'
-                        },
-                        {
-                            id: 'CentreWaterTreatment',
-                            name: '中央水处理'
-                        }
-                    ]
+                    obj: {},
+                    arr: []
                 },
                 usestate: {
                     obj: {
@@ -451,6 +351,7 @@ export default {
             }, 1);
         });
         that.getTableData();
+        that.getDetectiondepartmentData();
     },
     methods: {
         //  计算树区域高度
@@ -495,6 +396,51 @@ export default {
                     that.tableLoading = false;
                 });
         },
+        // 获取监测部门
+        getDetectiondepartmentData () {
+            let that = this
+            let url = 'pass/ems/v1/tcmcodeitems/DETECTIONDEPARTMENT';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.itemcode,
+                                name: item.itemname
+                            })
+                            obj[item.itemcode] = item.itemname;
+                        }
+                        that.nameObj.powerdetecdepartment.arr = arr;
+                        that.nameObj.powerdetecdepartment.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        handleSelectionChange (val) {
+            let that = this;
+            let tableFormDataObj = {};
+            for (let item of that.tableData) {
+                item.isSelection = false;
+            }
+            for (let item of val) {
+                let obj = {};
+                let xId = item.powercode;
+                if (that.tableFormDataObj[xId]) {
+                    tableFormDataObj[xId] = that.tableFormDataObj[xId];
+                } else {
+                    for (let key in item) {
+                        obj[key] = item[key];
+                    }
+                    tableFormDataObj[xId] = obj;
+                }
+                item.isSelection = true;
+            }
+            that.tableFormDataObj = tableFormDataObj;
+            this.multipleSelection = val;
+        },
         // 改变表格显示条数
         tableSizeChange (val) {
             let that = this;
@@ -524,104 +470,119 @@ export default {
                 that.$refs['dialog_form'].clearValidate();
             }, 100);
         },
-        but_edit (row) {
+        // but_edit (row) {
+        //     let that = this;
+        //     for (let key in that.dialog.editorBox.form.data) {
+        //         if (typeof row[key] !== 'undefined') {
+        //             that.dialog.editorBox.form.data[key] = row[key];
+        //         }
+        //     }
+        //     that.dialog.editorBox.type = 'edit';
+        //     that.dialog.editorBox.show = true;
+        // },
+        but_edit_plural () {
             let that = this;
-            for (let key in that.dialog.editorBox.form.data) {
-                if (typeof row[key] !== 'undefined') {
-                    that.dialog.editorBox.form.data[key] = row[key];
-                }
-            }
-            that.dialog.editorBox.type = 'edit';
-            that.dialog.editorBox.show = true;
-        },
-        but_del (row) {
-            let that = this;
-            that.$confirm('是否删除该条数据?', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                state: 'warning'
-            }).then(() => {
-                that.axios.delete('pass/ems/v1/tcm0325s/' + row.powercode)
-                    .then(function (res) {
-                        if (res.code === '0') {
-                            that.$message({
-                                message: '删除成功',
-                                type: 'success'
-                            });
-                            that.getTableData();
-                        } else {
-                            that.$message.error(res.message);
-                        }
-                    }).catch(function () {
-                    });
-            }).catch(() => {
-            });
-        },
-        dataSave () {
-            let that = this;
-            let SubmitData = {
-                powerdetecdepartment: that.dialog.editorBox.form.data.powerdetecdepartment,
-                powercode: that.dialog.editorBox.form.data.powercode,
-                powername: that.dialog.editorBox.form.data.powername,
-                usestate: that.dialog.editorBox.form.data.usestate,
-                sort: that.dialog.editorBox.form.data.sort
-            };
-            that.$refs['dialog_form'].validate((valid) => {
-                if (valid) {
-                    if (that.dialog.editorBox.type === 'add') {
-                        let foorData = new FormData();
-                        for (let key in SubmitData) {
-                            foorData.append(key, SubmitData[key]);
-                        }
-                        that.loading = true;
-                        that.axios.post('pass/ems/v1/tcm0325s/', foorData, {
-                            headers: {
-                                'Content-Type': 'multipart/form-data'
-                            }
+            if (that.multipleSelection.length > 0) {
+                that.$refs['dialog_form_arr'].validate((valid, obj) => {
+                   if (valid) {
+                    that.loading = true;
+                    let SubmitData = [];
+                    for (let key in that.tableFormDataObj) {
+                        SubmitData.push({
+                        powerdetecdepartment: that.tableFormDataObj[key].powerdetecdepartment,
+                        powercode: that.tableFormDataObj[key].powercode,
+                        powername: that.tableFormDataObj[key].powername,
+                        usestate: that.tableFormDataObj[key].usestate,
+                        sort: that.tableFormDataObj[key].sort
                         })
-                            .then(function (res) {
-                                if (res.code === '0') {
-                                    that.$message({
-                                        message: '新增成功',
-                                        type: 'success'
-                                    });
-                                    that.getTableData();
-                                    that.dialog.editorBox.show = false;
+                    }
+                        that.axios.put('pass/ems/v1/tcm0325s/', SubmitData)
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                message: '修改成功',
+                                 type: 'success'
+                                });
+                                that.getTableData();
+                                that.dialog.editorBox.show = false;
                                 } else {
                                     that.$message.error(res.message);
                                 }
                                 that.loading = false;
-                            }).catch(function () {
-                                that.loading = false;
-                            });
-                    } else {
-                        that.loading = true;
-                        that.axios.put('pass/ems/v1/tcm0325s/' + SubmitData.powercode, SubmitData)
-                            .then(function (res) {
-                                if (res.code === '0') {
-                                    that.$message({
-                                        message: '修改成功',
-                                        type: 'success'
-                                    });
-                                    that.getTableData();
-                                    that.dialog.editorBox.show = false;
+                        })
+                        .catch(function () {
+                            that.loading = false;
+                        });
+                   }
+                });
+            }
+        },
+        but_del () {
+          let that = this;
+          if (that.multipleSelection.length > 0) {
+              that.$refs['dialog_form_arr'].validate((valid, obj) => {
+                  if (valid) {
+                    that.loading = true;
+                    let SubmitData = [];
+                    for (let key in that.tableFormDataObj) {
+                        SubmitData.push({
+                        powerdetecdepartment: that.tableFormDataObj[key].powerdetecdepartment,
+                        powercode: that.tableFormDataObj[key].powercode,
+                        powername: that.tableFormDataObj[key].powername,
+                        usestate: that.tableFormDataObj[key].usestate,
+                        sort: that.tableFormDataObj[key].sort
+                        })
+                    }
+                    that.axios.delete('pass/ems/v1/tcm0325s/', SubmitData)
+                    .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                message: '删除成功',
+                                 type: 'success'
+                                });
+                                that.getTableData();
+                                that.dialog.editorBox.show = false;
                                 } else {
                                     that.$message.error(res.message);
                                 }
                                 that.loading = false;
-                            }).catch(function () {
-                                that.loading = false;
-                            });
-                    }
-                }
-            });
+                        })
+                        .catch(function () {
+                            that.loading = false;
+                        });
+                  }
+              });
+          }
         }
+        // but_del (row) {
+        //     let that = this;
+        //     that.$confirm('是否删除该条数据?', '提示', {
+        //         confirmButtonText: '确定',
+        //         cancelButtonText: '取消',
+        //         state: 'warning'
+        //     }).then(() => {
+        //         that.axios.delete('pass/ems/v1/tcm0325s/' + row.powercode)
+        //             .then(function (res) {
+        //                 if (res.code === '0') {
+        //                     that.$message({
+        //                         message: '删除成功',
+        //                         type: 'success'
+        //                     });
+        //                     that.getTableData();
+        //                 } else {
+        //                     that.$message.error(res.message);
+        //                 }
+        //             }).catch(function () {
+        //             });
+        //     }).catch(() => {
+        //     });
+        // }
     }
 }
 </script>
 
 <style lang="less">
-.powerQualitySystem {
+.powerMonitoringDayData {
     min-width: 700px;
     height: 100%;
     .box {
@@ -640,5 +601,14 @@ export default {
             }
         }
     }
+    .el-table__body .el-form-item--mini.el-form-item {
+        margin: 0px;
+        .error {
+            overflow: hidden;
+            color: #f56c6c;
+            font-size: 12px;
+            line-height: 1;
+        }
+    }
 }
 </style>

+ 160 - 295
src/views/energyQuality/components/waterQuality/waterMonitoringDayData.vue

@@ -11,32 +11,15 @@
                 >
                     <el-row>
                         <el-col :span="6">
-                            <el-form-item label="监测计划">
+                            <el-form-item label="监测项目名称" label-width="80px">
                                 <el-select
                                     filterable clearable
-                                    v-model="filterForm.data.monitoringplan"
+                                    v-model="filterForm.data.sitem"
                                     placeholder=""
                                     style="width: 100%;"
                                 >
                                     <el-option
-                                        v-for="item of nameObj.monitoringplan.arr"
-                                        :key="item.id"
-                                        :value="item.id"
-                                        :label="item.name"
-                                    ></el-option>
-                                </el-select>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="6">
-                            <el-form-item label="监测部门">
-                                <el-select
-                                    filterable clearable
-                                    v-model="filterForm.data.detectiondepartment"
-                                    placeholder=""
-                                    style="width: 100%;"
-                                >
-                                    <el-option
-                                        v-for="item of nameObj.detectiondepartment.arr"
+                                        v-for="item of nameObj.sitem.arr"
                                         :key="item.id"
                                         :value="item.id"
                                         :label="item.name"
@@ -82,36 +65,26 @@
                     <el-row>
                         <el-col :span="6">
                             <el-form-item label="监测日期">
-                                <el-date-picker
-                                    type="date"
+                               <zj-timegran-date
                                     v-model="filterForm.data.monitordate"
-                                    placeholder=""
                                     style="width: 100%;"
-                                    format="yyyy-MM-dd"
-                                    value-format="yyyy-MM-dd"
-                                ></el-date-picker>
+                                    :type="'daterange'"
+                                    :defaultOffset="-1"
+                                ></zj-timegran-date>
                             </el-form-item>
                         </el-col>
-                        <!-- <el-col :span="8">
-                            <el-form-item label="批次号">
-                                <el-select
-                                    filterable clearable
-                                    v-model="filterForm.data.batchno"
-                                    placeholder=""
-                                    style="width: 100%;"
-                                >
-                                    <el-option
-                                        v-for="index of 12"
-                                        :key="index"
-                                        :value="index"
-                                        :label="'第' + index + '次'"
-                                    ></el-option>
-                                </el-select>
-                            </el-form-item>
-                        </el-col> -->
                     </el-row>
                 </el-form>
                 <div class="box-top-gjl">
+                    <el-button
+                        class="button"
+                        type="primary"
+                        size="mini"
+                        icon="el-icon-plus"
+                        v-privilege="activeMenu + 'PUT'"
+                        :loading="loading"
+                        @click="but_edit_plural()"
+                    >保存</el-button>
                     <div style="float:right; text-align: right;">
                         <el-button
                             class="button"
@@ -143,6 +116,12 @@
                 </div>
             </div>
             <div class="box-bottom">
+                <el-form
+                    size="mini"
+                    ref="dialog_form_arr"
+                    label-width="0px"
+                    :model="tableFormDataObj"
+                >
                 <el-table
                     stripe
                     id="singleTable"
@@ -154,7 +133,23 @@
                     border
                     size="mini"
                     highlight-current-row
+                    @selection-change="handleSelectionChange"
                 >
+                   <el-table-column
+                                sortable
+                                type="selection"
+                                width="40"
+                                align="center"
+                                fixed="left"
+                    >
+                   </el-table-column>
+                    <el-table-column
+                            prop="seq"
+                            label="序号"
+                            fixed="left"
+                            width="50px"
+                            :show-overflow-tooltip="true"
+                    ></el-table-column>
                     <el-table-column
                         sortable
                         prop="detectiondepartment"
@@ -209,13 +204,6 @@
                         min-width="100px"
                         :show-overflow-tooltip="true"
                     ></el-table-column>
-                    <!-- <el-table-column
-                        sortable
-                        prop="batchno"
-                        label="批次号"
-                        min-width="100px"
-                        :show-overflow-tooltip="true"
-                    ></el-table-column> -->
                     <el-table-column
                         sortable
                         prop="datadate"
@@ -229,7 +217,23 @@
                         label="监测值"
                         min-width="100px"
                         :show-overflow-tooltip="true"
-                    ></el-table-column>
+                    >
+                    <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="scope.row.isSelection"
+                                >
+                                    <el-input clearable
+                                        style="width: 90%;"
+                                        v-model="tableFormDataObj[scope.row.seq].monitoringvalue"
+                                        refcous="true"
+                                    ></el-input>
+                                    <template slot="error" slot-scope="scope">
+                                        <p class="error" :title="scope.error">{{ scope.error }}</p>
+                                    </template>
+                                </el-form-item>
+                                <span v-else>{{scope.row.monitoringvalue}}</span>
+                            </template>
+                    </el-table-column>
                     <el-table-column
                         sortable
                         prop="unit"
@@ -250,27 +254,25 @@
                         label="备注"
                         min-width="100px"
                         :show-overflow-tooltip="true"
-                    ></el-table-column>
-                    <!-- <el-table-column
-                        sortable
-                        class-name="gn-TableDownloadExcel-none"
-                        label="操作"
-                        align="center"
-                        width="75px"
-                        fixed="right"
                     >
-                        <template slot-scope="scope">
-                            <div>
-                                <el-button
-                                    type="primary"
-                                    size="mini"
-                                    v-privilege="activeMenu + 'PUT'"
-                                    @click="but_edit(scope.row)"
-                                >修改</el-button>
-                            </div>
-                        </template>
-                    </el-table-column> -->
+                    <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="scope.row.isSelection"
+                                >
+                                    <el-input clearable
+                                        style="width: 90%;"
+                                        v-model="tableFormDataObj[scope.row.seq].note"
+                                        refcous="true"
+                                    ></el-input>
+                                    <template slot="error" slot-scope="scope">
+                                        <p class="error" :title="scope.error">{{ scope.error }}</p>
+                                    </template>
+                                </el-form-item>
+                                <span v-else>{{scope.row.note}}</span>
+                            </template>
+                    </el-table-column>
                 </el-table>
+                </el-form>
                 <el-pagination
                     layout="total, sizes, prev, pager, next, jumper"
                     :total="total"
@@ -283,231 +285,15 @@
                 ></el-pagination>
             </div>
         </div>
-        <el-dialog
-            :title="'信息 - ' + (dialog.editorBox.type === 'add' ? '新增' : '修改')"
-            :visible.sync="dialog.editorBox.show"
-            width="600px"
-            :close-on-click-modal="false"
-            :show-close="!loading"
-        >
-            <div>
-                <el-form
-                    ref="dialog_form"
-                    :model="dialog.editorBox.form.data"
-                    :rules="dialog.editorBox.form.rules"
-                    size="mini"
-                    label-width="85px"
-                >
-                    <el-row>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="监测部门"
-                                prop="detectiondepartment"
-                            >
-                                <el-select
-                                    filterable clearable
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.detectiondepartment"
-                                    disabled
-                                >
-                                    <el-option
-                                        v-for="item of nameObj.detectiondepartment.arr"
-                                        :key="item.id"
-                                        :value="item.id"
-                                        :label="item.name"
-                                    ></el-option>
-                                </el-select>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="系统名称"
-                                prop="systemname"
-                            >
-                                <el-select
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.systemname"
-                                    disabled
-                                >
-                                    <el-option
-                                        v-for="item of nameObj.systemname.arr"
-                                        :key="item.id"
-                                        :value="item.id"
-                                        :label="item.name"
-                                    ></el-option>
-                                </el-select>
-                            </el-form-item>
-                        </el-col>
-                    </el-row>
-                    <el-row>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="监测点名称"
-                                prop="powermonitorname"
-                            >
-                                <el-select
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.powermonitorname"
-                                    disabled
-                                >
-                                    <el-option
-                                        v-for="item of nameObj.powermonitorname.arr"
-                                        :key="item.id"
-                                        :value="item.id"
-                                        :label="item.name"
-                                    ></el-option>
-                                </el-select>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="监测项目名称"
-                                prop="sitem"
-                            >
-                                <el-select
-                                    filterable clearable
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.sitem"
-                                    disabled
-                                >
-                                    <el-option
-                                        v-for="item of nameObj.sitem.arr"
-                                        :key="item.id"
-                                        :value="item.id"
-                                        :label="item.name"
-                                    ></el-option>
-                                </el-select>
-                            </el-form-item>
-                        </el-col>
-                    </el-row>
-                    <el-row>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="监测日期"
-                                prop="monitordate"
-                            >
-                                <el-date-picker
-                                    type="date"
-                                    v-model="dialog.editorBox.form.data.monitordate"
-                                    placeholder=""
-                                    style="width: 100%;"
-                                    format="yyyy-MM-dd"
-                                    value-format="yyyy-MM-dd"
-                                ></el-date-picker>
-                            </el-form-item>
-                        </el-col>
-                        <!-- <el-col :span="12">
-                            <el-form-item
-                                label="批次号"
-                                prop="batchno"
-                            >
-                                <el-select
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.batchno"
-                                >
-                                    <el-option
-                                        v-for="index of 12"
-                                        :key="index"
-                                        :value="index"
-                                        :label="'第' + index + '次'"
-                                    ></el-option>
-                                </el-select>
-                            </el-form-item>
-                        </el-col>
-                    </el-row>
-                    <el-row> -->
-                        <el-col :span="12">
-                            <el-form-item
-                                label="监测时间"
-                                prop="datadate"
-                            >
-                                <el-date-picker
-                                    type="datetime"
-                                    v-model="dialog.editorBox.form.data.datadate"
-                                    placeholder=""
-                                    style="width: 100%;"
-                                    format="yyyy-MM-dd HH:mm:ss"
-                                    value-format="yyyy-MM-dd HH:mm:ss"
-                                ></el-date-picker>
-                            </el-form-item>
-                        </el-col>
-                    </el-row>
-                    <el-row>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="监测值"
-                                prop="monitoringvalue"
-                            >
-                                <el-input clearable
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.monitoringvalue"
-                                >
-                                </el-input>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="单位"
-                                prop="unit"
-                            >
-                                <el-input clearable
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.unit"
-                                    disabled
-                                >
-                                </el-input>
-                            </el-form-item>
-                        </el-col>
-                    </el-row>
-                    <el-row>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="分析人"
-                                prop="analyst"
-                            >
-                                <el-input clearable
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.analyst"
-                                >
-                                </el-input>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="备注"
-                                prop="note"
-                            >
-                                <el-input clearable
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.note"
-                                >
-                                </el-input>
-                            </el-form-item>
-                        </el-col>
-                    </el-row>
-                </el-form>
-            </div>
-            <span
-                slot="footer"
-                class="dialog-footer"
-            >
-                <el-button
-                    @click="dialog.editorBox.show = false"
-                    :loading="loading"
-                >取 消</el-button>
-                <el-button
-                    type="primary"
-                    @click="dataSave"
-                    :loading="loading"
-                >保 存</el-button>
-            </span>
-        </el-dialog>
     </div>
 </template>
-
 <script>
+import timegranDate from '@/components/zg/timegranDate.vue'
 export default {
     name: 'waterMonitoringDayData',
+    components: {
+        'zj-timegran-date': timegranDate
+    },
     data () {
         return {
             activeMenu: '',
@@ -529,6 +315,7 @@ export default {
             pageSize: 20,
             total: 0,
             singleTableHeight: 100,
+            tableFormDataObj: {},
             tableData: [
                 // {
                 //     detectiondepartment: '',
@@ -704,6 +491,29 @@ export default {
                     }
                 });
         },
+        handleSelectionChange (val) {
+            let that = this;
+            let tableFormDataObj = {};
+            for (let item of that.tableData) {
+                item.isSelection = false;
+            }
+            for (let item of val) {
+                let obj = {};
+                let xId = item.seq;
+                if (that.tableFormDataObj[xId]) {
+                    tableFormDataObj[xId] = that.tableFormDataObj[xId];
+                } else {
+                    for (let key in item) {
+                        obj[key] = item[key];
+                    }
+                    tableFormDataObj[xId] = obj;
+                }
+                item.isSelection = true;
+            }
+            that.tableFormDataObj = tableFormDataObj;
+            console.log(that.tableFormDataObj)
+            this.multipleSelection = val;
+        },
         // 获取监测点名称
         getPowermonitorNameData () {
             let that = this
@@ -755,12 +565,12 @@ export default {
             let that = this,
                 params = {
                     monitoringplan: that.filterForm.data.monitoringplan,
-                    detectiondepartment: that.filterForm.data.detectiondepartment,
                     systemname: that.filterForm.data.systemname,
                     powermonitorname: that.filterForm.data.powermonitorname,
-                    monitordate: that.filterForm.data.monitordate,
-                    batchno: that.filterForm.data.batchno,
-                    timegranid: 'DAY'
+                    sitem: that.filterForm.data.sitem,
+                    startTime: that.filterForm.data.monitordate[0],
+                    endTime: that.filterForm.data.monitordate[1],
+                    batchno: that.filterForm.data.batchno
                 };
             that.pageNum = pageNum || that.pageNum;
             that.tableLoading = true;
@@ -771,8 +581,10 @@ export default {
                 .then(function (res) {
                     if (res.code === '0') {
                         let arr = [];
-                        for (let item of res.data.list) {
+                        for (let i = 0; i < res.data.list.length; i++) {
+                            let item = res.data.list[i];
                             arr.push({
+                                seq: i,
                                 recordid: item.recordid,
                                 detectiondepartment: item.detectiondepartment,
                                 systemname: item.systemname,
@@ -797,6 +609,48 @@ export default {
                     that.tableLoading = false;
                 });
         },
+        but_edit_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                that.$refs['dialog_form_arr'].validate((valid, obj) => {
+                   if (valid) {
+                    that.loading = true;
+                    let SubmitData = [];
+                    console.log(that.tableFormDataObj)
+                    for (let key in that.tableFormDataObj) {
+                        SubmitData.push({
+                            powermonitorname: that.tableFormDataObj[key].powermonitorname,
+                            batchno: that.tableFormDataObj[key].batchno,
+                            sitem: that.tableFormDataObj[key].sitem,
+                            systemname: that.tableFormDataObj[key].systemname,
+                            monitordate: that.tableFormDataObj[key].monitordate,
+                            unit: that.tableFormDataObj[key].unit,
+                            analyst: that.tableFormDataObj[key].analyst,
+                            monitoringvalue: that.tableFormDataObj[key].monitoringvalue,
+                            note: that.tableFormDataObj[key].note
+                        })
+                    }
+                        that.axios.put('pass/ems/v1/tcm0318s/', SubmitData)
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                message: '修改成功',
+                                 type: 'success'
+                                });
+                                that.getTableData();
+                                that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                        })
+                        .catch(function () {
+                            that.loading = false;
+                        });
+                   }
+                });
+            }
+        },
         // 改变表格显示条数
         tableSizeChange (val) {
             let that = this;
@@ -877,8 +731,19 @@ export default {
                 overflow: hidden;
                 padding: 7px 0;
                 border-top: 1px solid #ccc;
+                // border-bottom: 1px solid #ccc;
+                // margin-bottom: 6px;
             }
         }
     }
+    .el-table__body .el-form-item--mini.el-form-item {
+        margin: 0px;
+        .error {
+            overflow: hidden;
+            color: #f56c6c;
+            font-size: 12px;
+            line-height: 1;
+        }
+    }
 }
 </style>