Commit 825f3942 authored by qiyaxin's avatar qiyaxin

CCAP历史控制计划-CCAP控制计划管理

parent ca15e5cc
import request from '@/utils/request.js' import request from '@/utils/request.js'
// 查询CCAP控制计划列表 // 查询CCAP控制计划列表
export function getCCAPPlanList() { export function getCCAPPlanList(query) {
return request({ return request({
url: '/control/ccapPlan/list', url: '/control/ccapPlan/list',
method: 'get' method: 'get',
params: query
})
}
// 查询所有事业部名称
export function getAllBusinessUnitName(query) {
return request({
url: '/control/unit/getAllBusinessUnitName',
method: 'get',
data: query,
}) })
} }
<template> <template>
<div class="app-container"> <div class="app-container">
<div style="margin-bottom: 20px"> <div style="margin-bottom: 20px">
<el-button <el-button
......
...@@ -236,16 +236,38 @@ ...@@ -236,16 +236,38 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination
v-show="total>0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</div> </div>
</template> </template>
<script setup> <script setup>
import cn from '@/locales/controlPlan/CCAPControlPlan/CCAPControlPlanManagement/history/cn.json' import cn from '@/locales/controlPlan/CCAPControlPlan/CCAPControlPlanManagement/history/cn.json'
import en from '@/locales/controlPlan/CCAPControlPlan/CCAPControlPlanManagement/history/en.json' import en from '@/locales/controlPlan/CCAPControlPlan/CCAPControlPlanManagement/history/en.json'
import { ref } from 'vue'
const total = ref(0);
const queryParams = ref({
pageNum: 1,
pageSize: 10
});
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
:deep(.el-pagination) {
display: flex;
justify-content: center;
width: 100%;
margin-top: 24px;
}
:deep(.el-pagination.is-background .el-pager li.is-active){
background-color: #0154FB;
}
</style> </style>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="app-container"> <div class="app-container">
<el-form v-model="queryParams" ref="queryRef" :inline="true" > <el-form v-model="queryParams" ref="queryRef" :inline="true" >
<!-- 事业部 --> <!-- 事业部 -->
<el-form-item :label="`${cn.businessDivision}/${en.businessDivision}`" prop="status"> <el-form-item :label="`${cn.businessDivision}/${en.businessDivision}`" prop="businessUnitId">
<el-select <el-select
v-model="queryParams.businessUnitId" v-model="queryParams.businessUnitId"
:placeholder="`${cn.pleaseChoose}/${en.pleaseChoose}`" :placeholder="`${cn.pleaseChoose}/${en.pleaseChoose}`"
...@@ -10,16 +10,16 @@ ...@@ -10,16 +10,16 @@
style="width: 200px" style="width: 200px"
> >
<el-option <el-option
v-for="dict in businessList" v-for="item in businessList"
:label="dict.businessUnitName" :label="item.businessUnitName"
:value="dict.id" :value="item.businessUnitName"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 车型代码 --> <!-- 车型代码 -->
<el-form-item :label="`${cn.vehicleTypeCode}/${en.vehicleTypeCode}`" prop="status"> <el-form-item :label="`${cn.vehicleTypeCode}/${en.vehicleTypeCode}`" prop="vehicleModelCode">
<el-select <el-select
v-model="queryParams.businessUnitId" v-model="queryParams.vehicleModelCode"
:placeholder="`${cn.pleaseChoose}/${en.pleaseChoose}`" :placeholder="`${cn.pleaseChoose}/${en.pleaseChoose}`"
clearable clearable
style="width: 200px" style="width: 200px"
...@@ -32,9 +32,9 @@ ...@@ -32,9 +32,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 车型系列 --> <!-- 车型系列 -->
<el-form-item :label="`${cn.vehicleTypeSeries}/${en.vehicleTypeSeries}`" prop="status"> <el-form-item :label="`${cn.vehicleTypeSeries}/${en.vehicleTypeSeries}`" prop="vehicleSeries">
<el-select <el-select
v-model="queryParams.businessUnitId" v-model="queryParams.vehicleSeries"
:placeholder="`${cn.pleaseChoose}/${en.pleaseChoose}`" :placeholder="`${cn.pleaseChoose}/${en.pleaseChoose}`"
clearable clearable
style="width: 200px" style="width: 200px"
...@@ -47,9 +47,9 @@ ...@@ -47,9 +47,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 版本号 --> <!-- 版本号 -->
<el-form-item :label="`${cn.versionNumber}/${en.versionNumber}`" prop="templateCode"> <el-form-item :label="`${cn.versionNumber}/${en.versionNumber}`" prop="versionNumber">
<el-input <el-input
v-model="queryParams.businessUnitId" v-model="queryParams.versionNumber"
placeholder="A0-Z9" placeholder="A0-Z9"
clearable clearable
disabled disabled
...@@ -57,27 +57,27 @@ ...@@ -57,27 +57,27 @@
/> />
</el-form-item> </el-form-item>
<!-- 创建人 --> <!-- 创建人 -->
<el-form-item :label="`${cn.creator}/${en.creator}`" prop="templateCode"> <el-form-item :label="`${cn.creator}/${en.creator}`" prop="createBy">
<el-input <el-input
v-model="queryParams.businessUnitId" v-model="queryParams.createBy"
:placeholder="`${cn.pleaseEnter}/${en.pleaseEnter}`" :placeholder="`${cn.pleaseEnter}/${en.pleaseEnter}`"
clearable clearable
style="width: 200px" style="width: 200px"
/> />
</el-form-item> </el-form-item>
<!-- 控制计划状态 --> <!-- 控制计划状态 -->
<el-form-item :label="`${cn.controlPlanStatus}/${en.controlPlanStatus}`" prop="status"> <el-form-item :label="`${cn.controlPlanStatus}/${en.controlPlanStatus}`" prop="controlPlanStatus">
<el-select <el-select
v-model="queryParams.businessUnitId" v-model="queryParams.controlPlanStatus"
:placeholder="`${cn.pleaseChoose}/${en.pleaseChoose}`" :placeholder="`${cn.pleaseChoose}/${en.pleaseChoose}`"
clearable clearable
style="width: 200px" style="width: 200px"
> >
<el-option <el-option
v-for="dict in businessList" v-for="dict in control_plan_status"
:label="dict.businessUnitName" :key="dict.value"
:value="dict.id" :label="dict.label"
/> :value="dict.value"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 搜索、重置 按钮 --> <!-- 搜索、重置 按钮 -->
...@@ -227,6 +227,9 @@ ...@@ -227,6 +227,9 @@
<div>{{en.controlPlanStatus}}</div> <div>{{en.controlPlanStatus}}</div>
</div> </div>
</template> </template>
<template #default="scope">
<span >{{ changeControlPlanStatus(scope.row.controlPlanStatus) }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
<template #header> <template #header>
...@@ -250,43 +253,90 @@ ...@@ -250,43 +253,90 @@
<script setup> <script setup>
import { import {
getCCAPPlanList getAllBusinessUnitName,
} from "@/api/CCAPControlPlanManagement/CCAPControlPlanManagement.js"; getCCAPPlanList,
} from '@/api/CCAPControlPlanManagement/CCAPControlPlanManagement.js'
import { ref } from 'vue' import { ref } from 'vue'
import cn from '@/locales/controlPlan/CCAPControlPlan/CCAPControlPlanManagement/index/cn.json'; import cn from '@/locales/controlPlan/CCAPControlPlan/CCAPControlPlanManagement/index/cn.json';
import en from '@/locales/controlPlan/CCAPControlPlan/CCAPControlPlanManagement/index/en.json'; import en from '@/locales/controlPlan/CCAPControlPlan/CCAPControlPlanManagement/index/en.json';
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { getDicts } from '@/api/system/dict/data.js'
const router = useRouter() const router = useRouter()
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const { control_plan_status} = proxy.useDict('control_plan_status');
const total = ref(0); const total = ref(0);
const tableList = ref([]);
const queryParams = ref({ const queryParams = ref({
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10,
businessUnitId:null,
vehicleModelCode:null,
vehicleSeries:null,
versionNumber:null,
controlPlanStatus:null,
createBy:null
}); });
const businessList = ref([]); const businessList = ref([]);
const tableList = ref([]);
const controlPlanStatusOptions = ref([]);
function toHistory() {
proxy.$router.push({ path: '/control/CCAPControlPlan/history' }); function getAllBusinessUnit() {
getAllBusinessUnitName().then(res => {
businessList.value = res.data
})
} }
function getList() {
getCCAPPlanList(queryParams.value).then(res => {
total.value = res.total
tableList.value = res.rows
});
}
//字典转换
//控制计划状态字典
getDicts("control_plan_status").then(response => {
controlPlanStatusOptions.value = response.data;
// console.log("控制计划字典",controlPlanStatusOptions.value)
});
function changeControlPlanStatus(before) {
// console.log("控制计划字典原数据",before)
if(!controlPlanStatusOptions.value) return before
let item = controlPlanStatusOptions.value.find(item=>item.dictValue === before)
return item.dictLabel
}
/** 搜索按钮操作 */
function handleQuery() { function handleQuery() {
queryParams.value.pageNum = 1;
getList();
} }
/** 重置按钮操作 */
function resetQuery() { function resetQuery() {
proxy.resetForm("queryRef");
queryParams.value = {
pageNum: 1,
pageSize: 10,
businessUnitId:null,
vehicleModelCode:null,
vehicleSeries:null,
versionNumber:null,
controlPlanStatus:null,
createBy:null
};
handleQuery();
} }
function getList() { /** 查看历史控制计划按钮操作 */
getCCAPPlanList().then(res => { function toHistory() {
tableList.value = res.rows proxy.$router.push({ path: '/control/CCAPControlPlan/history' });
total.value = res.total
// console.log("列表",tableList.value)
});
} }
getList()
getList()
getAllBusinessUnit()
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment