Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
zhutianqi
2021-11-24 17:45:44 +08:00
+117 -351
View File
@@ -4,7 +4,7 @@
<div class="dynamic-content">
<!-- 实施预警 -->
<div class="dynamic" style="overflow-y: auto;">
<div class="container" :style="containerStyle">
<div class="container" >
<!-- <el-tabs v-model="activeName" @tab-click="handleClick">-->
<!-- <el-tab-pane label="标准预警" name="STANDARD">-->
<div class="dynamic-content">
@@ -62,7 +62,7 @@
<el-date-picker
size="mini"
clearable
v-model="dynamic.putTime"
v-model="dynamic.SSRQ"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
@@ -74,7 +74,7 @@
<el-date-picker
size="mini"
clearable
v-model="dynamic.putTime"
v-model="dynamic.XCXSSRQ"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
@@ -86,7 +86,7 @@
<el-date-picker
size="mini"
clearable
v-model="dynamic.putTime"
v-model="dynamic.ZCCSSRQ"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
@@ -116,13 +116,13 @@
<div class="content">
<!-- <el-divider content-position="left" class="dynamic-child-title">实施日期预警</el-divider>-->
<el-table
:data="newItems"
:data="warningTableDatas"
style="overflow-y: auto;"
:height="warningTableHeight"
height="100%"
border
:resizable="false"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
v-loading="loading.newItems"
v-loading="warningTableLoading"
>
<el-table-column prop="standType" label="类型" width="100" align="center">
<template slot-scope="scope">
@@ -143,34 +143,34 @@
<a @click="handlePreview(scope.row)">{{ scope.row.standName }}</a>
</template>
</el-table-column>
<el-table-column prop="standCode" label="条款编号" width="200" align="center">
<el-table-column prop="itemsNum" label="条款编号" width="200" align="center">
<template slot-scope="scope">
<a @click="handlePreview(scope.row)">{{ scope.row.standCode }}</a>
<a @click="handlePreview(scope.row)">{{ scope.row.itemsNum }}</a>
</template>
</el-table-column>
<el-table-column prop="standName" width="320" label="条款名称" align="center">
<el-table-column prop="itemsName" width="320" label="条款名称" align="center">
<template slot-scope="scope">
<a @click="handlePreview(scope.row)">{{ scope.row.standName }}</a>
<a @click="handlePreview(scope.row)">{{ scope.row.itemsName }}</a>
</template>
</el-table-column>
<el-table-column prop="putTime" label="发布日期" width="120" align="center" sortable>
<template slot-scope="scope">
<span>{{ scope.row.putTime ? $moment(scope.row.putTime).format('YYYY-MM-DD') : '' }}</span>
<span>{{ scope.row.putTime ? scope.row.putTime.substring(0, 10) : '' }}</span>
</template>
</el-table-column>
<el-table-column prop="putTime" label="实施日期" width="120" align="center" sortable>
<el-table-column prop="ssrq" label="实施日期" width="120" align="center" sortable>
<template slot-scope="scope">
<span>{{ scope.row.putTime ? $moment(scope.row.putTime).format('YYYY-MM-DD') : '' }}</span>
<span>{{ scope.row.ssrq ? scope.row.ssrq.substring(0,10) : '' }}</span>
</template>
</el-table-column>
<el-table-column prop="putTime" label="新车型实施日期" width="150" align="center" sortable>
<el-table-column prop="xcxssrq" label="新车型实施日期" width="150" align="center" sortable>
<template slot-scope="scope">
<span>{{ scope.row.putTime ? $moment(scope.row.putTime).format('YYYY-MM-DD') : '' }}</span>
<span>{{ scope.row.xcxssrq ? scope.row.xcxssrq.substring(0,10) : '' }}</span>
</template>
</el-table-column>
<el-table-column prop="putTime" label="在产车实施日期" width="150" align="center" sortable>
<el-table-column prop="zccssrq" label="在产车实施日期" width="150" align="center" sortable>
<template slot-scope="scope">
<span>{{ scope.row.putTime ? $moment(scope.row.putTime).format('YYYY-MM-DD') : '' }}</span>
<span>{{ scope.row.zccssrq ? scope.row.zccssrq.substring(0,10) : '' }}</span>
</template>
</el-table-column>
<el-table-column prop="applyType" label="适用车型" align="center">
@@ -187,173 +187,12 @@
</el-table>
<pagination
style="position: static;"
:page="pageConfig.newItemsPage"
:pageSize="pageConfig.newItemsPageSize"
:total="pageConfig.count1"
:page="pageConfig.page"
:pageSize="pageConfig.pageSize"
:total="pageConfig.total"
autoSize
@pageChange="page => handlePageChange('newItems', page)"
@pageSizeChange="pageSize => handlePageSizeChange('newItems', pageSize)"></pagination>
<!-- <el-divider content-position="left" class="dynamic-child-title">在产车实施日期预警</el-divider>-->
<!-- <el-table-->
<!-- :data="oldItems"-->
<!-- :height="height"-->
<!-- border-->
<!-- :resizable="false"-->
<!-- :header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"-->
<!-- v-loading="loading.oldItems"-->
<!-- >-->
<!-- <el-table-column prop="sortName" label="类型" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <div v-if="scope.row.sortName === 'BUSINESS_STAND'">企业标准</div>-->
<!-- <div v-if="scope.row.standType === 'FOREIGN'">海外标准法规</div>-->
<!-- <div v-if="scope.row.standType === 'INLAND'">国内标准法规</div>-->
<!-- <div v-if="scope.row.sortName === 'INLAND_LAWS'">国内政策</div>-->
<!-- <div v-if="scope.row.sortName === 'FOREIGN_LAWS'">国外政策</div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="standCode" label="标准编号" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <a @click="handlePreview(scope.row)">{{ scope.row.standCode }}</a>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="standName" width="320" label="标准名称" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <a @click="handlePreview(scope.row)">{{ scope.row.standName }}</a>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="putTime" label="在产车实施日期" align="center" sortable>-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ scope.row.putTime ? $moment(scope.row.putTime).format('YYYY-MM-DD') : '' }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="applyType" label="适用车型" align="center">-->
<!-- </el-table-column>-->
<!-- <el-table-column label="操作" align="center" v-if="isShowBtn">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="danger"-->
<!-- @click="cancelWarning(scope.$index, scope.row)">取消预警-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- <pagination-->
<!-- style="position: static;"-->
<!-- :page="pageConfig.oldItemsPage"-->
<!-- :pageSize="pageConfig.oldItemsPageSize"-->
<!-- :total="pageConfig.count2"-->
<!-- autoSize-->
<!-- @pageChange="page => handlePageChange('oldItems', page)"-->
<!-- @pageSizeChange="pageSize => handlePageSizeChange('oldItems', pageSize)"></pagination>-->
<!-- <el-divider content-position="left" class="dynamic-child-title">新车型条款预警</el-divider>-->
<!-- <el-table-->
<!-- :data="newStand"-->
<!-- :height="height"-->
<!-- border-->
<!-- :resizable="false"-->
<!-- :header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"-->
<!-- v-loading="loading.newStand"-->
<!-- >-->
<!-- <el-table-column prop="standCode" label="标准编号" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <a @click="handlePreview(scope.row)">{{ scope.row.standCode }}</a>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="standName" width="320" label="标准名称" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <a @click="handlePreview(scope.row)">{{ scope.row.standName }}</a>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="itemsNum" label="条款号" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <div>{{ scope.row.itemsNum }}</div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="itemsName" label="条款要求" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <div>{{ scope.row.itemsName }}</div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="putTime" label="实施日期" align="center" sortable>-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ scope.row.putTime ? $moment(scope.row.putTime).format('YYYY-MM-DD') : '' }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="applyType" label="适用车型" align="center">-->
<!-- </el-table-column>-->
<!-- <el-table-column label="操作" align="center" v-if="isShowBtn">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="danger"-->
<!-- @click="cancelWarning(scope.$index, scope.row)">取消预警-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- <pagination-->
<!-- style="position: static;"-->
<!-- :page="pageConfig.newStandPage"-->
<!-- :pageSize="pageConfig.newStandPageSize"-->
<!-- :total="pageConfig.count3"-->
<!-- autoSize-->
<!-- @pageChange="page => handlePageChange('newStand', page)"-->
<!-- @pageSizeChange="pageSize => handlePageSizeChange('newStand', pageSize)"></pagination>-->
<!-- <el-divider content-position="left" class="dynamic-child-title">在产车条款预警</el-divider>-->
<!-- <el-table-->
<!-- :data="oldStand"-->
<!-- :height="height"-->
<!-- border-->
<!-- :resizable="false"-->
<!-- :header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"-->
<!-- v-loading="loading.oldStand"-->
<!-- >-->
<!-- <el-table-column prop="standCode" label="标准编号" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <a @click="handlePreview(scope.row)">{{ scope.row.standCode }}</a>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="standName" width="320" label="标准名称" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <a @click="handlePreview(scope.row)">{{ scope.row.standName }}</a>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="itemsNum" label="条款号" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <div>{{ scope.row.itemsNum }}</div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="itemsName" label="条款要求" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <div>{{ scope.row.itemsName }}</div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="putTime" label="实施日期" align="center" sortable>-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ scope.row.putTime ? $moment(scope.row.putTime).format('YYYY-MM-DD') : '' }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="applyType" label="适用车型" align="center">-->
<!-- </el-table-column>-->
<!-- <el-table-column label="操作" align="center" v-if="isShowBtn">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="danger"-->
<!-- @click="cancelWarning(scope.$index, scope.row)">取消预警-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- <pagination-->
<!-- style="position: static;"-->
<!-- :page="pageConfig.oldStandPage"-->
<!-- :pageSize="pageConfig.oldStandPageSize"-->
<!-- :total="pageConfig.count4"-->
<!-- autoSize-->
<!-- @pageChange="page => handlePageChange('oldStand', page)"-->
<!-- @pageSizeChange="pageSize => handlePageSizeChange('oldStand', pageSize)"></pagination>-->
@pageChange="page => handlePageChange('page', page)"
@pageSizeChange="pageSize => handlePageSizeChange('pageSize', pageSize)"></pagination>
</div>
</div>
</div>
@@ -370,6 +209,8 @@ export default {
name: "standardWarning",
data() {
return {
//
warningTableDatas:[],
warningTableHeight: '',
applyArcticOptions: [], // 适用车型下拉框
isShowBtn: true,
@@ -380,8 +221,14 @@ export default {
standCode: "",
//标准名称
standName: "",
//发布日期
putTime: [],
//实施日期
putTime: "",
SSRQ: [],
//新车型实施日期
XCXSSRQ: [],
//在产车实施日期
ZCCSSRQ: [],
//适用车型
applyType: "",
},
@@ -402,33 +249,11 @@ export default {
oldPolicy: [],
tableHeight: 0,
pageConfig: {
newItemsPage: 1,
newItemsPageSize: 10,
count1: 0,
newStandPage: 1,
newStandPageSize: 10,
count2: 0,
oldItemsPage: 1,
oldItemsPageSize: 10,
count3: 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,
page: 1,
pageSize: 10,
total: 0,
},
warningTableLoading: false,
// 记录当前分页器是哪个预警信息触发
field: ''
};
@@ -436,8 +261,8 @@ export default {
methods: {
// 获取标准预警数据 (type用于区别分页器切换)
getEarlyDate() {
this.loading[this.field] = true
this.$http.get('sys/EarlyWarning/StandWarning', {
this.warningTableLoading = true
this.$http.get('sys/EarlyWarning/getStandWarning', {
applyType: '',
...this.pageConfig
}, {
@@ -516,9 +341,7 @@ export default {
break
}
}
for (const loading in this.loading) {
this.loading[loading] = false
}
this.warningTableLoading = false
}, e => {
});
},
@@ -579,30 +402,56 @@ export default {
},
//查找适用车型
searchBtnClick() {
this.$http.get('StandWarning/getStandWarning', {
this.warningTableLoading = true
this.$http.get('sys/EarlyWarning/getStandWarning', {
...this.pageConfig,
//标准编号
standCode: this.dynamic.standCode,
//标准名称
standName: this.dynamic.standName,
//发布日期
startPutTime: this.dynamic.putTime[0],
endPutTime: this.dynamic.putTime[1],
//实施日期
putTime: this.dynamic.putTime[0],
lastTime: this.dynamic.putTime[1],
startSSRQ: this.dynamic.SSRQ[0],
endSSRQ: this.dynamic.SSRQ[1],
//新车型实施日期
startXCXSSRQ: this.dynamic.XCXSSRQ[0],
endXCXSSRQ: this.dynamic.XCXSSRQ[1],
//在产车实施日期
startZCCSSRQ: this.dynamic.ZCCSSRQ[0],
endZCCSSRQ: this.dynamic.ZCCSSRQ[1],
//适用车型
applyType: this.dynamic.applyType
}, {
_this: this,
}, res => {
const result = res.data[0]
for (const type in result) {
this[type] = result[type].records
console.log('608',res)
// 适用车型转换
for (let a = 0; a < res.data.records.length; a++) {
if (res.data.records[a].applyType !== null) {
let k = (res.data.records[a].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;
}
res.data.records[a].applyType = k.join(",");
}
}
}
}
this.newItemsPage = 1
this.oldItemsPage = 1
this.newStandPage = 1
this.oldStandPage = 1
this.newPolicyPage = 1
this.oldPolicypage = 1
this.warningTableDatas = res.data.records
this.pageConfig.page = res.data.current
if ((this.warningTableDatas.length === 0 || this.warningTableDatas === []) && this.pageConfig.page !== 1) {
this.warningTableLoading = true
this.handlePageChange('page', 1)
}else {
this.warningTableLoading = false
}
this.pageConfig.pageSize = res.data.size
this.pageConfig.total = res.data.total
// this.warningTableLoading = false
}, e => {
})
},
@@ -612,8 +461,14 @@ export default {
standCode: "",
//标准名称
standName: "",
//发布日期
putTime: [],
//实施日期
putTime: "",
SSRQ: [],
//新车型实施日期
XCXSSRQ: [],
//在产车实施日期
ZCCSSRQ: [],
//适用车型
applyType: "",
}
@@ -714,41 +569,21 @@ export default {
return date !== undefined && date != null ? date.split(" ")[0] : "";
},
handlePageChange(field, page) {
switch (field) {
// 新车型实施日期预警
case 'newItems':
this.pageConfig.newItemsPage = page
break
// 新车型条款预警
case 'newStand':
this.pageConfig.newStandPage = page
break
// 在产车实施日期预警
case 'oldItems':
this.pageConfig.oldItemsPage = page
break
// 在产车条款预警
case 'oldStand':
this.pageConfig.oldStandPage = page
break
// 政策新车型实施日期预警
case 'newPolicy':
this.pageConfig.newPolicyPage = page
break
//政策 在产车实施日期预警
case 'oldPolicy':
this.pageConfig.oldPolicyPage = page
break
}
this.pageConfig.page = page
this.searchBtnClick()
console.log('735',this.warningTableDatas)
this.activeName === 'STANDARD' ? this.getEarlyDate() : this.getPolicyDate()
this.field = field
},
//分页每页显示数改变后方法
handlePageSizeChange(field, pageSize) {
const _pageSize = field + 'PageSize'
this.pageConfig[_pageSize] = pageSize
this.activeName === 'STANDARD' ? this.getEarlyDate() : this.getPolicyDate()
this.field = field
// const _pageSize = field + 'PageSize'
// this.pageConfig[_pageSize] = pageSize
this.pageConfig.pageSize = pageSize
this.searchBtnClick()
console.log('771',this.warningTableDatas)
// this.activeName === 'STANDARD' ? this.getEarlyDate() : this.getPolicyDate()
// this.field = field
},
...mapMutations(["setDetailMap"])
},
@@ -759,17 +594,22 @@ export default {
},
computed: {
containerStyle() {
return this.activeName === 'POLICY' ? {
height: '100%'
} : {}
this.$nextTick(() => {
return this.activeName === 'POLICY' ? {
height: '100%'
} : {}
})
}
},
watch: {},
mounted() {
this.warningTableHeight = $(window).height()*0.54
window.onresize = () => {
this.warningTableHeight = $(window).height()*0.54;
};
this.warningTableLoading = true
// this.$nextTick(() => {
// this.warningTableHeight = $(window).height()*0.54
// window.onresize = () => {
// this.warningTableHeight = $(window).height()*0.54;
// };
// })
// alert(this.warningTableHeight)
// this.height = $(".content").height();
// window.onresize = () => {
@@ -782,100 +622,25 @@ export default {
this.energyKindOptions = res.data.ENERGYTYPES; // 文本状态
this.applyArcticOptions = res.data.ENERGYTYPES // 适用车型
this.zrgcs = res.data.ZRGCSCLASS;
this.loading[this.field] = true
this.$http.get('sys/EarlyWarning/StandWarning', {
this.warningTableLoading = true
this.$http.get('sys/EarlyWarning/getStandWarning', {
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 => {
// 适用车型转换
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
}
console.log('805',res)
this.warningTableDatas = res.data.records
this.pageConfig.page = res.data.current
this.pageConfig.pageSize = res.data.size
this.pageConfig.total = res.data.total
this.getEarlyDate();
this.warningTableLoading = false
}, e => {
});
});
// this.queryNewTypeByPage();
// this.queryProductionVehicleByPage();
// 四个预警同时查询,loading全部打开
for (const loading in this.loading) {
this.loading[loading] = true
}
this.getEarlyDate();
}
};
@@ -998,6 +763,7 @@ export default {
}
.container {
height: calc(100% - 139px);
/deep/ .el-tabs__header {
height: 50px;
}