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.

284 lines
8.7 KiB

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