patientInspectLogSendBack.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. <template>
  2. <view class="transferWorkOrder">
  3. <!-- <mSearch class="search" :mode="2" button="inside" placeholder="请搜索患者名称、住院号" @search="doSearch()" v-model="keyword" searchButtonType="icon" searchButtonName="newicon-saoma"></mSearch> -->
  4. <scroll-view scroll-y class="list">
  5. <view class="item tac"><text class="green">患者回科清单</text></view>
  6. <view class="item" v-for="(item, index) in listComputed" :key="item.id" @click="selectItem(item)">
  7. <view>{{item.patientName}}({{item.bedNum}})-{{item.patientCode}}</view>
  8. <text class="right-icon newicon newicon-lajitong" @click="deleteIt(item, index)"></text>
  9. </view>
  10. </scroll-view >
  11. <view class="footer">
  12. <template v-if="list.length">
  13. <view class="primaryButton btn gray" hover-class="seimin-btn-hover" @click="tagClick()" v-if="!config.batchPatientCheckType">确认回科</view>
  14. <template v-if="config.batchPatientCheckType == 1 || config.batchPatientCheckType == 2">
  15. <view class="primaryButton btn gray" hover-class="seimin-btn-hover" @click="scanCode()">扫一扫</view>
  16. <view class="primaryButton btn gray" hover-class="seimin-btn-hover" @click="fillInManually(2)" v-if="isNumberKey && config.batchPatientDynamicKey == 1">动态密钥</view>
  17. </template>
  18. <view class="primaryButton btn gray" hover-class="seimin-btn-hover" @click="fillInManually(1)" v-if="config.batchPatientCheckType == 3">工号确认</view>
  19. </template>
  20. <view class="btn gray" hover-class="seimin-btn-hover" @click="goBack()">返回</view>
  21. </view>
  22. <!-- 弹窗 -->
  23. <showModel :title="models.title" :icon="models.icon" :disjunctor="models.disjunctor" :content="models.content" :operate="models.operate" @ok="ok" @cancel="cancel"></showModel>
  24. <!-- 弹窗 -->
  25. <showModel :title="models1.title" :icon="models1.icon" :disjunctor="models1.disjunctor" :content="models1.content" :operate="models1.operate" @ok="ok1" @cancel="cancel1"></showModel>
  26. <!-- 动态密钥 -->
  27. <numberKeyModel v-if="showKey" :keyArr="keyArr" @cancel="showKey = false" @confirm="confirmKey($event)"></numberKeyModel>
  28. <!-- 填写交接人工号弹窗 -->
  29. <selectAccount @click.stop.native v-if="hosModels.disjunctor" :disjunctor="hosModels.disjunctor" @ok="hosOk" @cancel="hosCancel"></selectAccount>
  30. </view>
  31. </template>
  32. <script>
  33. import { get, post, SM, webHandle } from "../../http/http.js";
  34. import mSearch from "@/components/mehaotian-search-revision/mehaotian-search-revision.vue";
  35. import numberKeyModel from "@/components/numberKeyModel/numberKeyModel.vue";
  36. export default {
  37. onShow() {
  38. this.SMFlag = true;
  39. },
  40. onLoad(options) {
  41. console.log('options', options);
  42. this.options = options || {};
  43. this.deptId = +options.deptId;
  44. this.list = JSON.parse(options.patientList);
  45. console.log(this.list);
  46. this.getConfig();
  47. this.getConfig1();
  48. },
  49. components: {
  50. //引用mSearch组件,如不需要删除即可
  51. mSearch,
  52. numberKeyModel,
  53. },
  54. data() {
  55. return {
  56. // 填写交接人工号弹窗model
  57. hosModels: {
  58. disjunctor: false,
  59. },
  60. showKey:false,
  61. keyNum:4, //密钥位数
  62. isNumberKey:false, //是否开启动态密钥
  63. keyArr: [],
  64. SMFlag: true,
  65. keyword: '',
  66. hosId: uni.getStorageSync('userData').user.currentHospital.id,
  67. list: [],
  68. patientInspectLogDTOIndex: undefined,
  69. deptId: undefined,
  70. options: {},
  71. config: {},
  72. // 弹窗model
  73. models: {
  74. disjunctor: false,
  75. },
  76. // 弹窗model1
  77. models1: {
  78. disjunctor: false,
  79. },
  80. };
  81. },
  82. computed: {
  83. listComputed() {
  84. if(this.keyword){
  85. return this.list.filter( v => v.patientName.includes(this.keyword) || v.residenceNo.includes(this.keyword))
  86. }else{
  87. return this.list;
  88. }
  89. }
  90. },
  91. methods:{
  92. // 获取配置
  93. getConfig() {
  94. let postData = {
  95. idx: 0,
  96. sum: 9999,
  97. hospitalConfig:{
  98. hosId:this.hosId,
  99. model:"all"
  100. }
  101. };
  102. post("/simple/data/fetchDataList/hospitalConfig",postData).then((result) => {
  103. if (result.status == 200) {
  104. this.keyArr = []
  105. for(let i of result.list){
  106. if(i.key=='digitalSecretKey'){
  107. if(i.value==1){
  108. this.isNumberKey = true
  109. }else{
  110. this.isNumberKey = false
  111. }
  112. }else if(i.key=='numberDigitalSecretKey'){
  113. this.keyNum = Number(i.value)
  114. }
  115. }
  116. for(let i = 0; i < this.keyNum; i++){
  117. this.keyArr.push({
  118. value:null
  119. })
  120. }
  121. console.log(444,this.keyArr)
  122. }
  123. });
  124. },
  125. confirmKey(data){
  126. this.padChange(data)
  127. this.showKey = false
  128. },
  129. isShowKey(){
  130. this.showKey = true
  131. },
  132. padChange(scannerCode){
  133. if(!this.isNumberKey){
  134. scannerCode = scannerCode.replace('\n','')
  135. }
  136. this.bigScan(scannerCode);
  137. },
  138. // 手动填写
  139. fillInManually(value){
  140. if(value == 1){
  141. // 填写工号
  142. this.showSelectAccount();
  143. }else if(value == 2){
  144. // 动态密钥
  145. this.isShowKey();
  146. }
  147. },
  148. // 填写交接人工号-确认
  149. hosOk(data) {
  150. console.log(data);
  151. const {
  152. accountName,
  153. account,
  154. accountId
  155. } = data;
  156. if (!accountName && !account) {
  157. //没有填写交接人
  158. uni.showModal({
  159. title: "提示",
  160. content: "请填写交接人工号!",
  161. showCancel: false,
  162. success: function(res) {
  163. if (res.confirm) {
  164. console.log("用户点击确定");
  165. } else if (res.cancel) {
  166. console.log("用户点击取消");
  167. }
  168. },
  169. });
  170. return;
  171. } else if ((!accountName && account) || (accountName && !account)) {
  172. //没有填写交接人
  173. uni.showModal({
  174. title: "提示",
  175. content: "请填写正确的交接人工号!",
  176. showCancel: false,
  177. success: function(res) {
  178. if (res.confirm) {
  179. console.log("用户点击确定");
  180. } else if (res.cancel) {
  181. console.log("用户点击取消");
  182. }
  183. },
  184. });
  185. return;
  186. }
  187. this.hosModels.disjunctor = false;
  188. this.validateAccount(data);
  189. },
  190. // 填写交接人工号-取消
  191. hosCancel() {
  192. this.hosModels.disjunctor = false;
  193. this.flag = true;
  194. },
  195. // 填写交接人工号弹窗
  196. showSelectAccount() {
  197. this.hosModels = {
  198. disjunctor: true,
  199. };
  200. },
  201. // 手动填写工号校验
  202. validateAccount(accountObj){
  203. const { accountName, account, accountId } = accountObj;
  204. this.tagClick(accountId);
  205. },
  206. // 扫一扫交接
  207. scanCode(){
  208. if (!this.SMFlag) {
  209. return;
  210. }
  211. this.SMFlag = false;
  212. SM().then((content) => {
  213. uni.showLoading({
  214. title: "加载中",
  215. mask: true,
  216. });
  217. this.bigScan(content);
  218. }).catch(err => {
  219. this.SMFlag = true;
  220. });
  221. },
  222. // 扫码
  223. bigScan(content){
  224. let postData = {
  225. type: 'patientDept', //根据患者所在科室,对比扫码科室校验
  226. deptId: this.deptId,
  227. scanCode: content,
  228. }
  229. post("/workerOrder/scanCheck", postData)
  230. .then((res) => {
  231. this.SMFlag = true;
  232. uni.hideLoading();
  233. if (res.state == 200) {
  234. this.tagClick();
  235. } else {
  236. uni.showToast({
  237. icon: "none",
  238. title: res.msg || "接口获取数据失败!",
  239. });
  240. }
  241. });
  242. },
  243. // 标记回科
  244. tagClick(handover){
  245. this.handover = handover;
  246. this.models1 = {
  247. disjunctor: true,
  248. title: "提示",
  249. content: `是否确定批量回科?`,
  250. icon: "warn",
  251. operate: {
  252. ok: "确定",
  253. cancel: "取消",
  254. },
  255. };
  256. },
  257. //确定
  258. ok1() {
  259. this.models1.disjunctor = false;
  260. uni.showLoading({
  261. title: "加载中",
  262. mask: true,
  263. });
  264. post("/nurse/patientInspect/setPatientInspectBackDept", {
  265. pilIds: this.list.map(v => v.id).toString(),
  266. handover: this.handover,
  267. }).then((res) => {
  268. uni.hideLoading();
  269. if (res.state == 200) {
  270. uni.showToast({
  271. icon: "none",
  272. mask: true,
  273. title: "操作成功!",
  274. });
  275. setTimeout(() => {
  276. uni.navigateTo({
  277. url: `/pages/patientInspectLog/patientInspectLogList`,
  278. });
  279. },300)
  280. } else {
  281. uni.showToast({
  282. icon: 'none',
  283. title: res.msg || '请求数据失败!'
  284. });
  285. }
  286. })
  287. },
  288. //取消
  289. cancel1() {
  290. this.models1.disjunctor = false;
  291. },
  292. // 返回
  293. goBack() {
  294. uni.navigateBack();
  295. },
  296. getConfig1(){
  297. uni.showLoading({
  298. mask: true,
  299. title: '加载中'
  300. })
  301. const postData = {
  302. "idx":0,
  303. "sum":1,
  304. "taskTypeConfig":{
  305. "taskTypeDTO":{
  306. "hosId": {"id": this.hosId},
  307. "associationType": {
  308. "key": "association_types",
  309. "value":"inspect",
  310. },
  311. },
  312. },
  313. };
  314. post("/simple/data/fetchDataList/taskTypeConfig", postData).then((res) => {
  315. uni.hideLoading();
  316. if (res.status == 200) {
  317. let list = res.list || [];
  318. if(list.length){
  319. this.config = res.list[0];
  320. }else{
  321. this.config = {};
  322. }
  323. } else {
  324. uni.hideLoading();
  325. uni.showToast({
  326. icon: "none",
  327. title: res.msg || "接口获取数据失败!",
  328. });
  329. }
  330. })
  331. },
  332. // 移除
  333. deleteIt(patientInspectLogDTO, index){
  334. this.patientInspectLogDTOIndex = index;
  335. this.models = {
  336. disjunctor: true,
  337. content: `您确认将<b style='color:red'>${patientInspectLogDTO.patientName}</b>移除吗?`,
  338. icon: "warn",
  339. operate: {
  340. ok: "确定",
  341. cancel: "取消",
  342. },
  343. };
  344. },
  345. // 确定
  346. ok() {
  347. this.models.disjunctor = false;
  348. this.list.splice(this.patientInspectLogDTOIndex, 1);
  349. },
  350. // 取消
  351. cancel() {
  352. this.models.disjunctor = false;
  353. },
  354. doSearch(){
  355. // 扫码
  356. if (!this.SMFlag) {
  357. return;
  358. }
  359. this.SMFlag = false;
  360. SM().then((content) => {
  361. this.keyword = content;
  362. }).catch(err => {
  363. this.SMFlag = true;
  364. });
  365. },
  366. toTransferWorkOrderUser() {
  367. uni.redirectTo({
  368. url: `/pages/transferWorkOrder/transferWorkOrderUser`,
  369. });
  370. },
  371. selectItem(patient){
  372. this.list.forEach(v => {
  373. if(v.id === patient.id){
  374. v.checked ? this.$set(v, 'checked', false) : this.$set(v, 'checked', true)
  375. }
  376. })
  377. },
  378. }
  379. }
  380. </script>
  381. <style lang="less" scoped>
  382. .right-icon{
  383. color: #888;
  384. font-size: 44rpx;
  385. }
  386. .transferWorkOrder{
  387. width: 100%;
  388. height: 100vh;
  389. display: flex;
  390. flex-direction: column;
  391. /deep/ uni-checkbox:not([disabled]) .uni-checkbox-input:hover{
  392. border-color: #49B856!important;
  393. }
  394. .green{
  395. color: #49B856;
  396. font-size: 36rpx;
  397. font-weight: bold;
  398. }
  399. .search{
  400. padding: 10rpx 24rpx;
  401. }
  402. .list{
  403. flex: 1;
  404. min-height: 0;
  405. background-color: #fff;
  406. .item{
  407. height: 100rpx;
  408. line-height: 100rpx;
  409. font-size: 28rpx;
  410. border-bottom: 1rpx solid #D5D5D5;
  411. padding: 0 32rpx;
  412. display: flex;
  413. align-items: center;
  414. justify-content: space-between;
  415. &.tac{
  416. justify-content: center;
  417. }
  418. }
  419. }
  420. .footer{
  421. margin-top: 24rpx;
  422. margin-bottom: 24rpx;
  423. line-height: 80rpx;
  424. height: 80rpx;
  425. background: #fff;
  426. display: flex;
  427. align-items: center;
  428. .btn {
  429. height: 80rpx;
  430. flex: 1;
  431. margin: 0 24rpx 0 0;
  432. background-color: #49B856;
  433. color: #fff;
  434. border-radius: 8rpx;
  435. font-size: 34rpx;
  436. text-align: center;
  437. &:first-of-type{
  438. margin-left: 24rpx;
  439. }
  440. &.gray{
  441. background-color: #8F939C;
  442. }
  443. }
  444. }
  445. }
  446. </style>