test.blade.php 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785
  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-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'" 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-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.C">
  210. <div><b>@{{ s.name }}</b><span class="text-muted">(起步:@{{ s.base_km }}KM)</span></div>
  211. </div>
  212. <div v-if="selectedAudit=='system'" v-for="s in auditList.system.C">
  213. <div>使用费:<b>@{{ s.usage_fee }}</b></div>
  214. </div>
  215. </div>
  216. </div>
  217. <div class="row">
  218. <label class="col-1 text-right h4"><span class="badge badge-primary">修改</span></label>
  219. <label class="col-1 h3 text-primary" style="bottom: 0.25rem">
  220. <span class="fa fa-long-arrow-right"></span>
  221. </label>
  222. <div class="col-10">
  223. <div v-if="selectedAudit=='storage'" v-for="s in auditList.storage.U">
  224. <table class="table table-sm">
  225. <tr>
  226. <th v-for="(val,key) in auditList.mapping.storage">@{{ val }}</th>
  227. </tr>
  228. <tr>
  229. <td v-for="(val,key) in auditList.mapping.storage" v-html="s[key]"></td>
  230. </tr>
  231. </table>
  232. </div>
  233. <div v-if="selectedAudit=='operation'" v-for="s in auditList.operation.U">
  234. <table class="table table-sm">
  235. <tr>
  236. <th v-for="(val,key) in auditList.mapping.operation" v-if="key!='child'">@{{ val }}</th>
  237. <th v-if="s.items.length>0" class="text-center">子项</th>
  238. </tr>
  239. <tr>
  240. <td v-for="(val,key) in auditList.mapping.operation" v-if="key!='child'" v-html="s[key]"></td>
  241. <td v-if="s.items.length>0">
  242. <table class="table table-sm">
  243. <tr><th v-for="(val,key) in auditList.mapping.operation.child">@{{ val }}</th></tr>
  244. <tr v-for="item in s.items">
  245. <td v-for="(val,key) in auditList.mapping.operation.child" v-html="item[key]"></td>
  246. </tr>
  247. </table>
  248. </td>
  249. </tr>
  250. </table>
  251. </div>
  252. <div v-if="selectedAudit=='express'" v-for="s in auditList.express.U">
  253. <table class="table table-sm">
  254. <tr>
  255. <th v-for="(val,key) in auditList.mapping.express" v-if="key!='child'">@{{ val }}</th>
  256. <th v-if="s.details.length>0" class="text-center">子项</th>
  257. </tr>
  258. <tr>
  259. <td v-for="(val,key) in auditList.mapping.express" v-if="key!='child'" v-html="s[key]"></td>
  260. <td v-if="s.details.length>0">
  261. <table class="table table-sm">
  262. <tr><th v-for="(val,key) in auditList.mapping.express.child">@{{ val }}</th></tr>
  263. <tr v-for="item in s.details">
  264. <td v-for="(val,key) in auditList.mapping.express.child" v-html="item[key]"></td>
  265. </tr>
  266. </table>
  267. </td>
  268. </tr>
  269. </table>
  270. </div>
  271. <div v-if="selectedAudit=='logistic'" v-for="s in auditList.logistic.U">
  272. <table class="table table-sm">
  273. <tr>
  274. <th v-for="(val,key) in auditList.mapping.logistic" v-if="key!='child'">@{{ val }}</th>
  275. <th v-if="s.details.length>0" class="text-center">子项</th>
  276. </tr>
  277. <tr>
  278. <td v-for="(val,key) in auditList.mapping.logistic" v-if="key!='child'" v-html="s[key]"></td>
  279. <td v-if="s.details.length>0">
  280. <table class="table table-sm">
  281. <tr><th v-for="(val,key) in auditList.mapping.logistic.child">@{{ val }}</th></tr>
  282. <tr v-for="item in s.details">
  283. <td v-for="(val,key) in auditList.mapping.logistic.child" v-html="item[key]"></td>
  284. </tr>
  285. </table>
  286. </td>
  287. </tr>
  288. </table>
  289. </div>
  290. <div v-if="selectedAudit=='directLogistic'" v-for="s in auditList.directLogistic.C">
  291. <div><b>@{{ s.name }}</b><span class="text-muted">(起步:@{{ s.base_km }}KM)</span></div>
  292. </div>
  293. <div v-if="selectedAudit=='system'" v-for="s in auditList.system.C">
  294. <div>使用费:<b>@{{ s.usage_fee }}</b></div>
  295. </div>
  296. </div>
  297. </div>
  298. </div>
  299. <div class="modal-footer">
  300. </div>
  301. </div>
  302. </div>
  303. </div>
  304. <script type="text/javascript" src="{{mix("js/app.js")}}"></script>
  305. <script type="text/javascript">
  306. function a(){
  307. $("#auditOrRecover").modal("show");
  308. }
  309. new Vue({
  310. el:"#auditOrRecover",
  311. data:{
  312. auditList:{
  313. storage:{
  314. "C":[{name:"笕尚退货",counting_type:"包仓",using_type:"恒温"},{name:"笕尚退货",counting_type:"包仓",using_type:"恒温"}],
  315. "U":[{name:"笕尚退货",counting_type:"包仓",using_type:"恒温",
  316. minimum_area:"200",price:["0.2"],discount_type:"无减免",target_id:"10",
  317. discount_value:"20",unit_id:"1",time_unit_id:"2",tax_rate_id:"1",amount_interval:["2"]}],
  318. "D":[{name:"笕尚退货",counting_type:"包仓",using_type:"恒温",
  319. minimum_area:"200",price:["0.2","0.1"],discount_type:"无减免",
  320. discount_value:"20",unit_id:"m²",time_unit_id:"日",tax_rate_id:"3",amount_interval:["2","5"]}],
  321. "H":{10:{name:"笕尚退货",counting_type:"包仓",using_type:"恒温",
  322. minimum_area:"200",price:["0.1","0.2"],discount_type:"无减免",
  323. discount_value:"20",unit_id:"2",time_unit_id:"1",tax_rate_id:"2",amount_interval:["2","5"]}},
  324. },
  325. operation:{
  326. "C":[{name:"笕尚入库",operation_type:"入库",strategy:"特征"},{name:"笕尚入库",operation_type:"入库",strategy:"特征"}],
  327. "D":[{name:"笕尚入库",operation_type:"入库",strategy:"特征",
  328. feature:"特征X",remark:"x",discount_count:[1,2],total_price:"222",total_discount_price:[1,2,3,4]
  329. ,type_mark:"退货单",surcharge:"58",surcharge_unit_id:"米",max_fee:"777",tax_rate_id:"5%"}],
  330. "U":[{name:"笕尚入库",operation_type:"入库",strategy:"特征",
  331. feature:"特征X",remark:"x",discount_count:[1,2],total_price:"222",total_discount_price:[1,2,3,4]
  332. ,type_mark:"退货单",surcharge:"58",surcharge_unit_id:"米",max_fee:"777",tax_rate_id:"5%",target_id:"10",
  333. 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"},
  334. {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"},]}],
  335. "H":{10:{name:"笕尚入库1",operation_type:"入库",strategy:"特征",
  336. feature:"特征X",remark:"x",discount_count:[1,2,5],total_price:"222",total_discount_price:[1,2,4]
  337. ,type_mark:"退货单",surcharge:"58",surcharge_unit_id:"T",max_fee:"7771",tax_rate_id:"3%",
  338. 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"},
  339. {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"},
  340. {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"},
  341. ]}},
  342. },
  343. express:{
  344. "C":[{name:"笕尚快递"}],
  345. "D":[{name:"笕尚快递",initial_weight:"包仓",additional_weight:"恒温",
  346. amount_interval:[2,5],
  347. weight_interval:[[10,20],[]],tax_rate_id:"5%"}],
  348. "U":[{name:"笕尚快递",initial_weight:"1",additional_weight:"3",
  349. amount_interval:[2,5],
  350. weight_interval:[[10,20],[]],tax_rate_id:"5%",target_id:10,
  351. details:[{province_id:"河南",initial_weight_price:[[4]],additional_weight_price:[[5]]}]}],
  352. "H":{10:{name:"笕尚快递",initial_weight:"1",additional_weight:"2",
  353. amount_interval:[2,5],
  354. weight_interval:[[10,20],[]],tax_rate_id:"5%",
  355. details:[{province_id:"河南",initial_weight_price:[[5]],additional_weight_price:[[5]]}]}},
  356. },
  357. logistic:{
  358. "C":[{name:"笕尚物流"}],
  359. "D":[{name:"笕尚物流",unit_range:["0-5","5-10"],unit_id:"5",other_unit_range:["0-5","5-10"],other_unit_id:"T"
  360. ,pick_up_price:"222",fuel_price:"22",service_price:"34",tax_rate_id:"6%",details:[
  361. {unit_id:"T",range:"0-10",province_id:"河北",city_id:"石家庄",unit_price:"22",delivery_fee:"170",
  362. rate:"20%"},
  363. ]}],
  364. "U":[{name:"笕尚物流",unit_range:["0-5","5-10"],unit_id:"5",other_unit_range:["0-5","5-10"],other_unit_id:"T"
  365. ,pick_up_price:"222",fuel_price:"22",service_price:"34",tax_rate_id:"6%",target_id:10,details:[
  366. {unit_id:"T",range:"0-10",province_id:"河北",city_id:"石家庄",unit_price:"22",delivery_fee:"170",
  367. rate:"20%"},
  368. ]}],
  369. "H":{10:{name:"笕尚物流",unit_range:["0-5","5-10"],unit_id:"5",other_unit_range:["0-5","5-10"],other_unit_id:"T"
  370. ,pick_up_price:"222",fuel_price:"22",service_price:"34",tax_rate_id:"6%",details:[
  371. {unit_id:"T",range:"0-10",province_id:"河北",city_id:"石家庄",unit_price:"22",delivery_fee:"170",
  372. rate:"21%"},
  373. ]}},
  374. },
  375. directLogistic:{
  376. "C":[{name:"笕尚直发",base_km:"10"}],
  377. "D":[{name:"笕尚直发",base_km:"10",tax_rate_id:"3%"}],
  378. "U":[{name:"笕尚直发",base_km:"10",tax_rate_id:"3%",target_id:"10",details:[
  379. {car_type_id:"碰碰车",base_fee:"30",additional_fee:"50"}
  380. ]}],
  381. "H":{10:{name:"笕尚直发",base_km:"10",tax_rate_id:"3%",details:[
  382. {car_type_id:"碰碰车",base_fee:"30",additional_fee:"50"}
  383. ]}},
  384. },
  385. system:{
  386. "C":[{usage_fee:"500"}],
  387. },
  388. mapping:{
  389. "storage":{
  390. "name":"名称",
  391. "counting_type":"计费类型",
  392. "using_type":"用仓类型",
  393. "minimum_area":"最低起租面积",
  394. "discount_type":"减免类型",
  395. "discount_value":"减免值",
  396. "unit_id":"单位",
  397. "time_unit_id":"计时单位",
  398. "amount_interval":"数量-单价",
  399. "tax_rate_id":"税率",
  400. },
  401. "operation":{
  402. name:"名称",
  403. operation_type:"作业类型",
  404. strategy:"策略",
  405. feature:"特征",
  406. total_price:"按单价",
  407. total_discount_price:"按单减免单价",
  408. discount_count:"减免值",
  409. type_mark:"类型",
  410. surcharge:"附加费",
  411. surcharge_unit_id:"附加费单位",
  412. max_fee:"封顶费",
  413. remark:"备注",
  414. tax_rate_id:"税率",
  415. child:{
  416. strategy:"子策略",
  417. amount:"起步数",
  418. unit_id:"单位",
  419. unit_price:"单价",
  420. feature:"特征",
  421. discount_price:"减免单价",
  422. odd_price:"零头价",
  423. }
  424. },
  425. "express":{
  426. name:"名称",
  427. initial_weight:"首重",
  428. additional_weight:"续重",
  429. weight_interval:"数量-重量",
  430. tax_rate_id:"税率",
  431. child:{
  432. province_id:"省",
  433. initial_weight_price:"初始单价",
  434. additional_weight_price:"续重单价",
  435. },
  436. },
  437. "logistic":{
  438. name:"名称",
  439. unit_id:"单位一",
  440. unit_range:"单位一区间",
  441. other_unit_id:"单位二",
  442. other_unit_range:"单位二区间",
  443. pick_up_price:"提货费",
  444. fuel_price:"燃油附加费",
  445. service_price:"服务费",
  446. tax_rate_id:"税率",
  447. child:{
  448. unit_id:"单位",
  449. range:"区间",
  450. province_id:"省份",
  451. city_id:"城市",
  452. unit_price:"单价",
  453. delivery_fee:"送货费",
  454. initial_fee:"起始计费",
  455. initial_amount:"起始计数",
  456. rate:"费率",
  457. },
  458. },
  459. "directLogistic":{
  460. name:"名称",
  461. base_km:"起步公里数",
  462. tax_rate_id:"税率",
  463. child:{
  464. car_type_id:"车型",
  465. base_fee:"起步费",
  466. additional_fee:"续费(元/KM)"
  467. }
  468. }
  469. },
  470. },
  471. selectedAudit:"logistic",
  472. poolMapping:{
  473. units:{1:"T",2:"G"},
  474. taxRates:{1:"2",2:"3"},
  475. }
  476. },
  477. mounted(){
  478. let temp = {"name":"名称"};
  479. let font = "<div class='float-left'><span class='float-left fa fa-arrow-right text-info ml-2 mr-2'></span>";
  480. this.auditList.storage.U.forEach(data=>{
  481. let tar = this.auditList.storage.H[data.target_id];
  482. for (let key in this.auditList.mapping.storage){
  483. if (String(data[key])!==String(tar[key])){
  484. if (!temp[key]) temp[key] = this.auditList.mapping.storage[key];
  485. data[key] = this.transformData(tar,key)+font+this.transformData(data,key,true)+"</div>";
  486. }else data[key] = this.transformData(data,key);
  487. }
  488. if (String(data["price"])!==String(tar["price"]) && String(data["amount_interval"])===String(tar["amount_interval"])){
  489. data["amount_interval"] = this.transformData(tar,"amount_interval")+font+this.transformData(data,"amount_interval",true)+"</div>";
  490. }
  491. });
  492. this.auditList.mapping.storage = temp;
  493. temp={"name":"名称",child:{strategy:"子策略"}};
  494. this.auditList.operation.U.forEach(data=>{
  495. let tar = this.auditList.operation.H[data.target_id];
  496. for (let key in this.auditList.mapping.operation){
  497. if (String(data[key])!==String(tar[key])){
  498. if (!temp[key]) temp[key] = this.auditList.mapping.operation[key];
  499. data[key] = this.transformData(tar,key)+font+this.transformData(data,key,true)+"</div>";
  500. }else data[key] = this.transformData(data,key);
  501. }
  502. let itemTem = {};
  503. tar.items.forEach(item=>{
  504. if (!itemTem[item.strategy])itemTem[item.strategy] = [];
  505. itemTem[item.strategy].push(item);
  506. });
  507. let items = [];
  508. let amount = 0;
  509. data.items.forEach(item=>{
  510. if (itemTem[item.strategy]){
  511. let mark = true;
  512. for (let i=0;i<itemTem[item.strategy].length;i++){
  513. for (let key in this.auditList.mapping.operation.child){
  514. let oldStr = itemTem[item.strategy][i][key];
  515. let newStr = item[key];
  516. if (String(newStr)!==String(oldStr)){
  517. mark = false;break;
  518. }
  519. }
  520. if (mark){
  521. item.operation = "H";
  522. itemTem[item.strategy].splice(i,1);
  523. if (itemTem[item.strategy].length===0)itemTem[item.strategy] = null;
  524. break;
  525. }
  526. }
  527. }//去重
  528. });
  529. data.items.forEach(item=>{
  530. if (item.operation!=='H'){
  531. if (!itemTem[item.strategy]){
  532. for (let key in this.auditList.mapping.operation.child)item[key] = this.transformData(item,key);
  533. item.operation = "C";
  534. items.unshift(item);
  535. amount++;
  536. }else{
  537. let tar = item.strategy;
  538. for (let key in this.auditList.mapping.operation.child){
  539. if (String(item[key])!==String(itemTem[tar][0][key])){
  540. if (!temp.child[key]) temp.child[key] = this.auditList.mapping.operation.child[key];
  541. item[key] = this.transformData(itemTem[tar][0],key)+font+this.transformData(item,key,true)+"</div>";
  542. }else item[key] = this.transformData(item,key);
  543. }
  544. item.operation = "U";
  545. items.push(item);
  546. itemTem[tar].splice(0,1);
  547. if (itemTem[tar].length===0) itemTem[tar] = null;
  548. }
  549. }
  550. });
  551. for (let key in itemTem){
  552. if (itemTem[key]){
  553. itemTem[key].forEach(item=>{
  554. for (let key in this.auditList.mapping.operation.child)item[key] = this.transformData(item,key);
  555. item.operation = "D";
  556. items.splice(amount,0,item);
  557. amount++;
  558. });
  559. }
  560. }
  561. data.items = items;
  562. });
  563. this.auditList.mapping.operation = temp;
  564. temp={"name":"名称",child:{province_id:"省"}};
  565. this.auditList.express.U.forEach(data=> {
  566. let tar = this.auditList.express.H[data.target_id];
  567. for (let key in this.auditList.mapping.express) {
  568. if (String(data[key]) !== String(tar[key])) {
  569. if (!temp[key]) temp[key] = this.auditList.mapping.express[key];
  570. data[key] = this.transformData(tar, key) + font + this.transformData(data, key, true) + "</div>";
  571. } else data[key] = this.transformData(data, key);
  572. if (String(data["amount_interval"])!==String(tar["amount_interval"]) && String(data["weight_interval"])===String(tar["weight_interval"])){
  573. data["weight_interval"] = this.transformData(tar,"weight_interval")+font+this.transformData(data,"weight_interval",true)+"</div>";
  574. }
  575. }
  576. let itemTem = {};
  577. tar.details.forEach(item => {itemTem[item.province_id] = item;});
  578. let items = [];
  579. let amount = 0;
  580. data.details.forEach(item=>{
  581. if (!itemTem[item.province_id]){
  582. for (let key in this.auditList.mapping.express.child)item[key] = this.transformData(item,key);
  583. item.operation = "C";
  584. items.unshift(item);
  585. amount++;
  586. }else{
  587. let mark = true;
  588. for (let key in this.auditList.mapping.express.child){
  589. if (String(item[key])!==String(itemTem[item.province_id][key])){
  590. mark = false;break;
  591. }
  592. }
  593. if (!mark){
  594. let tar = item.province_id;
  595. for (let key in this.auditList.mapping.express.child) {
  596. if (String(item[key]) !== String(itemTem[tar][key])) {
  597. if (!temp.child[key]) temp.child[key] = this.auditList.mapping.express.child[key];
  598. item[key] = this.transformData(itemTem[tar], key) + font + this.transformData(item, key, true) + "</div>";
  599. } else item[key] = this.transformData(item, key);
  600. }
  601. item.operation = "U";
  602. items.push(item);
  603. delete itemTem[tar];
  604. }else delete itemTem[item.province_id];
  605. }
  606. });
  607. for (let key in itemTem){
  608. for (let k in this.auditList.mapping.express.child)itemTem[key][k] = this.transformData(itemTem[key],k);
  609. itemTem[key].operation = "D";
  610. items.splice(amount,0,itemTem[key]);
  611. amount++;
  612. }
  613. data.details = items;
  614. });
  615. this.auditList.mapping.express = temp;
  616. temp={name:"名称",child:{province_id:"省份",city_id:"城市"}};
  617. this.auditList.logistic.U.forEach(data=> {
  618. let tar = this.auditList.logistic.H[data.target_id];
  619. for (let key in this.auditList.mapping.logistic) {
  620. if (String(data[key]) !== String(tar[key])) {
  621. if (!temp[key]) temp[key] = this.auditList.mapping.logistic[key];
  622. data[key] = this.transformData(tar, key) + font + this.transformData(data, key, true) + "</div>";
  623. } else data[key] = this.transformData(data, key);
  624. }
  625. let itemTem = this.logisticDataFormat(tar);
  626. let dataTem = this.logisticDataFormat(data);
  627. let items = [];
  628. for (let key in itemTem){
  629. if (dataTem[key]){
  630. for (let key2 in itemTem[key]){
  631. if (dataTem[key][key2]){
  632. for (let key3 in itemTem[key][key2]){
  633. if (dataTem[key][key2][key3]){
  634. for (let key4 in itemTem[key][key2][key3]){
  635. if (dataTem[key][key2][key3][key4]){
  636. let mark = true;
  637. for (let key5 in this.auditList.mapping.logistic.child){
  638. if (String(dataTem[key][key2][key3][key4][key5]) !== String(itemTem[key][key2][key3][key4][key5])){
  639. if (!temp.child[key5]) temp.child[key5] = this.auditList.mapping.logistic.child[key5];
  640. mark=false;
  641. if (!temp.child[key5]) temp.child[key5] = this.auditList.mapping.logistic.child[key5];
  642. 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>";
  643. } else dataTem[key][key2][key3][key4][key5] = this.transformData(dataTem[key][key2][key3][key4], key5);
  644. }
  645. if (!mark){
  646. dataTem[key][key2][key3][key4].operation = "U";
  647. items.push(dataTem[key][key2][key3][key4])
  648. }
  649. delete dataTem[key][key2][key3][key4];
  650. delete itemTem[key][key2][key3][key4];
  651. }
  652. }
  653. }
  654. }
  655. }
  656. }
  657. }
  658. }
  659. dataTem = this.logisticDataRestore(dataTem,"C");
  660. dataTem.push.apply(dataTem,this.logisticDataRestore(itemTem,"D"));
  661. dataTem.push.apply(dataTem,items);
  662. data.details = dataTem;
  663. });
  664. this.auditList.mapping.logistic = temp;
  665. temp={name:"名称",child:{car_type_id:"车型"}};
  666. },
  667. methods:{
  668. transformData(data,key,font=false){
  669. if (!data[key])return;
  670. let html = '<div class="float-left small ';
  671. if (font)html += "text-primary font-weight-bold";
  672. else html += "text-secondary";
  673. html+='">';
  674. switch (key) {
  675. case "amount_interval":
  676. data[key].forEach((am,i)=>{
  677. if (i!==data[key].length-1) html += "<span>"+am+"-"+data[key][i+1]+"("+data["price"][i]+"元)<br></span>";
  678. });
  679. html += "<span>"+data[key][data[key].length-1]+" +("+data["price"][data[key].length-1]+"元)<br></span></div>";
  680. return html;
  681. case "total_discount_price":
  682. data[key].forEach(am=>{
  683. html += '<span>'+am+'元<br></span>'
  684. });
  685. return html+"</div>";
  686. case "discount_price":
  687. data[key].forEach(am=>{
  688. html += '<span>'+am+'元<br></span>'
  689. });
  690. return html+"</div>";
  691. case "discount_count":
  692. data[key].forEach((am,i)=>{
  693. if (i!==data[key].length-1)html += '<span>'+am+'-'+data[key][i+1]+'<br></span>'
  694. });
  695. html += '<span>'+data[key][data[key].length-1]+'&nbsp;+<br></span>';
  696. return html+"</div>";
  697. case "weight_interval":
  698. data[key].forEach((arr,i)=>{
  699. if (i!==data[key].length-1) html += '<span>'+data.amount_interval[i]+'-'+data.amount_interval[i+1]+'/单(';
  700. arr.forEach((w,j)=>{
  701. if (j!==arr.length-1)html += w+'-'+arr[j+1]+'/KG,';
  702. });
  703. html += (arr[arr.length-1] ? arr[arr.length-1] : 0)+'&nbsp;+/KG)<br></span>';
  704. });
  705. html += '<span>'+data.amount_interval[data.amount_interval.length-1]+'&nbsp;+/单(';
  706. let arr = data.weight_interval[data.weight_interval.length-1];
  707. arr.forEach((w,j)=>{
  708. if (j!==arr.length-1)html += w+'-'+arr[j+1]+'/KG,';
  709. });
  710. html += (arr[arr.length-1] ? arr[arr.length-1] : 0)+'&nbsp;+/KG)<br></span>';
  711. return html;
  712. case "initial_weight_price":
  713. data[key].forEach(arr=>{
  714. html += "<div class='float-left'>"+arr+"<br></div>";
  715. });
  716. return html;
  717. case "additional_weight_price":
  718. data[key].forEach(arr=>{
  719. html += "<div class='float-left'>"+arr+"<br></div>";
  720. });
  721. return html;
  722. case "unit_range":
  723. data[key].forEach(r=>{
  724. html += '<span class="small">'+r+'<br></span>';
  725. });
  726. return html;
  727. case "other_unit_range":
  728. data[key].forEach(r=>{
  729. html += '<span class="small">'+r+'<br></span>';
  730. });
  731. return html;
  732. }
  733. return html+= data[key]+"</div>";
  734. },
  735. logisticDataFormat(tar){
  736. let obj={};
  737. tar.details.forEach(item => {
  738. if (obj[item.province_id]){
  739. if (obj[item.province_id][item.city_id]){
  740. if (obj[item.province_id][item.city_id][item.unit_id]){
  741. obj[item.province_id][item.city_id][item.unit_id][item.range] = item;
  742. }else{
  743. let arr1={};
  744. arr1[item.range] = item;
  745. obj[item.province_id][item.city_id][item.unit_id] = arr1;
  746. }
  747. }else{
  748. let arr1={};
  749. arr1[item.range] = item;
  750. let arr2={};
  751. arr2[item.unit_id] = arr1;
  752. obj[item.province_id][item.city_id] = arr2;
  753. }
  754. }else{
  755. let arr1={};
  756. arr1[item.range] = item;
  757. let arr2={};
  758. arr2[item.unit_id] = arr1;
  759. let arr3={};
  760. arr3[item.city_id] = arr2;
  761. obj[item.province_id] = arr3;
  762. }
  763. });
  764. return obj;
  765. },
  766. logisticDataRestore(tar,type,items=[],count=0){
  767. if (count===4){
  768. tar["operation"] = type;
  769. items.push(tar);
  770. } else{
  771. count++;
  772. for (let key in tar){
  773. this.logisticDataRestore(tar[key],type,items,count);
  774. }
  775. }
  776. return items;
  777. }
  778. },
  779. });
  780. </script>
  781. </body>
  782. </html>