newReport.vue 49 KB

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