Bladeren bron

修改bug

QuKatie 3 jaren geleden
bovenliggende
commit
c4a8489b80

+ 19 - 10
src/components/fee-info/config/feeInfo.json

@@ -8,66 +8,75 @@
   "border": true,
   "index": true,
   "refreshBtn": false,
-  "menuWidth": 150,
+  "menuWidth": 180,
   "align":"center",
   "column": [{
       "label": "结算单位",
       "prop": "corpId",
       "index": 1,
       "minWidth": 100,
-      "cell": true
+      "cell": true,
+      "overHidden": true
     },
     {
       "label": "费用名称",
       "prop": "feeName",
       "index": 2,
-      "minWidth": 100
+      "minWidth": 100,
+      "overHidden": true
     },
     {
       "label": "单价",
       "prop": "price",
       "index": 3,
       "minWidth": 100,
-      "slot": true
+      "slot": true,
+      "overHidden": true
     },
     {
       "label": "计价单位",
       "prop": "unit",
       "index": 4,
       "minWidth": 100,
-      "cell": false
+      "cell": false,
+      "overHidden": true
     },
     {
       "label": "数量",
       "prop": "quantity",
       "index": 5,
-      "minWidth": 100
+      "minWidth": 100,
+      "overHidden": true
     },
     {
       "label": "金额",
       "prop": "amount",
       "index": 6,
       "minWidth": 100,
-      "cell": false
+      "cell": false,
+      "overHidden": true
     },
     {
       "label": "币别",
       "prop": "currency",
       "index": 7,
-      "minWidth": 100
+      "minWidth": 100,
+      "overHidden": true
     },
     {
       "label": "汇率",
       "prop": "exchangeRate",
       "index": 8,
-      "minWidth": 100
+      "minWidth": 100,
+      "overHidden": true
     },
     {
       "label": "备注",
       "prop": "remarks",
       "index": 9,
       "minWidth": 100,
-      "cell": true
+      "cell": true,
+      "overHidden": true
     }
   ]
 }

+ 64 - 18
src/components/fee-info/main.vue

@@ -16,6 +16,14 @@
         <template slot="menu" slot-scope="{ row, index }">
           <el-button
             size="small"
+            icon="el-icon-refresh"
+            type="text"
+            @click="rePick(row, index)"
+            :disabled="disabled"
+            >重选</el-button
+          >
+          <el-button
+            size="small"
             icon="el-icon-edit"
             type="text"
             @click="rowCell(row, index)"
@@ -87,6 +95,7 @@
           </div>
         </el-col>
         <el-col :span="19">
+          {{reData}}
           <avue-crud
             :option="option"
             :table-loading="loading"
@@ -104,7 +113,11 @@
       </el-row>
       <span slot="footer" class="dialog-footer">
         <el-button @click="feeDialog = false">取 消</el-button>
-        <el-button type="primary" @click="importData">
+        <el-button
+          type="primary"
+          @click="importData"
+          :disabled="this.selectionList.length == 0"
+        >
           导入
         </el-button>
       </span>
