Sfoglia il codice sorgente

产品基本信息添加编辑按钮

zhuliu 2 anni fa
parent
commit
23699f8c2a

+ 8 - 14
RMS-FrontEnd/src/views/components/identificationCode/index.vue

@@ -51,30 +51,24 @@ export default {
               this.$store.commit("COORDINATION",this.coordination)
               window.open(a.href,"_blank")
             } else {
-              document.getElementsByClassName("el-input__inner")[0].style.border("1px solid red")
+              document.getElementsByClassName("el-input__inner")[0].style.border="1px solid red"
               this.show = true;
               this.content = "识别码错误"
             }
+          }).catch(error=>{
+            document.getElementsByClassName("el-input__inner")[0].style.border="1px solid red"
+              this.show = true;
+              this.content = "识别码错误"
           })
-              // if (this.code == "111") {
-              //     this.$router.push({
-              //         path: ' http://192.168.1.9:8086/Incomplete?taskId=470&reportId=350&type=3&reportType=3',
-              //         // path: '/customer_review',
-              //     })
-              //   } else {
-              //       document.getElementsByClassName("el-input__inner")[0].style.border("1px solid red")
-              //       this.show = true;
-              //       this.content = "识别码错误"
-              //   }
 
             } else {
-                document.getElementsByClassName("el-input__inner")[0].style.border("1px solid red")
+                document.getElementsByClassName("el-input__inner")[0].style.border="1px solid red"
                 this.show = true;
                 this.content = "请输入识别码"
             }
         },
         change() {
-            document.getElementsByClassName("el-input__inner")[0].style.border("1px solid #DCDFE6")
+            document.getElementsByClassName("el-input__inner")[0].style.border="1px solid #DCDFE6"
             this.show = false;
         },
     }
