소스 검색

Merge branch 'dev' of git.echepei.com:caojunjie/Smart_platform_ui into dev

caojunjie 3 년 전
부모
커밋
a0fef2c3b4

+ 112 - 110
src/components/iframe/main.vue

@@ -1,129 +1,131 @@
 <template>
   <basic-container>
-    <iframe :src="src"
-            class="iframe"
-            ref="iframe"></iframe>
+    <iframe :src="src" class="iframe" ref="iframe"></iframe>
   </basic-container>
 </template>
 
 <script>
-  import {mapGetters} from "vuex";
-  import NProgress from "nprogress"; // progress bar
-  import "nprogress/nprogress.css"; // progress bar style
-  export default {
-    name: "AvueIframe",
-    data() {
-      return {
-        urlPath: this.getUrlPath() //iframe src 路径
-      };
+import { mapGetters } from "vuex";
+import NProgress from "nprogress"; // progress bar
+import "nprogress/nprogress.css"; // progress bar style
+export default {
+  name: "AvueIframe",
+  data() {
+    return {
+      urlPath: this.getUrlPath() //iframe src 路径
+    };
+  },
+  created() {
+    NProgress.configure({ showSpinner: false });
+  },
+  mounted() {
+    this.load();
+    this.resize();
+  },
+  props: ["routerPath"],
+  watch: {
+    $route: function() {
+      this.load();
     },
-    created() {
-      NProgress.configure({showSpinner: false});
+    routerPath: function() {
+      // 监听routerPath变化,改变src路径
+      this.urlPath = this.getUrlPath();
+    }
+  },
+  computed: {
+    ...mapGetters(["screen"]),
+    src() {
+      return this.$route.query.src
+        ? this.$route.query.src.replace("$", "#")
+        : this.urlPath;
+    }
+  },
+  methods: {
+    // 显示等待框
+    show() {
+      NProgress.start();
     },
-    mounted() {
-      this.load();
-      this.resize();
+    // 隐藏等待狂
+    hide() {
+      NProgress.done();
     },
-    props: ["routerPath"],
-    watch: {
-      $route: function () {
-        this.load();
-      },
-      routerPath: function () {
-        // 监听routerPath变化,改变src路径
-        this.urlPath = this.getUrlPath();
-      }
+    // 加载浏览器窗口变化自适应
+    resize() {
+      window.onresize = () => {
+        this.iframeInit();
+      };
     },
-    computed: {
-      ...mapGetters(["screen"]),
-      src() {
-        return this.$route.query.src
-          ? this.$route.query.src.replace("$", "#")
-          : this.urlPath;
+    // 加载组件
+    load() {
+      this.show();
+      var flag = true; //URL是否包含问号
+      if (
+        this.$route.query.src !== undefined &&
+        this.$route.query.src.indexOf("?") === -1
+      ) {
+        flag = false;
       }
-    },
-    methods: {
-      // 显示等待框
-      show() {
-        NProgress.start();
-      },
-      // 隐藏等待狂
-      hide() {
-        NProgress.done();
-      },
-      // 加载浏览器窗口变化自适应
-      resize() {
-        window.onresize = () => {
-          this.iframeInit();
-        };
-      },
-      // 加载组件
-      load() {
-        this.show();
-        var flag = true; //URL是否包含问号
-        if (this.$route.query.src !== undefined && this.$route.query.src.indexOf("?") === -1) {
-          flag = false;
+      var list = [];
+      for (var key in this.$route.query) {
+        if (key !== "src" && key !== "name" && key !== "i18n") {
+          list.push(`${key}=`+this.$route.query[key]);
         }
-        var list = [];
-        for (var key in this.$route.query) {
-          if (key !== "src" && key !== "name" && key !== "i18n") {
-            list.push(`${key}= this.$route.query[key]`);
-          }
-        }
-        list = list.join("&").toString();
-        if (flag) {
-          this.$route.query.src = `${this.$route.query.src}${
-            list.length > 0 ? `&list` : ""
-          }`;
-        } else {
-          this.$route.query.src = `${this.$route.query.src}${
-            list.length > 0 ? `?list` : ""
-          }`;
-        }
-        //超时3s自动隐藏等待狂,加强用户体验
-        let time = 3;
-        const timeFunc = setInterval(() => {
-          time--;
-          if (time === 0) {
-            this.hide();
-            clearInterval(timeFunc);
-          }
-        }, 1000);
-        this.iframeInit();
-      },
-      //iframe窗口初始化
-      iframeInit() {
-        const iframe = this.$refs.iframe;
-        const clientHeight =
-          document.documentElement.clientHeight - (screen > 1 ? 200 : 130);
-        if (!iframe) return;
-        iframe.style.height = `${clientHeight}px`;
-        if (iframe.attachEvent) {
-          iframe.attachEvent("onload", () => {
-            this.hide();
-          });
-        } else {
-          iframe.onload = () => {
-            this.hide();
-          };
+      }
+      
+      list = list.join("&").toString();
+      if (flag) {
+        this.$route.query.src = `${this.$route.query.src}${
+          list.length > 0 ? `&`+list: ""
+        }`;
+      } else {
+        this.$route.query.src = `${this.$route.query.src}${
+          list.length > 0 ? `?list` : ""
+        }`;
+      }
+      //超时3s自动隐藏等待狂,加强用户体验
+      let time = 3;
+      const timeFunc = setInterval(() => {
+        time--;
+        if (time === 0) {
+          this.hide();
+          clearInterval(timeFunc);
         }
-      },
-      getUrlPath: function () {
-        //获取 iframe src 路径
-        let url = window.location.href;
-        url = url.replace("/myiframe", "");
-        return url;
+      }, 1000);
+      this.iframeInit();
+    },
+    //iframe窗口初始化
+    iframeInit() {
+      const iframe = this.$refs.iframe;
+      const clientHeight =
+        document.documentElement.clientHeight - (screen > 1 ? 200 : 130);
+      if (!iframe) return;
+      iframe.style.height = `${clientHeight}px`;
+      if (iframe.attachEvent) {
+        iframe.attachEvent("onload", () => {
+          this.hide();
+        });
+      } else {
+        iframe.onload = () => {
+          this.hide();
+        };
       }
+    },
+    getUrlPath: function() {
+      //获取 iframe src 路径
+      let url = window.location.href;
+      url = url.replace("/myiframe", "");
+      return url;
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss">
-  .iframe {
-    width: 100%;
-    height: 100%;
-    border: 0;
-    overflow: hidden;
-    box-sizing: border-box;
-  }
+.iframe {
+  width: 100%;
+  height: 100%;
+  border: 0;
+  overflow: hidden;
+  box-sizing: border-box;
+}
 </style>

+ 1 - 1
src/components/selectComponent/customerSelect.vue

@@ -1,5 +1,5 @@
 <template>
-  <span>
+  <span class="select-component">
     <el-select
         v-model="value"
         :placeholder="configuration.placeholder"

+ 1 - 1
src/views/exportTrade/customerInquiry/config/customerContact.json

@@ -7,7 +7,7 @@
   "editBtn": false,
   "addBtn":false,
   "align": "center",
-  "menuWidth": "180",
+  "menuWidth": 80,
   "column": [{
       "label": "产品类别",
       "prop": "priceCategory",

+ 41 - 5
src/views/exportTrade/customerInquiry/detailsPage.vue

@@ -22,7 +22,11 @@
     <div style="margin-top: 60px;margin-bottom:35px">
       <containerTitle title="基础信息"></containerTitle>
       <basic-container style="margin-bottom: 10px">
-        <avue-form ref="form" v-model="form" :option="option"> </avue-form>
+        <avue-form ref="form" v-model="form" :option="option">
+          <template slot="corpId">
+            <select-component v-model="form.corpId" :configuration="configuration"></select-component>
+          </template>
+        </avue-form>
       </basic-container>
       <containerTitle title="商品信息"></containerTitle>
       <basic-container>
@@ -48,6 +52,16 @@
               >打 印</el-button
             >
           </template>
+          <template slot="menu" slot-scope="{ row, label, dic, $index }">
+            <el-button
+              v-if="row.$cellEdit"
+              size="small"
+              icon="el-icon-edit"
+              type="text"
+              @click="save(row, label, dic, $index)"
+              >保 存</el-button
+            >
+          </template>
         </avue-crud>
       </basic-container>
     </div>
@@ -79,9 +93,10 @@
               :option="goodsOption"
               :table-loading="loading"
               :data="goodsList"
-              ref="crud"
+              ref="goodsCrud"
               @refresh-change="refreshChange"
               @selection-change="selectionChange"
+              @row-click="rowClick"
               :page.sync="page"
               @on-load="onLoad"
             ></avue-crud>
@@ -91,7 +106,12 @@
 
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="importGoods">导入</el-button>
+        <el-button
+          type="primary"
+          @click="importGoods"
+          :disabled="selectionList.length == 0"
+          >导入</el-button
+        >
       </span>
     </el-dialog>
     <report-dialog
@@ -119,6 +139,13 @@ export default {
   name: "detailsPageEdit",
   data() {
     return {
+      configuration: {
+        multipleChoices: false,
+        multiple: false,
+        collapseTags: false,
+        placeholder: "请点击右边按钮选择",
+        dicData: []
+      },
       switchDialog: false,
       form: {},
       disabled: false,
@@ -340,6 +367,10 @@ export default {
     }
   },
   methods: {
+    save(row, label, dic, index) {
+      console.log(row, label, dic, index);
+      this.data[index].$cellEdit = false;
+    },
     rowDel(row, index) {
       if (row.id) {
         delItem(row.id).then(res => {
@@ -366,7 +397,6 @@ export default {
       this.treeDeptId = "";
     },
     selectionChange(list) {
-      console.log(list);
       list.map(e => {
         e.itemId = e.code;
         e.priceCategory = e.goodsTypeName;
@@ -382,10 +412,13 @@ export default {
         e.taxRate = 0;
         e.remarks = null;
         e.$cellEdit = true;
+        delete e.$index;
         delete e.id;
       });
       this.selectionList = list;
-      console.log(this.selectionList);
+    },
+    rowClick(row) {
+      this.$refs.goodsCrud.toggleSelection([this.goodsList[row.$index]]);
     },
     nodeClick(data) {
       this.treeDeptId = data.id;
@@ -488,4 +521,7 @@ export default {
 ::v-deep .el-form-item__error {
   display: none;
 }
+::v-deep .select-component {
+  display: flex;
+}
 </style>