dialogVaccineImage.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. define(function (require) {
  2. return function (context) {
  3. var $dlg, $grid;
  4. function queryGrid1() {
  5. $grid.reload({
  6. mtype: 'GET',
  7. url: api('/sweepCode/selectVaccineImageByUserId'),
  8. queryParams: {userId: context.userId}
  9. }, true);
  10. }
  11. return {
  12. xtype: 'dialog',
  13. dialogId: 'dialogDetail',
  14. title: '疫苗凭证记录 >> ' + context.linkman,
  15. width: '65%',
  16. height: '70%',
  17. onOpen: function () {
  18. $dlg = $(this);
  19. },
  20. center: {
  21. items: {
  22. onRender: function () {
  23. $grid = $(this);
  24. queryGrid1();
  25. },
  26. toolbar: {
  27. xtype: 'toolbar',
  28. title: '疫苗接种',
  29. items: [
  30. {
  31. text: '删除', iconCls: 'fa fa fa-pencil-square-o fa-lg', onClick: function () {
  32. var row = $grid.rowData();
  33. if (row.length == 0) {
  34. $.yvan.msg('请选择数据');
  35. return;
  36. }
  37. $.yvan.confirm('确定删除勾选的这条凭证信息吗?', {
  38. yes: function (index) {
  39. $.yvan.ajax({
  40. method: 'post',
  41. url: api('/sweepCode/deleteFile'),
  42. data: {fileId: row.fileId},
  43. success: function (data) {
  44. $.yvan.msg("删除成功");
  45. $grid.reload();
  46. queryGrid1();
  47. }
  48. });
  49. }
  50. });
  51. }
  52. },
  53. ]
  54. },
  55. xtype: 'grid',
  56. idField: "reportDate",
  57. pagination: true,
  58. columns: [[
  59. {field: 'fileId', title: 'fileId', hidden: true},
  60. {field: 'fileName', title: '文件名', maxWidth: 200, align: 'right',},
  61. {field: 'timeCreate', title: '新增时间', align: 'left', formatter: 'tsymd'},
  62. {
  63. field: 'fileUrl', title: '凭证', minWidth: 500, maxWidth: 500,
  64. formatter: function (value) {
  65. return "<img src='/upload" + value + "'/>";
  66. },
  67. },
  68. ]],
  69. }
  70. },
  71. buttons: [
  72. {
  73. text: "关闭", iconCls: "fa fa-times", onClick: function () {
  74. // $dlg.dialog('close');
  75. $dlg.window('close');
  76. }
  77. }
  78. ]
  79. };
  80. };
  81. });