list.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <a-card size="small" :bordered="false" class="provinceTypeSalesDetailsList-wrap">
  3. <!-- 搜索条件 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  6. <a-row :gutter="15">
  7. <a-col :md="6" :sm="24">
  8. <a-form-item label="创建时间">
  9. <rangeDate ref="rangeDate" @change="dateChange" />
  10. </a-form-item>
  11. </a-col>
  12. <a-col :md="6" :sm="24">
  13. <a-form-item label="区域">
  14. <a-select id="provinceTypeSalesDetailsList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择区域" allowClear >
  15. <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
  16. </a-select>
  17. </a-form-item>
  18. </a-col>
  19. <a-col :md="6" :sm="24">
  20. <a-form-item label="省份">
  21. <a-select id="provinceTypeSalesDetailsList-state" v-model="queryParam.state" placeholder="请选择省份" allowClear >
  22. <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
  23. </a-select>
  24. </a-form-item>
  25. </a-col>
  26. <a-col :md="6" :sm="24">
  27. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="provinceTypeSalesDetailsList-refresh">查询</a-button>
  28. <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="provinceTypeSalesDetailsList-reset">重置</a-button>
  29. </a-col>
  30. </a-row>
  31. </a-form>
  32. </div>
  33. <!-- 列表 -->
  34. <s-table
  35. class="sTable"
  36. ref="table"
  37. size="defalut"
  38. :rowKey="(record) => record.id"
  39. :columns="columns"
  40. :data="loadData"
  41. :scroll="{ x: 3650 }"
  42. bordered>
  43. </s-table>
  44. </a-card>
  45. </template>
  46. <script>
  47. import { STable, VSelect } from '@/components'
  48. import reportData from '@/libs/reportData'
  49. import rangeDate from '@/views/common/rangeDate.vue'
  50. // import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
  51. // import { allocateTypeAllList } from '@/api/allocateType'
  52. export default {
  53. components: { STable, VSelect, rangeDate },
  54. data () {
  55. return {
  56. advanced: false, // 高级搜索 展开/关闭
  57. tableHeight: 0,
  58. queryParam: { // 查询条件
  59. beginDate: '',
  60. endDate: '',
  61. targetName: '', // 调往对象
  62. allocateTypeSn: undefined, // 调拨类型
  63. state: undefined, // 业务状态
  64. allocateNo: '' // 调拨单号
  65. },
  66. disabled: false, // 查询、重置按钮是否可操作
  67. exportLoading: false,
  68. reportData: reportData.reportDataList,
  69. columns: [
  70. { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
  71. { title: '区域', dataIndex: 'area', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
  72. { title: '省份', dataIndex: 'province', align: 'center', customRender: function (text) { return text || '--' } },
  73. { title: '箭牌滤清器', dataIndex: 'targetName', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  74. { title: '冠牌滤清器', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  75. { title: '滤清器合计', dataIndex: 'totalQty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  76. { title: '箭牌雨刮片', dataIndex: 'totalCost', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  77. { title: '冠牌雨刮片', dataIndex: 'totalPrice', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  78. { title: '雨刮片合计', dataIndex: 'auditTime', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  79. { title: '箭牌刹车片', dataIndex: 'allocateTypeName', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  80. { title: '箭牌感应线', dataIndex: 'stateDictValue', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  81. { title: '冠牌刹车片', dataIndex: 'printStateDictValue', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  82. { title: 'TBU刹车片', dataIndex: 'printCount', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  83. { title: 'TBU刹车油', dataIndex: 'printCounts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  84. { title: 'TBU感应线', dataIndex: 'printCsounts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  85. { title: '刹车片合计', dataIndex: 'printdCounts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  86. { title: '德路斯润滑油', dataIndex: 'prfintCounts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  87. { title: '德路斯刹车油', dataIndex: 'printCogunts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  88. { title: '德路斯变速箱油', dataIndex: 'phrintCounts', width: 140, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  89. { title: '德路斯合计', dataIndex: 'printCsountss', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  90. { title: '稳升点火线圈', dataIndex: 'prinftCounts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  91. { title: '稳升灯泡', dataIndex: 'prisntCogunts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  92. { title: '稳升合计', dataIndex: 'prinxtCounts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  93. { title: '汇箭', dataIndex: 'printCocunts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  94. { title: '布瑞斯', dataIndex: 'printCvounts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  95. { title: '箭牌喇叭', dataIndex: 'printCgounts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  96. { title: '品牌合计', dataIndex: 'printCouhnts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  97. { title: 'NGK', dataIndex: 'printCoujnts', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  98. { title: '品牌+NGK总合计', dataIndex: 'printCournts', width: 150, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
  99. ],
  100. // 加载数据方法 必须为 Promise 对象
  101. loadData: parameter => {
  102. this.disabled = true
  103. // return allocateBillList(Object.assign(parameter, this.queryParam)).then(res => {
  104. // const data = res.data
  105. // const no = (data.pageNo - 1) * data.pageSize
  106. // for (var i = 0; i < data.list.length; i++) {
  107. // data.list[i].no = no + i + 1
  108. // }
  109. // this.disabled = false
  110. // return data
  111. // })
  112. const _this = this
  113. return new Promise(function (resolve, reject) {
  114. const data = {
  115. pageNo: 1,
  116. pageSize: 10,
  117. list: reportData.reportDataList,
  118. count: 10
  119. }
  120. for (var i = 0; i < data.list.length; i++) {
  121. data.list[i].no = i + 1
  122. }
  123. _this.disabled = false
  124. resolve(data)
  125. })
  126. },
  127. allocateTypeList: [], // 调拨类型
  128. openModal: false // 新增编辑 弹框
  129. }
  130. },
  131. methods: {
  132. // 创建时间 change
  133. dateChange (date) {
  134. this.queryParam.beginDate = date[0]
  135. this.queryParam.endDate = date[1]
  136. },
  137. // 重置
  138. resetSearchForm () {
  139. this.$refs.rangeDate.resetDate()
  140. this.queryParam.beginDate = ''
  141. this.queryParam.endDate = ''
  142. this.queryParam.targetName = ''
  143. this.queryParam.allocateTypeSn = undefined
  144. this.queryParam.state = undefined
  145. this.queryParam.allocateNo = ''
  146. this.$refs.table.refresh(true)
  147. }
  148. },
  149. beforeRouteEnter (to, from, next) {
  150. next(vm => {})
  151. }
  152. }
  153. </script>