Просмотр исходного кода

线索管理、公海线索详情页新增联系人tab

qymljy 7 месяцев назад
Родитель
Сommit
1f3e99ea71

+ 627 - 0
src/HManagement/clueManage/clue_private/modules/addContact.vue

@@ -0,0 +1,627 @@
+<template>
+  <div>
+    <el-button size="small" type="primary" @click="onshow" >{{
+        $t("新 建")
+      }}</el-button>
+    <el-drawer
+        :title="$t(`新建联系人`)"
+        :visible.sync="dialogFormVisible"
+        size="600px"
+        direction="rtl"
+        :show-close="false"
+        append-to-body
+        @close="onClose"
+    >
+      <div class="drawer__panel">
+        <el-row :gutter="20">
+          <el-form
+              :model="form"
+              :rules="rules"
+              ref="form"
+              size="mini"
+              label-position="right"
+              :label-width="tool.onlyZh('90px')"
+          >
+            <el-col :span="24">
+              <el-form-item :label="$t(`姓名`) + ':'" prop="name">
+                <contactsNewTemplate
+                   :is-param="true"
+                   :new-param="contactParam"
+                   :name="form.name"
+                   @contactData="contactData"
+                   @inputChange="inputChange"
+                ></contactsNewTemplate>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item>
+                <el-radio v-model="form.isTelephone" label="0">{{
+                    $t("手机号")
+                  }}</el-radio>
+                <el-radio v-model="form.isTelephone" label="1">{{
+                    $t("座机电话")
+                  }}</el-radio>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24" v-if="form.isTelephone == '1'">
+              <el-form-item :label="$t('联系方式') + ':'" prop="telephone">
+                <el-input
+                    v-model="form.areaCode"
+                    style="width: 25%"
+                    autocomplete="on"
+                    :placeholder="$t('请填写区号')"
+                ></el-input>
+                <span style="color: #999999">——</span>
+                <el-input
+                    v-model="form.telephone"
+                    style="width: 68%"
+                    autocomplete="on"
+                    :placeholder="$t('请填写座机电话')"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item
+                  v-if="form.isTelephone == '0'"
+                  :label="$t('联系方式') + ':'"
+                  prop="phonenumber"
+                  :rules="[
+                  { required: true, message: this.$t('手机号码不能为空') },
+                  {
+                    pattern: /^1[3-9][0-9]\d{8}$/,
+                    message: this.$t('请输入正确手机号码'),
+                    trigger: 'change',
+                  },
+                ]"
+              >
+                <el-input
+                    v-model="form.phonenumber"
+                    autocomplete="on"
+                    :placeholder="$t('请填写手机号码')"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t('微信') + ':'" prop="wechatnum">
+                <el-input
+                    autosize
+                    v-model="form.wechatnum"
+                    :placeholder="$t(`请输入微信`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item
+                  :label="$t(`邮箱`) + ':'"
+                  :rules="[
+                  {
+                    pattern:
+                      /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
+                    message: $t('请输入有效的邮箱'),
+                    trigger: 'change',
+                  },
+                ]"
+              >
+                <el-input
+                    autosize
+                    v-model="form.email"
+                    :placeholder="$t(`请输入邮箱`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`传真`) + ':'">
+                <el-input
+                    autosize
+                    v-model="form.fax"
+                    :placeholder="$t(`请输入传真`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`关联企业`) + ':'">
+                <el-input
+                    autosize
+                    v-model="form.enterprisename"
+                    :placeholder="$t(`请输入关联企业`)"
+                    disabled
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`部门`) + ':'" prop="depname">
+                <el-input
+                    autosize
+                    v-model="form.depname"
+                    :placeholder="$t(`请输入部门`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`职位`) + ':'" prop="position">
+                <el-input
+                    autosize
+                    v-model="form.position"
+                    :placeholder="$t(`请输入职位`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`性别`) + ':'">
+                <el-radio v-model="form.sex" label="男">{{
+                    $t("男")
+                  }}</el-radio>
+                <el-radio v-model="form.sex" label="女">{{
+                    $t("女")
+                  }}</el-radio>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`生日`) + ':'">
+                <el-date-picker
+                    v-model="form.birthday"
+                    value-format="yyyy-MM-dd"
+                    type="date"
+                    :placeholder="$t('选择日期')"
+                    style="width: 100%"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`家庭住址`) + ':'">
+                <el-input
+                    type="textarea"
+                    rows="5"
+                    v-model="form.address"
+                    :placeholder="$t(`请输入家庭住址`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`偏好`)" prop="preference">
+                <el-input
+                    v-model="form.preference"
+                    autocomplete="on"
+                    :placeholder="$t(`请填写偏好`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`爱好`)" prop="hobby">
+                <el-input
+                    v-model="form.hobby"
+                    autocomplete="on"
+                    :placeholder="$t(`请填写爱好`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`备注`) + ':'">
+                <el-input
+                    type="textarea"
+                    rows="5"
+                    v-model="form.remarks"
+                    :placeholder="$t(`请输入备注`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </el-row>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button size="small" @click="onClose" class="normal-btn-width">{{
+            $t("取 消")
+          }}</el-button>
+        <el-button
+            size="small"
+            type="primary"
+            :loading="loading"
+            @click="onSubmit"
+            class="normal-btn-width"
+        >{{ $t("确 定") }}</el-button
+        >
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import { mapGetters } from "vuex";
+import contactsNewTemplate from "@/template/contactsNewTemplate/index";
+export default {
+  name: "addContact",
+  props: ["data"],
+  components: { contactsNewTemplate },
+  data() {
+    var validateMobilePhone = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error(this.$t("手机号不可为空")));
+      } else {
+        if (value !== "") {
+          var reg = /^1[3456789]\d{9}$/;
+          if (!reg.test(value)) {
+            callback(new Error(this.$t("请输入有效的手机号码")));
+          }
+        }
+        callback();
+      }
+    };
+    var telephone = (rule, value, callback) => {
+      if (this.form.areaCode === "" && this.form.telephone === "") {
+        callback(new Error(this.$t("座机电话不能为空")));
+      } else {
+        var reg = /^0\d{2,3}-\d{7,8}$/;
+        let telephone = this.form.areaCode + "-" + this.form.telephone;
+        if (!reg.test(telephone)) {
+          callback(new Error(this.$t("请输入正确座机电话")));
+        } else {
+          callback();
+        }
+      }
+    };
+    return {
+      dialogFormVisible: false,
+      activeName: "first",
+      visible: false,
+      tagList: [],
+      tags: [],
+      groupname: "客户联系人",
+      form: {
+        "sat_orderclue_contactsid": 0,
+        "sys_phonebookid": '',
+        "sat_orderclueid": '',
+        "phonenumber": "",
+        "birthday": "",
+        "name": "",
+        "depname": "",
+        "wechatnum": "",
+        "position": "",
+        "email": "",
+        "sex": "",
+        "homeaddress": "",
+        "remarks": "",
+        "fax": "",
+        "isleader": "",
+        "grade": "",
+        "hobby": "",
+        "preference": "",
+        "sys_phonebookgroupid": 0,
+        "telephone": "",
+        "isTelephone": "0",
+        "areaCode": "",
+      },
+      rules: {
+        name: [
+          { required: true, message: this.$t("姓名不能为空"), trigger: "blur,change" },
+        ],
+        // phonenumber: [
+        //   { required: true, validator: validateMobilePhone, trigger: 'blur' },
+        // ]
+        telephone: [
+          { required: true, validator: telephone, trigger: "change" },
+        ],
+        depname: [
+          { required: true, message: this.$t('部门不能为空'), trigger: 'blur' },
+        ],
+        position: [
+          { required: true, message: this.$t('职位不能为空'), trigger: 'blur' },
+        ],
+      },
+      enterpriseContact: {
+        param: {
+          content: {
+            sys_enterpriseid: "",
+            pageNumber: 1,
+            pageSize: 9999,
+            where: {
+              condition: "",
+            },
+          },
+          id: 20221219193002,
+        },
+        listData: [],
+        total: 0,
+        currentPage: 0,
+        show: false,
+      },
+      myContacts: {
+        param: {
+          id: 20221219161202,
+          content: {
+            pageNumber: 1,
+            pageSize: 9999,
+            ownertable: "sa_customers",
+            ownerid: "",
+            where: {
+              condition: "",
+            },
+          },
+        },
+        listData: [],
+        total: 0,
+        currentPage: 0,
+        show: false,
+      },
+      paramTag: {
+        id: "20220929085401",
+        content: {
+          nocache: true,
+          ownertable: "",
+          ownerid: 0,
+        },
+      },
+      contactParam:{
+        "id": 2025042110061502,
+        "content": {
+          "sat_orderclueid": this.$route.query.id,
+          "pageSize": 20,
+          "pageNumber": 1,
+          "where":{
+            "condition":""
+          }
+        },
+      }
+    };
+  },
+  computed: {
+    ...mapGetters({
+      loading: "loading",
+    }),
+  },
+  methods: {
+    onshow() {
+      this.dialogFormVisible = true;
+      this.activeName = "first";
+      this.enterpriseContact.param.content.pageNumber = 1;
+      this.myContacts.param.content.pageNumber = 1;
+      this.enterpriseContactList();
+      this.myContactList();
+      this.getTag();
+      // this.form.sys_enterpriseid = this.data.sys_enterpriseid;
+      this.form.enterprisename = this.data.enterprisename_customer;
+    },
+    onSubmit() {
+      this.$refs["form"].validate(async (valid) => {
+        if (!valid) return false;
+        this.$store.commit("setLoading", true);
+        if (this.form.isTelephone == "1") {
+          this.form.phonenumber =
+              this.form.areaCode + "-" + this.form.telephone;
+        }
+        this.form.sat_orderclueid = this.$route.query.id
+        const res = await this.$api.requested({
+          id: "2025042110003902",
+          content: this.form,
+        });
+        this.tool.showMessage(res, async () => {
+          /*let res2 = await this.$api.requested({
+            "id": 20220929090901,
+            "content": {
+              "ownertable":"sys_phonebook",
+              "ownerid":res.data.sys_phonebookid,
+              "datatag": this.tags
+            }
+          })*/
+          this.$emit("insertSuccess");
+          this.$refs["form"].resetFields();
+          this.tags = [];
+          this.form = {
+            "sat_orderclue_contactsid": 0,
+            "sys_phonebookid": '',
+            "sat_orderclueid": '',
+            "phonenumber": "",
+            "birthday": "",
+            "name": "",
+            "depname": "",
+            "wechatnum": "",
+            "position": "",
+            "email": "",
+            "sex": "",
+            "homeaddress": "",
+            "remarks": "",
+            "fax": "",
+            "isleader": "",
+            "grade": "",
+            "hobby": "",
+            "preference": "",
+            "sys_phonebookgroupid": 0,
+            "telephone": "",
+            "isTelephone": "0",
+            "areaCode": "",
+          };
+          this.$store.commit("setLoading", false);
+          this.dialogFormVisible = false;
+        });
+      });
+    },
+    searchData() {
+      this.changeTab();
+    },
+    changeTab() {
+      this.enterpriseContactList();
+      this.myContactList();
+    },
+    /*企业联系人*/
+    async enterpriseContactList() {
+      this.enterpriseContact.param.content.where.condition = this.form.name;
+      this.enterpriseContact.param.content.sys_enterpriseid =
+          this.data.sys_enterpriseid;
+      const res = await this.$api.requested(this.enterpriseContact.param);
+      this.enterpriseContact.listData = res.data;
+      this.enterpriseContact.total = res.total;
+      this.enterpriseContact.currentPage = res.pageNumber;
+    },
+    /*选择企业联系人*/
+    enterpriseContactSelect(val) {
+      this.form.name = val.name;
+      if (val.phonenumber.indexOf("-") != "-1") {
+        this.form.isTelephone = "1";
+        this.form.areaCode = val.phonenumber.substring(
+            0,
+            val.phonenumber.indexOf("-")
+        );
+        this.form.telephone = val.phonenumber.substring(
+            this.form.areaCode.length + 1
+        );
+        this.form.phonenumber = "";
+      } else {
+        this.form.isTelephone = "0";
+        this.form.phonenumber = val.phonenumber;
+        this.form.areaCode = "";
+        this.form.telephone = "";
+      }
+      this.form.email = val.email;
+      this.form.position = val.position;
+      this.form.depname = val.depname;
+      this.form.sex = val.sex;
+      this.form.birthday = val.birthday;
+      this.form.address = val.address;
+      this.form.remarks = val.remarks;
+      this.enterpriseContact.show = false;
+    },
+    handleSizeChangeEnterprise(val) {
+      // console.log(`每页 ${val} 条`);
+      this.enterpriseContact.param.content.pageSize = val;
+      this.enterpriseContactList();
+    },
+    handleCurrentChangeEnterprise(val) {
+      // console.log(`当前页: ${val}`);
+      this.enterpriseContact.param.content.pageNumber = val;
+      this.enterpriseContactList();
+    },
+    /*我的联系人*/
+    async myContactList() {
+      this.myContacts.param.content.where.condition = this.form.name;
+      this.myContacts.param.content.sys_enterpriseid =
+          this.data.sys_enterpriseid;
+      this.myContacts.param.content.ownerid = this.data.sys_enterpriseid;
+      const res = await this.$api.requested(this.myContacts.param);
+
+      this.myContacts.listData = res.data;
+      this.myContacts.total = res.total;
+      this.myContacts.currentPage = res.pageNumber;
+    },
+    /*选择我的联系人*/
+    myContactSelect(val) {
+      this.form.name = val.name;
+      if (val.phonenumber.indexOf("-") != "-1") {
+        this.form.isTelephone = "1";
+        this.form.areaCode = val.phonenumber.substring(
+            0,
+            val.phonenumber.indexOf("-")
+        );
+        this.form.telephone = val.phonenumber.substring(
+            this.form.areaCode.length + 1
+        );
+        this.form.phonenumber = "";
+      } else {
+        this.form.isTelephone = "0";
+        this.form.phonenumber = val.phonenumber;
+        this.form.areaCode = "";
+        this.form.telephone = "";
+      }
+      this.form.email = val.email;
+      this.form.position = val.position;
+      this.form.depname = val.depname;
+      this.form.sex = val.sex;
+      this.form.birthday = val.birthday;
+      this.form.address = val.address;
+      this.form.remarks = val.remarks;
+      this.form.sys_phonebookid = val.sys_phonebookid;
+      this.enterpriseContact.show = false;
+    },
+    inputChange(val) {
+      this.form.name = val;
+    },
+    contactData(val) {
+      this.form.name = val.name;
+      if (val.phonenumber.indexOf("-") != "-1") {
+        this.form.isTelephone = "1";
+        this.form.areaCode = val.phonenumber.substring(
+            0,
+            val.phonenumber.indexOf("-")
+        );
+        this.form.telephone = val.phonenumber.substring(
+            this.form.areaCode.length + 1
+        );
+        this.form.phonenumber = "";
+      } else {
+        this.form.isTelephone = "0";
+        this.form.phonenumber = val.phonenumber;
+        this.form.areaCode = "";
+        this.form.telephone = "";
+      }
+      this.form.email = val.email;
+      this.form.position = val.position;
+      this.form.depname = val.depname;
+      this.form.sex = val.sex;
+      this.form.birthday = val.birthday;
+      this.form.address = val.address;
+      this.form.remarks = val.remarks;
+      this.form.sys_phonebookid = val.sys_phonebookid;
+    },
+    handleSizeChangeMy(val) {
+      // console.log(`每页 ${val} 条`);
+      this.myContacts.param.content.pageSize = val;
+      this.myContactList();
+    },
+    handleCurrentChangeMy(val) {
+      // console.log(`当前页: ${val}`);
+      this.myContacts.param.content.pageNumber = val;
+      this.myContactList();
+    },
+    onClose() {
+      this.$refs["form"].resetFields();
+      this.tags = [];
+      this.form = {
+        "sat_orderclue_contactsid": 0,
+        "sys_phonebookid": '',
+        "sat_orderclueid": '',
+        "phonenumber": "",
+        "birthday": "",
+        "name": "",
+        "depname": "",
+        "wechatnum": "",
+        "position": "",
+        "email": "",
+        "sex": "",
+        "homeaddress": "",
+        "remarks": "",
+        "fax": "",
+        "isleader": "",
+        "grade": "",
+        "hobby": "",
+        "preference": "",
+        "sys_phonebookgroupid": 0,
+        "telephone": "",
+        "isTelephone": "0",
+        "areaCode": "",
+      };
+      this.dialogFormVisible = false;
+    },
+    async getTag() {
+      this.paramTag.content.ownertable = "plm_unit";
+      const res = await this.$api.requested(this.paramTag);
+      this.tagList = res.data.option;
+    },
+    hasDisabledTag(item) {
+      let arr = [];
+      let arr2 = [];
+      arr = this.tagList.filter((item) => {
+        return this.tags.includes(item.tag);
+      });
+      arr.forEach((e) => {
+        arr2 = arr2.concat(e.mutextag);
+      });
+      arr2 = this.tags.length === 0 ? [] : arr2;
+      let _isSame = arr2.some((tag) => item.tag === tag);
+      return _isSame;
+    },
+  },
+}
+</script>
+
+<style scoped>
+
+</style>

