Browse Source

支出凭证,收入凭证调整

qymljy 1 year ago
parent
commit
e75bb91bff

+ 11 - 11
src/Form/payvoucher/add.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-button size="mini" type="primary" @click="dialogFormVisible = true" >新 建</el-button>
+    <el-button size="mini" type="primary" @click="dialogFormVisible = true; classList()" >新 建</el-button>
     <el-drawer
         title="创建支出凭证"
         :visible.sync="dialogFormVisible"
@@ -57,8 +57,8 @@
                   <el-option
                       v-for="item in subClass"
                       :key="item.rowindex"
-                      :label="item.value"
-                      :value="item.value">
+                      :label="item"
+                      :value="item">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -194,16 +194,16 @@ export default {
           }
         }
       })
-      console.log("支出凭证分类",res)
       this.classData = res.data
-      console.log(this.classData)
     },
     classChange(res){
-      console.log("选择",res)
-      console.log("明细",this.classData[res-1])
-      this.form.class = this.classData[res-1].value
-      this.subClass = this.classData[res-1].subvalues
-      console.log("form",this.form)
+      this.form.subclass = ''
+      this.subClass = []
+      this.classData.forEach(item=>{
+        if (item.value == res){
+          this.subClass = item.subvalues
+        }
+      })
     },
     onClose(){
       this.dialogFormVisible = false
@@ -225,7 +225,7 @@ export default {
     }
   },
   created() {
-    this.classList()
+
   },
   watch:{
     "form.sys_enterpriseid":function (val){

+ 19 - 8
src/Form/payvoucher/edit.vue

@@ -7,7 +7,7 @@
         size="40%"
         direction="rtl"
         append-to-body
-        @close="dialogFormVisible = false">
+        @close="onClose">
       <div class="drawer__panel">
         <el-row :gutter="20">
           <el-form :model="form" :rules="rules" ref="form" label-width="90px" label-position="right" size="mini">
@@ -57,8 +57,8 @@
                   <el-option
                       v-for="item in subClass"
                       :key="item.rowindex"
-                      :label="item.value"
-                      :value="item.value">
+                      :label="item"
+                      :value="item">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -72,7 +72,7 @@
         </el-row>
       </div>
       <div class="fixed__btn__panel">
-        <el-button size="small" @click="dialogFormVisible = false" class="normal-btn-width">取 消</el-button>
+        <el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
         <el-button size="small" type="warning" @click="onSubmit" class="normal-btn-width">保 存</el-button>
       </div>
     </el-drawer>
@@ -119,6 +119,7 @@ export default {
   methods:{
     onShow(){
       this.dialogFormVisible = true
+      this.classList()
       this.form = this.data
     },
     onSubmit(){
@@ -136,6 +137,11 @@ export default {
         })
       })
     },
+    onClose(){
+      this.$emit('onSuccess')
+      this.$refs['form'].resetFields()
+      this.dialogFormVisible = false
+    },
     enterpriseList(){
 
       this.visibleEnterprise = true
@@ -179,13 +185,18 @@ export default {
       this.classData = res.data
     },
     classChange(res){
-      this.form.class = this.classData[res-1].value
-      this.subClass = this.classData[res-1].subvalues
+      this.form.subclass = ''
+      this.subClass = []
+      this.classData.forEach(item=>{
+        if (item.value == res){
+          this.subClass = item.subvalues
+        }
+      })
     }
   },
   created() {
-    this.classList()
-    this.form = this.data
+
+
   },
   watch:{
     "form.sys_enterpriseid":function (val){

+ 13 - 13
src/Form/recvoucher/add.vue

@@ -1,13 +1,13 @@
 <template>
   <div>
-    <el-button size="mini" type="primary" @click="dialogFormVisible = true">新 建</el-button>
+    <el-button size="mini" type="primary" @click="dialogFormVisible = true; classList()">新 建</el-button>
     <el-drawer
         title="创建收入凭证"
         :visible.sync="dialogFormVisible"
         size="40%"
         direction="rtl"
         append-to-body
-        @close="dialogFormVisible = false">
+        @close="onClose">
       <div class="drawer__panel">
         <el-row :gutter="20">
           <el-form :model="form" :rules="rules" ref="form" label-width="90px" label-position="right" size="mini">
@@ -57,8 +57,8 @@
                   <el-option
                       v-for="item in subClass"
                       :key="item.rowindex"
-                      :label="item.value"
-                      :value="item.value">
+                      :label="item"
+                      :value="item">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -72,7 +72,7 @@
         </el-row>
       </div>
       <div class="fixed__btn__panel">
-        <el-button size="small" @click="dialogFormVisible = false" class="normal-btn-width">取 消</el-button>
+        <el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
         <el-button size="small" type="primary" @click="onSubmit" :loading="loading" class="normal-btn-width">确 定</el-button>
       </div>
     </el-drawer>
@@ -195,16 +195,16 @@ export default {
           }
         }
       })
