Просмотр исходного кода

feat(ledgerAssets): 新增批量设置所属工厂功能

yusheng 3 месяцев назад
Родитель
Сommit
8b15f2c4f8

+ 8 - 0
src/api/ledgerAssets/index.js

@@ -199,3 +199,11 @@ export async function batchRun(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+//批量设置所属工厂
+export async function batchUpdateFactory(data) {
+  const res = await request.post(`/main/asset/batchUpdateFactory`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

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

@@ -102,6 +102,16 @@
         >
           批量运行
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-home"
+          class="ele-btn-icon"
+          @click="setFactory"
+          v-if="$hasPermission('main:substance:update')"
+        >
+          设置所属工厂
+        </el-button>
         <el-button
           size="small"
           type="danger"
@@ -165,6 +175,7 @@
     <printTg ref="printTgRef"></printTg>
     <!-- <BomDetailsPop ref="bomDrawer"></BomDetailsPop> -->
     <batchSetDialog ref="batchSetRef" @success="sucesstion" />
+    <batchSetFactory ref="batchSetFactoryRef" @success="sucesstion" />
     <DialogMoveto ref="movetoRef" @success="sucesstion" />
     <importDialog
       ref="importDialogRef"
@@ -180,6 +191,7 @@
 
 <script>
   import batchSetDialog from '@/views/ledgerAssets/equipment/components/batchSetDialog.vue';
+  import batchSetFactory from '@/views/ledgerAssets/equipment/components/batchSetFactory.vue';
   import DialogMoveto from '@/views/ledgerAssets/equipment/components/DialogMoveTo.vue';
 
   import print from '@/views/ledgerAssets/components/print.vue';
@@ -211,7 +223,8 @@
       printTg,
       importDialog,
       DialogMoveto,
-      batchSetDialog
+      batchSetDialog,
+      batchSetFactory
     },
     mixins: [dictMixins],
     props: {
@@ -419,6 +432,12 @@
               return _row.runStatus == 5 ? '停机' : '运行';
             }
           },
+          {
+            prop: 'factoryName',
+            label: '所属工厂',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -527,6 +546,9 @@
           this.sucesstion(true);
         });
       },
+      setFactory() {
+        this.$refs.batchSetFactoryRef.open(this.checkRadioData);
+      },
       handlDelete() {
         if (this.checkRadioData.length == 0) {
           this.$message.warning('请至少选择一条数据');

+ 22 - 0
src/views/ledgerAssets/boat/components/boat-list.vue

@@ -101,6 +101,16 @@
         >
           批量运行
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-home"
+          class="ele-btn-icon"
+          @click="setFactory"
+          v-if="$hasPermission('main:substance:update')"
+        >
+          设置所属工厂
+        </el-button>
       </template>
       <!-- 编码列 -->
       <template v-slot:code="{ row }">
@@ -126,6 +136,7 @@
     <printSr ref="printSrRef"></printSr>
     <printTg ref="printTgRef"></printTg>
     <batchSetDialog ref="batchSetRef" @success="sucesstion" />
+    <batchSetFactory ref="batchSetFactoryRef" @success="sucesstion" />
     <DialogMoveto ref="movetoRef" @success="sucesstion" />
     <accountingLedgerList ref="accountingLedgerListRef"></accountingLedgerList>
   </div>
@@ -137,6 +148,7 @@
   import printSr from '@/views/ledgerAssets/components/printSr';
   import printTg from '@/views/ledgerAssets/components/printTg';
   import batchSetDialog from '@/views/ledgerAssets/equipment/components/batchSetDialog.vue';
+  import batchSetFactory from '@/views/ledgerAssets/equipment/components/batchSetFactory.vue';
   import DialogMoveto from '@/views/ledgerAssets/equipment/components/DialogMoveTo.vue';
   import { getByCode } from '@/api/system/dictionary-data';
   import {
@@ -172,6 +184,7 @@
       printTg,
       DialogMoveto,
       batchSetDialog,
+      batchSetFactory,
       accountingLedgerList
     },
     props: {
@@ -361,6 +374,12 @@
               return _row.runStatus == 5 ? '停机' : '运行';
             }
           },
+          {
+            prop: 'factoryName',
+            label: '所属工厂',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -450,6 +469,9 @@
           this.sucesstion(true);
         });
       },
