Commit bdba6fdf authored by 祁正's avatar 祁正

ccap项目管理-查看维护项目管理

parent 251320bd
...@@ -49,3 +49,10 @@ export function updateCcap(data) { ...@@ -49,3 +49,10 @@ export function updateCcap(data) {
data:data data:data
}) })
} }
// 获取所有事业部(除了奇瑞,除了列表里面的出现的)
export function getBusinessExclude() {
return request({
url: '/control/ccapProjectManagement/getBusinessExclude',
method: 'get'
})
}
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<el-table-column label="事业部" align="center" prop="applicableBrand" /> <el-table-column label="事业部" align="center" prop="applicableBrand" />
<el-table-column label="项目情况" align="center" prop="listCode" > <el-table-column label="项目情况" align="center" prop="listCode" >
<template #default="scope"> <template #default="scope">
<span style="text-decoration: underline;text-decoration-color: #2f9bfe;color: #2f9bfe;cursor: pointer">{{scope.row.relatedCount}}</span> <span @click="projectView(scope.row)" style="text-decoration: underline;text-decoration-color: #2f9bfe;color: #2f9bfe;cursor: pointer">{{scope.row.relatedCount}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建人" align="center" prop="createUserName" /> <el-table-column label="创建人" align="center" prop="createUserName" />
...@@ -56,10 +56,10 @@ ...@@ -56,10 +56,10 @@
/> />
<!-- 抽屉--> <!-- 抽屉-->
<el-drawer @close="closeDrawer" v-model="drawer2" size='40%'> <el-drawer @close="closeDrawer" v-model="drawer2" :size="!isDrawer?'40%':'32%'">
<template #header> <template #header>
<div style="font-weight: bold;font-size: 14px"> <div style="font-weight: bold;font-size: 14px">
维护项目(奇瑞、星途、智界) {{drawerTitle}}
</div> </div>
</template> </template>
<template #default> <template #default>
...@@ -89,18 +89,18 @@ ...@@ -89,18 +89,18 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="top-btn"> <div class="top-btn" v-if="!isDrawer">
<el-button type="primary" plain @click="handleAdd">新增</el-button> <el-button type="primary" plain @click="handleAdd">新增</el-button>
<el-button type="danger" plain @click="piliangDel">批量删除</el-button> <el-button type="danger" plain @click="piliangDel">批量删除</el-button>
</div> </div>
</div> </div>
<el-table border style="margin-top: 10px" :data="drawer2TableList" @selection-change="handleSelectionChange"> <el-table border style="margin-top: 10px" :data="drawer2TableList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/> <el-table-column type="selection" width="55" align="center" v-if="!isDrawer"/>
<el-table-column type="index" width="55" align="center" label="序号"/> <el-table-column type="index" width="55" align="center" label="序号"/>
<el-table-column label="项目" align="center" prop="project" width="300"/> <el-table-column label="项目" align="center" prop="project" width="300"/>
<el-table-column label="分组" align="center" prop="groupName" /> <el-table-column label="分组" align="center" prop="groupName" />
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center" v-if="!isDrawer">
<template #default="scope" align="center"> <template #default="scope" align="center">
<div > <div >
<el-button type="text" style="color: rgb(0,0,255)" @click="handleDrawerEdit(scope.row)">编辑</el-button> <el-button type="text" style="color: rgb(0,0,255)" @click="handleDrawerEdit(scope.row)">编辑</el-button>
...@@ -168,14 +168,14 @@ ...@@ -168,14 +168,14 @@
<el-form :model="tableDialogForm" > <el-form :model="tableDialogForm" >
<el-form-item label="事业部:" prop="project" > <el-form-item label="事业部:" prop="project" >
<el-select <el-select
v-model="dialogForm.business" v-model="tableDialogForm.businessUnitName"
placeholder="请选择" placeholder="请选择"
clearable clearable
> >
<el-option <el-option
v-for="dict in groupList" v-for="dict in businessListExclude"
:label="dict" :label="dict.business_unit_name"
:value="dict" :value="dict.id"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -185,8 +185,8 @@ ...@@ -185,8 +185,8 @@
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button @click="">取消</el-button> <el-button @click="dialog2Cancel">取消</el-button>
<el-button type="primary" @click="(dialogForm)"> <el-button type="primary" @click="dialog2Sure">
确定 确定
</el-button> </el-button>
</div> </div>
...@@ -204,13 +204,18 @@ import { ...@@ -204,13 +204,18 @@ import {
getProjectListById, getProjectListById,
inserTableData, inserTableData,
deleteBatch, deleteBatch,
updateCcap updateCcap,
getBusinessExclude
} from "@/api/CCAPProjectManagement/list"; } from "@/api/CCAPProjectManagement/list";
const tableDialogForm = ref({ const tableDialogForm = ref({
business:null, business:null,
id:null id:null
}) })
//抽屉标题
const drawerTitle = ref('')
//是否查看抽屉
const isDrawer = ref(false)
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const tableList = ref([]); const tableList = ref([]);
const drawer2 = ref(false) const drawer2 = ref(false)
...@@ -232,6 +237,9 @@ const dialogRules = { ...@@ -232,6 +237,9 @@ const dialogRules = {
groupName: [{ required: true, message: '分组不能为空', trigger: 'change' }] groupName: [{ required: true, message: '分组不能为空', trigger: 'change' }]
}; };
//所有事业部(除了奇瑞,除了列表里面的出现的)
const businessListExclude = ref([])
const dialogForm = ref({ const dialogForm = ref({
projectStatusId: null, projectStatusId: null,
project: null, project: null,
...@@ -274,7 +282,6 @@ function handleSelectionChange(arr){ ...@@ -274,7 +282,6 @@ function handleSelectionChange(arr){
//获取抽屉里面的表格数据 //获取抽屉里面的表格数据
function getDataProjectListById() { function getDataProjectListById() {
getProjectListById(drawerQueryParams.value).then(res => { getProjectListById(drawerQueryParams.value).then(res => {
console.log(res);
drawer2TableList.value = res.data; drawer2TableList.value = res.data;
}); });
} }
...@@ -298,10 +305,15 @@ function piliangDel(){ ...@@ -298,10 +305,15 @@ function piliangDel(){
} }
//添加事业部 //添加事业部
function addBusiness(row){ function addBusiness(row){
console.log(row)
tableDialogTitle.value = '添加事业部' tableDialogTitle.value = '添加事业部'
tableDialogVisible.value =true tableDialogVisible.value =true
} }
//获取所有事业部(除了奇瑞,除了列表里面的出现的)
function getBusinessListExclude(){
getBusinessExclude().then(res=>{
businessListExclude.value = res.data
})
}
//删除 //删除
function handleDrawerDel(row){ function handleDrawerDel(row){
...@@ -332,6 +344,22 @@ function del(id){ ...@@ -332,6 +344,22 @@ function del(id){
}) })
} }
//添加事业部等对话框的取消
function dialog2Cancel(){
tableDialogForm.value = {}
tableDialogVisible.value = false
}
function projectView(row){
console.log(row)
drawerQueryParams.value.id = row.id;
drawer2.value = true;
drawerTitle.value = "查看项目("+row.applicableBrand +")"
isDrawer.value = true
getDataProjectListById();
}
function handleDrawerEdit(row){ function handleDrawerEdit(row){
dialogVisible.value = true; dialogVisible.value = true;
addTitle.value = '编辑'; addTitle.value = '编辑';
...@@ -343,7 +371,6 @@ function handleDrawerEdit(row){ ...@@ -343,7 +371,6 @@ function handleDrawerEdit(row){
function getBusinessList() { function getBusinessList() {
getAllBusinessUnitList().then(res => { getAllBusinessUnitList().then(res => {
console.log(res);
businessList.value = res.data; businessList.value = res.data;
}); });
} }
...@@ -357,13 +384,11 @@ function handleAdd() { ...@@ -357,13 +384,11 @@ function handleAdd() {
//对话框里面的保存 //对话框里面的保存
function dialogSave() { function dialogSave() {
console.log(dialogForm.value);
dialogQueryRef.value.validate((valid)=>{ dialogQueryRef.value.validate((valid)=>{
if (valid) { if (valid) {
//判断是新增还是保存 //判断是新增还是保存
if(addTitle.value === '新增'){ if(addTitle.value === '新增'){
inserTableData(dialogForm.value).then(res=>{ inserTableData(dialogForm.value).then(res=>{
console.log(res)
if(res.code === 200) { if(res.code === 200) {
ElMessage.success("新增成功") ElMessage.success("新增成功")
dialogCencal() dialogCencal()
...@@ -372,7 +397,6 @@ function dialogSave() { ...@@ -372,7 +397,6 @@ function dialogSave() {
}) })
}else{ }else{
updateCcap(dialogForm.value).then(res=>{ updateCcap(dialogForm.value).then(res=>{
console.log(res)
if(res.code === 200) { if(res.code === 200) {
ElMessage.success("修改成功") ElMessage.success("修改成功")
dialogCencal() dialogCencal()
...@@ -461,8 +485,11 @@ function resetQuery() { ...@@ -461,8 +485,11 @@ function resetQuery() {
} }
function handleMaintain(row) { function handleMaintain(row) {
console.log(row)
drawerQueryParams.value.id = row.id; drawerQueryParams.value.id = row.id;
drawer2.value = true; drawer2.value = true;
drawerTitle.value = "维护项目("+row.applicableBrand +")"
isDrawer.value = false
getDataProjectListById(); getDataProjectListById();
} }
...@@ -475,6 +502,7 @@ function handleExport() { ...@@ -475,6 +502,7 @@ function handleExport() {
getList(); getList();
getBusinessList(); getBusinessList();
getBusinessListExclude();
</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