Pārlūkot izejas kodu

进口收发货缓存

qinbai 3 gadi atpakaļ
vecāks
revīzija
70101a3a81

+ 8 - 7
src/views/importTrade/invoice/detailsPageEdit.vue

@@ -160,6 +160,11 @@ import {getSysNo} from "@/api/importTrade/purchase";
 
 export default {
   name: "detailsPageEdit",
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
   data() {
     return {
       form: {},
@@ -322,8 +327,8 @@ export default {
     }
   },
   created() {
-    if (this.$route.query.id) {
-      let id = this.$route.query.id.replace(/\"/g, "")
+    if (this.detailData.id) {
+      let id = this.detailData.id.replace(/\"/g, "")
       detailInvoiceList(id).then(res => {
         this.form = res.data.data;
         this.configuration.dicData = this.form.companyName
@@ -560,11 +565,7 @@ export default {
     },
     //返回列表
     backToList() {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: '/importTrade/invoice/index',
-        query: {}
-      });
+      this.$emit("goBack");
     }
   },
 }

+ 38 - 19
src/views/importTrade/invoice/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <basic-container>
+  <basic-container v-if="show">
     <avue-crud :option="option"
                :data="dataList"
                ref="crud"
@@ -35,14 +35,14 @@
           type="text"
           icon="el-icon-view"
           size="small"
-          @click.stop="beforeOpenPage(scope.row,scope.index)"
+          @click.stop="beforeOpenPage(scope.row,1)"
         >查看
         </el-button>
         <el-button
           type="text"
           icon="el-icon-edit"
           size="small"
-          @click.stop="editOpen(scope.row,scope.index)"
+          @click.stop="editOpen(scope.row,2)"
         >编辑
         </el-button>
         <el-button
@@ -55,6 +55,12 @@
       </template>
     </avue-crud>
   </basic-container>
+  <detail-page
+    ref="detail"
+    @goBack="goBack"
+    :detailData="detailData"
+    v-else
+  ></detail-page>
 </template>
 
 <script>
@@ -62,6 +68,7 @@ import option from "./config/mainList.json";
 import {customerList, typeSave, deleteDetails} from "@/api/basicData/configuration"
 import {selectInvoiceList,
   removeInvoiceList,} from "@/api/importTrade/invoice"
+import detailPage from "./detailsPageEdit.vue";
 
 export default {
   name: "customerInformation",
@@ -70,6 +77,8 @@ export default {
       form: {},
       option: option,
       parentId: 0,
+      show:true,
+      detailData:{},
       dataList: [],
       page: {
         pageSize: 10,
@@ -78,6 +87,9 @@ export default {
       }
     }
   },
+  components:{
+    detailPage
+  },
   created() {
   },
   methods: {
@@ -136,24 +148,27 @@ export default {
       this.$refs.crud.rowAdd();
     },
     //查看跳转页面
-    beforeOpenPage(row, index) {
-      this.$router.push({
-        path: "/importInvoice_detailsPage",
-        query: {id: JSON.stringify(row.id)},
-      });
+    beforeOpenPage(row, status) {
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
     },
     //新增跳转页面
-    beforeOpen(row, index) {
-      this.$router.push({
-        path: "/importInvoice_detailsPage",
-        query: {id: JSON.stringify(row.id)},
-      });
-    },
-    editOpen(row, index) {
-      this.$router.push({
-        path: "/importInvoice_detailsPage",
-        query: {id: JSON.stringify(row.id)},
-      });
+    beforeOpen(row) {
+      this.detailData = {
+        id: row.id,
+        status: 0
+      };
+      this.show = false;
+    },
+    editOpen(row, status) {
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
     },
     //点击新增时触发
     beforeClose(done) {
@@ -194,6 +209,10 @@ export default {
         this.page.total = res.data.data.total
       })
     },
+    goBack() {
+      this.detailData=this.$options.data().detailData
+      this.show = true;
+    }
   }
 }
 </script>

+ 8 - 7
src/views/importTrade/receipt/detailsPageEdit.vue

@@ -164,6 +164,11 @@ import {detailListData } from "@/api/importTrade/purchase";
 
 export default {
   name: "detailsPageEdit",
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
   data() {
     return {
       form: {},
@@ -331,8 +336,8 @@ export default {
     }
   },
   created() {
-    if (this.$route.query.id) {
-      let id = this.$route.query.id.replace(/\"/g, "")
+    if (this.detailData.id) {
+      let id = this.detailData.id.replace(/\"/g, "")
       detailReceiptList(id).then(res => {
         this.form = res.data.data;
         this.configuration.dicData = this.form.companyName
@@ -576,11 +581,7 @@ export default {
     },
     //返回列表
     backToList() {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: '/importTrade/receipt/index',
-        query: {}
-      });
+      this.$emit("goBack");
     }
   },
 }

+ 38 - 20
src/views/importTrade/receipt/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <basic-container>
+  <basic-container v-if="show">
     <avue-crud :option="option"
                :data="dataList"
                ref="crud"
@@ -35,14 +35,14 @@
           type="text"
           icon="el-icon-view"
           size="small"
-          @click.stop="beforeOpenPage(scope.row,scope.index)"
+          @click.stop="beforeOpenPage(scope.row,1)"
         >查看
         </el-button>
         <el-button
           type="text"
           icon="el-icon-edit"
           size="small"
-          @click.stop="editOpen(scope.row,scope.index)"
+          @click.stop="editOpen(scope.row,2)"
         >编辑
         </el-button>
         <el-button
@@ -55,6 +55,12 @@
       </template>
     </avue-crud>
   </basic-container>
+  <detail-page
+    ref="detail"
+    @goBack="goBack"
+    :detailData="detailData"
+    v-else
+  ></detail-page>
 </template>
 
 <script>
@@ -62,12 +68,15 @@ import option from "./config/mainList.json";
 import {customerList, typeSave, deleteDetails} from "@/api/basicData/configuration"
 import {selectReceiptList,
   removeReceiptList,} from "@/api/importTrade/receipt"
+import detailPage from "./detailsPageEdit.vue";
 
 export default {
   name: "customerInformation",
   data() {
     return {
       form: {},
+      show:true,
+      detailData:{},
       option: option,
       parentId: 0,
       dataList: [],
@@ -78,6 +87,9 @@ export default {
       }
     }
   },
+  components:{
+    detailPage
+  },
   created() {
     // this.onLoad()
   },
@@ -137,25 +149,27 @@ export default {
       this.$refs.crud.rowAdd();
     },
     //查看跳转页面
-    beforeOpenPage(row, index) {
-      this.$router.push({
-        path: "/importReceipt_detailsPage",
-        query: {id: JSON.stringify(row.id)},
-      });
+    beforeOpenPage(row, status) {
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
     },
     //新增跳转页面
-    beforeOpen(row, index) {
-      console.log(row)
-      this.$router.push({
-        path: "/importReceipt_detailsPage",
-        query: {id: JSON.stringify(row.id)},
-      });
-    },
-    editOpen(row, index) {
-      this.$router.push({
-        path: "/importReceipt_detailsPage",
-        query: {id: JSON.stringify(row.id)},
-      });
+    beforeOpen(row, status) {
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
+    },
+    editOpen(row, status) {
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
     },
     //点击新增时触发
     beforeClose(done) {
@@ -197,6 +211,10 @@ export default {
         this.page.total = res.data.data.total
       })
     },
+    goBack() {
+      this.detailData=this.$options.data().detailData
+      this.show = true;
+    }
   }
 }
 </script>