Browse Source

修改bug

QuKatie 3 years ago
parent
commit
16e29dbb43

+ 27 - 30
src/views/basicData/commodityType/configuration/mainList.json

@@ -13,20 +13,17 @@
   "editBtn": false,
   "delBtn": false,
   "dialogClickModal": false,
-  "column": [
-    {
+  "column": [{
       "label": "商品编码",
       "prop": "code",
       "search": true,
       "width": 100,
       "overHidden": true,
-      "rules": [
-        {
-          "required": true,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
+      "rules": [{
+        "required": true,
+        "message": " ",
+        "trigger": "blur"
+      }]
     },
     {
       "label": "商品名称",
@@ -34,33 +31,23 @@
       "slot": true,
       "overHidden": true,
       "width": 100,
-      "rules": [
-        {
-          "required": true,
-          "message": " ",
-          "trigger": "blur"
-        }
-      ]
-    },
-    {
-      "label": "商品类别",
-      "prop": "goodsTypeId",
-      "dicData": [],
-      "type": "tree",
-      "hide": true,
-      "overHidden": true,
-      "addDisabled": false,
-      "multiple": true,
-      "props": {
-        "label": "title"
-      },
       "rules": [{
         "required": true,
         "message": " ",
-        "trigger": "click"
+        "trigger": "blur"
       }]
     },
     {
+      "label": "英文名称",
+      "prop": "ename",
+      "overHidden": true
+    },
+    {
+      "label": "商品类别",
+      "prop": "goodsTypeName",
+      "overHidden": true
+    },
+    {
       "label": "规格编码",
       "prop": "typeno",
       "search": true,
@@ -116,6 +103,16 @@
       "prop": "remarks",
       "slot": true,
       "overHidden": true
+    },
+    {
+      "label": "中文描述",
+      "prop": "nameDescription",
+      "overHidden": true
+    },
+    {
+      "label": "英文描述",
+      "prop": "cnameDescription",
+      "overHidden": true
     }
   ]
 }

+ 75 - 19
src/views/basicData/commodityType/detailsPageEdit.vue

@@ -10,14 +10,24 @@
           >返回列表
         </el-button>
       </div>
-      <el-button
-        class="el-button--small-yh add-customer-btn"
-        type="primary"
-        :disabled="disabled"
-        size="small"
-        @click="editCustomer"
-        >{{ form.id ? "确认修改" : "确认新增" }}
-      </el-button>
+      <div class="add-customer-btn">
+        <el-button
+          class="el-button--small-yh"
+          type="primary"
+          :disabled="disabled"
+          size="small"
+          @click="editCustomer"
+          >{{ form.id ? "确认修改" : "确认新增" }}
+        </el-button>
+        <el-button
+          type="success"
+          :disabled="!form.id"
+          size="small"
+          @click="copyDoc"
+        >
+          复制单据
+        </el-button>
+      </div>
     </div>
     <div style="margin-top: 60px">
       <el-form
@@ -480,7 +490,7 @@ export default {
           {
             label: "供应商",
             prop: "corpId",
-            span:12,
+            span: 12,
             rules: [
               {
                 required: false,
@@ -675,13 +685,63 @@ export default {
       }
     };
   },
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
   //初始化查询
   created() {
     getDeptTree().then(res => {
       this.dicData = res.data.data;
     });
-    if (this.$route.query.id) {
-      getDetail(JSON.parse(this.$route.query.id)).then(res => {
+    if (this.detailData.id) {
+      getDetail(this.detailData.id).then(res => {
+        if (this.detailData.status == "copy") {
+          delete res.data.data.id;
+          delete res.data.data.createTime;
+          delete res.data.data.createUser;
+          delete res.data.data.updateTime;
+          delete res.data.data.updateUser;
+          delete res.data.data.status;
+          delete res.data.data.isDeleted;
+          if (res.data.data.saleGoodsPrice) {
+            res.data.data.saleGoodsPrice.forEach(e => {
+              delete e.id;
+              delete e.pid;
+              delete e.createTime;
+              delete e.createUser;
+              delete e.updateTime;
+              delete e.updateUser;
+              delete e.status;
+              delete e.isDeleted;
+            });
+          }
+          if (res.data.data.buyGoodsPrice) {
+            res.data.data.buyGoodsPrice.forEach(e => {
+              delete e.id;
+              delete e.pid;
+              delete e.createTime;
+              delete e.createUser;
+              delete e.updateTime;
+              delete e.updateUser;
+              delete e.status;
+              delete e.isDeleted;
+            });
+          }
+          if (res.data.data.goodsSpecificationList) {
+            res.data.data.goodsSpecificationList.forEach(e => {
+              delete e.id;
+              delete e.pid;
+              delete e.createTime;
+              delete e.createUser;
+              delete e.updateTime;
+              delete e.updateUser;
+              delete e.status;
+              delete e.isDeleted;
+            });
+          }
+        }
         this.form = res.data.data;
         if (res.data.data.saleGoodsPrice) {
           this.contactsData = res.data.data.saleGoodsPrice;
@@ -693,12 +753,12 @@ export default {
           ? this.form.goodsSpecificationList
           : [];
       });
-    } else {
-      //新增时根据左侧选中树结构给客户类别赋值
-      this.$set(this.form, "goodsTypeId", this.$route.query.treeDeptId);
     }
   },
   methods: {
+    copyDoc() {
+      this.$emit("copyOrder", this.form.id);
+    },
     rowSftEdit(row) {
       if (row.$cellEdit == true) {
         this.$set(row, "$cellEdit", false);
@@ -947,11 +1007,7 @@ export default {
     },
     //返回列表
     backToList() {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/basicData/commodityType/index",
-        query: {}
-      });
+      this.$emit("goBack");
     }
   }
 };

+ 371 - 307
src/views/basicData/commodityType/index.vue

@@ -1,160 +1,199 @@
 <template>
-  <el-row>
-    <el-col :span="5">
-      <basic-container>
-        <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick"/>
-      </basic-container>
-    </el-col>
-    <el-col :span="19">
-      <basic-container>
-        <avue-crud :option="option"
-                   :search.sync="search"
-                   :table-loading="loading"
-                   :data="data"
-                   ref="crud"
-                   v-model="form"
-                   :permission="permissionList"
-                   @row-del="rowDel"
-                   @row-update="rowUpdate"
-                   @row-save="rowSave"
-                   :before-open="beforeOpenE"
-                   :page.sync="page"
-                   @search-change="searchChange"
-                   @search-reset="searchReset"
-                   @selection-change="selectionChange"
-                   @current-change="currentChange"
-                   @size-change="sizeChange"
-                   @refresh-change="refreshChange"
-                   @on-load="onLoad">
-          <template slot="menuLeft">
-            <el-button
-              type="primary"
-              size="small"
-              icon="el-icon-bottom"
-              @click="excelBox = true"
-            >导入
-            </el-button>
-          </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>
-          <template slot-scope="{row}"
-                    slot="tenantName">
-            <el-tag>{{row.tenantName}}</el-tag>
-          </template>
-          <template slot-scope="{row}"
-                    slot="roleName">
-            <el-tag>{{row.roleName}}</el-tag>
-          </template>
-          <template slot-scope="{row}"
-                    slot="deptName">
-            <el-tag>{{row.deptName}}</el-tag>
-          </template>
-          <template slot-scope="{row}"
-                    slot="userTypeName">
-            <el-tag>{{row.userTypeName}}</el-tag>
-          </template>
-        </avue-crud>
-        <el-dialog title="用户角色配置"
-                   append-to-body
-                   :visible.sync="roleBox"
-                   width="345px">
+  <div>
+    <div v-show="show">
+      <el-row>
+        <el-col :span="5">
+          <basic-container>
+            <avue-tree
+              :option="treeOption"
+              :data="treeData"
+              @node-click="nodeClick"
+            />
+          </basic-container>
+        </el-col>
+        <el-col :span="19">
+          <basic-container>
+            <avue-crud
+              :option="option"
+              :search.sync="search"
+              :table-loading="loading"
+              :data="data"
+              ref="crud"
+              v-model="form"
+              :permission="permissionList"
+              @row-del="rowDel"
+              @row-update="rowUpdate"
+              @row-save="rowSave"
+              :before-open="beforeOpen"
+              :page.sync="page"
+              @search-change="searchChange"
+              @search-reset="searchReset"
+              @selection-change="selectionChange"
+              @current-change="currentChange"
+              @size-change="sizeChange"
+              @refresh-change="refreshChange"
+              @on-load="onLoad"
+            >
+              <template slot="menuLeft">
+                <el-button
+                  type="primary"
+                  size="small"
+                  icon="el-icon-bottom"
+                  @click="excelBox = true"
+                  >导入
+                </el-button>
+                <el-button
+                  type="success"
+                  size="small"
+                  @click.stop="copyDoc()"
+                  :disabled="selectionList.length != 1"
+                  >复制单据</el-button
+                >
+              </template>
+              <template slot-scope="scope" slot="menu">
+                <el-button
+                  type="text"
+                  icon="el-icon-view"
+                  size="small"
+                  @click.stop="editOpen(scope.row, 1)"
+                  >查看
+                </el-button>
+                <el-button
+                  type="text"
+                  icon="el-icon-edit"
+                  size="small"
+                  @click.stop="editOpen(scope.row, 1)"
+                  >编辑
+                </el-button>
+                <el-button
+                  type="text"
+                  icon="el-icon-delete"
+                  size="small"
+                  @click.stop="rowDel(scope.row, scope.index)"
+                  >删除
+                </el-button>
+              </template>
+              <template slot-scope="{ row }" slot="tenantName">
+                <el-tag>{{ row.tenantName }}</el-tag>
+              </template>
+              <template slot-scope="{ row }" slot="roleName">
+                <el-tag>{{ row.roleName }}</el-tag>
+              </template>
+              <template slot-scope="{ row }" slot="deptName">
+                <el-tag>{{ row.deptName }}</el-tag>
+              </template>
+              <template slot-scope="{ row }" slot="userTypeName">
+                <el-tag>{{ row.userTypeName }}</el-tag>
+              </template>
+            </avue-crud>
+            <el-dialog
+              title="用户角色配置"
+              append-to-body
+              :visible.sync="roleBox"
+              width="345px"
+            >
+              <el-tree
+                :data="roleGrantList"
+                show-checkbox
+                check-strictly
+                default-expand-all
+                node-key="id"
+                ref="treeRole"
+                :default-checked-keys="roleTreeObj"
+                :props="props"
+              >
+              </el-tree>
 
-          <el-tree :data="roleGrantList"
-                   show-checkbox
-                   check-strictly
-                   default-expand-all
-                   node-key="id"
-                   ref="treeRole"
-                   :default-checked-keys="roleTreeObj"
-                   :props="props">
-          </el-tree>
+              <span slot="footer" class="dialog-footer">
+                <el-button @click="roleBox = false">取 消</el-button>
+                <el-button type="primary" @click="submitRole">确 定</el-button>
+              </span>
+            </el-dialog>
+            <el-dialog
+              title="用户数据导入"
+              append-to-body
+              :visible.sync="excelBox"
+              width="555px"
+            >
+              <avue-form
+                :option="excelOption"
+                v-model="excelForm"
+                :upload-after="uploadAfter"
+              >
+                <template slot="excelTemplate">
+                  <el-button type="primary" @click="handleTemplate">
+                    点击下载<i class="el-icon-download el-icon--right"></i>
+                  </el-button>
+                </template>
+              </avue-form>
+            </el-dialog>
+            <el-dialog
+              title="用户平台配置"
+              append-to-body
+              :visible.sync="platformBox"
+            >
+              <avue-crud
+                :option="platformOption"
+                :table-loading="platformLoading"
+                :data="platformData"
+                ref="platformCrud"
+                v-model="platformForm"
+                :before-open="platformBeforeOpen"
+                :page.sync="platformPage"
+                :permission="platformPermissionList"
+                @row-update="platformRowUpdate"
+                @search-change="platformSearchChange"
+                @search-reset="platformSearchReset"
+                @selection-change="platformSelectionChange"
+                @current-change="platformCurrentChange"
+                @size-change="platformSizeChange"
+                @refresh-change="platformRefreshChange"
+                @on-load="platformOnLoad"
+              >
+                <template slot-scope="{ row }" slot="tenantName">
+                  <el-tag>{{ row.tenantName }}</el-tag>
+                </template>
+                <template slot-scope="{ row }" slot="userTypeName">
+                  <el-tag>{{ row.userTypeName }}</el-tag>
+                </template>
+              </avue-crud>
+            </el-dialog>
+            <el-dialog
+              title="导入商品"
+              append-to-body
+              :visible.sync="excelBox"
+              width="555px"
+            >
+              <avue-form
+                :option="excelOption"
+                v-model="excelForm"
+                :upload-after="uploadAfter"
+              >
+                <template slot="excelTemplate">
+                  <el-button type="primary" @click="derivation">
+                    点击下载<i class="el-icon-download el-icon--right"></i>
+                  </el-button>
+                </template>
+              </avue-form>
+              <p style="text-align: center;color: #DC0505">
+                温馨提示 第一次导入时请先下载模板
+              </p>
+            </el-dialog>
+          </basic-container>
+        </el-col>
+      </el-row>
+    </div>
 
-          <span slot="footer" class="dialog-footer">
-            <el-button @click="roleBox = false">取 消</el-button>
-            <el-button type="primary"
-                       @click="submitRole">确 定</el-button>
-          </span>
-        </el-dialog>
-        <el-dialog title="用户数据导入"
-                   append-to-body
-                   :visible.sync="excelBox"
-                   width="555px">
-          <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
-            <template slot="excelTemplate">
-              <el-button type="primary" @click="handleTemplate">
-                点击下载<i class="el-icon-download el-icon--right"></i>
-              </el-button>
-            </template>
-          </avue-form>
-        </el-dialog>
-        <el-dialog title="用户平台配置"
-                   append-to-body
-                   :visible.sync="platformBox">
-          <avue-crud :option="platformOption"
-                     :table-loading="platformLoading"
-                     :data="platformData"
-                     ref="platformCrud"
-                     v-model="platformForm"
-                     :before-open="platformBeforeOpen"
-                     :page.sync="platformPage"
-                     :permission="platformPermissionList"
-                     @row-update="platformRowUpdate"
-                     @search-change="platformSearchChange"
-                     @search-reset="platformSearchReset"
-                     @selection-change="platformSelectionChange"
-                     @current-change="platformCurrentChange"
-                     @size-change="platformSizeChange"
-                     @refresh-change="platformRefreshChange"
-                     @on-load="platformOnLoad">
-            <template slot-scope="{row}"
-                      slot="tenantName">
-              <el-tag>{{row.tenantName}}</el-tag>
-            </template>
-            <template slot-scope="{row}"
-                      slot="userTypeName">
-              <el-tag>{{row.userTypeName}}</el-tag>
-            </template>
-          </avue-crud>
-        </el-dialog>
-        <el-dialog title="导入商品"
-                   append-to-body
-                   :visible.sync="excelBox"
-                   width="555px">
-          <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
-            <template slot="excelTemplate">
-              <el-button type="primary" @click="derivation">
-                点击下载<i class="el-icon-download el-icon--right"></i>
-              </el-button>
-            </template>
-          </avue-form>
-          <p style="text-align: center;color: #DC0505">温馨提示  第一次导入时请先下载模板</p>
-        </el-dialog>
-      </basic-container>
-    </el-col>
-  </el-row>
+    <detail-page
+      @goBack="goBack"
+      :detailData="detailData"
+      @copyOrder="copyOrder"
+      v-if="!show"
+    ></detail-page>
+  </div>
 </template>
 <script>
+import detailPage from "./detailsPageEdit";
 import {
   getList,
   getUser,
@@ -168,33 +207,35 @@ import {
   getDeptLazyTree,
   getDeptTree
 } from "@/api/basicData/commodityType";
-import {getRoleTree} from "@/api/system/role";
-import {getPostList} from "@/api/system/post";
-import {mapGetters} from "vuex";
-import website from '@/config/website';
-import {getToken} from '@/util/auth';
+import { getRoleTree } from "@/api/system/role";
+import { getPostList } from "@/api/system/post";
+import { mapGetters } from "vuex";
+import website from "@/config/website";
+import { getToken } from "@/util/auth";
 import option from "./configuration/mainList.json";
 export default {
   data() {
     const validatePass = (rule, value, callback) => {
-      if (value === '') {
-        callback(new Error('请输入密码'));
+      if (value === "") {
+        callback(new Error("请输入密码"));
       } else {
         callback();
       }
     };
     const validatePass2 = (rule, value, callback) => {
-      if (value === '') {
-        callback(new Error('请再次输入密码'));
+      if (value === "") {
+        callback(new Error("请再次输入密码"));
       } else if (value !== this.form.password) {
-        callback(new Error('两次输入密码不一致!'));
+        callback(new Error("两次输入密码不一致!"));
       } else {
         callback();
       }
     };
     return {
+      show: true,
+      detailData: {},
       form: {},
-      search:{},
+      search: {},
       roleBox: false,
       excelBox: false,
       platformBox: false,
@@ -215,7 +256,7 @@ export default {
       },
       init: {
         roleTree: [],
-        deptTree: [],
+        deptTree: []
       },
       props: {
         label: "title",
@@ -223,31 +264,33 @@ export default {
       },
       roleGrantList: [],
       roleTreeObj: [],
-      treeDeptId: '',
+      treeDeptId: "",
       treeData: [],
       treeOption: {
-        nodeKey: 'id',
+        nodeKey: "id",
         lazy: true,
-        treeLoad: function (node, resolve) {
-          console.log(node)
-          const parentId = (node.level === 0) ? 0 : node.data.id;
+        treeLoad: function(node, resolve) {
+          console.log(node);
+          const parentId = node.level === 0 ? 0 : node.data.id;
           getDeptLazyTree(parentId).then(res => {
-            resolve(res.data.data.map(item => {
-              return {
-                ...item,
-                leaf: !item.hasChildren
-              }
-            }))
+            resolve(
+              res.data.data.map(item => {
+                return {
+                  ...item,
+                  leaf: !item.hasChildren
+                };
+              })
+            );
           });
         },
         addBtn: false,
         menu: false,
-        size: 'small',
+        size: "small",
         props: {
-          labelText: '标题',
-          label: 'title',
-          value: 'value',
-          children: 'children'
+          labelText: "标题",
+          label: "title",
+          value: "value",
+          children: "children"
         }
       },
       option: option,
@@ -266,7 +309,7 @@ export default {
         viewBtn: true,
         dialogClickModal: false,
         menuWidth: 120,
-        editBtnText: '配置',
+        editBtnText: "配置",
         column: [
           {
             label: "登录账号",
@@ -305,11 +348,13 @@ export default {
             hide: true,
             display: false,
             prop: "userType",
-            rules: [{
-              required: true,
-              message: "请选择用户平台",
-              trigger: "blur"
-            }]
+            rules: [
+              {
+                required: true,
+                message: "请选择用户平台",
+                trigger: "blur"
+              }
+            ]
           },
           {
             label: "用户拓展",
@@ -319,9 +364,9 @@ export default {
             span: 24,
             overHidden: true,
             row: true,
-            hide: true,
-          },
-        ],
+            hide: true
+          }
+        ]
       },
       excelForm: {},
       excelOption: {
@@ -329,34 +374,37 @@ export default {
         emptyBtn: false,
         column: [
           {
-            label: '模板下载',
-            prop: 'excelTemplate',
+            label: "模板下载",
+            prop: "excelTemplate",
             formslot: true,
-            span: 24,
+            span: 24
           },
           {
-            label: '模板上传',
-            prop: 'excelFile',
-            type: 'upload',
+            label: "模板上传",
+            prop: "excelFile",
+            type: "upload",
             drag: true,
-            loadText: '模板上传中,请稍等',
+            loadText: "模板上传中,请稍等",
             span: 24,
             propsHttp: {
-              res: 'data',
+              res: "data"
             },
-            tip: '请上传 .xls,.xlsx 标准格式文件',
-            action: "/api/blade-client/goodsdesc/import-desc",
-          },
+            tip: "请上传 .xls,.xlsx 标准格式文件",
+            action: "/api/blade-client/goodsdesc/import-desc"
+          }
         ]
       }
     };
   },
+  components: {
+    detailPage
+  },
   watch: {
-    'form.tenantId'() {
-      if (this.form.tenantId !== '' && this.initFlag) {
+    "form.tenantId"() {
+      if (this.form.tenantId !== "" && this.initFlag) {
         this.initData(0);
       }
-    },
+    }
   },
   computed: {
     ...mapGetters(["userInfo", "permission"]),
@@ -382,10 +430,10 @@ export default {
         ids.push(ele.id);
       });
       return ids.join(",");
-    },
+    }
   },
   mounted() {
-    option.height = window.innerHeight - 230 ;
+    option.height = window.innerHeight - 230;
     // 非租户模式默认加载管理组数据
     if (!website.tenantMode) {
       this.initData(website.tenantId);
@@ -393,7 +441,11 @@ export default {
   },
   methods: {
     derivation() {
-      window.open(`/api/blade-client/goodsdesc/export-template?${this.website.tokenHeader}=${getToken()}`);
+      window.open(
+        `/api/blade-client/goodsdesc/export-template?${
+          this.website.tokenHeader
+        }=${getToken()}`
+      );
     },
     uploadAfter(res, done, loading, column) {
       window.console.log(column);
@@ -425,56 +477,71 @@ export default {
     },
     rowSave(row, done, loading) {
       row.goodsTypeId = row.goodsTypeId.join(",");
-      add(row).then(() => {
-        this.initFlag = false;
-        this.onLoad(this.page);
-        this.$message({
-          type: "success",
-          message: "操作成功!"
-        });
-        done();
-      }, error => {
-        window.console.log(error);
-        loading();
-      });
+      add(row).then(
+        () => {
+          this.initFlag = false;
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        },
+        error => {
+          window.console.log(error);
+          loading();
+        }
+      );
     },
     rowUpdate(row, index, done, loading) {
       row.goodsTypeId = row.goodsTypeId.join(",");
       // row.deptId = row.deptId.join(",");
       // row.roleId = row.roleId.join(",");
       // row.postId = row.postId.join(",");
-      add(row).then(() => {
-        this.initFlag = false;
-        this.onLoad(this.page);
-        this.$message({
-          type: "success",
-          message: "操作成功!"
-        });
-        done();
-      }, error => {
-        window.console.log(error);
-        loading();
-      });
-    },
-    //查看跳转页面
-    beforeOpenPage(row, index) {
-      this.$router.push({
-        path: "/commodityType_detailsPageEdit",
-        query: { id: JSON.stringify(row.id) }
-      });
+      add(row).then(
+        () => {
+          this.initFlag = false;
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        },
+        error => {
+          window.console.log(error);
+          loading();
+        }
+      );
     },
     //新增跳转页面
-    beforeOpenE(row, index) {
-      this.$router.push({
-        path: "/commodityType_detailsPageEdit",
-        query: { id: JSON.stringify(row.id),treeDeptId:this.treeDeptId }
+    beforeOpen() {
+      this.show = false;
+    },
+    editOpen(row, status) {
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
+    },
+    copyDoc() {
+      this.selectionList.forEach(e => {
+        this.detailData = {
+          id: e.id,
+          status: "copy"
+        };
+        this.show = false;
       });
     },
-    //编辑跳转页面
-    editOpen(row, index) {
-      this.$router.push({
-        path: "/commodityType_detailsPageEdit",
-        query: { id: JSON.stringify(row.id) }
+    copyOrder(id) {
+      this.show = true;
+      this.detailData = {
+        id: id,
+        status: "copy"
+      };
+      this.$nextTick(() => {
+        this.show = false;
       });
     },
     //删除触发
@@ -484,21 +551,21 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       })
-          .then(() => {
-            return remove(row.id);
-          })
-          .then(() => {
-            this.onLoad(this.page);
-            this.$message({
-              type: "success",
-              message: "操作成功!"
-            });
-            done()
+        .then(() => {
+          return remove(row.id);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
           });
+          done();
+        });
     },
     searchReset() {
       this.query = {};
-      this.treeDeptId = '';
+      this.treeDeptId = "";
       this.onLoad(this.page);
     },
     searchChange(params, done) {
@@ -524,17 +591,17 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       })
-          .then(() => {
-            return remove(this.ids);
-          })
-          .then(() => {
-            this.onLoad(this.page);
-            this.$message({
-              type: "success",
-              message: "操作成功!"
-            });
-            this.$refs.crud.toggleSelection();
+        .then(() => {
+          return remove(this.ids);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
           });
+          this.$refs.crud.toggleSelection();
+        });
     },
     handleGrant() {
       if (this.selectionList.length === 0) {
@@ -557,32 +624,11 @@ export default {
       this.excelBox = true;
     },
     handleTemplate() {
-      window.open(`/api/blade-user/export-template?${this.website.tokenHeader}=${getToken()}`);
-    },
-    //新增编辑查看触发
-    async beforeOpen(done, type) {
-      if (["add"].includes(type)) {
-        this.option.column.forEach(e=>{
-          if(e.prop=='goodsTypeId'){
-            this.$set(this.option.column,2,{...e,value:this.treeDeptId})
-          }
-        })
-      }
-      if (["edit", "view"].includes(type)) {
-        await getUser(this.form.id).then(res => {
-          this.form = res.data.data;
-          // this.form.goodsTypeId = [this.form.goodsTypeId.replace(/\"/g,"")]
-          console.log(this.form.hasOwnProperty("goodsTypeId"))
-          if(this.form.hasOwnProperty("goodsTypeId")){
-            this.form.goodsTypeId = this.form.goodsTypeId.split(",");
-          }
-        });
-      }
-      if (["add", "edit"].includes(type)) {
-        this.initData(0);
-      }
-      this.initFlag = true;
-      done();
+      window.open(
+        `/api/blade-user/export-template?${
+          this.website.tokenHeader
+        }=${getToken()}`
+      );
     },
     currentChange(currentPage) {
       this.page.currentPage = currentPage;
@@ -595,26 +641,34 @@ export default {
     },
     onLoad(page, params = {}) {
       this.loading = true;
-      getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
+      getList(
+        page.currentPage,
+        page.pageSize,
+        Object.assign(params, this.query),
+        this.treeDeptId
+      ).then(res => {
         const data = res.data.data;
         this.data = data.records;
-        this.page.total = res.data.data.total
+        this.page.total = res.data.data.total;
         this.loading = false;
         this.selectionClear();
       });
     },
     platformRowUpdate(row, index, done, loading) {
-      updatePlatform(row.id, row.userType, row.userExt).then(() => {
-        this.platformOnLoad(this.platformPage);
-        this.$message({
-          type: "success",
-          message: "操作成功!"
-        });
-        done();
-      }, error => {
-        window.console.log(error);
-        loading();
-      });
+      updatePlatform(row.id, row.userType, row.userExt).then(
+        () => {
+          this.platformOnLoad(this.platformPage);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        },
+        error => {
+          window.console.log(error);
+          loading();
+        }
+      );
     },
     platformBeforeOpen(done, type) {
       if (["edit", "view"].includes(type)) {
@@ -652,13 +706,23 @@ export default {
     },
     platformOnLoad(page, params = {}) {
       this.platformLoading = true;
-      getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
+      getList(
+        page.currentPage,
+        page.pageSize,
+        Object.assign(params, this.query),
+        this.treeDeptId
+      ).then(res => {
         const data = res.data.data;
         this.platformPage.total = data.total;
         this.platformData = data.records;
         this.platformLoading = false;
         this.selectionClear();
       });
+    },
+    goBack() {
+      this.detailData = this.$options.data().detailData;
+      this.show = true;
+      this.onLoad(this.page, this.search);
     }
   }
 };

+ 21 - 41
src/views/basicData/customerInformation/detailsPageEdit.vue

@@ -253,7 +253,7 @@ import {
   corpsfiles,
   corpsitem,
   areaTypeTree,
-  corpsAddrDelete,
+  corpsAddrDelete
 } from "@/api/basicData/customerInformation";
 import customerContact from "./configuration/customerContact.json";
 import advantageProject from "./configuration/advantageProject.json";
@@ -653,29 +653,33 @@ export default {
       addressForm: {},
       addressData: [],
       // 包装要求
-      packageOptions: [],
+      packageOptions: []
     };
   },
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
   components: {
     flowDialog
   },
   created() {
-    if(this.$store.getters.userInfo.tenant_id === "096359"){
-      let list = ['profitReturn','usedProfit','surplusProfit','monthProfit']
-      for(let item in list){
-        for(let i in this.basicData.column){
-          if (list[item] == this.basicData.column[i].prop){
-            this.basicData.column.splice(i,1)
+    if (this.$store.getters.userInfo.tenant_id === "096359") {
+      let list = ["profitReturn", "usedProfit", "surplusProfit", "monthProfit"];
+      for (let item in list) {
+        for (let i in this.basicData.column) {
+          if (list[item] == this.basicData.column[i].prop) {
+            this.basicData.column.splice(i, 1);
           }
         }
       }
     }
-
     this.customerContact.column.map(item => {
-      if (item.prop == 'tel') {
-        item.rules[1].pattern = /^1[3-9]\d{9}$/
+      if (item.prop == "tel") {
+        item.rules[1].pattern = /^1[3-9]\d{9}$/;
       }
-    })
+    });
     corpstypeTree({ corpType: customerParameter.code }).then(res => {
       this.dic = res.data.data;
     });
@@ -688,10 +692,8 @@ export default {
     this.getWorkDicts("payment_term").then(res => {
       this.paymentOption = res.data.data;
     });
-    if (this.$route.query.id) {
-      let id = this.$route.query.id.replace(/\"/g, "");
-      // let id = parseInt(this.$route.query.id)
-      detail(id).then(res => {
+    if (this.detailData.id) {
+      detail(this.detailData.id).then(res => {
         if (res.data.data.adminProfiles) {
           res.data.data.adminProfiles = res.data.data.adminProfiles.split(",");
         }
@@ -700,34 +702,16 @@ export default {
         this.bankOfDepositData = this.form.corpsBankList;
         this.advantageProjectData = this.form.corpsItems;
         this.addressData = this.form.corpsAddrList;
-
         delete this.form.corpsAttnList;
         delete this.form.corpsBankList;
         delete this.form.corpsItems;
         delete this.form.corpsAddrList;
       });
-    } else {
-      //新增时根据左侧选中树结构给客户类别赋值
-      this.$set(this.form, "corpsTypeId", this.$route.query.treeDeptId);
     }
     gainUser().then(res => {
       this.userList = res.data.data;
     });
   },
-  watch: {
-    $route(to, from) {
-      console.log(to, from);
-      if (this.$route.query.id) {
-        let id = JSON.parse(this.$route.query.id).replace(/\"/g, "");
-        detail(id).then(res => {
-          console.log(res.data.data);
-          this.form = res.data.data;
-        });
-      } else {
-        this.form = {};
-      }
-    }
-  },
   methods: {
     //新增客户联系人保存触发
     rowSave(row, done, loading) {
@@ -910,11 +894,7 @@ export default {
       });
     },
     backToList() {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/basicData/customerInformation/index",
-        query: {}
-      });
+      this.$emit("goBack");
     },
     openFlow() {
       this.switchDialog = !this.switchDialog;
@@ -922,7 +902,7 @@ export default {
     onClose(val) {
       this.switchDialog = val;
     },
-    getCorpName(row) {},
+    getCorpName(row) {}
   }
 };
 </script>
@@ -932,7 +912,7 @@ export default {
   margin-bottom: 0;
 }
 
-::v-deep .el-form-item__content{
+::v-deep .el-form-item__content {
   line-height: 32px;
 }
 </style>

+ 149 - 138
src/views/basicData/customerInformation/index.vue

@@ -1,121 +1,132 @@
 <template>
-  <el-row>
-    <el-col :span="5">
-      <div class="box">
-        <el-scrollbar>
+  <div>
+    <div v-show="show">
+      <el-row>
+        <el-col :span="5">
+          <div class="box">
+            <el-scrollbar>
+              <basic-container>
+                <avue-tree
+                  :option="treeOption"
+                  :data="treeData"
+                  @node-click="nodeClick"
+                />
+              </basic-container>
+            </el-scrollbar>
+          </div>
+        </el-col>
+        <el-col :span="19">
           <basic-container>
-            <avue-tree
-              :option="treeOption"
-              :data="treeData"
-              @node-click="nodeClick"
-            />
+            <avue-crud
+              :option="option"
+              :data="dataList"
+              ref="crud"
+              v-model="form"
+              :page.sync="page"
+              @row-del="rowDel"
+              @row-update="rowUpdate"
+              :before-open="beforeOpen"
+              :before-close="beforeClose"
+              @row-save="rowSave"
+              @search-change="searchChange"
+              @search-reset="searchReset"
+              @selection-change="selectionChange"
+              @current-change="currentChange"
+              @size-change="sizeChange"
+              @refresh-change="refreshChange"
+              @on-load="onLoad"
+              @tree-load="treeLoad"
+              @search-criteria-switch="searchCriteriaSwitch"
+            >
+              <template slot="menuLeft">
+                <el-button
+                  type="primary"
+                  size="small"
+                  icon="el-icon-bottom"
+                  @click="excelBox = true"
+                  >导入
+                </el-button>
+                <el-button
+                  icon="el-icon-printer"
+                  size="small"
+                  type="primary"
+                  @click.stop="openReport()"
+                  >报 表
+                </el-button>
+              </template>
+              <template slot-scope="scope" slot="menu">
+                <el-button
+                  type="text"
+                  icon="el-icon-view"
+                  size="small"
+                  @click.stop="editOpen(scope.row, 1)"
+                  >查看
+                </el-button>
+                <el-button
+                  type="text"
+                  icon="el-icon-edit"
+                  size="small"
+                  @click.stop="editOpen(scope.row, 1)"
+                  >编辑
+                </el-button>
+                <el-button
+                  type="text"
+                  icon="el-icon-delete"
+                  size="small"
+                  @click.stop="rowDel(scope.row, scope.index)"
+                  >删除
+                </el-button>
+              </template>
+              <template slot="adminProfiles" slot-scope="{ row }">
+                <span>{{ row.adminProfilesName | adminProfileFilter }}</span>
+              </template>
+              <template slot="belongtocompany" slot-scope="{ row }">
+                <span>{{ row.belongCompany }}</span>
+              </template>
+            </avue-crud>
+            <report-dialog
+              :switchDialog="switchDialog"
+              @onClose="onClose()"
+            ></report-dialog>
+            <el-dialog
+              title="导入客户"
+              append-to-body
+              :visible.sync="excelBox"
+              width="555px"
+              v-dialog-drag
+            >
+              <avue-form
+                :option="excelOption"
+                v-model="excelForm"
+                table-loading="excelLoading"
+                :upload-before="uploadBefore"
+                :upload-after="uploadAfter"
+              >
+                <template slot="excelTemplate">
+                  <el-button type="primary" @click="derivation">
+                    点击下载<i class="el-icon-download el-icon--right"></i>
+                  </el-button>
+                </template>
+              </avue-form>
+              <p style="text-align: center;color: #DC0505">
+                温馨提示 第一次导入时请先下载模板
+              </p>
+            </el-dialog>
           </basic-container>
-        </el-scrollbar>
-      </div>
-    </el-col>
-    <el-col :span="19">
-      <basic-container>
-        <avue-crud
-          :option="option"
-          :data="dataList"
-          ref="crud"
-          v-model="form"
-          :page.sync="page"
-          @row-del="rowDel"
-          @row-update="rowUpdate"
-          :before-open="beforeOpen"
-          :before-close="beforeClose"
-          @row-save="rowSave"
-          @search-change="searchChange"
-          @search-reset="searchReset"
-          @selection-change="selectionChange"
-          @current-change="currentChange"
-          @size-change="sizeChange"
-          @refresh-change="refreshChange"
-          @on-load="onLoad"
-          @tree-load="treeLoad"
-          @search-criteria-switch="searchCriteriaSwitch"
-        >
-          <template slot="menuLeft">
-            <el-button
-              type="primary"
-              size="small"
-              icon="el-icon-bottom"
-              @click="excelBox = true"
-              >导入
-            </el-button>
-            <el-button
-              icon="el-icon-printer"
-              size="small"
-              type="primary"
-              @click.stop="openReport()"
-              >报 表
-            </el-button>
-          </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>
-          <template slot="adminProfiles" slot-scope="{ row }">
-            <span>{{ row.adminProfilesName | adminProfileFilter }}</span>
-          </template>
-          <template slot="belongtocompany" slot-scope="{ row }">
-            <span>{{ row.belongCompany }}</span>
-          </template>
-        </avue-crud>
-        <report-dialog
-          :switchDialog="switchDialog"
-          @onClose="onClose()"
-        ></report-dialog>
-        <el-dialog
-          title="导入客户"
-          append-to-body
-          :visible.sync="excelBox"
-          width="555px"
-          v-dialog-drag
-        >
-          <avue-form
-            :option="excelOption"
-            v-model="excelForm"
-            table-loading="excelLoading"
-            :upload-before="uploadBefore"
-            :upload-after="uploadAfter"
-          >
-            <template slot="excelTemplate">
-              <el-button type="primary" @click="derivation">
-                点击下载<i class="el-icon-download el-icon--right"></i>
-              </el-button>
-            </template>
-          </avue-form>
-          <p style="text-align: center;color: #DC0505">
-            温馨提示 第一次导入时请先下载模板
-          </p>
-        </el-dialog>
-      </basic-container>
-    </el-col>
-  </el-row>
+        </el-col>
+      </el-row>
+    </div>
+
+    <detail-page
+      @goBack="goBack"
+      :detailData="detailData"
+      v-if="!show"
+    ></detail-page>
+  </div>
 </template>
 
 <script>
+import detailPage from "./detailsPageEdit";
 import option from "./configuration/mainList.json";
 import {
   customerList,
@@ -132,6 +143,8 @@ export default {
   name: "customerInformation",
   data() {
     return {
+      show: true,
+      detailData: {},
       reportQuery: {},
       switchDialog: false,
       treeDeptId: "",
@@ -205,7 +218,8 @@ export default {
     };
   },
   components: {
-    reportDialog
+    reportDialog,
+    detailPage
   },
   filters: {
     adminProfileFilter(row) {
@@ -216,7 +230,8 @@ export default {
   },
   created() {
     gainUser().then(res => {
-      this.findObject(this.option.column, "adminProfiles").dicData = res.data.data;
+      this.findObject(this.option.column, "adminProfiles").dicData =
+        res.data.data;
     });
   },
   // watch:{
@@ -310,25 +325,16 @@ export default {
       column.addDisabled = true;
       this.$refs.crud.rowAdd();
     },
-    //查看跳转页面
-    beforeOpenPage(row, index) {
-      this.$router.push({
-        path: "/detailsPageEdit",
-        query: { id: JSON.stringify(row.id) }
-      });
-    },
     //新增跳转页面
-    beforeOpen(row, index) {
-      this.$router.push({
-        path: "/detailsPageEdit",
-        query: { id: JSON.stringify(row.id), treeDeptId: this.treeDeptId }
-      });
+    beforeOpen() {
+      this.show = false;
     },
-    editOpen(row, index) {
-      this.$router.push({
-        path: "/detailsPageEdit",
-        query: { id: JSON.stringify(row.id) }
-      });
+    editOpen(row, status) {
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
     },
     //点击新增时触发
     beforeClose(done) {
@@ -367,7 +373,7 @@ export default {
         size: page.pageSize,
         current: page.currentPage,
         corpsTypeId: this.treeDeptId,
-        corpType: customerParameter.code
+        corpType: customerParameter.code,
       });
       customerList(queryParams).then(res => {
         this.dataList = res.data.data.records;
@@ -377,13 +383,13 @@ export default {
         }
       });
     },
-    searchCriteriaSwitch(type){
-      if (type){
-        this.option.height = this.option.height - 90
-      }else {
-        this.option.height = this.option.height + 90
+    searchCriteriaSwitch(type) {
+      if (type) {
+        this.option.height = this.option.height - 90;
+      } else {
+        this.option.height = this.option.height + 90;
       }
-      this.$refs.crud.getTableHeight()
+      this.$refs.crud.getTableHeight();
     },
     //树桩列点击展开触发
     treeLoad(tree, treeNode, resolve) {
@@ -400,6 +406,11 @@ export default {
     },
     onClose(val) {
       this.switchDialog = val;
+    },
+    goBack() {
+      this.detailData = this.$options.data().detailData;
+      this.show = true;
+      this.onLoad(this.page, this.search);
     }
   }
 };

+ 9 - 27
src/views/basicData/customerManagement/companyMaterial/detailsPageEdit.vue

@@ -547,6 +547,11 @@ export default {
       addressData: []
     };
   },
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
   components: {
     flowDialog
   },
@@ -560,10 +565,8 @@ export default {
     this.getWorkDicts("payment_term").then(res => {
       this.paymentOption = res.data.data;
     });
-    if (this.$route.query.id) {
-      let id = this.$route.query.id.replace(/\"/g, "");
-      // let id = parseInt(this.$route.query.id)
-      detail(id).then(res => {
+    if (this.detailData.id) {
+      detail(this.detailData.id).then(res => {
         if (res.data.data.adminProfiles) {
           res.data.data.adminProfiles = res.data.data.adminProfiles.split(",");
         }
@@ -575,28 +578,11 @@ export default {
         delete this.form.corpsBankList;
         delete this.form.corpsItems;
       });
-    } else {
-      //新增时根据左侧选中树结构给客户类别赋值
-      this.$set(this.form, "corpsTypeId", this.$route.query.treeDeptId);
     }
     gainUser().then(res => {
       this.userList = res.data.data;
     });
   },
-  watch: {
-    $route(to, from) {
-      console.log(to, from);
-      if (this.$route.query.id) {
-        let id = JSON.parse(this.$route.query.id).replace(/\"/g, "");
-        detail(id).then(res => {
-          console.log(res.data.data);
-          this.form = res.data.data;
-        });
-      } else {
-        this.form = {};
-      }
-    }
-  },
   methods: {
     //新增客户联系人保存触发
     rowSave(row, done, loading) {
@@ -745,11 +731,7 @@ export default {
       });
     },
     backToList() {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/basicData/customerManagement/companyMaterial/index",
-        query: {}
-      });
+       this.$emit("goBack");
     },
     openFlow() {
       this.switchDialog = !this.switchDialog;
@@ -789,7 +771,7 @@ export default {
           this.addressData.splice(index, 1);
         }
       });
-    },
+    }
   }
 };
 </script>

+ 142 - 133
src/views/basicData/customerManagement/companyMaterial/index.vue

@@ -1,118 +1,128 @@
 <template>
-  <el-row>
-    <el-col :span="5">
-      <div class="box">
-        <el-scrollbar>
+  <div>
+    <div v-show="show">
+      <el-row>
+        <el-col :span="5">
+          <div class="box">
+            <el-scrollbar>
+              <basic-container>
+                <avue-tree
+                  :option="treeOption"
+                  :data="treeData"
+                  @node-click="nodeClick"
+                />
+              </basic-container>
+            </el-scrollbar>
+          </div>
+        </el-col>
+        <el-col :span="19">
           <basic-container>
-            <avue-tree
-              :option="treeOption"
-              :data="treeData"
-              @node-click="nodeClick"
-            />
+            <avue-crud
+              :option="option"
+              :data="dataList"
+              ref="crud"
+              v-model="form"
+              :page.sync="page"
+              @row-del="rowDel"
+              @row-update="rowUpdate"
+              :before-open="beforeOpen"
+              :before-close="beforeClose"
+              @row-save="rowSave"
+              @search-change="searchChange"
+              @search-reset="searchReset"
+              @selection-change="selectionChange"
+              @current-change="currentChange"
+              @size-change="sizeChange"
+              @refresh-change="refreshChange"
+              @on-load="onLoad"
+              @search-criteria-switch="searchCriteriaSwitch"
+              @tree-load="treeLoad"
+            >
+              <template slot="menuLeft">
+                <el-button
+                  type="primary"
+                  size="small"
+                  icon="el-icon-bottom"
+                  @click="excelBox = true"
+                  >导入
+                </el-button>
+                <el-button
+                  icon="el-icon-printer"
+                  size="small"
+                  type="primary"
+                  @click.stop="openReport()"
+                  >报 表
+                </el-button>
+              </template>
+              <template slot-scope="scope" slot="menu">
+                <el-button
+                  type="text"
+                  icon="el-icon-view"
+                  size="small"
+                  @click.stop="editOpen(scope.row, 1)"
+                  >查看
+                </el-button>
+                <el-button
+                  type="text"
+                  icon="el-icon-edit"
+                  size="small"
+                  @click.stop="editOpen(scope.row, 1)"
+                  >编辑
+                </el-button>
+                <el-button
+                  type="text"
+                  icon="el-icon-delete"
+                  size="small"
+                  @click.stop="rowDel(scope.row, scope.index)"
+                  >删除
+                </el-button>
+              </template>
+              <template slot="adminProfiles" slot-scope="{ row }">
+                <span>{{ row.adminProfilesName | adminProfileFilter }}</span>
+              </template>
+            </avue-crud>
+            <report-dialog
+              :switchDialog="switchDialog"
+              @onClose="onClose()"
+            ></report-dialog>
+            <el-dialog
+              title="导入所属公司"
+              append-to-body
+              :visible.sync="excelBox"
+              width="555px"
+              v-dialog-drag
+            >
+              <avue-form
+                :option="excelOption"
+                v-model="excelForm"
+                table-loading="excelLoading"
+                :upload-before="uploadBefore"
+                :upload-after="uploadAfter"
+              >
+                <template slot="excelTemplate">
+                  <el-button type="primary" @click="derivation">
+                    点击下载<i class="el-icon-download el-icon--right"></i>
+                  </el-button>
+                </template>
+              </avue-form>
+              <p style="text-align: center;color: #DC0505">
+                温馨提示 第一次导入时请先下载模板
+              </p>
+            </el-dialog>
           </basic-container>
-        </el-scrollbar>
-      </div>
-    </el-col>
-    <el-col :span="19">
-      <basic-container>
-        <avue-crud
-          :option="option"
-          :data="dataList"
-          ref="crud"
-          v-model="form"
-          :page.sync="page"
-          @row-del="rowDel"
-          @row-update="rowUpdate"
-          :before-open="beforeOpen"
-          :before-close="beforeClose"
-          @row-save="rowSave"
-          @search-change="searchChange"
-          @search-reset="searchReset"
-          @selection-change="selectionChange"
-          @current-change="currentChange"
-          @size-change="sizeChange"
-          @refresh-change="refreshChange"
-          @on-load="onLoad"
-          @search-criteria-switch="searchCriteriaSwitch"
-          @tree-load="treeLoad"
-        >
-          <template slot="menuLeft">
-            <el-button
-              type="primary"
-              size="small"
-              icon="el-icon-bottom"
-              @click="excelBox = true"
-              >导入
-            </el-button>
-            <el-button
-              icon="el-icon-printer"
-              size="small"
-              type="primary"
-              @click.stop="openReport()"
-              >报 表
-            </el-button>
-          </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>
-          <template slot="adminProfiles" slot-scope="{ row }">
-            <span>{{ row.adminProfilesName | adminProfileFilter }}</span>
-          </template>
-        </avue-crud>
-        <report-dialog
-          :switchDialog="switchDialog"
-          @onClose="onClose()"
-        ></report-dialog>
-        <el-dialog
-          title="导入所属公司"
-          append-to-body
-          :visible.sync="excelBox"
-          width="555px"
-          v-dialog-drag
-        >
-          <avue-form
-            :option="excelOption"
-            v-model="excelForm"
-            table-loading="excelLoading"
-            :upload-before="uploadBefore"
-            :upload-after="uploadAfter"
-          >
-            <template slot="excelTemplate">
-              <el-button type="primary" @click="derivation">
-                点击下载<i class="el-icon-download el-icon--right"></i>
-              </el-button>
-            </template>
-          </avue-form>
-          <p style="text-align: center;color: #DC0505">
-            温馨提示 第一次导入时请先下载模板
-          </p>
-        </el-dialog>
-      </basic-container>
-    </el-col>
-  </el-row>
+        </el-col>
+      </el-row>
+    </div>
+    <detail-page
+      @goBack="goBack"
+      :detailData="detailData"
+      v-if="!show"
+    ></detail-page>
+  </div>
 </template>
 
 <script>
+import detailPage from "./detailsPageEdit";
 import option from "./configuration/mainList.json";
 import {
   customerList,
@@ -129,6 +139,8 @@ export default {
   name: "customerInformation",
   data() {
     return {
+      show: true,
+      detailData: {},
       reportQuery: {},
       switchDialog: false,
       treeDeptId: "",
@@ -202,7 +214,8 @@ export default {
     };
   },
   components: {
-    reportDialog
+    reportDialog,
+    detailPage
   },
   filters: {
     adminProfileFilter(row) {
@@ -309,25 +322,16 @@ export default {
       column.addDisabled = true;
       this.$refs.crud.rowAdd();
     },
-    //查看跳转页面
-    beforeOpenPage(row, index) {
-      this.$router.push({
-        path: "/basicData/customerManagement/companyMaterial/detailsPageEdit",
-        query: { id: JSON.stringify(row.id) }
-      });
-    },
     //新增跳转页面
-    beforeOpen(row, index) {
-      this.$router.push({
-        path: "/basicData/customerManagement/companyMaterial/detailsPageEdit",
-        query: { id: JSON.stringify(row.id), treeDeptId: this.treeDeptId }
-      });
+    beforeOpen() {
+      this.show = false;
     },
-    editOpen(row, index) {
-      this.$router.push({
-        path: "/basicData/customerManagement/companyMaterial/detailsPageEdit",
-        query: { id: JSON.stringify(row.id) }
-      });
+    editOpen(row, status) {
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
     },
     //点击新增时触发
     beforeClose(done) {
@@ -376,13 +380,13 @@ export default {
         }
       });
     },
-    searchCriteriaSwitch(type){
-      if (type){
-        this.option.height = this.option.height - 90
-      }else {
-        this.option.height = this.option.height + 90
+    searchCriteriaSwitch(type) {
+      if (type) {
+        this.option.height = this.option.height - 90;
+      } else {
+        this.option.height = this.option.height + 90;
       }
-      this.$refs.crud.getTableHeight()
+      this.$refs.crud.getTableHeight();
     },
     //树桩列点击展开触发
     treeLoad(tree, treeNode, resolve) {
@@ -399,6 +403,11 @@ export default {
     },
     onClose(val) {
       this.switchDialog = val;
+    },
+    goBack() {
+      this.detailData = this.$options.data().detailData;
+      this.show = true;
+      this.onLoad(this.page, this.search);
     }
   }
 };

+ 8 - 26
src/views/basicData/customerManagement/supplierMaterial/detailsPageEdit.vue

@@ -563,6 +563,11 @@ export default {
       addressData: []
     };
   },
+    props: {
+    detailData: {
+      type: Object
+    }
+  },
   components: {
     flowDialog
   },
@@ -576,10 +581,8 @@ export default {
     this.getWorkDicts("payment_term").then(res => {
       this.paymentOption = res.data.data;
     });
-    if (this.$route.query.id) {
-      let id = this.$route.query.id.replace(/\"/g, "");
-      // let id = parseInt(this.$route.query.id)
-      detail(id).then(res => {
+    if (this.detailData.id) {
+      detail(this.detailData.id).then(res => {
         if (res.data.data.adminProfiles) {
           res.data.data.adminProfiles = res.data.data.adminProfiles.split(",");
         }
@@ -593,28 +596,11 @@ export default {
         delete this.form.corpsItems;
         delete this.form.corpsAddrList;
       });
-    } else {
-      //新增时根据左侧选中树结构给客户类别赋值
-      this.$set(this.form, "corpsTypeId", this.$route.query.treeDeptId);
     }
     gainUser().then(res => {
       this.userList = res.data.data;
     });
   },
-  watch: {
-    $route(to, from) {
-      console.log(to, from);
-      if (this.$route.query.id) {
-        let id = JSON.parse(this.$route.query.id).replace(/\"/g, "");
-        detail(id).then(res => {
-          console.log(res.data.data);
-          this.form = res.data.data;
-        });
-      } else {
-        this.form = {};
-      }
-    }
-  },
   methods: {
     //新增客户联系人保存触发
     rowSave(row, done, loading) {
@@ -764,11 +750,7 @@ export default {
       });
     },
     backToList() {
-      this.$router.$avueRouter.closeTag();
-      this.$router.push({
-        path: "/basicData/customerManagement/supplierMaterial/index",
-        query: {}
-      });
+       this.$emit("goBack");
     },
     openFlow() {
       this.switchDialog = !this.switchDialog;

+ 146 - 136
src/views/basicData/customerManagement/supplierMaterial/index.vue

@@ -1,121 +1,132 @@
 <template>
-  <el-row>
-    <el-col :span="5">
-      <div class="box">
-        <el-scrollbar>
+  <div>
+    <div v-show="show">
+      <el-row>
+        <el-col :span="5">
+          <div class="box">
+            <el-scrollbar>
+              <basic-container>
+                <avue-tree
+                  :option="treeOption"
+                  :data="treeData"
+                  @node-click="nodeClick"
+                />
+              </basic-container>
+            </el-scrollbar>
+          </div>
+        </el-col>
+        <el-col :span="19">
           <basic-container>
-            <avue-tree
-              :option="treeOption"
-              :data="treeData"
-              @node-click="nodeClick"
-            />
+            <avue-crud
+              :option="option"
+              :data="dataList"
+              ref="crud"
+              v-model="form"
+              :page.sync="page"
+              @row-del="rowDel"
+              @row-update="rowUpdate"
+              :before-open="beforeOpen"
+              :before-close="beforeClose"
+              @row-save="rowSave"
+              @search-change="searchChange"
+              @search-reset="searchReset"
+              @selection-change="selectionChange"
+              @current-change="currentChange"
+              @size-change="sizeChange"
+              @refresh-change="refreshChange"
+              @on-load="onLoad"
+              @tree-load="treeLoad"
+              @search-criteria-switch="searchCriteriaSwitch"
+            >
+              <template slot="menuLeft">
+                <el-button
+                  type="primary"
+                  size="small"
+                  icon="el-icon-bottom"
+                  @click="excelBox = true"
+                  >导入
+                </el-button>
+                <el-button
+                  icon="el-icon-printer"
+                  size="small"
+                  type="primary"
+                  @click.stop="openReport()"
+                  >报 表
+                </el-button>
+              </template>
+              <template slot-scope="scope" slot="menu">
+                <el-button
+                  type="text"
+                  icon="el-icon-view"
+                  size="small"
+                  @click.stop="editOpen(scope.row, 1)"
+                  >查看
+                </el-button>
+                <el-button
+                  type="text"
+                  icon="el-icon-edit"
+                  size="small"
+                  @click.stop="editOpen(scope.row, 1)"
+                  >编辑
+                </el-button>
+                <el-button
+                  type="text"
+                  icon="el-icon-delete"
+                  size="small"
+                  @click.stop="rowDel(scope.row, scope.index)"
+                  >删除
+                </el-button>
+              </template>
+              <template slot="adminProfiles" slot-scope="{ row }">
+                <span>{{ row.adminProfilesName | adminProfileFilter }}</span>
+              </template>
+              <template slot="belongtocompany" slot-scope="{ row }">
+                <span>{{ row.belongCompany }}</span>
+              </template>
+            </avue-crud>
+            <report-dialog
+              :switchDialog="switchDialog"
+              @onClose="onClose()"
+            ></report-dialog>
+            <el-dialog
+              title="导入供应商"
+              append-to-body
+              :visible.sync="excelBox"
+              width="555px"
+              v-dialog-drag
+            >
+              <avue-form
+                :option="excelOption"
+                v-model="excelForm"
+                table-loading="excelLoading"
+                :upload-before="uploadBefore"
+                :upload-after="uploadAfter"
+              >
+                <template slot="excelTemplate">
+                  <el-button type="primary" @click="derivation">
+                    点击下载<i class="el-icon-download el-icon--right"></i>
+                  </el-button>
+                </template>
+              </avue-form>
+              <p style="text-align: center;color: #DC0505">
+                温馨提示 第一次导入时请先下载模板
+              </p>
+            </el-dialog>
           </basic-container>
-        </el-scrollbar>
-      </div>
-    </el-col>
-    <el-col :span="19">
-      <basic-container>
-        <avue-crud
-          :option="option"
-          :data="dataList"
-          ref="crud"
-          v-model="form"
-          :page.sync="page"
-          @row-del="rowDel"
-          @row-update="rowUpdate"
-          :before-open="beforeOpen"
-          :before-close="beforeClose"
-          @row-save="rowSave"
-          @search-change="searchChange"
-          @search-reset="searchReset"
-          @selection-change="selectionChange"
-          @current-change="currentChange"
-          @size-change="sizeChange"
-          @refresh-change="refreshChange"
-          @on-load="onLoad"
-          @tree-load="treeLoad"
-          @search-criteria-switch="searchCriteriaSwitch"
-        >
-          <template slot="menuLeft">
-            <el-button
-              type="primary"
-              size="small"
-              icon="el-icon-bottom"
-              @click="excelBox = true"
-              >导入
-            </el-button>
-            <el-button
-              icon="el-icon-printer"
-              size="small"
-              type="primary"
-              @click.stop="openReport()"
-              >报 表
-            </el-button>
-          </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>
-          <template slot="adminProfiles" slot-scope="{ row }">
-            <span>{{ row.adminProfilesName | adminProfileFilter }}</span>
-          </template>
-          <template slot="belongtocompany" slot-scope="{ row }">
-            <span>{{ row.belongCompany }}</span>
-          </template>
-        </avue-crud>
-        <report-dialog
-          :switchDialog="switchDialog"
-          @onClose="onClose()"
-        ></report-dialog>
-        <el-dialog
-          title="导入供应商"
-          append-to-body
-          :visible.sync="excelBox"
-          width="555px"
-          v-dialog-drag
-        >
-          <avue-form
-            :option="excelOption"
-            v-model="excelForm"
-            table-loading="excelLoading"
-            :upload-before="uploadBefore"
-            :upload-after="uploadAfter"
-          >
-            <template slot="excelTemplate">
-              <el-button type="primary" @click="derivation">
-                点击下载<i class="el-icon-download el-icon--right"></i>
-              </el-button>
-            </template>
-          </avue-form>
-          <p style="text-align: center;color: #DC0505">
-            温馨提示 第一次导入时请先下载模板
-          </p>
-        </el-dialog>
-      </basic-container>
-    </el-col>
-  </el-row>
+        </el-col>
+      </el-row>
+    </div>
+
+    <detail-page
+      @goBack="goBack"
+      :detailData="detailData"
+      v-if="!show"
+    ></detail-page>
+  </div>
 </template>
 
 <script>
+import detailPage from "./detailsPageEdit";
 import option from "./configuration/mainList.json";
 import {
   customerList,
@@ -132,6 +143,8 @@ export default {
   name: "customerInformation",
   data() {
     return {
+      show: true,
+      detailData: {},
       reportQuery: {},
       switchDialog: false,
       treeDeptId: "",
@@ -205,7 +218,8 @@ export default {
     };
   },
   components: {
-    reportDialog
+    reportDialog,
+    detailPage
   },
   filters: {
     adminProfileFilter(row) {
@@ -312,25 +326,16 @@ export default {
       column.addDisabled = true;
       this.$refs.crud.rowAdd();
     },
-    //查看跳转页面
-    beforeOpenPage(row, index) {
-      this.$router.push({
-        path: "/basicData/customerManagement/supplierMaterial/detailsPageEdit",
-        query: { id: JSON.stringify(row.id) }
-      });
-    },
     //新增跳转页面
-    beforeOpen(row, index) {
-      this.$router.push({
-        path: "/basicData/customerManagement/supplierMaterial/detailsPageEdit",
-        query: { id: JSON.stringify(row.id), treeDeptId: this.treeDeptId }
-      });
+    beforeOpen() {
+      this.show = false;
     },
-    editOpen(row, index) {
-      this.$router.push({
-        path: "/basicData/customerManagement/supplierMaterial/detailsPageEdit",
-        query: { id: JSON.stringify(row.id) }
-      });
+    editOpen(row, status) {
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
     },
     //点击新增时触发
     beforeClose(done) {
@@ -379,13 +384,13 @@ export default {
         }
       });
     },
-    searchCriteriaSwitch(type){
-      if (type){
-        this.option.height = this.option.height - 90
-      }else {
-        this.option.height = this.option.height + 90
+    searchCriteriaSwitch(type) {
+      if (type) {
+        this.option.height = this.option.height - 90;
+      } else {
+        this.option.height = this.option.height + 90;
       }
-      this.$refs.crud.getTableHeight()
+      this.$refs.crud.getTableHeight();
     },
     //树桩列点击展开触发
     treeLoad(tree, treeNode, resolve) {
@@ -402,6 +407,11 @@ export default {
     },
     onClose(val) {
       this.switchDialog = val;
+    },
+    goBack() {
+      this.detailData = this.$options.data().detailData;
+      this.show = true;
+      this.onLoad(this.page, this.search);
     }
   }
 };

+ 11 - 1
src/views/exportTrade/customerInquiry/detailsPage.vue

@@ -1793,9 +1793,19 @@ export default {
             }
             this.data.forEach(e => {
               const ename = e.ename ? e.ename : "";
+              const itemDescription = e.itemDescription
+                ? e.itemDescription
+                : "";
               const itemProp = e.itemProp ? e.itemProp : "";
               const partsDescribe = e.partsDescribe ? e.partsDescribe : "";
-              e.productRemark = ename + "\n" + itemProp + " " + partsDescribe;
+              e.productRemark =
+                ename +
+                "\n" +
+                itemDescription +
+                " " +
+                itemProp +
+                " " +
+                partsDescribe;
             });
           }
           for (let i = 0; i < orderFeesList.length; i++) {

+ 1 - 1
src/views/exportTrade/customerInquiry/index.vue

@@ -480,7 +480,7 @@ export default {
   height: 94.2vh;
 }
 ::v-deep .el-table__expanded-cell[class*="cell"] {
-  padding: 0px;
+  padding:0px 0px 0px 137px;
 }
 .itemTable ::v-deep .el-table {
   width: 738px;

+ 2 - 1
src/views/exportTrade/salesContract/config/customerContact.json

@@ -39,7 +39,8 @@
       "prop": "ename",
       "index": 4,
       "width": 200,
-      "overHidden": true
+      "overHidden": true,
+      "cell": true
     },
     {
       "label": "产品属性",

+ 13 - 3
src/views/exportTrade/salesContract/detailsPage.vue

@@ -1941,9 +1941,19 @@ export default {
             }
             this.data.forEach(e => {
               const ename = e.ename ? e.ename : "";
+              const itemDescription = e.itemDescription
+                ? e.itemDescription
+                : "";
               const itemProp = e.itemProp ? e.itemProp : "";
               const partsDescribe = e.partsDescribe ? e.partsDescribe : "";
-              e.productRemark = ename + "\n" + itemProp + " " + partsDescribe;
+              e.productRemark =
+                ename +
+                "\n" +
+                itemDescription +
+                " " +
+                itemProp +
+                " " +
+                partsDescribe;
             });
           }
           const orderFeesList = this.$refs.feeInfo.submitData();
@@ -2212,8 +2222,8 @@ export default {
       });
       this.checkLock(data).then(res => {
         if (res.data.code == 200) {
-       this.onLock(data).then(res => {
-      if (res.data.code == 200) {
+          this.onLock(data).then(res => {
+            if (res.data.code == 200) {
               this.detailData.status = 2;
               this.option = this.$options.data().option;
             }

+ 1 - 1
src/views/exportTrade/salesContract/index.vue

@@ -517,7 +517,7 @@ export default {
   height: 94.2vh;
 }
 ::v-deep .el-table__expanded-cell[class*="cell"] {
-  padding: 0px;
+  padding: 0px 0px 0px 137px;
 }
 .itemTable ::v-deep .el-table {
   width: 738px;