|
|
@@ -1,6 +1,37 @@ |
|
|
|
<template> |
|
|
|
<view class="lr-form-container"> |
|
|
|
<view> |
|
|
|
<l-input v-model="StuInfoFreshData.StuNo" disabled title="学号" placeholder="请填写学号" right/> |
|
|
|
<l-input v-model="StuInfoFreshData.StuName" disabled title="姓名" placeholder="请填写学号" right /> |
|
|
|
<l-input :value="displayListItem(StuInfoFreshData, 'ClassNo')" disabled title="班级" placeholder="请填写班级" right /> |
|
|
|
<l-input :value="displayListItem(StuInfoFreshData, 'DeptNo')" disabled title="系别" placeholder="请填写系别" right /> |
|
|
|
<!-- 姓名 StuName 班级 className 系别 deptName FinaChargesStandardList [缴费项目 ChargeItemName 收费标准 Standard 本次实缴 SJAmount] --> |
|
|
|
<l-customform-table |
|
|
|
@input="($event)=>{FinaChargesStandardList = $event}" |
|
|
|
:value="FinaChargesStandardList" |
|
|
|
:item="item" |
|
|
|
:edit="false" |
|
|
|
/> |
|
|
|
<view style="margin-top: 8px;"> |
|
|
|
<l-input v-model="PayFeeTotal" disabled title="应缴合计" disabled right /> |
|
|
|
<l-input v-model="payfeetotal" disabled title="实缴合计" disabled right /> |
|
|
|
<l-input v-model="YJAmount" disabled title="已缴金额" disabled right /> |
|
|
|
</view> |
|
|
|
<!-- <tki-qrcode |
|
|
|
v-if="qrCodeUrl" |
|
|
|
ref="qrcode" |
|
|
|
:val="qrCodeUrl" |
|
|
|
:size="300" |
|
|
|
:onval="true" |
|
|
|
:loadMake="true" |
|
|
|
/> --> |
|
|
|
<view style="display:flex;justify-content: center;padding-top: 18px;"> |
|
|
|
<image v-if="qrCodeUrl" :src="qrCodeUrl" mode="widthFix"></image> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<!-- :edit="isEdit(item)" --> |
|
|
|
<!-- @input="setValue(item.__valuePath__, $event)" --> |
|
|
|
<!-- <view> |
|
|
|
<l-select v-model="queryData.PayFeeStatus" :range="dataSource.PayStatus" title="线上缴费状态" placeholder="请选择" /> |
|
|
|
</view> |
|
|
|
<view> |
|
|
@@ -8,22 +39,40 @@ |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<l-select v-model="queryData.OnsitePayFeeStatus" :range="dataSource.OnsitePayStatus" title="现场缴费状态" placeholder="请选择" /> |
|
|
|
</view> |
|
|
|
<view class="btn" @click="tapBtn"> |
|
|
|
提交 |
|
|
|
</view> --> |
|
|
|
<view v-if="ready" class="btn" @click="tapBtn('getQRCode')"> |
|
|
|
生成二维码 |
|
|
|
</view> |
|
|
|
<view v-if="ready" class="btn" @click="tapBtn('getPayRes')"> |
|
|
|
查询缴费结果 |
|
|
|
</view> |
|
|
|
<view class="btn" style="background:;margin-bottom: 18px;" @click="NAV_BACK()"> |
|
|
|
取消缴费 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import moment from 'moment'; |
|
|
|
import get from 'lodash/get'; |
|
|
|
import set from 'lodash/set'; |
|
|
|
import pickBy from 'lodash/pickBy'; |
|
|
|
import mapValues from 'lodash/mapValues'; |
|
|
|
import tkiQrcode from "@/components/tki-qrcode/tki-qrcode.vue" |
|
|
|
export default{ |
|
|
|
components:{ |
|
|
|
tkiQrcode, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
disabled: false, |
|
|
|
ready:false, |
|
|
|
// 数据源 |
|
|
|
dataSource: { |
|
|
|
PayStatus: Object.values(this.GET_GLOBAL('dataDictionary').PayStatus).map(t => ({ value: t.value, text: t.text })), |
|
|
|
OnsitePayStatus: Object.values(this.GET_GLOBAL('dataDictionary').OnsitePayStatus).map(t => ({ value: t.value, text: t.text })) |
|
|
|
ClassNo:[], |
|
|
|
DeptNo:[], |
|
|
|
// PayStatus: Object.values(this.GET_GLOBAL('dataDictionary').PayStatus).map(t => ({ value: t.value, text: t.text })), |
|
|
|
// OnsitePayStatus: Object.values(this.GET_GLOBAL('dataDictionary').OnsitePayStatus).map(t => ({ value: t.value, text: t.text })) |
|
|
|
}, |
|
|
|
queryData: { |
|
|
|
StudentLoan: '', |
|
|
@@ -31,44 +80,205 @@ export default{ |
|
|
|
OnsitePayFeeStatus: '', |
|
|
|
StudentLoanStatus: '0' |
|
|
|
}, |
|
|
|
pageInfo:{} |
|
|
|
pageInfo:{}, |
|
|
|
scheme: { |
|
|
|
ClassNo: { |
|
|
|
type: 'select', |
|
|
|
dataSource: '1', |
|
|
|
dataSourceId: 'bjsj,classname,classno' |
|
|
|
}, |
|
|
|
DeptNo:{ |
|
|
|
type: 'dataItem', |
|
|
|
dataType: 'dataDictionary' |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
StuInfoFreshData:{}, |
|
|
|
PayFeeTotal:'', |
|
|
|
payfeetotal:'', |
|
|
|
YJAmount:'', |
|
|
|
FinaChargesStandardList:[], |
|
|
|
item:{ |
|
|
|
title:'缴费信息', |
|
|
|
fieldsData:[ |
|
|
|
{type:'label',field:'ChargeItemName',name:'缴费项目'}, |
|
|
|
{type:'label',field:'Standard',name:'收费标准'}, |
|
|
|
{type:'input',field:'SJAmount',name:'本次实缴',edit:true}, |
|
|
|
] |
|
|
|
}, |
|
|
|
qrCodeUrl:'', |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
FinaChargesStandardList: { |
|
|
|
handler (val) { |
|
|
|
console.log(val) |
|
|
|
this.getpayfeetotal() |
|
|
|
}, |
|
|
|
// 这里是关键,代表递归监听 demo 的变化 |
|
|
|
deep: true |
|
|
|
} |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
init() { |
|
|
|
// console.log(this.dataSource) |
|
|
|
async init() { |
|
|
|
this.pageInfo = this.GET_PARAM(); //获取页面传递参数 |
|
|
|
this.LOADING('加载数据中…'); |
|
|
|
this.HTTP_GET('StuInfoFresh/form', this.pageInfo.ID,'加载数据时出错').then(res => { |
|
|
|
await Promise.all([ |
|
|
|
this.FETCH_DATASOURCE('bjsj').then(data => { |
|
|
|
this.dataSource.ClassNo = data.data.map(t => ({ |
|
|
|
text: t.classname, |
|
|
|
value: t.classno |
|
|
|
})); |
|
|
|
}), |
|
|
|
|
|
|
|
this.FETCH_DATASOURCE('CdDeptInfo').then(data => { |
|
|
|
this.dataSource.DeptNo = data.data.map(t => ({ |
|
|
|
text: t.deptname, |
|
|
|
value: t.deptno |
|
|
|
})); |
|
|
|
}), |
|
|
|
|
|
|
|
() => {} |
|
|
|
]); |
|
|
|
this.HTTP_GET('/learun/payfee/getpayfeeinfo?keyValue='+this.pageInfo.Id, null,'加载数据时出错').then(res => { |
|
|
|
this.HIDE_LOADING(); |
|
|
|
// console.log(res) |
|
|
|
if(res){ |
|
|
|
let data = res.StuInfoFresh; |
|
|
|
this.queryData.StudentLoan = data.StudentLoan == null? '' : data.StudentLoan; |
|
|
|
this.queryData.PayFeeStatus = data.PayFeeStatus == null? '' : data.PayFeeStatus; |
|
|
|
this.queryData.OnsitePayFeeStatus = data.OnsitePayFeeStatus == null? '' : data.OnsitePayFeeStatus; |
|
|
|
this.disabled = data.StudentLoanStatus == "1"? true : false; |
|
|
|
if(!res){ |
|
|
|
return |
|
|
|
} |
|
|
|
if (res['FinaChargesStandardList'].length == 0) { |
|
|
|
this.TOAST("未查询到该学生收费标准!请先维护收费标准。"); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.FinaChargesStandardList = res.FinaChargesStandardList |
|
|
|
this.StuInfoFreshData = res.StuInfoFreshData |
|
|
|
this.PayFeeTotal = res.PayFeeTotal |
|
|
|
this.YJAmount = res.YJAmount |
|
|
|
this.ready = true |
|
|
|
|
|
|
|
// this.HTTP_GET('/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo&keyId=deptno'+'&key='+this.StuInfoFreshData.DeptNo).then(res=>{ |
|
|
|
// if(!res)return |
|
|
|
// this.StuInfoFreshData.deptname = res.deptname |
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
|
|
// var deptName = ""; |
|
|
|
// learun.clientdata.getAsync('custmerData', { |
|
|
|
// url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', |
|
|
|
// key: StuInfoFresh.DeptNo, |
|
|
|
// keyId: 'deptno', |
|
|
|
// callback: function (_data) { |
|
|
|
// deptName = _data['deptname']; |
|
|
|
// if (!deptName) { |
|
|
|
// deptName = "未知"; |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// let data = res.StuInfoFresh; |
|
|
|
// this.queryData.StudentLoan = data.StudentLoan == null? '' : data.StudentLoan; |
|
|
|
// this.queryData.PayFeeStatus = data.PayFeeStatus == null? '' : data.PayFeeStatus; |
|
|
|
// this.queryData.OnsitePayFeeStatus = data.OnsitePayFeeStatus == null? '' : data.OnsitePayFeeStatus; |
|
|
|
// this.disabled = data.StudentLoanStatus == "1"? true : false; |
|
|
|
}) |
|
|
|
}, |
|
|
|
tapBtn() { |
|
|
|
if(this.queryData.StudentLoan.trim() != ""){ |
|
|
|
this.queryData.StudentLoanStatus = 1; |
|
|
|
// 显示列表中的标题项 |
|
|
|
displayListItem(item, field) { |
|
|
|
const fieldItem = this.scheme[field]; |
|
|
|
const value = item[field]; |
|
|
|
|
|
|
|
switch (fieldItem.type) { |
|
|
|
case 'currentInfo': |
|
|
|
case 'organize': |
|
|
|
return fieldItem.dataType === 'time' ? value : get(this.GET_GLOBAL(fieldItem.dataType), `${value}.name`, ''); |
|
|
|
|
|
|
|
case 'radio': |
|
|
|
case 'select': |
|
|
|
const selectItem = this.dataSource[field].find(t => t.value === String(value)); |
|
|
|
return get(selectItem, 'text', ''); |
|
|
|
|
|
|
|
case 'dataItem': |
|
|
|
const sex = this.dataSource[field].find(t => t.value === String(value)); |
|
|
|
return get(sex, 'text', ''); |
|
|
|
|
|
|
|
case 'checkbox': |
|
|
|
if (!value || value.split(',').length <= 0) { |
|
|
|
return ''; |
|
|
|
} |
|
|
|
const checkboxItems = value.split(','); |
|
|
|
return this.dataSource[field] |
|
|
|
.filter(t => checkboxItems.includes(t.value)) |
|
|
|
.map(t => t.text) |
|
|
|
.join(','); |
|
|
|
|
|
|
|
case 'datetime': |
|
|
|
if (!value) { |
|
|
|
return ''; |
|
|
|
} |
|
|
|
return moment(value).format(Number(fieldItem.dateformat) === 0 ? 'YYYY年 M月 D日' : 'YYYY-MM-DD HH:mm'); |
|
|
|
|
|
|
|
default: |
|
|
|
return value === null || value === undefined ? '' : value; |
|
|
|
} |
|
|
|
}, |
|
|
|
tapBtn(action) { |
|
|
|
if(action == "getQRCode"){ |
|
|
|
let list = [],detail="",isNull=false; |
|
|
|
this.FinaChargesStandardList.forEach(item=>{ |
|
|
|
let value = 0 |
|
|
|
if(/^-?\d+(,\d{3})*(\.\d{1,2})?$/.test(item.SJAmount)){ |
|
|
|
value = Number(item.SJAmount) |
|
|
|
}else{ |
|
|
|
isNull=true |
|
|
|
} |
|
|
|
detail += item.ChargeItemCode + "!" + value + '&'; |
|
|
|
let entity = { |
|
|
|
Id: this.GUID(), |
|
|
|
ChargeItemName: item.ChargeItemName.replace(/^\s*|\s*$/g, ""), |
|
|
|
ChargeItemID: item.ChargeItemCode, |
|
|
|
YJAmount: item.Standard, |
|
|
|
SJAmount: value |
|
|
|
} |
|
|
|
list.push(entity) |
|
|
|
}) |
|
|
|
if (isNull) { |
|
|
|
this.TOAST("收费项目金额为空或错误!请检查并填写。"); |
|
|
|
return; |
|
|
|
} |
|
|
|
detail = detail.substring(0, detail.length - 1); |
|
|
|
var param = {}; |
|
|
|
//param.LoanMoney = $('#LoanMoney').val(); |
|
|
|
param.PayFeeDetail = detail; |
|
|
|
param.PayMoney = this.payfeetotal; |
|
|
|
this.LOADING('正在生成付款信息请稍等…'); |
|
|
|
// $("#confirmPayFee").hide(); |
|
|
|
console.log({ strEntity: param, detailList: list }); |
|
|
|
this.HTTP_POST('/learun/payfee/generateqrcode?keyValue=' + this.pageInfo.Id, { strEntity: JSON.stringify(param), detailList: JSON.stringify(list) }).then((res)=> { |
|
|
|
this.HIDE_LOADING(); |
|
|
|
if(!res){ |
|
|
|
return |
|
|
|
} |
|
|
|
this.qrCodeUrl = this.CONFIG("webHost")+res.imgUrl |
|
|
|
console.log(this.CONFIG("webHost")+res.imgUrl) |
|
|
|
// $('#qrcodeImg').attr('src', res.info); |
|
|
|
}); |
|
|
|
} |
|
|
|
let _postData = { |
|
|
|
keyValue: this.pageInfo.ID, |
|
|
|
strEntity: JSON.stringify(this.queryData) |
|
|
|
if(action == "getPayRes"){ |
|
|
|
this.StuInfoFreshData = {} |
|
|
|
this.PayFeeTotal = '' |
|
|
|
this.payfeetotal = '' |
|
|
|
this.YJAmount = '' |
|
|
|
this.FinaChargesStandardList = [] |
|
|
|
this.init() |
|
|
|
} |
|
|
|
this.LOADING('提交数据中…'); |
|
|
|
this.HTTP_POST('StuInfoFresh/save', _postData,'加载数据时出错').then(res => { |
|
|
|
this.HIDE_LOADING(); |
|
|
|
console.log(res) |
|
|
|
if(res){ |
|
|
|
this.TOAST('提交数据成功'); |
|
|
|
this.EMIT('stuInfoFreshPayFee'); |
|
|
|
this.NAV_BACK() |
|
|
|
}, |
|
|
|
getpayfeetotal(){ |
|
|
|
let value = 0 |
|
|
|
this.FinaChargesStandardList.map(item=>{ |
|
|
|
if(/^-?\d+(,\d{3})*(\.\d{1,2})?$/.test(item.SJAmount)){ |
|
|
|
value += Number(item.SJAmount) |
|
|
|
} |
|
|
|
}) |
|
|
|
this.payfeetotal = value |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
@@ -78,5 +288,7 @@ export default{ |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="less" scoped> |
|
|
|
@import '~@/common/css/customlist.less'; |
|
|
|
@import '~@/common/css/sidepage.less'; |
|
|
|
</style> |
|
|
|
|