From afd7d90ec2fc12d004901d500814cd315964392f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E4=BC=9F=E4=BD=B3?= <2797716443@qq.com> Date: Wed, 9 Jun 2021 13:57:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E5=87=86=E9=A2=84=E8=AD=A6=20?= =?UTF-8?q?=E5=9B=BD=E5=86=85=E6=B3=95=E8=A7=84=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/pagination/index.vue | 18 +- .../details/otherStandardDetails/index.vue | 12 +- src/pages/localTool/standardWarning.vue | 350 ++++++++++++------ 3 files changed, 262 insertions(+), 118 deletions(-) diff --git a/src/components/pagination/index.vue b/src/components/pagination/index.vue index 2b7b6f678..39e6bab14 100644 --- a/src/components/pagination/index.vue +++ b/src/components/pagination/index.vue @@ -7,8 +7,8 @@
+

{{ sarStandardsInfoEO.standName || '-' }}

+

{{ sarStandardsInfoEO.standEnName || '-' }}

{{ sarStandardsInfoEO.standSortShow + ' ' + sarStandardsInfoEO.standNumber + '-' + sarStandardsInfoEO.standYear }} {{ sarStandardsInfoEO.standSort + ' ' + sarStandardsInfoEO.standNumber }}

-

{{ sarStandardsInfoEO.standName || '-' }}

-

{{ sarStandardsInfoEO.standEnName || '-' }}

