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.

290 lines
9.0 KiB

4 months ago
2 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
3 months ago
4 months ago
4 months ago
2 months ago
4 months ago
4 months ago
4 months ago
3 months ago
4 months ago
  1. <template>
  2. <div>
  3. <div class="middlebox">
  4. <div class="contenttitle">
  5. 体检查询 /
  6. <span class="contenttitleBold">营业额统计体检类别</span>
  7. </div>
  8. </div>
  9. <div
  10. style="display: flex;justify-content: space-between; padding: 10px;background-color: #fff;border-radius: 8px;margin-bottom: 10px;">
  11. <div style="display:block;">
  12. <div style="display: flex;flex-wrap: wrap;height: 32px;align-items: center;">
  13. <div class="query">
  14. <el-select v-model="query.dateType" placeholder="请选择" style="width: 80px" size="small">
  15. <el-option label="登记日期" :value="'1'" />
  16. <el-option label="体检日期" :value="'2'" />
  17. <el-option label="总检日期" :value="'3'" />
  18. <el-option label="收费日期" :value="'6'" />
  19. </el-select>
  20. <!-- dateType 1 登记2 体检3 总检日期-->
  21. <el-date-picker v-model="query.startDate" type="date" placeholder="起始日期" size="small" style="width:90px;"
  22. value-format="yyyy-MM-dd" :picker-options="pickerOptions" />
  23. <span class="spanClass"></span>
  24. <el-date-picker v-model="query.endDate" type="date" placeholder="截止日期" size="small" style="width:90px;"
  25. value-format="yyyy-MM-dd" :picker-options="pickerOptions" />
  26. </div>
  27. <div class="query">
  28. <span class="spanClass">体检类别</span>
  29. <el-select v-model="query.medicalTypeIds" placeholder="请选择体检类别"
  30. default-first-option clearable filterable style="margin-left: 10px;width:200px;" size="small" multiple collapse-tags>
  31. <el-option v-for="item in medicalType" :key="item.id" :label="item.displayName" :value="item.id">
  32. {{ item.displayName }}
  33. </el-option>
  34. </el-select>
  35. </div>
  36. <div class="query">
  37. <span class="spanClass">包含预登记</span>
  38. <el-checkbox v-model="query.isPreRegistration" true-label="Y" false-label="N" />
  39. </div>
  40. </div>
  41. </div>
  42. <div>
  43. <el-button type="primary" class="commonbutton" @click="btnQuery" size="small">查询</el-button>
  44. <el-button class="commonbutton" @click="btnExport('tableData')" size="small">导出</el-button>
  45. </div>
  46. </div>
  47. <div id="tableData">
  48. <el-table :data="tableData" border :height="window.pageHeight - 160" highlight-current-row
  49. size="small" row-key="id" :summary-method="getSummaries" show-summary ref="refTable">
  50. <el-table-column type="index" label="序号" width="50" align="center" />
  51. <el-table-column prop="medicalTypeName" label="体检类别" min-width="150" />
  52. <el-table-column prop="registerCount" label="登记人数" min-width="80" align="center" />
  53. <el-table-column prop="startMedical" label="检查人数" min-width="80" align="center" />
  54. <el-table-column prop="checkCount" label="总检人数" min-width="80" align="center" />
  55. <el-table-column prop="avgStandardPrice" label="标准平均单价" min-width="100" align="center" />
  56. <el-table-column prop="avgChargePrice" label="应收平均单价" min-width="100" align="center" />
  57. <el-table-column prop="sumStandardPrice" label="标准金额" min-width="100" align="center" />
  58. <el-table-column prop="sumChargePrice" label="应收金额" min-width="100" align="center" />
  59. <el-table-column prop="sumReceivedPrice" label="实收金额" min-width="100" align="center" />
  60. </el-table>
  61. </div>
  62. </div>
  63. </template>
  64. <script>
  65. import { mapState } from "vuex";
  66. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  67. import { deepCopy } from "../../utlis/proFunc"
  68. import CusOrgOCX from "./CusOrgOCX.vue"
  69. import moment from "moment";
  70. import FileSaver from 'file-saver';
  71. export default {
  72. components: {
  73. CusOrgOCX,
  74. },
  75. props: ["orgEnable"],
  76. data() {
  77. return {
  78. dialogVisible: false,
  79. local: {
  80. completeFlag: []
  81. },
  82. customerOrg: [],
  83. customerOrgAll: [],
  84. medicalType: [],
  85. query: {
  86. dateType: '1',
  87. startDate: '',
  88. endDate: '',
  89. //customerOrgIds: [],
  90. medicalTypeIds: [],
  91. // isMedicalTypeId: 'Y',
  92. isPreRegistration:'N'
  93. },
  94. tableData: [],
  95. pickerOptions: {
  96. disabledDate(time) {
  97. return time.getTime() > Date.now();
  98. },
  99. shortcuts: [{
  100. text: '今天',
  101. onClick(picker) {
  102. picker.$emit('pick', new Date());
  103. }
  104. }, {
  105. text: '昨天',
  106. onClick(picker) {
  107. const date = new Date();
  108. date.setTime(date.getTime() - 3600 * 1000 * 24);
  109. picker.$emit('pick', date);
  110. }
  111. }, {
  112. text: '一周前',
  113. onClick(picker) {
  114. const date = new Date();
  115. date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
  116. picker.$emit('pick', date);
  117. }
  118. }]
  119. },
  120. };
  121. },
  122. created() {
  123. },
  124. //挂载完成
  125. mounted() {
  126. this.dictInit()
  127. },
  128. updated() {
  129. this.$nextTick(() => {
  130. this.$refs['refTable'].doLayout()
  131. })
  132. },
  133. computed: {
  134. ...mapState(["window", "dict", "patientRegister", "report"]),
  135. },
  136. methods: {
  137. //获取初始数据
  138. dictInit() {
  139. let today = moment(new Date()).format("YYYY-MM-DD")
  140. this.query.startDate = today
  141. this.query.endDate = today
  142. //获取单位列表
  143. // getapi("/api/app/customer-org/parent-all").then((res) => {
  144. // if (res.code != -1) {
  145. // this.customerOrgAll = res.data;
  146. // this.customerOrg = deepCopy(this.customerOrgAll);
  147. // }
  148. // });
  149. //体检类别
  150. getapi("/api/app/medical-type/in-filter").then((res) => {
  151. if (res.code > -1) {
  152. this.dict.medicalType = res.data;
  153. this.medicalType = res.data
  154. }
  155. });
  156. },
  157. //通用导出
  158. btnExport(elId) {
  159. let table = document.getElementById(elId);
  160. let tableData = table.innerHTML
  161. let fileName = moment(new Date()).format('yyyyMMDDHHmmss') + '.xls'
  162. let blob = new Blob([tableData], { type: "text/plain;charset=utf-8" });
  163. FileSaver.saveAs(blob, fileName);
  164. },
  165. // 体检类别过滤
  166. // filterMethod(keyWords) {
  167. // if (keyWords) {
  168. // this.medicalType = [];
  169. // this.dict.medicalType.forEach((item) => {
  170. // if (
  171. // item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > -1
  172. // ) {
  173. // this.medicalType.push(item);
  174. // }
  175. // });
  176. // } else {
  177. // this.medicalType = deepCopy(this.dict.medicalType);
  178. // }
  179. // },
  180. // 查询
  181. btnQuery() {
  182. postapi("/api/app/CustomerReport/GetMedicalTypePhysicalExaminationStatistics", this.query).then(res => {
  183. if (res.code > -1) {
  184. this.tableData = res.data
  185. if(Array.isArray(this.tableData) && this.tableData.length > 0){
  186. this.tableData.forEach(e => {
  187. e.startMedical = Number(e.partCheckCount) + Number(e.checkCount)
  188. });
  189. }
  190. }
  191. })
  192. },
  193. //合计
  194. getSummaries(param) {
  195. console.log('getSummaries param',param)
  196. // if(!param){
  197. // param = {
  198. // columns:[{}, {}, {}, {}, {}, {}, {property: 'asbitemMoney'},{property: 'customerOrgGroupDetailMoney'}],
  199. // data:this.customerOrgGroupAsbitems
  200. // }
  201. // }
  202. const { columns, data } = param;
  203. const sumCol = [2,3,4, 7,8, 9] //需合计的列
  204. const sums = [];
  205. columns.forEach((column, index) => {
  206. //console.log('column, index,data',column, index,data)
  207. //显示合计列
  208. if (index === 1) {
  209. sums[index] = '合计';
  210. return;
  211. }
  212. //不合计的列
  213. if (sumCol.indexOf(index) == -1) {
  214. sums[index] = '';
  215. return;
  216. }
  217. sums[index] = 0
  218. data.forEach(e => {
  219. if (!isNaN(e[column.property])) sums[index] += Number(e[column.property])// * e['amount']
  220. })
  221. sums[index] = sums[index].toFixed(2) //+ ' 元';
  222. });
  223. // this.groupPrice = sums[7];
  224. // console.log('getSummaries',sums)
  225. // if (!this.totalFoucs) this.total = sums[5];
  226. // if (!this.discountFoucs) this.discount = Number(this.total * 100 / this.totalStand).toFixed(2);
  227. return sums;
  228. },
  229. },
  230. };
  231. </script>
  232. <style scoped>
  233. @import '../../assets/css/global.css';
  234. @import '../../assets/css/global_font.css';
  235. ::v-deep .el-input__inner {
  236. /*text-align: center;*/
  237. padding-left: 5px;
  238. padding-right: 15px;
  239. }
  240. ::v-deep .el-input__icon {
  241. width: 15px;
  242. /* 输入框下拉箭头或清除图标 默认 25 */
  243. }
  244. ::v-deep .el-input-group__append {
  245. padding: 0 5px;
  246. /* 控件默认 0 20px;*/
  247. }
  248. ::v-deep .el-icon-search:before {
  249. color: #00F;
  250. }
  251. .query {
  252. margin-left: 10px;
  253. font-size: 14px;
  254. color: #232748;
  255. font-weight: 400;
  256. font-family: "NotoSansSC-Regular";
  257. }
  258. .spanClass {
  259. padding: 0 2px 0 0;
  260. }
  261. </style>