소스 검색

feat(客户管理): 客户管理列表、新增、修改

qihao 2 년 전
부모
커밋
183fe24407
2개의 변경된 파일210개의 추가작업 그리고 130개의 파일을 삭제
  1. 199 117
      src/views/saleManage/contact/components/addContactDialog.vue
  2. 11 13
      src/views/saleManage/contact/index.vue

+ 199 - 117
src/views/saleManage/contact/components/addContactDialog.vue

@@ -4,6 +4,7 @@
     :visible.sync="visible"
     v-if="visible"
     :title="title"
+    :close-on-click-modal="false"
     width="80%"
     @close="cancel"
   >
@@ -17,17 +18,29 @@
           style="margin-top: 30px"
         >
           <el-row>
+            <el-col :span="8">
+              <el-form-item
+                label="客户分类"
+                prop="categoryId"
+              >
+                <ele-tree-select
+                  :data="categoryTreeList"
+                  v-model="form.categoryId"
+                  valueKey="id"
+                  labelKey="name"
+                  placeholder="请选择"
+                  default-expand-all
+                />
+              </el-form-item>
+            </el-col>
             <el-col :span="8">
               <el-form-item label="客户名称" prop="name">
-                <el-input placeholder="请输入" v-model="form.name"></el-input>
+                <el-input placeholder="请输入" v-model="form.name" maxlength="50"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="客户代码" prop="serialNo">
-                <el-input
-                  placeholder="请输入"
-                  v-model="form.serialNo"
-                ></el-input>
+                <el-input placeholder="请输入" v-model="form.serialNo" maxlength="50"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -35,6 +48,7 @@
                 <el-input
                   placeholder="请输入"
                   v-model="form.simpleName"
+                  maxlength="50"
                 ></el-input>
               </el-form-item>
             </el-col>
@@ -42,16 +56,23 @@
               <el-form-item label="授信额度" prop="authorizationLimit">
                 <el-input
                   placeholder="请输入"
-                  v-model.number="form.authorizationLimit"
+                  v-model="form.authorizationLimit"
+                  maxlength="17"
+                  oninput ="value=value.replace(/[^0-9.]/g,'')"
                 ></el-input>
               </el-form-item>
             </el-col>
+            <el-col :span="8">
+              <el-form-item label="单位电话" prop="phone">
+                <el-input placeholder="请输入" v-model="form.phone" maxlength="20"></el-input>
+              </el-form-item>
+            </el-col>
             <el-col :span="8">
               <el-form-item label="地址" prop="addressId">
                 <el-cascader
                   clearable
                   v-model="form.addressId"
-                  :options="options.cityDataLabel"
+                  :options="options.cityData"
                   ref="address"
                   style="width: 100%"
                 ></el-cascader>
@@ -62,24 +83,20 @@
                 <el-input
                   placeholder="请输入"
                   v-model="form.address"
+                  maxlength="50"
                 ></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item
-                label="是否存在上级集团公司"
-                prop="hasParentGroup"
-                label-width="155px"
+                label="统一社会信用代码	"
+                prop="unifiedSocialCreditCode"
+                label-width="130px"
               >
-                <el-radio v-model="form.hasParentGroup" :label="1">是</el-radio>
-                <el-radio v-model="form.hasParentGroup" :label="0">否</el-radio>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="经营范围" prop="businessScope">
                 <el-input
                   placeholder="请输入"
-                  v-model="form.businessScope"
+                  v-model="form.unifiedSocialCreditCode"
+                  maxlength="18"
                 ></el-input>
               </el-form-item>
             </el-col>
@@ -94,14 +111,6 @@
                 </el-cascader>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
-              <el-form-item label="主营产品" prop="mainProduct">
-                <el-input
-                  placeholder="请输入"
-                  v-model="form.mainProduct"
-                ></el-input>
-              </el-form-item>
-            </el-col>
             <el-col :span="8">
               <el-form-item label="企业类型" prop="companyCategoryId">
                 <DictSelection
@@ -112,11 +121,6 @@
                 </DictSelection>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
-              <el-form-item label="单位电话" prop="phone">
-                <el-input placeholder="请输入" v-model="form.phone"></el-input>
-              </el-form-item>
-            </el-col>
             <el-col :span="8">
               <el-form-item label="登记日期" prop="registerDate">
                 <el-date-picker
