车型界面完善

This commit is contained in:
Jaunty
2021-07-16 14:12:01 +08:00
parent 46d2d87494
commit a795039c87
@@ -33,7 +33,7 @@
<el-button plain class="common-button-primary" size="mini" @click="addList">添加</el-button>
<el-button plain class="common-button-primary" size="mini" @click="deleteList">批量删除</el-button>
<el-button class="common-button-default export-button"
size="mini" @click="exportProducdata"
size="mini" @click="exportStandard"
title="不勾选时默认导出所有筛选项;勾选时仅导出勾选项"
icon="export"
>导出</el-button>
@@ -42,14 +42,15 @@
<!-- <el-tab-pane :label="localProEO.productName" class="details-panel-tabs-item">-->
<div class="table-wrapper">
<el-table
:data="detailList"
:data="dataList"
style="width: 100%"
:height="Height"
border
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', fontFamily: 'MicrosoftYaHei-Bold', height: '48px'}"
fontWeight: 'bold', fontFamily: 'MicrosoftYaHei-Bold', height: '48px',textAlign: 'center'}"
@selection-change="standSelectChange"
ref="selection"
:cell-style="{ textAlign: 'center' }"
>
<el-table-column
type="selection"
@@ -57,133 +58,68 @@
align="center">
</el-table-column>
<el-table-column
prop="standName"
label="中文名称"
prop="standId"
label="项目编号"
fixed="left"
width="260px"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop="enName"
prop="standName"
label="中文名称"
width="180px"
>
</el-table-column>
<el-table-column
prop="standEnName"
label="英文名称"
width="260px"
show-overflow-tooltip
width="180px"
>
</el-table-column>
<el-table-column
prop="sarState"
align="center"
width="100"
label="合规性分级">
<template slot-scope="scope">
<div @click="chooseColor(scope.row,'2')">
<div v-if="!scope.row.color">
<div v-if="scope.row.actState === ''||scope.row.actState === null">
<img class="iconClass" src="../../../../assets/images/ComplianceClassification/white.png" >
</div>
<div v-else-if="scope.row.sarState === 8 || scope.row.sarState === '' ||scope.row.sarState === null" >
<!-- <img class="iconClass" src="../../../../assets/images/ComplianceClassification/blue.png">-->
<!--暂不显示-->
</div>
<div v-else-if="scope.row.sarState === 2" >
<img class="iconClass" src="../../../../assets/images/ComplianceClassification/green.png">
</div>
<div v-else-if="scope.row.sarState === 5">
<img class="iconClass" src="../../../../assets/images/ComplianceClassification/grey.png">
</div>
<div v-else>
<img class="iconClass" @click="typeColor(scope.row, 2, 1)" src="../../../../assets/images/ComplianceClassification/yellow.png" >
</div>
</div>
<div v-else>
<div v-if="scope.row.color === 'green'" >
<img class="iconClass" src="../../../../assets/images/ComplianceClassification/green.png">
<!--暂不显示-->
</div>
<div v-if="scope.row.color === 'red'" >
<img class="iconClass" src="../../../../assets/images/ComplianceClassification/red.png">
<!--暂不显示-->
</div>
<div v-if="scope.row.color === 'blue'" >
<img class="iconClass" src="../../../../assets/images/ComplianceClassification/blue.png">
<!--暂不显示-->
</div>
<div v-if="scope.row.color === 'grey'" >
<img class="iconClass" src="../../../../assets/images/ComplianceClassification/grey.png">
<!--暂不显示-->
</div>
<div v-if="scope.row.color === 'yellow'" >
<img class="iconClass" src="../../../../assets/images/ComplianceClassification/yellow.png">
<!--暂不显示-->
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column
prop="authDelive"
width="120px"
label="认证交付物">
</el-table-column>
<el-table-column
prop="authObjId"
width="100px"
label="认证对象">
</el-table-column>
<el-table-column
prop="newPutTime"
prop="SSRQ"
width="190px"
sortable
label="标准实施日期">
</el-table-column>
<el-table-column
prop="XCXSSRQGJ"
width="190px"
label="新车型实施日期">
</el-table-column>
<el-table-column
prop="prodPutTime"
prop="ZCCSSRQGJ"
sortable
width="190px"
label="在产车实施日期">
</el-table-column>
<el-table-column
prop="eopPutTime"
sortable
width="190px"
label="EOP实施日期">
<template slot-scope="scope">
<span>{{ scope.row.eopPutTime !== null && scope.row.eopPutTime !== 'N/A' && scope.row.eopPutTime !== 'TBD'
&& scope.row.eopPutTime !== '已实施' ? $moment(scope.row.eopPutTime).format('YYYY-MM-DD') : scope.row.eopPutTime }}</span>
</template>
prop="ZRBM"
label="责任部门"
width="180px"
>
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="synopsis"
width="200px"
label="文本说明">
prop="KCCVPPSBM"
width="180px"
label="卡车VPPS编码">
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="performInfo"
width="280px"
label="实施说明">
prop="KCCVPPSCN"
width="180px"
label="卡车vpps中文名称">
</el-table-column>
<el-table-column
prop="dutyDepart"
width="150px"
label="责任部门">
prop="CYCVPPSBM"
width="180px"
label="乘车VPPS编码">
</el-table-column>
<el-table-column
prop="foUser"
width="150px"
label="FO">
</el-table-column>
<el-table-column
prop="proEssessUser"
width="120px"
label="项目评估角色">
</el-table-column>
<el-table-column
prop="askTypeName"
width="100px"
label="要求类型">
prop="CYCVPPSBM"
width="180px"
label="乘车vpps中文名称">
</el-table-column>
</el-table>
<pagination
@@ -278,7 +214,9 @@
<el-dialog :visible.sync="exportModelFlag" title="导出文件" width="700" :show-close="false">
<label-input v-model="exportName" placeholder="请输入导出文件名" clearable label="导出名称"/>
<div slot="footer">
<el-button class="common-button-primary" icon="el-icon-check" type="primary" @click="exportTestItem">导出</el-button>
<el-button class="common-button-primary" icon="el-icon-check" type="primary"
title="不勾选时默认导出所有筛选项;勾选时仅导出勾选项"
@click="exportTestItem">导出</el-button>
<el-button class="common-button-default" icon="el-icon-close" @click="cancal">取消</el-button>
</div>
</el-dialog>
@@ -287,6 +225,7 @@
<script>
import { mapGetters } from 'vuex'
import LawsTreeView from '@/components/ProjectRelatedPersonnel/view'
import { interfaceUrl } from "@/sysConfig";
export default {
name: 'Details',
components: {
@@ -294,6 +233,7 @@ export default {
},
data () {
return {
size: this.$store.getters.userInfo.configContent,
pageSizeNo: this.$store.getters.userInfo.configContent,
pageSize: this.$store.getters.userInfo.configContent,
pageNo: 1,
@@ -301,8 +241,8 @@ export default {
totalNo: 0,
standModel: false, // 选择标准抽屉状态
selectList: [], //选择标准的选择框
selectList1: [], //选择标准的选择框
dataList: [],//清单里的标准数据
detailList:[],//详情表格数据
page: 1,
total: 0,
loading: false,
@@ -312,7 +252,11 @@ export default {
localProLib:{},
takeingFlag: false,
exportModelFlag: false,
exportName: ''
exportName: '',
standList:[],//调取添加的数据
standList1:[],//调取添加的数据
id:'',//批量删除.
saveExportType: '',// 导出文件模态框控制,和文件名称
}
},
methods: {
@@ -325,7 +269,7 @@ export default {
this.selectionList();
},
pageChangeNo(page){
this.page = page
this.pageNo = page
this.addList()
},
pageSizeChangeNo(pageSize){
@@ -339,11 +283,16 @@ export default {
},
//点击添加事件
addList() {
this.$http.get("sarStandProjectLibrary/queryStandInfo", "", {
_this: this
this.$http.get("sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage", {
page:this.pageNo,
pageSize:this.pageSizeNo
}, {
_this:this,
}, res => {
console.log('res')
console.log(res)
this.standardData = res.data.list;
this.totalNo = res.data.pageCount
this.totalNo = res.data.count
}, e => {
});
this.standModel = true;
@@ -370,11 +319,41 @@ export default {
}
exits.push(item);
});
this.selectList = [];
// 批量删除表格数据
for (let i=0;i<this.selectList.length;i++){
this.selectList1.push(this.selectList[i].standId)
}
this.id=this.selectList1.join(',')
this.$http.post('sarStandProjectLibrary/deleteByIds', {
id:this.id
}, {
_this: this,
loading: 'loading'
}, res => {
this.getDataList()
this.selectList = [];
this.selectList1 = [];
}, e => {
})
}).catch(() => {
});
}
},
getDataList(){
// 查询详情表格数据
this.$http.get('sarStandProjectLibrary/queryStandInfo', {
id:this.localProEO.id,
current:this.page,
pageSize:this.pageSize
}, {
_this: this,
loading: 'loading'
}, res => {
this.dataList=res.data.records
this.total=res.data.total
}, e => {
})
},
//添加标准取消事件
cancelStand() {
this.standModel = false;
@@ -385,34 +364,57 @@ export default {
if (this.standList.length < 1) {
_this.$message.warning("请选择需要添加进清单的数据");
} else {
_this.standList.map(item => {
for (let i=0;i<this.dataList.length;i++){
let newStand = false;
for (let itemKey of _this.dataList) {
if (item.id == itemKey.id) {
for (let j=0;j<this.standList.length;j++){
if (this.standList[j].id==this.dataList[i].standId){
newStand = true;
break;
this.standList.splice(j,1)
j--
}
}
if (newStand) {
_this.$message.warning("请勿重复添加数据");
} else {
_this.dataList.push(item);
// _this.dataList.push(item);
}
});
}
this.standardData = []
_this.standModel = false;
for (var i=0;i<this.standList.length;i++){
this.standList1.push({
standId:this.standList[i].id,
projectId:this.localProEO.id
})
}
if(this.standList1!=''){
this.$http.postData("sarStandProjectLibrary/batchInsert", this.standList1, {
_this: this
}, res => {
if (res.ok) {
this.$message.success(res.message)
this.getDataList()
}else {
this.$message.warning(res.message)
}
}, e => {
});
}
this.standList = []
this.standList1 = []
_this.standModel = false;
}
},
//选择清单确定事件
OkDrawer() {
if (this.selectedList.length === 1) {
if (this.selectList.length === 1) {
let deposit = new Map();
this.sarAccessListDatas.forEach(item => {
deposit.set(item.id, item);
});
let bringData = [];
for (let i = 0; i < this.selectedList.length; i++) {
bringData.push(deposit.get(this.selectedList[i]));
for (let i = 0; i < this.selectList.length; i++) {
bringData.push(deposit.get(this.selectList[i]));
}
this.listForm.standId = bringData[0].id;
this.listForm.listName = bringData[0].detailedListName;
@@ -427,7 +429,6 @@ export default {
res.data=[]
}
this.dataList = res.data;
console.log(res.data);
this.listForm.dataList = res.data;
let formId = []
this.dataList.map(item => {
@@ -436,7 +437,7 @@ export default {
this.listForm.inforlist = formId.join(',');
}, e => {
});
} else if (this.selectedList.length > 1) {
} else if (this.selectList.length > 1) {
this.$message.warning("只能选择一条数据进行带入");
} else {
this.$message.warning("请选择一条数据进行带入");
@@ -455,8 +456,9 @@ export default {
_this: this,
loading: 'loading'
}, res => {
console.log('查询')
console.log(res.data.records)
this.dataList=res.data.records
console.log(res)
this.total=res.data.total
}, e => {
})
this.pointTimeList = JSON.parse(JSON.stringify(item)).pointTime.split(',')
@@ -481,14 +483,59 @@ export default {
this.selectTableDataList()
},
resetTakeingForm() {},
exportTestItem() {},
cancal() {},
//导出
exportStandard () {
if(this.selectList.length > 0) {
this.saveExportType = 'apart'
} else {
this.saveExportType = 'all'
}
this.exportName = ''
this.exportModelFlag = true
console.log(this.saveExportType);
},
//取消导出
cancal () {
this.exportModelFlag = false
},
//确认导出
exportTestItem () {
if(this.saveExportType === 'apart') {
if (this.selectList != null && this.selectList != ''){
console.log(this.selectList);
let ids='\''+this.selectList[0].standId+'\''
for(let i=1;i<this.selectList.length;i++){
ids+=',\''+this.selectList[i].standId+'\''
}
const exportURL = interfaceUrl + 'sarStandProjectLibrary/exportStandAttrInfoExcel?' +
'exportType' + this.saveExportType + '&ids=' + ids + '&exportName=' + this.exportName
window.open(exportURL)
this.$message.success('导出信息成功')
}
} else if (this.saveExportType === 'all') {
console.log(this.selectList);
const exportURL = interfaceUrl + 'sarStandProjectLibrary/exportStandAttrInfoExcel?' +
'exportType' + this.saveExportType + '&ids=' + this.selectList.join(',') + '&exportName=' + this.exportName
window.open(exportURL)
this.$message.success('导出信息成功')
}
this.exportModelFlag = false
},
exportProducdata() {},
deleteStandLawsForProduct() {},
selectStandLawsForProduct() {},
pageChangeLaws() {},
pageSizeChangeLaws() {},
standSelectChange() {},//选项值发生改变
pageChangeLaws(page) {
this.page = page
this.getDataList()
},
pageSizeChangeLaws(pageSize) {
this.$store.getters.userInfo.configContent = pageSize
this.size = pageSize
this.getDataList()
},
standSelectChange(val) {
this.selectList = val;
},//选项值发生改变
},
computed: {
...mapGetters(['getLocalPro'])
@@ -699,7 +746,8 @@ export default {
.el-table--enable-row-transition .el-table__body td {
cursor: pointer;
}
} .demo-drawer-content {
}
.demo-drawer-content {
margin-top: 10px;
}
}
</style>