yusheng 1 giorno fa
parent
commit
d0ce79a309

+ 38 - 1
src/views/ledgerAssets/accountingLedger/components/list.vue

@@ -81,6 +81,27 @@
         >
           设置使用单位
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-tools"
+          class="ele-btn-icon"
+          type="danger"
+          @click="setStatus(1)"
+          v-if="$hasPermission('main:substance:stop')"
+        >
+          批量停机
+        </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-setting"
+          class="ele-btn-icon"
+          @click="setStatus(2)"
+          v-if="$hasPermission('main:substance:run')"
+        >
+          批量运行
+        </el-button>
         <el-button
           size="small"
           type="danger"
@@ -173,7 +194,7 @@
   } from '@/utils/dict/warehouse';
 
   import EquipmentSearch from '@/views/ledgerAssets/equipment/components/equipment-search.vue';
-  import { getAssetList, getNetworkCount, batchDel } from '@/api/ledgerAssets';
+  import { getAssetList, getNetworkCount, batchDel, batchStop, batchRun } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   import axios from 'axios';
   import { API_BASE_URL } from '@/config/setting';
@@ -389,6 +410,15 @@
               }
             }
           },
+          {
+            prop: 'runStatus',
+            label: '运行状态',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.runStatus == 5 ? '停机' : '运行';
+            }
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -490,6 +520,13 @@
           this.checkRadioData = [];
         }
       },
+      setStatus(type) {
+        let api = type == 1 ? batchStop : batchRun;
+        api(this.checkRadioData.map((item) => item.id)).then((res) => {
+          this.$message.success('操作成功');
+          this.sucesstion(true);
+        });
+      },
       handlDelete() {
         if (this.checkRadioData.length == 0) {
           this.$message.warning('请至少选择一条数据');

+ 40 - 1
src/views/ledgerAssets/boat/components/boat-list.vue

@@ -80,6 +80,27 @@
         >
           设置使用单位
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-tools"
+          class="ele-btn-icon"
+          type="danger"
+          @click="setStatus(1)"
+          v-if="$hasPermission('main:substance:stop')"
+        >
+          批量停机
+        </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-setting"
+          class="ele-btn-icon"
+          @click="setStatus(2)"
+          v-if="$hasPermission('main:substance:run')"
+        >
+          批量运行
+        </el-button>
       </template>
       <!-- 编码列 -->
       <template v-slot:code="{ row }">
@@ -128,7 +149,9 @@
   import {
     getBoatList,
     downloadCategory,
-    getAssetList
+    getAssetList,
+    batchStop,
+    batchRun
   } from '@/api/ledgerAssets';
   // import { downloadAction } from '@/api/flowable/manage';
   import dictMixins from '@/mixins/dictMixins';
@@ -329,6 +352,15 @@
               }
             }
           },
+          {
+            prop: 'runStatus',
+            label: '运行状态',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.runStatus == 5 ? '停机' : '运行';
+            }
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -411,6 +443,13 @@
           this.checkRadioData = [];
         }
       },
+      setStatus(type) {
+        let api = type == 1 ? batchStop : batchRun;
+        api(this.checkRadioData.map((item) => item.id)).then((res) => {
+          this.$message.success('操作成功');
+          this.sucesstion(true);
+        });
+      },
       add() {
         this.$router.push({
           path: '/ledgerAssets/boat/edit'

+ 59 - 1
src/views/ledgerAssets/material/components/material-list.vue

@@ -17,6 +17,8 @@
       full-height="calc(100vh - 115px)"
       tool-class="ele-toolbar-form"
       cache-key="systemOrgUserTable"
+      @select="selectChange"
+      @select-all="changeSelectAll"
     >
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
@@ -59,6 +61,27 @@
         >
           设置使用单位
         </el-button> -->
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-tools"
+          class="ele-btn-icon"
+          type="danger"
+          @click="setStatus(1)"
+          v-if="$hasPermission('main:substance:stop')"
+        >
+          批量停机
+        </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-setting"
+          class="ele-btn-icon"
+          @click="setStatus(2)"
+          v-if="$hasPermission('main:substance:run')"
+        >
+          批量运行
+        </el-button>
       </template>
       <!-- 编码列 -->
       <template v-slot:code="{ row }">
@@ -100,7 +123,9 @@
   import {
     getBoatList,
     downloadCategory,
-    getAssetList
+    getAssetList,
+    batchStop,
+    batchRun
   } from '@/api/ledgerAssets';
   import batchSetDialog from '@/views/ledgerAssets/equipment/components/batchSetDialog.vue';
   import DialogMoveto from '@/views/ledgerAssets/equipment/components/DialogMoveTo.vue';
@@ -122,6 +147,7 @@
         businessStatus,
         assetLevel: [],
         isConsumer: false,
+        checkRadioData: [],
         // 表格列配置
         columns: [
           {
@@ -295,6 +321,15 @@
               }
             }
           },
+          {
+            prop: 'runStatus',
+            label: '运行状态',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.runStatus == 5 ? '停机' : '运行';
+            }
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -408,6 +443,29 @@
           rootCategoryLevelId: this.rootId
         };
         downloadCategory(params, '原料台账导出数据');
+      },
+      // 全选
+      changeSelectAll(arr) {
+        console.log(arr);
+        if (arr.length != 0) {
+          this.checkRadioData = arr;
+        } else {
+          this.checkRadioData = [];
+        }
+      },
+      selectChange(selection, row) {
+        if (selection.length != 0) {
+          this.checkRadioData = selection;
+        } else {
+          this.checkRadioData = [];
+        }
+      },
+      setStatus(type) {
+        let api = type == 1 ? batchStop : batchRun;
+        api(this.checkRadioData.map((item) => item.id)).then((res) => {
+          this.$message.success('操作成功');
+          this.sucesstion(true);
+        });
       }
     },
     watch: {

+ 40 - 1
src/views/ledgerAssets/meter/components/equipment-list.vue

@@ -77,6 +77,27 @@
         >
           设置使用单位
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-tools"
+          class="ele-btn-icon"
+          type="danger"
+          @click="setStatus(1)"
+          v-if="$hasPermission('main:substance:stop')"
+        >
+          批量停机
+        </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-setting"
+          class="ele-btn-icon"
+          @click="setStatus(2)"
+          v-if="$hasPermission('main:substance:run')"
+        >
+          批量运行
+        </el-button>
       </template>
       <!-- 编码列 -->
       <template v-slot:code="{ row }">
@@ -128,7 +149,9 @@
     getAssetList,
     downloadAsset,
     getNetworkCount,
-    batchDel
+    batchDel,
+    batchStop,
+    batchRun
   } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   import axios from 'axios';
