qymljy 2 miesięcy temu
rodzic
commit
809ad50a72

+ 0 - 1
src/Form/payvoucher/add.vue

@@ -162,7 +162,6 @@ export default {
       this.visibleEnterprise = false
       this.form.sys_enterpriseid = data.sys_enterpriseid
       this.form.enterprisename = data.enterprisename
-
     },
     /*账户类型*/
     async accountList(id){

+ 94 - 8
src/HDrpManagement/serviceImprovement/components/causeAnalysis/edit.vue

@@ -4,7 +4,6 @@
     <el-drawer
         :title="$t(`编辑真因分析`)"
         :visible.sync="drawerVisible"
-        :wrapperClosable="false"
         size="40%"
         direction="rtl"
         append-to-body
@@ -15,7 +14,7 @@
             <el-col :span="24">
               <el-form-item :label="$t(`责任人`)+':'" prop="userid_charge">
 <!--                <el-input v-model="form.userid_charge" :placeholder="$t(`请选择责任人`)"></el-input>-->
-                <selectTemplate ref="selectRef" :params="params" type="组织架构" :params1="params1" placeholder="选择责任人" :data="data"></selectTemplate>
+                <selectTemplate ref="selectRef" :params="params" type="组织架构" :params1="params1" placeholder="选择责任人" :name_charge="name_charge" @rowClick="rowClick"></selectTemplate>
               </el-form-item>
             </el-col>
             <el-col :span="24">
@@ -35,6 +34,30 @@
                           :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>
@@ -48,9 +71,10 @@
 
 <script>
 import selectTemplate from '@/components/addTable/index'
+import upload from '@/components/upload/hw_obs_upload.vue'
 export default {
   name: "edit",
-  props:['data'],
+  props:['data','attinfos'],
   data(){
     return {
       drawerVisible:false,
@@ -63,6 +87,7 @@ export default {
         "userid_charge": '' //责任人
       },
       depname_charge:'',
+      name_charge:'',
       rules:{
         userid_charge:[
           { required: true, message: this.$t('请选择责任人'), trigger: 'change'},
@@ -94,13 +119,23 @@ export default {
         classname: "webmanage.department.department",
         method: "querydepartment",
         content:{}
-      }
+      },
+      bindData:{
+        ownertable: 'sa_service_improvement',
+        ownerid: this.$route.query.id,
+        usetype: 'analysis'
+      },
+      bindDataFile:{
+        ownertable: 'sa_service_improvement',
+        ownerid: this.$route.query.id,
+        usetype: 'analysis'
+      },
+      folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
     }
   },
-  components:{selectTemplate},
+  components:{selectTemplate,upload},
   methods:{
     editClick(){
-      console.log(this.data,'data数据')
       this.form = {
         "sa_service_improvementid": this.$route.query.id,
         "main_reason": this.data.main_reason, //主要原因
@@ -109,14 +144,12 @@ export default {
         "userid_charge": this.data.userid_charge == 0 ? '' : this.data.userid_charge //责任人
       }
       this.depname_charge = this.data.depname_charge
-      console.log(this.form,'信息数据输出')
       this.drawerVisible = true
       this.$nextTick(()=>{
         this.$refs.selectRef.input = this.data.name_charge
       })
     },
     onSubmit(){
-      console.log(this.form,'form表单数据')
       this.$refs['form'].validate(async (valid) => {
         if (!valid) return false
         this.$store.commit('setLoading',true)
@@ -126,10 +159,63 @@ export default {
         })
         this.tool.showMessage(res,()=>{
           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')
         })
       })
     },
+    rowClick(data){
+      this.name_charge = data.username
+      this.depname_charge = data.depname
+      this.form.userid_charge = data.userid
+      this.form.departmentid = data.departmentid
+    },
+    checkFileType (type) {
+      let arr = ['JPG','JPEG','PNG']
+      if (arr.includes(type.toUpperCase())) {
+        return 'img'
+      } else {
+        return 'file'
+      }
+    },
+    async deleteFile (row) {
+      const res = await this.$api.requested({
+        "classname": "system.attachment.Attachment",
+        "method": "deleteFileLink",
+        "content": {
+          "linksids":[row.linksid]
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.attinfos.forEach(item=>{
+          if (item.rowindex == row.rowindex){
+            console.log('删除')
+            this.attinfos.splice(item,1)
+          }
+        })
+      })
+    },
+    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')
+    },
     onClose(){
     }
   }

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

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

+ 10 - 3
src/components/addTable/index.vue

@@ -12,7 +12,8 @@
                      size="small" class="input-with-select inline-16 layout_search__panel" clearable>
           </el-input>
         </div>
-        <table-detail :layout="tablecols" :data="list" :custom="true" :width="true" :height="tableHieght" minHeight="200px" fixedName="operation">
+        <table-detail :layout="tablecols" :data="list" :custom="true" :width="true" :height="tableHieght" minHeight="200px" fixedName="operation"
+                      @rowClick="rowClick">
           <template v-slot:customcol="scope">
             <div>
               {{scope.column.data[[scope.column.columnname]] || scope.column.columnname === 'operation'?scope.column.data[[scope.column.columnname]]:'--'}}
@@ -42,7 +43,7 @@
 <script>
 export default {
   name: "index",
-  props:['params','params1','type','placeholder','data'],
+  props:['params','params1','type','placeholder','data','name_charge'],
   data(){
     return {
       drawerVisible:false,
@@ -59,7 +60,7 @@ export default {
       this.drawerVisible = true
       if (this.type == '组织架构'){
         console.log(this.data,'data数据')
-        this.input = this.data.name_charge
+        this.input = this.name_charge
         this.depData()
       }
     },
@@ -88,6 +89,12 @@ export default {
       this.params.content.pageNumber = val
       this.listData()
     },
+    rowClick(data){
+      console.log('选择的责任人',data)
+      this.input = data.username
+      this.drawerVisible = false
+      this.$emit('rowClick',data)
+    },
     onClose(){}
   },
   created() {

+ 1 - 1
src/components/normal-basic-layout/details/modules/followUp/editLog.vue

@@ -152,7 +152,7 @@ export default {
         if (!valid) return false
         let resource = this.$route.matched[1].meta.title
         let content = {}
-        if (this.$route.path === '/projectChangeDetail' || $route.path === '/funnelProjectDetail'){
+        if (this.$route.path === '/projectChangeDetail' || this.$route.path === '/funnelProjectDetail'){
           content = {
             "sys_datafollowupid":this.data.sys_datafollowupid,
             "ownertable":this.ownertable,