+ 105 - 0
src/HManagement/clueManage/clue_private/modules/contactPerson.vue

@@ -0,0 +1,105 @@
+<template>
+  <div>
+    <add class="inline-16" :data="data" @insertSuccess="listData(param.content.pageNUmber = 1)"></add>
+    <el-input  style="width:200px;" :placeholder="$t('搜索')" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="clearSearchValue" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
+    </el-input>
+    <tableNewLayout :layout="tablecols" :data="list" :opwidth="200" height="calc(100vh - 426px)" :width="true" :custom="true" fixedName="operation" style="margin-top: 10px">
+      <template v-slot:customcol="scope">
+        <div v-if="scope.column.columnname === 'tag'">
+          <el-tag
+              v-for="item in scope.column.data.tag1"
+              :key="item.index"
+              color="#FA8C16"
+              size="mini"
+              type="warning"
+              effect="dark"
+              style="margin-right: 5px"
+          >
+            <span>{{ $t(item) }}</span>
+          </el-tag>
+        </div>
+        <div v-else>
+          {{$t(scope.column.data[[scope.column.columnname]]) || scope.column.columnname === 'operation'?$t(scope.column.data[[scope.column.columnname]]):'--'}}
+        </div>
+      </template>
+      <template v-slot:opreation="scope">
+        <edit class="inline-16" :data="scope.data" @updateSuccess="listData(param.content.pageNUmber = 1)"></edit>
+        <btnDelete message="确定要删除该联系人吗?" :is-number="true" name-id="2025042110012902" name-key="sat_orderclue_contactsid" :id="scope.data.sat_orderclue_contactsid" @deleteSuccess="listData(param.content.pageNUmber = 1)"></btnDelete>
+      </template>
+    </tableNewLayout>
+    <div  class="container normal-panel" style="text-align:right">
+      <el-pagination
+          background
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="currentPage"
+          :page-sizes="[20, 50, 100, 200]"
+          :page-size="50"
+          layout="total,sizes, prev, pager, next, jumper"
+          :total="total">
+      </el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+import add from './addContact'
+import edit from './editContact'
+export default {
+  name: "contactPerson",
+  props:['data'],
+  components:{add,edit},
+  data(){
+    return {
+      param:{
+        "id": 2025042110014402,
+        "content": {
+          "sat_orderclueid": 1864,
+          "pageSize": 50,
+          "pageNumber": 1,
+          "where":{
+            "condition":""
+          }
+        },
+      },
+      list:[],
+      total:0,
+      currentPage:0,
+      tablecols:[],
+    }
+  },
+  methods:{
+    async listData(){
+      this.param.content.sat_orderclueid = this.$route.query.id
+      const res = await this.$api.requested(this.param)
+      this.list = res.data
+      this.total = res.total
+      this.currentPage = res.pageNumber
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.listData()
+    },
+    clearSearchValue(){
+      this.$store.dispatch('clearSearchValue')
+      this.listData(this.param.content.pageNumber = 1)
+    }
+  },
+  mounted() {
+    this.listData()
+  },
+  created() {
+    this.tablecols = this.tool.tabelCol(this.$route.name).contactsDataTable.tablecols
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 11 - 53
src/HManagement/clueManage/clue_private/modules/detail.vue

@@ -9,7 +9,7 @@
       delApiId="20221101100502"
       idname="sat_orderclueid"
       :justsaler="1"
-      :tabs="[$t('跟进记录'), $t('详细信息'), $t('来源线索')]"
+      :tabs="tool.checkAuth($route.name,'contactPerson')?['跟进记录','联系人','详细信息','来源线索']:['跟进记录','详细信息','来源线索']"
       :statusCheck="[{ key: 'allocationstatus', value: '已分配' }]"
       @pageChange="pageChange"
       @onEditSuccess="queryMainData($route.query.id)"
@@ -59,62 +59,18 @@
           :status="mainData.status"
         ></restore>
       </div>
-      <div slot="slot1" class="container normal-panel">
-        <BaseInfo :detailInfo="detailInfo" />
-      </div>
       <div slot="slot0" class="container normal-panel" style="padding: 10px">
         <followDetail ref="followDetail" :disabled="true" />
-        <!--        <el-descriptions>
-          <div slot="title">跟进记录 &nbsp;<i @click="followRecord(param.content.sort[0].reversed = param.content.sort[0].reversed == 1 ? 0 : 1)" :class="param.content.sort[0].reversed == 1?'fa fa-sort-amount-asc':'fa fa-sort-amount-desc'"></i></div>
-        </el-descriptions>
-        <div class="flex-align-center normal-margin">
-          <p>日期:&nbsp;</p>
-          <el-date-picker
-            v-model="value2"
-            type="daterange"
-            align="right"
-            unlink-panels
-            :range-separator="$t(`至`)"
-            :start-placeholder="$t(`开始日期`)"
-            :end-placeholder="$t(`结束日期`)"
-            value-format="yyyy-MM-dd"
-            size="small"
-            @change="dateChange"
-            clearable>
-          </el-date-picker>
-        </div>
-        <div class="detail" v-if="recordlist.length > 0">
-          <div class="item" v-for="(item,index) in recordlist" :key="index">
-            <p>{{index + 1}}.{{item.createdate}},&nbsp;由<span style="font-weight:bold;margin:0 6px;font-size:13px">{{item.createby}}</span>开始跟进,跟进方式:<span style="font-weight:bold;margin:0 5px">{{item.followupmode}}</span>,{{handleTxt[item.logtype]}}</p>
-            <div class="content">
-              <div style="margin-bottom:10px">
-                <p v-if="item.competitor">已购买品牌:{{item.competitor}}</p>
-                {{item.content}}
-              </div>
-              <file-item
-                :marginRight="10"
-                :rowCount="5"
-                :isDownLoad="true"
-                :fileData="item.attinfo">
-              </file-item>
-            </div>
-          </div>
-        </div>
-        <el-empty :title="$t('暂无数据')" v-else></el-empty>
-        <div style="margin-top:16px;text-align:right">
-          <el-pagination
-          background
-          small
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="param.content.pageNumber"
-          :page-size="param.content.pageSize"
-          layout="total, prev, pager, next"
-          :total="total">
-          </el-pagination>
-        </div>-->
+      </div>
+      <div slot="slot1" class="container normal-panel">
+        <contactPerson v-if="tool.checkAuth($route.name,'contactPerson')" :data="mainData"></contactPerson>
+        <BaseInfo v-else :detailInfo="detailInfo" />
       </div>
       <div slot="slot2" class="container normal-panel">
+        <sourceClues v-if="tool.checkAuth($route.name,'contactPerson')"></sourceClues>
+        <sourceClues v-else></sourceClues>
+      </div>
+      <div slot="slot3" class="container normal-panel">
         <sourceClues></sourceClues>
       </div>
     </basicDetails>
@@ -131,6 +87,7 @@ import FileItem from "@/SManagement/orderclue/components/file/index2";
 import sourceClues from "@/HManagement/clueManage/clue_public/modules/sourceClues";
 import changeSite from "@/HManagement/clueManage/clue_private/modules/changeToSite.vue";
 import restore from "./restore.vue";
+import contactPerson from './contactPerson'
 export default {
   name: "detail",
   data() {
@@ -181,6 +138,7 @@ export default {
     changeSite,
     restore,
     followDetail,
+    contactPerson
   },
   methods: {
     async followRecord() {

+ 640 - 0
src/HManagement/clueManage/clue_private/modules/editContact.vue

@@ -0,0 +1,640 @@
+<template>
+  <div>
+    <el-button size="small" type="text" @click="onshow" >{{
+        $t("编辑")
+      }}</el-button>
+    <el-drawer
+        :title="$t(`编辑联系人`)"
+        :visible.sync="dialogFormVisible"
+        size="600px"
+        direction="rtl"
+        :show-close="false"
+        append-to-body
+        @close="onClose"
+    >
+      <div class="drawer__panel">
+        <el-row :gutter="20">
+          <el-form
+              :model="form"
+              :rules="rules"
+              ref="form"
+              size="mini"
+              label-position="right"
+              :label-width="tool.onlyZh('90px')"
+          >
+            <el-col :span="24">
+              <el-form-item :label="$t(`姓名`) + ':'" prop="name">
+                <contactsNewTemplate
+                   :is-param="true"
+                   :new-param="contactParam"
+                   :name="form.name"
+                   @contactData="contactData"
+                   @inputChange="inputChange"
+                ></contactsNewTemplate>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item>
+                <el-radio v-model="form.isTelephone" label="0">{{
+                    $t("手机号")
+                  }}</el-radio>
+                <el-radio v-model="form.isTelephone" label="1">{{
+                    $t("座机电话")
+                  }}</el-radio>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24" v-if="form.isTelephone == '1'">
+              <el-form-item :label="$t('联系方式') + ':'" prop="telephone">
+                <el-input
+                    v-model="form.areaCode"
+                    style="width: 25%"
+                    autocomplete="on"
+                    :placeholder="$t('请填写区号')"
+                ></el-input>
+                <span style="color: #999999">——</span>
+                <el-input
+                    v-model="form.telephone"
+                    style="width: 68%"
+                    autocomplete="on"
+                    :placeholder="$t('请填写座机电话')"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item
+                  v-if="form.isTelephone == '0'"
+                  :label="$t('联系方式') + ':'"
+                  prop="phonenumber"
+                  :rules="[
+                  { required: true, message: this.$t('手机号码不能为空') },
+                  {
+                    pattern: /^1[3-9][0-9]\d{8}$/,
+                    message: this.$t('请输入正确手机号码'),
+                    trigger: 'change',
+                  },
+                ]"
+              >
+                <el-input
+                    v-model="form.phonenumber"
+                    autocomplete="on"
+                    :placeholder="$t('请填写手机号码')"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t('微信') + ':'" prop="wechatnum">
+                <el-input
+                    autosize
+                    v-model="form.wechatnum"
+                    :placeholder="$t(`请输入微信`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item
+                  :label="$t(`邮箱`) + ':'"
+                  :rules="[
+                  {
+                    pattern:
+                      /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
+                    message: $t('请输入有效的邮箱'),
+                    trigger: 'change',
+                  },
+                ]"
+              >
+                <el-input
+                    autosize
+                    v-model="form.email"
+                    :placeholder="$t(`请输入邮箱`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`传真`) + ':'">
+                <el-input
+                    autosize
+                    v-model="form.fax"
+                    :placeholder="$t(`请输入传真`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`关联企业`) + ':'">
+                <el-input
+                    autosize
+                    v-model="form.enterprisename"
+                    :placeholder="$t(`请输入关联企业`)"
+                    disabled
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`部门`) + ':'" prop="depname">
+                <el-input
+                    autosize
+                    v-model="form.depname"
+                    :placeholder="$t(`请输入部门`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`职位`) + ':'" prop="position">
+                <el-input
+                    autosize
+                    v-model="form.position"
+                    :placeholder="$t(`请输入职位`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`性别`) + ':'">
+                <el-radio v-model="form.sex" label="男">{{
+                    $t("男")
+                  }}</el-radio>
+                <el-radio v-model="form.sex" label="女">{{
+                    $t("女")
+                  }}</el-radio>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`生日`) + ':'">
+                <el-date-picker
+                    v-model="form.birthday"
+                    value-format="yyyy-MM-dd"
+                    type="date"
+                    :placeholder="$t('选择日期')"
+                    style="width: 100%"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`家庭住址`) + ':'">
+                <el-input
+                    type="textarea"
+                    rows="5"
+                    v-model="form.address"
+                    :placeholder="$t(`请输入家庭住址`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`偏好`)" prop="preference">
+                <el-input
+                    v-model="form.preference"
+                    autocomplete="on"
+                    :placeholder="$t(`请填写偏好`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`爱好`)" prop="hobby">
+                <el-input
+                    v-model="form.hobby"
+                    autocomplete="on"
+                    :placeholder="$t(`请填写爱好`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`备注`) + ':'">
+                <el-input
+                    type="textarea"
+                    rows="5"
+                    v-model="form.remarks"
+                    :placeholder="$t(`请输入备注`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </el-row>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button size="small" @click="onClose" class="normal-btn-width">{{
+            $t("取 消")
+          }}</el-button>
+        <el-button
+            size="small"
+            type="primary"
+            :loading="loading"
+            @click="onSubmit"
+            class="normal-btn-width"
+        >{{ $t("确 定") }}</el-button
+        >
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import { mapGetters } from "vuex";
+import contactsNewTemplate from "@/template/contactsNewTemplate/index";
+export default {
+  name: "editContact",
+  props: ["data"],
+  components: { contactsNewTemplate },
+  data() {
+    var validateMobilePhone = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error(this.$t("手机号不可为空")));
+      } else {
+        if (value !== "") {
+          var reg = /^1[3456789]\d{9}$/;
+          if (!reg.test(value)) {
+            callback(new Error(this.$t("请输入有效的手机号码")));
+          }
+        }
+        callback();
+      }
+    };
+    var telephone = (rule, value, callback) => {
+      if (this.form.areaCode === "" && this.form.telephone === "") {
+        callback(new Error(this.$t("座机电话不能为空")));
+      } else {
+        var reg = /^0\d{2,3}-\d{7,8}$/;
+        let telephone = this.form.areaCode + "-" + this.form.telephone;
+        if (!reg.test(telephone)) {
+          callback(new Error(this.$t("请输入正确座机电话")));
+        } else {
+          callback();
+        }
+      }
+    };
+    return {
+      dialogFormVisible: false,
+      activeName: "first",
+      visible: false,
+      tagList: [],
+      tags: [],
+      groupname: "客户联系人",
+      form: {
+        "sat_orderclue_contactsid": 0,
+        "sys_phonebookid": '',
+        "sat_orderclueid": '',
+        "phonenumber": "",
+        "birthday": "",
+        "name": "",
+        "depname": "",
+        "wechatnum": "",
+        "position": "",
+        "email": "",
+        "sex": "",
+        "homeaddress": "",
+        "remarks": "",
+        "fax": "",
+        "isleader": "",
+        "grade": "",
+        "hobby": "",
+        "preference": "",
+        "sys_phonebookgroupid": 0,
+        "telephone": "",
+        "isTelephone": "0",
+        "areaCode": "",
+      },
+      rules: {
+        name: [
+          { required: true, message: this.$t("姓名不能为空"), trigger: "blur,change" },
+        ],
+        // phonenumber: [
+        //   { required: true, validator: validateMobilePhone, trigger: 'blur' },
+        // ]
+        telephone: [
+          { required: true, validator: telephone, trigger: "change" },
+        ],
+        depname: [
+          { required: true, message: this.$t('部门不能为空'), trigger: 'blur' },
+        ],
+        position: [
+          { required: true, message: this.$t('职位不能为空'), trigger: 'blur' },
+        ],
+      },
+      enterpriseContact: {
+        param: {
+          content: {
+            sys_enterpriseid: "",
+            pageNumber: 1,
+            pageSize: 9999,
+            where: {
+              condition: "",
+            },
+          },
+          id: 20221219193002,
+        },
+        listData: [],
+        total: 0,
+        currentPage: 0,
+        show: false,
+      },
+      myContacts: {
+        param: {
+          id: 20221219161202,
+          content: {
+            pageNumber: 1,
+            pageSize: 9999,
+            ownertable: "sa_customers",
+            ownerid: "",
+            where: {
+              condition: "",
+            },
+          },
+        },
+        listData: [],
+        total: 0,
+        currentPage: 0,
+        show: false,
+      },
+      paramTag: {
+        id: "20220929085401",
+        content: {
+          nocache: true,
+          ownertable: "",
+          ownerid: 0,
+        },
+      },
+      contactParam:{
+        "id": 2025042110061502,
+        "content": {
+          "sat_orderclueid": this.$route.query.id,
+          "pageSize": 20,
+          "pageNumber": 1,
+          "where":{
+            "condition":""
+          }
+        },
+      }
+    };
+  },
+  computed: {
+    ...mapGetters({
+      loading: "loading",
+    }),
+  },
+  methods: {
+    onshow() {
+      this.dialogFormVisible = true;
+      this.activeName = "first";
+      this.enterpriseContact.param.content.pageNumber = 1;
+      this.myContacts.param.content.pageNumber = 1;
+      this.enterpriseContactList();
+      this.myContactList();
+      this.getTag();
+      // this.form.sys_enterpriseid = this.data.sys_enterpriseid;
+      this.form = Object.assign({}, this.form, this.data);
+      // this.tags = this.form.tag;
+      if (this.form.phonenumber.indexOf("-") != "-1") {
+        this.form.isTelephone = "1";
+        this.form.areaCode = this.data.phonenumber.substring(
+            0,
+            this.form.phonenumber.indexOf("-")
+        );
+        this.form.telephone = this.data.phonenumber.substring(
+            this.form.areaCode.length + 1
+        );
+        this.form.phonenumber = "";
+      }
+      // this.form.enterprisename = this.data.enterprisename_customer;
+    },
+    onSubmit() {
+      this.$refs["form"].validate(async (valid) => {
+        if (!valid) return false;
+        this.$store.commit("setLoading", true);
+        if (this.form.isTelephone == "1") {
+          this.form.phonenumber =
+              this.form.areaCode + "-" + this.form.telephone;
+        }
+        this.form.sat_orderclueid = this.$route.query.id
+        const res = await this.$api.requested({
+          id: "2025042110003902",
+          content: this.form,
+        });
+        this.tool.showMessage(res, async () => {
+          /*let res2 = await this.$api.requested({
+            "id": 20220929090901,
+            "content": {
+              "ownertable":"sys_phonebook",
+              "ownerid":res.data.sys_phonebookid,
+              "datatag": this.tags
+            }
+          })*/
+          this.$emit("updateSuccess");
+          this.$refs["form"].resetFields();
+          this.tags = [];
+          this.form = {
+            "sat_orderclue_contactsid": 0,
+            "sys_phonebookid": '',
+            "sat_orderclueid": '',
+            "phonenumber": "",
+            "birthday": "",
+            "name": "",
+            "depname": "",
+            "wechatnum": "",
+            "position": "",
+            "email": "",
+            "sex": "",
+            "homeaddress": "",
+            "remarks": "",
+            "fax": "",
+            "isleader": "",
+            "grade": "",
+            "hobby": "",
+            "preference": "",
+            "sys_phonebookgroupid": 0,
+            "telephone": "",
+            "isTelephone": "0",
+            "areaCode": "",
+          };
+          this.$store.commit("setLoading", false);
+          this.dialogFormVisible = false;
+        });
+      });
+    },
+    searchData() {
+      this.changeTab();
+    },
+    changeTab() {
+      this.enterpriseContactList();
+      this.myContactList();
+    },
+    /*企业联系人*/
+    async enterpriseContactList() {
+      this.enterpriseContact.param.content.where.condition = this.form.name;
+      this.enterpriseContact.param.content.sys_enterpriseid =
+          this.data.sys_enterpriseid;
+      const res = await this.$api.requested(this.enterpriseContact.param);
+      this.enterpriseContact.listData = res.data;
+      this.enterpriseContact.total = res.total;
+      this.enterpriseContact.currentPage = res.pageNumber;
+    },
+    /*选择企业联系人*/
+    enterpriseContactSelect(val) {
+      this.form.name = val.name;
+      if (val.phonenumber.indexOf("-") != "-1") {
+        this.form.isTelephone = "1";
+        this.form.areaCode = val.phonenumber.substring(
+            0,
+            val.phonenumber.indexOf("-")
+        );
+        this.form.telephone = val.phonenumber.substring(
+            this.form.areaCode.length + 1
+        );
+        this.form.phonenumber = "";
+      } else {
+        this.form.isTelephone = "0";
+        this.form.phonenumber = val.phonenumber;
+        this.form.areaCode = "";
+        this.form.telephone = "";
+      }
+      this.form.email = val.email;
+      this.form.position = val.position;
+      this.form.depname = val.depname;
+      this.form.sex = val.sex;
+      this.form.birthday = val.birthday;
+      this.form.address = val.address;
+      this.form.remarks = val.remarks;
+      this.enterpriseContact.show = false;
+    },
+    handleSizeChangeEnterprise(val) {
+      // console.log(`每页 ${val} 条`);
+      this.enterpriseContact.param.content.pageSize = val;
+      this.enterpriseContactList();
+    },
+    handleCurrentChangeEnterprise(val) {
+      // console.log(`当前页: ${val}`);
+      this.enterpriseContact.param.content.pageNumber = val;
+      this.enterpriseContactList();
+    },
+    /*我的联系人*/
+    async myContactList() {
+      this.myContacts.param.content.where.condition = this.form.name;
+      this.myContacts.param.content.sys_enterpriseid =
+          this.data.sys_enterpriseid;
+      this.myContacts.param.content.ownerid = this.data.sys_enterpriseid;
+      const res = await this.$api.requested(this.myContacts.param);
+
+      this.myContacts.listData = res.data;
+      this.myContacts.total = res.total;
+      this.myContacts.currentPage = res.pageNumber;
+    },
+    /*选择我的联系人*/
+    myContactSelect(val) {
+      this.form.name = val.name;
+      if (val.phonenumber.indexOf("-") != "-1") {
+        this.form.isTelephone = "1";
+        this.form.areaCode = val.phonenumber.substring(
+            0,
+            val.phonenumber.indexOf("-")
+        );
+        this.form.telephone = val.phonenumber.substring(
+            this.form.areaCode.length + 1
+        );
+        this.form.phonenumber = "";
+      } else {
+        this.form.isTelephone = "0";
+        this.form.phonenumber = val.phonenumber;
+        this.form.areaCode = "";
+        this.form.telephone = "";
+      }
+      this.form.email = val.email;
+      this.form.position = val.position;
+      this.form.depname = val.depname;
+      this.form.sex = val.sex;
+      this.form.birthday = val.birthday;
+      this.form.address = val.address;
+      this.form.remarks = val.remarks;
+      this.form.sys_phonebookid = val.sys_phonebookid;
+      this.enterpriseContact.show = false;
+    },
+    inputChange(val) {
+      this.form.name = val;
+    },
+    contactData(val) {
+      this.form.name = val.name;
+      if (val.phonenumber.indexOf("-") != "-1") {
+        this.form.isTelephone = "1";
+        this.form.areaCode = val.phonenumber.substring(
+            0,
+            val.phonenumber.indexOf("-")
+        );
+        this.form.telephone = val.phonenumber.substring(
+            this.form.areaCode.length + 1
+        );
+        this.form.phonenumber = "";
+      } else {
+        this.form.isTelephone = "0";
+        this.form.phonenumber = val.phonenumber;
+        this.form.areaCode = "";
+        this.form.telephone = "";
+      }
+      this.form.email = val.email;
+      this.form.position = val.position;
+      this.form.depname = val.depname;
+      this.form.sex = val.sex;
+      this.form.birthday = val.birthday;
+      this.form.address = val.address;
+      this.form.remarks = val.remarks;
+      this.form.sys_phonebookid = val.sys_phonebookid;
+    },
+    handleSizeChangeMy(val) {
+      // console.log(`每页 ${val} 条`);
+      this.myContacts.param.content.pageSize = val;
+      this.myContactList();
+    },
+    handleCurrentChangeMy(val) {
+      // console.log(`当前页: ${val}`);
+      this.myContacts.param.content.pageNumber = val;
+      this.myContactList();
+    },
+    onClose() {
+      this.$refs["form"].resetFields();
+      this.tags = [];
+      this.form = {
+        "sat_orderclue_contactsid": 0,
+        "sys_phonebookid": '',
+        "sat_orderclueid": '',
+        "phonenumber": "",
+        "birthday": "",
+        "name": "",
+        "depname": "",
+        "wechatnum": "",
+        "position": "",
+        "email": "",
+        "sex": "",
+        "homeaddress": "",
+        "remarks": "",
+        "fax": "",
+        "isleader": "",
+        "grade": "",
+        "hobby": "",
+        "preference": "",
+        "sys_phonebookgroupid": 0,
+        "telephone": "",
+        "isTelephone": "0",
+        "areaCode": "",
+      };
+      this.dialogFormVisible = false;
+    },
+    async getTag() {
+      this.paramTag.content.ownertable = "plm_unit";
+      const res = await this.$api.requested(this.paramTag);
+      this.tagList = res.data.option;
+    },
+    hasDisabledTag(item) {
+      let arr = [];
+      let arr2 = [];
+      arr = this.tagList.filter((item) => {
+        return this.tags.includes(item.tag);
+      });
+      arr.forEach((e) => {
+        arr2 = arr2.concat(e.mutextag);
+      });
+      arr2 = this.tags.length === 0 ? [] : arr2;
+      let _isSame = arr2.some((tag) => item.tag === tag);
+      return _isSame;
+    },
+  },
+}
+</script>
+
+<style scoped>
+
+</style>

