detail.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <template>
  2. <view class="content-box">
  3. <view class="title">
  4. <view class="logo">
  5. <!-- <image :src="globalUrl + company.pic_url" alt="" class="logo-img" mode="aspectFit"/> -->
  6. <image src="/static/nodata.svg" alt="" class="logo-img" mode="aspectFit"/>
  7. </view>
  8. <view class="name">
  9. {{ itemObj.name || '-'}}
  10. </view>
  11. </view>
  12. <view class="uni-list title-date-box">
  13. <view class="uni-list-cell">
  14. <view class="uni-list-cell-db display-flex-start">
  15. <picker mode="date" fields="year" @change="bindDateChange" class="picker-class">
  16. <view class="uni-input display-between items-center">{{dateYear}}年<image src="/static/arrow_down.svg" mode="aspectFit"></image></view>
  17. </picker>
  18. <view style="font-size: 26rpx;margin-left: 20rpx;">1月~ </view>
  19. <picker :range="arrayMonth" :value="dateMonth" @change="bindDateMonthChange" class="picker-class">
  20. <view class="uni-input display-between items-center" style="color: #707070;">{{dateMonth}}月<image src="/static/calendar_icon.svg" mode="aspectFit"></image></view>
  21. </picker>
  22. </view>
  23. </view>
  24. </view>
  25. <qiun-title-bar title="工业产值(亿元)"/>
  26. <view class="charts-box">
  27. <qiun-data-charts type="line" :chartData="chartData" background="#4C4C4C"/>
  28. </view>
  29. <view class="item-list">
  30. <view class="term">
  31. <view class="term-name">法定代表人:</view>
  32. <view class="term-value-group">
  33. <p class="term-value-item">{{ itemObj.representative || "-" }}</p>
  34. </view>
  35. </view>
  36. <view class="term">
  37. <view class="term-name">成立日期:</view>
  38. <view class="term-value-group">
  39. <p class="term-value-item">{{ itemObj.found_date || "-" }}</p>
  40. </view>
  41. </view>
  42. <view class="term">
  43. <view class="term-name">注册资本:</view>
  44. <view class="term-value-group">
  45. <p class="term-value-item">{{ itemObj.capital || "-" }}</p>
  46. </view>
  47. </view>
  48. <view class="term">
  49. <view class="term-name">规上工业企业:</view>
  50. <view class="term-value-group">
  51. <p class="term-value-item">{{ highType[itemObj.high_tech] || "-" }}</p>
  52. </view>
  53. </view>
  54. <view class="term">
  55. <view class="term-name">先进制造业:</view>
  56. <view class="term-value-group">
  57. <p class="term-value-item">
  58. {{ advancedType[itemObj.advanced] || "-" }}
  59. </p>
  60. </view>
  61. </view>
  62. <view class="term">
  63. <view class="term-name">亩均排序:</view>
  64. <view class="term-value-group">
  65. <p class="term-value-item">{{ itemObj.aera_order || "-" }}</p>
  66. </view>
  67. </view>
  68. <view class="term">
  69. <view class="term-name">规上评定时间:</view>
  70. <view class="term-value-group">
  71. <p class="term-value-item">{{ itemObj.advanced_update_time || "-" }}</p>
  72. </view>
  73. </view>
  74. <view class="term">
  75. <view class="term-name">经营地址:</view>
  76. <view class="term-value-group">
  77. <p class="term-value-item">{{ itemObj.rigiser_address || "-" }}</p>
  78. </view>
  79. </view>
  80. <view class="term">
  81. <view class="term-name">累计研发投入费用:</view>
  82. <view class="term-value-group">
  83. <p class="term-value-item">{{ itemObj.insure_count || "-" }}</p>
  84. </view>
  85. </view>
  86. <view class="term">
  87. <view class="term-name">本年度生产总值:</view>
  88. <view class="term-value-group">
  89. <p class="term-value-item">{{ itemObj.industry_money || "-" }}</p>
  90. </view>
  91. </view>
  92. <view class="term">
  93. <view class="term-name">本年度工业产值增速:</view>
  94. <view class="term-value-group">
  95. <p class="term-value-item">{{ itemObj.increase_ratio || "-" }}</p>
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. </template>
  101. <script>
  102. import md5 from "@/common/md5.js";
  103. export default {
  104. data() {
  105. return{
  106. dateYear:new Date().getFullYear(),
  107. dateMonth:new Date().getMonth() + 1,
  108. arrayMonth:["1", "2","3", "4","5", "6","7", "8","9", "10","11", "12"],
  109. chartData:{
  110. // "categories": ["1月", "2月","3月", "4月","5月", "6月","7月", "8月","9月", "10月","11月", "12月"],
  111. "categories":[],
  112. "series": [
  113. {name: "本年度",data: [],textSize:'10'},
  114. ]
  115. },
  116. itemObj:{},
  117. advancedType:{
  118. '0':'是',
  119. '1':'否'
  120. },
  121. highType:{
  122. '0':'是',
  123. '1':'否'
  124. },
  125. nowId:''
  126. }
  127. },
  128. onLoad(option) {
  129. this.nowId = option.id;
  130. this.getCompanyInfo(this.dateYear,this.dateMonth,option.id)
  131. },
  132. methods:{
  133. bindDateChange(e){
  134. this.dateYear = e.target.value
  135. this.getCompanyInfo(this.dateYear,this.dateMonth,this.nowId)
  136. },
  137. bindDateMonthChange(e){
  138. this.dateMonth = this.arrayMonth[e.target.value]
  139. this.getCompanyInfo(this.dateYear,this.dateMonth,this.nowId)
  140. },
  141. getCompanyInfo(y,m,ids) {
  142. let md5Sign = md5(
  143. "method=" +
  144. "stat" +
  145. "&timestamp=" +
  146. getApp().globalData.globalTimestamp +
  147. "&secret=" +
  148. getApp().globalData.secret
  149. );
  150. let url =
  151. getApp().globalData.shareUrl +
  152. "api/api.php" +
  153. "?method=stat&action=company_by_id&timestamp=" +
  154. getApp().globalData.globalTimestamp +
  155. "&sign=" +
  156. md5Sign;
  157. let postData = {
  158. year : y,
  159. month: m,
  160. id: ids
  161. };
  162. uni.request({
  163. url: url,
  164. method: "POST",
  165. header: {
  166. "content-type": "application/x-www-form-urlencoded",
  167. },
  168. data: postData,
  169. success: (res) => {
  170. if (res.data.code === 200) {
  171. this.itemObj = res.data.data;
  172. let chartList = res.data.data.month_list;
  173. let chartCategories = [], chartData = [];
  174. if(chartList.length){
  175. chartList.forEach((item)=>{
  176. chartCategories.push(item.month + '月')
  177. chartData.push(item.balance)
  178. })
  179. this.chartData.categories = chartCategories;
  180. this.chartData.series[0].data = chartData;
  181. }
  182. }
  183. },
  184. fail: () => {
  185. console.log("连接失败");
  186. },
  187. });
  188. },
  189. }
  190. };
  191. </script>
  192. <style lang="scss">
  193. .content-box {
  194. display: flex;
  195. flex-direction: column;
  196. flex: 1;
  197. }
  198. .charts-box-title{
  199. width: 100%;
  200. height: 100rpx;
  201. }
  202. .charts-box {
  203. width: 100%;
  204. height: 600rpx;
  205. }
  206. .title-date-box {
  207. margin-top: 10px;
  208. border-bottom: 1px solid #d7d7d7;
  209. padding-bottom: 10px;
  210. }
  211. .picker-class {
  212. border-radius: 10rpx;
  213. padding: 10rpx;
  214. width: 180rpx;
  215. font-size: 28rpx;
  216. background: #f5f5f5;
  217. margin-left: 20rpx;
  218. }
  219. .picker-class image {
  220. width: 26rpx;
  221. height: 26rpx;
  222. }
  223. .title {
  224. display: flex;
  225. align-items: center;
  226. .logo {
  227. margin-right: 30rpx;
  228. display: flex;
  229. justify-content: center;
  230. align-items: center;
  231. overflow: hidden;
  232. width: 150rpx;
  233. height: 100rpx;
  234. overflow: hidden;
  235. .logo-img {
  236. max-width: 100%;
  237. max-height: 100%;
  238. }
  239. }
  240. }
  241. .item-list {
  242. margin-left: 20rpx;
  243. display: flex;
  244. flex-direction: column;
  245. .term {
  246. display: flex;
  247. .term-name {
  248. font-size: 28rpx;
  249. width: 30%;
  250. display: flex;
  251. margin: 20rpx;
  252. color: #7f7f7f;
  253. }
  254. .term-value-group {
  255. flex: 1;
  256. display: flex;
  257. flex-direction: column;
  258. font-size: 28rpx;
  259. .term-value-item {
  260. margin: 20rpx;
  261. }
  262. .flex_i {
  263. display: flex;
  264. flex-flow: row;
  265. justify-content: space-around;
  266. }
  267. }
  268. }
  269. }
  270. </style>