Commit 6eb712b9 authored by 祁正's avatar 祁正

ccap项目管理-复制新增

parent afb00fa5
...@@ -56,6 +56,16 @@ export function getBusinessExclude() { ...@@ -56,6 +56,16 @@ export function getBusinessExclude() {
method: 'get' method: 'get'
}) })
} }
// 获取所有事业部(除了奇瑞,除了列表里面的出现的在第一条数据的)-复制新增
export function getBusinessExclude2() {
return request({
url: '/control/ccapProjectManagement/getBusinessExclude2',
method: 'get'
})
}
// 添加事业部 // 添加事业部
export function addBusinessUnit(data) { export function addBusinessUnit(data) {
return request({ return request({
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<template #default="scope"> <template #default="scope">
<div style="display: flex;align-items: flex-start"> <div style="display: flex;align-items: flex-start">
<el-button type="text" style="color: rgb(0,0,255)" @click="handleMaintain(scope.row)">维护项目</el-button> <el-button type="text" style="color: rgb(0,0,255)" @click="handleMaintain(scope.row)">维护项目</el-button>
<el-button type="text" style="color: rgb(255,153,0)" v-if="scope.row.id === adminId" @click="handleView(scope.row)">复制新增</el-button> <el-button type="text" style="color: rgb(255,153,0)" v-if="scope.row.id === adminId" @click="copeAdd(scope.row)">复制新增</el-button>
<el-button type="text" v-if="scope.row.id === adminId" @click="addBusiness(scope.row)">添加事业部</el-button> <el-button type="text" v-if="scope.row.id === adminId" @click="addBusiness(scope.row)">添加事业部</el-button>
<el-button type="text" style="color: rgb(244,93,93)" v-else="scope.row.id === adminId" @click="handleView(scope.row)">删除</el-button> <el-button type="text" style="color: rgb(244,93,93)" v-else="scope.row.id === adminId" @click="handleView(scope.row)">删除</el-button>
</div> </div>
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
<div style="width: 70%;margin-left: 15%;padding: 20px 0"> <div style="width: 70%;margin-left: 15%;padding: 20px 0">
<el-form :model="tableDialogForm" ref="dialogForm2"> <el-form :model="tableDialogForm" ref="dialogForm2">
<el-form-item :rules="[ <el-form-item :rules="[
{ required: true, message: '请选择事业部', trigger: 'change' } { required: true, message: '请选择事业部', trigger: 'blur' }
]" label="事业部:" prop="businessId" > ]" label="事业部:" prop="businessId" >
<el-select <el-select
v-model="tableDialogForm.businessId" v-model="tableDialogForm.businessId"
...@@ -176,7 +176,7 @@ ...@@ -176,7 +176,7 @@
> >
<el-option <el-option
v-for="dict in businessListExclude" v-for="dict in businessListExclude"
:label="dict.business_unit_name" :label="dict.businessUnitName"
:value="dict.id" :value="dict.id"
/> />
</el-select> </el-select>
...@@ -208,7 +208,8 @@ import { ...@@ -208,7 +208,8 @@ import {
deleteBatch, deleteBatch,
updateCcap, updateCcap,
getBusinessExclude, getBusinessExclude,
addBusinessUnit addBusinessUnit,
getBusinessExclude2
} from "@/api/CCAPProjectManagement/list"; } from "@/api/CCAPProjectManagement/list";
const tableDialogForm = ref({ const tableDialogForm = ref({
...@@ -243,7 +244,7 @@ const dialogRules = { ...@@ -243,7 +244,7 @@ const dialogRules = {
groupName: [{ required: true, message: '分组不能为空', trigger: 'blur' }] groupName: [{ required: true, message: '分组不能为空', trigger: 'blur' }]
}; };
//所有事业部(除了奇瑞,除了列表里面的出现的) //所有事业部
const businessListExclude = ref([]) const businessListExclude = ref([])
const dialogForm = ref({ const dialogForm = ref({
...@@ -285,6 +286,7 @@ function handleSelectionChange(arr){ ...@@ -285,6 +286,7 @@ function handleSelectionChange(arr){
} }
} }
//获取抽屉里面的表格数据 //获取抽屉里面的表格数据
function getDataProjectListById() { function getDataProjectListById() {
getProjectListById(drawerQueryParams.value).then(res => { getProjectListById(drawerQueryParams.value).then(res => {
...@@ -314,10 +316,20 @@ function addBusiness(row){ ...@@ -314,10 +316,20 @@ function addBusiness(row){
tableDialogTitle.value = '添加事业部' tableDialogTitle.value = '添加事业部'
tableDialogVisible.value =true tableDialogVisible.value =true
tableDialogForm.value.id = row.id tableDialogForm.value.id = row.id
getBusinessListExclude();
} }
//获取所有事业部(除了奇瑞,除了列表里面的出现的) //获取所有事业部(除了奇瑞,除了列表里面的出现的)
function getBusinessListExclude(){ function getBusinessListExclude(){
getBusinessExclude().then(res=>{ getBusinessExclude().then(res=>{
console.log("添加事业部",res)
businessListExclude.value = res.data
})
}
// //获取所有事业部(除了奇瑞,除了列表里面的出现的在第一条数据的)-复制新增
function getBusinessListExclude2(){
getBusinessExclude2().then(res=>{
console.log("复制新增",res)
businessListExclude.value = res.data businessListExclude.value = res.data
}) })
} }
...@@ -420,6 +432,14 @@ function dialogSave() { ...@@ -420,6 +432,14 @@ function dialogSave() {
} }
//复制新增
function copeAdd(row){
tableDialogTitle.value = '复制新增'
tableDialogVisible.value =true
tableDialogForm.value.id = row.id
getBusinessListExclude2()
}
//对话框里面的取消 //对话框里面的取消
function dialogCencal() { function dialogCencal() {
dialogForm.value.project = null; dialogForm.value.project = null;
...@@ -528,7 +548,7 @@ function handleExport() { ...@@ -528,7 +548,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