LAPTOP-16IUEB3P\Lenovo 3 лет назад
Родитель
Сommit
b7db8e0673

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

@@ -55,3 +55,14 @@ export async function saveOrEdit (data) {
   }
   }
   return Promise.reject(new Error(res.data.message));
   return Promise.reject(new Error(res.data.message));
 }
 }
+
+
+// 根据类别统计位置数量 
+export async function getCount (data) {
+  let par = new URLSearchParams(data);
+  const res = await request.get(`/main/asset/countPosition?` + par, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 1 - 1
src/store/getters.js

@@ -14,7 +14,7 @@ export default {
   // 根据字典enumName  和 dictCode 获取字典 值(名称
   // 根据字典enumName  和 dictCode 获取字典 值(名称
   getDictValue: (state) => (enumName, dictCode) => {
   getDictValue: (state) => (enumName, dictCode) => {
     const obj = (state.dict[dictEnum[enumName]] || []).find((item) => {
     const obj = (state.dict[dictEnum[enumName]] || []).find((item) => {
-      return item.dictCode === dictCode;
+      return item.dictCode == dictCode;
     });
     });
 
 
     return obj && obj.dictValue;
     return obj && obj.dictValue;

+ 8 - 9
src/views/ledgerAssets/boat/components/baseInfo.vue

@@ -46,19 +46,19 @@
         class="basic-tab"
         class="basic-tab"
       >
       >
         <el-tab-pane
         <el-tab-pane
-          :label="`在用(${countInfo.inUseSum ? countInfo.inUseSum : '0'})`"
+          :label="`在用(${countInfo.useCount ? countInfo.useCount : '0'})`"
           name="inUse"
           name="inUse"
         >
         >
         </el-tab-pane>
         </el-tab-pane>
         <el-tab-pane
         <el-tab-pane
           :label="`在库(${
           :label="`在库(${
-            countInfo.inLibrarySum ? countInfo.inLibrarySum : '0'
+            countInfo.libraryCount ? countInfo.libraryCount : '0'
           })`"
           })`"
           name="inLibrary"
           name="inLibrary"
         >
         >
         </el-tab-pane>
         </el-tab-pane>
         <el-tab-pane
         <el-tab-pane
-          :label="`消耗(${countInfo.consumeSum ? countInfo.consumeSum : '0'})`"
+          :label="`消耗(${countInfo.consumeCount ? countInfo.consumeCount : '0'})`"
           name="hasConsume"
           name="hasConsume"
         >
         >
         </el-tab-pane>
         </el-tab-pane>
@@ -115,7 +115,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-  import { getPageSingle } from '@/api/ledgerAssets';
+  import { getPageSingle , getCount } from '@/api/ledgerAssets';
   import { getDetails } from '@/api/classifyManage/itemInformation.js';
   import { getDetails } from '@/api/classifyManage/itemInformation.js';
   export default {
   export default {
     props: {
     props: {
@@ -146,7 +146,7 @@
     created () {
     created () {
       this.getDetilInfo();
       this.getDetilInfo();
       this.handleList();
       this.handleList();
-      // this.getCountNum()
+      this.getCountNum()
     },
     },
     methods: {
     methods: {
       getDetilInfo () {
       getDetilInfo () {
@@ -204,12 +204,11 @@
 
 
       getCountNum () {
       getCountNum () {
         const params = {
         const params = {
-          assetType: 'ZHOUMIN',
-          informationId: this.rowInfo.id
+          categoryId:  this.rowId
         };
         };
         getCount(params).then((res) => {
         getCount(params).then((res) => {
-          if (res?.success) {
-            this.countInfo = res.data;
+          if (res) {
+            this.countInfo = res;
           }
           }
         });
         });
       }
       }

+ 10 - 11
src/views/ledgerAssets/material/components/baseInfo.vue

@@ -77,28 +77,28 @@
       <div class="tabbox">
       <div class="tabbox">
         <el-tabs v-model="activeName" type="card" @tab-click="tabClick" class="basic-tab">
         <el-tabs v-model="activeName" type="card" @tab-click="tabClick" class="basic-tab">
           <el-tab-pane
           <el-tab-pane
-            :label="`在用(${countInfo.inUseSum ? countInfo.inUseSum : '0'})`"
+            :label="`在用(${countInfo.useCount ? countInfo.useCount : '0'})`"
             name="inUse"
             name="inUse"
           >
           >
           </el-tab-pane>
           </el-tab-pane>
           <el-tab-pane
           <el-tab-pane
             :label="`在库(${
             :label="`在库(${
-              countInfo.inLibrarySum ? countInfo.inLibrarySum : '0'
+              countInfo.libraryCount ? countInfo.libraryCount : '0'
             })`"
             })`"
             name="inLibrary"
             name="inLibrary"
           >
           >
           </el-tab-pane>
           </el-tab-pane>
           <el-tab-pane
           <el-tab-pane
             :label="`消耗(${
             :label="`消耗(${
-              countInfo.consumeSum ? countInfo.consumeSum : '0'
+              countInfo.consumeCount ? countInfo.consumeCount : '0'
             })`"
             })`"
             name="hasConsume"
             name="hasConsume"
           >
           >
           </el-tab-pane>
           </el-tab-pane>
         </el-tabs>
         </el-tabs>
-        <el-button icon="el-icon-printer" size="small" @click="handlPrint"
+       <!-- <el-button icon="el-icon-printer" size="small" @click="handlPrint"
           >打印条码</el-button
           >打印条码</el-button
-        >
+        > -->
       </div>
       </div>
       <el-table
       <el-table
         :data="tableData"
         :data="tableData"
@@ -169,7 +169,7 @@
 // import { getAssetPage, getCount } from '@/api/ledgerAssets/asset'
 // import { getAssetPage, getCount } from '@/api/ledgerAssets/asset'
 // import { batchBarPrint } from '@/api/ledgerAssets/booksList'
 // import { batchBarPrint } from '@/api/ledgerAssets/booksList'
 // import QrPrint from '@/components/print/printPDF.vue'
 // import QrPrint from '@/components/print/printPDF.vue'
-  import { getPageSingle } from '@/api/ledgerAssets';
+  import { getPageSingle , getCount } from '@/api/ledgerAssets';
   import {  getDetails } from '@/api/classifyManage/itemInformation.js';
   import {  getDetails } from '@/api/classifyManage/itemInformation.js';
 export default {
 export default {
   props: {
   props: {
@@ -206,7 +206,7 @@ export default {
   created () {
   created () {
     this.getDetilInfo()
     this.getDetilInfo()
     this.handleList()
     this.handleList()
-    // this.getCountNum()
+    this.getCountNum()
   },
   },
   methods: {
   methods: {
     getDetilInfo(){
     getDetilInfo(){
@@ -358,10 +358,9 @@ export default {
 
 
     getCountNum () {
     getCountNum () {
       const params = {
       const params = {
-        assetType: 'WULIAO',
-        informationId: this.rowInfo.id,
-        outInCode: this.searchForm.outInCode,
-        batchNum: this.searchForm.batchNum
+        categoryId:  this.rowId,
+        sourceBizNo: this.searchForm.sourceBizNo,
+        sourceBatchNo: this.searchForm.sourceBatchNo
       }
       }
       getCount(params).then(res => {
       getCount(params).then(res => {
         if (res?.success) {
         if (res?.success) {

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

@@ -160,9 +160,9 @@ export default {
      async getDetilInfo(){
      async getDetilInfo(){
        const res = await getAssetInfo(this.rowId)
        const res = await getAssetInfo(this.rowId)
        if (res){
        if (res){
-          this.info = res.data
-          this.$set(this.info, 'category', res.data.category)
-          this.$set(this.info, 'extInfoSelf', res.data.extInfoSelf?res.data.extInfoSelf:[])
+          this.info = res
+          this.$set(this.info, 'category', res.category)
+          this.$set(this.info, 'extInfoSelf', res.extInfoSelf?res.extInfoSelf:[])
           // this.$set(this.info, 'warehouseDetail', res.data.warehouseDetail)
           // this.$set(this.info, 'warehouseDetail', res.data.warehouseDetail)
           // if (res.data.imageUrl) {
           // if (res.data.imageUrl) {
           //   imageView(res.data.imageUrl).then((res) => {
           //   imageView(res.data.imageUrl).then((res) => {

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

@@ -69,9 +69,11 @@
   import {
   import {
     getAssetList
     getAssetList
   } from '@/api/ledgerAssets';
   } from '@/api/ledgerAssets';
+  import dictMixins from '@/mixins/dictMixins';
 
 
   export default {
   export default {
     components: { TurnovercarSearch },
     components: { TurnovercarSearch },
+    mixins: [dictMixins],
     props: {
     props: {
       // 类别id
       // 类别id
       categoryId: [Number, String],
       categoryId: [Number, String],
@@ -148,7 +150,10 @@
             prop: 'totalSum',
             prop: 'totalSum',
             label: '生命周期',
             label: '生命周期',
             showOverflowTooltip: true,
             showOverflowTooltip: true,
-            minWidth: 110
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              return this.getDictValue('生命周期',  _row.position[0].type)
+            }
           },
           },
           {
           {
             columnKey: 'action',
             columnKey: 'action',
@@ -164,6 +169,9 @@
         checked:false
         checked:false
       };
       };
     },
     },
+    created () {
+      this.requestDict('生命周期');
+    },
     methods: {
     methods: {
       /* 表格数据源 */
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
       datasource({ page, limit, where, order }) {