detail.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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">{{ standard_sized[itemObj.standard_sized] || "-" }}</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.standard_sized_date || "-" }}</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.rd_balance || "-" }}(万元)</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">{{ totalBalance || "-" }}(万元)</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">{{ totalRatio || "-" }}%</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. totalBalance:'',
  117. totalRatio:'',
  118. itemObj:{},
  119. advancedType:{
  120. '0':'否',
  121. '1':'是'
  122. },
  123. highType:{
  124. '0':'否',
  125. '1':'是'
  126. },
  127. standard_sized:{
  128. '0':'否',
  129. '1':'是'
  130. },
  131. nowId:''
  132. }
  133. },
  134. onLoad(option) {
  135. this.nowId = option.id;
  136. this.dateYear = Number(option.year);
  137. this.dateMonth = Number(option.month);
  138. this.getCompanyInfo(this.dateYear,this.dateMonth,option.id)
  139. },
  140. methods:{
  141. bindDateChange(e){
  142. this.dateYear = e.target.value
  143. this.getCompanyInfo(this.dateYear,this.dateMonth,this.nowId)
  144. },
  145. bindDateMonthChange(e){
  146. this.dateMonth = this.arrayMonth[e.target.value]
  147. this.getCompanyInfo(this.dateYear,this.dateMonth,this.nowId)
  148. },
  149. getCompanyInfo(y,m,ids) {
  150. let md5Sign = md5(
  151. "method=" +
  152. "stat" +
  153. "&timestamp=" +
  154. getApp().globalData.globalTimestamp +
  155. "&secret=" +
  156. getApp().globalData.secret
  157. );
  158. let url =
  159. getApp().globalData.shareUrl +
  160. "api/api.php" +
  161. "?method=stat&action=company_by_id&timestamp=" +
  162. getApp().globalData.globalTimestamp +
  163. "&sign=" +
  164. md5Sign;
  165. let postData = {
  166. year : y,
  167. month: m,
  168. id: ids
  169. };
  170. uni.request({
  171. url: url,
  172. method: "POST",
  173. header: {
  174. "content-type": "application/x-www-form-urlencoded",
  175. },
  176. data: postData,
  177. success: (res) => {
  178. if (res.data.code === 200) {
  179. this.itemObj = res.data.data;
  180. let chartList = res.data.data.month_list;
  181. let chartCategories = [], chartData = [];
  182. if(chartList.length){
  183. chartList.forEach((item)=>{
  184. chartCategories.push(item.month + '月')
  185. chartData.push(item.balance)
  186. this.totalBalance = item.total_balance;
  187. this.totalRatio = item.total_ratio
  188. })
  189. this.chartData.categories = chartCategories;
  190. this.chartData.series[0].data = chartData;
  191. }
  192. }
  193. },
  194. fail: () => {
  195. console.log("连接失败");
  196. },
  197. });
  198. },
  199. }
  200. };
  201. </script>
  202. <style lang="scss">
  203. .content-box {
  204. display: flex;
  205. flex-direction: column;
  206. flex: 1;
  207. }
  208. .charts-box-title{
  209. width: 100%;
  210. height: 100rpx;
  211. }
  212. .charts-box {
  213. width: 100%;
  214. height: 600rpx;
  215. }
  216. .title-date-box {
  217. margin-top: 10px;
  218. border-bottom: 1px solid #d7d7d7;
  219. padding-bottom: 10px;
  220. }
  221. .picker-class {
  222. border-radius: 10rpx;
  223. padding: 10rpx;
  224. width: 180rpx;
  225. font-size: 28rpx;
  226. background: #f5f5f5;
  227. margin-left: 20rpx;
  228. }
  229. .picker-class image {
  230. width: 26rpx;
  231. height: 26rpx;
  232. }
  233. .title {
  234. display: flex;
  235. align-items: center;
  236. .logo {
  237. margin-right: 30rpx;
  238. display: flex;
  239. justify-content: center;
  240. align-items: center;
  241. overflow: hidden;
  242. width: 150rpx;
  243. height: 100rpx;
  244. overflow: hidden;
  245. .logo-img {
  246. max-width: 100%;
  247. max-height: 100%;
  248. }
  249. }
  250. }
  251. .item-list {
  252. margin-left: 20rpx;
  253. display: flex;
  254. flex-direction: column;
  255. .term {
  256. display: flex;
  257. .term-name {
  258. font-size: 28rpx;
  259. width: 30%;
  260. display: flex;
  261. margin: 20rpx;
  262. color: #7f7f7f;
  263. }
  264. .term-value-group {
  265. flex: 1;
  266. display: flex;
  267. flex-direction: column;
  268. font-size: 28rpx;
  269. .term-value-item {
  270. margin: 20rpx;
  271. }
  272. .flex_i {
  273. display: flex;
  274. flex-flow: row;
  275. justify-content: space-around;
  276. }
  277. }
  278. }
  279. }
  280. </style>