pharmacy-com.js 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319
  1. //@ sourceURL=pharmacy-com.js
  2. var readcardUrl = 'http://localhost:8321/readcard/entry';
  3. var url = '/thmz';
  4. /**
  5. * 加载搜索窗口
  6. */
  7. function initSearchList(content, searchTextIds, width, height) {
  8. var settings = {
  9. placement: 'bottom-right',//值: auto,top,right,bottom,left,top-right,top-left,bottom-right,bottom-left 要显示的位置
  10. trigger: 'click', //值:click,hover 触发方式
  11. content: '',//内容,内容可以是函数
  12. width: width,
  13. //arrow:false,//是否显示箭头
  14. multi: true,//在页面允许其他弹出层
  15. closeable: true,//显示关闭按钮
  16. style: '', //值:'',inverse
  17. delay: 300,//延迟时间, 悬浮属性才执行
  18. padding: true,//内容填充
  19. height: height,
  20. //offsetTop:10,
  21. cache: true,//如果缓存设置为false,则popover将销毁并重新创建
  22. content: content
  23. };
  24. if(Array.isArray(searchTextIds)){
  25. for (let i = 0; i < searchTextIds.length; i++) {
  26. $('#' + searchTextIds[i]).webuiPopover('destroy').webuiPopover(settings);
  27. }
  28. }else{
  29. $('#' + searchTextIds).webuiPopover('destroy').webuiPopover(settings);
  30. }
  31. }
  32. /**
  33. * 修改列数据
  34. * @param $table 表格元素
  35. * @param index 行索引
  36. * @param field 列名
  37. * @param value cell值
  38. */
  39. function saveCellData($table, index, field, value) {
  40. $table.bootstrapTable('updateCell', {
  41. index: index,
  42. field: field,
  43. value: value
  44. })
  45. }
  46. /**
  47. * 初始化下拉列表
  48. */
  49. function initDynamicSelect(url, id, codeColumn, nameColumn) {
  50. codeColumn = codeColumn==null?'code':codeColumn;
  51. nameColumn = nameColumn==null?'name':nameColumn;
  52. $.ajax({
  53. type: "GET",
  54. url: '/thmz/'+url,
  55. dataType: "json",
  56. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  57. success: function (data) {
  58. if (data == '401' || data == 401) {
  59. window.location.href = '/thmz/login/view';
  60. return;
  61. }
  62. var html = '';
  63. $.each(data.data, function (commentIndex, comment) {
  64. let pyCode = typeof comment.pyCode === 'undefined'?'':'(' +comment.pyCode+ ')';
  65. html += '<option value="' + comment[codeColumn] + '">' + comment[nameColumn] + pyCode + '</option>';
  66. });
  67. $('#' + id).empty();
  68. $('#' + id).html(html);
  69. $('#' + id).selectpicker('refresh');
  70. }
  71. });
  72. }
  73. /**
  74. * 初始化员工下拉列表
  75. */
  76. function initEmployeeSelect(id) {
  77. $.ajax({
  78. type: "GET",
  79. url: '/thmz/getEmployee',
  80. dataType: "json",
  81. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  82. success: function (data) {
  83. if (data == '401' || data == 401) {
  84. window.location.href = '/thmz/login/view';
  85. return;
  86. }
  87. var html = '';
  88. $.each(data.data, function (commentIndex, comment) {
  89. let pyCode = typeof comment.pyCode === 'undefined'?'':'(' +comment.pyCode+ ')';
  90. html += '<option value="' + comment['employeeCode'] + '">' + comment['employeeName']+"-"+comment['deptName'] + pyCode + '</option>';
  91. });
  92. $('#' + id).empty();
  93. $('#' + id).html(html);
  94. $('#' + id).selectpicker('refresh');
  95. }
  96. });
  97. }
  98. //初始化药房下拉
  99. function initAllGroup(id) {
  100. $.ajax({
  101. type: "GET",
  102. url: '/thmz/queryAllGroupName',
  103. contentType: "application/json;charset=UTF-8",
  104. dataType: "json",
  105. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  106. success: function (res) {
  107. if (res == '401' || res == 401) {
  108. window.location.href = '/thmz/login/view';
  109. return;
  110. }
  111. if (res.code == 0) {
  112. //初始化部门下拉
  113. var arr = res.data;
  114. if (arr != null && arr.length > 0) {
  115. var html = "";
  116. for (var i = 0; i < arr.length; i++) {
  117. html += "<option value='" + arr[i].groupNo + "'>" + arr[i].groupName + '(' + arr[i].pyCode + ")</option>";
  118. }
  119. $('#'+id).html(html);
  120. $('#'+id).selectpicker('refresh');
  121. } else {
  122. errorMesage(res);
  123. }
  124. }
  125. }
  126. });
  127. }
  128. /**
  129. * 四舍五入保留2位小数(若第二位小数为0,则保留一位小数)
  130. * @param num
  131. * @returns {*}
  132. */
  133. function keepTwoDecimal(num) {
  134. var result = parseFloat(num);
  135. if (isNaN(result)) {
  136. return false;
  137. }
  138. result = Math.round(num * 100) / 100;
  139. return result;
  140. }
  141. function keepMiDecimal(num, mi) {
  142. var result = parseFloat(num);
  143. if (isNaN(result)) {
  144. return false;
  145. }
  146. result = Math.round(num * mi) / mi;
  147. return result;
  148. }
  149. //默认打印机下标
  150. var defaultPrintIndex = -1;
  151. /**
  152. * 查询默认打印机
  153. */
  154. function setDefaultPrint() {
  155. if (defaultPrintIndex >= 0) {
  156. return;
  157. }
  158. $.ajax({
  159. type: "GET",
  160. url: '/thmz/getLastWindowsByCurrentUser',
  161. contentType: "application/json;charset=UTF-8",
  162. dataType: "json",
  163. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  164. async: false,
  165. success: function (res) {
  166. if (res == '401' || res == 401) {
  167. window.location.href = '/thmz/login/view'
  168. return;
  169. }
  170. if (res.code == 0) {
  171. defaultPrintIndex = res.data.cgPrintIndex;
  172. } else {
  173. defaultPrintIndex = -1;
  174. }
  175. }
  176. });
  177. }
  178. /**
  179. * 显示查询所有药品悬浮窗
  180. * @param data
  181. */
  182. function showDrugPopover(data) {
  183. let columns = [
  184. {
  185. field: 'code',
  186. title: '编码',
  187. align: "center",
  188. valign: 'middle'
  189. }, {
  190. field: 'name',
  191. title: '药品名',
  192. align: "center",
  193. valign: 'middle'
  194. }, {
  195. field: 'manufactoryName',
  196. title: '厂家',
  197. align: "center",
  198. valign: 'middle'
  199. },
  200. {
  201. field: 'specification',
  202. title: '规格',
  203. align: "center",
  204. valign: 'middle'
  205. },
  206. {
  207. field: 'packRetprice',
  208. title: '零售价',
  209. align: "center",
  210. valign: 'middle'
  211. }
  212. ];
  213. columns = columns.concat(data.columns);
  214. $('#tb_table_medicine').bootstrapTable('destroy');
  215. $('#tb_table_medicine').bootstrapTable({
  216. url: data.url==null?'/thmz/getYp':data.url, //请求后台的URL(*)
  217. method: data.method==null?'GET':data.method, //请求方式(*)
  218. toolbar: '#toolbar', //工具按钮用哪个容器
  219. striped: true, //是否显示行间隔色
  220. cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  221. pagination: false, //是否显示分页(*)
  222. sortable: true, //是否启用排序
  223. sortOrder: "asc", //排序方式
  224. queryParams: data.data,
  225. sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
  226. pageNumber: 1, //初始化加载第一页,默认第一页
  227. pageSize: 5, //每页的记录行数(*)
  228. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  229. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  230. strictSearch: true,
  231. showColumns: false, //是否显示所有的列
  232. showRefresh: false, //是否显示刷新按钮
  233. minimumCountColumns: 2, //最少允许的列数
  234. clickToSelect: true, //是否启用点击选中行
  235. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  236. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  237. cardView: false, //是否显示详细视图
  238. detailView: false,
  239. ajaxOptions: {
  240. headers: {
  241. 'Accept': 'application/json',
  242. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  243. }
  244. },
  245. columns: columns,
  246. onClickRow: data.onClickRow==null?function (row, $element) {
  247. $('#searchTextDrug').webuiPopover('hide');
  248. $('#codeSearch').val(row.code);
  249. $('#serialSearch').val(row.serial);
  250. $('#searchTextDrug').val(row.name);
  251. }:data.onClickRow,
  252. responseHandler: function (res) {
  253. if (res == '401' || res == 401) {
  254. window.location.href = '/thmz/login/view'
  255. return;
  256. }
  257. var ress = eval(res);
  258. if (ress.code == -1) {
  259. errorMesage(res);
  260. return {
  261. "total": 0,//总页数
  262. "rows": {} //数据
  263. };
  264. }
  265. return {
  266. "total": typeof(ress.data) == 'undefined' ? 0 : ress.data.length,//总页数
  267. "rows": ress.data //数据
  268. };
  269. }
  270. });
  271. }
  272. /**
  273. * 显示员工悬浮窗
  274. * @param data
  275. */
  276. function showEmployeePopover(data) {
  277. let columns = [
  278. {
  279. field: 'employeeCode',
  280. title: '员工编码',
  281. align: "center",
  282. valign: 'middle'
  283. }, {
  284. field: 'employeeName',
  285. title: '姓名',
  286. align: "center",
  287. valign: 'middle'
  288. }, {
  289. field: 'deptName',
  290. title: '科室',
  291. align: "center",
  292. valign: 'middle'
  293. }
  294. ];
  295. columns = columns.concat(data.columns);
  296. $('#tb_table_employee').bootstrapTable('destroy');
  297. $('#tb_table_employee').bootstrapTable({
  298. url: data.url==null?'/thmz/getEmployeeBySearchText':data.url, //请求后台的URL(*)
  299. method: 'GET', //请求方式(*)
  300. toolbar: '#toolbar', //工具按钮用哪个容器
  301. striped: true, //是否显示行间隔色
  302. cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  303. pagination: false, //是否显示分页(*)
  304. sortable: true, //是否启用排序
  305. sortOrder: "asc", //排序方式
  306. queryParams: data.data,
  307. sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
  308. pageNumber: 1, //初始化加载第一页,默认第一页
  309. pageSize: 5, //每页的记录行数(*)
  310. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  311. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  312. strictSearch: true,
  313. showColumns: false, //是否显示所有的列
  314. showRefresh: false, //是否显示刷新按钮
  315. minimumCountColumns: 2, //最少允许的列数
  316. clickToSelect: true, //是否启用点击选中行
  317. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  318. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  319. cardView: false, //是否显示详细视图
  320. detailView: false,
  321. ajaxOptions: {
  322. headers: {
  323. 'Accept': 'application/json',
  324. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  325. }
  326. },
  327. columns: columns,
  328. onClickRow: data.onClickRow,
  329. responseHandler: function (res) {
  330. if (res == '401' || res == 401) {
  331. window.location.href = '/thmz/login/view'
  332. return;
  333. }
  334. var ress = eval(res);
  335. if (ress.code == -1) {
  336. errorMesage(res);
  337. return {
  338. "total": 0,//总页数
  339. "rows": {} //数据
  340. };
  341. }
  342. return {
  343. "total": typeof(ress.data) == 'undefined' ? 0 : ress.data.length,//总页数
  344. "rows": ress.data //数据
  345. };
  346. }
  347. });
  348. }
  349. /**
  350. * 显示药品厂家悬浮窗
  351. * @param data
  352. */
  353. function showManufactoryPopover(data) {
  354. let columns = [
  355. {
  356. field: 'code',
  357. title: '编码',
  358. align: "center",
  359. valign: 'middle'
  360. }, {
  361. field: 'name',
  362. title: '厂名',
  363. align: "center",
  364. valign: 'middle'
  365. }
  366. ];
  367. columns = columns.concat(data.columns);
  368. $('#tb_table_manufactory').bootstrapTable('destroy');
  369. $('#tb_table_manufactory').bootstrapTable({
  370. url: data.url==null?'/thmz/getYpZdManufactoryBySearchText':data.url, //请求后台的URL(*)
  371. method: 'GET', //请求方式(*)
  372. toolbar: '#toolbar', //工具按钮用哪个容器
  373. striped: true, //是否显示行间隔色
  374. cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  375. pagination: false, //是否显示分页(*)
  376. sortable: true, //是否启用排序
  377. sortOrder: "asc", //排序方式
  378. queryParams: data.data,
  379. sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
  380. pageNumber: 1, //初始化加载第一页,默认第一页
  381. pageSize: 5, //每页的记录行数(*)
  382. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  383. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  384. strictSearch: true,
  385. showColumns: false, //是否显示所有的列
  386. showRefresh: false, //是否显示刷新按钮
  387. minimumCountColumns: 2, //最少允许的列数
  388. clickToSelect: true, //是否启用点击选中行
  389. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  390. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  391. cardView: false, //是否显示详细视图
  392. detailView: false,
  393. ajaxOptions: {
  394. headers: {
  395. 'Accept': 'application/json',
  396. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  397. }
  398. },
  399. columns: columns,
  400. onClickRow: data.onClickRow,
  401. responseHandler: function (res) {
  402. if (res == '401' || res == 401) {
  403. window.location.href = '/thmz/login/view'
  404. return;
  405. }
  406. var ress = eval(res);
  407. if (ress.code == -1) {
  408. errorMesage(res);
  409. return {
  410. "total": 0,//总页数
  411. "rows": {} //数据
  412. };
  413. }
  414. return {
  415. "total": typeof(ress.data) == 'undefined' ? 0 : ress.data.length,//总页数
  416. "rows": ress.data //数据
  417. };
  418. }
  419. });
  420. }
  421. /**
  422. * 显示供应商悬浮窗
  423. * @param data
  424. */
  425. function showSupplyPopover(data) {
  426. let columns = [
  427. {
  428. field: 'code',
  429. title: '编码',
  430. align: "center",
  431. valign: 'middle'
  432. }, {
  433. field: 'name',
  434. title: '供应商',
  435. align: "center",
  436. valign: 'middle'
  437. }
  438. ];
  439. columns = columns.concat(data.columns);
  440. $('#tb_table_supply').bootstrapTable('destroy');
  441. $('#tb_table_supply').bootstrapTable({
  442. url: data.url==null?'/thmz/getYpZdSupplyBySearchText':data.url, //请求后台的URL(*)
  443. method: 'GET', //请求方式(*)
  444. toolbar: '#toolbar', //工具按钮用哪个容器
  445. striped: true, //是否显示行间隔色
  446. cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  447. pagination: false, //是否显示分页(*)
  448. sortable: true, //是否启用排序
  449. sortOrder: "asc", //排序方式
  450. queryParams: data.data,
  451. sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
  452. pageNumber: 1, //初始化加载第一页,默认第一页
  453. pageSize: 5, //每页的记录行数(*)
  454. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  455. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  456. strictSearch: true,
  457. showColumns: false, //是否显示所有的列
  458. showRefresh: false, //是否显示刷新按钮
  459. minimumCountColumns: 2, //最少允许的列数
  460. clickToSelect: true, //是否启用点击选中行
  461. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  462. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  463. cardView: false, //是否显示详细视图
  464. detailView: false,
  465. ajaxOptions: {
  466. headers: {
  467. 'Accept': 'application/json',
  468. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  469. }
  470. },
  471. columns: columns,
  472. onClickRow: data.onClickRow,
  473. responseHandler: function (res) {
  474. if (res == '401' || res == 401) {
  475. window.location.href = '/thmz/login/view'
  476. return;
  477. }
  478. var ress = eval(res);
  479. if (ress.code == -1) {
  480. errorMesage(res);
  481. return {
  482. "total": 0,//总页数
  483. "rows": {} //数据
  484. };
  485. }
  486. return {
  487. "total": typeof(ress.data) == 'undefined' ? 0 : ress.data.length,//总页数
  488. "rows": ress.data //数据
  489. };
  490. }
  491. });
  492. }
  493. /**
  494. * 将table导出Excel
  495. * @param tableid
  496. * @param btnid
  497. * @param sheetName
  498. */
  499. function tableToExcel(tableid, btnid, sheetName) {
  500. var uri = 'data:application/vnd.ms-excel;base64,';
  501. var template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"' +
  502. 'xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet>'
  503. + '<x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets>'
  504. + '</x:ExcelWorkbook></xml><![endif]-->' +
  505. '<style type="text/css">' +
  506. 'table td{' +
  507. 'border: 1px solid #000000;' +
  508. 'width: 150px;' +
  509. 'height: 30px;' +
  510. 'text-align: center;' +
  511. '}' +
  512. '.xtd{' +
  513. 'border: 1px solid #000000;' +
  514. 'width: 50px;' +
  515. 'height: 30px;' +
  516. 'text-align: center;' +
  517. '}' +
  518. '</style>' +
  519. '</head><body ><table class="excelTable">{table}</table></body></html>';
  520. if (!tableid.nodeType) tableid = document.getElementById(tableid);
  521. var ctx = {worksheet: sheetName || 'Worksheet', table: tableid.innerHTML};
  522. var blobExel = self.baseExel(uri + base64(formatName(template, ctx))); //把base64位文件转化为exel文件
  523. document.getElementById(btnid).href = URL.createObjectURL(blobExel);
  524. document.getElementById(btnid).download = ctx.worksheet;
  525. console.log(document.getElementById(btnid).href);
  526. }
  527. /*处理后端返回的base64位文件变成exel文件进行下载
  528. * 不要直接把base64位的exel文件直接给a标签的href,
  529. * 文件过大时base64位长度过长;chrome浏览器对a标签的href长度有限制;导致下载失败;
  530. * 建议用以下方法处理成本地文件再下载
  531. * */
  532. function baseExel(base64) {
  533. function getContentType(base64) {
  534. return /data:([^;]*);/i.exec(base64)[1];
  535. };
  536. function getData(base64) {
  537. return base64.substr(base64.indexOf("base64,") + 7, base64.length);
  538. };
  539. function b64toBlob(b64Data, contentType, sliceSize) {
  540. contentType = contentType || '';
  541. sliceSize = sliceSize || 512;
  542. var byteCharacters = atob(b64Data);
  543. var byteArrays = [];
  544. for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) {
  545. var slice = byteCharacters.slice(offset, offset + sliceSize);
  546. var byteNumbers = new Array(slice.length);
  547. for (var i = 0; i < slice.length; i++) {
  548. byteNumbers[i] = slice.charCodeAt(i);
  549. }
  550. var byteArray = new Uint8Array(byteNumbers);
  551. byteArrays.push(byteArray);
  552. }
  553. var blob = new Blob(byteArrays, {type: contentType});
  554. return blob;
  555. };
  556. return b64toBlob(getData(base64), getContentType(base64));
  557. }
  558. /**
  559. * 获取jqgrid的所有数据
  560. * @param tableId
  561. * @returns {any[]}
  562. */
  563. function getJQAllData(tableId) {
  564. //拿到grid对象
  565. var obj = $("#" + tableId);
  566. //获取grid表中所有的rowid值
  567. var rowIds = obj.getDataIDs();
  568. //初始化一个数组arrayData容器,用来存放rowData
  569. var arrayData = new Array();
  570. if (rowIds.length > 0) {
  571. for (var i = 0; i < rowIds.length; i++) {
  572. arrayData.push(obj.getRowData(rowIds[i]));
  573. }
  574. }
  575. return arrayData;
  576. }
  577. //base64转码
  578. function base64(s) {
  579. return window.btoa(unescape(encodeURIComponent(s)));
  580. };
  581. //替换table数据和worksheet名字
  582. function formatName(s, c) {
  583. return s.replace(/{(\w+)}/g,
  584. function (m, p) {
  585. return c[p];
  586. });
  587. };
  588. /**
  589. * ajax封装请求
  590. * @param config
  591. * @returns {Promise<any>}
  592. */
  593. function request(config) {
  594. return new Promise(((resolve, reject) => {
  595. $.ajax({
  596. type: config.method,
  597. url: url + config.url,
  598. data: config.data,
  599. contentType: "application/json;charset=UTF-8",
  600. dataType: "json",
  601. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  602. success: function (res) {
  603. if (res == '401' || res == 401) {
  604. window.location.href = '/thmz/login/view';
  605. return;
  606. }
  607. if (res.code == 0) {
  608. resolve(res);
  609. } else {
  610. new PNotify({
  611. title: '错误提示',
  612. text: res.message,
  613. type: 'error',
  614. hide: true,
  615. styling: 'bootstrap3'
  616. });
  617. reject(res)
  618. }
  619. },
  620. error: err => {
  621. new PNotify({
  622. title: '错误提示',
  623. text: err.responseText,
  624. type: 'error',
  625. hide: true,
  626. styling: 'bootstrap3'
  627. });
  628. reject(err)
  629. }
  630. });
  631. }))
  632. }
  633. /**
  634. * 医保凭证接口
  635. * @param config
  636. * @returns {Promise<any>}
  637. */
  638. function readcardRequest(config) {
  639. return new Promise(((resolve, reject) => {
  640. $.ajax({
  641. type: config.method,
  642. url: config.data && config.data.param && config.data.param.startsWith('jiangsu_qrcode') ? 'http://localhost:8321/api/entry' : readcardUrl,
  643. data: config.data,
  644. contentType: "application/json;charset=UTF-8",
  645. dataType: "json",
  646. headers: {'Accept': 'application/json'},
  647. success: res => {
  648. if (res == '401' || res == 401) {
  649. window.location.href = '/thmz/login/view';
  650. return;
  651. }
  652. if (res.code == 200) {
  653. resolve(JSON.parse(res.data));
  654. } else {
  655. $("#showErrorModal").modal("show");
  656. hideModelTimeout('showErrorModal',3000);
  657. reject(res.message)
  658. }
  659. },
  660. error: err => {
  661. $("#showErrorModal").modal("show");
  662. hideModelTimeout('showErrorModal',3000);
  663. reject(err)
  664. }
  665. });
  666. }))
  667. }
  668. /**
  669. * 排序函数
  670. * @param property
  671. * @returns {function(*, *): number}
  672. */
  673. function compare(property) {
  674. return function (a,b) {
  675. var va1 = a[property];
  676. var va2 = b[property];
  677. return va1 - va2
  678. }
  679. }
  680. /**
  681. * 根据对象属性删除对象数组内容
  682. * @param array 对象数组
  683. * @param abj 对象
  684. * @param property 对象属性
  685. * @returns {*}
  686. */
  687. function removeObjArrayByProperty(array,abj,property) {
  688. for (let j = 0; j < array.length; j++) {
  689. if(abj != null && array[j][property] === abj[property]){
  690. array.splice(j,1);
  691. }
  692. }
  693. return array
  694. }
  695. /**
  696. * 获取LocalStorage
  697. * @param name
  698. * @param nullReturn
  699. */
  700. function getLocalStorage(name,nullReturn) {
  701. let returnValue = nullReturn ? nullReturn:-1;
  702. let data = window.localStorage[name];
  703. if(data){
  704. try {
  705. return JSON.parse(data);
  706. }catch (e) {
  707. return data;
  708. }
  709. }
  710. return returnValue;
  711. }
  712. /**
  713. * 指定区域全屏显示
  714. * @param divStr 指定元素ID
  715. */
  716. function fullScreen(divStr) {
  717. let fullarea = document.getElementById(divStr);
  718. if (fullscreen) {    // 退出全屏
  719. if (document.exitFullscreen) {
  720. document.exitFullscreen();
  721. } else if (document.webkitCancelFullScreen) {
  722. document.webkitCancelFullScreen();
  723. } else if (document.mozCancelFullScreen) {
  724. document.mozCancelFullScreen();
  725. } else if (document.msExitFullscreen) {
  726. document.msExitFullscreen();
  727. }
  728. } else {    // 进入全屏
  729. if (fullarea.requestFullscreen) {
  730. fullarea.requestFullscreen();
  731. } else if (fullarea.webkitRequestFullScreen) {
  732. fullarea.webkitRequestFullScreen();
  733. } else if (fullarea.mozRequestFullScreen) {
  734. fullarea.mozRequestFullScreen();
  735. } else if (fullarea.msRequestFullscreen) {
  736. // IE11
  737. fullarea.msRequestFullscreen();
  738. }
  739. }
  740. fullscreen = !fullscreen;
  741. }
  742. /**
  743. * 定时关闭模态框
  744. * @param str 模态框id
  745. * @param times 毫秒数
  746. */
  747. function hideModelTimeout(str,times){
  748. setTimeout(function () {
  749. $("#"+str).modal("hide");
  750. },times)
  751. }
  752. /**
  753. * 定义serializeObject方法,序列化表单
  754. */
  755. $.fn.serializeObject = function () {
  756. var o = {};
  757. var a = this.serializeArray();
  758. $.each(a, function () {
  759. if (o[this.name]) {
  760. if (!o[this.name].push) {
  761. o[this.name] = [o[this.name]];
  762. }
  763. o[this.name].push(this.value || '');
  764. } else {
  765. o[this.name] = this.value || '';
  766. }
  767. });
  768. return o;
  769. };
  770. /**
  771. * 获取药库药房名称
  772. * @param groupNo 编码
  773. */
  774. function getGroupName(groupNo) {
  775. let groupName
  776. $.ajax({
  777. type: "get",
  778. url: '/thmz/selectYfYkByGroupNo?groupNo=' + groupNo,
  779. contentType: "application/json;charset=UTF-8",
  780. dataType: "json",
  781. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  782. async: false,
  783. success: function (res) {
  784. if (res === '401' || res === 401) {
  785. window.location.href = '/thmz/login/view'
  786. return "";
  787. }
  788. if (res.code === 0) {
  789. if(res.data){
  790. groupName = res.data.groupName
  791. }
  792. } else {
  793. errorMesage(res);
  794. }
  795. }
  796. });
  797. return groupName;
  798. }
  799. /**
  800. * 获取药品类型(大类)
  801. * @param groupNo 编码
  802. */
  803. function getYpTypeName(ypType) {
  804. let ypTypeName;
  805. switch (ypType){
  806. case '1':
  807. ypTypeName='西药';
  808. break;
  809. case '2':
  810. ypTypeName='成药';
  811. break;
  812. case '3':
  813. ypTypeName='草药';
  814. break;
  815. default:
  816. ypTypeName='卫生材料';
  817. }
  818. return ypTypeName;
  819. }
  820. //判断字符是否为空的方法
  821. function isEmpty(obj) {
  822. if (typeof obj === "undefined" || obj === null || obj === "") {
  823. return true;
  824. } else {
  825. return false;
  826. }
  827. }
  828. /**
  829. * 根据编码获取性别
  830. * @param code
  831. * @returns {string}
  832. */
  833. function getSex(code) {
  834. var sex = '';
  835. if (code == 1) {
  836. sex = '男';
  837. } else if (code == 2) {
  838. sex = '女';
  839. } else {
  840. sex = '未知';
  841. }
  842. return sex
  843. }
  844. /**
  845. * bootstrapTable修改列数据
  846. * @param index
  847. * @param field
  848. * @param value
  849. */
  850. function saveData(index, field, value,id) {
  851. $('#'+id).bootstrapTable('updateCell', {
  852. index: index, //行索引
  853. field: field, //列名
  854. value: value //cell值
  855. })
  856. }
  857. //将checkbox未选中将设置为指定值并系列化
  858. jQuery.fn.extend({
  859. serializeWithCheckbox: function (uncheckedValue) {
  860. return jQuery.param(this.serializeArrayWithCheckbox(uncheckedValue));
  861. },
  862. serializeArrayWithCheckbox: function (uncheckedValue) {
  863. var
  864. rCRLF = /\r?\n/g,
  865. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  866. rsubmittable = /^(?:input|select|textarea|keygen)/i,
  867. rcheckableType = (/^(?:radio)$/i); //仅将radio设置为不发送未选中项
  868. //未指定的转换为false
  869. if (uncheckedValue == undefined)
  870. uncheckedValue = 'false'
  871. uncheckedValue = uncheckedValue + '';//转字符串
  872. return this.map(function () {
  873. // Can add propHook for "elements" to filter or add form elements
  874. var elements = jQuery.prop(this, "elements");
  875. return elements ? jQuery.makeArray(elements) : this;
  876. })
  877. .filter(function () {
  878. var type = this.type;
  879. // Use .is( ":disabled" ) so that fieldset[disabled] works
  880. return this.name && !jQuery(this).is(":disabled") &&
  881. rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) &&
  882. (this.checked || !rcheckableType.test(type));
  883. })
  884. .map(function (_i, elem) {
  885. var val = jQuery(this).val();
  886. if (val == null) {
  887. return null;
  888. }
  889. //将未勾选的checkbox值设置为指定值
  890. if (this.type == 'checkbox' && this.checked == false)
  891. val = uncheckedValue;
  892. if (Array.isArray(val)) {
  893. return jQuery.map(val, function (val) {
  894. return { name: elem.name, value: val.replace(rCRLF, "\r\n") };
  895. });
  896. }
  897. return { name: elem.name, value: val.replace(rCRLF, "\r\n") };
  898. }).get();
  899. }
  900. });
  901. /**
  902. * 初始化日期时间范围选择
  903. */
  904. function init_daterangepickertime() {
  905. if (typeof ($.fn.daterangepicker) === 'undefined') {
  906. return;
  907. }
  908. var optionSet1 = {
  909. startDate: moment().subtract(1, 'days').format("YYYY-MM-DD 00:00:00"),
  910. endDate: moment().subtract(1, 'days').format("YYYY-MM-DD 23:59:59"),
  911. minDate: '2012-01-01',
  912. maxDate: nowString() + ' 23:59:59',
  913. /*dateLimit: {
  914. days: 1200
  915. },//起止时间的最大间隔*/
  916. showDropdowns: true,
  917. showWeekNumbers: true,
  918. ranges: {
  919. '今天': [moment(), moment()],
  920. '昨天': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
  921. '最近7天': [moment().subtract(6, 'days'), moment()],
  922. '最近30天': [moment().subtract(29, 'days'), moment()],
  923. '当月': [moment().startOf('month'), moment().endOf('month')],
  924. '上个月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
  925. },
  926. opens: 'right',
  927. buttonClasses: ['btn btn-default'],
  928. applyClass: 'btn-small btn-primary',
  929. cancelClass: 'btn-small',
  930. timePicker: true, //显示时间
  931. timePicker24Hour: true, //时间制
  932. timePickerSeconds: true, //时间显示到秒
  933. timePickerIncrement: 1,
  934. format: 'YYYY-MM-DD HH:mm:ss',
  935. separator: ' to ',
  936. locale: {
  937. applyLabel: '确定',
  938. cancelLabel: '取消',
  939. fromLabel: 'From',
  940. toLabel: 'To',
  941. customRangeLabel: '自定义',
  942. daysOfWeek: ['天', '一', '二', '三', '四', '五', '六'],
  943. monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  944. firstDay: 1
  945. }
  946. };
  947. $('#reportrange').daterangepicker(optionSet1, function (start, end, label) {
  948. $('#reportrange span').html(start.format('YYYY-MM-DD HH:mm:ss') + ' - ' + end.format('YYYY-MM-DD HH:mm:ss'));
  949. });
  950. $('#reportrange span').html(moment().subtract(1, 'days').format("YYYY-MM-DD 00:00:00") + ' - ' + moment().subtract(1, 'days').format("YYYY-MM-DD 23:59:59"));
  951. }
  952. /**
  953. * 获取时间选择器的时间数组
  954. * @returns {string[]}
  955. */
  956. function getRePortRangeArr() {
  957. var rePortRange = $('#reportrange span').html();
  958. var rePortRangeArr = rePortRange.split(" - ");
  959. rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00";
  960. rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59";
  961. return rePortRangeArr;
  962. }
  963. /**
  964. * 防抖处理
  965. * @param method
  966. * @param delay
  967. * @returns {Function}
  968. */
  969. function debounce(cb, delay) {
  970. let timer;
  971. return function (...args) {
  972. if (timer) {
  973. clearTimeout(timer)
  974. }
  975. timer = setTimeout(() => {
  976. cb.call(this, ...args)
  977. }, delay)
  978. }
  979. }
  980. /**
  981. * 根据编码 查询药单名称
  982. */
  983. function getPageName(pageClass) {
  984. let ypTypeName;
  985. switch (pageClass){
  986. case '1':
  987. ypTypeName='出院带药';
  988. break;
  989. case '2':
  990. ypTypeName='毒麻药';
  991. break;
  992. case '3':
  993. ypTypeName='基数药';
  994. break;
  995. case '4':
  996. ypTypeName='大输液';
  997. break;
  998. case '5':
  999. ypTypeName='长期口服';
  1000. break;
  1001. case '6':
  1002. ypTypeName='临时口服';
  1003. break;
  1004. case '7':
  1005. ypTypeName='统领单';
  1006. break;
  1007. case '8':
  1008. ypTypeName='门诊领药单';
  1009. break;
  1010. case 'A':
  1011. ypTypeName='医技科室领药';
  1012. break;
  1013. case 'Y':
  1014. ypTypeName='节余药品';
  1015. break;
  1016. case 'T':
  1017. ypTypeName='退药单';
  1018. break;
  1019. case 'HT':
  1020. ypTypeName='护士退药单';
  1021. break;
  1022. case 'S':
  1023. ypTypeName='手术室药单';
  1024. break;
  1025. case 'HT':
  1026. ypTypeName='护士退药单';
  1027. break;
  1028. case 'Z':
  1029. ypTypeName='草药处方';
  1030. break;
  1031. default:
  1032. ypTypeName=pageClass;
  1033. }
  1034. return ypTypeName;
  1035. }
  1036. /**
  1037. * 根据系统字典编码获取字典值
  1038. * code: 编码
  1039. */
  1040. function initSysParametersByCode(code) {
  1041. let result = '';
  1042. $.ajax({
  1043. type: "get",
  1044. url: '/thmz/getSysParametersByCode',
  1045. contentType: "application/json;charset=UTF-8",
  1046. dataType: "json",
  1047. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1048. data: {
  1049. code: code,
  1050. },
  1051. async: false,
  1052. success: function (res) {
  1053. if (res === '401' || res === 401) {
  1054. window.location.href = '/thmz/login/view'
  1055. return;
  1056. }
  1057. if (res.code === 0) {
  1058. if(res.data){
  1059. result = res.data
  1060. }
  1061. } else {
  1062. errorMesage(res);
  1063. }
  1064. }
  1065. });
  1066. console.log(result)
  1067. return result;
  1068. }
  1069. /**
  1070. * 优化药品检索下拉框
  1071. * @param data 数据
  1072. * @param tableId table的id
  1073. */
  1074. function showDrugPopoverNew(data, tableId) {
  1075. let columns = [
  1076. {
  1077. field: 'code',
  1078. title: '编码',
  1079. align: "center",
  1080. valign: 'middle'
  1081. }, {
  1082. field: 'name',
  1083. title: '药品名',
  1084. align: "center",
  1085. valign: 'middle'
  1086. }, {
  1087. field: 'manufactoryName',
  1088. title: '厂家',
  1089. align: "center",
  1090. valign: 'middle'
  1091. },
  1092. {
  1093. field: 'specification',
  1094. title: '规格',
  1095. align: "center",
  1096. valign: 'middle'
  1097. },
  1098. {
  1099. field: 'packRetprice',
  1100. title: '零售价',
  1101. align: "center",
  1102. valign: 'middle'
  1103. }
  1104. ];
  1105. columns = columns.concat(data.columns);
  1106. $('#' + tableId).bootstrapTable('destroy');
  1107. $('#' + tableId).bootstrapTable({
  1108. url: data.url==null?'/thmz/getYp':data.url, //请求后台的URL(*)
  1109. method: data.method==null?'GET':data.method, //请求方式(*)
  1110. toolbar: '#toolbar', //工具按钮用哪个容器
  1111. striped: true, //是否显示行间隔色
  1112. cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  1113. pagination: false, //是否显示分页(*)
  1114. sortable: true, //是否启用排序
  1115. sortOrder: "asc", //排序方式
  1116. queryParams: data.data,
  1117. sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
  1118. pageNumber: 1, //初始化加载第一页,默认第一页
  1119. pageSize: 5, //每页的记录行数(*)
  1120. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  1121. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  1122. strictSearch: true,
  1123. showColumns: false, //是否显示所有的列
  1124. showRefresh: false, //是否显示刷新按钮
  1125. minimumCountColumns: 2, //最少允许的列数
  1126. clickToSelect: true, //是否启用点击选中行
  1127. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  1128. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  1129. cardView: false, //是否显示详细视图
  1130. detailView: false,
  1131. ajaxOptions: {
  1132. headers: {
  1133. 'Accept': 'application/json',
  1134. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  1135. }
  1136. },
  1137. columns: columns,
  1138. onClickRow: data.onClickRow==null?function (row, $element) {
  1139. $('#searchTextDrug').webuiPopover('hide');
  1140. $('#codeSearch').val(row.code);
  1141. $('#serialSearch').val(row.serial);
  1142. $('#searchTextDrug').val(row.name);
  1143. }:data.onClickRow,
  1144. responseHandler: function (res) {
  1145. if (res == '401' || res == 401) {
  1146. window.location.href = '/thmz/login/view'
  1147. return;
  1148. }
  1149. var ress = eval(res);
  1150. if (ress.code == -1) {
  1151. errorMesage(res);
  1152. return {
  1153. "total": 0,//总页数
  1154. "rows": {} //数据
  1155. };
  1156. }
  1157. return {
  1158. "total": typeof(ress.data) == 'undefined' ? 0 : ress.data.length,//总页数
  1159. "rows": ress.data //数据
  1160. };
  1161. }
  1162. });
  1163. }
  1164. /**
  1165. * 初始化下拉选
  1166. * @param url 请求路径
  1167. * @param id 下拉选id
  1168. * @param param 参数
  1169. * @param codeColumn 下拉选code值 默认code
  1170. * @param nameColumn 下拉选name值 默认name
  1171. */
  1172. function initDynamicSelectByParam(url, id, param, codeColumn, nameColumn) {
  1173. codeColumn = codeColumn==null?'code':codeColumn;
  1174. nameColumn = nameColumn==null?'name':nameColumn;
  1175. $.ajax({
  1176. type: "GET",
  1177. url: '/thmz/'+url + '?code=' + param,
  1178. dataType: "json",
  1179. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1180. success: function (data) {
  1181. if (data == '401' || data == 401) {
  1182. window.location.href = '/thmz/login/view';
  1183. return;
  1184. }
  1185. var html = '';
  1186. $.each(data.data, function (commentIndex, comment) {
  1187. let pyCode = typeof comment.pyCode === 'undefined'?'':'(' +comment.pyCode+ ')';
  1188. html += '<option value="' + comment[codeColumn] + '">' + comment[nameColumn] + pyCode + '</option>';
  1189. });
  1190. $('#' + id).empty();
  1191. $('#' + id).html(html);
  1192. $('#' + id).selectpicker('refresh');
  1193. }
  1194. });
  1195. }
  1196. // 根据药房编码获取药房信息
  1197. function selectYfInfo(groupNo) {
  1198. let yfVo
  1199. $.ajax({
  1200. type: "get",
  1201. url: '/thmz/selectYfInfoByGroupNo?groupNo=' + groupNo,
  1202. contentType: "application/json;charset=UTF-8",
  1203. dataType: "json",
  1204. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1205. async: false,
  1206. success: function (res) {
  1207. if (res === '401' || res === 401) {
  1208. window.location.href = '/thmz/login/view'
  1209. return "";
  1210. }
  1211. if (res.code === 0) {
  1212. if(res.data){
  1213. yfVo = res.data
  1214. }
  1215. } else {
  1216. errorMesage(res);
  1217. }
  1218. }
  1219. });
  1220. return yfVo;
  1221. }
  1222. // 获取药库信息
  1223. function selectYkInfo(groupNo) {
  1224. let ykVo
  1225. $.ajax({
  1226. type: "get",
  1227. url: '/thmz/selectYkInfoByGroupNo?groupNo=' + groupNo,
  1228. contentType: "application/json;charset=UTF-8",
  1229. dataType: "json",
  1230. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1231. async: false,
  1232. success: function (res) {
  1233. if (res === '401' || res === 401) {
  1234. window.location.href = '/thmz/login/view'
  1235. return "";
  1236. }
  1237. if (res.code === 0) {
  1238. if(res.data){
  1239. ykVo = res.data
  1240. }
  1241. } else {
  1242. errorMesage(res);
  1243. }
  1244. }
  1245. });
  1246. return ykVo;
  1247. }
  1248. // 根据groupNo获取药库药房字典信息
  1249. function getGroupInfo(groupNo) {
  1250. let ypGroupNoInfo
  1251. $.ajax({
  1252. type: "get",
  1253. url: '/thmz/selectYfYkByGroupNo?groupNo=' + groupNo,
  1254. contentType: "application/json;charset=UTF-8",
  1255. dataType: "json",
  1256. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1257. async: false,
  1258. success: function (res) {
  1259. if (res === '401' || res === 401) {
  1260. window.location.href = '/thmz/login/view'
  1261. return "";
  1262. }
  1263. if (res.code === 0) {
  1264. if(res.data){
  1265. ypGroupNoInfo = res.data
  1266. }
  1267. } else {
  1268. errorMesage(res);
  1269. }
  1270. }
  1271. });
  1272. return ypGroupNoInfo;
  1273. }