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.

909 lines
32 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div>
  3. <el-card>
  4. <div style="display: flex; width: 100%;">
  5. <!-- 查询条件 与列表 -->
  6. <div class="queryDivClass">
  7. <!-- 查询条件 -->
  8. <div style="height: 80px;">
  9. <div style="display:flex;">
  10. <div>
  11. <span>登记日期</span>
  12. <el-date-picker v-model="query.dateRange" type="daterange" align="right" unlink-panels range-separator=""
  13. start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" size="small"
  14. style="width: 240px">
  15. </el-date-picker>
  16. </div>
  17. <div style="margin-left:10px;">
  18. <el-button type="primary" class="btnClass" @click="Query">查询</el-button>
  19. </div>
  20. </div>
  21. <div style="display:flex;margin-top:10px;">
  22. <el-radio v-model="query.chargeFlag" label="N">未收费</el-radio>
  23. <el-radio v-model="query.chargeFlag" label="Y">已收费</el-radio>
  24. <el-radio v-model="query.chargeFlag" label="B">已退费</el-radio>
  25. </div>
  26. </div>
  27. <!-- 列表 -->
  28. <div class="prListDivClass">
  29. <el-table :data="patientRegister.prList" border highlight-current-row
  30. :height="(window.pageHeight > 600 ? (window.pageHeight - 230) : 350)" @row-click="rowClick" size="small"
  31. @selection-change="handleSelectionChange">
  32. <el-table-column prop="customerOrgParentName" label="单位" width="180">
  33. <template slot-scope="scope">
  34. <div>{{ scope.row.customerOrgParentName ? scope.row.customerOrgParentName : scope.row.customerOrgName }}
  35. </div>
  36. </template>
  37. </el-table-column>
  38. <el-table-column prop="patientName" label="姓名" />
  39. <el-table-column prop="sexId" label="性别">
  40. <template slot-scope="scope">
  41. <div>{{ dddw(dict.sex, "id", scope.row.sexId, "displayName") }}</div>
  42. </template>
  43. </el-table-column>
  44. <el-table-column prop="age" label="年龄" />
  45. <el-table-column prop="patientRegisterNo" label="条码号" width="150" />
  46. <el-table-column prop="patientNo" label="档案号" />
  47. <el-table-column prop="medicalTimes" label="体检次数"></el-table-column>
  48. <el-table-column label="分组/套餐" width="150">
  49. <template slot-scope="scope">
  50. <div
  51. v-if="scope.row.medicalPackageId !== dict.personOrgId && scope.row.customerOrgId === dict.personOrgId">
  52. {{ dddw(dict.medicalPackage, "id", scope.row.medicalPackageId, "displayName") }}
  53. </div>
  54. <div
  55. v-if="scope.row.medicalPackageId !== dict.personOrgId && scope.row.customerOrgId !== dict.personOrgId">
  56. {{ dddw(dict.customerOrgGroupAll, "id", scope.row.customerOrgGroupId, "displayName") }}
  57. </div>
  58. </template>
  59. </el-table-column>
  60. <el-table-column prop="completeFlag" label="体检进度">
  61. <template slot-scope="scope">
  62. <div>{{ dddw(dict.completeFlag, "id", scope.row.completeFlag, "displayName") }}</div>
  63. </template>
  64. </el-table-column>
  65. <el-table-column prop="guidePrintTimes" label="打印" width="50">
  66. <template slot-scope="scope">
  67. <i class="el-icon-printer" v-if="scope.row.guidePrintTimes > 0"
  68. style="font-size: 24px;color: green;"></i>
  69. </template>
  70. </el-table-column>
  71. <el-table-column prop="isLock" label="锁住">
  72. <template slot-scope="scope">
  73. <div>{{ scope.row.isLock == "Y" ? "是" : "否" }}</div>
  74. </template>
  75. </el-table-column>
  76. <el-table-column prop="customerOrgName" label="部门" width="180">
  77. <template slot-scope="scope">
  78. <div>{{ scope.row.customerOrgParentName ? scope.row.customerOrgName : "" }}</div>
  79. </template>
  80. </el-table-column>
  81. <el-table-column prop="nationId" label="民族">
  82. <template slot-scope="scope">
  83. <div>
  84. {{ dddw(dict.nation, "nationId", scope.row.nationId, "displayName") }}
  85. </div>
  86. </template>
  87. </el-table-column>
  88. <el-table-column prop="idNo" label="身份证" width="150" />
  89. <el-table-column prop="birthDate" label="出生日期" width="100">
  90. <template slot-scope="scope">
  91. <div v-if="scope.row.birthDate">
  92. {{ lmoment(scope.row.birthDate, "yyyy-MM-DD") }}
  93. </div>
  94. </template>
  95. </el-table-column>
  96. <el-table-column prop="email" label="邮箱" width="180" />
  97. <el-table-column prop="mobileTelephone" label="手机" width="100" />
  98. <el-table-column prop="telephone" label="电话" width="100" />
  99. <el-table-column prop="address" label="地址" width="300" />
  100. <el-table-column prop="medicalCardNo" label="体检卡号" />
  101. <el-table-column prop="jobCardNo" label="工卡号" />
  102. <el-table-column prop="maritalStatusId" label="婚姻状况">
  103. <template slot-scope="scope">
  104. <div>
  105. {{ dddw(dict.maritalStatus, "id", scope.row.maritalStatusId, "displayName") }}
  106. </div>
  107. </template>
  108. </el-table-column>
  109. <el-table-column prop="medicalTypeId" label="体检类别">
  110. <template slot-scope="scope">
  111. <div v-if="scope.row.medicalTypeId !== dict.personOrgId">
  112. {{ dddw(dict.medicalType, "id", scope.row.medicalTypeId, "displayName") }}
  113. </div>
  114. </template>
  115. </el-table-column>
  116. <el-table-column prop="personnelTypeId" label="人员类别">
  117. <template slot-scope="scope">
  118. <div v-if="scope.row.personnelTypeId !== dict.personOrgId">
  119. {{ dddw(dict.personnelType, "id", scope.row.personnelTypeId, "displayName") }}
  120. </div>
  121. </template>
  122. </el-table-column>
  123. <el-table-column prop="jobPost" label="职务" />
  124. <el-table-column prop="jobTitle" label="职称" />
  125. <el-table-column prop="salesman" label="介绍人" />
  126. <el-table-column prop="isVip" label="是否VIP">
  127. <template slot-scope="scope">
  128. <div>{{ scope.row.isVip == "Y" ? "是" : "否" }}</div>
  129. </template>
  130. </el-table-column>
  131. <el-table-column prop="creatorName" label="登记人" />
  132. <el-table-column prop="creationTime" label="登记日期" width="100">
  133. <template slot-scope="scope">
  134. <div>{{ lmoment(scope.row.creationTime, "yyyy-MM-DD") }}</div>
  135. </template>
  136. </el-table-column>
  137. <el-table-column prop="isUpload" label="是否上传">
  138. <template slot-scope="scope">
  139. <div>{{ scope.row.isUpload == "Y" ? "是" : "否" }}</div>
  140. </template>
  141. </el-table-column>
  142. </el-table>
  143. </div>
  144. </div>
  145. <!-- 收费操作 -->
  146. <div class="queryDivClass" style="margin-left:5px;">
  147. <!-- 查询信息 -->
  148. <div style="height: 40px;">
  149. <div style="display: flex; flex-wrap: wrap;margin-top:40px; height:40px; width: 100%;">
  150. <div class="query">
  151. <span>条码号</span>
  152. <el-input placeholder="条码号" v-model="query.patientRegisterNo" size="small" style="width: 140px" clearable
  153. @change="Query" />
  154. </div>
  155. <div class="query">
  156. <span>档案号</span>
  157. <el-input placeholder="档案号" v-model="query.patientNo" size="small" style="width: 100px" clearable
  158. @change="Query" />
  159. </div>
  160. <div class="query">
  161. <span>姓名</span>
  162. <el-input placeholder="姓名" v-model="query.patientName" size="small" style="width: 100px" disabled />
  163. </div>
  164. </div>
  165. </div>
  166. <!-- 收费信息 -->
  167. <div class="prListDivClass">
  168. <!-- charge -->
  169. <div>
  170. <el-form ref="form" :model="form" label-width="80px" :rules="rules" size="small">
  171. <el-row>
  172. <el-col :span="12">
  173. <el-form-item label="发票号" prop="invoiceNo">
  174. <el-input v-model="form.invoiceNo" />
  175. </el-form-item>
  176. </el-col>
  177. <el-col :span="12">
  178. <el-form-item label="开票抬头" prop="invoiceOrgName">
  179. <el-input v-model="form.invoiceOrgName" />
  180. </el-form-item>
  181. </el-col>
  182. </el-row>
  183. <el-row>
  184. <el-col :span="12">
  185. <el-form-item label="折扣" prop="discount">
  186. <el-input v-model="form.discount" />
  187. </el-form-item>
  188. </el-col>
  189. <el-col :span="12">
  190. <el-form-item label="应收金额" prop="total">
  191. <el-input v-model="form.total" />
  192. </el-form-item>
  193. </el-col>
  194. </el-row>
  195. <el-row>
  196. <el-col :span="12">
  197. <el-form-item label="预收金额" prop="preTotal">
  198. <el-input v-model="form.preTotal" />
  199. </el-form-item>
  200. </el-col>
  201. <el-col :span="12">
  202. <el-form-item label="找零" prop="balance">
  203. <el-input v-model="form.balance" />
  204. </el-form-item>
  205. </el-col>
  206. </el-row>
  207. </el-form>
  208. </div>
  209. <!-- charge_pay -->
  210. <div>
  211. <div style="margin-top:5px;font-size:10px;">收费方式</div>
  212. <el-table :data="chargePays" border highlight-current-row size="small"
  213. :height="window.pageHeight > 600 ? (window.pageHeight - 230 - 146) / 2 : 112">
  214. <el-table-column prop="payModeId" label="收费方式" width="180">
  215. <template slot-scope="scope">
  216. <div>{{ dddw(dict.payMode, "id", scope.row.payModeId, "displayName") }}</div>
  217. </template>
  218. </el-table-column>
  219. <el-table-column prop="chargeMoney" label="金额">
  220. <template slot-scope="scope">
  221. <el-input type="number" v-model="scope.row.chargeMoney" size="small" @input="inputMoney" />
  222. </template>
  223. </el-table-column>
  224. <el-table-column prop="cardBillId" label="会员卡">
  225. <template slot-scope="scope">
  226. <el-select v-model="scope.row.cardBillId" placeholder="请选择" size="small" filterable clearable
  227. :disabled="scope.row.payModeId == '05' ? false : true">
  228. <el-option v-for="item in cardRegister" :key="item.id" :label="item.idNo" :value="item.id" />
  229. </el-select>
  230. </template>
  231. </el-table-column>
  232. </el-table>
  233. </div>
  234. <!-- asbitem -->
  235. <div>
  236. <div style="margin-top:5px; font-size:10px;">待收费项目</div>
  237. <el-table :data="asbItemsForFee" border highlight-current-row
  238. :height="window.pageHeight > 600 ? (window.pageHeight - 230 - 146) / 2 : 112" size="small"
  239. @selection-change="handleSelectionChange" ref="asbItemsForFeeTable">
  240. <el-table-column type="selection" align="center" />
  241. <el-table-column label="已选组合项目" width="120" prop="asbitemName" />
  242. <el-table-column label="标准价格" prop="standardPrice" width="80" align="center" />
  243. <el-table-column label="折扣" prop="discount" width="60">
  244. <template slot-scope="scope">
  245. <el-input type="number" v-model="scope.row.discount"
  246. :disabled="scope.row.isCharge == 'Y' ? true : false" size="small"
  247. @input="changeDiscount(scope.row)" />
  248. </template>
  249. </el-table-column>
  250. <el-table-column label="数量" prop="amount" width="50">
  251. <template slot-scope="scope">
  252. <el-input type="number" v-model="scope.row.amount" size="small" />
  253. </template>
  254. </el-table-column>
  255. <el-table-column label="实收价格" prop="chargePrice" width="80">
  256. <template slot-scope="scope">
  257. <el-input type="number" v-model="scope.row.chargePrice"
  258. :disabled="scope.row.isCharge == 'Y' ? true : false" size="small" @input="changePrice(scope.row)" />
  259. </template>
  260. </el-table-column>
  261. <el-table-column prop="total" label="金额" width="70" v-if="false" />
  262. <el-table-column prop="standardPrice" label="标准金额" width="80" v-if="false" />
  263. <el-table-column label="支付方式" prop="payTypeFlag" width="100">
  264. <template slot-scope="scope">
  265. <el-select v-model="scope.row.payTypeFlag" size="small">
  266. <el-option v-for="item in dict.payType" :key="item.id" :label="item.displayName" :value="item.id" />
  267. </el-select>
  268. </template>
  269. </el-table-column>
  270. <el-table-column prop="checkCompleteFlag" label="状态" align="center">
  271. <template slot-scope="scope">
  272. <div>{{ dddw(dict.checkCompleteFlag, "id", scope.row.checkCompleteFlag, "displayName") }}</div>
  273. </template>
  274. </el-table-column>
  275. <el-table-column prop="creatorName" label="登记人" align="center" />
  276. <el-table-column prop="creationTime" label="登记日期" width="90" align="center">
  277. <template slot-scope="scope">
  278. <div>{{ moment(scope.row.creationTime, 'yyyy-MM-DD') }}</div>
  279. </template>
  280. </el-table-column>
  281. </el-table>
  282. </div>
  283. </div>
  284. </div>
  285. <div class="btnDivClass">
  286. <div class="btnListClass">
  287. <el-button type="primary" class="btnClass" @click="charge" :disabled="query.chargeFlag == 'N' ? false:true">收费</el-button>
  288. </div>
  289. <div class="btnListClass">
  290. <el-button type="danger" class="btnClass" @click="chargeBack" :disabled="query.chargeFlag == 'Y' ? false:true">退费</el-button>
  291. </div>
  292. <div class="btnListClass">
  293. <el-button type="success" class="btnClass" @click="chargePrint('0007', false, form.id)" :disabled="query.chargeFlag == 'B' ? true:false">打印</el-button>
  294. </div>
  295. </div>
  296. </div>
  297. </el-card>
  298. </div>
  299. </template>
  300. <script>
  301. import moment from 'moment';
  302. import { mapState, mapActions } from "vuex";
  303. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  304. import { tcdate, dddw, arrayExistObj } from "../../utlis/proFunc";
  305. import PatientRegisterQuery from "../../components/patientRegister/patientRegisterQuery.vue";
  306. import PatientRegisterRefuseList from "../../components/patientRegister/PatientRegisterRefuseList.vue";
  307. export default {
  308. components: {
  309. PatientRegisterQuery,
  310. PatientRegisterRefuseList,
  311. },
  312. data() {
  313. return {
  314. query: { chargeFlag: 'N' },//查询条件
  315. form: {
  316. id: null,
  317. patientRegisterId: null,
  318. invoiceNo: '',
  319. invoiceOrgName: '',
  320. chargeFlag: '1',
  321. discount: 0,
  322. total: 0, //应收金额
  323. preTotal: 0, //预收金额
  324. balance: 0, //找零
  325. }, //收费主表
  326. rules: {
  327. invoiceNo: [
  328. { required: true, message: "请填写发票/收据号", trigger: "blur" },
  329. ],
  330. total: [
  331. { required: true, message: "请填写应收金额", trigger: "blur" },
  332. ],
  333. },
  334. pickerOptions: {
  335. shortcuts: [
  336. {
  337. text: "最近一周",
  338. onClick(picker) {
  339. const end = new Date();
  340. const start = new Date();
  341. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  342. picker.$emit("pick", [start, end]);
  343. },
  344. },
  345. {
  346. text: "最近一个月",
  347. onClick(picker) {
  348. const end = new Date();
  349. const start = new Date();
  350. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  351. picker.$emit("pick", [start, end]);
  352. },
  353. },
  354. {
  355. text: "最近三个月",
  356. onClick(picker) {
  357. const end = new Date();
  358. const start = new Date();
  359. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  360. picker.$emit("pick", [start, end]);
  361. },
  362. },
  363. ],
  364. },
  365. chargePays: [], //收支方式
  366. asbItemsForFee: [], //待收费项目
  367. selectedData: [], //选中项目
  368. cardRegister: [{ id: '00000000-0000-0000-0000-000000000000', idNo: '0001' }], //当前客户的会员卡
  369. cardRegisterAll: [], //所有客户的会员卡
  370. };
  371. },
  372. created() { },
  373. //挂载完成
  374. mounted() {
  375. this.dictInit();
  376. },
  377. computed: {
  378. ...mapState(["window", "dict", "patientRegister", "customerOrg"]),
  379. },
  380. methods: {
  381. ...mapActions(["getCustomerOrgGroup"]),
  382. dddw, moment,
  383. //查询人员列表数据
  384. Query() {
  385. console.log('query', this.query);
  386. },
  387. //人员列表点击
  388. rowClick(row) {
  389. this.getAsbItemsForFee(row.patientRegisterId, row.chargeId);
  390. },
  391. //获取项目列表
  392. async getAsbItemsForFee(patientRegisterId, chargeId) {
  393. //待收费项目列表
  394. this.asbItemsForFee = [];
  395. if (this.query.chargeFlag = 'N') {
  396. getapi(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${patientRegisterId}`)
  397. .then(res => {
  398. if (res.code == 1) {
  399. this.asbItemsForFee = res.data;
  400. this.asbItemsForFee.forEach(e => {
  401. e.chargePriceOri = e.chargePrice;
  402. e.standTotal = e.amount * e.standardPrice;
  403. e.total = e.amount * e.chargePrice;
  404. return e
  405. });
  406. this.toCharge(patientRegisterId, chargeId);
  407. }
  408. });
  409. } else {
  410. //已收费项目列表
  411. getapi(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${chargeId}`)
  412. .then(res => {
  413. if (res.code == 1) {
  414. this.asbItemsForFee = res.data;
  415. }
  416. });
  417. }
  418. },
  419. //待收费数据分析
  420. toCharge() {
  421. //默认全部选中
  422. this.selectedData = this.asbItemsForFee;
  423. this.$nextTick(function () {
  424. // let rows = []
  425. // for (let m = 0; m < this.selectedData.length; m++) {
  426. // for (let n = 0; n < this.tableData.length; n++) {
  427. // if (this.selectedData[m].id === this.tableData[n].id) {
  428. // rows.push(this.tableData[n])
  429. // }
  430. // }
  431. // }
  432. this.selectedData.forEach(row => {
  433. this.$refs['asbItemsForFeeTable'].toggleRowSelection(row)
  434. })
  435. });
  436. this.form.patientRegisterId = patientRegisterId;
  437. },
  438. //根据明细算总价与折扣
  439. sumTotal() {
  440. let total = Number(0), totalOri = Number(0);
  441. this.selectedData.forEach(e => {
  442. totalOri += Number(e.amount * e.chargePriceOri); //原始实收价格
  443. total += Number(e.amount * e.chargePrice); //当前实收价格
  444. });
  445. this.form.total = total;
  446. if (totalOri == 0) {
  447. this.form.discount = 100;
  448. } else {
  449. this.form.discount = Math.round(total / totalOri, 2);
  450. }
  451. },
  452. //通过折扣计算总价与明细价格
  453. discountToDetails() {
  454. let discount = this.form.discount;
  455. let totalOri = Number(0), totalCompute = Number(0), totalPlan = Number(0);
  456. let lfind = -1;
  457. this.selectedData.forEach(e => {
  458. totalOri += Number(e.amount * e.chargePriceOri); //原始实收价格
  459. lfind = arrayExistObj(this.asbItemsForFee, 'id', e.id)
  460. if (lfind > -1 && e.chargePriceOri != 0) {
  461. this.asbItemsForFee[lfind].discount = discount;
  462. this.asbItemsForFee[lfind].chargePrice = Math.round(e.chargePriceOri * discount, 2);
  463. totalCompute += Number(this.asbItemsForFee[lfind].chargePrice * e.amount);
  464. }
  465. });
  466. totalPlan = Math.round(totalOri * discount, 2);
  467. this.form.total = totalPlan;
  468. //明细和与总金额不符处理 (其实不处理亦无关系)
  469. this.handleBalance(totalPlan, totalCompute);
  470. },
  471. //通过折扣计算总价与明细价格
  472. totalToDetails() {
  473. let discount = 0;
  474. let totalOri = Number(0), totalCompute = Number(0), totalPlan = Number(this.form.total);
  475. let lfind = -1;
  476. this.selectedData.forEach(e => {
  477. totalOri += Number(e.amount * e.chargePriceOri); //原始实收价格
  478. });
  479. discount = Math.round(totalPlan / totalOri, 2);
  480. //
  481. this.selectedData.forEach(e => {
  482. lfind = arrayExistObj(this.asbItemsForFee, 'id', e.id);
  483. if (lfind > -1) {
  484. this.asbItemsForFee[lfind].chargePrice = Math.round(this.asbItemsForFee[lfind].chargePrice * discount, 2);
  485. totalCompute += this.asbItemsForFee[lfind].chargePrice * e.amount;
  486. }
  487. });
  488. //明细和与总金额不符处理 (其实不处理亦无关系)
  489. this.handleBalance(totalPlan, totalCompute);
  490. },
  491. //明细合计金额与总金额不一致时,处理
  492. handleBalance(totalPlan, totalCompute) {
  493. if (totalPlan != totalCompute) {
  494. for (let i = this.selectedData.length - 1; i = 0; i--) {
  495. lfind = lfind = arrayExistObj(this.asbItemsForFee, 'id', this.selectedData[i].id);
  496. if (lfind > -1 && this.selectedData[i].amount == 1) {
  497. this.asbItemsForFee[lfind].chargePrice = this.asbItemsForFee[lfind].chargePrice + totalPlan - totalCompute;
  498. this.selectedData[i].chargePrice = this.asbItemsForFee[lfind].chargePrice;
  499. break;
  500. }
  501. }
  502. }
  503. },
  504. //输入收费方式金额
  505. inputMoney() {
  506. let total = Number(0);
  507. this.chargePays.forEach(e => {
  508. total += Number(e.chargeMoney);
  509. });
  510. if (total > this.form.total) this.$message.warning("输入金额超过总金额");
  511. },
  512. //勾选要收费的项目
  513. handleSelectionChange(v) {
  514. this.selectedData = v;
  515. this.sumTotal();
  516. },
  517. //调整明细折扣
  518. changeDiscount(row) {
  519. let total = this.form.total;
  520. let totalDetailsOri = row.amount * row.chargePrice;
  521. let totalDetailsCur = Number(0);
  522. row.chargePrice = Math.round(row.discount * row.chargePriceOri, 2);
  523. let lfind = arrayExistObj(this.selectedData, 'id', row.id);
  524. if (lfind > -1) {
  525. totalDetailsCur = row.amount * row.chargePrice;
  526. this.form.total = total + totalDetailsCur - totalDetailsOri;
  527. }
  528. },
  529. //调整明细实收价格
  530. changePrice(row) {
  531. if (row.chargePriceOri != 0) {
  532. row.discount = Math.round(row.chargePrice / row.chargePriceOri, 2);
  533. }
  534. row.chargePrice = Math.round(row.discount * row.chargePriceOri, 2);
  535. let lfind = arrayExistObj(this.selectedData, 'id', row.id);
  536. if (lfind > -1) {
  537. this.selectedData[lfind].discount = row.discount;
  538. this.selectedData[lfind].chargePrice = row.chargePrice;
  539. }
  540. this.sumTotal();
  541. },
  542. //收费
  543. charge() {
  544. let total = Number(0);
  545. let msg = '';
  546. let form = {};
  547. let chargePays = [];
  548. let chargeAsbitem = [];
  549. this.chargePays.forEach(e => {
  550. total += Number(e.chargeMoney);
  551. if (e.payModeId == '05') {
  552. if (!e.cardBillId) msg = '请先择会员卡号';
  553. } else {
  554. e.cardBillId = null;
  555. }
  556. return e;
  557. });
  558. if (msg) {
  559. this.$message.warning(msg);
  560. return;
  561. }
  562. if (total != this.form.total) {
  563. this.$message.warning("收费方式合计金额与收费总金额不符");
  564. return;
  565. }
  566. this.$refs[form].validate((valid) => {
  567. if (!valid) {
  568. this.$message.warning("数据未通过校验!");
  569. return;
  570. }
  571. });
  572. this.chargePays.forEach(e => {
  573. if (e.chargeMoney) {
  574. chargePays.push(e);
  575. }
  576. });
  577. form = {
  578. patientRegisterId: this.form.patientRegisterId,
  579. invoiceNo: this.form.invoiceNo,
  580. invoiceOrgName: this.form.invoiceOrgName,
  581. chargeFlag: this.form.chargeFlag,
  582. };
  583. this.selectedData.forEach(e => {
  584. chargeAsbitem.push({
  585. asbitemId: e.asbitemId,
  586. chargePrice: e.chargePrice,
  587. amount: e.amount,
  588. registerAsbitemId: e.id,
  589. });
  590. });
  591. },
  592. //退费
  593. chargeBack() {
  594. let chargeId = this.form.id;
  595. let msg = '';
  596. let chargeBackPays = [];
  597. this.chargePays.forEach(e => {
  598. total += Number(e.chargeMoney);
  599. if (e.payModeId == '05') {
  600. if (!e.cardBillId) msg = '请先择会员卡号';
  601. } else {
  602. e.cardBillId = null;
  603. }
  604. return e;
  605. });
  606. if (msg) {
  607. this.$message.warning(msg);
  608. return;
  609. }
  610. if (total != this.form.total) {
  611. this.$message.warning("退费方式合计金额与退费总金额不符");
  612. return;
  613. }
  614. this.chargePays.forEach(e => {
  615. if (e.chargeMoney) {
  616. chargeBackPays.push(e);
  617. }
  618. });
  619. },
  620. //收费打印
  621. chargePrint(ReportCode, isPreview, chargeId) {
  622. if (chargeId.length < 1) {
  623. this.$message.info("人员信息尚未保存,不可执行此操作!");
  624. return;
  625. }
  626. let token = localStorage.getItem('token');
  627. let user = localStorage.getItem('user');
  628. let toOutShell = {
  629. ReportCode, token,
  630. preViewCanPrint: 'Y',
  631. Parameters: [
  632. { Name: 'printer', Value: user },
  633. { Name: 'hisLog', Value: 'pic/hisLog.jpg' },
  634. ],
  635. };
  636. if (isPreview) {
  637. getapi(`/api/app/printreport/getpatientregisterguidereport?PatientRegisterId=${chargeId}`)
  638. .then((res) => {
  639. if (res.code != -1) {
  640. toOutShell.ReportTable = res.data;
  641. console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
  642. return this.$peisAPI.printPre(JSON.stringify(toOutShell));
  643. }
  644. })
  645. .catch(err => {
  646. this.$message.warning(err);
  647. });
  648. } else {
  649. getapi(`/api/app/printreport/getpatientregisterguidereport?PatientRegisterId=${chargeId}`)
  650. .then((res) => {
  651. if (res.code != -1) {
  652. toOutShell.ReportTable = res.data;
  653. console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
  654. return this.$peisAPI.print(JSON.stringify(toOutShell));
  655. }
  656. })
  657. .catch(err => {
  658. this.$message.warning(err);
  659. });
  660. }
  661. },
  662. //数据初始化
  663. dictInit() {
  664. //性别(仅档案用)
  665. getapi("/api/app/sex").then((res) => {
  666. if (res.code == 1) {
  667. this.dict.sex = res.data;
  668. }
  669. });
  670. //性别(查询)
  671. getapi("/api/app/for-sex").then((res) => {
  672. if (res.code == 1) {
  673. this.dict.forSex = res.data;
  674. }
  675. });
  676. //体检单位
  677. getapi("/api/app/customer-org/by-code-all").then((res) => {
  678. this.patientRegister.customerOrgTreeAll = res.data;
  679. tcdate(this.patientRegister.customerOrgTreeAll)
  680. });
  681. //体检中心
  682. getapi("/api/app/organization-units/organization-unit-by-is-peis").then(
  683. (res) => {
  684. if (res.code == 1) {
  685. this.dict.organization = res.data;
  686. }
  687. }
  688. );
  689. //体检单位
  690. getapi("/api/app/customer-org/in-filter").then((res) => {
  691. if (res.code == 1) {
  692. this.dict.customerOrg = res.data.items;
  693. }
  694. });
  695. //体检类别
  696. getapi("/api/app/medical-type/in-filter").then((res) => {
  697. if (res.code == 1) {
  698. this.dict.medicalType = res.data.items;
  699. }
  700. });
  701. //人员类别
  702. getapi("/api/app/personnel-type/in-filter").then((res) => {
  703. if (res.code == 1) {
  704. this.dict.personnelType = res.data.items;
  705. }
  706. });
  707. //婚姻状况
  708. getapi("/api/app/marital-statuses").then((res) => {
  709. if (res.code == 1) {
  710. this.dict.maritalStatus = res.data.items;
  711. }
  712. });
  713. //性激素期
  714. getapi("/api/app/sex-hormone-term/in-filter").then((res) => {
  715. if (res.code == 1) {
  716. this.dict.sexHormoneTerm = res.data.items;
  717. }
  718. });
  719. //民族
  720. getapi("/api/app/nation/in-filter").then((res) => {
  721. if (res.code == 1) {
  722. this.dict.nation = res.data.items;
  723. }
  724. });
  725. //籍惯 ,出生地
  726. getapi("/api/app/birth-place/in-filter").then((res) => {
  727. if (res.code == 1) {
  728. this.dict.birthPlace = res.data.items;
  729. }
  730. });
  731. //套餐
  732. getapi("/api/app/medical-package/in-filter").then((res) => {
  733. if (res.code == 1) {
  734. this.dict.medicalPackage = res.data.items;
  735. }
  736. });
  737. //分组,所有分组,不限单位,不限次数
  738. getapi("/api/app/customer-org-group").then((res) => {
  739. if (res.code == 1) {
  740. this.dict.customerOrgGroupAll = res.data.items;
  741. }
  742. });
  743. //支付方式
  744. getapi("/api/app/pay-mode").then((res) => {
  745. if (res.code == 1) {
  746. this.dict.payMode = res.data;
  747. //未收费时
  748. this.chargePays = [];
  749. this.dict.payMode.forEach(e => {
  750. this.chargePays.push({ chargeId: null, payModeId: e.id, chargeMoney: 0, cardBillId: null })
  751. })
  752. }
  753. });
  754. //体检类别 树结构
  755. getapi("/api/app/item-type/by-code-all").then((res) => {
  756. if (res.code == 1) {
  757. this.dict.itemTypeTree = res.data;
  758. tcdate(this.dict.itemTypeTree);
  759. }
  760. });
  761. getapi("/api/app/asbitem/in-filter?Filter").then((res) => {
  762. if (res.code == 1) {
  763. this.dict.asbItemAll = res.data.items;
  764. }
  765. });
  766. console.log("dict", this.dict);
  767. },
  768. },
  769. //监听事件()
  770. watch: {
  771. },
  772. };
  773. </script>
  774. <style scoped>
  775. ::v-deep .el-form-item {
  776. margin-bottom: 1px;
  777. }
  778. ::v-deep .el-table--small .el-table__cell {
  779. padding: 0px 0;
  780. }
  781. ::v-deep .el-input__inner {
  782. text-align: left;
  783. padding-left: 5px;
  784. padding-right: 15px;
  785. }
  786. ::v-deep input[type="number"]::-webkit-inner-spin-button,
  787. input[type="number"]::-webkit-outer-spin-button {
  788. -webkit-appearance: none !important;
  789. margin: 0 !important;
  790. }
  791. ::v-deep .el-table th.el-table__cell {
  792. text-align: center;
  793. padding-left: 1px;
  794. padding-right: 1px;
  795. }
  796. ::v-deep .el-table td.el-table__cell {
  797. padding-left: 1px;
  798. padding-right: 1px;
  799. }
  800. ::v-deep .el-table .cell {
  801. padding-left: 1px;
  802. padding-right: 1px;
  803. }
  804. .queryDivClass {
  805. display: block;
  806. width: v-bind("(window.pageWidth > 600 ? (window.pageWidth - 120 - 80) / 2 : 200) + 'px'");
  807. height: v-bind("(window.pageHeight > 600 ? (window.pageHeight - 150) : 450) + 'px'");
  808. }
  809. .query {
  810. margin-left: 10px;
  811. }
  812. .prListDivClass {
  813. height: v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'");
  814. }
  815. .btnDivClass {
  816. display: block;
  817. width: 110px;
  818. margin-left: 5px;
  819. margin-top: 180px;
  820. }
  821. .btnListClass {
  822. margin-top: 10px;
  823. }
  824. .btnClass {
  825. width: 110px;
  826. }
  827. </style>