index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <!-- 客户充值界面 -->
  2. <template>
  3. <div class="customer-top-up">
  4. <!-- 搜索条件区 -->
  5. <div class="search-section">
  6. <a-form :model="searchForm" layout="inline">
  7. <a-form-item field="customerName" label="客户名称">
  8. <a-input v-model="searchForm.customerName" placeholder="请输入客户名称" allow-clear />
  9. </a-form-item>
  10. <a-form-item>
  11. <a-space>
  12. <a-button type="primary" @click="handleSearch">搜索</a-button>
  13. <a-button @click="resetSearch">重置</a-button>
  14. </a-space>
  15. </a-form-item>
  16. </a-form>
  17. </div>
  18. <div class="audit-btn">
  19. <a-button @click="openTopsUp" type="text">
  20. <template #icon>
  21. <icon-plus-circle />
  22. </template>
  23. <template #default>充值</template>
  24. </a-button>
  25. </div>
  26. <!-- 数据表格 -->
  27. <a-table row-key="customerName" v-model:selectedKeys="selectedKeys" :row-selection="rowSelection"
  28. :columns="columns" :data="tableData" :pagination="pagination" :scroll="{ x: '100%', y: '400px' }">
  29. </a-table>
  30. <a-modal v-model:visible="showAdd" title="新增" @cancel="showAdd = false" @before-ok="submitAdd" okText="确定"
  31. width="800px" cancelText="关闭">
  32. <a-form :model="formAdd" auto-label-width>
  33. <a-form-item field="topsUpStatus" label="充值类型">
  34. <a-radio-group v-model="formAdd.topsUpStatus" :options="options" />
  35. </a-form-item>
  36. <a-form-item field="customerName" label="客户名称">
  37. <a-input v-model="formAdd.customerName" placeholder="请输入客户" />
  38. </a-form-item>
  39. <a-form-item field="money" label="充值金额">
  40. <!-- <a-input v-model="formAdd.money" placeholder="请输入金额" /> -->
  41. <a-input-number v-model="formAdd.money" placeholder="请输入金额" class="input-demo" :min="10"
  42. :max="100" />
  43. </a-form-item>
  44. <a-form-item field="topsUpOpinion" label="备注">
  45. <a-textarea placeholder="请输入" v-model="formAdd.topsUpOpinion" allow-clear />
  46. </a-form-item>
  47. <a-form-item field="fileList" label="凭证">
  48. <a-upload action="/" :default-file-list="formAdd.fileList" style="width: auto;max-width: 400px;" />
  49. <div class="text-box">
  50. <div class="text">
  51. 1.建议上传尺寸为360*240px的图片
  52. </div>
  53. <div class="text">
  54. 2.图片仅支持jpg或png格式
  55. </div>
  56. <div class="text">
  57. 3.图片不得大于2M
  58. </div>
  59. </div>
  60. </a-form-item>
  61. </a-form>
  62. </a-modal>
  63. </div>
  64. </template>
  65. <script setup>
  66. import { ref, reactive } from 'vue';
  67. import { Message } from '@arco-design/web-vue';
  68. const selectedKeys = ref([]);
  69. const rowSelection = reactive({
  70. type: 'checkbox',
  71. showCheckedAll: true,
  72. onlyCurrent: false,
  73. });
  74. const searchForm = reactive({
  75. customerName: '',
  76. });
  77. const columns = [
  78. { title: '序号', dataIndex: 'index', align: 'center', render: ({ rowIndex }) => rowIndex + 1 },
  79. {
  80. title: '客户编号', dataIndex: 'customerNumber', ellipsis: true,
  81. tooltip: true,
  82. width: 100
  83. },
  84. { title: '客户名称', dataIndex: 'customerName' },
  85. { title: '客户账号', dataIndex: 'customerAccountNumber' },
  86. { title: '充值金额(元)', dataIndex: 'topsUpMoney' },
  87. { title: '账户可用余额(元)', dataIndex: 'balance' },
  88. { title: '充值类型', dataIndex: 'topsUpStatus' },
  89. { title: '更新时间', dataIndex: 'updateTime' },
  90. { title: '详情', slotName: 'detail', align: 'center' },
  91. ];
  92. const tableData = ref([
  93. {
  94. customerNumber: '13800138000',
  95. customerName: '张三',
  96. topsUpStatus: '1',
  97. customerAccountNumber: 'jhl001',
  98. topsUpMoney: '100',
  99. balance: '100',
  100. updateTime: '2024-10-11'
  101. // operate:'上传合同'
  102. },
  103. {
  104. customerNumber: '13800138000',
  105. customerName: '李四',
  106. topsUpStatus: '2',
  107. customerAccountNumber: 'jhl001',
  108. topsUpMoney: '100',
  109. balance: '100',
  110. updateTime: '2024-10-11'
  111. // operate:'上传合同'
  112. },
  113. {
  114. customerNumber: '13800138000',
  115. customerName: '王五',
  116. topsUpStatus: '3',
  117. customerAccountNumber: 'jhl001',
  118. topsUpMoney: '100',
  119. balance: '100',
  120. updateTime: '2024-10-11'
  121. // operate:'上传合同'
  122. },
  123. {
  124. customerNumber: '13800138000',
  125. customerName: '赵六',
  126. topsUpStatus: '1',
  127. customerAccountNumber: 'jhl001',
  128. topsUpMoney: '100',
  129. balance: '100',
  130. updateTime: '2024-10-11'
  131. // operate:'上传合同'
  132. },
  133. ]);
  134. const pagination = reactive({
  135. total: tableData.value.length,
  136. current: 1,
  137. pageSize: 10,
  138. });
  139. const handleSearch = () => {
  140. console.log('Search form data:', searchForm);
  141. Message.success('执行搜索操作');
  142. };
  143. const resetSearch = () => {
  144. Object.keys(searchForm).forEach(key => {
  145. if (Array.isArray(searchForm[key])) {
  146. searchForm[key] = [];
  147. } else {
  148. searchForm[key] = null;
  149. }
  150. });
  151. Message.success('搜索条件已重置');
  152. };
  153. const options = [
  154. { label: '充值', value: '1' },
  155. { label: '抵充', value: '2' },
  156. { label: '消费扣除', value: '3' },
  157. ];
  158. const openTopsUp = () => {
  159. showAdd.value = true;
  160. }
  161. const showAdd = ref(false);
  162. const formAdd = reactive({
  163. customerName: '',
  164. cardType: '',
  165. money: null,
  166. topsUpStatus: '',
  167. topsUpOpinion: '',
  168. fileList: []
  169. })
  170. const submitAdd = () => {
  171. window.setTimeout(() => {
  172. showAdd.value = false;
  173. }, 1000)
  174. }
  175. </script>
  176. <style scoped lang="less">
  177. .customer-top-up {
  178. padding: 20px !important;
  179. .search-section {
  180. margin-bottom: 20px;
  181. }
  182. .audit-btn {
  183. margin-bottom: 10px;
  184. }
  185. }
  186. .text-box {
  187. width: 100%;
  188. margin-left: 10px;
  189. .text {
  190. font-family: PingFang SC;
  191. font-size: 12px;
  192. font-weight: 400;
  193. line-height: 19px;
  194. color: rgba(153, 153, 153, 1);
  195. text-align: left;
  196. }
  197. }
  198. </style>