LAPTOP-16IUEB3P\Lenovo hace 3 años
padre
commit
20f79b74cf

+ 43 - 0
src/api/ledgerAssets/turnovercar.js

@@ -0,0 +1,43 @@
+import request from '@/utils/request';
+
+
+// 获取实体列表分页
+export async function getAssetList (data) {
+  let par = new URLSearchParams(data);
+  const res = await request.get(`/main/asset/page?` + par, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 查询实例详情
+export async function getCategoryInfo (id) {
+  const res = await request.get(`/main/category/info/${id}`);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+// 获取单个类别实体明细分页
+export async function getPageSingle (data) {
+  let par = new URLSearchParams(data);
+  const res = await request.get(`/main/asset/pageSingleSubstance?` + par, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+
+
+
+
+
+
+
+
+

+ 1 - 1
src/components/AssetTree/index.vue

@@ -101,7 +101,7 @@
           this.treeLoading = false;
           if (res?.code === '0') {
             this.treeList = res.data;
-
+            this.$emit('setRootId', res.data[0].id);
             if (this.treeFormate) {
               this.treeList = this.treeFormate(this.treeList);
             }

+ 2 - 1
src/views/ledgerAssets/boat/components/baseInfo.vue

@@ -155,7 +155,8 @@ export default {
            ...this.pagination
          }
          getPageSingle(params).then(res=>{
-             
+            this.tableData = res.list
+            this.total = res.count
          })
 
       },

+ 13 - 3
src/views/ledgerAssets/boat/components/boat-list.vue

@@ -1,5 +1,7 @@
 <template>
   <div>
+    <boat-search @search="reload">
+    </boat-search>
     <!-- 数据表格 -->
     <ele-pro-table
       ref="table"
@@ -12,8 +14,14 @@
     >
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
-        <boat-search @search="reload">
-        </boat-search>
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-download"
+          class="ele-btn-icon"
+        >
+          导出
+        </el-button>
       </template>
       <!-- 编码列 -->
       <template v-slot:code="{ row }">
@@ -35,6 +43,7 @@
     components: { BoatSearch },
     props: {
       // 类别id
+      categoryId: [Number, String],
       rootId: [Number, String],
     },
     data() {
@@ -128,6 +137,7 @@
           ...order,
           pageNum: page,
           size: limit,
+          categoryId: this.categoryId,
           rootCategoryLevelId: this.rootId
         });
       },
@@ -148,7 +158,7 @@
     },
     watch: {
       // 监听类别id变化
-      rootId() {
+      categoryId() {
         this.reload();
       }
     }

+ 0 - 8
src/views/ledgerAssets/boat/components/boat-search.vue

@@ -44,14 +44,6 @@
             size="small"
             type="primary"
           >重置</el-button>
-          <el-button
-            size="small"
-            type="primary"
-            icon="el-icon-download"
-            class="ele-btn-icon"
-          >
-            导出
-          </el-button>
         </div>
       </el-col>
     </el-row>

+ 10 - 2
src/views/ledgerAssets/boat/index.vue

@@ -10,6 +10,7 @@
            <div class="ele-border-lighter sys-organization-list">
              <AssetTree
                @handleNodeClick="handleNodeClick"
+               @setRootId="setRootId"
                :type="'2'"
                :paramsType="'type'"
                ref="treeList"
@@ -19,7 +20,8 @@
          <template v-slot:content>
            <boat-list
              v-if="current"
-             :root-id="current.id"
+             :category-id="current.id"
+             :root-id="rootId"
            />
          </template>
        </ele-split-layout>
@@ -44,7 +46,8 @@
         loading: false,
         // 表格选中数据
         selection: [],
-        current:null
+        current:null,
+        rootId:null,
       };
     },
     computed: {
@@ -54,6 +57,11 @@
       handleNodeClick (info) {
         this.current = info
       },
+      // 获取根节点id
+      setRootId(id){
+        this.rootId = id
+      }
+
     }
   };
 </script>

+ 36 - 31
src/views/ledgerAssets/material/components/baseInfo.vue

@@ -6,11 +6,11 @@
     <el-descriptions title="" :column="4" size="medium" border>
       <el-descriptions-item>
         <template slot="label"> 物品编码 </template>
-        {{ information.informationCode }}
+        {{ information.code }}
       </el-descriptions-item>
       <el-descriptions-item>
         <template slot="label"> 原料名称 </template>
-        {{ information.informationName }}
+        {{ information.name }}
       </el-descriptions-item>
       <el-descriptions-item>
         <template slot="label"> 牌号</template>
@@ -26,7 +26,7 @@
       </el-descriptions-item>
       <el-descriptions-item :span="2">
         <template slot="label"> 分类 </template>
-        {{ information.classificationUrl }}
+        {{ information.categoryLevelPath }}
       </el-descriptions-item>
     </el-descriptions>
 
@@ -45,7 +45,7 @@
                 type="text"
                 size="small"
                 placeholder="请输入"
-                v-model="searchForm.outInCode"
+                v-model="searchForm.sourceBizNo"
               ></el-input>
             </el-form-item>
           </el-col>
@@ -55,7 +55,7 @@
                 type="text"
                 size="small"
                 placeholder="请输入"
-                v-model="searchForm.batchNum"
+                v-model="searchForm.sourceBatchNo"
               ></el-input
             ></el-form-item>
           </el-col>
@@ -75,7 +75,7 @@
       </el-form>
 
       <div class="tabbox">
-        <el-tabs v-model="activeName" type="card" @tab-click="tabClick">
+        <el-tabs v-model="activeName" type="card" @tab-click="tabClick" class="basic-tab">
           <el-tab-pane
             :label="`在用(${countInfo.inUseSum ? countInfo.inUseSum : '0'})`"
             name="inUse"
@@ -109,8 +109,9 @@
         <el-table-column type="selection" width="55"> </el-table-column>
         <el-table-column type="index" label="序号" width="100">
         </el-table-column>
-        <el-table-column prop="assetCode" label="原料编码"> </el-table-column>
-        <el-table-column prop="batchNum" label="批次号"> </el-table-column>
+        <el-table-column prop="code" label="编码"> </el-table-column>
+        <el-table-column prop="name" label="名称" > </el-table-column>
+        <el-table-column prop="sourceBatchNo" label="批次号"> </el-table-column>
         <el-table-column prop="bucketNum" label="包装编码"> </el-table-column>
         <el-table-column prop="minPackUnit" label="最小包装单元">
         </el-table-column>
@@ -146,7 +147,7 @@
           :total="total"
           :page-sizes="[15, 30, 50, 100, 500]"
           :page-size="pagination.size"
-          :current-page.sync="pagination.page"
+          :current-page.sync="pagination.pageNum"
           @current-change="handleCurrent"
           @size-change="handleSize"
         >
