RechargeDetails.vue 7.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <!-- 充值明细-->
  3. <div class="main-contain">
  4. <div class="app-container">
  5. <div
  6. style="
  7. justify-content: flex-start;
  8. margin: 0px 0 12px 0;
  9. display: flex;
  10. align-items: center;
  11. "
  12. >
  13. <div style="display: flex">
  14. <div style="width: 250px">
  15. <el-input
  16. size="small"
  17. style="width: 200px; margin-left: 10px"
  18. class="filter-item"
  19. placeholder="请输入编号/患者名称"
  20. v-model.trim="keyword"
  21. />
  22. </div>
  23. <div style="width: 465px">
  24. <span>日期查询:</span>
  25. <el-date-picker
  26. v-model="value1"
  27. type="daterange"
  28. range-separator="至"
  29. start-placeholder="开始日期"
  30. end-placeholder="结束日期"
  31. format="yyyy-MM-dd"
  32. value-format="yyyy-MM-dd"
  33. >
  34. </el-date-picker>
  35. </div>
  36. <el-button
  37. size="small"
  38. class="filter-item"
  39. type="primary"
  40. icon="el-icon-search"
  41. @click="search"
  42. >查询</el-button
  43. >
  44. </div>
  45. </div>
  46. <el-table
  47. :header-cell-style="{
  48. backgroundColor: 'rgb(245, 247, 250)',
  49. color: '#606266',
  50. }"
  51. max-height="550"
  52. :data="tableData"
  53. show-summary
  54. sum-text="充值金额合计"
  55. border
  56. >
  57. <el-table-column type="index" label="序号" align="center" width="200">
  58. </el-table-column>
  59. <el-table-column label="单据编号" align="center">
  60. <template slot-scope="scope">
  61. <span>{{ scope.row.deposit_code ? scope.row.deposit_code : "" }}</span>
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="患者名称" align="center">
  65. <template slot-scope="scope">
  66. <span>{{ scope.row.his_name ? scope.row.his_name : "" }}</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="充值金额" align="center" prop="deposit">
  70. <template slot-scope="scope">
  71. <span>{{ scope.row.deposit ? scope.row.deposit : "" }}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="审核状态" align="center">
  75. <template slot-scope="scope">
  76. <!-- <span>{{ scope.row.trial_status ? scope.row.trial_status : "" }}</span>-->
  77. <span v-if="scope.row.trial_status == 1">审核通过</span>
  78. <span v-if="scope.row.trial_status == 0">未审核</span>
  79. <span v-if="scope.row.trial_status == 2">审核拒绝</span>
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="创建人" align="center">
  83. <template slot-scope="scope">
  84. <span>{{ scope.row.name ? scope.row.name : "" }}</span>
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="充值时间" align="center">
  88. <template slot-scope="scope">
  89. <span>{{ scope.row.starttime ? scope.row.starttime : "" }}</span>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="备注" align="center">
  93. <template slot-scope="scope">
  94. <span>{{ scope.row.remarks ? scope.row.remarks : "" }}</span>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="操作" align="center" width="350px">
  98. <template slot-scope="scope">
  99. <el-button
  100. size="small"
  101. type="primary"
  102. @click="examine(scope.row, scope.row.$index)"
  103. >
  104. 审核
  105. </el-button>
  106. <span v-if="scope.row.trial_status == 1">
  107. <el-button
  108. size="small"
  109. type="primary"
  110. @click="print(scope.row, scope.row.$index)"
  111. >
  112. 打印凭证
  113. </el-button>
  114. </span>
  115. <el-button
  116. size="small"
  117. type="danger"
  118. @click="toDelete(scope.row, scope.row.$index)"
  119. >
  120. 删除
  121. </el-button>
  122. </template>
  123. </el-table-column>
  124. </el-table>
  125. <!-- <div>
  126. 充值金额合计:<span>{{sum}}</span>
  127. </div> -->
  128. </div>
  129. </div>
  130. </template>
  131. <script>
  132. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  133. import {
  134. rechargedetails,
  135. deletehistory,
  136. updeposit,
  137. getweektime
  138. }from "@/api/deposit";
  139. export default {
  140. components: {
  141. BreadCrumb,
  142. },
  143. data() {
  144. return {
  145. crumbs: [
  146. { path: false, name: "押金管理" },
  147. { path: "/DepositManagement/DepositSearch", name: "押金查询" },
  148. ],
  149. tableData: [],
  150. // total: 0,
  151. // page: 1,
  152. // limit: 10,
  153. keyword: "",
  154. value1:"",//日期
  155. start_time:"",
  156. end_time:"",
  157. sum:""
  158. };
  159. },
  160. created(){
  161. this.init();
  162. // this.search()
  163. },
  164. methods: {
  165. // 初始化数据
  166. init() {
  167. var params = {}
  168. getweektime(params).then((res) => {
  169. if (res.data.state == 1){
  170. this.value1 = [res.data.data.srart_time,res.data.data.end_time]
  171. }
  172. this.search()
  173. })
  174. },
  175. // 查询操作
  176. search() {
  177. if (this.value1 != null){
  178. if(this.value1[0] != undefined && this.value1[1] != undefined){
  179. this.start_time = this.value1[0]
  180. this.end_time = this.value1[1]
  181. }
  182. }else {
  183. this.start_time = ""
  184. this.end_time = ""
  185. }
  186. var params = {
  187. keyword: this.keyword,
  188. start_time: this.start_time,
  189. end_time: this.end_time,
  190. };
  191. rechargedetails(params).then((res) => {
  192. if (res.data.state == 1){
  193. this.tableData = res.data.data.list;
  194. this.sum = res.data.data.sum;
  195. }
  196. })
  197. },
  198. // 删除
  199. toDelete(val,index) {
  200. var params = {
  201. id:val.id,
  202. };
  203. this.$confirm("是否确定删除?", {
  204. confirmButtonText: "确 定",
  205. cancelButtonText: "取 消",
  206. type: "warning",
  207. }).then(() => {
  208. deletehistory(params).then((res) => {
  209. if (res.data.state == 1) {
  210. this.$message.success(res.data.data.list);
  211. }else {
  212. this.$message.error(res.data.msg);
  213. }
  214. })//刷新
  215. .then(() =>{
  216. this.search();
  217. })
  218. .catch((err) => {
  219. console.log(err)
  220. })
  221. }).catch(() => {});
  222. },
  223. // 审核
  224. examine(val,index) {
  225. var params = {
  226. id:val.id,
  227. };
  228. updeposit(params).then((res) =>{
  229. if (res.data.state == 1) {
  230. this.$message.success(res.data.data.list);
  231. }else {
  232. this.$message.error(res.data.msg);
  233. }
  234. })
  235. setTimeout(() => {
  236. this.search();
  237. },500)
  238. },
  239. // 打印凭证
  240. print(data,val){
  241. console.log("data",data)
  242. // alert("aaaaaaa")
  243. this.$router.push({path:"/DepositManagement/printindex",query:{key:data}})
  244. },
  245. },
  246. };
  247. </script>
  248. <style>
  249. </style>