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.

495 lines
17 KiB

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