|
@@ -0,0 +1,407 @@
|
|
|
+<template>
|
|
|
+ <a-row class="content-box">
|
|
|
+ <a-card class="layoutCard">
|
|
|
+ <a-form layout='vertical'>
|
|
|
+ <a-row :gutter="24">
|
|
|
+ <a-col :xl='6' :lg='6' :md='12' :sm='24' :xs='24'>
|
|
|
+ <a-form-item :label="$t('plan.dvp.description-of-the-purpose-of-the-test-vehicle')">
|
|
|
+ <a-input>
|
|
|
+
|
|
|
+ </a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :xl='6' :lg='6' :md='12' :sm='24' :xs='24'>
|
|
|
+ <a-form-item :label="$t('plan.dvp.description-of-the-vehicle-status')">
|
|
|
+ <a-input>
|
|
|
+
|
|
|
+ </a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :xl='6' :lg='6' :md='12' :sm='24' :xs='24' v-for="(item,index) in selectDataList">
|
|
|
+ <a-form-item :label="item.title">
|
|
|
+ <a-select allowClear v-model="item.value" :options="item.dataList" :key="item.id">
|
|
|
+
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <span v-show="advanceExpand">
|
|
|
+ <a-col :xl='6' :lg='6' :md='12' :sm='24' :xs='24'>
|
|
|
+ <a-form-item :label="$t('plan.dvp.test-location')">
|
|
|
+ <a-input>
|
|
|
+
|
|
|
+ </a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :xl='6' :lg='6' :md='24' :sm='24' :xs='24'>
|
|
|
+ <a-form-item :label="$t('plan.dvp.study-director')">
|
|
|
+ <a-input>
|
|
|
+
|
|
|
+ </a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :xl='6' :lg='6' :md='24' :sm='24' :xs='24'>
|
|
|
+ <a-form-item :label="$t('plan.dvp.panel-point')">
|
|
|
+ <a-input>
|
|
|
+
|
|
|
+ </a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :xl='6' :lg='6' :md='24' :sm='24' :xs='24'>
|
|
|
+ <a-form-item :label="$t('plan.dvp.sample-vehicle-plan-delivery-time')">
|
|
|
+ <a-input>
|
|
|
+
|
|
|
+ </a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :xl='6' :lg='6' :md='24' :sm='24' :xs='24'>
|
|
|
+ <a-form-item :label="$t('plan.dvp.scheduled-start-time')">
|
|
|
+ <a-input>
|
|
|
+
|
|
|
+ </a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :xl='6' :lg='6' :md='24' :sm='24' :xs='24'>
|
|
|
+ <a-form-item :label="$t('plan.dvp.scheduled-end-time')">
|
|
|
+ <a-input>
|
|
|
+
|
|
|
+ </a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </span>
|
|
|
+ </a-row>
|
|
|
+ <a-row :gutter="24">
|
|
|
+ <a-form-item class='tr' :label="'\xa0'">
|
|
|
+ <a-col :xl='24' :lg='24' :md='24' :sm='24' :xs='24'>
|
|
|
+ <!-- 展开/收起 -->
|
|
|
+ <a @click="toggleAdvance">
|
|
|
+ {{ advanceExpand ? $t('plan.dvp.collapse') : $t('plan.dvp.expand') }}
|
|
|
+ <a-icon :type="advanceExpand ? 'up' : 'down'"/>
|
|
|
+ </a>
|
|
|
+ <!-- 重置 -->
|
|
|
+ <a-button @click='reset' type="primary" class="mr10">
|
|
|
+ {{ $t('global-btn.reset') }}
|
|
|
+ </a-button>
|
|
|
+ <!-- 查询 -->
|
|
|
+ <a-button @click='search' type="primary" class="mr10">
|
|
|
+ {{ $t('global-btn.search') }}
|
|
|
+ </a-button>
|
|
|
+ </a-col>
|
|
|
+ </a-form-item>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ </a-card>
|
|
|
+ <a-card class="layoutCard" :style="{ height: tableHeight }">
|
|
|
+ <a-form-item class='tr' >
|
|
|
+ <!-- 新建 -->
|
|
|
+ <a-button @click='saveDvpPlan' type="primary" class="mr10">
|
|
|
+ {{ $t('global-btn.reset') }}
|
|
|
+ </a-button>
|
|
|
+ <!-- 导入 -->
|
|
|
+ <a-button @click='importFile' type="primary" class="mr10">
|
|
|
+ {{ $t('global-btn.import') }}
|
|
|
+ </a-button>
|
|
|
+ <!-- 导出 -->
|
|
|
+ <a-button @click='exportFile'>
|
|
|
+ {{ $t('global-btn.export') }}
|
|
|
+ </a-button>
|
|
|
+ </a-form-item>
|
|
|
+ <a-table
|
|
|
+ size="small"
|
|
|
+ :columns='tableColumns'
|
|
|
+ :dataSource='tableData'
|
|
|
+ :rowKey='(record, index) => { return index; }'
|
|
|
+ :scroll='{ x: 1850, y: tableHeightValue }'
|
|
|
+ :pagination='pagination'
|
|
|
+ :loading='tableLoading'
|
|
|
+ @change='handlePageChange'
|
|
|
+ >
|
|
|
+ <!-- 序号列 -->
|
|
|
+ <template slot='index' slot-scope='text, record, index'>
|
|
|
+ <span>{{ (pagination.current - 1) * pagination.pageSize + index + 1 }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
+ <span>
|
|
|
+ <!-- 编辑 -->
|
|
|
+ <a
|
|
|
+ href='javascript:'
|
|
|
+ @click='update(record)'
|
|
|
+ >
|
|
|
+ <a-tooltip :title="$t('workbench.edit')">
|
|
|
+ <i class="iconfont iconicon-bainji"></i>
|
|
|
+ </a-tooltip>
|
|
|
+ </a>
|
|
|
+ <a class='operation-btn ml16' @click="deleteDvpData(record)">
|
|
|
+ <!-- 删除 -->
|
|
|
+ <a-tooltip :title="$t('workbench.delete')">
|
|
|
+ <i class="iconfont iconshanchu"></i>
|
|
|
+ </a-tooltip>
|
|
|
+ </a>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+ </a-card>
|
|
|
+ </a-row>
|
|
|
+
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return{
|
|
|
+ /** 下拉选数据集合 根据后端返回数据生成对应的下拉选 */
|
|
|
+ selectDataList: [],
|
|
|
+ /** 折叠 展开 */
|
|
|
+ advanceExpand: false,
|
|
|
+ /** 分页 */
|
|
|
+ pagination: {
|
|
|
+ size: 'small',
|
|
|
+ current: 1,
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 10, // 默认每页显示数量
|
|
|
+ showTotal: total => this.$t('workbench.a-total-of-data', {total: `${total}`}), // 显示总数
|
|
|
+ showSizeChanger: true, // 显示可改变每页数量
|
|
|
+ pageSizeOptions: ['10', '20', '50', '100', '200'], // 每页数量选项
|
|
|
+ onShowSizeChange: (current, pageSize) => (this.pageSize = pageSize), // 改变每页数量时更新显示
|
|
|
+ total: 0, //总条数
|
|
|
+ showQuickJumper: true,
|
|
|
+ position: 'top'
|
|
|
+ },
|
|
|
+ /** 表格高度 */
|
|
|
+ tableHeight: window.innerHeight - 360 + 'px',
|
|
|
+ tableHeightValue: window.innerHeight - 418,
|
|
|
+ /** 表格加载状态 */
|
|
|
+ tableLoading: false,
|
|
|
+ /** 表格数据 */
|
|
|
+ tableData: [],
|
|
|
+ /** 表格列 */
|
|
|
+ tableColumns: [
|
|
|
+ {
|
|
|
+ title: this.$t('plan.dvp.serial-number'),
|
|
|
+ width: 50,
|
|
|
+ fixed: 'left',
|
|
|
+ align: 'center',
|
|
|
+ scopedSlots: {
|
|
|
+ customRender: 'index'
|
|
|
+ },
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: this.$t('plan.dvp.vehicle-performance-module'),
|
|
|
+ dataIndex: 'performanceModule',
|
|
|
+ align: 'center',
|
|
|
+ // width: 100,
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: this.$t('plan.dvp.description-of-the-purpose-of-the-test-vehicle'),
|
|
|
+ dataIndex: 'vehicleUse',
|
|
|
+ align: 'center',
|
|
|
+ // width: 100,
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: this.$t('plan.dvp.test-type'),
|
|
|
+ dataIndex: 'testType',
|
|
|
+ align: 'center',
|
|
|
+ // width: 100,
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: this.$t('plan.dvp.description-of-the-vehicle-status'),
|
|
|
+ dataIndex: 'vehicleState',
|
|
|
+ align: 'center',
|
|
|
+ // width: 100,
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: this.$t('plan.dvp.quantity'),
|
|
|
+ dataIndex: 'count',
|
|
|
+ align: 'center',
|
|
|
+ // width: 100,
|
|
|
+ ellipsis: true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ /** 表格固定部分数据 */
|
|
|
+ tableRightColumns: [
|
|
|
+ {
|
|
|
+ title: this.$t('plan.dvp.sample-vehicle-plan-delivery-time'),
|
|
|
+ dataIndex: 'prototypePlanTime',
|
|
|
+ align: 'center',
|
|
|
+ // width: 150,
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: this.$t('plan.dvp.scheduled-start-time'),
|
|
|
+ dataIndex: 'planStartTime',
|
|
|
+ align: 'center',
|
|
|
+ // width: 150,
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: this.$t('plan.dvp.scheduled-end-time'),
|
|
|
+ dataIndex: 'planEndTime',
|
|
|
+ align: 'center',
|
|
|
+ // width: 150,
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: this.$t('global-constant.operation'),
|
|
|
+ // dataIndex: 'quantity',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ scopedSlots: {customRender: 'action'},
|
|
|
+ ellipsis: true
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.initData();
|
|
|
+ window.onresize = () => {
|
|
|
+ this.tableHeight = window.innerHeight - 360 + 'px';
|
|
|
+ this.tableHeightValue = window.innerHeight - 418;
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /**
|
|
|
+ * 查询
|
|
|
+ */
|
|
|
+ search() {
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 重置
|
|
|
+ */
|
|
|
+ reset() {
|
|
|
+ this.advanceExpand = false;
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 收起/展开
|
|
|
+ */
|
|
|
+ toggleAdvance() {
|
|
|
+ this.advanceExpand = !this.advanceExpand;
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 新建DVP计划试验数据
|
|
|
+ */
|
|
|
+ saveDvpPlan() {
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 导入
|
|
|
+ */
|
|
|
+ importFile() {
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 导出
|
|
|
+ */
|
|
|
+ exportFile() {
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 表格 - 点击分页中数字触发的方法
|
|
|
+ * @param pagination
|
|
|
+ */
|
|
|
+ handlePageChange(pagination) {
|
|
|
+ this.pagination.current = pagination.current;
|
|
|
+ this.pagination.pageSize = pagination.pageSize;
|
|
|
+ this.pagination.pageNo = pagination.current;
|
|
|
+ // this.initData();
|
|
|
+ },
|
|
|
+ // '1': {
|
|
|
+ // name: '发送机'
|
|
|
+ // value: '99T星星发动机'
|
|
|
+ // '2': {
|
|
|
+ // name: '颜色'
|
|
|
+ // value: '五彩斑斓的黑'
|
|
|
+ // }
|
|
|
+ /**
|
|
|
+ * 初始化表格数据
|
|
|
+ */
|
|
|
+ initData() {
|
|
|
+ let _that = this;
|
|
|
+ let data = {
|
|
|
+ dvpId:1
|
|
|
+ }
|
|
|
+ _that.$api.initDvpList(data).then(res => {
|
|
|
+ if (res.flag) {
|
|
|
+ let columnData = res.inputData;
|
|
|
+ if (Object.keys(columnData).length > 0) {
|
|
|
+ for (let key in columnData) {
|
|
|
+ let column = {};
|
|
|
+ column.title = columnData[key].name;
|
|
|
+ column.dataIndex = columnData[key].id;
|
|
|
+ column.align = 'center';
|
|
|
+ column.ellipsis = true;
|
|
|
+ _that.tableColumns.push(column);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ _that.tableRightColumns.forEach(item => {
|
|
|
+ _that.tableColumns.push(item);
|
|
|
+ })
|
|
|
+ let tableDataList = res.data.data;
|
|
|
+ if (tableDataList) {
|
|
|
+ if (tableDataList.length > 0) {
|
|
|
+ tableDataList.forEach(item => {
|
|
|
+ // 表格数据整理
|
|
|
+ let tempData = {};
|
|
|
+ // 表格中动态列数据整理
|
|
|
+ let columnId = item.columnId.split('/');
|
|
|
+ let columnValue = item.columnValue.split('/');
|
|
|
+ console.log(columnId, columnValue);
|
|
|
+ columnId.forEach((id, index) => {
|
|
|
+ tempData[id] = columnValue[index];
|
|
|
+ });
|
|
|
+ console.log(tempData);
|
|
|
+ tempData.performanceModule = item.performanceModule; // 性能模块
|
|
|
+ tempData.testId = item.testId; // 编号
|
|
|
+ tempData.vehicleUse = item.vehicleUse; // 试验车用途
|
|
|
+ tempData.vehicleState = item.vehicleState; // 车辆状态
|
|
|
+ tempData.testType = item.testType; // 试验类型
|
|
|
+ tempData.count = item.count; // 数量
|
|
|
+ tempData.testSite = item.testSite; // 试验地点
|
|
|
+ tempData.testOwner = item.testOwner; // 试验负责人
|
|
|
+ tempData.node = item.node; // 节点
|
|
|
+ tempData.prototypePlanTime = item.prototypePlanTime; // 样车计划提供时间
|
|
|
+ tempData.planStartTime = item.planStartTime; // 计划开始时间
|
|
|
+ tempData.planEndTime = item.planEndTime; // 计划结束时间
|
|
|
+ _that.tableData.push(tempData);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 删除dvp计划试验数据
|
|
|
+ * @param data
|
|
|
+ */
|
|
|
+ deleteDvpData(data) {
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 编辑dvp计划试验数据
|
|
|
+ * @param data
|
|
|
+ */
|
|
|
+ update(data) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+</script>
|
|
|
+<style>
|
|
|
+.content-box {
|
|
|
+ padding: 0 12px;
|
|
|
+}
|
|
|
+
|
|
|
+.layoutCard {
|
|
|
+ padding: 12px;
|
|
|
+}
|
|
|
+</style>
|