You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

285 lines
9.9 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div style="margin-top: -10px;">
  3. <div>
  4. <el-tabs v-model="tabChoosed" style="margin-top: 0px;">
  5. <el-tab-pane label="待收费项目" name="1">
  6. <el-table :data="tableData" border style="width: 100%" row-key="id" height="450" highlight-current-row
  7. size="small" @selection-change="handleSelectionChange" :row-style="{ height: '25px' }">
  8. <el-table-column type="selection" align="center" width="40" />
  9. <el-table-column type="index" label="序号" align="center" width="40" />
  10. <el-table-column label="组合项目" min-width="150" prop="asbitemName"></el-table-column>
  11. <el-table-column label="标准价格" prop="standardPrice" min-width="70" align="center" />
  12. <el-table-column label="数量" prop="amount" min-width="50" align="center"></el-table-column>
  13. <el-table-column label="实收价格" prop="chargePrice" min-width="70" align="center"></el-table-column>
  14. <el-table-column prop="total" label="金额" min-width="70" align="center" />
  15. <el-table-column prop="standardPrice" label="标准金额" min-width="70" align="center" />
  16. </el-table>
  17. </el-tab-pane>
  18. <el-tab-pane label="已收费项目" name="2">
  19. <el-table :data="hisRequestData" border style="width: 100%" row-key="id" height="160" highlight-current-row
  20. size="small" @row-click="rowClick" :row-style="{ height: '25px' }">
  21. <el-table-column type="index" label="序号" align="center" width="40" />
  22. <el-table-column label="申请单号" min-width="100" prop="chargeRequestNo"></el-table-column>
  23. <el-table-column prop="hisChargeNo" label="his收费单" min-width="80" align="center" />
  24. <el-table-column prop="charges" label="金额" min-width="80" align="center" />
  25. <el-table-column prop="chargeRequestFlag" label="收费状态" width="70" align="center">
  26. <template slot-scope="scope">
  27. <div>{{ setChargeRequestFlag(scope.row.chargeRequestFlag) }}</div>
  28. </template>
  29. </el-table-column>
  30. <el-table-column prop="ch" label="收费人员" min-width="80" align="center" />
  31. <el-table-column prop="creationTime" label="申请时间" min-width="150" align="center" />
  32. <el-table-column label="操作" width="150" align="center">
  33. <template slot-scope="scope">
  34. <div style="display: flex;justify-content: space-between;">
  35. <div>
  36. <el-button class="commonbutton" @click="cancelRequest(scope.row)" style="width:80px;"
  37. :disabled="setBtnDisabled(scope.row, 'cancel')">撤消申请</el-button>
  38. </div>
  39. <div>
  40. <el-button class="commonbutton" @click="chargeBack(scope.row)" style="width:50px;"
  41. :disabled="setBtnDisabled(scope.row, 'chargeBack')">退费申请</el-button>
  42. </div>
  43. </div>
  44. </template>
  45. </el-table-column>
  46. </el-table>
  47. <div style="padding: 10px 0 5px 0;">申请单包含项目</div>
  48. <el-table :data="hisRequestDataDetails" border style="width: 100%" row-key="id" height="256"
  49. highlight-current-row size="small" :row-style="{ height: '25px' }">
  50. <el-table-column type="index" label="序号" align="center" width="40" />
  51. <el-table-column label="组合项目" min-width="150" prop="asbitemName"></el-table-column>
  52. <el-table-column label="数量" prop="amount" min-width="50" align="center"></el-table-column>
  53. <el-table-column label="实收价格" prop="chargePrice" min-width="70" align="center"></el-table-column>
  54. <el-table-column prop="total" label="金额" min-width="70" align="center" />
  55. </el-table>
  56. </el-tab-pane>
  57. </el-tabs>
  58. </div>
  59. <!-- 按钮区域 -->
  60. <div style="display: flex; margin-top: 10px; justify-content: space-between;">
  61. <div></div>
  62. <div style="display: flex;">
  63. <div style="margin-left: 10px">
  64. <el-button class="commonbutton" @click="btnRefresh">刷新</el-button>
  65. </div>
  66. <div style="margin-left: 10px" v-show="tabChoosed == '1'">
  67. <el-button class="commonbutton" @click="btnSubmit">收费申请</el-button>
  68. </div>
  69. <div style="margin-left: 10px">
  70. <el-button class="commonbutton" @click="dialogWin.AsbChargeRequest = false">关闭</el-button>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </template>
  76. <script>
  77. import { mapState } from "vuex";
  78. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  79. import { dddw, arrayExistObj, deepCopy } from "../../utlis/proFunc";
  80. // import
  81. export default {
  82. props: ["patientRegister"],
  83. data() {
  84. return {
  85. tabChoosed: '1',
  86. tableData: [], //组合项目数据 过滤后显示的数据
  87. selectedData: [], //选中的组合项目
  88. hisRequestData: [], //收费申请单
  89. hisRequestDataDetails: [], //收费申请单明细
  90. };
  91. },
  92. created() {
  93. },
  94. mounted() {
  95. this.initData(this.patientRegister.id);
  96. },
  97. computed: {
  98. ...mapState(["dict", "dataTransOpts", "dialogWin"]),
  99. },
  100. methods: {
  101. initData(patientRegisterId) {
  102. this.tableData = []
  103. this.hisRequestData = []
  104. this.hisRequestDataDetails = []
  105. if (!patientRegisterId) return
  106. //待收费项目
  107. this.asbList(patientRegisterId)
  108. // 收费申请单
  109. this.requestList(patientRegisterId)
  110. },
  111. // 待收费项目
  112. asbList(patientRegisterId) {
  113. this.tableData = []
  114. postapi('/api/app/registerasbitem/GetCanChargeAsbitemsByPatientRegisterId', { patientRegisterId })
  115. .then(res => {
  116. if (res.code > -1) {
  117. res.data.forEach(e => {
  118. e.total = Number(e.chargePrice * e.amount)
  119. this.tableData.push(e)
  120. });
  121. }
  122. })
  123. },
  124. // 收费申请单列表查询
  125. requestList(patientRegisterId) {
  126. this.hisRequestData = []
  127. this.hisRequestDataDetails = []
  128. postapi('/api/app/ChargeRequest/GetChargeRequestsByPatientRegisterId', { patientRegisterId })
  129. .then(res => {
  130. if (res.code > -1) {
  131. this.hisRequestData = res.data
  132. }
  133. })
  134. },
  135. setChargeRequestFlag(chargeRequestFlag) {
  136. let ret = '收费申请'
  137. switch (chargeRequestFlag) {
  138. case '1':
  139. ret = '已收费'
  140. break;
  141. case '2':
  142. ret = '作废申请'
  143. break;
  144. case '3':
  145. ret = '已作废'
  146. break;
  147. case '4':
  148. ret = '退费申请'
  149. break;
  150. case '5':
  151. ret = '已退费'
  152. break;
  153. default:
  154. break;
  155. }
  156. return ret
  157. },
  158. handleSelectionChange(v) {
  159. this.selectedData = v;
  160. },
  161. setBtnDisabled(row, oprType) {
  162. let ret = true
  163. if (oprType == 'chargeBack') {
  164. if (row.chargeRequestFlag == '1') ret = false
  165. } else {
  166. if (row.chargeRequestFlag == '0') ret = false
  167. }
  168. return ret
  169. },
  170. // 获取申请单明细
  171. rowClick(row) {
  172. this.hisRequestDataDetails = []
  173. postapi('/api/app/ChargeRequest/GetChargeRequestAsbitemsByChargeRequestId', { chargeRequestId: row.id })
  174. .then(res => {
  175. if (res.code > -1) {
  176. res.data.forEach(e => {
  177. e.total = Number(e.chargePrice * e.amount)
  178. this.hisRequestDataDetails.push(e)
  179. });
  180. }
  181. })
  182. },
  183. // 撤消申请(作废申请)
  184. cancelRequest(row) {
  185. postapi('/api/app/ChargeRequest/CancelChargeRequest', { chargeRequestId: row.id })
  186. .then(res => {
  187. if (res.code > -1) {
  188. row.chargeRequestFlag = "2"
  189. }
  190. })
  191. },
  192. // 退费申请
  193. chargeBack(row) {
  194. postapi('/api/app/ChargeRequest/RefundChargeRequest', { chargeRequestId: row.id })
  195. .then(res => {
  196. if (res.code > -1) {
  197. row.chargeRequestFlag = "4"
  198. }
  199. })
  200. },
  201. // 刷新
  202. btnRefresh() {
  203. if (this.tabChoosed == '1') {
  204. this.asbList(this.patientRegister.id)
  205. } else {
  206. this.requestList(this.patientRegister.id)
  207. }
  208. },
  209. btnSubmit() {
  210. if (this.selectedData.length == 0) {
  211. this.$message.warning({ showClose: true, message: `请勾选要发送收费申请的检查项目!` });
  212. return;
  213. }
  214. let body = {
  215. patientRegisterId: this.patientRegister.id,
  216. registerCheckAsbitems: []
  217. }
  218. this.selectedData.forEach(e => {
  219. body.registerCheckAsbitems.push({ registerCheckAsbitemId: e.registerCheckAsbitemId })
  220. });
  221. postapi("/api/app/ChargeRequest/Create", body)
  222. .then(res => {
  223. if (res.code > -1) {
  224. this.initData(this.patientRegister.id)
  225. }
  226. });
  227. },
  228. },
  229. //监听事件
  230. watch: {
  231. //
  232. "dataTransOpts.refresh.charge.S": {
  233. // immediate: true, // 立即执行
  234. // // deep: true, // 深度监听复杂类型内变化
  235. handler(newVal, oldVal) {
  236. console.log(`watch: 收费 newVal: ${newVal}, oldVal: ${oldVal}, 人员条码号: `, this.patientRegister.id)
  237. if (newVal != oldVal) this.initData(this.patientRegister.id)
  238. }
  239. },
  240. "tabChoosed": {
  241. // immediate: true, // 立即执行
  242. // // deep: true, // 深度监听复杂类型内变化
  243. handler(newVal, oldVal) {
  244. console.log(`watch: 收费 newVal: ${newVal}, oldVal: ${oldVal}, 人员条码号: `, this.patientRegister.id)
  245. if (newVal != oldVal) {
  246. if (newVal == '1') {
  247. this.asbList(this.patientRegister.id)
  248. } else {
  249. this.requestList(this.patientRegister.id)
  250. }
  251. }
  252. }
  253. },
  254. },
  255. };
  256. </script>
  257. <style scoped>
  258. @import "../../assets/css/global_input.css";
  259. @import "../../assets/css/global_table.css";
  260. @import "../../assets/css/global.css";
  261. </style>