huang_an 2 vuotta sitten
vanhempi
commit
565f8a2be5

+ 1 - 1
src/api/classifyManage/itemInformation.js

@@ -2,7 +2,7 @@ import request from '@/utils/request';
 // 物品信息列表
 export async function getList(data) {
   const res = await request.get(
-    `/main/category/getList?searchKey=${data.searchKey}&pageNum=${data.pageNum}&size=${data.size}`
+    `/main/category/getList?searchKey=${data.searchKey}&pageNum=${data.pageNum}&size=${data.size}&categoryLevelId=${data.categoryLevelId}`
   );
   if (res.data.code == 0) {
     return res.data.data;

+ 36 - 14
src/api/ledgerAssets/index.js

@@ -2,7 +2,7 @@ import request from '@/utils/request';
 import { download } from '@/utils/file';
 
 // 获取类别实体分页
-export async function getBoatList (data) {
+export async function getBoatList(data) {
   let par = new URLSearchParams(data);
   const res = await request.get(`/main/category/pageSubstance?` + par, {});
   if (res.data.code == 0) {
@@ -21,7 +21,7 @@ export async function getBoatList (data) {
 // }
 
 // 获取单个类别实体明细分页
-export async function getPageSingle (data) {
+export async function getPageSingle(data) {
   let par = new URLSearchParams(data);
   const res = await request.get(`/main/asset/pageSingleSubstance?` + par, {});
   if (res.data.code == 0) {
@@ -31,7 +31,7 @@ export async function getPageSingle (data) {
 }
 
 // 获取实体列表分页
-export async function getAssetList (data) {
+export async function getAssetList(data) {
   let par = new URLSearchParams(data);
   const res = await request.get(`/main/asset/page?` + par, {});
   if (res.data.code == 0) {
@@ -41,7 +41,7 @@ export async function getAssetList (data) {
 }
 
 // 查询实例详情
-export async function getAssetInfo (id) {
+export async function getAssetInfo(id) {
   const res = await request.get(`main/asset/getById/${id}`);
   if (res.data.code == 0) {
     return res.data.data;
@@ -49,7 +49,7 @@ export async function getAssetInfo (id) {
   return Promise.reject(new Error(res.data.message));
 }
 // 保存or更新
-export async function saveOrEdit (data) {
+export async function saveOrEdit(data) {
   const res = await request.post(`/main/asset/saveOrEdit`, data);
   if (res.data.code == 0) {
     return res.data;
@@ -57,10 +57,9 @@ export async function saveOrEdit (data) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
 // 根据类别统计位置数量
-export async function getCount (data) {
-  const res = await request.get(`/main/asset/countPosition` , { params: data } );
+export async function getCount(data) {
+  const res = await request.get(`/main/asset/countPosition`, { params: data });
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -68,13 +67,36 @@ export async function getCount (data) {
 }
 
 // 导出实体
-export async function downloadAsset (params, fileName) {
-  const res = await request.post('/main/asset/page/export',  params, {responseType:'blob'} );
-  download(res.data, fileName)
+export async function downloadAsset(params, fileName) {
+  const res = await request.post('/main/asset/page/export', params, {
+    responseType: 'blob'
+  });
+  download(res.data, fileName);
 }
 
 // 导出类别
-export async function downloadCategory (params, fileName) {
-  const res = await request.post('/main/category/pageSubstance/export',  params, {responseType:'blob'} );
-  download(res.data, fileName)
+export async function downloadCategory(params, fileName) {
+  const res = await request.post(
+    '/main/category/pageSubstance/export',
+    params,
+    { responseType: 'blob' }
+  );
+  download(res.data, fileName);
+}
+// 设备网络状态统计
+export async function getNetworkCount(data) {
+  const res = await request.get(`/main/asset/networkCount`, { params: data });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//移动分类
+export async function changeSubstanceCateId(data) {
+  const res = await request.post(`/main/asset/changeSubstanceCateId`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
 }

+ 36 - 10
src/components/AssetTree/index.vue

@@ -40,7 +40,7 @@
       defaultExpandAll: {
         type: Boolean,
         default: function () {
-          return true;
+          return false;
         }
       },
       // 初始请求treeList
@@ -61,7 +61,7 @@
       //   default: false
       // },
     },
-    data () {
+    data() {
       return {
         treeList: [],
         treeLoading: false,
@@ -70,21 +70,21 @@
         currentKey: ''
       };
     },
-    mounted () {
+    mounted() {
       if (this.init) {
         this.getTreeData();
       }
     },
     methods: {
-      getInstance () {
+      getInstance() {
         return this.$refs.tree;
       },
       // 获取树结构数据
-      async getTreeData () {
+      async getTreeData(id) {
         try {
           this.treeLoading = true;
 
-          const res = await getTreeByPid(this.id);
+          const res = await getTreeByPid(id ? id : this.id);
           this.treeLoading = false;
           if (res?.code === '0') {
             this.treeList = res.data;
@@ -96,8 +96,18 @@
               // 默认高亮第一级树节点
               if (this.treeList[0]) {
                 this.setCurrentKey(this.treeList[0].id);
+
+                //defaultExpandAll父组件传过来为false 不展开所有树,就默认展开根节点的子节点
+                if (!this.defaultExpandAll) {
+                  // 手动展开第一级树节点的子节点
+                  const rootNode = this.$refs.tree.getNode(this.treeList[0]);
+                  if (rootNode) {
+                    rootNode.expanded = true;
+                  }
+                }
+                const datas = this._setParentId(this.treeList);
                 this.handleNodeClick(
-                  this.treeList[0],
+                  datas[0],
                   this.$refs.tree.getCurrentNode()
                 );
               }
@@ -107,6 +117,22 @@
         } catch (error) {}
         this.treeLoading = false;
       },
+      _setParentId(tree) {
+        let data = tree;
+        for (let i = 0; i < data.length; i++) {
+          if (data[i].parentId === '0') {
+            this.parentName = data[i].name;
+            this.parentId = data[i].id;
+          }
+          data[i]['parentName'] = this.parentName;
+          data[i]['preParentId'] = data[i]['parentId'];
+          data[i]['parentId'] = this.parentId;
+          if (data[i].children && data[i].children.length > 0) {
+            this._setParentId(data[i].children);
+          }
+        }
+        return data;
+      },
       // 递归 - 往树children里面添加parentName
       // _setParentName (tree) {
       //   let data = tree;
@@ -127,17 +153,17 @@
       //   return data;
       // },
 
-      handleNodeClick (data, node) {
+      handleNodeClick(data, node) {
         this.$emit('handleNodeClick', data, node);
       },
       // 设置默认高亮行
-      setCurrentKey (id) {
+      setCurrentKey(id) {
         this.currentKey = id;
         this.$refs.tree.setCurrentKey(this.currentKey);
       },
 
       // 获取树的选中状态
-      getSelectList () {
+      getSelectList() {
         const selectList = this.$refs.tree.getCurrentNode();
         return selectList;
       }

+ 5 - 5
src/components/CommomSelect/equipment-select.vue

@@ -28,16 +28,16 @@
         default: '请选择'
       }
     },
-    data () {
+    data() {
       return {
         treeData: []
       };
     },
-    created () {
+    created() {
       this.getData();
     },
     methods: {
-      async getData () {
+      async getData() {
         const res = await getTreeByType(1);
         this.treeData = res.data;
         this.$emit('setRootId', res.data[0].id);
@@ -48,11 +48,11 @@
         // });
       },
       /* 更新选中数据 */
-      updateValue (value) {
+      updateValue(value) {
         this.$emit('input', value);
       },
 
-      chooseNode (node) {
+      chooseNode(node) {
         this.$emit('changeNode', node);
       }
     }

+ 54 - 10
src/views/ledgerAssets/equipment/components/DialogGoods.vue

@@ -14,14 +14,35 @@
         allow-collapse
         :right-style="{ overflow: 'hidden' }"
       >
-        <div class="minHeight ele-border-lighter split-layout-right-content">
-          <asset-tree
-            @handleNodeClick="handleNodeClick"
-            ref="AssetTree"
-            id="4"
-            :paramsType="'type'"
-          />
+        <div>
+          <div class="select">
+            <el-select
+              size="small"
+              @change="productChange"
+              v-model="productId"
+              placeholder="请选择"
+            >
+              <el-option
+                v-for="item in productList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              >
+              </el-option>
+            </el-select>
+          </div>
+          <div class="tree">
+            <asset-tree
+              @handleNodeClick="handleNodeClick"
+              ref="AssetTree"
+              :paramsType="'type'"
+            />
+          </div>
         </div>
+        <!-- <div class="minHeight ele-border-lighter split-layout-right-content">
+          <template> </template>
+          
+        </div> -->
         <template v-slot:content>
           <!-- 数据表格 -->
           <ele-pro-table
@@ -84,6 +105,7 @@
   // import { getList } from "@/api/stockManagement/itemInformation";
   import { getList } from '@/api/classifyManage/itemInformation';
   import dictMixins from '@/mixins/dictMixins';
+  import { getTreeByPid } from '@/api/classifyManage';
   export default {
     mixins: [dictMixins],
     props: {
@@ -107,14 +129,16 @@
     },
     data() {
       return {
+        productId: '',
         visibleSync: false,
         title: '选择物品编码',
         searchForm: {
           searchKey: '',
-          categoryLevelId: ''
+          categoryLevelId: '1'
         },
         current: {},
-        radio: null
+        radio: null,
+        productList: []
       };
     },
     computed: {
@@ -175,6 +199,9 @@
       this.requestDict('类型用途');
     },
     methods: {
+      productChange(e) {
+        this.$refs.AssetTree.getTreeData(e);
+      },
       /* 表格数据源 */
       datasource({ page, limit, where }) {
         return getList({
@@ -194,8 +221,12 @@
           });
         });
       },
-      open() {
+      async open() {
         this.visibleSync = true;
+        const { data } = await getTreeByPid(0);
+        this.productList = data;
+        this.$refs.AssetTree.getTreeData(0);
+        this.productId = '';
       },
       close() {
         this.visibleSync = false;
@@ -223,6 +254,19 @@
   };
 </script>
 <style lang="scss" scoped>
+  .select {
+    background: #fafafa;
+    border: 1px solid #ededed;
+    border-bottom: none;
+    padding: 9px 15px;
+    .el-select {
+      width: 100%;
+    }
+  }
+  .tree {
+    height: calc(100vh - 280px);
+    border: 1px solid #ededed;
+  }
   .from-search-bar {
     display: flex;
     .btn-wrap {

+ 108 - 0
src/views/ledgerAssets/equipment/components/DialogMoveTo.vue

@@ -0,0 +1,108 @@
+<template>
+  <div class="dialog-moveto">
+    <el-dialog
+      title="移动到"
+      :visible.sync="dialogVisible"
+      width="30%"
+      :before-close="handleClose"
+    >
+      <div class="form">
+        <el-form
+          label-width="77px"
+          :rules="rules"
+          :model="addForm"
+          ref="form"
+          class="ele-form-search"
+        >
+          <el-form-item label="设备分类" label-width="100px" prop="id">
+            <template>
+              <el-select v-model="addForm.id" placeholder="请选择">
+                <el-option
+                  v-for="item in list"
+                  :label="item.name"
+                  :value="item.id"
+                  :key="item.id"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-form-item>
+        </el-form>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="handleClose">取 消</el-button>
+        <el-button type="primary" @click="submit" :loading="loading"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+  import { changeSubstanceCateId } from '@/api/ledgerAssets';
+  import { getTreeByPid } from '@/api/classifyManage';
+  export default {
+    data() {
+      return {
+        dialogVisible: false,
+        addForm: {},
+        loading: false,
+        checkoutArr: [],
+        rules: {
+          id: [{ required: true, message: '请选择设备分类', trigger: 'blur' }]
+        },
+        list: []
+      };
+    },
+    methods: {
+      submit() {
+        this.$refs.form.validate(async (flag) => {
+          if (flag) {
+            try {
+              this.loading = true;
+              const paramsArr = this.checkoutArr.map((item) => {
+                return { categoryLevelId: this.addForm.id, id: item.id };
+              });
+              console.log(paramsArr);
+              const res = await changeSubstanceCateId(paramsArr);
+              this.$message.success('成功!');
+              this.dialogVisible = false;
+              this.$emit('success');
+            } finally {
+              this.loading = false;
+            }
+          } else {
+            return false;
+          }
+        });
+      },
+
+      open(arr, current) {
+        this.addForm = {};
+        this.dialogVisible = true;
+        this.checkoutArr = arr;
+        this.getTreeData(current);
+      },
+      async getTreeData(current) {
+        const res = await getTreeByPid(4);
+        if (res.code == 0) {
+          this.list = [];
+          console.log(current);
+          console.log('==res.data', res.data);
+          res.data.forEach((e) => {
+            if (e.id == current.parentId) {
+              e.children.forEach((item) => {
+                if (item.id == current.preParentId) {
+                  this.list = item.children;
+                }
+              });
+            }
+          });
+        }
+      },
+      handleClose() {
+        this.dialogVisible = false;
+      }
+    }
+  };
+</script>

+ 126 - 16
src/views/ledgerAssets/equipment/components/equipment-list.vue

@@ -1,6 +1,10 @@
 <template>
   <div>
-    <equipment-search @search="reload" ref="search" />
+    <equipment-search
+      @search="reload"
+      :networkCounts="networkCounts"
+      ref="search"
+    />
     <!-- 数据表格 -->
     <ele-pro-table
       ref="table"
@@ -10,6 +14,8 @@
       full-height="calc(100vh - 116px - 102px)"
       tool-class="ele-toolbar-form"
       cache-key="systemOrgUserTable"
+      @select="selectChange"
+      @select-all="changeSelectAll"
     >
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
@@ -24,13 +30,36 @@
         </el-button>
         <el-button
           size="small"
-          type="primary"
           icon="el-icon-download"
           class="ele-btn-icon"
           @click="exportFile"
         >
           导出
         </el-button>
+        <el-button
+          size="small"
+          :disabled="isCheckout"
+          icon="el-icon-set-up"
+          class="ele-btn-icon"
+        >
+          打印条码
+        </el-button>
+        <el-button
+          size="small"
+          :disabled="isCheckout"
+          icon="el-icon-thumb"
+          class="ele-btn-icon"
+        >
+          设置片区负责人
+        </el-button>
+        <el-button size="small" class="ele-btn-icon">删除</el-button>
+        <el-button
+          size="small"
+          @click="moveTo(checkRadioData)"
+          :disabled="isCheckout"
+          class="ele-btn-icon"
+          >移动到</el-button
+        >
       </template>
       <!-- 编码列 -->
       <template v-slot:code="{ row }">
@@ -50,26 +79,50 @@
         </el-link>
       </template>
     </ele-pro-table>
+    <DialogMoveto ref="movetoRef" @success="sucesstion" />
   </div>
 </template>
 
 <script>
+  import { getToken, setToken } from '@/utils/token-util';
   import EquipmentSearch from './equipment-search.vue';
-  import { getAssetList, downloadAsset } from '@/api/ledgerAssets';
+  import DialogMoveto from './DialogMoveTo.vue';
+  import {
+    getAssetList,
+    downloadAsset,
+    getNetworkCount
+  } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
+  import axios from 'axios';
+  import {
+    API_BASE_URL,
+    TOKEN_HEADER_NAME,
+    LAYOUT_PATH
+  } from '@/config/setting';
+  import { download } from '@/utils/file';
 
   export default {
-    components: { EquipmentSearch },
+    components: { EquipmentSearch, DialogMoveto },
     mixins: [dictMixins],
     props: {
       // 类别id
       categoryId: [Number, String],
-      rootId: [Number, String]
+      rootId: [Number, String],
+      current: {
+        typeof: Object,
+        default: {}
+      }
     },
     data() {
       return {
         // 表格列配置
         columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+          },
           {
             columnKey: 'index',
             type: 'index',
@@ -79,12 +132,18 @@
             showOverflowTooltip: true,
             fixed: 'left'
           },
+          {
+            prop: 'fixCode',
+            label: '固资编码',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
           {
             columnKey: 'code',
             slot: 'code',
             label: '设备编码',
             showOverflowTooltip: true,
-            minWidth: 60
+            minWidth: 130
           },
           // {
           //   prop: 'code',
@@ -99,12 +158,7 @@
             showOverflowTooltip: true,
             minWidth: 110
           },
-          {
-            prop: 'fixCode',
-            label: '固资编码',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
+
           {
             prop: 'category.modelType',
             label: '型号',
@@ -118,10 +172,13 @@
             minWidth: 110
           },
           {
-            prop: 'detailLocation',
+            prop: 'pathName',
             label: '位置',
             showOverflowTooltip: true,
-            minWidth: 110
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.position[0].pathName;
+            }
           },
           {
             prop: 'source',
@@ -143,15 +200,46 @@
             label: '操作',
             minWidth: 100
           }
-        ]
+        ],
+        networkCounts: {},
+        isCheckout: true,
+        checkRadioData: []
       };
     },
     created() {
       this.requestDict('网络状态');
     },
     methods: {
+      // 刷新回调
+      sucesstion() {
+        this.reload();
+        this.isCheckout = true;
+      },
+      // 移动到
+      moveTo(arr) {
+        this.$refs.movetoRef.open(arr, this.current);
+      },
+      // 全选
+      changeSelectAll(arr) {
+        console.log(arr);
+        if (arr.length != 0) {
+          this.checkRadioData = arr;
+        } else {
+          this.checkRadioData = [];
+        }
+      },
+      selectChange(selection, row) {
+        if (selection.length != 0) {
+          this.isCheckout = false;
+          this.checkRadioData = selection;
+        } else {
+          this.isCheckout = true;
+          this.checkRadioData = [];
+        }
+      },
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
+        this.getNetWork(page, limit, where, order);
         return getAssetList({
           ...where,
           ...order,
@@ -161,6 +249,17 @@
           rootCategoryLevelId: this.rootId
         });
       },
+      async getNetWork(page, limit, where, order) {
+        const res = await getNetworkCount({
+          ...where,
+          ...order,
+          pageNum: page,
+          size: limit,
+          categoryLevelId: this.categoryId,
+          rootCategoryLevelId: this.rootId
+        });
+        this.networkCounts = res;
+      },
       /* 刷新表格 */
       reload(where) {
         this.$refs.table.reload({ pageNum: 1, where: where });
@@ -198,7 +297,18 @@
           categoryLevelId: this.categoryId,
           rootCategoryLevelId: this.rootId
         };
-        downloadAsset(params, '设备台账导出数据');
+        // downloadAsset(params, '设备台账导出数据');
+        axios({
+          url: `${API_BASE_URL}/main/asset/page/export`,
+          method: 'post',
+          responseType: 'blob',
+          headers: {
+            Authorization: getToken()
+          },
+          data: params
+        }).then((res) => {
+          download(res.data, '设备台账导出数据');
+        });
       }
     },
     watch: {

+ 35 - 7
src/views/ledgerAssets/equipment/components/equipment-search.vue

@@ -47,7 +47,11 @@
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="生命周期:">
-          <DictSelection dictName="生命周期" clearable v-model="where.source">
+          <DictSelection
+            dictName="生命周期"
+            clearable
+            v-model="where.runStatus"
+          >
           </DictSelection>
         </el-form-item>
       </el-col>
@@ -69,6 +73,15 @@
             type="primary"
             >重置</el-button
           >
+          <div class="ele-status">
+            <el-checkbox v-model="consumption">显示已消耗</el-checkbox>
+            <span class="op"
+              >在线:<span>{{ networkCounts.online }}</span></span
+            >
+            <span class="op"
+              >离线:<span>{{ networkCounts.offline }}</span></span
+            >
+          </div>
         </div>
       </el-col>
     </el-row>
@@ -77,37 +90,52 @@
 
 <script>
   export default {
-    data () {
+    props: ['networkCounts'],
+    data() {
       // 默认表单数据
       const defaultWhere = {
         name: '',
         code: '',
         networkStatus: '',
         fixAssetCode: '',
-        source: '',
+        runStatus: '',
         spaceModule: ''
       };
       return {
         // 表单数据
-        where: { ...defaultWhere }
+        where: { ...defaultWhere },
+        consumption: false
       };
     },
     computed: {
       // 是否开启响应式布局
-      styleResponsive () {
+      styleResponsive() {
         return this.$store.state.theme.styleResponsive;
       }
     },
     methods: {
       /* 搜索 */
-      search () {
+      search() {
         this.$emit('search', this.where);
       },
       /*  重置 */
-      reset () {
+      reset() {
         this.where = { ...this.defaultWhere };
         this.search();
       }
     }
   };
 </script>
+<style lang="scss" scoped>
+  .ele-status {
+    float: right;
+    padding-right: 30px;
+    padding-top: 10px;
+    .op {
+      margin-left: 20px;
+      span {
+        color: #0000ff;
+      }
+    }
+  }
+</style>

+ 4 - 3
src/views/ledgerAssets/equipment/index.vue

@@ -22,6 +22,7 @@
             v-if="current"
             :category-id="current.id"
             :root-id="rootId"
+            :current="current"
           />
         </template>
       </ele-split-layout>
@@ -37,7 +38,7 @@
       AssetTree,
       EquipmentList
     },
-    data () {
+    data() {
       return {
         // 加载状态
         loading: false,
@@ -49,11 +50,11 @@
     },
     computed: {},
     methods: {
-      handleNodeClick (info) {
+      handleNodeClick(info) {
         this.current = info;
       },
       // 获取根节点id
-      setRootId (id) {
+      setRootId(id) {
         this.rootId = id;
       }
     }

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

@@ -1,10 +1,6 @@
 <template>
   <div>
-    <sparepart-search 
-      @search="reload"
-      :isConsumer="isConsumer"
-      ref="searchRef"
-    >
+    <sparepart-search @search="reload" :isConsumer="isConsumer" ref="searchRef">
     </sparepart-search>
     <!-- 数据表格 -->
     <ele-pro-table
@@ -18,16 +14,16 @@
     >
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
-          <el-checkbox v-model="isConsumer">显示已消耗</el-checkbox>
-          <el-button
-           size="small"
-           type="primary"
-           icon="el-icon-download"
-           class="ele-btn-icon"
-           @click="btnExport"
-         >
-           导出
-         </el-button>
+        <el-checkbox v-model="isConsumer">显示已消耗</el-checkbox>
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-download"
+          class="ele-btn-icon"
+          @click="btnExport"
+        >
+          导出
+        </el-button>
       </template>
 
       <!-- 编码列 -->
@@ -71,10 +67,7 @@
 
 <script>
   import SparepartSearch from './sparepart-search.vue';
-  import {
-    getAssetList,
-    downloadAsset
-  } from '@/api/ledgerAssets';
+  import { getAssetList, downloadAsset } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   export default {
     components: { SparepartSearch },
@@ -82,7 +75,7 @@
     props: {
       // 类别id
       categoryId: [Number, String],
-      rootId: [Number, String],
+      rootId: [Number, String]
     },
     data() {
       return {
@@ -129,14 +122,14 @@
             label: '规格',
             showOverflowTooltip: true,
             minWidth: 110,
-            slot:'specification'
+            slot: 'specification'
           },
           {
             prop: 'modelType',
             label: '型号',
             showOverflowTooltip: true,
             minWidth: 110,
-            slot:'modelType'
+            slot: 'modelType'
           },
           {
             prop: 'categoryLevelPath',
@@ -157,7 +150,7 @@
             showOverflowTooltip: true,
             minWidth: 110,
             formatter: (_row, _column, cellValue) => {
-              return this.getDictValue('生命周期',  _row.position[0].type)
+              return this.getDictValue('生命周期', _row.position[0].type);
             }
           },
           {
@@ -171,10 +164,10 @@
             fixed: 'right'
           }
         ],
-        isConsumer:false
+        isConsumer: false
       };
     },
-    created () {
+    created() {
       this.requestDict('生命周期');
     },
     methods: {
@@ -195,35 +188,34 @@
       },
 
       // 跳转到详情页
-      details ({ id }) {
+      details({ id }) {
         this.$router.push({
           path: '/ledgerAssets/sparepart/detail',
           query: {
             id
           }
-        })
+        });
       },
       // 跳转到编辑页
-      goEdit ({ id }) {
+      goEdit({ id }) {
         this.$router.push({
           path: '/ledgerAssets/sparepart/edit',
           query: {
             id
           }
-        })
+        });
       },
-      
+
       // 导出
       btnExport() {
         let params = {
           ...this.$refs.searchRef.where,
-          exportType:4,
+          exportType: 4,
           categoryLevelId: this.categoryId,
-          rootCategoryLevelId:this.rootId
-        }
+          rootCategoryLevelId: this.rootId
+        };
         downloadAsset(params, '备品备件台账导出数据');
-      },
-
+      }
     },
     watch: {
       // 监听类别id变化
@@ -234,7 +226,7 @@
   };
 </script>
 <style lang="scss" scoped>
-   .ele-btn-icon{
-     margin-left: 20px;
-   }
+  .ele-btn-icon {
+    margin-left: 20px;
+  }
 </style>

+ 35 - 34
src/views/ledgerAssets/turnoverCar/components/turnovercar-list.vue

@@ -1,9 +1,9 @@
 <template>
   <div>
     <turnovercar-search
-       ref="searchRef"
-       @search="reload"
-       :isConsumer="isConsumer"
+      ref="searchRef"
+      @search="reload"
+      :isConsumer="isConsumer"
     >
     </turnovercar-search>
     <!-- 数据表格 -->
@@ -18,16 +18,16 @@
     >
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
-          <el-checkbox v-model="isConsumer">显示已消耗</el-checkbox>
-          <el-button
-           size="small"
-           type="primary"
-           icon="el-icon-download"
-           class="ele-btn-icon"
-           @click="btnExport"
-         >
-           导出
-         </el-button>
+        <el-checkbox v-model="isConsumer">显示已消耗</el-checkbox>
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-download"
+          class="ele-btn-icon"
+          @click="btnExport"
+        >
+          导出
+        </el-button>
       </template>
 
       <!-- 编码列 -->
@@ -59,7 +59,7 @@
 
 <script>
   import TurnovercarSearch from './turnovercar-search.vue';
-  import {   getAssetList  , downloadAsset } from '@/api/ledgerAssets';
+  import { getAssetList, downloadAsset } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   // import { downloadAction } from '@/api/flowable/manage';
 
@@ -69,7 +69,7 @@
     props: {
       // 类别id
       categoryId: [Number, String],
-      rootId: [Number, String],
+      rootId: [Number, String]
     },
     data() {
       return {
@@ -112,12 +112,15 @@
             minWidth: 110
           },
           {
-            prop: 'materialQuality',
+            prop: 'texture',
             label: '材质',
             showOverflowTooltip: true,
             minWidth: 110,
             formatter: (_row, _column, cellValue) => {
-              return this.getDictValue('周转车材质',  _row.categoryDetail.materialQuality)
+              return this.getDictValue(
+                '周转车材质',
+                _row.categoryDetail.texture
+              );
             }
           },
           {
@@ -126,7 +129,7 @@
             showOverflowTooltip: true,
             minWidth: 110,
             formatter: (_row, _column, cellValue) => {
-              return  _row.category.modelType
+              return _row.category.modelType;
             }
           },
           {
@@ -148,7 +151,7 @@
             showOverflowTooltip: true,
             minWidth: 110,
             formatter: (_row, _column, cellValue) => {
-              return this.getDictValue('生命周期',  _row.position[0].type)
+              return this.getDictValue('生命周期', _row.position[0].type);
             }
           },
           {
@@ -162,10 +165,10 @@
             fixed: 'right'
           }
         ],
-        isConsumer:false
+        isConsumer: false
       };
     },
-    created () {
+    created() {
       this.requestDict('生命周期');
       this.requestDict('周转车材质');
     },
@@ -186,37 +189,35 @@
         this.$refs.table.reload({ pageNum: 1, where: where });
       },
 
-
       // 跳转到详情页
-      details ({ id }) {
+      details({ id }) {
         this.$router.push({
           path: '/ledgerAssets/turnoverCar/detail',
           query: {
             id
           }
-        })
+        });
       },
       // 跳转到编辑页
-      goEdit ({ id }) {
+      goEdit({ id }) {
         this.$router.push({
           path: '/ledgerAssets/turnoverCar/edit',
           query: {
             id
           }
-        })
+        });
       },
 
       // 导出
       btnExport() {
         let params = {
           ...this.$refs.searchRef.where,
-          exportType:2,
+          exportType: 2,
           categoryLevelId: this.categoryId,
-          rootCategoryLevelId:this.rootId
-        }
+          rootCategoryLevelId: this.rootId
+        };
         downloadAsset(params, '周转车台账导出数据');
-      },
-
+      }
     },
     watch: {
       // 监听类别id变化
@@ -227,7 +228,7 @@
   };
 </script>
 <style lang="scss" scoped>
-   .ele-btn-icon{
-     margin-left: 20px;
-   }
+  .ele-btn-icon {
+    margin-left: 20px;
+  }
 </style>