list.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <a-card :bordered="false" class="urgentItemsOffsetList-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. <a-range-picker
  10. style="width:100%"
  11. id="urgentItemsOffsetList-creatTime"
  12. :disabledDate="disabledDate"
  13. v-model="time"
  14. :format="dateFormat"
  15. :placeholder="['开始时间', '结束时间']" />
  16. </a-form-item>
  17. </a-form-item>
  18. </a-col>
  19. <a-col :md="6" :sm="24">
  20. <a-form-item label="客户名称">
  21. <a-select id="urgentItemsOffsetList-bundleName" placeholder="请选择" allowClear v-model="queryParam.dataSourceNo" :showSearch="true" option-filter-prop="children" :filter-option="filterOption">
  22. <a-select-option v-for="item in brandData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
  23. </a-select>
  24. </a-form-item>
  25. </a-col>
  26. <a-col :md="6" :sm="24">
  27. <a-form-item label="销售单号">
  28. <a-input id="urgentItemsOffsetList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入销售单号"/>
  29. </a-form-item>
  30. </a-col>
  31. <template v-if="advanced">
  32. <a-col :md="6" :sm="24">
  33. <a-form-item label="采购单号">
  34. <a-input id="urgentItemsOffsetList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入采购单号"/>
  35. </a-form-item>
  36. </a-col>
  37. </template>
  38. <a-col :md="6" :sm="24">
  39. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="urgentItemsOffsetList-refresh">查询</a-button>
  40. <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="urgentItemsOffsetList-reset">重置</a-button>
  41. <a @click="advanced=!advanced" style="margin-left: 8px">
  42. {{ advanced ? '收起' : '展开' }}
  43. <a-icon :type="advanced ? 'up' : 'down'"/>
  44. </a>
  45. </a-col>
  46. </a-row>
  47. </a-form>
  48. </div>
  49. <!-- 列表 -->
  50. <s-table
  51. class="sTable"
  52. ref="table"
  53. size="default"
  54. :rowKey="(record) => record.id"
  55. :columns="columns"
  56. :data="loadData"
  57. bordered>
  58. <!-- 状态 -->
  59. <template slot="state" slot-scope="text, record">
  60. <span>{{record.state == 1 ? '已启用' : '已禁用'}}</span>
  61. </template>
  62. <!-- 操作 -->
  63. <template slot="action" slot-scope="text, record">
  64. <a-button type="primary" @click="handleDetail(record)" id="urgentItemsOffsetList-detail-btn">详情</a-button>
  65. </template>
  66. </s-table>
  67. </a-card>
  68. </template>
  69. <script>
  70. import moment from 'moment'
  71. // import { customerBundleDelayList, customerBundleExportDelay } from '@/api/FinancialManagement'
  72. import { STable, VSelect } from '@/components'
  73. export default {
  74. components: { STable, VSelect },
  75. data () {
  76. return {
  77. advanced: false, // 高级搜索 展开/关闭
  78. queryParam: { // 查询条件
  79. bundleName: '', // 供应商名称
  80. state: undefined, // 状态
  81. },
  82. disabled: false, // 查询、重置按钮是否可操作
  83. dateFormat: 'YYYY-MM-DD',
  84. time: [], // 创建时间
  85. brandData: [], // 客户 下拉数据
  86. columns: [
  87. { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
  88. { title: '急件单号', dataIndex: 'productName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
  89. { title: '销售单号', dataIndex: 'productOldNum', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  90. { title: '客户名称', dataIndex: 'productBrand', width: 200, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
  91. { title: '总款数', dataIndex: 'productType', width: 200, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  92. { title: '总数量', dataIndex: 'inventoryNum', width: 180, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  93. { title: '创建时间', dataIndex: 'inventoryMoneys', width: 180, align: 'center' },
  94. { title: '冲减时间', dataIndex: 'inventoryMoney', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
  95. { title: '状态', scopedSlots: { customRender: 'state' }, width: 180, align: 'center' },
  96. { title: '操作', scopedSlots: { customRender: 'action' }, width: 240, align: 'center' }
  97. ],
  98. // 加载数据方法 必须为 Promise 对象
  99. loadData: parameter => {
  100. this.disabled = true
  101. // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
  102. // const data = res.data
  103. // const no = (data.pageNo - 1) * data.pageSize
  104. // for (var i = 0; i < data.list.length; i++) {
  105. // data.list[i].no = no + i + 1
  106. // }
  107. // this.disabled = false
  108. // return data
  109. // })
  110. const _this = this
  111. return new Promise(function(resolve, reject){
  112. const data = {
  113. pageNo: 1,
  114. pageSize: 10,
  115. list: [
  116. { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
  117. ]
  118. }
  119. const no = (data.pageNo - 1) * data.pageSize
  120. for (var i = 0; i < data.list.length; i++) {
  121. data.list[i].no = no + i + 1
  122. }
  123. _this.disabled = false
  124. resolve(data)
  125. })
  126. },
  127. }
  128. },
  129. methods: {
  130. // 不可选日期
  131. disabledDate (date, dateStrings) {
  132. return date && date.valueOf() > Date.now()
  133. },
  134. filterOption(input, option) {
  135. return (
  136. option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
  137. )
  138. },
  139. // 重置
  140. resetSearchForm () {
  141. this.queryParam.orderBundleNo = ''
  142. this.queryParam.orderBundle.custMobile = ''
  143. this.queryParam.bundleName = ''
  144. this.queryParam.itemName = ''
  145. this.oldTime = undefined
  146. this.newTime = undefined
  147. this.$refs.table.refresh(true)
  148. },
  149. // 详情
  150. handleDetail(row){
  151. this.$router.push({ path: `/salesManagement/urgentItemsOffset/detail/${row.id}` })
  152. }
  153. }
  154. }
  155. </script>
  156. <style lang="less">
  157. .urgentItemsOffsetList-wrap{
  158. .sTable{
  159. margin-top: 20px;
  160. table{
  161. width: auto;
  162. }
  163. }
  164. }
  165. </style>