index.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
  4. <el-form-item label="保税区">
  5. <el-select v-model="queryParams.cbIdArr" multiple placeholder="请选择保税区">
  6. <el-option
  7. v-for="item in regionList"
  8. :key="item.value"
  9. :label="item.label"
  10. :value="item.value">
  11. </el-option>
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="指标名称">
  15. <el-select v-model="queryParams.normFeeId" placeholder="请选择指标名称">
  16. <el-option
  17. v-for="item in normFeelistAll"
  18. :key="item.value"
  19. :label="item.label"
  20. :value="item.value">
  21. </el-option>
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item label="时间类型">
  25. <el-select v-model="queryParams.dateType" placeholder="请选择" clearable filterable class="se" @change="selectChange">
  26. <el-option v-for="t in datelist" :key="t.value" :label="t.label" :value="t.value" />
  27. </el-select>
  28. <el-select v-if="queryParams.dateType == 1" v-model="queryParams.dateValue" placeholder="选择月" clearable filterable class="se" style="margin-left: 10px;">
  29. <el-option v-for="t in 12" :key="t.value" :label="t + '月'" :value="t" />
  30. </el-select>
  31. <el-select v-if="queryParams.dateType == 2" v-model="queryParams.dateValue" placeholder="选择季度" clearable filterable class="se" style="margin-left: 10px;">
  32. <el-option v-for="t in jdlist" :key="t.value" :label="t.label" :value="t.value"/>
  33. </el-select>
  34. <el-date-picker v-if="queryParams.dateType == 3" v-model="queryParams.dateValue" type="year" placeholder="选择年" value-format="yyyy" format="yyyy 年" style="margin-left: 10px;"></el-date-picker>
  35. </el-form-item>
  36. <el-form-item>
  37. <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
  38. <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
  39. </el-form-item>
  40. <!-- <el-form-item label="图形类型">
  41. <el-select v-model="contentType" placeholder="请选择图形类型">
  42. <el-option
  43. v-for="item in contentTypelist"
  44. :key="item.value"
  45. :label="item.label"
  46. :value="item.value">
  47. </el-option>
  48. </el-select>
  49. </el-form-item> -->
  50. </el-form>
  51. <el-row :gutter="10" class="mb8">
  52. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  53. </el-row>
  54. <el-table :data="dataList" height="500px">
  55. <el-table-column label="保税区" align="center" prop="cbName">
  56. <template slot-scope="scope">
  57. {{ scope.row.cbName }}
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="指标名称" align="center" prop="colName">
  61. <template slot-scope="scope">
  62. {{ scope.row.colName }}
  63. </template>
  64. </el-table-column>
  65. <!-- <el-table-column v-for="item in datails" :key="Math.random()" :label="item[0].timeValue" align="center" prop="colName">
  66. <template slot="header" slot-scope="scope">
  67. {{ scope.row.$index }}
  68. </template>
  69. <el-table-column label="对比值" align="center" prop="colName">
  70. <template slot-scope="scope">
  71. 1
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="当前" align="center" prop="colName">
  75. <template slot-scope="scope">
  76. 2
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="浮动" align="center" prop="colName">
  80. <template slot-scope="scope">
  81. 3
  82. </template>
  83. </el-table-column>
  84. </el-table-column> -->
  85. <el-table-column align="center" prop="colName" v-if="queryParams.dateType == '1' || queryParams.dateType == ''">
  86. <template slot="header" slot-scope="scope">
  87. {{ timeValue[0]?timeValue[0]:'月份' }}
  88. </template>
  89. <el-table-column label="对比值" align="center" prop="colName">
  90. <template slot-scope="scope">
  91. {{ scope.row.datails[0].oldValue }}
  92. </template>
  93. </el-table-column>
  94. <el-table-column label="当前" align="center" prop="colName">
  95. <template slot-scope="scope">
  96. {{ scope.row.datails[0].nowValue }}
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="浮动" align="center" prop="colName">
  100. <template slot-scope="scope">
  101. {{ scope.row.datails[0].redio }}
  102. </template>
  103. </el-table-column>
  104. </el-table-column>
  105. <el-table-column align="center" prop="colName" v-if="queryParams.dateType == '2' || queryParams.dateType == ''">
  106. <template slot="header" slot-scope="scope">
  107. {{ timeValue[1]?timeValue[1] + '季度':'季度' }}
  108. </template>
  109. <el-table-column label="对比值" align="center" prop="colName">
  110. <template slot-scope="scope">
  111. {{ scope.row.datails[1].oldValue }}
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="当前" align="center" prop="colName">
  115. <template slot-scope="scope">
  116. {{ scope.row.datails[1].nowValue }}
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="浮动" align="center" prop="colName">
  120. <template slot-scope="scope">
  121. {{ scope.row.datails[1].redio }}
  122. </template>
  123. </el-table-column>
  124. </el-table-column>
  125. <el-table-column align="center" prop="colName" v-if="queryParams.dateType == '3' || queryParams.dateType == ''">
  126. <template slot="header" slot-scope="scope">
  127. {{ timeValue[2]?timeValue[2] + '年度':'年度' }}
  128. </template>
  129. <el-table-column label="对比值" align="center" prop="colName">
  130. <template slot-scope="scope">
  131. {{ scope.row.datails[2].oldValue }}
  132. </template>
  133. </el-table-column>
  134. <el-table-column label="当前" align="center" prop="colName">
  135. <template slot-scope="scope">
  136. {{ scope.row.datails[2].nowValue }}
  137. </template>
  138. </el-table-column>
  139. <el-table-column label="浮动" align="center" prop="colName">
  140. <template slot-scope="scope">
  141. {{ scope.row.datails[2].redio }}
  142. </template>
  143. </el-table-column>
  144. </el-table-column>
  145. </el-table>
  146. </div>
  147. </template>
  148. <script>
  149. import { getDFZL,normFeelistAll,bondedList } from '@/api/portal/figure/figure.js';
  150. export default {
  151. name: 'DFZL',
  152. data() {
  153. return {
  154. categoryChartData: {},
  155. contentType:'1',
  156. contentTypelist:[
  157. { label: '列表', value: '1' },
  158. { label: '柱状图', value: '2' },
  159. { label: '雷达图', value: '3' },
  160. ],
  161. datelist:[
  162. { label: '月', value: '1' },
  163. { label: '季度', value: '2' },
  164. { label: '年', value: '3' },
  165. ],
  166. jdlist:[
  167. { label: '第一季度', value: '1' },
  168. { label: '第二季度', value: '2' },
  169. { label: '第三季度', value: '3' },
  170. { label: '第四季度', value: '4' },
  171. ],
  172. dialogVisible: false,
  173. fileList: [],
  174. // 根路径
  175. baseURL: process.env.VUE_APP_BASE_API,
  176. // 遮罩层
  177. loading: true,
  178. // 显示搜索条件
  179. showSearch: true,
  180. // 系统管理表格数据
  181. dataList: [],
  182. // 查询参数
  183. queryParams: {
  184. cbIdArr:[], //保税区id集合
  185. dateType:'', //查询时间类型(1=月,2=季度,3=年)
  186. dateValue:'', //查询时间值
  187. normFeeId:'', //指标明细id
  188. },
  189. normFeelistAll:[], //指标列表
  190. regionList:[], //保税区列表
  191. timeValue:[],
  192. };
  193. },
  194. created() {
  195. this.bondedList()
  196. this.getNormFeelistAll()
  197. },
  198. methods: {
  199. selectChange(val){
  200. this.queryParams.dateValue = ''
  201. },
  202. getList() {
  203. this.timeValue = []
  204. this.loading = true;
  205. getDFZL(this.queryParams).then(response => {
  206. this.dataList = []
  207. this.dataList = response.data;
  208. for (const i in this.dataList[0].datails) {
  209. this.timeValue.push(this.dataList[0].datails[i].timeValue)
  210. }
  211. this.loading = false;
  212. });
  213. },
  214. bondedList(){
  215. this.regionList = []
  216. bondedList().then(res=>{
  217. for (const i in res.data) {
  218. this.regionList.push({
  219. label:res.data[i].deptName,
  220. value:res.data[i].deptId,
  221. })
  222. }
  223. })
  224. },
  225. getNormFeelistAll(){
  226. this.normFeelistAll = []
  227. normFeelistAll().then(res=>{
  228. for (const i in res.data) {
  229. this.normFeelistAll.push({
  230. label:res.data[i].fname,
  231. value:res.data[i].id,
  232. })
  233. }
  234. this.getList();
  235. })
  236. },
  237. handleQuery() {
  238. this.getList();
  239. },
  240. /** 重置按钮操作 */
  241. resetQuery() {
  242. this.queryParams.cbIdArr = [];
  243. this.queryParams.dateType = '';
  244. this.queryParams.dateValue = '';
  245. this.queryParams.normFeeId = '';
  246. this.resetForm('queryForm');
  247. },
  248. }
  249. };
  250. </script>