@@ -131,29 +135,37 @@
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="官方行业" prop="officialIndustry">
+              <el-form-item label="经营范围" prop="businessScope">
                 <el-input
                   placeholder="请输入"
-                  v-model="form.officialIndustry"
+                  v-model="form.businessScope"
+                  maxlength="100"
                 ></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item
-                label="统一社会信用代码	"
-                prop="unifiedSocialCreditCode"
-                 label-width="130px"
-              >
+              <el-form-item label="主营产品" prop="mainProduct">
                 <el-input
                   placeholder="请输入"
-                  v-model="form.unifiedSocialCreditCode"
+                  v-model="form.mainProduct"
+                  maxlength="100"
                 ></el-input>
               </el-form-item>
             </el-col>
+            <el-col :span="8">
+              <el-form-item
+                label="是否存在上级集团公司"
+                prop="hasParentGroup"
+                label-width="155px"
+              >
+                <el-radio v-model="form.hasParentGroup" :label="1">是</el-radio>
+                <el-radio v-model="form.hasParentGroup" :label="0">否</el-radio>
+              </el-form-item>
+            </el-col>
             <el-col :span="8">
               <el-form-item prop="businessLicenseFile" label="营业执照附件">
                 <fileUpload
-                  v-model="form.businessLicenseFiles"
+                  v-model="form.businessLicenseFile"
                   module="main"
                   :showLib="false"
                   :limit="1"
@@ -169,6 +181,7 @@
                   :rows="2"
                   placeholder="请输入"
                   size="small"
+                  maxlength="200"
                 ></el-input>
               </el-form-item>
             </el-col>
@@ -181,6 +194,7 @@
           :columns="bankColumns"
           :datasource="tableBankData"
           height="350px"
+          :toolkit="[]"
           :need-page="false"
         >
           <!-- 表头工具栏 -->
@@ -192,17 +206,21 @@
               >删除</el-link
             >
           </template>
+          <template v-slot:accountNameHeader="{ column }">
+            <span>{{ column.label }}</span><span style="color:red">*</span>
+          </template>
+
           <template v-slot:accountName="{ row }">
-            <el-input v-model="row.accountName" placeholder="请输入"></el-input>
+            <el-input v-model="row.accountName" placeholder="请输入" maxlength="50"></el-input>
           </template>
           <template v-slot:accountNo="{ row }">
-            <el-input v-model="row.accountNo" placeholder="请输入"></el-input>
+            <el-input v-model="row.accountNo" placeholder="请输入" maxlength="50"></el-input>
           </template>
           <template v-slot:bankName="{ row }">
-            <el-input v-model="row.bankName" placeholder="请输入"></el-input>
+            <el-input v-model="row.bankName" placeholder="请输入" maxlength="50"></el-input>
           </template>
           <template v-slot:interbankNo="{ row }">
-            <el-input v-model="row.interbankNo" placeholder="请输入"></el-input>
+            <el-input v-model="row.interbankNo" placeholder="请输入" maxlength="50"></el-input>
           </template>
         </ele-pro-table>
       </el-tab-pane>
@@ -211,6 +229,7 @@
           ref="linkTable"
           :columns="linkColumns"
           :datasource="tableLinkData"
+          :toolkit="[]"
           height="350px"
           :need-page="false"
         >
@@ -223,23 +242,33 @@
               >删除</el-link
             >
           </template>
+          <template v-slot:linkNameHeader="{ column }">
+            <span>{{ column.label }}</span><span style="color:red">*</span>
+          </template>
+          <template v-slot:mobilePhoneHeader="{ column }">
+            <span>{{ column.label }}</span><span style="color:red">*</span>
+          </template>
+          <template v-slot:statusHeader="{ column }">
+            <span>{{ column.label }}</span><span style="color:red">*</span>
+          </template>
+
           <template v-slot:linkName="{ row }">
-            <el-input v-model="row.linkName" placeholder="请输入"></el-input>
+            <el-input v-model="row.linkName" placeholder="请输入" maxlength="50"></el-input>
           </template>
           <template v-slot:mobilePhone="{ row }">
-            <el-input v-model="row.mobilePhone" placeholder="请输入"></el-input>
+            <el-input v-model="row.mobilePhone" placeholder="请输入" maxlength="20"></el-input>
           </template>
           <template v-slot:phone="{ row }">
