CLKCdetails_20230710155036.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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. this.jxctabledataapi()
  123. this.fqdxltabledataapi()
  124. },
  125. methods: {
  126. chaxun (value, value3) {
  127. const strvalue = value.join(',')
  128. const date = new Date(value3)
  129. // 获取年份和月份
  130. const year = date.getFullYear();
  131. const month = date.getMonth() + 1; // 月份从0开始,需要加1
  132. // 将年份和月份拼接成所需形式的字符串
  133. const strvalue1 = `${year}-${month}`;
  134. fqdxltabledataInfo({ "company_ids": strvalue, "search_month": strvalue1 }).then(res => {
  135. console.log('查询分期业务', res);
  136. this.tableData2 = res.data
  137. }
  138. )
  139. // console.log(strvalue, strvalue1);
  140. },
  141. chaxun2 (value, value2) {
  142. const strvalue = value.join(',')
  143. const date = new Date(value2)
  144. // 获取年份和月份
  145. const year = date.getFullYear();
  146. const month = date.getMonth() + 1; // 月份从0开始,需要加1
  147. const day = date.getDate()
  148. // 将年份和月份拼接成所需形式的字符串
  149. const strvalue1 = `${year}-${month}-${day}`;
  150. jxctabledataInfo({ "company_ids": strvalue, "search_date": strvalue1 }).then(res => {
  151. // console.log('查询分期业务', res);
  152. this.tableData = res.data
  153. // this.tableDatahj = res.footer
  154. }
  155. )
  156. console.log(strvalue, strvalue1);
  157. },
  158. handleClick (tab, event) {
  159. console.log(tab, event);
  160. const activeTab = tab.index
  161. console.log(activeTab);
  162. if (activeTab === 2) {
  163. column(this.tableData2)
  164. }
  165. },
  166. //进销存接口数据
  167. jxctabledataapi () {
  168. jxctabledataInfo().then(res => {
  169. // console.log(res);
  170. this.tableData = res.data
  171. })
  172. },
  173. //分渠道销量统计
  174. fqdxltabledataapi () {
  175. fqdxltabledataInfo().then(res => {
  176. console.log('分销渠道', res.data);
  177. this.tableData2 = res.data
  178. console.log(this.tableData2);
  179. })
  180. }
  181. }
  182. }
  183. </script>
  184. <style>
  185. /* .el-table tr {
  186. background-color: none;
  187. color: white;
  188. } */
  189. .el-table .warning-row {
  190. background-color: rgba(15, 78, 146, 0.827);
  191. }
  192. .el-table .success-row {
  193. background-color: rgb(15, 78, 146, 0.5);
  194. }
  195. .has-gutter tr th:last-child {
  196. background-color: rgba(30, 111, 200, 0.8);
  197. }
  198. .el-table tr {
  199. background-color: rgb(15, 78, 146, 0.5);
  200. }
  201. </style>
  202. <style scoped lang="scss">
  203. .JCDetails {
  204. .selec {
  205. margin: 0 0 20px 0;
  206. }
  207. }
  208. ::v-deep .el-table {
  209. background-color: transparent;
  210. border-color: rgb(70, 91, 117);
  211. }
  212. ::v-deep .el-table td,
  213. .building-top .el-table th.is-leaf {
  214. border-color: rgb(70, 91, 117);
  215. color: white;
  216. }
  217. ::v-deep .el-table td:hover {
  218. color: rgb(5, 51, 159);
  219. }
  220. ::v-deep .has-gutter th {
  221. border-color: rgb(70, 91, 117);
  222. }
  223. ::v-deep .el-table--enable-row-hover .el-table__body tr:hover>td {
  224. background-color: rgb(58, 147, 189);
  225. }
  226. ::v-deep #tab-first,
  227. ::v-deep #tab-second,
  228. ::v-deep #tab-third,
  229. ::v-deep #tab-fourth {
  230. color: #fff; //设置修改默认蚊子颜色,背景颜色,等
  231. }
  232. ::v-deep .el-tabs__item.is-active {
  233. color: rgb(37, 99, 214) !important;
  234. }
  235. </style>