123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391 |
- <template>
- <el-dialog width="854px" title="收费单" class="chargeDialog" :visible.sync="visibility" :close-on-click-modal="isClose"
- :close-on-press-escape="isClose">
-
- <el-form :model="form" ref="formValue" label-width="100px">
-
- <el-form-item label="日期:" style="width:100%;">
- <div>{{record_date}}</div>
- </el-form-item>
-
- <el-form-item label="总计:" prop="name" :validate-event="is_Name">
- <el-input type="number" v-model="form.total" :disabled="true"></el-input>
- </el-form-item>
- <el-form-item label="医保:" prop="name" :validate-event="is_Name">
- <el-input type="number" v-model="form.medical_insurance_price" :disabled="true"></el-input>
- </el-form-item>
-
-
- <el-form-item label="自费:" prop="age" :validate-event="is_Name">
- <el-input type="number" v-model="form.private_price" :disabled="true"></el-input>
- </el-form-item>
-
- <el-form-item label="个账支出:" prop="age" :validate-event="is_Name">
- <el-input type="number" v-model="form.acct_pay" :disabled="true"></el-input>
- </el-form-item>
-
-
- <el-form-item label="个人现金支出:" prop="age" :validate-event="is_Name">
- <el-input type="number" v-model="form.psn_pay" :disabled="true"></el-input>
- </el-form-item>
-
-
- <el-form-item label="个人现金支付方式:" style="width:100%;">
- <el-checkbox v-model="form.dec_way" @change="changedecimal">
- 使用押金余额抵扣(当前押金余额为¥{{decimal}})
- </el-checkbox>
- <span v-if="form.dec_way == true">
- <el-form-item class="specialFormItem" >
- <div style="display:flex;">
-
- <input class="input_style" v-model="form.tmp_decimal" onkeyup="this.value = this.value.replace(/[^\d.]/g,'');" @input="lilili"></input>元
- </div>
- </el-form-item>
- </span>
- </el-form-item>
-
-
- <el-form-item label="" style="width:100%;">
-
- <el-radio-group v-model="form.pay_way">
- <el-radio :label="index" v-for="(item,index) in payWays" :key="index">{{ item.label }}</el-radio>
- </el-radio-group>
- </el-form-item>
-
-
- <el-form-item label="付款金额:" prop="id_card" :validate-event="is_Name">
- <el-input type="number" v-model="form.pay_price" :disabled="true"></el-input>
- </el-form-item>
-
-
- <el-form-item label="付款卡号:" prop="id_card" :validate-event="is_Name">
- <el-input v-model="form.pay_card_no"></el-input>
- </el-form-item>
-
- <el-form-item class="specialFormItem" label="折扣金额:">
- <div style="display:flex;">
- <el-input v-model="form.discount_price" :disabled="form.preferential_price != 0" @change="changeDiscountPrice"></el-input>
- </div>
- </el-form-item>
- <el-form-item class="specialFormItem" label="优惠金额:">
- <div style="display:flex;">
- <el-input v-model="form.preferential_price" :disabled="form.discount_price != 0" @change="changePreferentialPrice"></el-input>
- </div>
- </el-form-item>
- <el-form-item label="实收金额:">
- <div style="display:flex;">
- <el-input v-model="form.reality_price" @change="realityPrice"></el-input>
- </div>
- </el-form-item>
- <el-form-item label="找回金额:">
- <div style="display:flex;">
- <el-input v-model.number="form.found_price"></el-input>
- </div>
- </el-form-item>
-
- <el-form-item label="发票编码:">
- <div style="display:flex;">
- <el-input v-model.number="form.fapiao_code"></el-input>
- </div>
- </el-form-item>
-
-
- <el-form-item label="发票号码:">
- <div style="display:flex;">
- <el-input v-model.number="form.fapiao_number"></el-input>
- </div>
- </el-form-item>
-
-
- </el-form>
-
- <span slot="footer" class="dialog-footer">
- <el-button @click="cancel('formValue')">取 消</el-button>
- <el-button type="primary" @click="confirm('formValue')">确 定</el-button>
- </span>
- </el-dialog>
-
- </template>
-
- <script>
- import { uParseTime } from '@/utils/tools'
- import {
- idtobalance
- }from "@/api/deposit";
-
- export default {
- name: 'chargeDialog',
-
- data() {
-
- return {
- tmp_pay:"",
- isshow:false,
- id:0,
- decimal:0,
- record_date:'',
- form: {
- medical_insurance_price:0,
- private_price:'',
- pay_way:'',
- dec_way:'false',
- tmp_decimal:"",
- pay_price:'',
- pay_card_no:'',
- discount_price:'',
- preferential_price:'',
- reality_price:'',
- found_price:'',
- total:0,
- fapiao_code:"",
- fapiao_number:"",
- order:null,
- acct_pay:'',
- psn_pay:'',
- },
- payWays: [
- {value: 1, label: '现金'},
-
-
-
- {value: 5, label: '医保卡'},
-
- ],
- total:"",
-
- visibility: false,
- labelPosition: 'right',
- isClose: false,
-
- resetForm: {
- medical_insurance_price:'',
- private_price:'',
- pay_way:'',
- pay_price:'',
- pay_card_no:'',
- discount_price:'',
- preferential_price:'',
- reality_price:'',
- found_price:'',
- fapiao_code:"",
- fapiao_number:"",
- acct_pay:"",
- psn_pay:"",
- },
-
- }
- },
- props: {
-
- titles: {
- type: String,
- default: ''
- },
- formValue: {
- type: Object
- },
- type: {
- type: Number,
- default: 1
-
- },
- isCreated: {
- type: Number,
- default: 1
-
- }
- },
- created(){
- },
- methods: {
- init(){
- console.log("this.tmp_decimal",this.tmp_decimal)
- console.log("this.tmp_decimal",this.tmp_decimal)
- console.log("this.tmp_decimal",this.tmp_decimal)
- },
- lilili(val){
- console.log("this.form.tmp_decimal",this.form.tmp_decimal)
-
- if(this.form.tmp_decimal == ""){
- this.form.pay_price = this.tmp_pay
- return
- }
- console.log("val",val)
- if (parseFloat(this.form.tmp_decimal) > parseFloat(this.form.private_price)){
-
- this.$message.error("押金不得大于自费金额");
- this.form.tmp_decimal = ""
- this.form.pay_price = this.tmp_pay
- return
- }
-
-
- this.form.pay_price = (parseFloat(this.form.private_price)*10000 - parseFloat(this.form.tmp_decimal)*10000)/10000
- },
- changedecimal(){
- console.log("this.form.dec_way前",this.form.dec_way)
- this.$forceUpdate();
- this.isshow = this.form.dec_way
-
- if (this.isshow == false){
-
- this.form.tmp_decimal = 0
- this.form.pay_price = this.tmp_pay
- }else {
-
- this.tmp_pay = this.form.pay_price
- if (parseFloat(this.form.tmp_decimal) > parseFloat(this.form.private_price)){
- this.form.tmp_decimal = 0
-
- this.$message.error("押金不得大于自费金额");
- return
- }
-
- this.tmp_pay = this.form.pay_price
- this.form.pay_price = (parseFloat(this.form.private_price)*10000 - parseFloat(this.form.tmp_decimal)*10000)/10000
- }
- },
-
- updateconfig(){
- var params = {
- his_patient_id: this.id,
- }
- idtobalance(params).then((res) => {
- if (res.data.state == 1){
- this.decimal = res.data.data.list;
- }
- })
- },
- show: function (total,order,id) {
-
-
-
-
-
-
-
-
-
-
- this.form.tmp_decimal = 0
- this.tmp_pay = 0
- this.id = id
- this.form.dec_way = false
- this.updateconfig()
- this.form.total = total
- this.form.private_price = total
- this.form.pay_price = total
- this.form.total = total + this.form.medical_insurance_price
- this.form.discount_price = 0.0
- this.form.preferential_price = 0.0
-
-
-
- this.form.fapiao_code =""
- this.form.fapiao_number = ""
- this.order = order
-
- if(this.order && this.order.id > 0){
- this.form.acct_pay = this.order.acct_pay
- this.form.psn_pay = this.order.psn_cash_pay
- this.form.total = this.order.medfee_sumamt
- this.form.pay_price = (this.order.medfee_sumamt).toFixed(2)
- this.form.medical_insurance_price = this.order.fund_pay_sumamt
- this.form.private_price = this.order.psn_part_amt
- }
-
- this.visibility = true
-
- }, hide: function () {
- this.form = Object.assign({}, this.resetForm)
- this.loadingtwo = false
- this.visibility = false
- }, cancel: function (formName) {
- this.form.tmp_decimal = 0
- this.tmp_pay = 0
- this.form.dec_way = false
- this.$emit('cancel', this.getValue())
- this.$refs['formValue'].resetFields()
- },
- confirm: function (formName) {
- if (parseFloat(this.form.tmp_decimal) > parseFloat(this.decimal)){
- this.$message.error("押金余额不足");
- return
- }
- this.$refs['formValue'].validate((valid) => {
- if (valid) {
- let value = {}
- value = this.getValue()
- this.$emit('confirm', value)
- this.loadingtwo = true
- }
- })
- },
- getValue: function () {
- let form = {}
- form = this.form
- return form
- },
- realityPrice(val){
- if(val < (this.form.total - this.form.discount_price - this.form.preferential_price)){
- this.$message.error('实收金额不能小于收费金额')
- return
- }
- this.form.found_price = parseInt(val) - parseInt(this.form.total) + parseInt(this.form.discount_price) + parseInt(this.form.preferential_price)
- },
- changeDiscountPrice(val){
- if(val > this.form.total){
- this.$message.error('折扣金额不能超过费用总额')
- return
- }
- this.form.reality_price = parseInt(this.form.total) - parseInt(val) - parseInt(this.form.preferential_price)
- },
- changePreferentialPrice(val){
- if(val > this.form.total){
- this.$message.error('优惠金额不能超过费用总额')
- return
- }
- this.form.reality_price = parseInt(this.form.total) - parseInt(val) - parseInt(this.form.discount_price)
- }
- },
- mounted() {
- var nowDate = new Date()
- var nowYear = nowDate.getFullYear()
- var nowMonth = nowDate.getMonth() + 1
- var nowDay = nowDate.getDate()
-
- var nowHours = nowDate.getHours()
- var nowMin = nowDate.getMinutes()
- var nowSecond = nowDate.getSeconds()
-
- this.record_date =
- nowYear +
- '-' +
- (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
- '-' +
- (nowDay < 10 ? '0' + nowDay : nowDay)+" "+(nowHours < 10 ? '0' + nowHours : nowHours)+":"+(nowMin < 10 ? '0' + nowMin : nowMin)
- }
-
- }
- </script>
-
- <style lang="scss" scoped>
- .chargeDialog{
- .el-form{
- display: flex;
- flex-wrap: wrap;
- }
- .el-form-item{
- width:50%;
- }
- }
- .input_style {
- border-radius: 5px;
- border: 1px solid #dddddd;
- }
- .input_style:focus {
- outline:none;
- border: 1px solid #66b1ff;
- }
- </style>
|