Explorar o código

更新藏品总账导出入库位置和出库位置

shaogen1995 %!s(int64=4) %!d(string=hai) anos
pai
achega
948c99af20
Modificáronse 2 ficheiros con 67 adicións e 28 borrados
  1. 2 2
      src/utils/request.js
  2. 65 26
      src/views/holding/holding3.vue

+ 2 - 2
src/utils/request.js

@@ -1,8 +1,8 @@
 import axios from 'axios'
 // export const baseURL = '666初始地址'
 const service = axios.create({
-  // baseURL: 'http://192.168.0.135:8006',
-  baseURL: '',
+  baseURL: 'http://192.168.0.135:8006',
+  // baseURL: '',
   timeout: 5000
 })
 

+ 65 - 26
src/views/holding/holding3.vue

@@ -142,7 +142,7 @@
   </div>
 </template>
 <script>
-// import { getTreeList } from '@/apis/statistics0'
+import { getTreeList } from '@/apis/statistics0'
 import axios from '@/utils/request'
 import { getHolding3List } from '@/apis/holding3'
 import { getGoodsType } from '@/apis/holding'
@@ -152,7 +152,7 @@ export default {
   components: { TabList },
   data () {
     return {
-      // options: [],
+      options: [],
       // 入库位置数据
       // 导出表格的数据
       json_fields: {
@@ -178,9 +178,9 @@ export default {
         质量范围: 'qualityScope',
         具体质量: 'quality',
         入藏时间范围: 'checkInScope',
-        入藏年度: 'checkInYear'
-        // 入库位置: '',
-        // 出库位置: 'outPath'
+        入藏年度: 'checkInYear',
+        入库位置: 'myweizhi',
+        出库位置: 'outPath'
       },
       json_data: [],
       json_meta: [
@@ -229,6 +229,26 @@ export default {
       const res = await getHolding3List({ ...this.mydata, pageNum: 1, pageSize: 99999 })
       this.json_data = res.data.list
       this.json_data.forEach(v => {
+      // 位置信息处理
+        this.options.forEach(p => {
+        // eslint-disable-next-line
+          if(p.id== v.storageId.split(',')[0]) {
+            v.myweizhi = p.name
+            p.children.forEach(p2 => {
+            // eslint-disable-next-line
+              if(p2.id==v.storageId.split(',')[1]) {
+                v.myweizhi += '/' + p2.name + '/'
+                p2.children.forEach(p3 => {
+                // eslint-disable-next-line
+                  if (p3.id == v.storageId.split(',')[2]) {
+                    v.myweizhi += p3.name
+                  }
+                })
+              }
+            })
+          }
+        })
+
         v.numTypeId = this.mycategory(v.numTypeId)
         if (v.amountType === 0) v.amountType = '单件'
         else if (v.amountType === 1) v.amountType = '一套多件'
@@ -266,25 +286,24 @@ export default {
       this.tableData = res.data.list
       this.tableData.forEach(v => {
         // 位置信息处理
-        // console.log(1111, v.storageId.split(',')[2])
-        // this.options.forEach(p => {
-        //   // eslint-disable-next-line
-        //   if(p.id== v.storageId.split(',')[0]) {
-        //     v.myweizhi = p.name
-        //     p.children.forEach(p2 => {
-        //       // eslint-disable-next-line
-        //       if(p2.id==v.storageId.split(',')[1]) {
-        //         v.myweizhi += '/' + p2.name + '/'
-        //         p2.children.forEach(p3 => {
-        //           // eslint-disable-next-line
-        //           if (p3.id == v.storageId.split(',')[2]) {
-        //             v.myweizhi += p3.name
-        //           }
-        //         })
-        //       }
-        //     })
-        //   }
-        // })
+        this.options.forEach(p => {
+          // eslint-disable-next-line
+          if(p.id== v.storageId.split(',')[0]) {
+            v.myweizhi = p.name
+            p.children.forEach(p2 => {
+              // eslint-disable-next-line
+              if(p2.id==v.storageId.split(',')[1]) {
+                v.myweizhi += '/' + p2.name + '/'
+                p2.children.forEach(p3 => {
+                  // eslint-disable-next-line
+                  if (p3.id == v.storageId.split(',')[2]) {
+                    v.myweizhi += p3.name
+                  }
+                })
+              }
+            })
+          }
+        })
 
         // if (v.textureType === 0) v.textureType = '单一质地'
         // else if (v.textureType === 1) v.textureType = '复合质地'
@@ -309,8 +328,8 @@ export default {
   // 生命周期 - 创建完成(可以访问当前this实例)
   async created () {
     // 获取位置信息
-    // const res1 = await getTreeList()
-    // this.options = res1.data
+    const res1 = await getTreeList()
+    this.options = res1.data
     // 获取藏品类型
     const res = await getGoodsType()
     this.mytype = res.data
@@ -328,6 +347,26 @@ export default {
     const res = await getHolding3List({ pageNum: 1, pageSize: 99999 })
     this.json_data = res.data.list
     this.json_data.forEach(v => {
+      // 位置信息处理
+      this.options.forEach(p => {
+        // eslint-disable-next-line
+          if(p.id== v.storageId.split(',')[0]) {
+          v.myweizhi = p.name
+          p.children.forEach(p2 => {
+            // eslint-disable-next-line
+              if(p2.id==v.storageId.split(',')[1]) {
+              v.myweizhi += '/' + p2.name + '/'
+              p2.children.forEach(p3 => {
+                // eslint-disable-next-line
+                  if (p3.id == v.storageId.split(',')[2]) {
+                  v.myweizhi += p3.name
+                }
+              })
+            }
+          })
+        }
+      })
+
       v.numTypeId = this.mycategory(v.numTypeId)
       if (v.amountType === 0) v.amountType = '单件'
       else if (v.amountType === 1) v.amountType = '一套多件'