|
|
@@ -526,7 +526,7 @@
|
|
|
>修改客户称呼</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180px" fixed="right">
|
|
|
<template slot-scope="scope">
|
|
|
<!-- <el-button-->
|
|
|
<!-- size="mini"-->
|
|
|
@@ -538,6 +538,14 @@
|
|
|
<!-- <span v-else>绑定CRM</span>-->
|
|
|
<!-- </el-button>-->
|
|
|
|
|
|
+ <el-button
|
|
|
+ v-if="showEditRemarkMobileBtn"
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-phone-outline"
|
|
|
+ @click="handleEditRemarkMobile(scope.row)"
|
|
|
+ >修改手机号码</el-button>
|
|
|
+
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
@@ -833,6 +841,23 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <el-dialog title="修改手机号码" :visible.sync="mobileEditOpen" width="500px" append-to-body>
|
|
|
+ <el-form label-width="110px">
|
|
|
+ <el-form-item label="联系手机号码">
|
|
|
+ <el-input
|
|
|
+ v-model="mobileEditInput"
|
|
|
+ type="textarea"
|
|
|
+ :rows="4"
|
|
|
+ placeholder="多个手机号请用英文逗号分隔,例如:177****8524,177****1352"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitRemarkMobileForm">确 定</el-button>
|
|
|
+ <el-button @click="mobileEditOpen = false">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<!-- 绑定客户 -->
|
|
|
<el-dialog :title="bindCustomer.title" :visible.sync="bindCustomer.open" width="1200px" append-to-body>
|
|
|
<mycustomer ref="mycustomer" @bindCustomerId="bindCustomerId"></mycustomer>
|
|
|
@@ -970,6 +995,7 @@ import {
|
|
|
setCustomerCourseSopList,
|
|
|
unBindUserId,
|
|
|
updateExternalContact,
|
|
|
+ updateRemarkMobiles,
|
|
|
getRepeat,
|
|
|
updateExternalContactCall, myDeptExtList, getRepeatRecordList
|
|
|
} from '../../../api/qw/externalContact'
|
|
|
@@ -1073,6 +1099,10 @@ export default {
|
|
|
remarkMobiles: [],
|
|
|
inputVisible: false,
|
|
|
inputValue: '',
|
|
|
+ showEditRemarkMobileBtn: false,
|
|
|
+ mobileEditOpen: false,
|
|
|
+ mobileEditForm: {},
|
|
|
+ mobileEditInput: '',
|
|
|
// 非单个禁用
|
|
|
single: true,
|
|
|
tagGroupList: [],
|
|
|
@@ -1274,9 +1304,66 @@ export default {
|
|
|
this.getDicts("sys_qw_transfer_status").then(response => {
|
|
|
this.transferStatusOptions = response.data;
|
|
|
});
|
|
|
+ this.loadExternalContactFuncDict();
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ loadExternalContactFuncDict() {
|
|
|
+ this.getDicts("sys_qw_external_contact_func").then(response => {
|
|
|
+ const list = response.data || [];
|
|
|
+ const btnDict = list.find(item => String(item.dictSort) === "1");
|
|
|
+ this.showEditRemarkMobileBtn = !!(btnDict && btnDict.dictValue === "1");
|
|
|
+ });
|
|
|
+ },
|
|
|
+ parseContactMobilesText(contactMobiles) {
|
|
|
+ return contactMobiles ? String(contactMobiles).trim() : "";
|
|
|
+ },
|
|
|
+ validateContactMobileInput(input) {
|
|
|
+ const raw = (input || "").trim();
|
|
|
+ if (!raw) {
|
|
|
+ return { valid: true, value: "" };
|
|
|
+ }
|
|
|
+ if (raw.includes(",")) {
|
|
|
+ return { valid: false, msg: "请使用英文逗号分隔手机号码" };
|
|
|
+ }
|
|
|
+ if (raw.includes(",,") || raw.startsWith(",") || raw.endsWith(",")) {
|
|
|
+ return { valid: false, msg: "手机号码格式不正确,请使用英文逗号分隔" };
|
|
|
+ }
|
|
|
+ const mobiles = raw.split(",").map(item => item.trim());
|
|
|
+ if (mobiles.some(item => !item)) {
|
|
|
+ return { valid: false, msg: "手机号码格式不正确,请使用英文逗号分隔" };
|
|
|
+ }
|
|
|
+ const set = new Set();
|
|
|
+ for (const mobile of mobiles) {
|
|
|
+ if (set.has(mobile)) {
|
|
|
+ return { valid: false, msg: "手机号码重复:" + mobile };
|
|
|
+ }
|
|
|
+ set.add(mobile);
|
|
|
+ }
|
|
|
+ return { valid: true, value: mobiles.join(",") };
|
|
|
+ },
|
|
|
+ handleEditRemarkMobile(row) {
|
|
|
+ getExternalContact(row.id).then(response => {
|
|
|
+ this.mobileEditForm = response.data;
|
|
|
+ this.mobileEditInput = this.parseContactMobilesText(response.data.contactMobiles);
|
|
|
+ this.mobileEditOpen = true;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ submitRemarkMobileForm() {
|
|
|
+ const result = this.validateContactMobileInput(this.mobileEditInput);
|
|
|
+ if (!result.valid) {
|
|
|
+ this.msgError(result.msg);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ updateRemarkMobiles({
|
|
|
+ id: this.mobileEditForm.id,
|
|
|
+ contactMobiles: result.value
|
|
|
+ }).then(() => {
|
|
|
+ this.msgSuccess("修改成功");
|
|
|
+ this.mobileEditOpen = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ },
|
|
|
shortenText(text, maxLen = 16) {
|
|
|
const str = text == null ? '' : String(text);
|
|
|
if (str.length <= maxLen) return str;
|