newReport.vue 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058
  1. <template>
  2. <view class="content">
  3. <view class="status_bar"></view>
  4. <view class="top-nav">
  5. <uni-icons class="back" type="back" size="25" @click="back"></uni-icons>
  6. <view class="right" :class="index==2?'nav-active':''" @click="navClick(2)">
  7. 新季
  8. </view>
  9. <view class="left" :class="index==1?'nav-active':''" @click="navClick(1)">
  10. 全部
  11. </view>
  12. </view>
  13. <view class="content1 content-item">
  14. <view class="title">
  15. 收支核算
  16. </view>
  17. <uni-transition ref="ani" custom-class="transition" :mode-class="modeClass" :styles="styles"
  18. :show="isSHowContent1">
  19. <u-line color="#EEEEEE" />
  20. <view class="row1 mtb40">
  21. <view class="left">
  22. <view class="">
  23. {{ym1Change}}
  24. </view>
  25. <view class="" style="font-size: 12px; color:#9E9E9E; margin-top: 10rpx;">
  26. 单位:万元
  27. </view>
  28. </view>
  29. <view class="right" v-if="index!=2">
  30. <text class="text" :class="textIndex==1?'text-active':''" @click="accounting(1)">
  31. 按月
  32. </text>
  33. <text class="text" :class="textIndex==2?'text-active':''" @click="accounting(2)">按年</text>
  34. </view>
  35. </view>
  36. <view class="row2" @click='godetail(2)'>
  37. <view class="text">
  38. 收入(万元)
  39. </view>
  40. <view class="price">
  41. {{sr?Number(sr).toFixed(2):0}}
  42. </view>
  43. </view>
  44. <view class="row3" @click='godetail(2)'>
  45. <view class="left">
  46. <view class="text">
  47. 支出(万元)
  48. </view>
  49. <view class="number">
  50. {{zc?Number(zc).toFixed(2):0}}
  51. </view>
  52. </view>
  53. <view class="center">
  54. </view>
  55. <view class="right">
  56. <view class="text">
  57. 差额(万元)
  58. </view>
  59. <view class="number">
  60. {{Number(sr-zc).toFixed(2)}}
  61. </view>
  62. </view>
  63. </view>
  64. <view class="row5 flex alc">
  65. <view class="left">
  66. <text class="point-left flex alc"></text>收入(万元):<text
  67. class="text-left">{{Number(sr).toFixed(2)}}</text>
  68. <!-- <text class="point-left flex alc"></text>收入(万元):<text class="text-left">2000.00</text> -->
  69. </view>
  70. <view class="right">
  71. <text class="point-right"></text>支出(万元):<text
  72. class="text-right">{{Number(zc).toFixed(2)}}</text>
  73. <!-- <text class="point-left flex alc"></text>收入(万元):<text class="text-left">2000.00</text> -->
  74. </view>
  75. </view>
  76. <view class="row4">
  77. <qiun-data-charts type="area" :opts="opts" :chartData="chartData" :ontouch="true"
  78. @getIndex="getIndex" />
  79. </view>
  80. </uni-transition>
  81. <view class="zd flex alc" @click="foldClcik('fade',1)">
  82. {{this.isSHowContent1?'点击收起':'点击展开'}}
  83. <image v-if="this.isSHowContent1" src="../../static/sq.png" mode="widthFix"
  84. style="width: 30rpx;margin-left: 10rpx;"></image>
  85. <image v-else src="../../static/zk.png" mode="widthFix" style="width: 30rpx;margin-left: 10rpx;">
  86. </image>
  87. </view>
  88. </view>
  89. <view class="content2 content-item">
  90. <view class="title">
  91. 合同数据
  92. </view>
  93. <uni-transition ref="ani" custom-class="transition" :mode-class="modeClass" :styles="styles"
  94. :show="isSHowContent2">
  95. <u-line color="#EEEEEE" />
  96. <view class="row1 flex jcsb" style="margin-top: 40rpx;">
  97. <view class="left title-lv2">
  98. 数量统计
  99. </view>
  100. <view @click='godetail(0)' class="right-btn" style="position: relative;z-index: 999;">
  101. 合同明细
  102. </view>
  103. </view>
  104. <!-- <view class="row2 flex jcse">
  105. <view class="left flex alc">
  106. <view class="color1"></view>
  107. <text class="text">{{index==1?'过去12个月累计签订数量':'本季累计签订合同数量'}}</text>
  108. </view>
  109. <view class="right flex alc">
  110. <view class="color2"></view>
  111. <text class="text">{{index==1?'当前执行中数量':'本季执行中数量'}}</text>
  112. </view>
  113. </view> -->
  114. <view class="row3">
  115. <qiun-data-charts type="bar" :opts="opts2" :chartData="chartData1" />
  116. </view>
  117. <view class="row4 flex jcsb mtb40">
  118. <view class="left title-lv2">
  119. 利润核算
  120. </view>
  121. <view @click='godetail(1)' class="right-btn">
  122. 利润明细
  123. </view>
  124. </view>
  125. <view class="row5">
  126. <view class="left flex">
  127. <view class="" v-if="index==1">
  128. <u-icon name="arrow-left" size="26" style="margin-right: 10rpx;" color="#969696"
  129. @click="yearClick('1')">
  130. </u-icon>
  131. <text @click="showYear=true">{{year}}年</text>
  132. <u-icon name="arrow-right" size="26" style="margin-left: 10rpx;"
  133. :color="nowYear!=year?'#969696':'#DBDBDB'" @click="yearClick('2')" v-if="nowYear!=year">
  134. </u-icon>
  135. <u-icon name="arrow-right" size="26" style="margin-left: 10rpx;"
  136. :color="nowYear!=year?'#969696':'#DBDBDB'" v-if="nowYear==year">
  137. </u-icon>
  138. </view>
  139. <view class="" v-else>
  140. 新季利润
  141. </view>
  142. </view>
  143. <view class="right">
  144. 单位:元
  145. </view>
  146. </view>
  147. <view class="row6" v-if="isHaveData3">
  148. <qiun-data-charts type="column" :opts="opts3" :chartData="chartData3" />
  149. </view>
  150. </uni-transition>
  151. <view class="zd flex alc" @click="foldClcik('fade',2)">
  152. {{this.isSHowContent2?'点击收起':'点击展开'}}
  153. <image v-if="this.isSHowContent2" src="../../static/sq.png" mode="widthFix"
  154. style="width: 30rpx;margin-left: 10rpx;"></image>
  155. <image v-else src="../../static/zk.png" mode="widthFix" style="width: 30rpx;margin-left: 10rpx;">
  156. </image>
  157. </view>
  158. </view>
  159. <view class="content3 content-item">
  160. <view class="title flex jcsb">
  161. <view class="">
  162. 仓储数据
  163. </view>
  164. <view @click='goToPage(5)' class="right-btn">
  165. 库存明细
  166. </view>
  167. </view>
  168. <uni-transition ref="ani" custom-class="transition" :mode-class="modeClass" :styles="styles"
  169. :show="isSHowContent3">
  170. <u-line color="#EEEEEE" />
  171. <view class="row1 flex jcsb mtb40">
  172. <view class="left title-lv2">
  173. 库存储量
  174. </view>
  175. <view class="right">
  176. 单位:吨
  177. </view>
  178. </view>
  179. <view class="row2">
  180. <view class="" v-for="(item,index) in clList">
  181. <view class="name">
  182. {{item.name}}
  183. </view>
  184. <view class="bottom flex alc jcsb">
  185. <u-line-progress :percent="item.percent" :active-color="color4(index)" :show-percent='false'
  186. class='left' height='12'>
  187. </u-line-progress>
  188. <view class="weight">
  189. {{item.weight}}
  190. </view>
  191. </view>
  192. </view>
  193. <!-- <qiun-data-charts type="bar" :opts="opts4" :chartData="chartData4" :ontouch="true" /> -->
  194. </view>
  195. <view class="row3">
  196. <view class="list-item flex jcsb" v-for="(item,index) in InventoryList">
  197. <view class="flex alc">
  198. <image :src="item.src" mode="widthFix" style="width: 40rpx;margin-right: 20rpx;"></image>
  199. <text style="color:#707575;">{{item.name}}</text>
  200. </view>
  201. <view class="number">
  202. {{item.number}}
  203. </view>
  204. </view>
  205. </view>
  206. <view class="row5 flex jcsb mtb40">
  207. <view class="left title-lv2">
  208. 当期货值
  209. </view>
  210. <view class="right">
  211. 单位:万元
  212. </view>
  213. </view>
  214. <view class="row6">
  215. <qiun-data-charts type="column" :opts="opts5" :chartData="chartData5" :ontouch="true" />
  216. </view>
  217. <view class="row7">
  218. <view class="left title-lv2" style="margin: 30rpx;">
  219. 平均成本
  220. </view>
  221. <view class="list-item" v-for="item in averageCostList">
  222. <view class="flex jcsb alc">
  223. <view class="left" style="color: #7A7A7A;">
  224. {{item.name}}
  225. </view>
  226. <view class="">
  227. {{Number(item.result).toFixed(0)}}
  228. </view>
  229. </view>
  230. </view>
  231. </view>
  232. </uni-transition>
  233. <view class="zd flex alc" @click="foldClcik('fade',3)">
  234. {{this.isSHowContent3?'点击收起':'点击展开'}}
  235. <image v-if="this.isSHowContent3" src="../../static/sq.png" mode="widthFix"
  236. style="width: 30rpx;margin-left: 10rpx;"></image>
  237. <image v-else src="../../static/zk.png" mode="widthFix" style="width: 30rpx;margin-left: 10rpx;">
  238. </image>
  239. </view>
  240. </view>
  241. <view class="content4 content-item">
  242. <view class="title flex jcsb">
  243. <view class="">
  244. 今日入库
  245. </view>
  246. <view @click='godetail(3)' class="right-btn">
  247. 入库明细
  248. </view>
  249. </view>
  250. <uni-transition ref="ani" custom-class="transition" :mode-class="modeClass" :styles="styles"
  251. :show="isSHowContent4">
  252. <u-line color="#EEEEEE" />
  253. <view class="" style="color: #9E9E9E;margin: 30rpx 0 0 30rpx; font-size: 12px;">
  254. 单位:吨
  255. </view>
  256. <view class="flex alc">
  257. <view class="" style="width:40%;height: 160px;">
  258. <qiun-data-charts type="ring" :opts="opts6" :chartData="chartData6" class='opts6' />
  259. </view>
  260. <view class="zt-right">
  261. <view class="flex jcsb alc" v-for="item in rkList" style="font-weight: 700;">
  262. <view class="left">
  263. <text :style="item.style"></text>{{item.name}}
  264. </view>
  265. <view class="right">
  266. {{Number(item.value).toFixed(2)}}
  267. </view>
  268. </view>
  269. </view>
  270. </view>
  271. </uni-transition>
  272. <view class="zd flex alc" @click="foldClcik('fade',4)">
  273. {{this.isSHowContent4?'点击收起':'点击展开'}}
  274. <image v-if="this.isSHowContent4" src="../../static/sq.png" mode="widthFix"
  275. style="width: 30rpx;margin-left: 10rpx;"></image>
  276. <image v-else src="../../static/zk.png" mode="widthFix" style="width: 30rpx;margin-left: 10rpx;">
  277. </image>
  278. </view>
  279. </view>
  280. <view class="content5 content-item">
  281. <view class="title">
  282. 在途数据
  283. </view>
  284. <uni-transition ref="ani" custom-class="transition" :mode-class="modeClass" :styles="styles"
  285. :show="isSHowContent5">
  286. <u-line color="#EEEEEE" />
  287. <view class="row1 days-nav">
  288. <view class="item" :class="carIndex==index?'item-active':''" v-for="(item, index) in dayList"
  289. @click="clickNav(index)">
  290. {{item}}
  291. </view>
  292. </view>
  293. <view class="flex alc">
  294. <view class="" style="width:40%;height: 160px;">
  295. <qiun-data-charts type="ring" :opts="opts7" :chartData="chartData7" />
  296. </view>
  297. <view class="zt-right">
  298. <view class="flex jcsb alc" v-for="item in ztList" style="font-weight: 700;">
  299. <view class="left">
  300. <text :style="item.style"></text>{{item.name}}
  301. </view>
  302. <view class="right">
  303. {{item.value}}
  304. </view>
  305. </view>
  306. </view>
  307. </view>
  308. </uni-transition>
  309. <view class="zd flex alc" @click="foldClcik('fade',5)">
  310. {{this.isSHowContent5?'点击收起':'点击展开'}}
  311. <image v-if="this.isSHowContent5" src="../../static/sq.png" mode="widthFix"
  312. style="width: 30rpx;margin-left: 10rpx;"></image>
  313. <image v-else src="../../static/zk.png" mode="widthFix" style="width: 30rpx;margin-left: 10rpx;">
  314. </image>
  315. </view>
  316. </view>
  317. <view class="content6 content-item">
  318. <view class="title">
  319. 用户增长
  320. </view>
  321. <uni-transition ref="ani" custom-class="transition" :mode-class="modeClass" :styles="styles"
  322. :show="isSHowContent6">
  323. <u-line color="#EEEEEE" />
  324. <view class="row1 flex jcsb" style="padding:0 12rpx 0 5rpx;">
  325. <view class="left">
  326. app注册
  327. </view>
  328. <view class="right">
  329. <text>合计:</text>
  330. <text style="color: #EC6666;">{{appTotal}}</text>
  331. <text>人</text>
  332. </view>
  333. </view>
  334. <view class="row2">
  335. <qiun-data-charts type="area" :opts="opts8" :chartData="chartData8" />
  336. </view>
  337. <view class="row1 flex jcsb" style="margin-top: 90rpx;padding:0 12rpx 0 5rpx;">
  338. <view class="left">
  339. 粮脉入驻
  340. </view>
  341. <view class="right">
  342. <text>合计:</text>
  343. <text style="color: #22C572;">{{lmTotal}}</text>
  344. <text>人</text>
  345. </view>
  346. </view>
  347. <view class="row2">
  348. <qiun-data-charts type="area" :opts="opts9" :chartData="chartData9" />
  349. </view>
  350. </uni-transition>
  351. <view class="zd flex alc" @click="foldClcik('fade',6)">
  352. {{this.isSHowContent6?'点击收起':'点击展开'}}
  353. <image v-if="this.isSHowContent6" src="../../static/sq.png" mode="widthFix"
  354. style="width: 30rpx;margin-left: 10rpx;"></image>
  355. <image v-else src="../../static/zk.png" mode="widthFix" style="width: 30rpx;margin-left: 10rpx;">
  356. </image>
  357. </view>
  358. </view>
  359. <u-picker v-model="showYear" mode="selector" :range="selector" :default-selector="[2]"></u-picker>
  360. </view>
  361. </template>
  362. <script>
  363. export default {
  364. data() {
  365. return {
  366. rkList: [],
  367. ztList: [],
  368. ztColor: ['#38CA80', '#8D9EE9', '#FFBB6E'],
  369. color: ['#FFBB6E', '#8D9EE9', '#FF8B95', '#38CA80', '#FFDD85', "#1890FF", "#91CB74", "#FAC858", "#EE6666",
  370. "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
  371. "#ea7ccc"
  372. ],
  373. clList: [],
  374. isHaveData3: true,
  375. val: 1000,
  376. carIndex: 0,
  377. appTotal: '',
  378. lmTotal: '',
  379. ym1: '',
  380. ym1Change: '',
  381. sr: '',
  382. zc: '',
  383. seachYear: '',
  384. seachMoth: '2022-10-10',
  385. dayList: ['1天', '7天', '30天'],
  386. averageCostList: [{
  387. name: '玉米',
  388. number: '2000.00'
  389. },
  390. {
  391. name: '玉米(潮粮)',
  392. number: '2000.00'
  393. },
  394. {
  395. name: '高粱',
  396. number: '2000.00'
  397. },
  398. {
  399. name: '高粱(潮粮)',
  400. number: '2000.00'
  401. },
  402. {
  403. name: '小麦',
  404. number: '2000.00'
  405. },
  406. {
  407. name: '大豆',
  408. number: '2000.00'
  409. },
  410. ],
  411. InventoryList: [{
  412. name: '合计储量',
  413. number: '1000.00',
  414. src: '../../static/img/cl.png'
  415. }, {
  416. name: '采购待执行',
  417. number: '1000.00',
  418. src: '../../static/img/cg.png'
  419. },
  420. {
  421. name: '销待执行售',
  422. number: '1000.00',
  423. src: '../../static/img/xs.png'
  424. },
  425. {
  426. name: '头寸',
  427. number: '1000.00',
  428. src: '../../static/img/tc.png'
  429. },
  430. ],
  431. year: 2022,
  432. selector: [2020, 2021, 2022],
  433. showYear: false,
  434. iconName1: 'arrow-up',
  435. iconName2: 'arrow-up',
  436. iconName3: 'arrow-up',
  437. iconName4: 'arrow-up',
  438. iconName5: 'arrow-up',
  439. iconName6: 'arrow-up',
  440. styles: {},
  441. modeClass: 'fade',
  442. isSHowContent1: true,
  443. isSHowContent2: true,
  444. isSHowContent3: true,
  445. isSHowContent4: true,
  446. isSHowContent5: true,
  447. isSHowContent6: true,
  448. chartData: {},
  449. chartData1: {},
  450. chartData3: {},
  451. chartData4: {},
  452. chartData5: {},
  453. chartData6: {},
  454. chartData7: {},
  455. chartData8: {},
  456. chartData9: {},
  457. opts: {
  458. enableScroll: true,
  459. color: ["#E84A55", "#22C572"],
  460. padding: [15, 15, 0, 15],
  461. dataPointShapeType: "hollow",
  462. legend: {
  463. show: false
  464. },
  465. xAxis: {
  466. gridType: "dash",
  467. disableGrid: true,
  468. itemCount: 6,
  469. },
  470. yAxis: {
  471. // gridType: "dash",
  472. gridType: 'solid',
  473. gridColor: "#E9E9E9",
  474. splitNumber: 5,
  475. data: [{
  476. // disabled: true,
  477. axisLine: false,
  478. fontColor: "#BEBEBE",
  479. textAlign: 'right'
  480. }],
  481. },
  482. extra: {
  483. area: {
  484. type: "straight",
  485. opacity: 0.3,
  486. addLine: true,
  487. width: 2,
  488. gradient: true
  489. },
  490. tooltip: {
  491. showBox: false,
  492. showArrow: true,
  493. showCategory: false,
  494. borderWidth: 0,
  495. borderRadius: 0,
  496. borderColor: "#000000",
  497. borderOpacity: 0.7,
  498. bgColor: "#000000",
  499. bgOpacity: 0.7,
  500. gridType: "dash",
  501. dashLength: 4,
  502. gridColor: "#E9E9E9",
  503. fontColor: "#FFFFFF",
  504. splitLine: true,
  505. horizentalLine: false,
  506. xAxisLabel: false,
  507. yAxisLabel: false,
  508. labelBgColor: "#FFFFFF",
  509. labelBgOpacity: 0.7,
  510. labelFontColor: "#666666"
  511. }
  512. },
  513. },
  514. opts2: {
  515. color: ["#D2F3E2", "#22C572"],
  516. padding: [15, 20, 0, 5],
  517. legend: {
  518. fontSize: 12,
  519. position: 'top',
  520. itemGap: 20,
  521. padding: 20
  522. },
  523. xAxis: {
  524. boundaryGap: "justify",
  525. disableGrid: false,
  526. axisLine: false,
  527. gridType: "dash",
  528. dashLength: 10,
  529. },
  530. extra: {
  531. // tooltip: {
  532. // showBox: false,
  533. // },
  534. bar: {
  535. type: "group",
  536. width: 10,
  537. meterBorde: 1,
  538. meterFillColor: "#FFFFFF",
  539. activeBgColor: "#000000",
  540. activeBgOpacity: 0.08,
  541. // linearType: "custom",
  542. barBorderCircle: true,
  543. seriesGap: 2,
  544. categoryGap: 6
  545. }
  546. }
  547. },
  548. opts3: {
  549. color: ["#8D9EE9"],
  550. padding: [15, 15, 0, 5],
  551. legend: {
  552. show: false
  553. },
  554. xAxis: {
  555. disableGrid: true,
  556. gridType: "dash",
  557. },
  558. yAxis: {
  559. gridType: "dash",
  560. data: [{
  561. min: 0,
  562. fontColor: '#BEBEBE',
  563. textAlign: 'right'
  564. }]
  565. },
  566. extra: {
  567. column: {
  568. type: "group",
  569. width: 15,
  570. activeBgColor: "#000000",
  571. activeBgOpacity: 0.08,
  572. linearType: "custom",
  573. seriesGap: 5,
  574. linearOpacity: 0.5,
  575. barBorderCircle: true,
  576. customColor: [
  577. "#8D9EE9",
  578. "#8D9EE9"
  579. ]
  580. }
  581. }
  582. },
  583. opts4: {
  584. enableScroll: true,
  585. color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
  586. "#ea7ccc"
  587. ],
  588. padding: [15, 30, 0, 5],
  589. legend: {
  590. show: false,
  591. },
  592. xAxis: {
  593. boundaryGap: "justify",
  594. disableGrid: false,
  595. axisLine: false,
  596. itemCount: 4,
  597. },
  598. yAxis: {
  599. },
  600. extra: {
  601. bar: {
  602. type: "group",
  603. width: 15,
  604. meterBorde: 1,
  605. meterFillColor: "#FFFFFF",
  606. activeBgColor: "#000000",
  607. activeBgOpacity: 0.08,
  608. // linearType: "custom",
  609. barBorderCircle: true,
  610. seriesGap: 2,
  611. categoryGap: 6
  612. }
  613. }
  614. },
  615. opts5: {
  616. enableScroll: true,
  617. color: ["#8D9EE9"],
  618. padding: [15, 15, 0, 5],
  619. legend: {
  620. show: false,
  621. },
  622. xAxis: {
  623. disableGrid: true,
  624. itemCount: 4,
  625. gridType: "dash",
  626. },
  627. yAxis: {
  628. gridType: "dash",
  629. data: [{
  630. min: 0,
  631. fontColor: "#BEBEBE",
  632. axisLine: false
  633. }]
  634. },
  635. extra: {
  636. column: {
  637. type: "group",
  638. width: 15,
  639. activeBgColor: "#000000",
  640. activeBgOpacity: 0.08,
  641. // linearType: "custom",
  642. seriesGap: 5,
  643. // linearOpacity: 0.5,
  644. barBorderCircle: true,
  645. customColor: [
  646. "#8D9EE9",
  647. "#8D9EE9"
  648. ]
  649. }
  650. }
  651. },
  652. opts6: {
  653. dataLabel: false,
  654. rotate: false,
  655. rotateLock: false,
  656. color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
  657. "#ea7ccc"
  658. ],
  659. legend: {
  660. show: false,
  661. position: "right",
  662. lineHeight: 25
  663. },
  664. title: {
  665. name: "",
  666. fontSize: 15,
  667. color: "#666666"
  668. },
  669. subtitle: {
  670. name: "",
  671. fontSize: 25,
  672. color: "#7cb5ec"
  673. },
  674. extra: {
  675. ring: {
  676. ringWidth: 10,
  677. activeOpacity: 0.5,
  678. activeRadius: 10,
  679. offsetAngle: 0,
  680. labelWidth: 15,
  681. border: false,
  682. borderWidth: 3,
  683. borderColor: "#FFFFFF"
  684. }
  685. }
  686. },
  687. opts7: {
  688. dataLabel: false,
  689. rotate: false,
  690. rotateLock: false,
  691. color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
  692. "#ea7ccc"
  693. ],
  694. legend: {
  695. show: false,
  696. position: "right",
  697. lineHeight: 25
  698. },
  699. title: {
  700. name: "",
  701. fontSize: 15,
  702. color: "#666666"
  703. },
  704. subtitle: {
  705. name: "",
  706. fontSize: 25,
  707. color: "#7cb5ec"
  708. },
  709. extra: {
  710. ring: {
  711. ringWidth: 10,
  712. activeOpacity: 0.5,
  713. activeRadius: 10,
  714. offsetAngle: 0,
  715. labelWidth: 15,
  716. border: false,
  717. borderWidth: 3,
  718. borderColor: "#FFFFFF"
  719. }
  720. }
  721. },
  722. opts8: {
  723. color: ["#EC6666"],
  724. padding: [15, 15, 0, 15],
  725. legend: {
  726. show: false,
  727. },
  728. xAxis: {
  729. disableGrid: true
  730. },
  731. yAxis: {
  732. gridType: "dash",
  733. dashLength: 2,
  734. data: [{
  735. // disabled: true,
  736. axisLine: false,
  737. fontColor: "#BEBEBE",
  738. }],
  739. },
  740. extra: {
  741. area: {
  742. type: "curve",
  743. opacity: 0.2,
  744. addLine: true,
  745. width: 2,
  746. gradient: true
  747. },
  748. tooltip: {
  749. showBox: false,
  750. showArrow: true,
  751. showCategory: false,
  752. borderWidth: 0,
  753. borderRadius: 0,
  754. borderColor: "#000000",
  755. borderOpacity: 0.7,
  756. bgColor: "#000000",
  757. bgOpacity: 0.7,
  758. gridType: "dash",
  759. dashLength: 4,
  760. gridColor: "#E9E9E9",
  761. fontColor: "#FFFFFF",
  762. splitLine: true,
  763. horizentalLine: false,
  764. xAxisLabel: false,
  765. yAxisLabel: false,
  766. labelBgColor: "#FFFFFF",
  767. labelBgOpacity: 0.7,
  768. labelFontColor: "#666666"
  769. }
  770. }
  771. },
  772. opts9: {
  773. color: ["#22C572"],
  774. padding: [15, 15, 0, 15],
  775. legend: {
  776. show: false,
  777. },
  778. xAxis: {
  779. disableGrid: true
  780. },
  781. yAxis: {
  782. gridType: "dash",
  783. dashLength: 2,
  784. data: [{
  785. // disabled: true,
  786. axisLine: false,
  787. fontColor: "#BEBEBE",
  788. }],
  789. },
  790. extra: {
  791. area: {
  792. type: "curve",
  793. opacity: 0.2,
  794. addLine: true,
  795. width: 2,
  796. gradient: true
  797. },
  798. tooltip: {
  799. showBox: false,
  800. showArrow: true,
  801. showCategory: false,
  802. borderWidth: 0,
  803. borderRadius: 0,
  804. borderColor: "#000000",
  805. borderOpacity: 0.7,
  806. bgColor: "#000000",
  807. bgOpacity: 0.7,
  808. gridType: "dash",
  809. dashLength: 4,
  810. gridColor: "#E9E9E9",
  811. fontColor: "#FFFFFF",
  812. splitLine: true,
  813. horizentalLine: false,
  814. xAxisLabel: false,
  815. yAxisLabel: false,
  816. labelBgColor: "#FFFFFF",
  817. labelBgOpacity: 0.7,
  818. labelFontColor: "#666666"
  819. }
  820. }
  821. },
  822. textIndex: 1,
  823. index: 2,
  824. background: {
  825. backgroundColor: '#2E303A',
  826. backgroundColor: 'red',
  827. },
  828. nowYear: ''
  829. }
  830. },
  831. onLoad: function(option) {
  832. this.nowYear = new Date().getFullYear()
  833. },
  834. destroyed() {
  835. },
  836. onUnload() {
  837. },
  838. onReady() {
  839. this.getServerData();
  840. },
  841. methods: {
  842. color4(index) {
  843. console.log(index)
  844. index = index + 1
  845. switch (index) {
  846. case 1:
  847. return '#FFBB6E'
  848. case 2:
  849. return '#8D9EE9'
  850. case 3:
  851. return '#FF8B95'
  852. case 4:
  853. return '#38CA80'
  854. case 5:
  855. return '#FFDD85'
  856. case 6:
  857. return '#FFBB6E'
  858. case 7:
  859. return '#FFBB6E'
  860. case 8:
  861. return '#FFBB6E'
  862. case 9:
  863. return '#FFBB6E'
  864. case 10:
  865. return '#FFBB6E'
  866. }
  867. },
  868. goToPage(index) {
  869. uni.navigateTo({
  870. url: '/pages/user/contractLook/inventoryCost?searchMonth=' + this.seachMoth
  871. })
  872. },
  873. clickNav(index) {
  874. this.carIndex = index
  875. let _data = ""
  876. if (index == 0) {
  877. _data = 1
  878. } else if (index == 1) {
  879. _data = 7
  880. } else {
  881. _data = 30
  882. }
  883. this.$api.doRequest('get', '/biInfoController/getTranCountWai', {
  884. seachMoth: _data,
  885. }).then(res => {
  886. console.log(res.data)
  887. this.selectMakeDate7(res.data.data[0])
  888. })
  889. },
  890. yearClick(type) {
  891. if (type == 1) {
  892. this.year--
  893. } else {
  894. this.year++
  895. }
  896. this.$api.doRequest('get', '/biInfoController/profitAccount', {
  897. compId: uni.getStorageSync('pcUserInfo').compId,
  898. seachYear: this.year,
  899. // biViewInfoList: {weight:''}
  900. }).then(res => {
  901. console.log("利润切换", res.data.data[0])
  902. // this.makeDate3(res.data[0])
  903. this.chartData3.series = [];
  904. let _categorieslr = []
  905. let _countlr = []
  906. if (res.data.data[0].biViewInfoList.length > 0) {
  907. for (let i = 0; i < res.data.data[0].biViewInfoList.length; i++) {
  908. _categorieslr.push(res.data.data[0].biViewInfoList[i].name)
  909. _countlr.push(res.data.data[0].biViewInfoList[i].weight ? res.data.data[0]
  910. .biViewInfoList[
  911. i].weight :
  912. 0)
  913. //利润核算
  914. }
  915. }
  916. let res3 = {
  917. categories: _categorieslr,
  918. series: [{
  919. name: "利润金额",
  920. data: _countlr
  921. }]
  922. };
  923. this.chartData3 = JSON.parse(JSON.stringify(res3));
  924. })
  925. },
  926. godetail(status) {
  927. var url = ''
  928. switch (status) {
  929. case 0:
  930. url = '/pages/dataReport/contractdetails/contractdetails'
  931. break;
  932. case 1:
  933. url = '/pages/dataReport/breakdownofprofit'
  934. break;
  935. case 2:
  936. url = '/pages/dataReport/costbreakdown?data=' + this.ym1 + '&type=' + this.index
  937. break;
  938. case 3:
  939. url = '/pages/dataReport/Inventoryentrydetails'
  940. break;
  941. }
  942. uni.navigateTo({
  943. url: url
  944. })
  945. },
  946. foldClcik(type, index) {
  947. switch (index) {
  948. case 1:
  949. this.isSHowContent1 = !this.isSHowContent1
  950. this.iconName1 = this.isSHowContent1 ? "arrow-up" : 'arrow-down'
  951. break;
  952. case 2:
  953. this.isSHowContent2 = !this.isSHowContent2
  954. this.iconName2 = this.isSHowContent2 ? "arrow-up" : 'arrow-down'
  955. break;
  956. case 3:
  957. this.isSHowContent3 = !this.isSHowContent3
  958. this.iconName3 = this.isSHowContent3 ? "arrow-up" : 'arrow-down'
  959. break;
  960. case 4:
  961. this.isSHowContent4 = !this.isSHowContent4
  962. this.iconName4 = this.isSHowContent4 ? "arrow-up" : 'arrow-down'
  963. break;
  964. case 5:
  965. this.isSHowContent5 = !this.isSHowContent5
  966. this.iconName5 = this.isSHowContent5 ? "arrow-up" : 'arrow-down'
  967. break;
  968. case 6:
  969. this.isSHowContent6 = !this.isSHowContent6
  970. this.iconName6 = this.isSHowContent6 ? "arrow-up" : 'arrow-down'
  971. break;
  972. }
  973. this.modeClass = type
  974. },
  975. getIndex(e) {
  976. console.log(e)
  977. // 点击图表
  978. if (this.textIndex == 1) {
  979. this.ym1 = this.chartList[0].biViewInfoList[e.currentIndex.index].name
  980. this.ym1Change = this.chartList[0].biViewInfoList[e.currentIndex.index].name.replace(/-/g, ".");
  981. this.sr = this.chartList[0].biViewInfoList[e.currentIndex.index].weight
  982. this.zc = this.chartList[2].biViewInfoList[e.currentIndex.index].weight
  983. } else {
  984. this.ym1 = this.chartList[1].biViewInfoList[e.currentIndex.index].name
  985. this.ym1Change = this.chartList[1].biViewInfoList[e.currentIndex.index].name.replace(/-/g, ".");
  986. this.sr = this.chartList[1].biViewInfoList[e.currentIndex.index].weight
  987. this.zc = this.chartList[3].biViewInfoList[e.currentIndex.index].weight
  988. }
  989. },
  990. makeYData(max) {
  991. if (max <= 100) {
  992. return Math.ceil(max * 1.05 / 20) * 20
  993. } else if (max <= 1000) {
  994. return Math.ceil(max * 1.05 / 100) * 100
  995. } else if (max > 1000) {
  996. console.log(111)
  997. return Math.ceil(max * 1.05 / 500) * 500
  998. }
  999. // Math.ceil(_max * 1.05 / 500) * 500
  1000. },
  1001. makeDate1(val) {
  1002. console.log("val", val)
  1003. // 按月1
  1004. let _categories = []
  1005. let _price1 = []
  1006. let _price2 = []
  1007. this.chartData.series = [];
  1008. // 设置x轴数据
  1009. let _ySRPriceMax = 0
  1010. let _yZCPriceMax = 0
  1011. let _max = 0
  1012. if (this.textIndex == 1) {
  1013. if (val[0].biViewInfoList && val[0].biViewInfoList.length > 0) {
  1014. for (let i = 0; i < val[0].biViewInfoList.length; i++) {
  1015. val[0].biViewInfoList[i].weight = Number(val[0].biViewInfoList[i].weight).toFixed(2)
  1016. _price1.push(val[0].biViewInfoList[i].weight)
  1017. }
  1018. //月收入最大值
  1019. _ySRPriceMax = Math.max(..._price1)
  1020. for (let i = 0; i < val[2].biViewInfoList.length; i++) {
  1021. val[2].biViewInfoList[i].weight = Number(val[2].biViewInfoList[i].weight).toFixed(2)
  1022. _price2.push(val[2].biViewInfoList[i].weight)
  1023. _categories.push(new Date(val[2].biViewInfoList[i].name).getMonth() + 1)
  1024. }
  1025. //月收入最大值
  1026. _yZCPriceMax = Math.max(..._price2)
  1027. // 判断收入支出最大值构建y坐标轴刻度
  1028. _max = _ySRPriceMax > _yZCPriceMax ? _ySRPriceMax : _yZCPriceMax
  1029. this.ym1 = val[0].biViewInfoList[val[0].biViewInfoList.length - 1].name
  1030. this.ym1Change = val[0].biViewInfoList[val[0].biViewInfoList.length - 1].name.replace(/-/g, ".");
  1031. this.sr = val[0].biViewInfoList[val[0].biViewInfoList.length - 1].weight
  1032. this.zc = val[2].biViewInfoList[val[2].biViewInfoList.length - 1].weight
  1033. }
  1034. } else {
  1035. if (val[1].biViewInfoList && val[1].biViewInfoList.length > 0) {
  1036. this.ym1Change = val[1].biViewInfoList[val[1].biViewInfoList.length - 1].name.replace(/-/g, ".");
  1037. this.ym1 = val[1].biViewInfoList[val[1].biViewInfoList.length - 1].name
  1038. this.sr = val[1].biViewInfoList[val[1].biViewInfoList.length - 1].weight
  1039. this.zc = val[3].biViewInfoList[val[3].biViewInfoList.length - 1].weight
  1040. for (let i = 0; i < val[1].biViewInfoList.length; i++) {
  1041. _categories.push(val[1].biViewInfoList[i].name)
  1042. _price1.push(val[1].biViewInfoList[i].weight)
  1043. }
  1044. for (let i = 0; i < val[3].biViewInfoList.length; i++) {
  1045. _price2.push(val[3].biViewInfoList[i].weight)
  1046. }
  1047. }
  1048. _max = _price1 > _price2 ? _price1 : _price2
  1049. }
  1050. let res = {
  1051. categories: _categories,
  1052. series: [{
  1053. name: "收入",
  1054. data: _price1,
  1055. textColor: "transparent"
  1056. }, {
  1057. name: "支出",
  1058. data: _price2,
  1059. textColor: "transparent"
  1060. }
  1061. ]
  1062. };
  1063. // this.opts.yAxis.data[0].max = Math.ceil(_max / 1000) * 1000
  1064. // 处理y轴最大值
  1065. console.log("max1", _max)
  1066. let _newMax = this.makeYData(_max)
  1067. console.log('max1', _newMax)
  1068. // this.opts.yAxis.data[0].max = Math.ceil(_max * 1.05 / 500) * 500
  1069. this.opts.yAxis.data[0].max = _newMax
  1070. this.chartData = JSON.parse(JSON.stringify(res));
  1071. },
  1072. makeDate2(val) {
  1073. let _categories = []
  1074. let _count1 = []
  1075. let _count2 = []
  1076. let _xMax1 = 0
  1077. let _xMax2 = 0
  1078. let _max = 0
  1079. if (val[4].biViewInfoList && val[4].biViewInfoList.length > 0) {
  1080. for (let i = 0; i < val[4].biViewInfoList.length; i++) {
  1081. _categories.push(val[4].biViewInfoList[i].name.substring(0, 2))
  1082. _count1.push(Number(val[4].biViewInfoList[i].weight).toFixed(0))
  1083. _count2.push(val[4].biViewInfoList[i].count ? Number(val[4].biViewInfoList[i].count).toFixed(0) :
  1084. 0)
  1085. }
  1086. }
  1087. _xMax1 = Math.max(..._count1)
  1088. _xMax2 = Math.max(..._count2)
  1089. _max = _xMax1 > _xMax2 ? _xMax1 : _xMax2
  1090. console.log(_xMax1)
  1091. console.log(_xMax2)
  1092. // this.opts2.xAxis.max = Math.ceil(_max / 100) * 100
  1093. let _newMax = this.makeYData(_max)
  1094. console.log('max2', _newMax)
  1095. this.opts2.xAxis.max = _newMax
  1096. let res1 = {
  1097. categories: _categories,
  1098. series: [{
  1099. name: this.index == 1 ? '过去12个月累计签订数量' : '本季累计签订合同数量',
  1100. data: _count1,
  1101. legendShape: "circle",
  1102. textColor: "transparent"
  1103. },
  1104. {
  1105. name: this.index == 1 ? '当前执行中数量' : '本季执行中数量',
  1106. data: _count2,
  1107. legendShape: "circle",
  1108. textColor: "transparent"
  1109. }
  1110. ]
  1111. };
  1112. this.chartData1 = JSON.parse(JSON.stringify(res1));
  1113. },
  1114. makeDate3(val) {
  1115. let _max = 0
  1116. let _categorieslr = []
  1117. let _countlr = []
  1118. if (val[5].biViewInfoList.length > 0) {
  1119. for (let i = 0; i < val[5].biViewInfoList.length; i++) {
  1120. _categorieslr.push(val[5].biViewInfoList[i].name.substring(0, 2))
  1121. _countlr.push(val[5].biViewInfoList[i].weight ? val[5].biViewInfoList[i].weight : 0)
  1122. }
  1123. _max = Math.max(..._countlr)
  1124. } else {
  1125. this.isHaveData3 = false
  1126. }
  1127. let _newMax = this.makeYData(_max)
  1128. console.log('max3', _newMax)
  1129. this.opts3.yAxis.data[0].max = _newMax
  1130. //利润核算
  1131. let res3 = {
  1132. categories: _categorieslr,
  1133. series: [{
  1134. name: "利润金额",
  1135. data: _countlr
  1136. }]
  1137. };
  1138. this.chartData3 = JSON.parse(JSON.stringify(res3));
  1139. },
  1140. makeDate4(val) {
  1141. let _categorieslr = []
  1142. let _countlr = []
  1143. // this.clList =
  1144. let _weightList = []
  1145. let _maxWeight = ''
  1146. if (val[8].biViewInfoList && val[8].biViewInfoList.length > 0) {
  1147. for (let i = 0; i < val[8].biViewInfoList.length; i++) {
  1148. _weightList.push(Number(val[8].biViewInfoList[i].weight).toFixed(0) ? Number(val[8].biViewInfoList[
  1149. i]
  1150. .weight).toFixed(0) : 0)
  1151. }
  1152. _maxWeight = Math.max(..._weightList) + Math.max(..._weightList) * 0.05
  1153. for (let i = 0; i < val[8].biViewInfoList.length; i++) {
  1154. let _obj = {
  1155. percent: Number(val[8].biViewInfoList[i].weight).toFixed(0) / _maxWeight * 100,
  1156. name: val[8].biViewInfoList[i].name,
  1157. weight: Number(val[8].biViewInfoList[i].weight).toFixed(0)
  1158. }
  1159. console.log("库存储量", _obj)
  1160. this.clList.push(_obj)
  1161. // _categorieslr.push(val[8].biViewInfoList[i].name)
  1162. // _countlr.push(Number(val[8].biViewInfoList[i].weight).toFixed(0) ? Number(val[8]
  1163. // .biViewInfoList[i]
  1164. // .weight).toFixed(0) : 0)
  1165. }
  1166. }
  1167. // let res4 = {
  1168. // categories: _categorieslr,
  1169. // series: [{
  1170. // name: '库存储量',
  1171. // data: _countlr
  1172. // }]
  1173. // };
  1174. // this.chartData4 = JSON.parse(JSON.stringify(res4));
  1175. let _tc = Number(val[6].biViewInfoList[0].count) + Number(val[6].biViewInfoList[1].count) - Number(
  1176. val[6].biViewInfoList[2].count)
  1177. this.InventoryList = [{
  1178. name: '合计储量',
  1179. number: Number(val[6].biViewInfoList[0].count).toFixed(3),
  1180. src: '../../static/img/cl.png'
  1181. }, {
  1182. name: '采购待执行',
  1183. number: Number(val[6].biViewInfoList[1].count).toFixed(3),
  1184. src: '../../static/img/cg.png'
  1185. },
  1186. {
  1187. name: '销待执行售',
  1188. number: Number(val[6].biViewInfoList[2].count).toFixed(3),
  1189. src: '../../static/img/xs.png'
  1190. },
  1191. {
  1192. name: '头寸',
  1193. number: Number(_tc).toFixed(3),
  1194. src: '../../static/img/tc.png'
  1195. },
  1196. ]
  1197. },
  1198. makeDate5(val) {
  1199. let _max = 0
  1200. let _categorieslr = []
  1201. let _count = []
  1202. let count = []
  1203. if (val[7].biViewInfoList && val[9].biViewInfoList.length > 0) {
  1204. for (let i = 0; i < val[9].biViewInfoList.length; i++) {
  1205. let _obj = {
  1206. value: Number(val[9].biViewInfoList[i].weight ? val[9].biViewInfoList[i].weight : 0)
  1207. .toFixed(
  1208. 0),
  1209. color: this.color[i]
  1210. }
  1211. _categorieslr.push(val[9].biViewInfoList[i].name)
  1212. _count.push(_obj)
  1213. count.push(Number(val[9].biViewInfoList[i].weight ? val[9].biViewInfoList[i].weight : 0))
  1214. }
  1215. _max = Math.max(...count)
  1216. }
  1217. let _newMax = this.makeYData(_max)
  1218. console.log('max5', _newMax)
  1219. this.opts5.yAxis.data[0].max = _newMax
  1220. // data: [{
  1221. // value: 10000,
  1222. // color: "#FFBB6E"
  1223. // },
  1224. // {
  1225. // value: 40000,
  1226. // color: "#8D9EE9"
  1227. // }, {
  1228. // value: 70000,
  1229. // color: "#FF8B95"
  1230. // }, {
  1231. // value: 90000,
  1232. // color: "#38CA80"
  1233. // },
  1234. // {
  1235. // value: 100000,
  1236. // color: "#FFDD85"
  1237. // }
  1238. // ]
  1239. let res5 = {
  1240. categories: _categorieslr,
  1241. series: [{
  1242. name: "货值(万元)",
  1243. data: _count
  1244. }]
  1245. };
  1246. this.chartData5 = JSON.parse(JSON.stringify(res5));
  1247. this.averageCostList = val[9].biViewInfoList
  1248. },
  1249. makeDate6(val) {
  1250. let _data = []
  1251. if (val[10].biViewInfoList && val[10].biViewInfoList.length > 0) {
  1252. for (let i = 0; i < val[10].biViewInfoList.length; i++) {
  1253. let _obj = {
  1254. name: val[10].biViewInfoList[i].name,
  1255. value: val[10].biViewInfoList[i].weight,
  1256. color: this.color[i],
  1257. style: {
  1258. 'background': this.color[i],
  1259. 'border-radius': '50%',
  1260. 'width': '20rpx',
  1261. 'height': '20rpx',
  1262. 'display': 'inline-block',
  1263. 'margin-right': '10rpx'
  1264. },
  1265. }
  1266. _data.push(_obj)
  1267. this.rkList = _data
  1268. }
  1269. }
  1270. let res6 = {
  1271. width: 200,
  1272. series: [{
  1273. data: _data
  1274. }]
  1275. };
  1276. this.chartData6 = JSON.parse(JSON.stringify(res6));
  1277. },
  1278. selectMakeDate7(val) {
  1279. console.log(11)
  1280. console.log(val)
  1281. this.chartData7.series = [];
  1282. let _data = []
  1283. this.ztList = []
  1284. for (let i = 0; i < val.biViewInfoList.length; i++) {
  1285. let _obj = {
  1286. name: val.biViewInfoList[i].name,
  1287. value: Number(val.biViewInfoList[i].count),
  1288. color: this.ztColor[i],
  1289. style: {
  1290. 'background': this.ztColor[i],
  1291. 'border-radius': '50%',
  1292. 'width': '20rpx',
  1293. 'height': '20rpx',
  1294. 'display': 'inline-block',
  1295. 'margin-right': '10rpx'
  1296. },
  1297. }
  1298. _data.push(_obj)
  1299. this.ztList = _data
  1300. }
  1301. console.log(_data)
  1302. let res7 = {
  1303. series: [{
  1304. data: _data
  1305. }]
  1306. };
  1307. this.chartData7 = JSON.parse(JSON.stringify(res7));
  1308. },
  1309. makeDate7(val) {
  1310. let _data = []
  1311. this.ztList = []
  1312. if (val[11].biViewInfoList && val[11].biViewInfoList.length) {
  1313. for (let i = 0; i < val[11].biViewInfoList.length; i++) {
  1314. let _obj = {
  1315. name: val[11].biViewInfoList[i].name,
  1316. value: Number(val[11].biViewInfoList[i].count),
  1317. color: this.ztColor[i],
  1318. style: {
  1319. 'background': this.ztColor[i],
  1320. 'border-radius': '50%',
  1321. 'width': '20rpx',
  1322. 'height': '20rpx',
  1323. 'display': 'inline-block',
  1324. 'margin-right': '10rpx'
  1325. },
  1326. }
  1327. _data.push(_obj)
  1328. this.ztList = _data
  1329. }
  1330. }
  1331. console.log(_data)
  1332. let res7 = {
  1333. series: [{
  1334. data: _data
  1335. }]
  1336. };
  1337. this.chartData7 = JSON.parse(JSON.stringify(res7));
  1338. },
  1339. makeDate8(val) {
  1340. let _categories = []
  1341. let _data = []
  1342. let _categories1 = []
  1343. let _data1 = []
  1344. this.appTotal = val[12].count
  1345. this.lmTotal = val[13].count
  1346. let _max1 = 0
  1347. let _max2 = 0
  1348. if (val[12].biViewInfoList && val[12].biViewInfoList.length) {
  1349. for (let i = 0; i < val[12].biViewInfoList.length; i++) {
  1350. _categories.push(new Date(val[12].biViewInfoList[i].name).getMonth() + 1 + '月')
  1351. _data.push(val[12].biViewInfoList[i].weight)
  1352. }
  1353. }
  1354. _max1 = Math.max(..._data)
  1355. if (val[13].biViewInfoList && val[13].biViewInfoList.length > 0) {
  1356. for (let i = 0; i < val[13].biViewInfoList.length; i++) {
  1357. _categories1.push(new Date(val[13].biViewInfoList[i].name).getMonth() + 1 + '月')
  1358. _data1.push(val[13].biViewInfoList[i].weight)
  1359. }
  1360. }
  1361. _max2 = Math.max(..._data1)
  1362. let _newMax1 = this.makeYData(_max1)
  1363. console.log('max8', _newMax1)
  1364. this.opts8.yAxis.data[0].max = _newMax1
  1365. let _newMax2 = this.makeYData(_max2)
  1366. console.log('max9', _newMax2)
  1367. this.opts9.yAxis.data[0].max = _newMax2
  1368. let res8 = {
  1369. categories: _categories,
  1370. series: [{
  1371. name: "成交量A",
  1372. data: _data,
  1373. // textColor: "transparent"
  1374. }]
  1375. }
  1376. let res9 = {
  1377. categories: _categories1,
  1378. series: [{
  1379. name: "成交量A",
  1380. data: _data1,
  1381. // textColor: "transparent"
  1382. }]
  1383. }
  1384. this.chartData8 = JSON.parse(JSON.stringify(res8))
  1385. this.chartData9 = JSON.parse(JSON.stringify(res9))
  1386. },
  1387. isShowChart(val, index) {
  1388. if (val.length == 0) {
  1389. return false
  1390. switch (index) {
  1391. case 3:
  1392. this.isHaveData3 = false
  1393. }
  1394. }
  1395. return true
  1396. },
  1397. getServerData() {
  1398. uni.showLoading({
  1399. title: "加载中",
  1400. mask: true
  1401. })
  1402. this.$api.doRequest('get', '/biInfoController/selectPhoneBiInfo?compId=' + uni.getStorageSync(
  1403. 'pcUserInfo')
  1404. .compId + '&seachMoth=' + this.seachMoth + '&seachYear=' + this.seachYear).then(
  1405. res => {
  1406. console.log("数据报表", res)
  1407. uni.hideLoading()
  1408. this.chartList = res.data.data
  1409. // 收支核算数据处理
  1410. this.makeDate1(res.data.data)
  1411. //合同数据
  1412. this.makeDate2(res.data.data)
  1413. //利润核算
  1414. this.makeDate3(res.data.data)
  1415. //库存储量
  1416. this.makeDate4(res.data.data)
  1417. //当期货值
  1418. this.makeDate5(res.data.data)
  1419. //今日入库
  1420. this.makeDate6(res.data.data)
  1421. //在途数据
  1422. this.makeDate7(res.data.data)
  1423. //APP注册
  1424. this.makeDate8(res.data.data)
  1425. // uni.hideLoading()
  1426. })
  1427. //模拟从服务器获取数据时的延时
  1428. setTimeout(() => {
  1429. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  1430. // let res = {
  1431. // categories: ["2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023"],
  1432. // series: [{
  1433. // name: "收入",
  1434. // data: [70, 40, 65, 100, 44, 68, 90, 240]
  1435. // }, {
  1436. // name: "支出",
  1437. // data: [35, 8, 25, 37, 4, 20, 56, 30]
  1438. // }
  1439. // ]
  1440. // };
  1441. // this.chartData = JSON.parse(JSON.stringify(res));
  1442. // let res1 = {
  1443. // categories: ["2016", "2017", "2018", "2019", "2020", "2021"],
  1444. // series: [{
  1445. // name: this.index == 1 ? '过去12个月累计签订数量' : '本季累计签订合同数量',
  1446. // data: [35, 36, 31, 33, 13, 34],
  1447. // legendShape: "circle",
  1448. // },
  1449. // {
  1450. // name: this.index == 1 ? '当前执行中数量' : '本季执行中数量',
  1451. // data: [18, 27, 21, 24, 6, 28],
  1452. // legendShape: "circle"
  1453. // }
  1454. // ]
  1455. // };
  1456. // this.chartData1 = JSON.parse(JSON.stringify(res1));
  1457. // let res3 = {
  1458. // categories: ["销售", "采购", "收购", "代收", "代储"],
  1459. // series: [{
  1460. // name: "利润金额",
  1461. // data: [35, 36, 31, 33, 13]
  1462. // }]
  1463. // };
  1464. // this.chartData3 = JSON.parse(JSON.stringify(res3));
  1465. let res4 = {
  1466. categories: ["小麦", "高粱(潮粮)", "高粱", "玉米(潮粮)", "玉米"],
  1467. series: [{
  1468. name: '库存储量',
  1469. data: [{
  1470. value: 35,
  1471. color: "#FFBB6E"
  1472. },
  1473. {
  1474. value: 36,
  1475. color: "#8D9EE9"
  1476. }, {
  1477. value: 31,
  1478. color: "#FF8B95"
  1479. }, {
  1480. value: 33,
  1481. color: "#38CA80"
  1482. },
  1483. {
  1484. color: "#FFDD85"
  1485. }
  1486. ]
  1487. }]
  1488. };
  1489. this.chartData4 = JSON.parse(JSON.stringify(res4));
  1490. // let res5 = {
  1491. // categories: ["小麦", "高粱(潮粮)", "高粱", "玉米(潮粮)", "玉米"],
  1492. // series: [{
  1493. // name: "利润金额",
  1494. // data: [{
  1495. // value: 10000,
  1496. // color: "#FFBB6E"
  1497. // },
  1498. // {
  1499. // value: 40000,
  1500. // color: "#8D9EE9"
  1501. // }, {
  1502. // value: 70000,
  1503. // color: "#FF8B95"
  1504. // }, {
  1505. // value: 90000,
  1506. // color: "#38CA80"
  1507. // },
  1508. // {
  1509. // value: 100000,
  1510. // color: "#FFDD85"
  1511. // }
  1512. // ]
  1513. // }]
  1514. // };
  1515. // this.chartData5 = JSON.parse(JSON.stringify(res5));
  1516. // let res6 = {
  1517. // series: [{
  1518. // data: [{
  1519. // "name": "一班",
  1520. // "value": 50
  1521. // }, {
  1522. // "name": "二班",
  1523. // "value": 30
  1524. // }, {
  1525. // "name": "三班",
  1526. // "value": 20
  1527. // }, {
  1528. // "name": "四班",
  1529. // "value": 18
  1530. // }, {
  1531. // "name": "五班",
  1532. // "value": 8
  1533. // }]
  1534. // }]
  1535. // };
  1536. // this.chartData6 = JSON.parse(JSON.stringify(res6));
  1537. // let res7 = {
  1538. // series: [{
  1539. // data: [{
  1540. // "name": "一班",
  1541. // "value": 50
  1542. // }, {
  1543. // "name": "二班",
  1544. // "value": 30
  1545. // }, {
  1546. // "name": "三班",
  1547. // "value": 20
  1548. // }, {
  1549. // "name": "四班",
  1550. // "value": 18
  1551. // }, {
  1552. // "name": "五班",
  1553. // "value": 8
  1554. // }]
  1555. // }]
  1556. // };
  1557. // this.chartData7 = JSON.parse(JSON.stringify(res7));
  1558. // let res8 = {
  1559. // categories: ["2016", "2017", "2018", "2019", "2020", "2021"],
  1560. // series: [{
  1561. // name: "成交量A",
  1562. // data: [35, 8, 25, 37, 4, 20]
  1563. // }
  1564. // ]
  1565. // };
  1566. // this.chartData8 = JSON.parse(JSON.stringify(res8));
  1567. // let res9 = {
  1568. // categories: ["2016", "2017", "2018", "2019", "2020", "2021"],
  1569. // series: [{
  1570. // name: "成交量A",
  1571. // data: [35, 8, 25, 37, 4, 20]
  1572. // },
  1573. // {
  1574. // name: "成交量B",
  1575. // data: [70, 40, 65, 100, 44, 68]
  1576. // },
  1577. // {
  1578. // name: "成交量C",
  1579. // data: [100, 80, 95, 150, 112, 132]
  1580. // }
  1581. // ]
  1582. // };
  1583. // this.chartData9 = JSON.parse(JSON.stringify(res9));
  1584. },
  1585. 500);
  1586. },
  1587. back() {
  1588. uni.navigateBack()
  1589. },
  1590. navClick(val) {
  1591. this.clList = []
  1592. this.index = val
  1593. if (val == 1) {
  1594. this.seachMoth = ''
  1595. } else {
  1596. this.seachMoth = '2022-10-10'
  1597. }
  1598. this.getServerData();
  1599. },
  1600. accounting(val) {
  1601. this.textIndex = val
  1602. if (val == 1) {
  1603. console.log("按月")
  1604. } else {
  1605. console.log("按年")
  1606. }
  1607. this.makeDate1(this.chartList)
  1608. }
  1609. }
  1610. }
  1611. </script>
  1612. <style scoped lang="scss">
  1613. .flex {
  1614. display: flex;
  1615. }
  1616. .alc {
  1617. align-items: center;
  1618. }
  1619. .jcse {
  1620. justify-content: space-evenly;
  1621. }
  1622. .jcsb {
  1623. justify-content: space-between;
  1624. }
  1625. .mtb40 {
  1626. margin: 40rpx 0;
  1627. }
  1628. .title-lv2 {
  1629. font-weight: bold;
  1630. color: #333333;
  1631. }
  1632. .status_bar {
  1633. height: var(--status-bar-height);
  1634. width: 100%;
  1635. }
  1636. .top-nav {
  1637. display: flex;
  1638. align-items: center;
  1639. justify-content: space-evenly;
  1640. position: fixed;
  1641. top: 0;
  1642. width: 100%;
  1643. z-index: 1;
  1644. }
  1645. .back {
  1646. position: absolute;
  1647. left: 20rpx;
  1648. top: 25%;
  1649. bottom: 0;
  1650. margin: auto;
  1651. }
  1652. .zd {
  1653. color: #969696;
  1654. margin-top: 20rpx;
  1655. justify-content: center;
  1656. }
  1657. .top-nav {
  1658. font-size: 36rpx;
  1659. background: white;
  1660. padding: 20rpx;
  1661. }
  1662. .nav-active {
  1663. font-weight: 700;
  1664. position: relative;
  1665. }
  1666. .nav-active:after {
  1667. content: "";
  1668. position: absolute;
  1669. bottom: -20rpx;
  1670. left: 0;
  1671. right: 0;
  1672. margin: auto;
  1673. height: 10rpx;
  1674. width: 60%;
  1675. background: #262626;
  1676. border-radius: 40rpx;
  1677. }
  1678. .content-item {
  1679. background: white;
  1680. margin: 20rpx 25rpx 0 25rpx;
  1681. border-radius: 20rpx;
  1682. padding: 20rpx;
  1683. box-sizing: border-box;
  1684. }
  1685. .title {
  1686. margin-bottom: 22rpx;
  1687. font-size: 32rpx;
  1688. font-weight: 700;
  1689. color: #343434;
  1690. }
  1691. .right-btn {
  1692. width: 120rpx;
  1693. height: 42rpx;
  1694. display: flex;
  1695. align-items: center;
  1696. justify-content: center;
  1697. background: #F1F1F1;
  1698. border-radius: 30px;
  1699. font-size: 22rpx;
  1700. color: #707575;
  1701. }
  1702. .content1 {
  1703. margin-top: 100rpx;
  1704. .content1-wrap {}
  1705. .row1 {
  1706. display: flex;
  1707. justify-content: space-between;
  1708. align-items: center;
  1709. .left {
  1710. color: #868686;
  1711. }
  1712. .text {
  1713. margin-left: 38rpx;
  1714. color: #2E303A;
  1715. height: 60rpx;
  1716. display: inline-block;
  1717. line-height: 60rpx;
  1718. padding: 0 26rpx;
  1719. }
  1720. .text-active {
  1721. // margin-left: 38rpx;
  1722. color: #FFF;
  1723. background: #2E303A;
  1724. // padding: 1rpx 26rpx;
  1725. height: 60rpx;
  1726. display: inline-block;
  1727. line-height: 60rpx;
  1728. padding: 0 26rpx;
  1729. border-radius: 10rpx;
  1730. }
  1731. }
  1732. .row2 {
  1733. display: flex;
  1734. flex-direction: column;
  1735. align-items: center;
  1736. .text {
  1737. color: #636363;
  1738. margin-bottom: 10rpx
  1739. }
  1740. .price {
  1741. font-size: 56rpx;
  1742. font-weight: 700;
  1743. color: #D79C58;
  1744. }
  1745. }
  1746. .row3 {
  1747. display: flex;
  1748. justify-content: space-between;
  1749. margin-top: 27rpx;
  1750. align-items: center;
  1751. .center {
  1752. width: 2px;
  1753. height: 61rpx;
  1754. border: 2rpx solid #EEEEEE;
  1755. }
  1756. .left,
  1757. .right {
  1758. // background: green;
  1759. width: calc(50% - 1px);
  1760. text-align: center;
  1761. .text {
  1762. color: #636363
  1763. }
  1764. .number {
  1765. margin-top: 12rpx;
  1766. font-size: 34rpx;
  1767. font-weight: 700;
  1768. color: #343434;
  1769. }
  1770. }
  1771. }
  1772. .row4 {
  1773. margin-top: 20rpx;
  1774. }
  1775. .row5 {
  1776. background: #F6F6F6;
  1777. border-radius: 8px;
  1778. padding: 16rpx 0;
  1779. box-sizing: border-box;
  1780. margin: 20rpx 0;
  1781. .left,
  1782. .right {
  1783. width: 50%;
  1784. text-align: center;
  1785. }
  1786. .point-left {
  1787. width: 11rpx;
  1788. height: 11rpx;
  1789. background: #E84A55;
  1790. display: inline-block;
  1791. border-radius: 50%;
  1792. margin: 6rpx;
  1793. }
  1794. .point-right {
  1795. width: 11rpx;
  1796. height: 11rpx;
  1797. background: #22C572;
  1798. display: inline-block;
  1799. border-radius: 50%;
  1800. margin: 6rpx;
  1801. }
  1802. .text-left {
  1803. color: #E84A55;
  1804. font-weight: 700;
  1805. }
  1806. .text-right {
  1807. color: #22C572;
  1808. font-weight: 700;
  1809. }
  1810. }
  1811. }
  1812. .content2 {
  1813. .row1 {}
  1814. .row2 {
  1815. color: #707575;
  1816. font-size: 22rpx;
  1817. .color1 {
  1818. width: 16rpx;
  1819. height: 12rpx;
  1820. background: #D2F3E2;
  1821. border-radius: 7rpx;
  1822. margin-right: 10rpx;
  1823. }
  1824. .color2 {
  1825. width: 16rpx;
  1826. height: 12rpx;
  1827. background: #2CC778;
  1828. border-radius: 7rpx;
  1829. margin-right: 10rpx;
  1830. }
  1831. }
  1832. .row3 {
  1833. position: relative;
  1834. top: -40rpx;
  1835. }
  1836. .row5 {
  1837. display: flex;
  1838. justify-content: space-between;
  1839. color: #9E9E9E;
  1840. margin-bottom: 20rpx;
  1841. .left {}
  1842. }
  1843. }
  1844. .content3 {
  1845. .right {
  1846. color: #9E9E9E;
  1847. }
  1848. .row2 {
  1849. .name {
  1850. color: #7A7A7A;
  1851. margin: 17rpx 0;
  1852. }
  1853. .bottom {
  1854. display: flex;
  1855. }
  1856. .left {
  1857. width: 80%;
  1858. }
  1859. .weight {
  1860. margin-left: 20rpx;
  1861. }
  1862. }
  1863. .row3 {
  1864. padding: 31rpx 25rpx 51rpx 25rpx;
  1865. border-radius: 15rpx;
  1866. margin-top: 31rpx;
  1867. background: #FAFAFA;
  1868. .list-item {
  1869. margin-top: 20rpx;
  1870. .number {
  1871. font-weight: 700;
  1872. }
  1873. }
  1874. }
  1875. .row7 {
  1876. .list-item {
  1877. font-size: 24rpx;
  1878. display: inline-block;
  1879. padding: 20rpx;
  1880. box-sizing: border-box;
  1881. background: #FAFAFA;
  1882. width: calc(50% - 40rpx);
  1883. margin: 20rpx;
  1884. border-radius: 8rpx;
  1885. }
  1886. }
  1887. }
  1888. .content4 {
  1889. .row1 {
  1890. display: flex;
  1891. .opts6 uni-canvas {
  1892. width: 200px;
  1893. }
  1894. }
  1895. }
  1896. .content5 {
  1897. .days-nav {
  1898. display: flex;
  1899. justify-content: space-evenly;
  1900. }
  1901. }
  1902. .zt-right {
  1903. flex-direction: column;
  1904. justify-content: space-evenly;
  1905. height: 100px;
  1906. display: flex;
  1907. width: 100%;
  1908. }
  1909. .content6 {
  1910. .row1 {
  1911. margin: 20rpx 0;
  1912. }
  1913. .left {
  1914. // font-weight: 700;
  1915. // margin
  1916. }
  1917. }
  1918. .days-nav {
  1919. margin: 20rpx;
  1920. background: #F5F6FA;
  1921. border-radius: 8rpx;
  1922. padding: 4rpx 0;
  1923. .item {
  1924. width: 33%;
  1925. display: flex;
  1926. justify-content: center;
  1927. padding: 6px 0;
  1928. }
  1929. .item-active {
  1930. background: #fff;
  1931. }
  1932. }
  1933. </style>