qymljy hace 2 meses
padre
commit
d772a7780d

+ 64 - 40
src/HDrpManagement/serviceImprovement/components/causeAnalysis/edit.vue

@@ -34,32 +34,29 @@
                           :rows="5" :placeholder="$t(`改善建议`)"></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="24">
-              <el-form-item>
-                <div class="flex-align-center flex-between pionter" v-for="file in attinfos" :key="file.index">
-                  <div class="flex-align-center">
-                    <img width="30" :src="checkFileType(file.postfix) === 'file'?require('@/assets/file_icons/file.svg'):file.url" class="inline-16" alt="">
-                    <div class="file__link inline-16">
-                      <a :href="file.url">{{file.document}}</a>
-                      <p>{{(file.contentlength / 1024).toFixed(2)}}kb</p>
-                    </div>
-                  </div>
-                  <i style="color:red;" class="el-icon-delete" @click="deleteFile(file)"></i>
-                </div>
-                <upload
-                    :folderid="folderid"
-                    @upload="loading = true"
-                    btntype="icon"
-                    @onSuccess="onSuccess"
-                    :hidemediastock="false"
-                    :isFile="true"
-                    :bindData=" {ownertable: 'sys_datafollowup', ownerid: data.sys_datafollowupid,usetype: 'default'}"
-                    :bindDataFile="bindDataFile">
-                </upload>
-              </el-form-item>
-            </el-col>
           </el-form>
         </el-row>
+        <div class="flex-align-center flex-between pionter" v-for="file in attinfos" :key="file.index">
+          <div class="flex-align-center">
+            <img width="30" :src="checkFileType(file.postfix) === 'file'?require('@/assets/file_icons/file.svg'):file.url" class="inline-16" alt="">
+            <div class="file__link inline-16">
+              <a :href="file.url">{{file.document}}</a>
+              <p>{{(file.contentlength / 1024).toFixed(2)}}kb</p>
+            </div>
+          </div>
+          <i style="color:red;" class="el-icon-delete" @click="deleteFile(file)"></i>
+        </div>
+        <upload
+            ref="uploadRef"
+            :folderid="folderid"
+            @upload="loading = true"
+            btntype="icon"
+            @onSuccess="onSuccess"
+            :hidemediastock="false"
+            :isFile="true"
+            :bindData="bindData"
+            :bindDataFile="bindDataFile">
+        </upload>
       </div>
       <div class="fixed__btn__panel">
         <el-button size="small" @click="drawerVisible = false" class="normal-btn-width">{{$t('取 消')}}</el-button>
@@ -131,6 +128,7 @@ export default {
         usetype: 'analysis'
       },
       folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
+      attachmentids:[]
     }
   },
   components:{selectTemplate,upload},
@@ -161,19 +159,6 @@ export default {
           this.$store.commit('setLoading',false)
           this.drawerVisible = false
           this.$refs['form'].resetFields();
-          // this.$refs['upload'].toUpload()
-          this.$store.dispatch('bindFileToData',{
-            "ownertable": 'sa_service_improvement',
-            "ownerid": this.$route.query.id,
-            "usetype": 'analysis',
-            "attachmentids": this.attachmentids
-
-          }).then(rs=>{
-            this.attachmentids = []
-            this.squarestageList = []
-            this.dialogFormVisible = false
-            this.$emit('onSuccess')
-          })
           this.$emit('editSuccess')
         })
       })
@@ -210,11 +195,23 @@ export default {
       })
     },
     onSuccess(res) {
-      console.log('res输出附件信息',res)
       res.attinfos = JSON.parse(res.attinfos)
       this.attachmentids = [...this.attachmentids,...res.attinfos.data]
       this.loading = false
-      // this.$emit('onSuccess')
+      this.$emit('queryFile')
+    },
+    async queryFile(){
+      const res = await this.$api.requested({
+        "classname": "system.attachment.Attachment",
+        "method": "queryFileLink",
+        "content": {
+          "ownertable": "sa_service_improvement",
+          "ownerid": this.$route.query.id,
+          "usetype":"analysis"//传空返回有所
+        }
+      })
+      console.log(res,'输出附件信息')
+      this.attinfos = res.data
     },
     onClose(){
     }
@@ -223,5 +220,32 @@ export default {
 </script>
 
 <style scoped>
-
+.file__link,.file__link > a{
+  color:#999;
+  font-size: 12px;
+  display:block;
+  width: 100%;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+.pionter{
+  margin:6px 0;
+  padding: 10px;
+  transition: .2s linear;
+  cursor: pointer;
+  border-radius: 5px;
+}
+.pionter:hover{
+  box-shadow: 0 5px 10px rgb(0 0 0 / 10%);
+}
+/deep/ .el-form-item {
+  margin-bottom: 10px;
+}
+/deep/ .el-form--label-top .el-form-item__label {
+  float: none;
+  display: inline-block;
+  text-align: left;
+  padding: 0 0 0px 0;
+}
 </style>

+ 1 - 1
src/HDrpManagement/serviceImprovement/components/causeAnalysis/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <edit :data="mainData" @editSuccess="editSuccess" :attinfos="attinfos" v-if="mainData.status == '新建' && mainData.userid_analysis == userid"></edit>
+    <edit :data="mainData" @editSuccess="editSuccess" @queryFile="queryFile" :attinfos="attinfos" v-if="mainData.status == '新建' && mainData.userid_analysis == userid"></edit>
     <div class="div_title">{{$t(`主要原因`)}}</div>
     <div class="div-content">
       {{mainData.main_reason || '暂无数据'}}

+ 2 - 1
src/HDrpManagement/serviceImprovement/modules/edit.vue

@@ -55,7 +55,7 @@
       <div class="fixed__btn__panel">
         <el-button
             size="small"
-            @click="onClose"
+            @click="drawerVisible = false"
             class="normal-btn-width"
         >{{ $t("取 消") }}</el-button
         >
@@ -116,6 +116,7 @@ export default {
       })
     },
     onClose(){
+      this.$refs.form.resetFields()
       this.$emit('editSuccess')
     },
     async queryType(type){