Quellcode durchsuchen

上个批次信息

jinxyang vor 5 Jahren
Ursprung
Commit
64ddc8d0a1
4 geänderte Dateien mit 13 neuen und 5 gelöschten Zeilen
  1. 4 4
      src/actions/getChainDetail.js
  2. 1 1
      src/actions/getChainList.js
  3. 6 0
      src/actions/goChainDetail.js
  4. 2 0
      src/actions/index.js

+ 4 - 4
src/actions/getChainDetail.js

@@ -1,5 +1,5 @@
 
 
-export default function getChainDetail ({ row }) {
+export default function getChainDetail ({ row, cache }) {
   return new Promise(resolve => {
   return new Promise(resolve => {
     const patchNum = {
     const patchNum = {
       nodeType: 'item',
       nodeType: 'item',
@@ -209,10 +209,10 @@ export default function getChainDetail ({ row }) {
       farm: [],
       farm: [],
       report: '',
       report: '',
     }
     }
-    if (row) {
-      console.log(row)
+    const data = row || cache
+    if (data) {
       Object.keys(value).forEach(i => {
       Object.keys(value).forEach(i => {
-        value[i] = row[i]
+        value[i] = data[i]
       })
       })
     }
     }
 
 

+ 1 - 1
src/actions/getChainList.js

@@ -15,7 +15,7 @@ export default function getChainList (payload) {
     const actions = [
     const actions = [
       {
       {
         title: '创建批次',
         title: '创建批次',
-        action: () => Vue.stack.push('chain-detail', '创建批次'),
+        action: 'goChainDetail',
         props: {
         props: {
           type: 'success',
           type: 'success',
         },
         },

+ 6 - 0
src/actions/goChainDetail.js

@@ -0,0 +1,6 @@
+
+export default async function goChainDetail (table) {
+  const cache = Object.assign({}, table[0])
+  Vue.stack.push('chain-detail', '创建批次', { cache })
+  return ''
+}

+ 2 - 0
src/actions/index.js

@@ -2,9 +2,11 @@
 import getChainList from './getChainList'
 import getChainList from './getChainList'
 import getChainDetail from './getChainDetail'
 import getChainDetail from './getChainDetail'
 import editChainDetail from './editChainDetail'
 import editChainDetail from './editChainDetail'
+import goChainDetail from './goChainDetail'
 
 
 export default {
 export default {
   getChainList,
   getChainList,
   getChainDetail,
   getChainDetail,
   editChainDetail,
   editChainDetail,
+  goChainDetail,
 }
 }