examine.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <div>
  3. <h3>{{ title }}</h3>
  4. <el-divider />
  5. <div class="diy-table-1">
  6. <el-row :gutter="0">
  7. <el-col :xs="24" :sm="24" :lg="24" class="item">
  8. <div class="label">登录状态</div>
  9. <div class="value">
  10. <el-radio-group v-model="formData.loginStatus">
  11. <el-radio v-for="item in engType" :key="item.value" :label="item.value">
  12. {{ item.label }}
  13. </el-radio>
  14. </el-radio-group>
  15. </div>
  16. </el-col>
  17. <el-col v-if="formData.loginStatus === 'FAIL'" :xs="24" :sm="24" :lg="24" class="item">
  18. <div class="label" style="height: auto">选择登录成功项目</div>
  19. <div class="value" style="height: 100%; display: block">
  20. <el-col :span="7" class="flex-box">
  21. <div class="flex-box-title">项目编号{{ formData.loginStatus === 'REJECT' ? '*' : '' }}</div>
  22. <el-input
  23. v-model="formData.successLoginProject"
  24. class="my-input"
  25. placeholder="请填写"
  26. size="mini"
  27. clearable
  28. >
  29. <el-button slot="append" @click="handleFocus">引入</el-button>
  30. </el-input>
  31. </el-col>
  32. <el-col :span="7" class="flex-box">
  33. <div class="flex-box-title">经销商编号</div>
  34. <el-input v-model="formData.customerNumber" class="my-input" placeholder="请填写" size="mini" clearable />
  35. </el-col>
  36. <el-col :span="7" class="flex-box">
  37. <div class="flex-box-title">经销商名称</div>
  38. <el-input v-model="formData.customerName" class="my-input" placeholder="请填写" size="mini" clearable />
  39. </el-col>
  40. <el-col :span="7" class="flex-box">
  41. <div class="flex-box-title">业务员编号</div>
  42. <el-input v-model="formData.serviceNumber" class="my-input" placeholder="请填写" size="mini" clearable />
  43. </el-col>
  44. <el-col :span="7" class="flex-box">
  45. <div class="flex-box-title">业务员名称</div>
  46. <el-input v-model="formData.serviceName" class="my-input" placeholder="请填写" size="mini" clearable />
  47. </el-col>
  48. </div>
  49. </el-col>
  50. <el-col :xs="12" :sm="12" :lg="12" class="item">
  51. <div class="label">审核备注{{ formData.loginStatus === 'REJECT' ? '*' : '' }}</div>
  52. <div class="value">
  53. <el-select v-model="formData.examineNote" placeholder="请选择" size="mini" clearable style="width: 100%">
  54. <el-option
  55. v-for="item in commonData.dict['TRADE_EXAMINE_NOTE']"
  56. :key="item.value"
  57. :label="item.label"
  58. :value="item.value"
  59. />
  60. </el-select>
  61. <el-input
  62. v-model="formData.note"
  63. placeholder="请填写"
  64. :disabled="formData.examineNote !== 'NOTE_3' "
  65. size="mini"
  66. clearable
  67. />
  68. </div>
  69. </el-col>
  70. <el-col :xs="12" :sm="12" :lg="12" class="item">
  71. <div class="label">共同跟进项目编号</div>
  72. <div class="value">
  73. <el-input v-model="formData.commonFollowProject" placeholder="请填写" size="mini" clearable />
  74. </div>
  75. </el-col>
  76. <el-col :xs="24" :sm="24" :lg="24" class="item">
  77. <div class="label" style="height: auto">审核上传</div>
  78. <div class="value" style="height: auto">
  79. <ImageUpload v-if="module !== 'detail'" class="mg-b" :file-list="formData.files" />
  80. <template v-else>
  81. <div
  82. v-for="item in formData.files"
  83. :key="item.fileUrl"
  84. style="display: flex; width: 120px; height: 120px; align-items: center; justify-content: center"
  85. >
  86. <el-image
  87. v-if="checkFileType(item.fileUrl) == 'image'"
  88. ref="img"
  89. :src="$imageUrl + item.fileUrl"
  90. fit="cover"
  91. :preview-src-list="[$imageUrl + item.fileUrl]"
  92. class="elImageClose"
  93. />
  94. <div
  95. style="display: flex; width: 120px; height: 120px; align-items: center; justify-content: center;cursor: pointer;"
  96. @click="openPdf(item)"
  97. >
  98. <img v-if="checkFileType(item.fileUrl) == 'word'" class="file" src="@/assets/common/word.png">
  99. <img v-if="checkFileType(item.fileUrl) == 'excel'" class="file" src="@/assets/common/excel.png">
  100. <img v-if="checkFileType(item.fileUrl) == 'ppt'" class="file" src="@/assets/common/ppt.png">
  101. <img
  102. v-if="checkFileType(item.fileUrl) == 'pdf'"
  103. class="file"
  104. style="cursor: pointer"
  105. src="@/assets/common/pdf.png"
  106. >
  107. <img v-if="checkFileType(item.fileUrl) == 'file'" class="file aaa" src="@/assets/common/zip.jpeg">
  108. </div>
  109. </div>
  110. </template>
  111. <div style="margin-left: 20px">注:可上传文件、附件</div>
  112. </div>
  113. </el-col>
  114. </el-row>
  115. </div>
  116. <!-- -->
  117. <LoginSuccess
  118. :page-type="pageType"
  119. :form-data="formData"
  120. :show-dialog="showDialog"
  121. @success="handleSuccess"
  122. @cancel="handleCancel"
  123. />
  124. </div>
  125. </template>
  126. <script>
  127. import ImageUpload from '@/components/Common/image-upload.vue'
  128. import LoginSuccess from './loginSuccess.vue'
  129. export default {
  130. components: {
  131. ImageUpload,
  132. LoginSuccess
  133. },
  134. props: {
  135. title: {
  136. type: String,
  137. default: '审核信息'
  138. },
  139. formData: {
  140. type: Object,
  141. default: () => ({})
  142. },
  143. // 页面类型
  144. pageType: {
  145. type: String,
  146. default: 'frock'
  147. },
  148. // 功能类型
  149. module: {
  150. type: String,
  151. default: 'add'
  152. },
  153. commonData: {
  154. type: Object,
  155. default: () => {}
  156. }
  157. },
  158. data() {
  159. return {
  160. engType: [
  161. { label: '登录成功', value: 'OK' },
  162. { label: '登录不成功', value: 'FAIL' },
  163. { label: '驳回', value: 'REJECT' }
  164. ],
  165. showDialog: false
  166. }
  167. },
  168. created() {
  169. console.log(this.formData, this.module, 8888)
  170. },
  171. methods: {
  172. handleSuccess(val) {
  173. console.log(val)
  174. const res = val[0]
  175. this.formData.successLoginProject = res.projectNo
  176. this.formData.customerNumber = res.customerNumber
  177. this.formData.customerName = res.customerName
  178. this.formData.serviceName = res.serviceName
  179. this.formData.serviceNumber = res.serviceNumber
  180. },
  181. handleCancel() {
  182. this.showDialog = false
  183. },
  184. handleFocus() {
  185. this.showDialog = true
  186. },
  187. onSbumit() {},
  188. // 检查文件类型
  189. checkFileType(url) {
  190. if (!url) return ''
  191. const fileSuffix = url.substring(url.lastIndexOf('.') + 1)
  192. if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
  193. return 'image'
  194. } else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
  195. return 'word'
  196. } else if (['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
  197. return 'excel'
  198. } else if (['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
  199. return 'ppt'
  200. } else if (['pdf'].includes(fileSuffix)) {
  201. return 'pdf'
  202. } else if (['zip', 'rar', 'gz', 'apk'].includes(fileSuffix)) {
  203. return 'file'
  204. } else {
  205. return ''
  206. }
  207. },
  208. openPdf(item) {
  209. console.log(item, 999)
  210. const link = document.createElement('a')
  211. link.style.display = 'none'
  212. link.href = this.$imageUrl + item.fileUrl
  213. link.download = item.fileName
  214. document.body.appendChild(link)
  215. link.click()
  216. document.body.removeChild(link)
  217. }
  218. }
  219. }
  220. </script>
  221. <style lang="scss" scoped>
  222. .diy-table-1 .item .label {
  223. width: 150px;
  224. }
  225. ::v-deep .el-radio {
  226. margin-right: 120px;
  227. }
  228. .flex-box {
  229. display: flex;
  230. align-items: center;
  231. margin: 5px 20px;
  232. &-title {
  233. width: 100px;
  234. }
  235. }
  236. ::v-deep .my-input > input {
  237. padding-left: 10px !important;
  238. border: 1px solid #dcdfe6 !important;
  239. }
  240. .mg-b {
  241. margin: 10px 0;
  242. }
  243. ::v-deep .el-image-viewer__close {
  244. top: 106px;
  245. right: 40px;
  246. width: 40px;
  247. height: 40px;
  248. font-size: 40px;
  249. }
  250. </style>