Browse Source

收入支出凭证调整

qymljy 2 years ago
parent
commit
55391776b4

+ 18 - 5
src/Form/salerExpenditure/add.vue

@@ -4,7 +4,7 @@
     <el-drawer
         title="新建支出凭证"
         :visible.sync="dialogVisible"
-        size="600px"
+        size="800px"
         direction="rtl"
         append-to-body
         @close="onClose">
@@ -18,6 +18,8 @@
                     v-model="isShow"
                     width="600"
                     trigger="click">
+                  <el-input  style="width:200px;margin-bottom: 10px" placeholder="搜索" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
+                  </el-input>
                   <tableNewLayout :layout="tablecols" :data="list" :opwidth="200" height="400px" :width="true" :custom="true" @rowClick="rowClick">
                     <template v-slot:customcol="scope">
                       <div>
@@ -55,12 +57,12 @@
             </el-col>
             <el-col :span="24">
               <el-form-item label="金额:" prop="amount">
-                <el-input v-model="form.amount" placeholder="请填写金额"></el-input>
+                <el-input v-model="form.amount" placeholder="请填写金额" v-on:input="validateInput"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="24">
               <el-form-item label="收入凭证:" prop="source_hrcashbill">
-                <tableNewLayout ref="tableRef" :checkbox="true" :layout="income.tablecols" :data="income.list" :opwidth="200" height="400px" :width="true" :custom="true" @selectionChange="selectionChange">
+                <tableNewLayout ref="tableRef" :checkbox="true" :layout="income.tablecols" :data="income.list" :opwidth="200" height="calc(100vh - 440px)" :width="true" :custom="true" @selectionChange="selectionChange">
                   <template v-slot:customcol="scope">
                     <div>
                       {{scope.column.data[[scope.column.columnname]] || scope.column.columnname === 'operation'?scope.column.data[[scope.column.columnname]]:'--'}}
@@ -121,7 +123,7 @@ export default {
         ],
         amount:[
           { required: true, message: '金额不可为空', trigger: 'change'},
-          { pattern:/^[0-9]+\.{0,1}[0-9]{0,6}$/,message: '输入不合法,请输入数值',trigger: 'change'},
+        /*  { pattern:/^[0-9]+\.{0,1}[0-9]{0,6}$/,message: '输入不合法,请输入数值',trigger: 'change'},*/
         ],
       },
       param:{
@@ -162,6 +164,10 @@ export default {
     }
   },
   methods:{
+    validateInput() {
+      // 使用正则表达式验证输入是否为数值
+      this.form.amount = this.form.amount.replace(/[^-0-9][^\d.]/g, '');
+    },
     /*可选业务员*/
     async listData(){
       const res = await this.$api.requested(this.param)
@@ -233,6 +239,11 @@ export default {
           "amount":item.amount
         }
       })
+    },
+  },
+  watch:{
+    'isShow':function (val){
+      this.param.content.where.condition = ''
     }
   },
   mounted() {
@@ -246,5 +257,7 @@ export default {
 </script>
 
 <style scoped>
-
+/deep/ .el-input__validateIcon {
+  display: none;
+}
 </style>

+ 18 - 5
src/Form/salerExpenditure/edit.vue

@@ -4,7 +4,7 @@
     <el-drawer
         title="编辑支出凭证"
         :visible.sync="dialogVisible"
-        size="600px"
+        size="800px"
         direction="rtl"
         append-to-body
         @close="onClose">
@@ -18,6 +18,8 @@
                     v-model="isShow"
                     width="600"
                     trigger="click">
+                  <el-input  style="width:200px;margin-bottom: 10px" placeholder="搜索" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
+                  </el-input>
                   <tableNewLayout :layout="tablecols" :data="list" :opwidth="200" height="400px" :width="true" :custom="true" @rowClick="rowClick">
                     <template v-slot:customcol="scope">
                       <div>
@@ -55,12 +57,12 @@
             </el-col>
             <el-col :span="24">
               <el-form-item label="金额:" prop="amount">
-                <el-input v-model="form.amount" placeholder="请填写金额"></el-input>
+                <el-input v-model="form.amount" placeholder="请填写金额" v-on:input="validateInput"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="24">
               <el-form-item label="收入凭证:" prop="source_hrcashbill">
-                <tableNewLayout ref="tableRef" :checkbox="false" :layout="income.tablecols" :data="income.list" :opwidth="200" height="400px" :width="true" :custom="true" @selectionChange="selectionChange">
+                <tableNewLayout ref="tableRef" :checkbox="false" :layout="income.tablecols" :data="income.list" :opwidth="200" height="calc(100vh - 440px)" :width="true" :custom="true" @selectionChange="selectionChange">
                   <template v-slot:customcol="scope">
                     <div v-if="scope.column.columnname === 'amount'">
                       {{tool.formatAmount(scope.column.data[[scope.column.columnname]],2)}}
@@ -125,7 +127,7 @@ export default {
         ],
         amount:[
           { required: true, message: '金额不可为空', trigger: 'change'},
-          { pattern:/^[0-9]+\.{0,1}[0-9]{0,6}$/,message: '输入不合法,请输入数值',trigger: 'change'},
+         /* { pattern:/^[0-9]+\.{0,1}[0-9]{0,6}$/,message: '输入不合法,请输入数值',trigger: 'change'},*/
         ],
       },
       param:{
@@ -166,6 +168,10 @@ export default {
     }
   },
   methods:{
+    validateInput() {
+      // 使用正则表达式验证输入是否为数值
+      this.form.amount = this.form.amount.replace(/[^-0-9][^\d.]/g, '');
+    },
     onShow(){
       this.form = Object.assign({},this.form,this.data)
       this.income.list = this.data.detail
@@ -245,6 +251,11 @@ export default {
       })
     }
   },