@@ -169,7 +170,8 @@
 // import { batchBarPrint } from '@/api/ledgerAssets/booksList'
 // import QrPrint from '@/components/print/printPDF.vue'
   import {
-    getCategoryInfo
+    getCategoryInfo,
+    getPageSingle
   } from '@/api/ledgerAssets/boat.js';
 export default {
   props: {
@@ -187,28 +189,25 @@ export default {
       activeName: 'inUse',
       tableData: [],
       pagination: {
-        page: 1,
+        pageNum: 1,
         size: 15
       },
       total: 0,
       searchForm: {
-        assetType: 'WULIAO',
-        informationId: '',
-        source: 1
+        categoryId:this.rowId,
+        positionType:1
       },
       multipleSelection: [],
       openWindows: false, //打印弹窗
       barCodeConfig: [],
-      source: 1,
+      positionType: 1,
       countInfo: {}
     }
   },
   watch: {},
   created () {
     this.getDetilInfo()
-    // this.searchForm.informationId = this.rowInfo.id
-    // this.getDetilInfo(this.rowInfo.id)
-    // this.handleList()
+    this.handleList()
     // this.getCountNum()
   },
   methods: {
@@ -224,21 +223,21 @@ export default {
     tabClick (val) {
       switch (this.activeName) {
         case 'inUse': {
-          this.source = 1
+          this.positionType = 1
           break
         }
         case 'inLibrary': {
-          this.source = 2
+          this.positionType = 2
           break
         }
         case 'hasConsume': {
-          this.source = 3
+          this.positionType = 3
           break
         }
         default:
           break
       }
-      this.searchForm.source = this.source
+      this.searchForm.positionType = this.positionType
       this.handleList()
     },
 
@@ -247,22 +246,21 @@ export default {
       this.handleList()
     },
     handleSize (size) {
-      this.pagination.page = 1
+      this.pagination.pageNum = 1
       this.pagination.size = size
       this.handleList()
     },
 
     // 搜索
     doSearch () {
-      this.pagination.page = 1
+      this.pagination.pageNum = 1
       this.handleList()
     },
     // 重置
     reset () {
       this.searchForm = {
-        assetType: 'WULIAO',
-        informationId: this.rowInfo.id,
-        source: this.source
+        categoryId:this.rowId,
+        positionType:1
       }
       this.doSearch()
     },
@@ -272,10 +270,10 @@ export default {
         ...this.searchForm,
         ...this.pagination
       }
-      const res = await getAssetPage(params)
-      if (res?.success) {
-        this.tableData = res.data.records
-        this.total = res.data.total
+      const res = await getPageSingle(params)
+      if (res) {
+        this.tableData = res.list
+        this.total = res.count
       }
     },
 
@@ -390,6 +388,13 @@ export default {
   .content {
     padding: 0 20px;
   }
+  .basic-details-title{
+    font-size: 16px;
+    margin: 15px 0;
+  }
+  .basic-tab{
+    margin-bottom: 15px;
+  }
   .upload-container {
     display: flex;
     .img-box {

+ 12 - 2
src/views/ledgerAssets/material/components/material-list.vue

@@ -1,5 +1,7 @@
 <template>
   <div>
+    <material-search @search="reload">
+    </material-search>
     <!-- 数据表格 -->
     <ele-pro-table
       ref="table"
@@ -12,8 +14,14 @@
     >
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
-        <material-search @search="reload">
-        </material-search>
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-download"
+            class="ele-btn-icon"
+          >
+            导出
+          </el-button>
       </template>
       <!-- 编码列 -->
       <template v-slot:code="{ row }">
@@ -35,6 +43,7 @@
     components: { MaterialSearch },
     props: {
       // 类别id
+      categoryId: [Number, String],
       rootId: [Number, String],
     },
     data() {
@@ -110,6 +119,7 @@
           ...order,
           pageNum: page,
           size: limit,
+          categoryId: this.categoryId,
           rootCategoryLevelId: this.rootId
         });
       },

+ 1 - 9
src/views/ledgerAssets/material/components/material-search.vue

@@ -22,7 +22,7 @@
           <el-input clearable v-model="where.modle" placeholder="请输入" />
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 7, md: 12 } : { span: 7 }">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <div class="ele-form-actions">
           <el-button
             type="primary"
@@ -38,14 +38,6 @@
              size="small"
              type="primary"
            >重置</el-button>
-           <el-button
-             size="small"
-             type="primary"
-             icon="el-icon-download"
-             class="ele-btn-icon"
-           >
-             导出
-           </el-button>
         </div>
       </el-col>
     </el-row>

+ 9 - 2
src/views/ledgerAssets/material/index.vue

@@ -10,6 +10,7 @@
            <div class="ele-border-lighter sys-organization-list">
              <AssetTree
                @handleNodeClick="handleNodeClick"
+               @setRootId="setRootId"
                :type="'3'"
                :paramsType="'type'"
                ref="treeList"
@@ -19,7 +20,8 @@
          <template v-slot:content>
            <material-list
              v-if="current"
-             :root-id="current.id"
+             :category-id="current.id"
+             :root-id="rootId"
            />
          </template>
        </ele-split-layout>
@@ -44,7 +46,8 @@
         loading: false,
         // 表格选中数据
         selection: [],
-        current:null
+        current:null,
+        rootId:null,
       };
     },
     computed: {
@@ -54,6 +57,10 @@
       handleNodeClick (info) {
         this.current = info
       },
+      // 获取根节点id
+      setRootId(id){
+        this.rootId = id
+      }
     }
   };
 </script>

+ 1 - 1
src/views/ledgerAssets/turnoverCar/components/baseInfo.vue

