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.

353 lines
12 KiB

3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 months ago
3 years ago
3 months ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 months ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 months ago
2 years ago
3 months ago
3 years ago
3 months ago
3 years ago
3 months ago
3 years ago
3 months ago
3 years ago
3 years ago
2 years ago
3 years ago
3 months ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 months ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 months ago
3 years ago
3 years ago
3 years ago
3 years ago
4 months ago
3 years ago
3 months ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 months ago
3 years ago
3 years ago
3 months ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 months ago
3 years ago
4 months ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
  1. <template>
  2. <div>
  3. <div style="position: relative">
  4. <div class="middlebox">
  5. <div class="contenttitle">
  6. 收费 /
  7. <span class="contenttitleBold"
  8. >会员卡记账记录</span
  9. >
  10. </div>
  11. </div>
  12. <div style="margin-top:7px">
  13. <div style="background-color: #fff; padding: 15px; border-radius: 8px;display: flex;flex-wrap: wrap; margin-bottom: 10px;height:80px;margin-top: 7px;">
  14. <div class="query">
  15. <span>记账日期</span>
  16. <el-date-picker v-model="query.startDate" type="date" placeholder="起始日期" size="small" value-format="yyyy-MM-dd"/>
  17. <span>--</span>
  18. <el-date-picker v-model="query.endDate" type="date" placeholder="截止日期" size="small" value-format="yyyy-MM-dd"/>
  19. </div>
  20. <div class="query">
  21. <span>记账标志</span>
  22. <el-select v-model="query.billFlag" placeholder="请选择" filterable clearable size="small">
  23. <el-option v-for="item in dict.billFlag" :key="item.id" :label="item.displayName" :value="item.id" />
  24. </el-select>
  25. </div>
  26. <div class="query">
  27. <span>支付方式</span>
  28. <el-select v-model="query.payModeIds" placeholder="请选择" filterable clearable size="small" multiple collapse-tags>
  29. <el-option v-for="item in dict.payMode" :key="item.id" :label="item.displayName" :value="item.id" />
  30. </el-select>
  31. </div>
  32. <div class="query">
  33. <span>卡号</span>
  34. <el-input placeholder="卡号" v-model="query.cardNo" size="small" clearable style="width: 190px"/>
  35. </div>
  36. <div class="query">
  37. <span>卡主姓名</span>
  38. <el-input placeholder="卡主姓名" v-model="query.customerName" size="small" clearable style="width: 190px"/>
  39. </div>
  40. <div class="query">
  41. <span>身份证号</span>
  42. <el-input placeholder="身份证号" v-model="query.idNo" size="small" clearable style="width: 190px"/>
  43. </div>
  44. <div class="query">
  45. <span>电话</span>
  46. <el-input placeholder="手机号/电话" v-model="query.mobileTelephone" size="small" clearable style="width: 190px"/>
  47. </div>
  48. <div class="query">
  49. <el-button class="commonbutton" @click="btnQuery">查询</el-button>
  50. </div>
  51. </div>
  52. <div style="background-color: #fff; padding: 15px; border-radius: 8px;">
  53. <el-table :data="dataList" width="100%" :height="window.pageHeight < 600 ? 330 : window.pageHeight - 250"
  54. row-key="id" highlight-current-row ref="dataList" border show-summary :summary-method="getSummaries">
  55. <el-table-column type="index" label="序号" width="50" align="center"/>
  56. <el-table-column prop="cardNo" label="会员卡号" width="150" align="center"/>
  57. <el-table-column prop="customerName" label="卡主姓名" />
  58. <el-table-column prop="mobileTelephone" label="手机号" align="center"/>
  59. <el-table-column prop="payModeId" label="支付方式" align="center">
  60. <template slot-scope="scope">
  61. <div>{{ dddw(dict.payMode, "id", scope.row.payModeId, "displayName") }}</div>
  62. </template>
  63. </el-table-column>
  64. <el-table-column prop="billMoney" label="记账金额" align="center"/>
  65. <el-table-column prop="billFlag" label="记账标志" align="center">
  66. <template slot-scope="scope">
  67. <div>{{ dddw(dict.billFlag, "id", scope.row.billFlag, "displayName") }}</div>
  68. </template>
  69. </el-table-column>
  70. <!--
  71. <el-table-column prop="creatorName" label="创建人员" align="center"/>
  72. <el-table-column prop="creationTime" label="创建日期" width="150" align="center">
  73. <template slot-scope="scope">
  74. <div v-if="scope.row.creationTime">
  75. {{ moment(scope.row.creationTime).format("yyyy-MM-DD") }}
  76. </div>
  77. </template>
  78. </el-table-column>
  79. -->
  80. <el-table-column prop="lastModifierName" label="修改人员" align="center"/>
  81. <el-table-column prop="lastModificationTime" label="修改日期" width="150" align="center">
  82. </el-table-column>
  83. </el-table>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. </template>
  89. <script>
  90. import moment from "moment";
  91. import { mapState, mapActions } from "vuex";
  92. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  93. import { dddw, objCopy, arrayReduce, arrayExistObj, deepCopy } from "@/utlis/proFunc";
  94. export default {
  95. components: {
  96. },
  97. data() {
  98. return {
  99. query: {
  100. startDate:'',
  101. endDate:'',
  102. billFlag:'',
  103. payModeIds:[],
  104. cardNo:'',
  105. customerName:'',
  106. idNo:'',
  107. mobileTelephone:''
  108. }, //查询条件
  109. dataList: [], //列表数据
  110. };
  111. },
  112. created() {
  113. this.query.startDate = moment(new Date()).format("yyyy-MM-DD");
  114. this.query.endDate = this.query.startDate;
  115. },
  116. //挂载完成
  117. mounted() {
  118. this.dicInit();
  119. this.enterToQuery()
  120. },
  121. updated() {
  122. this.$nextTick(() => {
  123. this.$refs['dataList'].doLayout() //刷新显示合计
  124. })
  125. },
  126. computed: {
  127. ...mapState(["window", "dict"]),
  128. },
  129. methods: {
  130. ...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]),
  131. dddw, moment,
  132. //查询
  133. btnQuery(queryType) {
  134. let body = deepCopy(this.query)
  135. switch (queryType) {
  136. case 'idNo':
  137. if(!this.query.idNo) return;
  138. body = { idNo: this.query.idNo };
  139. break;
  140. case 'cardNo':
  141. if(!this.query.cardNo) return;
  142. body = { cardNo: this.query.cardNo };
  143. break;
  144. default:
  145. if(this.query.idNo){
  146. body = { idNo: this.query.idNo };
  147. }else if(this.query.cardNo){
  148. body = { cardNo: this.query.cardNo };
  149. }else{
  150. // if(!this.query.startDate) this.query.startDate = moment(new Date()).format('yyyy-MM-DD');
  151. // if(!this.query.endDate) this.query.endDate = moment(new Date()).format('yyyy-MM-DD');
  152. if(this.query.startDate > this.query.endDate){
  153. this.$message.error("数据不合法,起始日期不能大于截止日期!");
  154. return;
  155. }
  156. if(!body.cardNo) delete body.cardNo
  157. if(!body.billFlag) delete body.billFlag
  158. if(!body.customerName) delete body.customerName
  159. if(!body.idNo) delete body.idNo
  160. if(!body.mobileTelephone) delete body.mobileTelephone
  161. if(body?.payModeIds.length == 0) delete body.payModeIds
  162. }
  163. break;
  164. }
  165. // {
  166. // "cardNo": "string",
  167. // "customerName": "string",
  168. // "idNo": "string",
  169. // "mobileTelephone": "string",
  170. // "billFlag": "string",
  171. // "startDate": "string",
  172. // "endDate": "string"
  173. // }
  174. postapi('/api/app/cardbill/getcardbilllist', body)
  175. .then((res) => {
  176. if (res.code != -1) {
  177. this.dataList = res.data;
  178. }
  179. });
  180. },
  181. //合计
  182. getSummaries(param) {
  183. //console.log('getSummaries param', param)
  184. // if(!param){
  185. // param = {
  186. // columns:[{}, {}, {}, {}, {}, {}, {property: 'asbitemMoney'},{property: 'customerOrgGroupDetailMoney'}],
  187. // data:this.customerOrgGroupAsbitems
  188. // }
  189. // }
  190. const { columns, data } = param;
  191. const sumCol = [5] //需合计的列
  192. const sums = [];
  193. columns.forEach((column, index) => {
  194. //console.log('column, index,data',column, index,data)
  195. //显示合计列
  196. if (index === 1) {
  197. sums[index] = '合计';
  198. return;
  199. }
  200. //不合计的列
  201. if (sumCol.indexOf(index) == -1) {
  202. sums[index] = '';
  203. return;
  204. }
  205. sums[index] = 0
  206. data.forEach(e => {
  207. if (!isNaN(e[column.property])) sums[index] += Number(e[column.property])// * e['amount']
  208. })
  209. sums[index] = sums[index].toFixed(2) //+ ' 元';
  210. });
  211. // this.groupPrice = sums[7];
  212. //console.log('getSummaries',sums)
  213. // if (!this.totalFoucs) this.total = sums[5];
  214. // if (!this.discountFoucs) this.discount = Number(this.total * 100 / this.totalStand).toFixed(2);
  215. return sums;
  216. },
  217. dicInit(){
  218. //支付方式
  219. getapi("/api/app/pay-mode").then((res) => {
  220. if (res.code == 1) {
  221. this.dict.payMode = res.data;
  222. }
  223. });
  224. },
  225. //回车替代查询
  226. enterToQuery() {
  227. // console.log('enterToTab');
  228. this.$nextTick(() => {
  229. let inputs = document.querySelectorAll(["input"]); //用数组可以读取多个标签的元素 //.inline-input
  230. // 为每个输入框添加键盘事件监听器
  231. inputs.forEach((input, i) => {
  232. // console.log('input',input);
  233. input.addEventListener('keydown', (event) => {
  234. if (event.keyCode === 13) {
  235. // 阻止回车键的默认行为(换行)
  236. event.preventDefault();
  237. // 如果按下的是回车查询
  238. // console.log(input.getAttribute('placeholder'),input.value)
  239. let placeholder = input.getAttribute('placeholder')
  240. switch (placeholder) {
  241. case '卡号':
  242. if (input.value) this.btnQuery()
  243. input.select()
  244. break;
  245. case '身份证号':
  246. if (input.value) this.btnQuery()
  247. input.select()
  248. break;
  249. }
  250. }
  251. });
  252. input.addEventListener('click', (event) => {
  253. let placeholder = input.getAttribute('placeholder')
  254. switch (placeholder) {
  255. case '卡号':
  256. input.select()
  257. break;
  258. case '身份证号':
  259. input.select()
  260. break;
  261. }
  262. });
  263. });
  264. });
  265. },
  266. },
  267. //监听事件
  268. watch: {
  269. //触发查询事件
  270. "patientRegister.query.times"(newVal, oldVal) {
  271. if (newVal != oldVal) {
  272. //alert('触发查询事件')
  273. this.query();
  274. }
  275. },
  276. },
  277. };
  278. </script>
  279. <style scoped>
  280. @import "../../assets/css/global_button.css";
  281. @import "../../assets/css/global_dialog.css";
  282. @import "../../assets/css/global_table.css";
  283. @import "../../assets/css/global_form.css";
  284. @import "../../assets/css/global_input.css";
  285. @import "../../assets/css/global.css";
  286. ::v-deep .el-input__inner {
  287. /*text-align: center;*/
  288. padding-left: 5px;
  289. padding-right: 25px;
  290. }
  291. ::v-deep .el-icon-date:before {
  292. content: ""
  293. }
  294. .query{
  295. margin-right: 15px;
  296. display: flex;
  297. justify-content: center;
  298. align-items: center;
  299. font-size: 14px;
  300. color: #232748;
  301. font-size: 400;
  302. font-family: "NotoSansSC-Regular";
  303. }
  304. .box {
  305. display: flex;
  306. flex-direction: column;
  307. }
  308. :deep .el-form-item {
  309. margin-bottom: 14px;
  310. }
  311. /* el-dialog的头部样式 */
  312. :deep .el-dialog__header {
  313. padding: 11px 20px 11px;
  314. }
  315. /* el-dialog的主体样式 */
  316. :deep .el-dialog__body {
  317. padding: 0px 20px 0px;
  318. }
  319. /* el-divider样式 */
  320. :deep .el-divider--horizontal {
  321. margin: 0px 0 12px;
  322. }
  323. /* el-dialog的底部样式 */
  324. :deep .el-dialog__footer {
  325. padding: 0px 20px 14px;
  326. }
  327. .query:last-child{
  328. margin-right: 0;
  329. }
  330. </style>