configuration-specimen.component.ts 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  1. import { Component, OnInit } from "@angular/core";
  2. import { MainService } from "../../../services/main.service";
  3. import { ToolService } from 'src/app/services/tool.service';
  4. import { NzMessageService } from 'ng-zorro-antd';
  5. import { Subject, forkJoin } from 'rxjs';
  6. import { debounceTime } from 'rxjs/operators';
  7. @Component({
  8. selector: "app-configuration-specimen",
  9. templateUrl: "./configuration-specimen.component.html",
  10. styleUrls: ["./configuration-specimen.component.less"],
  11. })
  12. export class ConfigurationSpecimenComponent implements OnInit {
  13. loading:boolean = false; //页面加载的loading
  14. btnLoading:boolean = false; //提交按钮的loading
  15. tabModalName:string = 'characteristics'; //当前选中的tab
  16. hosId = this.tool.getCurrentHospital().id; //当前院区
  17. // tab类型
  18. dictionaryKeyList:any[] = [
  19. {
  20. name:'检验标本',key:'examine'
  21. },
  22. {
  23. name:'病理标本',key:'pathology'
  24. },
  25. {
  26. name:'标本打包',key:'specimenPackage'
  27. }
  28. ];
  29. spePackageUnionReceive:any = undefined;//是否联合标本收取
  30. spePackageModel:any = undefined;//工单模式
  31. drugsCreateSign:any = [{ label:'是否开启', value: 0 }];//支持建单并签到
  32. drugsReceiveSign:any = [{ label:'是否开启', value: 0 }];//支持接单并签到
  33. drugsStartCheck:any = [{ label:'是否开启', value: 0 }];//起点科室支持核对
  34. drugsStartCheckScanIds:any = [];//起点核对方式
  35. drugsStartManual:any = undefined;//起点科室手动填写
  36. drugsEndCheck:any = [{ label:'是否开启', value: 1 }];//终点科室支持核对
  37. drugsEndCheckScanIds:any = [];//终点核对方式
  38. drugsEndManual:any = undefined;//终点科室手动填写
  39. spePackageAutoPack:any = [{ label:'是否开启', value: 0 }];//自动打包
  40. spePackageUrgents:any[] = [{label: '急标', value: 1}, {label: '普标', value: 0}];//自动关联急标普标急标
  41. spePackageTubeIds:any[] = [];// 自动关联试管类型
  42. spePackageTubeList:any[] = [];// 自动关联试管类型列表
  43. spePackageInventoryTypes:any[] = [{label: '患者', value: 1, disabled: true, checked: true}, {label: '试管', value: 2}];//清点方式
  44. spePackageCreateOrder:any = [{ label:'是否开启', value: 0 }];//生成配送工单
  45. spePackageCodeSize:any = undefined;//条码打印尺寸
  46. // 工单模式
  47. spePackageModelList:any[] = [
  48. { label: '一单一包', value: 1 },
  49. ];
  50. // 手动填写
  51. drugsManualList:any[] = [];
  52. // 是否支持根据手术新建申请单
  53. autoCreate:any[] = [
  54. {label:'是否开启',value: 0}
  55. ];
  56. // 是否是否支持门诊新增申请单
  57. outpatientCreatePathologyForm:any[] = [
  58. {label:'是否开启',value: 0}
  59. ];
  60. outpatientPathologyLabelSize:any; //门诊病理标签样式
  61. surgeryPathologyLabelSize:any //手术病理标签样式
  62. // 门诊支持离体并固定
  63. outpatientInVitroFixation:any[] = [
  64. {label:'是否开启',value: 0}
  65. ];
  66. // 扫描时指定科室不提醒勾选项
  67. deptNotAlert:any[] = [
  68. {label:'是否开启',value: 0}
  69. ];
  70. // 收取时需扫描二维码
  71. arriveScanCode:any[] = [
  72. {label:'是否开启',value: 0}
  73. ];
  74. // 必须扫描动态二维码
  75. arriveScanDynamicCode:any[] = [
  76. {label:'是否开启',value: 0}
  77. ];
  78. // 必须扫描动态二维码
  79. enterDynamicDigitalKey:any[] = [
  80. {label:'是否开启',value: 0}
  81. ];
  82. // 退回标本是否填写交接人
  83. returnSpecimenWhetherHandover:any[] = [
  84. {label:'是否开启',value: 0}
  85. ];
  86. // 显示接单签到按钮
  87. bigScanShowSignBtn:any[] = [
  88. {label:'是否开启',value: 0}
  89. ];
  90. // 支持待到达非本人
  91. bigScanArriveNotOwner:any[] = [
  92. {label:'是否开启',value: 0}
  93. ];
  94. // 显示建单并签到按钮
  95. bigScanShowCreateBtn:any[] = [
  96. {label:'是否开启',value: 0}
  97. ];
  98. // 默认扫描标本进入标本扫描页
  99. defaultScanSpe:any[] = [
  100. {label:'是否开启',value: 0}
  101. ];
  102. // 是否开通收取限制
  103. speCollectLimit:any[] = [
  104. {label:'是否开启',value: 0}
  105. ];
  106. // 是否支持非起点科室收取
  107. speCollectSupportNotStartDept:any[] = [
  108. {label:'是否开启',value: 0}
  109. ];
  110. // 限制标本状态收取
  111. speCollectLimitState:any = [];
  112. // 限制终点科室收取
  113. speCollectLimitEndDept:any = [];
  114. // 限制普通或紧急收取
  115. speCollectLimitUrgent:any = [];
  116. // 是否限制重复收取标本
  117. speCollectLimitRepeat:any[]= [
  118. {label:'是否开启',value: 0}
  119. ];
  120. // 是否限制试管类型收取标本
  121. speCollectLimitTubeType:any[];
  122. // 是否开始收取前进入配置页
  123. speStartCollectShowConfig:any[] = [
  124. {label:'是否开启',value: 0}
  125. ];
  126. // 速冻标本数量控制
  127. pathologyFrozenSpecimenNum:any = '0';
  128. // 提示语
  129. prompt:any;
  130. //申请单条码设置
  131. pathologyBarCode:any;
  132. // 配置
  133. configs:any = {};
  134. // 任务类型
  135. tasktype:any = {};
  136. specimenStateData:any = [];
  137. endDeptData:any = [];
  138. repetitionData:any = [];
  139. astrictData:any = [
  140. {name:'普通',id:'0'},
  141. {name:'紧急',id:'1'},
  142. ]
  143. searchTimerSubject = new Subject();
  144. constructor(private mainService: MainService,private tool: ToolService,private msg: NzMessageService) {}
  145. ngOnInit():void {
  146. // todo
  147. this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
  148. let fun = v[0];
  149. fun.call(this, v[1]);
  150. });
  151. this.getDeptDic();
  152. this.getDeptList();
  153. this.getTaskType();
  154. }
  155. // 获取科室类型
  156. deptItem:any;
  157. getDeptDic(e:string = ''){
  158. this.mainService.getDictionary("list", "speState").subscribe((res) => {
  159. this.specimenStateData = res
  160. })
  161. this.mainService.getDictionary("list", "specimen_tube_type").subscribe((res) => {
  162. this.repetitionData = res
  163. })
  164. this.mainService.getDictionary("list", "dept_type").subscribe((res2) => {
  165. this.deptItem = res2.find(i=>i.name=='检验科室')
  166. let data1 = {
  167. idx: 0,
  168. sum: 9999,
  169. department: {
  170. hospital: { id: this.hosId || "" },
  171. type: { id: this.deptItem.id || "" },
  172. dept: e,
  173. },
  174. };
  175. this.mainService
  176. .getFetchDataList("data", "department", data1)
  177. .subscribe((res) => {
  178. this.endDeptData = res.list;
  179. });
  180. })
  181. }
  182. getEndDeptData(e){
  183. let data1 = {
  184. idx: 0,
  185. sum: 9999,
  186. department: {
  187. hospital: { id: this.hosId || "" },
  188. type: { id: this.deptItem.id || "" },
  189. dept: e,
  190. },
  191. };
  192. this.mainService
  193. .getFetchDataList("data", "department", data1)
  194. .subscribe((res) => {
  195. this.isLoading = false;
  196. this.endDeptData = res.list;
  197. });
  198. }
  199. // 搜索起点科室
  200. changeEndDept(e){
  201. this.searchTimer(this.getEndDeptData, e);
  202. }
  203. // 点击数据字典key
  204. activeDictionaryKey:any = 'examine';
  205. clickDictionaryKey(item){
  206. this.activeDictionaryKey = item.key;
  207. this.tabModal('characteristics');
  208. if(item.key=='examine'){
  209. this.getDeptList();
  210. this.getTaskType();
  211. }else if(item.key=='pathology'){
  212. this.getLabelDic()
  213. this.getTaskTypesId()
  214. }else if(item.key=='specimenPackage'){
  215. this.getDeptList();
  216. this.loading = true;
  217. let drugs_bag_check_scan_type$ = this.mainService.getDictionary('list', 'drugs_bag_check_scan_type', true);
  218. let drugs_bag_manual_type$ = this.mainService.getDictionary('list', 'drugs_bag_manual_type', true);
  219. let specimen_tube_type$ = this.mainService.getDictionary('list', 'specimen_tube_type', true);
  220. forkJoin(drugs_bag_check_scan_type$, drugs_bag_manual_type$, specimen_tube_type$).subscribe((data:any[]) => {
  221. let drugs_bag_check_scan_type = data[0] || [];
  222. let drugs_bag_manual_type = data[1] || [];
  223. let specimen_tube_type = data[2] || [];
  224. this.drugsStartCheckScanIds = drugs_bag_check_scan_type.map(v => ({ label:v.name, value: v.id }));
  225. this.drugsEndCheckScanIds = drugs_bag_check_scan_type.map(v => ({ label:v.name, value: v.id }));
  226. this.drugsManualList = drugs_bag_manual_type.map(v => ({ label:v.name, value: v.id }));
  227. this.spePackageTubeList = specimen_tube_type.map(v => ({ label:v.name, value: v.id }));
  228. this.getTaskTypeByOrdinary('specimenPackage')
  229. })
  230. }
  231. }
  232. changeSpeCollect(e){
  233. if(!e[0].checked){
  234. }
  235. }
  236. // 扫描时指定科室不提醒勾选项
  237. changeDeptNotAlert(e){
  238. console.log(e);
  239. if(!e[0].checked){
  240. this.deptNotAlertIds = [];
  241. }
  242. }
  243. // 收取时需扫描二维码
  244. changeArriveScanCode(e){
  245. console.log(e);
  246. if(!e[0].checked){
  247. this.arriveScanDynamicCode[0].checked = false;
  248. this.enterDynamicDigitalKey[0].checked = false;
  249. }
  250. }
  251. // 用户输入搜索
  252. isLoading: boolean = false;
  253. deptNotAlertIds:any[] = [];
  254. spePackageDeptIds:any[] = [];
  255. deptList:any[] = [];
  256. changeDept(e) {
  257. this.searchTimer(this.getDeptList, e);
  258. }
  259. // 边输入边搜索节流阀
  260. searchTimer(fun, e) {
  261. this.isLoading = true;
  262. this.searchTimerSubject.next([fun, e]);
  263. }
  264. openDeptList(flag){
  265. if(flag){
  266. this.getDeptList();
  267. }
  268. }
  269. //获取科室列表
  270. getDeptList(e:string = '') {
  271. let postData:any = {
  272. idx: 0,
  273. sum: 20,
  274. department: {
  275. searchType: 1,// 简单查询
  276. hospital: { id: this.hosId },
  277. dept: e,
  278. }
  279. };
  280. this.isLoading = true;
  281. this.mainService.getFetchDataList("simple/data", "department", postData)
  282. .subscribe((result) => {
  283. this.isLoading = false;
  284. if (result.status == 200) {
  285. this.deptList = result.list || [];
  286. }
  287. });
  288. }
  289. // 切换tab
  290. tabModal(tabModalName:string){
  291. this.tabModalName = tabModalName;
  292. }
  293. //病理标本保存
  294. submitPathologyForm(){
  295. let postData:any = {
  296. id: this.configs.id,
  297. taskType: this.taskTypeData.id,
  298. hosId: this.hosId,
  299. autoCreate: this.autoCreate[0].checked ? 1 : 0,
  300. outpatientCreatePathologyForm: this.outpatientCreatePathologyForm[0].checked ? 1 : 0,
  301. outpatientInVitroFixation: this.outpatientInVitroFixation[0].checked ? 1 : 0,
  302. pathologyBarCode : this.pathologyBarCode,
  303. pathologyFrozenSpecimenNum : this.pathologyFrozenSpecimenNum,
  304. prompt : this.prompt?this.prompt:undefined,
  305. outpatientPathologyLabelSize:{
  306. id:this.outpatientPathologyLabelSize
  307. },
  308. surgeryPathologyLabelSize:{
  309. id:this.surgeryPathologyLabelSize
  310. },
  311. };
  312. this.btnLoading = true;
  313. this.mainService
  314. .simplePost("addData", "taskTypeConfig", postData)
  315. .subscribe((result) => {
  316. this.btnLoading = false;
  317. if (result.status == 200) {
  318. this.getConfig();
  319. }
  320. });
  321. }
  322. // 检验标本保存
  323. submitForm() {
  324. if(!this.tasktype.id){
  325. this.msg.create("warning", "请先配置患者陪检任务类型!");
  326. return;
  327. }
  328. if(this.deptNotAlert[0].checked && !this.deptNotAlertIds.length){
  329. this.msg.create("warning", "请选择科室!");
  330. return;
  331. }
  332. let postData:any = {
  333. id: this.configs.id,
  334. taskType: this.tasktype.id,
  335. hosId: this.hosId,
  336. deptNotAlert: this.deptNotAlert[0].checked ? 1 : 0,
  337. arriveScanCode: this.arriveScanCode[0].checked ? 1 : 0,
  338. arriveScanDynamicCode: this.arriveScanDynamicCode[0].checked ? 1 : 0,
  339. enterDynamicDigitalKey: this.enterDynamicDigitalKey[0].checked ? 1 : 0,
  340. returnSpecimenWhetherHandover: this.returnSpecimenWhetherHandover[0].checked ? 1 : 0,
  341. bigScanShowSignBtn: this.bigScanShowSignBtn[0].checked ? 1 : 0,
  342. bigScanArriveNotOwner: this.bigScanArriveNotOwner[0].checked ? 1 : 0,
  343. bigScanShowCreateBtn: this.bigScanShowCreateBtn[0].checked ? 1 : 0,
  344. defaultScanSpe: this.defaultScanSpe[0].checked ? 1 : 0,
  345. deptNotAlertIds: this.deptNotAlertIds && this.deptNotAlertIds.length>0 ? this.deptNotAlertIds.toString() : undefined,
  346. speCollectLimit: this.speCollectLimit[0].checked ? 1 : 0,
  347. speCollectSupportNotStartDept: null,
  348. speCollectLimitRepeat: null,
  349. speCollectLimitTubeType: null,
  350. speStartCollectShowConfig: null,
  351. speCollectLimitState: null,
  352. speCollectLimitEndDept: null,
  353. speCollectLimitUrgent: null,
  354. };
  355. if(this.speCollectLimit[0].checked){
  356. postData.speCollectSupportNotStartDept = this.speCollectSupportNotStartDept[0].checked ? 1 : 0;
  357. postData.speCollectLimitRepeat = this.speCollectLimitRepeat[0].checked ? 1 : 0;
  358. postData.speCollectLimitTubeType = this.speCollectLimitTubeType && this.speCollectLimitTubeType.length>0 ? this.speCollectLimitTubeType.toString() : undefined;
  359. postData.speStartCollectShowConfig = this.speStartCollectShowConfig[0].checked ? 1 : 0;
  360. postData.speCollectLimitState = this.speCollectLimitState && this.speCollectLimitState.length>0 ? this.speCollectLimitState.toString() : undefined;
  361. postData.speCollectLimitEndDept = this.speCollectLimitEndDept && this.speCollectLimitEndDept.length>0 ? this.speCollectLimitEndDept.toString() : undefined;
  362. postData.speCollectLimitUrgent = this.speCollectLimitUrgent && this.speCollectLimitUrgent.length>0 ? this.speCollectLimitUrgent.toString() : undefined;
  363. }else{
  364. postData.speCollectSupportNotStartDept = undefined;
  365. postData.speCollectLimitRepeat = undefined;
  366. postData.speCollectLimitTubeType = undefined;
  367. postData.speStartCollectShowConfig = undefined;
  368. postData.speCollectLimitState = undefined;
  369. postData.speCollectLimitEndDept = undefined;
  370. postData.speCollectLimitUrgent = undefined;
  371. }
  372. this.btnLoading = true;
  373. this.mainService
  374. .simplePost("addData", "taskTypeConfig", postData)
  375. .subscribe((result) => {
  376. this.btnLoading = false;
  377. if (result.status == 200) {
  378. this.getConfig();
  379. }
  380. });
  381. }
  382. // 标本打包保存
  383. submitSpecimenPackageForm() {
  384. if(!this.tasktype.id){
  385. this.msg.create("warning", "请先配置关联任务类型!");
  386. return;
  387. }
  388. if(!this.spePackageModel){
  389. this.msg.create("warning", "请选择工单模式!");
  390. return;
  391. }
  392. if(this.drugsStartCheck[0].checked && !this.drugsStartCheckScanIds.filter(v => v.checked).length){
  393. this.msg.create("warning", "请选择起点科室的核对方式!");
  394. return;
  395. }
  396. if(this.drugsEndCheck[0].checked && !this.drugsEndCheckScanIds.filter(v => v.checked).length){
  397. this.msg.create("warning", "请选择终点科室的核对方式!");
  398. return;
  399. }
  400. let postData:any = {
  401. id: this.configs.id,
  402. taskType: this.tasktype.id,
  403. hosId: this.hosId,
  404. spePackageUnionReceive: this.spePackageUnionReceive,
  405. spePackageModel: this.spePackageModel || undefined,
  406. drugsCreateSign: this.drugsCreateSign[0].checked ? 1 : 0,
  407. drugsReceiveSign: this.drugsReceiveSign[0].checked ? 1 : 0,
  408. drugsStartCheck: this.drugsStartCheck[0].checked ? 1 : 0,
  409. drugsStartCheckScanIds: this.drugsStartCheckScanIds.filter(v => v.checked).map(v => v.value).toString() || undefined,
  410. drugsStartManual: this.drugsStartManual ? { id: this.drugsStartManual } : undefined,
  411. drugsEndCheck: this.drugsEndCheck[0].checked ? 1 : 0,
  412. drugsEndCheckScanIds: this.drugsEndCheckScanIds.filter(v => v.checked).map(v => v.value).toString() || undefined,
  413. drugsEndManual: this.drugsEndManual ? { id: this.drugsEndManual } : undefined,
  414. spePackageAutoPack: this.spePackageAutoPack[0].checked ? 1 : 0,
  415. spePackageUrgents: this.spePackageUrgents.filter(v => v.checked).map(v => v.value).toString() || undefined,
  416. spePackageDeptIds: this.spePackageDeptIds.length ? this.spePackageDeptIds.toString() : undefined,
  417. spePackageTubeIds: this.spePackageTubeIds.length ? this.spePackageTubeIds.toString() : undefined,
  418. spePackageInventoryTypes: this.spePackageInventoryTypes.filter(v => v.checked).map(v => v.value).toString() || undefined,
  419. spePackageCreateOrder: this.spePackageCreateOrder[0].checked ? 1 : 0,
  420. spePackageCodeSize: this.spePackageCodeSize || undefined,
  421. };
  422. this.btnLoading = true;
  423. this.mainService
  424. .simplePost("addData", "taskTypeConfig", postData)
  425. .subscribe((result) => {
  426. this.btnLoading = false;
  427. if (result.status == 200) {
  428. this.getConfig();
  429. }
  430. });
  431. }
  432. // 获取标本字典
  433. labelData:any = [];
  434. getLabelDic(){
  435. this.mainService.getDictionary("list", "pathology_label_size").subscribe((data) => {
  436. this.labelData = data
  437. });
  438. }
  439. // 获取任务类型(病理标本)
  440. taskTypeData:any;
  441. getTaskTypesId() {
  442. this.mainService.getDictionary("list", "ordinary_field").subscribe((data) => {
  443. this.taskTypeData = data.find(i=>i.value=='pathology')
  444. this.getConfig();
  445. });
  446. }
  447. //获取任务类型
  448. getTaskType() {
  449. this.loading = true;
  450. let postData = {
  451. idx: 0,
  452. sum: 10,
  453. taskType: {
  454. simpleQuery: true,
  455. hosId: {
  456. id: this.hosId
  457. },
  458. associationType: {
  459. key:"association_types",
  460. value: 'specimen'
  461. }
  462. }
  463. };
  464. this.mainService
  465. .getFetchDataList("simple/data", "taskType", postData)
  466. .subscribe((result) => {
  467. this.loading = false;
  468. if (result.status == 200) {
  469. this.tasktype = result.list[0] || {};
  470. this.getConfig();
  471. }
  472. });
  473. }
  474. //获取任务类型
  475. getTaskTypeByOrdinary(key) {
  476. this.loading = true;
  477. let postData = {
  478. idx: 0,
  479. sum: 10,
  480. taskType: {
  481. simpleQuery: true,
  482. hosId: {
  483. id: this.hosId
  484. },
  485. ordinaryField: {
  486. key:"ordinary_field",
  487. value: key
  488. }
  489. }
  490. };
  491. this.mainService
  492. .getFetchDataList("simple/data", "taskType", postData)
  493. .subscribe((result) => {
  494. this.loading = false;
  495. if (result.status == 200) {
  496. this.tasktype = result.list[0] || {};
  497. this.getConfig();
  498. }
  499. });
  500. }
  501. // 获取配置
  502. getConfig() {
  503. this.loading = true;
  504. let postData = null;
  505. if(this.activeDictionaryKey=='examine'){
  506. postData = {
  507. idx: 0,
  508. sum: 10,
  509. taskTypeConfig: {
  510. taskTypeDTO: {
  511. hosId: {
  512. id: this.hosId
  513. },
  514. associationType: this.tasktype.associationType
  515. }
  516. }
  517. };
  518. }else if(this.activeDictionaryKey=='pathology'){
  519. postData = {
  520. idx: 0,
  521. sum: 10,
  522. taskTypeConfig: {
  523. hosId:this.hosId,
  524. taskType:this.taskTypeData.id
  525. }
  526. };
  527. }else if(this.activeDictionaryKey=='specimenPackage'){
  528. postData = {
  529. idx: 0,
  530. sum: 10,
  531. taskTypeConfig: {
  532. taskTypeDTO: {
  533. hosId: {
  534. id: this.hosId
  535. },
  536. ordinaryField: this.tasktype.ordinaryField
  537. }
  538. }
  539. };
  540. }
  541. this.mainService
  542. .getFetchDataList("simple/data", "taskTypeConfig", postData)
  543. .subscribe((result) => {
  544. this.loading = false;
  545. if (result.status == 200) {
  546. this.configs = result.list[0] || {};
  547. if(this.activeDictionaryKey=='examine'){
  548. // 检验标本
  549. this.deptNotAlert[0].checked = this.configs.deptNotAlert == 1;
  550. this.arriveScanCode[0].checked = this.configs.arriveScanCode == 1;
  551. this.arriveScanDynamicCode[0].checked = this.configs.arriveScanDynamicCode == 1;
  552. this.enterDynamicDigitalKey[0].checked = this.configs.enterDynamicDigitalKey == 1;
  553. this.returnSpecimenWhetherHandover[0].checked = this.configs.returnSpecimenWhetherHandover == 1;
  554. this.bigScanShowSignBtn[0].checked = this.configs.bigScanShowSignBtn == 1;
  555. this.bigScanArriveNotOwner[0].checked = this.configs.bigScanArriveNotOwner == 1;
  556. this.bigScanShowCreateBtn[0].checked = this.configs.bigScanShowCreateBtn == 1;
  557. this.defaultScanSpe[0].checked = this.configs.defaultScanSpe == 1;
  558. this.deptNotAlertIds = this.configs.deptNotAlertIds ? this.configs.deptNotAlertIds.split(',').map(v => +v) : [];
  559. this.deptList = this.configs.deptNotAlertList || [];
  560. this.speCollectLimit[0].checked = this.configs.speCollectLimit == 1;
  561. if(this.configs.speCollectLimit == 1){
  562. this.speCollectSupportNotStartDept[0].checked = this.configs.speCollectSupportNotStartDept == 1;
  563. this.speCollectLimitRepeat[0].checked = this.configs.speCollectLimitRepeat == 1;
  564. this.speCollectLimitTubeType = this.configs.speCollectLimitTubeType ? this.configs.speCollectLimitTubeType.split(',').map(v => +v) : [];
  565. this.speStartCollectShowConfig[0].checked = this.configs.speStartCollectShowConfig == 1;
  566. this.speCollectLimitState = this.configs.speCollectLimitState ? this.configs.speCollectLimitState.split(',').map(v => +v) : [];
  567. this.speCollectLimitEndDept = this.configs.speCollectLimitEndDept ? this.configs.speCollectLimitEndDept.split(',').map(v => +v) : [];
  568. this.speCollectLimitUrgent = this.configs.speCollectLimitUrgent ? this.configs.speCollectLimitUrgent.split(',').map(v => v) : [];
  569. }
  570. }else if(this.activeDictionaryKey=='pathology'){
  571. // 病理标本
  572. this.autoCreate[0].checked = this.configs.autoCreate == 1;
  573. this.outpatientCreatePathologyForm[0].checked = this.configs.outpatientCreatePathologyForm == 1;
  574. this.outpatientInVitroFixation[0].checked = this.configs.outpatientInVitroFixation == 1;
  575. this.pathologyBarCode = this.configs.pathologyBarCode;
  576. this.pathologyFrozenSpecimenNum = this.configs.pathologyFrozenSpecimenNum;
  577. this.prompt = this.configs.prompt || '';
  578. this.outpatientPathologyLabelSize = this.configs.outpatientPathologyLabelSize.id; //门诊病理标签样式
  579. this.surgeryPathologyLabelSize = this.configs.surgeryPathologyLabelSize.id //手术病理标签样式
  580. }else if(this.activeDictionaryKey=='specimenPackage'){
  581. // 标本打包
  582. this.spePackageUnionReceive = this.configs.spePackageUnionReceive || 0;
  583. this.spePackageModel = this.configs.spePackageModel || undefined;
  584. this.drugsCreateSign[0].checked = this.configs.drugsCreateSign == 1;
  585. this.drugsReceiveSign[0].checked = this.configs.drugsReceiveSign == 1;
  586. this.drugsStartCheck[0].checked = this.configs.drugsStartCheck == 1;
  587. this.drugsStartCheckScanIds = this.drugsStartCheckScanIds.map(v => ({...v, checked: (this.configs.drugsStartCheckScanIds || '').split(',').includes(v.value.toString())}));
  588. this.drugsStartManual = this.configs.drugsStartManual ? this.configs.drugsStartManual.id : undefined;
  589. this.drugsEndCheck[0].checked = true;
  590. this.drugsEndCheckScanIds = this.drugsEndCheckScanIds.map(v => ({...v, checked: (this.configs.drugsEndCheckScanIds || '').split(',').includes(v.value.toString())}));
  591. this.drugsEndManual = this.configs.drugsEndManual ? this.configs.drugsEndManual.id : undefined;
  592. this.spePackageAutoPack[0].checked = this.configs.spePackageAutoPack == 1;
  593. this.spePackageUrgents = this.spePackageUrgents.map(v => ({...v, checked: (this.configs.spePackageUrgents || '').split(',').includes(v.value.toString())}));
  594. this.spePackageDeptIds = this.configs.spePackageDeptIds ? this.configs.spePackageDeptIds.split(',').map(v => +v) : [];
  595. this.deptList = this.configs.spePackageDeptList || [];
  596. this.spePackageTubeIds = this.configs.spePackageTubeIds ? this.configs.spePackageTubeIds.split(',').map(v => +v) : [];
  597. this.spePackageInventoryTypes = this.spePackageInventoryTypes.map(v => ({...v, checked: (this.configs.spePackageInventoryTypes || '').split(',').includes(v.value.toString())}));
  598. this.spePackageCreateOrder[0].checked = this.configs.spePackageCreateOrder == 1;
  599. this.spePackageCodeSize = this.configs.spePackageCodeSize || undefined;
  600. }
  601. }
  602. });
  603. }
  604. // 修改起点科室支持核对
  605. changeDrugsStartCheck(e){
  606. console.log(e);
  607. if(!e[0].checked){
  608. this.drugsStartCheckScanIds = this.drugsStartCheckScanIds.map(v => ({...v, checked: false}));
  609. this.drugsStartManual = undefined;
  610. }
  611. }
  612. // 修改终点科室支持核对
  613. changeDrugsEndCheck(e){
  614. console.log(e);
  615. if(!e[0].checked){
  616. this.drugsEndCheckScanIds = this.drugsEndCheckScanIds.map(v => ({...v, checked: false}));
  617. this.drugsEndManual = undefined;
  618. }
  619. }
  620. // 修改自动打包
  621. changeSpePackageAutoPack(e){
  622. console.log(e);
  623. if(!e[0].checked){
  624. this.spePackageUrgents = this.spePackageUrgents.map(v => ({...v, checked: false}));
  625. this.spePackageDeptIds = [];
  626. this.spePackageTubeIds = [];
  627. }
  628. }
  629. }