examine.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  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. <template v-if="isTradeExaminer">
  33. <el-col :span="7" class="flex-box">
  34. <div class="flex-box-title">经销商编号</div>
  35. <el-input
  36. v-model="formData.customerNumber2"
  37. class="my-input"
  38. placeholder="请填写"
  39. size="mini"
  40. clearable
  41. />
  42. </el-col>
  43. <el-col :span="7" class="flex-box">
  44. <div class="flex-box-title">经销商名称</div>
  45. <el-input v-model="formData.customerName2" class="my-input" placeholder="请填写" size="mini" clearable />
  46. </el-col>
  47. </template>
  48. <el-col :span="7" class="flex-box">
  49. <div class="flex-box-title">业务员编号</div>
  50. <el-input v-model="formData.serviceNumber2" class="my-input" placeholder="请填写" size="mini" clearable />
  51. </el-col>
  52. <el-col :span="7" class="flex-box">
  53. <div class="flex-box-title">业务员名称</div>
  54. <el-input v-model="formData.serviceName2" class="my-input" placeholder="请填写" size="mini" clearable />
  55. </el-col>
  56. </div>
  57. </el-col>
  58. <el-col :xs="12" :sm="12" :lg="12" class="item">
  59. <div class="label">审核备注{{ formData.loginStatus === 'REJECT' ? '*' : '' }}</div>
  60. <div class="value">
  61. <el-select v-if="!['frock', 'cross'].includes(pageType)" v-model="formData.examineNote" placeholder="请选择" size="mini" clearable style="width: 100%">
  62. <el-option
  63. v-for="item in commonData.dict['TRADE_EXAMINE_NOTE']"
  64. :key="item.value"
  65. :label="item.label"
  66. :value="item.value"
  67. />
  68. </el-select>
  69. <el-input
  70. v-model="formData.note"
  71. placeholder="请填写"
  72. size="mini"
  73. clearable
  74. />
  75. </div>
  76. </el-col>
  77. <el-col :xs="12" :sm="12" :lg="12" class="item">
  78. <div class="label">共同跟进项目编号</div>
  79. <div class="value">
  80. <el-input v-model="formData.commonFollowProject" placeholder="请填写" size="mini" clearable />
  81. </div>
  82. </el-col>
  83. <el-col :xs="24" :sm="24" :lg="24" class="item">
  84. <div class="label" style="height: auto">审核上传</div>
  85. <div class="value" style="height: auto">
  86. <ImageUpload v-if="module !== 'detail'" class="mg-b" :file-list="formData.files" />
  87. <template v-else>
  88. <div
  89. v-for="item in formData.files"
  90. :key="item.fileUrl"
  91. style="display: flex; width: 120px; height: 120px; align-items: center; justify-content: center"
  92. >
  93. <el-image
  94. v-if="checkFileType(item.fileUrl) == 'image'"
  95. ref="img"
  96. :src="$imageUrl + item.fileUrl"
  97. fit="cover"
  98. :preview-src-list="[$imageUrl + item.fileUrl]"
  99. class="elImageClose"
  100. />
  101. <div
  102. style="
  103. display: flex;
  104. width: 120px;
  105. height: 120px;
  106. align-items: center;
  107. justify-content: center;
  108. cursor: pointer;
  109. "
  110. @click="openPdf(item)"
  111. >
  112. <img v-if="checkFileType(item.fileUrl) == 'word'" class="file" src="@/assets/common/word.png">
  113. <img v-if="checkFileType(item.fileUrl) == 'excel'" class="file" src="@/assets/common/excel.png">
  114. <img v-if="checkFileType(item.fileUrl) == 'ppt'" class="file" src="@/assets/common/ppt.png">
  115. <img
  116. v-if="checkFileType(item.fileUrl) == 'pdf'"
  117. class="file"
  118. style="cursor: pointer"
  119. src="@/assets/common/pdf.png"
  120. >
  121. <img v-if="checkFileType(item.fileUrl) == 'file'" class="file aaa" src="@/assets/common/zip.jpeg">
  122. </div>
  123. </div>
  124. </template>
  125. <div style="margin-left: 20px">注:可上传文件、附件</div>
  126. </div>
  127. </el-col>
  128. </el-row>
  129. </div>
  130. <!-- -->
  131. <LoginSuccess
  132. :page-type="pageType"
  133. :form-data="formData"
  134. :show-dialog="showDialog"
  135. @success="handleSuccess"
  136. @cancel="handleCancel"
  137. />
  138. </div>
  139. </template>
  140. <script>
  141. import { getLoginHomeDecorationList } from '@/api/homeDecoration'
  142. import { getLoginCrossDistrictList } from '@/api/crossDistrict'
  143. import { getLoginFrockList } from '@/api/frock'
  144. import { mapGetters } from 'vuex'
  145. import ImageUpload from '@/components/Common/image-upload.vue'
  146. import LoginSuccess from './loginSuccess.vue'
  147. export default {
  148. components: {
  149. ImageUpload,
  150. LoginSuccess
  151. },
  152. props: {
  153. title: {
  154. type: String,
  155. default: '审核信息'
  156. },
  157. formData: {
  158. type: Object,
  159. default: () => ({})
  160. },
  161. // 页面类型
  162. pageType: {
  163. type: String,
  164. default: 'frock'
  165. },
  166. // 功能类型
  167. module: {
  168. type: String,
  169. default: 'add'
  170. },
  171. commonData: {
  172. type: Object,
  173. default: () => {}
  174. }
  175. },
  176. data() {
  177. return {
  178. engType: [
  179. { label: '登录成功', value: 'OK' },
  180. { label: '登录不成功', value: 'FAIL' },
  181. { label: '驳回', value: 'REJECT' }
  182. ],
  183. showDialog: false
  184. }
  185. },
  186. computed: {
  187. ...mapGetters(['isTradeExaminer'])
  188. },
  189. watch: {
  190. async 'formData.id'(newValue, oldValue) {
  191. console.log(3333)
  192. this.getData()
  193. }
  194. },
  195. methods: {
  196. handleSuccess(val) {
  197. const res = val[0]
  198. this.formData.successLoginProject = res.projectNo
  199. this.formData.customerNumber2 = res.customerNumber
  200. this.formData.customerName2 = res.customerName
  201. this.formData.serviceName2 = res.serviceName
  202. this.formData.serviceNumber2 = res.serviceNumber
  203. },
  204. handleCancel() {
  205. this.showDialog = false
  206. },
  207. handleFocus() {
  208. this.showDialog = true
  209. },
  210. onSbumit() {},
  211. // 检查文件类型
  212. checkFileType(url) {
  213. if (!url) return ''
  214. const fileSuffix = url.substring(url.lastIndexOf('.') + 1)
  215. if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
  216. return 'image'
  217. } else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
  218. return 'word'
  219. } else if (['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
  220. return 'excel'
  221. } else if (['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
  222. return 'ppt'
  223. } else if (['pdf'].includes(fileSuffix)) {
  224. return 'pdf'
  225. } else if (['zip', 'rar', 'gz', 'apk'].includes(fileSuffix)) {
  226. return 'file'
  227. } else {
  228. return ''
  229. }
  230. },
  231. openPdf(item) {
  232. console.log(item, 999)
  233. const link = document.createElement('a')
  234. link.style.display = 'none'
  235. link.href = this.$imageUrl + item.fileUrl
  236. link.download = item.fileName
  237. document.body.appendChild(link)
  238. link.click()
  239. document.body.removeChild(link)
  240. },
  241. getData() {
  242. if (!this.formData.successLoginProject) return
  243. const params = {
  244. pageNum: 1,
  245. pageSize: -1,
  246. params: [
  247. {
  248. param: 'a.project_no',
  249. compare: 'like',
  250. value: this.formData.successLoginProject
  251. }
  252. ]
  253. }
  254. const objFn = {
  255. home: getLoginHomeDecorationList,
  256. cross: getLoginCrossDistrictList,
  257. frock: getLoginFrockList
  258. }
  259. objFn[this.pageType](params).then(res => {
  260. if (res.data.records && res.data.records.length) {
  261. this.formData.customerNumber2 = res.data.records[0].customerNumber
  262. this.formData.customerName2 = res.data.records[0].customerName
  263. this.formData.serviceName2 = res.data.records[0].serviceName
  264. this.formData.serviceNumber2 = res.data.records[0].serviceNumber
  265. }
  266. })
  267. }
  268. }
  269. }
  270. </script>
  271. <style lang="scss" scoped>
  272. .diy-table-1 {
  273. border: 1px solid #cccc;
  274. }
  275. .diy-table-1 .item {
  276. border-bottom: 1px solid #ccc;
  277. }
  278. .diy-table-1 .item .label {
  279. width: 150px;
  280. border-right: 1px solid #ccc;
  281. }
  282. .diy-table-1 .item .value{
  283. border-right: 1px solid #ccc;
  284. }
  285. ::v-deep .el-radio {
  286. margin-right: 120px;
  287. }
  288. .flex-box {
  289. display: flex;
  290. align-items: center;
  291. margin: 5px 20px;
  292. &-title {
  293. width: 100px;
  294. }
  295. }
  296. ::v-deep .my-input > input {
  297. padding-left: 10px !important;
  298. border: 1px solid #dcdfe6 !important;
  299. }
  300. .mg-b {
  301. margin: 10px 0;
  302. }
  303. ::v-deep .el-image-viewer__close {
  304. top: 106px;
  305. right: 40px;
  306. width: 40px;
  307. height: 40px;
  308. font-size: 40px;
  309. }
  310. ::v-deep .el-radio__inner {
  311. border: 2px solid #ccc;
  312. border-radius: 100%;
  313. width: 14px;
  314. height: 14px;
  315. background-color: #FFF;
  316. cursor: pointer;
  317. -webkit-box-sizing: border-box;
  318. box-sizing: border-box;
  319. }
  320. </style>