test.blade.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>table</title>
  6. <link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
  7. <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.0.0-beta2/css/bootstrap-grid.css" rel="stylesheet">
  8. <style type="text/css">
  9. #test th{
  10. position: sticky;
  11. position: -webkit-sticky;
  12. top: 0;
  13. z-index:999;
  14. background-color: white;
  15. }
  16. </style>
  17. <link href="{{ mix('css/app.css') }}" rel="stylesheet">
  18. </head>
  19. <body onload="a()">
  20. <button></button>
  21. <table id="table" cellspacing="0" cellpadding="2" width="100%" border="1">
  22. <tr id="test" style="white-space: nowrap !important;">
  23. <th >用户编号</th>
  24. <th>试用时间</th>
  25. <th>转正时间</th>
  26. <th>生日时间</th>
  27. <th>民族</th>
  28. <th>身高</th>
  29. </tr>
  30. <tr>
  31. <td style="overflow-x: hidden">200004512312312321321</td>
  32. <td><div>2001-2-15</div></td>
  33. <td><div>2001-2-15</div></td>
  34. <td>1978-8-5</td>
  35. <td>汉</td>
  36. <td>162</td>
  37. </tr>
  38. </table>
  39. <div class="modal fade" tabindex="-1" role="dialog" id="auditOrRecover">
  40. <div class="modal-dialog modal-xl modal-dialog-centered modal-dialog-scrollable">
  41. <div class="modal-content">
  42. <div class="modal-header">
  43. <button type="button" class="close" data-dismiss="modal">&times;</button>
  44. </div>
  45. <div class="modal-body">
  46. <div class="row">
  47. <label class="col-3 text-right h4"><span class="badge badge-success">新增</span></label>
  48. <label class="col-1 h3 text-success" style="bottom: 0.25rem">
  49. <span class="fa fa-long-arrow-right"></span>
  50. </label>
  51. <div class="col-8 border-bottom border-success">
  52. <div v-if="selectedAudit=='storage'" v-for="s in auditList.storage.C">
  53. <div><b>@{{ s.name }}</b><span class="text-muted">(@{{ s.counting_type }}-@{{ s.using_type }})</span></div>
  54. </div>
  55. <div v-if="selectedAudit=='operation'" v-for="s in auditList.operation.C">
  56. <div><b>@{{ s.name }}</b><span class="text-muted">(@{{ s.operation_type }}-@{{ s.strategy }})</span></div>
  57. </div>
  58. <div v-if="selectedAudit=='express'" v-for="s in auditList.express.C">
  59. <div><b>@{{ s.name }}</b></div>
  60. </div>
  61. <div v-if="selectedAudit=='logistic'" v-for="s in auditList.logistic.C">
  62. <div><b>@{{ s.name }}</b></div>
  63. </div>
  64. <div v-if="selectedAudit=='directLogistic'" v-for="s in auditList.directLogistic.C">
  65. <div><b>@{{ s.name }}</b><span class="text-muted">(起步:@{{ s.base_km }}KM)</span></div>
  66. </div>
  67. <div v-if="selectedAudit=='system'" v-for="s in auditList.system.C">
  68. <div>使用费:¥<b>@{{ s.usage_fee }}</b></div>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="row">
  73. <label class="col-3 text-right h4"><span class="badge badge-danger">删除</span></label>
  74. <label class="col-1 h3 text-danger" style="bottom: 0.25rem">
  75. <span class="fa fa-long-arrow-right"></span>
  76. </label>
  77. <div class="col-8 border-bottom border-danger">
  78. <div v-if="selectedAudit=='storage'" v-for="s in auditList.storage.D">
  79. <table class="table table-sm">
  80. <tr class="text-center">
  81. <th>名称</th>
  82. <th>计费类型</th>
  83. <th>用仓类型</th>
  84. <th>最低起租面积</th>
  85. <th>减免类型</th>
  86. <th>减免值</th>
  87. <th>单位</th>
  88. <th>计时单位</th>
  89. <th>数量-单价</th>
  90. <th>税率</th>
  91. </tr>
  92. <tr>
  93. <td>@{{ s.name }}</td>
  94. <td>@{{ s.counting_type }}</td>
  95. <td>@{{ s.using_type }}</td>
  96. <td>@{{ s.minimum_area }}</td>
  97. <td>@{{ s.discount_type }}</td>
  98. <td>@{{ s.discount_value }}</td>
  99. <td>@{{ s.unit_id }}</td>
  100. <td>@{{ s.time_unit_id }}</td>
  101. <td>
  102. <div>
  103. <div class="float-left">
  104. <small v-for="(a,i) in s.amount_interval" v-if="i!=s.amount_interval.length-1">@{{ a }}-@{{ s.amount_interval[i+1] }}(@{{ s.price[i] }}元)<br></small>
  105. <small>@{{ s.amount_interval[s.amount_interval.length-1] }}&nbsp;+<br></small>
  106. </div>
  107. <div class="float-left">
  108. <span class="float-left fa fa-long-arrow-right" style="margin-top: 1em"></span>
  109. <div class="float-left">
  110. <small v-for="(a,i) in s.amount_interval" v-if="i!=s.amount_interval.length-1">@{{ a }}-@{{ s.amount_interval[i+1] }}(@{{ s.price[i] }}元)<br></small>
  111. <small>@{{ s.amount_interval[s.amount_interval.length-1] }}&nbsp;+<br></small>
  112. </div>
  113. </div>
  114. </div>
  115. </td>
  116. <td>@{{ s.tax_rate_id }}%</td>
  117. </tr>
  118. </table>
  119. </div>
  120. <div v-if="selectedAudit=='operation'" v-for="s in auditList.operation.C">
  121. <div><b>@{{ s.name }}</b><span class="text-muted">(@{{ s.operation_type }}-@{{ s.strategy }})</span></div>
  122. </div>
  123. <div v-if="selectedAudit=='express'" v-for="s in auditList.express.C">
  124. <div><b>@{{ s.name }}</b></div>
  125. </div>
  126. <div v-if="selectedAudit=='logistic'" v-for="s in auditList.logistic.C">
  127. <div><b>@{{ s.name }}</b></div>
  128. </div>
  129. <div v-if="selectedAudit=='directLogistic'" v-for="s in auditList.directLogistic.C">
  130. <div><b>@{{ s.name }}</b><span class="text-muted">(起步:@{{ s.base_km }}KM)</span></div>
  131. </div>
  132. <div v-if="selectedAudit=='system'" v-for="s in auditList.system.C">
  133. <div>使用费:<b>@{{ s.usage_fee }}</b></div>
  134. </div>
  135. </div>
  136. </div>
  137. <div class="row">
  138. <label class="col-3 text-right h4"><span class="badge badge-primary">修改</span></label>
  139. <label class="col-1 h3 text-primary" style="bottom: 0.25rem">
  140. <span class="fa fa-long-arrow-right"></span>
  141. </label>
  142. <div class="col-8">
  143. <div v-if="selectedAudit=='storage'" v-for="s in auditList.storage.U">
  144. <table class="table table-sm">
  145. <tr>
  146. <th v-for="(key,val) in auditList.mapping.storage">@{{ val }}</th>
  147. </tr>
  148. <tr>
  149. <td v-for="(key,val) in auditList.mapping.storage" v-html="s[key]"></td>
  150. </tr>
  151. </table>
  152. </div>
  153. <div v-if="selectedAudit=='operation'" v-for="s in auditList.operation.C">
  154. <div><b>@{{ s.name }}</b><span class="text-muted">(@{{ s.operation_type }}-@{{ s.strategy }})</span></div>
  155. </div>
  156. <div v-if="selectedAudit=='express'" v-for="s in auditList.express.C">
  157. <div><b>@{{ s.name }}</b></div>
  158. </div>
  159. <div v-if="selectedAudit=='logistic'" v-for="s in auditList.logistic.C">
  160. <div><b>@{{ s.name }}</b></div>
  161. </div>
  162. <div v-if="selectedAudit=='directLogistic'" v-for="s in auditList.directLogistic.C">
  163. <div><b>@{{ s.name }}</b><span class="text-muted">(起步:@{{ s.base_km }}KM)</span></div>
  164. </div>
  165. <div v-if="selectedAudit=='system'" v-for="s in auditList.system.C">
  166. <div>使用费:<b>@{{ s.usage_fee }}</b></div>
  167. </div>
  168. </div>
  169. </div>
  170. </div>
  171. <div class="modal-footer">
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. <script type="text/javascript" src="{{mix("js/app.js")}}"></script>
  177. <script type="text/javascript">
  178. function a(){
  179. $("#auditOrRecover").modal("show");
  180. }
  181. new Vue({
  182. el:"#auditOrRecover",
  183. data:{
  184. auditList:{
  185. storage:{
  186. "C":[{name:"笕尚退货",counting_type:"包仓",using_type:"恒温"},{name:"笕尚退货",counting_type:"包仓",using_type:"恒温"}],
  187. "U":[{name:"笕尚退货",counting_type:"包仓",using_type:"恒温",
  188. minimum_area:"200",price:["0.2"],discount_type:"无减免",target_id:"10",
  189. discount_value:"20",unit_id:"m²",time_unit_id:"日",tax_rate_id:"3",amount_interval:["2"]}],
  190. "D":[{name:"笕尚退货",counting_type:"包仓",using_type:"恒温",
  191. minimum_area:"200",price:["0.2","0.1"],discount_type:"无减免",
  192. discount_value:"20",unit_id:"m²",time_unit_id:"日",tax_rate_id:"3",amount_interval:["2","5"]}],
  193. "H":{10:{name:"笕尚退货",counting_type:"包仓",using_type:"恒温",
  194. minimum_area:"200",price:["0.1","0.2"],discount_type:"无减免",
  195. discount_value:"20",unit_id:"m²",time_unit_id:"日",tax_rate_id:"3",amount_interval:["2","5"]}},
  196. },
  197. operation:{
  198. "C":[{name:"笕尚入库",operation_type:"入库",strategy:"特征"},{name:"笕尚入库",operation_type:"入库",strategy:"特征"}],
  199. },
  200. express:{
  201. "C":[{name:"笕尚快递"}],
  202. },
  203. logistic:{
  204. "C":[{name:"笕尚物流"}],
  205. },
  206. directLogistic:{
  207. "C":[{name:"笕尚直发",base_km:"10"}],
  208. },
  209. system:{
  210. "C":[{usage_fee:"500"}],
  211. },
  212. mapping:{
  213. "storage":{
  214. "name":"名称",
  215. "counting_type":"计费类型",
  216. "using_type":"用仓类型",
  217. "minimum_area":"最低起租面积",
  218. "discount_type":"减免类型",
  219. "discount_value":"减免值",
  220. "unit_id":"单位",
  221. "time_unit_id":"计时单位",
  222. "amount_interval":"数量-单价",
  223. "tax_rate_id":"税率",
  224. }
  225. },
  226. },
  227. selectedAudit:"storage"
  228. },
  229. mounted(){
  230. let temp = {};
  231. this.auditList.storage.U.forEach(data=>{
  232. let tar = this.auditList.storage.H[data.target_id];
  233. for (let key in this.auditList.mapping.storage){
  234. if (data[key]!==tar[key]){
  235. if (!temp[key]) temp[key] = this.auditList.mapping.storage[key];
  236. data[key] = this.transformData(data[key],key)+this.transformData(tar[key],key);
  237. }else data[key] = this.transformData(data[key],key);
  238. }
  239. if (data["price"]!==tar["price"]){
  240. }
  241. });
  242. this.auditList.mapping.storage = temp;
  243. },
  244. methods:{
  245. transformData(val,key){
  246. if (!val)return;
  247. switch (key) {
  248. case 'tax_rate_id':
  249. val += "%";
  250. break;
  251. case "amount_interval":
  252. let html = '<div class="float-left">';
  253. val.forEach((am,i)=>{
  254. html += "<small>"+am+"-"+val[i+1]+"("+data["price"][i]+"元)</small>";
  255. });
  256. html += "<small>"+val[val.length-1]+" +("+data["price"][val.length-1]+"元)</small></div>";
  257. val = html;
  258. }
  259. return val;
  260. },
  261. },
  262. });
  263. </script>
  264. </body>
  265. </html>