+      setFactory() {
+        this.$refs.batchSetFactoryRef.open(this.checkRadioData);
+      },
       add() {
         this.$router.push({
           path: '/ledgerAssets/boat/edit'

+ 33 - 9
src/views/ledgerAssets/components/businessInformation.vue

@@ -166,10 +166,19 @@
               <span>{{ networkStatusOptions[ywInfo.networkStatus] }}</span>
             </el-form-item>
           </el-descriptions-item>
+
           <el-descriptions-item>
-            <template slot="label">设备状态 </template>
+            <template slot="label">所属工厂 </template>
             <el-form-item label-width="0">
-              <span>{{ statusOptions[ywInfo.status] }}</span>
+              <el-select v-model="ywInfo.factoryId" placeholder="请选择" style="width: 100%;" :disabled="ywInfo.workstation">
+                <el-option
+                  v-for="item in factoryListOptions"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item :span="3">
@@ -185,7 +194,7 @@
                 <el-option
                   v-for="item in factoryOptions"
                   :key="item.id"
-                  :label="item.pathName"
+                  :label="item.name"
                   :value="item.id"
                 >
                 </el-option>
@@ -261,6 +270,12 @@
               ></el-input> -->
             </el-form-item>
           </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label">设备状态 </template>
+            <el-form-item label-width="0">
+              <span>{{ statusOptions[ywInfo.status] }}</span>
+            </el-form-item>
+          </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label"> 所属区域 </template>
             <el-form-item label-width="0">
@@ -372,12 +387,14 @@
     getFactoryarea,
     listWorkshopByParentId,
     listByProductionLineId,
-    listFactoryLine,basicAreaPageAPI
+    listFactoryLine,
+    basicAreaPageAPI
   } from '@/api/factoryModel';
   export default {
     data() {
       return {
         factoryOptions: [],
+        factoryListOptions: [],
         areaTreeList: [],
         productionLineOptions: [],
         stationOptions: [],
@@ -407,7 +424,8 @@
       this.getDeliveryCycleOptions();
       this.initStatusMapping();
       this.initNetworkMapping();
-      this.getBasicAreaList()
+      this.getBasicAreaList();
+      this.getFactoryList()
       this.getwhbm(1);
       this.getwhbm(2);
       if (this.form.networkStatus < 0) {
@@ -435,8 +453,7 @@
         });
       },
       getAreaInfo(nodeInfo) {
-        this.ywInfo.areaName =nodeInfo.name
-
+        this.ywInfo.areaName = nodeInfo.name;
       },
       // 维护部门
       async getwhbm(type) {
@@ -465,9 +482,16 @@
       //   this.options.repairUserId = data.list;
       // },
       // 获取工厂数据
+      getFactoryList() {
+        getFactoryarea({
+          size: 9999,
+          type: 1
+        }).then((res) => {
+          this.factoryListOptions = res.list;
+        });
+      },
       getFactoryareaList() {
         getFactoryarea({
-          type: 1,
           size: 9999,
           type: 2
         }).then((res) => {
@@ -507,7 +531,7 @@
         this.ywInfo.factoryRoomId = id;
         this.ywInfo.factoryRoomName = this.factoryOptions.filter(
           (item) => item.id === id
-        )[0].pathName;
+        )[0].name;
         this.getListWorkshopByParentId(id);
       },
       change_productionLineId(id) {

+ 112 - 0
src/views/ledgerAssets/equipment/components/batchSetFactory.vue

@@ -0,0 +1,112 @@
+<template>
+  <ele-modal
+    width="30%"
+    :visible.sync="visible"
+    custom-class="ele-dialog-form"
+    :before-close="cancel"
+    title="设置所属工厂"
+    :maxable="true"
+  >
+    <el-form
+      label-width="100px"
+      :model="addForm"
+      ref="form"
+      class="ele-form-search"
+    >
+      <el-form-item label="所属工厂" required>
+        <el-select
+          v-model="addForm.factoryId"
+          placeholder="请选择所属工厂"
+          filterable
+          clearable
+        >
+          <el-option
+            v-for="item in factoryListOptions"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="cancel">取 消</el-button>
+      <el-button type="primary" @click="submit" :loading="loading"
+        >确 定</el-button
+      >
+    </span>
+  </ele-modal>
+</template>
+
+<script>
+  import { getFactoryarea } from '@/api/factoryModel';
+  import { batchUpdateFactory } from '@/api/ledgerAssets';
+  export default {
+    data() {
+      return {
+        visible: false,
+        loading: false,
+        addForm: {
+          factoryId: ''
+        },
+        ids: [],
+        factoryListOptions: []
+      };
+    },
+    methods: {
+      cancel() {
+        this.addForm.factoryId = '';
+        this.ids = [];
+        this.visible = false;
+      },
+      open(data) {
+        // 检查是否有设备已绑定工位
+        const boundItems = data.filter(
+          (item) => item.workstationInfo && item.workstationInfo.name
+        );
+        if (boundItems.length > 0) {
+          const nameS = boundItems.map((item) => item.name).join('、');
+          this.$message.warning(
+            `设备【${nameS}】已绑定了工位,请到主数据工位管理调整`
+          );
+          return;
+        }
+        this.ids = data.map((item) => item.id);
+        this.addForm.factoryId = '';
+        this.visible = true;
+        this.getFactoryList();
+      },
+      getFactoryList() {
+        getFactoryarea({
+          size: 9999,
+          type: 1
+        }).then((res) => {
+          this.factoryListOptions = res.list;
+        });
+      },
+      submit() {
+        if (!this.addForm.factoryId) {
+          return this.$message.warning('请先选择所属工厂');
+        }
+        const params = {
+          ids: this.ids,
+          factoryId: this.addForm.factoryId
+        };
+        this.loading = true;
+        batchUpdateFactory(params)
+          .then((res) => {
+            this.loading = false;
+            if (res) {
+              this.$message.success('操作成功');
+              this.cancel();
+              this.$emit('success', true);
+            }
+          })
+          .catch((err) => {
+            this.loading = false;
+          });
+      }
+    }
+  };
+</script>

+ 26 - 2
src/views/ledgerAssets/equipment/components/equipment-list.vue

@@ -102,6 +102,16 @@
         >
           批量运行
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-home"
+          class="ele-btn-icon"
+          @click="setFactory"
+          v-if="$hasPermission('main:substance:update')"
+        >
+          设置所属工厂
+        </el-button>
         <el-button
           size="small"
           type="danger"
@@ -161,6 +171,7 @@
     <printTg ref="printTgRef"></printTg>
     <BomDetailsPop ref="bomDrawer"></BomDetailsPop>
     <batchSetDialog ref="batchSetRef" @success="sucesstion" />
+    <batchSetFactory ref="batchSetFactoryRef" @success="sucesstion" />
     <DialogMoveto ref="movetoRef" @success="sucesstion" />
     <importDialog
       ref="importDialogRef"
@@ -177,6 +188,7 @@
 
 <script>
   import batchSetDialog from './batchSetDialog.vue';
+  import batchSetFactory from './batchSetFactory.vue';
   import DialogMoveto from './DialogMoveTo.vue';
   import print from '@/views/ledgerAssets/components/print.vue';
   import accountingLedgerList from '@/views/ledgerAssets/components/accountingLedgerList.vue';
@@ -222,6 +234,7 @@
       importDialog,
       DialogMoveto,
       batchSetDialog,
+      batchSetFactory,
       accountingLedgerList
     },
     mixins: [dictMixins],
@@ -312,12 +325,20 @@
             showOverflowTooltip: true,
             minWidth: 110
           },
+         {
+            prop: 'factoryName',
+            label: '所属工厂',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+
           {
             prop: 'workstationInfo.name',
             label: '工位名称',
             showOverflowTooltip: true,
             minWidth: 110
           },
+
           {
             prop: 'manufacturer',
             label: '制造厂',
@@ -435,7 +456,7 @@
               return _row.runStatus == 5 ? '停机' : '运行';
             }
           },
-
+ 
           {
             prop: 'pathName',
             label: '位置',
@@ -544,6 +565,9 @@
           this.sucesstion(true);
         });
       },
+      setFactory() {
+        this.$refs.batchSetFactoryRef.open(this.checkRadioData);
+      },
       handlDelete() {
         if (this.checkRadioData.length == 0) {
           this.$message.warning('请至少选择一条数据');
@@ -584,7 +608,7 @@
           size: limit,
           ...where,
           categoryLevelId: this.categoryId,
-          rootCategoryLevelId: this.rootId
+          rootCategoryLevelId: this.rootId,
         });
       },
       async getNetWork(page, limit, where, order) {

+ 22 - 0
src/views/ledgerAssets/equipment/components/equipment-search.vue

@@ -9,6 +9,7 @@
 
 <script>
   import { getByCode } from '@/api/system/dictionary-data';
+  import { getFactoryarea } from '@/api/factoryModel';
   import { businessStatus, sourceStatus } from '@/utils/dict/warehouse';
 
   export default {
@@ -16,6 +17,7 @@
     data() {
       return {
         assetLevel: [],
+        factoryList: [],
         businessStatus,
         sourceStatus: Object.keys(sourceStatus).map((key) => {
           return {
@@ -103,14 +105,34 @@
             type: 'select',
             placeholder: '请选择',
             selectList: this.assetLevel
+          },
+          {
+            label: '所属工厂',
+            value: 'factoryId',
+            type: 'select',
+            placeholder: '请选择',
+            selectList: this.factoryList
           }
         ];
       }
     },
     created() {
       this.getAssetLevelOptions();
+      this.getFactoryList();
     },
     methods: {
+      // 获取所属工厂下拉
+      getFactoryList() {
+        getFactoryarea({
+          size: 9999,
+          type: 1
+        }).then((res) => {
+          this.factoryList = (res.list || []).map((item) => ({
+            label: item.name,
+            value: item.id
+          }));
+        });
+      },
       // 获取资产级别下拉
       async getAssetLevelOptions() {
         let { data } = await getByCode('asset_level');

+ 22 - 0
src/views/ledgerAssets/material/components/material-list.vue

@@ -82,6 +82,16 @@
         >
           批量运行
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-home"
+          class="ele-btn-icon"
+          @click="setFactory"
+          v-if="$hasPermission('main:substance:update')"
+        >
+          设置所属工厂
+        </el-button>
       </template>
       <!-- 编码列 -->
       <template v-slot:code="{ row }">
@@ -105,6 +115,7 @@
       </template>
     </ele-pro-table>
     <batchSetDialog ref="batchSetRef" @success="sucesstion" />
+    <batchSetFactory ref="batchSetFactoryRef" @success="sucesstion" />
     <DialogMoveto ref="movetoRef" @success="sucesstion" />
     <accountingLedgerList ref="accountingLedgerListRef"></accountingLedgerList>
   </div>
@@ -128,12 +139,14 @@
     batchRun
   } from '@/api/ledgerAssets';
   import batchSetDialog from '@/views/ledgerAssets/equipment/components/batchSetDialog.vue';
+  import batchSetFactory from '@/views/ledgerAssets/equipment/components/batchSetFactory.vue';
   import DialogMoveto from '@/views/ledgerAssets/equipment/components/DialogMoveTo.vue';
   export default {
     components: {
       MaterialSearch,
       DialogMoveto,
       batchSetDialog,
+      batchSetFactory,
       accountingLedgerList
     },
     props: {
@@ -330,6 +343,12 @@
               return _row.runStatus == 5 ? '停机' : '运行';
             }
           },
+          {
+            prop: 'factoryName',
+            label: '所属工厂',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -466,6 +485,9 @@
           this.$message.success('操作成功');
           this.sucesstion(true);
         });
+      },
+      setFactory() {
+        this.$refs.batchSetFactoryRef.open(this.checkRadioData);
       }
     },
     watch: {

+ 22 - 0
src/views/ledgerAssets/meter/components/equipment-list.vue

@@ -98,6 +98,16 @@
         >
           批量运行
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-home"
+          class="ele-btn-icon"
+          @click="setFactory"
+          v-if="$hasPermission('main:substance:update')"
+        >
+          设置所属工厂
+        </el-button>
       </template>
       <!-- 编码列 -->
       <template v-slot:code="{ row }">
@@ -125,6 +135,7 @@
     <printSr ref="printSrRef"></printSr>
     <printTg ref="printTgRef"></printTg>
     <batchSetDialog ref="batchSetRef" @success="sucesstion" />
+    <batchSetFactory ref="batchSetFactoryRef" @success="sucesstion" />
     <DialogMoveto ref="movetoRef" @success="sucesstion" />
     <accountingLedgerList ref="accountingLedgerListRef"></accountingLedgerList>
   </div>
@@ -133,6 +144,7 @@
 <script>
   import accountingLedgerList from '@/views/ledgerAssets/components/accountingLedgerList.vue';
   import batchSetDialog from '@/views/ledgerAssets/equipment/components/batchSetDialog.vue';
+  import batchSetFactory from '@/views/ledgerAssets/equipment/components/batchSetFactory.vue';
   import DialogMoveto from '@/views/ledgerAssets/equipment/components/DialogMoveTo.vue';
   import print from '@/views/ledgerAssets/components/print.vue';
   import printSr from '@/views/ledgerAssets/components/printSr';
@@ -171,6 +183,7 @@
       printSr,
       printTg,
       batchSetDialog,
+      batchSetFactory,
       accountingLedgerList
     },
     mixins: [dictMixins],
@@ -379,6 +392,12 @@
               return _row.runStatus == 5 ? '停机' : '运行';
             }
           },