@@ -217,7 +217,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-::v-deep.baseinfo-container {
+.baseinfo-container {
   background-color: #fff;
   padding: 20px;
   .content {

+ 56 - 16
src/views/ledgerAssets/turnoverCar/components/turnovercar-list.vue

@@ -1,5 +1,7 @@
 <template>
   <div>
+    <turnovercar-search @search="reload">
+    </turnovercar-search>
     <!-- 数据表格 -->
     <ele-pro-table
       ref="table"
@@ -12,9 +14,6 @@
     >
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
-        <turnovercar-search @search="reload">
-        </turnovercar-search>
-        <div>
           <el-checkbox v-model="checked">显示已消耗</el-checkbox>
           <el-button
            size="small"
@@ -24,14 +23,25 @@
          >
            导出
          </el-button>
-        </div>
       </template>
+
       <!-- 编码列 -->
       <template v-slot:code="{ row }">
         <el-link @click="details(row)">
           {{ row.code }}
         </el-link>
       </template>
+      <!-- 操作列 -->
+      <template v-slot:action="{ row }">
+        <el-link
+          type="primary"
+          :underline="false"
+          icon="el-icon-edit"
+          @click="goEdit(row)"
+        >
+          编辑
+        </el-link>
+      </template>
     </ele-pro-table>
   </div>
 </template>
@@ -39,19 +49,27 @@
 <script>
   import TurnovercarSearch from './turnovercar-search.vue';
   import {
-    getBoatList
-  } from '@/api/ledgerAssets/boat.js';
+    getAssetList
+  } from '@/api/ledgerAssets/turnovercar.js';
 
   export default {
     components: { TurnovercarSearch },
     props: {
       // 类别id
+      categoryId: [Number, String],
       rootId: [Number, String],
     },
     data() {
       return {
         // 表格列配置
         columns: [
+          {
+            columnKey: 'selection',
+            type: 'selection',
+            width: 45,
+            align: 'center',
+            fixed: 'left'
+          },
           {
             columnKey: 'index',
             type: 'index',
@@ -63,53 +81,64 @@
           },
           {
             prop: 'code',
-            label: '类别编码',
+            label: '编码',
             showOverflowTooltip: true,
             minWidth: 110,
-            slot: 'code'
+            slot: 'code',
+            fixed: 'left'
           },
           {
             prop: 'name',
-            label: '类别名称',
+            label: '名称',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
             prop: 'brandNum',
-            label: '牌号',
+            label: '固资编码',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
             prop: 'categoryLevelPath',
-            label: '分类',
+            label: '材质',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
             prop: 'inUseSum',
-            label: '在用',
+            label: '型号',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
             prop: 'inLibrarySum',
-            label: '在库',
+            label: '分类',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
             prop: 'consumeSum',
-            label: '消耗',
+            label: '所在部门',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
             prop: 'totalSum',
-            label: '总数量',
+            label: '生命周期',
             showOverflowTooltip: true,
             minWidth: 110
           },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 100,
+            align: 'left',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true,
+            fixed: 'right'
+          }
         ],
         checked:false
       };
@@ -117,11 +146,12 @@
     methods: {
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
-        return getBoatList({
+        return getAssetList({
           ...where,
           ...order,
           pageNum: page,
           size: limit,
+          categoryId: this.categoryId,
           rootCategoryLevelId: this.rootId
         });
       },
@@ -138,7 +168,17 @@
             id
           }
         })
+      },
+      // 跳转到编辑页
+      goEdit ({ id }) {
+        this.$router.push({
+          path: '/ledgerAssets/turnoverCar/edit',
+          query: {
+            id
+          }
+        })
       }
+
     },
     watch: {
       // 监听类别id变化

+ 1 - 1
src/views/ledgerAssets/turnoverCar/edit.vue

@@ -269,7 +269,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-::v-deep.equipment-container {
+.equipment-container {
   background-color: #fff;
   padding: 20px;
   .content {

+ 9 - 5
src/views/ledgerAssets/turnoverCar/index.vue

@@ -19,7 +19,8 @@
          <template v-slot:content>
            <turnovercar-list
              v-if="current"
-             :root-id="current.id"
+             :category-id="current.id"
+             :root-id="rootId"
            />
          </template>
        </ele-split-layout>
@@ -30,9 +31,7 @@
 <script>
   import AssetTree from '@/components/AssetTree';
   import TurnovercarList from './components/turnovercar-list.vue';
-  import {
-    getBoatList
-  } from '@/api/ledgerAssets/boat.js';
+
   export default {
     components: {
       AssetTree ,
@@ -44,7 +43,8 @@
         loading: false,
         // 表格选中数据
         selection: [],
-        current:null
+        current:null,
+        rootId:null
       };
     },
     computed: {
@@ -54,6 +54,10 @@
       handleNodeClick (info) {
         this.current = info
       },
+      // 获取根节点id
+      setRootId(id){
+        this.rootId = id
+      }
     }
   };
 </script>