editFollow.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <div class="follow" style="margin-right:10px">
  3. <el-button size="mini" type="text" @click="followBtn" :disabled="disabled">
  4. <svg t="1727070702944" class="icon" viewBox="0 0 1024 1024" style="vertical-align: middle" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12802" width="14" height="14"><path d="M319.122286 565.101714a8.265143 8.265143 0 0 0-1.609143 2.852572l-51.2 188.928a32.109714 32.109714 0 0 0 39.277714 39.350857l187.538286-51.2h0.658286a8.118857 8.118857 0 0 0 5.851428-2.413714l501.540572-501.467429a80.457143 80.457143 0 0 0 23.04-57.344 98.011429 98.011429 0 0 0-29.257143-68.681143l-47.396572-47.469714a98.157714 98.157714 0 0 0-68.681143-29.257143 80.457143 80.457143 0 0 0-57.856 23.698286L319.853714 563.712c-0.512 0.512-0.365714 1.170286-0.731428 1.755429m632.685714-373.028572l-49.810286 49.810286-80.969143-81.92 49.078858-49.078857a23.332571 23.332571 0 0 1 31.744 2.267428l47.396571 47.469715a25.819429 25.819429 0 0 1 7.753143 17.993142 19.090286 19.090286 0 0 1-5.412572 13.604572m-543.524571 380.342857l361.764571-361.545143 80.457143 82.066286-360.521143 361.252571z m-65.828571 146.724571l26.185142-95.963428 69.778286 69.778286z m641.170285-328.704a34.742857 34.742857 0 0 0-34.596571 34.669715v467.894857a44.470857 44.470857 0 0 1-44.470857 44.397714H113.590857a44.544 44.544 0 0 1-44.470857-44.397714V130.486857a44.544 44.544 0 0 1 44.470857-44.470857h509.366857a34.596571 34.596571 0 0 0 0-69.193143H108.324571A108.544 108.544 0 0 0-0.073143 125.220571v773.558858a108.544 108.544 0 0 0 108.397714 108.397714h801.353143a108.470857 108.470857 0 0 0 108.397715-108.397714V426.130286a34.669714 34.669714 0 0 0-34.596572-34.450286" fill="#999999" p-id="12803"></path></svg>
  5. <span style="color: #333333;font-size: 14px;margin-left: 5px;vertical-align: middle">{{$t(`编辑`)}}</span></el-button>
  6. <el-drawer :title="$t('线索跟进')" append-to-body :visible.sync="dialogVisible" size="600px" :before-close="handleClose" :show-close="false">
  7. <div class="drawer__panel">
  8. <el-form :model="param" :rules="rules" ref="ruleForm" :label-width="tool.onlyZh('110px')" class="demo-ruleForm"
  9. label-position="right">
  10. <el-form-item :label="$t('跟进时间')">
  11. <el-date-picker v-model="timer" type="datetime" format="yyyy-MM-dd HH:mm:ss" size="small">
  12. </el-date-picker>
  13. </el-form-item>
  14. <el-form-item :label="$t('跟进类型')" prop="followupmode">
  15. <el-select v-model="param.followupmode" :placeholder="$t('请选择方式')" size="small">
  16. <el-option v-for="(item,index) in followTypeList" :key="index" :label="$t(item.value)" :value="item.value">
  17. </el-option>
  18. </el-select>
  19. </el-form-item>
  20. <!-- <el-form-item label="本次跟进结果" prop="logtype">
  21. <el-radio-group v-model="param.logtype">
  22. <el-radio label="跟进">跟进</el-radio>
  23. </el-radio-group>
  24. </el-form-item> -->
  25. <el-form-item :label="$t('跟进内容')" prop="content" >
  26. <el-input type="textarea" v-model="param.content" size="small" :placeholder="$t('请填写跟进内容')"></el-input>
  27. </el-form-item>
  28. <!-- <div class="flex-align-center flex-between pionter" v-for="file in data.attinfo" :key="file.index">
  29. <div class="flex-align-center">
  30. <img width="38" :src="checkFileType(file.postfix) === 'file'?require('@/assets/file_icons/file.svg'):file.url" class="inline-16" alt="">
  31. <div class="file__link inline-16">
  32. <a :href="file.url">{{file.document}}</a>
  33. <p>{{(file.contentlength / 1024).toFixed(2)}}kb</p>
  34. </div>
  35. </div>
  36. <i style="color:red;" class="el-icon-delete" @click="deleteFile(file)"></i>
  37. </div>-->
  38. <file-item
  39. :auto="true"
  40. :isDownLoad="true"
  41. :isDelete='true'
  42. :fileData="data.attinfo"
  43. @deleteFile="handleRemove">
  44. </file-item>
  45. <upload
  46. ref="upload"
  47. @clickUpload="loading = true"
  48. @uploadEnd="loading = false"
  49. :folderid="folderid"
  50. @onSuccess="onSuccess"
  51. :bindData=" {ownertable: 'sat_ordercluefollowuplog', ownerid: data.sat_ordercluefollowuplogid,usetype: 'default'}"
  52. type="button">
  53. </upload>
  54. </el-form>
  55. </div>
  56. <div class="fixed__btn__panel">
  57. <el-button size="small" @click="dialogVisible = false" class="normal-btn-width" :disabled="loading">{{$t(`取 消`)}}</el-button>
  58. <el-button size="small" type="primary" @click="followAction" class="normal-btn-width" :loading="loading">{{$t(`确 定`)}}</el-button>
  59. </div>
  60. </el-drawer>
  61. </div>
  62. </template>
  63. <script>
  64. import upload from './upload'
  65. import FileItem from '@/SManagement/orderclue/components/file/index3'
  66. export default {
  67. name: "editFollow",
  68. components:{upload,FileItem},
  69. data () {
  70. return {
  71. loading:false,
  72. bindData:{},
  73. folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
  74. param: {
  75. "sat_orderclueid": 4,
  76. "content": "",
  77. "createdate":'',
  78. "followupmode": "", //当面拜访、电话沟通
  79. "logtype": "跟进", //跟进、成交、丢单、无效
  80. "competitor": "",
  81. "latitude":"",//经度,可选
  82. "longitude":"",//纬度,可选
  83. "address":"",//解析地址,
  84. "sat_ordercluefollowuplogid":0,//传0新增
  85. "resource":"销售线索"
  86. },
  87. timer: '',
  88. rules: {
  89. content: [
  90. { required: true, message: this.$t('内容不能为空'), trigger: 'blur' },
  91. ],
  92. followupmode: [
  93. { required: true, message: this.$t('内容不能为空'), trigger: 'blur' },
  94. ],
  95. logtype: [
  96. { required: true, message: this.$t('内容不能为空'), trigger: 'blur' },
  97. ],
  98. competitor: [
  99. { required: true, message: this.$t('内容不能为空'), trigger: 'blur' },
  100. ],
  101. },
  102. time: '',
  103. dialogVisible: false,
  104. followTypeList: []
  105. }
  106. },
  107. props: {
  108. detailInfo: {
  109. default () {
  110. return []
  111. },
  112. },
  113. position: {
  114. type: String
  115. },
  116. updataList: {
  117. type: Function
  118. },
  119. getDetail: {
  120. type: Function
  121. },
  122. disabled: Boolean,
  123. data:{}
  124. },
  125. watch: {
  126. dialogVisible(val) {
  127. if (!val) {
  128. this.$refs['ruleForm'].resetFields()
  129. this.$refs.upload.fileLinkList = []
  130. this.$refs.upload.fileList = []
  131. }
  132. }
  133. },
  134. computed: {
  135. },
  136. created () {
  137. /*this.getFollowType()*/
  138. this.timer = new Date()
  139. },
  140. methods: {
  141. async getFollowType () {
  142. let res = await this.$store.dispatch('optiontypeselect', 'followupmode')
  143. this.followTypeList = res.data
  144. },
  145. followBtn () {
  146. this.dialogVisible = true
  147. this.getFollowType()
  148. this.param = Object.assign({},this.param,this.data)
  149. },
  150. handleClose () {
  151. this.dialogVisible = false
  152. },
  153. followAction () {
  154. this.$refs.ruleForm.validate(async val => {
  155. if (!val) return
  156. this.loading = true
  157. this.param.sat_orderclueid = this.detailInfo.sat_orderclueid
  158. this.param.createdate = this.timer
  159. this.param.createdate = `${this.timer.getFullYear()}-${this.timer.getMonth() + 1}-${this.timer.getDate()} ${this.timer.getHours()}:${this.timer.getMinutes()}:${this.timer.getSeconds()}`
  160. let res = await this.$api.requested({
  161. "id":20221208100602,
  162. "content": this.param
  163. })
  164. if (res.code == 0){
  165. this.loading = false
  166. this.tool.showMessage(res,()=>{})
  167. }else {
  168. this.tool.showMessage(res,()=>{
  169. this.bindData = {
  170. "ownertable": 'sat_ordercluefollowuplog',
  171. "ownerid": res.data.sat_ordercluefollowuplogid,
  172. "usetype": 'default',
  173. }
  174. this.loading = false
  175. this.$refs['upload'].toUpload(() => {
  176. this.loading = false
  177. this.$emit('onSuccess')
  178. this.dialogVisible = false
  179. })
  180. })
  181. }
  182. })
  183. },
  184. onSuccess () {
  185. },
  186. checkFileType (type) {
  187. let arr = ['JPG','JPEG','PNG']
  188. if (arr.includes(type.toUpperCase())) {
  189. return 'img'
  190. } else {
  191. return 'file'
  192. }
  193. },
  194. async deleteFile (row) {
  195. const res = await this.$api.requested({
  196. "classname": "system.attachment.Attachment",
  197. "method": "deleteFileLink",
  198. "content": {
  199. "linksids":[row.linksid]
  200. }
  201. })
  202. this.tool.showMessage(res,()=>{
  203. /*this.queryLogs()*/
  204. })
  205. },
  206. handleRemove (index) {
  207. this.data.attinfo = this.data.attinfo.filter((e,idx)=>{
  208. if (idx !== index) {
  209. return e
  210. }
  211. })
  212. console.log(this.data.attinfo);
  213. this.fileLinkList = this.fileLinkList.filter((e,idx)=>{
  214. if (idx !== index) {
  215. return e
  216. }
  217. })
  218. },
  219. },
  220. }
  221. </script>
  222. <style scoped>
  223. .follow {
  224. display: inline-block;
  225. }
  226. /deep/.el-input,.el-select {
  227. width: 100%;
  228. }
  229. </style>