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.

1127 lines
38 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
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
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
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
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
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 class="publiccss">体检收费</div>
  5. <div style="display: flex; width: 100%;margin-top:20px">
  6. <!-- 查询条件 与列表 -->
  7. <div class="queryDivClass">
  8. <!-- 查询条件 -->
  9. <div style="height: 80px;">
  10. <div style="display:flex;">
  11. <div>
  12. <span>登记日期</span>
  13. <el-date-picker v-model="query.dateRange" type="daterange" align="right" unlink-panels range-separator=""
  14. start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" size="small"
  15. style="width: 240px">
  16. </el-date-picker>
  17. </div>
  18. <div style="margin-left:10px;">
  19. <el-button type="primary" class="btnClass" @click="Query" size="small" style="width:95px;">查询</el-button>
  20. </div>
  21. </div>
  22. <div style="display:flex;margin-top:10px;">
  23. <el-radio-group v-model="query.chargeFlag" @input="Query" size="mini" style="margin-top:8px;">
  24. <el-radio label="N">未收费</el-radio>
  25. <el-radio label="Y">已收费</el-radio>
  26. <el-radio label="B">已退费</el-radio>
  27. </el-radio-group>
  28. <div style="margin-left:20px;">
  29. <span>发票号</span>
  30. <el-input placeholder="发票/收据号" v-model="query.invoiceNo" size="small" style="width: 100px;" clearable
  31. @change="Query('invoiceNo')" />
  32. </div>
  33. </div>
  34. </div>
  35. <!-- 列表 -->
  36. <div class="prListDivClass">
  37. <el-table :data="patientList" border highlight-current-row
  38. :height="(window.pageHeight > 600 ? (window.pageHeight - 230) : 350)" @row-click="rowClick" size="small">
  39. <!--
  40. <el-table-column prop="patientRegisterId" label="体检记录ID" />
  41. -->
  42. <el-table-column prop="customerOrgParentName" label="单位" width="180">
  43. <template slot-scope="scope">
  44. <div>{{ scope.row.customerOrgParentName ? scope.row.customerOrgParentName : scope.row.customerOrgName }}
  45. </div>
  46. </template>
  47. </el-table-column>
  48. <el-table-column prop="patientName" label="姓名" />
  49. <el-table-column prop="sexId" label="性别" />
  50. <el-table-column prop="age" label="年龄" />
  51. <el-table-column prop="patientRegisterNo" label="条码号" width="150" />
  52. <el-table-column prop="patientNo" label="档案号" />
  53. <el-table-column prop="medicalTimes" label="体检次数" />
  54. <el-table-column prop="isVip" label="是否VIP">
  55. <template slot-scope="scope">
  56. <div>{{ scope.row.isVip == "Y" ? "是" : "否" }}</div>
  57. </template>
  58. </el-table-column>
  59. <el-table-column prop="salesman" label="介绍人" />
  60. <el-table-column prop="invoiceNo" label="发票号" />
  61. <el-table-column prop="invoiceOrgName" label="发票抬头" />
  62. <!--
  63. <el-table-column prop="chargeId" label="介绍人" />
  64. <el-table-column prop="chargeBackId" label="介绍人" />
  65. -->
  66. <el-table-column prop="email" label="邮箱" width="180" />
  67. <el-table-column prop="idNo" label="身份证" width="150" />
  68. <el-table-column prop="mobileTelephone" label="手机" width="100" />
  69. <el-table-column prop="telephone" label="电话" width="100" />
  70. <el-table-column prop="address" label="地址" width="300" />
  71. </el-table>
  72. </div>
  73. </div>
  74. <!-- 收费操作 -->
  75. <div class="queryDivClass" style="margin-left:5px;">
  76. <!-- 查询信息 -->
  77. <div style="height: 40px;">
  78. <div style="display: flex; flex-wrap: wrap;margin-top:40px; height:40px; width: 100%;">
  79. <div class="query">
  80. <span>条码号</span>
  81. <el-input placeholder="条码号" v-model="query.patientRegisterNo" size="small" style="width: 140px;" clearable
  82. @change="Query('patientRegisterNo')" />
  83. </div>
  84. <div class="query">
  85. <span>档案号</span>
  86. <el-input placeholder="档案号" v-model="query.patientNo" size="small" style="width: 100px;" clearable
  87. @change="Query('patientNo')" />
  88. </div>
  89. <div class="query">
  90. <span>姓名</span>
  91. <el-input placeholder="姓名" v-model="query.patientName" size="small" style="width: 100px;" disabled
  92. @change="Query" />
  93. </div>
  94. </div>
  95. </div>
  96. <!-- 收费信息 -->
  97. <div class="prListDivClass">
  98. <!-- charge -->
  99. <div style="height:103px;">
  100. <el-form ref="form" :model="form" label-width="80px" :rules="rules" size="small"
  101. :disabled="query.chargeFlag != 'N'">
  102. <el-row>
  103. <el-col :span="12">
  104. <el-form-item label="发票号" prop="invoiceNo">
  105. <el-input v-model="form.invoiceNo" />
  106. </el-form-item>
  107. </el-col>
  108. <el-col :span="12">
  109. <el-form-item label="开票抬头" prop="invoiceOrgName">
  110. <el-input v-model="form.invoiceOrgName" />
  111. </el-form-item>
  112. </el-col>
  113. </el-row>
  114. <el-row>
  115. <el-col :span="12">
  116. <el-form-item label="折扣" prop="discount">
  117. <el-input v-model="form.discount" @input="discountToDetails" />
  118. </el-form-item>
  119. </el-col>
  120. <el-col :span="12">
  121. <el-form-item label="应收金额" prop="total">
  122. <el-input v-model="form.total" @input="totalToDetails" />
  123. </el-form-item>
  124. </el-col>
  125. </el-row>
  126. <el-row v-if="query.chargeFlag == 'N'">
  127. <el-col :span="12">
  128. <el-form-item label="预收金额" prop="preTotal">
  129. <el-input v-model="form.preTotal" @input="findBalance" />
  130. </el-form-item>
  131. </el-col>
  132. <el-col :span="12">
  133. <el-form-item label="找零" prop="balance">
  134. <el-input v-model="form.balance" disabled />
  135. </el-form-item>
  136. </el-col>
  137. </el-row>
  138. </el-form>
  139. </div>
  140. <!-- charge_pay -->
  141. <div>
  142. <div style="margin-top:5px;font-size:10px;">{{ query.chargeFlag == 'B' ? '退' : '收' }}费方式</div>
  143. <el-table :data="chargePays" border highlight-current-row size="small"
  144. :height="window.pageHeight > 600 ? (window.pageHeight - 230 - 146) / 2 : 112">
  145. <el-table-column prop="payModeId" :label="(query.chargeFlag == 'B' ? '退' : '收') + '费方式'" width="180">
  146. <template slot-scope="scope">
  147. <div>{{ dddw(dict.payMode, "id", scope.row.payModeId, "displayName") }}</div>
  148. </template>
  149. </el-table-column>
  150. <el-table-column prop="chargeMoney" label="金额">
  151. <template slot-scope="scope">
  152. <el-input type="number" v-model="scope.row.chargeMoney" size="small" @input="inputMoney"
  153. :disabled="query.chargeFlag == 'B'" />
  154. </template>
  155. </el-table-column>
  156. <el-table-column prop="cardRegisterId" label="会员卡">
  157. <template slot-scope="scope">
  158. <el-select v-model="scope.row.cardRegisterId" placeholder="请选择" size="small" filterable clearable
  159. :disabled="scope.row.payModeId == '05' && query.chargeFlag != 'B' ? false : true">
  160. <el-option v-for="item in cardRegister" :key="item.id" :label="item.cardNo" :value="item.id" />
  161. </el-select>
  162. </template>
  163. </el-table-column>
  164. </el-table>
  165. </div>
  166. <!-- asbitem -->
  167. <div>
  168. <div style="margin-top:5px; font-size:10px;">{{ query.chargeFlag == 'N' ? '待收' : (query.chargeFlag == 'Y' ?
  169. '已收' : '已退') }}费项目</div>
  170. <el-table :data="asbItemsForFee" border highlight-current-row
  171. :height="window.pageHeight > 600 ? (window.pageHeight - 230 - 146) / 2 : 112" size="small"
  172. @selection-change="handleSelectionChange" ref="asbItemsForFeeTable">
  173. <el-table-column type="selection" align="center" v-if="query.chargeFlag == 'N'" />
  174. <el-table-column label="组合项目" width="120" prop="asbitemName" />
  175. <el-table-column label="标准价格" prop="standardPrice" width="80" align="center" />
  176. <el-table-column label="折扣" prop="discount" width="60" align="center">
  177. <template slot-scope="scope">
  178. <el-input type="number" v-model="scope.row.discount" v-if="query.chargeFlag == 'N'"
  179. :disabled="scope.row.isCharge == 'Y' ? true : false" size="small"
  180. @input="changeDiscount(scope.row)" />
  181. <div v-if="query.chargeFlag != 'N'">{{ scope.row.discount }}</div>
  182. </template>
  183. </el-table-column>
  184. <el-table-column label="数量" prop="amount" width="50" align="center" />
  185. <el-table-column label="实收价格" prop="chargePrice" width="80" align="center">
  186. <template slot-scope="scope">
  187. <el-input type="number" v-model="scope.row.chargePrice" v-if="query.chargeFlag == 'N'"
  188. :disabled="scope.row.isCharge == 'Y' ? true : false" size="small" @input="changePrice(scope.row)" />
  189. <div v-if="query.chargeFlag != 'N'">{{ scope.row.chargePrice }}</div>
  190. </template>
  191. </el-table-column>
  192. <el-table-column prop="total" label="金额" width="70" v-if="false" />
  193. <el-table-column prop="standardPrice" label="标准金额" width="80" v-if="false" />
  194. <el-table-column label="支付方式" prop="payTypeFlag" width="100" align="center">
  195. <template slot-scope="scope">
  196. <div>{{ dddw(dict.payType, "id", scope.row.payTypeFlag, "displayName") }}</div>
  197. </template>
  198. </el-table-column>
  199. <el-table-column prop="checkCompleteFlag" label="状态" align="center">
  200. <template slot-scope="scope">
  201. <div>{{ dddw(dict.checkCompleteFlag, "id", scope.row.checkCompleteFlag, "displayName") }}</div>
  202. </template>
  203. </el-table-column>
  204. <el-table-column prop="creatorName" label="登记人" align="center" />
  205. <el-table-column prop="creationTime" label="登记日期" width="90" align="center">
  206. <template slot-scope="scope">
  207. <div v-if="scope.row.creationTime">{{ moment(scope.row.creationTime).format('yyyy-MM-DD') }}</div>
  208. </template>
  209. </el-table-column>
  210. </el-table>
  211. </div>
  212. </div>
  213. </div>
  214. <div class="btnDivClass">
  215. <div class="btnListClass">
  216. <el-button type="primary" class="btnClass" @click="charge"
  217. :disabled="query.chargeFlag == 'N' ? false : true">收费</el-button>
  218. </div>
  219. <div class="btnListClass">
  220. <el-button type="danger" class="btnClass" @click="chargeBack"
  221. :disabled="query.chargeFlag == 'Y' ? false : true">退费</el-button>
  222. </div>
  223. <div class="btnListClass">
  224. <el-button type="success" class="btnClass" @click="chargePrint('0007', false, form.id)"
  225. :disabled="query.chargeFlag == 'B' ? true : false">打印</el-button>
  226. </div>
  227. <div class="btnListClass">
  228. <el-button type="success" class="btnClass" @click="chargePrint('0007', true, form.id)"
  229. :disabled="query.chargeFlag == 'B' ? true : false">打印预览</el-button>
  230. </div>
  231. </div>
  232. </div>
  233. </el-card>
  234. </div>
  235. </template>
  236. <script>
  237. import moment from 'moment';
  238. import { mapState, mapActions } from "vuex";
  239. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  240. import { tcdate, dddw, arrayExistObj, deepCopy } from "../../utlis/proFunc";
  241. import PatientRegisterQuery from "../../components/patientRegister/patientRegisterQuery.vue";
  242. import PatientRegisterRefuseList from "../../components/patientRegister/PatientRegisterRefuseList.vue";
  243. export default {
  244. components: {
  245. PatientRegisterQuery,
  246. PatientRegisterRefuseList,
  247. },
  248. data() {
  249. return {
  250. query: {
  251. chargeFlag: 'N',
  252. dateRange: null,
  253. patientRegisterNo: '',
  254. patientNo: '',
  255. invoiceNo: '',
  256. patientName: '',
  257. },//查询条件
  258. patientList: [],//人员列表
  259. form: {
  260. id: null,
  261. patientRegisterId: null,
  262. invoiceNo: '',
  263. invoiceOrgName: '',
  264. chargeFlag: '0',
  265. discount: 100,
  266. total: 0, //应收金额
  267. preTotal: 0, //预收金额
  268. balance: 0, //找零
  269. }, //收费主表
  270. rules: {
  271. invoiceNo: [
  272. { required: true, message: "请填写发票/收据号", trigger: "blur" },
  273. ],
  274. total: [
  275. { required: true, message: "请填写应收金额", trigger: "blur" },
  276. ],
  277. },
  278. pickerOptions: {
  279. shortcuts: [
  280. {
  281. text: "最近一周",
  282. onClick(picker) {
  283. const end = new Date();
  284. const start = new Date();
  285. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  286. picker.$emit("pick", [start, end]);
  287. },
  288. },
  289. {
  290. text: "最近一个月",
  291. onClick(picker) {
  292. const end = new Date();
  293. const start = new Date();
  294. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  295. picker.$emit("pick", [start, end]);
  296. },
  297. },
  298. {
  299. text: "最近三个月",
  300. onClick(picker) {
  301. const end = new Date();
  302. const start = new Date();
  303. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  304. picker.$emit("pick", [start, end]);
  305. },
  306. },
  307. ],
  308. },
  309. chargePays: [], //收支方式
  310. chargePaysInit: [], //收支方式(初始状态)
  311. asbItemsForFee: [], //待收费项目
  312. selectedData: [], //选中项目
  313. cardRegister: [{ id: '00000000-0000-0000-0000-000000000000', cardNo: '0001' }], //当前客户的会员卡
  314. cardRegisterAll: [], //所有客户的会员卡
  315. };
  316. },
  317. created() {
  318. this.dictInit();
  319. this.query.patientRegisterNo = this.patientRegister.patientRegisterRd.patientRegisterNo;
  320. },
  321. //挂载完成
  322. mounted() {
  323. if(this.query.patientRegisterNo){
  324. this.Query('patientRegisterNo');
  325. }else{
  326. this.Query();
  327. }
  328. },
  329. computed: {
  330. ...mapState(["window", "dict", "patientRegister", "customerOrg"]),
  331. },
  332. methods: {
  333. ...mapActions(["getCustomerOrgGroup"]),
  334. dddw, moment,
  335. //查询人员列表数据
  336. Query(type) {
  337. let url = '', body = {};
  338. console.log('query', type, this.query);
  339. // {
  340. // "skipCount": 2147483647,
  341. // "sorting": "string",
  342. // "patientName": "string",
  343. // "patientNo": "string",
  344. // "patientRegisterNo": "string",
  345. // "invoiceNo": "string",
  346. // "startDate": "string",
  347. // "endDate": "string",
  348. // "maxResultCount": 0
  349. // }
  350. if (type == 'patientRegisterNo') {
  351. if (!this.query.patientRegisterNo) return;
  352. body = { patientRegisterNo: this.query.patientRegisterNo };
  353. } else if (type == 'patientNo') {
  354. if (!this.query.patientNo) return;
  355. body = { patientNo: this.query.patientNo };
  356. } else if (type == 'invoiceNo' && this.query.chargeFlag != 'N') {
  357. if (!this.query.invoiceNo) return;
  358. body = { invoiceNo: this.query.invoiceNo };
  359. } else {
  360. if (this.query.dateRange) {
  361. body.startDate = moment(this.query.dateRange[0]).format('yyyy-MM-DD');
  362. body.endDate = moment(this.query.dateRange[1]).format('yyyy-MM-DD');
  363. }
  364. // if(this.query.patientName){
  365. // body.patientName = this.query.patientName;
  366. // }
  367. }
  368. switch (this.query.chargeFlag) {
  369. case 'Y':
  370. //已收费
  371. url = '/api/app/patientregister/getpatientregisterchargelist';
  372. break;
  373. case 'B':
  374. //已退费
  375. url = '/api/app/patientregister/getpatientregisterchargebacklist';
  376. break;
  377. default:
  378. //未收费
  379. url = '/api/app/patientregister/getpatientregisternotchargedlist'
  380. break;
  381. }
  382. postapi(url, body).then(res => {
  383. if (res.code != - 1) {
  384. this.patientList = res.data.items;
  385. if (this.patientList.length > 0) {
  386. this.query.patientRegisterNo = this.patientList[0].patientRegisterNo;
  387. this.query.patientName = this.patientList[0].patientName;
  388. this.query.patientNo = this.patientList[0].patientNo;
  389. }
  390. }
  391. });
  392. },
  393. //人员列表点击
  394. rowClick(row) {
  395. this.query.patientRegisterNo = row.patientRegisterNo;
  396. this.query.patientName = row.patientName;
  397. this.query.patientNo = row.patientNo;
  398. this.chargePays = deepCopy(this.chargePaysInit);
  399. //console.log(this.chargePays, this.chargePaysInit);
  400. if (this.query.chargeFlag == 'B') {
  401. this.form.chargeFlag = '1';
  402. } else {
  403. this.form.chargeFlag = '0';
  404. }
  405. if (row.chargeId) {
  406. this.form.id = row.chargeId;
  407. this.form.invoiceNo = row.invoiceNo;
  408. this.form.invoiceOrgName = row.patientName;
  409. } else {
  410. this.form.id = null;
  411. this.form.invoiceNo = '';
  412. this.form.invoiceOrgName = row.patientName;
  413. }
  414. //获取个人会员卡信息
  415. this.getCardRegister(row.idNo);
  416. switch (this.query.chargeFlag) {
  417. case 'N':
  418. this.getAsbItemsForFee(row.patientRegisterId);
  419. break;
  420. case 'Y':
  421. this.getChargePayByChargeId(row.chargeId);
  422. this.getChargeAsbByChargeid(row.chargeId);
  423. break;
  424. default:
  425. this.getChargeBackPayByChargeBackId(row.chargeBackId);
  426. this.getChargeAsbByChargeid(row.chargeId);
  427. break;
  428. }
  429. },
  430. //获取项目列表
  431. async getAsbItemsForFee(patientRegisterId) {
  432. //待收费项目列表
  433. this.asbItemsForFee = [];
  434. getapi(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${patientRegisterId}`)
  435. .then(res => {
  436. if (res.code == 1) {
  437. this.asbItemsForFee = res.data;
  438. for (let i = this.asbItemsForFee.length - 1; i >= 0; i--) {
  439. if (this.asbItemsForFee[i].isCharge == 'Y' || this.asbItemsForFee[i].payTypeFlag == '1') {
  440. this.asbItemsForFee.splice(i, 1);
  441. continue;
  442. }
  443. this.asbItemsForFee[i].chargePriceOri = this.asbItemsForFee[i].chargePrice;
  444. this.asbItemsForFee[i].discount = Math.round(10000 * this.asbItemsForFee[i].chargePrice / this.asbItemsForFee[i].standardPrice) / 100;
  445. this.asbItemsForFee[i].standTotal = this.asbItemsForFee[i].amount * this.asbItemsForFee[i].standardPrice;
  446. this.asbItemsForFee[i].total = this.asbItemsForFee[i].amount * this.asbItemsForFee[i].chargePrice;
  447. }
  448. //勾选已收费项目
  449. this.toCharge(patientRegisterId);
  450. }
  451. });
  452. },
  453. // "chargeId": "3a0d5685-b3a0-0186-0dd4-3b3ac0d2d08c",
  454. // "asbitemId": "3a0c657d-4e73-9bab-68da-56ab2f088bb1",
  455. // "asbitemName": "身高体重",
  456. // "asbitemPrice": 17,
  457. // "chargePrice": 18,
  458. // "amount": 1,
  459. // "registerAsbitemId": "3a0c6589-9b27-68d1-32f6-51082031d11c",
  460. // "creatorName": "admin",
  461. // "lastModifierName": null,
  462. // "lastModificationTime": null,
  463. // "lastModifierId": null,
  464. // "creationTime": "2023-08-30T10:49:48.753174",
  465. // "creatorId": "3a0c4180-107c-0c89-b25b-0bd34666dcec",
  466. // "id": "3a0d5685-b3bb-8dc2-0d14-56af1ddd11f9"
  467. // 获取个人充值卡
  468. getCardRegister(idNo) {
  469. let body = { cardModeId: '0', idNo };
  470. this.cardRegister = [];
  471. postapi(`/api/app/cardregister/getcardregisterlist`, body).then(res => {
  472. if (res.code != - 1) {
  473. this.cardRegister = res.data;
  474. }
  475. });
  476. },
  477. //获取收费单包含的组合项目
  478. getChargeAsbByChargeid(ChargeId) {
  479. this.asbItemsForFee = [];
  480. getapi(`/api/app/chargeasbitem/getchargeasbiteminchargeid?ChargeId=${ChargeId}`).then(res => {
  481. if (res.code != - 1) {
  482. res.data.forEach(e => {
  483. this.asbItemsForFee.push({
  484. asbitemName: e.asbitemName,
  485. standardPrice: e.asbitemPrice,
  486. chargePrice: e.chargePrice,
  487. chargePriceOri: e.chargePrice,
  488. amount: e.amount,
  489. discount: Math.round(10000 * e.chargePrice / e.asbitemPrice) / 100,
  490. payTypeFlag: e.payTypeFlag,
  491. checkCompleteFlag: e.checkCompleteFlag,
  492. creatorName: e.creatorName,
  493. creationTime: e.creationTime,
  494. });
  495. });
  496. this.sumTotal(this.asbItemsForFee, this.form);
  497. }
  498. });
  499. },
  500. //获取收费方式明细
  501. getChargePayByChargeId(ChargeId) {
  502. let lfind = -1;
  503. getapi(`/api/app/chargepay/getchargepayinchargeid?ChargeId=${ChargeId}`).then(res => {
  504. if (res.code != - 1) {
  505. res.data.forEach(e => {
  506. lfind = arrayExistObj(this.chargePays, 'payModeId', e.payModeId);
  507. if (lfind > - 1) {
  508. this.chargePays[lfind].chargeMoney = e.chargeMoney;
  509. this.chargePays[lfind].cardRegisterId = e.cardRegisterId;
  510. }
  511. });
  512. }
  513. });
  514. },
  515. //获取退费方式明细
  516. getChargeBackPayByChargeBackId(ChargeBackId) {
  517. let lfind = -1;
  518. getapi(`/api/app/chargebackpay/getchargebackpayinchargebackid?ChargeBackId=${ChargeBackId}`).then(res => {
  519. if (res.code != - 1) {
  520. res.data.forEach(e => {
  521. lfind = arrayExistObj(this.chargePays, 'payModeId', e.payModeId);
  522. if (lfind > - 1) {
  523. this.chargePays[lfind].chargeMoney = e.backMoeny;
  524. this.chargePays[lfind].cardRegisterId = e.cardRegisterId;
  525. }
  526. });
  527. }
  528. });
  529. },
  530. //待收费数据分析
  531. toCharge(patientRegisterId) {
  532. //默认全部选中
  533. this.selectedData = [...this.asbItemsForFee];
  534. this.$nextTick(function () {
  535. this.selectedData.forEach(row => {
  536. this.$refs['asbItemsForFeeTable'].toggleRowSelection(row)
  537. })
  538. });
  539. this.form.patientRegisterId = patientRegisterId;
  540. },
  541. //根据明细算总价与折扣
  542. sumTotal(details, head) {
  543. let total = 0, totalOri = 0;
  544. details.forEach(e => {
  545. totalOri += Math.round(e.amount * e.chargePriceOri * 100) / 100; //原始实收价格
  546. total += Math.round(e.amount * e.chargePrice * 100) / 100; //当前实收价格
  547. //console.log(total, e.chargePrice, e.amount)
  548. });
  549. total = Math.round(total * 100) / 100;
  550. totalOri = Math.round(totalOri * 100) / 100;
  551. head.total = total;
  552. head.preTotal = total;
  553. if (totalOri == 0) {
  554. head.discount = 100;
  555. } else {
  556. head.discount = Math.round(10000 * total / totalOri) / 100;
  557. }
  558. },
  559. //通过折扣计算总价与明细价格
  560. discountToDetails() {
  561. let discount = this.form.discount;
  562. let totalOri = 0, totalCompute = 0, totalPlan = 0;
  563. let lfind = -1;
  564. this.selectedData.forEach(e => {
  565. totalOri += Number(e.amount * e.chargePriceOri); //原始实收价格
  566. lfind = arrayExistObj(this.asbItemsForFee, 'id', e.id)
  567. if (lfind > -1 && e.chargePriceOri != 0) {
  568. e.chargePrice = Math.round(e.chargePriceOri * discount) / 100;
  569. e.discount = Math.round(10000 * e.chargePrice / e.standardPrice) / 100;
  570. totalCompute += Math.round(e.chargePrice * e.amount * 100) / 100;
  571. }
  572. });
  573. totalPlan = Math.round(totalOri * discount) / 100;
  574. this.form.total = totalPlan;
  575. this.form.preTotal = totalPlan;
  576. //明细和与总金额不符处理
  577. this.handleBalance(totalPlan, totalCompute);
  578. },
  579. //通过总价计算折扣与明细价格
  580. totalToDetails() {
  581. let discount = 100;
  582. let totalOri = 0, totalCompute = 0, totalPlan = Number(this.form.total);
  583. let lfind = -1;
  584. this.selectedData.forEach(e => {
  585. totalOri += Math.round(100 * e.amount * e.chargePriceOri) / 100; //原始实收价格
  586. });
  587. if (totalOri != 0) {
  588. discount = Math.round(10000 * totalPlan / totalOri) / 100;
  589. this.form.discount = discount;
  590. }
  591. //
  592. this.selectedData.forEach(e => {
  593. lfind = arrayExistObj(this.asbItemsForFee, 'id', e.id);
  594. if (lfind > -1) {
  595. e.chargePrice = Math.round(e.chargePriceOri * discount) / 100;
  596. e.discount = Math.round(10000 * e.chargePrice / e.standardPrice) / 100;
  597. totalCompute += Math.round(100 * e.chargePrice * e.amount) / 100;
  598. }
  599. });
  600. this.form.preTotal = totalPlan;
  601. //明细和与总金额不符处理
  602. this.handleBalance(totalPlan, totalCompute);
  603. },
  604. //明细合计金额与总金额不一致时,处理
  605. handleBalance(totalPlan, totalCompute) {
  606. if (totalPlan != totalCompute) {
  607. for (let i = this.selectedData.length - 1; i = 0; i--) {
  608. lfind = lfind = arrayExistObj(this.asbItemsForFee, 'id', this.selectedData[i].id);
  609. if (lfind > -1 && this.selectedData[i].amount == 1) {
  610. this.asbItemsForFee[lfind].chargePrice = this.asbItemsForFee[lfind].chargePrice + totalPlan - totalCompute;
  611. this.selectedData[i].chargePrice = this.asbItemsForFee[lfind].chargePrice;
  612. break;
  613. }
  614. }
  615. }
  616. },
  617. //输入预收金额,计算找零
  618. findBalance() {
  619. this.form.balance = this.form.preTotal - this.form.total;
  620. },
  621. //输入收费方式金额
  622. inputMoney() {
  623. let total = Number(0);
  624. this.chargePays.forEach(e => {
  625. total += Number(e.chargeMoney);
  626. });
  627. if (total > this.form.total) this.$message.warning("输入金额超过总金额");
  628. },
  629. //勾选要收费的项目
  630. handleSelectionChange(v) {
  631. this.selectedData = v;
  632. this.sumTotal(this.selectedData, this.form);
  633. },
  634. //调整明细折扣
  635. changeDiscount(row) {
  636. let total = this.form.total;
  637. let totalDetailsOri = Math.round(100 * row.amount * row.chargePrice) / 100;
  638. let totalDetailsCur = 0;
  639. row.chargePrice = Math.round(row.discount * row.standardPrice) / 100;
  640. let lfind = arrayExistObj(this.selectedData, 'id', row.id);
  641. if (lfind > -1) {
  642. totalDetailsCur = Math.round(100 * row.amount * row.chargePrice) / 100;
  643. this.form.total = total + totalDetailsCur - totalDetailsOri;
  644. }
  645. this.sumTotal(this.selectedData, this.form);
  646. },
  647. //调整明细实收价格
  648. changePrice(row) {
  649. if (row.chargePriceOri != 0) {
  650. row.discount = Math.round(10000 * row.chargePrice / row.standardPrice) / 100;
  651. }
  652. this.sumTotal(this.selectedData, this.form);
  653. },
  654. //收费
  655. charge() {
  656. let body = {};
  657. let total = 0;
  658. let msg = '';
  659. let chargePays = [];
  660. let asbitems = [];
  661. if (this.form.id) {
  662. this.$message.warning("已收费,不可重复操作!");
  663. return;
  664. }
  665. this.$refs['form'].validate((valid, fields) => {
  666. if (!valid) {
  667. msg = fields[Object.keys(fields)[0]][0].message;
  668. return;
  669. }
  670. });
  671. if (msg) {
  672. this.$message.warning(msg);
  673. return;
  674. }
  675. this.chargePays.forEach(e => {
  676. total += Number(e.chargeMoney);
  677. if (e.payModeId == '05' && e.chargeMoney) {
  678. //console.log(e.payModeId,e.chargeMoney,e.cardRegisterId);
  679. if (!e.cardRegisterId) msg = '请先择会员卡号';
  680. } else {
  681. e.cardRegisterId = null;
  682. }
  683. return e;
  684. });
  685. if (msg) {
  686. this.$message.warning(msg);
  687. return;
  688. }
  689. if (total != this.form.total) {
  690. this.$message.warning("收费方式合计金额与收费总金额不符");
  691. return;
  692. }
  693. this.chargePays.forEach(e => {
  694. if (e.chargeMoney) {
  695. chargePays.push({
  696. payModeId: e.payModeId,
  697. chargeMoney: e.chargeMoney,
  698. cardRegisterId: e.cardRegisterId,
  699. });
  700. }
  701. });
  702. this.selectedData.forEach(e => {
  703. asbitems.push({
  704. asbitemId: e.asbitemId,
  705. chargePrice: e.chargePrice,
  706. amount: e.amount,
  707. registerAsbitemId: e.id,
  708. });
  709. });
  710. body = {
  711. patientRegisterId: this.form.patientRegisterId,
  712. invoiceNo: this.form.invoiceNo,
  713. invoiceOrgName: this.form.invoiceOrgName,
  714. chargePays,
  715. asbitems,
  716. };
  717. // {
  718. // "patientRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  719. // "invoiceNo": "string",
  720. // "invoiceOrgName": "string",
  721. // "chargePays": [
  722. // {
  723. // "payModeId": "string",
  724. // "chargeMoney": 0,
  725. // "cardRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  726. // }
  727. // ],
  728. // "asbitems": [
  729. // {
  730. // "asbitemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  731. // "chargePrice": 0,
  732. // "amount": 0,
  733. // "registerAsbitemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  734. // }
  735. // ]
  736. // }
  737. //console.log('body',body);
  738. postapi('/api/app/registerasbitem/registerasbitemcharge', body).then(res => {
  739. if (res.code != -1) {
  740. this.$message.success("操作成功!");
  741. this.form.id = "操作成功!"; //防止重复提交收费
  742. this.Query();
  743. }
  744. });
  745. },
  746. //退费
  747. chargeBack() {
  748. let chargeId = this.form.id;
  749. let msg = '';
  750. let chargeBackPays = [];
  751. let total = 0;
  752. let body = {};
  753. if (!chargeId) {
  754. this.$message.warning("请选择待退费的记录!");
  755. return;
  756. }
  757. if (this.form.chargeFlag == '1') {
  758. this.$message.warning("已退费,不可重复操作!");
  759. return;
  760. }
  761. this.chargePays.forEach(e => {
  762. total += Number(e.chargeMoney);
  763. if (e.payModeId == '05' && e.chargeMoney) {
  764. if (!e.cardRegisterId) msg = '请先择会员卡号';
  765. } else {
  766. e.cardRegisterId = null;
  767. }
  768. return e;
  769. });
  770. if (msg) {
  771. this.$message.warning(msg);
  772. return;
  773. }
  774. if (total != this.form.total) {
  775. this.$message.warning("退费方式合计金额与退费总金额不符");
  776. return;
  777. }
  778. this.chargePays.forEach(e => {
  779. if (e.chargeMoney) {
  780. chargeBackPays.push({
  781. payModeId: e.payModeId,
  782. backMoeny: e.chargeMoney,
  783. cardRegisterId: e.cardRegisterId,
  784. });
  785. }
  786. });
  787. // {
  788. // "chargeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  789. // "chargeBackPays": [
  790. // {
  791. // "payModeId": "string",
  792. // "backMoeny": 0,
  793. // "cardRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  794. // }
  795. // ]
  796. // }
  797. body = {
  798. chargeId, chargeBackPays
  799. }
  800. postapi('/api/app/registerasbitem/registerasbitemchargeback', body).then(res => {
  801. if (res.code != -1) {
  802. this.$message.success("操作成功!");
  803. this.form.chargeFlag = '1'; //防止重复提交退费
  804. this.Query();
  805. }
  806. });
  807. },
  808. //收费打印
  809. chargePrint(ReportCode, isPreview, chargeId) {
  810. if (chargeId.length < 1) {
  811. this.$message.info("人员信息尚未保存,不可执行此操作!");
  812. return;
  813. }
  814. let token = localStorage.getItem('token');
  815. let user = localStorage.getItem('user');
  816. let toOutShell = {
  817. ReportCode, token,
  818. preViewCanPrint: 'Y',
  819. Parameters: [
  820. { Name: 'printer', Value: user },
  821. { Name: 'hisLog', Value: 'pic/hisLog.jpg' },
  822. ],
  823. };
  824. if (isPreview) {
  825. postapi(`/api/app/printreport/getchargereport?ChargeId=${chargeId}`)
  826. .then((res) => {
  827. if (res.code != -1) {
  828. toOutShell.ReportTable = res.data;
  829. console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
  830. return this.$peisAPI.printPre(JSON.stringify(toOutShell));
  831. }
  832. })
  833. .catch(err => {
  834. this.$message.warning(err);
  835. });
  836. } else {
  837. postapi(`/api/app/printreport/getchargereport?ChargeId=${chargeId}`)
  838. .then((res) => {
  839. if (res.code != -1) {
  840. toOutShell.ReportTable = res.data;
  841. console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
  842. return this.$peisAPI.print(JSON.stringify(toOutShell));
  843. }
  844. })
  845. .catch(err => {
  846. this.$message.warning(err);
  847. });
  848. }
  849. },
  850. //数据初始化
  851. dictInit() {
  852. //性别(仅档案用)
  853. getapi("/api/app/sex").then((res) => {
  854. if (res.code == 1) {
  855. this.dict.sex = res.data;
  856. }
  857. });
  858. //性别(查询)
  859. getapi("/api/app/for-sex").then((res) => {
  860. if (res.code == 1) {
  861. this.dict.forSex = res.data;
  862. }
  863. });
  864. //体检单位
  865. getapi("/api/app/customer-org/by-code-all").then((res) => {
  866. this.patientRegister.customerOrgTreeAll = res.data;
  867. tcdate(this.patientRegister.customerOrgTreeAll)
  868. });
  869. //体检中心
  870. getapi("/api/app/organization-units/organization-unit-by-is-peis").then(
  871. (res) => {
  872. if (res.code == 1) {
  873. this.dict.organization = res.data;
  874. }
  875. }
  876. );
  877. //体检单位
  878. getapi("/api/app/customer-org/in-filter").then((res) => {
  879. if (res.code == 1) {
  880. this.dict.customerOrg = res.data.items;
  881. }
  882. });
  883. //体检类别
  884. getapi("/api/app/medical-type/in-filter").then((res) => {
  885. if (res.code == 1) {
  886. this.dict.medicalType = res.data.items;
  887. }
  888. });
  889. //人员类别
  890. getapi("/api/app/personnel-type/in-filter").then((res) => {
  891. if (res.code == 1) {
  892. this.dict.personnelType = res.data.items;
  893. }
  894. });
  895. //婚姻状况
  896. getapi("/api/app/marital-statuses").then((res) => {
  897. if (res.code == 1) {
  898. this.dict.maritalStatus = res.data.items;
  899. }
  900. });
  901. //性激素期
  902. getapi("/api/app/sex-hormone-term/in-filter").then((res) => {
  903. if (res.code == 1) {
  904. this.dict.sexHormoneTerm = res.data.items;
  905. }
  906. });
  907. //民族
  908. getapi("/api/app/nation/in-filter").then((res) => {
  909. if (res.code == 1) {
  910. this.dict.nation = res.data.items;
  911. }
  912. });
  913. //籍惯 ,出生地
  914. getapi("/api/app/birth-place/in-filter").then((res) => {
  915. if (res.code == 1) {
  916. this.dict.birthPlace = res.data.items;
  917. }
  918. });
  919. //套餐
  920. getapi("/api/app/medical-package/in-filter").then((res) => {
  921. if (res.code == 1) {
  922. this.dict.medicalPackage = res.data.items;
  923. }
  924. });
  925. //分组,所有分组,不限单位,不限次数
  926. getapi("/api/app/customer-org-group").then((res) => {
  927. if (res.code == 1) {
  928. this.dict.customerOrgGroupAll = res.data.items;
  929. }
  930. });
  931. //支付方式
  932. getapi("/api/app/pay-mode").then((res) => {
  933. if (res.code == 1) {
  934. this.dict.payMode = res.data;
  935. //未收费时
  936. this.chargePaysInit = [];
  937. this.dict.payMode.forEach(e => {
  938. this.chargePaysInit.push({ chargeId: null, payModeId: e.id, chargeMoney: 0, cardBillId: null })
  939. });
  940. this.chargePays = deepCopy(this.chargePaysInit);
  941. }
  942. });
  943. //体检类别 树结构
  944. getapi("/api/app/item-type/by-code-all").then((res) => {
  945. if (res.code == 1) {
  946. this.dict.itemTypeTree = res.data;
  947. tcdate(this.dict.itemTypeTree);
  948. }
  949. });
  950. getapi("/api/app/asbitem/in-filter?Filter").then((res) => {
  951. if (res.code == 1) {
  952. this.dict.asbItemAll = res.data.items;
  953. }
  954. });
  955. console.log("dict", this.dict);
  956. },
  957. },
  958. //监听事件()
  959. watch: {
  960. },
  961. };
  962. </script>
  963. <style scoped>
  964. ::v-deep .el-form-item {
  965. margin-bottom: 1px;
  966. }
  967. ::v-deep .el-table--small .el-table__cell {
  968. padding: 0px 0;
  969. }
  970. ::v-deep .el-input__inner {
  971. text-align: left;
  972. padding-left: 5px;
  973. padding-right: 15px;
  974. }
  975. ::v-deep input[type="number"]::-webkit-inner-spin-button,
  976. input[type="number"]::-webkit-outer-spin-button {
  977. -webkit-appearance: none !important;
  978. margin: 0 !important;
  979. }
  980. ::v-deep .el-table th.el-table__cell {
  981. text-align: center;
  982. padding-left: 1px;
  983. padding-right: 1px;
  984. }
  985. ::v-deep .el-table td.el-table__cell {
  986. padding-left: 1px;
  987. padding-right: 1px;
  988. }
  989. ::v-deep .el-table .cell {
  990. padding-left: 1px;
  991. padding-right: 1px;
  992. }
  993. .queryDivClass {
  994. display: block;
  995. width: v-bind("(window.pageWidth > 600 ? (window.pageWidth - 120 - 80) / 2 : 200) + 'px'");
  996. height: v-bind("(window.pageHeight > 600 ? (window.pageHeight - 150) : 450) + 'px'");
  997. }
  998. .query {
  999. margin-left: 10px;
  1000. }
  1001. .prListDivClass {
  1002. height: v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'");
  1003. }
  1004. .btnDivClass {
  1005. display: block;
  1006. width: 110px;
  1007. margin-left: 5px;
  1008. margin-top: 180px;
  1009. }
  1010. .btnListClass {
  1011. margin-top: 10px;
  1012. }
  1013. .btnClass {
  1014. width: 110px;
  1015. }
  1016. </style>