|
@@ -51,10 +51,14 @@
|
|
|
<el-table :data="tableData" style="width: 100%" border>
|
|
|
<el-table-column type="index" label="序号" width="50"></el-table-column>
|
|
|
<el-table-column prop="elementName" label="元素名称"></el-table-column>
|
|
|
- <el-table-column prop="isGlobal" label="是否全局参数"></el-table-column>
|
|
|
+ <el-table-column prop="type" label="是否全局参数">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.type===1?'是' : '否' }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="projectName" label="项目名称"></el-table-column>
|
|
|
- <el-table-column prop="contractSection" label="合同段"></el-table-column>
|
|
|
- <el-table-column prop="creator" label="创始人"></el-table-column>
|
|
|
+ <el-table-column prop="contractName" label="合同段"></el-table-column>
|
|
|
+ <el-table-column prop="name" label="创始人"></el-table-column>
|
|
|
<el-table-column prop="createTime" label="创建时间"></el-table-column>
|
|
|
<el-table-column label="操作" width="100">
|
|
|
<template slot-scope="scope">
|
|
@@ -78,31 +82,47 @@
|
|
|
<el-tag type="info" closable v-for="item in form.selectedElement" :key="id" class="mr-5" @close="handleClose(tag)">{{ item.eName }}</el-tag>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="是否全局参数" label-width="120px" prop="isGlobal">
|
|
|
- <el-radio-group v-model="form.isGlobal">
|
|
|
- <el-radio :label="true">是</el-radio>
|
|
|
- <el-radio :label="false">否</el-radio>
|
|
|
+ <el-form-item label="是否全局参数" label-width="120px" prop="type">
|
|
|
+ <el-radio-group v-model="form.type">
|
|
|
+ <el-radio :label="1">是</el-radio>
|
|
|
+ <el-radio :label="2">否</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="合同段" prop="contractSection" v-if="form.isGlobal===false" label-width="120px">
|
|
|
- <el-select v-model="form.projectName" placeholder="请选择项目" @change="changeProject" clearable style="width: 48%;">
|
|
|
- <el-option
|
|
|
- v-for="item in projectList"
|
|
|
- :key="item.id"
|
|
|
- :label="item.projectName"
|
|
|
- :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
-
|
|
|
- <el-select v-model="form.contractSection" placeholder="请选择合同段" clearable style="width: 48%;margin-left: 5px;" multiple >
|
|
|
- <el-option
|
|
|
- v-for="item in contractList"
|
|
|
- :key="item.id"
|
|
|
- :label="item.contractName"
|
|
|
- :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
+
|
|
|
+ <div class="form-container1" v-if="form.type===2" >
|
|
|
+ <el-button type="warning" class="add-button" size="small" @click="addProData">新增</el-button>
|
|
|
+ <div v-if="form.type===2" class="form-container" v-for="(item,index) in proData" :key="index" :style="{ marginTop: index === 0 ? '40px' : '0' }">
|
|
|
+ <!-- 删除图标 -->
|
|
|
+ <el-button type="danger" size="mini" v-if="index !== 0"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ circle
|
|
|
+ class="delete-icon"
|
|
|
+ @click="removeProData(index)">
|
|
|
+ </el-button>
|
|
|
+ <el-form-item label="选择项目" prop="contractSection" label-width="120px">
|
|
|
+ <el-select v-model="form.projectName" placeholder="请选择项目" @change="changeProject" clearable style="width: 100%;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in projectList1"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.projectName"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="选择合同段" prop="contractSection" label-width="120px" >
|
|
|
+ <el-select v-model="form.contractSection" placeholder="请选择合同段" clearable multiple class="multiple-select">
|
|
|
+ <el-option
|
|
|
+ v-for="item in contractList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.contractName"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="addDialogVisible = false">取 消</el-button>
|
|
@@ -122,7 +142,7 @@ import checkEleDialog from './checkEleDialog.vue';
|
|
|
import { getProjectList } from "@/api/manager/projectinfo";
|
|
|
import { findContractByProjectId } from "@/api/manager/contractinfo";
|
|
|
import addParamDialog from './addParamDialog.vue';
|
|
|
-import { remove,getProjectContractByParam} from "../../../api/paramter/parmter.js";
|
|
|
+import { remove,getProjectContractByParam,submitElement,getParameterElementList} from "../../../api/paramter/parmter.js";
|
|
|
export default {
|
|
|
components:{
|
|
|
checkEleDialog,
|
|
@@ -135,9 +155,7 @@ export default {
|
|
|
params: {
|
|
|
handler: function(n) {
|
|
|
this.params=n
|
|
|
- if(n.id){
|
|
|
- this.getProjectListData()
|
|
|
- }
|
|
|
+
|
|
|
},
|
|
|
deep: true,
|
|
|
},
|
|
@@ -146,6 +164,7 @@ export default {
|
|
|
return {
|
|
|
dialogVisible: false,
|
|
|
projectList: [],
|
|
|
+ projectList1:[],
|
|
|
contractList: [
|
|
|
],
|
|
|
searchForm: {
|
|
@@ -176,21 +195,25 @@ export default {
|
|
|
form: {
|
|
|
elementName: '',
|
|
|
selectedElement: [],
|
|
|
- isGlobal: false
|
|
|
+ type: false
|
|
|
},
|
|
|
+ proData:[{}],
|
|
|
rules: {
|
|
|
|
|
|
- isGlobal: [
|
|
|
+ type: [
|
|
|
{ required: true, message: '请选择是否全局参数', trigger: 'change' }
|
|
|
]
|
|
|
},
|
|
|
- editDialogVisible:false
|
|
|
+ editDialogVisible:false,
|
|
|
+ paramId:''
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
- show() {
|
|
|
+ show(id) {
|
|
|
+ this.paramId = id
|
|
|
this.dialogVisible = true;
|
|
|
-
|
|
|
+ this.getProjectListData(id)
|
|
|
+ this.getTableData(id)
|
|
|
},
|
|
|
closeParamDialog(){
|
|
|
this.dialogVisible = false;
|
|
@@ -203,11 +226,15 @@ export default {
|
|
|
handleAdd() {
|
|
|
// 实现新增逻辑
|
|
|
this.addDialogVisible=true;
|
|
|
+
|
|
|
+ this.getProjectListData1()
|
|
|
this.isEdit=false
|
|
|
},
|
|
|
closeDialog(){
|
|
|
this.addDialogVisible=false;
|
|
|
+
|
|
|
this.isEdit=false
|
|
|
+ this.contractList=[]
|
|
|
},
|
|
|
handleEditParam(item){
|
|
|
this.editDialogVisible=true
|
|
@@ -247,22 +274,25 @@ export default {
|
|
|
console.log('删除:', index, row);
|
|
|
},
|
|
|
//获取项目列表
|
|
|
- getProjectListData() {
|
|
|
- console.log(this.params.id,'this.params.id');
|
|
|
-
|
|
|
- if(!this.params.id ){
|
|
|
+ getProjectListData(id) {
|
|
|
+ if(!id ){
|
|
|
getProjectList(1, 999).then((res) => {
|
|
|
this.projectList = res.data.data.records;
|
|
|
});
|
|
|
}else{
|
|
|
getProjectContractByParam({
|
|
|
- parameterId: this.params.id
|
|
|
+ parameterId: id
|
|
|
}).then((res) => {
|
|
|
this.projectList = res.data.data.records;
|
|
|
});
|
|
|
}
|
|
|
|
|
|
},
|
|
|
+ getProjectListData1() {
|
|
|
+ getProjectList(1, 999).then((res) => {
|
|
|
+ this.projectList1 = res.data.data.records;
|
|
|
+ });
|
|
|
+ },
|
|
|
changeProject(val){
|
|
|
|
|
|
//根据项目id获取合同段列表
|
|
@@ -272,8 +302,58 @@ export default {
|
|
|
|
|
|
});
|
|
|
},
|
|
|
+ //获取元素列表
|
|
|
+ getTableData(id){
|
|
|
+ getParameterElementList({
|
|
|
+ parameterId: this.paramId,
|
|
|
+ contractId:'',
|
|
|
+ projectId:'',
|
|
|
+ elementName:''
|
|
|
+ }).then((res)=>{
|
|
|
+ this.tableData = res.data.data;
|
|
|
+ })
|
|
|
+ },
|
|
|
confirmAdd(){
|
|
|
-
|
|
|
+ console.log(this.form,'form');
|
|
|
+ const {selectedElement}=this.form;
|
|
|
+ if(!this.form.elementName&&selectedElement.length==0){
|
|
|
+ this.$message.error('请选择元素或者完善元素名称');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let subArr=[]
|
|
|
+ if(selectedElement.length>0){
|
|
|
+ selectedElement.forEach(item=>{
|
|
|
+ subArr.push({
|
|
|
+ id:this.form.id,
|
|
|
+ parameterId: this.params.id,
|
|
|
+ type:this.form.type,
|
|
|
+ elementName:item.eName,
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }else if(this.form.elementName){
|
|
|
+ subArr.push({
|
|
|
+ id:this.form.id,
|
|
|
+ parameterId: this.params.id,
|
|
|
+ type:this.form.type,
|
|
|
+ elementName:this.form.elementName,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ submitElement(subArr).then((res) => {
|
|
|
+ if(res.data.code==200){
|
|
|
+
|
|
|
+ this.$message.success(res.data.msg)
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.$message.error(res.data.msg)
|
|
|
+ }
|
|
|
+ this.getTableData()
|
|
|
+ });
|
|
|
+ },
|
|
|
+ addProData(){
|
|
|
+ this.proData.push({})
|
|
|
+ },
|
|
|
+ removeProData(index){
|
|
|
+ this.proData.splice(index,1)
|
|
|
},
|
|
|
//选择元素
|
|
|
checkEle(){
|
|
@@ -292,6 +372,40 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
+.form-container1{
|
|
|
+ position: relative;
|
|
|
+ max-height: 400px;
|
|
|
+ overflow-y: auto;
|
|
|
+
|
|
|
+}
|
|
|
+.form-container {
|
|
|
+ border: 1px solid #ccc; /* 淡灰色边框 */
|
|
|
+
|
|
|
+ padding: 20px 40px 0px 20px;
|
|
|
+ margin-bottom: 15px;
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+}
|
|
|
+.delete-icon {
|
|
|
+ position: absolute;
|
|
|
+ top: 5px;
|
|
|
+ right:5px;
|
|
|
+ z-index: 1000;
|
|
|
+}
|
|
|
+.add-button {
|
|
|
+
|
|
|
+ margin-left: 20px;
|
|
|
+ position: absolute;
|
|
|
+ top: 0px;
|
|
|
+ right: 5px;
|
|
|
+ z-index: 1000;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+.multiple-select {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
.search-container {
|
|
|
display: flex;
|