QuKatie 3 лет назад
Родитель
Сommit
096e1c5e11

+ 4 - 4
src/router/views/index.js

@@ -290,18 +290,18 @@ export default [{
   },
    // 出口 客户询价
    {
-    path: '/exportcustomerInquiry_detailsPage',
+    path: '/exportTrade/customerInquiry/index',
     component: Layout,
     hidden: true,
     children: [
       {
-        path: '/exportcustomerInquiry_detailsPage',
+        path: '/exportTrade/customerInquiry/index',
         name:'报价单',
         meta: {
-          i18n: 'exportcustomerInquiry_detailsPage',
+          i18n: 'exportTrade/customerInquiry/index',
           keepAlive: true,
         },
-        component: () => import( /* webpackChunkName: "views" */ '@/views/exportTrade/customerInquiry/detailsPage')
+        component: () => import( /* webpackChunkName: "views" */ '@/views/exportTrade/customerInquiry/index')
       }
     ]
   },

+ 32 - 27
src/views/exportTrade/customerInquiry/detailsPage.vue

@@ -29,20 +29,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">
@@ -52,7 +52,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>
@@ -72,7 +72,7 @@
               icon="el-icon-plus"
               size="small"
               @click.stop="newDetails"
-              :disabled="$route.query.status == 1"
+              :disabled="detailData.status == 1"
               >新增明细</el-button
             >
             <el-button
@@ -86,14 +86,14 @@
               type="info"
               size="small"
               @click.stop="savePurchase"
-              :disabled="$route.query.status == 1"
+              :disabled="detailData.status == 1"
               >采购询价</el-button
             >
             <el-button
               type="info"
               size="small"
               @click.stop="saveShipping"
-              :disabled="$route.query.status == 1"
+              :disabled="detailData.status == 1"
               >船务询价</el-button
             >
           </template>
@@ -132,7 +132,7 @@
       <fee-info
         ref="feeInfo"
         :orderFeesList="orderFeesList"
-        :disabled="$route.query.status == 1"
+        :disabled="detailData.status == 1"
         feeUrl="/blade-purchase-sales/orderfees/update"
       />
     </div>
@@ -444,15 +444,20 @@ 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);
     }
-    if (this.$route.query.status == 1) {
+    if (this.detailData.status == 1) {
       this.option.disabled = true;
     }
     let _this = this;
@@ -589,17 +594,20 @@ export default {
     //费用查询
     onLoad(page, params = {}) {
       this.loading = true;
-      getGoods(page.currentPage, page.pageSize, this.treeDeptId).then(res => {
-        const data = res.data.data;
-        this.page.total = data.total;
-        this.goodsList = data.records;
-        this.loading = false;
-        if (this.page.total) {
-          this.goodsOption.height = window.innerHeight - 470;
-        } else {
-          this.goodsOption.height = window.innerHeight - 395;
-        }
-      });
+      getGoods(page.currentPage, page.pageSize, this.treeDeptId)
+        .then(res => {
+          const data = res.data.data;
+          this.page.total = data.total;
+          this.goodsList = data.records;
+          if (this.page.total) {
+            this.goodsOption.height = window.innerHeight - 470;
+          } else {
+            this.goodsOption.height = window.innerHeight - 395;
+          }
+        })
+        .finally(() => {
+          this.loading = false;
+        });
     },
     //商品明细导入
     newDetails() {
@@ -640,6 +648,7 @@ export default {
               this.data = res.data.data.orderItemsList;
               this.orderFeesList = res.data.data.orderFeesList;
               this.$message.success(this.form.id ? "修改成功" : "提交成功");
+              this.$emit("inRefresh");
             }
           });
         } else {
@@ -649,11 +658,7 @@ export default {
     },
     //返回列表
     backToList() {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportTrade/customerInquiry/index",
-        query: {}
-      });
+      this.$emit("goBack");
     },
     openReport() {
       this.switchDialog = !this.switchDialog;

+ 111 - 98
src/views/exportTrade/customerInquiry/index.vue

@@ -1,74 +1,85 @@
 <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="portOfLoadSearch">
-        <port-info v-model="search.portOfLoad" />
-      </template>
-      <template slot="portOfDestinationSearch">
-        <port-info v-model="search.portOfDestination" />
-      </template>
-      <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="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="portOfLoadSearch">
+          <port-info v-model="search.portOfLoad" />
+        </template>
+        <template slot="portOfDestinationSearch">
+          <port-info v-model="search.portOfDestination" />
+        </template>
+        <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="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
+      ref="detail"
+      @goBack="goBack"
+      @inRefresh="refreshChange"
+      :detailData="detailData"
+      v-else
+    ></detail-page>
+  </div>
 </template>
 
 <script>
 import option from "./config/mainList.json";
-import { getList, remove, getPorts } from "@/api/basicData/customerInquiry";
+import { getList, remove } from "@/api/basicData/customerInquiry";
+import detailPage from "./detailsPage.vue";
 
 export default {
   name: "customerInformation",
@@ -90,9 +101,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 => {
@@ -113,16 +128,8 @@ export default {
         };
       }
     });
-    // getPorts().then(res => {
-    //   this.findObject(this.option.column, "portOfLoad").click =()=>{
-    //     console.log('11111111')
-    //   };
-    //   // this.findObject(this.option.column, "portOfDestination").dicData =
-    //   //   res.data;
-    // });
   },
   methods: {
-    // getOpen
     //删除列表后面的删除按钮触发触发(row, index, done)
     rowDel(row, index, done) {
       this.$confirm("确定删除数据?", {
@@ -141,18 +148,18 @@ export default {
     },
     //查看跳转页面
     beforeOpenPage(row, status) {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportcustomerInquiry_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: "/exportcustomerInquiry_detailsPage",
-        query: { id: JSON.stringify(row.id), status: status }
-      });
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
     },
     //点击搜索按钮触发
     searchChange(params, done) {
@@ -168,24 +175,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;
+          }
+          this.loading = false;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
     },
     refreshChange() {
       this.onLoad(this.page, this.search);
     },
     newAdd() {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/exportcustomerInquiry_detailsPage"
-      });
+      this.show = false;
+    },
+    goBack() {
+      this.show = true;
     }
   }
 };