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

chargeDialog.vue 14KB

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