Explorar o código

业务员收入调整

qymljy hai 1 ano
pai
achega
a5670a286e
Modificáronse 2 ficheiros con 20 adicións e 2 borrados
  1. 10 1
      src/Form/salerIncome/add.vue
  2. 10 1
      src/Form/salerIncome/edit.vue

+ 10 - 1
src/Form/salerIncome/add.vue

@@ -93,13 +93,15 @@
       </div>
       <div class="fixed__btn__panel">
         <el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
-        <el-button size="small" type="primary"  @click="onSubmit" class="normal-btn-width">确 定</el-button>
+        <el-button size="small" type="primary"  @click="onSubmit" class="normal-btn-width" :loading="loading">确 定</el-button>
       </div>
     </el-drawer>
   </div>
 </template>
 
 <script>
+import {mapGetters} from "vuex";
+
 export default {
   name: "add",
   data(){
@@ -170,6 +172,11 @@ export default {
       orderTablecols:[]
     }
   },
+  computed:{
+    ...mapGetters({
+      loading:'loading'
+    })
+  },
   methods:{
     validateInput() {
       // 使用正则表达式验证输入是否为数值
@@ -210,10 +217,12 @@ export default {
     onSubmit(){
       this.$refs.formRef.validate(async (valid)=>{
         if (!valid) return false
+        this.$store.commit('setLoading',true)
         const res = await this.$api.requested({
           "id": 20240111085604,
           "content": this.form
         })
+        this.$store.commit('setLoading',false)
         this.tool.showMessage(res,()=>{
           this.dialogVisible = false
           this.$refs.formRef.resetFields()

+ 10 - 1
src/Form/salerIncome/edit.vue

@@ -70,13 +70,15 @@
       </div>
       <div class="fixed__btn__panel">
         <el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
-        <el-button size="small" type="primary"  @click="onSubmit" class="normal-btn-width">确 定</el-button>
+        <el-button size="small" type="primary"  @click="onSubmit" class="normal-btn-width" :loading="loading">确 定</el-button>
       </div>
     </el-drawer>
   </div>
 </template>
 
 <script>
+import {mapGetters} from "vuex";
+
 export default {
   name: "edit",
   props:['data'],
@@ -139,6 +141,11 @@ export default {
       accountData:[]
     }
   },
+  computed:{
+    ...mapGetters({
+      loading:'loading'
+    })
+  },
   methods:{
     validateInput() {
       // 使用正则表达式验证输入是否为数值
@@ -177,10 +184,12 @@ export default {
     onSubmit(){
       this.$refs.formRef.validate(async (valid)=>{
         if (!valid) return false
+        this.$store.commit('setLoading',true)
         const res = await this.$api.requested({
           "id": 20240111085604,
           "content": this.form
         })
+        this.$store.commit('setLoading',false)
         this.tool.showMessage(res,()=>{
           this.dialogVisible = false
           this.$refs.formRef.resetFields()