zhujun 2 лет назад
Родитель
Сommit
8b6d36c061

+ 6 - 1
src/components/AssetTree/index.vue

@@ -48,6 +48,11 @@
         type: Boolean,
         default: true
       },
+     
+      isFirstRefreshTable:{
+        type: Boolean,
+        default: true
+      },
       id: {
         type: String,
         default: '0'
@@ -94,7 +99,7 @@
             }
             this.$nextTick(() => {
               // 默认高亮第一级树节点
-              if (this.treeList[0]) {
+              if (this.treeList[0]&&this.isFirstRefreshTable) {
                 this.setCurrentKey(this.treeList[0].id);
                 this.handleNodeClick(
                   this.treeList[0],

+ 1 - 0
src/components/upload/fileUpload.vue

@@ -176,6 +176,7 @@
     methods: {
       //点击查看图片
       handleItem(file){
+        console.log(file,'5555')
        getFile({ objectName: file.storePath }, file.name);
       },
       delFileList () {

+ 885 - 0
src/views/purchasingManage/supplierManage/components/addContactDialog.vue

@@ -0,0 +1,885 @@
+<template>
+  <ele-modal
+    custom-class="ele-dialog-form"
+    v-if="visible"
+    :visible.sync="visible"
+    :title="title"
+    :close-on-click-modal="false"
+    width="80%"
+    @close="cancel"
+  >
+
+    <el-tabs v-model="activeName" type="card">
+      <el-tab-pane label="基本信息" name="base">
+        <el-form
+          label-width="100px"
+          ref="form"
+          :model="form"
+          :rules="rules"
+          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" 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" maxlength="50"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="供应商简称" prop="simpleName">
+                <el-input
+                  placeholder="请输入"
+                  v-model="form.simpleName"
+                  maxlength="50"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="授信额度" prop="authorizationLimit">
+                <el-input
+                  placeholder="请输入"
+                  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.cityData"
+                  ref="address"
+                  style="width: 100%"
+                ></el-cascader>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="详细地址" prop="address">
+                <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="unifiedSocialCreditCode"
+                label-width="130px"
+              >
+                <el-input
+                  placeholder="请输入"
+                  v-model="form.unifiedSocialCreditCode"
+                  maxlength="18"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="所属行业" prop="industry">
+                <el-cascader
+                  :options="options.categoryData"
+                  v-model="form.industry"
+                  style="width: 100%"
+                  ref="industry"
+                >
+                </el-cascader>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="企业类型" prop="companyCategoryId">
+                <DictSelection
+                  dictName="企业类型"
+                  clearable
+                  v-model="form.companyCategoryId"
+                >
+                </DictSelection>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="登记日期" prop="registerDate">
+                <el-date-picker
+                  style="width: 100%"
+                  clearable
+                  v-model="form.registerDate"
+                  type="date"
+                  value-format="yyyy-MM-dd"
+                  placeholder="请选择日期"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="经营范围" prop="businessScope">
+                <el-input
+                  placeholder="请输入"
+                  v-model="form.businessScope"
+                  maxlength="100"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="主营产品" prop="mainProduct">
+                <el-input
+                  placeholder="请输入"
+                  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="businessLicenseFiles" label="营业执照附件">
+                <fileUpload
+                  v-model="form.businessLicenseFiles"
+                  module="main"
+                  :showLib="false"
+                  :limit="1"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="16">
+              <el-form-item label="备注" prop="remark">
+                <el-input
+                  type="textarea"
+                  resize="none"
+                  v-model="form.remark"
+                  :rows="2"
+                  placeholder="请输入"
+                  size="small"
+                  maxlength="200"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </el-tab-pane>
+      <el-tab-pane label="银行信息" name="bank">
+        <ele-pro-table
+          ref="table"
+          :columns="bankColumns"
+          :datasource="tableBankData"
+          height="350px"
+          :toolkit="[]"
+          :need-page="false"
+        >
+          <!-- 表头工具栏 -->
+          <template v-slot:toolbar>
+            <el-button type="primary" @click="addBank">添加</el-button>
+          </template>
+          <template v-slot:action="{ row, $index }">
+            <el-link type="primary" @click="handleBankDel(row, $index)"
+              >删除</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="请输入" maxlength="50"></el-input>
+          </template>
+          <template v-slot:accountNo="{ row }">
+            <el-input v-model="row.accountNo" placeholder="请输入" maxlength="50"></el-input>
+          </template>
+          <template v-slot:bankName="{ row }">
+            <el-input v-model="row.bankName" placeholder="请输入" maxlength="50"></el-input>
+          </template>
+          <template v-slot:interbankNo="{ row }">
+            <el-input v-model="row.interbankNo" placeholder="请输入" maxlength="50"></el-input>
+          </template>
+        </ele-pro-table>
+      </el-tab-pane>
+      <el-tab-pane label="联系人信息" name="link">
+        <ele-pro-table
+          ref="linkTable"
+          :columns="linkColumns"
+          :datasource="tableLinkData"
+          :toolkit="[]"
+          height="350px"
+          :need-page="false"
+        >
+          <!-- 表头工具栏 -->
+          <template v-slot:toolbar>
+            <el-button type="primary" @click="addLink">添加</el-button>
+          </template>
+          <template v-slot:action="{ row, $index }">
+            <el-link type="primary" @click="handleLinkDel(row, $index)"
+              >删除</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="请输入" maxlength="50"></el-input>
+          </template>
+          <template v-slot:mobilePhone="{ row }">
+            <el-input v-model="row.mobilePhone" placeholder="请输入" maxlength="20"></el-input>
+          </template>
+          <template v-slot:phone="{ row }">
+            <el-input v-model="row.phone" placeholder="请输入" maxlength="20"></el-input>
+          </template>
+          <template v-slot:email="{ row }">
+            <el-input v-model="row.email" placeholder="请输入" maxlength="50"></el-input>
+          </template>
+          <template v-slot:post="{ row }">
+            <el-input v-model="row.post" placeholder="请输入" maxlength="20"></el-input>
+          </template>
+          <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"
+                :label="item.label"
+                :value="item.value"
+              ></el-option>
+            </el-select>
+          </template>
+          <template v-slot:status="{ row }">
+            <DictSelection
+              dictName="客户联系人状态"
+              v-model="row.status"
+            ></DictSelection>
+          </template>
+          <template v-slot:remark="{ row }">
+            <el-input v-model="row.remark" placeholder="请输入" maxlength="50"></el-input>
+          </template>
+        </ele-pro-table>
+      </el-tab-pane>
+      <el-tab-pane label="其他信息" name="other">
+        <el-form
+          label-width="100px"
+          ref="otherForm"
+          :model="otherForm"
+          :rules="otherRules"
+          style="margin-top: 30px"
+        >
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="结算方式" prop="settlementMode">
+                <DictSelection
+                  dictName="结算方式"
+                  clearable
+                  @itemChange="settlementModeChange"
+                  v-model="otherForm.settlementMode"
+                >
+                </DictSelection>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="税率" prop="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="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="分管部门"
+                prop="deptId"
+                style="margin-bottom: 22px"
+              >
+                <ele-tree-select
+                  clearable
+                  :data="groupTreeData"
+                  v-model="otherForm.deptId"
+                  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">
+                <personSelect
+                  ref="directorRef"
+                  v-model="otherForm.salesmanId"
+                  @selfChange="salesmanChange"
+                  :init="false"
+                />
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="8">
+              <el-form-item label="寄件人" prop="sender">
+                <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="otherForm.senderPhone"
+                  maxlength="20"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="寄件人地址" prop="addressId">
+                <el-cascader
+                  clearable
+                  v-model="otherForm.addressId"
+                  :options="options.cityData"
+                  ref="sendAddress"
+                  style="width: 100%"
+                ></el-cascader>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="寄件人详细地址" prop="address"
+                 label-width="130px">
+                <el-input
+                  placeholder="请输入"
+                  v-model="otherForm.address"
+                  maxlength="50"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </el-tab-pane>
+    </el-tabs>
+
+    <div slot="footer" class="footer">
+      <el-button type="primary" @click="save">保存</el-button>
+      <el-button @click="cancel">返回</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+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 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';
+import {copyObj} from '@/utils/util';
+
+
+export default {
+    props: {
+      categoryTreeList: Array
+    },
+    mixins: [dictMixins],
+    components: {
+      fileUpload,
+      deptSelect,
+      personSelect
+    },
+    data() {
+      let formDef = {
+          address: '',
+          addressId: 0,
+          addressName: '',
+          authorizationLimit: 0,
+          businessLicenseFiles: [],
+          businessLicenseFile: {},
+          businessScope: '',
+          categoryId: '',
+          companyCategoryId: '',
+          companyCategoryName: '',
+          hasParentGroup: 0,
+          industry: '',
+          industryCode: '',
+          industryFullName: '',
+          mainProduct: '',
+          name: '',
+          officialIndustry: '',
+          phone: '',
+          registerDate: '',
+          remark: '',
+          serialNo: '',
+          simpleName: '',
+          type: 2,
+          unifiedSocialCreditCode: ''
+        };
+      let otherFormDef = {
+        settlementMode: '',
+        settlementModeName: '',
+        taxRate: 0,
+        address: '',
+        addressId: '',
+        deptId: '',
+        deptName: '',
+        discount: 0,
+        salesmanId: '',
+        salesmanName: '',
+        sender: '',
+        senderPhone: ''
+      };
+      return {
+        visible: false,
+        title: '',
+        row: {},
+        activeName: 'base',
+        formDef,
+        otherFormDef,
+        form: copyObj(formDef),
+        otherForm: copyObj(otherFormDef),
+        // removeBankList: [],
+        // removeLinkList: [],
+        tableBankData: [],
+        tableLinkData: [],
+        ifChiefList: [
+          {
+            value: 0,
+            label: '否'
+          },
+          {
+            value: 1,
+            label: '是'
+          }
+        ],
+        bankColumns: [
+          {
+            type: 'index',
+            width: 55,
+            align: 'center'
+          },
+          {
+            label: '单位名称',
+            prop: 'accountName',
+            slot: 'accountName',
+            action: 'accountName',
+            headerSlot: 'accountNameHeader'
+          },
+          {
+            label: '银行账号',
+            prop: 'accountNo',
+            slot: 'accountNo',
+            action: 'accountNo'
+          },
+          {
+            label: '开户行',
+            prop: 'bankName',
+            slot: 'bankName',
+            action: 'bankName'
+          },
+          {
+            label: '银行银联号',
+            prop: 'interbankNo',
+            slot: 'interbankNo',
+            action: 'interbankNo'
+          },
+          {
+            action: 'action',
+            slot: 'action',
+            label: '操作'
+          }
+        ],
+        linkColumns: [
+          {
+            type: 'index',
+            width: 55,
+            align: 'center'
+          },
+          {
+            label: '联系人名称',
+            prop: 'linkName',
+            slot: 'linkName',
+            action: 'linkName',
+            headerSlot: 'linkNameHeader'
+          },
+          {
+            label: '手机',
+            prop: 'mobilePhone',
+            slot: 'mobilePhone',
+            action: 'mobilePhone',
+            headerSlot: 'mobilePhoneHeader'
+          },
+          {
+            label: '电话',
+            prop: 'phone',
+            slot: 'phone',
+            action: 'phone'
+          },
+          {
+            label: '邮箱',
+            prop: 'email',
+            slot: 'email',
+            action: 'email'
+          },
+          {
+            label: '职务',
+            prop: 'post',
+            slot: 'post',
+            action: 'post'
+          },
+          {
+            label: '状态',
+            prop: 'status',
+            slot: 'status',
+            action: 'status',
+            headerSlot: 'statusHeader'
+          },
+          {
+            label: '是否首要',
+            prop: 'ifChief',
+            slot: 'ifChief',
+            action: 'ifChief'
+          },
+          {
+            label: '备注',
+            prop: 'remark',
+            slot: 'remark',
+            action: 'remark'
+          },
+          {
+            action: 'action',
+            slot: 'action',
+            label: '操作'
+          }
+        ],
+        rules: {
+          categoryId: [
+            { required: true, message: '请选择供应商分类', trigger: 'change' }
+          ],
+          name: [
+            { required: true, message: '请输入供应商名称', trigger: 'blur' }
+          ],
+          authorizationLimit: [
+            { required: true, message: '请输入授信额度', trigger: 'blur' }
+          ]
+        },
+        otherRules: {
+          settlementMode: [
+            { required: true, message: '请输入结算方式', trigger: 'blur' }
+          ],
+          taxRate: [
+            { required: true, message: '请输入税率', trigger: 'change' }
+          ]
+        },
+        options: {
+          cityData,
+          categoryData,
+        },
+        // 提交状态
+        loading: false,
+        // 是否是修改
+        isUpdate: false,
+
+        // 组织机构树形结构数据
+        groupTreeData: [],
+        // 组织机构平铺数据
+        groupData: [],
+      };
+    },
+    created () {
+      this.getGroupAll();
+    },
+    methods: {
+      async open(type, row, contactCategoryId) {
+        this.title = type;
+        this.row = row;
+        this.visible = true;
+        if (type == '新建供应商') {
+          this.isUpdate = false;
+          // 默认带出列表页面选中的分类
+          this.form.categoryId = contactCategoryId;
+        } else {
+          this.isUpdate = true;
+          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) {
+        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: '',
+          accountNo: '',
+          bankName: '',
+          interbankNo: ''
+        });
+      },
+      addLink() {
+        this.tableLinkData.push({
+          linkName: '',
+          mobilePhone: '',
+          phone: '',
+          email: '',
+          post: '',
+          status: '',
+          ifChief: 0,
+          remark: ''
+        });
+      },
+      handleBankDel(row, index) {
+        this.tableBankData.splice(index, 1);
+        if (row?.id) {
+        //   this.removeBankList.push(row.id);
+        }
+      },
+      handleLinkDel(row, index) {
+        this.tableLinkData.splice(index, 1);
+        if (row?.id) {
+        //   this.removeLinkList.push(row.id);
+        }
+      },
+      getValidate() {
+          return Promise.all([
+            new Promise((resolve, reject) => {
+              this.$refs.form.validate((valid) => {
+                if (!valid) {
+                  this.activeName = 'base';
+                  reject(false);
+                } else {
+                  resolve(true);
+                }
+              });
+            }),
+            new Promise((resolve, reject) => {
+              this.$refs.otherForm.validate((valid) => {
+                if (!valid) {
+                  this.activeName = 'other';
+                  reject(false);
+                } else {
+                  resolve(true);
+                }
+              });
+            }),
+            new Promise((resolve, reject) => {
+              if (this.tableLinkData.length === 0) {
+                this.$message.error("联系人信息至少有1条");
+                this.activeName = 'link';
+                reject(false);
+              } else {
+                resolve(true);
+              }
+            })
+          ]);
+     },
+      async save() {
+        try {
+           await this.getValidate();
+           // 表单验证通过,执行保存操作
+           this.loading = true;
+        // 基本信息处理
+        if (this.$refs.address.getCheckedNodes()) {
+          let node = this.$refs.address.getCheckedNodes()[0];
+          if (node) {
+            this.form.addressId = node.path.join();
+            this.form.addressName = node.pathLabels.join();
+          } else {
+            this.form.addressId = '';
+            this.form.addressName = '';
+          }
+        }
+        if (this.$refs.industry.getCheckedNodes()) {
+          let node = this.$refs.industry.getCheckedNodes()[0];
+          if (node) {
+            this.form.industryCode = node.path.join();
+            this.form.industryFullName = node.pathLabels.join();
+          } else {
+            this.form.industryCode = '';
+            this.form.industryFullName = '';
+          }
+        }
+        if (this.form.companyCategoryId) {
+          this.form.companyCategoryName = this.getDictValue(
+            '企业类型',
+            this.form.companyCategoryId
+          );
+        }
+        if(this.form.businessLicenseFiles && this.form.businessLicenseFiles.length > 0){
+          this.form.businessLicenseFile = this.form.businessLicenseFiles[0];
+        } else {
+          this.form.businessLicenseFile = null;
+        }
+
+        // 其他信息处理
+        if (this.form.settlementMode) {
+          this.form.settlementModeName = this.getDictValue(
+            '结算方式',
+            this.form.settlementMode
+          );
+        }
+        if (this.$refs.sendAddress.getCheckedNodes()) {
+          let node = this.$refs.sendAddress.getCheckedNodes()[0];
+          if (node) {
+            this.otherForm.addressId = node.path.join();
+            this.otherForm.addressName = node.pathLabels.join();
+          } else {
+            this.otherForm.addressId = '';
+            this.otherForm.addressName = '';
+          }
+        }
+
+        if (!this.isUpdate) {
+          delete this.form.id;
+        } else {
+        //   this.form.removeBankList = this.removeBankList;
+        //   this.form.removeLinkList = this.removeLinkList;
+        }
+        const data = {
+          base: this.form,
+          other: this.otherForm,
+          bankList: this.tableBankData,
+          linkList: this.tableLinkData
+        };
+        if (this.isUpdate) {
+          contactUpdate(data)
+            .then((res) => {
+              this.loading = false;
+              this.$message.success("修改成功");
+              this.cancel();
+              this.$emit('done');
+            })
+            .catch((e) => {
+              //this.loading = false;
+            });
+        } else {
+          contactSave(data)
+            .then((res) => {
+              this.loading = false;
+              this.$message.success("新增成功");
+              this.cancel();
+              this.$emit('done');
+            })
+            .catch((e) => {
+              //this.loading = false;
+            });
+          }
+        } catch (error) {
+          // 表单验证未通过,不执行保存操作
+        }
+       
+      },
+      cancel() {
+        this.$nextTick(() => {
+          this.activeName = 'base';
+          // 关闭后,销毁所有的表单数据
+          this.$refs['otherForm'] &&  this.$refs['otherForm'].resetFields();
+          this.$refs['formRef'] &&  this.$refs['formRef'].resetFields();
+          this.form = copyObj(this.formDef),
+          this.otherForm = copyObj(this.otherFormDef),
+          this.tableBankData = []
+          this.tableLinkData = []
+          this.visible = false;
+        })
+      },
+      async _getById(id) {
+        const data = await contactDetail(id);
+        this.form = data.base;
+        this.otherForm = data.other;
+        this.tableBankData = data.bankList;
+        this.tableLinkData = data.linkList;
+        if(data.base.businessLicenseFile && data.base.businessLicenseFile !== ""){
+          this.$set(this.form,'businessLicenseFiles',[data.base.businessLicenseFile])
+        }
+
+        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});
+          })
+        }
+      },
+
+    }
+  };
+</script>

+ 488 - 0
src/views/purchasingManage/supplierManage/components/contactDetailDialog.vue

@@ -0,0 +1,488 @@
+<template>
+  <ele-modal
+    custom-class="ele-dialog-form"
+    v-if="visible"
+    :visible.sync="visible"
+    :title="title"
+    :close-on-click-modal="false"
+    width="80%"
+    @close="cancel"
+  >
+
+    <el-tabs v-model="activeName" type="card">
+      <el-tab-pane label="基本信息" name="base">
+        <el-form
+          label-width="160px"
+          ref="formRef"
+          :model="form"
+          style="margin-top: 30px"
+        >
+          <el-row>
+            <el-col :span="8">
+              <el-form-item
+                label="供应商分类:"
+                prop="categoryId"
+              >
+                {{form.categoryName}}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="供应商名称:" prop="name">
+                {{form.name}}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="供应商代号:" prop="serialNo">
+                {{form.serialNo}}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="供应商简称:" prop="simpleName">
+                {{form.simpleName}}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="授信额度:" prop="authorizationLimit">
+                {{form.authorizationLimit}}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="单位电话:" prop="phone">
+                {{form.phone}}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="地址:" prop="addressId">
+                {{form.addressName}}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="详细地址:" prop="address">
+                {{form.address}}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item
+                label="统一社会信用代码:"
+                prop="unifiedSocialCreditCode"
+              >
+                {{form.unifiedSocialCreditCode}}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="所属行业:" prop="industry">
+                {{form.industryFullName}}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="企业类型:" prop="companyCategoryId">
+                {{form.companyCategoryName}}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="登记日期:" prop="registerDate">
+                {{form.registerDate}}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="经营范围:" prop="businessScope">
+                {{form.businessScope}}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="主营产品:" prop="mainProduct">
+                {{form.mainProduct}}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item
+                label="是否存在上级集团公司:"
+                prop="hasParentGroup"
+                label-width="170px"
+              >
+                {{ form.hasParentGroup === 1 ? "是" : "否"}}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item prop="businessLicenseFile" label="营业执照附件:">
+                <el-link v-if="form.businessLicenseFile && form.businessLicenseFile !== ''"
+                         type="primary" :underline="false"
+                         @click="downloadFile(form.businessLicenseFile)"> {{ form.businessLicenseFile.name }}</el-link>
+              </el-form-item>
+            </el-col>
+            <el-col :span="16">
+              <el-form-item label="备注:" prop="remark">
+                {{form.remark}}
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </el-tab-pane>
+      <el-tab-pane label="银行信息" name="bank">
+        <ele-pro-table
+          ref="table"
+          :columns="bankColumns"
+          :datasource="tableBankData"
+          height="350px"
+          :toolkit="[]"
+          :need-page="false"
+        >
+          <template v-slot:accountNameHeader="{ column }">
+            <span>{{ column.label }}</span><span style="color:red">*</span>
+          </template>
+
+          <template v-slot:accountName="{ row }">
+            {{row.accountName}}
+          </template>
+          <template v-slot:accountNo="{ row }">
+            {{row.accountNo}}
+          </template>
+          <template v-slot:bankName="{ row }">
+            {{row.bankName}}
+          </template>
+          <template v-slot:interbankNo="{ row }">
+            {{row.interbankNo}}
+          </template>
+        </ele-pro-table>
+      </el-tab-pane>
+      <el-tab-pane label="联系人信息" name="link">
+        <ele-pro-table
+          ref="linkTable"
+          :columns="linkColumns"
+          :datasource="tableLinkData"
+          :toolkit="[]"
+          height="350px"
+          :need-page="false"
+        >
+          <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 }">
+            {{row.linkName}}
+          </template>
+          <template v-slot:mobilePhone="{ row }">
+            {{row.mobilePhone}}
+          </template>
+          <template v-slot:phone="{ row }">
+            {{row.phone}}
+          </template>
+          <template v-slot:email="{ row }">
+            {{row.email}}
+          </template>
+          <template v-slot:post="{ row }">
+            {{row.post}}
+          </template>
+          <template v-slot:ifChief="{ row, $index }">
+            <el-select v-model="row.ifChief" class="w100" disabled>
+              <el-option
+                v-for="item in ifChiefList"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              ></el-option>
+            </el-select>
+          </template>
+          <template v-slot:status="{ row }">
+            <DictSelection
+              dictName="客户联系人状态"
+              v-model="row.status"
+              :disabled="true"
+            ></DictSelection>
+          </template>
+          <template v-slot:remark="{ row }">
+            {{row.remark}}
+          </template>
+        </ele-pro-table>
+      </el-tab-pane>
+      <el-tab-pane label="其他信息" name="other">
+        <el-form
+          label-width="160px"
+          ref="otherFormRef"
+          :model="otherForm"
+          style="margin-top: 30px"
+        >
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="结算方式:" prop="settlementMode">
+                {{otherForm.settlementModeName}}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="税率:" prop="taxRate">
+                {{otherForm.taxRate}} %
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="折扣率:" prop="discount">
+                {{otherForm.discount}} %
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item
+                label="分管部门:"
+                prop="deptId"
+                style="margin-bottom: 22px"
+              >
+                {{otherForm.deptName}}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="业务员:" prop="salesmanId">
+                {{otherForm.salesmanName}}
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="8">
+              <el-form-item label="寄件人:" prop="sender">
+                {{otherForm.sender}}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="寄件人电话:" prop="senderPhone">
+                {{otherForm.senderPhone}}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="寄件人地址:" prop="addressId">
+                {{otherForm.addressName}}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="寄件人详细地址:" prop="address" >
+                {{otherForm.address}}
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </el-tab-pane>
+    </el-tabs>
+
+    <div slot="footer" class="footer">
+      <el-button @click="cancel">返回</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+import {contactDetail} from '@/api/saleManage/contact';
+import {getFile} from '@/api/system/file';
+import {getInfoById as getCategoryInfo} from '@/api/classifyManage/index';
+import fileUpload from '@/components/upload/fileUpload';
+import dictMixins from '@/mixins/dictMixins';
+import deptSelect from '@/components/CommomSelect/dept-select.vue';
+import personSelect from '@/components/CommomSelect/person-select.vue';
+import {copyObj} from '@/utils/util';
+
+
+export default {
+    props: {
+      categoryTreeList: Array
+    },
+    mixins: [dictMixins],
+    components: {
+      fileUpload,
+      deptSelect,
+      personSelect
+    },
+    data() {
+      let formDef = {
+          address: '',
+          addressId: 0,
+          addressName: '',
+          authorizationLimit: 0,
+          businessLicenseFile: {},
+          businessScope: '',
+          categoryId: '',
+          categoryName: '',
+          companyCategoryId: '',
+          companyCategoryName: '',
+          hasParentGroup: 0,
+          industry: '',
+          industryCode: '',
+          industryFullName: '',
+          mainProduct: '',
+          name: '',
+          officialIndustry: '',
+          phone: '',
+          registerDate: '',
+          remark: '',
+          serialNo: '',
+          simpleName: '',
+          type: 1,
+          unifiedSocialCreditCode: ''
+        };
+      let otherFormDef = {
+        settlementMode: '',
+        settlementModeName: '',
+        taxRate: 0,
+        address: '',
+        addressId: '',
+        deptId: '',
+        deptName: '',
+        discount: 0,
+        salesmanId: '',
+        salesmanName: '',
+        sender: '',
+        senderPhone: ''
+      };
+      return {
+        visible: false,
+        title: '供应商详情',
+        row: {},
+        activeName: 'base',
+        formDef,
+        otherFormDef,
+        form: copyObj(formDef),
+        otherForm: copyObj(otherFormDef),
+        tableBankData: [],
+        tableLinkData: [],
+        ifChiefList: [
+          {
+            value: 0,
+            label: '否'
+          },
+          {
+            value: 1,
+            label: '是'
+          }
+        ],
+        bankColumns: [
+          {
+            type: 'index',
+            width: 55,
+            align: 'center'
+          },
+          {
+            label: '单位名称',
+            prop: 'accountName',
+            slot: 'accountName',
+            action: 'accountName',
+            headerSlot: 'accountNameHeader'
+          },
+          {
+            label: '银行账号',
+            prop: 'accountNo',
+            slot: 'accountNo',
+            action: 'accountNo'
+          },
+          {
+            label: '开户行',
+            prop: 'bankName',
+            slot: 'bankName',
+            action: 'bankName'
+          },
+          {
+            label: '银行银联号',
+            prop: 'interbankNo',
+            slot: 'interbankNo',
+            action: 'interbankNo'
+          },
+        ],
+        linkColumns: [
+          {
+            type: 'index',
+            width: 55,
+            align: 'center'
+          },
+          {
+            label: '联系人名称',
+            prop: 'linkName',
+            slot: 'linkName',
+            action: 'linkName',
+            headerSlot: 'linkNameHeader'
+          },
+          {
+            label: '手机',
+            prop: 'mobilePhone',
+            slot: 'mobilePhone',
+            action: 'mobilePhone',
+            headerSlot: 'mobilePhoneHeader'
+          },
+          {
+            label: '电话',
+            prop: 'phone',
+            slot: 'phone',
+            action: 'phone'
+          },
+          {
+            label: '邮箱',
+            prop: 'email',
+            slot: 'email',
+            action: 'email'
+          },
+          {
+            label: '职务',
+            prop: 'post',
+            slot: 'post',
+            action: 'post'
+          },
+          {
+            label: '状态',
+            prop: 'status',
+            slot: 'status',
+            action: 'status',
+            headerSlot: 'statusHeader'
+          },
+          {
+            label: '是否首要',
+            prop: 'ifChief',
+            slot: 'ifChief',
+            action: 'ifChief'
+          },
+          {
+            label: '备注',
+            prop: 'remark',
+            slot: 'remark',
+            action: 'remark'
+          },
+        ],
+      };
+    },
+    methods: {
+      async open(row) {
+        this.row = row;
+        this.visible = true;
+        await this._getById(row.id);
+      },
+
+      cancel() {
+        this.$nextTick(() => {
+          // 关闭后,销毁所有的表单数据
+          this.form = copyObj(this.formDef),
+          this.otherForm = copyObj(this.otherFormDef),
+          this.tableBankData = []
+          this.tableLinkData = []
+          this.visible = false;
+        })
+      },
+
+      async _getById(id) {
+        const data = await contactDetail(id);
+        this.form = data.base;
+        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+"");
+        }
+
+        await getCategoryInfo(this.form.categoryId).then((res) => {
+          this.$set(this.form,'categoryName', res.data.name)
+        });
+      },
+
+      downloadFile(file){
+        getFile({ objectName: file.storePath }, file.name);
+      },
+
+    }
+  };
+</script>