@@ -160,7 +173,8 @@ export default {
       loading: false,
       data: [],
       feeData: [],
-      selectionList: []
+      selectionList: [],
+      reData: null
     };
   },
   props: {
@@ -237,6 +251,13 @@ export default {
     selectionChange(list) {
       this.selectionList = list;
     },
+    rePick(row, index) {
+      this.reData = {
+        ...row,
+        index: index
+      };
+      this.rowAdd();
+    },
     //费用编辑
     rowCell(row, index) {
       if (row.$cellEdit == true) {
@@ -282,24 +303,49 @@ export default {
       this.treeDeptId = null;
       this.loading = false;
       this.data = [];
-      this.selectionList = [];
+      this.reData = null;
     },
     importData() {
-      this.selectionList.forEach(e => {
-        this.feeData.push({
-          itemId: e.id,
-          corpId: null,
-          feeName: e.cname,
-          price: 0,
-          unit: e.unitno,
-          quantity: 0,
-          amount: 0,
-          currency: e.fcyno,
-          exchangeRate: null,
-          remarks: null,
-          $cellEdit: true
+      if (this.reData) {
+        this.selectionList.length;
+        if (this.selectionList.length != 1) {
+          return this.$message.error("重新选择的时候只能选择一条数据");
+        } else {
+          this.selectionList.forEach(e => {
+            this.feeData.forEach((item, index) => {
+              if (index == this.reData.index) {
+                item.itemId = e.id;
+                item.corpId = this.reData.corpId;
+                item.feeName = e.cname;
+                item.price = this.reData.price;
+                item.unit = e.unitno;
+                item.quantity = this.reData.quantity;
+                item.amount = this.reData.amount;
+                item.currency = e.fcyno;
+                item.exchangeRate = this.reData.exchangeRate;
+                item.remarks = this.reData.remarks;
+                item.$cellEdit = true;
+              }
+            });
+          });
+        }
+      } else {
+        this.selectionList.forEach(e => {
+          this.feeData.push({
+            itemId: e.id,
+            corpId: null,
+            feeName: e.cname,
+            price: 0,
+            unit: e.unitno,
+            quantity: 0,
+            amount: 0,
+            currency: e.fcyno,
+            exchangeRate: null,
+            remarks: null,
+            $cellEdit: true
+          });
         });
-      });
+      }
       this.feeDialog = false;
     },
     submitData() {
@@ -308,7 +354,7 @@ export default {
   },
   watch: {
     orderFeesList: function(rows) {
-      this.feeData = rows?rows:[];
+      this.feeData = rows ? rows : [];
     }
   }
 };

+ 22 - 28
src/router/views/index.js

@@ -298,7 +298,6 @@ export default [{
         path: '/exportTrade/customerInquiry/index',
         name:'报价单',
         meta: {
-          i18n: 'exportTrade/customerInquiry/index',
           keepAlive: true,
         },
         component: () => import( /* webpackChunkName: "views" */ '@/views/exportTrade/customerInquiry/index')
@@ -307,69 +306,65 @@ export default [{
   },
     // 出口 采购询价
     {
-      path: '/exportpurchaseInquiry_detailsPage',
+      path: '/exportTrade/purchaseInquiry/index',
       component: Layout,
       hidden: true,
       children: [
         {
-          path: '/exportpurchaseInquiry_detailsPage',
+          path: '/exportTrade/purchaseInquiry/index',
           name:'采购询价',
           meta: {
-            i18n: 'exportpurchaseInquiry_detailsPage',
             keepAlive: true,
           },
-          component: () => import( /* webpackChunkName: "views" */ '@/views/exportTrade/purchaseInquiry/detailsPage')
+          component: () => import( /* webpackChunkName: "views" */ '@/views/exportTrade/purchaseInquiry/index')
         }
       ]
     },
     // 出口 船务询价
     {
-          path: '/exportshippingInquiry_detailsPage',
+          path: '/exportTrade/shippingInquiry/index',
           component: Layout,
           hidden: true,
           children: [
             {
-              path: '/exportshippingInquiry_detailsPage',
+              path: '/exportTrade/shippingInquiry/index',
               name:'船务询价',
               meta: {
-                i18n: 'exportshippingInquiry_detailsPage',
                 keepAlive: true,
               },
-              component: () => import( /* webpackChunkName: "views" */ '@/views/exportTrade/shippingInquiry/detailsPage')
+              component: () => import( /* webpackChunkName: "views" */ '@/views/exportTrade/shippingInquiry/index')
             }
           ]
         },
-  // 出口 销售订单详情页
+  // 出口 销售订单
   {
-    path: '/exportsalesContract_detailsPage',
+    path: '/exportTrade/salesContract/index',
     component: Layout,
     hidden: true,
     children: [
       {
-        path: '/exportsalesContract_detailsPage',
+        path: '/exportTrade/salesContract/index',
         name:'销售订单',
         meta: {
-          i18n: 'exportsalesContract_detailsPage',
           keepAlive: true,
         },
-        component: () => import( /* webpackChunkName: "views" */ '@/views/exportTrade/salesContract/detailsPage')
+        component: () => import( /* webpackChunkName: "views" */ '@/views/exportTrade/salesContract/index')
       }
     ]
   },
-  // 出口 采购订单详情页
+  // 出口 采购订单
   {
-    path: '/exportPurchaseContract_detailsPage',
+    path: '/exportTrade/purchaseContract/index',
     component: Layout,
     hidden: true,
     children: [
       {
-        path: '/exportPurchaseContract_detailsPage',
+        path: '/exportTrade/purchaseContract/index',
         name:'采购订单',
         meta: {
-          i18n: 'exportPurchaseContract_detailsPage',
           keepAlive: true,
         },
-        component: () => import( /* webpackChunkName: "views" */ '@/views/exportTrade/purchaseContract/detailsPage')
+        component: () => import( /* webpackChunkName: "views" */ '@/views/exportTrade/purchaseContract/index')
       }
     ]
   },
@@ -390,36 +385,35 @@ export default [{
       }
     ]
   },
-  // 出口 收货单详情页
+  // 出口 收货单
   {
-    path: '/exportReceipt_detailsPage',
+    path: '/exportTrade/receipt/index',
     component: Layout,
     hidden: true,
     children: [
       {
-        path: '/exportReceipt_detailsPage',
+        path: '/exportTrade/receipt/index',
         name:"收货单",
         meta: {
-          i18n: 'exportReceipt_detailsPage',
           keepAlive:true,
         },
-        component: () => import( /* webpackChunkName: "views" */ '@/views/exportTrade/receipt/detailsPageEdit')
+        component: () => import( /* webpackChunkName: "views" */ '@/views/exportTrade/receipt/index')
       }
     ]
   },
   // 出口 发货单详情页
   {
-    path: '/exportInvoice_detailsPage',
+    path: '/exportTrade/invoice/index',
     component: Layout,
     hidden: true,
     children: [
       {
-        path: '/exportInvoice_detailsPage',
+        path: '/exportTrade/invoice/index',
         name:"发货单",
         meta: {
-          i18n: 'exportInvoice_detailsPage'
+          keepAlive:true,
         },
-        component: () => import( /* webpackChunkName: "views" */ '@/views/exportTrade/invoice/detailsPageEdit')
+        component: () => import( /* webpackChunkName: "views" */ '@/views/exportTrade/invoice/index')
       }
     ]
   },

+ 12 - 6
src/views/exportTrade/customerInquiry/detailsPage.vue

@@ -487,7 +487,6 @@ export default {
   },
   methods: {
     priceChange(row) {
-      console.log(row);
       if (!row.price) {
         row.price = 0;
       } else {
@@ -507,7 +506,11 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       }).then(() => {
-        saveShipping(this.form.id);
+        saveShipping(this.form.id).then(res => {
+          if (res.data.code == 200) {
+            this.$message.success("生成成功");
+          }
+        });
       });
     },
     savePurchase() {
@@ -516,7 +519,11 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       }).then(() => {
-        savePurchase(this.form.id);
+        savePurchase(this.form.id).then(res => {
+          if (res.data.code == 200) {
+            this.$message.success("生成成功");
+          }
+        });
       });
     },
     rateChange(row) {
@@ -600,9 +607,9 @@ export default {
           this.page.total = data.total;
           this.goodsList = data.records;
           if (this.page.total) {
-            this.goodsOption.height = window.innerHeight - 470;
+            this.goodsOption.height = window.innerHeight - 550;
           } else {
-            this.goodsOption.height = window.innerHeight - 395;
+            this.goodsOption.height = window.innerHeight - 475;
           }
         })
         .finally(() => {
@@ -648,7 +655,6 @@ export default {
               this.data = res.data.data.orderItemsList;
               this.orderFeesList = res.data.data.orderFeesList;
               this.$message.success(this.form.id ? "修改成功" : "提交成功");
-              this.$emit("inRefresh");
             }
           });
         } else {

+ 2 - 8
src/views/exportTrade/customerInquiry/index.vue

@@ -66,13 +66,7 @@
         </template>
       </avue-crud>
     </basic-container>
-    <detail-page
-      ref="detail"
-      @goBack="goBack"
-      @inRefresh="refreshChange"
-      :detailData="detailData"
-      v-else
-    ></detail-page>
+    <detail-page @goBack="goBack" :detailData="detailData" v-else></detail-page>
   </div>
 </template>
 
@@ -197,7 +191,7 @@ export default {
       this.show = false;
     },
     goBack() {
-      this.detailData=this.$options.data().detailData
+      this.detailData = this.$options.data().detailData;
       this.show = true;
     }
   }

+ 15 - 14
src/views/exportTrade/invoice/detailsPageEdit.vue → src/views/exportTrade/invoice/detailsPage.vue

@@ -30,7 +30,7 @@
             <select-component
               v-model="form.corpId"
               :configuration="configuration"
-              :disabled="$route.query.status == 1"
+              :disabled="detailData.status == 1"
             ></select-component>
           </template>
         </avue-form>
@@ -49,7 +49,7 @@
               icon="el-icon-plus"
               size="small"
               @click.stop="newDetails"
-              :disabled="$route.query.status == 1"
+              :disabled="detailData.status == 1"
               >新增明细</el-button
             >
             <el-button
@@ -113,14 +113,14 @@
       <fee-info
         ref="feeInfo"
         :orderFeesList="orderFeesList"
-        :disabled="$route.query.status == 1"
+        :disabled="detailData.status == 1"
         feeUrl="/blade-deliver-goods/deliveryfees/update"
       />
       <upload-file
         ref="uploadFile"
         title="合同附件"
         :orderFilesList="orderFilesList"
-        :disabled="$route.query.status == 1"
+        :disabled="detailData.status == 1"
         delUrl="/blade-deliver-goods/deliveryfiles/update"
       />
     </div>
@@ -377,6 +377,11 @@ export default {
       orderFilesList: []
     };
   },
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
   components: {
     reportDialog,
     feeInfo,
@@ -386,10 +391,10 @@ export default {
     if (this.$route.query.pageType == "Generate") {
       this.getGenerate(JSON.parse(this.$route.query.data));
     }
-    if (this.$route.query.id) {
-      this.getDetail(JSON.parse(this.$route.query.id));
+    if (this.detailData.id) {
+      this.getDetail(this.detailData.id);
     }
-    if (this.$route.query.status == 1) {
+    if (this.detailData.status == 1) {
       this.option.disabled = true;
     }
     let _this = this;
@@ -520,9 +525,9 @@ export default {
         this.goodsList = data.records;
         this.loading = false;
         if (this.page.total) {
-          this.goodsOption.height = window.innerHeight - 470;
+          this.goodsOption.height = window.innerHeight - 550;
         } else {
-          this.goodsOption.height = window.innerHeight - 395;
+          this.goodsOption.height = window.innerHeight - 475;
         }
       });
     },
@@ -582,11 +587,7 @@ export default {
     },
     //返回列表
     backToList() {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportTrade/invoice/index",
-        query: {}
-      });
+      this.$emit("goBack");
     },
     openReport() {
       this.switchDialog = !this.switchDialog;

+ 108 - 77
src/views/exportTrade/invoice/index.vue

@@ -1,65 +1,71 @@
 <template>
-  <basic-container>
-    <avue-crud
-      ref="crud"
-      :option="option"
-      :data="dataList"
-      v-model="form"
-      :page.sync="page"
-      :search.sync="search"
-      @search-change="searchChange"
-      @current-change="currentChange"
-      @size-change="sizeChange"
-      @refresh-change="refreshChange"
-      @on-load="onLoad"
-    >
-      <template slot="menuLeft">
-        <el-button
-          type="primary"
-          icon="el-icon-plus"
-          size="small"
-          @click.stop="newAdd()"
-          >新单</el-button
-        >
-                <el-button type="success" size="small" disabled>复制新单</el-button>
-        <el-button type="info" size="small">报表</el-button>
-      </template>
-      <template slot="corpIdSearch">
-        <select-component
-          v-model="search.corpId"
-          :configuration="configuration"
-        ></select-component>
-      </template>
-      <template slot-scope="scope" slot="menu">
-        <el-button
-          type="text"
-          icon="el-icon-view"
-          size="small"
-          @click.stop="beforeOpenPage(scope.row, 1)"
-          >查看
-        </el-button>
-        <el-button
-          type="text"
-          icon="el-icon-edit"
-          size="small"
-          @click.stop="editOpen(scope.row, 2)"
-          >编辑
-        </el-button>
-        <el-button
-          type="text"
-          icon="el-icon-delete"
-          size="small"
-          @click.stop="rowDel(scope.row, scope.index)"
-          >删除
-        </el-button>
-      </template>
-    </avue-crud>
-  </basic-container>
+  <div>
+    {{ show }}
+    <basic-container v-if="show">
+      <avue-crud
+        ref="crud"
+        :option="option"
+        :data="dataList"
+        v-model="form"
+        :page.sync="page"
+        :search.sync="search"
+        @search-change="searchChange"
+        @current-change="currentChange"
+        @size-change="sizeChange"
+        @refresh-change="refreshChange"
+        @on-load="onLoad"
+        :table-loading="loading"
+      >
+        <template slot="menuLeft">
+          <el-button
+            type="primary"
+            icon="el-icon-plus"
+            size="small"
+            @click.stop="newAdd()"
+            >新单</el-button
+          >
+          <el-button type="success" size="small" disabled>复制新单</el-button>
+          <el-button type="info" size="small">报表</el-button>
+        </template>
+        <template slot="corpIdSearch">
+          <select-component
+            v-model="search.corpId"
+            :configuration="configuration"
+          ></select-component>
+        </template>
+        <template slot-scope="scope" slot="menu">
+          <el-button
+            type="text"
+            icon="el-icon-view"
+            size="small"
+            @click.stop="beforeOpenPage(scope.row, 1)"
+            >查看
+          </el-button>
+          <el-button
+            type="text"
+            icon="el-icon-edit"
+            size="small"
+            @click.stop="editOpen(scope.row, 2)"
+            >编辑
+          </el-button>
+          <el-button
+            type="text"
+            icon="el-icon-delete"
+            size="small"
+            @click.stop="rowDel(scope.row, scope.index)"
+            >删除
+          </el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+    <detail-page @goBack="goBack" :detailData="detailData" v-else></detail-page>
+  </div>
 </template>
 
 <script>
 import option from "./config/mainList.json";
 import { getList, remove } from "@/api/basicData/invoice";
+import detailPage from "./detailsPage.vue";
 
 export default {
   name: "customerInformation",
@@ -81,10 +87,17 @@ export default {
         pageSize: 10,
         currentPage: 1,
         total: 0
-      }
+      },
+      show: true,
+      detailData: {},
+      loading: false
     };
   },
+  components: { detailPage },
   created() {
+    if (this.$route.query.pageType == "Generate") {
+      this.newAdd();
+    }
     let _this = this;
     this.option.column.forEach(e => {
       if (e.prop == "exchangeRate") {
@@ -105,6 +118,14 @@ export default {
       }
     });
   },
+  activated() {
+    //当页面已打开并无法重新渲染时,用activated重新激活keepalive组件
+    setTimeout(() => {
+      if (this.$route.query.pageType == "Generate"&&this.show) {
+        this.newAdd();
+      }
+    }, 100);
+  },
   methods: {
     //删除列表后面的删除按钮触发触发(row, index, done)
     rowDel(row, index, done) {
@@ -124,18 +145,18 @@ export default {
     },
     //查看跳转页面
     beforeOpenPage(row, status) {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportInvoice_detailsPage",
-        query: { id: JSON.stringify(row.id), status: status }
-      });
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
     },
     editOpen(row, status) {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportInvoice_detailsPage",
-        query: { id: JSON.stringify(row.id), status: status }
-      });
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
     },
     //点击搜索按钮触发
     searchChange(params, done) {
@@ -151,24 +172,34 @@ export default {
       this.page.pageSize = val;
     },
     onLoad(page, params) {
-      getList(page.currentPage, page.pageSize, params).then(res => {
-        this.dataList = res.data.data.records ? res.data.data.records : [];
-        this.page.total = res.data.data.total;
-        if (this.page.total) {
-          this.option.height = window.innerHeight - 435;
-        } else {
-          this.option.height = window.innerHeight - 360;
-        }
-      });
+      this.loading = true;
+      getList(page.currentPage, page.pageSize, params)
+        .then(res => {
+          this.dataList = res.data.data.records ? res.data.data.records : [];
+          this.page.total = res.data.data.total;
+          if (this.page.total) {
+            this.option.height = window.innerHeight - 435;
+          } else {
+            this.option.height = window.innerHeight - 360;
+          }
+        })
+        .finally(() => {
+          this.loading = false;
+        });
     },
     refreshChange() {
       this.onLoad(this.page, this.search);
     },
     newAdd() {
+      this.show = false;
+    },
+    goBack() {
       this.$router.$avueRouter.closeTag();
+      this.detailData = this.$options.data().detailData;
       this.$router.push({
-        path: "/exportInvoice_detailsPage"
+        path: "/exportTrade/invoice/index"
       });
+      this.show = true;
     }
   }
 };

+ 17 - 16
src/views/exportTrade/purchaseContract/detailsPage.vue

@@ -29,7 +29,7 @@
             <select-component
               v-model="form.corpId"
               :configuration="configuration"
-              :disabled="$route.query.status == 1"
+              :disabled="detailData.status == 1"
             ></select-component>
           </template>
           <template slot="exchangeRate">
@@ -39,7 +39,7 @@
               oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
               @change="rateChange"
               placeholder="请输入 汇率"
-              :disabled="$route.query.status == 1"
+              :disabled="detailData.status == 1"
               ><template slot="append">%</template></el-input
             >
           </template>
@@ -81,7 +81,7 @@
                 icon="el-icon-plus"
                 size="small"
                 @click.stop="newDetails"
-                :disabled="$route.query.status == 1"
+                :disabled="detailData.status == 1"
                 >新增明细</el-button
               >
               <el-button
@@ -109,14 +109,14 @@
       <fee-info
         ref="feeInfo"
         :orderFeesList="orderFeesList"
-        :disabled="$route.query.status == 1"
+        :disabled="detailData.status == 1"
         feeUrl="/trade-purchase/purchase-order/removeByFees"
       />
       <upload-file
         ref="uploadFile"
         title="合同附件"
         :orderFilesList="orderFilesList"
-        :disabled="$route.query.status == 1"
+        :disabled="detailData.status == 1"
         delUrl="/trade-purchase/purchase-order/removeByFiles"
       />
       <div>
@@ -455,16 +455,21 @@ export default {
       orderItemIds: []
     };
   },
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
   components: {
     reportDialog,
     feeInfo,
     uploadFile
   },
   created() {
-    if (this.$route.query.id) {
-      this.getDetail(JSON.parse(this.$route.query.id));
+    if (this.detailData.id) {
+      this.getDetail(this.detailData.id);
     }
-    if (this.$route.query.status == 1) {
+    if (this.detailData.status == 1) {
       this.option.disabled = true;
       this.bankOption.disabled = true;
       this.insuranceOption.disabled = true;
@@ -598,10 +603,10 @@ export default {
         this.page.total = data.total;
         this.goodsList = data.records;
         this.loading = false;
-        if (this.page.total) {
-          this.goodsOption.height = window.innerHeight - 470;
+       if (this.page.total) {
+          this.goodsOption.height = window.innerHeight - 550;
         } else {
-          this.goodsOption.height = window.innerHeight - 395;
+          this.goodsOption.height = window.innerHeight - 475;
         }
       });
     },
@@ -658,11 +663,7 @@ export default {
     },
     //返回列表
     backToList() {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportTrade/purchaseContract/index",
-        query: {}
-      });
+      this.$emit("goBack");
     },
     openReport() {
       this.switchDialog = !this.switchDialog;

+ 122 - 110
src/views/exportTrade/purchaseContract/index.vue

@@ -1,92 +1,97 @@
 <template>
-  <basic-container>
-    <avue-crud
-      ref="crud"
-      :option="option"
-      :data="dataList"
-      v-model="form"
-      :page.sync="page"
-      :search.sync="search"
-      @search-change="searchChange"
-      @current-change="currentChange"
-      @size-change="sizeChange"
-      @refresh-change="refreshChange"
-      @on-load="onLoad"
-    >
-      <template slot="menuLeft">
-        <el-button
-          type="primary"
-          icon="el-icon-plus"
-          size="small"
-          @click.stop="newAdd()"
-          >新单</el-button
-        >
-        <el-button type="success" size="small" disabled>复制新单</el-button>
-        <el-button type="info" size="small">报表</el-button>
-      </template>
-      <template slot="corpIdSearch">
-        <select-component
-          v-model="search.corpId"
-          :configuration="configuration"
-        ></select-component>
-      </template>
-      <template slot="businesDateSearch">
-        <el-date-picker
-          v-model="search.businesDate"
-          type="daterange"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-          format="yyyy-MM-dd"
-          value-format="yyyy-MM-dd HH:mm:ss"
-          :default-time="['00:00:00', '23:59:59']"
-        >
-        </el-date-picker>
-      </template>
-      <template slot="requiredDeliveryDateSearch">
-        <el-date-picker
-          v-model="search.requiredDeliveryDate"
-          type="daterange"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-          format="yyyy-MM-dd"
-          value-format="yyyy-MM-dd HH:mm:ss"
-          :default-time="['00:00:00', '23:59:59']"
-        >
-        </el-date-picker>
-      </template>
-      <template slot-scope="scope" slot="corpId">
-        {{ scope.row.corpsName }}
-      </template>
-      <template slot-scope="scope" slot="menu">
-        <el-button
-          type="text"
-          icon="el-icon-view"
-          size="small"
-          @click.stop="beforeOpenPage(scope.row, 1)"
-          >查看
-        </el-button>
-        <el-button
-          type="text"
-          icon="el-icon-edit"
-          size="small"
-          @click.stop="editOpen(scope.row, 2)"
-          >编辑
-        </el-button>
-        <el-button
-          type="text"
-          icon="el-icon-delete"
-          size="small"
-          @click.stop="rowDel(scope.row, scope.index)"
-          >删除
-        </el-button>
-      </template>
-    </avue-crud>
-  </basic-container>
+  <div>
+    <basic-container v-if="show">
+      <avue-crud
+        ref="crud"
+        :option="option"
+        :data="dataList"
+        v-model="form"
+        :page.sync="page"
+        :search.sync="search"
+        @search-change="searchChange"
+        @current-change="currentChange"
+        @size-change="sizeChange"
+        @refresh-change="refreshChange"
+        @on-load="onLoad"
+        :table-loading="loading"
+      >
+        <template slot="menuLeft">
+          <el-button
+            type="primary"
+            icon="el-icon-plus"
+            size="small"
+            @click.stop="newAdd()"
+            >新单</el-button
+          >
+          <el-button type="success" size="small" disabled>复制新单</el-button>
+          <el-button type="info" size="small">报表</el-button>
+        </template>
+        <template slot="corpIdSearch">
+          <select-component
+            v-model="search.corpId"
+            :configuration="configuration"
+          ></select-component>
+        </template>
+        <template slot="businesDateSearch">
+          <el-date-picker
+            v-model="search.businesDate"
+            type="daterange"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            format="yyyy-MM-dd"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            :default-time="['00:00:00', '23:59:59']"
+          >
+          </el-date-picker>
+        </template>
+        <template slot="requiredDeliveryDateSearch">
+          <el-date-picker
+            v-model="search.requiredDeliveryDate"
+            type="daterange"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            format="yyyy-MM-dd"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            :default-time="['00:00:00', '23:59:59']"
+          >
+          </el-date-picker>
+        </template>
+        <template slot-scope="scope" slot="corpId">
+          {{ scope.row.corpsName }}
+        </template>
+        <template slot-scope="scope" slot="menu">
+          <el-button
+            type="text"
+            icon="el-icon-view"
+            size="small"
+            @click.stop="beforeOpenPage(scope.row, 1)"
+            >查看
+          </el-button>
+          <el-button
+            type="text"
+            icon="el-icon-edit"
+            size="small"
+            @click.stop="editOpen(scope.row, 2)"
+            >编辑
+          </el-button>
+          <el-button
+            type="text"
+            icon="el-icon-delete"
+            size="small"
+            @click.stop="rowDel(scope.row, scope.index)"
+            >删除
+          </el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+    <detail-page @goBack="goBack" :detailData="detailData" v-else></detail-page>
+  </div>
 </template>
 
 <script>
 import option from "./config/mainList.json";
 import { getList, remove } from "@/api/exportTrade/purchaseContract";
+import detailPage from "./detailsPage.vue";
 
 export default {
   name: "customerInformation",
@@ -108,9 +113,13 @@ export default {
         pageSize: 10,
         currentPage: 1,
         total: 0
-      }
+      },
+      show: true,
+      detailData: {},
+      loading: false
     };
   },
