index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <template>
  2. <BusinessMainCom title="企业一张图">
  3. <div class="enterprise">
  4. <div class="__gis-business-main_title">数量统计</div>
  5. <FocusContentCom class="one" v-loading="loading.statistic">
  6. <div class="one-top">
  7. <img src="@/assets/images/gis-business/enterprise_icon1.png" alt=""/>
  8. <!-- <StatisticTitleCom title="企业总数" :num="statistic.qy.total" unit="家"/>-->
  9. <StatisticTitleCom title="企业总数" :num="$store.state.gis.tempStatistic.total" unit="家"/>
  10. </div>
  11. <div class="one-bottom">
  12. <div class="one-bottom-item">
  13. <div class="chart">
  14. <!-- <PieSimpleChartCom :num="statistic.qy.lgszyjkscsb" :total="statistic.qy.total" color="#00FFFF"/>-->
  15. <PieSimpleChartCom :num="$store.state.gis.tempStatistic.lgszyjkscsb" :total="$store.state.gis.tempStatistic.total" color="#00FFFF"/>
  16. </div>
  17. <div class="text">零关税自用<br/>进口生产设备</div>
  18. </div>
  19. <div class="one-bottom-item">
  20. <div class="chart">
  21. <!-- <PieSimpleChartCom :num="statistic.qy.jgzzmgs" :total="statistic.qy.total" color="#FFCC8F"/>-->
  22. <PieSimpleChartCom :num="$store.state.gis.tempStatistic.jgzzmgs" :total="$store.state.gis.tempStatistic.total" color="#FFCC8F"/>
  23. </div>
  24. <div class="text">加工增值免关税</div>
  25. </div>
  26. <div class="one-bottom-item">
  27. <div class="chart">
  28. <!-- <PieSimpleChartCom :num="statistic.qy.lgsjkyfl" :total="statistic.qy.total" color="#EB90FF"/>-->
  29. <PieSimpleChartCom :num="$store.state.gis.tempStatistic.lgsjkyfl" :total="$store.state.gis.tempStatistic.total" color="#EB90FF"/>
  30. </div>
  31. <div class="text">零关税进口<br/>原辅料</div>
  32. </div>
  33. </div>
  34. </FocusContentCom>
  35. <FocusContentCom class="two">
  36. <div class="two-main">
  37. <img src="@/assets/images/gis-business/enterprise_icon2.png" alt=""/>
  38. <StatisticTitleCom title="预警总数" :num="statistic.warning" unit="条"/>
  39. </div>
  40. </FocusContentCom>
  41. <div class="__gis-business-main_title">企业列表</div>
  42. <div class="form">
  43. <CusFormColumn
  44. labelWidth="44"
  45. :span="24"
  46. link="select"
  47. label="类型:"
  48. v-model:param="enterprise.tempForm.type"
  49. multiple
  50. collapse-tags
  51. :options="[
  52. {dictLabel: '零关税自用进口生产设备', dictValue: 'lgszyjkscsb'},
  53. {dictLabel: '加工增值免关税', dictValue: 'jgzzmgs'},
  54. {dictLabel: '零关税进口原辅料', dictValue: 'lgsjkyfl'},
  55. ]"
  56. />
  57. <div class="form-two">
  58. <CusFormColumn
  59. labelWidth="44"
  60. :span="24"
  61. label="搜索:"
  62. v-model:param="enterprise.tempForm.name"
  63. />
  64. <div class="__cus-buttons-2">
  65. <div class="__cus-button-submit __hover" @click="onSearch">搜索</div>
  66. <div class="__cus-button-cancel __hover" @click="onReset">重置</div>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="table">
  71. <div class="table-card">
  72. <template v-for="(item, index) in enterprise.table.data">
  73. <div class="table-card-item __hover" :class="{active: item.id === $store.state.gis.activeQyId}" @click="handleClick(item)">
  74. <img src="@/assets/images/gis-business/enterprise_list-icon1.png" alt=""/>
  75. <div class="table-card-item-right">
  76. <div class="table-card-item-right-top">
  77. <CusEllipsis :value="`${(enterprise.table.pageNum - 1) * enterprise.table.pageSize + index + 1}.${item.qymc}`"/>
  78. </div>
  79. <div class="table-card-item-right-bottom">
  80. <img src="@/assets/images/gis-business/enterprise_list-icon2.png" alt=""/>
  81. {{item.qykx}}
  82. </div>
  83. </div>
  84. </div>
  85. </template>
  86. </div>
  87. <el-pagination
  88. class="__cus-pagination"
  89. :current-page="enterprise.table.pageNum"
  90. :page-size="enterprise.table.pageSize"
  91. :total="enterprise.table.total"
  92. layout="total,prev,pager,next,jumper"
  93. @current-change="handleCurrentChange"
  94. />
  95. </div>
  96. </div>
  97. </BusinessMainCom>
  98. </template>
  99. <script lang="ts">
  100. import {
  101. defineComponent,
  102. computed,
  103. onMounted,
  104. ref,
  105. reactive,
  106. watch,
  107. getCurrentInstance,
  108. ComponentInternalInstance,
  109. toRefs,
  110. nextTick
  111. } from 'vue'
  112. import {useStore} from 'vuex'
  113. import {useRouter, useRoute} from 'vue-router'
  114. import {ElMessage, ElMessageBox} from "element-plus";
  115. import BusinessMainCom from '../common/business-main.vue'
  116. import FocusContentCom from '../common/focus-content.vue'
  117. import PieSimpleChartCom from '../common/pie-simple-chart.vue'
  118. import StatisticTitleCom from '../common/statistic-title.vue'
  119. import {enterpriseQuery} from "@/api/modules/enterprise";
  120. export default defineComponent({
  121. name: '',
  122. components: {
  123. BusinessMainCom,
  124. FocusContentCom,
  125. PieSimpleChartCom,
  126. StatisticTitleCom
  127. },
  128. props: {},
  129. setup(props, {emit}) {
  130. const store = useStore();
  131. const router = useRouter();
  132. const route = useRoute();
  133. const that = (getCurrentInstance() as ComponentInternalInstance).appContext.config.globalProperties
  134. const state = reactive({
  135. enterprise: {
  136. form: {},
  137. tempForm: {
  138. type: '',
  139. name: ''
  140. },
  141. table: {
  142. data: <any>[],
  143. pageNum: 1,
  144. pageSize: 10,
  145. total: 0
  146. }
  147. },
  148. statistic: {
  149. qy: {
  150. total: 0,
  151. lgszyjkscsb: 0,
  152. jgzzmgs: 0,
  153. lgsjkyfl: 0
  154. },
  155. warning: 0
  156. },
  157. loading: {
  158. statistic: false
  159. }
  160. })
  161. const onSearch = () => {
  162. state.enterprise.table.pageNum = 1
  163. state.enterprise.form = JSON.parse(JSON.stringify(state.enterprise.tempForm))
  164. handleSearch()
  165. }
  166. const onReset = () => {
  167. state.enterprise.tempForm = {
  168. name: '',
  169. type: ''
  170. }
  171. onSearch()
  172. }
  173. const handleCurrentChange = (val: number) => {
  174. state.enterprise.table.pageNum = val
  175. handleSearch()
  176. }
  177. const handleSearch = () => {
  178. state.enterprise.table.data = []
  179. const params = {
  180. pageNumber: state.enterprise.table.pageNum,
  181. pageSize: state.enterprise.table.pageSize,
  182. }
  183. if (state.enterprise.form.name) {
  184. params.entName = state.enterprise.form.name
  185. }
  186. if (state.enterprise.form.type?.length > 0) {
  187. params.entType = state.enterprise.form.type.map(v => store.getters['dictionary/elementTypeMap'].get(v)).join(',')
  188. }
  189. that.$api.enterpriseQuery(params).then((res: any) => {
  190. if (res.resp_code === 0 && res.datas?.length > 0) {
  191. state.enterprise.table.data = res.datas
  192. state.enterprise.table.total = res.recordCount
  193. }
  194. })
  195. }
  196. const initStatistic = () => {
  197. state.loading.statistic = true
  198. setTimeout(() => {
  199. state.statistic = {
  200. qy: {
  201. total: 0,
  202. lgszyjkscsb: 0,
  203. jgzzmgs: 0,
  204. lgsjkyfl: 0
  205. },
  206. warning: 0
  207. }
  208. state.loading.statistic = false
  209. })
  210. }
  211. const handleClick = (item) => {
  212. const qyLayer = store.state.gis.map.getLayers().getArray().filter(v => v.get('layerName') === 'qy')?.[0]
  213. if (qyLayer) {
  214. const f = qyLayer.getSource().getFeatureById(item.id)
  215. if (f) {
  216. f.get('mockClick')()
  217. store.state.gis.map.getView().animate({
  218. center: f.getGeometry().getCoordinates(),
  219. zoom: store.state.gis.map.getView().getMaxZoom(),
  220. });
  221. } else {
  222. ElMessage.warning('未找到该企业位置!')
  223. }
  224. }
  225. console.log(item)
  226. }
  227. onMounted(() => {
  228. state.enterprise.form = JSON.parse(JSON.stringify(state.enterprise.tempForm))
  229. handleSearch()
  230. initStatistic()
  231. })
  232. return {
  233. ...toRefs(state),
  234. onSearch,
  235. onReset,
  236. handleCurrentChange,
  237. handleClick
  238. }
  239. },
  240. })
  241. </script>
  242. <style scoped lang="scss">
  243. @import "../main";
  244. .enterprise {
  245. flex: 1;
  246. padding: 0 12px 10px 12px;
  247. display: flex;
  248. flex-direction: column;
  249. overflow: hidden;
  250. .one {
  251. height: 238px;
  252. display: flex;
  253. flex-direction: column;
  254. .one-top {
  255. display: flex;
  256. align-items: center;
  257. padding: 12px 22px 20px 23px;
  258. >img {
  259. margin-right: 16px;
  260. }
  261. }
  262. .one-bottom {
  263. display: flex;
  264. justify-content: space-between;
  265. padding: 0 12px;
  266. .one-bottom-item {
  267. display: flex;
  268. flex-direction: column;
  269. align-items: center;
  270. .chart {
  271. width: 100px;
  272. height: 100px;
  273. }
  274. .text {
  275. margin-top: 8px;
  276. flex: 1;
  277. text-align: center;
  278. font-size: 12px;
  279. font-family: Microsoft YaHei;
  280. font-weight: 400;
  281. color: #434343;
  282. line-height: 14px;
  283. display: flex;
  284. align-items: center;
  285. justify-content: center;
  286. }
  287. }
  288. }
  289. }
  290. .two {
  291. margin-top: 10px;
  292. height: 100px;
  293. .two-main {
  294. width: 100%;
  295. height: 100%;
  296. display: flex;
  297. align-items: center;
  298. padding: 12px 22px 20px 23px;
  299. >img {
  300. margin-right: 16px;
  301. }
  302. }
  303. }
  304. .form {
  305. :deep(.el-form-item) {
  306. margin-bottom: 7px;
  307. }
  308. .form-two {
  309. display: flex;
  310. align-items: flex-start;
  311. .cus-form-column {
  312. flex: 1;
  313. margin-right: 8px;
  314. }
  315. }
  316. }
  317. .table {
  318. flex: 1;
  319. display: flex;
  320. flex-direction: column;
  321. overflow: hidden;
  322. .table-card {
  323. flex: 1;
  324. overflow-y: auto;
  325. display: grid;
  326. row-gap: 10px;
  327. .table-card-item {
  328. overflow: hidden;
  329. width: 100%;
  330. height: 62px;
  331. border: 1px solid #D6D6D6;
  332. border-radius: 2px;
  333. display: flex;
  334. align-items: center;
  335. padding: 11px 8px;
  336. &.active {
  337. background: rgba(16,140,243,0.1);
  338. border: 1px solid #1270DA;
  339. }
  340. .table-card-item-right {
  341. overflow: hidden;
  342. flex: 1;
  343. margin-left: 6px;
  344. display: flex;
  345. flex-direction: column;
  346. justify-content: space-between;
  347. .table-card-item-right-top {
  348. font-size: 16px;
  349. font-family: Microsoft YaHei;
  350. font-weight: bold;
  351. color: #434343;
  352. }
  353. .table-card-item-right-bottom {
  354. margin-top: 7px;
  355. font-size: 14px;
  356. font-family: Microsoft YaHei;
  357. font-weight: 400;
  358. color: #FF8217;
  359. display: flex;
  360. align-items: center;
  361. >img {
  362. margin-right: 6px;
  363. }
  364. }
  365. }
  366. }
  367. }
  368. .__cus-pagination {
  369. height: 20px;
  370. }
  371. }
  372. }
  373. </style>