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.

301 lines
9.1 KiB

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