+  watch:{
+    'isShow':function (val){
+      this.param.content.where.condition = ''
+    }
+  },
   mounted() {
     this.queryAccountType()
   },
@@ -256,5 +267,7 @@ export default {
 </script>
 
 <style scoped>
-
+/deep/ .el-input__validateIcon {
+  display: none;
+}
 </style>

+ 17 - 4
src/Form/salerIncome/add.vue

@@ -4,7 +4,7 @@
     <el-drawer
         title="新建收入凭证"
         :visible.sync="dialogVisible"
-        size="600px"
+        size="800px"
         direction="rtl"
         append-to-body
         @close="onClose">
@@ -18,6 +18,8 @@
                     v-model="isShow"
                     width="600"
                     trigger="click">
+                  <el-input  style="width:200px;margin-bottom: 10px" placeholder="搜索" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
+                  </el-input>
                     <tableNewLayout :layout="tablecols" :data="list" :opwidth="200" height="400px" :width="true" :custom="true" @rowClick="rowClick">
                       <template v-slot:customcol="scope">
                         <div>
@@ -55,7 +57,7 @@
             </el-col>
             <el-col :span="24">
               <el-form-item label="金额:" prop="amount">
-                <el-input v-model="form.amount" placeholder="请填写金额"></el-input>
+                <el-input v-model="form.amount" placeholder="请填写金额" v-on:input="validateInput"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="24">
@@ -112,7 +114,7 @@ export default {
         ],
         amount:[
           { required: true, message: '金额不可为空', trigger: 'change'},
-          { pattern:/^[0-9]+\.{0,1}[0-9]{0,6}$/,message: '输入不合法,请输入数值',trigger: 'change'},
+         /* { pattern:/^[0-9]+\.{0,1}[0-9]{0,6}$/,message: '输入不合法,请输入数值',trigger: 'change'},*/
         ],
       },
       param:{
@@ -137,6 +139,10 @@ export default {
     }
   },
   methods:{
+    validateInput() {
+      // 使用正则表达式验证输入是否为数值
+      this.form.amount = this.form.amount.replace(/[^-0-9][^\d.]/g, '');
+    },
     async listData(){
       const res = await this.$api.requested(this.param)
       this.list = res.data
@@ -186,6 +192,11 @@ export default {
       this.accountData = res.data
     }
   },
+  watch:{
+    'isShow':function (val){
+      this.param.content.where.condition = ''
+    }
+  },
   mounted() {
     this.queryAccountType()
   },
@@ -196,5 +207,7 @@ export default {
 </script>
 
 <style scoped>
-
+/deep/ .el-input__validateIcon {
+  display: none;
+}
 </style>

+ 17 - 6
src/Form/salerIncome/edit.vue

@@ -4,7 +4,7 @@
     <el-drawer
         title="编辑收入凭证"
         :visible.sync="dialogVisible"
-        size="600px"
+        size="800px"
         direction="rtl"
         append-to-body
         @close="onClose">
@@ -18,6 +18,8 @@
                     v-model="isShow"
                     width="600"
                     trigger="click">
+                  <el-input  style="width:200px;margin-bottom: 10px" placeholder="搜索" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
+                  </el-input>
                   <tableNewLayout :layout="tablecols" :data="list" :opwidth="200" height="400px" :width="true" :custom="true" @rowClick="rowClick">
                     <template v-slot:customcol="scope">
                       <div>
@@ -55,7 +57,7 @@
             </el-col>
             <el-col :span="24">
               <el-form-item label="金额:" prop="amount">
-                <el-input v-model="form.amount" placeholder="请填写金额"></el-input>
+                <el-input v-model="form.amount" placeholder="请填写金额" v-on:input="validateInput"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="24">
@@ -113,7 +115,7 @@ export default {
         ],
         amount:[
           { required: true, message: '金额不可为空', trigger: 'change'},
-          { pattern:/^[0-9]+\.{0,1}[0-9]{0,6}$/,message: '输入不合法,请输入数值',trigger: 'change'},
+         /* { pattern:/^[0-9]+\.{0,1}[0-9]{0,6}$/,message: '输入不合法,请输入数值',trigger: 'change'},*/
         ],
       },
       param:{
@@ -138,6 +140,10 @@ export default {
     }
   },
   methods:{
+    validateInput() {
+      // 使用正则表达式验证输入是否为数值
+      this.form.amount = this.form.amount.replace(/[^-0-9][^\d.]/g, '');
+    },
     onShow(){
       this.form = Object.assign({},this.form,this.data)
     },
@@ -190,6 +196,11 @@ export default {
       this.accountData = res.data
     }
   },
+  watch:{
+    'isShow':function (val){
+      this.param.content.where.condition = ''
+    }
+  },
   mounted() {
     this.queryAccountType()
   },
@@ -198,9 +209,9 @@ export default {
   }
 }
 </script>
-}
-</script>
 
 <style scoped>
-
+/deep/ .el-input__validateIcon {
+  display: none;
+}
 </style>