myIndex.vue 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  4. <el-form-item label="企微主体" prop="corpId">
  5. <el-select v-model="queryParams.corpId" placeholder="企微主体" size="small" @change="updateCorpId()">
  6. <el-option
  7. v-for="dict in myQwCompanyList"
  8. :key="dict.dictValue"
  9. :label="dict.dictLabel"
  10. :value="dict.dictValue"
  11. />
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="企微账号" prop="qwUserId">
  15. <el-input
  16. v-model="queryParams.qwUserId"
  17. placeholder="请输入企微账号"
  18. clearable
  19. size="small"
  20. @keyup.enter.native="handleQuery"
  21. />
  22. </el-form-item>
  23. <el-form-item label="企微昵称" prop="qwUserName">
  24. <el-input
  25. v-model="queryParams.qwUserName"
  26. placeholder="请输入企微昵称"
  27. clearable
  28. size="small"
  29. @keyup.enter.native="handleQuery"
  30. />
  31. </el-form-item>
  32. <el-form-item label="授权码" prop="appKey">
  33. <el-input
  34. v-model="queryParams.appKey"
  35. placeholder="请输入授权码"
  36. clearable
  37. size="small"
  38. @keyup.enter.native="handleQuery"
  39. />
  40. </el-form-item>
  41. <el-form-item label="ipad状态" prop="loginStatus">
  42. <el-select v-model="queryParams.loginStatus" placeholder="请选择ipad状态" clearable>
  43. <el-option
  44. v-for="item in loginStatusOption"
  45. :key="item.value"
  46. :label="item.label"
  47. :value="item.value">
  48. </el-option>
  49. </el-select>
  50. </el-form-item>
  51. <el-form-item label="员工状态" prop="isDel">
  52. <el-select v-model="queryParams.isDel" placeholder="请选择员工状态" clearable>
  53. <el-option
  54. v-for="item in optionsStatus"
  55. :key="item.value"
  56. :label="item.label"
  57. :value="item.value">
  58. </el-option>
  59. </el-select>
  60. </el-form-item>
  61. <el-form-item>
  62. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  63. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  64. </el-form-item>
  65. </el-form>
  66. <el-row :gutter="10" class="mb8">
  67. <el-col :span="1.5">
  68. <el-button
  69. type="primary"
  70. :disabled="multiple"
  71. plain
  72. icon="el-icon-edit"
  73. size="mini"
  74. @click="updateSendType"
  75. >修改发送方式
  76. </el-button>
  77. </el-col>
  78. <el-col :span="1.5">
  79. <el-button
  80. type="warning"
  81. plain
  82. icon="el-icon-download"
  83. size="mini"
  84. :loading="exportLoading"
  85. @click="handleExport"
  86. v-hasPermi="['qw:user:export']"
  87. >导出</el-button>
  88. </el-col>
  89. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  90. </el-row>
  91. <el-table border v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
  92. <el-table-column type="selection" width="55" align="center" />
  93. <el-table-column label="企微成员ID" align="center" prop="id" />
  94. <el-table-column label="企微账号" align="center" prop="qwUserId" />
  95. <el-table-column label="企微昵称" align="center" prop="qwUserName" />
  96. <el-table-column label="员工称呼" align="center" prop="welcomeText" />
  97. <el-table-column label="员工状态" align="center" prop="isDel">
  98. <template slot-scope="scope">
  99. <el-tag v-if="scope.row.isDel == 0" type="success">正常</el-tag>
  100. <el-tag v-else type="error">离职</el-tag>
  101. </template>
  102. </el-table-column>
  103. <el-table-column label="联系我二维码" align="center" prop="contactWay" >
  104. <template slot-scope="scope">
  105. <el-image
  106. v-if="scope.row.contactWay!=null"
  107. style="width: 100px; height: 100px"
  108. :src="scope.row.contactWay"
  109. fit="contain"
  110. @click="openImageViewer(scope.row.contactWay)"/>
  111. </template>
  112. </el-table-column>
  113. <el-table-column label="绑定的AI客服" align="center" prop="fastGptRoleName" />
  114. <el-table-column label="授权码" align="center" prop="appKey" />
  115. <el-table-column label="发送方式" align="center" prop="sendMsgType">
  116. <template slot-scope="scope">
  117. <el-tag v-if="scope.row.sendMsgType == 0">方式一</el-tag>
  118. <el-tag v-if="scope.row.sendMsgType == 1" type="success">方式二</el-tag>
  119. <el-tag v-if="scope.row.sendMsgType == 2" type="warning">掉线通知</el-tag>
  120. </template>
  121. </el-table-column>
  122. <el-table-column label="vid" align="center" prop="vid" />
  123. <el-table-column label="uid" align="center" prop="uid" />
  124. <el-table-column label="serverId" align="center" prop="serverId" />
  125. <el-table-column label="ipad状态" align="center" prop="loginStatus">
  126. <template slot-scope="scope">
  127. <el-tag v-if="scope.row.ipadStatus == 1" type="success">在线</el-tag>
  128. <el-tag v-else type="danger">离线</el-tag>
  129. </template>
  130. </el-table-column>
  131. <!-- <el-table-column label="插件状态" align="center" prop="toolStatus">-->
  132. <!-- <template slot-scope="scope">-->
  133. <!-- <el-tag v-if="scope.row.toolStatus == 1" type="success">在线</el-tag>-->
  134. <!-- <el-tag v-else type="danger">离线</el-tag>-->
  135. <!-- </template>-->
  136. <!-- </el-table-column>-->
  137. <!-- <el-table-column label="插件版本" align="center" prop="version"/>-->
  138. <!-- <el-table-column label="服务器地址" align="center" prop="loginCodeUrl">-->
  139. <!-- <template slot-scope="scope">-->
  140. <!-- <el-tooltip class="item" effect="dark" :content="scope.row.loginCodeUrl" placement="top">-->
  141. <!-- <div style="display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; text-overflow: ellipsis;">-->
  142. <!-- <span>{{ scope.row.loginCodeUrl }}</span>-->
  143. <!-- </div>-->
  144. <!-- </el-tooltip>-->
  145. <!-- </template>-->
  146. <!-- </el-table-column>-->
  147. <el-table-column label="自动发课" align="center" prop="isAuto">
  148. <template slot-scope="scope">
  149. <dict-tag :options="isAutoOptions" :value="scope.row.isAuto"/>
  150. </template>
  151. </el-table-column>
  152. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
  153. <template slot-scope="scope">
  154. <el-button
  155. size="mini"
  156. type="text"
  157. icon="el-icon-user-solid"
  158. plain
  159. @click="handleAppellation(scope.row)"
  160. >
  161. 修改员工称呼
  162. </el-button>
  163. <el-button
  164. size="mini"
  165. type="text"
  166. icon="el-icon-user-solid"
  167. plain
  168. @click="handleAutoRemark(scope.row)"
  169. >
  170. 完课备注修改
  171. </el-button>
  172. <el-button
  173. v-if="scope.row.serverStatus==1&&scope.row.ipadStatus!=1"
  174. size="mini"
  175. type="text"
  176. icon="el-icon-sunny"
  177. plain
  178. @click="handleLoginQwCode(scope.row)"
  179. v-hasPermi="['qw:user:login']"
  180. >
  181. 登录企微
  182. </el-button>
  183. <el-button
  184. v-if="scope.row.serverStatus==1&&scope.row.ipadStatus==1"
  185. size="mini"
  186. type="text"
  187. icon="el-icon-moon"
  188. plain
  189. @click="handleLoginOutQwStatus(scope.row)"
  190. v-hasPermi="['qw:user:login']"
  191. >
  192. 退出企微
  193. </el-button>
  194. <el-button
  195. v-if="scope.row.ipadStatus==1"
  196. size="mini"
  197. type="text"
  198. icon="el-icon-moon"
  199. plain
  200. @click="handleTwoCode(scope.row)"
  201. v-hasPermi="['qw:user:login']">
  202. 二次验证
  203. </el-button>
  204. <el-button
  205. v-if="scope.row.serverStatus!=1"
  206. size="mini"
  207. type="text"
  208. icon="el-icon-moon"
  209. plain
  210. @click="handleGetQwIpad(scope.row)"
  211. v-hasPermi="['qw:user:login']"
  212. >
  213. 获取Ai主机
  214. </el-button>
  215. <el-button
  216. v-if="scope.row.serverStatus==1 && scope.row.ipadStatus!=1"
  217. size="mini"
  218. type="text"
  219. icon="el-icon-moon"
  220. plain
  221. @click="handleDelQwIpad(scope.row)"
  222. v-hasPermi="['qw:user:login']"
  223. >
  224. 解绑Ai主机
  225. </el-button>
  226. <el-button
  227. v-if="scope.row.isAuto=='00'"
  228. size="mini"
  229. type="text"
  230. icon="el-icon-moon"
  231. plain
  232. @click="handleUpdateIsAuto(scope.row,'01')"
  233. v-hasPermi="['qw:user:isauto']"
  234. >
  235. 启用插件
  236. </el-button>
  237. <el-button
  238. v-if="scope.row.isAuto=='01'"
  239. size="mini"
  240. type="text"
  241. icon="el-icon-moon"
  242. plain
  243. @click="handleUpdateIsAuto(scope.row,'00')"
  244. v-hasPermi="['qw:user:isauto']"
  245. >
  246. 禁用插件
  247. </el-button>
  248. </template>
  249. </el-table-column>
  250. <el-table-column label="主机" align="center" class-name="small-padding fixed-width" width="110px" fixed="right">
  251. <template slot-scope="scope">
  252. <el-button
  253. v-if="scope.row.appKey==null"
  254. size="mini"
  255. type="text"
  256. icon="el-icon-s-check"
  257. plain
  258. v-hasPermi="['qw:user:authAppKey']"
  259. @click="uploadAuthorizeKey2(scope.row)"
  260. >授权key
  261. </el-button>
  262. <el-button
  263. v-if="scope.row.loginCodeUrl==null && scope.row.appKey !=null"
  264. size="mini"
  265. type="text"
  266. icon="el-icon-sunny"
  267. plain
  268. @click="handleBindCloudHost(scope.row)"
  269. v-hasPermi="['qw:user:loginIp']"
  270. >
  271. 绑定主机
  272. </el-button>
  273. <!-- <el-button-->
  274. <!-- v-if="scope.row.loginCodeUrl!=null"-->
  275. <!-- size="mini"-->
  276. <!-- type="text"-->
  277. <!-- icon="el-icon-video-camera-solid"-->
  278. <!-- plain-->
  279. <!-- @click="handleCloudAP(scope.row.loginCodeUrl)"-->
  280. <!-- v-hasPermi="['qw:user:cloudAP']"-->
  281. <!-- >-->
  282. <!-- 获取主机帐密-->
  283. <!-- </el-button>-->
  284. <el-button
  285. v-if="scope.row.loginCodeUrl!=null"
  286. size="mini"
  287. type="text"
  288. icon="el-icon-moon"
  289. plain
  290. @click="handleUnbindCloudHost(scope.row)"
  291. v-hasPermi="['qw:user:loginIpOut']"
  292. >
  293. 解除主机
  294. </el-button>
  295. <el-button
  296. size="mini"
  297. type="text"
  298. :icon="scope.row.videoGetStatus == 0 ? 'el-icon-circle-check' : 'el-icon-remove-outline'"
  299. plain
  300. @click="changeVideoStatus(scope.row)"
  301. >
  302. {{ scope.row.videoGetStatus == 0 ? "开启" : "禁用" }}视频号接收
  303. </el-button>
  304. </template>
  305. </el-table-column>
  306. <el-table-column label="AI客服" align="center" class-name="small-padding fixed-width" width="100px" fixed="right">
  307. <template slot-scope="scope">
  308. <el-button
  309. size="mini"
  310. type="text"
  311. icon="el-icon-connection"
  312. plain
  313. v-if="scope.row.fastGptRoleName!=null"
  314. @click="bindFastGptRole(scope.row)"
  315. >换绑AI客服</el-button>
  316. <el-button
  317. size="mini"
  318. type="text"
  319. plain
  320. icon="el-icon-link"
  321. v-else
  322. @click="bindFastGptRole(scope.row)"
  323. >绑定AI客服</el-button>
  324. <el-button
  325. size="mini"
  326. type="text"
  327. icon="el-icon-unlock"
  328. plain
  329. v-if="scope.row.fastGptRoleName!=null"
  330. @click="relieveFastGptRole(scope.row)"
  331. >解绑AI客服</el-button>
  332. <el-button
  333. size="mini"
  334. type="text"
  335. icon="el-icon-unlock"
  336. plain
  337. v-hasPermi="['qw:user:myAiStatus']"
  338. v-if="scope.row.aiStatus == 0 && projectFrom === 'sxjz'"
  339. @click="updateFastGptRoleStatus(scope.row)"
  340. >Ai客服下线</el-button>
  341. <el-button
  342. size="mini"
  343. type="text"
  344. icon="el-icon-unlock"
  345. plain
  346. v-hasPermi="['qw:user:myAiStatus']"
  347. v-if="scope.row.aiStatus == 1 && projectFrom === 'sxjz'"
  348. @click="updateFastGptRoleStatus(scope.row)"
  349. >Ai客服上线</el-button>
  350. </template>
  351. </el-table-column>
  352. </el-table>
  353. <pagination
  354. v-show="total>0"
  355. :total="total"
  356. :page.sync="queryParams.pageNum"
  357. :limit.sync="queryParams.pageSize"
  358. @pagination="getList"
  359. />
  360. <!-- 绑定AI客服-->
  361. <el-dialog :title="bindAiTitle" :visible.sync="bindAiOpen" width="1200px" append-to-body>
  362. <fast-gpt-role ref="fastGptRole" @refreshFastGptList="refreshFastGptList" ></fast-gpt-role>
  363. </el-dialog>
  364. <!-- <el-dialog :visible.sync="updateIp.open" width="600px" append-to-body>-->
  365. <!-- <el-form ref="updateIpForm" :model="updateIpForm" :rules="updateIpRule" label-width="100px">-->
  366. <!-- <el-form-item label="新云主机IP" prop="Ip">-->
  367. <!-- <el-input v-model="updateIpForm.newIp" placeholder="请输入新IP" />-->
  368. <!-- </el-form-item>-->
  369. <!-- </el-form>-->
  370. <!-- <div slot="footer" class="dialog-footer" >-->
  371. <!-- <el-button type="primary" @click="submitUpdateIpForm">确 定</el-button>-->
  372. <!-- </div>-->
  373. <!-- </el-dialog>-->
  374. <el-dialog title="云主机信息" :visible.sync="cloudAPOpen.open" append-to-body>
  375. <el-card class="box-card">
  376. <div slot="header" class="clearfix">
  377. <span>账号:{{cloudAPOpen.admin}}</span>
  378. </div>
  379. <div slot="header" class="clearfix">
  380. <span>密码:{{cloudAPOpen.passWord}}</span>
  381. </div>
  382. </el-card>
  383. </el-dialog>
  384. <el-dialog :title="callOpen.title" :visible.sync="callOpen.open" width="500px" append-to-body>
  385. <el-form ref="callOpenFrom" :model="callOpenFrom" :rules="callOpenRule" label-width="110px">
  386. <el-form-item label="员工称呼" prop="welcomeText">
  387. <el-input v-model="callOpenFrom.welcomeText" placeholder="请输入员工称呼" />
  388. </el-form-item>
  389. </el-form>
  390. <div slot="footer" class="dialog-footer" >
  391. <el-button type="primary" @click="submitCallOpenFrom">确 定</el-button>
  392. </div>
  393. </el-dialog>
  394. <el-dialog :title="editRemarkOpen.title" :visible.sync="editRemarkOpen.open" width="500px" append-to-body>
  395. <el-form ref="callOpenFrom" :model="editRemarkOpen" label-width="110px">
  396. <el-radio-group v-model="editRemarkOpen.isSendMsg">
  397. <el-card>
  398. <el-row :gutter="20">
  399. <el-col>
  400. <el-radio
  401. :label="1"
  402. style="font-size: 16px; margin: 10px 0;"
  403. >添加【完课备注】在最【旧备注-(前面)】</el-radio>
  404. </el-col>
  405. <el-col>
  406. <el-radio
  407. :label="2"
  408. style="font-size: 16px; margin: 10px 0;"
  409. >添加【完课备注】在最【旧备注-(后面)】</el-radio>
  410. </el-col>
  411. <el-col>
  412. <el-radio
  413. :label="3"
  414. style="font-size: 16px; margin: 10px 0;"
  415. >使用简洁版备注【*日期完】,在【旧备注-前面】</el-radio>
  416. </el-col>
  417. <el-col>
  418. <el-radio
  419. :label="4"
  420. style="font-size: 16px; margin: 10px 0;"
  421. >使用简洁版备注【*日期完】,在【旧备注-后面】</el-radio>
  422. </el-col>
  423. <el-col>
  424. <el-radio
  425. :label="5"
  426. style="font-size: 16px; margin: 10px 0;"
  427. >不用完课备注</el-radio>
  428. </el-col>
  429. </el-row>
  430. </el-card>
  431. </el-radio-group>
  432. </el-form>
  433. <div slot="footer" class="dialog-footer">
  434. <el-button type="primary" @click="submitEditRemarkOpenFrom">确 定</el-button>
  435. </div>
  436. </el-dialog>
  437. <el-dialog title="授权key" :visible.sync="authorizeKeyOpen" width="500px" append-to-body>
  438. <el-form ref="authorizeKeyFrom" :model="authorizeKeyFrom" :rules="authorizeKeyRule" label-width="110px">
  439. <el-form-item label="授权的key值" prop="appKey">
  440. <el-input v-model="authorizeKeyFrom.appKey" placeholder="请输入授权key" type="Number"/>
  441. </el-form-item>
  442. </el-form>
  443. <div slot="footer" class="dialog-footer" >
  444. <el-button type="primary" @click="submitAuthorizeKeyForm">确 定</el-button>
  445. </div>
  446. </el-dialog>
  447. <!--二维码 -->
  448. <el-dialog
  449. title="企微二次认证"
  450. :visible.sync="qwLoginTwo.open"
  451. width="600px"
  452. append-to-body
  453. custom-class="qr-login-dialog"
  454. >
  455. <div class="qr-login-container">
  456. <div class="image-wrapper" v-loading="imageLoading" >
  457. <el-image
  458. :src="'data:image/png;base64,' +qwLoginTwo.codeUrl"
  459. style="display: block; margin: 0 auto; width: 300px; height: 300px;"
  460. />
  461. </div>
  462. <p class="qr-login-instructions">二次验证二维码</p>
  463. </div>
  464. <div slot="footer" class="dialog-footer" >
  465. <el-button type="primary" @click="qwLoginTwo.open=false">确 定</el-button>
  466. </div>
  467. </el-dialog>
  468. <el-dialog
  469. :title="qwLogin.title"
  470. :visible.sync="qwLogin.open"
  471. width="600px"
  472. append-to-body
  473. custom-class="qr-login-dialog"
  474. >
  475. <div class="qr-login-container">
  476. <div class="image-wrapper" v-loading="imageLoading" >
  477. <el-image
  478. :src="'data:image/png;base64,' +qwLogin.codeUrl"
  479. style="display: block; margin: 0 auto; width: 300px; height: 300px;"
  480. />
  481. </div>
  482. <p class="qr-login-instructions">使用企业微信扫码授权登录</p>
  483. </div>
  484. </el-dialog>
  485. <el-dialog
  486. title="输入企微验证码"
  487. :visible.sync="qwCode.open"
  488. width="600px"
  489. append-to-body>
  490. <el-form :model="qwCode" label-width="80px" @submit.native.prevent="handleSubmit">
  491. <el-form-item label="验证码" prop="companyName">
  492. <el-input v-model="qwCode.code" placeholder="输入企微6位验证码" />
  493. </el-form-item>
  494. </el-form>
  495. <div slot="footer" class="dialog-footer">
  496. <el-button type="primary" @click="submitCodeForm">确 定</el-button>
  497. </div>
  498. </el-dialog>
  499. <!-- 大图预览对话框 -->
  500. <el-dialog
  501. :visible.sync="dialogVisible"
  502. :modal="false"
  503. width="1200"
  504. append-to-body>
  505. <img
  506. :src="this.dialogImageUrl"
  507. style="display: block; max-width: 100%; margin: 0 auto"
  508. />
  509. </el-dialog>
  510. <el-dialog
  511. :visible.sync="updateSendOpen"
  512. width="1000px"
  513. append-to-body>
  514. <el-form label-width="80px">
  515. <p>是否修改企微账号发送方式:
  516. <el-tag style="margin-left: 10px" v-for="name in names">{{ name }}</el-tag>
  517. </p>
  518. <el-form-item label="发送方式" prop="type">
  519. <el-radio-group v-model="type">
  520. <el-radio
  521. :label="0"
  522. >方式一
  523. </el-radio>
  524. <el-radio
  525. :label="1"
  526. >方式二
  527. </el-radio>
  528. <el-radio
  529. :label="2"
  530. >掉线通知
  531. </el-radio>
  532. </el-radio-group>
  533. </el-form-item>
  534. </el-form>
  535. <div slot="footer" class="dialog-footer">
  536. <el-button type="primary" @click="submitUpdateSendTypeForm">确 定</el-button>
  537. </div>
  538. </el-dialog>
  539. </div>
  540. </template>
  541. <script>
  542. import {
  543. updateIsAuto,
  544. updateUser,
  545. getMyQwCompanyList,
  546. relieveFastGptRoleById,
  547. loginQwIpad,
  548. loginQwCodeMsg,
  549. twoCode,
  550. twoCodeStatus,
  551. qrCodeStatus,
  552. updateSendType,
  553. getQwIpad,
  554. delQwIpad,
  555. qrCodeVerify,
  556. outLoginQwIpad,
  557. changeVideoStatus,
  558. handleAllocateRemoteHost,
  559. qwBindCloudHost,
  560. qwUnbindCloudHost,
  561. handleAuthAppKey,
  562. handleInputAuthAppKey,
  563. selectCloudAP,
  564. staffListUser,
  565. exportStaff,
  566. myStaffListUser,updateFastGptRoleStatusById
  567. } from '../../../api/qw/user'
  568. import fastGptRole from "@/views/fastGpt/fastGptRole/fastGptRole";
  569. export default {
  570. name: "myIndex",
  571. components: { fastGptRole},
  572. data() {
  573. return {
  574. isAutoOptions:[],
  575. updateIp:{
  576. open:false,
  577. title: "修改云主机IP"
  578. },
  579. updateIpForm:{
  580. id:null,
  581. newIp:null,
  582. },
  583. projectFrom:process.env.VUE_APP_PROJECT_FROM,
  584. authorizeKeyOpen:false,
  585. authorizeKeyFrom:{
  586. id:null,
  587. appKey:null,
  588. qwUserId:null,
  589. qwUserName:null
  590. },
  591. updateIpRule:{},
  592. newIp:null,
  593. //放大图片
  594. dialogImageUrl:null,
  595. dialogVisible:false,
  596. optionsStatus: [{
  597. value: 0,
  598. label: '正常'
  599. }, {
  600. value: 2,
  601. label: '离职'
  602. }],
  603. // 遮罩层
  604. loading: true,
  605. names: [],
  606. // 导出遮罩层
  607. exportLoading: false,
  608. // 选中数组
  609. ids: [],
  610. // 非单个禁用
  611. single: true,
  612. // 非多个禁用
  613. multiple: true,
  614. // 显示搜索条件
  615. showSearch: true,
  616. updateSendOpen: false,
  617. // 总条数
  618. total: 0,
  619. //公司列表
  620. myQwCompanyList:[],
  621. // 企微用户表格数据
  622. userList: [],
  623. allowSelectOptions:[],
  624. // 弹出层标题
  625. bindAiTitle: "",
  626. bindAiOpen: false,
  627. qwLogin:{
  628. title:"",
  629. open:false,
  630. codeUrl:null,
  631. code:null,
  632. appKey:null,
  633. },
  634. qwLoginTwo:{
  635. title:"",
  636. open:false,
  637. codeUrl:null,
  638. code:null,
  639. appKey:null,
  640. },
  641. qwCode:{
  642. title:"",
  643. open:false,
  644. code:null,
  645. },
  646. cloudAPOpen:{
  647. open:false,
  648. admin:null,
  649. passWord:null,
  650. },
  651. callOpen:{
  652. open:false,
  653. title: '修改员工称呼',
  654. },
  655. callOpenFrom:{
  656. id:null,
  657. welcomeText:null,
  658. },
  659. isAutoForm:{
  660. id:null,
  661. isAuto:null,
  662. },
  663. editRemarkOpen: {
  664. open: false,
  665. title: '修改员工自动给完课客户打备注的规则',
  666. id:null,
  667. isSendMsg:null,
  668. },
  669. twoCodeInterval:null,
  670. type: 0,
  671. loginQwInterval:null,
  672. imageLoading: true, // 控制加载状态
  673. // 查询参数
  674. queryParams: {
  675. pageNum: 1,
  676. pageSize: 10,
  677. qwUserId: null,
  678. loginStatus: null,
  679. corpId: null,
  680. qwUserName: null,
  681. },
  682. loginStatusOption: [{
  683. value: 0,
  684. label: '离线'
  685. }, {
  686. value: 1,
  687. label: '在线'
  688. }],
  689. qwUserId:null,
  690. companyUserList:[],
  691. // 表单参数
  692. form: {
  693. isSendMsg: '2',
  694. },
  695. authorizeKeyRule:{
  696. appKey:[{required:true,message:"授权码不能为空",trigger:"blur"}]
  697. },
  698. callOpenRule:{
  699. welcomeText:[{required:true,message:"员工称呼不能为空",trigger:"blur"}]
  700. },
  701. // 表单校验
  702. rules: {
  703. },
  704. //欢迎语表单校验
  705. weclomeRules:{
  706. welcomeText:[{required:true,message:"消息文本不能为空",trigger:"blur"}]
  707. },
  708. };
  709. },
  710. created() {
  711. this.getDicts("qw_user_is_auto").then(response => {
  712. this.isAutoOptions = response.data;
  713. });
  714. getMyQwCompanyList().then(response => {
  715. this.myQwCompanyList = response.data;
  716. if(this.myQwCompanyList!=null){
  717. this.queryParams.corpId=this.myQwCompanyList[0].dictValue;
  718. this.getList();
  719. }
  720. });
  721. },
  722. watch: {
  723. // 监听弹窗的可见性变化
  724. 'qwLogin.open'(newVal) {
  725. if (!newVal) {
  726. // 如果弹窗关闭,清除定时器
  727. clearInterval(this.loginQwInterval);
  728. }
  729. },
  730. },
  731. methods: {
  732. getList() {
  733. this.loading = true;
  734. myStaffListUser(this.queryParams).then(response => {
  735. this.userList = response.rows;
  736. this.total = response.total;
  737. this.loading = false;
  738. });
  739. },
  740. updateCorpId() {
  741. this.reset();
  742. this.getList();
  743. },
  744. changeVideoStatus(val){
  745. changeVideoStatus(val.id).then(res => {
  746. this.$message.success("修改状态成功");
  747. this.getList()
  748. })
  749. },
  750. //绑定AI客服
  751. bindFastGptRole(row) {
  752. this.bindAiTitle = "绑定AI客服";
  753. this.bindAiOpen = true;
  754. setTimeout(() => {
  755. this.$refs.fastGptRole.handleBindAiData(row)
  756. }, 200);
  757. },
  758. handleAppellation(val) {
  759. this.callOpen.open = true;
  760. this.callOpenFrom.welcomeText = val.welcomeText;
  761. this.callOpenFrom.id = val.id;
  762. },
  763. handleAutoRemark(val) {
  764. this.editRemarkOpen.open = true;
  765. this.editRemarkOpen.id = val.id;
  766. this.editRemarkOpen.isSendMsg = val.isSendMsg;
  767. },
  768. //登录
  769. handleLoginQwCode(val) {
  770. if (val.appKey == null || val.appKey === '') {
  771. return this.$message.warning("没有授权码,无法登录企业微信,请授权");
  772. }
  773. loginQwIpad({qwUserId: val.id}).then(res => {
  774. this.qwUserId = val.id;
  775. this.qwLogin.code = null;
  776. this.imageLoading = false;
  777. console.log(res)
  778. if (res.msg == "success") {
  779. this.qwLogin.codeUrl = res.qrCode64
  780. this.qwLogin.open = true;
  781. this.loginQwPolling();
  782. } else {
  783. this.$message.success(res.msg);
  784. this.getList()
  785. }
  786. })
  787. },
  788. handleTwoCode(val) {
  789. twoCode({qwUserId: val.id}).then(res => {
  790. console.log(res)
  791. this.qwLoginTwo.open = true;
  792. this.qwLoginTwo.codeUrl = res.qrCode
  793. });
  794. },
  795. twoCodePolling() {
  796. this.twoCodeInterval = setInterval(() => {
  797. twoCodeStatus({qwUserId: this.qwUserId}).then(res => {
  798. console.log(res)
  799. if (res.msg == 104001) {
  800. this.$message.success('登录成功');
  801. this.clearDl()
  802. clearInterval(this.loginQwInterval);
  803. } else if (res.msg == 100004) {
  804. this.clearDl()
  805. }
  806. });
  807. }, 3000);
  808. },
  809. loginQwPolling() {
  810. this.loginQwInterval = setInterval(() => {
  811. qrCodeStatus({qwUserId: this.qwUserId}).then(res => {
  812. console.log(res)
  813. if (res.msg == 22) {
  814. this.$message.success('账号企业不一致请重新扫码登录');
  815. this.clearDl();
  816. }
  817. if (res.msg == 104001) {
  818. this.$message.success('登录成功');
  819. this.clearDl()
  820. } else if (res.msg == 100004) {
  821. this.qwCode.open = true;
  822. clearInterval(this.loginQwInterval);
  823. }
  824. });
  825. }, 3000);
  826. },
  827. submitCodeForm() {
  828. qrCodeVerify({code: this.qwCode.code, qwUserId: this.qwUserId}).then(res => {
  829. console.log(res)
  830. this.$message.success('验证成功账号信息确认中。。。。');
  831. this.qwCode.open = false;
  832. this.loginQwInterval = setTimeout(() => {
  833. qrCodeStatus({qwUserId: this.qwUserId}).then(res => {
  834. console.log(res);
  835. if (res.msg == 23) {
  836. this.$message.error('账号不一致请重新扫码登录');
  837. this.clearDl();
  838. }
  839. if (res.msg == 22) {
  840. this.$message.error('账号企业不一致请重新扫码登录');
  841. this.clearDl();
  842. }
  843. if (res.msg == 104001) {
  844. this.$message.success('登录成功');
  845. this.clearDl();
  846. }
  847. });
  848. }, 4000);
  849. });
  850. },
  851. clearDl() {
  852. this.qwCode.open = false;
  853. this.qwLogin.open = false;
  854. clearInterval(this.loginQwInterval);
  855. this.getList()
  856. },
  857. //退出
  858. handleLoginOutQwStatus(val) {
  859. outLoginQwIpad({qwUserId: val.id}).then(res => {
  860. this.$message.success("退出登录成功");
  861. this.getList()
  862. })
  863. },
  864. handleGetQwIpad(val) {
  865. getQwIpad({qwUserId: val.id}).then(res => {
  866. this.$message.success("获取主机成功");
  867. this.getList();
  868. }).catch(error => {
  869. console.log(error);
  870. if (error.code === 501) {
  871. this.$confirm(
  872. '当前区域没有多余的名额,将为你分配异地名额,会导致企业微信需要扫脸重新登录,并且半个小时后需要进行验证',
  873. '提示',
  874. {
  875. confirmButtonText: '确定',
  876. cancelButtonText: '取消',
  877. type: 'warning',
  878. dangerouslyUseHTMLString: true
  879. }
  880. ).then(() => {
  881. return handleAllocateRemoteHost({qwUserId: val.id});
  882. }).then(res => {
  883. this.$message.success('异地主机分配成功');
  884. this.getList();
  885. }).catch(() => {
  886. this.$message.info('已取消异地主机分配');
  887. });
  888. } else {
  889. this.$message.error('获取主机失败');
  890. }
  891. });
  892. },
  893. handleDelQwIpad(val) {
  894. delQwIpad({qwUserId: val.id}).then(res => {
  895. this.$message.success("解绑主机成功");
  896. }).finally(res => {
  897. this.getList();
  898. })
  899. },
  900. handleUpdateIsAuto(val,code) {
  901. this.isAutoForm={
  902. id:val.id,
  903. isAuto:code
  904. }
  905. updateIsAuto(this.isAutoForm).then(res => {
  906. if (code==='00'){
  907. this.$message.success('禁用成功');
  908. }else {
  909. this.$message.success('启用成功');
  910. }
  911. this.getList();
  912. });
  913. },
  914. //传验证码
  915. handleLoginQwCodeMsg() {
  916. loginQwCodeMsg({appKey: this.qwLogin.appKey, code: this.qwLogin.code}).then(res => {
  917. this.qwLogin.open = false;
  918. this.$message.success("登录成功");
  919. })
  920. },
  921. validateCode() {
  922. // 只允许输入数字并限制长度为6
  923. this.qwLogin.code = this.qwLogin.code.replace(/\D/g, "").slice(0, 6);
  924. },
  925. handleCloudAP(urlAP) {
  926. selectCloudAP({ipAddress: urlAP}).then(res => {
  927. this.cloudAPOpen.open = true
  928. this.cloudAPOpen.admin = res.data.apAdmin;
  929. this.cloudAPOpen.passWord = res.data.apPassword;
  930. })
  931. },
  932. handleUnbindCloudHost(val) {
  933. const appKey = val.appKey;
  934. this.$confirm(
  935. '确定要给企微账号:<span style="color: green;">' + val.qwUserId + '' +
  936. '</span><br>企微昵称:<span style="color: red;">【' + val.qwUserName + '】</span>' +
  937. '</span><br><span style="color: orange;">解绑【Ps:解绑后此云主机可能会分配给他人】</span></span>',
  938. "警告",
  939. {
  940. confirmButtonText: "确定",
  941. cancelButtonText: "取消",
  942. type: "warning",
  943. dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
  944. }
  945. ).then(() => {
  946. return qwUnbindCloudHost(appKey);
  947. }).then(response => {
  948. this.$message.success('解绑成功');
  949. }).finally(res => {
  950. this.getList();
  951. })
  952. },
  953. handleAuthorizeKey(val) {
  954. this.authorizeKeyFrom.id = val.id;
  955. this.authorizeKeyFrom.qwUserId = val.qwUserId;
  956. this.authorizeKeyFrom.qwUserName = val.qwUserName;
  957. this.authorizeKeyOpen = true;
  958. },
  959. submitAuthorizeKeyForm() {
  960. this.$refs["authorizeKeyFrom"].validate(valid => {
  961. if (valid) {
  962. if (this.authorizeKeyFrom.id != null && this.authorizeKeyFrom.appKey != null) {
  963. this.uploadAuthorizeKey();
  964. }
  965. }
  966. });
  967. },
  968. submitCallOpenFrom() {
  969. this.$refs["callOpenFrom"].validate(valid => {
  970. if (valid) {
  971. if (this.callOpenFrom.id != null && this.callOpenFrom.welcomeText != null) {
  972. updateUser(this.callOpenFrom).then(res => {
  973. this.$message.success('修改成功');
  974. this.callOpen.open = false;
  975. this.getList();
  976. });
  977. }
  978. }
  979. });
  980. },
  981. submitEditRemarkOpenFrom() {
  982. if (this.editRemarkOpen.id != null && this.editRemarkOpen.isSendMsg != null) {
  983. updateUser(this.editRemarkOpen).then(res => {
  984. this.$message.success('修改成功');
  985. this.editRemarkOpen.open = false;
  986. this.getList();
  987. });
  988. } else {
  989. this.$message.error("请选择条件")
  990. }
  991. },
  992. uploadAuthorizeKey() {
  993. this.$confirm(
  994. '确定要给企微账号:<span style="color: green;">' + this.authorizeKeyFrom.qwUserId + '' +
  995. '</span><br>企微昵称:<span style="color: red;">【' + this.authorizeKeyFrom.qwUserName + '】</span>' +
  996. '</span><br>授权key:<span style="color: #04adf6;">【' + this.authorizeKeyFrom.appKey + '】</span>?',
  997. "警告",
  998. {
  999. confirmButtonText: "确定",
  1000. cancelButtonText: "取消",
  1001. type: "warning",
  1002. dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
  1003. }
  1004. ).then(() => {
  1005. this.authorizeKeyOpen = false;
  1006. return handleInputAuthAppKey(this.authorizeKeyFrom);
  1007. }).then(response => {
  1008. this.msgSuccess("授权key完成");
  1009. }).finally(res => {
  1010. this.resetAuthorizeKeyFrom();
  1011. this.getList();
  1012. })
  1013. },
  1014. uploadAuthorizeKey2(val) {
  1015. const id = val.id;
  1016. this.$confirm(
  1017. '确定要给企微账号:<span style="color: green;">' + val.qwUserId + '' +
  1018. '</span><br>企微昵称:<span style="color: red;">【' + val.qwUserName + '】</span>' +
  1019. '</span><br>授权key</span>?',
  1020. "警告",
  1021. {
  1022. confirmButtonText: "确定",
  1023. cancelButtonText: "取消",
  1024. type: "warning",
  1025. dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
  1026. }
  1027. ).then(() => {
  1028. return handleAuthAppKey({id: id});
  1029. }).then(response => {
  1030. this.msgSuccess("授权key完成");
  1031. }).finally(res => {
  1032. this.resetAuthorizeKeyFrom();
  1033. this.getList();
  1034. })
  1035. },
  1036. updateFastGptRoleStatus(row) {
  1037. this.$confirm('是否修改该销售的AI客服?', "警告", {
  1038. confirmButtonText: "确定",
  1039. cancelButtonText: "取消",
  1040. type: "warning"
  1041. }).then(function () {
  1042. return updateFastGptRoleStatusById(row.id);
  1043. }).then(() => {
  1044. this.getList();
  1045. this.msgSuccess("修改成功");
  1046. })
  1047. },
  1048. handleBindCloudHost(val) {
  1049. if (val.appKey == null || val.appKey == '') {
  1050. return this.$message.warning('没有授权码,无法绑定主机,请联系管理员');
  1051. }
  1052. const appKey = val.appKey;
  1053. this.$confirm(
  1054. '确定要给企微账号:<span style="color: green;">' + val.qwUserId + '' +
  1055. '</span><br>企微昵称:<span style="color: red;">【' + val.qwUserName + '】</span>' +
  1056. '</span><br><span style="color: dodgerblue;">绑定云主机?</span></span>',
  1057. "警告",
  1058. {
  1059. confirmButtonText: "确定",
  1060. cancelButtonText: "取消",
  1061. type: "warning",
  1062. dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
  1063. }
  1064. ).then(() => {
  1065. return qwBindCloudHost(appKey);
  1066. }).then(response => {
  1067. this.$message.success('绑定成功,请登录云主机进行配置~~');
  1068. }).finally(res => {
  1069. this.getList();
  1070. })
  1071. },
  1072. openImageViewer(url) {
  1073. // 打开大图预览对话框
  1074. this.dialogImageUrl = url
  1075. this.dialogVisible = true;
  1076. },
  1077. //刷新页面
  1078. refreshFastGptList() {
  1079. this.bindAiOpen = false;
  1080. this.getList();
  1081. },
  1082. // 取消按钮
  1083. cancel() {
  1084. this.open = false;
  1085. this.reset();
  1086. },
  1087. // 表单重置
  1088. reset() {
  1089. this.form = {
  1090. id: null,
  1091. qwUserId: null,
  1092. corpId: null,
  1093. qwUserName: null,
  1094. };
  1095. this.resetForm("form");
  1096. },
  1097. //重置授权
  1098. resetAuthorizeKeyFrom() {
  1099. this.authorizeKeyFrom = {
  1100. id: null,
  1101. appKey: null,
  1102. qwUserId: null,
  1103. qwUserName: null
  1104. };
  1105. },
  1106. //重置登录
  1107. resetQwLogin() {
  1108. this.qwLogin = {
  1109. title: "",
  1110. open: false,
  1111. codeUrl: null,
  1112. code: null,
  1113. corpId: null,
  1114. qwUserId: null,
  1115. }
  1116. this.qwLogin.open = false;
  1117. this.loading = false;
  1118. this.getList();
  1119. },
  1120. //解绑AI客服
  1121. relieveFastGptRole(row) {
  1122. this.$confirm('是否确认解绑AI客服?', "警告", {
  1123. confirmButtonText: "确定",
  1124. cancelButtonText: "取消",
  1125. type: "warning"
  1126. }).then(function () {
  1127. return relieveFastGptRoleById(row.id);
  1128. }).then(() => {
  1129. this.getList();
  1130. this.msgSuccess("解绑成功");
  1131. })
  1132. },
  1133. /** 搜索按钮操作 */
  1134. handleQuery() {
  1135. this.queryParams.pageNum = 1;
  1136. this.getList();
  1137. },
  1138. /** 重置按钮操作 */
  1139. resetQuery() {
  1140. this.resetForm("queryForm");
  1141. this.queryParams.loginStatus = null;
  1142. this.queryParams.corpId = this.myQwCompanyList[0].dictValue;
  1143. this.handleQuery();
  1144. },
  1145. // 多选框选中数据
  1146. handleSelectionChange(selection) {
  1147. this.ids = selection.map(item => item.id)
  1148. this.names = selection.map(item => item.qwUserName)
  1149. this.single = selection.length !== 1
  1150. this.multiple = !selection.length
  1151. },
  1152. /** 提交按钮 */
  1153. submitForm() {
  1154. this.$refs["form"].validate(valid => {
  1155. if (valid) {
  1156. if (this.form.id != null) {
  1157. // updateUser(this.form).then(response => {
  1158. // this.msgSuccess("绑定成功");
  1159. // this.open = false;
  1160. // this.getList();
  1161. //
  1162. // });
  1163. } else {
  1164. // addUser(this.form).then(response => {
  1165. // this.msgSuccess("新增成功");
  1166. // this.open = false;
  1167. // this.getList();
  1168. // });
  1169. }
  1170. }
  1171. });
  1172. },
  1173. /** 导出按钮操作 */
  1174. handleExport() {
  1175. const queryParams = this.queryParams;
  1176. this.$confirm('是否确认导出所有企微员工数据项?', "警告", {
  1177. confirmButtonText: "确定",
  1178. cancelButtonText: "取消",
  1179. type: "warning"
  1180. }).then(() => {
  1181. this.exportLoading = true;
  1182. return exportStaff(queryParams);
  1183. }).then(response => {
  1184. this.download(response.msg);
  1185. this.exportLoading = false;
  1186. }).catch(() => {
  1187. });
  1188. },
  1189. updateSendType() {
  1190. this.updateSendOpen = true;
  1191. },
  1192. cleanUpdateSendType() {
  1193. this.updateSendOpen = false;
  1194. },
  1195. submitUpdateSendTypeForm(){
  1196. updateSendType({ids: this.ids, type: this.type}).then(e => {
  1197. this.updateSendOpen = false;
  1198. this.$message.success("修改成功");
  1199. this.getList();
  1200. });
  1201. },
  1202. }
  1203. };
  1204. </script>
  1205. <style>
  1206. .text-container {
  1207. max-height: 7.5em; /* 设置最大高度为6行,根据字体大小调整 */
  1208. overflow-y: auto; /* 内容超出时显示滚动条 */
  1209. line-height: 1.5em; /* 行高设置,确保每行高度一致 */
  1210. }
  1211. .qr-login-dialog .el-dialog__body {
  1212. display: flex;
  1213. flex-direction: column;
  1214. align-items: center;
  1215. text-align: center;
  1216. padding: 20px;
  1217. }
  1218. .qr-login-container {
  1219. width: 100%;
  1220. }
  1221. .qr-login-instructions {
  1222. font-size: 14px;
  1223. color: #666;
  1224. margin: 10px 0;
  1225. }
  1226. .verification-code-input {
  1227. margin-top: 15px;
  1228. width: 80%;
  1229. }
  1230. </style>