addLog.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <div>
  3. <el-button type="default" size="mini" @click="dialogFormVisible = true">新 建</el-button>
  4. <el-dialog title="创建跟进日志" width="600px" append-to-body :visible.sync="dialogFormVisible">
  5. <el-form :model="form" ref="form" label-position="top" label-width="80px">
  6. <el-form-item label="跟进日志" prop="content">
  7. <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 18 }" v-model="form.content" placeholder="请输入跟进日志" autocomplete="off"></el-input>
  8. </el-form-item>
  9. <el-form-item>
  10. <upload
  11. ref="upload"
  12. :folderid="folderid"
  13. @onSuccess="onSuccess"
  14. :bindData="bindData"
  15. type="button">
  16. </upload>
  17. <!-- <previewImage :image="{}" :deletebtn="true"></previewImage> -->
  18. </el-form-item>
  19. </el-form>
  20. <div slot="footer" class="dialog-footer">
  21. <el-button size="small" @click="dialogFormVisible = false">取 消</el-button>
  22. <el-button type="warning" size="small" @click="submitLog">保 存</el-button>
  23. </div>
  24. </el-dialog>
  25. </div>
  26. </template>
  27. <script>
  28. import upload from '@/components/upload/preview_upload.vue'
  29. import previewImage from '@/components/previewImage/index.vue'
  30. export default {
  31. props:['ownertable'],
  32. components:{
  33. upload,
  34. previewImage
  35. },
  36. data () {
  37. return {
  38. dialogFormVisible:false,
  39. form:{
  40. content:''
  41. },
  42. bindData:{},
  43. folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
  44. attachmentids:[]
  45. }
  46. },
  47. methods:{
  48. onSuccess(res) {
  49. this.attachmentids = [...this.attachmentids,...res.data.attachmentids]
  50. },
  51. async submitLog () {
  52. const res = await this.$api.requested({
  53. "id": 20220930121601,
  54. "content": {
  55. "sys_datafollowupid":0,
  56. "ownertable":this.ownertable,
  57. "ownerid":this.$route.query.id,
  58. "type":"",
  59. "content":this.form.content
  60. }
  61. })
  62. this.tool.showMessage(res,()=>{
  63. this.bindData = {
  64. "ownertable": 'sys_datafollowup',
  65. "ownerid": res.data.sys_datafollowupid,
  66. "usetype": 'default',
  67. }
  68. this.$refs['form'].resetFields();
  69. this.$refs['upload'].toUpload()
  70. })
  71. },
  72. onSuccess() {
  73. this.$emit('onSuccess')
  74. this.dialogFormVisible = false
  75. }
  76. }
  77. }
  78. </script>
  79. <style>
  80. </style>
  81. <style scoped>
  82. </style>