+ 627 - 0
src/HManagement/clueManage/clue_public/modules/addContact.vue

@@ -0,0 +1,627 @@
+<template>
+  <div>
+    <el-button size="small" type="primary" @click="onshow" >{{
+        $t("新 建")
+      }}</el-button>
+    <el-drawer
+        :title="$t(`新建联系人`)"
+        :visible.sync="dialogFormVisible"
+        size="600px"
+        direction="rtl"
+        :show-close="false"
+        append-to-body
+        @close="onClose"
+    >
+      <div class="drawer__panel">
+        <el-row :gutter="20">
+          <el-form
+              :model="form"
+              :rules="rules"
+              ref="form"
+              size="mini"
+              label-position="right"
+              :label-width="tool.onlyZh('90px')"
+          >
+            <el-col :span="24">
+              <el-form-item :label="$t(`姓名`) + ':'" prop="name">
+                <contactsNewTemplate
+                   :is-param="true"
+                   :new-param="contactParam"
+                   :name="form.name"
+                   @contactData="contactData"
+                   @inputChange="inputChange"
+                ></contactsNewTemplate>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item>
+                <el-radio v-model="form.isTelephone" label="0">{{
+                    $t("手机号")
+                  }}</el-radio>
+                <el-radio v-model="form.isTelephone" label="1">{{
+                    $t("座机电话")
+                  }}</el-radio>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24" v-if="form.isTelephone == '1'">
+              <el-form-item :label="$t('联系方式') + ':'" prop="telephone">
+                <el-input
+                    v-model="form.areaCode"
+                    style="width: 25%"
+                    autocomplete="on"
+                    :placeholder="$t('请填写区号')"
+                ></el-input>
+                <span style="color: #999999">——</span>
+                <el-input
+                    v-model="form.telephone"
+                    style="width: 68%"
+                    autocomplete="on"
+                    :placeholder="$t('请填写座机电话')"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item
+                  v-if="form.isTelephone == '0'"
+                  :label="$t('联系方式') + ':'"
+                  prop="phonenumber"
+                  :rules="[
+                  { required: true, message: this.$t('手机号码不能为空') },
+                  {
+                    pattern: /^1[3-9][0-9]\d{8}$/,
+                    message: this.$t('请输入正确手机号码'),
+                    trigger: 'change',
+                  },
+                ]"
+              >
+                <el-input
+                    v-model="form.phonenumber"
+                    autocomplete="on"
+                    :placeholder="$t('请填写手机号码')"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t('微信') + ':'" prop="wechatnum">
+                <el-input
+                    autosize
+                    v-model="form.wechatnum"
+                    :placeholder="$t(`请输入微信`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item
+                  :label="$t(`邮箱`) + ':'"
+                  :rules="[
+                  {
+                    pattern:
+                      /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
+                    message: $t('请输入有效的邮箱'),
+                    trigger: 'change',
+                  },
+                ]"
+              >
+                <el-input
+                    autosize
+                    v-model="form.email"
+                    :placeholder="$t(`请输入邮箱`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`传真`) + ':'">
+                <el-input
+                    autosize
+                    v-model="form.fax"
+                    :placeholder="$t(`请输入传真`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`关联企业`) + ':'">
+                <el-input
+                    autosize
+                    v-model="form.enterprisename"
+                    :placeholder="$t(`请输入关联企业`)"
+                    disabled
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`部门`) + ':'" prop="depname">
+                <el-input
+                    autosize
+                    v-model="form.depname"
+                    :placeholder="$t(`请输入部门`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`职位`) + ':'" prop="position">
+                <el-input
+                    autosize
+                    v-model="form.position"
+                    :placeholder="$t(`请输入职位`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`性别`) + ':'">
+                <el-radio v-model="form.sex" label="男">{{
+                    $t("男")
+                  }}</el-radio>
+                <el-radio v-model="form.sex" label="女">{{
+                    $t("女")
+                  }}</el-radio>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`生日`) + ':'">
+                <el-date-picker
+                    v-model="form.birthday"
+                    value-format="yyyy-MM-dd"
+                    type="date"
+                    :placeholder="$t('选择日期')"
+                    style="width: 100%"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`家庭住址`) + ':'">
+                <el-input
+                    type="textarea"
+                    rows="5"
+                    v-model="form.address"
+                    :placeholder="$t(`请输入家庭住址`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`偏好`)" prop="preference">
+                <el-input
+                    v-model="form.preference"
+                    autocomplete="on"
+                    :placeholder="$t(`请填写偏好`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`爱好`)" prop="hobby">
+                <el-input
+                    v-model="form.hobby"
+                    autocomplete="on"
+                    :placeholder="$t(`请填写爱好`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`备注`) + ':'">
+                <el-input
+                    type="textarea"
+                    rows="5"
+                    v-model="form.remarks"
+                    :placeholder="$t(`请输入备注`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </el-row>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button size="small" @click="onClose" class="normal-btn-width">{{
+            $t("取 消")
+          }}</el-button>
+        <el-button
+            size="small"
+            type="primary"
+            :loading="loading"
+            @click="onSubmit"
+            class="normal-btn-width"
+        >{{ $t("确 定") }}</el-button
+        >
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import { mapGetters } from "vuex";
+import contactsNewTemplate from "@/template/contactsNewTemplate/index";
+export default {
+  name: "addContact",
+  props: ["data"],
+  components: { contactsNewTemplate },
+  data() {
+    var validateMobilePhone = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error(this.$t("手机号不可为空")));
+      } else {
+        if (value !== "") {
+          var reg = /^1[3456789]\d{9}$/;
+          if (!reg.test(value)) {
+            callback(new Error(this.$t("请输入有效的手机号码")));
+          }
+        }
+        callback();
+      }
+    };
+    var telephone = (rule, value, callback) => {
+      if (this.form.areaCode === "" && this.form.telephone === "") {
+        callback(new Error(this.$t("座机电话不能为空")));
+      } else {
+        var reg = /^0\d{2,3}-\d{7,8}$/;
+        let telephone = this.form.areaCode + "-" + this.form.telephone;
+        if (!reg.test(telephone)) {
+          callback(new Error(this.$t("请输入正确座机电话")));
+        } else {
+          callback();
+        }
+      }
+    };
+    return {
+      dialogFormVisible: false,
+      activeName: "first",
+      visible: false,
+      tagList: [],
+      tags: [],
+      groupname: "客户联系人",
+      form: {
+        "sat_orderclue_contactsid": 0,
+        "sys_phonebookid": '',
+        "sat_orderclueid": '',
+        "phonenumber": "",
+        "birthday": "",
+        "name": "",
+        "depname": "",
+        "wechatnum": "",
+        "position": "",
+        "email": "",
+        "sex": "",
+        "homeaddress": "",
+        "remarks": "",
+        "fax": "",
+        "isleader": "",
+        "grade": "",
+        "hobby": "",
+        "preference": "",
+        "sys_phonebookgroupid": 0,
+        "telephone": "",
+        "isTelephone": "0",
+        "areaCode": "",
+      },
+      rules: {
+        name: [
+          { required: true, message: this.$t("姓名不能为空"), trigger: "blur,change" },
+        ],
+        // phonenumber: [
+        //   { required: true, validator: validateMobilePhone, trigger: 'blur' },
+        // ]
+        telephone: [
+          { required: true, validator: telephone, trigger: "change" },
+        ],
+        depname: [
+          { required: true, message: this.$t('部门不能为空'), trigger: 'blur' },
+        ],
+        position: [
+          { required: true, message: this.$t('职位不能为空'), trigger: 'blur' },
+        ],
+      },
+      enterpriseContact: {
+        param: {
+          content: {
+            sys_enterpriseid: "",
+            pageNumber: 1,
+            pageSize: 9999,
+            where: {
+              condition: "",
+            },
+          },
+          id: 20221219193002,
+        },
+        listData: [],
+        total: 0,
+        currentPage: 0,
+        show: false,
+      },
+      myContacts: {
+        param: {
+          id: 20221219161202,
+          content: {
+            pageNumber: 1,
+            pageSize: 9999,
+            ownertable: "sa_customers",
+            ownerid: "",
+            where: {
+              condition: "",
+            },
+          },
+        },
+        listData: [],
+        total: 0,
+        currentPage: 0,
+        show: false,
+      },
+      paramTag: {
+        id: "20220929085401",
+        content: {
+          nocache: true,
+          ownertable: "",
+          ownerid: 0,
+        },
+      },
+      contactParam:{
+        "id": 2025042110061502,
+        "content": {
+          "sat_orderclueid": this.$route.query.id,
+          "pageSize": 20,
+          "pageNumber": 1,
+          "where":{
+            "condition":""
+          }
+        },
+      }
+    };
+  },
+  computed: {
+    ...mapGetters({
+      loading: "loading",
+    }),
+  },
+  methods: {
+    onshow() {
+      this.dialogFormVisible = true;
+      this.activeName = "first";
+      this.enterpriseContact.param.content.pageNumber = 1;
+      this.myContacts.param.content.pageNumber = 1;
+      this.enterpriseContactList();
+      this.myContactList();
+      this.getTag();
+      // this.form.sys_enterpriseid = this.data.sys_enterpriseid;
+      this.form.enterprisename = this.data.enterprisename_customer;
+    },
+    onSubmit() {
+      this.$refs["form"].validate(async (valid) => {
+        if (!valid) return false;
+        this.$store.commit("setLoading", true);
+        if (this.form.isTelephone == "1") {
+          this.form.phonenumber =
+              this.form.areaCode + "-" + this.form.telephone;
+        }
+        this.form.sat_orderclueid = this.$route.query.id
+        const res = await this.$api.requested({
+          id: "2025042110003902",
+          content: this.form,
+        });
+        this.tool.showMessage(res, async () => {
+          /*let res2 = await this.$api.requested({
+            "id": 20220929090901,
+            "content": {
+              "ownertable":"sys_phonebook",
+              "ownerid":res.data.sys_phonebookid,
+              "datatag": this.tags
+            }
+          })*/
+          this.$emit("insertSuccess");
+          this.$refs["form"].resetFields();
+          this.tags = [];
+          this.form = {
+            "sat_orderclue_contactsid": 0,
+            "sys_phonebookid": '',
+            "sat_orderclueid": '',
+            "phonenumber": "",
+            "birthday": "",
+            "name": "",
+            "depname": "",
+            "wechatnum": "",
+            "position": "",
+            "email": "",
+            "sex": "",
+            "homeaddress": "",
+            "remarks": "",
+            "fax": "",
+            "isleader": "",
+            "grade": "",
+            "hobby": "",
+            "preference": "",
+            "sys_phonebookgroupid": 0,
+            "telephone": "",
+            "isTelephone": "0",
+            "areaCode": "",
+          };
+          this.$store.commit("setLoading", false);
+          this.dialogFormVisible = false;
+        });
+      });
+    },
+    searchData() {
+      this.changeTab();
+    },
+    changeTab() {
+      this.enterpriseContactList();
+      this.myContactList();
+    },
+    /*企业联系人*/
+    async enterpriseContactList() {
+      this.enterpriseContact.param.content.where.condition = this.form.name;
+      this.enterpriseContact.param.content.sys_enterpriseid =
+          this.data.sys_enterpriseid;
+      const res = await this.$api.requested(this.enterpriseContact.param);
+      this.enterpriseContact.listData = res.data;
+      this.enterpriseContact.total = res.total;
+      this.enterpriseContact.currentPage = res.pageNumber;
+    },
+    /*选择企业联系人*/
+    enterpriseContactSelect(val) {
+      this.form.name = val.name;
+      if (val.phonenumber.indexOf("-") != "-1") {
+        this.form.isTelephone = "1";
+        this.form.areaCode = val.phonenumber.substring(
+            0,
+            val.phonenumber.indexOf("-")
+        );
+        this.form.telephone = val.phonenumber.substring(
+            this.form.areaCode.length + 1
+        );
+        this.form.phonenumber = "";
+      } else {
+        this.form.isTelephone = "0";
+        this.form.phonenumber = val.phonenumber;
+        this.form.areaCode = "";
+        this.form.telephone = "";
+      }
+      this.form.email = val.email;
+      this.form.position = val.position;
+      this.form.depname = val.depname;
+      this.form.sex = val.sex;
+      this.form.birthday = val.birthday;
+      this.form.address = val.address;
+      this.form.remarks = val.remarks;
+      this.enterpriseContact.show = false;
+    },
+    handleSizeChangeEnterprise(val) {
+      // console.log(`每页 ${val} 条`);
+      this.enterpriseContact.param.content.pageSize = val;
+      this.enterpriseContactList();
+    },
+    handleCurrentChangeEnterprise(val) {
+      // console.log(`当前页: ${val}`);
+      this.enterpriseContact.param.content.pageNumber = val;
+      this.enterpriseContactList();
+    },
+    /*我的联系人*/
+    async myContactList() {
+      this.myContacts.param.content.where.condition = this.form.name;
+      this.myContacts.param.content.sys_enterpriseid =
+          this.data.sys_enterpriseid;
+      this.myContacts.param.content.ownerid = this.data.sys_enterpriseid;
+      const res = await this.$api.requested(this.myContacts.param);
+
+      this.myContacts.listData = res.data;
+      this.myContacts.total = res.total;
+      this.myContacts.currentPage = res.pageNumber;
+    },
+    /*选择我的联系人*/
+    myContactSelect(val) {
+      this.form.name = val.name;
+      if (val.phonenumber.indexOf("-") != "-1") {
+        this.form.isTelephone = "1";
+        this.form.areaCode = val.phonenumber.substring(
+            0,
+            val.phonenumber.indexOf("-")
+        );
+        this.form.telephone = val.phonenumber.substring(
+            this.form.areaCode.length + 1
+        );
+        this.form.phonenumber = "";
+      } else {
+        this.form.isTelephone = "0";
+        this.form.phonenumber = val.phonenumber;
+        this.form.areaCode = "";
+        this.form.telephone = "";
+      }
+      this.form.email = val.email;
+      this.form.position = val.position;
+      this.form.depname = val.depname;
+      this.form.sex = val.sex;
+      this.form.birthday = val.birthday;
+      this.form.address = val.address;
+      this.form.remarks = val.remarks;
+      this.form.sys_phonebookid = val.sys_phonebookid;
+      this.enterpriseContact.show = false;
+    },
+    inputChange(val) {
+      this.form.name = val;
+    },
+    contactData(val) {
+      this.form.name = val.name;
+      if (val.phonenumber.indexOf("-") != "-1") {
+        this.form.isTelephone = "1";
+        this.form.areaCode = val.phonenumber.substring(
+            0,
+            val.phonenumber.indexOf("-")
+        );
+        this.form.telephone = val.phonenumber.substring(
+            this.form.areaCode.length + 1
+        );
+        this.form.phonenumber = "";
+      } else {
+        this.form.isTelephone = "0";
+        this.form.phonenumber = val.phonenumber;
+        this.form.areaCode = "";
+        this.form.telephone = "";
+      }
+      this.form.email = val.email;
+      this.form.position = val.position;
+      this.form.depname = val.depname;
+      this.form.sex = val.sex;
+      this.form.birthday = val.birthday;
+      this.form.address = val.address;
+      this.form.remarks = val.remarks;
+      this.form.sys_phonebookid = val.sys_phonebookid;
+    },
+    handleSizeChangeMy(val) {
+      // console.log(`每页 ${val} 条`);
+      this.myContacts.param.content.pageSize = val;
+      this.myContactList();
+    },
+    handleCurrentChangeMy(val) {
+      // console.log(`当前页: ${val}`);
+      this.myContacts.param.content.pageNumber = val;
+      this.myContactList();
+    },
+    onClose() {
+      this.$refs["form"].resetFields();
+      this.tags = [];
+      this.form = {
+        "sat_orderclue_contactsid": 0,
+        "sys_phonebookid": '',
+        "sat_orderclueid": '',
+        "phonenumber": "",
+        "birthday": "",
+        "name": "",
+        "depname": "",
+        "wechatnum": "",
+        "position": "",
+        "email": "",
+        "sex": "",
+        "homeaddress": "",
+        "remarks": "",
+        "fax": "",
+        "isleader": "",
+        "grade": "",
+        "hobby": "",
+        "preference": "",
+        "sys_phonebookgroupid": 0,
+        "telephone": "",
+        "isTelephone": "0",
+        "areaCode": "",
+      };
+      this.dialogFormVisible = false;
+    },
+    async getTag() {
+      this.paramTag.content.ownertable = "plm_unit";
+      const res = await this.$api.requested(this.paramTag);
+      this.tagList = res.data.option;
+    },
+    hasDisabledTag(item) {
+      let arr = [];
+      let arr2 = [];
+      arr = this.tagList.filter((item) => {
+        return this.tags.includes(item.tag);
+      });
+      arr.forEach((e) => {
+        arr2 = arr2.concat(e.mutextag);
+      });
+      arr2 = this.tags.length === 0 ? [] : arr2;
+      let _isSame = arr2.some((tag) => item.tag === tag);
+      return _isSame;
+    },
+  },
+}
+</script>
+
+<style scoped>
+
+</style>

+ 105 - 0
src/HManagement/clueManage/clue_public/modules/contactPerson.vue

@@ -0,0 +1,105 @@
+<template>
+  <div>
+    <add class="inline-16" :data="data" @insertSuccess="listData(param.content.pageNUmber = 1)"></add>
+    <el-input  style="width:200px;" :placeholder="$t('搜索')" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="clearSearchValue" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
+    </el-input>
+    <tableNewLayout :layout="tablecols" :data="list" :opwidth="200" height="calc(100vh - 426px)" :width="true" :custom="true" fixedName="operation" style="margin-top: 10px">
+      <template v-slot:customcol="scope">
+        <div v-if="scope.column.columnname === 'tag'">
+          <el-tag
+              v-for="item in scope.column.data.tag1"
+              :key="item.index"
+              color="#FA8C16"
+              size="mini"
+              type="warning"
+              effect="dark"
+              style="margin-right: 5px"
+          >
+            <span>{{ $t(item) }}</span>
+          </el-tag>
+        </div>
+        <div v-else>
+          {{$t(scope.column.data[[scope.column.columnname]]) || scope.column.columnname === 'operation'?$t(scope.column.data[[scope.column.columnname]]):'--'}}
+        </div>
+      </template>
+      <template v-slot:opreation="scope">
+        <edit class="inline-16" :data="scope.data" @updateSuccess="listData(param.content.pageNUmber = 1)"></edit>
+        <btnDelete message="确定要删除该联系人吗?" :is-number="true" name-id="2025042110012902" name-key="sat_orderclue_contactsid" :id="scope.data.sat_orderclue_contactsid" @deleteSuccess="listData(param.content.pageNUmber = 1)"></btnDelete>
+      </template>
+    </tableNewLayout>
+    <div  class="container normal-panel" style="text-align:right">
+      <el-pagination
+          background
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="currentPage"
+          :page-sizes="[20, 50, 100, 200]"
+          :page-size="50"
+          layout="total,sizes, prev, pager, next, jumper"
+          :total="total">
+      </el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+import add from './addContact'
+import edit from './editContact'
+export default {
+  name: "contactPerson",
+  props:['data'],
+  components:{add,edit},
+  data(){
+    return {
+      param:{
+        "id": 2025042110014402,
+        "content": {
+          "sat_orderclueid": 1864,
+          "pageSize": 50,
+          "pageNumber": 1,
+          "where":{
+            "condition":""
+          }
+        },
+      },
+      list:[],
+      total:0,
+      currentPage:0,
+      tablecols:[],
+    }
+  },
+  methods:{
+    async listData(){
+      this.param.content.sat_orderclueid = this.$route.query.id
+      const res = await this.$api.requested(this.param)
+      this.list = res.data
+      this.total = res.total
+      this.currentPage = res.pageNumber
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.listData()
+    },
+    clearSearchValue(){
+      this.$store.dispatch('clearSearchValue')
+      this.listData(this.param.content.pageNumber = 1)
+    }
+  },
+  mounted() {
+    this.listData()
+  },
+  created() {
+    this.tablecols = this.tool.tabelCol(this.$route.name).contactsTable.tablecols
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 10 - 55
src/HManagement/clueManage/clue_public/modules/detail.vue

@@ -11,7 +11,7 @@
         turnPageId="20221101094402"
         idname="sat_orderclueid"
         tags=""
-        :tabs="[$t('跟进记录'),$t('详细信息'),$t('来源线索')]"
+        :tabs="tool.checkAuth($route.name,'contactPerson')?['跟进记录','联系人','详细信息','来源线索']:['跟进记录','详细信息','来源线索']"
         @pageChange="pageChange"
         delApiId="20221101100502"
         @onEditSuccess="queryMainData($route.query.id)">
@@ -23,63 +23,16 @@
         <restore v-if="tool.checkAuth($route.name,'restore')" class="inline-16" @restSuccess="queryMainData" :status="mainData.status"></restore>
         <!-- <recall v-if="tool.checkAuth($route.name,'recall')" :data="mainData" @onSuccess="queryMainData"></recall> -->
       </div>
-      <div slot="slot1" class="container normal-panel">
-        <BaseInfo :detailInfo="detailInfo"/>
-      </div>
       <div slot="slot0" class="container normal-panel" style="padding: 10px">
         <followDetail ref="followDetail" :disabled="!isHandle || mainData.status === '已无效' || mainData.status === '已过期'"/>
-<!--        <el-descriptions>
-          <div slot="title">跟进记录 &nbsp;<i @click="followRecord(param.content.sort[0].reversed = param.content.sort[0].reversed == 1 ? 0 : 1)" :class="param.content.sort[0].reversed == 1?'fa fa-sort-amount-asc':'fa fa-sort-amount-desc'"></i></div>
-        </el-descriptions>
-        <div class="flex-align-center normal-margin">
-          <p>日期:&nbsp;</p>
-          <el-date-picker
-            v-model="value2"
-            type="daterange"
-            align="right"
-            unlink-panels
-            :range-separator="$t(`至`)"
-            :start-placeholder="$t(`开始日期`)"
-            :end-placeholder="$t(`结束日期`)"
-            value-format="yyyy-MM-dd"
-            size="small"
-            @change="dateChange"
-            clearable>
-          </el-date-picker>-->
-<!--        </div>
-        <div class="detail" v-if="recordlist.length > 0">
-          <div class="item" v-for="(item,index) in recordlist" :key="index">
-            <p>{{index + 1}}.{{item.createdate}},&nbsp;由<span style="font-weight:bold;margin:0 6px;font-size:13px">{{item.createby}}</span>开始跟进,跟进方式:<span style="font-weight:bold;margin:0 5px">{{item.followupmode}}</span>,{{handleTxt[item.logtype]}}</p>
-            <div class="content">
-              <div style="margin-bottom:10px">
-                <p v-if="item.competitor">已购买品牌:{{item.competitor}}</p>
-                {{item.content}}
-              </div>
-              <file-item
-                :marginRight="10"
-                :rowCount="5"
-                :isDownLoad="true"
-                :fileData="item.attinfo">
-              </file-item>
-            </div>
-          </div>
-        </div>
-        <el-empty :title="$t('暂无数据')" v-else></el-empty>
-        <div style="margin-top:16px;text-align:right">
-          <el-pagination
-          background
-          small
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="param.content.pageNumber"
-          :page-size="param.content.pageSize"
-          layout="total, prev, pager, next"
-          :total="total">
-          </el-pagination>
-        </div>-->
+      </div>
+      <div slot="slot1" class="container normal-panel">
+        <contactPerson v-if="tool.checkAuth($route.name,'contactPerson')" :data="mainData"></contactPerson>
+        <BaseInfo v-else :detailInfo="detailInfo"/>
       </div>
       <div slot="slot2" class="container normal-panel">
-        <sourceClues></sourceClues>
+        <BaseInfo v-if="tool.checkAuth($route.name,'contactPerson')" :detailInfo="detailInfo"/>
+        <sourceClues v-else></sourceClues>
       </div>
     </basicDetails>
   </div>
@@ -94,6 +47,7 @@ import distobutionOne from './distobutionOne'
 import sourceClues from '@/HManagement/clueManage/clue_public/modules/sourceClues'
 import changeSite from '@/HManagement/clueManage/clue_private/modules/changeToSite.vue'
 import restore from "@/HManagement/clueManage/clue_private/modules/restore";
+import contactPerson from './contactPerson'
 export default {
   name: "detail",
   data() {
@@ -142,7 +96,8 @@ export default {
     sourceClues,
     changeSite,
     restore,
-    followDetail
+    followDetail,
+    contactPerson
   },
   methods:{
     handleSizeChange(val) {

+ 640 - 0
src/HManagement/clueManage/clue_public/modules/editContact.vue

@@ -0,0 +1,640 @@
+<template>
+  <div>
+    <el-button size="small" type="text" @click="onshow" >{{
+        $t("编辑")
+      }}</el-button>
+    <el-drawer
+        :title="$t(`编辑联系人`)"
+        :visible.sync="dialogFormVisible"
+        size="600px"
+        direction="rtl"
+        :show-close="false"
+        append-to-body
+        @close="onClose"
+    >
+      <div class="drawer__panel">
+        <el-row :gutter="20">
+          <el-form
+              :model="form"
+              :rules="rules"
+              ref="form"
+              size="mini"
+              label-position="right"
+              :label-width="tool.onlyZh('90px')"
+          >
+            <el-col :span="24">
+              <el-form-item :label="$t(`姓名`) + ':'" prop="name">
+                <contactsNewTemplate
+                   :is-param="true"
+                   :new-param="contactParam"
+                   :name="form.name"
+                   @contactData="contactData"
+                   @inputChange="inputChange"
+                ></contactsNewTemplate>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item>
+                <el-radio v-model="form.isTelephone" label="0">{{
+                    $t("手机号")
+                  }}</el-radio>
+                <el-radio v-model="form.isTelephone" label="1">{{
+                    $t("座机电话")
+                  }}</el-radio>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24" v-if="form.isTelephone == '1'">
+              <el-form-item :label="$t('联系方式') + ':'" prop="telephone">
+                <el-input
+                    v-model="form.areaCode"
+                    style="width: 25%"
+                    autocomplete="on"
+                    :placeholder="$t('请填写区号')"
+                ></el-input>
+                <span style="color: #999999">——</span>
+                <el-input
+                    v-model="form.telephone"
+                    style="width: 68%"
+                    autocomplete="on"
+                    :placeholder="$t('请填写座机电话')"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item
+                  v-if="form.isTelephone == '0'"
+                  :label="$t('联系方式') + ':'"
+                  prop="phonenumber"
+                  :rules="[
+                  { required: true, message: this.$t('手机号码不能为空') },
+                  {
+                    pattern: /^1[3-9][0-9]\d{8}$/,
+                    message: this.$t('请输入正确手机号码'),
+                    trigger: 'change',
+                  },
+                ]"
+              >
+                <el-input
+                    v-model="form.phonenumber"
+                    autocomplete="on"
+                    :placeholder="$t('请填写手机号码')"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t('微信') + ':'" prop="wechatnum">
+                <el-input
+                    autosize
+                    v-model="form.wechatnum"
+                    :placeholder="$t(`请输入微信`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item
+                  :label="$t(`邮箱`) + ':'"
+                  :rules="[
+                  {
+                    pattern:
+                      /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
+                    message: $t('请输入有效的邮箱'),
+                    trigger: 'change',
+                  },
+                ]"
+              >
+                <el-input
+                    autosize
+                    v-model="form.email"
+                    :placeholder="$t(`请输入邮箱`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`传真`) + ':'">
+                <el-input
+                    autosize
+                    v-model="form.fax"
+                    :placeholder="$t(`请输入传真`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`关联企业`) + ':'">
+                <el-input
+                    autosize
+                    v-model="form.enterprisename"
+                    :placeholder="$t(`请输入关联企业`)"
+                    disabled
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`部门`) + ':'" prop="depname">
+                <el-input
+                    autosize
+                    v-model="form.depname"
+                    :placeholder="$t(`请输入部门`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`职位`) + ':'" prop="position">
+                <el-input
+                    autosize
+                    v-model="form.position"
+                    :placeholder="$t(`请输入职位`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`性别`) + ':'">
+                <el-radio v-model="form.sex" label="男">{{
+                    $t("男")
+                  }}</el-radio>
+                <el-radio v-model="form.sex" label="女">{{
+                    $t("女")
+                  }}</el-radio>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`生日`) + ':'">
+                <el-date-picker
+                    v-model="form.birthday"
+                    value-format="yyyy-MM-dd"
+                    type="date"
+                    :placeholder="$t('选择日期')"
+                    style="width: 100%"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`家庭住址`) + ':'">
+                <el-input
+                    type="textarea"
+                    rows="5"
+                    v-model="form.address"
+                    :placeholder="$t(`请输入家庭住址`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`偏好`)" prop="preference">
+                <el-input
+                    v-model="form.preference"
+                    autocomplete="on"
+                    :placeholder="$t(`请填写偏好`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`爱好`)" prop="hobby">
+                <el-input
+                    v-model="form.hobby"
+                    autocomplete="on"
+                    :placeholder="$t(`请填写爱好`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item :label="$t(`备注`) + ':'">
+                <el-input
+                    type="textarea"
+                    rows="5"
+                    v-model="form.remarks"
+                    :placeholder="$t(`请输入备注`)"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </el-row>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button size="small" @click="onClose" class="normal-btn-width">{{
+            $t("取 消")
+          }}</el-button>
+        <el-button
+            size="small"
+            type="primary"
+            :loading="loading"
+            @click="onSubmit"
+            class="normal-btn-width"
+        >{{ $t("确 定") }}</el-button
+        >
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import { mapGetters } from "vuex";
+import contactsNewTemplate from "@/template/contactsNewTemplate/index";
+export default {
+  name: "editContact",
+  props: ["data"],
+  components: { contactsNewTemplate },
+  data() {
+    var validateMobilePhone = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error(this.$t("手机号不可为空")));
+      } else {
+        if (value !== "") {
+          var reg = /^1[3456789]\d{9}$/;
+          if (!reg.test(value)) {
+            callback(new Error(this.$t("请输入有效的手机号码")));
+          }
+        }
+        callback();
+      }
+    };
+    var telephone = (rule, value, callback) => {
+      if (this.form.areaCode === "" && this.form.telephone === "") {
+        callback(new Error(this.$t("座机电话不能为空")));
+      } else {
+        var reg = /^0\d{2,3}-\d{7,8}$/;
+        let telephone = this.form.areaCode + "-" + this.form.telephone;
+        if (!reg.test(telephone)) {
+          callback(new Error(this.$t("请输入正确座机电话")));
+        } else {
+          callback();
+        }
+      }
+    };
+    return {
+      dialogFormVisible: false,
+      activeName: "first",
+      visible: false,
+      tagList: [],
+      tags: [],
+      groupname: "客户联系人",
+      form: {
+        "sat_orderclue_contactsid": 0,
+        "sys_phonebookid": '',
+        "sat_orderclueid": '',
+        "phonenumber": "",
+        "birthday": "",
+        "name": "",
+        "depname": "",
+        "wechatnum": "",
+        "position": "",
+        "email": "",
+        "sex": "",
+        "homeaddress": "",
+        "remarks": "",
+        "fax": "",
+        "isleader": "",
+        "grade": "",
+        "hobby": "",
+        "preference": "",
+        "sys_phonebookgroupid": 0,
+        "telephone": "",
+        "isTelephone": "0",
+        "areaCode": "",
+      },
+      rules: {
+        name: [
+          { required: true, message: this.$t("姓名不能为空"), trigger: "blur,change" },
+        ],
+        // phonenumber: [
+        //   { required: true, validator: validateMobilePhone, trigger: 'blur' },
+        // ]
+        telephone: [
+          { required: true, validator: telephone, trigger: "change" },
+        ],
+        depname: [
+          { required: true, message: this.$t('部门不能为空'), trigger: 'blur' },
+        ],
+        position: [
+          { required: true, message: this.$t('职位不能为空'), trigger: 'blur' },
+        ],
+      },
+      enterpriseContact: {
+        param: {
+          content: {
+            sys_enterpriseid: "",
+            pageNumber: 1,
+            pageSize: 9999,
+            where: {
+              condition: "",
+            },
+          },
+          id: 20221219193002,
+        },
+        listData: [],
+        total: 0,
+        currentPage: 0,
+        show: false,
+      },
+      myContacts: {
+        param: {
+          id: 20221219161202,
+          content: {
+            pageNumber: 1,
+            pageSize: 9999,
+            ownertable: "sa_customers",
+            ownerid: "",
+            where: {
+              condition: "",
+            },
+          },
+        },
+        listData: [],
+        total: 0,
+        currentPage: 0,
+        show: false,
+      },
+      paramTag: {
+        id: "20220929085401",
+        content: {
+          nocache: true,
+          ownertable: "",
+          ownerid: 0,
+        },
+      },
+      contactParam:{
+        "id": 2025042110061502,
+        "content": {
+          "sat_orderclueid": this.$route.query.id,
+          "pageSize": 20,
+          "pageNumber": 1,
+          "where":{
+            "condition":""
+          }
+        },
+      }
+    };
+  },
+  computed: {
+    ...mapGetters({
+      loading: "loading",
+    }),
+  },
+  methods: {
+    onshow() {
+      this.dialogFormVisible = true;
+      this.activeName = "first";
+      this.enterpriseContact.param.content.pageNumber = 1;
+      this.myContacts.param.content.pageNumber = 1;
+      this.enterpriseContactList();
+      this.myContactList();
+      this.getTag();
+      // this.form.sys_enterpriseid = this.data.sys_enterpriseid;
+      this.form = Object.assign({}, this.form, this.data);
+      // this.tags = this.form.tag;
+      if (this.form.phonenumber.indexOf("-") != "-1") {
+        this.form.isTelephone = "1";
+        this.form.areaCode = this.data.phonenumber.substring(
+            0,
+            this.form.phonenumber.indexOf("-")
+        );
+        this.form.telephone = this.data.phonenumber.substring(
+            this.form.areaCode.length + 1
+        );
+        this.form.phonenumber = "";
+      }
+      // this.form.enterprisename = this.data.enterprisename_customer;
+    },
+    onSubmit() {
+      this.$refs["form"].validate(async (valid) => {
+        if (!valid) return false;
+        this.$store.commit("setLoading", true);
+        if (this.form.isTelephone == "1") {
+          this.form.phonenumber =
+              this.form.areaCode + "-" + this.form.telephone;
+        }
+        this.form.sat_orderclueid = this.$route.query.id
+        const res = await this.$api.requested({
+          id: "2025042110003902",
+          content: this.form,
+        });
+        this.tool.showMessage(res, async () => {
+          /*let res2 = await this.$api.requested({
+            "id": 20220929090901,
+            "content": {
+              "ownertable":"sys_phonebook",
+              "ownerid":res.data.sys_phonebookid,
+              "datatag": this.tags
+            }
+          })*/
+          this.$emit("updateSuccess");
+          this.$refs["form"].resetFields();
+          this.tags = [];
+          this.form = {
+            "sat_orderclue_contactsid": 0,
+            "sys_phonebookid": '',
+            "sat_orderclueid": '',
+            "phonenumber": "",
+            "birthday": "",
+            "name": "",
+            "depname": "",
+            "wechatnum": "",
+            "position": "",
+            "email": "",
+            "sex": "",
+            "homeaddress": "",
+            "remarks": "",
+            "fax": "",
+            "isleader": "",
+            "grade": "",
+            "hobby": "",
+            "preference": "",
+            "sys_phonebookgroupid": 0,
+            "telephone": "",
+            "isTelephone": "0",
+            "areaCode": "",
+          };
+          this.$store.commit("setLoading", false);
+          this.dialogFormVisible = false;
+        });
+      });
+    },
+    searchData() {
+      this.changeTab();
+    },
+    changeTab() {
+      this.enterpriseContactList();
+      this.myContactList();
+    },
+    /*企业联系人*/
+    async enterpriseContactList() {
+      this.enterpriseContact.param.content.where.condition = this.form.name;
+      this.enterpriseContact.param.content.sys_enterpriseid =
+          this.data.sys_enterpriseid;
+      const res = await this.$api.requested(this.enterpriseContact.param);
+      this.enterpriseContact.listData = res.data;
+      this.enterpriseContact.total = res.total;
+      this.enterpriseContact.currentPage = res.pageNumber;
+    },
+    /*选择企业联系人*/
+    enterpriseContactSelect(val) {
+      this.form.name = val.name;
+      if (val.phonenumber.indexOf("-") != "-1") {
+        this.form.isTelephone = "1";
+        this.form.areaCode = val.phonenumber.substring(
+            0,
+            val.phonenumber.indexOf("-")
+        );
+        this.form.telephone = val.phonenumber.substring(
+            this.form.areaCode.length + 1
+        );
+        this.form.phonenumber = "";
+      } else {
+        this.form.isTelephone = "0";
+        this.form.phonenumber = val.phonenumber;
+        this.form.areaCode = "";
+        this.form.telephone = "";
+      }
+      this.form.email = val.email;
+      this.form.position = val.position;
+      this.form.depname = val.depname;
+      this.form.sex = val.sex;
+      this.form.birthday = val.birthday;
+      this.form.address = val.address;
+      this.form.remarks = val.remarks;
+      this.enterpriseContact.show = false;
+    },
+    handleSizeChangeEnterprise(val) {
+      // console.log(`每页 ${val} 条`);
+      this.enterpriseContact.param.content.pageSize = val;
+      this.enterpriseContactList();
+    },
+    handleCurrentChangeEnterprise(val) {
+      // console.log(`当前页: ${val}`);
+      this.enterpriseContact.param.content.pageNumber = val;
+      this.enterpriseContactList();
+    },
+    /*我的联系人*/
+    async myContactList() {
+      this.myContacts.param.content.where.condition = this.form.name;
+      this.myContacts.param.content.sys_enterpriseid =
+          this.data.sys_enterpriseid;
+      this.myContacts.param.content.ownerid = this.data.sys_enterpriseid;
+      const res = await this.$api.requested(this.myContacts.param);
+
+      this.myContacts.listData = res.data;
+      this.myContacts.total = res.total;
+      this.myContacts.currentPage = res.pageNumber;
+    },
+    /*选择我的联系人*/
+    myContactSelect(val) {
+      this.form.name = val.name;
+      if (val.phonenumber.indexOf("-") != "-1") {
+        this.form.isTelephone = "1";
+        this.form.areaCode = val.phonenumber.substring(
+            0,
+            val.phonenumber.indexOf("-")
+        );
+        this.form.telephone = val.phonenumber.substring(
+            this.form.areaCode.length + 1
+        );
+        this.form.phonenumber = "";
+      } else {
+        this.form.isTelephone = "0";
+        this.form.phonenumber = val.phonenumber;
+        this.form.areaCode = "";
+        this.form.telephone = "";
+      }
+      this.form.email = val.email;
+      this.form.position = val.position;
+      this.form.depname = val.depname;
+      this.form.sex = val.sex;
+      this.form.birthday = val.birthday;
+      this.form.address = val.address;
+      this.form.remarks = val.remarks;
+      this.form.sys_phonebookid = val.sys_phonebookid;
+      this.enterpriseContact.show = false;
+    },
+    inputChange(val) {
+      this.form.name = val;
+    },
+    contactData(val) {
+      this.form.name = val.name;
+      if (val.phonenumber.indexOf("-") != "-1") {
+        this.form.isTelephone = "1";
+        this.form.areaCode = val.phonenumber.substring(
+            0,
+            val.phonenumber.indexOf("-")
+        );
+        this.form.telephone = val.phonenumber.substring(
+            this.form.areaCode.length + 1
+        );
+        this.form.phonenumber = "";
+      } else {
+        this.form.isTelephone = "0";
+        this.form.phonenumber = val.phonenumber;
+        this.form.areaCode = "";
+        this.form.telephone = "";
+      }
+      this.form.email = val.email;
+      this.form.position = val.position;
+      this.form.depname = val.depname;
+      this.form.sex = val.sex;
+      this.form.birthday = val.birthday;
+      this.form.address = val.address;
+      this.form.remarks = val.remarks;
+      this.form.sys_phonebookid = val.sys_phonebookid;
+    },
+    handleSizeChangeMy(val) {
+      // console.log(`每页 ${val} 条`);
+      this.myContacts.param.content.pageSize = val;
+      this.myContactList();
+    },
+    handleCurrentChangeMy(val) {
+      // console.log(`当前页: ${val}`);
+      this.myContacts.param.content.pageNumber = val;
+      this.myContactList();
+    },
+    onClose() {
+      this.$refs["form"].resetFields();
+      this.tags = [];
+      this.form = {
+        "sat_orderclue_contactsid": 0,
+        "sys_phonebookid": '',
+        "sat_orderclueid": '',
+        "phonenumber": "",
+        "birthday": "",
+        "name": "",
+        "depname": "",
+        "wechatnum": "",
+        "position": "",
+        "email": "",
+        "sex": "",
+        "homeaddress": "",
+        "remarks": "",
+        "fax": "",
+        "isleader": "",
+        "grade": "",
+        "hobby": "",
+        "preference": "",
+        "sys_phonebookgroupid": 0,
+        "telephone": "",
+        "isTelephone": "0",
+        "areaCode": "",
+      };
+      this.dialogFormVisible = false;
+    },
+    async getTag() {
+      this.paramTag.content.ownertable = "plm_unit";
+      const res = await this.$api.requested(this.paramTag);
+      this.tagList = res.data.option;
+    },
+    hasDisabledTag(item) {
+      let arr = [];
+      let arr2 = [];
+      arr = this.tagList.filter((item) => {
+        return this.tags.includes(item.tag);
+      });
+      arr.forEach((e) => {
+        arr2 = arr2.concat(e.mutextag);
+      });
+      arr2 = this.tags.length === 0 ? [] : arr2;
+      let _isSame = arr2.some((tag) => item.tag === tag);
+      return _isSame;
+    },
+  },
+}
+</script>
+
+<style scoped>
+
+</style>

+ 6 - 6
src/SManagement/orderclue/components/edit.vue

@@ -17,20 +17,20 @@
             </el-col>
             <el-col :span="24">
               <el-form-item :label="$t('联系人')+':'" prop="name">
-                <contactsNewTemplate ownertable="" ownerid="" @contactData="contactData" :name="param.name" :disabled="data.status != '待跟进' && data.status != '跟进中'" @inputChange="inputChange"></contactsNewTemplate>
+                <contactsNewTemplate ownertable="" ownerid="" @contactData="contactData" :name="param.name" :disabled="true" @inputChange="inputChange"></contactsNewTemplate>
               </el-form-item>
             </el-col>
             <el-col :span="24">
               <el-form-item>
-                <el-radio v-model="param.isTelephone" label="0" :disabled="data.status != '待跟进' && data.status != '跟进中'">{{$t('手机号')}}</el-radio>
-                <el-radio v-model="param.isTelephone" label="1" :disabled="data.status != '待跟进' && data.status != '跟进中'">{{$t('座机电话')}}</el-radio>
+                <el-radio v-model="param.isTelephone" label="0" :disabled="true">{{$t('手机号')}}</el-radio>
+                <el-radio v-model="param.isTelephone" label="1" :disabled="true">{{$t('座机电话')}}</el-radio>
               </el-form-item>
             </el-col>
             <el-col :span="24" v-if="param.isTelephone == '1'">
               <el-form-item :label="$t('联系方式')+':'" prop="telephone" >
