detail.vue 7.9 KB

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