+  components: { detailPage },
   created() {
     let _this = this;
     this.option.column.forEach(e => {
@@ -151,18 +160,18 @@ export default {
     },
     //查看跳转页面
     beforeOpenPage(row, status) {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportpurchaseContract_detailsPage",
-        query: { id: JSON.stringify(row.id), status: status }
-      });
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
     },
     editOpen(row, status) {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportpurchaseContract_detailsPage",
-        query: { id: JSON.stringify(row.id), status: status }
-      });
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
     },
     //点击搜索按钮触发
     searchChange(params, done) {
@@ -188,27 +197,30 @@ export default {
       this.page.pageSize = val;
     },
     onLoad(page, params) {
-      getList(page.currentPage, page.pageSize, params).then(res => {
-        this.dataList = res.data.data.records ? res.data.data.records : [];
-        this.page.total = res.data.data.total;
-        if (this.page.total) {
-          this.option.height = window.innerHeight - 380;
-        } else {
-          this.option.height = window.innerHeight - 305;
-        }
-      });
+      this.loading = true;
+      getList(page.currentPage, page.pageSize, params)
+        .then(res => {
+          this.dataList = res.data.data.records ? res.data.data.records : [];
+          this.page.total = res.data.data.total;
+          if (this.page.total) {
+            this.option.height = window.innerHeight - 380;
+          } else {
+            this.option.height = window.innerHeight - 305;
+          }
+        })
+        .finally(() => {
+          this.loading = false;
+        });
     },
     refreshChange() {
       this.onLoad(this.page, this.search);
     },
     newAdd() {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportpurchaseContract_detailsPage",
-        query:{
-          pageType:'new'
-        }
-      });
+      this.show = false;
+    },
+    goBack() {
+      this.detailData = this.$options.data().detailData;
+      this.show = true;
     }
   }
 };

+ 14 - 10
src/views/exportTrade/purchaseInquiry/detailsPage.vue

@@ -414,12 +414,20 @@ export default {
       treeDeptId: null
     };
   },
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
   components: {
     reportDialog
   },
   created() {
-    if (this.$route.query.id) {
-      this.getDetail(JSON.parse(this.$route.query.id));
+    if (this.detailData.id) {
+      this.getDetail(this.detailData.id);
+    }
+    if (this.detailData.status == 1) {
+      this.option.disabled = true;
     }
     let _this = this;
     this.tableOption.column.forEach(e => {
@@ -536,10 +544,10 @@ export default {
         this.page.total = data.total;
         this.goodsList = data.records;
         this.loading = false;
-        if (this.page.total) {
-          this.goodsOption.height = window.innerHeight - 470;
+       if (this.page.total) {
+          this.goodsOption.height = window.innerHeight - 550;
         } else {
-          this.goodsOption.height = window.innerHeight - 395;
+          this.goodsOption.height = window.innerHeight - 475;
         }
       });
     },
@@ -573,11 +581,7 @@ export default {
     },
     //返回列表
     backToList() {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportTrade/purchaseInquiry/index",
-        query: {}
-      });
+      this.$emit("goBack");
     },
     openReport() {
       this.switchDialog = !this.switchDialog;

+ 98 - 84
src/views/exportTrade/purchaseInquiry/index.vue

@@ -1,66 +1,71 @@
 <template>
-  <basic-container>
-    <avue-crud
-      ref="crud"
-      :option="option"
-      :data="dataList"
-      v-model="form"
-      :page.sync="page"
-      :search.sync="search"
-      @search-change="searchChange"
-      @current-change="currentChange"
-      @size-change="sizeChange"
-      @refresh-change="refreshChange"
-      @on-load="onLoad"
-    >
-      <template slot="menuLeft">
-        <el-button type="info" size="small">报表</el-button>
-      </template>
-      <template slot="corpIdSearch">
-        <select-component
-          v-model="search.corpId"
-          :configuration="configuration"
-        ></select-component>
-      </template>
-      <template slot="portOfLoadSearch">
-        <port-info v-model="search.portOfLoad" />
-      </template>
-      <template slot="portOfDestinationSearch">
-        <port-info v-model="search.portOfDestination" />
-      </template>
-      <template slot-scope="scope" slot="corpId">
-        {{ scope.row.corpName }}
-      </template>
-      <template slot-scope="scope" slot="menu">
-        <el-button
-          type="text"
-          icon="el-icon-view"
-          size="small"
-          @click.stop="beforeOpenPage(scope.row, scope.index)"
-          >查看
-        </el-button>
-        <el-button
-          type="text"
-          icon="el-icon-edit"
-          size="small"
-          @click.stop="editOpen(scope.row, scope.index)"
-          >编辑
-        </el-button>
-        <el-button
-          type="text"
-          icon="el-icon-delete"
-          size="small"
-          @click.stop="rowDel(scope.row, scope.index)"
-          >删除
-        </el-button>
-      </template>
-    </avue-crud>
-  </basic-container>
+  <div>
+    <basic-container v-if="show">
+      <avue-crud
+        ref="crud"
+        :option="option"
+        :data="dataList"
+        v-model="form"
+        :page.sync="page"
+        :search.sync="search"
+        @search-change="searchChange"
+        @current-change="currentChange"
+        @size-change="sizeChange"
+        @refresh-change="refreshChange"
+        @on-load="onLoad"
+        :table-loading="loading"
+      >
+        <template slot="menuLeft">
+          <el-button type="info" size="small">报表</el-button>
+        </template>
+        <template slot="corpIdSearch">
+          <select-component
+            v-model="search.corpId"
+            :configuration="configuration"
+          ></select-component>
+        </template>
+        <template slot="portOfLoadSearch">
+          <port-info v-model="search.portOfLoad" />
+        </template>
+        <template slot="portOfDestinationSearch">
+          <port-info v-model="search.portOfDestination" />
+        </template>
+        <template slot-scope="scope" slot="corpId">
+          {{ scope.row.corpName }}
+        </template>
+        <template slot-scope="scope" slot="menu">
+          <el-button
+            type="text"
+            icon="el-icon-view"
+            size="small"
+            @click.stop="beforeOpenPage(scope.row,1)"
+            >查看
+          </el-button>
+          <el-button
+            type="text"
+            icon="el-icon-edit"
+            size="small"
+            @click.stop="editOpen(scope.row, 2)"
+            >编辑
+          </el-button>
+          <el-button
+            type="text"
+            icon="el-icon-delete"
+            size="small"
+            @click.stop="rowDel(scope.row, scope.index)"
+            >删除
+          </el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+    <detail-page @goBack="goBack" :detailData="detailData" v-else></detail-page>
+  </div>
 </template>
 
 <script>
 import option from "./config/mainList.json";
 import { getList, remove, getPorts } from "@/api/basicData/purchaseInquiry";
+import detailPage from "./detailsPage.vue";
 
 export default {
   name: "customerInformation",
@@ -81,9 +86,13 @@ export default {
         pageSize: 10,
         currentPage: 1,
         total: 0
-      }
+      },
+      show: true,
+      detailData: {},
+      loading: false
     };
   },
