checkRecordModal.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <!-- 调账记录 -->
  3. <a-drawer
  4. :title="'调账记录'+titVal"
  5. placement="right"
  6. closable
  7. :visible="isShow"
  8. class="lookUpCustomers-modal"
  9. @close="isShow=false"
  10. width="75%">
  11. <a-spin :spinning="spinning" tip="Loading...">
  12. <!-- 搜索条件 -->
  13. <div ref="tableSearch" class="table-page-search-wrapper">
  14. <a-form layout="inline" id="dealerAccountNewList-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="申请日期" prop="time">
  18. <rangeDate
  19. ref="rangeDate"
  20. :showTime="false"
  21. :today="false"
  22. :value="queryParam.time"
  23. id="tireSalesDealerList-time"
  24. @change="dateChange" />
  25. </a-form-model-item>
  26. </a-col>
  27. <a-col :md="6" :sm="24">
  28. <a-form-model-item label="入账类型">
  29. <v-select
  30. v-model="queryParam.dealerLevel"
  31. ref="dealerLevel"
  32. id="tireSalesDealerList-dealerLevel"
  33. code="DEALER_LEVEL"
  34. placeholder="请选择入账类型"
  35. allowClear></v-select>
  36. </a-form-model-item>
  37. </a-col>
  38. <a-col :md="6" :sm="24">
  39. <a-form-model-item label="审核状态">
  40. <v-select
  41. v-model="queryParam.dealerLevel"
  42. ref="dealerLevel"
  43. id="tireSalesDealerList-dealerLevel"
  44. code="DEALER_LEVEL"
  45. placeholder="请选择审核状态"
  46. allowClear></v-select>
  47. </a-form-model-item>
  48. </a-col>
  49. <a-col :md="4" :sm="24">
  50. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="dealerAccountNewList-refresh">查询</a-button>
  51. <a-button style="margin:0 5px" @click="resetSearchForm" :disabled="disabled" id="dealerAccountNewList-reset">重置</a-button>
  52. </a-col>
  53. </a-row>
  54. </a-form>
  55. </div>
  56. <!-- 列表 -->
  57. <s-table
  58. class="sTable fixPagination"
  59. ref="table"
  60. :style="{ height: tableHeight+70+'px' }"
  61. size="small"
  62. :rowKey="(record) => record.id"
  63. :columns="columns"
  64. :data="loadData"
  65. :pageSize="30"
  66. :scroll="{ y: tableHeight }"
  67. :defaultLoadData="false"
  68. bordered>
  69. <!-- 轮胎补贴金额 -->
  70. <template slot="moneyNum" slot-scope="text, record">
  71. <span v-if="$hasPermissions('B_salesDetail')" class="link-bule" @click="handleDetail(record)">111111111111</span>
  72. <span v-else>111111111111</span>
  73. </template>
  74. </s-table>
  75. </a-spin>
  76. <!-- 审核进度 -->
  77. <verifyModal v-drag :openModal="openVerifyModal" :itemId="itemId" :itemSn="itemSn" @close="openVerifyModal=false"></verifyModal>
  78. </a-drawer>
  79. </template>
  80. <script>
  81. import { commonMixin } from '@/utils/mixin'
  82. // 组件
  83. import { STable, VSelect } from '@/components'
  84. import chooseDealer from '@/views/dealerManagement/provincialWarehouseManagement/chooseDealer.vue'
  85. import { saveBatchDealerList } from '@/api/provinceServiceCenter'
  86. import rangeDate from '@/views/common/rangeDate.vue'
  87. import verifyModal from './verifyModal.vue'
  88. // 接口
  89. import { dealerUserList } from '@/api/dealer'
  90. export default {
  91. name: 'AddDealerModal',
  92. mixins: [commonMixin],
  93. components: { STable, VSelect, chooseDealer, rangeDate, verifyModal },
  94. props: {
  95. openModal: { // 弹框显示状态
  96. type: Boolean,
  97. default: false
  98. }
  99. },
  100. data () {
  101. return {
  102. spinning: false,
  103. isShow: this.openModal, // 是否打开弹框
  104. titVal: '(经销商名称)',
  105. queryParam: { time: [], dealerLevel: '' },
  106. openVerifyModal: true, // 审核进度弹窗
  107. columns: [
  108. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  109. { title: '申请时间', dataIndex: 'dealerTypeName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  110. { title: '审核时间', dataIndex: 'dealerTypeName1', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
  111. { title: '记账日期', dataIndex: 'dealerTypeName2', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
  112. { title: '入账类型', dataIndex: 'dealerTypeName3', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
  113. { title: '金额(¥)', dataIndex: 'dealerLevelDictValue', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
  114. { title: '审核状态', dataIndex: 'dealerTypeName4', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
  115. { title: '操作', scopedSlots: { customRender: 'moneyNum' }, width: '10%', align: 'center' },
  116. { title: '备注', dataIndex: 'createDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
  117. ],
  118. // 加载数据方法 必须为 Promise 对象
  119. loadData: parameter => {
  120. this.disabled = true
  121. this.spinning = true
  122. return dealerUserList(Object.assign(parameter, this.queryParam)).then(res => {
  123. let data
  124. if (res.status == 200) {
  125. data = res.data
  126. // 计算表格序号
  127. const no = (data.pageNo - 1) * data.pageSize
  128. for (var i = 0; i < data.list.length; i++) {
  129. data.list[i].no = no + i + 1
  130. }
  131. }
  132. this.disabled = false
  133. this.spinning = false
  134. return data
  135. })
  136. }
  137. }
  138. },
  139. methods: {
  140. // 审核进度
  141. handleDetail () {
  142. this.openVerifyModal = true
  143. },
  144. // 日期选择 change
  145. dateChange (date) {
  146. if (date[0] && date[1]) {
  147. this.queryParam.time = date
  148. } else {
  149. this.queryParam.time = []
  150. }
  151. this.queryParam.bizBeginDate = date[0] ? date[0].replace(/-/g, '') : ''
  152. this.queryParam.bizEndDate = date[1] ? date[1].replace(/-/g, '') : ''
  153. },
  154. handleAddDealer (list) {
  155. const newList = list.map(item => {
  156. return {
  157. dealerSn: item.dealerSn,
  158. dealerName: item.dealerName,
  159. dealerLevel: item.dealerLevel
  160. }
  161. })
  162. this.spinning = true
  163. saveBatchDealerList(newList).then(res => {
  164. if (res.status == 200) {
  165. this.$message.success(res.message)
  166. }
  167. this.spinning = false
  168. this.$emit('ok')
  169. this.isShow = false
  170. })
  171. }
  172. },
  173. watch: {
  174. // 父页面传过来的弹框状态
  175. openModal (newValue, oldValue) {
  176. this.isShow = newValue
  177. },
  178. // 重定义的弹框状态
  179. isShow (newValue, oldValue) {
  180. if (!newValue) {
  181. this.$emit('close')
  182. }
  183. }
  184. }
  185. }
  186. </script>