examine.vue 11 KB

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