You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1555 lines
44 KiB

3 weeks ago
  1. <script setup>
  2. import { ref, onMounted, reactive, computed, watch, nextTick } from 'vue'
  3. import { ElMessage } from 'element-plus'
  4. import { Plus } from '@element-plus/icons-vue'
  5. import axios from 'axios'
  6. import { ElMessageBox } from 'element-plus'
  7. import API from '@/util/http'
  8. import moment from 'moment'
  9. import { range, re } from 'mathjs'
  10. import { utils, read } from 'xlsx'
  11. import throttle from 'lodash/throttle'
  12. // 精网号去空格
  13. const trimJwCode = () => {
  14. if (addRecharge.value.jwcode) {
  15. addRecharge.value.jwcode = addRecharge.value.jwcode.replace(/\s/g, '');
  16. }
  17. }
  18. // 上传图片前的验证函数
  19. const beforeAvatarUpload = (file) => {
  20. const isJPG = file.type === 'image/jpeg'
  21. const isPNG = file.type === 'image/png'
  22. const isLt2M = file.size / 1024 / 1024 < 2
  23. if (!isJPG && !isPNG) {
  24. ElMessage.error('上传头像图片只能是 JPG 或 PNG 格式!')
  25. }
  26. if (!isLt2M) {
  27. ElMessage.error('上传头像图片大小不能超过 2MB!')
  28. }
  29. return (isJPG || isPNG) && isLt2M
  30. }
  31. // 这是添加上传图片的接口
  32. const imageUrl = ref('')
  33. const rechargeVoucher = ref('')
  34. const Rate = ref()
  35. const adminData = ref({})
  36. const getAdminData = async function () {
  37. try {
  38. const result = await API({
  39. url: '/admin/userinfo',
  40. data: {}
  41. })
  42. adminData.value = result
  43. addRecharge.value.adminId = adminData.value.adminId
  44. addRecharge.value.area = adminData.value.area
  45. console.log('请求成功', result)
  46. console.log('用户信息', user.value)
  47. } catch (error) {
  48. console.log('请求失败', error)
  49. }
  50. }
  51. // 这是添加充值信息的表单
  52. const addRecharge = ref({
  53. rechargeVoucher: '',
  54. rechargeWay: '客服充值',
  55. freeGold: '',
  56. rechargeGold: null,
  57. paidGold: '',
  58. Rate: null,
  59. rechargeRatio: ''
  60. })
  61. // 这是添加充值信息的接口
  62. const add = async function () {
  63. try {
  64. console.log('开始添加充值信息', addRecharge.value)
  65. // 发送POST请求
  66. const result = await API({
  67. url: '/recharge/recharge/add',
  68. data: addRecharge.value
  69. })
  70. if (result.code === 0) {
  71. ElMessage.error(result.msg)
  72. return
  73. }
  74. // 将响应结果存储到响应式数据中
  75. console.log('请求成功', result)
  76. // 显示成功消息
  77. ElMessage.success('添加成功')
  78. // 重置表单
  79. addRecharge.value = {}
  80. addRecharge.value.adminId = adminData.value.adminId
  81. addRecharge.value.area = adminData.value.area
  82. addRecharge.value.rechargeVoucher = ''
  83. addRecharge.value.rechargeWay = '客服充值'
  84. addRecharge.value.freeGold = ''
  85. addRecharge.value.rechargeGold = null
  86. addRecharge.value.paidGold = ''
  87. imageUrl.value = ''
  88. Rate.value = null
  89. user.value = {}
  90. } catch (error) {
  91. console.log('请求失败', error)
  92. // 在这里可以处理错误逻辑,比如显示错误提示等
  93. }
  94. }
  95. const addBefore = () => {
  96. Ref.value.validate(async (valid) => {
  97. if (valid) {
  98. if (Rate.value == null || Rate.value == '' || Rate.value == undefined) {
  99. ElMessage({
  100. type: 'error',
  101. message: '请选择币种'
  102. })
  103. return
  104. }
  105. if(addRecharge.value.rechargeGold == null || addRecharge.value.rechargeGold == '' || addRecharge.value.rechargeGold == undefined){
  106. ElMessage({
  107. type: 'error',
  108. message: '请输入充值金额'
  109. })
  110. return
  111. }
  112. ElMessageBox.confirm('确认添加?')
  113. .then(() => {
  114. add()
  115. console.log('添加成功')
  116. })
  117. .catch(() => {
  118. console.log('取消添加')
  119. })
  120. } else {
  121. //提示
  122. ElMessage({
  123. type: 'error',
  124. message: '请检查输入内容'
  125. })
  126. }
  127. })
  128. }
  129. // 表单验证
  130. // 开始时间改变时,重新验证结束时间
  131. const Ref = ref(null)
  132. const rules = reactive({
  133. jwcode: [{ required: true, message: '请输入精网号', trigger: 'blur' }],
  134. activityId: [{ required: true, message: '请选择活动名称', trigger: 'blur' }],
  135. paidGold: [
  136. { required: true, message: '请输入永久金币数', trigger: 'blur' },
  137. {
  138. validator: (rule, value, callback) => {
  139. if (value >= 0) {
  140. callback()
  141. } else {
  142. callback(new Error('输入金额至少为0'))
  143. }
  144. }
  145. }
  146. ],
  147. freeGold: [
  148. {
  149. required: true,
  150. message: '请输入免费金币数',
  151. trigger: 'blur'
  152. },
  153. {
  154. validator: (rule, value, callback) => {
  155. if (value == 0) {
  156. callback(new Error('输入金额不可为0'))
  157. } else {
  158. callback()
  159. }
  160. }
  161. }
  162. ],
  163. rechargeGold: [
  164. {
  165. required: true,
  166. message: '请选择货币名称',
  167. trigger: 'blur'
  168. }
  169. ],
  170. 'addRecharge.rechargeGold': [
  171. {
  172. required: true,
  173. message: '请输入充值金额',
  174. trigger: 'blur'
  175. }
  176. ],
  177. payWay: [{ required: true, message: '请选择付款方式', trigger: 'blur' }],
  178. rechargeTime: [{ required: true, message: '请选择交款时间', trigger: 'blur' }]
  179. })
  180. // 查找客户信息的方法
  181. const user = ref({})
  182. const getUser = async function (jwcode) {
  183. trimJwCode();
  184. try {
  185. // 发送POST请求
  186. const result = await API({
  187. url: '/recharge/user',
  188. data: {
  189. jwcode: addRecharge.value.jwcode,
  190. area: adminData.value.area
  191. }
  192. })
  193. console.log('请求成功', result)
  194. if (result.code === 0) {
  195. ElMessage.error(result.msg)
  196. } else {
  197. user.value = result.data
  198. user.value.A =
  199. Number(user.value.pendingRechargeTimes) +
  200. Number(user.value.pendingSpendTimes)
  201. console.log('用户信息', user.value)
  202. ElMessage.success(result.msg)
  203. }
  204. } catch (error) {
  205. console.log('请求失败', error)
  206. ElMessage.error('查询失败,请检查精网号是否正确')
  207. // 在这里可以处理错误逻辑,比如显示错误提示等
  208. }
  209. }
  210. // 这是查询活动的接口
  211. const activity = ref([])
  212. const getActivity = async function () {
  213. try {
  214. // 发送POST请求
  215. const result = await API({
  216. url: '/recharge/activity/select',
  217. data: {
  218. activity: { status: 1 }
  219. }
  220. })
  221. // 将响应结果存储到响应式数据中
  222. console.log('请求成功', result)
  223. // 存储表格数据
  224. activity.value = result.data
  225. console.log('活动信息', activity.value)
  226. } catch (error) {
  227. console.log('请求失败', error)
  228. // 在这里可以处理错误逻辑,比如显示错误提示等
  229. }
  230. }
  231. // 这是查询货币的接口
  232. const currency = ref([])
  233. const getCurrency = async function () {
  234. try {
  235. // 发送POST请求
  236. const result = await API({
  237. url: '/rates/status',
  238. data: {}
  239. })
  240. // 将响应结果存储到响应式数据中
  241. console.log('货币请求成功', result)
  242. // 存储表格数据
  243. currency.value = result.data
  244. console.log('tableData', currency.value)
  245. // 在这里可以根据需求进一步处理成功后的逻辑,比如更新UI显示成功消息等
  246. } catch (error) {
  247. console.log('请求失败', error)
  248. // 在这里可以处理错误逻辑,比如显示错误提示等
  249. }
  250. }
  251. // 上传图片成功的回调函数
  252. const handleAvatarSuccess = (response, uploadFile) => {
  253. imageUrl.value = URL.createObjectURL(uploadFile.raw)
  254. console.log('图片上传成功', response, uploadFile)
  255. addRecharge.value.rechargeVoucher = `http://54.251.137.151:10704/upload/${response.data}`
  256. console.log('图片名称', addRecharge.value.rechargeVoucher)
  257. }
  258. //充值方式条目
  259. const options = [
  260. {
  261. value: '现金',
  262. label: '现金'
  263. },
  264. {
  265. value: '支票',
  266. label: '支票'
  267. },
  268. {
  269. value: '刷卡',
  270. label: '刷卡'
  271. },
  272. {
  273. value: '其他(各地区电子支付)',
  274. label: '其他(各地区电子支付)'
  275. }
  276. ]
  277. //根据活动id获取汇率
  278. const getActivityById = async function (row) {
  279. try {
  280. // 发送POST请求
  281. const result = await API({
  282. url: '/recharge/activity/select',
  283. data: {
  284. activity: { activityId: row }
  285. }
  286. })
  287. addRecharge.value.rechargeRatio = result.data[0].rechargeRatio
  288. console.log('看看有了吗', addRecharge.value.rechargeRatio)
  289. } catch (error) {
  290. console.log('请求失败', error)
  291. }
  292. }
  293. function handleActivityChange(value) {
  294. // 在这里执行你的逻辑,例如获取选中的值
  295. console.log('选中的值:', value)
  296. getActivityById(value)
  297. console.log('看看', addRecharge.value)
  298. }
  299. //这是重置重置表单的方法
  300. const deleteRecharge = function () {
  301. addRecharge.value = {
  302. adminId: adminData.value.adminId,
  303. area: adminData.value.area,
  304. rechargeVoucher: '',
  305. rechargeWay: '客服充值',
  306. freeGold: Number(),
  307. rechargeGold: null,
  308. paidGold: Number()
  309. }
  310. imageUrl.value = ''
  311. Rate.value = ''
  312. }
  313. // 批量充值
  314. // jwcode列表
  315. const jwcodeList = ref([])
  316. let jwcodeSet
  317. // 获取jwcode列表
  318. const getJwcodeList = async function () {
  319. try {
  320. // 发送POST请求
  321. const result = await API({
  322. url: '/recharge/user/jwcode',
  323. data: {
  324. jwcode: jwcode,
  325. area: adminData.value.area
  326. }
  327. })
  328. // 将响应结果存储到响应式数据中
  329. console.log('请求成功', result)
  330. // 存储表格数据
  331. jwcodeList.value = result.data
  332. console.log('精网号', jwcodeList.value)
  333. // 将数组转换为set
  334. jwcodeSet = new Set(jwcodeList.value)
  335. console.log('精网号set', jwcodeSet)
  336. } catch (error) {
  337. console.log('请求失败', error)
  338. // 在这里可以处理错误逻辑,比如显示错误提示等
  339. }
  340. }
  341. // 校验精网号
  342. // 精网号错误对象
  343. const errorCount = ref(0)
  344. // 校验规则
  345. const validateInput = function (row, index) {
  346. console.log(jwcodeSet.has(row.jwcode), 'has')
  347. if (!jwcodeSet.has(row.jwcode) && row.jwcode != '' && row.jwcode != null) {
  348. row.isInputInvalid = true
  349. row.inputErrorMessage = '精网号不存在'
  350. errorCount.value++
  351. return
  352. } else {
  353. row.isInputInvalid = false
  354. row.inputErrorMessage = ''
  355. errorCount.value--
  356. }
  357. }
  358. // 批量充值弹窗
  359. const batchRechargeVisible = ref(false)
  360. const i = ref(1)
  361. const delObj = ref({})
  362. const batchDelObj = ref([])
  363. const resetObj = ref({})
  364. // 批量充值表格数据
  365. const batchData = ref([
  366. {
  367. line: 1,
  368. showInput: true,
  369. isInputInvalid: false,
  370. inputErrorMessage: '',
  371. freeGold: '0',
  372. rechargeGold: '0',
  373. paidGold: '0'
  374. }
  375. ])
  376. // 打开批量充值弹窗
  377. const openBatchRechargeVisible = function () {
  378. batchRechargeVisible.value = true
  379. }
  380. // 关闭批量充值弹窗
  381. const closeBatchRechargeVisible = function () {
  382. batchRechargeVisible.value = false
  383. }
  384. // 批量充值初始化
  385. const batchInit = function () {
  386. openBatchRechargeVisible()
  387. }
  388. // 添加行数对象
  389. const addLineObj = ref(0)
  390. //添加一行
  391. const addLine = function () {
  392. batchData.value.unshift({
  393. line: ++i.value,
  394. showInput: true,
  395. isInputInvalid: false,
  396. inputErrorMessage: '',
  397. freeGold: '0',
  398. rechargeGold: '0',
  399. paidGold: '0'
  400. })
  401. }
  402. const loading = ref(false)
  403. // 添加多行
  404. const addLines = async function () {
  405. try {
  406. loading.value = true // 操作开始前,将loading设为true,显示加载动画
  407. console.log(loading.value, 'loading.value')
  408. await new Promise((resolve) => setTimeout(resolve, 100)) // 人为创建一个小延迟
  409. for (let j = 0; j < addLineObj.value; j++) {
  410. batchData.value.unshift({
  411. line: ++i.value,
  412. showInput: true,
  413. isInputInvalid: false,
  414. inputErrorMessage: '',
  415. freeGold: '0',
  416. rechargeGold: '0',
  417. paidGold: '0'
  418. })
  419. }
  420. ElMessage.success('添加成功')
  421. console.log(batchData.value, 'batchData.value')
  422. } catch (error) {
  423. console.log('添加失败', error)
  424. ElMessage.error('添加失败')
  425. } finally {
  426. loading.value = false
  427. console.log(loading.value, 'loading.value')
  428. }
  429. }
  430. // 添加多行点击按钮
  431. // const addLines = async function () {
  432. // try {
  433. // loading.value = true; // 操作开始前,将loading设为true,显示加载动画
  434. // console.log(loading.value, "loading.value")
  435. // await new Promise(resolve => setTimeout(resolve, 100)); // 人为创建一个小延迟
  436. // const newItems = Array.from({ length: addLineObj.value }, (_, index) => reactive({
  437. // line: ++i.value,
  438. // showInput: true,
  439. // isInputInvalid: false,
  440. // inputErrorMessage: '',
  441. // freeGold: "0",
  442. // rechargeGold: "0",
  443. // paidGold: "0",
  444. // }));
  445. // batchData.value = [...newItems, ...batchData.value];
  446. // ElMessage.success("添加成功");
  447. // console.log(batchData.value, "batchData.value");
  448. // loading.value = false;
  449. // console.log(loading.value, "loading.value")
  450. // } catch (error) {
  451. // console.log("添加失败", error);
  452. // ElMessage.error("添加失败");
  453. // // 如果出现异常,也要确保关闭加载动画
  454. // loading.value = false;
  455. // }
  456. // };
  457. // 使用 _.throttle 并设置 trailing 为 false 实现严格节流,只执行一次
  458. const throttledAddLines = throttle(addLines, 500, { trailing: false })
  459. // 导入excel按钮的ref
  460. const uploadRefMap = ref({})
  461. // 获取excel数据
  462. const excelList = ref([])
  463. // 动态设置upload Ref
  464. const handleSetUploadRefMap = (el) => {
  465. if (el) {
  466. uploadRefMap.value[`Upload_Ref`] = el
  467. }
  468. }
  469. // 文件上传自定义
  470. const httpExcelRequest = async (op) => {
  471. // 获取除文件之外的参数,具体根据实际业务需求来
  472. console.log(op.data)
  473. // 获取上传的excel 并解析数据
  474. let file = op.file
  475. let dataBinary = await readFile(file)
  476. let workBook = read(dataBinary, { type: 'binary', cellDates: true })
  477. let workSheet = workBook.Sheets[workBook.SheetNames[0]]
  478. const excelData = utils.sheet_to_json(workSheet, { header: 1 })
  479. excelList.value = excelData
  480. console.log(excelData)
  481. }
  482. const readFile = (file) => {
  483. return new Promise((resolve) => {
  484. let reader = new FileReader()
  485. reader.readAsBinaryString(file)
  486. reader.onload = (ev) => {
  487. resolve(ev.target?.result)
  488. }
  489. })
  490. }
  491. //获取批量删除的数组
  492. const handleSelectionChangebatch = function (val) {
  493. console.log('val===', val)
  494. batchDelObj.value = val
  495. }
  496. //批量删除
  497. const batchDel = function () {
  498. ElMessageBox.confirm('确认批量删除吗?', '批量删除', {
  499. confirmButtonText: '确定',
  500. cancelButtonText: '取消',
  501. type: 'warning'
  502. })
  503. .then(() => {
  504. console.log('batchDel===', batchDelObj.value)
  505. batchData.value = batchData.value.filter((itemA) => {
  506. return !batchDelObj.value.some((itemB) => itemB.line == itemA.line)
  507. })
  508. console.log('batchData===', batchData.value)
  509. ElMessage({
  510. type: 'success',
  511. message: '操作成功'
  512. })
  513. })
  514. .catch(() => {
  515. ElMessage({
  516. type: 'info',
  517. message: '操作撤销'
  518. })
  519. })
  520. }
  521. //监听改变活动时的操作
  522. const changeActivity = function (row) {
  523. console.log('row===', row)
  524. let ratio = 0
  525. for (let i = 0; i < activity.value.length; i++) {
  526. if (activity.value[i].activityId == row.activityId) {
  527. ratio = activity.value[i].rechargeRatio
  528. break
  529. }
  530. }
  531. console.log('ratio===', ratio)
  532. if (row.paidGold == null || row.paidGold == '') {
  533. row.freeGold = 0
  534. } else {
  535. if (ratio == 0) {
  536. row.freeGold = 0
  537. } else {
  538. row.freeGold = Math.ceil(row.paidGold / ratio)
  539. }
  540. }
  541. }
  542. // //监听改变永久金币时的操作
  543. // const changePaidGold = function (row) {
  544. // console.log('row===', row)
  545. // let ratio = 0
  546. // if (row.activityId == null || row.activityId == '') {
  547. // row.freeGold = 0
  548. // } else {
  549. // for (let i = 0; i < activity.value.length; i++) {
  550. // if (activity.value[i].activityId == row.activityId) {
  551. // ratio = activity.value[i].rechargeRatio
  552. // break
  553. // }
  554. // }
  555. // if (ratio == 0) {
  556. // row.freeGold = 0
  557. // } else {
  558. // row.freeGold = Math.ceil(Number(row.paidGold) / ratio)
  559. // }
  560. // }
  561. // let rate = row.rate
  562. // if (rate == null || rate == '') {
  563. // row.rechargeGold = 0
  564. // } else {
  565. // if (row.paidGold == null || row.paidGold == '') {
  566. // row.rechargeGold = 0
  567. // } else {
  568. // row.rechargeGold = Math.ceil(Number(row.paidGold) * rate)
  569. // }
  570. // }
  571. // }
  572. // 监听改变币种时的操作
  573. const changeRate = function (row) {
  574. console.log('row===', row)
  575. let rate = row.rate
  576. if (rate == null || rate == '') {
  577. row.rechargeGold = 0
  578. } else {
  579. if (row.paidGold == null || row.paidGold == '') {
  580. row.rechargeGold = 0
  581. } else {
  582. row.rechargeGold = Math.ceil(Number(row.paidGold) * rate)
  583. }
  584. }
  585. }
  586. //监听改变凭证时的操作
  587. const changeVoucher = function (row) {
  588. if (
  589. (imageUrl.value != '' && rechargeVoucher.value != '') ||
  590. (imageUrl.value != null && rechargeVoucher.value != null)
  591. ) {
  592. console.log('row===', row)
  593. row.imageUrl = imageUrl.value
  594. row.rechargeVoucher = rechargeVoucher.value
  595. console.log('row===', row)
  596. imageUrl.value = ''
  597. rechargeVoucher.value = ''
  598. }
  599. }
  600. // 上传图片成功的回调函数
  601. const handleBatchAvatarSuccess = (response, uploadFile) => {
  602. imageUrl.value = URL.createObjectURL(uploadFile.raw)
  603. console.log('图片上传成功', response, uploadFile)
  604. rechargeVoucher.value = `http://54.251.137.151:10704/upload/${response.data}`
  605. console.log('图片名称', rechargeVoucher.value)
  606. }
  607. //批量充值确认按钮
  608. const batchAdd = async function () {
  609. try {
  610. console.log('batchData===', batchData.value)
  611. let msg = ''
  612. if (batchData.value.length == 0) {
  613. ElMessage({
  614. type: 'error',
  615. message: '至少需要输入一条数据!'
  616. })
  617. return
  618. }
  619. if (errorCount.value > 0) {
  620. console.log('errorCount.value', errorCount.value)
  621. ElMessage({
  622. type: 'error',
  623. message: '请检查输入的精网号是否正确!'
  624. })
  625. return
  626. }
  627. for (let i = 0; i < batchData.value.length; i++) {
  628. batchData.value[i].adminId = adminData.value.adminId
  629. batchData.value[i].area = adminData.value.area
  630. batchData.value[i].rechargeWay = '客服充值'
  631. if (
  632. batchData.value[i].jwcode == '' ||
  633. batchData.value[i].jwcode == null
  634. ) {
  635. msg += `精网号不能为空! <br/>`
  636. }
  637. if (
  638. batchData.value[i].activityId == '' ||
  639. batchData.value[i].activityId == null
  640. ) {
  641. msg += `活动不能为空! <br/>`
  642. }
  643. if (
  644. batchData.value[i].paidGold == '' ||
  645. batchData.value[i].paidGold == null
  646. ) {
  647. msg += `永久金币不能为空! <br/>`
  648. }
  649. if (
  650. batchData.value[i].freeGold == '' ||
  651. batchData.value[i].freeGold == null
  652. ) {
  653. msg += `免费金币不能为空! <br/>`
  654. }
  655. if (
  656. batchData.value[i].rechargeGold == '' ||
  657. batchData.value[i].rechargeGold == null
  658. ) {
  659. msg += `充值金额不能为空! <br/>`
  660. }
  661. if (
  662. batchData.value[i].payWay == '' ||
  663. batchData.value[i].payWay == null
  664. ) {
  665. msg += `收款方式不能为空! <br/>`
  666. }
  667. if (
  668. batchData.value[i].rechargeTime == '' ||
  669. batchData.value[i].rechargeTime == null
  670. ) {
  671. msg += `交款时间不能为空! <br/>`
  672. }
  673. if (msg != '' && msg != null) {
  674. console.log(batchData.value[i])
  675. ElMessage({
  676. dangerouslyUseHTMLString: true,
  677. type: 'error',
  678. message: msg
  679. })
  680. return
  681. }
  682. }
  683. console.log('batchData===', batchData.value)
  684. const result = await API({
  685. url: '/recharge/recharge/addmore',
  686. data: {
  687. ...batchData.value
  688. }
  689. })
  690. if (result.code === 0) {
  691. ElMessage.error('添加失败')
  692. return
  693. }
  694. ElMessage({
  695. type: 'success',
  696. message: '添加成功!'
  697. })
  698. closeBatchRechargeVisible()
  699. } catch (error) {
  700. console.log('error===', error)
  701. ElMessage.error('添加失败')
  702. return
  703. }
  704. }
  705. // 使用 _.throttle 并设置 trailing 为 false 实现严格节流,只执行一次
  706. const throttledBatchAdd = throttle(batchAdd, 2000, { trailing: false })
  707. // 批量设置的对象
  708. const batchSettingObj = ref({
  709. rechargeGold: '0',
  710. paidGold: '0',
  711. freeGold: '0'
  712. })
  713. // 批量充值弹窗
  714. const batchSettingVisible = ref(false)
  715. // 打开批量充值弹窗
  716. const openBatchSettingVisible = function () {
  717. batchSettingVisible.value = true
  718. }
  719. // 关闭批量充值弹窗
  720. const closeBatchSettingVisible = function () {
  721. batchSettingVisible.value = false
  722. }
  723. // 批量设置初始化
  724. const batchSettingInit = function () {
  725. openBatchSettingVisible()
  726. }
  727. // 上传图片成功的回调函数
  728. const batchSettingHandleAvatarSuccess = (response, uploadFile) => {
  729. batchSettingObj.value.imageUrl = URL.createObjectURL(uploadFile.raw)
  730. console.log('图片上传成功', response, uploadFile)
  731. batchSettingObj.value.rechargeVoucher = `http://54.251.137.151:10704/upload/${response.data}`
  732. console.log('图片名称', batchSettingObj.value.rechargeVoucher)
  733. }
  734. // 批量设置取消按钮
  735. const cancelBatchSetting = function () {
  736. batchSettingObj.value = {
  737. rechargeGold: '0',
  738. paidGold: '0',
  739. freeGold: '0'
  740. }
  741. closeBatchSettingVisible()
  742. }
  743. // 批量设置确认按钮
  744. const batchSettingConfirm = function () {
  745. for (let i = 0; i < batchData.value.length; i++) {
  746. if (
  747. batchSettingObj.value.jwcode != '' &&
  748. batchSettingObj.value.jwcode != null
  749. ) {
  750. batchData.value[i].jwcode = batchSettingObj.value.jwcode
  751. }
  752. if (
  753. batchSettingObj.value.activityId != '' &&
  754. batchSettingObj.value.activityId != null
  755. ) {
  756. batchData.value[i].activityId = batchSettingObj.value.activityId
  757. }
  758. if (
  759. batchSettingObj.value.paidGold != '' &&
  760. batchSettingObj.value.paidGold != null
  761. ) {
  762. batchData.value[i].paidGold = batchSettingObj.value.paidGold
  763. }
  764. if (
  765. batchSettingObj.value.freeGold != '' &&
  766. batchSettingObj.value.freeGold != null
  767. ) {
  768. batchData.value[i].freeGold = batchSettingObj.value.freeGold
  769. }
  770. if (
  771. batchSettingObj.value.rate != '' &&
  772. batchSettingObj.value.rate != null
  773. ) {
  774. batchData.value[i].rate = batchSettingObj.value.rate
  775. }
  776. if (
  777. batchSettingObj.value.rechargeGold != '' &&
  778. batchSettingObj.value.rechargeGold != null
  779. ) {
  780. batchData.value[i].rechargeGold = batchSettingObj.value.rechargeGold
  781. }
  782. if (
  783. batchSettingObj.value.payWay != '' &&
  784. batchSettingObj.value.payWay != null
  785. ) {
  786. batchData.value[i].payWay = batchSettingObj.value.payWay
  787. }
  788. if (
  789. batchSettingObj.value.rechargeTime != '' &&
  790. batchSettingObj.value.rechargeTime != null
  791. ) {
  792. batchData.value[i].rechargeTime = batchSettingObj.value.rechargeTime
  793. }
  794. if (
  795. batchSettingObj.value.imageUrl != '' &&
  796. batchSettingObj.value.imageUrl != null
  797. ) {
  798. batchData.value[i].imageUrl = batchSettingObj.value.imageUrl
  799. }
  800. if (
  801. batchSettingObj.value.rechargeVoucher != '' &&
  802. batchSettingObj.value.rechargeVoucher != null
  803. ) {
  804. batchData.value[i].rechargeVoucher = batchSettingObj.value.rechargeVoucher
  805. }
  806. if (
  807. batchSettingObj.value.remark != '' &&
  808. batchSettingObj.value.remark != null
  809. ) {
  810. batchData.value[i].remark = batchSettingObj.value.remark
  811. }
  812. }
  813. batchSettingObj.value = {
  814. rechargeGold: '0',
  815. paidGold: '0',
  816. freeGold: '0'
  817. }
  818. closeBatchSettingVisible()
  819. }
  820. // 挂载
  821. onMounted(async function () {
  822. await getAdminData()
  823. await getCurrency()
  824. await getActivity()
  825. await getJwcodeList()
  826. })
  827. </script>
  828. <template>
  829. <div style="display: flex">
  830. <div style="margin-right: 20px">新增充值</div>
  831. <!-- <el-button type="primary" plain @click="batchInit()">批量充值</el-button> -->
  832. </div>
  833. <el-form
  834. :model="addRecharge"
  835. ref="Ref"
  836. :rules="rules"
  837. label-width="auto"
  838. style="max-width: 600px"
  839. class="add-form"
  840. >
  841. <el-form-item prop="jwcode" label="精网号">
  842. <el-input v-model="addRecharge.jwcode" style="width: 220px" />
  843. <el-button
  844. type="primary"
  845. @click="getUser(addRecharge.jwcode)"
  846. style="margin-left: 20px"
  847. >查询</el-button
  848. >
  849. </el-form-item>
  850. <el-form-item prop="activityId" label="活动名称">
  851. <el-select
  852. v-model="addRecharge.activityId"
  853. placeholder="请选择"
  854. style="width: 300px"
  855. @change="handleActivityChange"
  856. >
  857. <el-option
  858. v-for="item in activity"
  859. :key="item.value"
  860. :label="item.activityName"
  861. :value="item.activityId"
  862. />
  863. </el-select>
  864. </el-form-item>
  865. <el-col>
  866. <el-form-item prop="paidGold" label="永久金币">
  867. <el-input v-model="addRecharge.paidGold" style="width: 100px" />
  868. <p style="margin-right: 20px"></p>
  869. </el-form-item>
  870. <el-form-item prop="freeGold" label="免费金币">
  871. <el-input v-model="addRecharge.freeGold" style="width: 100px" />
  872. <p></p>
  873. </el-form-item>
  874. </el-col>
  875. <el-form-item label="充值金额">
  876. <el-select
  877. prop="rechargeGold"
  878. v-model="Rate"
  879. placeholder="货币名称"
  880. style="width: 95px; margin-right: 5px"
  881. aria-required="true"
  882. >
  883. <el-option
  884. v-for="item in currency"
  885. :key="item.value"
  886. :label="item.currency"
  887. :value="item.exchangeRate"
  888. />
  889. </el-select>
  890. <el-input prop="addRecharge.rechargeGold" v-model="addRecharge.rechargeGold" style="width: 200px" aria-required="true"/>
  891. </el-form-item>
  892. <el-form-item prop="payWay" label="收款方式">
  893. <el-select
  894. v-model="addRecharge.payWay"
  895. placeholder="请选择"
  896. style="width: 300px"
  897. >
  898. <el-option
  899. v-for="item in options"
  900. :key="item.value"
  901. :label="item.label"
  902. :value="item.value"
  903. />
  904. </el-select>
  905. </el-form-item>
  906. <el-form-item prop="rechargeTime" label="交款时间">
  907. <!-- 修改 type 属性为 datetime 以支持时分秒选择 -->
  908. <el-date-picker
  909. v-model="addRecharge.rechargeTime"
  910. type="datetime"
  911. style="width: 300px"
  912. />
  913. </el-form-item>
  914. <el-form-item
  915. prop="rechargeVoucher"
  916. label="交款凭证"
  917. style="margin-bottom: 5px"
  918. >
  919. <el-upload
  920. action="http://54.251.137.151:10704/upload"
  921. class="avatar-uploader"
  922. :show-file-list="false"
  923. :on-success="handleAvatarSuccess"
  924. :before-upload="beforeAvatarUpload"
  925. style="width: 100px; height: 115px"
  926. >
  927. <img
  928. v-if="imageUrl"
  929. :src="imageUrl"
  930. class="avatar"
  931. style="width: 100px; height: 115px"
  932. />
  933. <el-icon
  934. v-else
  935. class="avatar-uploader-icon"
  936. style="width: 100px; height: 100px"
  937. >
  938. <Plus />
  939. </el-icon>
  940. </el-upload>
  941. <p style="margin-left: 10px; color: rgb(177, 176, 176)">
  942. 仅支持.jpg .png格式文件1MB
  943. </p>
  944. </el-form-item>
  945. <el-form-item prop="remark" label="备注">
  946. <el-input
  947. v-model="addRecharge.remark"
  948. style="width: 300px"
  949. :rows="2"
  950. maxlength="100"
  951. show-word-limit
  952. type="textarea"
  953. />
  954. </el-form-item>
  955. <el-form-item prop="submitter" label="提交人">
  956. <el-input
  957. style="width: 300px"
  958. :value="adminData.name"
  959. disabled
  960. placeholder="提交人姓名"
  961. />
  962. </el-form-item>
  963. <el-button @click="deleteRecharge" style="margin-left: 280px" type="success"
  964. >重置</el-button
  965. >
  966. <el-button type="primary" @click="addBefore"> 提交 </el-button>
  967. </el-form>
  968. <!-- 客户信息栏 -->
  969. <el-card
  970. style="width: 1200px; float: right"
  971. class="customer-info"
  972. width="3000px"
  973. >
  974. <el-form
  975. :model="user"
  976. label-width="auto"
  977. style="max-width: 1200px"
  978. label-position="left"
  979. >
  980. <el-text size="large" style="margin-left: 20px">客户信息</el-text>
  981. <el-row style="margin-top: 20px">
  982. <el-col :span="10">
  983. <el-form-item label="姓名:">
  984. <p>{{ user.name }}</p>
  985. </el-form-item>
  986. </el-col>
  987. <el-col :span="14">
  988. <el-form-item label="历史金币总数">
  989. <!-- 检查 user.totalRechargeGold 是否为有效的数字 -->
  990. <p v-if="!isNaN(Number(user.totalRechargeGold))">
  991. {{ Number(user.totalRechargeGold / 100) }}
  992. </p>
  993. <!-- 如果不是有效的数字显示默认值 -->
  994. <p v-else></p>
  995. </el-form-item>
  996. </el-col>
  997. <el-col :span="10">
  998. <el-form-item label="精网号">
  999. <p>{{ user.jwcode }}</p>
  1000. </el-form-item>
  1001. </el-col>
  1002. <el-col :span="14">
  1003. <el-form-item label="当前金币总数" style="width: 500px">
  1004. <span
  1005. style="color: #2fa1ff; margin-right: 5px"
  1006. v-if="user.buyJb !== undefined"
  1007. >{{
  1008. (user.buyJb + user.free6 + user.free12 + user.coreJb) / 100
  1009. }}</span
  1010. >
  1011. <span
  1012. style="display: inline; white-space: nowrap; color: #b1b1b1"
  1013. v-if="user.buyJb !== undefined"
  1014. >(永久金币:{{ user.buyJb / 100 }};免费金币:{{
  1015. (user.free6 + user.free12) / 100
  1016. }};任务金币:{{ user.coreJb / 100 }})</span
  1017. >
  1018. </el-form-item>
  1019. </el-col>
  1020. <el-col :span="10">
  1021. <el-form-item label="首次充值日期">
  1022. <p v-if="user.firstRechargeDate">
  1023. {{ moment(user.firstRechargeDate).format('YYYY-MM-DD HH:mm:ss') }}
  1024. </p>
  1025. </el-form-item>
  1026. </el-col>
  1027. <el-col :span="14">
  1028. <el-form-item label="充值次数">
  1029. <p style="color: #2fa1ff">{{ user.rechargeTimes }}</p>
  1030. </el-form-item>
  1031. </el-col>
  1032. <!-- <el-col :span="10">
  1033. <el-form-item label="负责客服">
  1034. <p>{{ adminData.name }}</p>
  1035. </el-form-item>
  1036. </el-col> -->
  1037. <el-col :span="10">
  1038. <el-form-item label="消费次数">
  1039. <p style="color: #2fa1ff">{{ user.spendTimes }}</p>
  1040. </el-form-item>
  1041. </el-col>
  1042. <el-col :span="10">
  1043. <el-form-item label="所属门店">
  1044. <p>{{ adminData.area }}</p>
  1045. </el-form-item>
  1046. </el-col>
  1047. <el-col :span="14">
  1048. <!-- <el-form-item label="待审核">
  1049. <p style="color: #2fa1ff">
  1050. {{ user.A }}
  1051. </p>
  1052. </el-form-item> -->
  1053. </el-col>
  1054. </el-row>
  1055. </el-form>
  1056. </el-card>
  1057. <el-dialog
  1058. v-model="batchRechargeVisible"
  1059. title="批量充值"
  1060. width="1800px"
  1061. style="height: 700px"
  1062. :close-on-click-modal="false"
  1063. >
  1064. <el-row style="margin-bottom: 10px">
  1065. <!-- <el-button type="primary" @click="addLine()" style="margin-right: 10px">新增一行</el-button> -->
  1066. <div style="font-weight: bold; font-size: 20px">
  1067. <span>添加</span>
  1068. <el-input-number
  1069. min="1"
  1070. style="width: 100px"
  1071. controls-position="right"
  1072. v-model="addLineObj"
  1073. ></el-input-number>
  1074. <span></span>
  1075. <el-button
  1076. type="primary"
  1077. @click="throttledAddLines"
  1078. style="margin-right: 10px"
  1079. >添加</el-button
  1080. >
  1081. </div>
  1082. <el-button
  1083. type="warning"
  1084. @click="batchSettingInit()"
  1085. style="margin-right: 10px"
  1086. >批量设置</el-button
  1087. >
  1088. <!-- <el-upload :ref="(el) => handleSetUploadRefMap(el)" action="" :http-request="httpExcelRequest" :limit="1" :show-file-list="false"
  1089. class="uploadExcelContent" :data={} style="margin-right: auto">
  1090. <el-button type="success" >导入jwcode</el-button>
  1091. </el-upload> -->
  1092. <el-button
  1093. type="danger"
  1094. plain
  1095. @click="batchDel()"
  1096. style="margin-right: 10px; width: 130px"
  1097. >批量删除</el-button
  1098. >
  1099. </el-row>
  1100. <el-row>
  1101. <el-table
  1102. v-loading="loading"
  1103. :data="batchData"
  1104. border
  1105. max-height="540px"
  1106. style="height: 540px"
  1107. @selection-change="handleSelectionChangebatch"
  1108. >
  1109. <el-table-column type="selection" width="50px" />
  1110. <el-table-column property="index" label="序号" width="55px">
  1111. <template #default="scope">
  1112. <span>{{ scope.$index + 1 }}</span>
  1113. </template>
  1114. </el-table-column>
  1115. <el-table-column property="jwcode" label="精网号" width="150px">
  1116. <template #default="scope">
  1117. <el-input
  1118. v-if="scope.row.showInput"
  1119. :class="{ 'is-invalid': scope.row.isInputInvalid }"
  1120. @blur="validateInput(scope.row)"
  1121. v-model="scope.row.jwcode"
  1122. style="width: 110px"
  1123. />
  1124. <p v-if="scope.row.isInputInvalid" class="error-message">
  1125. {{ scope.row.inputErrorMessage }}
  1126. </p>
  1127. </template>
  1128. <!-- <template #default="scope">
  1129. <el-select-v2 v-if="scope.row.showInput" filterable clearable v-model="scope.row.jwcode"
  1130. placeholder="请选择精网号" style="widows: 110px;" :options="jwcodeList">
  1131. <el-select-v2
  1132. v-if="scope.row.showInput"
  1133. filterable
  1134. clearable
  1135. v-model="scope.row.jwcode"
  1136. placeholder="请选择精网号"
  1137. style="widows: 110px"
  1138. :options="jwcodeList"
  1139. >
  1140. </el-select-v2>
  1141. <span v-else>{{ scope.row.jwcode }}</span>
  1142. </template> -->
  1143. </el-table-column>
  1144. <el-table-column property="activityName" label="活动名称" width="150px">
  1145. <template #default="scope">
  1146. <el-select
  1147. v-if="scope.row.showInput"
  1148. filterable
  1149. clearable
  1150. v-model="scope.row.activityId"
  1151. placeholder="请选择活动名称"
  1152. @change="changeActivity(scope.row)"
  1153. >
  1154. <el-option
  1155. v-for="item in activity"
  1156. :key="item.activityId"
  1157. :label="item.activityName"
  1158. :value="item.activityId"
  1159. >
  1160. </el-option>
  1161. </el-select>
  1162. <span v-else>{{ scope.row.activityName }}</span>
  1163. </template>
  1164. </el-table-column>
  1165. <el-table-column property="paidGold" label="永久金币" width="110px">
  1166. <template #default="scope">
  1167. <el-input
  1168. v-if="scope.row.showInput"
  1169. v-model="scope.row.paidGold"
  1170. style="width: 70px"
  1171. @change="changePaidGold(scope.row)"
  1172. />
  1173. <span v-else>{{ scope.row.paidGold }}</span>
  1174. </template>
  1175. </el-table-column>
  1176. <el-table-column property="freeGold" label="免费金币" width="110px">
  1177. <template #default="scope">
  1178. <el-input
  1179. v-if="scope.row.showInput"
  1180. v-model="scope.row.freeGold"
  1181. style="width: 70px"
  1182. />
  1183. <span v-else>{{ scope.row.freeGold }}</span>
  1184. </template>
  1185. </el-table-column>
  1186. <el-table-column property="rate" label="货币名称">
  1187. <template #default="scope">
  1188. <el-select
  1189. v-if="scope.row.showInput"
  1190. filterable
  1191. clearable
  1192. v-model="scope.row.rate"
  1193. placeholder="请选择币种"
  1194. @change="changeRate(scope.row)"
  1195. >
  1196. <el-option
  1197. v-for="item in currency"
  1198. :key="item.exchangeRate"
  1199. :label="item.currency"
  1200. :value="item.exchangeRate"
  1201. >
  1202. </el-option>
  1203. </el-select>
  1204. <span v-else>{{ scope.row.rate }}</span>
  1205. </template>
  1206. </el-table-column>
  1207. <el-table-column label="充值金额" width="110px">
  1208. <template #default="scope">
  1209. <el-input property="rechargeGold" v-model="scope.row.rechargeGold"></el-input>
  1210. </template>
  1211. </el-table-column>
  1212. <el-table-column property="payWay" label="收款方式" width="130px">
  1213. <template #default="scope">
  1214. <el-select
  1215. v-if="scope.row.showInput"
  1216. filterable
  1217. clearable
  1218. v-model="scope.row.payWay"
  1219. placeholder="请选择收款方式"
  1220. >
  1221. <el-option
  1222. v-for="item in options"
  1223. :key="item.value"
  1224. :label="item.label"
  1225. :value="item.value"
  1226. >
  1227. </el-option>
  1228. </el-select>
  1229. <span v-else>{{ scope.row.payWay }}</span>
  1230. </template>
  1231. </el-table-column>
  1232. <el-table-column property="rechargeTime" label="交款时间" width="150px">
  1233. <template #default="scope">
  1234. <el-date-picker
  1235. v-if="scope.row.showInput"
  1236. type="date"
  1237. v-model="scope.row.rechargeTime"
  1238. style="width: 120px"
  1239. placeholder="请选择交款时间"
  1240. >
  1241. </el-date-picker>
  1242. <span v-else>{{
  1243. moment(scope.row.rechargeTime).format('YYYY-MM-DD HH:mm:ss')
  1244. }}</span>
  1245. </template>
  1246. </el-table-column>
  1247. <el-table-column property="rechargeVoucher" label="充值凭证">
  1248. <template #default="scope">
  1249. <el-upload
  1250. action="http://54.251.137.151:10704/upload"
  1251. class="avatar-uploader"
  1252. :show-file-list="false"
  1253. :on-success="handleBatchAvatarSuccess"
  1254. v-if="scope.row.showInput"
  1255. @change="changeVoucher(scope.row)"
  1256. >
  1257. <img
  1258. v-if="scope.row.imageUrl"
  1259. :src="scope.row.imageUrl"
  1260. class="avatar"
  1261. />
  1262. <el-icon v-else class="avatar-uploader-icon">
  1263. <Plus />
  1264. </el-icon>
  1265. </el-upload>
  1266. <span v-else>{{ scope.row.rechargeVoucher }}</span>
  1267. </template>
  1268. </el-table-column>
  1269. <el-table-column property="remark" label="备注" width="130px">
  1270. <template #default="scope">
  1271. <el-input
  1272. type="textarea"
  1273. v-if="scope.row.showInput"
  1274. v-model="scope.row.remark"
  1275. style="max-width: 90px"
  1276. :rows="1"
  1277. cols="12"
  1278. ></el-input>
  1279. <span v-else>{{ scope.row.remark }}</span>
  1280. </template>
  1281. </el-table-column>
  1282. <el-table-column property="submitter" label="提交人">
  1283. <el-input :value="adminData.name" disabled />
  1284. </el-table-column>
  1285. <el-table-column
  1286. fixed="right"
  1287. prop="operation"
  1288. label="操作"
  1289. width="150px"
  1290. >
  1291. <template #default="scope">
  1292. <div style="display: flex">
  1293. <el-popconfirm
  1294. title="确定将此条信息删除吗?"
  1295. @confirm="delConfirm"
  1296. >
  1297. <template #reference>
  1298. <el-button type="danger" text @click="del(scope.row)">
  1299. 删除
  1300. </el-button>
  1301. </template>
  1302. <template #actions="{ confirm, cancel }">
  1303. <el-button size="small" @click="cancel">取消</el-button>
  1304. <el-button type="primary" size="small" @click="confirm">
  1305. 确定
  1306. </el-button>
  1307. </template>
  1308. </el-popconfirm>
  1309. <el-popconfirm
  1310. title="确定将此条信息重置吗?"
  1311. @confirm="resetConfirm"
  1312. >
  1313. <template #reference>
  1314. <el-button type="success" text @click="reset(scope.row)">
  1315. 重置
  1316. </el-button>
  1317. </template>
  1318. <template #actions="{ confirm, cancel }">
  1319. <el-button size="small" @click="cancel">取消</el-button>
  1320. <el-button type="primary" size="small" @click="confirm">
  1321. 确定
  1322. </el-button>
  1323. </template>
  1324. </el-popconfirm>
  1325. </div>
  1326. </template>
  1327. </el-table-column>
  1328. </el-table>
  1329. </el-row>
  1330. <el-row>
  1331. <div class="batch-btn">
  1332. <el-button @click="cancelBatch()"> 取消 </el-button>
  1333. <el-button type="primary" @click="throttledBatchAdd()">
  1334. 提交
  1335. </el-button>
  1336. </div>
  1337. </el-row>
  1338. </el-dialog>
  1339. <el-dialog
  1340. v-model="batchSettingVisible"
  1341. title="批量设置"
  1342. :close-on-click-modal="false"
  1343. style="width: 550px"
  1344. >
  1345. <el-form label-position="left" label-width="auto">
  1346. <el-form-item label="活动名称">
  1347. <el-select
  1348. v-model="batchSettingObj.activityId"
  1349. placeholder="请选择活动名称"
  1350. clearable
  1351. >
  1352. <el-option
  1353. v-for="item in activity"
  1354. :key="item.activityId"
  1355. :label="item.activityName"
  1356. :value="item.activityId"
  1357. >
  1358. </el-option>
  1359. </el-select>
  1360. </el-form-item>
  1361. <el-form-item label="永久金币">
  1362. <el-input
  1363. v-model="batchSettingObj.paidGold"
  1364. placeholder="请输入永久金币"
  1365. ></el-input>
  1366. </el-form-item>
  1367. <el-form-item label="免费金币">
  1368. <el-input v-model="batchSettingObj.freeGold"></el-input>
  1369. </el-form-item>
  1370. <el-form-item label="充值金额">
  1371. <div style="display: flex">
  1372. <el-select
  1373. v-model="batchSettingObj.rate"
  1374. placeholder="请选择币种"
  1375. style="width: 120px; margin-right: 10px"
  1376. clearable
  1377. >
  1378. <el-option
  1379. v-for="item in currency"
  1380. :key="item.exchangeRate"
  1381. :label="item.currency"
  1382. :value="item.exchangeRate"
  1383. ></el-option>
  1384. </el-select>
  1385. <el-input
  1386. v-model="batchSettingObj.rechargeGold"
  1387. placeholder="请输入充值金额"
  1388. ></el-input>
  1389. </div>
  1390. </el-form-item>
  1391. <el-form-item prop="payWay" label="收款方式">
  1392. <el-select
  1393. v-model="batchSettingObj.payWay"
  1394. placeholder="请选择收款方式"
  1395. clearable
  1396. >
  1397. <el-option
  1398. v-for="item in options"
  1399. :key="item.value"
  1400. :label="item.label"
  1401. :value="item.value"
  1402. ></el-option>
  1403. </el-select>
  1404. </el-form-item>
  1405. <el-form-item prop="rechargeTime" label="交款时间">
  1406. <el-date-picker
  1407. v-model="batchSettingObj.rechargeTime"
  1408. type="date"
  1409. placeholder="请选择交款时间"
  1410. ></el-date-picker>
  1411. </el-form-item>
  1412. <el-form-item prop="rechargeVoucher" label="交款凭证">
  1413. <el-upload
  1414. action="http://54.251.137.151:10704/upload"
  1415. class="avatar-uploader"
  1416. :show-file-list="false"
  1417. :on-success="batchSettingHandleAvatarSuccess"
  1418. :before-upload="beforeAvatarUpload"
  1419. style="width: 100px; height: 115px"
  1420. >
  1421. <img
  1422. v-if="batchSettingObj.imageUrl"
  1423. :src="batchSettingObj.imageUrl"
  1424. class="avatar"
  1425. style="width: 100px; height: 115px"
  1426. />
  1427. <el-icon
  1428. v-else
  1429. class="avatar-uploader-icon"
  1430. style="width: 100px; height: 100px"
  1431. >
  1432. <Plus />
  1433. </el-icon>
  1434. </el-upload>
  1435. </el-form-item>
  1436. <el-form-item prop="remark" label="备注">
  1437. <el-input
  1438. type="textarea"
  1439. v-model="batchSettingObj.remark"
  1440. placeholder="请输入备注"
  1441. />
  1442. </el-form-item>
  1443. </el-form>
  1444. <el-button @click="cancelBatchSetting()" style="margin-left: 370px"
  1445. >取消</el-button
  1446. >
  1447. <el-button type="primary" @click="batchSettingConfirm()"> 确认 </el-button>
  1448. </el-dialog>
  1449. </template>
  1450. <style scoped>
  1451. p {
  1452. margin: 0px;
  1453. }
  1454. .batch-btn {
  1455. margin-top: 20px;
  1456. margin-left: auto;
  1457. }
  1458. .el-form-item {
  1459. margin-left: 50px;
  1460. }
  1461. /* 上传图片的格式 */
  1462. .avatar-uploader .avatar {
  1463. width: 50px;
  1464. height: 50px;
  1465. display: block;
  1466. }
  1467. </style>
  1468. <style>
  1469. .error-message {
  1470. color: red;
  1471. font-size: 8px;
  1472. }
  1473. .is-invalid .el-input__inner {
  1474. border-color: red;
  1475. }
  1476. .avatar-uploader .el-upload {
  1477. border: 1px dashed var(--el-border-color);
  1478. border-radius: 6px;
  1479. cursor: pointer;
  1480. position: relative;
  1481. overflow: hidden;
  1482. transition: var(--el-transition-duration-fast);
  1483. }
  1484. .avatar-uploader .el-upload:hover {
  1485. border-color: var(--el-color-primary);
  1486. }
  1487. .el-icon.avatar-uploader-icon {
  1488. font-size: 28px;
  1489. color: #8c939d;
  1490. width: 50px;
  1491. height: 50px;
  1492. text-align: center;
  1493. }
  1494. .add-form {
  1495. margin-top: 50px;
  1496. max-width: 50%;
  1497. float: left;
  1498. }
  1499. .customer-info {
  1500. max-width: 60%;
  1501. }
  1502. </style>