diff --git a/src/pages/localTool/standardWarning.vue b/src/pages/localTool/standardWarning.vue index a290cf84a..8e4f32a12 100644 --- a/src/pages/localTool/standardWarning.vue +++ b/src/pages/localTool/standardWarning.vue @@ -89,14 +89,6 @@ - - FCA - HEV - 纯电动 - 传统车 - 混动 - 柴油 - @@ -105,7 +97,7 @@ - {{ scope.row.dutyEngineer }} + {{ scope.row.dutyEngineer }} @@ -160,14 +152,6 @@ - - FCA - HEV - 纯电动 - 传统车 - 混动 - 柴油 - @@ -176,7 +160,7 @@ - {{ scope.row.dutyEngineer }} + {{ scope.row.dutyEngineer }} @@ -216,14 +200,14 @@ {{ scope.row.standName }} - + - {{ scope.row.itemsId }} + {{ scope.row.itemsNum }} - {{ scope.row.itemsName }} + {{ scope.row.itemsName }} @@ -232,14 +216,6 @@ - - FCA - HEV - 纯电动 - 传统车 - 混动 - 柴油 - @@ -249,7 +225,7 @@ - {{ scope.row.dutyEngineer }} + {{ scope.row.dutyEngineer }} @@ -289,14 +265,14 @@ {{ scope.row.standName }} - + - {{ scope.row.itemsId }} + {{ scope.row.itemsNum }} - {{ scope.row.itemsName }} + {{ scope.row.itemsName }} @@ -305,14 +281,6 @@ - - FCA - HEV - 纯电动 - 传统车 - 混动 - 柴油 - @@ -322,7 +290,7 @@ - {{ scope.row.dutyEngineer }} + {{ scope.row.dutyEngineer }} @@ -472,6 +440,8 @@ export default { applyType: "", }, height: null, + energyKindOptions: [], //存放适用车型数据 + zrgcs: [], //责任工程师 // 新车型实施日期预警 newItems: [], //政策新车型实施日期预警 @@ -527,11 +497,63 @@ export default { }, { _this: this }, res => { - console.log(res.data); const result = res.data[0] for (const field in result) { this[field] = result[field].records - this.newItems = result.newItems.records + this[field].forEach(item => { + // 适用车型转换 + if (item.applyType !== null) { + let k = (item.applyType || "").split(","); + for (let i in this.energyKindOptions) { + for (let m = 0; m < k.length; m++) { + if (this.energyKindOptions[i].value === k[m]) { + k[m] = this.energyKindOptions[i].label; + } + item.applyType = k.join(","); + } + } + } + // 责任工程师转换 + if (item.dutyEngineer !== null) { + let k = (item.dutyEngineer || "").split(","); + for (let i in this.zrgcs) { + for (let m = 0; m < k.length; m++) { + if (this.zrgcs[i].value === k[m]) { + k[m] = this.zrgcs[i].label; + } + item.dutyEngineer = k.join(","); + } + } + } + }) + let arr = result.newItems.records + arr.forEach(item => { + // 适用车型转换 + if (item.applyType !== null) { + let k = (item.applyType || "").split(","); + for (let i in this.energyKindOptions) { + for (let m = 0; m < k.length; m++) { + if (this.energyKindOptions[i].value === k[m]) { + k[m] = this.energyKindOptions[i].label; + } + item.applyType = k.join(","); + } + } + } + // 责任工程师转换 + if (item.dutyEngineer !== null) { + let k = (item.dutyEngineer || "").split(","); + for (let i in this.zrgcs) { + for (let m = 0; m < k.length; m++) { + if (this.zrgcs[i].value === k[m]) { + k[m] = this.zrgcs[i].label; + } + item.dutyEngineer = k.join(","); + } + } + } + }) + this.newItems = arr //可能还需要调整一下条款或标准的顺序(zyh) switch (field) { case 'newItems': @@ -635,7 +657,6 @@ export default { this.newPolicyPage = 1 this.oldPolicypage = 1 }, e => { - console.log(e) }) }, clearBtnClick() { @@ -653,7 +674,6 @@ export default { }, //取消预警 cancelWarning(index, row) { - console.log(index, row) this.$confirm('确认取消预警?', '提示', { confirmButtonText: '确定', confirmButtonClass: 'common-button-primary', @@ -661,7 +681,6 @@ export default { type: 'warning', roundButton: false }).then(() => { - console.log(569) this.$http.get('sys/EarlyWarning/ChangePermissions', { id: row.id, }, {}, res => { @@ -679,7 +698,6 @@ export default { }) }, showStandDetails(item) { - console.log(item) let getStandId = item.sarId; let getStandType = item.sortName; // this.$http.get("lawss/sarMenu/judgeSarMenuByRole", { @@ -805,6 +823,100 @@ export default { window.onresize = () => { this.height = $(".content").height() * 0.4; }; + //从数据库中查询下拉框数据 + this.$http.get("sys/dictype/getDicTypeListCode", {}, { + _this: this + }, res => { + this.energyKindOptions = res.data.ENERGYTYPES; // 文本状态 + this.zrgcs = res.data.ZRGCSCLASS; + this.loading[this.field] = true + this.$http.get('sys/EarlyWarning/StandWarning', { + applyType: '', + ...this.pageConfig + }, { + _this: this + }, res => { + const result = res.data[0] + for (const field in result) { + this[field] = result[field].records + this[field].forEach(item => { + // 适用车型转换 + if (item.applyType !== null) { + let k = (item.applyType || "").split(","); + for (let i in this.energyKindOptions) { + for (let m = 0; m < k.length; m++) { + if (this.energyKindOptions[i].value === k[m]) { + k[m] = this.energyKindOptions[i].label; + } + item.applyType = k.join(","); + } + } + } + // 责任工程师转换 + if (item.dutyEngineer !== null) { + let k = (item.dutyEngineer || "").split(","); + for (let i in this.zrgcs) { + for (let m = 0; m < k.length; m++) { + if (this.zrgcs[i].value === k[m]) { + k[m] = this.zrgcs[i].label; + } + item.dutyEngineer = k.join(","); + } + } + } + }) + let arr = result.newItems.records + arr.forEach(item => { + console.log(item.applyType) + // 适用车型转换 + if (item.applyType !== null) { + let k = (item.applyType || "").split(","); + for (let i in this.energyKindOptions) { + for (let m = 0; m < k.length; m++) { + if (this.energyKindOptions[i].value === k[m]) { + k[m] = this.energyKindOptions[i].label; + } + item.applyType = k.join(","); + } + } + } + // 责任工程师转换 + if (item.dutyEngineer !== null) { + let k = (item.dutyEngineer || "").split(","); + for (let i in this.zrgcs) { + for (let m = 0; m < k.length; m++) { + if (this.zrgcs[i].value === k[m]) { + k[m] = this.zrgcs[i].label; + } + item.dutyEngineer = k.join(","); + } + } + } + }) + this.newItems = arr + //可能还需要调整一下条款或标准的顺序(zyh) + 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 => { + }); + + }); // this.queryNewTypeByPage(); // this.queryProductionVehicleByPage(); // 四个预警同时查询,loading全部打开