+  components: { detailPage },
   created() {
     let _this = this;
     this.option.column.forEach(e => {
@@ -128,19 +137,19 @@ export default {
       });
     },
     //查看跳转页面
-    beforeOpenPage(row, index) {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportpurchaseInquiry_detailsPage",
-        query: { id: JSON.stringify(row.id) }
-      });
+    beforeOpenPage(row,status) {
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
     },
-    editOpen(row) {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportpurchaseInquiry_detailsPage",
-        query: { id: JSON.stringify(row.id) }
-      });
+    editOpen(row,status) {
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
     },
     //点击搜索按钮触发
     searchChange(params, done) {
@@ -156,25 +165,30 @@ export default {
       this.page.pageSize = val;
     },
     onLoad(page, params) {
-      console.log(this.search);
-      getList(page.currentPage, page.pageSize, params).then(res => {
-        this.dataList = res.data.data.records ? res.data.data.records : [];
-        this.page.total = res.data.data.total;
-        if (this.page.total) {
-          this.option.height = window.innerHeight - 380;
-        } else {
-          this.option.height = window.innerHeight - 305;
-        }
-      });
+      this.loading = true;
+      getList(page.currentPage, page.pageSize, params)
+        .then(res => {
+          this.dataList = res.data.data.records ? res.data.data.records : [];
+          this.page.total = res.data.data.total;
+          if (this.page.total) {
+            this.option.height = window.innerHeight - 380;
+          } else {
+            this.option.height = window.innerHeight - 305;
+          }
+        })
+        .finally(() => {
+          this.loading = false;
+        });
     },
     refreshChange() {
       this.onLoad(this.page, this.search);
     },
     newAdd() {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportpurchaseInquiry_detailsPage"
-      });
+      this.show = false;
+    },
+    goBack() {
+      this.detailData = this.$options.data().detailData;
+      this.show = true;
     }
   }
 };

+ 17 - 26
src/views/exportTrade/receipt/detailsPageEdit.vue → src/views/exportTrade/receipt/detailsPage.vue

@@ -30,7 +30,7 @@
             <select-component
               v-model="form.corpId"
               :configuration="configuration"
-              :disabled="$route.query.status == 1"
+              :disabled="detailData.status == 1"
             ></select-component>
           </template>
         </avue-form>
@@ -49,7 +49,7 @@
               icon="el-icon-plus"
               size="small"
               @click.stop="newDetails"
-              :disabled="$route.query.status == 1"
+              :disabled="detailData.status == 1"
               >新增明细</el-button
             >
             <el-button
