|
@@ -11,6 +11,7 @@
|
|
|
:summary-method="summaryMethod"
|
|
|
@row-del="rowDel"
|
|
|
@search-change="searchChange"
|
|
|
+ @current-change="currentChange"
|
|
|
@refresh-change="refreshChange"
|
|
|
@on-load="getList"
|
|
|
@saveColumn="saveColumn"
|
|
@@ -21,6 +22,9 @@
|
|
|
:configuration="configuration"
|
|
|
></select-component>
|
|
|
</template>
|
|
|
+ <template slot-scope="scope" slot="corpId">
|
|
|
+ {{ scope.row.corpNames }}
|
|
|
+ </template>
|
|
|
<template slot="corpAttnSearch">
|
|
|
<el-select v-model="search.corpAttn"
|
|
|
remote
|
|
@@ -43,9 +47,10 @@
|
|
|
@click="addMainItems">新 单
|
|
|
</el-button>
|
|
|
<el-button size="small"
|
|
|
+ icon="el-icon-printer"
|
|
|
type="info"
|
|
|
@click.stop="openReport()"
|
|
|
- >导出报表
|
|
|
+ >报表
|
|
|
</el-button>
|
|
|
</template>
|
|
|
<template slot-scope="scope" slot="menu">
|
|
@@ -65,10 +70,6 @@
|
|
|
>删除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
- <report-dialog
|
|
|
- :switchDialog="switchDialog"
|
|
|
- @onClose="onClose()"
|
|
|
- ></report-dialog>
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
<detail-page
|
|
@@ -92,7 +93,6 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- switchDialog:false,
|
|
|
loading: false,
|
|
|
data: [],
|
|
|
options:[],
|
|
@@ -150,29 +150,46 @@ export default {
|
|
|
this.options = res.data.data
|
|
|
})
|
|
|
},
|
|
|
- //打印
|
|
|
+ //报表
|
|
|
openReport() {
|
|
|
- this.switchDialog =! this.switchDialog;
|
|
|
+ let searchParams = Object.assign({},this.search);
|
|
|
+ let param = this.paramsAdjustment(searchParams)
|
|
|
+ getList(1, 10000,param).then(res =>{
|
|
|
+ const fileData = this.deepClone(res.data.data.records)
|
|
|
+ fileData.map(item =>{
|
|
|
+ item.corpId = item.corpNames
|
|
|
+ })
|
|
|
+ this.$Export.excel({
|
|
|
+ title: "主营项目",
|
|
|
+ columns: option.column,
|
|
|
+ data: fileData,
|
|
|
+ });
|
|
|
+ })
|
|
|
},
|
|
|
+
|
|
|
//关闭打印
|
|
|
onClose(val) {
|
|
|
this.switchDialog = val;
|
|
|
},
|
|
|
- //flag:0 判断是主营项目还是结算
|
|
|
- getList(page,params = {}) {
|
|
|
+ paramsAdjustment(params){
|
|
|
+ params = Object.assign({},this.search);
|
|
|
+ if (params.createTime && params.createTime.length !=0) { //发货
|
|
|
+ params.createStartDate = params.createTime[0]+ " " + "00:00:00";
|
|
|
+ params.createEndDate = params.createTime[1] + " " + "23:59:59";
|
|
|
+ this.$delete(params,'createTime')
|
|
|
+ }
|
|
|
params.flag = 0;
|
|
|
+ return params
|
|
|
+ },
|
|
|
+ //flag:0 判断是主营项目还是结算
|
|
|
+ getList(page,params) {
|
|
|
+ params = this.paramsAdjustment(params)
|
|
|
this.loading = true;
|
|
|
- if(params){
|
|
|
- if (params.createTime && params.createTime.length !=0) { //发货
|
|
|
- params.createStartDate = params.createTime[0]+ " " + "00:00:00";
|
|
|
- params.createEndDate = params.createTime[1] + " " + "23:59:59";
|
|
|
- this.$delete(params,'createTime')
|
|
|
- }
|
|
|
- }
|
|
|
getList(page.currentPage, page.pageSize,params).then(res =>{
|
|
|
this.data = res.data.data.records
|
|
|
this.page.total = res.data.data.total
|
|
|
- this.loading = false
|
|
|
+ }).finally(()=>{
|
|
|
+ this.loading = false;
|
|
|
})
|
|
|
},
|
|
|
//新单打开
|
|
@@ -195,6 +212,10 @@ export default {
|
|
|
this.getList(this.page, params);
|
|
|
done();
|
|
|
},
|
|
|
+ currentChange(val) {
|
|
|
+ this.page.currentPage = val;
|
|
|
+ this.getList(this.page);
|
|
|
+ },
|
|
|
refreshChange(params) {
|
|
|
this.getList(this.page,params);
|
|
|
},
|
|
@@ -261,16 +282,7 @@ export default {
|
|
|
goBack() {
|
|
|
this.detailData=this.$options.data().detailData
|
|
|
this.show = true;
|
|
|
-
|
|
|
- let params = Object.assign({}, this.search)
|
|
|
-
|
|
|
- if (params.createTime && params.createTime.length !=0) { //发货
|
|
|
- params.createStartDate = params.createTime[0]+ " " + "00:00:00";
|
|
|
- params.createEndDate = params.createTime[1] + " " + "23:59:59";
|
|
|
- this.$delete(params,'createTime')
|
|
|
- }
|
|
|
-
|
|
|
- this.getList(this.page,params)
|
|
|
+ this.getList(this.page, this.search)
|
|
|
},
|
|
|
}
|
|
|
};
|