|
|
@@ -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(){
|
|
|
}
|
|
|
}
|