@@ -113,14 +113,14 @@
       <fee-info
         ref="feeInfo"
         :orderFeesList="orderFeesList"
-        :disabled="$route.query.status == 1"
+        :disabled="detailData.status == 1"
         feeUrl="/blade-deliver-goods/deliveryfees/update"
       />
       <upload-file
         ref="uploadFile"
         title="合同附件"
         :orderFilesList="orderFilesList"
-        :disabled="$route.query.status == 1"
+        :disabled="detailData.status == 1"
         delUrl="/blade-deliver-goods/deliveryfiles/update"
       />
     </div>
@@ -360,19 +360,21 @@ export default {
       orderFilesList: []
     };
   },
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
   components: {
     reportDialog,
     feeInfo,
     uploadFile
   },
   created() {
-    if (this.$route.query.pageType == "Generate") {
-      this.getGenerate(JSON.parse(this.$route.query.data));
-    }
-    if (this.$route.query.id) {
-      this.getDetail(JSON.parse(this.$route.query.id));
+    if (this.detailData.id) {
+      this.getDetail(this.detailData.id);
     }
-    if (this.$route.query.status == 1) {
+    if (this.detailData.status == 1) {
       this.option.disabled = true;
     }
     let _this = this;
@@ -472,7 +474,7 @@ export default {
           price: 0,
           contractAmount: 0,
           taxRate: 0,
-          unit:e.unit,
+          unit: e.unit,
           remarks: null,
           $cellEdit: true
         });
@@ -502,10 +504,10 @@ export default {
         this.page.total = data.total;
         this.goodsList = data.records;
         this.loading = false;
-        if (this.page.total) {
-          this.goodsOption.height = window.innerHeight - 470;
+         if (this.page.total) {
+          this.goodsOption.height = window.innerHeight - 550;
         } else {
-          this.goodsOption.height = window.innerHeight - 395;
+          this.goodsOption.height = window.innerHeight - 475;
         }
       });
     },
@@ -522,13 +524,6 @@ export default {
         this.configuration.dicData = this.form.corpName;
       });
     },
-    getGenerate(data) {
-      console.log(data);
-      this.form = data;
-      this.data = data.orderItemsList;
-      this.orderFeesList = data.deliveryFeesList;
-      this.configuration.dicData = data.corpName;
-    },
     //修改提交触发
     editCustomer() {
       this.$refs["form"].validate((valid, done) => {
@@ -562,11 +557,7 @@ export default {
     },
     //返回列表
     backToList() {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportTrade/receipt/index",
-        query: {}
-      });
+      this.$emit("goBack");
     },
     openReport() {
       this.switchDialog = !this.switchDialog;

+ 94 - 80
src/views/exportTrade/receipt/index.vue

@@ -1,65 +1,70 @@
 <template>
-  <basic-container>
-    <avue-crud
-      ref="crud"
-      :option="option"
-      :data="dataList"
-      v-model="form"
-      :page.sync="page"
-      :search.sync="search"
-      @search-change="searchChange"
-      @current-change="currentChange"
-      @size-change="sizeChange"
-      @refresh-change="refreshChange"
-      @on-load="onLoad"
-    >
-      <template slot="menuLeft">
-        <el-button
-          type="primary"
-          icon="el-icon-plus"
-          size="small"
-          @click.stop="newAdd()"
-          >新单</el-button
-        >
-        <el-button type="success" size="small" disabled>复制新单</el-button>
-        <el-button type="info" size="small">报表</el-button>
-      </template>
-      <template slot="corpIdSearch">
-        <select-component
-          v-model="search.corpId"
-          :configuration="configuration"
-        ></select-component>
-      </template>
-      <template slot-scope="scope" slot="menu">
-        <el-button
-          type="text"
-          icon="el-icon-view"
-          size="small"
-          @click.stop="beforeOpenPage(scope.row, 1)"
-          >查看
-        </el-button>
-        <el-button
-          type="text"
-          icon="el-icon-edit"
-          size="small"
-          @click.stop="editOpen(scope.row, 2)"
-          >编辑
-        </el-button>
-        <el-button
-          type="text"
-          icon="el-icon-delete"
-          size="small"
-          @click.stop="rowDel(scope.row, scope.index)"
-          >删除
-        </el-button>
-      </template>
-    </avue-crud>
-  </basic-container>
+  <div>
+    <basic-container v-if="show">
+      <avue-crud
+        ref="crud"
+        :option="option"
+        :data="dataList"
+        v-model="form"
+        :page.sync="page"
+        :search.sync="search"
+        @search-change="searchChange"
+        @current-change="currentChange"
+        @size-change="sizeChange"
+        @refresh-change="refreshChange"
+        @on-load="onLoad"
+        :table-loading="loading"
+      >
+        <template slot="menuLeft">
+          <el-button
+            type="primary"
+            icon="el-icon-plus"
+            size="small"
+            @click.stop="newAdd()"
+            >新单</el-button
+          >
+          <el-button type="success" size="small" disabled>复制新单</el-button>
+          <el-button type="info" size="small">报表</el-button>
+        </template>
+        <template slot="corpIdSearch">
+          <select-component
+            v-model="search.corpId"
+            :configuration="configuration"
+          ></select-component>
+        </template>
+        <template slot-scope="scope" slot="menu">
+          <el-button
+            type="text"
+            icon="el-icon-view"
+            size="small"
+            @click.stop="beforeOpenPage(scope.row, 1)"
+            >查看
+          </el-button>
+          <el-button
+            type="text"
+            icon="el-icon-edit"
+            size="small"
+            @click.stop="editOpen(scope.row, 2)"
+            >编辑
+          </el-button>
+          <el-button
+            type="text"
+            icon="el-icon-delete"
+            size="small"
+            @click.stop="rowDel(scope.row, scope.index)"
+            >删除
+          </el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+    <detail-page @goBack="goBack" :detailData="detailData" v-else></detail-page>
+  </div>
 </template>
 
 <script>
 import option from "./config/mainList.json";
 import { getList, remove } from "@/api/exportTrade/receipt";
+import detailPage from "./detailsPage.vue";
 
 export default {
   name: "customerInformation",
@@ -81,9 +86,13 @@ export default {
         pageSize: 10,
         currentPage: 1,
         total: 0
-      }
+      },
+      show: true,
+      detailData: {},
+      loading: false
     };
   },
+  components: { detailPage },
   created() {
     let _this = this;
     this.option.column.forEach(e => {
@@ -124,18 +133,18 @@ export default {
     },
     //查看跳转页面
     beforeOpenPage(row, status) {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportReceipt_detailsPage",
-        query: { id: JSON.stringify(row.id), status: status }
-      });
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
     },
     editOpen(row, status) {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportReceipt_detailsPage",
-        query: { id: JSON.stringify(row.id), status: status }
-      });
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
     },
     //点击搜索按钮触发
     searchChange(params, done) {
@@ -151,24 +160,29 @@ export default {
       this.page.pageSize = val;
     },
     onLoad(page, params) {
-      getList(page.currentPage, page.pageSize, params).then(res => {
-        this.dataList = res.data.data.records ? res.data.data.records : [];
-        this.page.total = res.data.data.total;
-        if (this.page.total) {
-          this.option.height = window.innerHeight - 435;
-        } else {
-          this.option.height = window.innerHeight - 360;
-        }
-      });
+      getList(page.currentPage, page.pageSize, params)
+        .then(res => {
+          this.dataList = res.data.data.records ? res.data.data.records : [];
+          this.page.total = res.data.data.total;
+          if (this.page.total) {
+            this.option.height = window.innerHeight - 435;
+          } else {
+            this.option.height = window.innerHeight - 360;
+          }
+        })
+        .finally(() => {
+          this.loading = false;
+        });
     },
     refreshChange() {
       this.onLoad(this.page, this.search);
     },
     newAdd() {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportReceipt_detailsPage"
-      });
+      this.show = false;
+    },
+    goBack() {
+      this.detailData = this.$options.data().detailData;
+      this.show = true;
     }
   }
 };

