You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1777 lines
52 KiB

  1. <template>
  2. <div class="box-center">
  3. <!-- 头 -->
  4. <div class="app-top">
  5. <div class="app-titel" style="margin-top: 10px">
  6. <div class="div-lab">
  7. <!-- <div class="label">合同结束日期:</div> -->
  8. <div class="label" style="min-width: 80px">
  9. <el-select
  10. v-model="searchForm.timeType"
  11. placeholder="请选择"
  12. style="width: 100px"
  13. >
  14. <el-option
  15. v-for="item in timeTypeList"
  16. :key="item.value"
  17. :label="item.label"
  18. :value="item.value"
  19. >
  20. </el-option>
  21. </el-select>
  22. </div>
  23. <el-date-picker
  24. v-model="starTime"
  25. class="div-inp"
  26. @change="timeChange1"
  27. style="width: 250px"
  28. type="daterange"
  29. range-separator="-"
  30. :default-time="['00:00:00', '23:59:59']"
  31. value-format="yyyy-MM-dd"
  32. start-placeholder="开始日期"
  33. end-placeholder="结束日期"
  34. >
  35. </el-date-picker>
  36. </div>
  37. <div v-if="orgType == 0" class="div-lab">
  38. <div class="label">项目类型:</div>
  39. <el-select
  40. v-model="searchForm.houseType"
  41. placeholder="请选择"
  42. class="div-inp"
  43. filterable
  44. clearable
  45. >
  46. <el-option
  47. v-for="item in options"
  48. :key="item.value"
  49. :label="item.label"
  50. :value="item.value"
  51. >
  52. </el-option>
  53. </el-select>
  54. </div>
  55. <div class="div-lab">
  56. <div class="label">服务状态:</div>
  57. <el-select
  58. v-model="searchForm.serviceStatus"
  59. placeholder="请选择"
  60. class="div-inp"
  61. filterable
  62. clearable
  63. >
  64. <el-option
  65. v-for="item in options1"
  66. :key="item.value"
  67. :label="item.label"
  68. :value="item.value"
  69. >
  70. </el-option>
  71. </el-select>
  72. </div>
  73. <div class="div-lab">
  74. <div class="label">项目名称:</div>
  75. <el-select
  76. class="div-inp"
  77. v-model="searchForm.propertyName"
  78. filterable
  79. clearable
  80. @change="houseChange"
  81. placeholder="请选择项目"
  82. >
  83. <el-option
  84. v-for="item in houseList"
  85. :key="item.id"
  86. :label="item.propertyName"
  87. :value="item.propertyName"
  88. >
  89. </el-option>
  90. </el-select>
  91. </div>
  92. <div class="div-lab" v-show="isOpen">
  93. <div class="label">地区:</div>
  94. <el-cascader
  95. :props="props1"
  96. @change="locationsChange1"
  97. :options="addressOptions"
  98. placeholder="省/市"
  99. size="small"
  100. separator="/"
  101. v-model="area"
  102. filterable
  103. clearable
  104. ></el-cascader>
  105. </div>
  106. <div
  107. v-if="orgType == 0 || orgType == 1"
  108. class="div-lab"
  109. v-show="isOpen"
  110. >
  111. <div class="label">运营人员:</div>
  112. <el-select
  113. v-model="searchForm.operationStaffId"
  114. placeholder="请选择"
  115. class="div-inp"
  116. filterable
  117. clearable
  118. >
  119. <el-option
  120. v-for="item in operaList"
  121. :key="item.accountId"
  122. :label="item.name"
  123. :value="item.accountId"
  124. >
  125. </el-option>
  126. </el-select>
  127. </div>
  128. <div v-if="orgType == 0" class="div-lab" v-show="isOpen">
  129. <div class="label">代理商名称:</div>
  130. <el-input
  131. class="div-inp"
  132. maxlength="30"
  133. clearable
  134. v-model="searchForm.agentName"
  135. placeholder="请输入内容"
  136. >
  137. </el-input>
  138. </div>
  139. <div v-if="orgType != 2" class="div-lab" v-show="isOpen">
  140. <div class="label">公司名称:</div>
  141. <el-input
  142. class="div-inp"
  143. v-model="searchForm.corporateName"
  144. placeholder="请输入内容"
  145. maxlength="30"
  146. clearable
  147. >
  148. </el-input>
  149. </div>
  150. </div>
  151. <div class="app-titel" style="margin-top: 10px">
  152. <div class="label" style="color: #ffffff">筛选相关:</div>
  153. <div style="margin-left: 5px">
  154. <el-button @click="screen" type="primary">筛选</el-button>
  155. </div>
  156. <div style="margin-left: 20px">
  157. <el-button @click="empty" type="text">清空筛选条件</el-button>
  158. </div>
  159. <el-button style="margin-left: 10px" @click="isSystoleForm" type="text"
  160. >{{ isOpen ? "收起" : "展开"
  161. }}<i
  162. style="margin-left: 5px"
  163. :class="isOpen ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
  164. ></i
  165. ></el-button>
  166. <div style="margin-left: auto; margin-right: 20px" v-if="orgType != 2">
  167. <el-button v-if="cus_build_index_add" type="primary" @click="addHouse"
  168. >新增</el-button
  169. >
  170. </div>
  171. </div>
  172. </div>
  173. <!-- 表格 -->
  174. <div class="cen-tab">
  175. <avue-crud
  176. ref="crud"
  177. :page.sync="page"
  178. :data="tableData"
  179. :table-loading="tableLoading"
  180. :option="tableOption"
  181. :show-column.sync="showColumn"
  182. @size-change="handleSizeChange"
  183. @current-change="handleCurrentChange"
  184. >
  185. <template slot-scope="{ row }" slot="menu">
  186. <el-button type="text" v-if="cus_build_index_edit" @click="edit(row)"
  187. >编辑</el-button
  188. >
  189. <el-button
  190. type="text"
  191. v-if="orgType != 2 && cus_build_index_change"
  192. @click="changeAccount(row)"
  193. >更换账号
  194. </el-button>
  195. <el-dropdown>
  196. <el-button type="text" size="small" style="margin-left: 10px"
  197. >更多</el-button
  198. >
  199. <el-dropdown-menu slot="dropdown">
  200. <el-dropdown-item>
  201. <el-button
  202. type="text"
  203. size="small"
  204. v-if="cus_build_index_sys"
  205. @click="editOpera(row, 0)"
  206. >系统运营</el-button
  207. >
  208. </el-dropdown-item>
  209. <el-dropdown-item>
  210. <el-button
  211. type="text"
  212. size="small"
  213. v-if="cus_build_index_agent"
  214. @click="editOpera(row, 1)"
  215. >售后运营</el-button
  216. >
  217. </el-dropdown-item>
  218. <el-dropdown-item>
  219. <el-button
  220. type="text"
  221. size="small"
  222. v-if="cus_build_index_bindAgent"
  223. @click="bindAgent(row)"
  224. >绑定代理商</el-button
  225. >
  226. </el-dropdown-item>
  227. <el-dropdown-item>
  228. <el-button
  229. type="text"
  230. v-if="cus_build_index_del"
  231. @click="del(row)"
  232. >删除</el-button
  233. >
  234. </el-dropdown-item>
  235. <el-dropdown-item>
  236. <el-button
  237. type="text"
  238. v-if="cus_build_index_open"
  239. size="small"
  240. @click="toDisable(row)"
  241. >{{ row.lockFlag == 0 ? "禁用" : "启用" }}</el-button
  242. >
  243. </el-dropdown-item>
  244. <el-dropdown-item>
  245. <el-button
  246. type="text"
  247. v-if="permissions['cus_build_index_sug']"
  248. size="small"
  249. @click="toOtherPage(row)"
  250. >使用建议</el-button
  251. >
  252. </el-dropdown-item>
  253. </el-dropdown-menu>
  254. </el-dropdown>
  255. </template>
  256. </avue-crud>
  257. </div>
  258. <el-dialog
  259. :title="editFlag ? '编辑项目' : '新增项目'"
  260. :visible.sync="dialogVisible"
  261. @close="dialogClose"
  262. width="600px"
  263. center
  264. >
  265. <div
  266. style="padding: 0 10px;height: 500px; overflow-y: scroll"
  267. >
  268. <el-form
  269. :model="ruleForm"
  270. label-position="labelPosition"
  271. ref="ruleForm"
  272. label-width="150px"
  273. :rules="rules"
  274. >
  275. <el-form-item label="公司" prop="orgCode" v-if="orgType != 2">
  276. <el-select
  277. :disabled="editFlag == true"
  278. v-model="ruleForm.orgCode"
  279. filterable
  280. placeholder="请选择公司"
  281. >
  282. <el-option
  283. v-for="item in orgList"
  284. :key="item.id"
  285. :label="item.name"
  286. :value="item.orgCode"
  287. >
  288. </el-option>
  289. </el-select>
  290. </el-form-item>
  291. <el-form-item label="项目类型" prop="houseType" v-if="orgType != 2">
  292. <el-radio-group class="houseType" v-model="ruleForm.houseType">
  293. <el-radio :label="0">正式</el-radio>
  294. <el-radio :label="1">试用</el-radio>
  295. <el-radio :label="2">演示</el-radio>
  296. <el-radio :label="3">测试</el-radio>
  297. </el-radio-group>
  298. </el-form-item>
  299. <el-form-item label="项目名称" prop="propertyName">
  300. <el-input
  301. v-model="ruleForm.propertyName"
  302. placeholder="项目名称"
  303. maxlength="30"
  304. clearable
  305. ></el-input>
  306. </el-form-item>
  307. <el-form-item
  308. label="合同起止日期"
  309. prop="startWorking"
  310. v-if="orgType != 2"
  311. >
  312. <el-date-picker
  313. style="width:280px"
  314. v-model="time"
  315. @change="timeChange"
  316. type="daterange"
  317. range-separator="-"
  318. :default-time="['00:00:00', '23:59:59']"
  319. value-format="yyyy-MM-dd"
  320. start-placeholder="开始日期"
  321. end-placeholder="结束日期"
  322. >
  323. </el-date-picker>
  324. </el-form-item>
  325. <el-form-item label="日报推送时间" prop="time">
  326. <el-time-picker
  327. style="width:280px"
  328. v-model="ruleForm.time"
  329. format="HH:mm"
  330. value-format="HH:mm"
  331. placeholder="日报推送时间"
  332. >
  333. </el-time-picker>
  334. </el-form-item>
  335. <el-form-item label="项目离线推送时间" prop="offLine">
  336. <el-time-picker
  337. is-range
  338. style="width:280px"
  339. v-model="ruleForm.offLine"
  340. range-separator="-"
  341. start-placeholder="开始时间"
  342. end-placeholder="结束时间"
  343. placeholder="选择时间范围"
  344. value-format="HH:mm"
  345. format="HH:mm"
  346. >
  347. </el-time-picker>
  348. </el-form-item>
  349. <el-form-item label="优秀案例" prop="caseShow">
  350. <el-radio-group v-model="ruleForm.caseShow">
  351. <el-radio :label="0">全部可见</el-radio>
  352. <el-radio :label="1">团队可见</el-radio>
  353. </el-radio-group>
  354. </el-form-item>
  355. <el-form-item label="客户标签匹配" prop="tagMatching">
  356. <el-radio-group v-model="ruleForm.tagMatching">
  357. <el-radio :label="0">全部话术</el-radio>
  358. <el-radio :label="1">客户话术</el-radio>
  359. </el-radio-group>
  360. </el-form-item>
  361. <el-form-item label="短录音转写" prop="shortRecordingSetting">
  362. <el-radio-group v-model="ruleForm.shortRecordingSetting">
  363. <el-radio :label="0">转写</el-radio>
  364. <el-radio :label="1">不转写</el-radio>
  365. </el-radio-group>
  366. </el-form-item>
  367. <el-form-item label="无效接待审核" prop="auditReception">
  368. <el-radio-group v-model="ruleForm.auditReception">
  369. <el-radio :label="0">审核</el-radio>
  370. <el-radio :label="1">不审核</el-radio>
  371. </el-radio-group>
  372. </el-form-item>
  373. <el-form-item label="联系人" prop="linkman">
  374. <el-input
  375. v-model="ruleForm.linkman"
  376. maxlength="20"
  377. placeholder="联系人"
  378. clearable
  379. ></el-input>
  380. </el-form-item>
  381. <el-form-item label="接待时长" prop="linkman">
  382. <el-input
  383. v-model="ruleForm.closeTime"
  384. maxlength="10"
  385. placeholder="接待时长(分钟)"
  386. clearable
  387. ></el-input>
  388. </el-form-item>
  389. <el-form-item label="联系手机" prop="linkmanPhone">
  390. <el-input
  391. v-model="ruleForm.linkmanPhone"
  392. type="tel"
  393. placeholder="联系手机"
  394. maxlength="11"
  395. onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)));"
  396. ></el-input>
  397. </el-form-item>
  398. <el-form-item label="项目地区" prop="provinceId">
  399. <el-cascader
  400. :props="props"
  401. @change="locationsChange"
  402. :options="addressOptions"
  403. placeholder="省/市"
  404. size="small"
  405. separator="/"
  406. v-model="ruleForm.area"
  407. filterable
  408. clearable
  409. ></el-cascader>
  410. </el-form-item>
  411. <el-form-item label="详细地址" prop="address">
  412. <el-input
  413. v-model="ruleForm.address"
  414. placeholder="详细地址"
  415. type="textarea"
  416. maxlength="60"
  417. show-word-limit
  418. ></el-input>
  419. </el-form-item>
  420. <el-form-item label="管理员账号" prop="managerPhone" v-if="!editFlag">
  421. <el-input
  422. auto-complete="new-password"
  423. maxlength="11"
  424. placeholder="管理员账号"
  425. onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)));"
  426. v-model="ruleForm.managerPhone"
  427. >
  428. </el-input>
  429. </el-form-item>
  430. <el-form-item
  431. label="管理员密码"
  432. prop="managerPassword"
  433. v-if="!editFlag"
  434. >
  435. <el-input
  436. auto-complete="new-password"
  437. placeholder="管理员密码"
  438. v-model="ruleForm.managerPassword"
  439. maxlength="18"
  440. type="passsword"
  441. show-password
  442. :disabled="passFlag"
  443. ></el-input>
  444. </el-form-item>
  445. <el-form-item label="转写方式" prop="transliterationMethod">
  446. <div style="display:flex;align-items:center">
  447. <el-select style="width:150px" v-model="ruleForm.transliterationMethod" placeholder="请选择项目" @change="changeFun">
  448. <el-option v-for="(item,index) in projectList" :label="item.name" :key="index" :value="item.code"></el-option>
  449. </el-select>
  450. <el-select style="width:150px" v-model="ruleForm.language" placeholder="请选择语种">
  451. <el-option v-for="(item,index) in languageList" :label="item.name" :key="index" :value="item.code"></el-option>
  452. </el-select>
  453. </div>
  454. </el-form-item>
  455. </el-form>
  456. </div>
  457. <div
  458. slot="footer"
  459. class="dialog-footer"
  460. style="
  461. border-top: 1px solid #eee;
  462. padding-top: 20px;
  463. display: flex;
  464. justify-content: end;
  465. "
  466. >
  467. <el-button @click="addSurequxiao()">取 消</el-button>
  468. <el-button type="primary" :loading="loadingFlag" @click="addSure">
  469. 保存
  470. </el-button>
  471. </div>
  472. </el-dialog>
  473. <el-dialog
  474. title="更换账号"
  475. :visible.sync="changeFlag"
  476. @close="$refs.accountForm.resetFields()"
  477. width="400px"
  478. :center="true"
  479. >
  480. <el-form
  481. :model="accountForm"
  482. label-width="100px"
  483. ref="accountForm"
  484. :rules="accountRules"
  485. >
  486. <el-form-item label="管理员账号:" prop="managerPhone">
  487. <el-input
  488. style="width: 200px"
  489. maxlength="11"
  490. placeholder="管理员账号"
  491. v-model.number="accountForm.managerPhone"
  492. onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)));"
  493. ></el-input>
  494. </el-form-item>
  495. <el-form-item label="管理员密码:" prop="managerPassword">
  496. <el-input
  497. style="width: 200px"
  498. :disabled="passFlag"
  499. placeholder="管理员密码"
  500. show-password
  501. v-model="accountForm.managerPassword"
  502. >
  503. </el-input>
  504. </el-form-item>
  505. </el-form>
  506. <div
  507. style="
  508. border-top: 1px solid #eee;
  509. padding-top: 20px;
  510. display: flex;
  511. justify-content: end;
  512. "
  513. >
  514. <el-button @click="changeFlag = false">取 消</el-button>
  515. <el-button type="primary" @click="changeSure" :loading="loadingFlag"
  516. >确 定</el-button
  517. >
  518. </div>
  519. </el-dialog>
  520. <el-dialog
  521. :title="sysFlag == 0 ? '绑定系统运营' : '绑定售后运营'"
  522. :visible.sync="operaVisible"
  523. :center="true"
  524. >
  525. <el-form
  526. :model="operaForm"
  527. label-position="labelPosition"
  528. :rules="operaRules"
  529. ref="operaForm"
  530. label-width="140px"
  531. >
  532. <el-form-item label="运营人员:" prop="operationalPeople">
  533. <el-select
  534. v-model="operaForm.operationalPeople"
  535. filterable
  536. multiple
  537. style="width: 80%"
  538. placeholder="请选择"
  539. >
  540. <el-option
  541. v-for="item in optionsoperationalPeople"
  542. :key="item.value"
  543. :label="item.name"
  544. :value="item.accountId"
  545. >
  546. </el-option>
  547. </el-select>
  548. </el-form-item>
  549. </el-form>
  550. <div
  551. slot="footer"
  552. class="dialog-footer"
  553. style="
  554. border-top: 1px solid #eee;
  555. padding-top: 20px;
  556. display: flex;
  557. justify-content: end;
  558. "
  559. >
  560. <el-button @click="operaVisible = false">取 消</el-button>
  561. <el-button type="primary" :loading="loadingFlag" @click="saveOpera()"
  562. >保存</el-button
  563. >
  564. </div>
  565. </el-dialog>
  566. <el-dialog title="绑定代理商" :visible.sync="agentVisible" :center="true">
  567. <el-form
  568. :model="agentForm"
  569. label-position="labelPosition"
  570. :rules="agentRule"
  571. ref="agentForm"
  572. label-width="140px"
  573. >
  574. <el-form-item label="代理商:" prop="agentId">
  575. <el-select
  576. v-model="agentForm.agentId"
  577. style="width: 80%"
  578. filterable
  579. clearable
  580. placeholder="请选择"
  581. >
  582. <el-option
  583. v-for="item in optionsagentId"
  584. :key="item.id"
  585. :label="item.agentName"
  586. :value="item.id"
  587. >
  588. </el-option>
  589. </el-select>
  590. </el-form-item>
  591. </el-form>
  592. <div
  593. slot="footer"
  594. class="dialog-footer"
  595. style="
  596. border-top: 1px solid #eee;
  597. padding-top: 20px;
  598. display: flex;
  599. justify-content: end;
  600. "
  601. >
  602. <el-button @click="agentVisible = false">取 消</el-button>
  603. <el-button type="primary" :loading="loadingFlag" @click="saveAgent()"
  604. >保存</el-button
  605. >
  606. </div>
  607. </el-dialog>
  608. </div>
  609. </template>
  610. <script>
  611. import { mapGetters } from "vuex";
  612. import { getAreaList } from "@/api/modules/api";
  613. export default {
  614. data() {
  615. var validatePass = (rule, value, callback) => {
  616. if (value === "") {
  617. // callback(new Error("请输入手机号"));
  618. callback();
  619. } else {
  620. if (value) {
  621. if (!/^1[3456789]\d{9}$/.test(value)) {
  622. // alert("手机号码不合法,请重新输入");
  623. callback(new Error("手机号格式错误,请重新输入"));
  624. }
  625. }
  626. callback();
  627. }
  628. };
  629. var validatePass1 = (rule, value, callback) => {
  630. if (value === "") {
  631. callback(new Error("请输入管理员账号"));
  632. } else {
  633. if (value) {
  634. this.passFlag = false;
  635. if (!/^1[3456789]\d{9}$/.test(value)) {
  636. // alert("手机号码不合法,请重新输入");
  637. callback(new Error("手机号格式错误,请重新输入"));
  638. } else {
  639. // 验证电话号码
  640. this.$api.api.verPhone(value).then((res) => {
  641. // console.log(res);
  642. // 判断数据是否已经有了
  643. if (res.data) {
  644. // 由用户
  645. this.$api.api
  646. .userVerify({
  647. houseId: this.accountForm.id,
  648. orgType: 3,
  649. accountId: res.data.sysUser.accountId,
  650. username: res.data.sysUser.username,
  651. agentId: localStorage.getItem("agentId"),
  652. orgCode: localStorage.getItem("orgCode"),
  653. })
  654. .then((res1) => {
  655. this.resetFlag = true;
  656. this.passFlag = true;
  657. if (this.changeFlag) {
  658. this.accountForm.managerPassword =
  659. res.data.sysUser.resultPwd;
  660. } else {
  661. this.ruleForm.managerPassword =
  662. res.data.sysUser.resultPwd;
  663. }
  664. callback();
  665. })
  666. .catch((err) => {
  667. console.log(err);
  668. //
  669. this.resetFlag = false;
  670. callback(new Error(err));
  671. });
  672. } else {
  673. // 没有用户
  674. // console.log("没有用户");
  675. // callback(new Error("没有管理员账号"));
  676. if (this.changeFlag) {
  677. this.accountForm.managerPassword = "";
  678. } else {
  679. this.ruleForm.managerPassword = "";
  680. }
  681. this.resetFlag = true;
  682. this.passFlag = false;
  683. callback();
  684. }
  685. });
  686. }
  687. }
  688. callback();
  689. }
  690. };
  691. return {
  692. tableIdName: "buildingIndex", // 当前页面需要的变量
  693. tableOption: this.$tableOption.buildingIndex, // 当前table配置项
  694. tableLoading: false, // 监听的显示列的变量
  695. showColumn: [], // 监听的显示列的变量
  696. page: {
  697. total: this.total, // 总页数
  698. currentPage: 1, // 当前页数
  699. pageSize: this.size, // 每页显示多少条
  700. },
  701. isOpen: false,
  702. props: {
  703. lazy: true,
  704. // checkStrictly: true,
  705. async lazyLoad(node, resolve) {
  706. console.log(node, 123);
  707. const { level } = node;
  708. if (level == 0) {
  709. console.log(23);
  710. const { data } = await getAreaList({ parentId: 0 }); //获取省接口
  711. var nodes = data.map((item) => {
  712. return {
  713. value: item.id,
  714. label: item.name,
  715. leaf: false,
  716. };
  717. });
  718. resolve(nodes);
  719. } else if (level == 1) {
  720. const { data } = await getAreaList({ parentId: node.data.value }); //获取市接口
  721. var nodes = data.map((item) => {
  722. return {
  723. value: item.id,
  724. label: item.name,
  725. leaf: true,
  726. };
  727. });
  728. resolve(nodes);
  729. }
  730. },
  731. },
  732. props1: {
  733. lazy: true,
  734. checkStrictly: true,
  735. expandTrigger: "hover",
  736. async lazyLoad(node, resolve) {
  737. // console.log(node, 123);
  738. const { level } = node;
  739. if (level == 0) {
  740. console.log(23);
  741. const { data } = await getAreaList({ parentId: 0 }); //获取省接口
  742. var nodes = data.map((item) => {
  743. return {
  744. value: item.id,
  745. label: item.name,
  746. leaf: false,
  747. };
  748. });
  749. resolve(nodes);
  750. } else if (level == 1) {
  751. const { data } = await getAreaList({ parentId: node.data.value }); //获取市接口
  752. var nodes = data.map((item) => {
  753. return {
  754. value: item.id,
  755. label: item.name,
  756. leaf: true,
  757. };
  758. });
  759. resolve(nodes);
  760. } else {
  761. resolve();
  762. }
  763. },
  764. },
  765. area: [],
  766. editFlag: false,
  767. changeFlag: false,
  768. operaVisible: false,
  769. resetFlag: false,
  770. passFlag: false,
  771. starTime: [],
  772. searchForm: {
  773. corporateName: "",
  774. propertyName: "",
  775. provinceId: "",
  776. serviceStatus: "",
  777. houseType: "",
  778. timeType: "0",
  779. // residueTime: 7,
  780. startWorking: "",
  781. endWorking: "",
  782. agentName: "",
  783. operationalPeople: "",
  784. operationStaffId: "",
  785. },
  786. areaList: [],
  787. operaList: [],
  788. options1: [
  789. {
  790. value: "0",
  791. label: "服务中",
  792. },
  793. {
  794. value: "1",
  795. label: "已过期",
  796. },
  797. ],
  798. options: [
  799. {
  800. value: "0",
  801. label: "正式",
  802. },
  803. {
  804. value: "1",
  805. label: "试用",
  806. },
  807. {
  808. value: "2",
  809. label: "演示",
  810. },
  811. {
  812. value: "3",
  813. label: "测试",
  814. },
  815. ],
  816. timeTypeList: [
  817. {
  818. value: "0",
  819. label: "添加时间",
  820. },
  821. {
  822. value: "1",
  823. label: "合同结束日期",
  824. },
  825. ],
  826. value: "",
  827. input: "",
  828. sysFlag: "0",
  829. idx: "0",
  830. tableData: [],
  831. optionsoperationalPeople: [],
  832. orgType: "",
  833. orgList: [],
  834. operationList: [],
  835. dialogVisible: false,
  836. dialogVisible1: false,
  837. agentVisible: false,
  838. loadingFlag: false,
  839. time: [],
  840. addressOptions: [],
  841. accountForm: {
  842. managerPassword: "",
  843. managerPhone: "",
  844. },
  845. accountRules: {
  846. managerPhone: [
  847. { required: true, message: "请填写账号", trigger: "blur" },
  848. { validator: validatePass1, trigger: "blur" },
  849. ],
  850. managerPassword: [
  851. { required: true, message: "请填写密码", trigger: "blur" },
  852. {
  853. min: 6,
  854. max: 18,
  855. message: "请输入6~18位,数字或字母组合的密码",
  856. trigger: "blur",
  857. },
  858. ],
  859. },
  860. houseList: [], // 项目列表
  861. ruleForm: {
  862. orgCode: "", //公司标识
  863. houseType: 0, //项目类型
  864. propertyName: "", //项目名称
  865. startWorking: "", //活动开始时间
  866. endWorking: "", //活动结束时间
  867. linkman: "", //联系人
  868. linkmanPhone: "", //联系手机
  869. area: [], //项目地区
  870. address: "", //详细地址
  871. operationalPeople: "", //运营人员
  872. managerPhone: "", //管理员账号
  873. managerPassword: "", //密码
  874. provinceId: "", //省id
  875. cityId: "", //市id
  876. agentId: localStorage.getItem("agentId"),
  877. time: "22:00", // 日报推送时间
  878. closeTime: "120", // 接待时长(自动结束)
  879. offLine: ["08:00", "20:00"], // 离线推送时间段
  880. caseShow: 0, // 优秀案例
  881. tagMatching: 0, // 客户标签匹配
  882. transliterationMethod: '',//转写方式
  883. language:'',//语言
  884. shortRecordingSetting: 0, // 短录音是否转写 是否转写短录音 0 转写(默认) 1 不转写
  885. auditReception: 1, // 无效接待审核 0 审核 1不审核
  886. },
  887. ruleForm1: {},
  888. optionsagentId: [],
  889. rules: {
  890. orgCode: [{ required: true, message: "请选择公司", trigger: "blur" }],
  891. propertyName: [
  892. { required: true, message: "请填写项目名称", trigger: "change" },
  893. ],
  894. transliterationMethod: [
  895. { required: true, message: "请选择转写方式", trigger: "change" },
  896. ],
  897. managerPassword: [
  898. { required: true, message: "请填写密码", trigger: "blur" },
  899. {
  900. min: 6,
  901. max: 18,
  902. message: "请输入6~18位,数字或字母组合的密码",
  903. trigger: "blur",
  904. },
  905. ],
  906. startWorking: [
  907. { required: true, message: "请选择时间", trigger: "change" },
  908. ],
  909. time: [{ required: true, message: "请选择时间", trigger: "change" }],
  910. managerPhone: [
  911. { required: true, message: "请填写账号", trigger: "change" },
  912. { validator: validatePass1, trigger: "blur" },
  913. ],
  914. linkmanPhone: [{ validator: validatePass, trigger: "blur" }],
  915. provinceId: [
  916. { required: true, message: "请选择省市", trigger: "change" },
  917. ],
  918. offLine: [
  919. { required: true, message: "请选择离线推送时间", trigger: "change" },
  920. ],
  921. caseShow: [
  922. { required: true, message: "请选择优秀案例", trigger: "change" },
  923. ],
  924. tagMatching: [
  925. { required: true, message: "请选择客户标签匹配", trigger: "change" },
  926. ],
  927. },
  928. operaForm: {
  929. operationalPeople: "",
  930. },
  931. operaRules: {
  932. operationalPeople: [
  933. { required: false, message: "请选择运营人员", trigger: "blur" },
  934. ],
  935. },
  936. agentRule: {
  937. agentId: [{ required: true, message: "请选择代理商", trigger: "blur" }],
  938. },
  939. agentForm: {
  940. agentId: "",
  941. },
  942. projectList:[],//转写方式
  943. languageList:[]//语言
  944. };
  945. },
  946. computed: {
  947. ...mapGetters(["permissions"]),
  948. },
  949. watch: {
  950. showColumn(nowV) {
  951. let params = {
  952. tableIdName: this.tableIdName,
  953. optionData: nowV,
  954. };
  955. this.$db.upDate(params);
  956. },
  957. },
  958. created() {
  959. // 获取显隐的列表
  960. this.setTableOption();
  961. this.cus_build_index_add = this.permissions["cus_build_index_add"];
  962. this.cus_build_index_edit = this.permissions["cus_build_index_edit"];
  963. this.cus_build_index_change = this.permissions["cus_build_index_change"];
  964. this.cus_build_index_sys = this.permissions["cus_build_index_sys"];
  965. this.cus_build_index_agent = this.permissions["cus_build_index_agent"];
  966. this.cus_build_index_bindAgent = this.permissions["cus_build_index_bindAgent"];
  967. this.cus_build_index_del = this.permissions["cus_build_index_del"];
  968. this.cus_build_index_open = this.permissions["cus_build_index_open"];
  969. // 获取转写方式数据
  970. this.findTransferMethod()
  971. },
  972. mounted() {
  973. if (this.$route.query.serviceStatus) {
  974. this.starTime = this.$route.query.residueTime;
  975. this.searchForm.startWorking = this.starTime[0];
  976. this.searchForm.endWorking = this.starTime[1];
  977. this.searchForm.serviceStatus = this.$route.query.serviceStatus;
  978. this.searchForm.houseType = "0";
  979. this.searchForm.timeType = "1";
  980. }
  981. if (this.$route.query.time) {
  982. this.starTime = [this.$route.query.time, this.$route.query.time];
  983. this.searchForm.startWorking = this.starTime[0];
  984. this.searchForm.endWorking = this.starTime[1];
  985. }
  986. if (this.$route.query.types) {
  987. this.starTime = [
  988. this.$route.query.types.split(",")[0],
  989. this.$route.query.types.split(",")[1],
  990. ];
  991. this.searchForm.startWorking = this.starTime[0];
  992. this.searchForm.endWorking = this.starTime[1];
  993. }
  994. this.orgType = localStorage.getItem("orgType");
  995. // 检测某些字段是否可以展示
  996. this.checkOption();
  997. // 获取公司列表数据
  998. this.getOrgList();
  999. // 获取运营人员
  1000. this.getOperaList();
  1001. // this.getAllOperationsStaff();
  1002. // 获取地区列表
  1003. // this.getCityList();
  1004. // 获取列表数据
  1005. this.zkhousePage();
  1006. // 获取项目列表
  1007. this.zkhousePages();
  1008. },
  1009. methods: {
  1010. changeFun(value){
  1011. // console.log(value)
  1012. this.ruleForm.language = ''
  1013. this.projectList.forEach(item=>{
  1014. if(item.code==value){
  1015. this.languageList = item.list
  1016. this.ruleForm.language = this.languageList[0].code
  1017. }
  1018. })
  1019. },
  1020. // 转写方式
  1021. findTransferMethod(){
  1022. axios({
  1023. url: `autoSR/zkhouse/findTransferMethod`,
  1024. method: "get",
  1025. data: {
  1026. },
  1027. }).then((res) => {
  1028. // console.log(res)
  1029. if(res.code==0){
  1030. this.projectList = res.data||[]
  1031. this.languageList = res.data&&res.data[0].list||[]
  1032. }
  1033. });
  1034. },
  1035. // 获取当前页面的显隐
  1036. setTableOption() {
  1037. this.$db.getDataByKey(this.tableIdName).then((res) => {
  1038. console.log(res, "获取存储的res");
  1039. if (res.tableIdName == this.tableIdName) {
  1040. this.showColumn = res.optionData;
  1041. }
  1042. });
  1043. },
  1044. // 检测是否可以展示某些字段
  1045. checkOption() {
  1046. let checkArr = ["代理商", "公司", "运营人员", "项目类型"];
  1047. checkArr.forEach((item) => {
  1048. let index = this.$tableOption[this.tableIdName].column.findIndex(
  1049. (findObj) => item == findObj.label
  1050. );
  1051. if (index >= 0) {
  1052. let obj = this.$tableOption[this.tableIdName].column[index];
  1053. if (obj.label == "代理商" && this.orgType == 0) {
  1054. obj.hide = false;
  1055. obj.showColumn = true;
  1056. }
  1057. if (
  1058. (obj.label == "公司" || obj.label == "项目类型") &&
  1059. this.orgType != 2
  1060. ) {
  1061. obj.hide = false;
  1062. obj.showColumn = true;
  1063. }
  1064. if (
  1065. obj.label == "运营人员" &&
  1066. (this.orgType == 0 || this.orgType == 1)
  1067. ) {
  1068. obj.hide = false;
  1069. obj.showColumn = true;
  1070. }
  1071. }
  1072. });
  1073. },
  1074. isSystoleForm() {
  1075. this.isOpen = !this.isOpen;
  1076. },
  1077. //切换项目
  1078. houseChange() {
  1079. this.page.currentPage = 1;
  1080. this.zkhousePage();
  1081. },
  1082. //获取项目
  1083. zkhousePages() {
  1084. this.$api.api
  1085. .findHouseByUser({
  1086. orgType: localStorage.getItem("orgType"),
  1087. })
  1088. .then((res) => {
  1089. this.houseList = res.data;
  1090. });
  1091. },
  1092. getOperaList() {
  1093. if (this.orgType == 1) {
  1094. this.$api.http
  1095. .getAllOperationsStaffByAgent({
  1096. agentId: localStorage.getItem("agentId"),
  1097. })
  1098. .then((res) => {
  1099. // console.log(1);
  1100. this.operaList = res.data;
  1101. // this.operaVisible = true;
  1102. });
  1103. } else {
  1104. this.$api.http.getAllOperationsStaff().then((res) => {
  1105. this.operaList = res.data;
  1106. // this.operaVisible = true;
  1107. // console.log(2);
  1108. });
  1109. }
  1110. },
  1111. getCityList() {
  1112. this.$api.api.getAreaList({ parentId: 0 }).then((res) => {
  1113. // console.log(res,'地区列表');
  1114. this.areaList = res.data;
  1115. });
  1116. },
  1117. bindAgent(row) {
  1118. // console.log(row);
  1119. this.findMyAgent(row);
  1120. this.agentVisible = true;
  1121. },
  1122. saveAgent() {
  1123. this.$refs.agentForm.validate((valid) => {
  1124. if (valid) {
  1125. this.loadingFlag = true;
  1126. console.log(this.agentForm);
  1127. this.$api.api
  1128. .saveAgent({
  1129. agentId: this.agentForm.agentId,
  1130. id: this.agentForm.houseId,
  1131. })
  1132. .then((res) => {
  1133. setTimeout(() => {
  1134. this.loadingFlag = false;
  1135. console.log("防重");
  1136. }, 1);
  1137. this.$message.success("操作成功");
  1138. this.zkhousePage();
  1139. this.agentVisible = false;
  1140. })
  1141. .catch((err) => {
  1142. this.loadingFlag = false;
  1143. });
  1144. }
  1145. });
  1146. },
  1147. findMyAgent(row) {
  1148. this.$api.http.findMyAgent({ orgType: this.orgType }).then((res) => {
  1149. console.log(res.data);
  1150. this.optionsagentId = res.data;
  1151. this.agentForm.orgCode = row.orgCode;
  1152. this.agentForm.houseId = row.id;
  1153. this.agentForm.agentId = row.agentId;
  1154. });
  1155. },
  1156. saveOpera() {
  1157. this.$refs.operaForm.validate((valid) => {
  1158. if (valid) {
  1159. // console.log(valid,this.operaForm);
  1160. this.loadingFlag = true;
  1161. this.$api.api
  1162. .zkoperationrecordSaveHouse({
  1163. orgType: 3,
  1164. accountIds: this.operaForm.operationalPeople.join(","),
  1165. orgId: this.operaForm.orgId,
  1166. orgCode: this.operaForm.orgCode,
  1167. operationType: this.idx == 0 ? "1" : "2",
  1168. })
  1169. .then((res) => {
  1170. console.log(res);
  1171. setTimeout(() => {
  1172. this.loadingFlag = false;
  1173. console.log("防重");
  1174. }, 1);
  1175. this.$message.success("操作成功");
  1176. this.operaVisible = false;
  1177. this.zkhousePage();
  1178. })
  1179. .catch((err) => {
  1180. this.loadingFlag = false;
  1181. });
  1182. }
  1183. });
  1184. },
  1185. editOpera(row, idx) {
  1186. // console.log(row,idx);
  1187. // 获取运营人员列表
  1188. this.operaForm.orgId = row.id;
  1189. this.operaForm.orgCode = row.orgCode;
  1190. this.sysFlag = idx;
  1191. this.idx = idx;
  1192. this.AllOperationsStaff(idx, row);
  1193. this.zkoperationrecordFindByOrg(row.id, idx, row.agentId);
  1194. },
  1195. zkoperationrecordFindByOrg(orgId, idx, agentId) {
  1196. this.$api.api
  1197. .zkoperationrecordFindByOrg({
  1198. orgType: 3,
  1199. orgId,
  1200. agentId,
  1201. operationType: this.idx == 0 ? "1" : "2",
  1202. })
  1203. .then((res) => {
  1204. // console.log(res);
  1205. if (res.data.length == 0) {
  1206. // 没有运营人员
  1207. this.operaForm.operationalPeople = [];
  1208. } else {
  1209. let arr = [];
  1210. // 有运营
  1211. res.data.map((item) => {
  1212. arr.push(item.accountId);
  1213. });
  1214. this.operaForm.operationalPeople = arr;
  1215. }
  1216. });
  1217. },
  1218. //获取运营人员
  1219. AllOperationsStaff(idx, row) {
  1220. console.log(idx);
  1221. this.optionsoperationalPeople = [];
  1222. if (idx == 1) {
  1223. this.$api.http
  1224. .getAllOperationsStaffByAgent({
  1225. agentId: row.agentId,
  1226. })
  1227. .then((res) => {
  1228. this.optionsoperationalPeople = res.data;
  1229. this.operaVisible = true;
  1230. });
  1231. } else {
  1232. this.$api.http.getAllOperationsStaff().then((res) => {
  1233. this.optionsoperationalPeople = res.data;
  1234. this.operaVisible = true;
  1235. });
  1236. }
  1237. // this.$api.api.getAllOperationsStaffByAgent({agentId}).then((res) => {
  1238. // this.optionsoperationalPeople = res.data;
  1239. // });
  1240. },
  1241. screen() {
  1242. this.page.currentPage = 1;
  1243. this.zkhousePage();
  1244. },
  1245. addSurequxiao() {
  1246. this.dialogVisible = false;
  1247. },
  1248. // 添加项目this.ruleForm.closeTim
  1249. addSure() {
  1250. this.$refs.ruleForm.validate((valid) => {
  1251. if (valid) {
  1252. if (!this.resetFlag) {
  1253. return;
  1254. }
  1255. this.loadingFlag = true;
  1256. if (this.ruleForm.closeTime && this.ruleForm.closeTime < 30) {
  1257. this.$message.error("自动结束接待时长限制最小为30分钟");
  1258. this.loadingFlag = false;
  1259. return;
  1260. }
  1261. if (this.ruleForm.closeTime && this.ruleForm.closeTime > 720) {
  1262. this.$message.error("自动结束接待时长限制最大为720分钟");
  1263. this.loadingFlag = false;
  1264. return;
  1265. }
  1266. if (this.ruleForm.language=='') {
  1267. this.$message.error("请选择转写语言");
  1268. this.loadingFlag = false;
  1269. return;
  1270. }
  1271. this.ruleForm.offLine = this.ruleForm.offLine.join("~");
  1272. // 编辑
  1273. if (this.editFlag) {
  1274. this.$api.api
  1275. .editZkhouse(this.ruleForm)
  1276. .then((res) => {
  1277. if (res.code == 0) {
  1278. this.dialogVisible = false;
  1279. setTimeout(() => {
  1280. this.loadingFlag = false;
  1281. }, 1);
  1282. this.$message.success("编辑成功");
  1283. this.zkhousePage();
  1284. }
  1285. })
  1286. .catch((err) => {
  1287. this.loadingFlag = false;
  1288. });
  1289. } else {
  1290. // 添加
  1291. this.$api.api
  1292. .addZkhouse(this.ruleForm)
  1293. .then((res) => {
  1294. if (res.code == 0) {
  1295. this.dialogVisible = false;
  1296. setTimeout(() => {
  1297. this.loadingFlag = false;
  1298. }, 1);
  1299. this.$message.success("新增项目成功");
  1300. this.zkhousePage();
  1301. }
  1302. })
  1303. .catch((err) => {
  1304. this.loadingFlag = false;
  1305. });
  1306. }
  1307. }
  1308. });
  1309. },
  1310. // 跳转其他页面
  1311. toOtherPage(page) {
  1312. console.log(page);
  1313. this.$router.push({
  1314. path: "/suglist",
  1315. query: {
  1316. id: page.id,
  1317. },
  1318. });
  1319. },
  1320. toDisable(row) {
  1321. this.$confirm(
  1322. `确定${
  1323. row.lockFlag == 0
  1324. ? "禁用" + "-" + row.propertyName + "-"
  1325. : "启用" + "-" + row.propertyName + "-"
  1326. }项目吗?`,
  1327. "提示",
  1328. {
  1329. confirmButtonText: "确定",
  1330. cancelButtonText: "取消",
  1331. type: "warning",
  1332. }
  1333. )
  1334. .then(() => {
  1335. // return
  1336. // console.log(123);
  1337. this.$api.api
  1338. .editZkhouse({ id: row.id, lockFlag: row.lockFlag == 0 ? 1 : 0 })
  1339. .then((res) => {
  1340. if (res.code == 0) {
  1341. this.$message({
  1342. type: "success",
  1343. message: "操作成功!",
  1344. });
  1345. this.zkhousePage();
  1346. } else {
  1347. this.$message.error(res.message);
  1348. }
  1349. });
  1350. })
  1351. .catch((err) => {
  1352. // console.log('关闭');
  1353. // console.log(err);
  1354. });
  1355. },
  1356. dialogClose() {
  1357. this.restFrom();
  1358. },
  1359. restFrom() {
  1360. this.$refs.ruleForm.resetFields();
  1361. this.time = [];
  1362. this.ruleForm = {
  1363. orgCode: "", //公司标识
  1364. houseType: 0, //项目类型
  1365. propertyName: "", //项目名称
  1366. startWorking: "", //活动开始时间
  1367. endWorking: "", //活动结束时间
  1368. linkman: "", //联系人
  1369. linkmanPhone: "", //联系手机
  1370. area: [], //项目地区
  1371. address: "", //详细地址
  1372. operationalPeople: "", //运营人员
  1373. managerPhone: "", //管理员账号
  1374. managerPassword: "", //密码
  1375. provinceId: "", //省id
  1376. cityId: "", //市id
  1377. agentId: localStorage.getItem("agentId"),
  1378. time: "22:00", // 日报推送时间
  1379. closeTime: "120", // 接待时长(自动结束)
  1380. offLine: ["08:00", "20:00"], // 离线推送时间段
  1381. caseShow: 0, // 优秀案例
  1382. tagMatching: 0, // 客户标签匹配
  1383. };
  1384. },
  1385. // 新增项目,弹框显示
  1386. addHouse() {
  1387. this.editFlag = false;
  1388. this.dialogVisible = true;
  1389. this.passFlag = false;
  1390. },
  1391. edit(row) {
  1392. console.log(row);
  1393. this.resetFlag = true;
  1394. this.time = [
  1395. row.startWorking.substring(0, 10),
  1396. row.endWorking.substring(0, 10),
  1397. ];
  1398. // console.log(this.time)
  1399. this.ruleForm = Object.assign({}, row);
  1400. this.ruleForm.shortRecordingSetting = row.shortRecordingSetting || 0
  1401. this.ruleForm.area = [this.ruleForm.provinceId, this.ruleForm.cityId];
  1402. this.ruleForm.time = row.time || "22:00";
  1403. if (row.offLine && row.offLine.indexOf('~') != -1) {
  1404. this.ruleForm.offLine = row.offLine.split('~')
  1405. }
  1406. if(row.transliterationMethod){
  1407. this.projectList.forEach(item=>{
  1408. if(item.code==row.transliterationMethod){
  1409. this.languageList = item.list
  1410. }
  1411. })
  1412. }else{
  1413. }
  1414. this.editFlag = true;
  1415. this.dialogVisible = true;
  1416. this.$forceUpdate();
  1417. },
  1418. // 更换账号
  1419. changeAccount(row) {
  1420. this.changeFlag = true;
  1421. this.passFlag = false;
  1422. this.accountForm.id = row.id;
  1423. },
  1424. changeSure() {
  1425. if (!this.resetFlag) {
  1426. this.$message.error("平台用户与项目用户不能重复添加!");
  1427. return;
  1428. }
  1429. this.$refs.accountForm
  1430. .validate((valid) => {
  1431. if (valid) {
  1432. this.loadingFlag = true;
  1433. this.$api.api.updateManagerPhone(this.accountForm).then((res) => {
  1434. if (res.code == 0) {
  1435. this.changeFlag = false;
  1436. setTimeout(() => {
  1437. this.loadingFlag = false;
  1438. }, 1);
  1439. this.$message.success("编辑成功");
  1440. this.zkhousePage();
  1441. }
  1442. });
  1443. }
  1444. })
  1445. .catch((err) => {
  1446. this.loadingFlag = false;
  1447. });
  1448. },
  1449. del(row) {
  1450. console.log(row, "删除");
  1451. this.$confirm(`是否删除此项目?`, "提示", {
  1452. confirmButtonText: "确定",
  1453. cancelButtonText: "取消",
  1454. distinguishCancelAndClose: true,
  1455. type: "warning",
  1456. }).then(() => {
  1457. axios({
  1458. url: `/autoSR/zkhouse/${row.id}`,
  1459. method: "delete",
  1460. // params: {
  1461. // id: row.id,
  1462. // },
  1463. }).then((res) => {
  1464. if (res.code == 0) {
  1465. this.$message.success("删除成功");
  1466. this.zkhousePage();
  1467. } else {
  1468. this.$message.warning(res.resMsg);
  1469. }
  1470. });
  1471. });
  1472. },
  1473. // 时间改变
  1474. timeChange(e) {
  1475. console.log(e);
  1476. this.ruleForm.startWorking = e[0];
  1477. this.ruleForm.endWorking = e[1];
  1478. },
  1479. // 获取公司列表
  1480. getOrgList() {
  1481. this.$api.api
  1482. .getCompanyList({
  1483. orgType: this.orgType,
  1484. agentId: localStorage.getItem("agentId"),
  1485. })
  1486. .then((res) => {
  1487. if (res.code == 0) {
  1488. this.orgList = res.data;
  1489. }
  1490. });
  1491. },
  1492. // 获取运营人员地址
  1493. getAllOperationsStaff() {
  1494. this.$api.api.getAllOperationsStaff().then((res) => {
  1495. console.log(res);
  1496. if (res.code == 0) {
  1497. this.operationList = res.data;
  1498. }
  1499. });
  1500. },
  1501. // 获取项目列表
  1502. zkhousePage() {
  1503. let obj = {
  1504. current: this.page.currentPage,
  1505. size: this.page.pageSize,
  1506. orgType: localStorage.getItem("orgType"),
  1507. agentId: localStorage.getItem("agentId"),
  1508. orgCode: localStorage.getItem("orgCode"),
  1509. operationType:
  1510. localStorage.getItem("orgType") == 0
  1511. ? "1"
  1512. : localStorage.getItem("orgType") == 1
  1513. ? "2"
  1514. : "",
  1515. ...this.searchForm,
  1516. };
  1517. if (this.orgType == 0) {
  1518. obj.residueTime = null;
  1519. }
  1520. this.$api.api.zkhousePage(obj).then((res) => {
  1521. // console.log(res)
  1522. this.tableData = res.data.records;
  1523. this.page.total = res.data.total;
  1524. this.$nextTick(() => {
  1525. this.$refs.crud.doLayout();
  1526. });
  1527. });
  1528. },
  1529. async getProvinceList(parentId = 0) {
  1530. let _this = this;
  1531. this.addressOptions = [];
  1532. let res = await getAreaList({ parentId });
  1533. // console.log(res);
  1534. // 当他没有值时给addressOptions赋值,这是第一个数组
  1535. if (res.code == 0) {
  1536. // _this.$set(_this, 'addressOptions',_this.ruleForm.cityIds&&_this.ruleForm.provinceId ? this.loadOptions(res.data||[] ):res.data)
  1537. let arr = [];
  1538. res.data.map((item) => {
  1539. let obj = {};
  1540. obj.value = item.id;
  1541. obj.label = item.name;
  1542. obj.leaf = false;
  1543. obj.children = [];
  1544. arr.push(obj);
  1545. });
  1546. this.addressOptions = arr;
  1547. this.loadOptions();
  1548. }
  1549. },
  1550. loadOptions() {
  1551. // console.log(this.addressOptions);
  1552. this.addressOptions.map((item, idx) => {
  1553. if (item.value == this.ruleForm.provinceId) {
  1554. console.log("有匹配项");
  1555. getAreaList({ parentId: this.ruleForm.provinceId }).then((res) => {
  1556. if (res.code == 0) {
  1557. let arr = [];
  1558. res.data.map((item1) => {
  1559. let obj = {};
  1560. obj.value = item1.id;
  1561. obj.label = item1.name;
  1562. obj.leaf = true;
  1563. arr.push(obj);
  1564. });
  1565. this.$set(this.addressOptions[idx], "children", arr);
  1566. // console.log(this.addressOptions[idx], "123");
  1567. this.addressOptions = Object.assign([], this.addressOptions);
  1568. this.area = null;
  1569. setTimeout(() => {
  1570. this.ruleForm.area = [
  1571. this.ruleForm.provinceId,
  1572. this.ruleForm.cityId,
  1573. ];
  1574. // console.log(1);
  1575. // console.log(this.addressOptions);
  1576. // console.log(this.area);
  1577. this.$forceUpdate();
  1578. }, 50);
  1579. }
  1580. });
  1581. }
  1582. this.dialogVisible = true;
  1583. });
  1584. },
  1585. empty() {
  1586. this.starTime = [];
  1587. this.searchForm = {
  1588. corporateName: "",
  1589. propertyName: "",
  1590. serviceStatus: "",
  1591. provinceId: "",
  1592. houseType: "",
  1593. timeType: "0",
  1594. // residueTime: 7,
  1595. startWorking: "",
  1596. endWorking: "",
  1597. agentName: "",
  1598. operationalPeople: "",
  1599. operationStaffId: "",
  1600. };
  1601. this.area = [];
  1602. this.page.currentPage = 1;
  1603. this.zkhousePage();
  1604. },
  1605. timeChange1(e) {
  1606. if (e) {
  1607. this.searchForm.startWorking = e[0];
  1608. this.searchForm.endWorking = e[1];
  1609. } else {
  1610. this.searchForm.startWorking = "";
  1611. this.searchForm.endWorking = "";
  1612. }
  1613. },
  1614. tabtimetap(idx) {
  1615. this.searchForm.residueTime = idx;
  1616. },
  1617. handleSizeChange(val) {
  1618. console.log(`每页 ${val} 条`);
  1619. this.page.pageSize = val;
  1620. this.zkhousePage();
  1621. },
  1622. handleCurrentChange(val) {
  1623. console.log(`当前页: ${val}`);
  1624. this.page.currentPage = val;
  1625. this.zkhousePage();
  1626. },
  1627. locationsChange(e) {
  1628. console.log(e);
  1629. if (!e) return;
  1630. this.ruleForm.provinceId = e[0];
  1631. this.ruleForm.cityId = e[1];
  1632. },
  1633. locationsChange1(e) {
  1634. console.log(e);
  1635. if (!e) return;
  1636. this.searchForm.provinceId = e[0];
  1637. this.searchForm.cityId = e[1];
  1638. },
  1639. },
  1640. };
  1641. </script>
  1642. <style scoped="scoped" lang="scss" >
  1643. .box-center {
  1644. width: 100%;
  1645. padding: 5px 15px 40px;
  1646. min-width: 1000px;
  1647. }
  1648. .cen-tab {
  1649. width: 100%;
  1650. padding: 15px;
  1651. background: #ffffff;
  1652. margin-top: 15px;
  1653. }
  1654. .tophove {
  1655. color: #ffffff;
  1656. background: #2671e2;
  1657. }
  1658. .app-top {
  1659. width: 100%;
  1660. background: #ffffff;
  1661. box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
  1662. border-radius: 4px;
  1663. padding-top: 15px;
  1664. padding-bottom: 15px;
  1665. .app-titel {
  1666. width: 100%;
  1667. display: flex;
  1668. align-items: center;
  1669. flex-wrap: wrap;
  1670. .label {
  1671. font-size: 14px;
  1672. font-weight: 400;
  1673. color: #32363d;
  1674. line-height: 32px;
  1675. margin-left: 15px;
  1676. min-width: 100px;
  1677. text-align: right;
  1678. }
  1679. .toptimeqhuan {
  1680. height: 30px;
  1681. background: #ffffff;
  1682. display: flex;
  1683. align-items: center;
  1684. }
  1685. .toptimeqhuan div {
  1686. padding-left: 20px;
  1687. padding-right: 20px;
  1688. text-align: center;
  1689. line-height: 30px;
  1690. font-size: 14px;
  1691. margin-right: 15px;
  1692. border-radius: 4px;
  1693. border: 1px solid #e0e0e0;
  1694. }
  1695. }
  1696. }
  1697. .div-lab {
  1698. display: flex;
  1699. margin: 5px;
  1700. }
  1701. .div-inp {
  1702. width: 250px;
  1703. }
  1704. /deep/ .el-table__header-wrapper {
  1705. thead {
  1706. tr {
  1707. th {
  1708. background: #f5f7fa !important;
  1709. color: #333333 !important;
  1710. }
  1711. }
  1712. }
  1713. }
  1714. /deep/ .el-dialog--center {
  1715. border-radius: 8px;
  1716. .el-dialog__title {
  1717. font-weight: bold;
  1718. }
  1719. }
  1720. /deep/ .el-button--primary {
  1721. background: #2671e2 !important;
  1722. border: 1px solid #2671e2 !important;
  1723. }
  1724. /deep/ .el-button--text {
  1725. color: #2671e2;
  1726. }
  1727. /deep/ .el-button--text {
  1728. color: #2671e2;
  1729. }
  1730. /deep/.houseType {
  1731. height: 32px;
  1732. display: flex;
  1733. align-items: center;
  1734. justify-content: space-between;
  1735. .el-radio {
  1736. margin-right: 0;
  1737. }
  1738. }
  1739. </style>