contactDetailDialog.vue 15 KB

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