+ 22 - 20
src/views/exportTrade/salesContract/detailsPage.vue

@@ -28,20 +28,20 @@
           <template slot="portOfLoad">
             <port-info
               v-model="form.portOfLoad"
-              :disabled="$route.query.status == 1"
+              :disabled="detailData.status == 1"
             />
           </template>
           <template slot="portOfDestination">
             <port-info
               v-model="form.portOfDestination"
-              :disabled="$route.query.status == 1"
+              :disabled="detailData.status == 1"
             />
           </template>
           <template slot="corpId">
             <select-component
               v-model="form.corpId"
               :configuration="configuration"
-              :disabled="$route.query.status == 1"
+              :disabled="detailData.status == 1"
             ></select-component>
           </template>
           <template slot="exchangeRate">
@@ -51,7 +51,7 @@
               oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
               @change="rateChange"
               placeholder="请输入 汇率"
-              :disabled="$route.query.status == 1"
+              :disabled="detailData.status == 1"
               ><template slot="append">%</template></el-input
             >
           </template>
@@ -93,7 +93,7 @@
                 icon="el-icon-plus"
                 size="small"
                 @click.stop="newDetails"
-                :disabled="$route.query.status == 1"
+                :disabled="detailData.status == 1"
                 >新增明细</el-button
               >
               <el-button
@@ -107,7 +107,7 @@
                 type="warning"
                 icon="el-icon-plus"
                 size="small"
-                :disabled="$route.query.status == 1 || orderItemIds.length == 0"
+                :disabled="detailData.status == 1 || orderItemIds.length == 0"
                 @click="getInvoice"
                 >生成发货单
               </el-button>
@@ -129,14 +129,14 @@
       <fee-info
         ref="feeInfo"
         :orderFeesList="orderFeesList"
-        :disabled="$route.query.status == 1"
+        :disabled="detailData.status == 1"
         feeUrl="/blade-purchase-sales/orderfees/update"
       />
       <upload-file
         ref="uploadFile"
         title="合同附件"
         :orderFilesList="orderFilesList"
-        :disabled="$route.query.status == 1"
+        :disabled="detailData.status == 1"
         delUrl="/blade-purchase-sales/orderfiles/update"
       />
       <div>
