index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="90px">
  4. <el-form-item label="公司名" prop="companyId">
  5. <el-select filterable v-model="queryParams.companyId" placeholder="请选择公司名" 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. </el-select>
  12. </el-form-item>
  13. <el-form-item label="付款单号" prop="payCode">
  14. <el-input
  15. v-model="queryParams.payCode"
  16. placeholder="请输入付款单号"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item label="订单编号" prop="businessCode">
  23. <el-input
  24. v-model="queryParams.businessCode"
  25. placeholder="请输入订单号"
  26. clearable
  27. size="small"
  28. @keyup.enter.native="handleQuery"
  29. />
  30. </el-form-item>
  31. <el-form-item label="处方单号" prop="prescribeCode">
  32. <el-input
  33. v-model="queryParams.prescribeCode"
  34. placeholder="请输入处方单号"
  35. clearable
  36. size="small"
  37. @keyup.enter.native="handleQuery"
  38. />
  39. </el-form-item>
  40. <el-form-item label="外部订单" prop="tradeNo">
  41. <el-input
  42. v-model="queryParams.tradeNo"
  43. placeholder="请输入外部订单号"
  44. clearable
  45. size="small"
  46. @keyup.enter.native="handleQuery"
  47. />
  48. </el-form-item>
  49. <el-form-item label="银行单号" prop="bankSerialNo">
  50. <el-input
  51. v-model="queryParams.bankSerialNo"
  52. placeholder="请输入银行单号"
  53. clearable
  54. size="small"
  55. @keyup.enter.native="handleQuery"
  56. />
  57. </el-form-item>
  58. <el-form-item label="手机号" prop="phone">
  59. <el-input
  60. v-model="queryParams.phone"
  61. placeholder="请输入会员手机号"
  62. clearable
  63. size="small"
  64. @keyup.enter.native="handleQuery"
  65. />
  66. </el-form-item>
  67. <el-form-item label="服务商类型" prop="payMode">
  68. <el-select v-model="queryParams.payMode" placeholder="请选择业务类型" clearable size="small">
  69. <el-option
  70. v-for="dict in payModeOptions"
  71. :key="dict.dictValue"
  72. :label="dict.dictLabel"
  73. :value="dict.dictValue"
  74. />
  75. </el-select>
  76. </el-form-item>
  77. <el-form-item label="业务类型" prop="businessType">
  78. <el-select v-model="queryParams.businessType" placeholder="请选择业务类型" clearable size="small">
  79. <el-option
  80. v-for="dict in busineOptions"
  81. :key="dict.dictValue"
  82. :label="dict.dictLabel"
  83. :value="dict.dictValue"
  84. />
  85. </el-select>
  86. </el-form-item>
  87. <el-form-item label="交易单号" prop="bankTransactionId">
  88. <el-input
  89. v-model="queryParams.bankTransactionId"
  90. placeholder="请输入交易单号"
  91. clearable
  92. size="small"
  93. @keyup.enter.native="handleQuery"
  94. />
  95. </el-form-item>
  96. <!-- <el-form-item label="银行流水号" prop="bankSerialNo">
  97. <el-input
  98. v-model="queryParams.bankSerialNo"
  99. placeholder="请输入银行流水号"
  100. clearable
  101. size="small"
  102. @keyup.enter.native="handleQuery"
  103. />
  104. </el-form-item> -->
  105. <el-form-item label="所属小程序" prop="coursePlaySourceConfigId">
  106. <el-select v-model="queryParams.coursePlaySourceConfigId" placeholder="请选择所属小程序" clearable size="small">
  107. <el-option
  108. v-for="dict in appMallOptions"
  109. :key="dict.id"
  110. :label="dict.name + '(' + dict.appid + ')'"
  111. :value="dict.id"
  112. />
  113. </el-select>
  114. </el-form-item>
  115. <el-form-item label="创建时间" prop="createTime">
  116. <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>
  117. </el-form-item>
  118. <el-form-item label="支付时间" prop="payTime">
  119. <el-date-picker v-model="payTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="change"></el-date-picker>
  120. </el-form-item>
  121. <el-form-item label="退款时间" prop="refundTime">
  122. <el-date-picker v-model="refundTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="change"></el-date-picker>
  123. </el-form-item>
  124. <el-form-item>
  125. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  126. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  127. </el-form-item>
  128. </el-form>
  129. <el-row :gutter="10" class="mb8">
  130. <el-col :span="1.5">
  131. <el-button
  132. type="warning"
  133. plain
  134. icon="el-icon-download"
  135. size="mini"
  136. :loading="exportLoading"
  137. @click="handleExport"
  138. v-hasPermi="['his:storePayment:export']"
  139. >导出</el-button>
  140. </el-col>
  141. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  142. </el-row>
  143. <el-tabs type="card" v-model="actName" @tab-click="handleClickX">
  144. <el-tab-pane label="全部订单" name="10"></el-tab-pane>
  145. <el-tab-pane v-for="(item,index) in statusOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
  146. </el-tabs>
  147. <el-table height="600" v-loading="loading" border :data="storePaymentList" @selection-change="handleSelectionChange">
  148. <el-table-column type="selection" width="55" align="center" />
  149. <el-table-column label="处方单号" align="center" prop="prescribeCode" width="170px"/>
  150. <el-table-column label="支付订单号" align="center" prop="payCode" width="170px"/>
  151. <el-table-column label="支付类型" align="center" prop="payTypeCode" />
  152. <el-table-column label="支付服务商" align="center" prop="payMode" width="100">
  153. <template slot-scope="scope">
  154. <dict-tag :options="payModeOptions" :value="scope.row.payMode"/>
  155. </template>
  156. </el-table-column>
  157. <el-table-column label="支付金额" align="center" prop="payMoney" />
  158. <el-table-column label="外部订单号" align="center" prop="tradeNo" width="180"/>
  159. <el-table-column label="订单编号" align="center" prop="businessCode" width="180"/>
  160. <el-table-column label="业务类型 " align="center" prop="businessType" width="100">
  161. <template slot-scope="scope">
  162. <dict-tag :options="busineOptions" :value="scope.row.businessType"/>
  163. </template>
  164. </el-table-column>
  165. <el-table-column label="小程序名称" align="center" prop="miniProgramName" width="120px" />
  166. <el-table-column label="状态" align="center" prop="status">
  167. <template slot-scope="scope">
  168. <dict-tag :options="statusOptions" :value="scope.row.status"/>
  169. </template>
  170. </el-table-column>
  171. <el-table-column label="所属公司" align="center" prop="companyName" />
  172. <el-table-column label="员工" align="center" prop="companyUserNickName" />
  173. <el-table-column label="备注" align="center" prop="remark" width="120px" />
  174. <el-table-column label="创建时间" align="center" prop="createTime" width="150" />
  175. <el-table-column label="支付时间" align="center" prop="payTime" width="150" />
  176. <el-table-column label="交易单号" align="center" prop="bankTransactionId" width="170px" />
  177. <el-table-column label="银行流水号" align="center" prop="bankSerialNo" width="150px"/>
  178. <el-table-column label="退款金额" align="center" prop="refundMoney" />
  179. <el-table-column label="退款时间" align="center" prop="refundTime" width="180" />
  180. <el-table-column label="分账状态" align="center" prop="shareStatus">
  181. <template slot-scope="scope">
  182. <dict-tag :options="shareOptions" :value="scope.row.shareStatus"/>
  183. </template>
  184. </el-table-column>
  185. <el-table-column label="分账金额" align="center" prop="shareMoney" />
  186. <el-table-column label="分账单号" align="center" prop="shareCode" width="150px"/>
  187. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
  188. <template slot-scope="scope">
  189. <el-button
  190. size="mini"
  191. type="text"
  192. @click="handledetails(scope.row)"
  193. >详情
  194. </el-button>
  195. </template>
  196. </el-table-column>
  197. </el-table>
  198. <pagination
  199. v-show="total>0"
  200. :total="total"
  201. :page.sync="queryParams.pageNum"
  202. :limit.sync="queryParams.pageSize"
  203. @pagination="getList"
  204. />
  205. <el-drawer
  206. :with-header="false"
  207. size="75%"
  208. :title="show.title" :visible.sync="show.open">
  209. <storePayDetails ref="Details" />
  210. </el-drawer>
  211. </div>
  212. </template>
  213. <script>
  214. import { listStorePayment, getStorePayment, delStorePayment, addStorePayment, updateStorePayment, exportStorePayment } from "@/api/his/storePayment";
  215. import { getTask } from "@/api/common";
  216. import storePayDetails from '../../components/his/storePayDetails.vue';
  217. import { getCompanyList } from "@/api/company/company";
  218. import {list as getAppMallOptions} from '@/api/course/coursePlaySourceConfig';
  219. export default {
  220. name: "StorePayment",
  221. components: { storePayDetails },
  222. data() {
  223. return {
  224. show:{
  225. open:false,
  226. },
  227. createTime:null,
  228. refundTime:null,
  229. payTime:null,
  230. companys:[],
  231. // 遮罩层
  232. loading: true,
  233. // 导出遮罩层
  234. exportLoading: false,
  235. // 选中数组
  236. ids: [],
  237. // 非单个禁用
  238. single: true,
  239. // 非多个禁用
  240. multiple: true,
  241. // 显示搜索条件
  242. showSearch: true,
  243. // 总条数
  244. total: 0,
  245. // 支付明细表格数据
  246. storePaymentList: [],
  247. payModeOptions:[],
  248. shareOptions:[],
  249. // 弹出层标题
  250. title: "",
  251. // 是否显示弹出层
  252. open: false,
  253. // 状态 0未支付 1已支付 -1 已退款字典
  254. statusOptions: [],
  255. busineOptitons: [],
  256. actName:"10",
  257. appMallOptions:[],
  258. // 查询参数
  259. queryParams: {
  260. pageNum: 1,
  261. pageSize: 10,
  262. payCode: null,
  263. payTypeCode: null,
  264. payMoney: null,
  265. payTime: null,
  266. tradeNo: null,
  267. userId: null,
  268. openId: null,
  269. sTime:null,
  270. eTime:null,
  271. businessType: null,
  272. businessId: null,
  273. status: null,
  274. bankTransactionId: null,
  275. bankSerialNo: null,
  276. refundMoney: null,
  277. refundTime: null,
  278. storeId: null,
  279. businessCode:null,
  280. phone:null,
  281. coursePlaySourceConfigId:null,
  282. },
  283. // 表单参数
  284. form: {},
  285. // 表单校验
  286. rules: {
  287. }
  288. };
  289. },
  290. created() {
  291. getCompanyList().then(response => {
  292. this.companys = response.data;
  293. });
  294. this.getList();
  295. this.getDicts("sys_store_payment_status").then(response => {
  296. this.statusOptions = response.data;
  297. });
  298. this.getDicts("sys_store_payment_business_type").then(response => {
  299. this.busineOptions = response.data;
  300. });
  301. this.getDicts("sys_pay_mode").then(response => {
  302. this.payModeOptions = response.data;
  303. });
  304. this.getDicts("sys_store_payment_share_status").then(response => {
  305. this.shareOptions = response.data;
  306. });
  307. // 获取小程序选项列表
  308. this.getAppMallOptions();
  309. },
  310. methods: {
  311. handleClickX(tab, event) {
  312. if(tab.name=="10"){
  313. this.queryParams.status=null;
  314. }else{
  315. this.queryParams.status=tab.name;
  316. }
  317. this.handleQuery();
  318. },
  319. /** 查询支付明细列表 */
  320. getList() {
  321. this.loading = true;
  322. listStorePayment(this.queryParams).then(response => {
  323. this.storePaymentList = response.rows;
  324. this.total = response.total;
  325. this.loading = false;
  326. });
  327. },
  328. // 取消按钮
  329. cancel() {
  330. this.open = false;
  331. this.reset();
  332. },
  333. // 表单重置
  334. reset() {
  335. this.form = {
  336. paymentId: null,
  337. payCode: null,
  338. payTypeCode: null,
  339. payMoney: null,
  340. payTime: null,
  341. createTime: null,
  342. tradeNo: null,
  343. userId: null,
  344. openId: null,
  345. businessType: null,
  346. businessId: null,
  347. status: 0,
  348. remark: null,
  349. bankTransactionId: null,
  350. bankSerialNo: null,
  351. refundMoney: null,
  352. refundTime: null,
  353. storeId: null
  354. };
  355. this.resetForm("form");
  356. },
  357. /** 搜索按钮操作 */
  358. handleQuery() {
  359. this.queryParams.pageNum = 1;
  360. this.getList();
  361. },
  362. /** 重置按钮操作 */
  363. resetQuery() {
  364. this.resetForm("queryForm");
  365. this.createTime=null;
  366. this.queryParams.sTime=null;
  367. this.queryParams.eTime=null;
  368. this.queryParams.refundBeginTime=null;
  369. this.queryParams.refundEndTime=null;
  370. this.queryParams.payBeginTime=null;
  371. this.queryParams.payEndTime=null;
  372. this.refundTime=null
  373. this.payTime=null
  374. this.handleQuery();
  375. },
  376. change(){
  377. if(this.createTime!=null){
  378. this.queryParams.sTime=this.createTime[0];
  379. this.queryParams.eTime=this.createTime[1];
  380. }else{
  381. this.queryParams.sTime=null;
  382. this.queryParams.eTime=null;
  383. }
  384. if(this.refundTime!=null){
  385. this.queryParams.refundBeginTime=this.refundTime[0];
  386. this.queryParams.refundEndTime=this.refundTime[1];
  387. }else{
  388. this.queryParams.refundBeginTime=null;
  389. this.queryParams.refundEndTime=null;
  390. }
  391. if(this.payTime!=null){
  392. this.queryParams.payBeginTime=this.payTime[0];
  393. this.queryParams.payEndTime=this.payTime[1];
  394. }else{
  395. this.queryParams.payBeginTime=null;
  396. this.queryParams.payEndTime=null;
  397. }
  398. },
  399. handledetails(row){
  400. this.show.open=true;
  401. setTimeout(() => {
  402. this.$refs.Details.getDetails(row.paymentId);
  403. }, 1);
  404. },
  405. // 多选框选中数据
  406. handleSelectionChange(selection) {
  407. this.ids = selection.map(item => item.paymentId)
  408. this.single = selection.length!==1
  409. this.multiple = !selection.length
  410. },
  411. /** 新增按钮操作 */
  412. handleAdd() {
  413. this.reset();
  414. this.open = true;
  415. this.title = "添加支付明细";
  416. },
  417. /** 修改按钮操作 */
  418. handleUpdate(row) {
  419. this.reset();
  420. const paymentId = row.paymentId || this.ids
  421. getStorePayment(paymentId).then(response => {
  422. this.form = response.data;
  423. this.open = true;
  424. this.title = "修改支付明细";
  425. });
  426. },
  427. /** 提交按钮 */
  428. submitForm() {
  429. this.$refs["form"].validate(valid => {
  430. if (valid) {
  431. if (this.form.paymentId != null) {
  432. updateStorePayment(this.form).then(response => {
  433. this.msgSuccess("修改成功");
  434. this.open = false;
  435. this.getList();
  436. });
  437. } else {
  438. addStorePayment(this.form).then(response => {
  439. this.msgSuccess("新增成功");
  440. this.open = false;
  441. this.getList();
  442. });
  443. }
  444. }
  445. });
  446. },
  447. /** 删除按钮操作 */
  448. handleDelete(row) {
  449. const paymentIds = row.paymentId || this.ids;
  450. this.$confirm('是否确认删除支付明细编号为"' + paymentIds + '"的数据项?', "警告", {
  451. confirmButtonText: "确定",
  452. cancelButtonText: "取消",
  453. type: "warning"
  454. }).then(function() {
  455. return delStorePayment(paymentIds);
  456. }).then(() => {
  457. this.getList();
  458. this.msgSuccess("删除成功");
  459. }).catch(() => {});
  460. },
  461. /** 导出按钮操作 */
  462. handleExport() {
  463. var that=this;
  464. const queryParams = this.queryParams;
  465. this.$confirm('是否确认导出所有支付明细数据项?', "警告", {
  466. confirmButtonText: "确定",
  467. cancelButtonText: "取消",
  468. type: "warning"
  469. }).then(() => {
  470. this.exportLoading = true;
  471. return exportStorePayment(queryParams);
  472. }).then(response => {
  473. if(response.code==200){
  474. that.msgSuccess(response.msg);
  475. that.taskId=response.data;
  476. that.time=setInterval(function(){
  477. //查订单
  478. getTask(that.taskId).then(res => {
  479. if(res.data.status==1){
  480. that.exportLoading = false;
  481. clearTimeout(that.time)
  482. that.time=null;
  483. that.download(res.data.fileUrl);
  484. }
  485. });
  486. },10000);
  487. }
  488. }).catch(() => {});
  489. },
  490. // 获取小程序选项列表
  491. getAppMallOptions() {
  492. getAppMallOptions({pageNum:1,pageSize:100,isMall:1}).then(response => {
  493. this.appMallOptions = response.rows;
  494. })
  495. },
  496. }
  497. };
  498. </script>