checkRecordModal.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <!-- 调账记录 -->
  3. <a-drawer
  4. :title="'调账记录('+$route.params.name+')'"
  5. placement="right"
  6. closable
  7. :visible="isShow"
  8. class="checkRecord-modal"
  9. @close="isShow=false"
  10. width="78%">
  11. <a-spin :spinning="spinning" tip="Loading...">
  12. <!-- 搜索条件 -->
  13. <div ref="tableSearch" class="table-page-search-wrapper">
  14. <a-form layout="inline" id="checkRecordModal-form" @keyup.enter.native="$refs.table.refresh(true)">
  15. <a-row :gutter="15">
  16. <a-col :md="6" :sm="24">
  17. <a-form-model-item label="申请日期">
  18. <rangeDate
  19. ref="rangeDate"
  20. :value="time"
  21. id="checkRecordModal-time"
  22. @change="dateChange" />
  23. </a-form-model-item>
  24. </a-col>
  25. <a-col :md="6" :sm="24">
  26. <a-form-model-item label="入账类型">
  27. <v-select
  28. v-model="queryParam.amountType"
  29. ref="amountType"
  30. id="checkRecordModal-amountType"
  31. code="DEALER_AMOUNT_TYPE"
  32. placeholder="请选择入账类型"
  33. allowClear></v-select>
  34. </a-form-model-item>
  35. </a-col>
  36. <a-col :md="6" :sm="24">
  37. <a-form-model-item label="审核状态">
  38. <v-select
  39. v-model="queryParam.status"
  40. id="checkRecordModal-status"
  41. code="DEALER_ADJU_ADUIT"
  42. placeholder="请选择审核状态"
  43. allowClear></v-select>
  44. </a-form-model-item>
  45. </a-col>
  46. <a-col :md="4" :sm="24">
  47. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="dealerAccountNewList-refresh">查询</a-button>
  48. <a-button style="margin:0 5px" @click="resetSearchForm" :disabled="disabled" id="dealerAccountNewList-reset">重置</a-button>
  49. </a-col>
  50. </a-row>
  51. </a-form>
  52. </div>
  53. <!-- 列表 -->
  54. <s-table
  55. class="sTable fixPagination"
  56. ref="table"
  57. :style="{ height:770+'px' }"
  58. size="small"
  59. :rowKey="(record) => record.id"
  60. :columns="columns"
  61. :data="loadData"
  62. :pageSize="30"
  63. :scroll="{ y: 730 }"
  64. :defaultLoadData="false"
  65. bordered>
  66. <!-- 记账日期 审核通过时显示审核时间 -->
  67. <template slot="postingDate" slot-scope="text, record">
  68. {{ record.status==='AUDIT_PASS'?record.auditDate:'--' }}
  69. </template>
  70. <!-- 操作 -->
  71. <template slot="action" slot-scope="text, record">
  72. <a-button
  73. size="small"
  74. type="link"
  75. v-if="$hasPermissions('B_dealerAccount_edit')"
  76. class="button-info"
  77. @click="handleCheck(record)"
  78. :id="'checkRecordModal-audit-btn'+record.id">审核进度</a-button>
  79. </template>
  80. </s-table>
  81. </a-spin>
  82. <!-- 审核进度 -->
  83. <verifyModal v-drag :openModal="openVerifyModal" :itemSn="itemSn" @close="openVerifyModal=false"></verifyModal>
  84. </a-drawer>
  85. </template>
  86. <script>
  87. import { commonMixin } from '@/utils/mixin'
  88. // 组件
  89. import { STable, VSelect } from '@/components'
  90. import rangeDate from '@/views/common/rangeDate.vue'
  91. import verifyModal from './verifyModal.vue'
  92. // 接口
  93. import { dealerAccountRecordList } from '@/api/dealerAccount'
  94. export default {
  95. name: 'CheckRecordModal',
  96. mixins: [commonMixin],
  97. components: { STable, VSelect, rangeDate, verifyModal },
  98. props: {
  99. openModal: { // 弹框显示状态
  100. type: Boolean,
  101. default: false
  102. }
  103. },
  104. data () {
  105. const _this = this
  106. return {
  107. spinning: false,
  108. disabled: false, // 查询、重置按钮是否可操作
  109. isShow: this.openModal, // 是否打开弹框
  110. time: [], // 申请时间
  111. queryParam: {
  112. beginDate: '', // 开始时间
  113. endDate: '', // 结束时间
  114. amountType: undefined, // 入账类型
  115. status: undefined// 审核状态
  116. },
  117. openVerifyModal: false, // 审核进度弹窗
  118. itemSn: null, // 当前行sn
  119. columns: [
  120. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  121. { title: '申请时间', dataIndex: 'createDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
  122. { title: '审核时间', dataIndex: 'auditDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
  123. { title: '记账日期', width: '13%', align: 'center', scopedSlots: { customRender: 'postingDate' } },
  124. { title: '入账类型', dataIndex: 'amountTypeDictValue', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
  125. { title: '金额(¥)', dataIndex: 'changeAmount', width: '13%', align: 'right', customRender: text => { return (text || text == 0) ? _this.toThousands(text) : '--' } },
  126. { title: '审核状态', dataIndex: 'statusDictValue', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
  127. { title: '操作', scopedSlots: { customRender: 'action' }, width: '13%', align: 'center' },
  128. { title: '备注', dataIndex: 'remark', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
  129. ],
  130. // 加载数据方法 必须为 Promise 对象
  131. loadData: parameter => {
  132. this.disabled = true
  133. this.spinning = true
  134. this.queryParam.dealerSn = this.$route.params.sn
  135. return dealerAccountRecordList(Object.assign(parameter, this.queryParam)).then(res => {
  136. let data
  137. if (res.status == 200) {
  138. data = res.data
  139. // 计算表格序号
  140. const no = (data.pageNo - 1) * data.pageSize
  141. for (var i = 0; i < data.list.length; i++) {
  142. data.list[i].no = no + i + 1
  143. }
  144. }
  145. this.disabled = false
  146. this.spinning = false
  147. return data
  148. })
  149. }
  150. }
  151. },
  152. methods: {
  153. // 审核进度
  154. handleCheck (row) {
  155. this.itemSn = row.accountChangeSn
  156. this.openVerifyModal = true
  157. },
  158. // 日期选择 change
  159. dateChange (date) {
  160. if (date[0] && date[1]) {
  161. this.time = date
  162. } else {
  163. this.time = []
  164. }
  165. this.queryParam.beginDate = date[0] || ''
  166. this.queryParam.endDate = date[1] || ''
  167. },
  168. // 重置
  169. resetSearchForm () {
  170. this.time = []
  171. this.queryParam.beginDate = ''
  172. this.queryParam.endDate = ''
  173. this.queryParam.amountType = undefined
  174. this.queryParam.status = undefined
  175. this.$refs.rangeDate.resetDate()
  176. this.$refs.table.refresh(true)
  177. }
  178. },
  179. watch: {
  180. // 父页面传过来的弹框状态
  181. openModal (newValue, oldValue) {
  182. this.isShow = newValue
  183. },
  184. // 重定义的弹框状态
  185. isShow (newValue, oldValue) {
  186. if (!newValue) {
  187. this.$emit('close')
  188. this.resetSearchForm()
  189. } else {
  190. this.$nextTick(() => {
  191. this.$refs.table.refresh(true)
  192. })
  193. }
  194. }
  195. }
  196. }
  197. </script>