patientInspectLogSendBack.vue 13 KB

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