index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="85px">
  4. <el-form-item label="公司名" prop="companyId">
  5. <el-select filterable v-model="queryParams.companyId" placeholder="请选择公司名" @change="companyChange" clearable size="small">
  6. <el-option
  7. v-for="item in companys"
  8. :key="item.companyId"
  9. :label="item.companyName"
  10. :value="item.companyId"
  11. />
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item>
  15. <treeselect style="width: 220px" :clearable="false" v-model="queryParams.deptId" :options="deptOptions" clearable :show-count="true" placeholder="请选择归属部门" />
  16. </el-form-item>
  17. <el-form-item label="订单号" prop="orderSn">
  18. <el-input
  19. v-model="queryParams.orderSn"
  20. placeholder="请输入订单号"
  21. clearable
  22. size="small"
  23. @keyup.enter.native="handleQuery"
  24. />
  25. </el-form-item>
  26. <el-form-item label="用户电话" prop="phone">
  27. <el-input
  28. v-model="queryParams.phone"
  29. placeholder="请输入用户电话"
  30. clearable
  31. size="small"
  32. @keyup.enter.native="handleQuery"
  33. />
  34. </el-form-item>
  35. <el-form-item label="加密号码" prop="phoneMk">
  36. <el-input
  37. v-model="queryParams.phoneMk"
  38. placeholder="请输入用户电话"
  39. clearable
  40. size="small"
  41. @keyup.enter.native="handleQuery"
  42. />
  43. </el-form-item>
  44. <el-form-item label="医生名称" prop="doctorName">
  45. <el-input
  46. v-model="queryParams.doctorName"
  47. placeholder="请输入医生名称"
  48. clearable
  49. size="small"
  50. @keyup.enter.native="handleQuery"
  51. />
  52. </el-form-item>
  53. <el-form-item label="员工账号" prop="companyUserName">
  54. <el-input
  55. v-model="queryParams.companyUserName"
  56. placeholder="员工账号"
  57. clearable
  58. size="small"
  59. @keyup.enter.native="handleQuery"
  60. />
  61. </el-form-item>
  62. <el-form-item label="员工昵称" prop="companyNickName">
  63. <el-input
  64. v-model="queryParams.companyNickName"
  65. placeholder="员工昵称"
  66. clearable
  67. size="small"
  68. @keyup.enter.native="handleQuery"
  69. />
  70. </el-form-item>
  71. <el-form-item label="收货人" prop="userName">
  72. <el-input
  73. v-model="queryParams.userName"
  74. placeholder="请输入收货人"
  75. clearable
  76. size="small"
  77. @keyup.enter.native="handleQuery"
  78. />
  79. </el-form-item>
  80. <el-form-item label="收货人电话" prop="userPhone">
  81. <el-input
  82. v-model="queryParams.userPhone"
  83. placeholder="请输入收货人电话"
  84. clearable
  85. size="small"
  86. @keyup.enter.native="handleQuery"
  87. />
  88. </el-form-item>
  89. <el-form-item label="套餐名称" prop="packageName">
  90. <el-input
  91. v-model="queryParams.packageName"
  92. placeholder="请输入套餐名称"
  93. clearable
  94. size="small"
  95. @keyup.enter.native="handleQuery"
  96. />
  97. </el-form-item>
  98. <el-form-item label="是否支付" prop="isPay">
  99. <el-select v-model="queryParams.isPay" placeholder="请选择是否支付" clearable size="small">
  100. <el-option
  101. v-for="dict in isPayOptions"
  102. :key="dict.dictValue"
  103. :label="dict.dictLabel"
  104. :value="dict.dictValue"
  105. />
  106. </el-select>
  107. </el-form-item>
  108. <el-form-item label="来源" prop="source">
  109. <el-select v-model="queryParams.source" placeholder="请选择是否支付" clearable size="small">
  110. <el-option
  111. v-for="dict in sourceOptions"
  112. :key="dict.dictValue"
  113. :label="dict.dictLabel"
  114. :value="dict.dictValue"
  115. />
  116. </el-select>
  117. </el-form-item>
  118. <el-form-item label="所属小程序" prop="coursePlaySourceConfigId">
  119. <el-select v-model="queryParams.coursePlaySourceConfigId" placeholder="请选择所属小程序" clearable size="small">
  120. <el-option
  121. v-for="dict in appMallOptions"
  122. :key="dict.id"
  123. :label="dict.name + '(' + dict.appid + ')'"
  124. :value="dict.id"
  125. />
  126. </el-select>
  127. </el-form-item>
  128. <el-form-item label="开始时间" prop="startTime">
  129. <el-date-picker v-model="startTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="startChange"></el-date-picker>
  130. </el-form-item>
  131. <el-form-item>
  132. <el-form-item label="结束时间" prop="endTime">
  133. <el-date-picker v-model="endTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="endChange"></el-date-picker>
  134. </el-form-item>
  135. <el-form-item label="下单时间" prop="createTime">
  136. <el-date-picker v-model="createTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="xdChange"></el-date-picker>
  137. </el-form-item>
  138. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  139. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  140. </el-form-item>
  141. </el-form>
  142. <el-row :gutter="10" class="mb8">
  143. <el-col :span="1.5">
  144. <el-button
  145. type="warning"
  146. plain
  147. icon="el-icon-download"
  148. size="mini"
  149. :loading="exportLoading"
  150. @click="handleExport"
  151. v-hasPermi="['his:packageOrder:export']"
  152. >导出</el-button>
  153. </el-col>
  154. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  155. </el-row>
  156. <el-tabs type="card" v-model="actName" @tab-click="handleClickX">
  157. <el-tab-pane label="全部订单" name="10"></el-tab-pane>
  158. <el-tab-pane v-for="(item,index) in statusOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
  159. </el-tabs>
  160. <el-table height="500" v-loading="loading" border :data="packageOrderList" @selection-change="handleSelectionChange">
  161. <el-table-column type="selection" width="55" align="center" />
  162. <el-table-column label="订单号" align="center" prop="orderSn" width="120px"/>
  163. <el-table-column label="所属公司" align="center" prop="companyName" />
  164. <el-table-column label="员工账号" align="center" prop="companyUserName" />
  165. <el-table-column label="员工昵称" align="center" prop="companyNickName" />
  166. <el-table-column label="小程序名称" align="center" prop="miniProgramName" width="120px" />
  167. <el-table-column label="套餐名称" align="center" prop="packageName" />
  168. <el-table-column label="套餐别名" align="center" prop="packageSecondName" width="100px"/>
  169. <el-table-column label="天数" align="center" prop="days" />
  170. <el-table-column label="就诊人" align="center" prop="patientName" />
  171. <el-table-column label="应收金额" align="center" prop="payPrice" />
  172. <el-table-column label="实收金额" align="center" prop="payMoney" />
  173. <el-table-column label="支付类别" align="center" prop="payType">
  174. <template slot-scope="scope">
  175. <dict-tag :options="payTypeOptions" :value="scope.row.payType"/>
  176. </template>
  177. </el-table-column>
  178. <el-table-column label="订单状态" align="center" prop="status" >
  179. <template slot-scope="scope">
  180. <dict-tag :options="statusOptions" :value="scope.row.status"/>
  181. </template>
  182. </el-table-column>
  183. <el-table-column label="套餐类型" align="center" prop="packageSubType" >
  184. <template slot-scope="scope">
  185. <dict-tag :options="packageSubTypeOptions" :value="scope.row.packageSubType"/>
  186. </template>
  187. </el-table-column>
  188. <el-table-column label="订单来源" align="center" prop="source" >
  189. <template slot-scope="scope">
  190. <dict-tag :options="sourceOptions" :value="scope.row.source"/>
  191. </template>
  192. </el-table-column>
  193. <el-table-column label="下单时间" align="center" prop="createTime" width="180" />
  194. <el-table-column label="支付时间" align="center" prop="payTime" width="180" />
  195. <el-table-column label="开始时间" align="center" prop="startTime" width="180" />
  196. <el-table-column label="结束时间" align="center" prop="finishTime" width="180" />
  197. <el-table-column label="物流状态" align="center" prop="deliveryStatus" >
  198. <template slot-scope="scope">
  199. <dict-tag :options="deliveryStatusOptions" :value="scope.row.deliveryStatus"/>
  200. </template>
  201. </el-table-column>
  202. <el-table-column label="结算状态" align="center" prop="deliveryPayStatus" >
  203. <template slot-scope="scope">
  204. <dict-tag :options="deliveryPayStatusOptions" :value="scope.row.deliveryPayStatus"/>
  205. </template>
  206. </el-table-column>
  207. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="150px">
  208. <template slot-scope="scope">
  209. <el-button
  210. size="mini"
  211. type="text"
  212. @click="handledetails(scope.row)"
  213. >详情
  214. </el-button>
  215. </template>
  216. </el-table-column>
  217. </el-table>
  218. <pagination
  219. v-show="total>0"
  220. :total="total"
  221. :page.sync="queryParams.pageNum"
  222. :limit.sync="queryParams.pageSize"
  223. @pagination="getList"
  224. />
  225. <!-- 添加或修改套餐订单对话框 -->
  226. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  227. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  228. <el-form-item label="订单号" prop="orderSn">
  229. <el-input v-model="form.orderSn" placeholder="请输入订单号" />
  230. </el-form-item>
  231. <el-form-item label="用户ID" prop="userId">
  232. <el-input v-model="form.userId" placeholder="请输入用户ID" />
  233. </el-form-item>
  234. <el-form-item label="医生ID" prop="doctorId">
  235. <el-input v-model="form.doctorId" placeholder="请输入医生ID" />
  236. </el-form-item>
  237. <el-form-item label="套餐ID" prop="packageId">
  238. <el-input v-model="form.packageId" placeholder="请输入套餐ID" />
  239. </el-form-item>
  240. <el-form-item label="套餐名称" prop="packageName">
  241. <el-input v-model="form.packageName" placeholder="请输入套餐名称" />
  242. </el-form-item>
  243. <el-form-item label="支付金额" prop="payMoney">
  244. <el-input v-model="form.payMoney" placeholder="请输入支付金额" />
  245. </el-form-item>
  246. <el-form-item label="是否支付" prop="isPay">
  247. <el-select v-model="form.isPay" placeholder="请选择是否支付">
  248. <el-option
  249. v-for="dict in isPayOptions"
  250. :key="dict.dictValue"
  251. :label="dict.dictLabel"
  252. :value="parseInt(dict.dictValue)"
  253. ></el-option>
  254. </el-select>
  255. </el-form-item>
  256. <el-form-item label="天数" prop="days">
  257. <el-input v-model="form.days" placeholder="请输入天数" />
  258. </el-form-item>
  259. <el-form-item label="状态">
  260. <el-radio-group v-model="form.status">
  261. <el-radio
  262. v-for="dict in statusOptions"
  263. :key="dict.dictValue"
  264. :label="parseInt(dict.dictValue)"
  265. >{{dict.dictLabel}}</el-radio>
  266. </el-radio-group>
  267. </el-form-item>
  268. <el-form-item label="开始时间" prop="startTime">
  269. <el-date-picker clearable size="small"
  270. v-model="form.startTime"
  271. type="date"
  272. value-format="yyyy-MM-dd"
  273. placeholder="选择开始时间">
  274. </el-date-picker>
  275. </el-form-item>
  276. <el-form-item label="结束时间" prop="finishTime">
  277. <el-date-picker clearable size="small"
  278. v-model="form.finishTime"
  279. type="date"
  280. value-format="yyyy-MM-dd"
  281. placeholder="选择结束时间">
  282. </el-date-picker>
  283. </el-form-item>
  284. </el-form>
  285. <div slot="footer" class="dialog-footer">
  286. <el-button type="primary" @click="submitForm">确 定</el-button>
  287. <el-button @click="cancel">取 消</el-button>
  288. </div>
  289. </el-dialog>
  290. <el-drawer
  291. :with-header="false"
  292. size="75%"
  293. :title="show.title" :visible.sync="show.open">
  294. <packageOrderDetails ref="Details" />
  295. </el-drawer>
  296. </div>
  297. </template>
  298. <script>
  299. import { listPackageOrder, getPackageOrder, delPackageOrder, addPackageOrder, updatePackageOrder, exportPackageOrder } from "@/api/his/packageOrder";
  300. import { getCompanyList } from "@/api/company/company";
  301. import packageOrderDetails from '../../components/his/packageOrderDetails.vue';
  302. import { treeselect } from "@/api/company/companyDept";
  303. import Treeselect from "@riophae/vue-treeselect";
  304. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  305. import { getTask } from "@/api/common";
  306. import {list as getAppMallOptions} from '@/api/course/coursePlaySourceConfig';
  307. export default {
  308. watch: {
  309. // 监听deptId
  310. 'deptId': 'currDeptChange'
  311. },
  312. name: "PackageOrder",
  313. components: {packageOrderDetails ,Treeselect },
  314. data() {
  315. return {
  316. companys:[],
  317. deptOptions:[],
  318. companyId:undefined,
  319. deptId:undefined,
  320. show:{
  321. open:false,
  322. },
  323. sourceOptions:[],
  324. actName:"2",
  325. // 遮罩层
  326. loading: true,
  327. startTime:null,
  328. // 导出遮罩层
  329. exportLoading: false,
  330. // 导出任务检查计数器
  331. exportCheckCount: 0,
  332. // 选中数组
  333. ids: [],
  334. createTime:null,
  335. // 非单个禁用
  336. single: true,
  337. // 非多个禁用
  338. multiple: true,
  339. // 显示搜索条件
  340. showSearch: true,
  341. endTime:null,
  342. // 总条数
  343. total: 0,
  344. // 套餐订单表格数据
  345. packageOrderList: [],
  346. // 弹出层标题
  347. title: "",
  348. // 是否显示弹出层
  349. open: false,
  350. // 是否支付字典
  351. isPayOptions: [],
  352. // 状态字典
  353. statusOptions: [],
  354. refundStatusOptions: [],
  355. packageSubTypeOptions: [],
  356. payTypeOptions:[],
  357. deliveryPayStatusOptions:[],
  358. deliveryStatusOptions:[],
  359. appMallOptions:[],
  360. // 查询参数
  361. queryParams: {
  362. pageNum: 1,
  363. pageSize: 10,
  364. orderSn: null,
  365. userId: null,
  366. doctorId: null,
  367. doctorName: null,
  368. phone: null,
  369. phoneMk: null,
  370. packageId: null,
  371. packageName: null,
  372. payMoney: null,
  373. isPay: null,
  374. days: null,
  375. status: 2,
  376. startTime: null,
  377. finishTime: null,
  378. sTime:null,
  379. eTime:null,
  380. stTime:null,
  381. endTime:null,
  382. endStartTime:null,
  383. endEndTime:null,
  384. companyUserName:null,
  385. companyNickName:null,
  386. companyName:null,
  387. deptId:null,
  388. source:null,
  389. coursePlaySourceConfigId:null,
  390. },
  391. // 表单参数
  392. form: {},
  393. // 表单校验
  394. rules: {
  395. }
  396. };
  397. },
  398. created() {
  399. getCompanyList().then(response => {
  400. this.companys = response.data;
  401. if(this.companys!=null&&this.companys.length>0){
  402. this.companyId=this.companys[0].companyId;
  403. this.getTreeselect();
  404. }
  405. this.companys.push({companyId:"-1",companyName:"无"})
  406. });
  407. this.getList();
  408. this.getDicts("sys_company_or").then(response => {
  409. this.isPayOptions = response.data;
  410. });
  411. this.getDicts("sys_package_order_status").then(response => {
  412. this.statusOptions = response.data;
  413. });
  414. this.getDicts("sys_refund_status").then(response => {
  415. this.refundStatusOptions = response.data;
  416. });
  417. this.getDicts("sys_order_source").then(response => {
  418. this.sourceOptions = response.data;
  419. });
  420. this.getDicts("sys_package_pay_type").then(response => {
  421. this.payTypeOptions = response.data;
  422. });
  423. this.getDicts("sys_store_delivery_pay_status").then(response => {
  424. this.deliveryPayStatusOptions = response.data;
  425. });
  426. this.getDicts("sys_store_order_delivery_status").then(response => {
  427. this.deliveryStatusOptions = response.data;
  428. });
  429. this.getDicts("sys_package_sub_type").then(response => {
  430. this.packageSubTypeOptions = response.data;
  431. });
  432. // 获取小程序选项列表
  433. this.getAppMallOptions();
  434. },
  435. methods: {
  436. /** 查询套餐订单列表 */
  437. getList() {
  438. this.loading = true;
  439. listPackageOrder(this.queryParams).then(response => {
  440. this.packageOrderList = response.rows;
  441. this.total = response.total;
  442. this.loading = false;
  443. });
  444. },
  445. handledetails(row){
  446. this.show.open=true;
  447. setTimeout(() => {
  448. this.$refs.Details.getDetails(row.orderId);
  449. }, 1);
  450. },
  451. startChange(){
  452. if(this.startTime!=null){
  453. this.queryParams.sTime=this.startTime[0];
  454. this.queryParams.eTime=this.startTime[1];
  455. }else{
  456. this.queryParams.sTime=null;
  457. this.queryParams.eTime=null;
  458. }
  459. },
  460. // 取消按钮
  461. cancel() {
  462. this.open = false;
  463. this.reset();
  464. },
  465. // 表单重置
  466. reset() {
  467. this.form = {
  468. orderId: null,
  469. orderSn: null,
  470. userId: null,
  471. doctorId: null,
  472. packageId: null,
  473. packageName: null,
  474. payMoney: null,
  475. isPay: null,
  476. days: null,
  477. status: 0,
  478. startTime: null,
  479. finishTime: null,
  480. createTime: null
  481. };
  482. this.resetForm("form");
  483. },
  484. /** 搜索按钮操作 */
  485. handleQuery() {
  486. this.queryParams.pageNum = 1;
  487. this.getList();
  488. },
  489. /** 重置按钮操作 */
  490. resetQuery() {
  491. this.resetForm("queryForm");
  492. this.startTime=null;
  493. this.queryParams.sTime=null;
  494. this.queryParams.eTime=null;
  495. this.createTime=null;
  496. this.queryParams.stTime=null;
  497. this.queryParams.endTime=null;
  498. this.endTime=null;
  499. this.queryParams.endStartTime=null;
  500. this.queryParams.endEndTime=null;
  501. this.handleQuery();
  502. },
  503. // 多选框选中数据
  504. handleSelectionChange(selection) {
  505. this.ids = selection.map(item => item.orderId)
  506. this.single = selection.length!==1
  507. this.multiple = !selection.length
  508. },
  509. xdChange(){
  510. if(this.createTime!=null){
  511. this.queryParams.stTime=this.createTime[0];
  512. this.queryParams.endTime=this.createTime[1];
  513. }else{
  514. this.queryParams.stTime=null;
  515. this.queryParams.endTime=null;
  516. }
  517. },
  518. endChange(){
  519. if(this.endTime!=null){
  520. this.queryParams.endStartTime=this.endTime[0];
  521. this.queryParams.endEndTime=this.endTime[1];
  522. }else{
  523. this.queryParams.endStartTime=null;
  524. this.queryParams.endEndTime=null;
  525. }
  526. },
  527. /** 新增按钮操作 */
  528. handleAdd() {
  529. this.reset();
  530. this.open = true;
  531. this.title = "添加套餐订单";
  532. },
  533. handleClickX(tab, event) {
  534. if(tab.name=="10"){
  535. this.queryParams.status=null;
  536. }else{
  537. this.queryParams.status=tab.name;
  538. }
  539. this.handleQuery();
  540. },
  541. /** 修改按钮操作 */
  542. handleUpdate(row) {
  543. this.reset();
  544. const orderId = row.orderId || this.ids
  545. getPackageOrder(orderId).then(response => {
  546. this.form = response.data;
  547. this.open = true;
  548. this.title = "修改套餐订单";
  549. });
  550. },
  551. /** 提交按钮 */
  552. submitForm() {
  553. this.$refs["form"].validate(valid => {
  554. if (valid) {
  555. if (this.form.orderId != null) {
  556. updatePackageOrder(this.form).then(response => {
  557. this.msgSuccess("修改成功");
  558. this.open = false;
  559. this.getList();
  560. });
  561. } else {
  562. addPackageOrder(this.form).then(response => {
  563. this.msgSuccess("新增成功");
  564. this.open = false;
  565. this.getList();
  566. });
  567. }
  568. }
  569. });
  570. },
  571. /** 删除按钮操作 */
  572. handleDelete(row) {
  573. const orderIds = row.orderId || this.ids;
  574. this.$confirm('是否确认删除套餐订单编号为"' + orderIds + '"的数据项?', "警告", {
  575. confirmButtonText: "确定",
  576. cancelButtonText: "取消",
  577. type: "warning"
  578. }).then(function() {
  579. return delPackageOrder(orderIds);
  580. }).then(() => {
  581. this.getList();
  582. this.msgSuccess("删除成功");
  583. }).catch(() => {});
  584. },
  585. /** 导出按钮操作 */
  586. handleExport() {
  587. var that=this;
  588. const queryParams = this.queryParams;
  589. this.$confirm('是否确认导出所有套餐订单数据项?', "警告", {
  590. confirmButtonText: "确定",
  591. cancelButtonText: "取消",
  592. type: "warning"
  593. }).then(() => {
  594. this.exportLoading = true;
  595. return exportPackageOrder(queryParams);
  596. }).then(response => {
  597. if(response.code==200){
  598. that.msgSuccess(response.msg);
  599. that.taskId=response.data;
  600. that.exportCheckCount = 0; // 添加检查计数器
  601. that.time=setInterval(function(){
  602. that.exportCheckCount++;
  603. //查任务状态
  604. getTask(that.taskId).then(res => {
  605. // 任务完成
  606. if(res.data.status==1){
  607. that.exportLoading = false;
  608. clearInterval(that.time);
  609. that.time=null;
  610. that.download(res.data.fileUrl);
  611. }
  612. // 任务失败
  613. else if(res.data.status==-1 || res.data.status==2){
  614. that.exportLoading = false;
  615. clearInterval(that.time);
  616. that.time=null;
  617. that.msgError('导出任务失败,请重试');
  618. }
  619. // 超时处理(检查超过30次,即5分钟)
  620. else if(that.exportCheckCount > 30){
  621. that.exportLoading = false;
  622. clearInterval(that.time);
  623. that.time=null;
  624. that.msgError('导出任务超时,请稍后重试');
  625. }
  626. }).catch(err => {
  627. // API调用失败
  628. that.exportCheckCount++;
  629. if(that.exportCheckCount > 30){
  630. that.exportLoading = false;
  631. clearInterval(that.time);
  632. that.time=null;
  633. that.msgError('导出任务查询失败,请重试');
  634. }
  635. });
  636. },10000); // 10秒查询一次
  637. }
  638. else{
  639. that.msgError(response.msg);
  640. that.exportLoading = false;
  641. }
  642. }).catch(() => {
  643. that.exportLoading = false;
  644. });
  645. },
  646. /** 查询部门下拉树结构 */
  647. getTreeselect() {
  648. var that=this;
  649. var param={companyId:this.companyId}
  650. treeselect(param).then((response) => {
  651. this.deptOptions = response.data;
  652. console.log(this.deptOptions)
  653. if(response.data!=null&&response.data.length>0){
  654. //this.queryParams.deptId=response.data[0].id;
  655. }
  656. });
  657. },
  658. companyChange(val){
  659. this.companyId=val;
  660. this.getTreeselect();
  661. },
  662. currDeptChange(val){
  663. this.queryParams.deptId=val;
  664. this.getList();
  665. },
  666. // 获取小程序选项列表
  667. getAppMallOptions() {
  668. getAppMallOptions({pageNum:1,pageSize:100,isMall:1}).then(response => {
  669. this.appMallOptions = response.rows;
  670. })
  671. },
  672. }
  673. };
  674. </script>