index.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <div>
  3. <Des :list="desList" @onClick="imgClick" />
  4. <a-modal :visible="previewVisible" :footer="null" @cancel="cancelImg">
  5. <img alt="预览附件" style="width: 100%" :src="previewImage" />
  6. </a-modal>
  7. </div>
  8. </template>
  9. <script lang="ts">
  10. import { defineComponent, PropType, watchEffect } from 'vue';
  11. import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
  12. import { getStatusName } from '@/common/constants/enumsName';
  13. import { formatValue } from '@/common/methods';
  14. import { getCardTypeEnumItemName } from '@/common/constants/enumsName';
  15. import { Des, DescriptionsList, handleDesList } from '@/common/components/commonDes';
  16. import { handlePreviewImg } from '@/common/setup/upload';
  17. import { isPingAnOem, isQianHaiJin } from '@/common/config/projectName';
  18. import { QhjCustomer } from '@/services/go/ermcp/qhj/interface';
  19. import { formatTime } from '@/common/methods';
  20. export default defineComponent({
  21. name: 'custom-detail-desc',
  22. components: { Des },
  23. props: {
  24. selectedRow: {
  25. type: Object as PropType<QhjCustomer>,
  26. default: {},
  27. },
  28. },
  29. setup(props) {
  30. console.log('dddd', props.selectedRow);
  31. function isPersonal() {
  32. return props.selectedRow.userinfotype === 1;
  33. }
  34. const { desList, getDesList } = handleDesList();
  35. // 预览附件
  36. const { previewVisible, previewImage, cancelImg, previewImg, getImgName } = handlePreviewImg();
  37. //
  38. function imgClick({ label }: DescriptionsList) {
  39. const { proxystatementurl, cardfrontphotourl, cardbackphotourl } = props.selectedRow;
  40. switch (label) {
  41. case '营业执照':
  42. previewImg(proxystatementurl);
  43. break;
  44. case '身份证正面照':
  45. previewImg(cardfrontphotourl);
  46. break;
  47. case '身份证反面照':
  48. previewImg(cardbackphotourl);
  49. break;
  50. }
  51. }
  52. watchEffect(() => {
  53. // if (props.selectedRow.customername) {
  54. const data = props.selectedRow;
  55. if (isPingAnOem()) {
  56. const person = [
  57. { label: '客户类型', value: '个人' },
  58. { label: '姓名', value: formatValue(data.username) },
  59. { label: '点价联系人', value: formatValue(data.contactname) },
  60. { label: '联系人手机号', value: formatValue(data.mobile) },
  61. { label: '状态', value: getStatusName(data.status), className: 'green' },
  62. ];
  63. const company = [
  64. { label: '客户类型', value: '企业' },
  65. { label: '企业名称', value: formatValue(data.customername) },
  66. { label: '点价联系人', value: formatValue(data.contactname) },
  67. { label: '联系人手机号', value: formatValue(data.mobile) },
  68. { label: '状态', value: getStatusName(data.status), className: 'green' },
  69. ];
  70. getDesList(isPersonal() ? person : company);
  71. } else if (isQianHaiJin()) {
  72. // 个人
  73. const person = [
  74. { label: '所属机构', value: formatValue(data.parentusername) },
  75. { label: '所属客户经理', value: formatValue(data.brokername) },
  76. { label: '客户类型', value: '个人' },
  77. { label: '姓名', value: formatValue(data.username) },
  78. { label: '性别', value: data.sex === 1 ? '男' : data.sex === 0 ? '女' : '--' },
  79. { label: '生日', value: formatValue(formatTime(data.birthday, 'd')) },
  80. { label: '身份证号码', value: formatValue(data.cardnum) },
  81. { label: '手机号码', value: formatValue(data.mobile) },
  82. { label: '身份证正面照', value: formatValue(getImgName(data.cardfrontphotourl)), className: 'blue' },
  83. { label: '身份证反面照', value: formatValue(getImgName(data.cardbackphotourl)), className: 'blue' },
  84. { label: '邮箱', value: formatValue(data.email) },
  85. { label: '联系电话', value: formatValue(data.telphone) },
  86. { label: '通讯地址', value: formatValue(data.provincename + data.cityname + data.districtname + data.address) },
  87. { label: '备注', value: formatValue(data.remark) },
  88. ];
  89. // 企业
  90. const company = [
  91. { label: '所属机构', value: formatValue(data.parentusername) },
  92. { label: '所属客户经理', value: formatValue(data.brokername) },
  93. { label: '客户类型', value: '企业' },
  94. { label: '企业名称', value: data.customername },
  95. { label: '企业简称', value: formatValue(data.nickname) },
  96. { label: '证件类型', value: getCardTypeEnumItemName(data.cardtype) },
  97. { label: '法定代表人', value: formatValue(data.legalpersonname) },
  98. { label: '证件号码', value: formatValue(data.cardnum) },
  99. { label: '纳税人识别号', value: formatValue(data.taxpayernum) },
  100. { label: '营业执照', value: formatValue(getImgName(data.proxystatementurl)), className: 'blue' },
  101. { label: '联系人', value: formatValue(data.contactname) },
  102. { label: '联系人手机号', value: formatValue(data.mobile) },
  103. { label: '联系电话', value: formatValue(data.telphone) },
  104. { label: '状态', value: getStatusName(data.status), className: 'green' },
  105. { label: '通讯地址', value: formatValue(data.provincename + data.cityname + data.districtname + data.address) },
  106. { label: '备注', value: formatValue(data.remark) },
  107. ];
  108. getDesList(isPersonal() ? person : company);
  109. } else {
  110. // 个人
  111. const person = [
  112. { label: '客户类型', value: '个人' },
  113. { label: '姓名', value: formatValue(data.username) },
  114. { label: '身份证号码', value: formatValue(data.cardnum) },
  115. { label: '手机号码', value: formatValue(data.mobile) },
  116. { label: '身份证正面照', value: formatValue(getImgName(data.cardfrontphotourl)), className: 'blue' },
  117. { label: '身份证反面照', value: formatValue(getImgName(data.cardbackphotourl)), className: 'blue' },
  118. { label: '邮箱', value: formatValue(data.email) },
  119. { label: '联系电话', value: formatValue(data.telphone) },
  120. { label: '通讯地址', value: formatValue(data.provincename + data.cityname + data.districtname + data.address) },
  121. { label: '备注', value: formatValue(data.remark) },
  122. ];
  123. // 企业
  124. const company = [
  125. { label: '客户类型', value: '企业' },
  126. { label: '企业名称', value: data.customername },
  127. { label: '企业简称', value: formatValue(data.nickname) },
  128. { label: '证件类型', value: getCardTypeEnumItemName(data.cardtype) },
  129. { label: '法定代表人', value: formatValue(data.legalpersonname) },
  130. { label: '证件号码', value: formatValue(data.cardnum) },
  131. { label: '纳税人识别号', value: formatValue(data.taxpayernum) },
  132. { label: '营业执照', value: formatValue(getImgName(data.proxystatementurl)), className: 'blue' },
  133. { label: '联系人', value: formatValue(data.contactname) },
  134. { label: '联系人手机号', value: formatValue(data.mobile) },
  135. { label: '联系电话', value: formatValue(data.telphone) },
  136. { label: '状态', value: getStatusName(data.status), className: 'green' },
  137. { label: '通讯地址', value: formatValue(data.provincename + data.cityname + data.districtname + data.address) },
  138. { label: '备注', value: formatValue(data.remark) },
  139. ];
  140. getDesList(isPersonal() ? person : company);
  141. // }
  142. }
  143. });
  144. return {
  145. desList,
  146. previewVisible,
  147. previewImage,
  148. cancelImg,
  149. imgClick,
  150. };
  151. },
  152. });
  153. </script>
  154. <style lang="less">
  155. .custom-detail {
  156. .ant-form.inlineForm {
  157. margin-top: 20px;
  158. }
  159. .upload {
  160. .look {
  161. margin-left: 0;
  162. }
  163. }
  164. }
  165. </style>;