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

chargeDialog.vue 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  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
  9. label="总计:"
  10. prop="name"
  11. :validate-event="is_Name"
  12. style="width: 33%"
  13. >
  14. <el-input
  15. class="number_style"
  16. style="color: black;font-weight:bolder;"
  17. type="number"
  18. v-model="form.total"
  19. :disabled="true"
  20. ></el-input>
  21. </el-form-item>
  22. <el-form-item
  23. label="医保:"
  24. prop="name"
  25. :validate-event="is_Name"
  26. style="width: 33%"
  27. >
  28. <el-input
  29. class="number_style"
  30. style="color: black"
  31. type="number"
  32. v-model="form.medical_insurance_price"
  33. :disabled="true"
  34. ></el-input>
  35. </el-form-item>
  36. <el-form-item
  37. label="自费:"
  38. prop="age"
  39. :validate-event="is_Name"
  40. style="width: 33%"
  41. >
  42. <el-input
  43. class="number_style"
  44. style="color: black"
  45. type="number"
  46. v-model="form.private_price"
  47. :disabled="true"
  48. ></el-input>
  49. </el-form-item>
  50. <el-form-item
  51. label="个账支出:"
  52. prop="age"
  53. :validate-event="is_Name"
  54. style="width: 33%"
  55. >
  56. <el-input
  57. class="number_style"
  58. style="color: black"
  59. type="number"
  60. v-model="form.acct_pay"
  61. :disabled="true"
  62. ></el-input>
  63. </el-form-item>
  64. <el-form-item
  65. label="个人现金支出:"
  66. prop="age"
  67. :validate-event="is_Name"
  68. style="width: 33%"
  69. >
  70. <el-input
  71. class="number_style"
  72. style="color: black"
  73. type="number"
  74. v-model="form.psn_pay"
  75. :disabled="true"
  76. ></el-input>
  77. </el-form-item>
  78. <el-form-item label="支付方式:" style="width:100%;">
  79. <el-radio-group v-model="form.pay_way">
  80. <el-radio :label="item.value" :value="item.value" v-for="(item,index) in payWays" :key="index">{{ item.label }}</el-radio>
  81. <el-button type="primary" v-if="form.pay_way == 4 || form.pay_way == 6" @click="reading()">读卡</el-button>
  82. </el-radio-group>
  83. </el-form-item>
  84. <el-form-item label="个人现金支付方式:" style="width: 100%">
  85. <el-checkbox v-model="form.dec_way" @change="changedecimal">
  86. 使用押金余额抵扣(当前押金余额为¥{{ decimal }})
  87. </el-checkbox>
  88. <span v-if="form.dec_way == true">
  89. <el-form-item class="specialFormItem">
  90. <div style="display: flex">
  91. <!-- 这里不要改成el-input,因为使用el-input会导致一个奇怪的bug,千万不要改!!!!!!!!!!!!!!!!!!!!-->
  92. <input v-model="form.tmp_decimal" class="input_style" onkeyup="this.value = this.value.replace(/[^\d.]/g,'');" @change="lilili">元
  93. </div>
  94. </el-form-item>
  95. </span>
  96. </el-form-item>
  97. <el-form-item label="付款金额:" prop="id_card">
  98. <el-input
  99. class="number_style"
  100. style="color: black"
  101. type="number"
  102. v-model="form.pay_price"
  103. :disabled="true"
  104. ></el-input>
  105. </el-form-item>
  106. <el-form-item label="付款卡号:" prop="id_card">
  107. <el-input v-model="form.pay_card_no"></el-input>
  108. </el-form-item>
  109. <el-form-item class="specialFormItem" label="折扣金额:">
  110. <div style="display: flex">
  111. <el-input
  112. style="color: black"
  113. v-model="form.discount_price"
  114. :disabled="form.preferential_price != 0"
  115. @change="changeDiscountPrice"
  116. ></el-input>
  117. </div>
  118. </el-form-item>
  119. <el-form-item class="specialFormItem" label="优惠金额:">
  120. <div style="display: flex">
  121. <el-input
  122. class="number_style"
  123. style="color: black"
  124. v-model="form.preferential_price"
  125. :disabled="form.discount_price != 0"
  126. @change="changePreferentialPrice"
  127. ></el-input>
  128. </div>
  129. </el-form-item>
  130. <el-form-item label="实收金额:">
  131. <div style="display: flex">
  132. <el-input
  133. class="number_style"
  134. style="color: black"
  135. v-model="form.reality_price"
  136. @change="realityPrice"
  137. ></el-input>
  138. </div>
  139. </el-form-item>
  140. <el-form-item label="找回金额:">
  141. <div style="display: flex">
  142. <el-input
  143. class="number_style"
  144. style="color: black"
  145. v-model.number="form.found_price"
  146. ></el-input>
  147. </div>
  148. </el-form-item>
  149. <el-form-item label="发票编码:">
  150. <div style="display: flex">
  151. <el-input v-model.number="form.fapiao_code"></el-input>
  152. </div>
  153. </el-form-item>
  154. <el-form-item label="发票号码:">
  155. <div style="display: flex">
  156. <el-input v-model.number="form.fapiao_number"></el-input>
  157. </div>
  158. </el-form-item>
  159. </el-form>
  160. <span slot="footer" class="dialog-footer">
  161. <el-button @click="cancel('formValue')">取 消</el-button>
  162. <!-- <el-button @click="init">调试</el-button>-->
  163. <el-button type="primary" @click="confirm('formValue')">确 定</el-button>
  164. </span>
  165. </el-dialog>
  166. </template>
  167. <script>
  168. import { uParseTime } from '@/utils/tools'
  169. import {
  170. idtobalance
  171. }from "@/api/deposit";
  172. import axios from "axios";
  173. const moment = require('moment')
  174. export default {
  175. name: 'chargeDialog',
  176. data() {
  177. return {
  178. tmp_pay: "",
  179. isshow: false,
  180. id: 0,
  181. decimal: 0,//当前押金余额
  182. record_date: '',
  183. form: {
  184. medical_insurance_price: 0,
  185. private_price: '',//自费12
  186. pay_way: '',
  187. dec_way: 'false',//是否使用押金支付
  188. tmp_decimal: "",//本次使用的押金
  189. pay_price: '',
  190. pay_card_no: '',
  191. discount_price: '',
  192. preferential_price: '',
  193. reality_price: '',
  194. found_price: '',
  195. total: 0,
  196. fapiao_code: "",
  197. fapiao_number: "",
  198. order: null,
  199. acct_pay: '',
  200. psn_pay: '',
  201. },
  202. payWays: [
  203. { value: 1, label: '现金' },
  204. { value: 2, label: '银行卡'},
  205. { value: 3, label: '微信'},
  206. { value: 5, label: '支付宝'},
  207. { value: 7, label: '积分'},
  208. { value: 4, label: '医保卡' },
  209. { value: 6, label: '电子凭证'},
  210. ],
  211. total: "",
  212. visibility: false,
  213. labelPosition: "right",
  214. isClose: false,
  215. resetForm: {
  216. medical_insurance_price: "",
  217. private_price: "",
  218. pay_way: "",
  219. pay_price: "",
  220. pay_card_no: "",
  221. discount_price: "",
  222. preferential_price: "",
  223. reality_price: "",
  224. found_price: "",
  225. fapiao_code: "",
  226. fapiao_number: "",
  227. acct_pay: "",
  228. psn_pay: "",
  229. },
  230. };
  231. },
  232. props: {
  233. titles: {
  234. type: String,
  235. default: "",
  236. },
  237. formValue: {
  238. type: Object,
  239. },
  240. type: {
  241. type: Number,
  242. default: 1,
  243. },
  244. isCreated: {
  245. type: Number,
  246. default: 1,
  247. },
  248. },
  249. created() {
  250. },
  251. methods: {
  252. reading() {
  253. var that = this
  254. let id_card_type = 1
  255. if (this.form.pay_way == 6){
  256. id_card_type = 4
  257. }
  258. let params = {
  259. 'id_card_type': id_card_type,
  260. 'admin_user_id': this.$store.getters.xt_user.user.id,
  261. 'certificates':1,
  262. }
  263. axios.get('http://127.0.0.1:9532/zh/api/readcard', {
  264. params: params
  265. })
  266. .then(function(response) {
  267. if (response.data.state == 0) {
  268. that.$message.error(response.data.msg)
  269. return false
  270. } else {
  271. that.$message({ message: '读卡成功', type: 'success' })
  272. }
  273. })
  274. .catch(function(error) {
  275. })
  276. },
  277. init() {
  278. console.log("====this.form.dec_way===", this.form.dec_way)
  279. },
  280. lilili(val) {
  281. console.log("val", val)
  282. if (this.form.tmp_decimal == "") {
  283. this.form.pay_price = this.tmp_pay
  284. return
  285. }
  286. if (parseFloat(this.form.tmp_decimal) > parseFloat(this.form.private_price)) {
  287. // alert("押金不得大于自费金额")
  288. this.$message.error("押金不得大于自费金额");
  289. this.form.tmp_decimal = ""
  290. this.form.pay_price = this.tmp_pay
  291. return
  292. }
  293. // this.form.private_price = parseFloat(this.form.tmp_decimal) + parseFloat(this.form.pay_price)
  294. this.form.pay_price = ((parseFloat(this.form.private_price) * 10000 - parseFloat(this.form.tmp_decimal) * 10000) / 10000).toFixed(2)
  295. },
  296. changedecimal() {
  297. // console.log("this.isshow前",this.isshow)
  298. this.$forceUpdate();
  299. this.isshow = this.form.dec_way
  300. // console.log("this.form.dec_way后",this.form.dec_way)
  301. if (this.isshow == false) {
  302. // this.form.private_price = parseFloat(this.form.pay_price)
  303. this.form.tmp_decimal = 0
  304. this.form.pay_price = this.tmp_pay
  305. } else {
  306. //储存临时付款
  307. this.tmp_pay = this.form.pay_price
  308. if (parseFloat(this.form.tmp_decimal) > parseFloat(this.form.private_price)) {
  309. this.form.tmp_decimal = 0
  310. // alert("押金不得大于自费金额")
  311. this.$message.error("押金不得大于自费金额");
  312. return
  313. }
  314. // this.form.private_price = parseFloat(this.form.tmp_decimal) + parseFloat(this.form.pay_price)
  315. this.tmp_pay = this.form.pay_price
  316. this.form.pay_price = ((parseFloat(this.form.private_price) * 10000 - parseFloat(this.form.tmp_decimal) * 10000) / 10000).toFixed(2)
  317. }
  318. },
  319. //查询用户当前的余额
  320. updateconfig() {
  321. var params = {
  322. his_patient_id: this.id,
  323. }
  324. idtobalance(params).then((res) => {
  325. if (res.data.state == 1) {
  326. this.decimal = res.data.data.list;
  327. }
  328. })
  329. },
  330. show(total,order,id) {
  331. this.record_date = moment(new Date()).add('year', 0).format("YYYY-MM-DD HH:mm")
  332. //初始化
  333. this.form.tmp_decimal = 0
  334. this.tmp_pay = 0
  335. this.id = id
  336. this.updateconfig()
  337. this.form.dec_way = false
  338. this.form.total = total
  339. this.form.private_price = total
  340. this.form.pay_price = total
  341. this.form.total = total + this.form.medical_insurance_price
  342. this.form.discount_price = 0.0
  343. this.form.preferential_price = 0.0
  344. this.form.fapiao_code = "";
  345. this.form.fapiao_number = "";
  346. this.order = order;
  347. if (this.order && this.order.id > 0) {
  348. this.form.acct_pay = this.order.acct_pay
  349. this.form.psn_pay = this.order.psn_cash_pay
  350. this.form.total = this.order.medfee_sumamt
  351. this.form.pay_price = (this.order.medfee_sumamt).toFixed(2)
  352. this.form.medical_insurance_price = this.order.fund_pay_sumamt
  353. this.form.private_price = this.order.psn_part_amt
  354. }
  355. this.visibility = true
  356. },
  357. hide: function() {
  358. this.form = Object.assign({}, this.resetForm);
  359. this.loadingtwo = false;
  360. this.visibility = false
  361. }, cancel: function(formName) {
  362. this.form.tmp_decimal = 0
  363. this.tmp_pay = 0
  364. this.form.dec_way = false
  365. this.$emit('cancel', this.getValue());
  366. this.$refs['formValue'].resetFields()
  367. },
  368. confirm: function(formName) {
  369. if (parseFloat(this.form.tmp_decimal) > parseFloat(this.decimal)){
  370. this.$message.error("押金余额不足");
  371. return
  372. }
  373. this.$refs['formValue'].validate((valid) => {
  374. if (valid) {
  375. let value = {};
  376. value = this.getValue();
  377. this.$emit('confirm', value);
  378. this.loadingtwo = true
  379. }
  380. })
  381. },
  382. getValue: function() {
  383. let form = {};
  384. form = this.form;
  385. return form
  386. },
  387. realityPrice(val) {
  388. if (val < (this.form.total - this.form.discount_price - this.form.preferential_price)) {
  389. this.$message.error('实收金额不能小于收费金额');
  390. return
  391. }
  392. this.form.found_price = parseInt(val) - parseInt(this.form.total) + parseInt(this.form.discount_price) + parseInt(this.form.preferential_price)
  393. },
  394. changeDiscountPrice(val) {
  395. if (val > this.form.total) {
  396. this.$message.error('折扣金额不能超过费用总额');
  397. return
  398. }
  399. this.form.reality_price = parseInt(this.form.total) - parseInt(val) - parseInt(this.form.preferential_price)
  400. },
  401. changePreferentialPrice(val) {
  402. if (val > this.form.total) {
  403. this.$message.error('优惠金额不能超过费用总额');
  404. return
  405. }
  406. this.form.reality_price = parseInt(this.form.total) - parseInt(val) - parseInt(this.form.discount_price)
  407. }
  408. },
  409. mounted() {
  410. var nowDate = new Date();
  411. var nowYear = nowDate.getFullYear();
  412. var nowMonth = nowDate.getMonth() + 1;
  413. var nowDay = nowDate.getDate();
  414. var nowHours = nowDate.getHours();
  415. var nowMin = nowDate.getMinutes();
  416. var nowSecond = nowDate.getSeconds();
  417. this.record_date =
  418. nowYear +
  419. '-' +
  420. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  421. '-' +
  422. (nowDay < 10 ? '0' + nowDay : nowDay) + " " + (nowHours < 10 ? '0' + nowHours : nowHours) + ":" + (nowMin < 10 ? '0' + nowMin : nowMin)
  423. }
  424. }
  425. </script>
  426. <style lang="scss" scoped>
  427. /deep/input::-webkit-input-placeholder {
  428. color: red;
  429. font-size: 15px;
  430. }
  431. /deep/.el-input__inner {
  432. background-color: transparent !important;
  433. border: 1px solid red;
  434. }
  435. .chargeDialog {
  436. .el-form {
  437. display: flex;
  438. flex-wrap: wrap;
  439. }
  440. .el-form-item {
  441. width: 50%;
  442. }
  443. }
  444. .input_style {
  445. border-radius: 5px;
  446. border: 1px solid #dddddd;
  447. }
  448. .input_style:focus {
  449. outline:none;
  450. border: 1px solid #66b1ff;
  451. }
  452. /deep/ .number_style{
  453. .el-input__inner{
  454. font-weight: bolder;
  455. }
  456. }
  457. </style>