index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="任务名称" prop="name">
  5. <el-input
  6. v-model="queryParams.name"
  7. placeholder="请输入任务名称"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="机器人" prop="robot">
  14. <el-select v-model="queryParams.robot" filterable clearable>
  15. <el-option v-for="item in robotList" :label="item.name + '('+item.num+')'" :value="item.id"/>
  16. </el-select>
  17. </el-form-item>
  18. <el-form-item label="话术" prop="dialogId">
  19. <el-select v-model="queryParams.dialogId" filterable clearable>
  20. <el-option v-for="item in dialogList" :label="item.name" :value="item.id"/>
  21. </el-select>
  22. </el-form-item>
  23. <el-form-item>
  24. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  25. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  26. </el-form-item>
  27. </el-form>
  28. <el-row :gutter="10" class="mb8">
  29. <el-col :span="1.5">
  30. <el-button
  31. type="primary"
  32. icon="el-icon-plus"
  33. size="mini"
  34. @click="handleAdd"
  35. v-hasPermi="['system:companyVoiceRobotic:add']"
  36. >新增
  37. </el-button>
  38. </el-col>
  39. <el-col :span="1.5">
  40. <el-button
  41. type="danger"
  42. icon="el-icon-delete"
  43. size="mini"
  44. :disabled="multiple"
  45. @click="handleDelete"
  46. v-hasPermi="['system:companyVoiceRobotic:remove']"
  47. >删除
  48. </el-button>
  49. </el-col>
  50. <el-col :span="1.5">
  51. <el-button
  52. type="warning"
  53. icon="el-icon-download"
  54. size="mini"
  55. @click="handleExport"
  56. v-hasPermi="['system:companyVoiceRobotic:export']"
  57. >导出
  58. </el-button>
  59. </el-col>
  60. <el-col :span="1.5">
  61. <el-button
  62. type="success"
  63. icon="el-icon-refresh"
  64. size="mini"
  65. @click="updateStatusFun"
  66. v-hasPermi="['system:companyVoiceRobotic:list']"
  67. >更新状态
  68. </el-button>
  69. </el-col>
  70. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  71. </el-row>
  72. <el-table v-loading="loading" :data="roboticList" @selection-change="handleSelectionChange">
  73. <el-table-column type="selection" width="55" align="center"/>
  74. <el-table-column label="ID" align="center" prop="id"/>
  75. <el-table-column label="任务名称" align="center" prop="name"/>
  76. <el-table-column label="三方名称" align="center" prop="taskName"/>
  77. <el-table-column label="三方ID" align="center" prop="taskId"/>
  78. <el-table-column label="机器人" align="center" prop="robot">
  79. <template slot-scope="scope">
  80. <p v-for="(item, index) in robotList" v-if="scope.row.robot && scope.row.robot == item.id">{{item.name}}</p>
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="话术" align="center" prop="dialogId">
  84. <template slot-scope="scope">
  85. <p v-for="(item, index) in dialogList" v-if="scope.row.dialogId && scope.row.dialogId == item.id">{{item.name}}</p>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="加微方式" align="center" prop="dialogId">
  89. <template slot-scope="scope">
  90. <el-tag v-if="scope.row.addType == 0">平均</el-tag>
  91. <el-tag v-if="scope.row.addType == 1">意向</el-tag>
  92. </template>
  93. </el-table-column>
  94. <!-- <el-table-column label="星期" align="center" prop="weekDay1">-->
  95. <!-- <template slot-scope="scope">-->
  96. <!-- <el-tag v-for="(item, index) in weekList" v-if="scope.row.weekDay1 && scope.row.weekDay1.indexOf(item.value) != -1">{{item.label}}</el-tag>-->
  97. <!-- </template>-->
  98. <!-- </el-table-column>-->
  99. <!-- <el-table-column label="开始时间" align="center" prop="startTime1"/>-->
  100. <!-- <el-table-column label="结束时间" align="center" prop="endTime1"/>-->
  101. <el-table-column label="任务流程" align="center" width="230">
  102. <template slot-scope="scope">
  103. <div v-if="scope.row.taskFlow" v-model="scope.row.taskFlow.split(',')" class="flow-parent">
  104. <div v-for="(item, index) in scope.row.taskFlow.split(',')">
  105. <el-tag :type="scope.row.runTaskFlow != null && scope.row.runTaskFlow.split(',').indexOf(item) != -1 ? 'success' : 'warning'">{{ taskFlowMap[item] }}</el-tag>
  106. <i class="el-icon-arrow-right" v-if="index != 2"></i>
  107. </div>
  108. </div>
  109. </template>
  110. </el-table-column>
  111. <el-table-column label="任务状态" align="center">
  112. <template slot-scope="scope">
  113. <el-tag v-if="scope.row.taskStatus == 0">未启动</el-tag>
  114. <el-tag v-if="scope.row.taskStatus == 1" type="warning">执行中</el-tag>
  115. <el-tag v-if="scope.row.taskStatus == 2" type="danger">执行中断</el-tag>
  116. <el-tag v-if="scope.row.taskStatus == 3" type="success">执行完成</el-tag>
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="外呼状态" align="center">
  120. <template slot-scope="scope">
  121. <div v-loading="loadingStatus">
  122. <p v-if="statusObj.hasOwnProperty(scope.row.taskId)">
  123. <el-tag v-if="statusObj[scope.row.taskId].runningStatus == 0">未启动</el-tag>
  124. <el-tag v-if="statusObj[scope.row.taskId].runningStatus == 1">运行中</el-tag>
  125. <el-tag v-if="statusObj[scope.row.taskId].runningStatus == 2">已暂停</el-tag>
  126. <el-tag v-if="statusObj[scope.row.taskId].runningStatus == 3">已停止</el-tag>
  127. </p>
  128. <p v-if="!statusObj.hasOwnProperty(scope.row.taskId)"><el-tag>空</el-tag></p>
  129. </div>
  130. </template>
  131. </el-table-column>
  132. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  133. <template slot-scope="scope">
  134. <el-button
  135. size="mini"
  136. type="text"
  137. @click="calleesOpen(scope.row.id)"
  138. v-hasPermi="['system:companyVoiceRobotic:list']"
  139. >客户列表</el-button>
  140. <el-button
  141. size="mini"
  142. type="text"
  143. @click="wxOpen(scope.row.id)"
  144. v-hasPermi="['system:companyVoiceRobotic:list']"
  145. >加微管理</el-button>
  146. <el-button
  147. size="mini"
  148. type="text"
  149. v-if="scope.row.taskStatus == 0"
  150. @click="taskRunFun(scope.row.id)"
  151. >启动任务</el-button>
  152. <el-button
  153. size="mini"
  154. type="text"
  155. v-if="statusObj.hasOwnProperty(scope.row.taskId) && (statusObj[scope.row.taskId].runningStatus == 0 || statusObj[scope.row.taskId].runningStatus == 3)"
  156. @click="startRoboticFun(scope.row.taskId)"
  157. v-hasPermi="['system:companyVoiceRobotic:list']"
  158. >开启外呼任务</el-button>
  159. <el-button
  160. size="mini"
  161. type="text"
  162. v-if="statusObj.hasOwnProperty(scope.row.taskId) && (statusObj[scope.row.taskId].runningStatus == 1 || statusObj[scope.row.taskId].runningStatus == 2)"
  163. @click="stopRoboticFun(scope.row.taskId)"
  164. v-hasPermi="['system:companyVoiceRobotic:list']"
  165. >停止任务</el-button>
  166. <el-button
  167. size="mini"
  168. type="text"
  169. icon="el-icon-delete"
  170. @click="handleDelete(scope.row)"
  171. v-hasPermi="['system:companyVoiceRobotic:remove']"
  172. >删除
  173. </el-button>
  174. </template>
  175. </el-table-column>
  176. </el-table>
  177. <pagination
  178. v-show="total>0"
  179. :total="total"
  180. :page.sync="queryParams.pageNum"
  181. :limit.sync="queryParams.pageSize"
  182. @pagination="getList"
  183. />
  184. <!-- 添加或修改机器人外呼任务对话框 -->
  185. <el-drawer size="75%" :title="title" :visible.sync="open" width="500px" append-to-body>
  186. <div class="app-container">
  187. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  188. <el-form-item label="任务名称" prop="name">
  189. <el-input v-model="form.name" placeholder="请输入任务名称"/>
  190. </el-form-item>
  191. <el-form-item label="机器人" prop="robot">
  192. <el-select v-model="form.robot" filterable>
  193. <el-option v-for="item in robotList" :label="item.name + '('+item.num+')'" :value="item.id"/>
  194. </el-select>
  195. </el-form-item>
  196. <el-form-item label="话术" prop="dialogId">
  197. <el-select v-model="form.dialogId" filterable>
  198. <el-option v-for="item in dialogList" :label="item.name" :value="item.id"/>
  199. </el-select>
  200. </el-form-item>
  201. <el-form-item label="拨打客户" prop="userIds">
  202. <el-button @click="openSelect">选择客户({{ form.userIds ? form.userIds.length : 0 }})</el-button>
  203. </el-form-item>
  204. <el-form-item label="任务流程" prop="taskFlow">
  205. <draggable v-model="taskFlowList" @end="" class="flow-parent">
  206. <div class="flow-child" v-for="item in taskFlowList">
  207. <el-tag>{{ item.value }}</el-tag>
  208. <i class="el-icon-arrow-right"></i>
  209. </div>
  210. </draggable>
  211. </el-form-item>
  212. <el-form-item label="加微方式" prop="addType">
  213. <el-radio v-model="form.addType" :label="0">平均</el-radio>
  214. <el-radio v-model="form.addType" :label="1">意向</el-radio>
  215. </el-form-item>
  216. <el-form-item label="分配账号">
  217. <el-button @click="addQwUser">添加</el-button>
  218. <el-row :gutter="24" v-for="(item, index) in form.qwUser" style="margin-top: 5px">
  219. <el-col :span="5">
  220. <el-select v-model="item.intention" placeholder="意向等级" filterable clearable>
  221. <el-option v-for="item in levelList" :label="item.dictLabel" :value="item.dictValue"/>
  222. </el-select>
  223. </el-col>
  224. <el-col :span="4">
  225. <el-button @click="openQwUserSelect(index)">选择企微({{ item.companyUserId ? item.companyUserId.length : 0 }})</el-button>
  226. </el-col>
  227. <el-col :span="5">
  228. <el-select v-model="item.wxDialogId" placeholder="话术" filterable>
  229. <el-option v-for="item in wxDialogList" :label="item.name" :value="item.id"/>
  230. </el-select>
  231. </el-col>
  232. <el-col :span="3">
  233. <el-button type="danger" icon="el-icon-delete" circle @click="removeQwUser(index)"></el-button>
  234. </el-col>
  235. </el-row>
  236. </el-form-item>
  237. <el-form-item label="模式" prop="mode">
  238. <el-select v-model="form.mode">
  239. <el-option label="呼叫机器人后挂断" :value="7"/>
  240. </el-select>
  241. </el-form-item>
  242. <el-form-item label="呼叫倍率" prop="multiplier">
  243. <el-select v-model="form.multiplier">
  244. <el-option :value="1"/>
  245. <el-option :value="2"/>
  246. <el-option :value="3"/>
  247. <el-option :value="4"/>
  248. <el-option :value="5"/>
  249. </el-select>
  250. </el-form-item>
  251. <el-form-item label="自动重呼" prop="autoRecall">
  252. <el-radio v-model="form.autoRecall" :label="0">否</el-radio>
  253. <el-radio v-model="form.autoRecall" :label="1">是</el-radio>
  254. </el-form-item>
  255. <el-form-item label="重呼次数" prop="recallTimes" v-if="form.autoRecall == 1">
  256. <el-select v-model="form.recallTimes">
  257. <el-option label="不自动重呼" :value="0"/>
  258. <el-option :value="1"/>
  259. <el-option :value="2"/>
  260. <el-option :value="3"/>
  261. <el-option :value="4"/>
  262. <el-option :value="5"/>
  263. </el-select>
  264. </el-form-item>
  265. </el-form>
  266. <div slot="footer" class="dialog-footer">
  267. <el-button type="primary" @click="submitForm">确 定</el-button>
  268. <el-button @click="cancel">取 消</el-button>
  269. </div>
  270. </div>
  271. </el-drawer>
  272. <customer-select @success="selectFun" ref="customer"/>
  273. <qw-user-select @success="selectQwUserFun" ref="qwUserSelect"/>
  274. <el-drawer title="呼叫客户列表" size="60%" :visible.sync="callees.show" width="800px" append-to-body>
  275. <el-table v-loading="callees.loading" :data="callees.list">
  276. <el-table-column label="电话号码" align="center" prop="phone"/>
  277. <el-table-column label="客户名称" align="center" prop="userName"/>
  278. <el-table-column label="客户ID" align="center" prop="userId"/>
  279. <el-table-column label="客户意向度" align="center">
  280. <template slot-scope="scope">
  281. <el-tag v-for="item in levelList" v-if="scope.row.intention == item.dictValue">{{item.dictLabel}}</el-tag>
  282. </template>
  283. </el-table-column>
  284. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  285. <template slot-scope="scope">
  286. <el-button
  287. size="mini"
  288. type="text"
  289. @click="openCustomer(scope.row.userId)"
  290. >客户信息详情</el-button>
  291. </template>
  292. </el-table-column>
  293. </el-table>
  294. <pagination
  295. v-show="callees.total>0"
  296. :total="callees.total"
  297. :page.sync="callees.queryParams.pageNum"
  298. :limit.sync="callees.queryParams.pageSize"
  299. @pagination="getCalleesList"
  300. />
  301. </el-drawer>
  302. <el-drawer title="加微详情" size="60%" :visible.sync="wx.show" append-to-body>
  303. <el-table v-loading="wx.loading" :data="wx.list">
  304. <el-table-column label="意向等级" align="center" prop="intention"/>
  305. <el-table-column label="微信昵称" align="center" prop="wxNickName"/>
  306. <el-table-column label="微信号" align="center" prop="wxNo"/>
  307. <el-table-column label="手机号" align="center" prop="phone"/>
  308. <el-table-column label="员工名称" align="center" prop="companyUserName"/>
  309. <el-table-column label="话术" align="center" prop="dialogName"/>
  310. <el-table-column label="分配数量" align="center" prop="num"/>
  311. <el-table-column label="添加数量" align="center" prop="addNum"/>
  312. </el-table>
  313. <pagination
  314. v-show="wx.total>0"
  315. :total="wx.total"
  316. :page.sync="wx.queryParams.pageNum"
  317. :limit.sync="wx.queryParams.pageSize"
  318. @pagination="getWxList"
  319. />
  320. </el-drawer>
  321. <el-drawer size="75%" title="客户详情" :visible.sync="customerDetailShow" append-to-body>
  322. <customer-details ref="customerDetails" />
  323. </el-drawer>
  324. </div>
  325. </template>
  326. <script>
  327. import {
  328. listRobotic,
  329. getRobotic,
  330. delRobotic,
  331. addRobotic,
  332. updateRobotic,
  333. exportRobotic,
  334. calleesList,
  335. statusList,
  336. startRobotic,
  337. stopRobotic,
  338. companyUserList,
  339. wxList,
  340. taskRun,
  341. getTypes
  342. } from "@/api/company/companyVoiceRobotic";
  343. import draggable from 'vuedraggable'
  344. import { listAll } from '@/api/company/wxDialog';
  345. import customerSelect from '@/views/crm/components/CustomerSelect.vue';
  346. import qwUserSelect from '@/views/components/QwUserSelect.vue';
  347. import customerDetails from "@/views/crm/components/customerDetails.vue";
  348. import {clearTime} from "element-ui";
  349. import {getDicts} from "@/api/system/dict/data";
  350. export default {
  351. name: "Robotic",
  352. components: { draggable, customerDetails, customerSelect, qwUserSelect},
  353. data() {
  354. return {
  355. // 遮罩层
  356. loading: true,
  357. // 选中数组
  358. ids: [],
  359. weekList: [
  360. {label: "星期一", value: 1},
  361. {label: "星期二", value: 2},
  362. {label: "星期三", value: 3},
  363. {label: "星期四", value: 4},
  364. {label: "星期五", value: 5},
  365. {label: "星期六", value: 6},
  366. {label: "星期日", value: 0},
  367. ],
  368. // 非单个禁用
  369. single: true,
  370. // 非多个禁用
  371. multiple: true,
  372. // 显示搜索条件
  373. showSearch: true,
  374. loadingStatus: true,
  375. // 总条数
  376. total: 0,
  377. // 机器人外呼任务表格数据
  378. roboticList: [],
  379. userTableList: [],
  380. // 弹出层标题
  381. title: "",
  382. // 是否显示弹出层
  383. open: false,
  384. // 查询参数
  385. queryParams: {
  386. pageNum: 1,
  387. pageSize: 10,
  388. name: null,
  389. taskName: null,
  390. taskId: null,
  391. robot: null,
  392. dialogId: null,
  393. mode: null,
  394. multiplier: null,
  395. autoRecall: null,
  396. recallTimes: null,
  397. cidGroupId: null,
  398. weekDay1: null,
  399. startTime1: null,
  400. endTime1: null,
  401. weekDay2: null,
  402. startTime2: null,
  403. endTime2: null,
  404. createUser: null
  405. },
  406. // 表单参数
  407. form: {},
  408. taskFlowList: [{key: "cellPhone", value: "外呼"}, {key: "sendMsg", value: "发短信"}, {key: "addWx", value: "加微"}],
  409. taskFlowMap: {cellPhone: "外呼", sendMsg: "发短信", addWx: "加微"},
  410. statusObj: {},
  411. levelList: {},
  412. robotList: [],
  413. dialogList: [],
  414. wxDialogList: [],
  415. qwUserList: [],
  416. selectQwUserList: [],
  417. thisQwUserIndex: 0,
  418. updateTime: null,
  419. customer: {
  420. show: false,
  421. },
  422. customerDetailShow: false,
  423. callees: {
  424. show: false,
  425. list: [],
  426. loading: false,
  427. total: 0,
  428. queryParams:{
  429. id: null,
  430. pageNum: 1,
  431. pageSize: 10,
  432. },
  433. },
  434. wx: {
  435. show: false,
  436. list: [],
  437. loading: false,
  438. total: 0,
  439. queryParams:{
  440. id: null,
  441. pageNum: 1,
  442. pageSize: 10,
  443. },
  444. },
  445. // 表单校验
  446. rules: {}
  447. };
  448. },
  449. created() {
  450. getTypes().then(e => {
  451. this.robotList = e.robot;
  452. this.dialogList = e.dialog;
  453. })
  454. listAll().then(e => {
  455. this.wxDialogList = e.data;
  456. })
  457. companyUserList().then(e => {
  458. this.qwUserList = e.data;
  459. })
  460. getDicts("customer_intention_level").then(e => {
  461. this.levelList = e.data;
  462. })
  463. this.getList();
  464. },
  465. methods: {
  466. /** 查询机器人外呼任务列表 */
  467. getList() {
  468. this.loading = true;
  469. listRobotic(this.queryParams).then(response => {
  470. this.roboticList = response.rows;
  471. this.roboticList.forEach(e => {
  472. if(e.weekDay1){
  473. e.weekDay = e.weekDay1.split(",")
  474. }
  475. })
  476. this.total = response.total;
  477. this.loading = false;
  478. this.updateStatusFun();
  479. });
  480. },
  481. updateStatusFun(){
  482. if(!this.roboticList){
  483. return;
  484. }
  485. this.loadingStatus = true;
  486. statusList(this.roboticList.map(e => e.taskId).join()).then(e => {
  487. this.loadingStatus = false;
  488. this.statusObj = e.data;
  489. });
  490. },
  491. // 取消按钮
  492. cancel() {
  493. this.open = false;
  494. this.reset();
  495. },
  496. // 表单重置
  497. reset() {
  498. this.form = {
  499. id: null,
  500. name: null,
  501. taskName: null,
  502. taskId: null,
  503. robot: null,
  504. dialogId: null,
  505. mode: 7,
  506. multiplier: 3,
  507. autoRecall: 0,
  508. recallTimes: null,
  509. cidGroupId: null,
  510. weekDay1: null,
  511. startTime1: null,
  512. addType: 0,
  513. endTime1: null,
  514. weekDay2: null,
  515. startTime2: null,
  516. endTime2: null,
  517. createTime: null,
  518. qwUser: [],
  519. createUser: null
  520. };
  521. this.resetForm("form");
  522. },
  523. /** 搜索按钮操作 */
  524. handleQuery() {
  525. this.queryParams.pageNum = 1;
  526. this.getList();
  527. },
  528. /** 重置按钮操作 */
  529. resetQuery() {
  530. this.resetForm("queryForm");
  531. this.handleQuery();
  532. },
  533. // 多选框选中数据
  534. handleSelectionChange(selection) {
  535. this.ids = selection.map(item => item.id)
  536. this.single = selection.length !== 1
  537. this.multiple = !selection.length
  538. },
  539. /** 新增按钮操作 */
  540. handleAdd() {
  541. this.reset();
  542. this.open = true;
  543. this.title = "添加机器人外呼任务";
  544. },
  545. /** 修改按钮操作 */
  546. handleUpdate(row) {
  547. this.reset();
  548. const id = row.id || this.ids
  549. getRobotic(id).then(response => {
  550. this.form = response.data;
  551. this.open = true;
  552. this.title = "修改机器人外呼任务";
  553. });
  554. },
  555. /** 提交按钮 */
  556. submitForm() {
  557. this.$refs["form"].validate(valid => {
  558. if (valid) {
  559. if (this.form.weekDay && this.form.weekDay.length > 0) {
  560. this.form.weekDay1 = this.form.weekDay.join(",")
  561. }
  562. let list = [];
  563. this.form.qwUser.forEach(l => {
  564. list = list.concat(l.companyUserId.map(e => {return {intention: l.intention, companyUserId: e,wxDialogId: l.wxDialogId}}))
  565. })
  566. this.form.qwUserList = list;
  567. if(!this.form.qwUserList || this.form.qwUserList.length == 0){
  568. this.msgError("请选者加微方案");
  569. return;
  570. }
  571. this.form.taskFlow = this.taskFlowList.map(e => e.key).join();
  572. if (this.form.id != null) {
  573. updateRobotic(this.form).then(response => {
  574. if (response.code === 200) {
  575. this.msgSuccess("修改成功");
  576. this.open = false;
  577. this.getList();
  578. }
  579. });
  580. } else {
  581. addRobotic(this.form).then(response => {
  582. if (response.code === 200) {
  583. this.msgSuccess("新增成功");
  584. this.open = false;
  585. this.getList();
  586. }
  587. });
  588. }
  589. }
  590. });
  591. },
  592. /** 删除按钮操作 */
  593. handleDelete(row) {
  594. const ids = row.id || this.ids;
  595. this.$confirm('是否确认删除机器人外呼任务编号为"' + ids + '"的数据项?', "警告", {
  596. confirmButtonText: "确定",
  597. cancelButtonText: "取消",
  598. type: "warning"
  599. }).then(function () {
  600. return delRobotic(ids);
  601. }).then(() => {
  602. this.getList();
  603. this.msgSuccess("删除成功");
  604. }).catch(function () {
  605. });
  606. },
  607. /** 导出按钮操作 */
  608. handleExport() {
  609. const queryParams = this.queryParams;
  610. this.$confirm('是否确认导出所有机器人外呼任务数据项?', "警告", {
  611. confirmButtonText: "确定",
  612. cancelButtonText: "取消",
  613. type: "warning"
  614. }).then(function () {
  615. return exportRobotic(queryParams);
  616. }).then(response => {
  617. this.download(response.msg);
  618. }).catch(function () {
  619. });
  620. },
  621. openSelect() {
  622. this.$refs.customer.setRows(this.form.userTableList);
  623. },
  624. openQwUserSelect(index) {
  625. this.thisQwUserIndex = index;
  626. this.$nextTick(() => {
  627. this.$refs.qwUserSelect.setRows(this.selectQwUserList[index]);
  628. })
  629. },
  630. selectFun(e) {
  631. this.form.userIds = e.ids;
  632. this.form.userNames = e.names;
  633. this.form.userTableList = e.rows;
  634. this.$forceUpdate()
  635. },
  636. selectQwUserFun(e) {
  637. this.form.qwUser[this.thisQwUserIndex].companyUserId = e.ids;
  638. this.selectQwUserList[this.thisQwUserIndex] = e.rows;
  639. this.$forceUpdate()
  640. },
  641. calleesOpen(id){
  642. this.callees.show = true;
  643. this.callees.queryParams.id = id;
  644. this.getCalleesList();
  645. },
  646. getCalleesList() {
  647. this.callees.loading = true;
  648. calleesList(this.callees.queryParams).then(response => {
  649. this.callees.list = response.rows;
  650. this.callees.total = response.total;
  651. this.callees.loading = false;
  652. });
  653. },
  654. wxOpen(id){
  655. this.wx.show = true;
  656. this.wx.queryParams.id = id;
  657. this.getWxList();
  658. },
  659. getWxList() {
  660. this.wx.loading = true;
  661. wxList(this.wx.queryParams).then(response => {
  662. this.wx.list = response.rows;
  663. this.wx.total = response.total;
  664. this.wx.loading = false;
  665. });
  666. },
  667. openCustomer(id) {
  668. this.customerDetailShow=true;
  669. this.$nextTick(() => {
  670. this.$refs.customerDetails.getDetails(id);
  671. })
  672. },
  673. startRoboticFun(id){
  674. startRobotic(id).then(e => {
  675. this.updateStatusFun();
  676. })
  677. },
  678. taskRunFun(id){
  679. taskRun({id}).then(e => {
  680. this.getList();
  681. })
  682. },
  683. stopRoboticFun(id){
  684. stopRobotic(id).then(e => {
  685. this.updateStatusFun();
  686. })
  687. },
  688. addQwUser(){
  689. this.form.qwUser.push({});
  690. },
  691. removeQwUser(index){
  692. this.form.qwUser.splice(index, 1)
  693. }
  694. }
  695. };
  696. </script>
  697. <style>
  698. .flow-parent{
  699. display: flex;
  700. flex-wrap: nowrap;
  701. }
  702. .flow-child{
  703. position: relative;
  704. width: 150px;
  705. cursor: move;
  706. }
  707. .flow-child:last-child i{
  708. display: none;
  709. }
  710. .flow-child:last-child::after{
  711. display: none;
  712. }
  713. .flow-child i{
  714. right: 20px;
  715. top: 50%;
  716. transform: translateY(-50%);
  717. position: absolute;
  718. font-weight: bold;
  719. }
  720. .flow-child::after{
  721. content: "";
  722. border-top: 1px solid #000;
  723. height: 1px;
  724. width: 50px;
  725. right: 26px;
  726. top: 50%;
  727. transform: translateY(-50%);
  728. position: absolute;
  729. }
  730. .sortable-ghost{
  731. //background: #FFF !important;
  732. background: rgb(217, 236, 255) !important;
  733. }
  734. </style>