-      console.log("收入凭证分类",res)
       this.classData = res.data
-      console.log(this.classData)
     },
     classChange(res){
-      console.log("选择",res)
-      console.log("明细",this.classData[res-1])
-      this.form.class = this.classData[res-1].value
-      this.subClass = this.classData[res-1].subvalues
-      console.log("form",this.form)
+      this.form.subclass = ''
+      this.subClass = []
+      this.classData.forEach(item=>{
+        if (item.value == res){
+          this.subClass = item.subvalues
+        }
+      })
     },
     onClose(){
       this.dialogFormVisible = false
@@ -226,7 +226,7 @@ export default {
     }
   },
   created() {
-    this.classList()
+
   },
   watch:{
     "form.sys_enterpriseid":function (val){

+ 18 - 11
src/Form/recvoucher/edit.vue

@@ -7,7 +7,7 @@
         size="25%"
         direction="rtl"
         append-to-body
-        @close="dialogFormVisible = false">
+        @close="onClose">
       <div class="drawer__panel">
         <el-row :gutter="20">
           <el-form :model="form" :rules="rules" ref="form" label-width="90px" label-position="right" size="mini">
@@ -57,8 +57,8 @@
                   <el-option
                       v-for="item in subClass"
                       :key="item.rowindex"
-                      :label="item.value"
-                      :value="item.value">
+                      :label="item"
+                      :value="item">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -72,7 +72,7 @@
         </el-row>
       </div>
       <div class="fixed__btn__panel">
-        <el-button size="small" @click="dialogFormVisible = false" class="normal-btn-width">取 消</el-button>
+        <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>
       </div>
     </el-drawer>
@@ -120,6 +120,7 @@ export default {
     onShow(){
       this.dialogFormVisible = true
       console.log(this.data)
+      this.classList()
       this.form = this.data
     },
     onSubmit(){
@@ -138,6 +139,11 @@ export default {
         })
       })
     },
+    onClose(){
+      this.$emit('onSuccess')
+      this.$refs['form'].resetFields()
+      this.dialogFormVisible = false
+    },
     enterpriseList(){
 
       this.visibleEnterprise = true
@@ -185,16 +191,17 @@ export default {
       console.log(this.classData)
     },
     classChange(res){
-      console.log("选择",res)
-      console.log("明细",this.classData[res-1])
-      this.form.class = this.classData[res-1].value
-      this.subClass = this.classData[res-1].subvalues
-      console.log("form",this.form)
+      this.form.subclass = ''
+      this.subClass = []
+      this.classData.forEach(item=>{
+        if (item.value == res){
+          this.subClass = item.subvalues
+        }
+      })
     }
   },
   created() {
-    this.classList()
-    this.form = this.data
+
   },
   watch:{
     "form.sys_enterpriseid":function (val){

+ 3 - 3
src/HDrpManagement/payvoucher/details/index.vue

@@ -52,6 +52,9 @@ export default {
       mainAreaData:[],
     }
   },
+  mounted() {
+    this.queryMainData(this.$route.query.id)
+  },
   methods:{
     async queryMainData(id){
       const res = await this.$api.requested({
@@ -144,9 +147,6 @@ export default {
     }
   },
   created() {
-    console.log('触发111');
-
-    this.queryMainData(this.$route.query.id)
   }
 }
 </script>

+ 0 - 3
src/HDrpManagement/payvoucher/details/modules/detailedData.vue

@@ -46,7 +46,6 @@ export default {
   methods:{
     style(val) {
       let style = {}
-      console.log(val,'执行了')
       switch (val) {
         case '新建':
           style = {color:"#000000"}
@@ -57,9 +56,7 @@ export default {
         default:
           break;
       }
-      console.log(style)
       this.colorStyle.color = style.color
-      console.log(this.colorStyle,"1111")
       return style
 
     }

+ 3 - 1
src/HDrpManagement/recvoucher/details/index.vue

@@ -212,8 +212,10 @@ export default {
       this.queryMainData(this.$route.query.id)
     }
   },
-  created() {
+  mounted() {
     this.queryMainData(this.$route.query.id)
+  },
+  created() {
   }
 }
 </script>

+ 0 - 3
src/HDrpManagement/recvoucher/details/modules/detailedData.vue

@@ -47,7 +47,6 @@ export default {
   methods:{
     style(val) {
       let style = {}
-      console.log(val,'执行了')
       switch (val) {
         case '新建':
           style = {color:"#000000"}
@@ -58,9 +57,7 @@ export default {
         default:
           break;
       }
-      console.log(style)
       this.colorStyle.color = style.color
-      console.log(this.colorStyle,"1111")
       return style
 
     }