-            <el-input v-model="row.phone" placeholder="请输入"></el-input>
+            <el-input v-model="row.phone" placeholder="请输入" maxlength="20"></el-input>
           </template>
           <template v-slot:email="{ row }">
-            <el-input v-model="row.email" placeholder="请输入"></el-input>
+            <el-input v-model="row.email" placeholder="请输入" maxlength="50"></el-input>
           </template>
           <template v-slot:post="{ row }">
-            <el-input v-model="row.post" placeholder="请输入"></el-input>
+            <el-input v-model="row.post" placeholder="请输入" maxlength="20"></el-input>
           </template>
-          <template v-slot:ifChief="{ row }">
-            <el-select v-model="row.ifChief" placeholder="请选择" class="w100">
+          <template v-slot:ifChief="{ row, $index }">
+            <el-select v-model="row.ifChief" placeholder="请选择" class="w100" @change="((value)=>{ifChiefChange(value, $index)})">
               <el-option
                 v-for="item in ifChiefList"
                 :key="item.value"
@@ -255,7 +284,7 @@
             ></DictSelection>
           </template>
           <template v-slot:remark="{ row }">
-            <el-input v-model="row.remark" placeholder="请输入"></el-input>
+            <el-input v-model="row.remark" placeholder="请输入" maxlength="50"></el-input>
           </template>
         </ele-pro-table>
       </el-tab-pane>
@@ -273,6 +302,7 @@
                 <DictSelection
                   dictName="结算方式"
                   clearable
+                  @itemChange="settlementModeChange"
                   v-model="otherForm.settlementMode"
                 >
                 </DictSelection>
@@ -280,36 +310,42 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="税率" prop="taxRate">
-                <el-input v-model.number="otherForm.taxRate">
+                <el-input v-model="otherForm.taxRate" maxlength="5" oninput ="value=value.replace(/[^0-9.]/g,'')">
                   <template slot="append">%</template>
                 </el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="折扣率" prop="discount">
-                <el-input v-model.number="otherForm.discount">
+                <el-input v-model="otherForm.discount" maxlength="5" oninput ="value=value.replace(/[^0-9.]/g,'')">
                   <template slot="append">%</template>
                 </el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item
-                label="分管部门:"
+                label="分管部门"
                 prop="deptId"
                 style="margin-bottom: 22px"
               >
-                <deptSelect
+                <ele-tree-select
+                  clearable
+                  :data="groupTreeData"
                   v-model="otherForm.deptId"
-                  @changeGroup="change_principalDep"
-                  placeholder="请选择分管部门"
+                  valueKey="id"
+                  labelKey="name"
+                  placeholder="请选择"
+                  @change="change_principalDep"
+                  default-expand-all
                 />
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="业务员:" prop="salesmanId">
+              <el-form-item label="业务员" prop="salesmanId">
                 <personSelect
                   ref="directorRef"
                   v-model="otherForm.salesmanId"
+                  @selfChange="salesmanChange"
                   :init="false"
                 />
               </el-form-item>
@@ -317,14 +353,15 @@
 
             <el-col :span="8">
               <el-form-item label="寄件人" prop="sender">
-                <el-input placeholder="请输入" v-model="otherForm.sender"></el-input>
+                <el-input placeholder="请输入" v-model="otherForm.sender" maxlength="50"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="寄件人电话" prop="senderPhone">
                 <el-input
                   placeholder="请输入"
-                  v-model.number="otherForm.senderPhone"
+                  v-model="otherForm.senderPhone"
+                  maxlength="20"
                 ></el-input>
               </el-form-item>
             </el-col>
@@ -333,7 +370,7 @@
                 <el-cascader
                   clearable
                   v-model="otherForm.addressId"
-                  :options="options.cityDataLabel"
+                  :options="options.cityData"
                   ref="sendAddress"
                   style="width: 100%"
                 ></el-cascader>
@@ -345,6 +382,7 @@
                 <el-input
                   placeholder="请输入"
                   v-model="otherForm.address"
+                  maxlength="50"
                 ></el-input>
               </el-form-item>
             </el-col>
@@ -361,28 +399,19 @@
 </template>
 
 <script>
