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.

513 lines
18 KiB

1 year ago
7 months ago
1 year ago
7 months ago
1 year ago
9 months ago
1 year ago
7 months ago
1 year ago
9 months ago
1 year ago
7 months ago
1 year ago
9 months ago
7 months ago
1 year ago
7 months ago
9 months ago
9 months ago
7 months ago
1 month ago
1 year ago
7 months ago
1 year ago
7 months ago
1 year ago
7 months ago
1 year ago
7 months ago
1 year ago
7 months ago
1 year ago
7 months ago
1 year ago
7 months ago
1 year ago
9 months ago
1 year ago
7 months ago
1 year ago
7 months ago
1 year ago
7 months ago
1 year ago
7 months ago
1 year ago
7 months ago
1 year ago
9 months ago
1 year ago
7 months ago
1 year ago
7 months ago
1 year ago
7 months ago
1 year ago
7 months ago
1 month ago
1 year ago
  1. <template>
  2. <div style="margin-top: -15px;">
  3. <div style="display: flex;justify-content: space-between;">
  4. <div
  5. style="display: flex;flex-wrap: wrap;background-color: #fff;border-radius: 8px;align-items: center;padding: 2px;width:700px;">
  6. <div class="query">
  7. <!--
  8. <el-select v-model="query.thirdInterfaceId" placeholder="请选择" style="width: 100px" size="small">
  9. <el-option v-for="item in thirdInterfaces" :key="item.id" :label="item.displayName" :value="item.id" />
  10. </el-select>
  11. -->
  12. <el-date-picker v-model="query.startDate" type="date" placeholder="起始日期" size="small" style="width:90px;"
  13. value-format="yyyy-MM-dd" :picker-options="{ disabledDate: false, shortcuts: pickerOptions.shortcuts }" />
  14. <span class="spanClass"></span>
  15. <el-date-picker v-model="query.endDate" type="date" placeholder="截止日期" size="small" style="width:90px;"
  16. value-format="yyyy-MM-dd" :picker-options="{ disabledDate: false, shortcuts: pickerOptions.shortcuts }" />
  17. </div>
  18. <div class="query">
  19. <span class="spanClass">检索关键字</span>
  20. <el-input placeholder="姓名、电话、身份证号" v-model="query.keyWord" size="small" clearable style="width: 200px" />
  21. </div>
  22. <div class="query">
  23. <span class="spanClass">状态</span>
  24. <el-select v-model="query.medicalStatus" placeholder="请选择" clearable style="width: 80px" size="small">
  25. <el-option v-for="item in localDict.medicalStatus" :key="item.value" :label="item.label"
  26. :value="item.value">
  27. </el-option>
  28. </el-select>
  29. </div>
  30. </div>
  31. <div style="margin-top: -38px;width: 160px;">
  32. <div>
  33. <el-button @click="peopleIcCard" size="small" class="commonbutton"
  34. style="width:160px;font-size: 14px;">读身份证</el-button>
  35. </div>
  36. <div style="display: flex;">
  37. <el-button size="small" class="commonbutton" @click="btnQuery"
  38. style="margin-top: 6px; width:60px;">查询</el-button>
  39. <el-button @click="handleExport" size="small" class="commonbutton"
  40. style="margin-top: 6px; width:100px;">导出excel</el-button>
  41. </div>
  42. </div>
  43. </div>
  44. <div>
  45. <el-table :data="tableData" border style="width: 100%" row-key="id" height="430" highlight-current-row
  46. size="small" @row-click="rowClick" ref="webBooking" id="webBookingMzak">
  47. <el-table-column label="序号" type="index" width="40" align="center" />
  48. <el-table-column label="部门名称" width="150" prop="departmentName" align="center" />
  49. <el-table-column label="子部门" width="150" prop="childCompanyName" align="center" />
  50. <el-table-column label="岗位类别" width="100" prop="positionName" align="center" />
  51. <el-table-column label="岗位名称" width="100" prop="position2" align="center" />
  52. <el-table-column label="姓名" width="80" prop="patientName" align="center" />
  53. <el-table-column label="身份证号" width="150" prop="idNo" align="center" />
  54. <el-table-column label="预约时间" width="150" prop="bookingDate" align="center" />
  55. <el-table-column label="手机号" width="130" prop="phone" align="center" />
  56. <el-table-column label="性别" width="40" prop="sexId" align="center" />
  57. <el-table-column label="年龄" width="40" prop="age" align="center" />
  58. <el-table-column label="单位" width="150" prop="customerOrgId" align="center" />
  59. <el-table-column label="单位体检次数" width="150" prop="customerOrgRegisterId" align="center" />
  60. <el-table-column label="分组/套餐" width="120" prop="customerOrgGroupId" align="center">
  61. <template slot-scope="scope">
  62. <div>{{ scope.row.customerOrgGroupId ? scope.row.customerOrgGroupId : scope.row.medicalPackageName }}
  63. </div>
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="预约编号" width="120" prop="thirdBookingId" align="center" />
  67. <el-table-column label="状态" width="50" prop="medicalStatus" align="center">
  68. <template slot-scope="scope">
  69. {{ dddw(localDict.medicalStatus, 'value', scope.row.medicalStatus, 'label') }}
  70. </template>
  71. </el-table-column>
  72. </el-table>
  73. </div>
  74. <div style="margin-top: 10px; display: flex;justify-content: space-between;">
  75. <div style="margin: -8px 0 0 0; font-size: 12px;">
  76. {{ asbDesc }}
  77. </div>
  78. <div>
  79. <el-button v-if="false" @click="btnTest">测试</el-button>
  80. </div>
  81. <div>
  82. <el-button class="commonbutton" @click="btnOk">确定</el-button>
  83. <el-button class="commonbutton" @click="btnClose">关闭</el-button>
  84. </div>
  85. </div>
  86. </div>
  87. </template>
  88. <script>
  89. import { mapState } from "vuex";
  90. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  91. import { dddw, deepCopy, parsIcCardtoLocal } from "../../utlis/proFunc";
  92. import moment from "moment";
  93. import { exportToExcel } from "../../utlis/Export2Excel";
  94. export default {
  95. components: {
  96. },
  97. data() {
  98. return {
  99. thirdInterfaces: [],
  100. tableData: [],
  101. currRowData: {},
  102. tableDataDetails: [],
  103. query: {
  104. thirdInterfaceId: "",
  105. idNo: "",
  106. mobilePhone: "",
  107. appointStartDate: "",
  108. appointStopDate: "",
  109. completeFlag: "0",
  110. keyWord: '',
  111. startDate: '',
  112. endDate: '',
  113. medicalStatus: '0'
  114. },
  115. asbDesc: '', //所选套餐描述
  116. localDict: {
  117. medicalStatus: [
  118. { label: '未开始', value: '0' }, // 0未开始 1已登记 2已完成
  119. { label: '已登记', value: '1' },
  120. { label: '已完成', value: '2' },
  121. ]
  122. }
  123. };
  124. },
  125. created() {
  126. let today = moment(new Date()).format("yyyy-MM-DD")
  127. this.query.endDate = today
  128. this.query.startDate = today
  129. },
  130. updated() {
  131. // this.$nextTick(() => {
  132. // this.$refs['webBookingDetaills'].doLayout()
  133. // })
  134. },
  135. //挂载完成
  136. mounted() {
  137. //回车替代查询
  138. this.enterToQuery()
  139. this.funMounted()
  140. },
  141. computed: {
  142. ...mapState([
  143. "pickerOptions",
  144. "window",
  145. "dict",
  146. "dataTransOpts",
  147. "dialogWin"
  148. ]),
  149. },
  150. methods: {
  151. dddw,
  152. funMounted() {
  153. this.dictInit()
  154. // .then(res => {
  155. // //this.btnQuery()
  156. // })
  157. },
  158. //数据初始化
  159. dictInit() {
  160. // return new Promise((resolve, reject) => {
  161. // let curDate = moment(new Date()).format('YYYY-MM-DD')
  162. // this.query.appointStartDate = curDate
  163. // this.query.appointStopDate = moment(Date.now() + 3600 * 1000 * 24 * 7).format('YYYY-MM-DD')
  164. // this.query.idNo = ''
  165. // this.query.mobilePhone = ''
  166. // this.tableData = []
  167. // this.tableDataDetails = []
  168. // // 获取接口列表,传07
  169. // postapi("/api/app/ThirdInterface/GetListByThirdInterfaceTypeAsync", { thirdInterfaceType: "07" })
  170. // .then(res => {
  171. // if (res.code > -1) {
  172. // this.thirdInterfaces = res.data
  173. // if (res.data && Array.isArray(res.data) && res.data.length > 0) this.query.thirdInterfaceId = res.data[0].id
  174. // resolve(res)
  175. // } else {
  176. // reject(res.message)
  177. // }
  178. // })
  179. // .catch(err => {
  180. // reject(err)
  181. // })
  182. // })
  183. },
  184. //读取身份证信息
  185. peopleIcCard() {
  186. if (!this.$peisAPI) {
  187. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" })
  188. return
  189. }
  190. this.$peisAPI.peopleIcCard().then(res => {
  191. // console.log('peopleIcCard', res)
  192. let lres = JSON.parse(res)
  193. if (lres.code >= -1) {
  194. let idNos = parsIcCardtoLocal(lres.data, this.dict.sex, this.dict.nation)
  195. this.query.idNo = idNos.IDCode
  196. this.query.keyWord = idNos.IDCode
  197. // this.form.patientName = idNos.Name
  198. // this.form.birthDate = idNos.birthDate
  199. // this.form.sexId = idNos.sexId
  200. // this.form.age = idNos.age
  201. // this.form.nationId = idNos.nationId
  202. // this.form.idNo = idNos.IDCode
  203. // this.form.address = idNos.Address
  204. // this.peoplePhoto = 'data:image/bmp;base64,' + idNos.Photo
  205. // this.patientRegister.photo = 'data:image/bmp;base64,' + idNos.Photo
  206. this.btnQuery()
  207. } else {
  208. this.$message.error({ showClose: true, message: `${lres.message}` })
  209. }
  210. })
  211. },
  212. handleExport() {
  213. exportToExcel("#webBookingMzak", "网上预约--人寿", false);
  214. },
  215. // 查询
  216. btnQuery() {
  217. // if (!(this.query.appointStartDate && this.query.appointStopDate)) {
  218. // this.$message.error({ showClose: true, message: "必须选择日期段!" })
  219. // return
  220. // }
  221. // if (!(this.query.idNo || this.query.mobilePhone)) {
  222. // this.$message.error({ showClose: true, message: "手机号或身份证号必须填写一项!" })
  223. // return
  224. // }
  225. if (!(this.query.startDate && this.query.endDate)) {
  226. this.$message.error({ showClose: true, message: "必须选择日期段!" })
  227. return
  228. }
  229. this.currRowData = {}
  230. this.tableData = []
  231. this.tableDataDetails = []
  232. let body = deepCopy(this.query)
  233. // body.appointStartDate = this.query.appointStartDate + " 00:00:00"
  234. // body.appointStopDate = this.query.appointStopDate + " 23:59:59"
  235. body.startDate = this.query.startDate + " 00:00:00"
  236. body.endDate = this.query.endDate + " 23:59:59"
  237. postapi('/api/app/ThirdBooking/GetThirdBookingList', body)
  238. .then(res => {
  239. if (res.code > -1) {
  240. this.tableData = res.data
  241. if (res.data && Array.isArray(res.data) && res.data.length == 1) {
  242. this.rowClick(res.data[0])
  243. this.$refs['webBooking'].setCurrentRow(res.data[0]);
  244. }
  245. }
  246. })
  247. },
  248. btnTest() {
  249. console.log('this.thirdInterfaces', this.thirdInterfaces)
  250. console.log('this.tableData', this.tableData)
  251. console.log('this.currRowData', this.currRowData)
  252. console.log('this.tableDataDetails', this.tableDataDetails)
  253. console.log('this.query', this.query)
  254. },
  255. rowClick(row) {
  256. this.currRowData = row
  257. // this.tableDataDetails = []
  258. // postapi('/api/app/AppointPatientRegister/GetAppointRegisterAsbitemListById', {
  259. // thirdInterFaceId: this.query.thirdInterfaceId,
  260. // appointPatientRegisterId: row.appointPatientRegisterId
  261. // }).then(res => {
  262. // if (res.code > -1) {
  263. // res.data.forEach(e => {
  264. // e.discount = e.standardPrice == 0 ? 100: Math.floor(e.chargePrice * 10000/e.standardPrice)/100
  265. // if(!e.isBelongGroupPackage){
  266. // e.isBelongGroupPackage = e.isInMedicalPackage
  267. // }
  268. // // e.standTotal = e.amount * e.standardPrice
  269. // e.total = e.amount * e.chargePrice
  270. // });
  271. // this.tableDataDetails = res.data
  272. // }
  273. // })
  274. },
  275. // 点击确定
  276. btnOk() {
  277. // if (!this.currRowData.appointPatientRegisterId) {
  278. // this.$message.warning({ showClose: true, message: "请选择预约的记录" })
  279. // return
  280. // }
  281. if (!this.currRowData.thirdBookingId) {
  282. this.$message.warning({ showClose: true, message: "请选择预约的记录" })
  283. return
  284. }
  285. this.dataTransOpts.tableS.appoint_patient_register = this.dataTrans(this.currRowData)
  286. // this.dataTransOpts.tableM.appoint_register_asbitem = deepCopy(this.tableDataDetails)
  287. this.dialogWin.WebBookingMzak = false
  288. },
  289. dataTrans(curRow) {
  290. // { // 标准数据
  291. // "appointPatientRegisterId": "string",
  292. // "personId": "string",
  293. // "personName": "string",
  294. // "idNo": "string",
  295. // "mobileTelephone": "string",
  296. // "sexId": "string",
  297. // "sexName": "string",
  298. // "maritalStatusId": "string",
  299. // "maritalStatusName": "string",
  300. // "customerOrgId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  301. // "customerOrgName": "string",
  302. // "childCustomerOrgName": "string",
  303. // "customerOrgGroupId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  304. // "customerOrgGroupName": "string",
  305. // "medicalPackageId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  306. // "medicalPackageName": "string",
  307. // "completeFlag": "string",
  308. // "appointDate": "2024-09-27T08:53:32.520Z",
  309. // "remark": "string",
  310. // "medicalCenterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  311. // "customerOrgRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  312. // "pregnantFlag": "string",
  313. // "pregnantFlagName": "string",
  314. // "height": 0,
  315. // "weight": 0
  316. // }
  317. // { // 人寿数据
  318. // "thirdBookingId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  319. // "patientName": "string",
  320. // "customerOrgGroupId": "string",
  321. // "idNo": "string",
  322. // "sexId": "string",
  323. // "age": 0,
  324. // "bookingDate": "2024-09-27T08:53:32.306Z",
  325. // "phone": "string",
  326. // "medicalStatus": "string",
  327. // "customerOrgRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  328. // "customerOrgId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  329. // }
  330. let ret = Object.assign({}, curRow, {
  331. mobileTelephone: curRow.phone,
  332. personName: curRow.patientName,
  333. jobPost: curRow.position2
  334. })
  335. return ret
  336. },
  337. // 点击关闭
  338. btnClose() {
  339. this.dataTransOpts.tableS.appoint_patient_register = {}
  340. this.dataTransOpts.tableM.appoint_register_asbitem = []
  341. this.dialogWin.WebBookingMzak = false
  342. },
  343. //自定义计算列
  344. getSummaries(param) {
  345. const { columns, data } = param;
  346. const sumCol = [6] //需合计的列
  347. const sums = [];
  348. let count = this.tableDataDetails.length
  349. let pack = this.tableDataDetails.filter(e => { return e.isBelongGroupPackage == 'Y' }).length
  350. this.asbDesc = `共选 ${count} 个项目,其中套餐/分组 ${pack} 个,加做 ${count - pack}`
  351. columns.forEach((column, index) => {
  352. //console.log('column, index,data',column, index,data)
  353. //显示合计列
  354. if (index == 1) {
  355. sums[index] = `合计`;
  356. return;
  357. }
  358. //不合计的列
  359. if (sumCol.indexOf(index) == -1) {
  360. sums[index] = '';
  361. return;
  362. }
  363. sums[index] = 0
  364. data.forEach(e => {
  365. if (!isNaN(e[column.property])) {
  366. if (index == 1) {
  367. sums[index] += e[column.property] * e['amount']
  368. } else {
  369. sums[index] += e[column.property]
  370. }
  371. }
  372. })
  373. sums[index] = Math.round(sums[index] * 100) / 100 //+ ' 元';
  374. // const values = data.map(item => Number(item[column.property]));
  375. // if (!values.every(value => isNaN(value))) {
  376. // sums[index] = values.reduce((prev, curr) => {
  377. // const value = Number(curr);
  378. // if (!isNaN(value)) {
  379. // //return prev + curr; //原始
  380. // return prev + curr; //改造
  381. // } else {
  382. // return prev;
  383. // }
  384. // }, 0);
  385. // sums[index] = sums[index].toFixed(2) + ' 元';
  386. // } else {
  387. // sums[index] = 'N/A';
  388. // }
  389. });
  390. this.totalStand = sums[1];
  391. //console.log('this.totalFoucs/this.discountFoucs',this.totalFoucs,this.discountFoucs)
  392. if (!this.totalFoucs) this.total = sums[5];
  393. if (!this.discountFoucs) this.discount = Math.round(this.total * 10000 / this.totalStand) / 100;
  394. return sums;
  395. },
  396. //回车替代查询
  397. enterToQuery() {
  398. // console.log('enterToTab');
  399. this.$nextTick(() => {
  400. let inputs = document.querySelectorAll(["input"]); //用数组可以读取多个标签的元素 //.inline-input
  401. // 为每个输入框添加键盘事件监听器
  402. inputs.forEach((input, i) => {
  403. // console.log('input',input);
  404. input.addEventListener('keydown', (event) => {
  405. if (event.keyCode === 13) {
  406. // 阻止回车键的默认行为(换行)
  407. event.preventDefault();
  408. // 如果按下的是回车查询
  409. // console.log(input.getAttribute('placeholder'),input.value)
  410. let placeholder = input.getAttribute('placeholder')
  411. switch (placeholder) {
  412. case '预约手机号':
  413. case '身份证号':
  414. case '姓名、电话、身份证号':
  415. this.btnQuery()
  416. input.select()
  417. break;
  418. }
  419. }
  420. });
  421. input.addEventListener('click', (event) => {
  422. let placeholder = input.getAttribute('placeholder')
  423. switch (placeholder) {
  424. case '预约手机号':
  425. case '身份证号':
  426. case '姓名、电话、身份证号':
  427. input.select()
  428. break;
  429. }
  430. });
  431. });
  432. });
  433. },
  434. },
  435. //监听事件()
  436. watch: {
  437. "dataTransOpts.plus.WebBookingMzak": {
  438. // immediate:true,
  439. handler(newVal, oldVal) {
  440. console.log(`watch dataTransOpts.plus.WebBookingMzak newVal: ${newVal}, oldVal: ${oldVal} `);
  441. if (newVal != oldVal) this.funMounted()
  442. }
  443. },
  444. },
  445. };
  446. </script>
  447. <style scoped>
  448. @import '../../assets/css/global_card.css';
  449. @import '../../assets/css/global_input.css';
  450. @import '../../assets/css/global_table.css';
  451. @import '../../assets/css/global.css';
  452. .query {
  453. margin-right: 10px;
  454. font-size: 14px;
  455. color: #232748;
  456. font-weight: 400;
  457. font-family: "NotoSansSC-Regular";
  458. }
  459. .spanClass {
  460. font-size: 14px;
  461. padding: 0 2px 0 0;
  462. }
  463. </style>