Browse Source

fix consume

zhangrenyuan/feature-20250728113353-金币前端三期
zhangrenyuan 1 week ago
parent
commit
e1faf8b3e3
  1. 2
      .env.development
  2. 35
      src/views/consume/bean/addBeanConsume.vue

2
.env.development

@ -11,4 +11,4 @@ VITE_UPLOAD_URL=http://39.101.133.168:8828/hljw/api/aws/upload
# zhangyong
# VITE_API_BASE='http://192.168.3.83:8081/'
# 本地
# VITE_API_BASE='http://localhost:10704/'
# VITE_API_BASE='http://localhost:8081/'

35
src/views/consume/bean/addBeanConsume.vue

@ -13,6 +13,7 @@ import { utils, read } from 'xlsx'
import throttle from 'lodash/throttle'
import { useAdminStore } from "@/store/index.js";
import { storeToRefs } from "pinia";
import _ from 'lodash'
const user = ref({})
const getUser = async function (jwcode) {
if (consumeForm.value.jwcode) {
@ -47,7 +48,7 @@ const consumeForm = ref({
permanentBean: '',
freeBean: '',
remark: '',
adminId: ''
adminName: ''
})
const formRef = ref(null)
const adminStore = useAdminStore()
@ -121,7 +122,7 @@ const deleteConsumeForm = function () {
permanentBean: '',
freeBean: '',
remark: '',
adminId: ''
adminName: ''
}
}
@ -141,22 +142,46 @@ const handleConsumeForm = async () => {
});
console.log('adminData', adminData.value);
await ElMessageBox.confirm(
'确认消耗吗?',
'提示',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
type: "primary",
lockScroll: false,
}
)
const result = await request({
url: '/beanConsume/reduce',
data: {
jwcode: consumeForm.value.jwcode,
permanentBean: consumeForm.value.permanentBean,
freeBean: consumeForm.value.freeBean,
remark: consumeForm.value.remark,
adminId: adminData.adminId
adminName: adminData.value.adminName
}
})
if (result.code == 200) {
ElMessage.success('新增成功')
consumeForm.value = {
jwcode: "",
permanentBean: '',
freeBean: '',
remark: '',
adminName: ''
}
}else{
ElMessage.error(result.msg)
}
} catch (error) {
console.log('金豆新增充值失败');
ElMessage.error(error.message || '操作失败');
}
}
const throttledHandleConsumeFormt = _.throttle(handleConsumeForm, 5000, {
trailing: false
})
</script>
<template>
<div>
@ -175,7 +200,7 @@ const handleConsumeForm = async () => {
<el-input v-model="consumeForm.remark" style="width: 300px" :rows="5" maxlength="100" show-word-limit
type="textarea" />
</el-form-item>
<!-- <el-form-item prop="adminId" label="提交人">
<!-- <el-form-item prop="adminName" label="提交人">
<el-input style="width: 300px" :value="adminData.adminName" disabled placeholder="提交人姓名" />
</el-form-item> -->
<el-button @click="deleteConsumeForm" style="margin-left: 280px" type="success">重置</el-button>

Loading…
Cancel
Save