@@ -268,20 +302,21 @@ 新车型实施日期预警
- + - + @@ -289,33 +324,44 @@ {{ (scope.row.putTime ? scope.row.putTime.substring(0, 11) : "") }} + + +
+ :page="pageConfig.newPolicyPage" + :pageSize="pageConfig.newPolicyPageSize" + :total="pageConfig.count5" + autoSize + @pageChange="page => handlePageChange('newPolicy', page)" + @pageSizeChange="pageSize => handlePageSizeChange('newPolicy', pageSize)">
在产车实施日期预警
- + - + @@ -323,14 +369,24 @@ {{ (scope.row.putTime ? scope.row.putTime.substring(0, 11) : "") }} + + +
+ :page="pageConfig.oldPolicyPage" + :pangSize="pageConfig.oldPolicyPageSize" + :total="pageConfig.count6" + autoSize + @pageChange="page => handlePageChange('oldPolicy', page)" + @pageSizeChange="pageSize => handlePageSizeChange('oldPolicy', pageSize)">
@@ -350,6 +406,7 @@ export default { name: "standardWarning", data() { return { + isShowBtn: true, activeName: "STANDARD", //tab 默认选中值 // 头部搜索框 dynamic: { @@ -358,32 +415,53 @@ export default { height: null, // 新车型实施日期预警 newItems: [], + //政策新车型实施日期预警 + newPolicy: [], // 新车型条款预警 newStand: [], // 在产车实施日期预警 oldItems: [], // 在产车条款预警 oldStand: [], + //政策在产车实施日期预警 + oldPolicy: [], tableHeight: 0, pageConfig: { - current1: 1, - pageSize1: 10, + newItemsPage: 1, + newItemsPageSize: 10, count1: 0, - current2: 1, - pageSize2: 10, + newStandPage: 1, + newStandPageSize: 10, count2: 0, - current3: 1, - pageSize3: 10, + oldItemsPage: 1, + oldItemsPageSize: 10, count3: 0, - current4: 1, - pageSize4: 10, - count4: 0 - } + oldStandPage: 1, + oldStandPageSize: 10, + count4: 0, + newPolicyPage: 1, + newPolicyPageSize: 10, + count5: 0, + oldPolicyPage: 1, + oldPolicyPageSize: 10, + count6: 0, + }, + loading: { + newItems: false, + oldItems: false, + newStand: false, + oldStand: false, + newPolicy: false, + oldPolicy: false, + }, + // 记录当前分页器是哪个预警信息触发 + field: '' }; }, methods: { - // 获取数据 (type用于区别分页器切换) + // 获取标准预警数据 (type用于区别分页器切换) getEarlyDate() { + this.loading[this.field] = true this.$http.get('sys/EarlyWarning/StandWarning', { applyType: '', ...this.pageConfig @@ -391,17 +469,56 @@ export default { _this: this },res => { const result = res.data[0] - Object.keys(result).forEach((tableName, index) => { - const tableRes = result[tableName] - const count = `count${index + 1}` - this.pageConfig[count] = tableRes.total - this[tableName] = tableRes.records - }) + for (const field in result) { + this[field] = result[field].records + // this.newItems = result.newItems.records + switch (field) { + case 'newItems': + this.pageConfig.count1 = result.newItems.total + break + case 'oldItems': + this.pageConfig.count2 = result.oldItems.total + break + case 'newStand': + this.pageConfig.count3 = result.newStand.total + break + case 'oldStand': + this.pageConfig.count4 = result.oldStand.total + break + } + } + for (const loading in this.loading) { this.loading[loading] = false } }, e => { }); }, + //获取政策预警数据(type用于区别分页器切换) + getPolicyDate() { + this.loading[this.field] = true + this.$http.get('sys/EarlyWarning/PolicyWarning', { + applyType: '', + ...this.pageConfig + },{ + _this: this + }, res => { + const policys = res.data[0] + for(const field in policys) { + this[field] = policys[field].records + switch(field) { + case 'newPolicy': + this.pageConfig.count5 = policys.newPolicy.total + break + case 'oldPolicy': + this.pageConfig.count6 = policys.oldPolicy.total + break + } + } + for(const loading in this.loading) {this.loading[loading] = false} + }, e => { + }); + }, // 切换tab handleClick(tab, event) { + this.getPolicyDate(); switch (tab.name) { case "POLICY": const computedHeight = () => { @@ -418,7 +535,27 @@ export default { }, //查找适用车型 searchBtnClick() { - console.log("查找适用车型"); + this.$http.get('sys/EarlyWarning/StandWarning', { + ...this.pageConfig, + applyType: this.dynamic.keyword + },{ + _this: this, + }, res=> { + const result = res.data[0] + // Object.keys(result).forEach((tableName,index) => { + // const tableRes = result[tableName] + // const count = `count${index + 1}` + // this.pageConfig[count] = tableRes.total + // this[tableName] = tableRes.records + // console.log(tableRes) + // }) + }, e => { + console.log(e) + }) + }, + //取消预警 + cancelWarning (index, row) { + console.log(index, row) }, showStandDetails(item) { let getStandId = item.sarId; @@ -515,44 +652,38 @@ export default { switch (field) { // 新车型实施日期预警 case 'newItems': - this.pageConfig.current1 = page + this.pageConfig.newItemsPage = page break // 新车型条款预警 case 'newStand': - this.pageConfig.current2 = page + this.pageConfig.newStandPage = page break // 在产车实施日期预警 case 'oldItems': - this.pageConfig.current3 = page + this.pageConfig.oldItemsPage = page break // 在产车条款预警 case 'oldStand': - this.pageConfig.current4 = page + this.pageConfig.oldStandPage = page + break + // 政策新车型实施日期预警 + case 'newPolicy': + this.pageConfig.newPolicyPage = page + break + //政策 在产车实施日期预警 + case 'oldPolicy': + this.pageConfig.oldPolicyPage = page break } - this.getEarlyDate() + this.activeName === 'STANDARD' ? this.getEarlyDate() : this.getPolicyDate() + this.field = field }, //分页每页显示数改变后方法 handlePageSizeChange(field, pageSize) { - switch (field) { - // 新车型实施日期预警 - case 'newItems': - this.pageConfig.pageSize1 = pageSize - break - // 新车型条款预警 - case 'newStand': - this.pageConfig.pageSize2 = pageSize - break - // 在产车实施日期预警 - case 'oldItems': - this.pageConfig.pageSize3 = pageSize - break - // 在产车条款预警 - case 'oldStand': - this.pageConfig.pageSize4 = pageSize - break - } - this.getEarlyDate() + const _pageSize = field + 'PageSize' + this.pageConfig[_pageSize] = pageSize + this.activeName === 'STANDARD' ? this.getEarlyDate() : this.getPolicyDate() + this.field = field }, ...mapMutations(["setDetailMap"]) }, @@ -576,7 +707,10 @@ export default { }; this.queryNewTypeByPage(); this.queryProductionVehicleByPage(); + // 四个预警同时查询,loading全部打开 + for (const loading in this.loading) { this.loading[loading] = true } this.getEarlyDate(); + } };