Explorar el Código

上个批次信息

jinxyang hace 5 años
padre
commit
64ddc8d0a1

+ 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 => {
     const patchNum = {
       nodeType: 'item',
@@ -209,10 +209,10 @@ export default function getChainDetail ({ row }) {
       farm: [],
       report: '',
     }
-    if (row) {
-      console.log(row)
+    const data = row || cache
+    if (data) {
       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 = [
       {
         title: '创建批次',
-        action: () => Vue.stack.push('chain-detail', '创建批次'),
+        action: 'goChainDetail',
         props: {
           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 getChainDetail from './getChainDetail'
 import editChainDetail from './editChainDetail'
+import goChainDetail from './goChainDetail'
 
 export default {
   getChainList,
   getChainDetail,
   editChainDetail,
+  goChainDetail,
 }