+          {
+            prop: 'factoryName',
+            label: '所属工厂',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -509,6 +528,9 @@
           this.sucesstion(true);
         });
       },
+      setFactory() {
+        this.$refs.batchSetFactoryRef.open(this.checkRadioData);
+      },
 
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {

+ 22 - 0
src/views/ledgerAssets/mould/components/mould-list.vue

@@ -99,6 +99,16 @@
         >
           批量运行
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-home"
+          class="ele-btn-icon"
+          @click="setFactory"
+          v-if="$hasPermission('main:substance:update')"
+        >
+          设置所属工厂
+        </el-button>
       </template>
 
       <!-- 编码列 -->
@@ -147,6 +157,7 @@
     <printTg ref="printTgRef"></printTg>
     <BomDetailsPop ref="bomDrawer"></BomDetailsPop>
     <batchSetDialog ref="batchSetRef" @success="sucesstion" />
+    <batchSetFactory ref="batchSetFactoryRef" @success="sucesstion" />
     <DialogMoveto ref="movetoRef" @success="sucesstion" />
     <accountingLedgerList ref="accountingLedgerListRef"></accountingLedgerList>
   </div>
@@ -155,6 +166,7 @@
 <script>
   import accountingLedgerList from '@/views/ledgerAssets/components/accountingLedgerList.vue';
   import batchSetDialog from '@/views/ledgerAssets/equipment/components/batchSetDialog.vue';
+  import batchSetFactory from '@/views/ledgerAssets/equipment/components/batchSetFactory.vue';
   import DialogMoveto from '@/views/ledgerAssets/equipment/components/DialogMoveTo.vue';
   import print from '@/views/ledgerAssets/components/print.vue';
   import printSr from '@/views/ledgerAssets/components/printSr';
@@ -189,6 +201,7 @@
       BomDetailsPop,
       DialogMoveto,
       batchSetDialog,
+      batchSetFactory,
       accountingLedgerList
     },
     mixins: [dictMixins],