@@ -347,6 +370,15 @@
               }
             }
           },
+          {
+            prop: 'runStatus',
+            label: '运行状态',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.runStatus == 5 ? '停机' : '运行';
+            }
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -470,6 +502,13 @@
             .catch(() => {});
         }
       },
+      setStatus(type) {
+        let api = type == 1 ? batchStop : batchRun;
+        api(this.checkRadioData.map((item) => item.id)).then((res) => {
+          this.$message.success('操作成功');
+          this.sucesstion(true);
+        });
+      },
 
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {

+ 38 - 1
src/views/ledgerAssets/mould/components/mould-list.vue

@@ -78,6 +78,27 @@
         >
           设置使用单位
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-tools"
+          class="ele-btn-icon"
+          type="danger"
+          @click="setStatus(1)"
+          v-if="$hasPermission('main:substance:stop')"
+        >
+          批量停机
+        </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-setting"
+          class="ele-btn-icon"
+          @click="setStatus(2)"
+          v-if="$hasPermission('main:substance:run')"
+        >
+          批量运行
+        </el-button>
       </template>
 
       <!-- 编码列 -->
@@ -146,7 +167,7 @@
   } from '@/utils/dict/warehouse';
   import MouldSearch from '@/views/ledgerAssets/equipment/components/equipment-search.vue';
 
-  import { getAssetList, downloadAsset } from '@/api/ledgerAssets';
+  import { getAssetList, downloadAsset, batchStop, batchRun } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   import axios from 'axios';
   import {
@@ -354,6 +375,15 @@
               }
             }
           },
+          {
+            prop: 'runStatus',
+            label: '运行状态',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.runStatus == 5 ? '停机' : '运行';
+            }
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -436,6 +466,13 @@
           this.checkRadioData = [];
         }
       },
+      setStatus(type) {
+        let api = type == 1 ? batchStop : batchRun;
+        api(this.checkRadioData.map((item) => item.id)).then((res) => {
+          this.$message.success('操作成功');
+          this.sucesstion(true);
+        });
+      },
       // 获取资产级别下拉
       async getAssetLevelOptions() {
         let { data } = await getByCode('asset_level');

+ 38 - 1
src/views/ledgerAssets/office/components/data-list.vue

@@ -79,6 +79,27 @@
         >
           设置使用单位
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-tools"
+          class="ele-btn-icon"
+          type="danger"
+          @click="setStatus(1)"
+          v-if="$hasPermission('main:substance:stop')"
+        >
+          批量停机
+        </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-setting"
+          class="ele-btn-icon"
+          @click="setStatus(2)"
+          v-if="$hasPermission('main:substance:run')"
+        >
+          批量运行
+        </el-button>
       </template>
 
       <!-- 编码列 -->
@@ -144,7 +165,7 @@
   } from '@/utils/dict/warehouse';
   import UserSearch from '@/views/ledgerAssets/equipment/components/equipment-search.vue';
 
-  import { getAssetList, downloadAsset } from '@/api/ledgerAssets';
+  import { getAssetList, downloadAsset, batchStop, batchRun } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   import axios from 'axios';
   import {
@@ -353,6 +374,15 @@
               }
             }
           },
+          {
+            prop: 'runStatus',
+            label: '运行状态',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.runStatus == 5 ? '停机' : '运行';
+            }
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -415,6 +445,13 @@
           this.checkRadioData = [];
         }
       },
