Forráskód Böngészése

利润总账限制修改

wengyuwen 4 éve
szülő
commit
deeca2ce16
1 módosított fájl, 7 hozzáadás és 3 törlés
  1. 7 3
      src/views/reportAnalysis/profitGeneralLedger.vue

+ 7 - 3
src/views/reportAnalysis/profitGeneralLedger.vue

@@ -35,6 +35,8 @@
           <el-form-item label="开始月" prop="mothStar">
             <el-select
               v-model="queryParams.mothStar"
+              @change="changeMonth"
+              clearable
               style="width: 200px">
               <el-option
               v-for="(item,index) in monthOption"
@@ -47,6 +49,7 @@
           <el-select
             v-model="queryParams.mothEnd"
             @change="changeMonth"
+            clearable
             style="width: 200px">
             <el-option
               v-for="(item,index) in monthOption"
@@ -317,7 +320,8 @@ export default {
   },
   methods: {
     changeMonth(){
-      if(this.queryParams.mothEnd < this.queryParams.mothStar){
+      if(this.queryParams.mothEnd && this.queryParams.mothStar && this.queryParams.mothEnd <= this.queryParams.mothStar){
+        console.log("111")
         this.$message.error("结束月不能小于开始月,请重新选择")
         this.queryParams.mothEnd = ''
       }
@@ -401,7 +405,7 @@ export default {
       columns.forEach((column, index) => {
         if (index === 0) {
           sums[index] = '总计'
-        } else if (index === 7 || index === 8 || index === 9) {
+        } else if (column.label === '收入' || column.label === '支出' || column.label === '利润') {
           const values = data.map(item => Number(item[column.property]))
           if (!values.every(value => isNaN(value))) {
             sums[index] = values.reduce((prev, curr) => {
@@ -421,7 +425,7 @@ export default {
     /** 查询库存总账列表 */
     getList() {
       this.loading = true
-      if(this.queryParams.monthList[0] && this.queryParams.monthList[1]){
+      if(this.queryParams.mothStar && this.queryParams.mothEnd){
         this.queryParams.monthList[0] = this.queryParams.mothStar
         this.queryParams.monthList[1] = this.queryParams.mothEnd
       }