소스 검색

问题修复

gangyj 3 년 전
부모
커밋
e2c2794128
3개의 변경된 파일115개의 추가작업 그리고 21개의 파일을 삭제
  1. 8 1
      src/styles/common.scss
  2. 0 15
      src/views/manager/projectinfo/tree.vue
  3. 107 5
      src/views/manager/wbsinfo/edit.vue

+ 8 - 1
src/styles/common.scss

@@ -118,4 +118,11 @@ a{
   justify-content: space-between;
   font-size: 14px;
   padding-right: 8px;
-}
+}
+
+.required:before{
+  content: "*";
+  color: #f56c6c;
+  margin-right: 4px;
+}
+

+ 0 - 15
src/views/manager/projectinfo/tree.vue

@@ -1713,22 +1713,7 @@ export default {
     },
 
     importTemplate (data) {
-      this.importTemplateVisible = true;
       this.curTreeData = data;
-
-      if (!this.fileUrl) {
-        getAttchFromOriginalName(1, 20, {
-          originalName: 'WBS划分模板.xls'
-        }).then((res) => {
-          if (res.data.data.records.length) {
-            this.fileUrl = res.data.data.records[0].link;
-          } else {
-            this.fileUrl = '';
-          }
-
-        })
-      }
-
     },
 
     importTemplateHandle () {

+ 107 - 5
src/views/manager/wbsinfo/edit.vue

@@ -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;