瀏覽代碼

提交代码

caojunjie 3 年之前
父節點
當前提交
c67974e6b3

+ 34 - 0
src/components/e-crop-jump/index.vue

@@ -0,0 +1,34 @@
+<template>
+  <span style="color: #409EFF;cursor: pointer" @click.stop="jump">{{label}}:</span>
+</template>
+
+<script>
+export default {
+  name: "index",
+  props: {
+    label: String,
+    value:String,
+    corpType: String,
+  },
+  methods:{
+    jump(){
+      console.log(this.value)
+      if (this.corpType == 'DD'){
+        this.$router.push({
+          path: '/basicData/portinformation/index',
+          query: {customerName: this.value},
+        });
+      }else {
+        this.$router.push({
+          path: '/basicData/customerInformation/index',
+          query: {customerName: this.value},
+        });
+      }
+    },
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 149 - 0
src/components/e-crop-select/main.vue

@@ -0,0 +1,149 @@
+<template>
+  <div style="display: flex;">
+    <el-select
+        v-model="value"
+        placeholder="请选择"
+        filterable
+        clearable
+        allow-create
+        default-first-option
+        @change="getKeyId(value)" :disabled="disabled">
+      <template>
+        <el-option v-for="item in corpList" :key="item.id" :label="corpType == 'DD'?item.name:corpType == 'DD-ID'?item.name:item.cname" :value="item.id">
+        </el-option>
+      </template>
+    </el-select>
+    <el-tooltip class="item" effect="dark" content="获取最新客户资料" placement="top-start">
+      <el-button icon="el-icon-refresh" size="mini" v-if="label != 'shortName'" :disabled="disabled"
+                 @click="refreshData"></el-button>
+    </el-tooltip>
+  </div>
+</template>
+
+<script>
+import {allCropList} from "@/api/basicData/customerInformation";
+import {kMaxLength} from "buffer";
+import {getAllList} from "@/api/basicData/portinformation";
+
+export default {
+  name: "main",
+  data() {
+    return {
+      form: {},
+      corpList: []
+    };
+  },
+  props: {
+    value: String,
+    name: String,
+    label: String,
+    corpType: String,
+    disabled: Boolean
+  },
+  model: {
+    prop: "value",
+    event: "balabala",
+  },
+  created() {
+    this.getCorpList()
+  },
+  methods: {
+    getCorpList(type) {
+      let userObj = JSON.parse(localStorage.getItem("saber-userInfo")).content;
+      if (this.corpType == 'DD'){
+        getAllList().then(res => {
+          this.corpList = res.data.data;
+          if (type) {
+            for (let item of this.corpList) {
+              if (item.name == this.value) {
+                return this.getKeyId(item.id)
+              }
+            }
+            for (let item of this.corpList) {
+              if (item.id == this.value) {
+                return this.getKeyId(item.id)
+              }
+            }
+          }
+        });
+      }else if(this.corpType == 'DD-ID'){
+        getAllList().then(res => {
+          this.corpList = res.data.data;
+          if (type) {
+            for (let item of this.corpList) {
+              if (item.name == this.value) {
+                return this.getKeyId(item.id)
+              }
+            }
+            for (let item of this.corpList) {
+              if (item.id == this.value) {
+                return this.getKeyId(item.id)
+              }
+            }
+          }
+        });
+      }else {
+        allCropList({
+          corpType: this.corpType ? this.corpType : 'KH',
+          adminProfiles: userObj.role_name != "admin" ? userObj.user_id : null
+        }).then(res => {
+          this.corpList = res.data.data;
+          if (type) {
+            for (let item of this.corpList) {
+              if (item.cname == this.value) {
+                return this.getKeyId(item.id)
+              }
+            }
+            for (let item of this.corpList) {
+              if (item.id == this.value) {
+                return this.getKeyId(item.id)
+              }
+            }
+          }
+        });
+      }
+    },
+    refreshData() {
+      this.getCorpList(true)
+    },
+    getKeyId(row) {
+      console.log(row)
+      if (row) {
+        let res = this.corpList.find(e => {
+          return e.id == row
+        })
+        if (res) {
+          if (this.corpType == 'DD'){
+            this.$emit('balabala',res.name)
+            this.$emit('getCropId', res)
+          }else if (this.corpType == 'DD-ID'){
+            this.$emit('balabala',res.id)
+            this.$emit('getCropId', res)
+          }else {
+            this.$emit('balabala',res.id)
+            this.$emit('getCropId', res)
+          }
+        } else {
+          if (this.corpType == 'DD'){
+            this.$emit('update:name', row);
+          }else if (this.corpType == 'DD-ID'){
+            this.$emit('update:name', row);
+          }else {
+            this.$emit('update:name', row);
+          }
+          this.$emit('balabala',row)
+          this.$emit('getCropId', null)
+        }
+      } else {
+        this.$emit('balabala', null)
+        this.$emit('getCropId', null)
+      }
+
+    }
+  },
+  watch: {}
+};
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 6 - 0
src/main.js

@@ -53,6 +53,10 @@ import messagePost from "@/components/messageSend/main"
 import changeApprove from "@/components/change-approve/main"
 //仓库客户组件
 import warehousKH from '@/components/warehousKH/main';
+//仓库客户组件
+import eCropSelect from '@/components/e-crop-select/main';
+// 标题跳转组件
+import eCropJump from '@/components/e-crop-jump/index';
 //枚举列设置名称管理
 import {
   getColumnName
@@ -87,6 +91,8 @@ Vue.component('cropSelect', cropSelect);
 Vue.component('messagePost', messagePost);
 Vue.component('changeApprove', changeApprove)
 Vue.component('warehousKh', warehousKH)
+Vue.component('eCropSelect', eCropSelect)
+Vue.component('eCropJump', eCropJump)
 import portInfo from "@/components/port-info/index";
 Vue.component('portInfo', portInfo);
 // 注册全局crud驱动

+ 19 - 5
src/views/basicData/customerInformation/detailsPageEdit.vue

@@ -843,7 +843,11 @@ export default {
     this.getWorkDicts("credit_rating").then(res => {
       this.creditRatingList = res.data.data;
     });
-
+    if (this.$route.query.customerName){
+      this.returnButton = true
+    }else {
+      this.returnButton = true
+    }
     if (this.detailData.id) {
       detail(this.detailData.id).then(res => {
         if (res.data.data.adminProfiles) {
@@ -867,11 +871,17 @@ export default {
       });
     } else if (this.detailData.treeDeptId) {
       this.$set(this.form, "corpsTypeId", this.detailData.treeDeptId);
-      if (this.$route.query) {
+      if (this.$route.query.customerName){
+        this.$set(this.form, "cname", this.$route.query.customerName);
+        this.$router.$avueRouter.closeTag(window.location.hash.slice(1))
+      }else if (this.$route.query) {
         this.$set(this.form, "cname", this.$route.query.corpName);
       }
     } else {
-      if (this.$route.query) {
+      if (this.$route.query.customerName){
+        this.$set(this.form, "cname", this.$route.query.customerName);
+        this.$router.$avueRouter.closeTag(window.location.hash.slice(1))
+      }else if (this.$route.query) {
         this.$set(this.form, "cname", this.$route.query.corpName);
       }
     }
@@ -1331,8 +1341,12 @@ export default {
         }
       });
     },
-    backToList() {
-      this.$emit("goBack");
+    backToList(value) {
+      if (value == '0'){
+        this.$emit("goBack");
+      }else {
+        this.$emit('goBack', true)
+      }
     },
     openFlow() {
       this.switchDialog = !this.switchDialog;

+ 135 - 124
src/views/basicData/customerInformation/index.vue

@@ -7,9 +7,9 @@
             <el-scrollbar>
               <basic-container>
                 <avue-tree
-                  :option="treeOption"
-                  :data="treeData"
-                  @node-click="nodeClick"
+                    :option="treeOption"
+                    :data="treeData"
+                    @node-click="nodeClick"
                 />
               </basic-container>
             </el-scrollbar>
@@ -18,66 +18,66 @@
         <el-col :span="19">
           <basic-container class="page-crad">
             <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.sync="search"
-              @search-change="searchChange"
-              @search-reset="searchReset"
-              @selection-change="selectionChange"
-              @current-change="currentChange"
-              @size-change="sizeChange"
-              @refresh-change="refreshChange"
-              @saveColumn="saveColumn"
-              @resetColumn="resetColumn"
-              @on-load="onLoad"
-              @tree-load="treeLoad"
-              @search-criteria-switch="searchCriteriaSwitch"
+                :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.sync="search"
+                @search-change="searchChange"
+                @search-reset="searchReset"
+                @selection-change="selectionChange"
+                @current-change="currentChange"
+                @size-change="sizeChange"
+                @refresh-change="refreshChange"
+                @saveColumn="saveColumn"
+                @resetColumn="resetColumn"
+                @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"
-                  >导入
+                    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()"
-                  >报表打印
+                    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)"
-                  >查看
+                    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)"
-                  >编辑
+                    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)"
-                  >删除
+                    type="text"
+                    icon="el-icon-delete"
+                    size="small"
+                    @click.stop="rowDel(scope.row, scope.index)"
+                >删除
                 </el-button>
               </template>
               <template slot="adminProfiles" slot-scope="{ row }">
@@ -88,32 +88,32 @@
               </template>
             </avue-crud>
             <report-dialog
-              :switchDialog="switchDialog"
-              reportName="客户资料-客户资料"
-              @onClose="onClose()"
-              v-if="$store.getters.userInfo.tenant_id == '096359'"
+                :switchDialog="switchDialog"
+                reportName="客户资料-客户资料"
+                @onClose="onClose()"
+                v-if="$store.getters.userInfo.tenant_id == '096359'"
             ></report-dialog>
             <report-dialog
-              :switchDialog="switchDialog"
-              reportName="客户信息"
-              corpType="KH"
-              @onClose="onClose()"
-              v-else
+                :switchDialog="switchDialog"
+                reportName="客户信息"
+                corpType="KH"
+                @onClose="onClose()"
+                v-else
             ></report-dialog>
             <el-dialog
-              title="导入客户"
-              append-to-body
-              :visible.sync="excelBox"
-              width="555px"
-              :close-on-click-modal="false"
-              v-dialog-drag
+                title="导入客户"
+                append-to-body
+                :visible.sync="excelBox"
+                width="555px"
+                :close-on-click-modal="false"
+                v-dialog-drag
             >
               <avue-form
-                :option="excelOption"
-                v-model="excelForm"
-                table-loading="excelLoading"
-                :upload-before="uploadBefore"
-                :upload-after="uploadAfter"
+                  :option="excelOption"
+                  v-model="excelForm"
+                  table-loading="excelLoading"
+                  :upload-before="uploadBefore"
+                  :upload-after="uploadAfter"
               >
                 <template slot="excelTemplate">
                   <el-button type="primary" @click="derivation">
@@ -131,9 +131,9 @@
     </div>
 
     <detail-page
-      @goBack="goBack"
-      :detailData="detailData"
-      v-if="!show"
+        @goBack="goBack"
+        :detailData="detailData"
+        v-if="!show"
     ></detail-page>
   </div>
 </template>
@@ -148,10 +148,11 @@ import {
   deleteDetails,
   getDeptLazyTree
 } from "@/api/basicData/customerInformation";
-import { getToken } from "@/util/auth";
+import {getToken} from "@/util/auth";
 import reportDialog from "@/components/report-dialog/main";
-import { customerParameter } from "@/enums/management-type";
-import { gainUser } from "@/api/basicData/customerInquiry";
+import {customerParameter} from "@/enums/management-type";
+import {gainUser} from "@/api/basicData/customerInquiry";
+
 export default {
   name: "customerInformation",
   data() {
@@ -162,26 +163,26 @@ export default {
       switchDialog: false,
       treeDeptId: "",
       form: {},
-      search:{},
+      search: {},
       option: option,
       parentId: 0,
       dataList: [],
       treeOption: {
         nodeKey: "id",
         lazy: true,
-        treeLoad: function(node, resolve) {
+        treeLoad: function (node, resolve) {
           const parentId = node.level === 0 ? 0 : node.data.id;
           getDeptLazyTree({
             parentId: parentId,
             corpType: customerParameter.code
           }).then(res => {
             resolve(
-              res.data.data.map(item => {
-                return {
-                  ...item,
-                  leaf: !item.hasChildren
-                };
-              })
+                res.data.data.map(item => {
+                  return {
+                    ...item,
+                    leaf: !item.hasChildren
+                  };
+                })
             );
           });
         },
@@ -242,17 +243,22 @@ export default {
       }
     }
   },
- async created() {
+  async created() {
     this.option = await this.getColumnData(this.getColumnName(142), option);
     gainUser().then(res => {
       this.findObject(this.option.column, "adminProfiles").dicData =
-        res.data.data;
+          res.data.data;
     });
   },
-  activated(){
-    if(this.$route.query.corpId){
-      this.editOpen({id:this.$route.query.corpId},1)
-    }else{
+  activated() {
+    if (this.$route.query.corpId) {
+      this.editOpen({id: this.$route.query.corpId}, 1)
+    } else if (this.$route.query.customerName) {
+      this.show = false;
+      this.detailData = {
+        treeDeptId: this.treeDeptId
+      };
+    } else {
       this.beforeOpen()
     }
   },
@@ -267,9 +273,9 @@ export default {
   methods: {
     derivation() {
       window.open(
-        `/api/blade-client/corpsdesc/export-template?${
-          this.website.tokenHeader
-        }=${getToken()}`
+          `/api/blade-client/corpsdesc/export-template?${
+              this.website.tokenHeader
+          }=${getToken()}`
       );
     },
     uploadBefore(file, done, loading) {
@@ -295,37 +301,37 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       })
-        .then(() => {
-          return deleteDetails({
-            id: row.id,
-            corpsTypeId: row.corpsTypeId,
-            corpType: "KH"
-          });
-        })
-        .then(() => {
-          this.$message({
-            type: "success",
-            message: "操作成功!"
+          .then(() => {
+            return deleteDetails({
+              id: row.id,
+              corpsTypeId: row.corpsTypeId,
+              corpType: "KH"
+            });
+          })
+          .then(() => {
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.page.currentPage = 1;
+            this.onLoad(this.page, {parentId: 0});
           });
-          this.page.currentPage = 1;
-          this.onLoad(this.page, { parentId: 0 });
-        });
     },
     //修改时的修改按钮点击触发
     rowUpdate(row, index, done, loading) {
       typeSave(row).then(
-        () => {
-          this.$message({
-            type: "success",
-            message: "操作成功!"
-          });
-          // 数据回调进行刷新
-          done(row);
-        },
-        error => {
-          window.console.log(error);
-          loading();
-        }
+          () => {
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            // 数据回调进行刷新
+            done(row);
+          },
+          error => {
+            window.console.log(error);
+            loading();
+          }
       );
     },
     //新增修改时保存触发
@@ -337,7 +343,7 @@ export default {
     },
     //查询全部
     initData() {
-      customerList({ corpType: customerParameter.code }).then(res => {
+      customerList({corpType: customerParameter.code}).then(res => {
         console.log(this.form);
         const column = this.findObject(this.option.column, "parentId");
         column.dicData = res.data.data.records;
@@ -397,7 +403,7 @@ export default {
     refreshChange() {
       this.onLoad(this.page);
     },
-    onLoad(page, params = { parentId: 0 }) {
+    onLoad(page, params = {parentId: 0}) {
       let queryParams = Object.assign({}, params, {
         size: page.pageSize,
         current: page.currentPage,
@@ -438,8 +444,8 @@ export default {
     },
     async saveColumn() {
       const inSave = await this.saveColumnData(
-        this.getColumnName(142),
-        this.option
+          this.getColumnName(142),
+          this.option
       );
       if (inSave) {
         this.$nextTick(() => {
@@ -461,9 +467,14 @@ export default {
         this.$refs.crud.$refs.dialogColumn.columnBox = false;
       }
     },
-    goBack() {
+    goBack(type) {
       this.detailData = this.$options.data().detailData;
       this.show = true;
+      if (type){
+        this.$router.push({
+          path: '/basicData/customerInformation/index'
+        });
+      }
       this.onLoad(this.page, this.search);
     }
   }

+ 7 - 0
src/views/basicData/portinformation/index.vue

@@ -110,6 +110,13 @@
     components: {
       reportDialog
     },
+    activated() {
+      this.$set(this.form, "name", this.$route.query.customerName);
+      this.$router.$avueRouter.closeTag(window.location.hash.slice(1))
+      this.$router.push({ query: {} });
+      // console.log(this.form.name)
+      // this.$refs.crud.beforeOpen()
+    },
     mounted() {
       option.height = window.innerHeight - 210 ;
       //查询服务类别字典项

+ 24 - 5
src/views/landTransportation/bulkCargo/detailPage.vue

@@ -135,13 +135,22 @@
     </trade-card>
     <trade-card title="委托信息">
       <avue-form :option="goodsOptionForm" ref="goodsForm" v-model="goodsForm">
+        <template slot-scope="{}" slot="corpIdLabel">
+          <e-crop-jump label="公司名称" corp-type="KH"></e-crop-jump>
+        </template>
         <template slot-scope="scope" slot="corpId">
-          <crop-select
-              :disabled="goodsForm.status !== 0"
+<!--          <crop-select-->
+<!--              :disabled="goodsForm.status !== 0"-->
+<!--              v-model="goodsForm.corpId"-->
+<!--              @getCorpData="getCorpData"-->
+<!--              :corpType="'KH'"-->
+<!--          ></crop-select>-->
+          <e-crop-select
               v-model="goodsForm.corpId"
-              @getCorpData="getCorpData"
-              :corpType="'KH'"
-          ></crop-select>
+              corp-type="KH"
+              :disabled="goodsForm.status !== 0"
+              @getCropId="getCropId"
+          />
         </template>
         <template slot-scope="scope" slot="station">
           <port-info
@@ -2912,6 +2921,16 @@ export default {
       //查询业务员
       this.salesmanQuery()
     },
+    getCropId(row){
+      if (row){
+        this.goodsForm.corpId = row.id
+        this.goodsForm.corpName = row.cname
+        this.goodsForm.belongCompany = row.belongCompany
+        this.goodsForm.salesman = ''
+        //查询业务员
+        this.salesmanQuery()
+      }
+    },
     clear(row) {
       row.corpName = ''
     },

+ 80 - 10
src/views/landTransportation/placeAnOrder/detailPage.vue

@@ -90,17 +90,36 @@
     </trade-card>
     <trade-card title="委托信息">
       <avue-form :option="goodsOptionForm" ref="goodsForm" v-model="goodsForm">
+        <template slot-scope="{}" slot="corpIdLabel">
+          <e-crop-jump label="公司名称" corp-type="KH" :value="goodsForm.corpName"></e-crop-jump>
+        </template>
         <template slot-scope="scope" slot="corpId">
-          <crop-select
-              :disabled="goodsForm.status !== 0"
+<!--          <crop-select-->
+<!--              :disabled="goodsForm.status !== 0"-->
+<!--              v-model="goodsForm.corpId"-->
+<!--              @getCorpData="getCorpData"-->
+<!--              :corpType="'KH'"-->
+<!--          ></crop-select>-->
+          <e-crop-select
               v-model="goodsForm.corpId"
-              @getCorpData="getCorpData"
-              :corpType="'KH'"
-          ></crop-select>
+              :name.sync="goodsForm.corpName"
+              corp-type="KH"
+              :disabled="goodsForm.status !== 0"
+              @getCropId="getCropId"
+          />
+        </template>
+        <template slot-scope="{}" slot="stationLabel">
+          <e-crop-jump label="场站" corp-type="DD" :value="goodsForm.station"></e-crop-jump>
         </template>
         <template slot-scope="scope" slot="station">
-          <port-info
+<!--          <port-info-->
+<!--              v-model="goodsForm.station"-->
+<!--              :disabled="goodsForm.status !== 0"-->
+<!--          />-->
+          <e-crop-select
               v-model="goodsForm.station"
+              corp-type="DD"
+              :name.sync="goodsForm.station"
               :disabled="goodsForm.status !== 0"
           />
         </template>
@@ -167,20 +186,61 @@
               v-model="goodsForm.agentId"
           ></crop-select>
         </template>
+        <template slot-scope="{}" slot="agentIdLabel">
+          <e-crop-jump label="订舱代理" corp-type="KH" :value="goodsForm.agentName"></e-crop-jump>
+        </template>
+        <template slot-scope="scope" slot="agentId">
+          <!--          <crop-select-->
+          <!--              :disabled="goodsForm.status !== 0"-->
+          <!--              v-model="goodsForm.corpId"-->
+          <!--              @getCorpData="getCorpData"-->
+          <!--              :corpType="'KH'"-->
+          <!--          ></crop-select>-->
+          <e-crop-select
+              v-model="goodsForm.agentId"
+              corp-type="KH"
+              :name.sync="goodsForm.agentName"
+              :disabled="goodsForm.status !== 0"
+              @getCropId="getCropId"
+          />
+        </template>
+<!--        <template slot-scope="scope" slot="polId">-->
+<!--          <port-info-->
+<!--              :type="'id'"-->
+<!--              v-model="goodsForm.polId"-->
+<!--              :disabled="goodsForm.status !== 0"-->
+<!--          />-->
+<!--        </template>-->
+        <template slot-scope="{}" slot="polIdLabel">
+          <e-crop-jump label="起运港" corp-type="DD" :value="goodsForm.polName"></e-crop-jump>
+        </template>
         <template slot-scope="scope" slot="polId">
-          <port-info
-              :type="'id'"
+          <e-crop-select
               v-model="goodsForm.polId"
+              corp-type="DD-ID"
+              :name.sync="goodsForm.polName"
               :disabled="goodsForm.status !== 0"
           />
         </template>
+
+        <template slot-scope="{}" slot="podIdLabel">
+          <e-crop-jump label="目的港" corp-type="DD" :value="goodsForm.podName"></e-crop-jump>
+        </template>
         <template slot-scope="scope" slot="podId">
-          <port-info
-              :type="'id'"
+          <e-crop-select
               v-model="goodsForm.podId"
+              corp-type="DD-ID"
+              :name.sync="goodsForm.podName"
               :disabled="goodsForm.status !== 0"
           />
         </template>
+<!--        <template slot-scope="scope" slot="podId">-->
+<!--          <port-info-->
+<!--              :type="'id'"-->
+<!--              v-model="goodsForm.podId"-->
+<!--              :disabled="goodsForm.status !== 0"-->
+<!--          />-->
+<!--        </template>-->
       </avue-form>
     </trade-card>
     <trade-card title="箱信息" v-if="goodsForm.status === 0 || !goodsForm.status">
@@ -1634,6 +1694,16 @@ export default {
       //   // console.log(this.lineArr[this.lineArr.length - 1])
       // })
     },
+    getCropId(row){
+      if (row){
+        this.goodsForm.corpId = row.id
+        this.goodsForm.corpName = row.cname
+        this.goodsForm.belongCompany = row.belongCompany
+        this.goodsForm.salesman = ''
+        //查询业务员
+        this.salesmanQuery()
+      }
+    },
     changeSelect(val) {
       for (let item of this.salesmanList) {
         if (item.id == val) {

+ 5 - 2
src/views/saleLeads/detail.vue

@@ -38,8 +38,11 @@
             <span style="color: #409EFF;cursor: pointer" @click.stop="khEdit">客户名称:</span>
           </template>
           <template slot-scope="{row,index}" slot="corpName">
-            <warehous-Kh v-model="form.corpName" :zhKey="true" :disabled="disabled || approvalStatus"
-              @getCropId="getCropId"></warehous-Kh>
+            <warehous-Kh
+                v-model="form.corpName"
+                :zhKey="true"
+                :disabled="disabled || approvalStatus"
+                @getCropId="getCropId"></warehous-Kh>
           </template>
           <template slot="fromUser">
             <el-select v-model="form.fromUser" filterable clearable size="small" :disabled="disabled || approvalStatus">