test.blade.php 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769
  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. },
  378. system:{
  379. "C":[{usage_fee:"500"}],
  380. },
  381. mapping:{
  382. "storage":{
  383. "name":"名称",
  384. "counting_type":"计费类型",
  385. "using_type":"用仓类型",
  386. "minimum_area":"最低起租面积",
  387. "discount_type":"减免类型",
  388. "discount_value":"减免值",
  389. "unit_id":"单位",
  390. "time_unit_id":"计时单位",
  391. "amount_interval":"数量-单价",
  392. "tax_rate_id":"税率",
  393. },
  394. "operation":{
  395. name:"名称",
  396. operation_type:"作业类型",
  397. strategy:"策略",
  398. feature:"特征",
  399. total_price:"按单价",
  400. total_discount_price:"按单减免单价",
  401. discount_count:"减免值",
  402. type_mark:"类型",
  403. surcharge:"附加费",
  404. surcharge_unit_id:"附加费单位",
  405. max_fee:"封顶费",
  406. remark:"备注",
  407. tax_rate_id:"税率",
  408. child:{
  409. strategy:"子策略",
  410. amount:"起步数",
  411. unit_id:"单位",
  412. unit_price:"单价",
  413. feature:"特征",
  414. discount_price:"减免单价",
  415. odd_price:"零头价",
  416. }
  417. },
  418. "express":{
  419. name:"名称",
  420. initial_weight:"首重",
  421. additional_weight:"续重",
  422. weight_interval:"数量-重量",
  423. tax_rate_id:"税率",
  424. child:{
  425. province_id:"省",
  426. initial_weight_price:"初始单价",
  427. additional_weight_price:"续重单价",
  428. },
  429. },
  430. "logistic":{
  431. name:"名称",
  432. unit_id:"单位一",
  433. unit_range:"单位一区间",
  434. other_unit_id:"单位二",
  435. other_unit_range:"单位二区间",
  436. pick_up_price:"提货费",
  437. fuel_price:"燃油附加费",
  438. service_price:"服务费",
  439. tax_rate_id:"税率",
  440. child:{
  441. unit_id:"单位",
  442. range:"区间",
  443. province_id:"省份",
  444. city_id:"城市",
  445. unit_price:"单价",
  446. delivery_fee:"送货费",
  447. initial_fee:"起始计费",
  448. initial_amount:"起始计数",
  449. rate:"费率",
  450. },
  451. },
  452. },
  453. },
  454. selectedAudit:"logistic",
  455. poolMapping:{
  456. units:{1:"T",2:"G"},
  457. taxRates:{1:"2",2:"3"},
  458. }
  459. },
  460. mounted(){
  461. let temp = {"name":"名称"};
  462. let font = "<div class='float-left'><span class='float-left fa fa-arrow-right text-info ml-2 mr-2'></span>";
  463. this.auditList.storage.U.forEach(data=>{
  464. let tar = this.auditList.storage.H[data.target_id];
  465. for (let key in this.auditList.mapping.storage){
  466. if (String(data[key])!==String(tar[key])){
  467. if (!temp[key]) temp[key] = this.auditList.mapping.storage[key];
  468. data[key] = this.transformData(tar,key)+font+this.transformData(data,key,true)+"</div>";
  469. }else data[key] = this.transformData(data,key);
  470. }
  471. if (String(data["price"])!==String(tar["price"]) && String(data["amount_interval"])===String(tar["amount_interval"])){
  472. data["amount_interval"] = this.transformData(tar,"amount_interval")+font+this.transformData(data,"amount_interval",true)+"</div>";
  473. }
  474. });
  475. this.auditList.mapping.storage = temp;
  476. temp={"name":"名称",child:{strategy:"子策略"}};
  477. this.auditList.operation.U.forEach(data=>{
  478. let tar = this.auditList.operation.H[data.target_id];
  479. for (let key in this.auditList.mapping.operation){
  480. if (String(data[key])!==String(tar[key])){
  481. if (!temp[key]) temp[key] = this.auditList.mapping.operation[key];
  482. data[key] = this.transformData(tar,key)+font+this.transformData(data,key,true)+"</div>";
  483. }else data[key] = this.transformData(data,key);
  484. }
  485. let itemTem = {};
  486. tar.items.forEach(item=>{
  487. if (!itemTem[item.strategy])itemTem[item.strategy] = [];
  488. itemTem[item.strategy].push(item);
  489. });
  490. let items = [];
  491. let amount = 0;
  492. data.items.forEach(item=>{
  493. if (itemTem[item.strategy]){
  494. let mark = true;
  495. for (let i=0;i<itemTem[item.strategy].length;i++){
  496. for (let key in this.auditList.mapping.operation.child){
  497. let oldStr = itemTem[item.strategy][i][key];
  498. let newStr = item[key];
  499. if (String(newStr)!==String(oldStr)){
  500. mark = false;break;
  501. }
  502. }
  503. if (mark){
  504. item.operation = "H";
  505. itemTem[item.strategy].splice(i,1);
  506. if (itemTem[item.strategy].length===0)itemTem[item.strategy] = null;
  507. break;
  508. }
  509. }
  510. }//去重
  511. });
  512. data.items.forEach(item=>{
  513. if (item.operation!=='H'){
  514. if (!itemTem[item.strategy]){
  515. for (let key in this.auditList.mapping.operation.child)item[key] = this.transformData(item,key);
  516. item.operation = "C";
  517. items.unshift(item);
  518. amount++;
  519. }else{
  520. let tar = item.strategy;
  521. for (let key in this.auditList.mapping.operation.child){
  522. if (String(item[key])!==String(itemTem[tar][0][key])){
  523. if (!temp.child[key]) temp.child[key] = this.auditList.mapping.operation.child[key];
  524. item[key] = this.transformData(itemTem[tar][0],key)+font+this.transformData(item,key,true)+"</div>";
  525. }else item[key] = this.transformData(item,key);
  526. }
  527. item.operation = "U";
  528. items.push(item);
  529. itemTem[tar].splice(0,1);
  530. if (itemTem[tar].length===0) itemTem[tar] = null;
  531. }
  532. }
  533. });
  534. for (let key in itemTem){
  535. if (itemTem[key]){
  536. itemTem[key].forEach(item=>{
  537. for (let key in this.auditList.mapping.operation.child)item[key] = this.transformData(item,key);
  538. item.operation = "D";
  539. items.splice(amount,0,item);
  540. amount++;
  541. });
  542. }
  543. }
  544. data.items = items;
  545. });
  546. this.auditList.mapping.operation = temp;
  547. temp={"name":"名称",child:{province_id:"省"}};
  548. this.auditList.express.U.forEach(data=> {
  549. let tar = this.auditList.express.H[data.target_id];
  550. for (let key in this.auditList.mapping.express) {
  551. if (String(data[key]) !== String(tar[key])) {
  552. if (!temp[key]) temp[key] = this.auditList.mapping.express[key];
  553. data[key] = this.transformData(tar, key) + font + this.transformData(data, key, true) + "</div>";
  554. } else data[key] = this.transformData(data, key);
  555. if (String(data["amount_interval"])!==String(tar["amount_interval"]) && String(data["weight_interval"])===String(tar["weight_interval"])){
  556. data["weight_interval"] = this.transformData(tar,"weight_interval")+font+this.transformData(data,"weight_interval",true)+"</div>";
  557. }
  558. }
  559. let itemTem = {};
  560. tar.details.forEach(item => {itemTem[item.province_id] = item;});
  561. let items = [];
  562. let amount = 0;
  563. data.details.forEach(item=>{
  564. if (!itemTem[item.province_id]){
  565. for (let key in this.auditList.mapping.express.child)item[key] = this.transformData(item,key);
  566. item.operation = "C";
  567. items.unshift(item);
  568. amount++;
  569. }else{
  570. let mark = true;
  571. for (let key in this.auditList.mapping.express.child){
  572. if (String(item[key])!==String(itemTem[item.province_id][key])){
  573. mark = false;break;
  574. }
  575. }
  576. if (!mark){
  577. let tar = item.province_id;
  578. for (let key in this.auditList.mapping.express.child) {
  579. if (String(item[key]) !== String(itemTem[tar][key])) {
  580. if (!temp.child[key]) temp.child[key] = this.auditList.mapping.express.child[key];
  581. item[key] = this.transformData(itemTem[tar], key) + font + this.transformData(item, key, true) + "</div>";
  582. } else item[key] = this.transformData(item, key);
  583. }
  584. item.operation = "U";
  585. items.push(item);
  586. delete itemTem[tar];
  587. }else delete itemTem[item.province_id];
  588. }
  589. });
  590. for (let key in itemTem){
  591. for (let k in this.auditList.mapping.express.child)itemTem[key][k] = this.transformData(itemTem[key],k);
  592. itemTem[key].operation = "D";
  593. items.splice(amount,0,itemTem[key]);
  594. amount++;
  595. }
  596. data.details = items;
  597. });
  598. this.auditList.mapping.express = temp;
  599. temp={name:"名称",child:{province_id:"省份",city_id:"城市"}};
  600. this.auditList.logistic.U.forEach(data=> {
  601. let tar = this.auditList.logistic.H[data.target_id];
  602. for (let key in this.auditList.mapping.logistic) {
  603. if (String(data[key]) !== String(tar[key])) {
  604. if (!temp[key]) temp[key] = this.auditList.mapping.logistic[key];
  605. data[key] = this.transformData(tar, key) + font + this.transformData(data, key, true) + "</div>";
  606. } else data[key] = this.transformData(data, key);
  607. }
  608. let itemTem = this.logisticDataFormat(tar);
  609. let dataTem = this.logisticDataFormat(data);
  610. let items = [];
  611. console.log(itemTem,dataTem)
  612. for (let key in itemTem){
  613. if (dataTem[key]){
  614. for (let key2 in itemTem[key]){
  615. if (dataTem[key][key2]){
  616. for (let key3 in itemTem[key][key2]){
  617. if (dataTem[key][key2][key3]){
  618. for (let key4 in itemTem[key][key2][key3]){
  619. if (dataTem[key][key2][key3][key4]){
  620. let mark = true;
  621. for (let key5 in this.auditList.mapping.logistic.child){
  622. if (String(dataTem[key][key2][key3][key4][key5]) !== String(itemTem[key][key2][key3][key4][key5])){
  623. if (!temp.child[key5]) temp.child[key5] = this.auditList.mapping.logistic.child[key5];
  624. mark=false;
  625. if (!temp.child[key5]) temp.child[key5] = this.auditList.mapping.logistic.child[key5];
  626. 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>";
  627. } else dataTem[key][key2][key3][key4][key5] = this.transformData(dataTem[key][key2][key3][key4], key5);
  628. }
  629. if (!mark){
  630. dataTem[key][key2][key3][key4].operation = "U";
  631. items.push(dataTem[key][key2][key3][key4])
  632. }
  633. delete dataTem[key][key2][key3][key4];
  634. delete itemTem[key][key2][key3][key4];
  635. }
  636. }
  637. }
  638. }
  639. }
  640. }
  641. }
  642. }
  643. dataTem = this.logisticDataRestore(dataTem,"C");
  644. dataTem.push.apply(dataTem,this.logisticDataRestore(itemTem,"D"));
  645. dataTem.push.apply(dataTem,items);
  646. data.details = dataTem;
  647. console.log(data.details)
  648. });
  649. this.auditList.mapping.logistic = temp;
  650. },
  651. methods:{
  652. transformData(data,key,font=false){
  653. if (!data[key])return;
  654. let html = '<div class="float-left small ';
  655. if (font)html += "text-primary font-weight-bold";
  656. else html += "text-secondary";
  657. html+='">';
  658. switch (key) {
  659. case "amount_interval":
  660. data[key].forEach((am,i)=>{
  661. if (i!==data[key].length-1) html += "<span>"+am+"-"+data[key][i+1]+"("+data["price"][i]+"元)<br></span>";
  662. });
  663. html += "<span>"+data[key][data[key].length-1]+" +("+data["price"][data[key].length-1]+"元)<br></span></div>";
  664. return html;
  665. case "total_discount_price":
  666. data[key].forEach(am=>{
  667. html += '<span>'+am+'元<br></span>'
  668. });
  669. return html+"</div>";
  670. case "discount_price":
  671. data[key].forEach(am=>{
  672. html += '<span>'+am+'元<br></span>'
  673. });
  674. return html+"</div>";
  675. case "discount_count":
  676. data[key].forEach((am,i)=>{
  677. if (i!==data[key].length-1)html += '<span>'+am+'-'+data[key][i+1]+'<br></span>'
  678. });
  679. html += '<span>'+data[key][data[key].length-1]+'&nbsp;+<br></span>';
  680. return html+"</div>";
  681. case "weight_interval":
  682. data[key].forEach((arr,i)=>{
  683. if (i!==data[key].length-1) html += '<span>'+data.amount_interval[i]+'-'+data.amount_interval[i+1]+'/单(';
  684. arr.forEach((w,j)=>{
  685. if (j!==arr.length-1)html += w+'-'+arr[j+1]+'/KG,';
  686. });
  687. html += (arr[arr.length-1] ? arr[arr.length-1] : 0)+'&nbsp;+/KG)<br></span>';
  688. });
  689. html += '<span>'+data.amount_interval[data.amount_interval.length-1]+'&nbsp;+/单(';
  690. let arr = data.weight_interval[data.weight_interval.length-1];
  691. arr.forEach((w,j)=>{
  692. if (j!==arr.length-1)html += w+'-'+arr[j+1]+'/KG,';
  693. });
  694. html += (arr[arr.length-1] ? arr[arr.length-1] : 0)+'&nbsp;+/KG)<br></span>';
  695. return html;
  696. case "initial_weight_price":
  697. data[key].forEach(arr=>{
  698. html += "<div class='float-left'>"+arr+"<br></div>";
  699. });
  700. return html;
  701. case "additional_weight_price":
  702. data[key].forEach(arr=>{
  703. html += "<div class='float-left'>"+arr+"<br></div>";
  704. });
  705. return html;
  706. case "unit_range":
  707. data[key].forEach(r=>{
  708. html += '<span class="small">'+r+'<br></span>';
  709. });
  710. return html;
  711. case "other_unit_range":
  712. data[key].forEach(r=>{
  713. html += '<span class="small">'+r+'<br></span>';
  714. });
  715. return html;
  716. }
  717. return html+= data[key]+"</div>";
  718. },
  719. logisticDataFormat(tar){
  720. let obj={};
  721. tar.details.forEach(item => {
  722. if (obj[item.province_id]){
  723. if (obj[item.province_id][item.city_id]){
  724. if (obj[item.province_id][item.city_id][item.unit_id]){
  725. obj[item.province_id][item.city_id][item.unit_id][item.range] = item;
  726. }else{
  727. let arr1={};
  728. arr1[item.range] = item;
  729. obj[item.province_id][item.city_id][item.unit_id] = arr1;
  730. }
  731. }else{
  732. let arr1={};
  733. arr1[item.range] = item;
  734. let arr2={};
  735. arr2[item.unit_id] = arr1;
  736. obj[item.province_id][item.city_id] = arr2;
  737. }
  738. }else{
  739. let arr1={};
  740. arr1[item.range] = item;
  741. let arr2={};
  742. arr2[item.unit_id] = arr1;
  743. let arr3={};
  744. arr3[item.city_id] = arr2;
  745. obj[item.province_id] = arr3;
  746. }
  747. });
  748. return obj;
  749. },
  750. logisticDataRestore(tar,type,items=[],count=0){
  751. if (count===4){
  752. tar["operation"] = type;
  753. items.push(tar);
  754. } else{
  755. count++;
  756. for (let key in tar){
  757. this.logisticDataRestore(tar[key],type,items,count);
  758. }
  759. }
  760. return items;
  761. }
  762. },
  763. });
  764. </script>
  765. </body>
  766. </html>