@@ -384,6 +397,12 @@
               return _row.runStatus == 5 ? '停机' : '运行';
             }
           },
+          {
+            prop: 'factoryName',
+            label: '所属工厂',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -473,6 +492,9 @@
           this.sucesstion(true);
         });
       },
+      setFactory() {
+        this.$refs.batchSetFactoryRef.open(this.checkRadioData);
+      },
       // 获取资产级别下拉
       async getAssetLevelOptions() {
         let { data } = await getByCode('asset_level');

+ 22 - 0
src/views/ledgerAssets/office/components/data-list.vue

@@ -100,6 +100,16 @@
         >
           批量运行
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-home"
+          class="ele-btn-icon"
+          @click="setFactory"
+          v-if="$hasPermission('main:substance:update')"
+        >
+          设置所属工厂
+        </el-button>
       </template>
 
       <!-- 编码列 -->
@@ -145,6 +155,7 @@
     <printSr ref="printSrRef"></printSr>
     <printTg ref="printTgRef"></printTg>
     <batchSetDialog ref="batchSetRef" @success="sucesstion" />
+    <batchSetFactory ref="batchSetFactoryRef" @success="sucesstion" />
     <DialogMoveto ref="movetoRef" @success="sucesstion" />
     <accountingLedgerList ref="accountingLedgerListRef"></accountingLedgerList>
   </div>
@@ -153,6 +164,7 @@
 <script>
   import accountingLedgerList from '@/views/ledgerAssets/components/accountingLedgerList.vue';
   import batchSetDialog from '@/views/ledgerAssets/equipment/components/batchSetDialog.vue';
+  import batchSetFactory from '@/views/ledgerAssets/equipment/components/batchSetFactory.vue';
   import DialogMoveto from '@/views/ledgerAssets/equipment/components/DialogMoveTo.vue';
   import print from '@/views/ledgerAssets/components/print.vue';
   import printSr from '@/views/ledgerAssets/components/printSr';
@@ -183,6 +195,7 @@
       printTg,
       DialogMoveto,
       batchSetDialog,
+      batchSetFactory,
       accountingLedgerList
     },
     mixins: [dictMixins],
