lirl 3 роки тому
батько
коміт
86ae39b385

+ 43 - 74
src/views/energyQuality/components/power/powerQualitySystem.vue

@@ -97,7 +97,7 @@
                         type="danger"
                         size="mini"
                         v-privilege="activeMenu + 'DELETE'"
-                        @click="but_del()"
+                        @click="but_del_plural()"
                         >删除</el-button>
                     <div style="float:right; text-align: right;">
                         <el-button
@@ -266,7 +266,7 @@
                                 </el-select>
                             </el-form-item>
                         </el-col>
-                        <el-col :span="12">
+                        <!-- <el-col :span="12">
                             <el-form-item
                                 label="动力系统代码"
                                 prop="powercode"
@@ -277,9 +277,7 @@
                                     :disabled="dialog.editorBox.type !== 'add'"
                                 ></el-input>
                             </el-form-item>
-                        </el-col>
-                    </el-row>
-                    <el-row>
+                        </el-col> -->
                         <el-col :span="12">
                             <el-form-item
                                 label="动力系统名称"
@@ -291,6 +289,8 @@
                                 ></el-input>
                             </el-form-item>
                         </el-col>
+                    </el-row>
+                    <el-row>
                         <el-col :span="12">
                             <el-form-item
                                 label="使用状态"
@@ -311,20 +311,6 @@
                             </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
@@ -666,7 +652,10 @@ export default {
                         sort: that.tableFormDataObj[key].sort
                         })
                     }
-                        that.axios.put('pass/ems/v1/tcm0325s/', SubmitData)
+                        console.log(SubmitData)
+                        that.axios.put('pass/ems/v1/tcm0325s/', SubmitData, {
+                        contentType: 'application/json'
+                       })
                         .then(function (res) {
                             if (res.code === '0') {
                                 that.$message({
@@ -687,66 +676,46 @@ export default {
                 });
             }
         },
-        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) {
+        but_del_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                let SubmitData = [];
+                for (let item of that.multipleSelection) {
+                    SubmitData.push({
+                        powerdetecdepartment: item.powerdetecdepartment,
+                        powercode: item.powercode,
+                        powername: item.powername,
+                        usestate: item.usestate,
+                        sort: item.sort
+                    });
+                }
+                that.$confirm('是否删除已选数据?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    that.axios.delete('pass/ems/v1/tcm0325s/', {
+                        data: SubmitData,
+                        contentType: 'application/json;charset=UTF-8'
+                    })
+                        .then(function (res) {
                             if (res.code === '0') {
                                 that.$message({
-                                message: '删除成功',
-                                 type: 'success'
+                                    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.$message.error(res.message);
+                            }
+                        }).catch(function () {
                         });
-                  }
-              });
-          }
+                }).catch(() => {
+                });
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
         }
-        // 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>

+ 13 - 23
src/views/energyQuality/components/waterQuality/waterQualitySystem.vue

@@ -341,19 +341,6 @@
                     label-width="90px"
                 >
                     <el-row>
-                        <el-col :span="12">
-                            <el-form-item
-                                label="水质系统代码"
-                                prop="watercode"
-                            >
-                                <el-input
-                                    clearable
-                                    style="width: 100%;"
-                                    v-model="dialog.editorBox.form.data.watercode"
-                                    disabled
-                                ></el-input>
-                            </el-form-item>
-                        </el-col>
                         <el-col :span="12">
                             <el-form-item
                                 label="监测部门"
@@ -374,8 +361,6 @@
                                 </el-select>
                             </el-form-item>
                         </el-col>
-                    </el-row>
-                    <el-row>
                         <el-col :span="12">
                             <el-form-item
                                 label="水质系统名称"
@@ -388,6 +373,8 @@
                                 ></el-input>
                             </el-form-item>
                         </el-col>
+                    </el-row>
+                    <el-row>
                         <el-col :span="12">
                             <el-form-item
                                 label="使用状态"
@@ -398,7 +385,6 @@
                                     clearable
                                     style="width: 100%;"
                                     v-model="dialog.editorBox.form.data.usestate"
-                                    disabled
                                 >
                                     <el-option
                                         v-for="item of nameObj.usestate.arr"
@@ -724,19 +710,26 @@ export default {
             }
         },
         // 批量删除
-        but_del_plural () {
+          but_del_plural () {
             let that = this;
             if (that.multipleSelection.length > 0) {
-                let ids = [];
+                let SubmitData = [];
                 for (let item of that.multipleSelection) {
-                    ids.push(item.watercode);
+                    SubmitData.push({
+                        watercode: item.watercode,
+                        detectiondepartment: item.detectiondepartment,
+                        watername: item.watername
+                    });
                 }
                 that.$confirm('是否删除已选数据?', '提示', {
                     confirmButtonText: '确定',
                     cancelButtonText: '取消',
                     state: 'warning'
                 }).then(() => {
-                    that.axios.delete('pass/ems/v1/tcm0310s/' + ids.toString())
+                    that.axios.delete('pass/ems/v1/tcm0310s/', {
+                        data: SubmitData,
+                        contentType: 'application/json;charset=UTF-8'
+                    })
                         .then(function (res) {
                             if (res.code === '0') {
                                 that.$message({
@@ -745,9 +738,6 @@ export default {
                                 });
                                 that.getTableData();
                             } else {
-                                if (res.code === '51') {
-
-                                }
                                 that.$message.error(res.message);
                             }
                         }).catch(function () {