-  import {
-    contactSave,
-    contactUpdate,
-    contactDetail
-  } from '@/api/saleManage/contact';
-  import {
-    categoryData,
-    CodeToText,
-    TextToCode
-  } from 'element-china-category-data';
-  import fileUpload from '@/components/upload/fileUpload';
-  import { cityDataLabel } from 'ele-admin/packages/utils/regions';
-  import {
-    uploadFile,
-    removeFile
-  } from '@/api/system/file/index.js';
-  import dictMixins from '@/mixins/dictMixins';
-  import deptSelect from '@/components/CommomSelect/dept-select.vue';
-  import personSelect from '@/components/CommomSelect/person-select.vue';
-  export default {
+import {contactDetail, contactSave, contactUpdate} from '@/api/saleManage/contact';
+import {categoryData} from 'element-china-category-data';
+import fileUpload from '@/components/upload/fileUpload';
+import {cityData} from 'ele-admin/packages/utils/regions';
+import {removeFile, uploadFile} from '@/api/system/file/index.js';
+import dictMixins from '@/mixins/dictMixins';
+import deptSelect from '@/components/CommomSelect/dept-select.vue';
+import personSelect from '@/components/CommomSelect/person-select.vue';
+import {listOrganizations} from '@/api/system/organization';
+
+export default {
     props: {
-      categoryId: String
+      categoryTreeList: Array
     },
     mixins: [dictMixins],
     components: {
@@ -401,13 +430,13 @@
           addressId: 0,
           addressName: '',
           authorizationLimit: 0,
-          businessLicenseFiles: [],
           businessLicenseFile: {},
           businessScope: '',
           categoryId: '',
           companyCategoryId: '',
           companyCategoryName: '',
           hasParentGroup: 0,
+          industry: '',
           industryCode: '',
           industryFullName: '',
           mainProduct: '',
@@ -442,11 +471,11 @@
         ifChiefList: [
           {
             value: 0,
-            label: '非首要'
+            label: ''
           },
           {
-            value: `2`,
-            label: '首要'
+            value: 1,
+            label: ''
           }
         ],
         bankColumns: [
@@ -459,7 +488,8 @@
             label: '单位名称',
             prop: 'accountName',
             slot: 'accountName',
-            action: 'accountName'
+            action: 'accountName',
+            headerSlot: 'accountNameHeader'
           },
           {
             label: '银行账号',
@@ -476,7 +506,6 @@
           {
             label: '银行银联号',
             prop: 'interbankNo',
-            prop: 'interbankNo',
             slot: 'interbankNo',
             action: 'interbankNo'
           },
@@ -496,13 +525,15 @@
             label: '联系人名称',
             prop: 'linkName',
             slot: 'linkName',
-            action: 'linkName'
+            action: 'linkName',
+            headerSlot: 'linkNameHeader'
           },
           {
             label: '手机',
             prop: 'mobilePhone',
             slot: 'mobilePhone',
-            action: 'mobilePhone'
+            action: 'mobilePhone',
+            headerSlot: 'mobilePhoneHeader'
           },
           {
             label: '电话',
@@ -513,35 +544,31 @@
           {
             label: '邮箱',
             prop: 'email',
-            prop: 'email',
             slot: 'email',
             action: 'email'
           },
           {
             label: '职务',
             prop: 'post',
-            prop: 'post',
             slot: 'post',
             action: 'post'
           },
           {
             label: '状态',
             prop: 'status',
-            prop: 'status',
             slot: 'status',
-            action: 'status'
+            action: 'status',
+            headerSlot: 'statusHeader'
           },
           {
             label: '是否首要',
             prop: 'ifChief',
-            prop: 'ifChief',
             slot: 'ifChief',
             action: 'ifChief'
           },
           {
             label: '备注',
             prop: 'remark',
-            prop: 'remark',
             slot: 'remark',
             action: 'remark'
           },
@@ -552,6 +579,9 @@
           }
         ],
         rules: {
+          categoryId: [
+            { required: true, message: '请选择客户分类', trigger: 'change' }
+          ],
           name: [
             { required: true, message: '请输入客户名称', trigger: 'blur' }
           ],
@@ -568,36 +598,71 @@
           ]
         },
         options: {
-          cityDataLabel,
-          categoryData
+          cityData,
+          categoryData,
         },
         // 提交状态
         loading: false,
         // 是否是修改
-        isUpdate: false
+        isUpdate: false,
+
+        groupTreeData: [],
+        groupData: [],
       };
     },
