|
@@ -71,7 +71,7 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 新增弹窗 -->
|
|
|
- <el-dialog title="元素新增" :visible.sync="addDialogVisible" width="30%" append-to-body @close="closeDialog">
|
|
|
+ <el-dialog :title="form.id?'元素编辑':'元素新增'" :visible.sync="addDialogVisible" width="30%" append-to-body @close="closeDialog">
|
|
|
<el-form :model="form" :rules="rules" ref="formRef" label-position="left">
|
|
|
<el-form-item label="元素名称" label-width="120px">
|
|
|
<el-input v-model="form.elementName" :disabled="form.selectedElement.length>0"></el-input>
|
|
@@ -142,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,submitElement,getParameterElementList} from "../../../api/paramter/parmter.js";
|
|
|
+import { remove,getProjectContractByParam,submitElement,getParameterElementList,removeElement} from "../../../api/paramter/parmter.js";
|
|
|
export default {
|
|
|
components:{
|
|
|
checkEleDialog,
|
|
@@ -172,24 +172,7 @@ export default {
|
|
|
contractSection: '',
|
|
|
textSearch: '',
|
|
|
},
|
|
|
- tableData: [
|
|
|
- {
|
|
|
- elementName: '元素1',
|
|
|
- isGlobal: '是',
|
|
|
- projectName: '项目A',
|
|
|
- contractSection: '合同段1',
|
|
|
- creator: '张三',
|
|
|
- createTime: '2023-10-01'
|
|
|
- },
|
|
|
- {
|
|
|
- elementName: '元素2',
|
|
|
- isGlobal: '否',
|
|
|
- projectName: '项目B',
|
|
|
- contractSection: '合同段2',
|
|
|
- creator: '李四',
|
|
|
- createTime: '2023-10-02'
|
|
|
- }
|
|
|
- ],
|
|
|
+ tableData: [],
|
|
|
addDialogVisible:false,
|
|
|
isEdit:false,
|
|
|
form: {
|
|
@@ -229,6 +212,12 @@ export default {
|
|
|
|
|
|
this.getProjectListData1()
|
|
|
this.isEdit=false
|
|
|
+ this.form={
|
|
|
+ elementName: '',
|
|
|
+ selectedElement: [],
|
|
|
+ type: false
|
|
|
+ }
|
|
|
+ this.proData=[{}]
|
|
|
},
|
|
|
closeDialog(){
|
|
|
this.addDialogVisible=false;
|
|
@@ -238,6 +227,8 @@ export default {
|
|
|
},
|
|
|
handleEditParam(item){
|
|
|
this.editDialogVisible=true
|
|
|
+ console.log(this.params,'this.params');
|
|
|
+
|
|
|
|
|
|
},
|
|
|
addCardFinish(){
|
|
@@ -246,7 +237,18 @@ export default {
|
|
|
},
|
|
|
handleEdit(index, row) {;
|
|
|
this.addDialogVisible=true;
|
|
|
+ this.getProjectListData1()
|
|
|
+ this.changeProject(row.projectId)
|
|
|
this.isEdit=true
|
|
|
+ console.log(row,'row');
|
|
|
+
|
|
|
+ this.form=row
|
|
|
+ let arr=[{
|
|
|
+ projectName:row.projectId,
|
|
|
+ contractSection:row.contractId?row.contractId.split(','):[]
|
|
|
+ }]
|
|
|
+ this.proData=arr
|
|
|
+ this.form.selectedElement=[]
|
|
|
},
|
|
|
handleDelteParam(){
|
|
|
this.$confirm("确定将选择数据删除?", {
|
|
@@ -272,6 +274,25 @@ export default {
|
|
|
handleDelete(index, row) {
|
|
|
// 实现删除逻辑
|
|
|
console.log('删除:', index, row);
|
|
|
+ this.$confirm("确定将选择数据删除?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ return removeElement({
|
|
|
+ id:row.id
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message:res.data.msg
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ this.getTableData( this.paramId)
|
|
|
+ });
|
|
|
},
|
|
|
//获取项目列表
|
|
|
getProjectListData(id) {
|