123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- import { payHistory } from './service';
- import history from '../../utils/history';
- import { tradePay } from '../../utils/tradePay';
- import { reportCmPV_YL } from '../../utils/cloudMonitorHelper';
- Component({
- props: {},
- data: {
- empty: true,
- clinicCard: {},
- filterParams: {
- type: '9',
- cardNum: '',
- endTime: '',
- startTime: '',
- medicCards: []
- },
- /* 赛选项目 */
- typeOptions: [{
- value: '1',
- label: '挂号订单'
- }, {
- value: '2',
- label: '充值订单'
- }, {
- value: '3',
- label: '诊间订单'
- }],
- statusOptions: [{
- value: '0',
- label: '待支付'
- }, {
- value: '1',
- label: '已支付'
- }, {
- value: '9',
- label: '已取消'
- }]
- },
- didMount() {
- /* 服务预警,缴费记录查询 */
- reportCmPV_YL({
- title: '缴费记录查询'
- });
- },
- methods: {
- onFilterHandel(filters) {
- this.filters = filters;
- this.scrollRef.refresh();
- },
- saveRef(ref) {
- this.scrollRef = ref;
- },
- saveSubscribe(ref) {
- this.subscribe = ref;
- },
- onService(page) {
- const {
- type
- } = this.filters || {};
- return payHistory({ ...this.filters,
- type: type || '9',
- ...page
- });
- },
- // 进入详情
- toDetail(e) {
- history.push({
- title: '缴费详情',
- query: e.target.dataset,
- pageType: 'hospital-payment-detail'
- });
- },
- // 付款
- async onPayment(e) {
- const {
- medicareBinded = false,
- item
- } = e.target.dataset; // 同意订阅消息后发起支付
- // 挂号
- if (item.type === 1) {
- await tradePay({
- type: item.type,
- idNum: item.outTradeNo,
- depName: item.depName
- }, {
- tradeType: 'Appointment'
- });
- } else if (item.type === 2) {
- // 充值
- await tradePay({
- type: item.type,
- idNum: item.outTradeNo,
- amount: item.amount
- }, {
- tradeType: 'Appointment'
- });
- } else {
- // 门诊订单
- await tradePay({
- useBalance: !medicareBinded,
- useMedicare: medicareBinded,
- outTradeNo: item.outTradeNo
- }, {
- tradeType: 'Outpatient'
- });
- } // 支付成功去订单详情页
- this.toDetail({
- target: {
- dataset: {
- outTradeNo: item.outTradeNo,
- type: item.type
- }
- }
- }); // 发起消息订阅
- this.subscribe.subscribeMessage();
- }
- }
- });
|