liuhj 9 months ago
parent
commit
a663601287
1 changed files with 57 additions and 8 deletions
  1. 57 8
      src/components/statistics/paymentstatement.vue

+ 57 - 8
src/components/statistics/paymentstatement.vue

@@ -19,11 +19,36 @@
             </div>
         </el-dialog>
         <div class="paymentstatement-haed">
-            <el-date-picker @change="Dailychange" style="width:350px" v-model="value2" type="daterange" align="left"
-                unlink-panels range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
-                :picker-options="pickerOptions">
-            </el-date-picker>
-            <el-button @click="dialogFormVisible = true" type="primary">更改筛选器</el-button>
+            <div>
+                <el-date-picker style="width:350px" v-model="value2" type="daterange" align="left"
+                    unlink-panels range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
+                    :picker-options="pickerOptions">
+                </el-date-picker>
+                <el-select
+                v-model="valuecorporation"
+                multiple
+                collapse-tags
+                style="width:300px;"
+                placeholder="请选择">
+                    <el-option
+                    v-for="item in corporationoptions"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id">
+                    </el-option>
+                </el-select>
+                <el-input
+                style="width:200px;"
+                placeholder="请输入内容"
+                v-model="filter"
+                clearable>
+                </el-input>
+                <el-button  @click="Dailychange" type="primary">查 询</el-button>
+            </div>
+            <div>
+                <el-button @click="deriveclick" type="primary">导出</el-button>
+                <el-button @click="dialogFormVisible = true" type="primary">更改筛选器</el-button>
+            </div>
         </div>
         <div class="paymentstatement-tree">
             <div class="paymentstatement-tree-title">
@@ -77,6 +102,14 @@ export default {
                         start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                         picker.$emit('pick', [start, end]);
                     }
+                }, {
+                    text: '最近一年',
+                    onClick(picker) {
+                    const end = new Date();
+                    const start = new Date();
+                    start.setTime(start.getTime() - 3600 * 1000 * 24 * 365);
+                    picker.$emit('pick', [start, end]);
+                    }
                 }]
             },
             value2:'',
@@ -88,6 +121,9 @@ export default {
                 label: 'viewStr'
             },
             total:0,
+            valuecorporation:[],
+            corporationoptions:[],
+            filter:'',
         }
     },
     methods:{
@@ -117,7 +153,8 @@ export default {
                 }
             }).then(function (res) {
                 if (res.data.code == 200) {
-                    that.DailypaymentTypelist=res.data.data
+                    that.DailypaymentTypelist=res.data.data.dailyTypeData;
+                    that.corporationoptions=res.data.data.companyData;
                 } else {
                     that.$message.error(res.data.msg);
                 }
@@ -174,6 +211,9 @@ export default {
                         message: res.data.msg,
                         type: 'success'
                     });
+                    if(!that.value2<=0){
+                        that.DailypaymentRange(that.getdate(that.value2[0]),that.getdate(that.value2[1]),1)
+                    }
                 } else {
                     that.$message.error(res.data.msg);
                 }
@@ -192,7 +232,10 @@ export default {
         //日期切换
         Dailychange(){
             // console.log(this.getdate(val[0]));
-            this.DailypaymentRange(this.getdate(this.value2[0]),this.getdate(this.value2[1]),1)
+            this.DailypaymentRange(this.getdate(this.value2[0]),this.getdate(this.value2[1]),1);
+        },
+        deriveclick(){
+            this.DailypaymentRange(this.getdate(this.value2[0]),this.getdate(this.value2[1]),2);
         },
         //获取列表
         DailypaymentRange(beginDt,endDt,type){
@@ -208,17 +251,23 @@ export default {
                     portType: 1 ,
                     pageIndex:1,
                     pageSize:99999,
+                    companyIds:that.valuecorporation,
                     beginDt:beginDt,
+                    filter:that.filter,
                     endDt:endDt,
                     type:type,
                 }
             }).then(function (res) {
                 if (res.data.code == 200) {
+                    if(type==2){
+                        window.open(res.data.data.url);
+                        return
+                    }
                     that.treedata=res.data.data.data;
                     that.total=res.data.data.total;
                     for(let i=0;i<that.treedata.length;i++){
                         for(let j=0;j<that.treedata[i].contents.length;j++){
-                            that.treedata[i].contents[j].viewStr=j+1+'、'+that.treedata[i].contents[j].priceName+" 单价:"+that.treedata[i].contents[j].quantity + " 数量:"+that.treedata[i].contents[j].quantity+' 总价:'+that.treedata[i].contents[j].itemTotal;
+                            that.treedata[i].contents[j].viewStr=j+1+'、'+that.treedata[i].contents[j].priceName+" 单价:"+that.processingprice(that.treedata[i].contents[j].price) + " 数量:"+that.treedata[i].contents[j].quantity+' 总价:'+that.processingprice(that.treedata[i].contents[j].itemTotal);
                             // console.log(that.treedata[i].contents[j].priceName+" 单价:"+that.treedata[i].contents[j].quantity + " 数量:"+that.treedata[i].contents[j].quantity+' 总价'+that.treedata[i].contents[j].itemTotal);
                         }
                     }