CLKCdetails_20230710160114.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <template>
  2. <div class="JCDetails" style="padding: 50px;">
  3. <h1>车辆库存</h1>
  4. <el-tabs v-model="activeName" @tab-click="handleClick">
  5. <el-tab-pane label="进销存报表" name="first">
  6. <div class="topbox" style="display: flex;justify-content: space-between;">
  7. <div style="width: 60%;"></div>
  8. <div class="selec">
  9. <el-select v-model="value" filterable multiple collapse-tags clearable placeholder="请选择">
  10. <el-option v-for="item in options" :key="item.value" :label="item.text" :value="item.value">
  11. </el-option>
  12. </el-select>
  13. </div>
  14. <div class="timeselec">
  15. <el-date-picker v-model="value2" type="date" placeholder="选择日期">
  16. </el-date-picker>
  17. </div>
  18. <button style="width: 100px;height: 40px;background-color: aqua;" @click="chaxun2(value, value2)">查询</button>
  19. </div>
  20. <div> <el-table :header-cell-style="{
  21. background: 'rgba(30, 111, 200,0.8)',
  22. color: 'white',
  23. textAlign: 'center',
  24. border: '1px rgb(70, 91, 117) solid',
  25. }" :data="tableData" style="width: 100%">
  26. <el-table-column prop="company" label="店面" width="100">
  27. </el-table-column>
  28. <el-table-column prop="tqxl" label="同期销量">
  29. </el-table-column>
  30. <el-table-column prop="ymb" label="月目标">
  31. </el-table-column>
  32. <el-table-column prop="rzdj" label="日增定交">
  33. </el-table-column>
  34. <el-table-column prop="lcdd" label="留存订单">
  35. </el-table-column>
  36. <el-table-column prop="drjc" label="当日交车">
  37. </el-table-column>
  38. <el-table-column prop="yljc" label="月累交车">
  39. </el-table-column>
  40. <el-table-column prop="wcl" label="完成率">
  41. </el-table-column>
  42. <el-table-column prop="hb" label="环比">
  43. </el-table-column>
  44. <el-table-column prop="tqxl_jzdq" label="同期销量(截至当前)">
  45. </el-table-column>
  46. <el-table-column prop="tb" label="同比">
  47. </el-table-column>
  48. <el-table-column prop="kczl" label="库存总量">
  49. </el-table-column>
  50. <el-table-column prop="kcje" label="库存金额">
  51. </el-table-column>
  52. <el-table-column prop="kcsd" label="库存深度">
  53. </el-table-column>
  54. <el-table-column prop="yplqcltc" label="银票临期车辆台次">
  55. </el-table-column>
  56. <el-table-column prop="180zb" label="180天以上库存占比">
  57. </el-table-column>
  58. <el-table-column prop="180je" label="180以上车辆金额">
  59. </el-table-column>
  60. <el-table-column prop="xjczb" label="现金车占比">
  61. </el-table-column>
  62. <el-table-column prop="xjcje" label="现金车金额">
  63. </el-table-column>
  64. <el-table-column prop="ymygkcsd" label="月末预估库存深度">
  65. </el-table-column>
  66. </el-table></div>
  67. </el-tab-pane>
  68. <el-tab-pane label="分渠道销量统计分析" name="second">
  69. <div class="topbox" style="display: flex;justify-content: space-between;">
  70. <div style="width: 60%;"></div>
  71. <div class="selec">
  72. <el-select v-model="value" filterable multiple collapse-tags clearable placeholder="请选择">
  73. <el-option v-for="item in options" :key="item.value" :label="item.text" :value="item.value">
  74. </el-option>
  75. </el-select>
  76. </div>
  77. <div class="timeselec">
  78. <el-date-picker v-model="value3" type="month" placeholder="选择日期">
  79. </el-date-picker>
  80. </div>
  81. <button style="width: 100px;height: 40px;background-color: aqua;" @click="chaxun(value, value3)">查询</button>
  82. </div>
  83. <div> <el-table :header-cell-style="{
  84. background: 'rgba(30, 111, 200,0.8)',
  85. color: 'white',
  86. textAlign: 'center',
  87. border: '1px rgb(70, 91, 117) solid',
  88. }" :data="tableData2.table_data" style="width: 100%">
  89. <el-table-column v-for="(item, index) in tableData2.table_title" :prop="item" :label="item" :key="index"
  90. width="100">
  91. </el-table-column>
  92. </el-table></div>
  93. </el-tab-pane>
  94. </el-tabs>
  95. </div>
  96. </template>
  97. <script>
  98. import { column } from "./tuozhuai";
  99. import { jxctabledataInfo, fqdxltabledataInfo } from "../../../servuces/prove";
  100. export default {
  101. data () {
  102. return {
  103. //进销存
  104. tableData: [],
  105. tableData2: [],
  106. options: [],
  107. value: '',
  108. value2: '',
  109. value3: '',
  110. activeName: 'first'
  111. }
  112. },
  113. created () {
  114. const data = sessionStorage.getItem('data')
  115. console.log(data);
  116. if (data) {
  117. this.options = JSON.parse(data)
  118. }
  119. },
  120. mounted () {
  121. column(this.tableData)
  122. column(this.tableData2)
  123. this.jxctabledataapi()
  124. this.fqdxltabledataapi()
  125. },
  126. methods: {
  127. chaxun (value, value3) {
  128. const strvalue = value.join(',')
  129. const date = new Date(value3)
  130. // 获取年份和月份
  131. const year = date.getFullYear();
  132. const month = date.getMonth() + 1; // 月份从0开始,需要加1
  133. // 将年份和月份拼接成所需形式的字符串
  134. const strvalue1 = `${year}-${month}`;
  135. fqdxltabledataInfo({ "company_ids": strvalue, "search_month": strvalue1 }).then(res => {
  136. console.log('查询分期业务', res);
  137. this.tableData2 = res.data
  138. }
  139. )
  140. // console.log(strvalue, strvalue1);
  141. },
  142. chaxun2 (value, value2) {
  143. const strvalue = value.join(',')
  144. const date = new Date(value2)
  145. // 获取年份和月份
  146. const year = date.getFullYear();
  147. const month = date.getMonth() + 1; // 月份从0开始,需要加1
  148. const day = date.getDate()
  149. // 将年份和月份拼接成所需形式的字符串
  150. const strvalue1 = `${year}-${month}-${day}`;
  151. jxctabledataInfo({ "company_ids": strvalue, "search_date": strvalue1 }).then(res => {
  152. // console.log('查询分期业务', res);
  153. this.tableData = res.data
  154. // this.tableDatahj = res.footer
  155. }
  156. )
  157. console.log(strvalue, strvalue1);
  158. },
  159. handleClick (tab, event) {
  160. console.log(tab, event);
  161. // const activeTab = tab.index
  162. // console.log(activeTab);
  163. // if (activeTab === 2) {
  164. // column(this.tableData)
  165. // }
  166. },
  167. //进销存接口数据
  168. jxctabledataapi () {
  169. jxctabledataInfo().then(res => {
  170. // console.log(res);
  171. this.tableData = res.data
  172. })
  173. },
  174. //分渠道销量统计
  175. fqdxltabledataapi () {
  176. fqdxltabledataInfo().then(res => {
  177. console.log('分销渠道', res.data);
  178. this.tableData2 = res.data
  179. console.log(this.tableData2);
  180. })
  181. column(this.tableData2)
  182. }
  183. }
  184. }
  185. </script>
  186. <style>
  187. /* .el-table tr {
  188. background-color: none;
  189. color: white;
  190. } */
  191. .el-table .warning-row {
  192. background-color: rgba(15, 78, 146, 0.827);
  193. }
  194. .el-table .success-row {
  195. background-color: rgb(15, 78, 146, 0.5);
  196. }
  197. .has-gutter tr th:last-child {
  198. background-color: rgba(30, 111, 200, 0.8);
  199. }
  200. .el-table tr {
  201. background-color: rgb(15, 78, 146, 0.5);
  202. }
  203. </style>
  204. <style scoped lang="scss">
  205. .JCDetails {
  206. .selec {
  207. margin: 0 0 20px 0;
  208. }
  209. }
  210. ::v-deep .el-table {
  211. background-color: transparent;
  212. border-color: rgb(70, 91, 117);
  213. }
  214. ::v-deep .el-table td,
  215. .building-top .el-table th.is-leaf {
  216. border-color: rgb(70, 91, 117);
  217. color: white;
  218. }
  219. ::v-deep .el-table td:hover {
  220. color: rgb(5, 51, 159);
  221. }
  222. ::v-deep .has-gutter th {
  223. border-color: rgb(70, 91, 117);
  224. }
  225. ::v-deep .el-table--enable-row-hover .el-table__body tr:hover>td {
  226. background-color: rgb(58, 147, 189);
  227. }
  228. ::v-deep #tab-first,
  229. ::v-deep #tab-second,
  230. ::v-deep #tab-third,
  231. ::v-deep #tab-fourth {
  232. color: #fff; //设置修改默认蚊子颜色,背景颜色,等
  233. }
  234. ::v-deep .el-tabs__item.is-active {
  235. color: rgb(37, 99, 214) !important;
  236. }
  237. </style>