+    created () {
+      this.getGroupAll();
+    },
     methods: {
-      async open(type, row) {
+      async open(type, row, contactCategoryId) {
         this.title = type;
         this.row = row;
         this.visible = true;
         if (type == '新建客户') {
+          // 默认带出列表页面选中的分类
+          this.form.categoryId = contactCategoryId;
         } else {
           this.isUpdate = true;
-        this._getById(row.id);
+          await this._getById(row.id);
         }
       },
 
+      // 获取公司数据
+      getGroupAll () {
+        listOrganizations().then((list) => {
+          this.groupData = list;
+          this.groupTreeData = this.$util.toTreeData({
+            data: list,
+            idField: 'id',
+            parentIdField: 'parentId'
+          });
+        });
+      },
+
       // 选择负责人部门
-      change_principalDep(id, info) {
+      change_principalDep(id) {
+        const info = this.groupData.find(e => e.id == id);
+        this.otherForm.deptName = info.name;
         this.otherForm.salesmanId = '';
+        this.otherForm.salesmanName = '';
         // 根据部门获取人员
         const params = { groupId: id };
         this.$nextTick(() => {
           this.$refs.directorRef.getList(params);
         });
       },
+      salesmanChange(val, info){
+        this.otherForm.salesmanName = info.name;
+      },
+      settlementModeChange(info){
+        this.otherForm.settlementModeName = info.dictValue;
+      },
+      ifChiefChange(value, idx){
+        if(value === 1){
+          this.tableLinkData.forEach(e => e.ifChief = 0);
+          this.tableLinkData[idx].ifChief = 1;
+        }
+      },
       addBank() {
         this.tableBankData.push({
           accountName: '',
@@ -625,7 +690,7 @@
         }
       },
       handleLinkDel(row, index) {
-        this.linkColumns.splice(index, 1);
+        this.tableLinkData.splice(index, 1);
         if (row?.id) {
         //   this.removeLinkList.push(row.id);
         }
@@ -636,22 +701,25 @@
         if (!isBaseValid || !isOtherValid) {
           return false;
         }
+        if(this.tableLinkData && this.tableLinkData.length === 0){
+          this.$message.error("联系人信息至少有1条");
+          return false;
+        }
 
         this.loading = true;
         // 基本信息处理
-        this.form.categoryId = this.categoryId;
-        debugger
+        // this.form.categoryId = this.categoryId;
         if (this.$refs.address.getCheckedNodes()) {
           let node = this.$refs.address.getCheckedNodes()[0];
           if (node) {
-            this.form.addressId = node.path.join();;
+            this.form.addressId = node.path.join();
             this.form.addressName = node.pathLabels.join();
           }
         }
         if (this.$refs.industry.getCheckedNodes()) {
           let node = this.$refs.industry.getCheckedNodes()[0];
           if (node) {
-            this.form.industryCode = node.path.join();;
+            this.form.industryCode = node.path.join();
             this.form.industryFullName = node.pathLabels.join();
           }
         }
@@ -661,12 +729,6 @@
             this.form.companyCategoryId
           );
         }
-        if (
-          this.form.businessLicenseFiles &&
-          this.form.businessLicenseFiles.length > 0
-        ) {
-          this.form.businessLicenseFile = this.form.businessLicenseFile[0];
-        }
         // 其他信息处理
         if (this.form.settlementMode) {
           this.form.settlementModeName = this.getDictValue(
@@ -677,7 +739,7 @@
         if (this.$refs.sendAddress.getCheckedNodes()) {
           let node = this.$refs.sendAddress.getCheckedNodes()[0];
           if (node) {
-            this.otherForm.addressId = node.path.join();;
+            this.otherForm.addressId = node.path.join();
             this.otherForm.addressName = node.pathLabels.join();
           }
         }
@@ -694,7 +756,6 @@
           bankList: this.tableBankData,
           linkList: this.tableLinkData
         };
-
         if (this.isUpdate) {
           contactUpdate(data)
             .then((res) => {
@@ -704,7 +765,7 @@
               this.$emit('done');
             })
             .catch((e) => {
-              this.loading = false;
+              //this.loading = false;
             });
         } else {
           contactSave(data)
@@ -715,7 +776,7 @@
               this.$emit('done');
             })
             .catch((e) => {
-              this.loading = false;
+              //this.loading = false;
             });
         }
       },
@@ -728,6 +789,27 @@
         this.otherForm = data.other;
         this.tableBankData = data.bankList;
         this.tableLinkData = data.linkList;
+        if(this.tableLinkData && this.tableLinkData.length > 0){
+          this.tableLinkData.forEach(e => e.status = e.status+"");
+        }
+        this.otherForm.settlementMode = this.otherForm.settlementMode + "";
+        // 回显地址选择器
+        if(this.form.addressId && this.form.addressId.length > 0){
+          this.form.addressId = this.form.addressId.split(",");
+        }
+        if(this.otherForm.addressId && this.otherForm.addressId.length > 0){
+          this.otherForm.addressId = this.otherForm.addressId.split(",");
+        }
+        // 回显行业
+        if(this.form.industryCode && this.form.industryCode.length > 0){
+          this.form.industry = this.form.industryCode.split(",");
+        }
+        if(this.otherForm.deptId) {
+          // 编辑时,默认查询组织相关的用户列表,用于回显
+          this.$nextTick(async () => {
+            await this.$refs.directorRef.getList({groupId: this.otherForm.deptId});
+          })
+        }
       },
       // 文件上传
       async handlSuccess(params) {

+ 11 - 13
src/views/saleManage/contact/index.vue

@@ -81,7 +81,7 @@
         </template>
       </ele-split-layout>
     </el-card>
-    <AddContactDialog ref="addContactDialogRef" :categoryId="curNode.id" @done="reload"></AddContactDialog>
+    <AddContactDialog ref="addContactDialogRef" :categoryTreeList="treeList" @done="reload"></AddContactDialog>
 
   </div>
 </template>
@@ -173,7 +173,7 @@
           }
         ],
         current: {},
