list.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <a-card size="small" :bordered="false" class="ledgerRecordList-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 v-model="queryParam.creatDate" id="ledgerRecordList-creatDate"/>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :md="6" :sm="24">
  13. <a-form-item label="客户名称">
  14. <a-input id="ledgerRecordList-purchaseNo" v-model.trim="queryParam.purchaseNo" allowClear placeholder="请输入客户名称"/>
  15. </a-form-item>
  16. </a-col>
  17. <a-col :md="6" :sm="24">
  18. <a-form-item label="配件名称">
  19. <a-input id="ledgerRecordList-purchaseNo" v-model.trim="queryParam.purchaseNo" allowClear placeholder="请输入配件名称"/>
  20. </a-form-item>
  21. </a-col>
  22. <template v-if="advanced">
  23. <a-col :md="6" :sm="24">
  24. <a-form-item label="配件编码">
  25. <a-input id="ledgerRecordList-purchaseNo" v-model.trim="queryParam.purchaseNo" allowClear placeholder="请输入配件编码"/>
  26. </a-form-item>
  27. </a-col>
  28. </template>
  29. <a-col :md="6" :sm="24">
  30. <span class="table-page-search-submitButtons">
  31. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="ledgerRecordList-refresh">查询</a-button>
  32. <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="ledgerRecordList-reset">重置</a-button>
  33. <a @click="advanced=!advanced" style="margin-left: 8px">
  34. {{ advanced ? '收起' : '展开' }}
  35. <a-icon :type="advanced ? 'up' : 'down'"/>
  36. </a>
  37. </span>
  38. </a-col>
  39. </a-row>
  40. </a-form>
  41. </div>
  42. <!-- alert -->
  43. <a-alert type="info" showIcon style="margin-bottom:15px">
  44. <div slot="message">分账金额: <strong>¥6</strong> 元</div>
  45. </a-alert>
  46. <!-- 列表 -->
  47. <s-table
  48. class="sTable"
  49. ref="table"
  50. size="default"
  51. :rowKey="(record) => record.id"
  52. :columns="columns"
  53. :data="loadData"
  54. :scroll="{ x: 1540 }"
  55. bordered>
  56. <!-- 结算单号 -->
  57. <template slot="purchaseNo" slot-scope="text, record">
  58. <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.purchaseNo }}</span>
  59. </template>
  60. <!-- 结算方式 -->
  61. <template slot="sss" slot-scope="text, record">
  62. <span>{{ record.state == 1 ? '现金' : '微信' }}</span>
  63. </template>
  64. <!-- 操作 -->
  65. <template slot="action" slot-scope="text, record">
  66. <a-button size="small" type="dashed" @click="handleDetail(record)" id="ledgerRecordList-detail-btn">详情</a-button>
  67. </template>
  68. </s-table>
  69. </a-card>
  70. </template>
  71. <script>
  72. import { STable, VSelect } from '@/components'
  73. // import { getRoleList, getServiceList } from '@/api/manage'
  74. export default {
  75. components: { STable, VSelect },
  76. data () {
  77. return {
  78. advanced: false, // 高级搜索 展开/关闭
  79. disabled: false, // 查询、重置按钮是否可操作
  80. // 查询参数
  81. queryParam: {},
  82. // 表头
  83. columns: [
  84. { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
  85. { title: '分账时间', dataIndex: 'name', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  86. { title: '客户名称', dataIndex: 'pssayType', align: 'center', customRender: function (text) { return text || '--' } },
  87. { title: '关联工单', dataIndex: 'paddyType', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
  88. { title: '配件名称', scopedSlots: { customRender: 'purchaseNo' }, align: 'center' },
  89. { title: '配件编码', dataIndex: 'totalP', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
  90. { title: '数量', dataIndex: 'creatDate', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  91. { title: '分账类型', dataIndex: 'payType', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
  92. { title: '分账金额(¥)', scopedSlots: { customRender: 'sss' }, width: 120, align: 'center' },
  93. { title: '分账状态', dataIndex: 'paysType', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
  94. { title: '备注', dataIndex: 'remarks', align: 'center', ellipsis: true }
  95. ],
  96. // 加载数据方法 必须为 Promise 对象
  97. loadData: parameter => {
  98. this.disabled = true
  99. // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
  100. // const data = res.data
  101. // const no = (data.pageNo - 1) * data.pageSize
  102. // for (var i = 0; i < data.list.length; i++) {
  103. // data.list[i].no = no + i + 1
  104. // }
  105. // this.disabled = false
  106. // return data
  107. // })
  108. const _this = this
  109. return new Promise(function (resolve, reject) {
  110. const data = {
  111. pageNo: 1,
  112. pageSize: 10,
  113. list: [
  114. { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
  115. ],
  116. count: 10
  117. }
  118. const no = (data.pageNo - 1) * data.pageSize
  119. for (var i = 0; i < data.list.length; i++) {
  120. data.list[i].no = no + i + 1
  121. }
  122. _this.disabled = false
  123. resolve(data)
  124. })
  125. }
  126. }
  127. },
  128. methods: {
  129. // 详情
  130. handleDetail (row) {
  131. this.$router.push({ path: `/financialManagement/ledgerRecord/detail/${row.id}` })
  132. },
  133. // 审核
  134. handleExamine (row, type) {
  135. const _this = this
  136. this.$confirm({
  137. title: '提示',
  138. content: '操作后不可恢复,确定要进行' + (type == 1 ? ' 通过 ' : ' 不通过 ') + '操作吗?',
  139. centered: true,
  140. onOk () {
  141. // delectRolePower({
  142. // id: row.id
  143. // }).then(res => {
  144. // console.log(res, 'res1111')
  145. // if (res.status == 200) {
  146. // _this.$message.success(res.message)
  147. // _this.$refs.table.refresh()
  148. // }
  149. // })
  150. }
  151. })
  152. },
  153. // 重置
  154. resetSearchForm () {
  155. this.queryParam.orderBundleNo = ''
  156. this.queryParam.orderBundle.custMobile = ''
  157. this.queryParam.bundleName = ''
  158. this.queryParam.itemName = ''
  159. this.oldTime = undefined
  160. this.newTime = undefined
  161. this.$refs.table.refresh(true)
  162. }
  163. }
  164. }
  165. </script>
  166. <style lang="less">
  167. .ledgerRecordList-wrap{
  168. .sTable{
  169. margin-top: 15px;
  170. }
  171. }
  172. </style>