+      setStatus(type) {
+        let api = type == 1 ? batchStop : batchRun;
+        api(this.checkRadioData.map((item) => item.id)).then((res) => {
+          this.$message.success('操作成功');
+          this.sucesstion(true);
+        });
+      },
       // 获取资产级别下拉
       async getAssetLevelOptions() {
         let { data } = await getByCode('asset_level');

+ 38 - 1
src/views/ledgerAssets/sparepart/components/sparepart-list.vue

@@ -70,6 +70,27 @@
         >
           设置使用单位
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-tools"
+          class="ele-btn-icon"
+          type="danger"
+          @click="setStatus(1)"
+          v-if="$hasPermission('main:substance:stop')"
+        >
+          批量停机
+        </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-setting"
+          class="ele-btn-icon"
+          @click="setStatus(2)"
+          v-if="$hasPermission('main:substance:run')"
+        >
+          批量运行
+        </el-button>
       </template>
 
       <!-- 编码列 -->
@@ -135,7 +156,7 @@
   } from '@/utils/dict/warehouse';
   import SparepartSearch from '@/views/ledgerAssets/equipment/components/equipment-search.vue';
 
-  import { getAssetList, importCategorySparePart } from '@/api/ledgerAssets';
+  import { getAssetList, importCategorySparePart, batchStop, batchRun } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   import axios from 'axios';
   import {
@@ -339,6 +360,15 @@
               }
             }
           },
+          {
+            prop: 'runStatus',
+            label: '运行状态',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.runStatus == 5 ? '停机' : '运行';
+            }
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -420,6 +450,13 @@
           this.checkRadioData = [];
         }
       },
+      setStatus(type) {
+        let api = type == 1 ? batchStop : batchRun;
+        api(this.checkRadioData.map((item) => item.id)).then((res) => {
+          this.$message.success('操作成功');
+          this.sucesstion(true);
+        });
+      },
       suuccessUpload() {
         this.isLoading = false;
       },

+ 38 - 1
src/views/ledgerAssets/turnoverCar/components/turnovercar-list.vue

@@ -79,6 +79,27 @@
         >
           设置使用单位
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-tools"
+          class="ele-btn-icon"
+          type="danger"
+          @click="setStatus(1)"
+          v-if="$hasPermission('main:substance:stop')"
+        >
+          批量停机
+        </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-setting"
+          class="ele-btn-icon"
+          @click="setStatus(2)"
+          v-if="$hasPermission('main:substance:run')"
+        >
+          批量运行
+        </el-button>
       </template>
 
       <!-- 编码列 -->
@@ -132,7 +153,7 @@
   } from '@/utils/dict/warehouse';
   import TurnovercarSearch from '@/views/ledgerAssets/equipment/components/equipment-search.vue';
 
-  import { getAssetList, downloadAsset } from '@/api/ledgerAssets';
+  import { getAssetList, downloadAsset, batchStop, batchRun } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   // import { downloadAction } from '@/api/flowable/manage';
   import axios from 'axios';
@@ -333,6 +354,15 @@
               }
             }
           },
+          {
+            prop: 'runStatus',
+            label: '运行状态',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.runStatus == 5 ? '停机' : '运行';
+            }
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -415,6 +445,13 @@
           this.checkRadioData = [];
         }
       },
+      setStatus(type) {
+        let api = type == 1 ? batchStop : batchRun;
+        api(this.checkRadioData.map((item) => item.id)).then((res) => {
+          this.$message.success('操作成功');
+          this.sucesstion(true);
+        });
+      },
       // 获取资产级别下拉
       async getAssetLevelOptions() {
         let { data } = await getByCode('asset_level');

+ 40 - 1
src/views/ledgerAssets/turnoverDisks/components/equipment-list.vue

@@ -78,6 +78,27 @@
         >
           设置使用单位
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-tools"
+          class="ele-btn-icon"
+          type="danger"
+          @click="setStatus(1)"
+          v-if="$hasPermission('main:substance:stop')"
+        >
+          批量停机
+        </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-setting"
+          class="ele-btn-icon"
+          @click="setStatus(2)"
+          v-if="$hasPermission('main:substance:run')"
+        >
+          批量运行
+        </el-button>
       </template>
       <!-- 编码列 -->
       <template v-slot:code="{ row }">
@@ -124,7 +145,9 @@
     getAssetList,
     downloadAsset,
     getNetworkCount,
-    batchDel
+    batchDel,
+    batchStop,
+    batchRun
   } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   import axios from 'axios';
@@ -327,6 +350,15 @@
               }
             }
           },
+          {
+            prop: 'runStatus',
+            label: '运行状态',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.runStatus == 5 ? '停机' : '运行';
+            }
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -439,6 +471,13 @@
             .catch(() => {});
         }
       },
+      setStatus(type) {
+        let api = type == 1 ? batchStop : batchRun;
+        api(this.checkRadioData.map((item) => item.id)).then((res) => {
+          this.$message.success('操作成功');
+          this.sucesstion(true);
+        });
+      },
 
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {