| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410 | <template>  <div class="app-container">    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">      <el-form-item label="企微账号" prop="qwUserId">              <el-select v-model="queryParams.qwUserId" placeholder="企微账号"  size="small" @change="updateQwuser()">                <el-option                  v-for="dict in myQwUserList"                  :key="dict.dictValue"                  :label="dict.dictLabel+'('+dict.corpName+')'"                  :value="dict.dictValue"                />              </el-select>      </el-form-item>      <el-form-item label="客户名称" prop="name">        <el-input          v-model="queryParams.name"          placeholder="请输入客户名称"          clearable          size="small"          @keyup.enter.native="handleQuery"        />      </el-form-item>      <el-form-item label="用户类别" prop="type">        <el-select v-model="queryParams.type" placeholder="请选择用户类别" clearable size="small">          <el-option            v-for="dict in typeOptions"            :key="dict.dictValue"            :label="dict.dictLabel"            :value="dict.dictValue"          />        </el-select>      </el-form-item>      <el-form-item label="性别" prop="gender">        <el-select v-model="queryParams.gender" placeholder="性别" clearable size="small">          <el-option            v-for="dict in genderOptions"            :key="dict.dictValue"            :label="dict.dictLabel"            :value="dict.dictValue"          />        </el-select>      </el-form-item>      <el-form-item label="电话号码" prop="remarkMobiles">        <el-input          v-model="queryParams.remarkMobiles"          placeholder="请输入备注电话号码"          clearable          size="small"          @keyup.enter.native="handleQuery"        />      </el-form-item>      <el-form-item label="来源" prop="addWay">        <el-select v-model="queryParams.addWay" placeholder="来源" clearable size="small">          <el-option            v-for="dict in addWayOptions"            :key="dict.dictValue"            :label="dict.dictLabel"            :value="dict.dictValue"          />        </el-select>      </el-form-item>      <el-form-item label="状态" prop="status">        <el-select v-model="queryParams.status" placeholder="状态" clearable size="small">          <el-option            v-for="dict in statusOptions"            :key="dict.dictValue"            :label="dict.dictLabel"            :value="dict.dictValue"          />        </el-select>      </el-form-item>      <el-form-item label="是否重粉" prop="userRepeat">        <el-select v-model="queryParams.userRepeat" placeholder="重粉" clearable size="small">          <el-option label="否" :value="0"/>          <el-option label="是" :value="1"/>        </el-select>      </el-form-item>      <el-form-item label="客户等级" prop="level">        <el-select v-model="queryParams.level" placeholder="客户等级" clearable size="small">          <el-option            v-for="dict in ratingType"            :key="dict.dictValue"            :label="dict.dictLabel"            :value="dict.dictValue"          />        </el-select>      </el-form-item>      <el-form-item label="等级升降" prop="levelType">        <el-select v-model="queryParams.levelType" placeholder="等级升降" clearable size="small">          <el-option            v-for="dict in ratingUpFall"            :key="dict.dictValue"            :label="dict.dictLabel"            :value="dict.dictValue"          />        </el-select>      </el-form-item>      <el-form-item label="转接状态" prop="addWay">        <el-select v-model="queryParams.transferStatus" placeholder="转接状态" clearable size="small">          <el-option            v-for="dict in transferStatusOptions"            :key="dict.dictValue"            :label="dict.dictLabel"            :value="dict.dictValue"          />        </el-select>      </el-form-item>      <el-form-item label="是否绑定会员" prop="isBindMini">        <el-select v-model="queryParams.isBindMini" placeholder="是否绑定会员" clearable size="small" @change="handleQuery" >          <el-option            v-for="dict in isBindMiniOptions"            :key="dict.dictValue"            :label="dict.dictLabel"            :value="dict.dictValue"          />        </el-select>      </el-form-item>      <el-form-item label="标签" prop="tagIds"><!--        <el-select v-model="selectTags" remote multiple placeholder="请选择" filterable  style="width: 100%;">--><!--          <el-option--><!--            v-for="dict in tagList"--><!--            :label="dict.name"--><!--            :value="dict.tagId">--><!--          </el-option>--><!--          </el-select>-->        <div @click="hangleChangeTags()" style="cursor: pointer; border: 1px solid #e6e6e6; background-color: white; overflow: hidden; flex-grow: 1;width: 250px">          <div style="min-height: 35px; max-height: 200px; overflow-y: auto;">            <el-tag type="success"                    closable                    :disable-transitions="false"                    v-for="list in this.selectTags"                    :key="list.tagId"                    @close="handleCloseTags(list)"                    style="margin: 3px;"            >{{list.name}}            </el-tag>          </div>        </div>      </el-form-item>      <el-form-item label="备注" prop="remark">        <el-input          v-model="queryParams.remark"          placeholder="请输入备注"          clearable          size="small"          @keyup.enter.native="handleQuery"        />      </el-form-item>      <el-form-item label="添加时间" prop="createTime">          <el-date-picker v-model="createTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="change"></el-date-picker>      </el-form-item>      <el-form-item label="流失时间" prop="lossTime">        <el-date-picker clearable size="small"                        v-model="queryParams.lossTime"                        type="date"                        value-format="yyyy-MM-dd"                        placeholder="选择流失时间">        </el-date-picker>      </el-form-item>      <el-form-item label="删除时间" prop="delTime">        <el-date-picker clearable size="small"                        v-model="queryParams.delTime"                        type="date"                        value-format="yyyy-MM-dd"                        placeholder="选择删除时间">        </el-date-picker>      </el-form-item>      <el-form-item>        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>      </el-form-item>    </el-form>    <el-row :gutter="10" class="mb8">      <el-col :span="1.5">        <el-button          type="success"          plain          icon="el-icon-edit"          size="mini"          @click="handleBatchUpdateNotes"          v-hasPermi="['qw:externalContact:edit']"        >批量修改备注        </el-button>      </el-col>      <el-col :span="1.5">        <el-button          type="success"          plain          icon="el-icon-edit"          size="mini"          @click="handleBatchUpdateNotesFilter"          v-hasPermi="['qw:externalContact:edit']"        >批量修改备注(筛选条件)        </el-button>      </el-col>      <!-- <el-col :span="1.5">        <el-button          type="primary"          plain          icon="el-icon-plus"          size="mini"          @click="handleAdd"          v-hasPermi="['qw:externalContact:add']"        >同步</el-button>      </el-col> -->      <el-col :span="1.5">        <el-button          type="success"          plain          icon="el-icon-edit"          size="mini"          :disabled="single"          @click="handleUpdate"        >修改备注</el-button>      </el-col>      <el-col :span="1.5">        <el-button          type="warning"          plain          icon="el-icon-download"          size="mini"          :loading="exportLoading"          @click="handleSyncMyExternalContact"        >同步我的客户</el-button>		<el-button		  type="warning"		  plain		  icon="el-icon-download"		  size="mini"		  :loading="exportLoading"		  @click="handleSyncAddMyExternalContact"		>新客同步</el-button>      </el-col>      <el-col :span="1.5">        <el-button          type="warning"          plain          icon="el-icon-download"          size="mini"          :loading="exportLoading"          @click="handleExport"          v-hasPermi="['qw:externalContact:myExport']"        >导出</el-button>      </el-col>      <el-col :span="1.5">        <el-button          type="primary"          plain          size="mini"          @click="addUserTag"          v-hasPermi="['qw:externalContact:myAddTag']"        >批量添加标签</el-button>      </el-col>      <el-col :span="1.5">        <el-button          type="primary"          plain          size="mini"          @click="delUserTag"          v-hasPermi="['qw:externalContact:myDelTag']"        >批量移除标签</el-button>      </el-col>	  <el-col :span="1.5">	    <el-button	      type="primary"	      plain	      size="mini"	      @click="updateTalk"        v-hasPermi="['qw:externalContactInfo:myUpdateTalk']"	    >批量更改交流状态</el-button>	  </el-col>	  <el-col :span="1.5">	    <el-button	      type="primary"	      plain	      size="mini"	      @click="updateAllTalk"        v-hasPermi="['qw:externalContactInfo:myUpdateAllTalk']"	    >更改全部交流状态</el-button>	  </el-col><!--     <el-col :span="1.5">--><!--        <el-button--><!--          type="primary"--><!--          plain--><!--          size="mini"--><!--          @click="setUserCourseSop"--><!--          v-hasPermi="['qw:externalContact:setCourseSop']"--><!--        >批量设置SOP</el-button>--><!--      </el-col>-->      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>    </el-row><!--    <el-tabs type="card" v-model="isBindActiveName" @tab-click="handleClickX">--><!--      <el-tab-pane label="全部" name="all"></el-tab-pane>--><!--      <el-tab-pane label="已绑定CRM" name="isBind"></el-tab-pane>--><!--      <el-tab-pane label="未绑定CRM" name="noBind"></el-tab-pane>--><!--    </el-tabs>-->    <el-table v-loading="loading" :data="externalContactList" @selection-change="handleSelectionChange" border>      <el-table-column type="selection" width="55" align="center" />      <el-table-column label="企微客户ID" align="center" prop="id"/>      <el-table-column label="企微客户头像" align="center" prop="avatar" width="100px">        <template slot-scope="scope">          <el-popover            placement="right"            title=""            trigger="hover">            <img slot="reference" :src="scope.row.avatar" width="60px">            <img :src="scope.row.avatar" style="max-width: 200px;">          </el-popover>        </template>      </el-table-column>      <el-table-column label="企微客户名称"  prop="name" width="110px"/>      <el-table-column label="客户称呼"  prop="stageStatus" width="110px"/>      <el-table-column label="销售企微昵称" align="center" prop="qwUserName" width="120px"/>      <el-table-column label="企微部门" align="center" prop="departmentName" width="120px"/>      <el-table-column label="用户类别" align="center" prop="type">        <template slot-scope="scope">          <dict-tag :options="typeOptions" :value="scope.row.type"/>        </template>      </el-table-column>      <el-table-column label="性别" align="center" prop="gender">        <template slot-scope="scope">          <dict-tag :options="genderOptions" :value="scope.row.gender"/>        </template>      </el-table-column>      <el-table-column label="备注" align="center" prop="remark" />      <el-table-column label="描述信息" align="center" prop="description" />      <el-table-column label="标签" align="center" prop="tagIdsName" width="300px">        <template slot-scope="scope">          <div class="tag-container">            <div class="tag-list">              <el-tag                v-for="name in scope.row.tagIdsName"                :key="name"                type="success"                size="small"              >                {{ name }}              </el-tag>            </div>          </div>        </template>      </el-table-column>      <el-table-column label="是否回复" align="center" prop="isReply" width="120px" >        <template slot-scope="scope">          <span v-if="scope.row.isReply === 1"><el-tag type="success">已回复</el-tag></span>          <span v-else-if="scope.row.isReply === 0"><el-tag type="info">未回复</el-tag></span>          <span v-else>{{ scope.row.isReply }}</span>        </template>      </el-table-column>      <el-table-column label="状态" align="center" prop="status" width="120px" >        <template slot-scope="scope">          <dict-tag :options="statusOptions" :value="scope.row.status"/>        </template>      </el-table-column>      <el-table-column label="客户等级" align="center" prop="level" width="120px" >        <template slot-scope="scope">          <dict-tag :options="ratingType" :value="scope.row.level"/>        </template>      </el-table-column>      <el-table-column label="下单次数" align="center" width="100px">        <template #default="scope">          {{ scope.row.orderCount && scope.row.orderCount !== 0 ? scope.row.orderCount : '' }}        </template>      </el-table-column>      <el-table-column label="state参数" align="center" prop="state" width="100px" />      <el-table-column label="等级状态" align="center" prop="levelType" width="120px" >        <template slot-scope="scope">          <dict-tag :options="ratingUpFall" :value="scope.row.levelType"/>        </template>      </el-table-column>      <el-table-column label="添加时间" align="center" prop="createTime" width="100px" />      <el-table-column label="流失时间" align="center" prop="lossTime" width="100px" />      <el-table-column label="删除时间" align="center" prop="delTime" width="100px" />      <el-table-column label="注册时间" align="center" prop="registerTime" width="100px" />      <el-table-column label="备注电话号码" align="center" prop="remarkMobiles" width="150px">        <template slot-scope="scope">          <div v-for="i in JSON.parse(scope.row.remarkMobiles)" :key="i">{{i}}</div>        </template>      </el-table-column>      <el-table-column label="备注企业名称" align="center" prop="remarkCorpName" />      <el-table-column label="来源" align="center" prop="addWay" width="100px">        <template slot-scope="scope">          <dict-tag :options="addWayOptions" :value="scope.row.addWay"/>        </template>      </el-table-column>      <el-table-column label="转接状态" align="center" prop="transferStatus" width="100px" >        <template slot-scope="scope">          <dict-tag :options="transferStatusOptions" :value="scope.row.transferStatus"/>        </template>      </el-table-column>      <el-table-column label="企业id" align="center" prop="corpId" />      <el-table-column label="重粉看课历史" width="100px" align="center" fixed="right">        <template slot-scope="scope">          <div v-if="scope.row.fsUserId">            <el-tag type="success" v-if="scope.row.userRepeat == 0">正常</el-tag>            <el-tag type="danger" v-if="scope.row.userRepeat == 1">重粉</el-tag>            <el-button              size="mini"              type="text"              @click="showLog(scope.row)"            >重粉看课历史            </el-button>          </div>        </template>      </el-table-column>      <el-table-column label="是否绑定会员" width="100px" align="center" fixed="right">        <template slot-scope="scope">          <el-tag v-if="scope.row.fsUserId" >已绑定</el-tag>          <el-tag v-else type="info"> 未绑定</el-tag>        </template>      </el-table-column>      <el-table-column label="修改" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">        <template slot-scope="scope">          <el-button            v-show="scope.row.status==0||scope.row.status==2"            size="mini"            type="text"            icon="el-icon-edit"            @click="handleUpdate(scope.row)"            v-hasPermi="['qw:externalContact:edit']"          >修改备注</el-button>          <el-button            size="mini"            type="text"            icon="el-icon-user-solid"            @click="handleAppellation(scope.row)"          >修改客户称呼</el-button>        </template>      </el-table-column>      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">        <template slot-scope="scope"><!--          <el-button--><!--            size="mini"--><!--            type="text"--><!--            icon="el-icon-edit-outline"--><!--            @click="handleUpdateCustomer(scope.row)"--><!--            >--><!--            <span v-if="scope.row.customerId">换绑CRM</span>--><!--            <span v-else>绑定CRM</span>--><!--          </el-button>-->          <el-button            size="mini"            type="text"            icon="el-icon-edit-outline"            @click="handleUpdateUser(scope.row)"            >            <span v-if="scope.row.fsUserId">换绑会员</span>            <span v-else>绑定会员</span>          </el-button>          <el-button v-show="scope.row.fsUserId"            size="mini"            type="text"            icon="el-icon-thumb"            @click="handleUnBindUserId(scope.row)"            v-hasPermi="['qw:externalContact:unBindUserId']"          >            <span>解除会员绑定</span>          </el-button>          <el-button v-show="scope.row.fsUserId"            size="mini"            type="text"            @click="handleDiagnosis(scope.row)"          >            <span>初诊单</span>          </el-button>          <el-button             size="mini"             type="text"             @click="handleMemberdetails(scope.row)"             v-if="scope.row.fsUserId"             >             <span>会员详情</span>          </el-button>          <el-button             size="mini"             type="text"             @click="handleInfoCollection(scope.row)"          v-if="false"             >             <span>信息采集</span>          </el-button><!--          <el-button v-if="scope.row.customerId"--><!--            size="mini"--><!--            type="text"--><!--            icon="el-icon-paperclip"--><!--            @click="handleShow(scope.row)"--><!--          >CRM客户详情</el-button>-->		  <el-button		     size="mini"		     type="text"		     @click="handledetails(scope.row)"		     >用户信息		  </el-button><!--          <el-button v-if="scope.row.customerId"                     size="mini"                     type="text"                     icon="el-icon-setting"                     @click="setCourseSOP(scope.row)"          >设置课程SOP</el-button> -->        <el-button          size="mini"          type="text"          icon="el-icon-edit"          @click="handleChangeStatus(scope.row)"          v-hasPermi="['qw:externalContact:changeStatus']"        >          修改状态        </el-button>        </template>      </el-table-column>    </el-table>    <pagination      v-show="total>0"      :total="total"      :page.sync="queryParams.pageNum"      :limit.sync="queryParams.pageSize"      @pagination="getList"    />    <!-- 添加或修改初诊单对话框 -->    <el-dialog title="初诊单" :visible.sync="diagnosisOpen" width="1000px" append-to-body>      <el-form ref="diagnosisForm" :model="diagnosisForm" :rules="diagnosisRules" label-width="110px">        <el-row>          <el-col :span="12">            <el-form-item label="患者姓名" prop="patientName">              <el-input v-model="diagnosisForm.patientName" placeholder="请输入患者姓名" />            </el-form-item>          </el-col>          <el-col :span="12">            <el-form-item label="年龄" prop="age">              <el-input-number v-model="diagnosisForm.age"  :min="1" label="年龄"></el-input-number>            </el-form-item>          </el-col>        </el-row>        <el-row>          <el-col :span="12">            <el-form-item label="患者电话" prop="phone">              <el-input v-model="diagnosisForm.phone" placeholder="请输入电话" />            </el-form-item>          </el-col>          <el-col :span="12">            <el-form-item label="性别" prop="gender">              <el-select  v-model="diagnosisForm.gender">                <el-option label="未知" :value = "0"></el-option>                <el-option label="男性" :value = "1"></el-option>                <el-option label="女性" :value = "2"></el-option>              </el-select>            </el-form-item>          </el-col>        </el-row>        <el-row>          <el-col :span="12">            <el-form-item label="日期" prop="dateTime">              <el-date-picker clearable size="small"                v-model="diagnosisForm.dateTime"                type="date"                value-format="yyyy-MM-dd"                placeholder="选择日期">              </el-date-picker>            </el-form-item>          </el-col>          <el-col :span="12">            <el-form-item label="医生" prop="doctorId">              <el-select v-model="diagnosisForm.doctorId" placeholder="选择医生"  size="small" @change="doctorChange">                <el-option                  v-for="dict in doctorList"                  :key="dict.id"                  :label="dict.name"                  :value="dict.id"                />              </el-select>            </el-form-item>          </el-col>        </el-row>        <el-form-item label="身体状况" prop="physicalCondition">          <el-input v-model="diagnosisForm.physicalCondition" type="textarea" placeholder="请输入内容" />        </el-form-item>        <el-form-item label="初步诊断" prop="firstDiagnosis">          <el-input v-model="diagnosisForm.firstDiagnosis" type="textarea" placeholder="请输入内容" />        </el-form-item>        <el-form-item label="医生职称" prop="doctorDep">          <el-input disabled v-model="diagnosisForm.doctorDep" placeholder="医生职称" />        </el-form-item>        <el-form-item label="医生证号" prop="doctorCertificate">          <el-input disabled v-model="diagnosisForm.doctorCertificate" placeholder="医生证号" />        </el-form-item>      </el-form>      <div slot="footer" class="dialog-footer">        <el-button type="primary" @click="diagnosisSubmitForm">确 定</el-button>        <el-button @click="diagnosisCancel">取 消</el-button>      </div>    </el-dialog>    <el-drawer size="75%" :title="show.title" :visible.sync="show.open">      <customer-details  ref="customerDetails" @refreshList="refreshList"/>    </el-drawer>    <!--  搜索标签   -->    <el-dialog :title="changeTagDialog.title" :visible.sync="changeTagDialog.open" style="width:100%;height: 100%" append-to-body>      <div>搜索标签:        <el-input v-model="queryTagParams.name" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(queryTagParams.name)">搜索</el-button>        <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>      </div>      <div v-for="item in tagGroupList" :key="item.id">        <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">          <span class="name-background">{{ item.name }}</span>        </div>        <!-- 添加外层滚动容器 -->        <div class="scroll-wrapper">          <div class="tag-container">            <a              v-for="tagItem in item.tag"              class="tag-box"              @click="tagSelection(tagItem)"              :class="{ 'tag-selected': tagItem.isSelected }"            >              {{ tagItem.name }}            </a>          </div>        </div>      </div><!--      <div v-for="item in tagGroupList" :key="item.id"  >--><!--        <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">--><!--          <span class="name-background">{{ item.name }}</span>--><!--        </div>--><!--        <div class="tag-container">--><!--          <a--><!--            v-for="tagItem in item.tag"--><!--            class="tag-box"--><!--            @click="tagSelection(tagItem)"--><!--            :class="{ 'tag-selected': tagItem.isSelected }"--><!--          >--><!--            {{ tagItem.name }}--><!--          </a>--><!--        </div>--><!--      </div>-->      <pagination        v-show="tagTotal>0"        :total="tagTotal"        :page.sync="queryTagParams.pageNum"        :limit.sync="queryTagParams.pageSize"        @pagination="getPageListTagGroup"      />      <div slot="footer" class="dialog-footer">        <el-button type="primary" @click="tagSubmitForm()">确 定</el-button>        <el-button @click="tagCancel()">取消</el-button>      </div>    </el-dialog>    <el-dialog title="批量添加标签" :visible.sync="tagOpen" width="800px" append-to-body>      <div>搜索标签:        <el-input v-model="tagChange.tagName" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(tagChange.tagName)">搜索</el-button>        <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>      </div>      <el-form ref="form" :model="addTagForm"  label-width="80px">        <div v-for="item in tagGroupList" :key="item.id" >          <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">            <span class="name-background">{{ item.name }}</span>          </div>          <div class="scroll-wrapper">            <div class="tag-container">              <a                v-for="tagItem in item.tag"                class="tag-box"                @click="tagSelection(tagItem)"                :class="{ 'tag-selected': tagItem.isSelected }"              >                {{ tagItem.name }}              </a>            </div>          </div>        </div>      </el-form>      <pagination        v-show="tagTotal>0"        :total="tagTotal"        :page.sync="queryTagParams.pageNum"        :limit.sync="queryTagParams.pageSize"        @pagination="getPageListTagGroup"      />      <div slot="footer" class="dialog-footer">        <el-button type="primary" @click="addTagSubmitForm()">确 定</el-button>        <el-button @click="addTagCancel">取 消</el-button>      </div>    </el-dialog>    <el-dialog title="批量添加客户备注" :visible.sync="notesOpen.open" width="800px" append-to-body>      <el-card>        <el-row>          <el-col>            <el-radio-group v-model="notesOpen.nameType" style="margin-bottom: 2%">              <el-radio :label="1">                客户名称添加在【新备注】【前】              </el-radio>              <el-radio :label="2">                客户名称添加在【新备注】【后】              </el-radio>              <el-radio :label="3">                不添加客户名称              </el-radio>            </el-radio-group>          </el-col>          <el-col>            <el-radio-group v-model="notesOpen.type">              <el-radio                :label="1"              >添加【新备注】在最【前】面              </el-radio>              <el-radio                :label="2"              >添加【新备注】在最【后】面              </el-radio>              <el-radio                :label="3"              >替换所有备注              </el-radio>            </el-radio-group>          </el-col>          <el-col>            <el-input v-model="notesOpen.notes" placeholder="请输入客户备注(最多20个字,含已有的)" clearable size="small"                      maxlength="20" show-word-limit style="width: 500px;margin-top: 3%"/>            <div style="color: #999;font-size: 14px;display: flex;align-items: center;">              <i class="el-icon-info"></i>              由于企业微信官方限制,备注最多20个字,且自动会去除末尾超出的字            </div>          </el-col>        </el-row>      </el-card>      <div slot="footer" class="dialog-footer">        <el-button type="primary" @click="notesSubmitForm()">确 定</el-button>        <el-button @click="notesCancel()">取消</el-button>      </div>    </el-dialog>    <el-dialog title="批量移除标签" :visible.sync="tagDelOpen" width="800px" append-to-body>      <div>搜索标签:        <el-input v-model="tagChange.tagName" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(tagChange.tagName)">搜索</el-button>        <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>      </div>      <el-form ref="form" :model="addTagForm"  label-width="80px">        <div v-for="item in tagGroupList" :key="item.id" >          <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">            <span class="name-background">{{ item.name }}</span>          </div>          <div class="scroll-wrapper">            <div class="tag-container">              <a                v-for="tagItem in item.tag"                class="tag-box"                @click="tagSelection(tagItem)"                :class="{ 'tag-selected': tagItem.isSelected }"              >                {{ tagItem.name }}              </a>            </div>          </div>        </div>      </el-form>      <pagination        v-show="tagTotal>0"        :total="tagTotal"        :page.sync="queryTagParams.pageNum"        :limit.sync="queryTagParams.pageSize"        @pagination="getPageListTagGroup"      />      <div slot="footer" class="dialog-footer">        <el-button type="primary" @click="tagDelSubmitForm()">确 定</el-button>        <el-button @click="DelTagCancel">取 消</el-button>      </div>    </el-dialog>    <!-- 添加或修改企业微信客户对话框 -->    <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>      <el-form ref="form" :model="form" :rules="rules" label-width="100px">        <el-form-item label="备注" prop="remark">          <el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />        </el-form-item>        <el-form-item label="描述信息" prop="description">          <el-input v-model="form.description" type="textarea" :rows="3" placeholder="请输入描述信息" />        </el-form-item>        <el-form-item label="备注电话号码" prop="remarkMobiles">          <el-tag            :key="tag"            v-for="tag in remarkMobiles"            closable            :disable-transitions="false"            @close="handleClose(tag)">            {{tag}}          </el-tag>          <el-input            style="width:110px"            class="input-new-tag"            v-if="inputVisible"            v-model="inputValue"            ref="saveTagInput"            size="small"            @keyup.enter.native="handleInputConfirm"            @blur="handleInputConfirm"          >          </el-input>          <el-button v-else class="button-new-tag" size="small" style="width: 110px" @click="showInput">新增电话</el-button>        </el-form-item>        <el-form-item label="备注企业名称" prop="remarkCorpName">          <el-input v-model="form.remarkCorpName" placeholder="请输入备注企业名称" />        </el-form-item>      </el-form>      <div slot="footer" class="dialog-footer">        <el-button type="primary" @click="submitForm">确 定</el-button>        <el-button @click="cancel">取 消</el-button>      </div>    </el-dialog>    <el-dialog :title="callOpen.title" :visible.sync="callOpen.open" width="500px" append-to-body>      <el-form ref="callOpenFrom" :model="callOpenFrom" :rules="callOpenRule" label-width="110px">        <el-form-item label="客户称呼" prop="stageStatus">          <el-input v-model="callOpenFrom.stageStatus" placeholder="请输入客户称呼" />        </el-form-item>      </el-form>      <div slot="footer" class="dialog-footer" >        <el-button type="primary" @click="submitCallOpenFrom">确 定</el-button>      </div>    </el-dialog>    <!-- 重粉看课记录   -->    <el-drawer title="重粉看课历史" :visible.sync="log.open" size="75%" append-to-body>      <div style="padding: 10px">        <el-form :model="log.queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">          <el-form-item label="所属项目" prop="project">            <el-select v-model="log.queryParams.project" placeholder="请选择项目" filterable clearable size="small">              <el-option                v-for="dict in projectOptions"                :key="dict.dictValue"                :label="dict.dictLabel"                :value="dict.dictValue"              />            </el-select>          </el-form-item>          <el-form-item label="课程" prop="courseId">            <el-select filterable v-model="log.queryParams.courseId" placeholder="请选择课程" clearable size="small"                       @change="courseChange(log.queryParams.courseId)">              <el-option                v-for="dict in courseLists"                :key="dict.dictValue"                :label="dict.dictLabel"                :value="dict.dictValue"              />            </el-select>          </el-form-item>          <el-form-item label="小节" prop="videoId">            <el-select filterable v-model="log.queryParams.videoId" placeholder="请选择小节" clearable size="small">              <el-option                v-for="dict in videoList"                :key="dict.dictValue"                :label="dict.dictLabel"                :value="dict.dictValue"              />            </el-select>          </el-form-item>          <el-form-item>            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQueryWatchLog">搜索</el-button>          </el-form-item>        </el-form>        <el-table v-loading="log.loading" :data="log.list">          <el-table-column label="编号" align="center" prop="id"/>          <el-table-column label="所属企微主体" align="center" prop="corpName"/>          <el-table-column label="所属企微" align="center" prop="qwUserName"/>          <el-table-column label="项目" align="center" prop="projectName"/>          <el-table-column label="课程" align="center" prop="courseName"/>          <el-table-column label="小节" align="aligner" prop="videoName"/>          <el-table-column label="记录时间" align="center" prop="createTime"/>          <el-table-column label="是否完课" align="center" prop="logType">            <template slot-scope="scope">              <el-tag v-if="scope.row.logType == 2" type="success">已完课</el-tag>              <el-tag v-else type="success">未完课</el-tag>            </template>          </el-table-column>          <el-table-column label="完课时间" align="center" prop="finishTime"/>        </el-table>        <pagination          v-show="log.total>0"          :total="log.total"          :page.sync="log.queryParams.pageNum"          :limit.sync="log.queryParams.pageSize"          @pagination="logList"        />      </div>    </el-drawer>    <el-drawer        :with-header="false"        size="75%"          :title="member.title" :visible.sync="member.open">      <userDetails  ref="userDetails" />    </el-drawer>    <!-- 绑定客户   -->    <el-dialog :title="bindCustomer.title" :visible.sync="bindCustomer.open"  width="1200px" append-to-body>      <mycustomer ref="mycustomer"  @bindCustomerId="bindCustomerId"></mycustomer>    </el-dialog><!--    设置一个课程sop-->    <el-dialog :title="setSop.title" :visible.sync="setSop.open"  width="1200px" append-to-body>      <SopDialog ref="SopDialog"  @bindCourseSop="bindCourseSop"></SopDialog>    </el-dialog>	<el-drawer			:with-header="false"	 size="75%"	 :title="show.title" :visible.sync="show.open">	  <info  ref="Details" />	</el-drawer>    <el-dialog :title="user.title" :visible.sync="user.open" width="800px" append-to-body>      <selectUser ref="selectUser" @bindMiniCustomerId="bindMiniCustomerId"></selectUser>    </el-dialog>    <el-dialog :title="collection.title" :visible.sync="collection.open"   width="1100px" append-to-body>	  <collection   ref="collection" />	</el-dialog>  <el-dialog title="修改客户状态" :visible.sync="statusDialog.open" width="500px" append-to-body>    <el-form ref="statusForm" :model="statusForm" :rules="statusRules" label-width="100px">      <el-form-item label="状态" prop="status">        <el-select v-model="statusForm.status" placeholder="请选择状态" size="small">          <el-option            v-for="dict in statusOptions"            :key="dict.dictValue"            :label="dict.dictLabel"            :value="dict.dictValue"          />        </el-select>      </el-form-item>    </el-form>    <div slot="footer" class="dialog-footer">      <el-button @click="statusDialog.open = false">取 消</el-button>      <el-button type="primary" @click="submitStatusForm">提 交</el-button>    </div>  </el-dialog>  </div></template><script>import {  myList,  bindUserId,  addTag,  batchUpdateExternalContactNotes,  delTag,  listExternalContact,  getExternalContact,  delExternalContact,  addExternalContact,  updateExternalContact,  exportExternalContact,  editbindCustomer,  syncMyAddExternalContact,  setCustomerCourseSop,  getCustomerCourseSop,  setCustomerCourseSopList,  syncMyExternalContact, unBindUserId, updateExternalContactCall,exportMyExternalContact,updateExternalContactStatus,getWatchLogList} from '@/api/qw/externalContact'import info from "@/views/qw/externalContact/info.vue";import {getMyQwUserList, getMyQwCompanyList, handleInputAuthAppKey, updateUser} from "@/api/qw/user";import {addFsFirstDiagnosis, updateFsFirstDiagnosis, getFsFirstDiagnosis} from "@/api/company/firstDiagnosis";import {listTag, getTag, searchTags,} from "@/api/qw/tag";import { allListTagGroup} from "../../../api/qw/tagGroup";import mycustomer from '@/views/qw/externalContact/mycustomer'import customerDetails from '@/views/qw/externalContact/customerDetails'import SopDialog from '@/views/course/sop/SopDialog.vue'import  selectUser  from "@/views/qw/externalContact/selectUser.vue";import { editTalk,editAllTalk } from "@/api/qw/externalContactInfo";import {createLinkUrl} from "@/api/course/sopCourseLink";import {docList} from "@/api/doctor/doctor";import PaginationMore from "../../../components/PaginationMore/index.vue";import Collection from './collection.vue';import {courseList, videoList} from "@/api/course/courseRedPacketLog";import userDetails from '@/views/store/components/userDetails.vue';export default {  name: "ExternalContact",  components:{PaginationMore, mycustomer,customerDetails,SopDialog,selectUser,info,Collection,userDetails},  data() {    return {      member:{        title:"客户详情",        open:false,      },      projectOptions: [],      courseLists: [],      videoList: [],      //重粉记录的参数      log: {        open: false,        loading: true,        list: [],        total: 0,        queryParams: {          pageNum: 1,          pageSize: 10,          externalUserId: null,          fsUserId: null,          projectId: null,          courseId: null,          videoId: null,        },      },      statusDialog: {        open: false,        title: "修改客户状态"      },      statusForm: {        id: null,        status: null      },      statusRules: {        status: [          {required: true, message: '状态不能为空', trigger: 'change'}        ]      },      collection:{        titile:"信息采集",        open:false,      },      doctorList:[],      diagnosisForm:{},      diagnosisOpen:false,      diagnosisRules:{},      notesOpen: {        type: 1,        nameType: 3,        addType: 0,        filter: false,        open: false,        notes: null,      },      user:{        open:false,        title:"修改客户"      },      userForm:{        id:null,        fsUserId:null,      },	    myQwUserList:[],      // 遮罩层      loading: false,      // 导出遮罩层      exportLoading: false,      tagOpen:false,      tagDelOpen:false,	  sTime:null,	  eTime:null,	  createTime:null,      // 选中数组      ids: [],      isBindMiniOptions:[        {dictLabel:"已绑定",dictValue:'isBindMini'},        {dictLabel:"未绑定",dictValue:'noBindMini'},      ],      isBindActiveName:"all",      remarkMobiles: [],      inputVisible: false,      inputValue: '',      // 非单个禁用      single: true,      tagGroupList: [],      //标签弹窗选择      tagChange:{        open:false,        index:null,      },      // 非多个禁用      multiple: true,      // 显示搜索条件      showSearch: true,      // 总条数      total: 0,      // 企业微信客户表格数据      externalContactList: [],      // 弹出层标题      title: "",      // 是否显示弹出层      open: false,      // 用户类别字典      typeOptions: [],      ratingType: [],      ratingUpFall: [],      // 性别字典      genderOptions: [],      addTagForm:{        userIds:[],        tagIds:[]      },      myQwCompanyList:[],      // show:{      //   title:"客户详情",      //   open:false,      // },      //存储选择的客户      chooseCustomerSOP:null,      setSop:{        title:"选择课节SOP",        open:false,        //区分单选1还是多选2        type:null,      },      //合成的客户-课节SOP参数      customerCourseForm:{},      //查询是否已经设置过客户-某个课节的SOP      customerCourseFormLogs:{},      //绑定客户      bindCustomer:{        title:null,        open:false,      },      callOpen:{        open:false,        title: '修改客户称呼',      },      callOpenFrom:{        id:null,        stageStatus:null,      },      callOpenRule:{        stageStatus:[{required:true,message:"员工称呼不能为空",trigger:"blur"}]      },      //绑定的参数表      qwFormCustomer:{        externalContactId:null,        customerId:null,      },	  show:{	  		  title:"用户信息",	  		  open:false,	  },      // 来源字典      addWayOptions: [],      // 查询参数      queryParams: {        pageNum: 1,        pageSize: 10,        userId: null,        qwUserName:null,        externalUserId: null,        name: null,        avatar: null,        type: null,        qwUserId:null,        gender: null,        description: null,        tagIds: null,        remark:null,        remarkMobiles: null,        remarkCorpName: null,        addWay: null,        operUserid: null,        corpId: null,        companyId: null,        status:null,        transferStatus:null,        isBind:null,        isBindMini:null,        lossTime:null,        createTime:null,        level:null,        levelType:null,        companyUser:null,        userRepeat: null      },      queryTagParams:{        pageNum: 1,        pageSize: 5,        total:0,        name:null,        corpId:null,      },      tagTotal:0,      //标签      changeTagDialog:{        title:"",        open:false,      },      selectTags:[],      // 表单参数      form: {},      tagList:[],      transferStatusOptions:[],      statusOptions:[],      // 表单校验      rules: {      },      fsUserId: null,    };  },  created() {    this.getDicts("sys_course_project").then(response => {      this.projectOptions = response.data;    });    this.getDicts("sys_qw_externalContact_type").then(response => {      this.typeOptions = response.data;    });    this.getDicts("sys_qw_sop_rating_type").then(response => {      this.ratingType = response.data;    });    this.getDicts("sys_qw_sop_rating_upFall").then(response => {      this.ratingUpFall = response.data;    });    this.handleGetMyQwUserList();    this.getDicts("sys_sex").then(response => {      this.genderOptions = response.data;    });    this.getDicts("sys_qw_externalContact_addWay").then(response => {      this.addWayOptions = response.data;    });    this.getDicts("sys_qw_external_contact_status").then(response => {      this.statusOptions = response.data;    });    this.getDicts("sys_qw_transfer_status").then(response => {      this.transferStatusOptions = response.data;    });    this.getDocList();  },  methods: {    /** 重粉查看操作 */    showLog(row) {      this.log.queryParams.fsUserId = row.fsUserId;      this.log.open = true;      this.log.loading = true;      courseList().then(response => {        this.courseLists = response.list;        this.log.queryParams.externalUserId = row.id;        this.logList();      })    },    handleQueryWatchLog() {      this.log.queryParams.pageNum = 1;      this.log.queryParams.pageSize = 10;      this.logList();    },    logList() {      getWatchLogList(this.log.queryParams).then(e => {        this.log.loading = false;        this.log.list = e.rows;        this.log.total = e.total;      });    },    courseChange(row) {      this.log.queryParams.videoId = null;      if (row === '') {        this.videoList = [];        return      }      videoList(row).then(response => {        this.videoList = response.list      });    },    handleMemberdetails(row){            this.member.open=true;            setTimeout(() => {                 this.$refs.userDetails.getDetails(row.fsUserId);            }, 1);    },    handleInfoCollection(row){      this.collection.title = "信息采集";      this.collection.open = true;      this.userId = row.fsUserId;      setTimeout(() => {                 this.$refs.collection.getCollectionInfo(row.fsUserId);            }, 1);    },    closeCollection(){      this.collection.open = false;    },    doctorChange(val){      for(const doctor of this.doctorList) {        if(doctor.id == val) {          this.diagnosisForm.doctorDep = doctor.position;          this.diagnosisForm.doctorCertificate = doctor.certificateCode;          this.diagnosisForm.doctorName = doctor.name;          break;        }      }      console.log(this.diagnosisForm)    },    getDocList(){      docList().then(res => {        this.doctorList = res.rows;      })    },    handleDiagnosis(row){      getFsFirstDiagnosis(row.fsUserId).then(res => {        this.diagnosisForm = res.data;      });      this.fsUserId = row.fsUserId;      this.diagnosisOpen = true;    },   diagnosisSubmitForm(){    this.$refs["diagnosisForm"].validate(valid => {        if (valid) {          this.diagnosisForm.qwUserId = this.queryParams.qwUserId;          this.diagnosisForm.userId = this.fsUserId;          if (this.diagnosisForm.id != null) {            updateFsFirstDiagnosis(this.diagnosisForm).then(response => {              this.msgSuccess("修改成功");              this.diagnosisOpen = false;            });          } else {            addFsFirstDiagnosis(this.diagnosisForm).then(response => {              this.msgSuccess("新增成功");              this.diagnosisOpen = false;            });          }        }      });   },   diagnosisCancel(){    this.diagnosisOpen = false;   },	 change(){		if(this.createTime!=null){		  this.queryParams.sTime=this.createTime[0];		  this.queryParams.eTime=this.createTime[1];		}else{		  this.queryParams.sTime=null;		  this.queryParams.eTime=null;		}	  },    handledetails(row){      this.show.open=true;      setTimeout(() => {         this.$refs.Details.getDetails(row.id);      }, 1);    },    updateQwuser(){      for (const user of this.myQwUserList) {          if (user.dictValue == this.queryParams.qwUserId) {             this.queryParams.corpId=user.corpId;             break;          }      }      var listTagFrom={corpId:this.queryParams.corpId}        listTag(listTagFrom).then(response => {          this.tagList = response.rows;        });        this.getList();     },    //搜索的标签    hangleChangeTags(){      this.changeTagDialog.title="搜索的标签"      this.changeTagDialog.open=true;      // 获取 tagListFormIndex 中的所有 tagId,用于快速查找      const selectedTagIds = new Set(        (this.selectTags || []).map(tagItem => tagItem?.tagId)      );      this.queryTagParams.name=null;      this.getPageListTagGroup();      setTimeout(() => {        for (let i = 0; i < this.tagGroupList.length; i++) {          for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {            this.tagGroupList[i].tag[x].isSelected = selectedTagIds.has(this.tagGroupList[i].tag[x].tagId);          }        }      }, 200);    },    //确定选择标签    tagSubmitForm(){        for (let i = 0; i < this.tagGroupList.length; i++) {          for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {            if (this.tagGroupList[i].tag[x].isSelected === true) {              if (!this.selectTags) {                this.selectTags = [];              }              // 检查当前 tag 是否已经存在于 tagListFormIndex[index] 中              let tagExists = this.selectTags.some(                tag => tag.id === this.tagGroupList[i].tag[x].id              );              // 如果 tag 不存在于 tagListFormIndex[index] 中,则新增              if (!tagExists) {                this.selectTags.push(this.tagGroupList[i].tag[x]);              }            }          }        }        if (!this.selectTags || this.selectTags.length === 0) {          return this.$message('请选择标签');        }      this.changeTagDialog.open = false;    },    //取消选择标签    tagCancel(){      this.changeTagDialog.open = false;    },    //删除一些选择的标签    handleCloseTags(list){      const ls = this.selectTags.findIndex(t => t.tagId === list.tagId);      if (ls !== -1) {        this.selectTags.splice(ls, 1);        this.selectTags = [...this.selectTags];      }      if (this.selectTags!=null && this.selectTags.length>0){        // 确保 this.form.tags 是数组        if (!this.queryParams.tagIds) {          this.queryParams.tagIds = []; // 如果未定义,初始化        } else {          this.queryParams.tagIds = []; // 清空已有数据        }        // 遍历并添加 tagId        this.selectTags.forEach(tag => {          if (tag.tagId) { // 确保 tagId 存在            this.queryParams.tagIds.push(tag.tagId);          }        });        this.queryParams.tagIds=this.queryParams.tagIds.join(",");      }else {        this.queryParams.tagIds=null;      }    },    handleChangeStatus(row) {      this.statusForm = {        id: row.id,        status: String(row.status) // 保证与 dictValue 类型一致      };      this.statusDialog.open = true;    },    submitStatusForm() {      this.$refs["statusForm"].validate(valid => {        if (valid) {          const params = {            id: this.statusForm.id,            status: this.statusForm.status          };          // 调用接口更新状态          updateExternalContactStatus(params).then(response => {            this.msgSuccess("状态修改成功");            this.statusDialog.open = false;            this.getList(); // 刷新列表          }).catch(error => {            console.error('状态修改失败:', error);            this.$message.error('状态修改失败');          });        }      });    },    /** 查询企业微信客户列表 */    getList() {      this.loading = true;      myList(this.queryParams).then(response => {        this.externalContactList = response.rows;        this.total = response.total;        this.loading = false;      });    },    getPageListTagGroup(){      this.queryTagParams.corpId=this.queryParams.corpId      allListTagGroup(this.queryTagParams).then(response => {        this.tagGroupList = response.rows;        this.tagTotal = response.total;      });    },    handleSearchTags(name){      if (!name){        return this.$message.error("请输入要搜索的标签")      }      this.queryTagParams.name=name;      this.queryTagParams.corpId=this.queryParams.corpId;      searchTags(this.queryTagParams).then(response => {        this.tagGroupList = response.rows;        this.tagTotal = response.total;      });      // searchTags({name:name,corpId:this.queryParams.corpId}).then(response => {      //   this.tagGroupList = response.rows;      // });    },    handleGetMyQwUserList(){      getMyQwUserList().then(response => {        this.myQwUserList = response.data;        if(this.myQwUserList!=null){          this.queryParams.qwUserId=this.myQwUserList[0].dictValue          this.queryParams.corpId=this.myQwUserList[0].corpId          this.handleGetTagsList();          this.getList();        }      });    },    cancelSearchTags(){      this.resetSearchQueryTag()      this.getPageListTagGroup();    },    resetSearchQueryTag(){      this.queryTagParams= {        pageNum: 1,        pageSize: 5,        total:0,        name:null,      };    },    handleGetTagsList(){      var listTagFrom={corpId:this.queryParams.corpId}      listTag(listTagFrom).then(response => {        this.tagList = response.rows;      });    },    bindMiniCustomerId(row){      this.userForm.fsUserId=row;      bindUserId(this.userForm).then(res=>{         if (res.code==200){           this.$message.success('绑定成功')         }else {           this.$message.error('绑定失败:',res.msg)         }         this.getList()         this.user.open=false;      })    },    /** 查看客户详情 */    handleShow(row){      this.show.open=true;      var that=this;      const tab = "visit";      setTimeout(() => {        that.$refs.customerDetails.getDetails(row.customerId);        that.$refs.customerDetails.handleClick(tab);      }, 200);    },    handleClickX(tab, event) {      this.queryParams.isBind=tab.name;      this.handleQuery();    },    handleClose(tag) {      this.remarkMobiles.splice(this.remarkMobiles.indexOf(tag), 1);    },    showInput() {      this.inputVisible = true;      this.$nextTick(_ => {        this.$refs.saveTagInput.$refs.input.focus();      });    },    handleInputConfirm() {      let inputValue = this.inputValue;      if (inputValue) {        this.remarkMobiles.push(inputValue);      }      this.inputVisible = false;      this.inputValue = '';    },    addUserTag(){      if(this.ids==null||this.ids==""){        return  this.$message('请选择需要添加标签的客户');      }      this.getPageListTagGroup();      setTimeout(() => {        for (let i = 0; i < this.tagGroupList.length; i++) {          for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {            this.tagGroupList[i].tag[x].isSelected=false;          }        }      }, 200);      this.tagOpen = true;    },    delUserTag(){      if(this.ids==null||this.ids==""){        return  this.$message('请选择需要移除标签的客户');      }      this.getPageListTagGroup();      setTimeout(() => {        for (let i = 0; i < this.tagGroupList.length; i++) {          for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {            this.tagGroupList[i].tag[x].isSelected=false;          }        }      }, 200);      this.tagDelOpen = true;    },    //重新获取页面数据    refreshList(){      this.getList();    },    //批量设置课程sop    setUserCourseSop(){      if(this.ids==null||this.ids==""){        return  this.$message('请选择需要设置课程SOP的客户');      }      this.$confirm('批量设置客户课节SOP可能会存在重复,确定要批量设置吗?', "警告", {        confirmButtonText: "确定",        cancelButtonText: "取消",        type: "warning"      }).then(() => {          this.setSop.open = true;          this.setSop.type = 2;        })        .catch(() => {          // 可以处理用户点击“取消”的逻辑        });    },    tagSelection(row){      row.isSelected= !row.isSelected;      this.$forceUpdate();    },    // 取消按钮    cancel() {      this.open = false;      this.reset();    },    addTagCancel() {      this.tagOpen = false;      this.addTagForm={        userIds:[],        tagIds:[]      };    },    DelTagCancel() {      this.tagDelOpen = false;      this.addTagForm={        userIds:[],        tagIds:[]      };    },    addTagSubmitForm(){      for (let i = 0; i < this.tagGroupList.length; i++) {        for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {          if(this.tagGroupList[i].tag[x].isSelected==true){            this.addTagForm.tagIds.push(this.tagGroupList[i].tag[x].tagId)          }        }      }      if(this.addTagForm.tagIds==[]||this.addTagForm.tagIds==null||this.addTagForm.tagIds==""){        return  this.$message('请选择标签');      }      this.addTagForm.corpId=this.queryParams.corpId      this.addTagForm.userIds=this.ids;      let loadingRock = this.$loading({        lock: true,        text: '正在执行中请稍后~~请不要刷新页面!!',        spinner: 'el-icon-loading',        background: 'rgba(0, 0, 0, 0.7)'      });      addTag(this.addTagForm).then(response => {       this.msgSuccess(response.msg);       this.tagOpen = false;        loadingRock.close();       this.addTagForm={         userIds:[],         tagIds:[]       };       this.getList()     }).finally(res=>{        loadingRock.close();      });    },    tagDelSubmitForm(){      for (let i = 0; i < this.tagGroupList.length; i++) {        for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {          if(this.tagGroupList[i].tag[x].isSelected==true){            this.addTagForm.tagIds.push(this.tagGroupList[i].tag[x].tagId)          }        }      }      if(this.addTagForm.tagIds==[]||this.addTagForm.tagIds==null||this.addTagForm.tagIds==""){        return  this.$message('请选择标签');      }       this.addTagForm.corpId=this.queryParams.corpId      this.addTagForm.userIds=this.ids;      let loadingRock = this.$loading({        lock: true,        text: '正在执行中请稍后~~请不要刷新页面!!',        spinner: 'el-icon-loading',        background: 'rgba(0, 0, 0, 0.7)'      });      delTag(this.addTagForm).then(response => {       this.msgSuccess(response.msg);       this.tagDelOpen = false;        loadingRock.close();       this.addTagForm={         userIds:[],         tagIds:[]       };       this.getList()     }).finally(res=>{        loadingRock.close();      });    },    // 表单重置    reset() {      this.form = {        id: null,        userId: null,        externalUserId: null,        name: null,        companyUserId:null,        customerId:null,        avatar: null,        type: null,        gender: null,        remark: null,        description: null,        tagIds: null,        remarkMobiles: null,        remarkCorpName: null,        addWay: null,        operUserid: null,        corpId: null,        companyId: null,        transferStatus:null,        status:null,        createTime:null,        transferTime:null,        transferNum:null,        lossTime:null,        delTime:null,        state:null,        wayId:null,        stageStatus:null,        customerName:null      };      this.resetForm("form");    },    /** 搜索按钮操作 */    handleQuery() {      if (this.selectTags!=null && this.selectTags.length>0){        // 确保 this.form.tags 是数组        if (!this.queryParams.tagIds) {          this.queryParams.tagIds = []; // 如果未定义,初始化        } else {          this.queryParams.tagIds = []; // 清空已有数据        }        // 遍历并添加 tagId        this.selectTags.forEach(tag => {          if (tag.tagId) { // 确保 tagId 存在            this.queryParams.tagIds.push(tag.tagId);          }        });        this.queryParams.tagIds=this.queryParams.tagIds.join(",");      }else {        this.queryParams.tagIds=null;      }      this.queryParams.pageNum = 1;      this.getList();    },    /** 重置按钮操作 */    resetQuery() {      this.resetForm("queryForm");      this.queryParams.qwUserId=this.myQwUserList[0].dictValue;      this.queryParams.corpId=this.myQwUserList[0].corpId;      this.queryParams.transferStatus = null;      this.selectTags=[];	   this.createTime=null;	  this.queryParams.sTime=null;	  this.queryParams.eTime=null;      this.handleQuery();    },    // 多选框选中数据    handleSelectionChange(selection) {      this.ids = selection.map(item => item.id)      this.single = selection.length!==1      this.multiple = !selection.length    },    /** 新增按钮操作 */    handleAdd() {      this.loading=true;      this.form.corpId=this.queryParams.corpId     addExternalContact(this.form).then(response => {       this.msgSuccess("同步成功");       this.getList();     }).finally(()=>{       this.loading=false;     });    },    /** 修改按钮操作 */    handleUpdate(row) {      this.reset();      const id = row.id || this.ids      getExternalContact(id).then(response => {        this.form = response.data;        if(this.form.remarkMobiles!=null){          this.remarkMobiles=JSON.parse(this.form.remarkMobiles)        }else{          this.remarkMobiles=[]        }        this.open = true;        this.title = "修改企业微信客户";      });    },    handleAppellation(val){      this.callOpen.open=true;      this.callOpenFrom.stageStatus=val.stageStatus;      this.callOpenFrom.id=val.id;    },    /** 绑定客户操作 */    handleUpdateCustomer(row){       this.bindCustomer.title="绑定客户"        this.bindCustomer.open=true;        this.form.id=row.id        this.form.externalUserId=row.externalUserId        this.form.name=row.name    },    handleUpdateUser(row){        this.user.title="绑定客户"        this.user.open=true;        this.userForm.id=row.id;    },    handleUnBindUserId(val){      this.$confirm(        '确认解绑客户:<span style="color: green;">' + val.name + '' +        '</span> 的小程序用户?<br><span style="color: red;">【ps:可能会导致客户无法看课】</span>',        {          confirmButtonText: "确定",          cancelButtonText: "取消",          type: "warning",          dangerouslyUseHTMLString: true // 允许使用 HTML 字符串        }      ).then(() => {        return unBindUserId(val.id);      }).then(response => {        this.getList();        this.msgSuccess("解绑成功");      }).finally(res=>{        this.getList();      })    },    bindCustomerId(row){      console.log("row",row)      // this.qwFormCustomer.customerId=row;      this.form.customerId=row;      this.form.corpId=this.queryParams.corpId;      this.msgWarning("绑定中.....同步信息中.....");      editbindCustomer(this.form).then(res=>{        //清空表单        this.reset();        this.bindCustomer.open = false;        this.msgSuccess("绑定成功");        this.getList();      })    },    //设置一个SOP    setCourseSOP(row) {      // 检查 row.miniUserId 是否为 null      if (row.miniUserId === null || row.miniUserId === undefined) {        return this.$confirm('当前客户【CRM客户详情】中 未绑定小程序客户,请先绑定', "警告", {          confirmButtonText: "确定",          cancelButtonText: "取消",          type: "warning"        }).catch(error => {          this.msgWarning("操作取消:", error);        });      } else {        this.chooseCustomerSOP = row;        this.setSop.open = true;        this.setSop.type=1;      }    },    //选择课程SOP    // 用于设置 customerCourseForm 和 customerCourseFormLogs 的共同属性    setCommonProperties(form, row) {      form.qwUserid = this.chooseCustomerSOP.userId;      form.companyUserId = this.chooseCustomerSOP.companyUserId;      form.externalUserId = this.chooseCustomerSOP.externalUserId;      form.customerId = this.chooseCustomerSOP.customerId;      form.miniUserId = this.chooseCustomerSOP.miniUserId;      form.businessId = row.businessId;    },    bindCourseSop(row,days) {      if (this.setSop.type==2){        this.setSop.open = false;        this.loading=true;        this.msgWarning("设定中.....同步信息中.....");        setCustomerCourseSopList({ids:this.ids,fsCourseSopId:row.id,days:days}).then(res=>{          let msg=" 批量设置成功数【" + res.successNum + "】,<br>"          if (res.failCRM.length>0){            msg+="失败的客户【" + res.failCRM + "】,原因是未绑定CRM客户。<br>"          }          if (res.failMiNi.length>0){            msg+="失败的客户【" + res.failMiNi + "】,原因是CRM中未绑定小程序客户。<br>"          }          if (res.failCompany.length>0){            msg+="失败的客户【" + res.failCompany + "】,原因是客户没有所属成员。<br>"          }          return this.$confirm(msg, "提示", {            confirmButtonText: "确定",            cancelButtonText: "取消",            type: "warning",            dangerouslyUseHTMLString: true // 允许使用HTML标签          }).catch(error => {            this.msgSuccess("操作完成~");          });        }).finally(()=>{          this.loading = false;          this.getList();        })      }else if (this.setSop.type==1){      // 设置 customerCourseFormLogs 的属性      this.setCommonProperties(this.customerCourseFormLogs, row);      // 设置 customerCourseForm 的属性      this.setCommonProperties(this.customerCourseForm, row);      this.customerCourseForm.sopId = row.id;      this.customerCourseForm.sopType = row.sopType;      this.customerCourseForm.setting = row.setting;      this.customerCourseForm.days = days;      // 执行异步操作      getCustomerCourseSop(this.customerCourseFormLogs)        .then(res => {          if (res) {            return this.$confirm('当前客户已设置过相同课程课节SOP,确定还要再次设置吗?', "警告", {              confirmButtonText: "确定",              cancelButtonText: "取消",              type: "warning"            });          } else {            return Promise.resolve(); // 如果没有设置过,直接执行后续操作          }        })        .then(() => {          this.loading = true;          this.setSop.open = false;          this.msgSuccess("设定中.....同步信息中.....");          return setCustomerCourseSop(this.customerCourseForm);        })        .then(() => {          this.msgSuccess("设定成功");        })        .catch(error => {          this.msgWarning("操作取消:", error);        })        .finally(() => {          this.loading = false;          this.getList();        });      }    },    submitCallOpenFrom(){      this.$refs["callOpenFrom"].validate(valid => {        if (valid) {          if (this.callOpenFrom.id != null && this.callOpenFrom.stageStatus != null) {            updateExternalContactCall(this.callOpenFrom).then(res=>{              this.$message.success('修改成功');              this.callOpen.open=false;              this.getList();            });          }        }      });    },    /** 提交按钮 */    submitForm() {      this.$refs["form"].validate(valid => {        if (valid) {          if (this.form.id != null) {            this.form.remarkMobiles=JSON.stringify(this.remarkMobiles)            updateExternalContact(this.form).then(response => {              this.msgSuccess("修改成功");              this.open = false;              this.getList();            });          } else {            addExternalContact(this.form).then(response => {              this.msgSuccess("新增成功");              this.open = false;              this.getList();            });          }        }      });    },    /** 删除按钮操作 */    handleDelete(row) {      const ids = row.id || this.ids;      this.$confirm('是否确认删除企业微信客户编号为"' + ids + '"的数据项?', "警告", {          confirmButtonText: "确定",          cancelButtonText: "取消",          type: "warning"        }).then(function() {          return delExternalContact(ids);        }).then(() => {          this.getList();          this.msgSuccess("删除成功");        }).catch(() => {});    },    handleSyncMyExternalContact(){      this.loading=true;      let loadingRock = this.$loading({        lock: true,        text: '正在执行中请稍后~~请不要刷新页面!!',        spinner: 'el-icon-loading',        background: 'rgba(0, 0, 0, 0.7)'      });      syncMyExternalContact(this.queryParams.qwUserId).then(res => {        this.msgSuccess("同步成功");        this.loading=false;        loadingRock.close();        this.getList();      }).catch(res=>{        console.log("asdasdwaaw ")        loadingRock.close();      }).finally(res=>{        loadingRock.close();        this.loading=false;      })    },    handleSyncAddMyExternalContact(){        this.loading=true;      let loadingRock = this.$loading({        lock: true,        text: '正在执行中请稍后~~请不要刷新页面!!',        spinner: 'el-icon-loading',        background: 'rgba(0, 0, 0, 0.7)'      });    syncMyAddExternalContact(this.queryParams.qwUserId).then(res => {        this.msgSuccess("同步成功");        this.loading=false;        loadingRock.close();        this.getList();      }).finally(()=>{        loadingRock.close();        this.loading=false;    })    },	updateTalk(row){		const ids = row.id || this.ids;		this.$confirm('是否确认批量更改用户信息为非首次交流', "警告", {		    confirmButtonText: "确定",		    cancelButtonText: "取消",		    type: "warning"		  }).then(function() {		    return editTalk(ids);		  }).then(() => {		    this.getList();		    this.msgSuccess("成功");		  }).catch(() => {});	},	updateAllTalk(row){		const id =	this.queryParams.qwUserId		this.$confirm('是否确认更改全部用户信息为非首次交流', "警告", {		    confirmButtonText: "确定",		    cancelButtonText: "取消",		    type: "warning"		  }).then(function() {		    return editAllTalk(id);		  }).then(() => {		    this.getList();		    this.msgSuccess("成功");		  }).catch(() => {});	},    /** 导出按钮操作 */    handleExport() {      const queryParams = this.queryParams;      this.$confirm('是否确认导出所有企业微信客户数据项?', "警告", {          confirmButtonText: "确定",          cancelButtonText: "取消",          type: "warning"        }).then(() => {          this.exportLoading = true;          return exportMyExternalContact(queryParams);        }).then(response => {          this.download(response.msg);          this.exportLoading = false;        }).catch(() => {});    },    handleBatchUpdateNotesFilter() {      this.notesOpen.open = true;      this.notesOpen.filter = true;    },    handleBatchUpdateNotes() {      if (this.ids == null || this.ids == "") {        return this.$message('请选择需要添加备注的客户');      }      this.notesOpen.open = true;      this.notesOpen.filter = false;    },    notesCancel(){      this.notesOpen={        open: false,        notes: null,        type: 1,        nameType:3,      }    },    notesSubmitForm() {      if (this.notesOpen.notes == null || this.notesOpen.notes == "") {        return this.$message.error("请输入备注内容");      }      // let loadingRock = this.$loading({      //   lock: true,      //   text: '正在执行中请稍后~~请不要刷新页面!!',      //   spinner: 'el-icon-loading',      //   background: 'rgba(0, 0, 0, 0.7)'      // });      let obj = JSON.parse(JSON.stringify(this.queryParams))      console.log(obj);      if(obj.tagIds !== null && obj.tagIds !== undefined && obj.tagIds !== ''){        obj.tagIds = obj.tagIds.split(",");      }      batchUpdateExternalContactNotes({        addType: 0,        userIds: this.ids,        notes: this.notesOpen.notes,        type: this.notesOpen.type,        nameType: this.notesOpen.nameType,        filter: this.notesOpen.filter,        param: obj      }).then(res => {        this.resultMessage = res.msg;        this.$message.success("正在执行中...");        // this.resultDialogVisible = true; // 显示弹窗        // this.resultTitle = '批量修改备注结果';      }).finally(res => {        this.getList();        // loadingRock.close();        this.notesCancel();      })    },  }};</script><style scoped>/* CSS 样式 */.tag-container {  display: flex;  flex-wrap: wrap; /* 超出宽度时自动换行 */  gap: 8px; /* 设置标签之间的间距 */}.name-background {  display: inline-block;  background-color: #abece6; /* 背景颜色 */  padding: 4px 8px; /* 调整内边距,让背景包裹文字 */  border-radius: 4px; /* 可选:设置圆角 */}.tag-box {  padding: 8px 12px;  border: 1px solid #989797;  border-radius: 4px;  cursor: pointer;  display: inline-block;}.tag-selected {  background-color: #00bc98;  color: #fff;  border-color: #00bc98;}.el-tag + .el-tag {  margin-left: 10px;}.button-new-tag {  margin-left: 10px;  height: 32px;  line-height: 30px;  padding-top: 0;  padding-bottom: 0;}.input-new-tag {  width: 90px;  margin-left: 10px;  vertical-align: bottom;}/* 新增的滚动容器样式(不影响原有样式) */.scroll-wrapper {  max-height: 130px; /* 大约三行的高度 */  overflow-y: auto;  /* 垂直滚动 */  padding-right: 5px; /* 为滚动条留出空间 */}/* 美化滚动条(可选) */.scroll-wrapper::-webkit-scrollbar {  width: 6px;}.scroll-wrapper::-webkit-scrollbar-thumb {  background: rgba(0, 0, 0, 0.2);  border-radius: 3px;}.tag-container {  max-height: 200px;  overflow-y: auto;  padding: 1px;  border: 1px solid #ebeef5;  border-radius: 1px;  background-color: #fafafa;}.tag-list {  display: flex;  flex-wrap: wrap;  gap: 8px;}.scroll-hint {  text-align: center;  color: #909399;  font-size: 12px;  padding: 1px 0;}.container {  max-width: 800px;  margin: 0 auto;  padding: 10px;}.title {  text-align: center;  color: #303133;  margin-bottom: 30px;}.demo-table {  width: 100%;  margin-bottom: 30px;}.instructions {  background-color: #f5f7fa;  padding: 15px;  border-radius: 1px;  margin-bottom: 20px;}</style>
 |