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.

1653 lines
61 KiB

3 years ago
2 years ago
2 years ago
2 years ago
1 year ago
5 months ago
1 year ago
5 months ago
1 year ago
5 months ago
1 year ago
5 months ago
1 year ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
1 year ago
3 years ago
1 year ago
3 years ago
5 months ago
1 year ago
5 months ago
1 year ago
3 years ago
1 year ago
3 years ago
1 year ago
5 months ago
1 year ago
5 months ago
1 year ago
4 months ago
1 year ago
4 months ago
1 year ago
4 months ago
1 year ago
3 years ago
1 year ago
5 months ago
1 year ago
5 months ago
1 year ago
5 months ago
1 year ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
1 year ago
3 years ago
1 year ago
3 years ago
1 year ago
2 years ago
5 months ago
5 months ago
5 months ago
3 years ago
5 months ago
3 years ago
1 year ago
3 years ago
1 year ago
3 years ago
2 years ago
3 years ago
5 months ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
5 months ago
5 months ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
5 months ago
4 months ago
5 months ago
4 months ago
2 years ago
4 months ago
5 months ago
3 years ago
1 year ago
2 years ago
5 months ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
5 months ago
2 years ago
3 years ago
5 months ago
2 years ago
5 months ago
2 years ago
4 months ago
3 years ago
4 months ago
3 years ago
4 months ago
3 years ago
4 months ago
3 years ago
4 months ago
2 years ago
3 years ago
4 months ago
3 years ago
4 months ago
3 years ago
5 months ago
5 months ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
5 months ago
3 years ago
2 years ago
5 months ago
2 years ago
3 years ago
3 years ago
3 years ago
5 months ago
3 years ago
5 months ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
5 months ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
5 months ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
5 months ago
3 years ago
5 months ago
5 months ago
5 months ago
3 years ago
3 years ago
5 months ago
3 years ago
5 months ago
3 years ago
5 months ago
3 years ago
5 months ago
5 months ago
5 months ago
3 years ago
3 years ago
5 months ago
3 years ago
5 months ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
4 months ago
2 years ago
3 years ago
4 months ago
3 years ago
4 months ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
5 months ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
5 months ago
5 months ago
5 months ago
3 years ago
5 months ago
5 months ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
5 months ago
3 years ago
3 years ago
2 years ago
3 years ago
5 months ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
4 months ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
4 months ago
3 years ago
4 months ago
3 years ago
3 years ago
3 years ago
4 months ago
3 years ago
4 months ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
5 months ago
2 years ago
4 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
5 months ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
1 year ago
3 years ago
1 year ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
5 months ago
3 years ago
2 years ago
2 years ago
3 years ago
1 year ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
1 year ago
2 years ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
3 years ago
2 years ago
3 years ago
3 years ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
3 years ago
5 months ago
2 years ago
5 months ago
2 years ago
2 years ago
4 months ago
2 years ago
5 months ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
  1. <template>
  2. <div style="font-size: 14px;">
  3. <div>
  4. <div class="contenttitle">
  5. 体检登记 /<span class="contenttitleBold">体检收费</span>
  6. </div>
  7. <el-tabs v-model="activeName">
  8. <el-tab-pane label="体检收费" name="peis">
  9. <div style="display: flex; width: 100%;">
  10. <!-- 查询条件 与列表 -->
  11. <div :style="`display: block;width: ${Math.floor(bodyWidth * 3 / 5)}px;`">
  12. <!-- 查询条件 -->
  13. <div style="height: 60px;padding: 10px;border-radius: 8px;background-color: #fff;margin-bottom: 10px;">
  14. <div style="display:flex;">
  15. <div>
  16. <span>{{ dateTypeName }}日期</span>
  17. <el-date-picker v-model="query.startDate" type="date" placeholder="起始日期" size="small"
  18. style="width:90px;" :picker-options="pickerOptions" />
  19. <span style="margin: 0 3px;"></span>
  20. <el-date-picker v-model="query.endDate" type="date" placeholder="截止日期" size="small"
  21. style="width:90px;" :picker-options="pickerOptions" />
  22. </div>
  23. <div>
  24. <span class="query">条码号</span>
  25. <el-input ref="tmh" placeholder="条码号" v-model="query.patientRegisterNo" size="small"
  26. style="width: 120px;" clearable />
  27. </div>
  28. <div>
  29. <span class="query">档案号</span>
  30. <el-input placeholder="档案号" v-model="query.patientNo" size="small" style="width: 90px;" clearable />
  31. </div>
  32. </div>
  33. <div style="display:flex;justify-content: space-between;">
  34. <div style="display:flex;">
  35. <div>
  36. <span>姓名</span>
  37. <el-input placeholder="姓名" v-model="query.patientName" size="small" style="width: 100px;"
  38. clearable />
  39. </div>
  40. <el-radio-group v-model="query.chargeFlag" @input="btnQuery" size="mini"
  41. style="margin-top:8px;margin-left: 21px;">
  42. <el-radio label="N">未收费</el-radio>
  43. <el-radio label="Y">已收费</el-radio>
  44. <el-radio label="B">已退费</el-radio>
  45. </el-radio-group>
  46. <div v-if="query.chargeFlag != 'N'" style="margin-left:21px;">
  47. <span>发票号</span>
  48. <el-input placeholder="发票/收据号" v-model="query.invoiceNo" size="small" style="width: 90px;"
  49. clearable />
  50. </div>
  51. </div>
  52. <div>
  53. <el-button type="primary" class="commonbutton" @click="btnQuery" size="small"
  54. style="width:60px;">查询</el-button>
  55. </div>
  56. </div>
  57. </div>
  58. <!-- 列表 -->
  59. <div style="padding: 10px;border-radius: 8px;background-color: #fff;">
  60. <el-table :data="patientList" border highlight-current-row ref="patientList" :height="tableListHeight"
  61. @row-click="rowClick" size="small">
  62. <!--
  63. <el-table-column prop="patientRegisterId" label="体检记录ID" />
  64. -->
  65. <el-table-column type="index" label="序号" width="40" align="center" />
  66. <el-table-column v-if="query.chargeFlag == 'Y'" label="收费时间" prop="chargeTime" width="140"
  67. align="center" />
  68. <el-table-column v-if="query.chargeFlag == 'Y'" label="收费人" prop="chargeName" width="80"
  69. align="center" />
  70. <el-table-column v-if="query.chargeFlag == 'Y'" label="收费金额" prop="chargeMoney" width="80"
  71. align="center" />
  72. <el-table-column v-if="query.chargeFlag == 'B'" label="退费时间" prop="chargeBackTime" width="140"
  73. align="center" />
  74. <el-table-column v-if="query.chargeFlag == 'B'" label="退费人" prop="chargeBackName" width="80"
  75. align="center" />
  76. <el-table-column v-if="query.chargeFlag == 'B'" label="退费金额" prop="chargeBackMoney" width="80"
  77. align="center" />
  78. <el-table-column prop="customerOrgParentName" label="单位" width="150">
  79. <template slot-scope="scope">
  80. <div>{{ scope.row.customerOrgParentName ? scope.row.customerOrgParentName :
  81. scope.row.customerOrgName }}
  82. </div>
  83. </template>
  84. </el-table-column>
  85. <el-table-column prop="patientName" label="姓名" />
  86. <el-table-column prop="sexId" label="性别" width="40" align="center" />
  87. <el-table-column prop="age" label="年龄" width="40" align="center" />
  88. <el-table-column prop="patientRegisterNo" label="条码号" width="120" align="center" />
  89. <el-table-column prop="patientNo" label="档案号" width="80" align="center" />
  90. <el-table-column prop="medicalTimes" label="体检次数" width="80" align="center" />
  91. <el-table-column prop="isVip" label="VIP" width="30" align="center">
  92. <template slot-scope="scope">
  93. <div>{{ scope.row.isVip == "Y" ? "是" : "否" }}</div>
  94. </template>
  95. </el-table-column>
  96. <el-table-column prop="salesman" label="介绍人" />
  97. <el-table-column prop="invoiceNo" label="发票号" />
  98. <el-table-column prop="invoiceOrgName" label="发票抬头" />
  99. <!--
  100. <el-table-column prop="chargeId" label="介绍人" />
  101. <el-table-column prop="chargeBackId" label="介绍人" />
  102. -->
  103. <el-table-column prop="email" label="邮箱" width="180" />
  104. <el-table-column prop="idNo" label="身份证" width="150" />
  105. <el-table-column prop="mobileTelephone" label="手机" width="100" />
  106. <el-table-column prop="telephone" label="电话" width="100" />
  107. <el-table-column prop="address" label="地址" width="300" />
  108. </el-table>
  109. </div>
  110. </div>
  111. <!-- 收费操作 -->
  112. <div :style="`display: block;margin-left:10px;width: ${Math.floor(bodyWidth * 2 / 5)}px;`">
  113. <!-- 人员信息 -->
  114. <div style="height: 40px; background-color: #fff;border-radius: 8px;margin-bottom: 10px;">
  115. <div style="display: flex; flex-wrap: wrap;height:40px; width: 100%;align-items: center;">
  116. <div class="query">
  117. <span>条码号</span>
  118. <el-input v-model="info.patientRegisterNo" size="small" style="margin-left: 3px; width: 120px;"
  119. disabled />
  120. </div>
  121. <div class="query">
  122. <span>档案号</span>
  123. <el-input v-model="info.patientNo" size="small" style="margin-left: 3px; width: 90px;" disabled />
  124. </div>
  125. <div class="query">
  126. <span>姓名</span>
  127. <el-input v-model="info.patientName" size="small" style="margin-left: 3px; width: 80px;" disabled />
  128. </div>
  129. </div>
  130. </div>
  131. <!-- 收费信息 -->
  132. <div>
  133. <!-- charge -->
  134. <div style="padding: 10px;margin-bottom: 7px;background-color: rgb(255, 255, 255);border-radius: 8px;">
  135. <el-form ref="form" :model="form" label-width="80px" :rules="rules" size="medium"
  136. :disabled="query.chargeFlag != 'N'">
  137. <el-row>
  138. <el-col :span="12">
  139. <el-form-item label="发票号" prop="invoiceNo">
  140. <el-input v-model="form.invoiceNo" size="small" />
  141. </el-form-item>
  142. </el-col>
  143. <el-col :span="12">
  144. <el-form-item label="开票抬头" prop="invoiceOrgName">
  145. <el-input v-model="form.invoiceOrgName" size="small" />
  146. </el-form-item>
  147. </el-col>
  148. </el-row>
  149. <el-row>
  150. <el-col :span="12">
  151. <el-form-item label="折扣" prop="discount">
  152. <el-input v-model="form.discount" @input="discountToDetails" size="small" />
  153. </el-form-item>
  154. </el-col>
  155. <el-col :span="12">
  156. <el-form-item label="应收金额" prop="total">
  157. <el-input v-model="form.total" @input="totalToDetails" size="small" />
  158. </el-form-item>
  159. </el-col>
  160. </el-row>
  161. <el-row v-if="query.chargeFlag == 'N'">
  162. <el-col :span="12">
  163. <el-form-item label="预收金额" prop="preTotal">
  164. <el-input v-model="form.preTotal" disabled size="small" />
  165. </el-form-item>
  166. </el-col>
  167. <el-col :span="12">
  168. <el-form-item label="找零" prop="balance">
  169. <el-input v-model="form.balance" disabled size="small" />
  170. </el-form-item>
  171. </el-col>
  172. </el-row>
  173. </el-form>
  174. </div>
  175. <!-- charge_pay -->
  176. <div style="padding: 10px;background-color: #fff;margin-bottom: 7px;border-radius: 8px;">
  177. <div style="font-size:10px;">{{ query.chargeFlag == 'B' ? '退' : '收' }}费方式</div>
  178. <el-table :data="chargePays" border highlight-current-row size="small"
  179. :height="Math.floor((tableListHeight - 155) / 2)">
  180. <el-table-column prop="payModeId" :label="(query.chargeFlag == 'B' ? '退' : '收') + '费方式'"
  181. min-width="100">
  182. <template slot-scope="scope">
  183. <div>{{ dddw(dict.payMode, "id", scope.row.payModeId, "displayName") }}</div>
  184. </template>
  185. </el-table-column>
  186. <el-table-column prop="chargeMoney" label="金额" min-width="80">
  187. <template slot-scope="scope">
  188. <el-input type="number" v-model="scope.row.chargeMoney" size="small" @input="inputMoney"
  189. :disabled="query.chargeFlag == 'B'" />
  190. </template>
  191. </el-table-column>
  192. <!-- 旧的选卡方式
  193. <el-table-column prop="cardRegisterId" label="会员卡">
  194. <template slot-scope="scope">
  195. <el-select v-model="scope.row.cardRegisterId" placeholder="请选择" size="small" filterable
  196. clearable :disabled="scope.row.payModeId == '05' && query.chargeFlag != 'B' ? false : true">
  197. <el-option v-for="item in cardRegister" :key="item.id" :label="item.cardNo"
  198. :value="item.id" />
  199. </el-select>
  200. </template>
  201. </el-table-column>
  202. -->
  203. <el-table-column prop="cardRegisterId" label="会员卡" min-width="150">
  204. <template slot-scope="scope">
  205. <el-input v-model="scope.row.cardNo" size="small" disabled />
  206. </template>
  207. </el-table-column>
  208. <el-table-column v-if="query.chargeFlag == 'N'" width="60" align="center">
  209. <template slot-scope="scope">
  210. <i class="el-icon-search" @click="getCardId(scope.$index)" v-if="scope.row.payModeId == '05'"
  211. style="font-size: 24px;color: blue;cursor:pointer;"></i>
  212. <i class="el-icon-s-open" @click="brushCard(scope.$index)" v-if="scope.row.payModeId == '05'"
  213. style="font-size: 24px;color: red;cursor:pointer;"></i>
  214. </template>
  215. </el-table-column>
  216. </el-table>
  217. </div>
  218. <!-- asbitem -->
  219. <div style="padding: 10px;background-color: rgb(255, 255, 255);border-radius: 8px;">
  220. <div style="font-size:10px;">{{ query.chargeFlag == 'N' ? '待收' : (query.chargeFlag == 'Y' ?
  221. '已收' : '已退') }}费项目</div>
  222. <el-table :data="asbItemsForFee" border highlight-current-row
  223. :height="Math.floor((tableListHeight - 155) / 2)" size="small"
  224. @selection-change="handleSelectionChange" ref="asbItemsForFeeTable">
  225. <el-table-column type="selection" align="center" v-if="query.chargeFlag == 'N'" />
  226. <el-table-column label="组合项目" width="120" prop="asbitemName" />
  227. <el-table-column label="标准价格" prop="standardPrice" width="80" align="center" />
  228. <el-table-column label="折扣" prop="discount" width="60" align="center">
  229. <template slot-scope="scope">
  230. <el-input type="number" v-model="scope.row.discount" v-if="query.chargeFlag == 'N'"
  231. :disabled="scope.row.isCharge == 'Y' ? true : false" size="small"
  232. @input="changeDiscount(scope.row)" />
  233. <div v-if="query.chargeFlag != 'N'">{{ scope.row.discount }}</div>
  234. </template>
  235. </el-table-column>
  236. <el-table-column label="数量" prop="amount" width="50" align="center" />
  237. <el-table-column label="实收价格" prop="chargePrice" width="80" align="center">
  238. <template slot-scope="scope">
  239. <el-input type="number" v-model="scope.row.chargePrice" v-if="query.chargeFlag == 'N'"
  240. :disabled="scope.row.isCharge == 'Y' ? true : false" size="small"
  241. @input="changePrice(scope.row)" />
  242. <div v-if="query.chargeFlag != 'N'">{{ scope.row.chargePrice }}</div>
  243. </template>
  244. </el-table-column>
  245. <el-table-column prop="total" label="金额" width="70" v-if="false" />
  246. <el-table-column prop="standardPrice" label="标准金额" width="80" v-if="false" />
  247. <el-table-column label="支付方式" prop="payTypeFlag" width="100" align="center">
  248. <template slot-scope="scope">
  249. <div>{{ dddw(dict.payType, "id", scope.row.payTypeFlag, "displayName") }}</div>
  250. </template>
  251. </el-table-column>
  252. <el-table-column prop="checkCompleteFlag" label="状态" align="center">
  253. <template slot-scope="scope">
  254. <div>{{ dddw(dict.checkCompleteFlag, "id", scope.row.checkCompleteFlag, "displayName") }}</div>
  255. </template>
  256. </el-table-column>
  257. <el-table-column prop="creatorName" label="登记人" align="center" />
  258. <el-table-column prop="creationTime" label="登记日期" width="90" align="center">
  259. <template slot-scope="scope">
  260. <div v-if="scope.row.creationTime">{{ moment(scope.row.creationTime).format('yyyy-MM-DD') }}
  261. </div>
  262. </template>
  263. </el-table-column>
  264. </el-table>
  265. </div>
  266. </div>
  267. </div>
  268. <div class="btnDivClass">
  269. <div class="btnListClass">
  270. <el-button type="primary" class="commonbutton" @click="btnCharge"
  271. :disabled="query.chargeFlag == 'N' ? false : true">收费</el-button>
  272. </div>
  273. <div class="btnListClass">
  274. <el-button type="danger" class="commonbutton" @click="btnChargeBack"
  275. :disabled="query.chargeFlag == 'Y' ? false : true">退费</el-button>
  276. </div>
  277. <div class="btnListClass">
  278. <el-button type="success" class="commonbutton" @click="chargePrint('0007', false, form.id)"
  279. :disabled="query.chargeFlag == 'B' ? true : false">打印</el-button>
  280. </div>
  281. <div class="btnListClass">
  282. <el-button type="success" class="commonbutton" @click="chargePrint('0007', true, form.id)"
  283. :disabled="query.chargeFlag == 'B' ? true : false">打印预览</el-button>
  284. </div>
  285. </div>
  286. </div>
  287. </el-tab-pane>
  288. <el-tab-pane label="小程序退费" name="web">
  289. <WebChargeBack />
  290. </el-tab-pane>
  291. </el-tabs>
  292. </div>
  293. <!--弹窗-->
  294. <!--选卡号-->
  295. <el-dialog title="选卡" :visible.sync="winDialog.queryCard" width="800px" height="500" :show-close="false"
  296. :close-on-click-modal="false" :append-to-body="true">
  297. <!--查询条件-->
  298. <div style="display: flex;justify-content: space-between;">
  299. <div>
  300. <el-select v-model="queryCard.queryCol" placeholder="请选择" clearable size="small">
  301. <el-option label="卡号" value="cardNo" />
  302. <el-option label="姓名" value="customerName" />
  303. <el-option label="身份证号" value="idNo" />
  304. <el-option label="手机号" value="phone" />
  305. </el-select>
  306. <el-input placeholder="卡号" v-model="queryCard.value" size="small" clearable style="width: 190px"
  307. @change="btnQueryCard" />
  308. </div>
  309. <div class="query">
  310. <el-button class="commonbutton" @click="btnQueryCard">查询</el-button>
  311. </div>
  312. </div>
  313. <el-table :data="cardDatas" border height="400" row-key="id" size="small" highlight-current-row
  314. @row-click="cardRowClick" @row-dblclick="rowDblclick" ref="patientList">
  315. <el-table-column prop="cardTypeName" label="卡类别" min-width="70" />
  316. <el-table-column prop="cardNo" label="会员卡号" min-width="150" />
  317. <el-table-column prop="discount" label="折扣率" min-width="80" />
  318. <el-table-column prop="cardBalance" label="卡余额" min-width="80" />
  319. <el-table-column prop="expiryDate" label="有效期限" min-width="120">
  320. <template slot-scope="scope">
  321. <div v-if="scope.row.expiryDate">
  322. {{ moment(scope.row.expiryDate).format("yyyy-MM-DD") }}
  323. </div>
  324. </template>
  325. </el-table-column>
  326. <el-table-column prop="customerName" label="卡主姓名" min-width="80" />
  327. <el-table-column prop="idNo" label="卡主身份证号" min-width="200" />
  328. <el-table-column prop="telephone" label="卡主电话" min-width="150" />
  329. <el-table-column prop="mobileTelephone" label="卡主手机号" min-width="150" />
  330. <el-table-column prop="remark" label="备注" min-width="200" />
  331. <!--
  332. <el-table-column prop="creatorName" label="创建人员" min-width="100" />
  333. <el-table-column prop="creationTime" label="创建日期" min-width="150">
  334. <template slot-scope="scope">
  335. <div v-if="scope.row.creationTime">
  336. {{ moment(scope.row.creationTime).format("yyyy-MM-DD") }}
  337. </div>
  338. </template>
  339. </el-table-column>
  340. <el-table-column prop="lastModifierName" label="修改人员" width="100" />
  341. <el-table-column prop="lastModificationTime" label="修改日期" width="150">
  342. <template slot-scope="scope">
  343. <div v-if="scope.row.lastModificationTime">
  344. {{
  345. moment(scope.row.lastModificationTime).format("yyyy-MM-DD")
  346. }}
  347. </div>
  348. </template>
  349. </el-table-column>
  350. -->
  351. </el-table>
  352. <span slot="footer" class="dialog-footer">
  353. <el-button class="commonbutton" type="primary" @click="btnOkCard" style="width:90px;">确定</el-button>
  354. <el-button class="commonbutton" @click="winDialog.queryCard = false" style="width:90px;">取消</el-button>
  355. </span>
  356. </el-dialog>
  357. </div>
  358. </template>
  359. <script>
  360. import moment from 'moment';
  361. import { mapState, mapActions } from "vuex";
  362. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  363. import { tcdate, dddw, arrayExistObj, arrayExistObjPos, deepCopy } from "../../utlis/proFunc";
  364. import PatientRegisterQuery from "../../components/patientRegister/patientRegisterQuery.vue";
  365. import PatientRegisterRefuseList from "../../components/patientRegister/PatientRegisterRefuseList.vue";
  366. import WebChargeBack from "./WebChargeBack.vue";
  367. export default {
  368. components: {
  369. PatientRegisterQuery,
  370. PatientRegisterRefuseList,
  371. WebChargeBack,
  372. },
  373. props: ["patientRegisterNo"],
  374. data() {
  375. return {
  376. activeName: "peis",
  377. query: {
  378. chargeFlag: 'N', // N:未收费,Y:已收费,B:已退费
  379. dateRange: null,
  380. startDate: null,
  381. endDate: null,
  382. patientRegisterNo: '',
  383. patientNo: '',
  384. invoiceNo: '',
  385. patientName: '',
  386. },//查询条件
  387. info: {
  388. patientRegisterNo: '',
  389. patientNo: '',
  390. patientName: ''
  391. },
  392. patientList: [],//人员列表
  393. formInit: {},
  394. form: {
  395. id: null,
  396. patientRegisterId: null,
  397. invoiceNo: '',
  398. invoiceOrgName: '',
  399. chargeFlag: '0',
  400. discount: 100,
  401. total: 0, //应收金额
  402. preTotal: 0, //预收金额
  403. balance: 0, //找零
  404. }, //收费主表
  405. rules: {
  406. // invoiceNo: [
  407. // { required: true, message: "请填写发票/收据号", trigger: "blur" },
  408. // ],
  409. total: [
  410. { required: true, message: "请填写应收金额", trigger: "blur" },
  411. ],
  412. },
  413. // pickerOptions: {
  414. // shortcuts: [
  415. // {
  416. // text: "最近一周",
  417. // onClick(picker) {
  418. // const end = new Date();
  419. // const start = new Date();
  420. // start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  421. // picker.$emit("pick", [start, end]);
  422. // },
  423. // },
  424. // {
  425. // text: "最近一个月",
  426. // onClick(picker) {
  427. // const end = new Date();
  428. // const start = new Date();
  429. // start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  430. // picker.$emit("pick", [start, end]);
  431. // },
  432. // },
  433. // {
  434. // text: "最近三个月",
  435. // onClick(picker) {
  436. // const end = new Date();
  437. // const start = new Date();
  438. // start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  439. // picker.$emit("pick", [start, end]);
  440. // },
  441. // },
  442. // ],
  443. // },
  444. chargePays: [], //收支方式
  445. chargePaysInit: [], //收支方式(初始状态)
  446. asbItemsForFee: [], //待收费项目
  447. selectedData: [], //选中项目
  448. cardRegister: [{ id: '00000000-0000-0000-0000-000000000000', cardNo: '0001' }], //当前客户的会员卡
  449. cardRegisterAll: [], //所有客户的会员卡
  450. queryCard: {
  451. // <el-option label="卡号" value="cardNo" />
  452. // <el-option label="姓名" value="customerName" />
  453. // <el-option label="身份证号" value="idNo" />
  454. // <el-option label="手机号" value="mobileTelephone" />
  455. queryCol: "cardNo",
  456. value: "",
  457. },
  458. cardDatas: [], //卡数据
  459. cardSeq: 0, // 当前选卡的记录行数
  460. cardChoosed: {}, //选中卡
  461. winDialog: {
  462. queryCard: false,
  463. },
  464. charge_normal_card: 1, // 单次收费允许使用多少张充值卡
  465. };
  466. },
  467. created() {
  468. this.formInit = Object.assign({}, this.form)
  469. this.dictInit();
  470. },
  471. //挂载完成
  472. mounted() {
  473. this.enterToQuery()
  474. if (this.patientRegisterNo) {
  475. this.query.patientRegisterNo = this.patientRegisterNo
  476. this.query.chargeFlag = 'N'
  477. }
  478. this.btnQuery();
  479. },
  480. computed: {
  481. ...mapState(["pickerOptions", "window", "dict", "dataTransOpts", "patientRegister", "customerOrg"]),
  482. dateTypeName() {
  483. let ret = '登记'
  484. switch (this.query.chargeFlag) {
  485. case 'N':
  486. break;
  487. case 'Y':
  488. ret = '收费'
  489. break;
  490. case 'B':
  491. ret = '退费'
  492. break;
  493. default:
  494. break;
  495. }
  496. return ret
  497. },
  498. tableListHeight() {
  499. let tempH = this.window.pageHeight < 600 ? 600 : this.window.pageHeight
  500. return tempH - 175 - 30 - 35
  501. },
  502. bodyWidth() {
  503. let tempW = this.window.pageWidth < 600 ? 600 : this.window.pageWidth
  504. return tempW - 110 - 25
  505. }
  506. },
  507. methods: {
  508. ...mapActions(["getCustomerOrgGroup"]),
  509. dddw, moment,
  510. //查询人员列表数据
  511. btnQuery() {
  512. let url = '', body = {};
  513. // {
  514. // "skipCount": 2147483647,
  515. // "sorting": "string",
  516. // "patientName": "string",
  517. // "patientNo": "string",
  518. // "patientRegisterNo": "string",
  519. // "invoiceNo": "string",
  520. // "startDate": "string",
  521. // "endDate": "string",
  522. // "maxResultCount": 0
  523. // }
  524. //console.log('query', this.query);
  525. if (this.query.patientRegisterNo) {
  526. body = { patientRegisterNo: this.query.patientRegisterNo };
  527. } else if (this.query.patientNo) {
  528. body = { patientNo: this.query.patientNo };
  529. } else if (this.query.invoiceNo && this.query.chargeFlag != 'N') {
  530. body = { invoiceNo: this.query.invoiceNo };
  531. } else {
  532. if (this.query.startDate && this.query.endDate) {
  533. body.startDate = moment(this.query.startDate).format("yyyy-MM-DD")
  534. body.endDate = moment(this.query.endDate).format("yyyy-MM-DD")
  535. if (body.startDate > body.endDate) {
  536. this.$message.warning("起始日期不能大于截止日期,数据校验不通过!")
  537. return
  538. }
  539. if (this.query.patientName) body.patientName = this.query.patientName
  540. }
  541. }
  542. switch (this.query.chargeFlag) {
  543. case 'Y':
  544. //已收费
  545. url = '/api/app/patientregister/getpatientregisterchargelist';
  546. break;
  547. case 'B':
  548. //已退费
  549. url = '/api/app/patientregister/getpatientregisterchargebacklist';
  550. break;
  551. default:
  552. //未收费
  553. url = '/api/app/patientregister/getpatientregisternotchargedlist'
  554. break;
  555. }
  556. // 查询前,清除其他收费或人员信息数据
  557. this.info.patientName = ''
  558. this.info.patientNo = ''
  559. this.info.patientRegisterNo = ''
  560. this.form = Object.assign({}, this.formInit)
  561. this.chargePays = []
  562. this.asbItemsForFee = []
  563. // const loading = this.$loading({
  564. // lock: true,
  565. // text: 'Loading',
  566. // spinner: 'el-icon-loading',
  567. // background: 'rgba(0, 0, 0, 0.7)'
  568. // });
  569. postapi(url, body).then(res => {
  570. console.log(url, body, res)
  571. if (res.code != - 1) {
  572. this.patientList = res.data.items;
  573. //this.patientList.length == 1 && this.query.chargeFlag == 'N'
  574. if (this.patientList.length > 0) {
  575. // this.query.patientRegisterNo = this.patientList[0].patientRegisterNo;
  576. // this.query.patientName = this.patientList[0].patientName;
  577. // this.query.patientNo = this.patientList[0].patientNo;
  578. this.$nextTick(() => {
  579. setTimeout(() => {
  580. this.$refs['patientList'].setCurrentRow(this.patientList[0])
  581. this.rowClick(this.patientList[0])
  582. }, 20)
  583. })
  584. } else {
  585. this.asbItemsForFee = []
  586. this.form = Object.assign({}, this.formInit)
  587. }
  588. }
  589. // loading.close();
  590. })
  591. .catch((err) => {
  592. console.error(err)
  593. // loading.close();
  594. });
  595. },
  596. //人员列表点击
  597. rowClick(row) {
  598. this.info.patientRegisterNo = row.patientRegisterNo;
  599. this.info.patientName = row.patientName;
  600. this.info.patientNo = row.patientNo;
  601. this.chargePays = deepCopy(this.chargePaysInit);
  602. //console.log(this.chargePays, this.chargePaysInit);
  603. if (this.query.chargeFlag == 'B') {
  604. this.form.chargeFlag = '1';
  605. } else {
  606. this.form.chargeFlag = '0';
  607. }
  608. if (row.chargeId) {
  609. this.form.id = row.chargeId;
  610. this.form.invoiceNo = row.invoiceNo;
  611. this.form.invoiceOrgName = row.patientName;
  612. } else {
  613. this.form.id = null;
  614. this.form.invoiceNo = '';
  615. this.form.invoiceOrgName = row.patientName;
  616. }
  617. //获取个人会员卡信息 (废弃)
  618. //this.getCardRegister(row.idNo);
  619. switch (this.query.chargeFlag) {
  620. case 'N':
  621. this.getAsbItemsForFee(row.patientRegisterId);
  622. break;
  623. case 'Y':
  624. this.getChargePayByChargeId(row.chargeId);
  625. this.getChargeAsbByChargeid(row.chargeId);
  626. break;
  627. default:
  628. this.getChargeBackPayByChargeBackId(row.chargeBackId);
  629. this.getChargeAsbByChargeid(row.chargeId);
  630. break;
  631. }
  632. },
  633. //获取项目列表
  634. async getAsbItemsForFee(patientRegisterId) {
  635. //待收费项目列表
  636. this.asbItemsForFee = [];
  637. getapi(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${patientRegisterId}`)
  638. .then(res => {
  639. if (res.code == 1) {
  640. this.asbItemsForFee = res.data;
  641. for (let i = this.asbItemsForFee.length - 1; i >= 0; i--) {
  642. if (this.asbItemsForFee[i].isCharge == 'Y' || this.asbItemsForFee[i].payTypeFlag !== '0') {
  643. this.asbItemsForFee.splice(i, 1);
  644. continue;
  645. }
  646. this.asbItemsForFee[i].chargePriceOri = this.asbItemsForFee[i].chargePrice;
  647. this.asbItemsForFee[i].discount = Math.round(10000 * this.asbItemsForFee[i].chargePrice / this.asbItemsForFee[i].standardPrice) / 100;
  648. this.asbItemsForFee[i].standTotal = this.asbItemsForFee[i].amount * this.asbItemsForFee[i].standardPrice;
  649. this.asbItemsForFee[i].total = this.asbItemsForFee[i].amount * this.asbItemsForFee[i].chargePrice;
  650. }
  651. //勾选已收费项目
  652. this.toCharge(patientRegisterId);
  653. }
  654. });
  655. },
  656. // "chargeId": "3a0d5685-b3a0-0186-0dd4-3b3ac0d2d08c",
  657. // "asbitemId": "3a0c657d-4e73-9bab-68da-56ab2f088bb1",
  658. // "asbitemName": "身高体重",
  659. // "asbitemPrice": 17,
  660. // "chargePrice": 18,
  661. // "amount": 1,
  662. // "registerAsbitemId": "3a0c6589-9b27-68d1-32f6-51082031d11c",
  663. // "creatorName": "admin",
  664. // "lastModifierName": null,
  665. // "lastModificationTime": null,
  666. // "lastModifierId": null,
  667. // "creationTime": "2023-08-30T10:49:48.753174",
  668. // "creatorId": "3a0c4180-107c-0c89-b25b-0bd34666dcec",
  669. // "id": "3a0d5685-b3bb-8dc2-0d14-56af1ddd11f9"
  670. // 获取个人充值卡
  671. getCardRegister(idNo) {
  672. this.cardRegister = [];
  673. if (!idNo) return;
  674. let body = { cardModeId: '0', idNo };
  675. postapi(`/api/app/cardregister/getcardregisterlist`, body).then(res => {
  676. if (res.code != - 1) {
  677. this.cardRegister = res.data;
  678. }
  679. });
  680. },
  681. // 清除选的卡
  682. brushCard(index) {
  683. this.chargePays[index].cardNo = ''
  684. this.chargePays[index].cardRegisterId = ''
  685. this.chargePays[index].chargeMoney = 0
  686. delete this.chargePays[index].discount
  687. delete this.chargePays[index].cardBalance
  688. // 刷新预收金额 及 找零
  689. this.inputMoney()
  690. },
  691. // 弹出卡号查询窗口
  692. getCardId(index) {
  693. console.log('index', index)
  694. this.cardSeq = index
  695. this.cardDatas = [] //清除原来的卡列表数据
  696. this.queryCard.value = ''
  697. this.cardChoosed = {}
  698. this.winDialog.queryCard = true // 显示选卡页面
  699. },
  700. // 根据条件查询卡列表数据
  701. btnQueryCard() {
  702. let body = {}
  703. body[this.queryCard.queryCol] = this.queryCard.value
  704. // body = {
  705. // "cardModeId": "string",
  706. // "cardNo": "string",
  707. // "customerName": "string",
  708. // "idNo": "string",
  709. // "phone": "string"
  710. // }
  711. postapi('/api/app/CardRegister/GetCardRegisterCharge', body)
  712. .then(res => {
  713. if (res.code > -1) {
  714. this.cardDatas = res.data
  715. }
  716. })
  717. },
  718. // 选中卡记录
  719. cardRowClick(row) {
  720. this.cardChoosed = Object.assign({}, row)
  721. },
  722. // 确定选中卡记录
  723. btnOkCard() {
  724. if(!this.cardChoosed.id){
  725. this.$message.warning({showClose:true,message:'请选择会员卡'})
  726. return
  727. }
  728. // 单次收费不允重复同一张卡
  729. let lfind = arrayExistObj(this.chargePays, 'cardRegisterId', this.cardChoosed.id)
  730. if (lfind > -1) {
  731. this.$message.warning({ showClose: true, message: '单次收费不允重复同一张卡!' })
  732. return
  733. }
  734. // 单次收费不允出现不同折扣的充值卡
  735. let diffDiscount = false //默认相同折扣
  736. let preDiscount = 100
  737. let curDiscount = this.cardChoosed.discount || 100
  738. this.chargePays.forEach(e => {
  739. if (e.payModeId == '05' && e.discount) {
  740. if (Number(e.discount) !== Number(curDiscount)) {
  741. preDiscount = e.discount
  742. diffDiscount = true
  743. }
  744. }
  745. });
  746. // 多张卡时,出现不同折扣,则返回
  747. if (diffDiscount) {
  748. this.$message.warning({ showClose: true, message: `当前所选卡折扣 ${curDiscount} 与 上次所选卡折扣 ${preDiscount} 不同,不可执行此操作` })
  749. return
  750. }
  751. this.chargePays[this.cardSeq].cardNo = this.cardChoosed.cardNo + ' 余:' + this.cardChoosed.cardBalance + ' 折:' + curDiscount
  752. this.chargePays[this.cardSeq].discount = curDiscount
  753. this.chargePays[this.cardSeq].cardBalance = this.cardChoosed.cardBalance
  754. this.chargePays[this.cardSeq].cardRegisterId = this.cardChoosed.id
  755. // 将折扣带回,并触发
  756. this.form.discount = curDiscount
  757. this.discountToDetails()
  758. this.winDialog.queryCard = false
  759. },
  760. // 双击选中卡记录
  761. rowDblclick(row) {
  762. this.cardRowClick(row)
  763. this.btnOkCard()
  764. },
  765. //获取收费单包含的组合项目
  766. getChargeAsbByChargeid(ChargeId) {
  767. this.asbItemsForFee = [];
  768. getapi(`/api/app/chargeasbitem/getchargeasbiteminchargeid?ChargeId=${ChargeId}`).then(res => {
  769. if (res.code != - 1) {
  770. res.data.forEach(e => {
  771. this.asbItemsForFee.push({
  772. asbitemName: e.asbitemName,
  773. standardPrice: e.asbitemPrice,
  774. chargePrice: e.chargePrice,
  775. chargePriceOri: e.chargePrice,
  776. amount: e.amount,
  777. discount: Math.round(10000 * e.chargePrice / e.asbitemPrice) / 100,
  778. payTypeFlag: e.payTypeFlag,
  779. checkCompleteFlag: e.checkCompleteFlag,
  780. creatorName: e.creatorName,
  781. creationTime: e.creationTime,
  782. });
  783. });
  784. this.sumTotal(this.asbItemsForFee, this.form);
  785. }
  786. });
  787. },
  788. //获取收费方式明细
  789. getChargePayByChargeId(ChargeId) {
  790. let curPayModeId = ''
  791. let lfind = -1;
  792. getapi(`/api/app/chargepay/getchargepayinchargeid?ChargeId=${ChargeId}`).then(res => {
  793. if (res.code != - 1) {
  794. res.data.forEach(e => {
  795. if (curPayModeId != e.payModeId) lfind = -1
  796. lfind++
  797. console.log('lfind', lfind)
  798. lfind = arrayExistObjPos(this.chargePays, 'payModeId', e.payModeId, lfind);
  799. if (lfind > - 1) {
  800. this.chargePays[lfind].chargeMoney = e.chargeMoney;
  801. this.chargePays[lfind].cardRegisterId = e.cardRegisterId;
  802. this.chargePays[lfind].cardNo = e.cardNo;
  803. }
  804. curPayModeId = e.payModeId
  805. });
  806. }
  807. });
  808. },
  809. //获取退费方式明细
  810. getChargeBackPayByChargeBackId(ChargeBackId) {
  811. let curPayModeId = ''
  812. let lfind = -1;
  813. getapi(`/api/app/chargebackpay/getchargebackpayinchargebackid?ChargeBackId=${ChargeBackId}`).then(res => {
  814. if (res.code != - 1) {
  815. res.data.forEach(e => {
  816. if (curPayModeId != e.payModeId) lfind = -1
  817. lfind++
  818. console.log('lfind', lfind)
  819. lfind = arrayExistObjPos(this.chargePays, 'payModeId', e.payModeId, lfind);
  820. if (lfind > - 1) {
  821. this.chargePays[lfind].chargeMoney = e.backMoeny;
  822. this.chargePays[lfind].cardRegisterId = e.cardRegisterId;
  823. this.chargePays[lfind].cardNo = e.cardNo;
  824. }
  825. curPayModeId = e.payModeId
  826. });
  827. }
  828. });
  829. },
  830. //待收费数据分析
  831. toCharge(patientRegisterId) {
  832. //默认全部选中
  833. this.selectedData = [...this.asbItemsForFee];
  834. this.$nextTick(function () {
  835. this.selectedData.forEach(row => {
  836. this.$refs['asbItemsForFeeTable'].toggleRowSelection(row)
  837. })
  838. });
  839. this.form.patientRegisterId = patientRegisterId;
  840. },
  841. //根据明细算总价与折扣
  842. sumTotal(details, head) {
  843. let total = 0, totalOri = 0;
  844. details.forEach(e => {
  845. totalOri += Math.round(e.amount * e.chargePriceOri * 100) / 100; //原始实收价格
  846. total += Math.round(e.amount * e.chargePrice * 100) / 100; //当前实收价格
  847. //console.log(total, e.chargePrice, e.amount)
  848. });
  849. total = Math.round(total * 100) / 100;
  850. totalOri = Math.round(totalOri * 100) / 100;
  851. head.total = total;
  852. //head.preTotal = total;
  853. if (totalOri == 0) {
  854. head.discount = 100;
  855. } else {
  856. head.discount = Math.round(10000 * total / totalOri) / 100;
  857. }
  858. //
  859. this.findBalance()
  860. },
  861. //通过折扣计算总价与明细价格
  862. discountToDetails() {
  863. let discount = this.form.discount;
  864. let totalOri = 0, totalCompute = 0, totalPlan = 0;
  865. let lfind = -1;
  866. this.selectedData.forEach(e => {
  867. totalOri += Number(e.amount * e.chargePriceOri); //原始实收价格
  868. lfind = arrayExistObj(this.asbItemsForFee, 'id', e.id)
  869. if (lfind > -1 && e.chargePriceOri != 0) {
  870. e.chargePrice = Math.round(e.chargePriceOri * discount) / 100;
  871. e.discount = Math.round(10000 * e.chargePrice / e.standardPrice) / 100;
  872. totalCompute += Math.round(e.chargePrice * e.amount * 100) / 100;
  873. }
  874. });
  875. totalPlan = Math.round(totalOri * discount) / 100;
  876. this.form.total = totalPlan;
  877. //this.form.preTotal = totalPlan;
  878. //明细和与总金额不符处理
  879. this.handleBalance(totalPlan, totalCompute);
  880. this.findBalance()
  881. },
  882. //通过总价计算折扣与明细价格
  883. totalToDetails() {
  884. let discount = 100;
  885. let totalOri = 0, totalCompute = 0, totalPlan = Number(this.form.total);
  886. let lfind = -1;
  887. this.selectedData.forEach(e => {
  888. totalOri += Math.round(100 * e.amount * e.chargePriceOri) / 100; //原始实收价格
  889. });
  890. if (totalOri != 0) {
  891. discount = Math.round(10000 * totalPlan / totalOri) / 100;
  892. this.form.discount = discount;
  893. }
  894. //
  895. this.selectedData.forEach(e => {
  896. lfind = arrayExistObj(this.asbItemsForFee, 'id', e.id);
  897. if (lfind > -1) {
  898. e.chargePrice = Math.round(e.chargePriceOri * discount) / 100;
  899. e.discount = Math.round(10000 * e.chargePrice / e.standardPrice) / 100;
  900. totalCompute += Math.round(100 * e.chargePrice * e.amount) / 100;
  901. }
  902. });
  903. //this.form.preTotal = totalPlan;
  904. //明细和与总金额不符处理
  905. this.handleBalance(totalPlan, Math.round(100 * totalCompute) / 100);
  906. this.findBalance()
  907. },
  908. // 明细合计金额与总金额不一致时,处理
  909. handleBalance(totalPlan, totalCompute) {
  910. if (totalPlan != totalCompute) {
  911. //console.log('明细合计金额与总金额不一致时', totalPlan, totalCompute, this.selectedData)
  912. for (let i = this.selectedData.length - 1; i >= 0; i--) {
  913. // lfind = arrayExistObj(this.asbItemsForFee, 'id', this.selectedData[i].id);
  914. // if (lfind > -1 && this.selectedData[i].amount == 1) {
  915. // this.asbItemsForFee[lfind].chargePrice = this.asbItemsForFee[lfind].chargePrice + totalPlan - totalCompute;
  916. // this.selectedData[i].chargePrice = this.asbItemsForFee[lfind].chargePrice;
  917. // break;
  918. // }
  919. //console.log('this.selectedData[i].amount', this.selectedData[i].amount)
  920. if (this.selectedData[i].amount == 1) {
  921. let chargePrice = this.selectedData[i].chargePrice
  922. this.selectedData[i].chargePrice = Math.round((Number(chargePrice) + Number(totalPlan) - totalCompute)*100)/100 ;
  923. this.selectedData[i].discount = Math.round(this.selectedData[i].chargePrice * 10000/this.selectedData[i].standardPrice)/100
  924. //console.log('平衡金额 行数,前,后:', i, chargePrice, this.selectedData[i].chargePrice)
  925. break;
  926. }
  927. }
  928. }
  929. },
  930. //输入预收金额,计算找零
  931. findBalance() {
  932. this.form.balance = Math.round((this.form.preTotal - this.form.total) * 100) / 100;
  933. },
  934. //输入收费方式金额
  935. inputMoney() {
  936. // 现金 id = 01
  937. let err = ''
  938. let cashTotal = Number(0), unCashTotal = Number(0);
  939. this.chargePays.forEach(e => {
  940. console.log('e', e)
  941. if (e.payModeId == '01') {
  942. cashTotal += Number(e.chargeMoney);
  943. } else {
  944. unCashTotal += Number(e.chargeMoney);
  945. }
  946. if (e.payModeId == '05') {
  947. if (Number(e.cardBalance) < Number(e.chargeMoney)) {
  948. err = `会员卡【${e.cardNo}】 余额不足`
  949. }
  950. }
  951. });
  952. if (err) {
  953. this.$message.warning({ showClose: true, message: err })
  954. return
  955. }
  956. this.form.preTotal = cashTotal + unCashTotal
  957. this.findBalance()
  958. if (unCashTotal > this.form.total) this.$message.warning(`数据校验失败:输入的非现金金额${unCashTotal}不能超过应收金额${this.form.total}`);
  959. },
  960. //勾选要收费的项目
  961. handleSelectionChange(v) {
  962. this.selectedData = v;
  963. this.sumTotal(this.selectedData, this.form);
  964. },
  965. //调整明细折扣
  966. changeDiscount(row) {
  967. let total = this.form.total;
  968. let totalDetailsOri = Math.round(100 * row.amount * row.chargePrice) / 100;
  969. let totalDetailsCur = 0;
  970. row.chargePrice = Math.round(row.discount * row.standardPrice) / 100;
  971. let lfind = arrayExistObj(this.selectedData, 'id', row.id);
  972. if (lfind > -1) {
  973. totalDetailsCur = Math.round(100 * row.amount * row.chargePrice) / 100;
  974. this.form.total = total + totalDetailsCur - totalDetailsOri;
  975. }
  976. this.sumTotal(this.selectedData, this.form);
  977. },
  978. //调整明细实收价格
  979. changePrice(row) {
  980. if (row.chargePriceOri != 0) {
  981. row.discount = Math.round(10000 * row.chargePrice / row.standardPrice) / 100;
  982. }
  983. this.sumTotal(this.selectedData, this.form);
  984. },
  985. //收费
  986. btnCharge() {
  987. let body = {};
  988. let unCashTotal = Number(0), cashTotal = Number(0);
  989. let msg = '';
  990. let chargePays = [];
  991. let asbitems = [];
  992. if (this.form.id) {
  993. this.$message.warning("已收费,不可重复操作!");
  994. return;
  995. }
  996. this.$refs['form'].validate((valid, fields) => {
  997. if (!valid) {
  998. msg = fields[Object.keys(fields)[0]][0].message;
  999. return;
  1000. }
  1001. });
  1002. if (msg) {
  1003. this.$message.warning(msg);
  1004. return;
  1005. }
  1006. this.chargePays.forEach(e => {
  1007. if (e.payModeId == '01') {
  1008. cashTotal += Number(e.chargeMoney);
  1009. } else {
  1010. unCashTotal += Number(e.chargeMoney);
  1011. }
  1012. if (e.payModeId == '05' && e.chargeMoney) {
  1013. //console.log(e.payModeId,e.chargeMoney,e.cardRegisterId);
  1014. if (!e.cardRegisterId) msg = dddw(this.dict.payMode, "id", e.payModeId, "displayName") + '付费,必需选择会员卡号';
  1015. if (Number(e.cardBalance) < Number(e.chargeMoney)) msg = `会员卡【${e.cardNo}】 余额不足`
  1016. } else {
  1017. e.cardRegisterId = null;
  1018. }
  1019. });
  1020. /**/
  1021. if (msg) {
  1022. this.$message.warning(msg);
  1023. return;
  1024. }
  1025. //规避套现
  1026. if (unCashTotal > this.form.total) {
  1027. this.$message.warning("非现金收款不可大于应收金额!");
  1028. return;
  1029. }
  1030. if (unCashTotal + cashTotal < this.form.total) {
  1031. this.$message.warning("收费方式合计收款不可小于应收金额!");
  1032. return;
  1033. }
  1034. let chargeMoney = Number(0)
  1035. this.chargePays.forEach(e => {
  1036. if (e.chargeMoney) {
  1037. if (e.payModeId == '01') {
  1038. //现金支付,数据库中存找零后的现金
  1039. chargePays.push({
  1040. payModeId: e.payModeId,
  1041. chargeMoney: e.chargeMoney - this.form.balance,
  1042. cardRegisterId: e.cardRegisterId,
  1043. });
  1044. } else {
  1045. chargePays.push({
  1046. payModeId: e.payModeId,
  1047. chargeMoney: e.chargeMoney,
  1048. cardRegisterId: e.cardRegisterId,
  1049. });
  1050. }
  1051. chargeMoney += Number(e.chargeMoney)
  1052. }
  1053. });
  1054. let detailsTotal = 0
  1055. this.selectedData.forEach(e => {
  1056. asbitems.push({
  1057. asbitemId: e.asbitemId,
  1058. chargePrice: e.chargePrice,
  1059. amount: e.amount,
  1060. registerAsbitemId: e.id,
  1061. });
  1062. detailsTotal += Math.round(100 * e.amount * e.chargePrice) / 100
  1063. });
  1064. if (Math.round(chargeMoney * 100) / 100 !== Math.round(detailsTotal * 100) / 100) {
  1065. this.$message.warning({ showClose: true, message: `明细合计 ${Math.round(detailsTotal * 100) / 100} 与 总金额 ${Math.round(chargeMoney * 100) / 100} 不一致` })
  1066. return
  1067. }
  1068. body = {
  1069. patientRegisterId: this.form.patientRegisterId,
  1070. invoiceNo: this.form.invoiceNo,
  1071. invoiceOrgName: this.form.invoiceOrgName,
  1072. chargePays,
  1073. asbitems,
  1074. };
  1075. // {
  1076. // "patientRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  1077. // "invoiceNo": "string",
  1078. // "invoiceOrgName": "string",
  1079. // "chargePays": [
  1080. // {
  1081. // "payModeId": "string",
  1082. // "chargeMoney": 0,
  1083. // "cardRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  1084. // }
  1085. // ],
  1086. // "asbitems": [
  1087. // {
  1088. // "asbitemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  1089. // "chargePrice": 0,
  1090. // "amount": 0,
  1091. // "registerAsbitemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  1092. // }
  1093. // ]
  1094. // }
  1095. //console.log('body',body);
  1096. postapi('/api/app/registerasbitem/registerasbitemcharge', body).then(res => {
  1097. if (res.code != -1) {
  1098. this.form.id = res.data.chargeId; //可防止重复提交收费
  1099. // 壳端 才有打印提示
  1100. this.$confirm("操作成功, 是否打印发票?", "提示", {
  1101. confirmButtonText: "是",
  1102. cancelButtonText: "否",
  1103. type: "warning",
  1104. }).then(() => {
  1105. this.chargePrint('0007', false, res.data.chargeId)
  1106. setTimeout(() => {
  1107. this.btnQuery();
  1108. }, 1000)
  1109. }).catch((err) => {
  1110. if (err == "cancel") {
  1111. //this.$message.info("已取消删除");
  1112. this.btnQuery();
  1113. }
  1114. });
  1115. }
  1116. });
  1117. },
  1118. //退费
  1119. btnChargeBack() {
  1120. let chargeId = this.form.id;
  1121. let msg = '';
  1122. let chargeBackPays = [];
  1123. let total = 0;
  1124. let body = {};
  1125. if (!chargeId) {
  1126. this.$message.warning("请选择待退费的记录!");
  1127. return;
  1128. }
  1129. if (this.form.chargeFlag == '1') {
  1130. this.$message.warning("已退费,不可重复操作!");
  1131. return;
  1132. }
  1133. this.$confirm("是否确定执行退费操作?", "提示", {
  1134. confirmButtonText: "是",
  1135. cancelButtonText: "否",
  1136. type: "warning",
  1137. }).then(() => {
  1138. this.chargePays.forEach(e => {
  1139. total += Number(e.chargeMoney);
  1140. if (e.payModeId == '05' && e.chargeMoney) {
  1141. if (!e.cardRegisterId) msg = '请先择会员卡号';
  1142. } else {
  1143. e.cardRegisterId = null;
  1144. }
  1145. return e;
  1146. });
  1147. if (msg) {
  1148. this.$message.warning(msg);
  1149. return;
  1150. }
  1151. if (total != this.form.total) {
  1152. this.$message.warning("退费方式合计金额与退费总金额不符");
  1153. return;
  1154. }
  1155. this.chargePays.forEach(e => {
  1156. if (e.chargeMoney) {
  1157. chargeBackPays.push({
  1158. payModeId: e.payModeId,
  1159. backMoeny: e.chargeMoney,
  1160. cardRegisterId: e.cardRegisterId,
  1161. });
  1162. }
  1163. });
  1164. // {
  1165. // "chargeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  1166. // "chargeBackPays": [
  1167. // {
  1168. // "payModeId": "string",
  1169. // "backMoeny": 0,
  1170. // "cardRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  1171. // }
  1172. // ]
  1173. // }
  1174. body = {
  1175. chargeId, chargeBackPays
  1176. }
  1177. postapi('/api/app/registerasbitem/registerasbitemchargeback', body).then(res => {
  1178. if (res.code != -1) {
  1179. console.log("操作成功!");
  1180. this.form.chargeFlag = '1'; //防止重复提交退费
  1181. this.btnQuery();
  1182. }
  1183. });
  1184. }).catch((err) => {
  1185. if (err == "cancel") {
  1186. this.$message.info("已取消删除");
  1187. }
  1188. });
  1189. },
  1190. //收费打印
  1191. chargePrint(ReportCode, isPreview, chargeId) {
  1192. console.log('ReportCode, isPreview, chargeId', ReportCode, isPreview, chargeId)
  1193. if (!chargeId) {
  1194. this.$message.info("人员信息尚未保存,不可执行此操作!");
  1195. return;
  1196. }
  1197. if (!this.$peisAPI) {
  1198. this.$message.info("此功能,需要在壳客户端才可运行!")
  1199. return
  1200. }
  1201. let token = window.sessionStorage.getItem('token');
  1202. let user = window.sessionStorage.getItem('user');
  1203. let toOutShell = {
  1204. ReportCode, token,
  1205. isBuildImage: 'N',
  1206. IsUploadPdf: 'N',
  1207. preViewCanPrint: 'Y',
  1208. Parameters: [
  1209. { Name: 'printer', Value: user },
  1210. { Name: 'hisLog', Value: 'pic/hisLog.jpg' },
  1211. ],
  1212. BusinessCode: chargeId,
  1213. };
  1214. if (isPreview) {
  1215. /*
  1216. postapi(`/api/app/printreport/getchargereport?ChargeId=${chargeId}`)
  1217. .then((res) => {
  1218. if (res.code != -1) {
  1219. toOutShell.ReportTable = res.data;
  1220. console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
  1221. return this.$peisAPI.printPre(JSON.stringify(toOutShell));
  1222. }
  1223. })
  1224. .then(res => {
  1225. console.log(res)
  1226. if (JSON.parse(res).code < 0) {
  1227. this.$message.error(JSON.parse(res).message)
  1228. }
  1229. })
  1230. .catch(err => {
  1231. this.$message.warning(err);
  1232. });
  1233. */
  1234. this.$peisAPI.printPre(JSON.stringify(toOutShell))
  1235. .then(res => {
  1236. if (JSON.parse(res).code < 0) {
  1237. this.$message.warning({ showClose: true, message: JSON.parse(res).message });
  1238. }
  1239. })
  1240. .catch((err) => {
  1241. console.log('打印发票错误', err)
  1242. this.$message.warning({ showClose: true, message: `${err}` });
  1243. });
  1244. } else {
  1245. /*
  1246. postapi(`/api/app/printreport/getchargereport?ChargeId=${chargeId}`)
  1247. .then((res) => {
  1248. if (res.code != -1) {
  1249. toOutShell.ReportTable = res.data;
  1250. console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
  1251. return this.$peisAPI.print(JSON.stringify(toOutShell));
  1252. }
  1253. })
  1254. .then(res => {
  1255. console.log(res)
  1256. if (JSON.parse(res).code < 0) {
  1257. this.$message.error(JSON.parse(res).message)
  1258. }
  1259. })
  1260. .catch(err => {
  1261. this.$message.warning(err);
  1262. });
  1263. */
  1264. this.$peisAPI.print(JSON.stringify(toOutShell))
  1265. .then(res => {
  1266. if (JSON.parse(res).code < 0) {
  1267. this.$message.warning({ showClose: true, message: JSON.parse(res).message });
  1268. }
  1269. })
  1270. .catch((err) => {
  1271. console.log('打印发票错误', err)
  1272. this.$message.warning({ showClose: true, message: `${err}` });
  1273. });
  1274. }
  1275. },
  1276. // 获取系统参数 charge_normal_card 的值
  1277. getChargeNormalCard() {
  1278. return new Promise((resolve, reject) => {
  1279. // 获取系统参数(pacs系统条码类型:0:检查条码,1:人员条码)
  1280. postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId: 'charge_normal_card' })
  1281. .then(res => {
  1282. if (res.code > -1) {
  1283. try {
  1284. this.charge_normal_card = Number(res.data || "1") || 1
  1285. } catch (error) {
  1286. console.log('charge_normal_card', error)
  1287. }
  1288. }
  1289. })
  1290. .finally(() => {
  1291. resolve()
  1292. })
  1293. })
  1294. },
  1295. //数据初始化
  1296. dictInit() {
  1297. this.query.startDate = new Date()
  1298. this.query.endDate = this.query.startDate
  1299. /*
  1300. //性别(仅档案用)
  1301. getapi("/api/app/sex").then((res) => {
  1302. if (res.code == 1) {
  1303. this.dict.sex = res.data;
  1304. }
  1305. });
  1306. //性别(查询)
  1307. getapi("/api/app/for-sex").then((res) => {
  1308. if (res.code == 1) {
  1309. this.dict.forSex = res.data;
  1310. }
  1311. });
  1312. //体检单位
  1313. getapi("/api/app/customerorg/getbycodeall").then((res) => {
  1314. this.patientRegister.customerOrgTreeAll = res.data;
  1315. tcdate(this.patientRegister.customerOrgTreeAll)
  1316. });
  1317. //体检中心
  1318. getapi("/api/app/organization-units/organization-unit-by-is-peis").then(
  1319. (res) => {
  1320. if (res.code == 1) {
  1321. this.dict.organization = res.data;
  1322. }
  1323. }
  1324. );
  1325. //体检单位
  1326. getapi("/api/app/customer-org/in-filter").then((res) => {
  1327. if (res.code == 1) {
  1328. this.dict.customerOrg = res.data;
  1329. }
  1330. });
  1331. //体检类别
  1332. getapi("/api/app/medical-type/in-filter").then((res) => {
  1333. if (res.code == 1) {
  1334. this.dict.medicalType = res.data;
  1335. }
  1336. });
  1337. //人员类别
  1338. getapi("/api/app/personnel-type/in-filter").then((res) => {
  1339. if (res.code == 1) {
  1340. this.dict.personnelType = res.data;
  1341. }
  1342. });
  1343. //婚姻状况
  1344. getapi("/api/app/MaritalStatus/GetMaritalStatusList").then((res) => {
  1345. if (res.code == 1) {
  1346. this.dict.maritalStatus = res.data;
  1347. }
  1348. });
  1349. //性激素期
  1350. getapi("/api/app/sex-hormone-term/in-filter").then((res) => {
  1351. if (res.code == 1) {
  1352. this.dict.sexHormoneTerm = res.data;
  1353. }
  1354. });
  1355. //民族
  1356. getapi("/api/app/nation/in-filter").then((res) => {
  1357. if (res.code == 1) {
  1358. this.dict.nation = res.data;
  1359. }
  1360. });
  1361. //籍惯 ,出生地
  1362. getapi("/api/app/birth-place/in-filter").then((res) => {
  1363. if (res.code == 1) {
  1364. this.dict.birthPlace = res.data;
  1365. }
  1366. });
  1367. //套餐
  1368. postapi("/api/app/medicalpackage/GetBasicList", {}).then((res) => {
  1369. if (res.code == 1) {
  1370. this.dict.medicalPackage = res.data;
  1371. }
  1372. });
  1373. //分组,所有分组,不限单位,不限次数
  1374. postapi("/api/app/CustomerOrgGroup/GetBasicList").then((res) => {
  1375. if (res.code > -1) {
  1376. this.dict.customerOrgGroupAll = res.data;
  1377. }
  1378. });
  1379. //体检类别 树结构
  1380. getapi("/api/app/item-type/by-code-all").then((res) => {
  1381. if (res.code == 1) {
  1382. this.dict.itemTypeTree = res.data;
  1383. tcdate(this.dict.itemTypeTree);
  1384. }
  1385. });
  1386. */
  1387. //支付方式 /api/app/pay-mode(全部)
  1388. this.getChargeNormalCard()
  1389. .then(() => {
  1390. return getapi("/api/app/paymode/getlistinisactive")
  1391. })
  1392. .then((res) => {
  1393. if (res.code == 1) {
  1394. this.dict.payMode = res.data;
  1395. //未收费时
  1396. this.chargePaysInit = [];
  1397. this.dict.payMode.forEach(e => {
  1398. if (e.id == '05') {
  1399. for (let index = 0; index < this.charge_normal_card; index++) {
  1400. this.chargePaysInit.push({ chargeId: null, payModeId: e.id, chargeMoney: 0, cardBillId: null, cardRegisterId: '', cardNo: '' })
  1401. }
  1402. } else {
  1403. this.chargePaysInit.push({ chargeId: null, payModeId: e.id, chargeMoney: 0, cardBillId: null, cardRegisterId: '', cardNo: '' })
  1404. }
  1405. });
  1406. this.chargePays = deepCopy(this.chargePaysInit);
  1407. }
  1408. });
  1409. // postapi("/api/app/asbitem/getasbitemlist", {}).then((res) => {
  1410. // if (res.code == 1) {
  1411. // this.dict.asbItemAll = res.data;
  1412. // }
  1413. // });
  1414. console.log("dict", this.dict);
  1415. },
  1416. //回车替代查询
  1417. enterToQuery() {
  1418. // console.log('enterToTab');
  1419. this.$nextTick(() => {
  1420. let inputs = document.querySelectorAll(["input"]); //用数组可以读取多个标签的元素 //.inline-input
  1421. // 为每个输入框添加键盘事件监听器
  1422. inputs.forEach((input, i) => {
  1423. // console.log('input',input);
  1424. input.addEventListener('keydown', (event) => {
  1425. if (event.keyCode === 13) {
  1426. // 阻止回车键的默认行为(换行)
  1427. event.preventDefault();
  1428. // 如果按下的是回车查询
  1429. console.log(input.getAttribute('placeholder'), input.value)
  1430. let placeholder = input.getAttribute('placeholder')
  1431. switch (placeholder) {
  1432. case '条码号':
  1433. case '档案号':
  1434. case '发票/收据号':
  1435. if (input.value) this.btnQuery()
  1436. input.select()
  1437. break;
  1438. case '卡号':
  1439. if (input.value) this.btnQueryCard()
  1440. input.select()
  1441. break;
  1442. }
  1443. }
  1444. });
  1445. input.addEventListener('click', (event) => {
  1446. let placeholder = input.getAttribute('placeholder')
  1447. switch (placeholder) {
  1448. case '条码号':
  1449. case '档案号':
  1450. case '姓名':
  1451. case '检查条码':
  1452. case '检验条码':
  1453. input.select()
  1454. break;
  1455. }
  1456. });
  1457. });
  1458. });
  1459. },
  1460. },
  1461. //监听事件()
  1462. watch: {
  1463. // 从登记页面,跳至收费页面时,始终默认为未收费方式
  1464. "dataTransOpts.refresh.charge.S": {
  1465. //immediate: true, // 立即执行
  1466. // // deep: true, // 深度监听复杂类型内变化
  1467. handler(newVal, oldVal) {
  1468. console.log(`watch: 收费 newVal: ${newVal}, oldVal: ${oldVal}, 人员条码号: `, this.patientRegisterNo)
  1469. this.query.patientRegisterNo = this.patientRegisterNo
  1470. this.query.chargeFlag = 'N'
  1471. this.btnQuery()
  1472. }
  1473. },
  1474. },
  1475. };
  1476. </script>
  1477. <style scoped>
  1478. @import '../../assets/css/global_button.css';
  1479. @import '../../assets/css/global_card.css';
  1480. @import '../../assets/css/global_dialog.css';
  1481. @import '../../assets/css/global_form.css';
  1482. @import '../../assets/css/global_input.css';
  1483. @import '../../assets/css/global_table.css';
  1484. @import '../../assets/css/global.css';
  1485. .query {
  1486. margin-left: 5px;
  1487. font-size: 14px;
  1488. color: #232748;
  1489. font-weight: 400;
  1490. font-family: "NotoSansSC-Regular";
  1491. }
  1492. .btnDivClass {
  1493. display: block;
  1494. width: 100px;
  1495. margin-left: 10px;
  1496. }
  1497. .btnListClass {
  1498. margin-top: 10px;
  1499. }
  1500. .btnClass {
  1501. width: 100px;
  1502. }
  1503. :deep .el-form-item--mini.el-form-item,
  1504. .el-form-item--small.el-form-item {
  1505. margin-bottom: 10px;
  1506. }
  1507. </style>