lingyunUserNotOnJob.js 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. define(function (require) {
  2. return function (context) {
  3. var $grid1, $form, $coma;
  4. // 输入搜索文本后点击回车按钮查询列表
  5. function enterQueryGrid1(e) {
  6. if (e.keyCode === 13) {
  7. var tmp = $(this).val();
  8. $form.formSet({queryProperties: tmp});
  9. queryGrid1();
  10. }
  11. }
  12. // 弹框的方式
  13. var widgets = {
  14. // 搜索分类检索
  15. selectTableUnit: {
  16. url: 'app/whepi/home/selectLYbumen.js',
  17. bind: {
  18. unitId: 'unitId',
  19. unit: 'unit',
  20. },
  21. },
  22. };
  23. // 下拉选清空并重新赋值
  24. function reloadValuea(_datas) {
  25. if ($coma) {
  26. $coma.combobox('clear');// 清除当前的选项
  27. $coma.combobox('loadData', _datas);// 重新加载数据
  28. }
  29. }
  30. // 获取联机下拉选二级信息
  31. function getList(id) {
  32. id = id == undefined ? 0 : id
  33. var _datas = [];
  34. _datas.push({
  35. "id": "",
  36. "text": "全部",
  37. "selected": true
  38. });
  39. $.yvan.ajax({
  40. url: api('/home/getDepartmentIdLYepi.json?unitId=' + id),
  41. method: 'GET',
  42. async: true,
  43. success: function (data) {
  44. if (data.data != null && data.data != undefined) {
  45. for (var i = 0; i < data.data.length; i++) {
  46. _datas.push({
  47. "id": data.data[i].departmentId,
  48. "text": data.data[i].departmentName
  49. })
  50. }
  51. reloadValuea(_datas);
  52. }
  53. }
  54. });
  55. return _datas;
  56. }
  57. // 检索条件查询
  58. function queryGrid1() {
  59. var queryForm = $form.formGet();
  60. $grid1.reload({
  61. mtype: 'POST',
  62. url: api('/sweepCode/selectLingyunUserNotOnJob'),
  63. queryParams: queryForm
  64. }, true);
  65. }
  66. var queryToolbar = {
  67. xtype: 'toolbar',
  68. title: '用户管理',
  69. items: [
  70. {
  71. text: '查询', iconCls: 'fa fa-search', onClick: function () {
  72. queryGrid1();
  73. }
  74. }, {
  75. text: '重置', iconCls: 'fa fa-refresh', onClick: function () {
  76. $form.formClear();
  77. queryGrid1();
  78. }
  79. }, {
  80. text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
  81. App.closeMe(this);
  82. }
  83. }
  84. ]
  85. };
  86. var queryForm = {
  87. onRender: function () {
  88. $form = $(this);
  89. },
  90. xtype: 'form',
  91. items: [[
  92. {
  93. xtype: 'textbox',
  94. label: '检索条件',
  95. name: 'queryProperties',
  96. prompt: "用户名称/电话号码",
  97. labelWidth: 'auto',
  98. events: {keydown: enterQueryGrid1}, width: 200
  99. },
  100. {
  101. name: 'unitId',
  102. xtype: 'combobox',
  103. label: '部门名称',
  104. data: [{id: '', text: '全部'}, {id: '1000', text: '注册人员'}, {id: '1001', text: '离职人员'}],
  105. value: '',
  106. onChange: function (value) {
  107. queryGrid1();
  108. },
  109. },
  110. // {
  111. // name: 'isBand',
  112. // xtype: 'combobox',
  113. // label: '是否迁移',
  114. // data: [{id: '', text: '全部'}, {id: '1', text: '否'}, {id: '2', text: '是'}],
  115. // value: '',
  116. // onChange: function (value) {
  117. // queryGrid1();
  118. // },
  119. // },
  120. ]]
  121. };
  122. return {
  123. north: {
  124. height: 88,
  125. /* split: true,
  126. border: false,*///底框是否可变动
  127. items: [
  128. queryToolbar,
  129. queryForm
  130. ]
  131. },
  132. center: {
  133. height: '60%',
  134. split: true,
  135. items:
  136. {
  137. onRender: function () {
  138. $grid1 = $(this);
  139. queryGrid1()
  140. },
  141. xtype: 'grid',
  142. toolbar: {
  143. xtype: 'toolbar',
  144. title: '用户列表',
  145. items: [
  146. {
  147. text: '入职', iconCls: 'fa fa-plus-circle fa-lg', onClick: function () {
  148. var row = $grid1.checkedData();
  149. if (row.length == 0) {
  150. $.yvan.msg('请至少选择一行数据');
  151. return;
  152. }
  153. var ids = "";
  154. for (var i=0; i<row.length; i++) {
  155. ids += row[i].houseId + ","
  156. }
  157. $.yvan.showDialog(this,
  158. require('/app/whepi/lingyun/addUser.js')({
  159. isEdit: false,
  160. ids: ids,
  161. confirm: function () {
  162. queryGrid1();
  163. }
  164. })
  165. );
  166. }
  167. },
  168. ]
  169. },
  170. multiselect: true, /// 表格多选
  171. idField: 'userId',
  172. editable: true,
  173. editOnSelected: true,
  174. autoSizeColumns: true,
  175. columns:
  176. [
  177. [
  178. {field: 'userId', title: '用户ID', hidden: true},
  179. {field: 'houseId', title: 'houseId', hidden: true},
  180. {field: 'linkman', title: '姓名', maxWidth: 200, align: 'left',},
  181. {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
  182. {
  183. field: 'returnWork', title: '今日复工', maxWidth: 100, align: 'center', formatter: function (value) {
  184. if (value == 1) {
  185. return "<span style='color: green;'>允许复工<span>";
  186. } else if (value == 0) {
  187. return "<span style='color: red;'>禁止复工<span>";
  188. }
  189. }
  190. },
  191. {field: 'reportStatus', title: '上报', hidden: true},
  192. {
  193. field: 'msStatus', title: '个人上报状态', maxWidth: 100, align: 'center', formatter: function (value, row) {
  194. if (row.rowData.reportStatus == 0) {
  195. return "<span style='color: #ffb717;'>未上报<span>";
  196. } else if (value == 1) {
  197. return "<span style='color: green;'>正常<span>";
  198. } else {
  199. return "<span style='color: red;'>异常<span>";
  200. }
  201. }
  202. },
  203. {field: 'phone', title: '联系电话', maxWidth: 200, align: 'left',},
  204. {field: 'doorplate', title: '工号', maxWidth: 200, align: 'left',},
  205. {field: 'oldOpenId', title: '旧openId',hidden: true},
  206. {field: 'isBand', title: '是否迁移',hidden: true, maxWidth: 200, align: 'center', formatter: function (value, row) {
  207. if (row.rowData.oldOpenId) {
  208. return "<span style='color: green;'>是<span>";
  209. } else {
  210. return "<span style='color: red;'>否<span>";
  211. }
  212. }
  213. },
  214. {field: 'bingqingDesc', title: '病情表述', align: 'left',},
  215. {field: 'isContactDesc', title: '家人确诊或接触', align: 'left',formatter: function (value) {
  216. if (value == "否") {
  217. return "<span style='color: green;'>否<span>";
  218. } else {
  219. return "<span style='color: red;'>是<span>";
  220. }
  221. }
  222. },
  223. {field: 'isSuspectedDesc', title: '家人健康异常', align: 'left',formatter: function (value) {
  224. if (value == "否") {
  225. return "<span style='color: green;'>否<span>";
  226. } else {
  227. return "<span style='color: red;'>是<span>";
  228. }
  229. }
  230. },
  231. {field: 'autoLocal', title: '定位地区', maxWidth: 200, align: 'left',},
  232. {field: 'autoAddr', title: '定位地址', maxWidth: 200, align: 'left',},
  233. {field: 'isTripDesc', title: '是否出行', maxWidth: 200, align: 'left',},
  234. {field: 'tripDetDesc', title: '出行详细', align: 'left',},
  235. ]
  236. ]
  237. }
  238. }
  239. };
  240. };
  241. }
  242. );