Browse Source

重复点击以及样式优化

zhangyong/feature-20250815160302-金币优化
ZhangYong 19 hours ago
parent
commit
0da3eb3887
  1. 8
      src/views/consume/bean/addBeanConsume.vue
  2. 52
      src/views/consume/gold/addCoinConsume.vue
  3. 10
      src/views/recharge/addBeanRecharge.vue
  4. 8
      src/views/recharge/gold/addCoinRecharge.vue
  5. 2
      src/views/refund/gold/addCoinRefund.vue

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

@ -44,6 +44,10 @@ const getUser = async function (jwcode) {
ElMessage.error("精网号错误");
}
}
//
const addDisabled = ref(false)
const consumeForm = ref({
jwcode: '',
permanentBean: '',
@ -178,6 +182,7 @@ const handleConsumeForm = async () => {
lockScroll: false,
}
)
addDisabled.value = true
const result = await request({
url: '/beanConsume/reduce',
data: {
@ -188,6 +193,7 @@ const handleConsumeForm = async () => {
adminName: adminData.value.adminName
}
})
addDisabled.value = false
if (result.code == 200) {
ElMessage.success('新增成功')
consumeForm.value = {
@ -230,7 +236,7 @@ const throttledHandleConsumeFormt = _.throttle(handleConsumeForm, 5000, {
<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>
<el-button type="primary" @click="handleConsumeForm"> 提交 </el-button>
<el-button type="primary" :disabled="addDisabled" @click="handleConsumeForm"> 提交 </el-button>
</el-form>
<!-- 客户信息栏 -->

52
src/views/consume/gold/addCoinConsume.vue

@ -18,7 +18,8 @@ const trimJwCode = () => {
}
}
}
//
const addDisabled = ref(false)
/*
====================数据=================================
*/
@ -238,6 +239,7 @@ const add = async function () {
console.log("addConsume.value", addConsume.value)
// POST
addDisabled.value = true
const result = await request({
// url: "/consume/add",
url: "/consume/add",
@ -253,7 +255,7 @@ const add = async function () {
remark: addConsume.value.remark
}
});
addDisabled.value = false
console.log("add请求", result);
//
handleResponse(result);
@ -464,60 +466,45 @@ onMounted(async function () {
<template>
<div>
<el-form :model="addConsume" ref="Ref" :rules="rules" style="max-width: 750px;">
<div style="width:25vw">
<el-form-item prop="jwcode" label="精网号" style="margin-top: 50px">
<el-input v-model="addConsume.jwcode" style="width: 10vw;margin-left:45px" />
<el-form :model="addConsume" ref="Ref" :rules="rules" label-width="auto" style="max-width: 600px;" label-position="right" class="add-form">
<el-form-item prop="jwcode" label="精网号" >
<el-input v-model="addConsume.jwcode" style="width: 200px" />
<el-button type="primary" @click="getUser(addConsume.jwcode)" style="margin-left: 10px">查询
</el-button>
</el-form-item>
</div>
<div style="width:25vw">
<el-form-item prop="goodsName" label="商品名称" style="flex: 1; margin-right: 0px">
<el-select v-model="addConsume.goodsName" placeholder="请选择商品" style="width: 10vw;margin-left:30px">
<el-form-item prop="goodsName" label="商品名称">
<el-select v-model="addConsume.goodsName" placeholder="请选择商品" style="width: 200px">
<el-option v-for="item in goods" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</div>
<div style="width:25vw">
<el-form-item prop="sumGold" label="消耗金币总数">
<el-input v-model="addConsume.sumGold" style="width: 10vw;margin-left:2px" @input="validateInput()"
<el-input v-model="addConsume.sumGold" style="width: 100px" @input="validateInput()"
@change="calculateCoins(addConsume.sumGold)" />
</el-form-item>
</div>
<!-- 三类金币自动计算禁用状态不可编辑 -->
<div style="width:25vw">
<el-form-item prop="permanentGold" label="永久金币">
<el-input v-model="addConsume.permanentGold" disabled style="width: 10vw;margin-left:40px">
<el-input v-model="addConsume.permanentGold" disabled style="width: 100px">
<template #default="scope">{{ scope.row.permanentGold }}</template>
</el-input>
<p style="margin-right: 0px">&nbsp;&nbsp;</p>
</el-form-item>
</div>
<div style="width:25vw">
<el-form-item prop="freeCoin" label="免费金币">
<el-input disabled v-model="addConsume.freeGold" style="width: 10vw;margin-left:40px" />
<el-input disabled v-model="addConsume.freeGold" style="width: 100px" />
<p style="margin-right: 0px">&nbsp;&nbsp;</p>
</el-form-item>
</div>
<div style="width:25vw">
<el-form-item prop="taskGold" label="任务金币">
<el-input disabled v-model="addConsume.taskGold" style="width: 10vw;margin-left:40px" />
<el-input disabled v-model="addConsume.taskGold" style="width: 100px" />
<p style="margin-right: 20px">&nbsp;&nbsp;</p>
</el-form-item>
</div>
<div style="width:25vw">
<el-form-item prop="remark" label="备注">
<el-input v-model="addConsume.remark" style="width: 13.5vw;margin-left:70px" :rows="4" maxlength="100" show-word-limit
<el-input v-model="addConsume.remark" style="width: 300px" :rows="4" maxlength="100" show-word-limit
type="textarea" />
</el-form-item>
</div>
<el-button type="success" @click="resetForm()" style="margin-left: 200px;margin-top:10px">重置</el-button>
<el-button type="primary" @click="addBefore" style="margin-top:10px"> 提交</el-button>
<el-button type="primary" :disabled="addDisabled" @click="addBefore" style="margin-top:10px"> 提交</el-button>
</el-form>
<!-- 客户信息栏 -->
<el-card v-if="user.jwcode" style="width: 800px; float: right" class="customer-info">
<el-form :model="user" label-width="auto" style="max-width: 1000px" label-position="left">
@ -618,7 +605,11 @@ onMounted(async function () {
p {
margin: 0px;
}
.add-form {
margin-top: 50px;
max-width: 50%;
float: left;
}
.el-form-item {
margin-left: 50px;
}
@ -629,6 +620,9 @@ p {
height: 50px;
display: block;
}
.customer-info {
max-width: 60%;
}
</style>
<style>

10
src/views/recharge/addBeanRecharge.vue

@ -43,6 +43,9 @@ const getUser = async function (jwcode) {
ElMessage.error("精网号错误");
}
}
//
const addDisabled = ref(false)
const addForm = ref({
jwcode: '',
permanentBean: '',
@ -164,6 +167,7 @@ const handleAddForm = async () => {
lockScroll: false,
}
)
addDisabled.value = true
const result = await request({
url: '/beanRecharge/add',
data: {
@ -174,6 +178,7 @@ const handleAddForm = async () => {
adminName: adminData.value.adminName
}
})
addDisabled.value = false
if (result.code == 200) {
ElMessage.success('新增成功')
addForm.value = {
@ -191,9 +196,6 @@ const handleAddForm = async () => {
ElMessage.error(error.message || '操作取消');
}
}
const throttledHandleAddFormt = _.throttle(handleAddForm, 5000, {
trailing: false
})
</script>
<template>
<div>
@ -216,7 +218,7 @@ const throttledHandleAddFormt = _.throttle(handleAddForm, 5000, {
<el-input style="width: 300px" :value="adminData.adminName" disabled placeholder="提交人姓名" />
</el-form-item> -->
<el-button @click="deleteAddForm" style="margin-left: 280px" type="success">重置</el-button>
<el-button type="primary" @click="throttledHandleAddFormt"> 提交 </el-button>
<el-button type="primary" :disabled="addDisabled" @click="handleAddForm"> 提交 </el-button>
</el-form>
<!-- 客户信息栏 -->

8
src/views/recharge/gold/addCoinRecharge.vue

@ -549,7 +549,7 @@ onMounted(() => {
<template>
<div>
<el-form :model="recharge" ref="Ref" :rules="rules" label-width="auto" style="max-width: 600px" class="add-form">
<el-form :model="recharge" ref="Ref" :rules="rules" label-width="auto" label-position="right" style="max-width: 600px" class="add-form">
<el-form-item prop="jwcode" label="精网号">
<el-input v-model="recharge.jwcode" style="width: 220px" />
<el-button type="primary" @click="getUser(recharge.jwcode)" style="margin-left: 20px">查询</el-button>
@ -636,7 +636,7 @@ onMounted(() => {
</p>
</el-form-item>
<el-form-item prop="remark" label="备注">
<el-input v-model="recharge.remark" style="width: 300px" :rows="2" maxlength="100" show-word-limit
<el-input v-model="recharge.remark" style="width: 300px" :rows="4" maxlength="100" show-word-limit
type="textarea" />
</el-form-item>
@ -753,9 +753,6 @@ p {
height: 50px;
display: block;
}
</style>
<style>
.error-message {
color: red;
font-size: 8px;
@ -796,3 +793,4 @@ p {
max-width: 60%;
}
</style>

2
src/views/refund/gold/addCoinRefund.vue

@ -440,7 +440,7 @@ onMounted(async function () {
<template>
<div>
<el-form :model="addRefund" ref="Ref" :rules="rules" label-width="auto" style="max-width: 750px" class="form-style">
<el-form :model="addRefund" ref="Ref" :rules="rules" label-width="auto" label-position="right" style="max-width: 750px" class="form-style">
<el-form-item prop="jwcode" label="精网号">
<el-input v-model="addRefund.jwcode" style="width: 220px" @change="getGoods(addRefund.jwcode)" />
<el-button type="primary" @click="getUser(addRefund.jwcode)" style="margin-left: 20px">查询

Loading…
Cancel
Save