detail.vue 7.8 KB

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