|
|
@@ -100,6 +100,23 @@
|
|
|
</el-popover>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item :label="$t(`上传附件`)+':'">
|
|
|
+ <uploadFile
|
|
|
+ @uploadGet="loading = true"
|
|
|
+ ref="uploadRef"
|
|
|
+ class="inline-16"
|
|
|
+ :folderid="folderid"
|
|
|
+ :bindData="{
|
|
|
+ ownertable: 'sys_task',
|
|
|
+ ownerid: ownerid,
|
|
|
+ usetype: 'default',
|
|
|
+ }"
|
|
|
+ :ownerid="ownerid"
|
|
|
+ @onSuccess="uploadSuccess"
|
|
|
+ ></uploadFile>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
</el-form>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
@@ -118,12 +135,14 @@ import member from '@/template/menber/index'
|
|
|
import upload from '@/components/upload/preview_upload.vue';
|
|
|
|
|
|
import followData from "@/HManagement/task/components/followData";
|
|
|
+import uploadFile from "@/template/upload/index";
|
|
|
export default {
|
|
|
props:['ownertable','status','typeTask','followData','disabled'],
|
|
|
components:{
|
|
|
upload,
|
|
|
member,
|
|
|
- followData
|
|
|
+ followData,
|
|
|
+ uploadFile
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
@@ -196,7 +215,12 @@ export default {
|
|
|
"ownertable": "",
|
|
|
"ownerid": ""
|
|
|
},
|
|
|
- }
|
|
|
+ },
|
|
|
+ attachmentids:[],
|
|
|
+ loading:false,
|
|
|
+ ownerid: "000001",
|
|
|
+ listFile:[],
|
|
|
+ linksids:[]
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
@@ -276,6 +300,7 @@ export default {
|
|
|
"usetype": 'default',
|
|
|
}
|
|
|
this.$refs['upload'].toUpload()*/
|
|
|
+ this.batchBinding(res.data.sys_taskid)
|
|
|
this.$emit('onSuccess')
|
|
|
this.dialogTableVisible = false
|
|
|
this.refresh()
|
|
|
@@ -286,8 +311,8 @@ export default {
|
|
|
refresh () {
|
|
|
this.form = {
|
|
|
"sys_taskid":0,
|
|
|
- "title":this.$t('任务标题'),
|
|
|
- "remarks":this.$t('任务说明'),
|
|
|
+ "title":'',
|
|
|
+ "remarks":'',
|
|
|
"starttime":"",
|
|
|
"remindday":0,
|
|
|
"ownertable":"",
|
|
|
@@ -323,6 +348,12 @@ export default {
|
|
|
this.leaderShow = false
|
|
|
this.dialogTableVisible = false
|
|
|
this.form.remarks = ''
|
|
|
+ this.$refs.uploadRef.listFile = []
|
|
|
+ this.$refs.uploadRef.filelist = []
|
|
|
+ this.$refs.uploadRef.count = 0
|
|
|
+ this.$refs.uploadRef.oldCount = 0
|
|
|
+ this.$refs.uploadRef.$refs.uploadMy.clearFiles()
|
|
|
+ this.batchDeletion()
|
|
|
},
|
|
|
follow(content,type,contacts){
|
|
|
if (this.typeTask === '我的客户' || this.typeTask === '项目商机' || this.typeTask === '公海客户'){
|
|
|
@@ -346,7 +377,61 @@ export default {
|
|
|
this.form.remarks = content
|
|
|
}
|
|
|
|
|
|
- }
|
|
|
+ },
|
|
|
+ async uploadSuccess(res1){
|
|
|
+ this.listFile = []
|
|
|
+ this.attachmentids = res1.data.attachmentids
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ classname: "system.attachment.Attachment",
|
|
|
+ method: "queryFileLink",
|
|
|
+ content: {
|
|
|
+ ownertable: "sys_task",
|
|
|
+ ownerid: this.ownerid,
|
|
|
+ usetype: "",
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.$refs.uploadRef.listFile = res.data.map((item) => {
|
|
|
+ return {
|
|
|
+ name: item.document,
|
|
|
+ url: item.url,
|
|
|
+ linksid: item.linksid,
|
|
|
+ attachmentid:item.attachmentid
|
|
|
+ };
|
|
|
+ });
|
|
|
+ this.listFile = this.$refs.uploadRef.listFile
|
|
|
+ this.loading = false;
|
|
|
+ },
|
|
|
+ /*批量绑定*/
|
|
|
+ async batchBinding(id){
|
|
|
+ this.attachmentids = []
|
|
|
+ this.listFile.forEach((item,index)=>{
|
|
|
+ this.attachmentids[index] = item.attachmentid
|
|
|
+ })
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "classname": "system.attachment.Attachment",
|
|
|
+ "method": "createFileLink",
|
|
|
+ "content": {
|
|
|
+ "ownertable": "sys_task",
|
|
|
+ "ownerid": id,
|
|
|
+ "usetype": "default",
|
|
|
+ "attachmentids": this.attachmentids
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /*批量删除*/
|
|
|
+ async batchDeletion(){
|
|
|
+ this.linksids = []
|
|
|
+ this.listFile.forEach((item,index)=>{
|
|
|
+ this.linksids[index] = item.linksid
|
|
|
+ })
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "classname": "system.attachment.Attachment",
|
|
|
+ "method": "deleteFileLink",
|
|
|
+ "content": {
|
|
|
+ "linksids": this.linksids
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
/*onCancel (done) {
|
|
|
console.log("关闭")
|
|
|
this.assistShow = false
|