order2.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  4. <!-- <el-form-item label="公司名称" prop="companyId" >-->
  5. <!-- <el-select v-model="queryParams.companyId" placeholder="请选择所属公司" filterable size="small">-->
  6. <!-- <el-option v-for="(option, index) in companyList" :key="index" :value="option.dictValue" :label="option.dictLabel"></el-option>-->
  7. <!-- </el-select>-->
  8. <!-- </el-form-item>-->
  9. <el-form-item label="处方类型" prop="prescribeType">
  10. <el-select v-model="queryParams.prescribeType" placeholder="处方类型" clearable size="small">
  11. <el-option
  12. v-for="dict in prescribeType"
  13. :key="dict.dictValue"
  14. :label="dict.dictLabel"
  15. :value="dict.dictValue"
  16. />
  17. </el-select>
  18. </el-form-item>
  19. <el-form-item label="患者名称" prop="patientName">
  20. <el-input
  21. v-model="queryParams.patientName"
  22. placeholder="请输入患者名称"
  23. clearable
  24. size="small"
  25. @keyup.enter.native="handleQuery"
  26. />
  27. </el-form-item>
  28. <el-form-item label="医生姓名" prop="doctorName">
  29. <el-input
  30. v-model="queryParams.doctorName"
  31. placeholder="请输入医生姓名"
  32. clearable
  33. size="small"
  34. @keyup.enter.native="handleQuery"
  35. />
  36. </el-form-item>
  37. <el-form-item label="药品订单编号" prop="orderCode">
  38. <el-input
  39. v-model="queryParams.orderCode"
  40. placeholder="请输入药品订单单号"
  41. clearable
  42. size="small"
  43. @keyup.enter.native="handleQuery"
  44. />
  45. </el-form-item>
  46. <el-form-item label="处方单编号" prop="prescribeCode">
  47. <el-input
  48. v-model="queryParams.prescribeCode"
  49. placeholder="请输入处方单编号"
  50. clearable
  51. size="small"
  52. @keyup.enter.native="handleQuery"
  53. />
  54. </el-form-item>
  55. <el-form-item label="患者电话" prop="patientTel">
  56. <el-input
  57. v-model="queryParams.patientTel"
  58. placeholder="请输入患者电话"
  59. clearable
  60. size="small"
  61. @keyup.enter.native="handleQuery"
  62. />
  63. </el-form-item>
  64. <el-form-item label="药品订单状态" prop="orderStatus">
  65. <el-select v-model="queryParams.orderStatus" placeholder="药品订单状态" clearable size="small">
  66. <el-option
  67. v-for="dict in orderStatusOptions"
  68. :key="dict.dictValue"
  69. :label="dict.dictLabel"
  70. :value="dict.dictValue"
  71. />
  72. </el-select>
  73. </el-form-item>
  74. <el-form-item label="创建时间" prop="createTime">
  75. <el-date-picker v-model="createTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="change"></el-date-picker>
  76. </el-form-item>
  77. <el-form-item label="审核时间" prop="auditTime">
  78. <el-date-picker v-model="auditTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="change"></el-date-picker>
  79. </el-form-item>
  80. <!-- 开方耗时区间筛选 -->
  81. <el-form-item label="开方耗时" prop="operateTimeRange">
  82. <el-input-number
  83. v-model="operateTime.minVal"
  84. :min="0"
  85. :controls="false"
  86. size="small"
  87. placeholder="最小值"
  88. style="width: 100px"
  89. />
  90. <el-select v-model="operateTime.minUnit" size="small" style="width: 70px; margin: 0 8px">
  91. <el-option label="秒" value="sec" />
  92. <el-option label="分" value="min" />
  93. </el-select>
  94. ~
  95. <el-input-number
  96. v-model="operateTime.maxVal"
  97. :min="0"
  98. :controls="false"
  99. size="small"
  100. placeholder="最大值"
  101. style="width: 100px; margin-left: 8px"
  102. />
  103. <el-select v-model="operateTime.maxUnit" size="small" style="width: 70px; margin: 0 8px">
  104. <el-option label="秒" value="sec" />
  105. <el-option label="分" value="min" />
  106. </el-select>
  107. </el-form-item>
  108. <el-form-item label="医生组别" prop="groupCode">
  109. <el-select v-model="queryParams.groupCode" placeholder="请选择医生组别" clearable size="small">
  110. <el-option
  111. v-for="dict in groupCodeOptions"
  112. :key="dict.dictValue"
  113. :label="dict.dictLabel"
  114. :value="dict.dictValue"
  115. />
  116. </el-select>
  117. </el-form-item>
  118. <el-form-item>
  119. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  120. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  121. </el-form-item>
  122. </el-form>
  123. <el-row :gutter="10" class="mb8">
  124. <el-col :span="1.5">
  125. <el-button
  126. type="warning"
  127. plain
  128. icon="el-icon-download"
  129. size="mini"
  130. :loading="exportLoading"
  131. @click="handleExport"
  132. v-hasPermi="['his:prescribe:export']"
  133. >导出</el-button>
  134. </el-col>
  135. <el-col :span="1.5">
  136. <el-button
  137. type="warning"
  138. plain
  139. icon="el-icon-download"
  140. size="small"
  141. :loading="exportLoading"
  142. @click="handleExportMessageFeedback"
  143. v-hasPermi="['his:prescribe:messageFeedbackExport']"
  144. >医疗信息反馈单</el-button>
  145. </el-col>
  146. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  147. </el-row>
  148. <el-tabs type="card" v-model="actName" @tab-click="handleClickX">
  149. <el-tab-pane label="全部订单" name="10"></el-tab-pane>
  150. <el-tab-pane v-for="(item,index) in prescribeStatusOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
  151. </el-tabs>
  152. <el-table heiget="600" v-loading="loading" border :data="prescribeList" @selection-change="handleSelectionChange">
  153. <el-table-column type="selection" width="55" align="center" />
  154. <el-table-column label="处方单编号" align="center" prop="prescribeCode" width="180px" />
  155. <el-table-column label="药品订单编号" align="center" prop="orderCode" width="180px" />
  156. <el-table-column label="处方类型" align="center" prop="prescribeType" >
  157. <template slot-scope="scope">
  158. <dict-tag :options="prescribeType" :value="scope.row.prescribeType"/>
  159. </template>
  160. </el-table-column>
  161. <el-table-column label="医生组别" align="center" prop="groupCode">
  162. <template slot-scope="scope">
  163. <dict-tag :options="groupCodeOptions" :value="scope.row.groupCode"/>
  164. </template>
  165. </el-table-column>
  166. <el-table-column label="患者年龄" align="center" prop="patientAge" />
  167. <el-table-column label="患者姓名" align="center" prop="patientName" />
  168. <el-table-column label="诊断" align="center" prop="diagnose" />
  169. <el-table-column label="医生名称" align="center" prop="doctorName" />
  170. <el-table-column label="药师名称" align="center" prop="doctorDrugName">
  171. <template slot-scope="scope">
  172. <!-- 使用 v-if 指令,根据当前行的 status 值决定是否渲染药师名称 -->
  173. <span v-if="scope.row.status !== 0">{{ scope.row.doctorDrugName }}</span>
  174. </template>
  175. </el-table-column>
  176. <el-table-column label="状态" align="center" prop="status" >
  177. <template slot-scope="scope">
  178. <dict-tag :options="prescribeStatusOptions" :value="scope.row.status"/>
  179. </template>
  180. </el-table-column>
  181. <el-table-column label="药品订单状态" align="center" prop="orderStatus" >
  182. <template slot-scope="scope">
  183. <dict-tag :options="orderStatusOptions" :value="scope.row.orderStatus"/>
  184. </template>
  185. </el-table-column>
  186. <el-table-column label="审核时间" align="center" prop="auditTime" width="180" />
  187. <el-table-column
  188. prop="operate_second"
  189. label="操作时长"
  190. min-width="140"
  191. >
  192. <template slot-scope="{ row }">
  193. {{ formatSeconds(row.operateSecond) }}
  194. </template>
  195. </el-table-column>
  196. <el-table-column label="创建时间" align="center" prop="createTime" width="180" />
  197. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="100px">
  198. <template slot-scope="scope">
  199. <el-button
  200. size="mini"
  201. type="text"
  202. @click="handledetails(scope.row)"
  203. >查看
  204. </el-button>
  205. <el-button size="mini" type="text"
  206. @click="handleRecord(scope.row)">审核记录</el-button>
  207. </template>
  208. </el-table-column>
  209. </el-table>
  210. <pagination
  211. v-show="total>0"
  212. :total="total"
  213. :page.sync="queryParams.pageNum"
  214. :limit.sync="queryParams.pageSize"
  215. @pagination="getList"
  216. />
  217. <el-drawer
  218. :with-header="false"
  219. size="75%"
  220. :title="show.title" :visible.sync="show.open">
  221. <prescribeDetails ref="Details" />
  222. </el-drawer>
  223. <el-dialog title="审核记录" :visible.sync="recordDialogVisible" width="1000px" append-to-body>
  224. <el-table v-loading="recordLoading" :data="recordList" border style="width: 100%; margin-top: 10px;"
  225. max-height="400">
  226. <el-table-column label="审核药师" align="center" prop="drugDoctorName" />
  227. <el-table-column label="拒方原因" align="center" prop="auditReason" show-overflow-tooltip />
  228. <el-table-column label="处方图片" align="center" width="140">
  229. <template slot-scope="scope">
  230. <el-image v-if="scope.row.prescribeImgUrl" :src="scope.row.prescribeImgUrl"
  231. :preview-src-list="[scope.row.prescribeImgUrl]" style="width: 120px; height: 120px" fit="cover" />
  232. <span v-else>无</span>
  233. </template>
  234. </el-table-column>
  235. <el-table-column label="审核时间" align="center" prop="createTime" />
  236. <el-table-column label="审核状态" align="center" width="120">
  237. <template slot-scope="scope">
  238. {{ statusFormat(scope.row.auditStatus != null ? scope.row.auditStatus : scope.row.status) }}
  239. </template>
  240. </el-table-column>
  241. </el-table>
  242. </el-dialog>
  243. </div>
  244. </template>
  245. <script>
  246. import { listPrescribe, getPrescribe, delPrescribe, addPrescribe, updatePrescribe, exportPrescribe,exportMessageFeedback,recordList } from "@/api/his/prescribe";
  247. import prescribeDetails from '../../components/his/prescribeDetails.vue';
  248. import {allList}from "@/api/company/company";
  249. import { getTask } from "@/api/common";
  250. import {list as getAppMallOptions} from '@/api/course/coursePlaySourceConfig';
  251. export default {
  252. name: "Prescribe",
  253. components: { prescribeDetails },
  254. data() {
  255. return {
  256. // 医生组别字典
  257. groupCodeOptions: [],
  258. //审核记录数据
  259. recordLoading: false,
  260. recordList: [],
  261. recordDialogVisible: false,//审核记录弹窗控制
  262. operateTime: {
  263. minVal: null,
  264. minUnit: 'sec', // 默认单位:秒
  265. maxVal: null,
  266. maxUnit: 'sec'
  267. },
  268. dateRange: null,
  269. companyList:[],
  270. createTime:null,
  271. pjtUrl: process.env.VUE_APP_BASE_API+"/",
  272. show:{
  273. title:"订单详情",
  274. open:false,
  275. },
  276. // 遮罩层
  277. loading: true,
  278. // 导出遮罩层
  279. exportLoading: false,
  280. // 选中数组
  281. ids: [],
  282. auditTime:null,
  283. // 非单个禁用
  284. single: true,
  285. // 非多个禁用
  286. multiple: true,
  287. // 显示搜索条件
  288. showSearch: true,
  289. // 总条数
  290. total: 0,
  291. // 处方表格数据
  292. prescribeList: [],
  293. orderStatusOptions:[],
  294. // 弹出层标题
  295. title: "",
  296. // 是否显示弹出层
  297. open: false,
  298. // 查询参数
  299. queryParams: {
  300. groupCode: null,
  301. pageNum: 1,
  302. pageSize: 10,
  303. prescribeType: null,
  304. inquiryOrderId: null,
  305. storeOrderId: null,
  306. userId: null,
  307. patientId: null,
  308. prescribeCode: null,
  309. patientDescs: null,
  310. nowIllness: null,
  311. historyIllness: null,
  312. patientAge: null,
  313. patientName: null,
  314. weight: null,
  315. sTime:null,
  316. eTime:null,
  317. isHistoryAllergic: null,
  318. historyAllergic: null,
  319. liverUnusual: null,
  320. renalUnusual: null,
  321. isLactation: null,
  322. patientTel: null,
  323. patientGender: null,
  324. recordPic: null,
  325. prescribeImgUrl: null,
  326. auditReason: null,
  327. diagnose: null,
  328. doctorId: null,
  329. status: null,
  330. auditTime: null,
  331. auditSTime:null,
  332. auditETime:null,
  333. doctorName:null,
  334. orderStatus:null,
  335. appId:null,
  336. minOperateSeconds: null,
  337. maxOperateSeconds: null,
  338. },
  339. actName:"10",
  340. // 表单参数
  341. form: {},
  342. // 表单校验
  343. rules: {
  344. },
  345. prescribeStatusOptions:[],
  346. prescribeType:[],
  347. orOptions:[],
  348. sexOptions:[],
  349. appMallOptions:[],
  350. };
  351. },
  352. created() {
  353. this.getDicts("doctor_group").then(response => {
  354. this.groupCodeOptions = response.data;
  355. });
  356. this.getAllCompany();
  357. this.getDicts("sys_prescribe_status").then(response => {
  358. this.prescribeStatusOptions = response.data;
  359. });
  360. this.getDicts("sys_prescribe_type").then(response => {
  361. this.prescribeType = response.data;
  362. });
  363. this.getDicts("sys_sex").then(response => {
  364. this.sexOptions = response.data;
  365. });
  366. this.getDicts("sys_company_or").then(response => {
  367. this.orOptions = response.data;
  368. });
  369. this.getDicts("sys_order_status").then(response => {
  370. this.orderStatusOptions = response.data;
  371. });
  372. this.getAppMallOptions();
  373. this.getList();
  374. },
  375. methods: {
  376. statusFormat(val) {
  377. if (val === 0 || val === '0') return '待审核'
  378. if (val === 1 || val === '1') return '审核通过'
  379. if (val === 2 || val === '2') return '审核不通过'
  380. return '-'
  381. },
  382. getAppMallOptions() {
  383. getAppMallOptions({pageNum:1,pageSize:100,isMall:1}).then(response => {
  384. this.appMallOptions = response.rows;
  385. })
  386. },
  387. getAllCompany() {
  388. allList().then(response => {
  389. this.companyList = response.rows;
  390. });
  391. },
  392. handleClickX(tab, event) {
  393. if(tab.name=="10"){
  394. this.queryParams.status=null;
  395. }else{
  396. this.queryParams.status=tab.name;
  397. }
  398. this.handleQuery();
  399. },
  400. handledetails(row){
  401. this.show.open=true;
  402. setTimeout(() => {
  403. this.$refs.Details.getDetails(row.prescribeId);
  404. }, 1);
  405. },
  406. //审核记录
  407. handleRecord(row) {
  408. this.recordDialogVisible = true;
  409. this.recordLoading = true;
  410. recordList(row.prescribeId).then(res =>{
  411. this.recordLoading = false;
  412. this.recordList = res.data;
  413. })
  414. },
  415. /** 查询处方列表 */
  416. getList() {
  417. this.loading = true;
  418. // 构造请求参数(避免直接修改 queryParams)
  419. const params = { ...this.queryParams };
  420. // 处理开方时间
  421. if (this.dateRange?.length === 2) {
  422. params.startOperateTime = this.dateRange[0];
  423. params.endOperateTime = this.dateRange[1];
  424. } else {
  425. delete params.startOperateTime;
  426. delete params.endOperateTime;
  427. }
  428. listPrescribe(params).then(response => {
  429. this.prescribeList = response.rows;
  430. this.total = response.total;
  431. this.loading = false;
  432. });
  433. },
  434. // 取消按钮
  435. cancel() {
  436. this.open = false;
  437. this.reset();
  438. },
  439. change(){
  440. if(this.createTime!=null){
  441. this.queryParams.sTime=this.createTime[0];
  442. this.queryParams.eTime=this.createTime[1];
  443. }else{
  444. this.queryParams.sTime=null;
  445. this.queryParams.eTime=null;
  446. }
  447. if(this.auditTime!=null){
  448. this.queryParams.auditSTime=this.auditTime[0];
  449. this.queryParams.auditETime=this.auditTime[1];
  450. }else{
  451. this.queryParams.auditSTime=null;
  452. this.queryParams.auditETime=null;
  453. }
  454. },
  455. // 表单重置
  456. reset() {
  457. this.form = {
  458. prescribeId: null,
  459. prescribeType: null,
  460. inquiryOrderId: null,
  461. storeOrderId: null,
  462. userId: null,
  463. patientId: null,
  464. prescribeCode: null,
  465. patientDescs: null,
  466. nowIllness: null,
  467. historyIllness: null,
  468. patientAge: null,
  469. patientName: null,
  470. weight: null,
  471. isHistoryAllergic: null,
  472. historyAllergic: null,
  473. liverUnusual: null,
  474. renalUnusual: null,
  475. isLactation: null,
  476. patientTel: null,
  477. patientGender: null,
  478. recordPic: null,
  479. prescribeImgUrl: null,
  480. auditReason: null,
  481. diagnose: null,
  482. doctorId: null,
  483. createTime: null,
  484. status: 0,
  485. auditTime: null
  486. };
  487. this.resetForm("form");
  488. },
  489. /** 搜索按钮操作 */
  490. handleQuery() {
  491. this.queryParams.pageNum = 1;
  492. const toSeconds = (val, unit) => {
  493. if (val == null || val === '') return null;
  494. return unit === 'min' ? val * 60 : val;
  495. };
  496. const minSec = toSeconds(this.operateTime.minVal, this.operateTime.minUnit);
  497. const maxSec = toSeconds(this.operateTime.maxVal, this.operateTime.maxUnit);
  498. //核心校验:如果两个值都存在,max 不能小于 min
  499. if (minSec != null && maxSec != null && minSec > maxSec) {
  500. this.$message.warning('开方耗时:最大值不能小于最小值!');
  501. return; // 阻止查询
  502. }
  503. if (minSec === 0 && maxSec === 0) {
  504. delete this.queryParams.minOperateSeconds;
  505. delete this.queryParams.maxOperateSeconds;
  506. } else {
  507. // 否则正常赋值(可能是 null,也可能是有效数字)
  508. this.queryParams.minOperateSeconds = minSec;
  509. this.queryParams.maxOperateSeconds = maxSec;
  510. }
  511. this.getList();
  512. },
  513. /** 重置按钮操作 */
  514. resetQuery() {
  515. this.resetForm("queryForm");
  516. this.createTime=null;
  517. this.queryParams.sTime=null;
  518. this.queryParams.eTime=null;
  519. this.auditTime=null;
  520. this.dateRange = null;
  521. this.queryParams.auditSTime=null;
  522. this.queryParams.auditETime=null;
  523. this.operateTime = {
  524. minVal: null,
  525. minUnit: 'sec',
  526. maxVal: null,
  527. maxUnit: 'sec'
  528. };
  529. this.handleQuery();
  530. },
  531. // 多选框选中数据
  532. handleSelectionChange(selection) {
  533. this.ids = selection.map(item => item.prescribeId)
  534. this.single = selection.length!==1
  535. this.multiple = !selection.length
  536. },
  537. /** 新增按钮操作 */
  538. handleAdd() {
  539. this.reset();
  540. this.open = true;
  541. this.title = "添加处方";
  542. },
  543. /** 修改按钮操作 */
  544. handleUpdate(row) {
  545. this.reset();
  546. const prescribeId = row.prescribeId || this.ids
  547. getPrescribe(prescribeId).then(response => {
  548. this.form = response.data;
  549. this.open = true;
  550. this.title = "修改处方";
  551. });
  552. },
  553. /** 提交按钮 */
  554. submitForm() {
  555. this.$refs["form"].validate(valid => {
  556. if (valid) {
  557. if (this.form.prescribeId != null) {
  558. updatePrescribe(this.form).then(response => {
  559. this.msgSuccess("修改成功");
  560. this.open = false;
  561. this.getList();
  562. });
  563. } else {
  564. addPrescribe(this.form).then(response => {
  565. this.msgSuccess("新增成功");
  566. this.open = false;
  567. this.getList();
  568. });
  569. }
  570. }
  571. });
  572. },
  573. /** 删除按钮操作 */
  574. handleDelete(row) {
  575. const prescribeIds = row.prescribeId || this.ids;
  576. this.$confirm('是否确认删除处方编号为"' + prescribeIds + '"的数据项?', "警告", {
  577. confirmButtonText: "确定",
  578. cancelButtonText: "取消",
  579. type: "warning"
  580. }).then(function() {
  581. return delPrescribe(prescribeIds);
  582. }).then(() => {
  583. this.getList();
  584. this.msgSuccess("删除成功");
  585. }).catch(() => {});
  586. },
  587. /** 导出按钮操作 */
  588. handleExport() {
  589. var that=this;
  590. const queryParams = this.queryParams;
  591. this.$confirm('是否确认导出所有处方数据项?', "警告", {
  592. confirmButtonText: "确定",
  593. cancelButtonText: "取消",
  594. type: "warning"
  595. }).then(() => {
  596. this.exportLoading = true;
  597. return exportPrescribe(queryParams);
  598. }).then(response => {
  599. if(response.code==200){
  600. that.msgSuccess(response.msg);
  601. that.taskId=response.data;
  602. that.time=setInterval(function(){
  603. //查订单
  604. getTask(that.taskId).then(res => {
  605. if(res.data.status==1){
  606. that.exportLoading = false;
  607. clearTimeout(that.time)
  608. that.time=null;
  609. that.download(res.data.fileUrl);
  610. }
  611. });
  612. },10000);
  613. }
  614. }).catch(() => {});
  615. },
  616. /** 导出按钮操作 */
  617. handleExportMessageFeedback() {
  618. var that=this;
  619. const queryParams = this.queryParams;
  620. this.$confirm('是否确认导出所有医疗信息反馈单数据项?', "警告", {
  621. confirmButtonText: "确定",
  622. cancelButtonText: "取消",
  623. type: "warning"
  624. }).then(() => {
  625. this.exportLoading = true;
  626. return exportMessageFeedback(queryParams);
  627. }).then(response => {
  628. if(response.code==200){
  629. that.msgSuccess(response.msg);
  630. that.taskId=response.data;
  631. that.time=setInterval(function(){
  632. //查订单
  633. getTask(that.taskId).then(res => {
  634. if(res.data.status==1){
  635. that.exportLoading = false;
  636. clearTimeout(that.time)
  637. that.time=null;
  638. that.download(res.data.fileUrl);
  639. }
  640. });
  641. },10000);
  642. }
  643. }).catch(() => {});
  644. },
  645. // 表格排序变化(点击表头排序)
  646. handleSortChange({ prop, order }) {
  647. if (order === 'ascending') {
  648. this.queryParams.sortField = prop;
  649. this.queryParams.sortOrder = 'asc';
  650. } else if (order === 'descending') {
  651. this.queryParams.sortField = prop;
  652. this.queryParams.sortOrder = 'desc';
  653. } else {
  654. // 取消排序
  655. delete this.queryParams.sortField;
  656. delete this.queryParams.sortOrder;
  657. }
  658. this.handleQuery(); // 重新查询
  659. },
  660. // 秒数转“X分Y秒”
  661. formatSeconds(seconds) {
  662. if (seconds == null || seconds === '') return '0秒'
  663. const sec = Math.floor(Number(seconds))
  664. const min = Math.floor(sec / 60)
  665. const remainingSec = sec % 60
  666. if (min > 0) {
  667. return `${min}分${remainingSec}秒`
  668. }
  669. return `${remainingSec}秒`
  670. }
  671. }
  672. };
  673. </script>