|
@@ -200,11 +200,19 @@
|
|
|
<el-table :data="eleForm.elementList" border style="width: 100%" height="400px">
|
|
|
<el-table-column align="center" type="index" width="50"></el-table-column>
|
|
|
<el-table-column align="center" prop="eName" label="元素名称" >
|
|
|
+ <template slot="header">
|
|
|
+ <i class="required"></i>
|
|
|
+ <span>元素名称</span>
|
|
|
+ </template>
|
|
|
<template slot-scope="scope">
|
|
|
<el-input v-model="scope.row.eName" size="small" placeholder="请输入内容"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" prop="eType" label="数据类型" width="120">
|
|
|
+ <template slot="header">
|
|
|
+ <i class="required"></i>
|
|
|
+ <span>数据类型</span>
|
|
|
+ </template>
|
|
|
<template slot-scope="scope">
|
|
|
<el-select v-model="scope.row.eType" size="small" placeholder="请选择">
|
|
|
<el-option v-for="item in dataTypeList" :key="item.id" :label="item.dictValue" :value="item.dictKey"></el-option>
|
|
@@ -212,6 +220,10 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" prop="eLength" label="长度" width="120">
|
|
|
+ <template slot="header">
|
|
|
+ <i class="required"></i>
|
|
|
+ <span>长度</span>
|
|
|
+ </template>
|
|
|
<template slot-scope="scope">
|
|
|
<el-input v-model="scope.row.eLength" size="small" placeholder="请输入内容" :disabled="scope.row.eType == 4" ></el-input>
|
|
|
</template>
|
|
@@ -280,12 +292,20 @@
|
|
|
<p class="font-c-warning">编辑元素信息(请谨慎操作)</p>
|
|
|
<el-table :data="editEleList" border style="width: 100%" height="400px">
|
|
|
<el-table-column align="center" type="index" width="50"></el-table-column>
|
|
|
- <el-table-column align="center" prop="eName" label="元素名称" >
|
|
|
+ <el-table-column align="center" prop="eName" label="元素名称">
|
|
|
+ <template slot="header">
|
|
|
+ <i class="required"></i>
|
|
|
+ <span>元素名称</span>
|
|
|
+ </template>
|
|
|
<template slot-scope="scope">
|
|
|
<el-input v-model="scope.row.eName" size="small" placeholder="请输入内容"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" prop="eType" label="数据类型" width="120">
|
|
|
+ <template slot="header">
|
|
|
+ <i class="required"></i>
|
|
|
+ <span>数据类型</span>
|
|
|
+ </template>
|
|
|
<template slot-scope="scope">
|
|
|
<el-select v-model="scope.row.eType" size="small" placeholder="请选择">
|
|
|
<el-option v-for="item in dataTypeList" :key="item.id" :label="item.dictValue" :value="item.dictKey"></el-option>
|
|
@@ -293,6 +313,10 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" prop="eLength" label="长度" width="120">
|
|
|
+ <template slot="header">
|
|
|
+ <i class="required"></i>
|
|
|
+ <span>长度</span>
|
|
|
+ </template>
|
|
|
<template slot-scope="scope">
|
|
|
<el-input v-model="scope.row.eLength" size="small" placeholder="请输入内容" :disabled="scope.row.eType == 4"></el-input>
|
|
|
</template>
|
|
@@ -346,7 +370,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="操作" width="200">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-link type="primary" >公式配置</el-link>
|
|
|
+ <el-link type="primary" @click="toFormulaEdit">公式配置</el-link>
|
|
|
<el-link class="mg-l-10" type="danger" @click="delEleRowHandle(scope.$index,editEleList)">删除</el-link>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -733,10 +757,34 @@
|
|
|
this.eleForm.deptCategory = -1;
|
|
|
this.eleForm.type = 2;// '1'节点 '2'表单
|
|
|
this.eleForm.parentId = this.nodeDetail.id;
|
|
|
+ for (let i = 0; i < this.eleForm.elementList.length; i++) {
|
|
|
+ if(!this.eleForm.elementList[i].eName){
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "请填写第"+(i+1)+"条元素名称"
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(!this.eleForm.elementList[i].eType){
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "请选择第"+(i+1)+"条数据类型"
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(this.eleForm.elementList[i].eType != 4 && !this.eleForm.elementList[i].eLength){
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "请填写第"+(i+1)+"条长度"
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
this.eleForm.elementList.forEach((element)=>{
|
|
|
element.eAllowDeviation = (element.allow?element.allow:'') + (element.deviation?element.deviation:'');
|
|
|
if(element.eType == 4){
|
|
|
- element.eLength = 0;
|
|
|
+ this.$set(element,'eLength',0);
|
|
|
+ //element.eLength = 0;
|
|
|
}
|
|
|
})
|
|
|
saveFormAndElement(this.eleForm).then(()=>{
|
|
@@ -821,12 +869,35 @@
|
|
|
},
|
|
|
|
|
|
saveNewEle(row){
|
|
|
+ if(!row.eName){
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "请填写元素名称"
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(!row.eType){
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "请选择数据类型"
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
row.eAllowDeviation = (row.allow?row.allow:'') + (row.deviation?row.deviation:'');
|
|
|
row.fId = this.curEleTable.id;
|
|
|
row.initTableName = this.curEleTable.initTableName;
|
|
|
if(row.eType == 4){
|
|
|
- row.eLength = 0;
|
|
|
+ this.$set(row,'eLength',0);
|
|
|
+ //row.eLength = 0;
|
|
|
+ }else if(!row.eLength){
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "请填写长度"
|
|
|
+ });
|
|
|
+ return;
|
|
|
}
|
|
|
+
|
|
|
saveElement(row).then((res)=>{
|
|
|
if(res.data.data){
|
|
|
this.$set(row,'id',res.data.data.id);
|
|
@@ -864,12 +935,34 @@
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
+ if(!this.editEleList[i].eName){
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "请填写第"+(i+1)+"条元素名称"
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(!this.editEleList[i].eType){
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "请选择第"+(i+1)+"条数据类型"
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(this.editEleList[i].eType != 4 && !this.editEleList[i].eLength){
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "请填写第"+(i+1)+"条长度"
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
if(this.editEleList.length > 0){
|
|
|
this.editEleList.forEach((element)=>{
|
|
|
element.eAllowDeviation = (element.allow?element.allow:'') + (element.deviation?element.deviation:'');
|
|
|
if(element.eType == 4){
|
|
|
- element.eLength = 0;
|
|
|
+ this.$set(element,'eLength',0);
|
|
|
+ //element.eLength = 0;
|
|
|
}
|
|
|
})
|
|
|
updateBatchElements(this.editEleList,this.curEleTable.initTableName).then(()=>{
|
|
@@ -1041,6 +1134,15 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ toFormulaEdit(){
|
|
|
+ this.$router.push({
|
|
|
+ path:'/formula/edit',
|
|
|
+ query:{
|
|
|
+ wbsid:this.id,
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
getDeptCategorylist(){
|
|
|
if(this.deptCategorylist.length >1){
|
|
|
return;
|