test.blade.php 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916
  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" v-if="showAuditPiece.C">
  47. <label class="col-1 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-10 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'">
  68. <div>使用费:¥<b>@{{ auditList.system.C.usage_fee }}</b></div>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="row" v-if="showAuditPiece.D">
  73. <label class="col-1 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-10 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 class="float-left small">
  103. <span 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></span>
  104. <span>@{{ s.amount_interval[s.amount_interval.length-1] }}&nbsp;+(@{{ s.price[s.amount_interval.length-1] }}元)<br></span>
  105. </div>
  106. </td>
  107. <td>@{{ s.tax_rate_id }}</td>
  108. </tr>
  109. </table>
  110. </div>
  111. <div v-if="selectedAudit=='operation'" v-for="s in auditList.operation.D">
  112. <table class="table table-sm">
  113. <tr>
  114. <th>名称</th>
  115. <th>作业类型</th>
  116. <th>策略</th>
  117. <th>特征</th>
  118. <th>按单价</th>
  119. <th>按单减免单价</th>
  120. <th>减免值</th>
  121. <th>类型</th>
  122. <th>附加费</th>
  123. <th>附加费单位</th>
  124. <th>封顶费</th>
  125. <th>备注</th>
  126. <th>税率</th>
  127. </tr>
  128. <tr>
  129. <td>@{{ s.name }}</td>
  130. <td>@{{ s.operation_type }}</td>
  131. <td>@{{ s.strategy }}</td>
  132. <td>@{{ s.feature }}</td>
  133. <td>@{{ s.total_price }}</td>
  134. <td>
  135. <div class="float-left small">
  136. <span v-for="(a,i) in s.total_discount_price">@{{ a }}元<br></span>
  137. </div>
  138. </td>
  139. <td>
  140. <div class="float-left small">
  141. <span v-for="(a,i) in s.discount_count" v-if="i!=s.discount_count.length-1">@{{ a }}-@{{ s.discount_count[i+1] }}<br></span>
  142. <span>@{{ s.discount_count[s.discount_count.length-1] }}&nbsp;+<br></span>
  143. </div>
  144. </td>
  145. <td>@{{ s.type_mark }}</td>
  146. <td>@{{ s.surcharge }}</td>
  147. <td>@{{ s.surcharge_unit_id }}</td>
  148. <td>@{{ s.max_fee }}</td>
  149. <td>@{{ s.remark }}</td>
  150. <td>@{{ s.tax_rate_id }}</td>
  151. </tr>
  152. </table>
  153. </div>
  154. <div v-if="selectedAudit=='express'" v-for="s in auditList.express.D">
  155. <table class="table table-sm">
  156. <tr>
  157. <th>名称</th>
  158. <th>首重</th>
  159. <th>续重</th>
  160. <th>数量-重量</th>
  161. <th>税率</th>
  162. </tr>
  163. <tr>
  164. <td>@{{ s.name }}</td>
  165. <td>@{{ s.initial_weight }}</td>
  166. <td>@{{ s.additional_weight }}</td>
  167. <td>
  168. <span v-for="(a,i) in s.amount_interval" v-if="i!=s.amount_interval.length-1">@{{ a }}-@{{ s.amount_interval[i+1] }}/单(
  169. <span v-for="(w,j) in s.weight_interval[i]" v-if="j!=s.weight_interval[i].length">@{{ w }}-@{{ s.weight_interval[i][j+1] }}/KG,</span>
  170. @{{ s.weight_interval[i][s.weight_interval[i].length-1] }}&nbsp;+/KG)<br></span>
  171. <span>@{{ s.amount_interval[s.amount_interval.length-1] }}&nbsp;+/单(
  172. <span v-for="(w,j) in s.weight_interval[s.amount_interval.length-1]" v-if="j!=s.weight_interval[s.amount_interval.length-1].length">@{{ w }}-@{{ s.weight_interval[s.amount_interval.length-1][j+1] }}/KG,</span>
  173. @{{ s.weight_interval[s.amount_interval.length-1][s.weight_interval[s.amount_interval.length-1].length-1] }}&nbsp;+/KG)<br></span>
  174. </td>
  175. <td>@{{ s.tax_rate_id }}</td>
  176. </tr>
  177. </table>
  178. </div>
  179. <div v-if="selectedAudit=='logistic'" v-for="s in auditList.logistic.D">
  180. <table class="table table-sm">
  181. <tr>
  182. <th>名称</th>
  183. <th>单位一</th>
  184. <th>单位一区间</th>
  185. <th>单位二</th>
  186. <th>单位二区间</th>
  187. <th>提货费</th>
  188. <th>燃油附加费</th>
  189. <th>服务费</th>
  190. <th>税率</th>
  191. </tr>
  192. <tr>
  193. <td>@{{ s.name }}</td>
  194. <td>@{{ s.unit_id }}</td>
  195. <td>
  196. <span class="small" v-for="u in s.unit_range">@{{ u }}<br></span>
  197. </td>
  198. <td>@{{ s.other_unit_id }}</td>
  199. <td>
  200. <span class="small" v-for="u in s.other_unit_range">@{{ u }}<br></span>
  201. </td>
  202. <td>@{{ s.pick_up_price }}</td>
  203. <td>@{{ s.fuel_price }}</td>
  204. <td>@{{ s.service_price }}</td>
  205. <td>@{{ s.tax_rate_id }}</td>
  206. </tr>
  207. </table>
  208. </div>
  209. <div v-if="selectedAudit=='directLogistic'" v-for="s in auditList.directLogistic.D">
  210. <table class="table table-sm">
  211. <tr>
  212. <th>名称</th>
  213. <th>起步公里数</th>
  214. <th>税率</th>
  215. </tr>
  216. <tr>
  217. <td>@{{ s.name }}</td>
  218. <td>@{{ s.base_km }}</td>
  219. <td>@{{ s.tax_rate_id }}</td>
  220. </tr>
  221. </table>
  222. </div>
  223. <div v-if="selectedAudit=='system'">
  224. <div>使用费:<b>@{{ auditList.system.D.usage_fee }}</b></div>
  225. </div>
  226. </div>
  227. </div>
  228. <div class="row" v-if="showAuditPiece.U">
  229. <label class="col-1 text-right h4"><span class="badge badge-primary">修改</span></label>
  230. <label class="col-1 h3 text-primary" style="bottom: 0.25rem">
  231. <span class="fa fa-long-arrow-right"></span>
  232. </label>
  233. <div class="col-10">
  234. <div v-if="selectedAudit=='storage'" v-for="s in auditList.storage.U">
  235. <table class="table table-sm">
  236. <tr>
  237. <th v-for="(val,key) in auditList.mapping.storage">@{{ val }}</th>
  238. </tr>
  239. <tr>
  240. <td v-for="(val,key) in auditList.mapping.storage" v-html="s[key]"></td>
  241. </tr>
  242. </table>
  243. </div>
  244. <div v-if="selectedAudit=='operation'" v-for="s in auditList.operation.U">
  245. <table class="table table-sm">
  246. <tr>
  247. <th v-for="(val,key) in auditList.mapping.operation" v-if="key!='child'">@{{ val }}</th>
  248. <th v-if="s.items.length>0" class="text-center">子项</th>
  249. </tr>
  250. <tr>
  251. <td v-for="(val,key) in auditList.mapping.operation" v-if="key!='child'" v-html="s[key]"></td>
  252. <td v-if="s.items.length>0">
  253. <table class="table table-sm">
  254. <tr><th v-for="(val,key) in auditList.mapping.operation.child">@{{ val }}</th></tr>
  255. <tr v-for="item in s.items">
  256. <td v-for="(val,key) in auditList.mapping.operation.child" v-html="item[key]"></td>
  257. </tr>
  258. </table>
  259. </td>
  260. </tr>
  261. </table>
  262. </div>
  263. <div v-if="selectedAudit=='express'" v-for="s in auditList.express.U">
  264. <table class="table table-sm">
  265. <tr>
  266. <th v-for="(val,key) in auditList.mapping.express" v-if="key!='child'">@{{ val }}</th>
  267. <th v-if="s.details.length>0" class="text-center">子项</th>
  268. </tr>
  269. <tr>
  270. <td v-for="(val,key) in auditList.mapping.express" v-if="key!='child'" v-html="s[key]"></td>
  271. <td v-if="s.details.length>0">
  272. <table class="table table-sm">
  273. <tr><th v-for="(val,key) in auditList.mapping.express.child">@{{ val }}</th></tr>
  274. <tr v-for="item in s.details">
  275. <td v-for="(val,key) in auditList.mapping.express.child" v-html="item[key]"></td>
  276. </tr>
  277. </table>
  278. </td>
  279. </tr>
  280. </table>
  281. </div>
  282. <div v-if="selectedAudit=='logistic'" v-for="s in auditList.logistic.U">
  283. <table class="table table-sm">
  284. <tr>
  285. <th v-for="(val,key) in auditList.mapping.logistic" v-if="key!='child'">@{{ val }}</th>
  286. <th v-if="s.details.length>0" class="text-center">子项</th>
  287. </tr>
  288. <tr>
  289. <td v-for="(val,key) in auditList.mapping.logistic" v-if="key!='child'" v-html="s[key]"></td>
  290. <td v-if="s.details.length>0">
  291. <table class="table table-sm">
  292. <tr><th v-for="(val,key) in auditList.mapping.logistic.child">@{{ val }}</th></tr>
  293. <tr v-for="item in s.details">
  294. <td v-for="(val,key) in auditList.mapping.logistic.child" v-html="item[key]"></td>
  295. </tr>
  296. </table>
  297. </td>
  298. </tr>
  299. </table>
  300. </div>
  301. <div v-if="selectedAudit=='directLogistic'" v-for="s in auditList.directLogistic.U">
  302. <table class="table table-sm">
  303. <tr>
  304. <th v-for="(val,key) in auditList.mapping.directLogistic" v-if="key!='child'">@{{ val }}</th>
  305. <th v-if="s.details.length>0" class="text-center">子项</th>
  306. </tr>
  307. <tr>
  308. <td v-for="(val,key) in auditList.mapping.directLogistic" v-if="key!='child'" v-html="s[key]"></td>
  309. <td v-if="s.details.length>0">
  310. <table class="table table-sm">
  311. <tr><th v-for="(val,key) in auditList.mapping.directLogistic.child">@{{ val }}</th></tr>
  312. <tr v-for="item in s.details">
  313. <td v-for="(val,key) in auditList.mapping.directLogistic.child" v-html="item[key]"></td>
  314. </tr>
  315. </table>
  316. </td>
  317. </tr>
  318. </table>
  319. </div>
  320. <div v-if="selectedAudit=='system'">
  321. <div v-if="auditList.system.H.usage_fee!=auditList.system.U.usage_fee">
  322. <div class="float-left">使用费:</div>
  323. <div class="float-left small text-secondary mt-1">@{{ auditList.system.H.usage_fee }}</div>
  324. <div class="float-left mt-1 mr-4">
  325. <span class="float-left fa fa-arrow-right text-info ml-2 mr-2"></span>
  326. <div class="float-left small text-primary font-weight-bold">@{{ auditList.system.U.usage_fee }}</div>
  327. </div>
  328. </div>
  329. <div v-if="auditList.system.H.tax_rate_id!=auditList.system.U.tax_rate_id">
  330. <div class="float-left">税率:</div>
  331. <div class="float-left small text-secondary mt-1">@{{ auditList.system.H.tax_rate_id }}</div>
  332. <div class="float-left mt-1">
  333. <span class="float-left fa fa-arrow-right text-info ml-2 mr-2"></span>
  334. <div class="float-left small text-primary font-weight-bold">@{{ auditList.system.U.tax_rate_id }}</div>
  335. </div>
  336. </div>
  337. </div>
  338. </div>
  339. </div>
  340. </div>
  341. <div class="modal-footer">
  342. </div>
  343. </div>
  344. </div>
  345. </div>
  346. <div id="app">
  347. </div>
  348. <script type="text/javascript" src="{{mix("js/app.js")}}"></script>
  349. <script type="text/javascript">
  350. function a(){
  351. let url = "{{url('maintenance/priceModel/getPriceModelAudit')}}";
  352. let type = 'directLogistic';
  353. window.tempTip.postBasicRequest(url,{type:type,"owner_id":86},res=>{
  354. console.log(res);
  355. });
  356. return;
  357. //$("#auditOrRecover").modal("show");
  358. let video = document.createElement("video");
  359. let canvas = document.createElement("canvas");
  360. let arr=["{{asset("1.mp4")}}"];
  361. let result = [];
  362. arr.forEach(url=>{
  363. video.setAttribute('src',url);
  364. document.getElementById("app").appendChild(video);
  365. canvas.style.width = video.clientWidth+"px";
  366. canvas.style.height = video.clientHeight+"px";
  367. document.getElementById("app").appendChild(canvas);
  368. canvas.getContext("2d").drawImage(video,0,0,canvas.width,canvas.height);
  369. result.push(canvas.toDataURL("image/png"));
  370. });
  371. console.log(result)
  372. }
  373. new Vue({
  374. el:"#auditOrRecover",
  375. data:{
  376. auditList:{
  377. storage:{
  378. "C":[{name:"笕尚退货",counting_type:"包仓",using_type:"恒温"},{name:"笕尚退货",counting_type:"包仓",using_type:"恒温"}],
  379. "U":[{name:"笕尚退货",counting_type:"包仓",using_type:"恒温",
  380. minimum_area:"200",price:["0.2"],discount_type:"无减免",target_id:"10",
  381. discount_value:"20",unit_id:"1",time_unit_id:"2",tax_rate_id:"1",amount_interval:["2"]}],
  382. "D":[{name:"笕尚退货",counting_type:"包仓",using_type:"恒温",
  383. minimum_area:"200",price:["0.2","0.1"],discount_type:"无减免",
  384. discount_value:"20",unit_id:"m²",time_unit_id:"日",tax_rate_id:"3",amount_interval:["2","5"]}],
  385. "H":{10:{name:"笕尚退货",counting_type:"包仓",using_type:"恒温",
  386. minimum_area:"200",price:["0.1","0.2"],discount_type:"无减免",
  387. discount_value:"20",unit_id:"2",time_unit_id:"1",tax_rate_id:"2",amount_interval:["2","5"]}},
  388. },
  389. operation:{
  390. "C":[{name:"笕尚入库",operation_type:"入库",strategy:"特征"},{name:"笕尚入库",operation_type:"入库",strategy:"特征"}],
  391. "D":[{name:"笕尚入库",operation_type:"入库",strategy:"特征",
  392. feature:"特征X",remark:"x",discount_count:[1,2],total_price:"222",total_discount_price:[1,2,3,4]
  393. ,type_mark:"退货单",surcharge:"58",surcharge_unit_id:"米",max_fee:"777",tax_rate_id:"5%"}],
  394. "U":[{name:"笕尚入库",operation_type:"入库",strategy:"特征",
  395. feature:"特征X",remark:"x",discount_count:[1,2],total_price:"222",total_discount_price:[1,2,3,4]
  396. ,type_mark:"退货单",surcharge:"58",surcharge_unit_id:"米",max_fee:"777",tax_rate_id:"5%",target_id:"10",
  397. items:[{id:"2",owner_price_operation_id:"5",strategy:"默认",amount:"21",unit_id:"8",unit_price:"9",feature:"11",priority:"0",discount_price:[5,6,7],odd_price:"5"},
  398. {id:"5",owner_price_operation_id:"5",strategy:"特征",amount:"22",unit_id:"8",unit_price:"9",feature:"13",priority:"0",discount_price:[5,6,7],odd_price:"5"},]}],
  399. "H":{10:{name:"笕尚入库1",operation_type:"入库",strategy:"特征",
  400. feature:"特征X",remark:"x",discount_count:[1,2,5],total_price:"222",total_discount_price:[1,2,4]
  401. ,type_mark:"退货单",surcharge:"58",surcharge_unit_id:"T",max_fee:"7771",tax_rate_id:"3%",
  402. items:[{id:"1",owner_price_operation_id:"5",strategy:"默认",amount:"21",unit_id:"8",unit_price:"9",feature:"11",priority:"0",discount_price:[5,6,7],odd_price:"5"},
  403. {id:"3",owner_price_operation_id:"5",strategy:"起步",amount:"21",unit_id:"8",unit_price:"9",feature:"11",priority:"0",discount_price:[5,6,7],odd_price:"5"},
  404. {id:"4",owner_price_operation_id:"5",strategy:"特征",amount:"21",unit_id:"8",unit_price:"9",feature:"11",priority:"0",discount_price:[5,6,7],odd_price:"5"},
  405. ]}},
  406. },
  407. express:{
  408. "C":[{name:"笕尚快递"}],
  409. "D":[{name:"笕尚快递",initial_weight:"包仓",additional_weight:"恒温",
  410. amount_interval:[2,5],
  411. weight_interval:[[10,20],[]],tax_rate_id:"5%"}],
  412. "U":[{name:"笕尚快递",initial_weight:"1",additional_weight:"3",
  413. amount_interval:[2,5],
  414. weight_interval:[[10,20],[]],tax_rate_id:"5%",target_id:10,
  415. details:[{province_id:"河南",initial_weight_price:[[4]],additional_weight_price:[[5]]}]}],
  416. "H":{10:{name:"笕尚快递",initial_weight:"1",additional_weight:"2",
  417. amount_interval:[2,5],
  418. weight_interval:[[10,20],[]],tax_rate_id:"5%",
  419. details:[{province_id:"河南",initial_weight_price:[[5]],additional_weight_price:[[5]]}]}},
  420. },
  421. logistic:{
  422. "C":[{name:"笕尚物流"}],
  423. "D":[{name:"笕尚物流",unit_range:["0-5","5-10"],unit_id:"5",other_unit_range:["0-5","5-10"],other_unit_id:"T"
  424. ,pick_up_price:"222",fuel_price:"22",service_price:"34",tax_rate_id:"6%",details:[
  425. {unit_id:"T",range:"0-10",province_id:"河北",city_id:"石家庄",unit_price:"22",delivery_fee:"170",
  426. rate:"20%"},
  427. ]}],
  428. "U":[{name:"笕尚物流",unit_range:["0-5","5-10"],unit_id:"5",other_unit_range:["0-5","5-10"],other_unit_id:"T"
  429. ,pick_up_price:"222",fuel_price:"22",service_price:"34",tax_rate_id:"6%",target_id:10,details:[
  430. {unit_id:"T",range:"0-10",province_id:"河北",city_id:"石家庄",unit_price:"22",delivery_fee:"170",
  431. rate:"20%"},
  432. ]}],
  433. "H":{10:{name:"笕尚物流",unit_range:["0-5","5-10"],unit_id:"5",other_unit_range:["0-5","5-10"],other_unit_id:"T"
  434. ,pick_up_price:"222",fuel_price:"22",service_price:"34",tax_rate_id:"6%",details:[
  435. {unit_id:"T",range:"0-10",province_id:"河北",city_id:"石家庄",unit_price:"22",delivery_fee:"170",
  436. rate:"21%"},
  437. ]}},
  438. },
  439. directLogistic:{
  440. "C":[{name:"笕尚直发",base_km:"10"}],
  441. "D":[{name:"笕尚直发",base_km:"10",tax_rate_id:"3%"}],
  442. "U":[{name:"笕尚直发",base_km:"10",tax_rate_id:"3%",target_id:"10",details:[
  443. {car_type_id:"碰碰车",base_fee:"30",additional_fee:"50"}
  444. ]}],
  445. "H":{10:{name:"笕尚直发",base_km:"101",tax_rate_id:"32%",details:[
  446. {car_type_id:"碰碰车",base_fee:"301",additional_fee:"50"}
  447. ]}},
  448. },
  449. system:{
  450. "C":[{usage_fee:"500"}],
  451. "D":[{usage_fee:"500"}],
  452. "U":{usage_fee:"510",tax_rate_id:20},
  453. "H":{usage_fee:"500",tax_rate_id:21},
  454. },
  455. mapping:{
  456. "storage":{
  457. "name":"名称",
  458. "counting_type":"计费类型",
  459. "using_type":"用仓类型",
  460. "minimum_area":"最低起租面积",
  461. "discount_type":"减免类型",
  462. "discount_value":"减免值",
  463. "unit_id":"单位",
  464. "time_unit_id":"计时单位",
  465. "amount_interval":"数量-单价",
  466. "tax_rate_id":"税率",
  467. },
  468. "operation":{
  469. name:"名称",
  470. operation_type:"作业类型",
  471. strategy:"策略",
  472. feature:"特征",
  473. total_price:"按单价",
  474. total_discount_price:"按单减免单价",
  475. discount_count:"减免值",
  476. type_mark:"类型",
  477. surcharge:"附加费",
  478. surcharge_unit_id:"附加费单位",
  479. max_fee:"封顶费",
  480. remark:"备注",
  481. tax_rate_id:"税率",
  482. child:{
  483. strategy:"子策略",
  484. amount:"起步数",
  485. unit_id:"单位",
  486. unit_price:"单价",
  487. feature:"特征",
  488. discount_price:"减免单价",
  489. odd_price:"零头价",
  490. }
  491. },
  492. "express":{
  493. name:"名称",
  494. initial_weight:"首重",
  495. additional_weight:"续重",
  496. weight_interval:"数量-重量",
  497. tax_rate_id:"税率",
  498. child:{
  499. province_id:"省",
  500. initial_weight_price:"初始单价",
  501. additional_weight_price:"续重单价",
  502. },
  503. },
  504. "logistic":{
  505. name:"名称",
  506. unit_id:"单位一",
  507. unit_range:"单位一区间",
  508. other_unit_id:"单位二",
  509. other_unit_range:"单位二区间",
  510. pick_up_price:"提货费",
  511. fuel_price:"燃油附加费",
  512. service_price:"服务费",
  513. tax_rate_id:"税率",
  514. child:{
  515. unit_id:"单位",
  516. range:"区间",
  517. province_id:"省份",
  518. city_id:"城市",
  519. unit_price:"单价",
  520. delivery_fee:"送货费",
  521. initial_fee:"起始计费",
  522. initial_amount:"起始计数",
  523. rate:"费率",
  524. },
  525. },
  526. "directLogistic":{
  527. name:"名称",
  528. base_km:"起步公里数",
  529. tax_rate_id:"税率",
  530. child:{
  531. car_type_id:"车型",
  532. base_fee:"起步费",
  533. additional_fee:"续费(元/KM)"
  534. }
  535. },
  536. },
  537. },
  538. selectedAudit:"system",
  539. poolMapping:{
  540. units:{1:"T",2:"G"},
  541. taxRates:{1:"2",2:"3"},
  542. },
  543. showAuditPiece:{
  544. "C":true,"D":true,"U":true
  545. }
  546. },
  547. mounted(){
  548. let temp = {"name":"名称"};
  549. let font = "<div class='float-left'><span class='float-left fa fa-arrow-right text-info ml-2 mr-2'></span>";
  550. this.auditList.storage.U.forEach(data=>{
  551. let tar = this.auditList.storage.H[data.target_id];
  552. for (let key in this.auditList.mapping.storage){
  553. if (String(data[key])!==String(tar[key])){
  554. if (!temp[key]) temp[key] = this.auditList.mapping.storage[key];
  555. data[key] = this.transformData(tar,key)+font+this.transformData(data,key,true)+"</div>";
  556. }else data[key] = this.transformData(data,key);
  557. }
  558. if (String(data["price"])!==String(tar["price"]) && String(data["amount_interval"])===String(tar["amount_interval"])){
  559. data["amount_interval"] = this.transformData(tar,"amount_interval")+font+this.transformData(data,"amount_interval",true)+"</div>";
  560. }
  561. });
  562. this.auditList.mapping.storage = temp;
  563. temp={"name":"名称",child:{strategy:"子策略"}};
  564. this.auditList.operation.U.forEach(data=>{
  565. let tar = this.auditList.operation.H[data.target_id];
  566. for (let key in this.auditList.mapping.operation){
  567. if (String(data[key])!==String(tar[key])){
  568. if (!temp[key]) temp[key] = this.auditList.mapping.operation[key];
  569. data[key] = this.transformData(tar,key)+font+this.transformData(data,key,true)+"</div>";
  570. }else data[key] = this.transformData(data,key);
  571. }
  572. let itemTem = {};
  573. tar.items.forEach(item=>{
  574. if (!itemTem[item.strategy])itemTem[item.strategy] = [];
  575. itemTem[item.strategy].push(item);
  576. });
  577. let items = [];
  578. let amount = 0;
  579. data.items.forEach(item=>{
  580. if (itemTem[item.strategy]){
  581. let mark = true;
  582. for (let i=0;i<itemTem[item.strategy].length;i++){
  583. for (let key in this.auditList.mapping.operation.child){
  584. let oldStr = itemTem[item.strategy][i][key];
  585. let newStr = item[key];
  586. if (String(newStr)!==String(oldStr)){
  587. mark = false;break;
  588. }
  589. }
  590. if (mark){
  591. item.operation = "H";
  592. itemTem[item.strategy].splice(i,1);
  593. if (itemTem[item.strategy].length===0)itemTem[item.strategy] = null;
  594. break;
  595. }
  596. }
  597. }//去重
  598. });
  599. data.items.forEach(item=>{
  600. if (item.operation!=='H'){
  601. if (!itemTem[item.strategy]){
  602. for (let key in this.auditList.mapping.operation.child)item[key] = this.transformData(item,key);
  603. item.operation = "C";
  604. items.unshift(item);
  605. amount++;
  606. }else{
  607. let tar = item.strategy;
  608. for (let key in this.auditList.mapping.operation.child){
  609. if (String(item[key])!==String(itemTem[tar][0][key])){
  610. if (!temp.child[key]) temp.child[key] = this.auditList.mapping.operation.child[key];
  611. item[key] = this.transformData(itemTem[tar][0],key)+font+this.transformData(item,key,true)+"</div>";
  612. }else item[key] = this.transformData(item,key);
  613. }
  614. item.operation = "U";
  615. items.push(item);
  616. itemTem[tar].splice(0,1);
  617. if (itemTem[tar].length===0) itemTem[tar] = null;
  618. }
  619. }
  620. });
  621. for (let key in itemTem){
  622. if (itemTem[key]){
  623. itemTem[key].forEach(item=>{
  624. for (let key in this.auditList.mapping.operation.child)item[key] = this.transformData(item,key);
  625. item.operation = "D";
  626. items.splice(amount,0,item);
  627. amount++;
  628. });
  629. }
  630. }
  631. data.items = items;
  632. });
  633. this.auditList.mapping.operation = temp;
  634. temp={"name":"名称",child:{province_id:"省"}};
  635. this.auditList.express.U.forEach(data=> {
  636. let tar = this.auditList.express.H[data.target_id];
  637. for (let key in this.auditList.mapping.express) {
  638. if (String(data[key]) !== String(tar[key])) {
  639. if (!temp[key]) temp[key] = this.auditList.mapping.express[key];
  640. data[key] = this.transformData(tar, key) + font + this.transformData(data, key, true) + "</div>";
  641. } else data[key] = this.transformData(data, key);
  642. if (String(data["amount_interval"])!==String(tar["amount_interval"]) && String(data["weight_interval"])===String(tar["weight_interval"])){
  643. data["weight_interval"] = this.transformData(tar,"weight_interval")+font+this.transformData(data,"weight_interval",true)+"</div>";
  644. }
  645. }
  646. let itemTem = {};
  647. tar.details.forEach(item => {itemTem[item.province_id] = item;});
  648. let items = [];
  649. let amount = 0;
  650. data.details.forEach(item=>{
  651. if (!itemTem[item.province_id]){
  652. for (let key in this.auditList.mapping.express.child)item[key] = this.transformData(item,key);
  653. item.operation = "C";
  654. items.unshift(item);
  655. amount++;
  656. }else{
  657. let mark = true;
  658. for (let key in this.auditList.mapping.express.child){
  659. if (String(item[key])!==String(itemTem[item.province_id][key])){
  660. mark = false;break;
  661. }
  662. }
  663. if (!mark){
  664. let tar = item.province_id;
  665. for (let key in this.auditList.mapping.express.child) {
  666. if (String(item[key]) !== String(itemTem[tar][key])) {
  667. if (!temp.child[key]) temp.child[key] = this.auditList.mapping.express.child[key];
  668. item[key] = this.transformData(itemTem[tar], key) + font + this.transformData(item, key, true) + "</div>";
  669. } else item[key] = this.transformData(item, key);
  670. }
  671. item.operation = "U";
  672. items.push(item);
  673. delete itemTem[tar];
  674. }else delete itemTem[item.province_id];
  675. }
  676. });
  677. for (let key in itemTem){
  678. for (let k in this.auditList.mapping.express.child)itemTem[key][k] = this.transformData(itemTem[key],k);
  679. itemTem[key].operation = "D";
  680. items.splice(amount,0,itemTem[key]);
  681. amount++;
  682. }
  683. data.details = items;
  684. });
  685. this.auditList.mapping.express = temp;
  686. temp={name:"名称",child:{province_id:"省份",city_id:"城市"}};
  687. this.auditList.logistic.U.forEach(data=> {
  688. let tar = this.auditList.logistic.H[data.target_id];
  689. for (let key in this.auditList.mapping.logistic) {
  690. if (String(data[key]) !== String(tar[key])) {
  691. if (!temp[key]) temp[key] = this.auditList.mapping.logistic[key];
  692. data[key] = this.transformData(tar, key) + font + this.transformData(data, key, true) + "</div>";
  693. } else data[key] = this.transformData(data, key);
  694. }
  695. let itemTem = this.logisticDataFormat(tar);
  696. let dataTem = this.logisticDataFormat(data);
  697. let items = [];
  698. for (let key in itemTem){
  699. if (dataTem[key]){
  700. for (let key2 in itemTem[key]){
  701. if (dataTem[key][key2]){
  702. for (let key3 in itemTem[key][key2]){
  703. if (dataTem[key][key2][key3]){
  704. for (let key4 in itemTem[key][key2][key3]){
  705. if (dataTem[key][key2][key3][key4]){
  706. let mark = true;
  707. for (let key5 in this.auditList.mapping.logistic.child){
  708. if (String(dataTem[key][key2][key3][key4][key5]) !== String(itemTem[key][key2][key3][key4][key5])){
  709. if (!temp.child[key5]) temp.child[key5] = this.auditList.mapping.logistic.child[key5];
  710. mark=false;
  711. if (!temp.child[key5]) temp.child[key5] = this.auditList.mapping.logistic.child[key5];
  712. dataTem[key][key2][key3][key4][key5] = this.transformData(itemTem[key][key2][key3][key4], key5) + font + this.transformData(dataTem[key][key2][key3][key4], key5, true) + "</div>";
  713. } else dataTem[key][key2][key3][key4][key5] = this.transformData(dataTem[key][key2][key3][key4], key5);
  714. }
  715. if (!mark){
  716. dataTem[key][key2][key3][key4].operation = "U";
  717. items.push(dataTem[key][key2][key3][key4])
  718. }
  719. delete dataTem[key][key2][key3][key4];
  720. delete itemTem[key][key2][key3][key4];
  721. }
  722. }
  723. }
  724. }
  725. }
  726. }
  727. }
  728. }
  729. dataTem = this.logisticDataRestore(dataTem,"C");
  730. dataTem.push.apply(dataTem,this.logisticDataRestore(itemTem,"D"));
  731. dataTem.push.apply(dataTem,items);
  732. data.details = dataTem;
  733. });
  734. this.auditList.mapping.logistic = temp;
  735. temp={name:"名称",child:{car_type_id:"车型"}};
  736. this.auditList.directLogistic.U.forEach(data=> {
  737. let tar = this.auditList.directLogistic.H[data.target_id];
  738. for (let key in this.auditList.mapping.directLogistic) {
  739. if (String(data[key]) !== String(tar[key])) {
  740. if (!temp[key]) temp[key] = this.auditList.mapping.directLogistic[key];
  741. data[key] = this.transformData(tar, key) + font + this.transformData(data, key, true) + "</div>";
  742. } else data[key] = this.transformData(data, key);
  743. }
  744. let itemTem = {};
  745. tar.details.forEach(item => {itemTem[item.car_type_id] = item;});
  746. let items = [];
  747. let amount = 0;
  748. data.details.forEach(item => {
  749. if (itemTem[item.car_type_id]){
  750. let car = item.car_type_id;
  751. let mark = true;
  752. for (let key in this.auditList.mapping.directLogistic.child) {
  753. if (String(item[key]) !== String(itemTem[car][key])) {
  754. mark = false;
  755. if (!temp.child[key]) temp.child[key] = this.auditList.mapping.directLogistic.child[key];
  756. item[key] = this.transformData(itemTem[car], key) + font + this.transformData(item, key, true) + "</div>";
  757. } else item[key] = this.transformData(item, key);
  758. }
  759. if (!mark){
  760. item.operation = "U";
  761. items.push(item);
  762. }
  763. delete itemTem[car];
  764. }else{
  765. item.operation = "C";
  766. items.unshift(item);
  767. amount++;
  768. }
  769. for (let key in itemTem){
  770. for (let k in this.auditList.mapping.directLogistic.child)itemTem[key][k] = this.transformData(itemTem[key],k);
  771. itemTem[key].operation = "D";
  772. items.splice(amount,0,itemTem[key]);
  773. amount++;
  774. }
  775. data.details = items;
  776. });
  777. });
  778. this.auditList.mapping.directLogistic = temp;
  779. },
  780. methods:{
  781. {{--@include("customer.customer.project.part._auditComparisonVue")--}}
  782. transformData(data,key,font=false){
  783. if (!data[key])return;
  784. let html = '<div class="float-left small ';
  785. if (font)html += "text-primary font-weight-bold";
  786. else html += "text-secondary";
  787. html+='">';
  788. switch (key) {
  789. case "amount_interval":
  790. data[key].forEach((am,i)=>{
  791. if (i!==data[key].length-1) html += "<span>"+am+"-"+data[key][i+1]+"("+data["price"][i]+"元)<br></span>";
  792. });
  793. html += "<span>"+data[key][data[key].length-1]+" +("+data["price"][data[key].length-1]+"元)<br></span></div>";
  794. return html;
  795. case "total_discount_price":
  796. data[key].forEach(am=>{
  797. html += '<span>'+am+'元<br></span>'
  798. });
  799. return html+"</div>";
  800. case "discount_price":
  801. data[key].forEach(am=>{
  802. html += '<span>'+am+'元<br></span>'
  803. });
  804. return html+"</div>";
  805. case "discount_count":
  806. data[key].forEach((am,i)=>{
  807. if (i!==data[key].length-1)html += '<span>'+am+'-'+data[key][i+1]+'<br></span>'
  808. });
  809. html += '<span>'+data[key][data[key].length-1]+'&nbsp;+<br></span>';
  810. return html+"</div>";
  811. case "weight_interval":
  812. data[key].forEach((arr,i)=>{
  813. if (i!==data[key].length-1) html += '<span>'+data.amount_interval[i]+'-'+data.amount_interval[i+1]+'/单(';
  814. arr.forEach((w,j)=>{
  815. if (j!==arr.length-1)html += w+'-'+arr[j+1]+'/KG,';
  816. });
  817. html += (arr[arr.length-1] ? arr[arr.length-1] : 0)+'&nbsp;+/KG)<br></span>';
  818. });
  819. html += '<span>'+data.amount_interval[data.amount_interval.length-1]+'&nbsp;+/单(';
  820. let arr = data.weight_interval[data.weight_interval.length-1];
  821. arr.forEach((w,j)=>{
  822. if (j!==arr.length-1)html += w+'-'+arr[j+1]+'/KG,';
  823. });
  824. html += (arr[arr.length-1] ? arr[arr.length-1] : 0)+'&nbsp;+/KG)<br></span>';
  825. return html;
  826. case "initial_weight_price":
  827. data[key].forEach(arr=>{
  828. html += "<div class='float-left'>"+arr+"<br></div>";
  829. });
  830. return html;
  831. case "additional_weight_price":
  832. data[key].forEach(arr=>{
  833. html += "<div class='float-left'>"+arr+"<br></div>";
  834. });
  835. return html;
  836. case "unit_range":
  837. data[key].forEach(r=>{
  838. html += '<span class="small">'+r+'<br></span>';
  839. });
  840. return html;
  841. case "other_unit_range":
  842. data[key].forEach(r=>{
  843. html += '<span class="small">'+r+'<br></span>';
  844. });
  845. return html;
  846. }
  847. return html+= data[key]+"</div>";
  848. },
  849. logisticDataFormat(tar){
  850. let obj={};
  851. tar.details.forEach(item => {
  852. if (obj[item.province_id]){
  853. if (obj[item.province_id][item.city_id]){
  854. if (obj[item.province_id][item.city_id][item.unit_id]){
  855. obj[item.province_id][item.city_id][item.unit_id][item.range] = item;
  856. }else{
  857. let arr1={};
  858. arr1[item.range] = item;
  859. obj[item.province_id][item.city_id][item.unit_id] = arr1;
  860. }
  861. }else{
  862. let arr1={};
  863. arr1[item.range] = item;
  864. let arr2={};
  865. arr2[item.unit_id] = arr1;
  866. obj[item.province_id][item.city_id] = arr2;
  867. }
  868. }else{
  869. let arr1={};
  870. arr1[item.range] = item;
  871. let arr2={};
  872. arr2[item.unit_id] = arr1;
  873. let arr3={};
  874. arr3[item.city_id] = arr2;
  875. obj[item.province_id] = arr3;
  876. }
  877. });
  878. return obj;
  879. },
  880. logisticDataRestore(tar,type,items=[],count=0){
  881. if (count===4){
  882. tar["operation"] = type;
  883. items.push(tar);
  884. } else{
  885. count++;
  886. for (let key in tar){
  887. this.logisticDataRestore(tar[key],type,items,count);
  888. }
  889. }
  890. return items;
  891. },
  892. 这样(){
  893. let video = document.createElement("video");
  894. let canvas = document.createElement("canvas");
  895. let arr=["url1","url2","url3"];
  896. let result = [];
  897. arr.forEach(url=>{
  898. video.setAttribute('src',url);
  899. canvas.width = video.clientWidth+"px";
  900. canvas.height = video.clientHeight+"px";
  901. canvas.getContext("2d").drawImage(video,0,0,canvas.width,canvas.height);
  902. result.push(canvas.toDataURL("image/png"));
  903. });
  904. console.log(result);
  905. },
  906. },
  907. });
  908. </script>
  909. </body>
  910. </html>