@@ -383,6 +396,12 @@
               return _row.runStatus == 5 ? '停机' : '运行';
             }
           },
+          {
+            prop: 'factoryName',
+            label: '所属工厂',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -452,6 +471,9 @@
           this.sucesstion(true);
         });
       },
+      setFactory() {
+        this.$refs.batchSetFactoryRef.open(this.checkRadioData);
+      },
       // 获取资产级别下拉
       async getAssetLevelOptions() {
         let { data } = await getByCode('asset_level');

+ 22 - 0
src/views/ledgerAssets/sparepart/components/sparepart-list.vue

@@ -91,6 +91,16 @@
         >
           批量运行
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-home"
+          class="ele-btn-icon"
+          @click="setFactory"
+          v-if="$hasPermission('main:substance:update')"
+        >
+          设置所属工厂
+        </el-button>
       </template>
 
       <!-- 编码列 -->
@@ -136,6 +146,7 @@
     <printSr ref="printSrRef"></printSr>
     <printTg ref="printTgRef"></printTg>
     <batchSetDialog ref="batchSetRef" @success="sucesstion" />
+    <batchSetFactory ref="batchSetFactoryRef" @success="sucesstion" />
     <DialogMoveto ref="movetoRef" @success="sucesstion" />
     <accountingLedgerList ref="accountingLedgerListRef"></accountingLedgerList>
   </div>
@@ -144,6 +155,7 @@
 <script>
   import accountingLedgerList from '@/views/ledgerAssets/components/accountingLedgerList.vue';
   import batchSetDialog from '@/views/ledgerAssets/equipment/components/batchSetDialog.vue';
+  import batchSetFactory from '@/views/ledgerAssets/equipment/components/batchSetFactory.vue';
   import DialogMoveto from '@/views/ledgerAssets/equipment/components/DialogMoveTo.vue';
   import print from '@/views/ledgerAssets/components/print.vue';
   import printSr from '@/views/ledgerAssets/components/printSr';
@@ -175,6 +187,7 @@
       printTg,
       DialogMoveto,
       batchSetDialog,
+      batchSetFactory,
       accountingLedgerList
     },
     mixins: [dictMixins],
