CZDetails.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <template>
  2. <div class="JCDetails" style="padding: 0 50px 0 50px;">
  3. <h1>产值统计</h1>
  4. <!-- <div class="topbox">
  5. <div class="selec">
  6. <el-select v-model="value" clearable placeholder="请选择">
  7. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
  8. </el-option>
  9. </el-select>
  10. </div>
  11. <div class="timeselec">
  12. </div>
  13. </div> -->
  14. <div class="topbox" style="display: flex;justify-content: space-between;">
  15. <div style="flex: 1;"></div>
  16. <div class="selec ershi">
  17. <el-select v-model="value" filterable multiple collapse-tags clearable placeholder="请选择">
  18. <el-option v-for="(item, index) in options" :key="index" :label="item.text" :value="item.value">
  19. </el-option>
  20. </el-select>
  21. </div>
  22. <div class="timeselec ershi">
  23. <el-date-picker v-model="value1" type="daterange" range-separator="至" start-placeholder="开始日期"
  24. end-placeholder="结束日期">
  25. </el-date-picker>
  26. </div>
  27. <button class="ershi" style="width: 100px;height: 40px;background-color: aqua;"
  28. @click="chaxun2(value, value1)">查询</button>
  29. </div>
  30. <div> <el-table ref="table" show-summary :height="taheight" :summary-method="getSummaries" :header-cell-style="{
  31. background: 'rgba(30, 111, 200,0.8)',
  32. color: 'white',
  33. textAlign: 'center',
  34. border: '1px rgb(70, 91, 117) solid',
  35. }" :data="tableData" style="width: 100%">
  36. <el-table-column prop="company" fixed label="品牌" width="100">
  37. </el-table-column>
  38. <el-table-column label="收入类">
  39. <el-table-column prop="pjls" sortable label="配件零售" width="110">
  40. </el-table-column>
  41. <el-table-column label="首保收入">
  42. <el-table-column prop="sbgs" sortable width="110" label="首保工时">
  43. </el-table-column>
  44. <el-table-column prop="sbll" sortable width="110" label="首保领料">
  45. </el-table-column>
  46. </el-table-column>
  47. <el-table-column label="索赔收入">
  48. <el-table-column prop="spll" sortable width="110" label="索赔领料">
  49. </el-table-column>
  50. <el-table-column prop="spgs" sortable width="110" label="索赔工时">
  51. </el-table-column>
  52. </el-table-column>
  53. <el-table-column label="定保收入">
  54. <el-table-column prop="dbgs" sortable width="110" label="定保工时">
  55. </el-table-column>
  56. <el-table-column prop="dbll" sortable width="110" label="定保领料">
  57. </el-table-column>
  58. </el-table-column>
  59. <el-table-column label="一般维修收入">
  60. <el-table-column prop="ybwxll" sortable width="110" label="外修领料">
  61. </el-table-column>
  62. <el-table-column prop="ybwxgs" sortable width="110" label="外修工时">
  63. </el-table-column>
  64. </el-table-column>
  65. <el-table-column label="事故收入">
  66. <el-table-column prop="bpll" sortable width="110" label="事故材料">
  67. </el-table-column>
  68. <el-table-column prop="bpgs" sortable width="110" label="事故工时">
  69. </el-table-column>
  70. </el-table-column>
  71. <el-table-column prop="jpsr" sortable label="精品">
  72. </el-table-column>
  73. <el-table-column prop="qtsr" sortable label="其他收入">
  74. </el-table-column>
  75. <el-table-column prop="srhj" sortable label="收入合计">
  76. </el-table-column>
  77. </el-table-column>
  78. </el-table></div>
  79. </div>
  80. </template>
  81. <script>
  82. import { column } from "./tuozhuai";
  83. import { cztjtabledataInfo } from "../../../servuces/prove";
  84. import { nowdaterange } from "../../../servuces/getnowtime";
  85. export default {
  86. data () {
  87. return {
  88. taheight: window.innerHeight - (window.innerHeight * 0.15),
  89. tableData: [],
  90. tableDatahj: [],
  91. options: [],
  92. value: '',
  93. value1: '',
  94. activeName: 'first'
  95. }
  96. },
  97. created () {
  98. const data = sessionStorage.getItem('data')
  99. console.log(data);
  100. if (data) {
  101. this.options = JSON.parse(data)
  102. }
  103. },
  104. mounted () {
  105. column(this)
  106. this.cztjtabledataapi()
  107. },
  108. updated () {
  109. this.$nextTick(() => {
  110. this.$refs.table.doLayout()
  111. })
  112. },
  113. methods: {
  114. // handleClick(tab, event) {
  115. // console.log(tab, event);
  116. // },
  117. getSummaries () {
  118. const keyindex = {
  119. 'company': 0,
  120. 'pjls': 1,
  121. 'sbgs': 2,
  122. 'sbll': 3,
  123. 'spll': 4,
  124. 'spgs': 5,
  125. 'dbgs': 6,
  126. 'dbll': 7,
  127. 'ybwxll': 8,
  128. 'ybwxgs': 9,
  129. 'bpll': 10,
  130. 'bpgs': 11,
  131. 'jpsr': 12,
  132. 'qtsr': 13,
  133. 'srhj': 14,
  134. }
  135. const item_value = []
  136. for (let key in this.tableDatahj) {
  137. let index = keyindex[key]
  138. item_value[index] = this.tableDatahj[key] + ''
  139. }
  140. // console.log(item_value);
  141. item_value[0] = '合计'
  142. return item_value
  143. },
  144. chaxun2 (value, value1) {
  145. const strvalue = value.join(',')
  146. if (value1) {
  147. const strvaluezh = value1.map(item => {
  148. const date = new Date(item)
  149. // 获取年份和月份
  150. const year = date.getFullYear();
  151. const month = date.getMonth() + 1; // 月份从0开始,需要加1
  152. const day = date.getDate()
  153. // 将年份和月份拼接成所需形式的字符串
  154. return `${year}-${month}-${day}`;
  155. });
  156. cztjtabledataInfo({ "company_ids": strvalue, "date_begin": strvaluezh[0], 'date_end': strvaluezh[1] }).then(res => {
  157. // console.log('查询分期业务', res);
  158. this.tableData = res.rows
  159. this.tableDatahj = res.footer
  160. console.log(res);
  161. }
  162. )
  163. } else {
  164. cztjtabledataInfo({ "company_ids": strvalue, "date_begin": '', 'date_end': '' }).then(res => {
  165. // console.log('查询分期业务', res);
  166. this.tableData = res.rows
  167. this.tableDatahj = res.footer
  168. console.log(res);
  169. }
  170. )
  171. }
  172. // const strvalue1 = strvaluezh.join(',')
  173. // console.log(strvaluezh[0], strvaluezh[1]);
  174. // const date = new Date(value1)
  175. // // 获取年份和月份
  176. // const year = date.getFullYear();
  177. // const month = String(date.getMonth() + 1); // 月份从0开始,需要加1
  178. // const day = String(date.getDate())
  179. // // 将年份和月份拼接成所需形式的字符串
  180. // const strvalue1 = `${year}-${month}-${day}`;
  181. // const strvalue3=
  182. // console.log(strvalue, strvaluezh[0], strvaluezh[1]);
  183. // console.log(strvalue, strvalue1);
  184. // console.log(value, value1);
  185. },
  186. cztjtabledataapi () {
  187. this.value1 = nowdaterange
  188. cztjtabledataInfo({ "company_ids": '', "date_begin": nowdaterange[0], 'date_end': nowdaterange[1] }).then(res => {
  189. // console.log(res);
  190. this.tableData = res.rows
  191. this.tableDatahj = res.footer
  192. })
  193. }
  194. }
  195. }
  196. </script>
  197. <style>
  198. /* .el-table tr {
  199. background-color: none;
  200. color: white;
  201. } */
  202. .el-table .warning-row {
  203. background-color: rgba(15, 78, 146, 0.827);
  204. }
  205. .el-table .success-row {
  206. background-color: rgb(15, 78, 146, 0.5);
  207. }
  208. .has-gutter tr th:last-child {
  209. background-color: rgba(30, 111, 200, 0.8);
  210. }
  211. .el-table tr {
  212. background-color: rgb(15, 78, 146, 0.5);
  213. }
  214. </style>
  215. <style scoped lang="scss">
  216. .JCDetails {
  217. .selec {
  218. margin: 0 0 20px 0;
  219. }
  220. }
  221. ::v-deep .el-table__footer {
  222. border: none;
  223. tr {
  224. border: none;
  225. td {
  226. border: none;
  227. color: white;
  228. background-color: rgba(30, 111, 200, 0.8);
  229. }
  230. td:hover {
  231. color: white;
  232. }
  233. }
  234. }
  235. ::v-deep .el-table {
  236. background-color: transparent;
  237. border-color: rgb(70, 91, 117);
  238. }
  239. ::v-deep .el-table td,
  240. .building-top .el-table th.is-leaf {
  241. border-color: rgb(70, 91, 117);
  242. color: white;
  243. }
  244. ::v-deep .el-table__body tr.hover-row>td.el-table__cell {
  245. background-color: rgb(58, 147, 189) !important;
  246. }
  247. ::v-deep .el-table td:hover {
  248. color: rgb(5, 51, 159);
  249. }
  250. ::v-deep .gutter {
  251. background-color: rgba(30, 111, 200, 0.8) !important;
  252. border: 0 !important;
  253. }
  254. ::v-deep .has-gutter th {
  255. border-color: rgb(70, 91, 117);
  256. }
  257. ::v-deep .el-table--enable-row-hover .el-table__body tr:hover>td {
  258. background-color: rgb(58, 147, 189);
  259. }
  260. ::v-deep #tab-first,
  261. ::v-deep #tab-second,
  262. ::v-deep #tab-third,
  263. ::v-deep #tab-fourth {
  264. color: #fff; //设置修改默认蚊子颜色,背景颜色,等
  265. }
  266. ::v-deep .el-tabs__item.is-active {
  267. color: rgb(37, 99, 214) !important;
  268. }
  269. </style>