金币系统前端
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.

1515 lines
44 KiB

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