@@ -369,6 +382,12 @@
               return _row.runStatus == 5 ? '停机' : '运行';
             }
           },
+          {
+            prop: 'factoryName',
+            label: '所属工厂',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -457,6 +476,9 @@
           this.sucesstion(true);
         });
       },
+      setFactory() {
+        this.$refs.batchSetFactoryRef.open(this.checkRadioData);
+      },
       suuccessUpload() {
         this.isLoading = false;
       },

+ 22 - 0
src/views/ledgerAssets/turnoverCar/components/turnovercar-list.vue

@@ -100,6 +100,16 @@
         >
           批量运行
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-home"
+          class="ele-btn-icon"
+          @click="setFactory"
+          v-if="$hasPermission('main:substance:update')"
+        >
+          设置所属工厂
+        </el-button>
       </template>
 
       <!-- 编码列 -->
@@ -133,6 +143,7 @@
     <printSr ref="printSrRef"></printSr>
     <printTg ref="printTgRef"></printTg>
     <batchSetDialog ref="batchSetRef" @success="sucesstion" />
+    <batchSetFactory ref="batchSetFactoryRef" @success="sucesstion" />
     <DialogMoveto ref="movetoRef" @success="sucesstion" />
     <accountingLedgerList ref="accountingLedgerListRef"></accountingLedgerList>
   </div>