-        curNode: {},
+        curNodeData: {},
         treeList: [],
         treeLoading: false,
         formData: {},
@@ -202,14 +202,13 @@
       async getTreeData() {
         try {
           this.treeLoading = true;
-
           const res = await contactTypeTree({ type: 17 });
           this.treeLoading = false;
           if (res?.code === '0') {
             this.treeList = res.data;
-            if(this.treeList && this.treeList[0]) {
-              this.curNode = this.treeList[0]
-            }
+            // if(this.treeList && this.treeList[0]) {
+            //   this.curNode = this.treeList[0]
+            // }
             this.$nextTick(() => {
               // 默认高亮第一级树节点
               // if (this.treeList[0]) {
@@ -223,8 +222,8 @@
         this.treeLoading = false;
       },
       handleNodeClick(data, node) {
-        this.curNode = node;
-        this.pathList = this.findParent([], data, this.treeList);
+        this.curNodeData = data;
+        /*this.pathList = this.findParent([], data, this.treeList);
         this.rootTreeId = null;
         if (this.pathList.length == 0) {
           this.rootTreeId = data.id;
@@ -232,12 +231,11 @@
           this.rootTreeId =
             this.pathList[this.pathList.length - 1] &&
             this.pathList[this.pathList.length - 1].id;
-        }
-
+        }*/
         this.reload({ categoryId: data.id });
       },
       // parents:用于返回的数组,childNode:要查询的节点,treeList:json树形数据
-      findParent(parents, childNode, treeList) {
+      /*findParent(parents, childNode, treeList) {
         for (let i = 0; i < treeList.length; i++) {
           // 父节点查询条件
           if (treeList[i].id === childNode.parentId) {
@@ -254,7 +252,7 @@
           }
         }
         return parents;
-      },
+      },*/
       /* 刷新表格 */
       reload(where) {
         this.$refs.table.reload({ page: 1, where });
@@ -262,7 +260,7 @@
       openEdit(row, type) {
         this.current = row;
         this.showEdit = true;
-        this.$refs.addContactDialogRef.open(row, type);
+        this.$refs.addContactDialogRef.open(row, type, this.curNodeData.id);
         this.$refs.addContactDialogRef.$refs.form &&
         this.$refs.addContactDialogRef.$refs.form.clearValidate();
       },