Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

chargeDialog.vue 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. <template><!--门诊收费-->
  2. <el-dialog width="854px" title="收费单" class="chargeDialog" :visible.sync="visibility" :close-on-click-modal="isClose"
  3. :close-on-press-escape="isClose">
  4. <el-form :model="form" ref="formValue" label-width="100px">
  5. <el-form-item label="日期:" style="width:100%;">
  6. <div>{{record_date}}</div>
  7. </el-form-item>
  8. <el-form-item label="总计:" prop="name" :validate-event="is_Name">
  9. <el-input type="number" v-model="form.total" :disabled="true"></el-input>
  10. </el-form-item>
  11. <el-form-item label="医保:" prop="name" :validate-event="is_Name">
  12. <el-input type="number" v-model="form.medical_insurance_price" :disabled="true"></el-input>
  13. </el-form-item>
  14. <el-form-item label="自费:" prop="age" :validate-event="is_Name">
  15. <el-input type="number" v-model="form.private_price" :disabled="true"></el-input>
  16. </el-form-item>
  17. <el-form-item label="个账支出:" prop="age" :validate-event="is_Name">
  18. <el-input type="number" v-model="form.acct_pay" :disabled="true"></el-input>
  19. </el-form-item>
  20. <el-form-item label="个人现金支出:" prop="age" :validate-event="is_Name">
  21. <el-input type="number" v-model="form.psn_pay" :disabled="true"></el-input>
  22. </el-form-item>
  23. <el-form-item label="个人现金支付方式:" style="width:100%;"><!--门诊-->
  24. <el-checkbox v-model="form.dec_way" @change="changedecimal">
  25. 使用押金余额抵扣(当前押金余额为¥{{decimal}})
  26. </el-checkbox>
  27. <span v-if="form.dec_way == true">
  28. <el-form-item class="specialFormItem" >
  29. <div style="display:flex;">
  30. <!-- 这里不要改成el-input,因为使用el-input会导致一个奇怪的bug,千万不要改!!!!!!!!!!!!!!!!!!!!-->
  31. <input class="input_style" v-model="form.tmp_decimal" onkeyup="this.value = this.value.replace(/[^\d.]/g,'');" @input="lilili"></input>元
  32. </div>
  33. </el-form-item>
  34. </span>
  35. </el-form-item>
  36. <el-form-item label="" style="width:100%;">
  37. <el-radio-group v-model="form.pay_way">
  38. <el-radio :label="index" v-for="(item,index) in payWays" :key="index">{{ item.label }}</el-radio>
  39. </el-radio-group>
  40. </el-form-item>
  41. <el-form-item label="付款金额:" prop="id_card" :validate-event="is_Name">
  42. <el-input type="number" v-model="form.pay_price" :disabled="true"></el-input>
  43. </el-form-item>
  44. <el-form-item label="付款卡号:" prop="id_card" :validate-event="is_Name">
  45. <el-input v-model="form.pay_card_no"></el-input>
  46. </el-form-item>
  47. <el-form-item class="specialFormItem" label="折扣金额:">
  48. <div style="display:flex;">
  49. <el-input v-model="form.discount_price" :disabled="form.preferential_price != 0" @change="changeDiscountPrice"></el-input>
  50. </div>
  51. </el-form-item>
  52. <el-form-item class="specialFormItem" label="优惠金额:">
  53. <div style="display:flex;">
  54. <el-input v-model="form.preferential_price" :disabled="form.discount_price != 0" @change="changePreferentialPrice"></el-input>
  55. </div>
  56. </el-form-item>
  57. <el-form-item label="实收金额:">
  58. <div style="display:flex;">
  59. <el-input v-model="form.reality_price" @change="realityPrice"></el-input>
  60. </div>
  61. </el-form-item>
  62. <el-form-item label="找回金额:">
  63. <div style="display:flex;">
  64. <el-input v-model.number="form.found_price"></el-input>
  65. </div>
  66. </el-form-item>
  67. <el-form-item label="发票编码:">
  68. <div style="display:flex;">
  69. <el-input v-model.number="form.fapiao_code"></el-input>
  70. </div>
  71. </el-form-item>
  72. <el-form-item label="发票号码:">
  73. <div style="display:flex;">
  74. <el-input v-model.number="form.fapiao_number"></el-input>
  75. </div>
  76. </el-form-item>
  77. </el-form>
  78. <span slot="footer" class="dialog-footer">
  79. <el-button @click="cancel('formValue')">取 消</el-button>
  80. <el-button type="primary" @click="confirm('formValue')">确 定</el-button>
  81. </span>
  82. </el-dialog>
  83. </template>
  84. <script>
  85. import { uParseTime } from '@/utils/tools'
  86. import {
  87. idtobalance
  88. }from "@/api/deposit";
  89. export default {
  90. name: 'chargeDialog',
  91. data() {
  92. return {
  93. tmp_pay:"",//临时付款金额
  94. isshow:false,
  95. id:0,
  96. decimal:0,//当前押金余额
  97. record_date:'',
  98. form: {
  99. medical_insurance_price:0,
  100. private_price:'',//自费12
  101. pay_way:'',
  102. dec_way:'false',//是否使用押金支付
  103. tmp_decimal:"",//本次使用的押金
  104. pay_price:'',
  105. pay_card_no:'',
  106. discount_price:'',
  107. preferential_price:'',
  108. reality_price:'',
  109. found_price:'',
  110. total:0,
  111. fapiao_code:"",
  112. fapiao_number:"",
  113. order:null,
  114. acct_pay:'',
  115. psn_pay:'',
  116. },
  117. payWays: [
  118. {value: 1, label: '现金'},
  119. // {value: 2, label: '银行卡'},
  120. // {value: 3, label: '微信'},
  121. // {value: 4, label: '支付宝'},
  122. {value: 5, label: '医保卡'},
  123. ],
  124. total:"",
  125. visibility: false,
  126. labelPosition: 'right',
  127. isClose: false,
  128. resetForm: {
  129. medical_insurance_price:'',
  130. private_price:'',
  131. pay_way:'',
  132. pay_price:'',
  133. pay_card_no:'',
  134. discount_price:'',
  135. preferential_price:'',
  136. reality_price:'',
  137. found_price:'',
  138. fapiao_code:"",
  139. fapiao_number:"",
  140. acct_pay:"",
  141. psn_pay:"",
  142. },
  143. }
  144. },
  145. props: {
  146. titles: {
  147. type: String,
  148. default: ''
  149. },
  150. formValue: {
  151. type: Object
  152. },
  153. type: {
  154. type: Number,
  155. default: 1
  156. },
  157. isCreated: {
  158. type: Number,
  159. default: 1
  160. }
  161. },
  162. created(){
  163. },
  164. methods: {
  165. init(){
  166. console.log("this.tmp_decimal",this.tmp_decimal)
  167. console.log("this.tmp_decimal",this.tmp_decimal)
  168. console.log("this.tmp_decimal",this.tmp_decimal)
  169. },
  170. lilili(val){
  171. console.log("this.form.tmp_decimal",this.form.tmp_decimal)
  172. //null undefined
  173. if(this.form.tmp_decimal == ""){
  174. this.form.pay_price = this.tmp_pay
  175. return
  176. }
  177. console.log("val",val)
  178. if (parseFloat(this.form.tmp_decimal) > parseFloat(this.form.private_price)){
  179. // alert("押金不得大于自费金额")
  180. this.$message.error("押金不得大于自费金额");
  181. this.form.tmp_decimal = ""
  182. this.form.pay_price = this.tmp_pay
  183. return
  184. }
  185. // this.form.private_price = parseFloat(this.form.tmp_decimal) + parseFloat(this.form.pay_price)
  186. this.form.pay_price = (parseFloat(this.form.private_price)*10000 - parseFloat(this.form.tmp_decimal)*10000)/10000
  187. },
  188. changedecimal(){
  189. console.log("this.form.dec_way前",this.form.dec_way)
  190. this.$forceUpdate();
  191. this.isshow = this.form.dec_way
  192. // console.log("this.form.dec_way后",this.form.dec_way)
  193. if (this.isshow == false){
  194. // this.form.private_price = parseFloat(this.form.pay_price)
  195. this.form.tmp_decimal = 0
  196. this.form.pay_price = this.tmp_pay
  197. }else {
  198. //储存临时押金
  199. this.tmp_pay = this.form.pay_price
  200. if (parseFloat(this.form.tmp_decimal) > parseFloat(this.form.private_price)){
  201. this.form.tmp_decimal = 0
  202. // alert("押金不得大于自费金额")
  203. this.$message.error("押金不得大于自费金额");
  204. return
  205. }
  206. // this.form.private_price = parseFloat(this.form.tmp_decimal) + parseFloat(this.form.pay_price)
  207. this.tmp_pay = this.form.pay_price
  208. this.form.pay_price = (parseFloat(this.form.private_price)*10000 - parseFloat(this.form.tmp_decimal)*10000)/10000
  209. }
  210. },
  211. //查询用户当前的余额
  212. updateconfig(){
  213. var params = {
  214. his_patient_id: this.id,
  215. }
  216. idtobalance(params).then((res) => {
  217. if (res.data.state == 1){
  218. this.decimal = res.data.data.list;
  219. }
  220. })
  221. },
  222. show: function (total,order,id) {
  223. // alert("total",total)
  224. // console.log("===========")
  225. // console.log(total)
  226. // alert("order",orde
  227. // console.log(order)
  228. // alert("id",id)
  229. // console.log("wwwwwwwwwwwwww")
  230. // console.log(id)
  231. // console.log("++++++++++++")
  232. //初始化
  233. this.form.tmp_decimal = 0
  234. this.tmp_pay = 0
  235. this.id = id
  236. this.form.dec_way = false
  237. this.updateconfig()
  238. this.form.total = total
  239. this.form.private_price = total
  240. this.form.pay_price = total
  241. this.form.total = total + this.form.medical_insurance_price
  242. this.form.discount_price = 0.0
  243. this.form.preferential_price = 0.0
  244. this.form.fapiao_code =""
  245. this.form.fapiao_number = ""
  246. this.order = order
  247. if(this.order && this.order.id > 0){
  248. this.form.acct_pay = this.order.acct_pay
  249. this.form.psn_pay = this.order.psn_cash_pay
  250. this.form.total = this.order.medfee_sumamt
  251. this.form.pay_price = (this.order.medfee_sumamt).toFixed(2)
  252. this.form.medical_insurance_price = this.order.fund_pay_sumamt
  253. this.form.private_price = this.order.psn_part_amt
  254. }
  255. this.visibility = true
  256. }, hide: function () {
  257. this.form = Object.assign({}, this.resetForm)
  258. this.loadingtwo = false
  259. this.visibility = false
  260. }, cancel: function (formName) {
  261. this.form.tmp_decimal = 0
  262. this.tmp_pay = 0
  263. this.form.dec_way = false
  264. this.$emit('cancel', this.getValue())
  265. this.$refs['formValue'].resetFields()
  266. },
  267. confirm: function (formName) {
  268. if (parseFloat(this.form.tmp_decimal) > parseFloat(this.decimal)){
  269. this.$message.error("押金余额不足");
  270. return
  271. }
  272. this.$refs['formValue'].validate((valid) => {
  273. if (valid) {
  274. let value = {}
  275. value = this.getValue()
  276. this.$emit('confirm', value)
  277. this.loadingtwo = true
  278. }
  279. })
  280. },
  281. getValue: function () {
  282. let form = {}
  283. form = this.form
  284. return form
  285. },
  286. realityPrice(val){
  287. if(val < (this.form.total - this.form.discount_price - this.form.preferential_price)){
  288. this.$message.error('实收金额不能小于收费金额')
  289. return
  290. }
  291. this.form.found_price = parseInt(val) - parseInt(this.form.total) + parseInt(this.form.discount_price) + parseInt(this.form.preferential_price)
  292. },
  293. changeDiscountPrice(val){
  294. if(val > this.form.total){
  295. this.$message.error('折扣金额不能超过费用总额')
  296. return
  297. }
  298. this.form.reality_price = parseInt(this.form.total) - parseInt(val) - parseInt(this.form.preferential_price)
  299. },
  300. changePreferentialPrice(val){
  301. if(val > this.form.total){
  302. this.$message.error('优惠金额不能超过费用总额')
  303. return
  304. }
  305. this.form.reality_price = parseInt(this.form.total) - parseInt(val) - parseInt(this.form.discount_price)
  306. }
  307. },
  308. mounted() {
  309. var nowDate = new Date()
  310. var nowYear = nowDate.getFullYear()
  311. var nowMonth = nowDate.getMonth() + 1
  312. var nowDay = nowDate.getDate()
  313. var nowHours = nowDate.getHours()
  314. var nowMin = nowDate.getMinutes()
  315. var nowSecond = nowDate.getSeconds()
  316. this.record_date =
  317. nowYear +
  318. '-' +
  319. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  320. '-' +
  321. (nowDay < 10 ? '0' + nowDay : nowDay)+" "+(nowHours < 10 ? '0' + nowHours : nowHours)+":"+(nowMin < 10 ? '0' + nowMin : nowMin)
  322. }
  323. }
  324. </script>
  325. <style lang="scss" scoped>
  326. .chargeDialog{
  327. .el-form{
  328. display: flex;
  329. flex-wrap: wrap;
  330. }
  331. .el-form-item{
  332. width:50%;
  333. }
  334. }
  335. .input_style {
  336. border-radius: 5px;
  337. border: 1px solid #dddddd;
  338. }
  339. .input_style:focus {
  340. outline:none;
  341. border: 1px solid #66b1ff;
  342. }
  343. </style>