archive.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. {extend name="../../base/view/common/base" /}
  2. <!-- 主体 -->
  3. {block name="body"}
  4. <div class="p-3">
  5. <form class="layui-form gg-form-bar border-x border-t">
  6. <div class="layui-input-inline" style="width:150px;">
  7. <select name="cate_id">
  8. <option value="">请选择合同类别</option>
  9. {volist name=":contract_cate()" id="v"}
  10. <option value="{$v.id}">{$v.title}</option>
  11. {/volist}
  12. </select>
  13. </div>
  14. <div class="layui-input-inline" style="width:150px;">
  15. <select name="type">
  16. <option value="">请选择合同性质</option>
  17. <option value="1">普通合同</option>
  18. <option value="2">框架合同</option>
  19. <option value="3">补充协议</option>
  20. <option value="4">其他合同</option>
  21. </select>
  22. </div>
  23. <div class="layui-input-inline" style="width:240px;">
  24. <input type="text" name="keywords" placeholder="输入关键字" class="layui-input" autocomplete="off" />
  25. </div>
  26. <div class="layui-input-inline" style="width:150px;">
  27. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform"><i class="layui-icon layui-icon-search mr-1"></i>搜索</button>
  28. <button type="reset" class="layui-btn layui-btn-reset" lay-filter="reset">清空</button>
  29. </div>
  30. </form>
  31. <table class="layui-hide" id="test" lay-filter="test"></table>
  32. </div>
  33. {/block}
  34. <!-- /主体 -->
  35. <!-- 脚本 -->
  36. {block name="script"}
  37. <script>
  38. const moduleInit = ['tool'];
  39. function gouguInit() {
  40. var table = layui.table, tool = layui.tool ,form = layui.form;
  41. layui.pageTable = table.render({
  42. elem: '#test',
  43. title: '合同归档列表',
  44. url: "/contract/index/archive", //数据接口
  45. cellMinWidth: 80,
  46. page: true, //开启分页
  47. limit: 20,
  48. cols: [
  49. [ //表头
  50. {
  51. field: 'id',
  52. title: '编号',
  53. align: 'center',
  54. width: 80
  55. },{ field: 'check_status', title: '状态', align: 'center', width: 80, templet: function (d) {
  56. var html = '<span class="layui-btn layui-btn-xs layui-bg-' + d.check_status + '">' + d.status_name + '</span>';
  57. return html;
  58. }
  59. },{
  60. field: 'code',
  61. title: '合同编号',
  62. width: 160
  63. },{
  64. field: 'name',
  65. title: '合同名称',
  66. minWidth:240,
  67. templet: '<div><a data-href="/contract/index/view/id/{{d.id}}.html" class="side-a">{{d.name}}</a></div>'
  68. }, {
  69. field: 'cate_title',
  70. title: '合同类别',
  71. align: 'center',
  72. width: 100
  73. }, {
  74. field: 'type_name',
  75. title: '合同性质',
  76. align: 'center',
  77. width: 80,
  78. templet: function (d) {
  79. var html = '<span class="layui-color-' + d.type + '">' + d.type_name + '</span>';
  80. return html;
  81. }
  82. },{
  83. field: 'cost',
  84. title: '合同金额/元',
  85. align: 'right',
  86. width: 100
  87. }, {
  88. field: 'sign_name',
  89. title: '签定人',
  90. align: 'center',
  91. width: 80
  92. },{
  93. field: 'keeper_name',
  94. title: '保管人',
  95. align: 'center',
  96. width: 80
  97. }, {
  98. field: 'sign_time',
  99. title: '签订时间',
  100. align: 'center',
  101. width: 100
  102. }, {
  103. field: 'right',
  104. fixed:'right',
  105. title: '操作',
  106. width: 100,
  107. align: 'center',
  108. templet: function (d) {
  109. return '<span class="layui-btn layui-btn-normal layui-btn-xs" lay-event="view">详情</span>';
  110. }
  111. }
  112. ]
  113. ]
  114. });
  115. //表头工具栏事件
  116. table.on('toolbar(test)', function(obj){
  117. if (obj.event === 'add') {
  118. selectType();
  119. return;
  120. }
  121. });
  122. //监听行工具事件
  123. table.on('tool(test)', function(obj) {
  124. var data = obj.data;
  125. if(obj.event === 'view'){
  126. tool.side('/contract/index/view?id='+data.id);
  127. return;
  128. }
  129. });
  130. //监听搜索提交
  131. form.on('submit(webform)', function(data) {
  132. layui.pageTable.reload({
  133. where: {
  134. keywords: data.field.keywords,
  135. cate_id: data.field.cate_id,
  136. type: data.field.type
  137. },
  138. page: {
  139. curr: 1
  140. }
  141. });
  142. return false;
  143. });
  144. }
  145. </script>
  146. {/block}
  147. <!-- /脚本 -->