contactDetailDialog.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  1. <template>
  2. <ele-modal
  3. custom-class="ele-dialog-form long-dialog-form"
  4. :centered="true"
  5. v-if="visible"
  6. :visible.sync="visible"
  7. :title="title"
  8. :close-on-click-modal="false"
  9. width="80%"
  10. @close="cancel"
  11. >
  12. <el-tabs v-model="activeName" type="card">
  13. <el-tab-pane label="基本信息" name="base">
  14. <el-form
  15. label-width="160px"
  16. ref="formRef"
  17. :model="form"
  18. style="margin-top: 30px"
  19. >
  20. <el-row>
  21. <el-col :span="8">
  22. <el-form-item
  23. label="客户分类:"
  24. prop="categoryId"
  25. >
  26. {{form.categoryName}}
  27. </el-form-item>
  28. </el-col>
  29. <el-col :span="8">
  30. <el-form-item label="客户名称:" prop="name">
  31. {{form.name}}
  32. </el-form-item>
  33. </el-col>
  34. <el-col :span="8">
  35. <el-form-item label="客户代号:" prop="serialNo">
  36. {{form.serialNo}}
  37. </el-form-item>
  38. </el-col>
  39. <el-col :span="8">
  40. <el-form-item label="客户简称:" prop="simpleName">
  41. {{form.simpleName}}
  42. </el-form-item>
  43. </el-col>
  44. <el-col :span="8">
  45. <el-form-item label="授信额度:" prop="authorizationLimit">
  46. {{form.authorizationLimit}}
  47. </el-form-item>
  48. </el-col>
  49. <el-col :span="8">
  50. <el-form-item label="单位电话:" prop="phone">
  51. {{form.phone}}
  52. </el-form-item>
  53. </el-col>
  54. <el-col :span="8">
  55. <el-form-item label="地址:" prop="addressId">
  56. {{form.addressName}}
  57. </el-form-item>
  58. </el-col>
  59. <el-col :span="8">
  60. <el-form-item label="详细地址:" prop="address">
  61. {{form.address}}
  62. </el-form-item>
  63. </el-col>
  64. <el-col :span="8">
  65. <el-form-item
  66. label="统一社会信用代码:"
  67. prop="unifiedSocialCreditCode"
  68. >
  69. {{form.unifiedSocialCreditCode}}
  70. </el-form-item>
  71. </el-col>
  72. <el-col :span="8">
  73. <el-form-item label="所属行业:" prop="industry">
  74. {{form.industryFullName}}
  75. </el-form-item>
  76. </el-col>
  77. <el-col :span="8">
  78. <el-form-item label="企业类型:" prop="companyCategoryId">
  79. {{form.companyCategoryName}}
  80. </el-form-item>
  81. </el-col>
  82. <el-col :span="8">
  83. <el-form-item label="登记日期:" prop="registerDate">
  84. {{form.registerDate}}
  85. </el-form-item>
  86. </el-col>
  87. <el-col :span="8">
  88. <el-form-item label="经营范围:" prop="businessScope">
  89. {{form.businessScope}}
  90. </el-form-item>
  91. </el-col>
  92. <el-col :span="8">
  93. <el-form-item label="主营产品:" prop="mainProduct">
  94. {{form.mainProduct}}
  95. </el-form-item>
  96. </el-col>
  97. <el-col :span="8">
  98. <el-form-item
  99. label="上级单位:"
  100. prop="hasParentGroup"
  101. >
  102. {{ form.parentName }}
  103. </el-form-item>
  104. </el-col>
  105. <el-col :span="8">
  106. <el-form-item prop="businessLicenseFile" label="营业执照附件:">
  107. <el-link v-if="form.businessLicenseFile && form.businessLicenseFile !== ''"
  108. type="primary" :underline="false"
  109. @click="downloadFile(form.businessLicenseFile)"> {{ form.businessLicenseFile.name }}</el-link>
  110. </el-form-item>
  111. </el-col>
  112. <el-col :span="16">
  113. <el-form-item label="备注:" prop="remark">
  114. {{form.remark}}
  115. </el-form-item>
  116. </el-col>
  117. </el-row>
  118. </el-form>
  119. </el-tab-pane>
  120. <el-tab-pane label="银行信息" name="bank">
  121. <ele-pro-table
  122. ref="table"
  123. :columns="bankColumns"
  124. :datasource="tableBankData"
  125. height="350px"
  126. :toolkit="[]"
  127. :need-page="false"
  128. >
  129. <template v-slot:accountNameHeader="{ column }">
  130. <span>{{ column.label }}</span><span style="color:red">*</span>
  131. </template>
  132. <template v-slot:accountName="{ row }">
  133. {{row.accountName}}
  134. </template>
  135. <template v-slot:accountNo="{ row }">
  136. {{row.accountNo}}
  137. </template>
  138. <template v-slot:bankName="{ row }">
  139. {{row.bankName}}
  140. </template>
  141. <template v-slot:interbankNo="{ row }">
  142. {{row.interbankNo}}
  143. </template>
  144. </ele-pro-table>
  145. </el-tab-pane>
  146. <el-tab-pane label="联系人信息" name="link">
  147. <ele-pro-table
  148. ref="linkTable"
  149. :columns="linkColumns"
  150. :datasource="tableLinkData"
  151. :toolkit="[]"
  152. height="350px"
  153. :need-page="false"
  154. >
  155. <template v-slot:linkNameHeader="{ column }">
  156. <span>{{ column.label }}</span><span style="color:red">*</span>
  157. </template>
  158. <template v-slot:mobilePhoneHeader="{ column }">
  159. <span>{{ column.label }}</span><span style="color:red">*</span>
  160. </template>
  161. <template v-slot:statusHeader="{ column }">
  162. <span>{{ column.label }}</span><span style="color:red">*</span>
  163. </template>
  164. <template v-slot:linkName="{ row }">
  165. {{row.linkName}}
  166. </template>
  167. <template v-slot:mobilePhone="{ row }">
  168. {{row.mobilePhone}}
  169. </template>
  170. <template v-slot:phone="{ row }">
  171. {{row.phone}}
  172. </template>
  173. <template v-slot:email="{ row }">
  174. {{row.email}}
  175. </template>
  176. <template v-slot:post="{ row }">
  177. {{row.post}}
  178. </template>
  179. <template v-slot:ifChief="{ row, $index }">
  180. <el-select v-model="row.ifChief" class="w100" disabled>
  181. <el-option
  182. v-for="item in ifChiefList"
  183. :key="item.value"
  184. :label="item.label"
  185. :value="item.value"
  186. ></el-option>
  187. </el-select>
  188. </template>
  189. <template v-slot:status="{ row }">
  190. <DictSelection
  191. dictName="客户联系人状态"
  192. v-model="row.status"
  193. :disabled="true"
  194. ></DictSelection>
  195. </template>
  196. <template v-slot:remark="{ row }">
  197. {{row.remark}}
  198. </template>
  199. </ele-pro-table>
  200. </el-tab-pane>
  201. <el-tab-pane label="其他信息" name="other">
  202. <el-form
  203. label-width="160px"
  204. ref="otherFormRef"
  205. :model="otherForm"
  206. style="margin-top: 30px"
  207. >
  208. <el-row>
  209. <el-col :span="8">
  210. <el-form-item label="结算方式:" prop="settlementMode">
  211. {{otherForm.settlementModeName}}
  212. </el-form-item>
  213. </el-col>
  214. <el-col :span="8">
  215. <el-form-item label="税率:" prop="taxRate">
  216. {{otherForm.taxRate}} %
  217. </el-form-item>
  218. </el-col>
  219. <el-col :span="8">
  220. <el-form-item label="折扣率:" prop="discount">
  221. {{otherForm.discount}} %
  222. </el-form-item>
  223. </el-col>
  224. <el-col :span="8">
  225. <el-form-item
  226. label="分管部门:"
  227. prop="deptId"
  228. style="margin-bottom: 22px"
  229. >
  230. {{otherForm.deptName}}
  231. </el-form-item>
  232. </el-col>
  233. <el-col :span="8">
  234. <el-form-item label="业务员:" prop="salesmanId">
  235. {{otherForm.salesmanName}}
  236. </el-form-item>
  237. </el-col>
  238. <el-col :span="8">
  239. <el-form-item label="收件人:" prop="sender">
  240. {{otherForm.sender}}
  241. </el-form-item>
  242. </el-col>
  243. <el-col :span="8">
  244. <el-form-item label="收件人电话:" prop="senderPhone">
  245. {{otherForm.senderPhone}}
  246. </el-form-item>
  247. </el-col>
  248. <el-col :span="8">
  249. <el-form-item label="收件人地址:" prop="addressId">
  250. {{otherForm.addressName}}
  251. </el-form-item>
  252. </el-col>
  253. <el-col :span="8">
  254. <el-form-item label="收件人详细地址:" prop="address" >
  255. {{otherForm.address}}
  256. </el-form-item>
  257. </el-col>
  258. </el-row>
  259. </el-form>
  260. </el-tab-pane>
  261. </el-tabs>
  262. <div slot="footer" class="footer">
  263. <el-button @click="cancel">返回</el-button>
  264. </div>
  265. </ele-modal>
  266. </template>
  267. <script>
  268. import {contactDetail} from '@/api/saleManage/contact';
  269. import {getFile} from '@/api/system/file';
  270. import {getInfoById as getCategoryInfo} from '@/api/classifyManage/index';
  271. import fileUpload from '@/components/upload/fileUpload';
  272. import dictMixins from '@/mixins/dictMixins';
  273. import deptSelect from '@/components/CommomSelect/dept-select.vue';
  274. import personSelect from '@/components/CommomSelect/person-select.vue';
  275. import {copyObj} from '@/utils/util';
  276. export default {
  277. props: {
  278. categoryTreeList: Array
  279. },
  280. mixins: [dictMixins],
  281. components: {
  282. fileUpload,
  283. deptSelect,
  284. personSelect
  285. },
  286. data() {
  287. let formDef = {
  288. address: '',
  289. addressId: 0,
  290. addressName: '',
  291. authorizationLimit: 0,
  292. businessLicenseFile: {},
  293. businessScope: '',
  294. categoryId: '',
  295. categoryName: '',
  296. companyCategoryId: '',
  297. companyCategoryName: '',
  298. hasParentGroup: 0,
  299. industry: '',
  300. industryCode: '',
  301. industryFullName: '',
  302. mainProduct: '',
  303. name: '',
  304. officialIndustry: '',
  305. phone: '',
  306. registerDate: '',
  307. remark: '',
  308. serialNo: '',
  309. simpleName: '',
  310. type: 1,
  311. unifiedSocialCreditCode: ''
  312. };
  313. let otherFormDef = {
  314. settlementMode: '',
  315. settlementModeName: '',
  316. taxRate: 0,
  317. address: '',
  318. addressId: '',
  319. deptId: '',
  320. deptName: '',
  321. discount: 0,
  322. salesmanId: '',
  323. salesmanName: '',
  324. sender: '',
  325. senderPhone: ''
  326. };
  327. return {
  328. visible: false,
  329. title: '客户详情',
  330. row: {},
  331. activeName: 'base',
  332. formDef,
  333. otherFormDef,
  334. form: copyObj(formDef),
  335. otherForm: copyObj(otherFormDef),
  336. tableBankData: [],
  337. tableLinkData: [],
  338. ifChiefList: [
  339. {
  340. value: 0,
  341. label: '否'
  342. },
  343. {
  344. value: 1,
  345. label: '是'
  346. }
  347. ],
  348. bankColumns: [
  349. {
  350. type: 'index',
  351. width: 55,
  352. align: 'center'
  353. },
  354. {
  355. label: '单位名称',
  356. prop: 'accountName',
  357. slot: 'accountName',
  358. action: 'accountName',
  359. headerSlot: 'accountNameHeader'
  360. },
  361. {
  362. label: '银行账号',
  363. prop: 'accountNo',
  364. slot: 'accountNo',
  365. action: 'accountNo'
  366. },
  367. {
  368. label: '开户行',
  369. prop: 'bankName',
  370. slot: 'bankName',
  371. action: 'bankName'
  372. },
  373. {
  374. label: '银行银联号',
  375. prop: 'interbankNo',
  376. slot: 'interbankNo',
  377. action: 'interbankNo'
  378. },
  379. ],
  380. linkColumns: [
  381. {
  382. type: 'index',
  383. width: 55,
  384. align: 'center'
  385. },
  386. {
  387. label: '姓名',
  388. prop: 'linkName',
  389. slot: 'linkName',
  390. action: 'linkName',
  391. headerSlot: 'linkNameHeader'
  392. },
  393. {
  394. label: '手机',
  395. prop: 'mobilePhone',
  396. slot: 'mobilePhone',
  397. action: 'mobilePhone',
  398. headerSlot: 'mobilePhoneHeader'
  399. },
  400. {
  401. label: '电话',
  402. prop: 'phone',
  403. slot: 'phone',
  404. action: 'phone'
  405. },
  406. {
  407. label: '微信号',
  408. prop: 'wechat',
  409. slot: 'wechat',
  410. action: 'wechat'
  411. },
  412. {
  413. label: '邮箱',
  414. prop: 'email',
  415. slot: 'email',
  416. action: 'email'
  417. },
  418. {
  419. label: '职务',
  420. prop: 'post',
  421. slot: 'post',
  422. action: 'post'
  423. },
  424. {
  425. label: '状态',
  426. prop: 'status',
  427. slot: 'status',
  428. action: 'status',
  429. headerSlot: 'statusHeader'
  430. },
  431. {
  432. label: '是否首要',
  433. prop: 'ifChief',
  434. slot: 'ifChief',
  435. action: 'ifChief'
  436. },
  437. {
  438. label: '备注',
  439. prop: 'remark',
  440. slot: 'remark',
  441. action: 'remark'
  442. },
  443. ],
  444. };
  445. },
  446. methods: {
  447. async open(row) {
  448. this.row = row;
  449. this.visible = true;
  450. await this._getById(row.id);
  451. },
  452. cancel() {
  453. this.$nextTick(() => {
  454. // 关闭后,销毁所有的表单数据
  455. this.form = copyObj(this.formDef),
  456. this.otherForm = copyObj(this.otherFormDef),
  457. this.tableBankData = []
  458. this.tableLinkData = []
  459. this.visible = false;
  460. })
  461. },
  462. async _getById(id) {
  463. const data = await contactDetail(id);
  464. this.form = data.base;
  465. this.otherForm = data.other;
  466. this.tableBankData = data.bankList;
  467. this.tableLinkData = data.linkList;
  468. if(this.tableLinkData && this.tableLinkData.length > 0){
  469. this.tableLinkData.forEach(e => e.status = e.status+"");
  470. }
  471. await getCategoryInfo(this.form.categoryId).then((res) => {
  472. this.$set(this.form,'categoryName', res.data.name)
  473. });
  474. },
  475. downloadFile(file){
  476. getFile({ objectName: file.storePath }, file.name);
  477. },
  478. }
  479. };
  480. </script>