@@ -522,16 +522,21 @@ export default {
       orderItemIds: []
     };
   },
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
   components: {
     reportDialog,
     feeInfo,
     uploadFile
   },
   created() {
-    if (this.$route.query.id) {
-      this.getDetail(JSON.parse(this.$route.query.id));
+    if (this.detailData.id) {
+      this.getDetail(this.detailData.id);
     }
-    if (this.$route.query.status == 1) {
+    if (this.detailData.status == 1) {
       this.option.disabled = true;
       this.bankOption.disabled = true;
       this.insuranceOption.disabled = true;
@@ -665,10 +670,10 @@ export default {
         this.page.total = data.total;
         this.goodsList = data.records;
         this.loading = false;
-        if (this.page.total) {
-          this.goodsOption.height = window.innerHeight - 470;
+       if (this.page.total) {
+          this.goodsOption.height = window.innerHeight - 550;
         } else {
-          this.goodsOption.height = window.innerHeight - 395;
+          this.goodsOption.height = window.innerHeight - 475;
         }
       });
     },
@@ -722,11 +727,7 @@ export default {
     },
     //返回列表
     backToList() {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportTrade/salesContract/index",
-        query: {}
-      });
+      this.$emit("goBack");
     },
     openReport() {
       this.switchDialog = !this.switchDialog;
@@ -743,6 +744,7 @@ export default {
             const data = res.data.data;
             data.orderItemsList.forEach(e => {
               e.actualQuantity = e.orderQuantity;
+              e.contractAmount=e.amount
               delete e.id;
               delete e.version;
               delete e.status;
@@ -762,7 +764,7 @@ export default {
             delete data.isDeleted;
             delete data.orderStatus;
             this.$router.push({
-              path: "/exportInvoice_detailsPage",
+              path: "/exportTrade/invoice/index",
               query: {
                 pageType: "Generate",
                 data: JSON.stringify(data)

+ 89 - 80
src/views/exportTrade/salesContract/index.vue

@@ -1,75 +1,79 @@
 <template>
-  <basic-container>
-    <avue-crud
-      ref="crud"
-      :option="option"
-      :data="dataList"
-      v-model="form"
-      :page.sync="page"
-      :search.sync="search"
-      @search-change="searchChange"
-      @current-change="currentChange"
-      @size-change="sizeChange"
-      @refresh-change="refreshChange"
-      @on-load="onLoad"
-    >
-      <template slot="menuLeft">
-        <el-button
-          type="primary"
-          icon="el-icon-plus"
-          size="small"
-          @click.stop="newAdd()"
-          >新单</el-button
-        >
-        <el-button type="success" size="small" disabled>复制新单</el-button>
-        <el-button type="info" size="small">报表</el-button>
-      </template>
-      <template slot="corpIdSearch">
-        <select-component
-          v-model="search.corpId"
-          :configuration="configuration"
-        ></select-component>
-      </template>
-      <template slot="portOfLoadSearch">
-        <port-info v-model="search.portOfLoad" />
-      </template>
-      <template slot="portOfDestinationSearch">
-        <port-info v-model="search.portOfDestination" />
-      </template>
+  <div>
+    <basic-container v-if="show">
+      <avue-crud
+        ref="crud"
+        :option="option"
+        :data="dataList"
+        v-model="form"
+        :page.sync="page"
+        :search.sync="search"
+        @search-change="searchChange"
+        @current-change="currentChange"
+        @size-change="sizeChange"
+        @refresh-change="refreshChange"
+        @on-load="onLoad"
+      >
+        <template slot="menuLeft">
+          <el-button
+            type="primary"
+            icon="el-icon-plus"
+            size="small"
+            @click.stop="newAdd()"
+            >新单</el-button
+          >
+          <el-button type="success" size="small" disabled>复制新单</el-button>
+          <el-button type="info" size="small">报表</el-button>
+        </template>
+        <template slot="corpIdSearch">
+          <select-component
+            v-model="search.corpId"
+            :configuration="configuration"
+          ></select-component>
+        </template>
+        <template slot="portOfLoadSearch">
+          <port-info v-model="search.portOfLoad" />
+        </template>
+        <template slot="portOfDestinationSearch">
+          <port-info v-model="search.portOfDestination" />
+        </template>
 
-      <template slot-scope="scope" slot="corpId">
-        {{ scope.row.corpsName }}
-      </template>
-      <template slot-scope="scope" slot="menu">
-        <el-button
-          type="text"
-          icon="el-icon-view"
-          size="small"
-          @click.stop="beforeOpenPage(scope.row, 1)"
-          >查看
-        </el-button>
-        <el-button
-          type="text"
-          icon="el-icon-edit"
-          size="small"
-          @click.stop="editOpen(scope.row, 2)"
-          >编辑
-        </el-button>
-        <el-button
-          type="text"
-          icon="el-icon-delete"
-          size="small"
-          @click.stop="rowDel(scope.row, scope.index)"
-          >删除
-        </el-button>
-      </template>
-    </avue-crud>
-  </basic-container>
+        <template slot-scope="scope" slot="corpId">
+          {{ scope.row.corpsName }}
+        </template>
+        <template slot-scope="scope" slot="menu">
+          <el-button
+            type="text"
+            icon="el-icon-view"
+            size="small"
+            @click.stop="beforeOpenPage(scope.row, 1)"
+            >查看
+          </el-button>
+          <el-button
+            type="text"
+            icon="el-icon-edit"
+            size="small"
+            @click.stop="editOpen(scope.row, 2)"
+            >编辑
+          </el-button>
+          <el-button
+            type="text"
+            icon="el-icon-delete"
+            size="small"
+            @click.stop="rowDel(scope.row, scope.index)"
+            >删除
+          </el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+    <detail-page @goBack="goBack" :detailData="detailData" v-else></detail-page>
+  </div>
 </template>
 
 <script>
 import option from "./config/mainList.json";
 import { getList, remove, getPorts } from "@/api/basicData/salesContract";
+import detailPage from "./detailsPage.vue";
 
 export default {
   name: "customerInformation",
@@ -91,9 +95,13 @@ export default {
         pageSize: 10,
         currentPage: 1,
         total: 0
-      }
+      },
+      show: true,
+      detailData: {},
+      loading: false
     };
   },
+  components: { detailPage },
   created() {
     let _this = this;
     this.option.column.forEach(e => {
@@ -139,18 +147,18 @@ export default {
     },
     //查看跳转页面
     beforeOpenPage(row, status) {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportsalesContract_detailsPage",
-        query: { id: JSON.stringify(row.id), status: status }
-      });
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
     },
     editOpen(row, status) {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportsalesContract_detailsPage",
-        query: { id: JSON.stringify(row.id), status: status }
-      });
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
     },
     //点击搜索按钮触发
     searchChange(params, done) {
@@ -180,10 +188,11 @@ export default {
       this.onLoad(this.page, this.search);
     },
     newAdd() {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportsalesContract_detailsPage"
-      });
+      this.show = false;
+    },
+    goBack() {
+      this.detailData = this.$options.data().detailData;
+      this.show = true;
     }
   }
 };

+ 10 - 11
src/views/exportTrade/shippingInquiry/detailsPage.vue

@@ -373,13 +373,18 @@ export default {
       orderFeesList: []
     };
   },
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
   components: {
     reportDialog,
     feeInfo
   },
   created() {
-    if (this.$route.query.id) {
-      this.getDetail(JSON.parse(this.$route.query.id));
+    if (this.detailData.id) {
+      this.getDetail(this.detailData.id);
     }
     let _this = this;
     this.tableOption.column.forEach(e => {
@@ -408,14 +413,12 @@ export default {
   },
   methods: {
     rateChange(row) {
-      console.log(row);
       if (row >= 100) {
         this.form.exchangeRate = 0;
         this.$message.error("汇率不能超过100%");
       }
     },
     rowSave(row) {
-      console.log(row);
       this.$set(row, "$cellEdit", false);
     },
     importGoods() {
@@ -465,9 +468,9 @@ export default {
         this.goodsList = data.records;
         this.loading = false;
         if (this.page.total) {
-          this.goodsOption.height = window.innerHeight - 470;
+          this.goodsOption.height = window.innerHeight - 550;
         } else {
-          this.goodsOption.height = window.innerHeight - 395;
+          this.goodsOption.height = window.innerHeight - 475;
         }
       });
     },
@@ -509,11 +512,7 @@ export default {
     },
     //返回列表
     backToList() {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportTrade/shippingInquiry/index",
-        query: {}
-      });
+      this.$emit("goBack");
     },
     onClose(val) {
       this.switchDialog = val;

+ 75 - 68
src/views/exportTrade/shippingInquiry/index.vue

@@ -1,59 +1,63 @@
 <template>
-  <basic-container>
-    <avue-crud
-      ref="crud"
-      :option="option"
-      :data="dataList"
-      v-model="form"
-      :page.sync="page"
-      :search.sync="search"
-      @search-change="searchChange"
-      @current-change="currentChange"
-      @size-change="sizeChange"
-      @refresh-change="refreshChange"
-      @on-load="onLoad"
-    >
-      <template slot="menuLeft">
-        <el-button type="info" size="small">报表</el-button>
-      </template>
-      <template slot="corpIdSearch">
-        <select-component
-          v-model="search.corpId"
-          :configuration="configuration"
-        ></select-component>
-      </template>
-      <template slot="portOfLoadSearch">
-        <port-info v-model="search.portOfLoad" />
-      </template>
-      <template slot="portOfDestinationSearch">
-        <port-info v-model="search.portOfDestination" />
-      </template>
-      <template slot-scope="scope" slot="corpId">
-        {{ scope.row.corpName }}
-      </template>
-      <template slot-scope="scope" slot="menu">
-        <el-button
-          type="text"
-          icon="el-icon-view"
-          size="small"
-          @click.stop="beforeOpenPage(scope.row, scope.index)"
-          >查看
-        </el-button>
-        <el-button
-          type="text"
-          icon="el-icon-edit"
-          size="small"
-          @click.stop="editOpen(scope.row, scope.index)"
-          >编辑
-        </el-button>
-      </template>
-    </avue-crud>
-  </basic-container>
+  <div>
+    <basic-container v-if="show">
+      <avue-crud
+        ref="crud"
+        :option="option"
+        :data="dataList"
+        v-model="form"
+        :page.sync="page"
+        :search.sync="search"
+        @search-change="searchChange"
+        @current-change="currentChange"
+        @size-change="sizeChange"
+        @refresh-change="refreshChange"
+        @on-load="onLoad"
+      >
+        <template slot="menuLeft">
+          <el-button type="info" size="small">报表</el-button>
+        </template>
+        <template slot="corpIdSearch">
+          <select-component
+            v-model="search.corpId"
+            :configuration="configuration"
+          ></select-component>
+        </template>
+        <template slot="portOfLoadSearch">
+          <port-info v-model="search.portOfLoad" />
+        </template>
+        <template slot="portOfDestinationSearch">
+          <port-info v-model="search.portOfDestination" />
+        </template>
+        <template slot-scope="scope" slot="corpId">
+          {{ scope.row.corpName }}
+        </template>
+        <template slot-scope="scope" slot="menu">
+          <el-button
+            type="text"
+            icon="el-icon-view"
+            size="small"
+            @click.stop="beforeOpenPage(scope.row, 1)"
+            >查看
+          </el-button>
+          <el-button
+            type="text"
+            icon="el-icon-edit"
+            size="small"
+            @click.stop="editOpen(scope.row, 2)"
+            >编辑
+          </el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+    <detail-page @goBack="goBack" :detailData="detailData" v-else></detail-page>
+  </div>
 </template>
 
 <script>
 import option from "./config/mainList.json";
 import { getList, getPorts } from "@/api/basicData/shippingInquiry";
+import detailPage from "./detailsPage.vue";
 
 export default {
   name: "customerInformation",
@@ -74,9 +78,13 @@ export default {
         pageSize: 10,
         currentPage: 1,
         total: 0
-      }
+      },
+      show: true,
+      detailData: {},
+      loading: false
     };
   },
+  components: { detailPage },
   created() {
     let _this = this;
     this.option.column.forEach(e => {
@@ -105,19 +113,19 @@ export default {
   },
   methods: {
     //查看跳转页面
-    beforeOpenPage(row, index) {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportshippingInquiry_detailsPage",
-        query: { id: JSON.stringify(row.id) }
-      });
+    beforeOpenPage(row, status) {
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
     },
-    editOpen(row) {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportshippingInquiry_detailsPage",
-        query: { id: JSON.stringify(row.id) }
-      });
+    editOpen(row, status) {
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
     },
     //点击搜索按钮触发
     searchChange(params, done) {
@@ -145,12 +153,11 @@ export default {
     },
     refreshChange() {
       this.onLoad(this.page, this.search);
+    },
+    goBack() {
+      this.detailData = this.$options.data().detailData;
+      this.show = true;
     }
-    // newAdd() {
-    //   this.$router.push({
-    //     path: "/exportshippingInquiry_detailsPage"
-    //   });
-    // }
   }
 };
 </script>