标准预警bug修复~

This commit is contained in:
Mr.Z
2021-09-03 10:33:45 +08:00
parent 47da0d589e
commit 61464742bd
+160 -48
View File
@@ -89,14 +89,6 @@
</template>
</el-table-column>
<el-table-column prop="applyType" label="适用车型" align="center">
<template slot-scope="scope">
<div v-if="scope.row.applyType === 'EKFCA'">FCA</div>
<div v-if="scope.row.applyType === 'EKHEV'">HEV</div>
<div v-if="scope.row.applyType === 'EKEV'">纯电动</div>
<div v-if="scope.row.applyType === 'EKQY'">传统车</div>
<div v-if="scope.row.applyType === 'EKPHEV'">混动</div>
<div v-if="scope.row.applyType === 'DIESEL'">柴油</div>
</template>
</el-table-column>
<el-table-column label="标准类型" align="center">
<template slot-scope="scope">
@@ -105,7 +97,7 @@
</el-table-column>
<el-table-column prop="dutyEngineer" label="标准责任工程师" align="center">
<template slot-scope="scope">
<a @click="showStandDetails(scope.row)">{{ scope.row.dutyEngineer }}</a>
<div>{{ scope.row.dutyEngineer }}</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" v-if="isShowBtn">
@@ -160,14 +152,6 @@
</template>
</el-table-column>
<el-table-column prop="applyType" label="适用车型" align="center">
<template slot-scope="scope">
<div v-if="scope.row.applyType === 'EKFCA'">FCA</div>
<div v-if="scope.row.applyType === 'EKHEV'">HEV</div>
<div v-if="scope.row.applyType === 'EKEV'">纯电动</div>
<div v-if="scope.row.applyType === 'EKQY'">传统车</div>
<div v-if="scope.row.applyType === 'EKPHEV'">混动</div>
<div v-if="scope.row.applyType === 'DIESEL'">柴油</div>
</template>
</el-table-column>
<el-table-column label="标准类型" align="center">
<template slot-scope="scope">
@@ -176,7 +160,7 @@
</el-table-column>
<el-table-column prop="dutyEngineer" label="标准责任工程师" align="center">
<template slot-scope="scope">
<a @click="showStandDetails(scope.row)">{{ scope.row.dutyEngineer }}</a>
<div>{{ scope.row.dutyEngineer }}</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" v-if="isShowBtn">
@@ -216,14 +200,14 @@
<a @click="handlePreview(scope.row)">{{ scope.row.standName }}</a>
</template>
</el-table-column>
<el-table-column prop="itemsId" label="条款号" align="center">
<el-table-column prop="itemsNum" label="条款号" align="center">
<template slot-scope="scope">
<a @click="showStandDetails(scope.row)">{{ scope.row.itemsId }}</a>
<div>{{ scope.row.itemsNum }}</div>
</template>
</el-table-column>
<el-table-column prop="itemsName" label="条款要求" align="center">
<template slot-scope="scope">
<a @click="showStandDetails(scope.row)">{{ scope.row.itemsName }}</a>
<div>{{ scope.row.itemsName }}</div>
</template>
</el-table-column>
<el-table-column prop="putTime" label="实施日期" align="center" sortable>
@@ -232,14 +216,6 @@
</template>
</el-table-column>
<el-table-column prop="applyType" label="适用车型" align="center">
<template slot-scope="scope">
<div v-if="scope.row.applyType === 'EKFCA'">FCA</div>
<div v-if="scope.row.applyType === 'EKHEV'">HEV</div>
<div v-if="scope.row.applyType === 'EKEV'">纯电动</div>
<div v-if="scope.row.applyType === 'EKQY'">传统车</div>
<div v-if="scope.row.applyType === 'EKPHEV'">混动</div>
<div v-if="scope.row.applyType === 'DIESEL'">柴油</div>
</template>
</el-table-column>
<el-table-column prop="mark" label="标准分类" align="center">
<template slot-scope="scope">
@@ -249,7 +225,7 @@
</el-table-column>
<el-table-column prop="dutyEngineer" label="标准责任工程师" align="center">
<template slot-scope="scope">
<a @click="showStandDetails(scope.row)">{{ scope.row.dutyEngineer }}</a>
<div>{{ scope.row.dutyEngineer }}</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" v-if="isShowBtn">
@@ -289,14 +265,14 @@
<a @click="handlePreview(scope.row)">{{ scope.row.standName }}</a>
</template>
</el-table-column>
<el-table-column prop="itemsId" label="条款号" align="center">
<el-table-column prop="itemsNum" label="条款号" align="center">
<template slot-scope="scope">
<a @click="showStandDetails(scope.row)">{{ scope.row.itemsId }}</a>
<div>{{ scope.row.itemsNum }}</div>
</template>
</el-table-column>
<el-table-column prop="itemsName" label="条款要求" align="center">
<template slot-scope="scope">
<a @click="showStandDetails(scope.row)">{{ scope.row.itemsName }}</a>
<div>{{ scope.row.itemsName }}</div>
</template>
</el-table-column>
<el-table-column prop="putTime" label="实施日期" align="center" sortable>
@@ -305,14 +281,6 @@
</template>
</el-table-column>
<el-table-column prop="applyType" label="适用车型" align="center">
<template slot-scope="scope">
<div v-if="scope.row.applyType === 'EKFCA'">FCA</div>
<div v-if="scope.row.applyType === 'EKHEV'">HEV</div>
<div v-if="scope.row.applyType === 'EKEV'">纯电动</div>
<div v-if="scope.row.applyType === 'EKQY'">传统车</div>
<div v-if="scope.row.applyType === 'EKPHEV'">混动</div>
<div v-if="scope.row.applyType === 'DIESEL'">柴油</div>
</template>
</el-table-column>
<el-table-column prop="mark" label="标准分类" align="center">
<template slot-scope="scope">
@@ -322,7 +290,7 @@
</el-table-column>
<el-table-column prop="dutyEngineer" label="标准责任工程师" align="center">
<template slot-scope="scope">
<a @click="showStandDetails(scope.row)">{{ scope.row.dutyEngineer }}</a>
<div>{{ scope.row.dutyEngineer }}</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" v-if="isShowBtn">
@@ -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全部打开