+ 99 - 0
src/views/purchasingManage/supplierManage/components/contactSearch.vue

@@ -0,0 +1,99 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="100px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="编码/代号:" prop="codeOrSerialNo">
+          <el-input
+            clearable
+            v-model="params.codeOrSerialNo"
+            placeholder="请输入"
+            maxlength="50"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="供应商名称:" prop="name">
+          <el-input
+            clearable
+            placeholder="请输入"
+            v-model.trim="params.name"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="是否启用:" prop="codeOrSerialNo">
+          <el-select v-model="params.status" placeholder="请选择" class="w100" clearable>
+            <el-option
+              v-for="item in statusList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <div class="ele-form-actions">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+          <el-button @click="reset">重置</el-button>
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+<script>
+  export default {
+    data () {
+      // 默认表单数据
+      const defaultParams = {
+        type: 2,
+        name: '',
+        codeOrSerialNo: '',
+        status: ''
+      };
+      return {
+        defaultParams,
+        // 表单数据
+        params: { ...defaultParams },
+        // 状态数据源
+        statusList: [
+          {value: 1, label: "启用"},
+          {value: 2, label: "禁用"}
+        ],
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive () {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search () {
+        console.log(this.current);
+        this.$emit('search', {
+          ...this.params
+        });
+      },
+      /*  重置 */
+      reset () {
+        this.params = { ...this.defaultParams };
+        this.search();
+      }
+    }
+  };
+</script>

+ 383 - 0
src/views/purchasingManage/supplierManage/index.vue

@@ -0,0 +1,383 @@
+<template>
+    <div class="ele-body">
+      <el-card shadow="never" v-loading="loading">
+        <ele-split-layout
+          width="300px"
+          allow-collapse
+          :right-style="{ overflow: 'hidden' }"
+        >
+          <div>
+            <div class="ele-border-lighter sys-organization-list">
+              <AssetTree
+                @handleNodeClick="handleNodeClick"
+                id="19" 
+                :isFirstRefreshTable="false"
+                ref="treeList"
+              />
+            </div>
+          </div>
+  
+          <template v-slot:content>
+            <div class="ele-border-lighter form-content" v-loading="loading">
+              <contact-search @search="reload"> </contact-search>
+  
+              <!-- 数据表格 -->
+              <ele-pro-table
+                ref="table"
+                :columns="columns"
+                :datasource="datasource"
+                height="calc(100vh - 300px)"
+                full-height="calc(100vh - 116px)"
+                tool-class="ele-toolbar-form"
+                :selection.sync="selection"
+                cache-key="eomContactPageTable"
+              >
+                <!-- 表头工具栏 -->
+                <template v-slot:toolbar>
+                  <el-button
+                    size="small"
+                    type="primary"
+                    icon="el-icon-plus"
+                    class="ele-btn-icon"
+                    @click="openEdit('新建供应商',{})"
+                  >
+                    新建
+                  </el-button>
+                  <el-button
+                    size="small"
+                    type="danger"
+                    el-icon-delete
+                    class="ele-btn-icon"
+                    @click="allDelBtn"
+                    :disabled="selection?.length===0"
+                  >
+                    批量删除
+                  </el-button>
+                </template>
+  
+                <template v-slot:name="{ row }">
+                  <el-link type="primary" :underline="false" @click="openDetail(row)"> {{ row.name }}</el-link>
+                </template>
+  
+                <!-- 操作列 -->
+                <template v-slot:action="{ row }">
+                  <el-link
+                    type="primary"
+                    :underline="false"
+                    icon="el-icon-edit"
+                    @click="openEdit('编辑供应商',row)"
+                  >
+                    修改
+                  </el-link>
+                  <el-link
+                    v-if="row.status===2"
+                    type="primary"
+                    :underline="false"
+                    icon="el-icon-check"
+                    @click="enableOption(row)"
+                  >
+                    启用
+                  </el-link>
+                  <el-link
+                    v-if="row.status===1"
+                    type="primary"
+                    :underline="false"
+                    icon="el-icon-close"
+                    @click="disableOption(row)"
+                  >
+                    禁用
+                  </el-link>
+  
+                  <el-popconfirm
+                    class="ele-action"
+                    title="确定要删除此供应商信息吗?"
+                    @confirm="remove(row)"
+                  >
+                    <template v-slot:reference>
+                      <el-link
+                        type="danger"
+                        :underline="false"
+                        icon="el-icon-delete"
+                      >
+                        删除
+                      </el-link>
+                    </template>
+                  </el-popconfirm>
+                </template>
+              </ele-pro-table>
+            </div>
+          </template>
+        </ele-split-layout>
+      </el-card>
+  
+  
+      <AddContactDialog ref="addContactDialogRef" :categoryTreeList="treeList" @done="reload"></AddContactDialog>
+      <ContactDetailDialog ref="contactDetailDialogRef"></ContactDetailDialog>
+  <!-- 多选删除弹窗 -->
+      <pop-modal :visible.sync="delVisible" content="是否确定删除?" @done="commitBtn"/>
+    </div>
+  </template>
+  
+  <script>
+  import ContactSearch from './components/contactSearch.vue';
+  import AddContactDialog from './components/addContactDialog.vue';
+  import ContactDetailDialog from './components/contactDetailDialog.vue';
+  import popModal from '@/components/pop-modal';
+  import AssetTree from '@/components/AssetTree';
+  import {contactDelete, contactPage, contactTypeTree, updateStatus} from '@/api/saleManage/contact';
+  import dictMixins from '@/mixins/dictMixins';
+  
+  export default {
+      mixins: [dictMixins],
+      components: {
+        AssetTree,
+        ContactSearch,
+        popModal,
+        AddContactDialog,
+        ContactDetailDialog,
+      },
+      data() {
+        return {
+          selection:[],
+          delVisible:false,
+          // 加载状态
+          loading: false,
+          columns: [
+          {
+               width: 45,
+               type: 'selection',
+               columnKey: 'selection',
+               align: 'center'
+            },
+            {
+              columnKey: 'index',
+              label: '序号',
+              type: 'index',
+              width: 55,
+              align: 'center',
+              showOverflowTooltip: true,
+              fixed: 'left'
+            },
+            {
+              prop: 'code',
+              label: '供应商编码',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 140
+            },
+            {
+              prop: 'name',
+              label: '供应商名称',
+              align: 'center',
+              slot: 'name',
+              showOverflowTooltip: true,
+              minWidth: 200
+            },
+            {
+              prop: 'serialNo',
+              label: '供应商代号',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 140
+            },
+            {
+              prop: 'phone',
+              label: '供应商电话',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 120
+            },
+            {
+              prop: 'addressName',
+              label: '单位地址',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 120,
+              formatter: (_row, _column, cellValue) => {
+                let addr = '' + _row.addressName ? _row.addressName.replaceAll(',', '') : '';
+                addr += _row.address ? _row.address : '';
+                return addr;
+              }
+            },
+            {
+              prop: 'linkName',
+              label: '联系人',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 120
+            },
+            {
+              prop: 'linkPhone',
+              label: '联系人电话',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 120
+            },
+            {
+              prop: 'status',
+              label: '状态',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 100,
+              formatter: (_row, _column, cellValue) => {
+                return _row.status === 1 ? '启用' : '禁用';
+              }
+            },
+            {
+              prop: 'createUsername',
+              label: '创建人',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 100
+            },
+            {
+              prop: 'createTime',
+              label: '创建时间',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 160,
+              formatter: (_row, _column, cellValue) => {
+                return this.$util.toDateString(cellValue);
+              }
+            },
+            {
+              columnKey: 'action',
+              label: '操作',
+              width: 200,
+              align: 'center',
+              resizable: false,
+              slot: 'action',
+              showOverflowTooltip: true,
+              fixed: 'right',
+            }
+          ],
+          current: {},
+          curNodeData: {},
+          treeList: [],
+          treeLoading: false,
+          formData: {},
+          rootTreeId: null,
+          defaultProps: {
+            children: 'children',
+            label: 'name'
+          },
+          showEdit: true,
+        };
+      },
+      computed: {},
+      created() {
+        this.requestDict('供应商状态');
+        this.getTreeData();
+      },
+      methods: {
+        /* 表格数据源 */
+        datasource({ page, limit, where, order }) {
+          return contactPage({
+            pageNum: page,
+            size: limit,
+            type:2,
+            ...where
+          });
+        },
+        async getTreeData() {
+          try {
+            this.treeLoading = true;
+            const res = await contactTypeTree({ type: 19 });
+            this.treeLoading = false;
+            if (res?.code === '0') {
+              this.treeList = res.data;
+              this.$nextTick(() => {
+                // 默认高亮第一级树节点
+                // if (this.treeList[0]) {
+                //   this.rootTreeId = this.treeList[0].id;
+                //   this.getDetail(this.treeList[0].id);
+                // }
+              });
+              return this.treeList;
+            }
+          } catch (error) {}
+          this.treeLoading = false;
+        },
+        handleNodeClick(data, node) {
+          this.curNodeData = data;
+          this.reload({ categoryId: data.id });
+        },
+        /* 刷新表格 */
+        reload(where) {
+          this.$refs.table.reload({ page: 1, where });
+        },
+        openEdit(row, type) {
+          this.current = row;
+          this.showEdit = true;
+          this.$refs.addContactDialogRef.open(row, type, this.curNodeData.id);
+          this.$refs.addContactDialogRef.$refs.form &&
+          this.$refs.addContactDialogRef.$refs.form.clearValidate();
+        },
+        //批量删除
+        allDelBtn(){
+          if(this.selection.length===0) return
+          this.delVisible=true
+        },
+        commitBtn(){
+          console.log(this.selection)
+          const dataId=this.selection.map(v=>v.id)
+          contactDelete(dataId).then((res) => {
+            this.$message.success('删除成功!');
+            this.reload();
+          });
+        },
+        remove(row) {
+          contactDelete([row.id]).then((res) => {
+            this.$message.success('删除成功!');
+            this.reload();
+          });
+        },
+        /** 启用供应商 */
+        enableOption(row) {
+          updateStatus(row.id, 1)
+            .then((msg) => {
+              this.$message.success("供应商启用成功");
+              this.reload();
+            })
+            .catch((e) => {
+              this.$message.error(e.message);
+            });
+        },
+        /** 禁用供应商 */
+        disableOption(row) {
+          updateStatus(row.id, 2)
+            .then((msg) => {
+              this.$message.success("供应商禁用成功");
+              this.reload();
+            })
+            .catch((e) => {
+              this.$message.error(e.message);
+            });
+        },
+        openDetail(row){
+          this.$refs.contactDetailDialogRef.open(row);
+        },
+      }
+    };
+  </script>
+  
+  <style lang="scss" scoped>
+  :deep(.el-link--inner){
+    margin-left: 0px !important;
+  }
+  
+  .sys-organization-list {
+    height: calc(100vh - 264px);
+    box-sizing: border-box;
+    border-width: 1px;
+    border-style: solid;
+    overflow: auto;
+  }
+  .sys-organization-list :deep(.el-tree-node__content) {
+    height: 40px;
+    & > .el-tree-node__expand-icon {
+      margin-left: 10px;
+    }
+  }
+  </style>
+  

+ 1 - 1
src/views/saleManage/contact/components/addContactDialog.vue

@@ -40,7 +40,7 @@
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="客户代" prop="serialNo">
+              <el-form-item label="客户代" prop="serialNo">
                 <el-input placeholder="请输入" v-model="form.serialNo" maxlength="50"></el-input>
               </el-form-item>
             </el-col>

+ 1 - 1
src/views/saleManage/contact/components/contactDetailDialog.vue

@@ -32,7 +32,7 @@
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="客户代:" prop="serialNo">
+              <el-form-item label="客户代:" prop="serialNo">
                 {{form.serialNo}}
               </el-form-item>
             </el-col>

+ 1 - 1
src/views/saleManage/contact/components/contactSearch.vue

@@ -8,7 +8,7 @@
   >
     <el-row :gutter="15">
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="编号/代码:" prop="codeOrSerialNo">
+        <el-form-item label="编码/代号:" prop="codeOrSerialNo">
           <el-input
             clearable
             v-model="params.codeOrSerialNo"

+ 0 - 232
src/views/saleManage/contact/edit.vue

@@ -1,232 +0,0 @@
-<template>
-  <div class="ele-body">111
-    <el-card shadow="never">
-      <el-form label-width="120px" ref="manageForm" :model="form" :rules="rules">
-        <headerTitle title="基本信息">
-          <el-button @click="cancel">返回</el-button>
-          <el-button type="primary" @click="submit" :loading="loading">保存</el-button>
-        </headerTitle>
-
-        <el-row :gutter="24">
-          <el-col :span="8">
-            <el-form-item label="分类" prop="categoryLevelName">
-              <el-input v-model="form.categoryLevelName" @click.native="openCategory" />
-            </el-form-item>
-          </el-col>
-
-          
-        <el-col :span="8" v-if="ruleCode == '自定义'"  key="1" >
-            <el-form-item label="编码" prop="code">
-              <el-input v-model="form.code" readonly @click.native="openCode" />
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="8"  v-else  key="2">
-            <el-form-item label="编码" prop="code">
-              <el-input v-model="form.code"  />
-            </el-form-item>
-          </el-col> 
-
-
- 
-
-          <el-col :span="8">
-            <el-form-item label="名称" prop="name">
-              <el-input v-model="form.name" />
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="8">
-            <el-form-item label="牌号" prop="brandNum">
-              <el-input v-model="form.brandNum" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="型号" prop="modelType">
-              <el-input v-model="form.modelType" />
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="8">
-            <el-form-item label="规格" prop="specification">
-              <el-input v-model="form.specification" />
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="8">
-            <el-form-item label="计量单位" prop="measuringUnit">
-              <DictSelection dictName="计量单位" clearable v-model="form.measuringUnit">
-              </DictSelection>
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="8">
-            <el-form-item label="重量单位" prop="weightUnit">
-              <DictSelection dictName="重量单位" clearable v-model="form.weightUnit">
-              </DictSelection>
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="8">
-            <el-form-item label="包装单位" prop="packingUnit">
-              <DictSelection dictName="包装单位" clearable v-model="form.packingUnit">
-              </DictSelection>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="体积">
-              <div class="form-line">
-                <el-input v-model="form.volume" />
-                <DictSelection class="line-select" dictName="体积单位" clearable v-model="form.volumeUnit">
-                </DictSelection>
-              </div>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="毛重">
-              <div class="form-line">
-                <el-input v-model="form.roughWeight" />
-
-              </div>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="净重">
-              <div class="form-line">
-                <el-input v-model="form.netWeight" />
-              </div>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="所属部门">
-              <deptSelect v-model="form.deptLeaderId" @changeGroup="searchDeptNodeClick" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="负责人">
-              <personSelect ref="directorRef" v-model="form.deptId" @selfChange="handleDirectorChange" :init="false" />
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
-    </el-card>
-
-
-  </div>
-</template>
-
-<script>
-
-export default {
-  name: 'contactEdit',
-  components: {
-    
-  },
-  data() {
-    return {
-      loading: false,
-      form: {
-        categoryLevelGroupName: '',
-        categoryLevelName: ''
-      },
-      remarkform: {
-        remarkAttach: []
-      },
-      categoryAps: {},
-      categoryMes: {},
-      categoryMold: {},
-      categoryPallet: {},
-      categoryQms: {},
-      categoryVehicle: {},
-      categoryWms: {
-        isUnpack: 1
-      },
-      // 表单验证规则
-      rules: {
-        categoryLevelGroupName: [
-          { required: true, message: '请选择所属物料组', trigger: 'change' }
-        ],
-        code: [{ required: true, message: '请输入编码', trigger: 'blur' }],
-        name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
-        categoryLevelName: [
-          { required: true, message: '请选择所属分类', trigger: 'change' }
-        ],
-        measuringUnit: [
-          { required: true, message: '请选择计量单位', trigger: 'change' }
-        ]
-      },
-      PathInfo: {},
-      id: null,
-
-      ruleCode: null,
-      codeShow: false
-    };
-  },
-  async created() {
-
-
-  },
-  methods: {
-    
-  }
-};
-</script>
-
-<style lang="scss" scoped>
-.ele-page-header {
-  border: none;
-}
-
-.body-top {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  background: #fff;
-
-  .top-left {
-    display: flex;
-    align-items: center;
-    justify-content: flex-start;
-    margin-left: -25px;
-
-    .el-form-item {
-      margin-bottom: 0;
-    }
-  }
-}
-
-.divider {
-  margin: 20px 0;
-
-  .title {
-    display: flex;
-    align-items: center;
-    margin-bottom: 10px;
-
-    div {
-      width: 8px;
-      height: 20px;
-      margin-right: 10px;
-    }
-
-    span {
-      font-size: 20px;
-    }
-  }
-
-  .ele-width {
-    width: 100%;
-    height: 2px;
-  }
-}
-
-.form-line {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-
-  .line-select {
-    margin-left: 15px;
-  }
-}
-</style>

+ 3 - 1
src/views/saleManage/contact/index.vue

@@ -11,6 +11,7 @@
             <AssetTree
               @handleNodeClick="handleNodeClick"
               id="17"
+              :isFirstRefreshTable="false"
               ref="treeList"
             />
           </div>
@@ -174,7 +175,7 @@ export default {
           },
           {
             prop: 'serialNo',
-            label: '客户代',
+            label: '客户代',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 140
@@ -274,6 +275,7 @@ export default {
         return contactPage({
           pageNum: page,
           size: limit,
+          type:1,
           ...where
         });
       },