-                <el-input v-model="param.areaCode" style="width: 25%" autocomplete="on" :placeholder="$t('请填写区号')" :disabled="data.status != '待跟进' && data.status != '跟进中'"></el-input>
+                <el-input v-model="param.areaCode" style="width: 25%" autocomplete="on" :placeholder="$t('请填写区号')" :disabled="true"></el-input>
                 <span style="color: #999999">——</span>
-                <el-input v-model="param.telephone" style="width: 68%" autocomplete="on" :placeholder="$t('请填写座机电话')" :disabled="data.status != '待跟进' && data.status != '跟进中'"></el-input>
+                <el-input v-model="param.telephone" style="width: 68%" autocomplete="on" :placeholder="$t('请填写座机电话')" :disabled="true"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="24"  >
@@ -38,7 +38,7 @@
               { required: true, message: $t('手机号码不能为空')},
               { pattern:/^1[3-9][0-9]\d{8}$/, message: $t('请输入正确手机号码'),trigger: 'change' }
             ]">
-                <el-input v-model="param.phonenumber" autocomplete="on" :placeholder="$t('请填写手机号码')" :disabled="data.status != '待跟进' && data.status != '跟进中'"></el-input>
+                <el-input v-model="param.phonenumber" autocomplete="on" :placeholder="$t('请填写手机号码')" :disabled="true"></el-input>
               </el-form-item>
             </el-col>