@@ -141,6 +152,7 @@
 <script>
   import accountingLedgerList from '@/views/ledgerAssets/components/accountingLedgerList.vue';
   import batchSetDialog from '@/views/ledgerAssets/equipment/components/batchSetDialog.vue';
+  import batchSetFactory from '@/views/ledgerAssets/equipment/components/batchSetFactory.vue';
   import DialogMoveto from '@/views/ledgerAssets/equipment/components/DialogMoveTo.vue';
   import print from '@/views/ledgerAssets/components/print.vue';
   import printSr from '@/views/ledgerAssets/components/printSr';
@@ -173,6 +185,7 @@
       printTg,
       DialogMoveto,
       batchSetDialog,
+      batchSetFactory,
       accountingLedgerList
     },
     mixins: [dictMixins],
@@ -363,6 +376,12 @@
               return _row.runStatus == 5 ? '停机' : '运行';
             }
           },
+          {
+            prop: 'factoryName',
+            label: '所属工厂',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -452,6 +471,9 @@
           this.sucesstion(true);
         });
       },
+      setFactory() {
+        this.$refs.batchSetFactoryRef.open(this.checkRadioData);
+      },
       // 获取资产级别下拉
       async getAssetLevelOptions() {
         let { data } = await getByCode('asset_level');

+ 22 - 0
src/views/ledgerAssets/turnoverDisks/components/equipment-list.vue

@@ -99,6 +99,16 @@
         >
           批量运行
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-home"
+          class="ele-btn-icon"
+          @click="setFactory"
+          v-if="$hasPermission('main:substance:update')"
+        >
+          设置所属工厂
+        </el-button>
       </template>
       <!-- 编码列 -->
       <template v-slot:code="{ row }">
@@ -125,6 +135,7 @@
     <printSr ref="printSrRef"></printSr>
     <printTg ref="printTgRef"></printTg>
     <batchSetDialog ref="batchSetRef" @success="sucesstion" />
+    <batchSetFactory ref="batchSetFactoryRef" @success="sucesstion" />
     <DialogMoveto ref="movetoRef" @success="sucesstion" />
     <accountingLedgerList ref="accountingLedgerListRef"></accountingLedgerList>
   </div>
@@ -133,6 +144,7 @@
 <script>
   import accountingLedgerList from '@/views/ledgerAssets/components/accountingLedgerList.vue';
   import batchSetDialog from '@/views/ledgerAssets/equipment/components/batchSetDialog.vue';
+  import batchSetFactory from '@/views/ledgerAssets/equipment/components/batchSetFactory.vue';
   import DialogMoveto from '@/views/ledgerAssets/equipment/components/DialogMoveTo.vue';
   import print from '@/views/ledgerAssets/components/print.vue';
   import printSr from '@/views/ledgerAssets/components/printSr';
@@ -167,6 +179,7 @@
       printTg,
       DialogMoveto,
       batchSetDialog,
+      batchSetFactory,
       accountingLedgerList
     },
     mixins: [dictMixins],
@@ -359,6 +372,12 @@
               return _row.runStatus == 5 ? '停机' : '运行';
             }
           },
+          {
+            prop: 'factoryName',
+            label: '所属工厂',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -478,6 +497,9 @@
           this.sucesstion(true);
         });
       },
+      setFactory() {
+        this.$refs.batchSetFactoryRef.open(this.checkRadioData);
+      },
 
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {