stoplist.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. {extend name="../../base/view/common/base" /}
  2. <!-- 主体 -->
  3. {block name="body"}
  4. <div class="p-page">
  5. <div class="layui-card border-x border-t" style="margin-bottom:0; box-shadow:0 0 0 0 rgb(5 32 96 / 0%)">
  6. <div class="body-table layui-tab layui-tab-brief" lay-filter="tab">
  7. <ul class="layui-tab-title">
  8. <li><a href="/contract/contract/stoplist">销售合同</a></li>
  9. <li class="layui-this"><a href="/contract/purchase/stoplist">采购合同</a></li>
  10. </ul>
  11. </div>
  12. </div>
  13. <form class="layui-form gg-form-bar border-x">
  14. <div class="layui-input-inline" style="width:122px;">
  15. <select name="types">
  16. <option value="">选择合同性质</option>
  17. <option value="1">普通采购</option>
  18. <option value="2">物品采购</option>
  19. <option value="3">服务采购</option>
  20. </select>
  21. </div>
  22. <div class="layui-input-inline" style="width:122px;">
  23. <select name="cate_id">
  24. <option value="">选择合同类别</option>
  25. {volist name=":get_base_data('ContractCate');" id="vo"}
  26. <option value="{$vo.id}">{$vo.title}</option>
  27. {/volist}
  28. </select>
  29. </div>
  30. <div class="layui-input-inline" style="width:175px;">
  31. <input type="text" class="layui-input" id="sign_time" placeholder="选择合同签订日期" readonly name="sign_time">
  32. </div>
  33. <div class="layui-input-inline" style="width:175px;">
  34. <input type="text" class="layui-input" id="end_time" placeholder="选择合同到期日期" readonly name="end_time">
  35. </div>
  36. <div class="layui-input-inline" style="width:220px;">
  37. <input type="text" name="keywords" placeholder="输入关键字,合同编号/合同名称" class="layui-input" autocomplete="off" />
  38. </div>
  39. <div class="layui-input-inline" style="width:150px">
  40. <input type="hidden" name="tab" value="0" />
  41. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="table-search"><i class="layui-icon layui-icon-search mr-1"></i>搜索</button>
  42. <button type="reset" class="layui-btn layui-btn-reset" lay-filter="table-reset">清空</button>
  43. </div>
  44. </form>
  45. <table class="layui-hide" id="table_contract" lay-filter="table_contract"></table>
  46. </div>
  47. <script type="text/html" id="toolbarDemo">
  48. <div class="layui-btn-container">
  49. <h3>中止合同</h3>
  50. </div>
  51. </script>
  52. {/block}
  53. <!-- /主体 -->
  54. <!-- 脚本 -->
  55. {block name="script"}
  56. <script>
  57. const moduleInit = ['tool','tablePlus','laydatePlus'];
  58. function gouguInit() {
  59. var table = layui.tablePlus,dropdown = layui.dropdown, tool = layui.tool,laydatePlus = layui.laydatePlus;
  60. //日期范围
  61. var sign_time = new laydatePlus({'target':'sign_time'});
  62. var end_time = new laydatePlus({'target':'end_time'});
  63. layui.pageTable = table.render({
  64. elem: "#table_contract"
  65. , toolbar: "#toolbarDemo"
  66. ,url: "/contract/purchase/stoplist"
  67. ,is_excel: true
  68. ,page: true
  69. ,limit: 20
  70. ,cellMinWidth: 60
  71. ,height: 'full-154'
  72. ,cols: [[ //表头
  73. {
  74. field: 'id',
  75. title: 'ID号',
  76. align: 'center',
  77. width: 80
  78. },{
  79. field: 'code',
  80. title: '合同编号',
  81. align: 'center',
  82. width: 150
  83. },{
  84. field: 'name',
  85. title: '合同名称',
  86. minWidth:240,
  87. templet: '<div><a data-href="/contract/purchase/view/id/{{d.id}}.html" class="side-a">{{d.name}}</a></div>'
  88. },{
  89. field: 'cate_title',
  90. title: '合同类别',
  91. align: 'center',
  92. width: 100
  93. },{
  94. field: 'types_name',
  95. title: '合同性质',
  96. align: 'center',
  97. width: 80,
  98. templet: function (d) {
  99. var html = '<span class="layui-color-' + d.types + '">' + d.types_name + '</span>';
  100. return html;
  101. }
  102. },{
  103. field: 'interval_time',
  104. title: '合同有效时间',
  105. align: 'center',
  106. width: 268,
  107. templet: function (d) {
  108. var html = d.interval_time;
  109. if (d.delay > 0 && d.delay < 30) {
  110. html += '<span class="red ml-1" style="font-size:12px;">' + d.delay + '天后到期</span>';
  111. }
  112. if (d.delay == 0) {
  113. html += '<span class="red ml-1" style="font-size:12px;">已过期</span>';
  114. }
  115. return html;
  116. }
  117. },{
  118. field: 'cost',
  119. title: '合同金额(元)',
  120. align: 'right',
  121. width: 100
  122. },{
  123. field: 'stop_name',
  124. title: '中止人',
  125. align: 'center',
  126. width: 80
  127. },{
  128. field: 'stop_time',
  129. title: '中止日期',
  130. align: 'center',
  131. width: 90
  132. },{
  133. field: 'sign_name',
  134. title: '签定人',
  135. align: 'center',
  136. width: 80
  137. },{
  138. field: 'sign_time',
  139. title: '签订日期',
  140. align: 'center',
  141. width: 90
  142. },{
  143. field: 'keeper_name',
  144. title: '保管人',
  145. align: 'center',
  146. width: 80
  147. },{
  148. field: 'right',
  149. fixed:'right',
  150. title: '操作',
  151. width: 60,
  152. align: 'center',
  153. ignoreExport:true,
  154. templet: function (d) {
  155. var btn0='<span class="layui-btn layui-btn-normal layui-btn-xs" lay-event="view">详情</span>';
  156. return btn0;
  157. }
  158. }
  159. ]]
  160. });
  161. table.on('tool(table_contract)',function (obj) {
  162. var checkStatus = table.checkStatus(obj.config.id); //获取选中行状态
  163. var data = obj.data;
  164. if (obj.event === 'view') {
  165. tool.side("/contract/purchase/view?id="+data.id);
  166. return;
  167. }
  168. });
  169. }
  170. </script>
  171. {/block}
  172. <!-- /脚本 -->