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.

387 lines
12 KiB

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