@@ -87,7 +81,7 @@ export default {
 
 .code span {
     position: absolute;
-    top: calc(100%+10px);
+    top: calc(100% + 10px);
     left: 0px;
     color: red;
     font-size: 12px;

+ 21 - 10
RMS-FrontEnd/src/views/report/FTO/FTOPage/components/ProductMessage.vue

@@ -1,25 +1,29 @@
 <template>
     <div style="">
         <el-container>
-            <el-main  style="border:0;padding:35px 20px 20px;">
+            <el-main  style="border:0;padding:20px 20px 20px;">
                 <div class="header1">
-                    <el-button type="primary" @click="saveProduct" v-if="!noEdit1">保存</el-button>
+                    <el-button  @click="changEdit()" v-if="!noEdit1 && !isEdit">编辑</el-button>
+                    <el-button type="primary" @click="saveProduct" v-if="!noEdit1 && isEdit">保存</el-button>
                 </div>
                 <div class="demo-input-suffix" style="width:800px;margin:0 auto">
                     <div>
                         <el-form ref="form" :model="product" :rules="productRules" label-width="200px">
                             <el-form-item label="标的产品:" prop="productName">
-                                <el-input v-model="product.productName" @change="editChange" @blur="editChange" v-if="isEdit == 'productName' " placeholder="请输入"></el-input>
+                                <!-- <el-input v-model="product.productName" @change="editChange" @blur="editChange" v-if="isEdit == 'productName' " placeholder="请输入"></el-input> -->
+                                <el-input v-model="product.productName" v-if="isEdit " placeholder="请输入"></el-input>
                                 <span @dblclick="changEdit('productName')" placeholder="请输入" v-else>{{ product.productName }}</span>
                                 <!-- <span>{{ product.productName }}</span> -->
                             </el-form-item> 
                             <el-form-item label="标的产品说明:" prop="productDescription">
-                                <el-input type="textarea" v-model="product.productDescription" @change="editChange" @blur="editChange" v-if="isEdit == 'productDescription'" placeholder="请输入"></el-input>
+                                <!-- <el-input type="textarea" v-model="product.productDescription" @change="editChange" @blur="editChange" v-if="isEdit == 'productDescription'" placeholder="请输入"></el-input> -->
+                                <el-input type="textarea" v-model="product.productDescription" v-if="isEdit" placeholder="请输入"></el-input>
                                 <span @dblclick="changEdit('productDescription')" placeholder="请输入" v-else>{{ product.productDescription }}</span>
                                 <!-- <span>{{ product.productDescription }}</span> -->
                             </el-form-item>
                             <el-form-item label="调查区域:" prop="surveyArea" v-if="reportMessage.type == 3">
-                               <el-input type="textarea"  v-model="product.surveyArea" @change="editChange" @blur="editChange" v-if="isEdit == 'surveyArea'" placeholder="请输入"></el-input>
+                               <!-- <el-input type="textarea"  v-model="product.surveyArea" @change="editChange" @blur="editChange" v-if="isEdit == 'surveyArea'" placeholder="请输入"></el-input> -->
+                               <el-input type="textarea"  v-model="product.surveyArea" v-if="isEdit" placeholder="请输入"></el-input>
                                 <span @dblclick="changEdit('surveyArea')" placeholder="请输入" v-else>{{ product.surveyArea}}</span>
                             </el-form-item>
                             <el-form-item label="产品图:">
@@ -43,16 +47,17 @@
                                             </span>
                                             <el-image ref="image" class="img" :src="item" :preview-src-list="imgList"></el-image>
                                         </span>
-                                        <i class="el-icon-plus avatar-uploader-icon" v-if="!noEdit1"></i>
+                                        <i class="el-icon-plus avatar-uploader-icon" v-if="!noEdit1 && isEdit"></i>
                                     </span>
                                 </el-upload>
                             </el-form-item>
                             <el-form-item label="检索策略:" prop="searchPolicy" v-if="reportMessage.type == 3">
-                                <el-input v-model="product.searchPolicy" @change="editChange" @blur="editChange" v-if="isEdit == 'searchPolicy'" placeholder="请输入"></el-input>
+                                <!-- <el-input v-model="product.searchPolicy" @change="editChange" @blur="editChange" v-if="isEdit == 'searchPolicy'" placeholder="请输入"></el-input> -->
+                                <el-input v-model="product.searchPolicy" v-if="isEdit" placeholder="请输入"></el-input>
                                 <span @dblclick="changEdit('searchPolicy')" placeholder="请输入" v-else>{{ product.searchPolicy}}</span>
                             </el-form-item>
                             <el-form-item label="检索截止日期:" prop="deadLine">
-                                <span v-if="noEdit1 && product.deadLine">{{ product.deadLine.slice(0,10) }}</span>
+                                <span v-if="noEdit1 || !isEdit">{{product.deadLine? product.deadLine.slice(0,10):'' }}</span>
                                 <el-date-picker
                                     v-else
                                     style="width:100%"
@@ -63,7 +68,8 @@
                                     </el-date-picker>
                             </el-form-item>
                             <el-form-item :label="reportMessage.type==3?'关注企业/发明人/技术方向:':'备注:'">
-                                <el-input type="textarea" v-model="product.focusInformation" @change="editChange" @blur="editChange" v-if="isEdit == 'focusInformation'" placeholder="请输入"></el-input>
+                                <!-- <el-input type="textarea" v-model="product.focusInformation" @change="editChange" @blur="editChange" v-if="isEdit == 'focusInformation'" placeholder="请输入"></el-input> -->
+                                <el-input type="textarea" v-model="product.focusInformation" v-if="isEdit" placeholder="请输入"></el-input>
                                 <span @dblclick="changEdit('focusInformation')" placeholder="请输入" v-else>{{ product.focusInformation}}</span>
                                 <!-- <span>{{ product.focusInformation }}</span> -->
                             </el-form-item>
@@ -136,7 +142,10 @@ export default{
             if(this.noEdit1){
                 return false
             }
-            this.isEdit = val
+            if(!val){
+                this.isEdit = true
+            }
+            
       },
       editChange() {
           this.isEdit = ''
@@ -245,6 +254,7 @@ export default{
                             this.dialogImageUrl = []
                             this.file = []
                             this.$message.success('产品信息修改成功')
+                            this.isEdit = false
                             this.getProduct()
                         }
                     })
@@ -254,6 +264,7 @@ export default{
                             this.dialogImageUrl = []
                             this.file = []
                             this.$message.success('产品信息保存成功')
+                            this.isEdit = false
                             this.getProduct()
                         }
                     })

+ 1 - 1
RMS-FrontEnd/src/views/report/reportDetails/components/basicMessage.vue

@@ -39,7 +39,7 @@
                 </el-form-item>
                 <el-form-item :label="noEdit1?'附件':'上传附件:'">
                 <div v-if="form.reportFiles" class="upload-file">
-                    <div v-for="item in form.reportFiles" style="margin:0;display:flex;justify-content:space-around;"><p style="margin:0;width:calc(100% - 40px);overflow: hidden;white-space: nowrap;text-overflow:ellipsis;cursor: pointer" @click="checkFile(item)">{{item.name?item.name:item.fileName}}</p> <p style="margin:0;" @click="delFile(item.id)" v-if="!noEdit1"><i class="el-icon-close"></i></p></div>
+                    <div v-for="item in form.reportFiles" style="margin:0;display:flex;justify-content:space-around;"><p style="margin:0;width:calc(100% - 40px);overflow: hidden;white-space: nowrap;text-overflow:ellipsis;cursor: pointer" @click="checkFile(item)">{{item.name?item.name+'.'+item.suffix:item.fileName}}</p> <p style="margin:0;" @click="delFile(item.id)" v-if="!noEdit1"><i class="el-icon-close"></i></p></div>
                 </div>
                 <el-upload v-if="!noEdit1" ref="upload" class="upload-file" drag action="#" :auto-upload="false" :show-file-list="true" :on-change="onChange" multiple   :on-preview="handlePreview" :on-remove="handleRemove">
                     <i :class="!file ? 'el-icon-upload' : 'el-icon-refresh'"></i>