addContactDialog.vue 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909
  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. :append-to-body="true"
  10. width="70%"
  11. :maxable="true"
  12. :resizable="true"
  13. @close="cancel"
  14. >
  15. <el-tabs v-model="activeName" type="card" @tab-click="handleActive">
  16. <el-tab-pane label="基本信息" name="1">
  17. <headerTitle title="基本信息" style="margin-top: 30px"></headerTitle>
  18. <el-form
  19. label-width="120px"
  20. ref="form"
  21. class="el-form-box"
  22. :model="form"
  23. :rules="rules"
  24. >
  25. <el-row>
  26. <el-col :span="8">
  27. <el-form-item label="分类" prop="categoryId">
  28. <ele-tree-select
  29. :data="categoryTreeList"
  30. v-model="categoryIdList"
  31. multiple
  32. filterable
  33. :checkStrictly="true"
  34. valueKey="id"
  35. labelKey="name"
  36. placeholder="请选择"
  37. default-expand-all
  38. ref="treeSelect"
  39. />
  40. </el-form-item>
  41. </el-col>
  42. <el-col :span="8">
  43. <el-form-item
  44. label="对像类型 "
  45. prop="objectType"
  46. >
  47. <el-select
  48. v-model="form.objectType"
  49. clearable
  50. style="width: 100%"
  51. >
  52. <el-option
  53. :key="1"
  54. label="企业"
  55. :value="1"
  56. >
  57. </el-option>
  58. <el-option
  59. :key="2"
  60. label="个人"
  61. :value="2"
  62. >
  63. </el-option>
  64. </el-select>
  65. </el-form-item>
  66. </el-col>
  67. <el-col :span="8">
  68. <el-form-item label="名称" prop="name">
  69. <el-input
  70. placeholder="请输入"
  71. v-model="form.name"
  72. maxlength="50"
  73. @change="nameChange"
  74. ></el-input>
  75. </el-form-item>
  76. </el-col>
  77. <el-col :span="8">
  78. <el-form-item
  79. :label="form.objectType == 1 ? '统一信用代码' : '身份证号'"
  80. prop="unifiedSocialCreditCode"
  81. >
  82. <el-input
  83. placeholder="请输入"
  84. v-model="form.unifiedSocialCreditCode"
  85. maxlength="18"
  86. @change="unifiedSocialCreditCodeChange"
  87. ></el-input>
  88. </el-form-item>
  89. </el-col>
  90. <el-col :span="8">
  91. <el-form-item label="简称">
  92. <el-input
  93. placeholder="请输入"
  94. v-model="form.simpleName"
  95. maxlength="50"
  96. ></el-input>
  97. </el-form-item>
  98. </el-col>
  99. <el-col :span="8">
  100. <el-form-item
  101. label="代号"
  102. prop="serialNo"
  103. :rules="{
  104. required: false,
  105. message: '请输入',
  106. trigger: 'change'
  107. }"
  108. >
  109. <el-input
  110. placeholder="请输入"
  111. v-model="form.serialNo"
  112. maxlength="50"
  113. ></el-input>
  114. </el-form-item>
  115. </el-col>
  116. <el-col :span="8">
  117. <el-form-item label="法定代表人" prop="legalPerson">
  118. <el-input
  119. placeholder="请输入"
  120. v-model="form.legalPerson"
  121. maxlength="50"
  122. ></el-input>
  123. </el-form-item>
  124. </el-col>
  125. <el-col :span="8">
  126. <el-form-item label="所属行业" prop="industry">
  127. <DictSelection
  128. dictName="所属行业"
  129. clearable
  130. v-model="form.industryCode"
  131. >
  132. </DictSelection>
  133. </el-form-item>
  134. </el-col>
  135. <el-col :span="8">
  136. <el-form-item label="企业类型" prop="companyCategoryId">
  137. <DictSelection
  138. dictName="营业类型"
  139. clearable
  140. v-model="form.companyCategoryId"
  141. >
  142. </DictSelection>
  143. </el-form-item>
  144. </el-col>
  145. <el-col :span="8" style="height: 40px;">
  146. <el-form-item label="企业性质" prop="enterpriseTypeId">
  147. <DictSelection
  148. dictName="企业类型"
  149. clearable
  150. v-model="form.enterpriseTypeId"
  151. >
  152. </DictSelection>
  153. </el-form-item>
  154. </el-col>
  155. <el-col :span="8">
  156. <el-form-item label="上级单位" prop="parentId">
  157. <el-input
  158. placeholder="请选择上级单位"
  159. v-model="form.parentName"
  160. readonly
  161. @click.native="handParent"
  162. ></el-input>
  163. </el-form-item>
  164. </el-col>
  165. <el-col :span="8">
  166. <el-form-item label="注册资本" prop="registeredCapital">
  167. <el-input
  168. placeholder="请输入"
  169. v-model="form.registeredCapital"
  170. maxlength="50"
  171. ></el-input>
  172. </el-form-item>
  173. </el-col>
  174. <el-col :span="8">
  175. <el-form-item label="授信额度" prop="authorizationLimit">
  176. <el-input
  177. placeholder="请输入"
  178. v-model="form.authorizationLimit"
  179. maxlength="17"
  180. oninput="value=value.replace(/[^0-9.]/g,'')"
  181. ></el-input>
  182. </el-form-item>
  183. </el-col>
  184. <el-col :span="8">
  185. <el-form-item label="单位电话" prop="phone">
  186. <el-input
  187. placeholder="请输入"
  188. v-model="form.phone"
  189. maxlength="20"
  190. ></el-input>
  191. </el-form-item>
  192. </el-col>
  193. <el-col :span="8">
  194. <el-form-item label="成立日期" prop="registerDate">
  195. <el-date-picker
  196. style="width: 100%"
  197. clearable
  198. v-model="form.registerDate"
  199. type="date"
  200. value-format="yyyy-MM-dd"
  201. placeholder="请选择日期"
  202. >
  203. </el-date-picker>
  204. </el-form-item>
  205. </el-col>
  206. <el-col :span="8" style="height: 40px;">
  207. <el-form-item label="级别:">
  208. <DictSelection
  209. dictName="供应商级别"
  210. clearable
  211. v-model="form.level"
  212. >
  213. </DictSelection>
  214. </el-form-item>
  215. </el-col>
  216. <el-col :span="8">
  217. <el-form-item
  218. label="企业规模"
  219. prop="enterpriseScale"
  220. style="height: 36px"
  221. >
  222. <DictSelection
  223. dictName="企业规模"
  224. clearable
  225. v-model="form.enterpriseScale"
  226. >
  227. </DictSelection>
  228. </el-form-item>
  229. </el-col>
  230. <el-col :span="8">
  231. <el-form-item label="员工人数" prop="staffCount">
  232. <el-input
  233. placeholder="请输入"
  234. v-model="form.staffCount"
  235. maxlength="20"
  236. ></el-input>
  237. </el-form-item>
  238. </el-col>
  239. <el-col :span="8">
  240. <el-form-item label="英文名称" prop="englishName">
  241. <el-input
  242. placeholder="请输入"
  243. v-model="form.englishName"
  244. maxlength="20"
  245. ></el-input>
  246. </el-form-item>
  247. </el-col>
  248. <el-col :span="8">
  249. <el-form-item label="纳税人资质" prop="taxpayerQualification">
  250. <DictSelection
  251. dictName="纳税人资质"
  252. clearable
  253. v-model="form.taxpayerQualification"
  254. >
  255. </DictSelection>
  256. </el-form-item>
  257. </el-col>
  258. <el-col :span="8">
  259. <el-form-item label="企业荣誉" prop="enterpriseHonor">
  260. <DictSelection
  261. dictName="企业荣誉"
  262. clearable
  263. v-model="form.enterpriseHonor"
  264. >
  265. </DictSelection>
  266. </el-form-item>
  267. </el-col>
  268. <!-- <el-col :span="8" v-if="form.type != 2">
  269. <el-form-item label="客户审查" prop="qualificationCensorship">
  270. <el-radio v-model="form.qualificationCensorship" label="1"
  271. >启用</el-radio
  272. >
  273. <el-radio v-model="form.qualificationCensorship" label="2"
  274. >不启用</el-radio
  275. >
  276. </el-form-item>
  277. </el-col> -->
  278. <el-col :span="24">
  279. <el-form-item label="注册地址" prop="addressId">
  280. <el-cascader
  281. filterable
  282. clearable
  283. v-model="form.addressId"
  284. :options="options.cityData"
  285. ref="address"
  286. style="width: 35%"
  287. placeholder="请选择省市区/县"
  288. @change="changeAddress1"
  289. ></el-cascader>
  290. <el-input
  291. placeholder="请输入详细地址"
  292. v-model="form.address"
  293. style="width: 65%"
  294. ></el-input>
  295. </el-form-item>
  296. </el-col>
  297. </el-row>
  298. </el-form>
  299. <el-form
  300. label-width="120px"
  301. ref="otherForm"
  302. class="el-form-box"
  303. :model="otherForm"
  304. :rules="otherRules"
  305. >
  306. <el-row>
  307. <el-col :span="24">
  308. <el-form-item label="联系地址" prop="address">
  309. <el-cascader
  310. @change="changeAddress2"
  311. clearable
  312. v-model="otherForm.addressId"
  313. :options="options.cityData"
  314. ref="sendAddress"
  315. style="width: 35%"
  316. placeholder="请选择省市区/县"
  317. ></el-cascader>
  318. <el-input
  319. placeholder="请输入详细地址"
  320. v-model="otherForm.address"
  321. maxlength="50"
  322. style="width: 65%"
  323. ></el-input>
  324. </el-form-item>
  325. </el-col>
  326. <el-col :span="24">
  327. <el-form-item label="主营产品" prop="mainProduct">
  328. <el-input
  329. placeholder="请输入"
  330. v-model="form.mainProduct"
  331. type="textarea"
  332. maxlength="500"
  333. ></el-input>
  334. </el-form-item>
  335. </el-col>
  336. <el-col :span="24">
  337. <el-form-item label="经营范围" prop="businessScope">
  338. <el-input
  339. type="textarea"
  340. maxlength="500"
  341. placeholder="请输入"
  342. v-model="form.businessScope"
  343. ></el-input>
  344. </el-form-item>
  345. </el-col>
  346. <el-col :span="24">
  347. <el-form-item label="企业简介" prop="enterpriseProfile">
  348. <el-input
  349. placeholder="请输入"
  350. v-model="form.enterpriseProfile"
  351. type="textarea"
  352. maxlength="500"
  353. ></el-input>
  354. </el-form-item>
  355. </el-col>
  356. <el-col :span="24">
  357. <el-form-item label="备注" prop="remark">
  358. <el-input
  359. type="textarea"
  360. resize="none"
  361. v-model="form.remark"
  362. :rows="2"
  363. placeholder="请输入"
  364. size="small"
  365. maxlength="200"
  366. ></el-input>
  367. </el-form-item>
  368. </el-col>
  369. </el-row>
  370. </el-form>
  371. </el-tab-pane>
  372. <el-tab-pane label="银行信息" name="2">
  373. <headerTitle title="银行信息" style="margin-top: 30px"></headerTitle>
  374. <ele-pro-table
  375. ref="table"
  376. :columns="bankColumns"
  377. :datasource="tableBankData"
  378. height="350px"
  379. :toolkit="[]"
  380. class="el-form-box"
  381. :need-page="false"
  382. >
  383. <!-- 表头工具栏 -->
  384. <template v-slot:toolbar>
  385. <el-button type="primary" @click="addBank">添加</el-button>
  386. </template>
  387. <template v-slot:action="{ row, $index }">
  388. <el-link
  389. type="danger"
  390. :underline="false"
  391. icon="el-icon-delete"
  392. @click="handleBankDel(row, $index)"
  393. >删除
  394. </el-link>
  395. </template>
  396. <template v-slot:accountNameHeader="{ column }">
  397. <span>{{ column.label }}</span
  398. ><span style="color: red">*</span>
  399. </template>
  400. <template v-slot:accountName="{ row }">
  401. <el-input
  402. v-model="row.accountName"
  403. placeholder="请输入"
  404. maxlength="50"
  405. ></el-input>
  406. </template>
  407. <template v-slot:accountNo="{ row }">
  408. <el-input
  409. v-model="row.accountNo"
  410. placeholder="请输入"
  411. maxlength="50"
  412. ></el-input>
  413. </template>
  414. <template v-slot:bankName="{ row }">
  415. <el-input
  416. v-model="row.bankName"
  417. placeholder="请输入"
  418. maxlength="50"
  419. ></el-input>
  420. </template>
  421. <template v-slot:interbankNo="{ row }">
  422. <el-input
  423. v-model="row.interbankNo"
  424. placeholder="请输入"
  425. maxlength="50"
  426. ></el-input>
  427. </template>
  428. </ele-pro-table>
  429. </el-tab-pane>
  430. <el-tab-pane label="联系人信息" name="3">
  431. <headerTitle title="联系人信息" style="margin-top: 30px"></headerTitle>
  432. <ele-pro-table
  433. ref="linkTable"
  434. :columns="linkColumns"
  435. :datasource="tableLinkData"
  436. :toolkit="[]"
  437. height="350px"
  438. class="el-form-box"
  439. :need-page="false"
  440. >
  441. <!-- 表头工具栏 -->
  442. <template v-slot:toolbar>
  443. <el-button type="primary" @click="addLink">添加</el-button>
  444. </template>
  445. <template v-slot:action="{ row, $index }">
  446. <el-link
  447. type="danger"
  448. :underline="false"
  449. icon="el-icon-delete"
  450. @click="handleLinkDel(row, $index)"
  451. >删除
  452. </el-link>
  453. </template>
  454. <template v-slot:linkNameHeader="{ column }">
  455. <span>{{ column.label }}</span
  456. ><span style="color: red">*</span>
  457. </template>
  458. <template v-slot:mobilePhoneHeader="{ column }">
  459. <span>{{ column.label }}</span
  460. ><span style="color: red">*</span>
  461. </template>
  462. <template v-slot:statusHeader="{ column }">
  463. <span>{{ column.label }}</span
  464. ><span style="color: red">*</span>
  465. </template>
  466. <template v-slot:linkName="{ row }">
  467. <el-input
  468. v-model="row.linkName"
  469. placeholder="请输入"
  470. maxlength="50"
  471. ></el-input>
  472. </template>
  473. <template v-slot:mobilePhone="{ row }">
  474. <el-input
  475. v-model="row.mobilePhone"
  476. placeholder="请输入"
  477. maxlength="20"
  478. ></el-input>
  479. </template>
  480. <template v-slot:phone="{ row }">
  481. <el-input
  482. v-model="row.phone"
  483. placeholder="请输入"
  484. maxlength="20"
  485. ></el-input>
  486. </template>
  487. <template v-slot:wechat="{ row }">
  488. <el-input
  489. v-model="row.wechat"
  490. placeholder="请输入"
  491. maxlength="50"
  492. ></el-input>
  493. </template>
  494. <template v-slot:email="{ row }">
  495. <el-input
  496. v-model="row.email"
  497. placeholder="请输入"
  498. maxlength="50"
  499. ></el-input>
  500. </template>
  501. <template v-slot:deptName="{ row }">
  502. <el-input
  503. v-model="row.deptName"
  504. placeholder="请输入"
  505. maxlength="50"
  506. ></el-input>
  507. </template>
  508. <template v-slot:post="{ row }">
  509. <el-input
  510. v-model="row.post"
  511. placeholder="请输入"
  512. maxlength="20"
  513. ></el-input>
  514. </template>
  515. <template v-slot:ifChief="{ row, $index }">
  516. <el-select
  517. v-model="row.ifChief"
  518. placeholder="请选择"
  519. class="w100"
  520. @change="
  521. (value) => {
  522. ifChiefChange(value, $index);
  523. }
  524. "
  525. >
  526. <el-option
  527. v-for="item in ifChiefList"
  528. :key="item.value"
  529. :label="item.label"
  530. :value="item.value"
  531. ></el-option>
  532. </el-select>
  533. </template>
  534. <template v-slot:isDefault="{ row, $index }">
  535. <el-select
  536. v-model="row.isDefault"
  537. placeholder="请选择"
  538. class="w100"
  539. >
  540. <el-option
  541. v-for="item in ifChiefList"
  542. :key="item.value"
  543. :label="item.label"
  544. :value="item.value"
  545. ></el-option>
  546. </el-select>
  547. </template>
  548. <template v-slot:status="{ row }">
  549. <DictSelection
  550. dictName="联系人状态"
  551. v-model="row.status"
  552. ></DictSelection>
  553. </template>
  554. <template v-slot:remark="{ row }">
  555. <el-input
  556. v-model="row.remark"
  557. placeholder="请输入"
  558. maxlength="50"
  559. ></el-input>
  560. </template>
  561. </ele-pro-table>
  562. </el-tab-pane>
  563. <!-- <el-tab-pane label="其他信息" :name="4">
  564. <headerTitle title="其他信息" style="margin-top: 30px"></headerTitle>
  565. <el-form
  566. label-width="100px"
  567. ref="otherForm"
  568. :model="otherForm"
  569. :rules="otherRules"
  570. style="margin-top: 30px"
  571. >
  572. <el-row>
  573. <el-col :span="8">
  574. <el-form-item label="结算方式" prop="settlementMode">
  575. <DictSelection
  576. dictName="结算方式"
  577. clearable
  578. @itemChange="settlementModeChange"
  579. v-model="otherForm.settlementMode"
  580. >
  581. </DictSelection>
  582. </el-form-item>
  583. </el-col>
  584. <el-col :span="8">
  585. <el-form-item label="税率">
  586. <el-input
  587. v-model="otherForm.taxRate"
  588. maxlength="5"
  589. oninput="value=value.replace(/[^0-9.]/g,'')"
  590. >
  591. <template slot="append">%</template>
  592. </el-input>
  593. </el-form-item>
  594. </el-col>
  595. <el-col :span="8">
  596. <el-form-item label="折扣率" prop="discount">
  597. <el-input
  598. v-model="otherForm.discount"
  599. maxlength="5"
  600. oninput="value=value.replace(/[^0-9.]/g,'')"
  601. >
  602. <template slot="append">%</template>
  603. </el-input>
  604. </el-form-item>
  605. </el-col>
  606. <el-col :span="8">
  607. <el-form-item label="收件人" prop="sender">
  608. <el-input
  609. placeholder="请输入"
  610. v-model="otherForm.sender"
  611. maxlength="50"
  612. ></el-input>
  613. </el-form-item>
  614. </el-col>
  615. <el-col :span="8">
  616. <el-form-item label="收件人电话" prop="senderPhone">
  617. <el-input
  618. placeholder="请输入"
  619. v-model="otherForm.senderPhone"
  620. maxlength="20"
  621. ></el-input>
  622. </el-form-item>
  623. </el-col>
  624. </el-row>
  625. </el-form>
  626. </el-tab-pane> -->
  627. <el-tab-pane label="证书资质" name="4">
  628. <headerTitle title="证书资质" style="margin-top: 30px"></headerTitle>
  629. <certificateManagement
  630. ref="certificateManagementRef"
  631. ></certificateManagement>
  632. <!-- <ele-pro-table
  633. ref="certificateTable"
  634. :columns="certificateColumns"
  635. :need-page="false"
  636. :datasource="tableCertificateDataList"
  637. :toolkit="[]"
  638. height="350px"
  639. > -->
  640. <!-- 表头工具栏 -->
  641. <!-- <template v-slot:toolbar>
  642. <el-button type="primary" @click="addCertificate('add', '')"
  643. >新增</el-button
  644. >
  645. </template> -->
  646. <!-- 操作栏 -->
  647. <!-- <template v-slot:action="scope">
  648. <el-link
  649. v-if="[1, 2].includes(scope.row.processStatus)"
  650. type="primary"
  651. :underline="false"
  652. icon="el-icon-edit"
  653. @click="addCertificate('view', scope.row, scope.$index)"
  654. >
  655. 详情
  656. </el-link>
  657. <el-link
  658. v-if="[0, 3].includes(scope.row.processStatus)"
  659. type="primary"
  660. :underline="false"
  661. icon="el-icon-edit"
  662. @click="addCertificate('update', scope.row, scope.$index)"
  663. >
  664. 修改
  665. </el-link>
  666. <el-link
  667. v-if="
  668. [0, 3].includes(scope.row.processStatus) &&
  669. form.type == 1 &&
  670. form.qualificationCensorship == '2'
  671. "
  672. type="primary"
  673. :underline="false"
  674. icon="el-icon-plus"
  675. @click="submit(scope.row)"
  676. >
  677. 提交
  678. </el-link>
  679. <el-link
  680. v-if="[0, 3].includes(scope.row.processStatus) && (form.type == 2||form.type == 3)"
  681. type="primary"
  682. :underline="false"
  683. icon="el-icon-plus"
  684. @click="submit(scope.row)"
  685. >
  686. 提交
  687. </el-link>
  688. <el-popconfirm
  689. class="ele-action"
  690. title="确定要删除此资质吗?"
  691. @confirm="handleRemove(scope.row)"
  692. >
  693. <template v-slot:reference>
  694. <el-link
  695. v-if="[0, 3].includes(scope.row.processStatus)"
  696. type="danger"
  697. :underline="false"
  698. icon="el-icon-delete"
  699. >
  700. 删除
  701. </el-link>
  702. </template>
  703. </el-popconfirm>
  704. </template>
  705. </ele-pro-table> -->
  706. </el-tab-pane>
  707. <el-tab-pane :label="getLabel" name="5">
  708. <headerTitle :title="getLabel" style="margin-top: 30px"></headerTitle>
  709. <ele-pro-table
  710. ref="supplyRef"
  711. :columns="supplyColumns"
  712. :need-page="false"
  713. :datasource="supplyList"
  714. :toolkit="[]"
  715. height="350px"
  716. >
  717. <!-- 表头工具栏 -->
  718. <template v-slot:toolbar>
  719. <el-button type="primary" @click="handSelectSupply">新增</el-button>
  720. </template>
  721. <template v-slot:purchasingCycle="scope">
  722. <el-input v-model="scope.row.purchasingCycle" placeholder="请输入">
  723. <template slot="append">天</template>
  724. </el-input>
  725. </template>
  726. <template v-slot:purchaseMultiplier="scope">
  727. <el-input
  728. v-model="scope.row.purchaseMultiplier"
  729. placeholder="请输入"
  730. >
  731. </el-input>
  732. </template>
  733. <template v-slot:minimumOrderQuantity="scope">
  734. <el-input
  735. v-model="scope.row.minimumOrderQuantity"
  736. placeholder="请输入"
  737. >
  738. </el-input>
  739. </template>
  740. <template v-slot:provenance="scope">
  741. <DictSelection
  742. dictName="产地"
  743. clearable
  744. v-model="scope.row.provenance"
  745. multiple
  746. >
  747. </DictSelection>
  748. </template>
  749. <!-- 操作栏 -->
  750. <template v-slot:action="scope">
  751. <el-popconfirm
  752. class="ele-action"
  753. title="确定要删除此产品吗?"
  754. @confirm="handleRemoveSupply(scope.$index)"
  755. >
  756. <template v-slot:reference>
  757. <el-link type="danger" :underline="false" icon="el-icon-delete">
  758. 删除
  759. </el-link>
  760. </template>
  761. </el-popconfirm>
  762. </template>
  763. </ele-pro-table>
  764. </el-tab-pane>
  765. </el-tabs>
  766. <div slot="footer" class="footer">
  767. <el-button
  768. type="primary"
  769. @click="pageChange('up')"
  770. :disabled="activeName == '1'"
  771. >上一步</el-button
  772. >
  773. <el-button
  774. type="primary"
  775. @click="pageChange('next')"
  776. :disabled="activeName == '5'"
  777. >下一步</el-button
  778. >
  779. <el-button type="primary" v-if="form?.id||activeName == '5'" @click="save" v-click-once
  780. >保存</el-button
  781. >
  782. <el-button
  783. type="primary"
  784. v-if="
  785. form.type == 1 &&
  786. activeName == '5' &&
  787. form.qualificationCensorship == '1'
  788. "
  789. @click="save('sub')"
  790. v-click-once
  791. >提交</el-button
  792. >
  793. <el-button @click="cancel">返回</el-button>
  794. </div>
  795. <parentList
  796. ref="parentRef"
  797. classType="1"
  798. @changeParent="changeParent"
  799. ></parentList>
  800. <!-- 资质证书弹窗
  801. <certificate-qualifications-dialog
  802. :certificate-qualifications-dialog-flag.sync="
  803. certificateQualificationsDialogFlag
  804. "
  805. v-if="certificateQualificationsDialogFlag"
  806. ref="certificateQualificationsDialogRef"
  807. :contactInfo="form"
  808. :typeInfo="form.type"
  809. @success="tableCertificateDataAdd"
  810. @reload="reloadTableCertificateDataList"
  811. >
  812. </certificate-qualifications-dialog> -->
  813. <process-submit-dialog
  814. :processSubmitDialogFlag.sync="processSubmitDialogFlag"
  815. v-if="processSubmitDialogFlag"
  816. ref="processSubmitDialogRef"
  817. @reload="reload"
  818. ></process-submit-dialog>
  819. <product-list
  820. ref="productListRef"
  821. :data="supplyList"
  822. @changeParent="getSupplyList"
  823. ></product-list>
  824. </ele-modal>
  825. </template>
  826. <script>
  827. import {
  828. contactDetail,
  829. contactSave,
  830. contactUpdate,
  831. // contactQcPackDeleteAPI,
  832. // identityphotoList,
  833. // contactQcPackPageAPI,
  834. contactQcPackSaveAPI
  835. } from '@/api/saleManage/contact';
  836. import { categoryData } from 'element-china-category-data';
  837. import fileUpload from '@/components/upload/fileUpload';
  838. import { cityData } from 'ele-admin/packages/utils/regions';
  839. import dictMixins from '@/mixins/dictMixins';
  840. import deptSelect from '@/components/CommomSelect/dept-select.vue';
  841. import personSelect from '@/components/CommomSelect/person-select.vue';
  842. import { listOrganizations } from '@/api/system/organization';
  843. import { copyObj } from '@/utils/util';
  844. import productList from '@/BIZComponents/product-list.vue';
  845. import parentList from './parentList.vue';
  846. // import certificateQualificationsDialog from '@/views/purchasingManage/supplierManage/components/certificateQualificationsDialog.vue';
  847. import certificateQualificationsDialog from './certificateQualificationsDialog.vue';
  848. import { reviewStatus, lbjtList } from '@/enum/dict';
  849. import { deepClone } from '@/utils';
  850. import searchTable from '@/views/saleManage/saleOrder/components/searchTable.vue';
  851. // import fileMain from '@/components/addDoc/index.vue';
  852. import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
  853. import certificateManagement from '@/views/saleManage/contact/components/certificateManagement/index.vue';
  854. import { parameterGetByCode } from '@/api/main/index.js';
  855. export default {
  856. props: {
  857. categoryTreeList: Array
  858. },
  859. mixins: [dictMixins],
  860. components: {
  861. processSubmitDialog,
  862. // fileMain,
  863. searchTable,
  864. certificateQualificationsDialog,
  865. fileUpload,
  866. deptSelect,
  867. personSelect,
  868. parentList,
  869. productList,
  870. certificateManagement
  871. },
  872. data() {
  873. let formDef = {
  874. objectType: 1,
  875. address: '',
  876. addressId: '',
  877. addressName: '',
  878. authorizationLimit: 0,
  879. businessLicenseFiles: [],
  880. businessLicenseFile: [],
  881. businessScope: '',
  882. categoryId: '',
  883. companyCategoryId: '',
  884. companyCategoryName: '',
  885. enterpriseTypeId: '',
  886. enterpriseTypeName: '',
  887. legalPerson: '',
  888. registeredCapital: '',
  889. parentId: '',
  890. industry: '',
  891. industryCode: '',
  892. industryFullName: '',
  893. mainProduct: '',
  894. name: '',
  895. officialIndustry: '',
  896. phone: '',
  897. registerDate: '',
  898. remark: '',
  899. serialNo: '',
  900. simpleName: '',
  901. type: 1,
  902. unifiedSocialCreditCode: '',
  903. enterpriseHonor: '',
  904. enterpriseScale: '',
  905. staffCount: '',
  906. enterpriseProfile: '',
  907. englishName: '',
  908. taxpayerQualification: '',
  909. qualificationCensorship: '2'
  910. };
  911. let otherFormDef = {
  912. settlementMode: '',
  913. settlementModeName: '',
  914. taxRate: 0,
  915. address: '',
  916. addressId: '',
  917. deptId: '',
  918. deptName: '',
  919. discount: 0,
  920. salesmanId: '',
  921. salesmanName: '',
  922. sender: '',
  923. senderPhone: ''
  924. };
  925. return {
  926. enableStatus: '2',
  927. fullscreen: false,
  928. visible: false,
  929. certificateQualificationsDialogFlag: false,
  930. processSubmitDialogFlag: false,
  931. title: '',
  932. row: {},
  933. activeName: '1',
  934. formDef,
  935. supplyList: [],
  936. otherFormDef,
  937. form: copyObj(formDef),
  938. otherForm: copyObj(otherFormDef),
  939. // removeBankList: [],
  940. // removeLinkList: [],
  941. tableBankData: [],
  942. tableLinkData: [],
  943. categoryIdList: [],
  944. dictList: {},
  945. ifChiefList: [
  946. {
  947. value: 0,
  948. label: '否'
  949. },
  950. {
  951. value: 1,
  952. label: '是'
  953. }
  954. ],
  955. bankColumns: [
  956. {
  957. type: 'index',
  958. width: 55,
  959. align: 'center'
  960. },
  961. {
  962. label: '单位名称',
  963. prop: 'accountName',
  964. slot: 'accountName',
  965. action: 'accountName',
  966. headerSlot: 'accountNameHeader',
  967. align: 'center'
  968. },
  969. {
  970. label: '银行账号',
  971. prop: 'accountNo',
  972. slot: 'accountNo',
  973. action: 'accountNo',
  974. align: 'center'
  975. },
  976. {
  977. label: '开户行',
  978. prop: 'bankName',
  979. slot: 'bankName',
  980. action: 'bankName',
  981. align: 'center'
  982. },
  983. {
  984. label: '银行银联号',
  985. prop: 'interbankNo',
  986. slot: 'interbankNo',
  987. action: 'interbankNo',
  988. align: 'center'
  989. },
  990. {
  991. action: 'action',
  992. slot: 'action',
  993. label: '操作',
  994. align: 'center'
  995. }
  996. ],
  997. certificateColumns: [
  998. {
  999. type: 'index',
  1000. width: 55,
  1001. align: 'center'
  1002. },
  1003. {
  1004. label: '编码',
  1005. prop: 'code',
  1006. slot: 'code',
  1007. align: 'center',
  1008. minWidth: 120
  1009. },
  1010. {
  1011. label: '名称',
  1012. prop: 'name',
  1013. slot: 'name',
  1014. align: 'center',
  1015. minWidth: 120
  1016. },
  1017. {
  1018. label: '创建时间',
  1019. prop: 'createTime',
  1020. slot: 'createTime',
  1021. align: 'center',
  1022. minWidth: 120
  1023. },
  1024. {
  1025. label: '状态',
  1026. prop: 'processStatus',
  1027. slot: 'processStatus',
  1028. align: 'center',
  1029. width: 120,
  1030. formatter: (_row, _column, cellValue) => {
  1031. return reviewStatus[_row.processStatus];
  1032. }
  1033. },
  1034. {
  1035. label: '备注',
  1036. prop: 'remark',
  1037. slot: 'remark',
  1038. align: 'center',
  1039. minWidth: 120
  1040. },
  1041. {
  1042. action: 'action',
  1043. slot: 'action',
  1044. label: '操作',
  1045. align: 'center',
  1046. width: 200
  1047. }
  1048. ],
  1049. otherRules: {
  1050. // settlementMode: [
  1051. // { required: true, message: '请输入结算方式', trigger: 'blur' }
  1052. // ],
  1053. address: [
  1054. { required: false, message: '请选择地址', trigger: 'change' }
  1055. ]
  1056. },
  1057. options: {
  1058. cityData,
  1059. categoryData
  1060. },
  1061. // 提交状态
  1062. loading: false,
  1063. // 是否是修改
  1064. isUpdate: false,
  1065. // 组织机构树形结构数据
  1066. groupTreeData: [],
  1067. // 组织机构平铺数据
  1068. groupData: [],
  1069. parentShow: false,
  1070. tableCertificateDataList: []
  1071. };
  1072. },
  1073. computed: {
  1074. rules() {
  1075. return {
  1076. categoryId: [
  1077. { required: true, message: '请选择分类', trigger: 'change' }
  1078. ],
  1079. name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
  1080. unifiedSocialCreditCode: [
  1081. {
  1082. required: this.form.objectType == 1 ? true : false,
  1083. message: '请输入统一社会信用代码',
  1084. trigger: 'blur'
  1085. }
  1086. ],
  1087. authorizationLimit: [
  1088. { required: true, message: '请输入授信额度', trigger: 'blur' }
  1089. ],
  1090. // addressId: [
  1091. // { required: true, message: '请选择地址', trigger: 'change' }
  1092. // ],
  1093. // qualificationCensorship: [
  1094. // { required: true, message: '请选择', trigger: 'change' }
  1095. // ]
  1096. }
  1097. },
  1098. clientEnvironmentId() {
  1099. return this.$store.state.user.info.clientEnvironmentId;
  1100. },
  1101. linkColumns() {
  1102. return [
  1103. {
  1104. type: 'index',
  1105. width: 55,
  1106. align: 'center'
  1107. },
  1108. {
  1109. label: '姓名',
  1110. prop: 'linkName',
  1111. slot: 'linkName',
  1112. action: 'linkName',
  1113. headerSlot: 'linkNameHeader',
  1114. align: 'center'
  1115. },
  1116. {
  1117. label: '手机',
  1118. prop: 'mobilePhone',
  1119. slot: 'mobilePhone',
  1120. action: 'mobilePhone',
  1121. // headerSlot: 'mobilePhoneHeader',
  1122. align: 'center'
  1123. },
  1124. {
  1125. label: '电话',
  1126. prop: 'phone',
  1127. slot: 'phone',
  1128. action: 'phone',
  1129. align: 'center'
  1130. },
  1131. {
  1132. label: '微信号',
  1133. prop: 'wechat',
  1134. slot: 'wechat',
  1135. action: 'wechat',
  1136. align: 'center'
  1137. },
  1138. {
  1139. label: '邮箱',
  1140. prop: 'email',
  1141. slot: 'email',
  1142. action: 'email',
  1143. align: 'center'
  1144. },
  1145. {
  1146. label: '部门',
  1147. prop: 'deptName',
  1148. slot: 'deptName',
  1149. action: 'deptName',
  1150. align: 'center'
  1151. },
  1152. {
  1153. label: '职务',
  1154. prop: 'post',
  1155. slot: 'post',
  1156. action: 'post',
  1157. align: 'center'
  1158. },
  1159. {
  1160. label: '状态',
  1161. prop: 'status',
  1162. slot: 'status',
  1163. action: 'status',
  1164. headerSlot: 'statusHeader',
  1165. align: 'center'
  1166. },
  1167. {
  1168. label: '是否首要',
  1169. prop: 'ifChief',
  1170. slot: 'ifChief',
  1171. action: 'ifChief',
  1172. align: 'center'
  1173. },
  1174. {
  1175. label: `是否默认${this.form.type == 1 ? '收件' : '寄件'}人`,
  1176. prop: 'isDefault',
  1177. slot: 'isDefault',
  1178. align: 'center'
  1179. },
  1180. {
  1181. label: '备注',
  1182. prop: 'remark',
  1183. slot: 'remark',
  1184. action: 'remark',
  1185. align: 'center'
  1186. },
  1187. {
  1188. action: 'action',
  1189. slot: 'action',
  1190. label: '操作',
  1191. align: 'center'
  1192. }
  1193. ];
  1194. },
  1195. getLabel() {
  1196. return this.categoryIdList
  1197. .map((item) => {
  1198. let data = this.$refs?.treeSelect?.getNodeByValue(item);
  1199. return data?.rootCategoryLevelId;
  1200. })
  1201. .includes('20250317001')
  1202. ? '生产列表'
  1203. : '供货列表';
  1204. },
  1205. supplyColumns() {
  1206. return [
  1207. {
  1208. columnKey: 'index',
  1209. type: 'index',
  1210. width: 50,
  1211. align: 'center',
  1212. showOverflowTooltip: true,
  1213. label: '序号'
  1214. },
  1215. {
  1216. prop: 'productCode',
  1217. label: '编码',
  1218. align: 'center',
  1219. showOverflowTooltip: true,
  1220. minWidth: 110
  1221. },
  1222. {
  1223. prop: 'productName',
  1224. label: '名称',
  1225. align: 'center',
  1226. showOverflowTooltip: true,
  1227. minWidth: 110
  1228. },
  1229. {
  1230. prop: 'purchasingCycle',
  1231. label: '采购周期',
  1232. align: 'center',
  1233. slot: 'purchasingCycle',
  1234. showOverflowTooltip: true,
  1235. minWidth: 150
  1236. },
  1237. {
  1238. prop: 'purchaseMultiplier',
  1239. label: '倍数',
  1240. slot: 'purchaseMultiplier',
  1241. align: 'center',
  1242. showOverflowTooltip: true,
  1243. minWidth: 100
  1244. },
  1245. {
  1246. prop: 'minimumOrderQuantity',
  1247. label: '最低订购数量',
  1248. slot: 'minimumOrderQuantity',
  1249. align: 'center',
  1250. showOverflowTooltip: true,
  1251. minWidth: 150
  1252. },
  1253. {
  1254. prop: 'provenance',
  1255. label: '产地',
  1256. slot: 'provenance',
  1257. align: 'center',
  1258. showOverflowTooltip: true,
  1259. minWidth: 200
  1260. },
  1261. {
  1262. prop: 'manufacturer',
  1263. label: '生产厂家',
  1264. slot: 'manufacturer',
  1265. align: 'center',
  1266. showOverflowTooltip: true,
  1267. minWidth: 200,
  1268. show: this.getLabel == '供货列表'
  1269. },
  1270. {
  1271. prop: 'imgCode',
  1272. align: 'center',
  1273. label: '图号/件号',
  1274. showOverflowTooltip: true,
  1275. minWidth: 110
  1276. },
  1277. {
  1278. prop: 'produceType',
  1279. align: 'center',
  1280. label: '属性类型',
  1281. showOverflowTooltip: true,
  1282. minWidth: 110,
  1283. formatter: (row, column) => {
  1284. if (row.produceType) {
  1285. return row.produceType
  1286. .map((item) => {
  1287. return lbjtList[item];
  1288. })
  1289. .toString();
  1290. }
  1291. }
  1292. },
  1293. {
  1294. prop: 'packingSpecification',
  1295. align: 'center',
  1296. label: '包装规格',
  1297. showOverflowTooltip: true,
  1298. minWidth: 110
  1299. },
  1300. {
  1301. prop: 'brandNum',
  1302. align: 'center',
  1303. label: '牌号',
  1304. showOverflowTooltip: true
  1305. },
  1306. {
  1307. prop: 'modelType',
  1308. label: '型号',
  1309. align: 'center',
  1310. showOverflowTooltip: true
  1311. },
  1312. {
  1313. prop: 'specification',
  1314. label: '规格',
  1315. align: 'center',
  1316. showOverflowTooltip: true
  1317. },
  1318. {
  1319. prop: 'measuringUnit',
  1320. label: '计量单位',
  1321. showOverflowTooltip: true,
  1322. align: 'center',
  1323. minWidth: 90
  1324. },
  1325. {
  1326. prop: 'createTime',
  1327. label: '创建时间',
  1328. showOverflowTooltip: true,
  1329. align: 'center',
  1330. minWidth: 160
  1331. },
  1332. {
  1333. slot: 'action',
  1334. align: 'center',
  1335. minWidth: 90,
  1336. fixed: 'right',
  1337. label: '操作'
  1338. }
  1339. ];
  1340. }
  1341. },
  1342. watch: {
  1343. categoryIdList(val) {
  1344. if (val.length > 0) {
  1345. this.$refs.form?.clearValidate('categoryId');
  1346. this.form.categoryId = this.categoryIdList.join(',');
  1347. } else {
  1348. this.form.categoryId = '';
  1349. this.$refs.form?.validateField('categoryId');
  1350. }
  1351. }
  1352. },
  1353. created() {
  1354. this.getGroupAll();
  1355. this.requestDict('生产类型');
  1356. },
  1357. methods: {
  1358. async open(type, row, contactCategoryId, pageType) {
  1359. this.resetForm()
  1360. // return
  1361. this.form.type = pageType || 1;
  1362. this.title = type;
  1363. this.row = row;
  1364. this.visible = true;
  1365. if (!row.id) {
  1366. console.log('新增', this.form);
  1367. this.isUpdate = false;
  1368. // 默认带出列表页面选中的分类
  1369. this.$nextTick(() => {
  1370. this.categoryIdList = contactCategoryId ? [contactCategoryId] : [];
  1371. // 客户审查 //2不启用 1启用
  1372. parameterGetByCode({
  1373. code: 'eom_saleManage_contact_qualificationCensorship'
  1374. }).then((res) => {
  1375. console.log('客户审查', res)
  1376. this.form.qualificationCensorship = res.value;
  1377. this.enableStatus = res.value
  1378. });
  1379. });
  1380. } else {
  1381. this.isUpdate = true;
  1382. await this._getById(row.id);
  1383. }
  1384. },
  1385. handleActive(val) {
  1386. console.log(val);
  1387. },
  1388. nameChange() {
  1389. this.tableBankData.forEach((item) => {
  1390. item.accountName = this.form.name;
  1391. });
  1392. },
  1393. // 获取公司数据
  1394. getGroupAll() {
  1395. listOrganizations().then((list) => {
  1396. this.groupData = list;
  1397. this.groupTreeData = this.$util.toTreeData({
  1398. data: list,
  1399. idField: 'id',
  1400. parentIdField: 'parentId'
  1401. });
  1402. });
  1403. },
  1404. // //新增/查看/修改资质
  1405. // addCertificate(type, row, index) {
  1406. // this.certificateQualificationsDialogFlag = true;
  1407. // this.$nextTick(() => {
  1408. // console.log(index);
  1409. // this.$refs.certificateQualificationsDialogRef.init(type, row, index);
  1410. // });
  1411. // },
  1412. // /* 证书资质表格数据源 */
  1413. // tableCertificateData() {
  1414. // contactQcPackPageAPI({
  1415. // certificationType: this.form.type,
  1416. // relationId: this.form.id
  1417. // }).then((res) => {
  1418. // this.tableCertificateDataList = res;
  1419. // });
  1420. // },
  1421. // tableCertificateDataAdd({ form = {}, index = '' }) {
  1422. // if (this.form.id) {
  1423. // this.tableCertificateData();
  1424. // } else {
  1425. // if (index + '') {
  1426. // this.$set(this.tableCertificateDataList, index, form);
  1427. // } else {
  1428. // this.tableCertificateDataList.push(form);
  1429. // }
  1430. // }
  1431. // },
  1432. // //删除资质包
  1433. // handleRemove(row) {
  1434. // contactQcPackDeleteAPI([row.id]).then((res) => {
  1435. // this.$message.success('删除成功!');
  1436. // this.tableCertificateDataAdd({});
  1437. // });
  1438. // },
  1439. //开启提交流程
  1440. async contactSubmit(row) {
  1441. const { base } = await contactDetail(this.form.id || row);
  1442. this.processSubmitDialogFlag = true;
  1443. this.$nextTick(() => {
  1444. let params = {
  1445. businessId: base.id,
  1446. businessKey: 'contact_approve',
  1447. formCreateUserId: base.createUserId,
  1448. variables: {
  1449. certificationType: 1,
  1450. businessCode: base.code,
  1451. businessName: base.name,
  1452. businessType: '客户审核'
  1453. }
  1454. };
  1455. this.$refs.processSubmitDialogRef.init(params);
  1456. });
  1457. },
  1458. //开启资质提交流程
  1459. async submit(row) {
  1460. this.processSubmitDialogFlag = true;
  1461. this.$nextTick(() => {
  1462. let params = {
  1463. businessId: row.id,
  1464. businessKey: 'contact_qc_approve',
  1465. formCreateUserId: row.createUserId,
  1466. variables: {
  1467. certificationType: this.form.type,
  1468. businessName: row.name
  1469. }
  1470. };
  1471. this.$refs.processSubmitDialogRef.init(params);
  1472. });
  1473. },
  1474. //获取代号
  1475. unifiedSocialCreditCodeChange(val) {
  1476. this.form.serialNo = this.form.serialNo || val.slice(-4);
  1477. },
  1478. // 选择负责人部门
  1479. change_principalDep(id) {
  1480. const info = this.groupData.find((e) => e.id == id);
  1481. this.otherForm.deptName = info.name;
  1482. this.otherForm.salesmanId = '';
  1483. this.otherForm.salesmanName = '';
  1484. // 根据部门获取人员
  1485. const params = { groupId: id };
  1486. this.$nextTick(() => {
  1487. this.$refs.directorRef.getList(params);
  1488. });
  1489. },
  1490. salesmanChange(val, info) {
  1491. this.otherForm.salesmanName = info.name;
  1492. },
  1493. settlementModeChange(info) {
  1494. this.otherForm.settlementModeName = info.dictValue;
  1495. },
  1496. ifChiefChange(value, idx) {
  1497. if (value === 1) {
  1498. this.tableLinkData.forEach((e) => (e.ifChief = 0));
  1499. this.tableLinkData[idx].ifChief = 1;
  1500. }
  1501. },
  1502. addBank() {
  1503. this.tableBankData.push({
  1504. accountName: this.form.name,
  1505. accountNo: '',
  1506. bankName: '',
  1507. interbankNo: ''
  1508. });
  1509. },
  1510. addLink() {
  1511. this.tableLinkData.push({
  1512. linkName: '',
  1513. mobilePhone: '',
  1514. phone: '',
  1515. email: '',
  1516. post: '',
  1517. status: '1',
  1518. ifChief: 0,
  1519. remark: ''
  1520. });
  1521. },
  1522. handleBankDel(row, index) {
  1523. this.tableBankData.splice(index, 1);
  1524. if (row?.id) {
  1525. // this.removeBankList.push(row.id);
  1526. }
  1527. },
  1528. handleLinkDel(row, index) {
  1529. this.tableLinkData.splice(index, 1);
  1530. if (row?.id) {
  1531. // this.removeLinkList.push(row.id);
  1532. }
  1533. },
  1534. formValid() {
  1535. return new Promise((resolve, reject) => {
  1536. this.$refs.form.validate((valid) => {
  1537. if (!valid) {
  1538. this.activeName = '1';
  1539. reject(false);
  1540. } else {
  1541. resolve(true);
  1542. }
  1543. });
  1544. });
  1545. },
  1546. otherFormValid() {
  1547. return new Promise((resolve, reject) => {
  1548. this.$refs.otherForm.validate((valid) => {
  1549. console.log(valid, 'valid');
  1550. if (!valid) {
  1551. this.activeName = '1';
  1552. reject(false);
  1553. } else {
  1554. resolve(true);
  1555. }
  1556. });
  1557. });
  1558. },
  1559. tableLinkDataValid() {
  1560. return new Promise((resolve, reject) => {
  1561. if (this.tableLinkData.length == 0) {
  1562. this.activeName = '3';
  1563. this.$message.error('联系人信息至少有1条');
  1564. reject(false);
  1565. } else {
  1566. resolve(true);
  1567. }
  1568. });
  1569. },
  1570. getValidate() {
  1571. return Promise.all([
  1572. this.formValid(),
  1573. this.otherFormValid(),
  1574. this.tableLinkDataValid()
  1575. ]);
  1576. },
  1577. async pageChange(type) {
  1578. if (type == 'up') {
  1579. this.activeName = (parseInt(this.activeName) - 1).toString();
  1580. }
  1581. if (type == 'next') {
  1582. if (this.activeName == '1' && !(await this.formValid())) {
  1583. return;
  1584. }
  1585. if (this.activeName == '3' && !(await this.tableLinkDataValid())) {
  1586. this.$message.error('联系人信息至少有1条');
  1587. return;
  1588. }
  1589. // if (this.activeName == 4 && !(await this.otherFormValid())) {
  1590. // return;
  1591. // }
  1592. this.activeName = (parseInt(this.activeName) + 1).toString();
  1593. }
  1594. },
  1595. async save(type = '') {
  1596. try {
  1597. await this.getValidate();
  1598. // 表单验证通过,执行保存操作
  1599. this.loading = true;
  1600. // 基本信息处理
  1601. if (this.$refs.address.getCheckedNodes()) {
  1602. let node = this.$refs.address.getCheckedNodes()[0];
  1603. if (node) {
  1604. this.form.addressId = node.path.join();
  1605. this.form.addressName = node.pathLabels.join();
  1606. } else {
  1607. this.form.addressId = '';
  1608. this.form.addressName = '';
  1609. }
  1610. }
  1611. this.form.categoryId = this.categoryIdList.join(',');
  1612. if (this.form.companyCategoryId) {
  1613. this.form.companyCategoryName = this.getDictValue(
  1614. '营业类型',
  1615. this.form.companyCategoryId
  1616. );
  1617. }
  1618. if (this.form.industryCode) {
  1619. this.form.industryFullName = this.getDictValue(
  1620. '所属行业',
  1621. this.form.industryCode
  1622. );
  1623. }
  1624. if (this.form.enterpriseTypeId) {
  1625. this.form.enterpriseTypeName = this.getDictValue(
  1626. '企业类型',
  1627. this.form.enterpriseTypeId
  1628. );
  1629. }
  1630. // if (
  1631. // this.form.businessLicenseFiles &&
  1632. // this.form.businessLicenseFiles.length > 0
  1633. // ) {
  1634. // this.form.businessLicenseFile = this.form.businessLicenseFiles[0];
  1635. // } else {
  1636. // this.form.businessLicenseFile = null;
  1637. // }
  1638. // 其他信息处理
  1639. if (this.form.settlementMode) {
  1640. this.form.settlementModeName = this.getDictValue(
  1641. '结算方式',
  1642. this.form.settlementMode
  1643. );
  1644. }
  1645. if (this.$refs.sendAddress.getCheckedNodes()) {
  1646. let node = this.$refs.sendAddress.getCheckedNodes()[0];
  1647. if (node) {
  1648. this.otherForm.addressId = node.path.join();
  1649. this.otherForm.addressName = node.pathLabels.join();
  1650. } else {
  1651. this.otherForm.addressId = '';
  1652. this.otherForm.addressName = '';
  1653. }
  1654. }
  1655. if (!this.isUpdate) {
  1656. delete this.form.id;
  1657. } else {
  1658. // this.form.removeBankList = this.removeBankList;
  1659. // this.form.removeLinkList = this.removeLinkList;
  1660. }
  1661. this.form.type =
  1662. this.form.type != 1 ? (this.getLabel == '供货列表' ? '2' : '3') : 1;
  1663. console.log(this.form, 'this.form~~~~~~~~');
  1664. const data = {
  1665. base: this.form,
  1666. other: this.otherForm,
  1667. bankList: this.tableBankData,
  1668. linkList: this.tableLinkData,
  1669. productList: this.supplyList
  1670. };
  1671. if (this.isUpdate) {
  1672. contactUpdate(data)
  1673. .then((res) => {
  1674. this.loading = false;
  1675. this.$message.success('修改成功');
  1676. if (type == 'sub') {
  1677. this.contactSubmit(res);
  1678. return;
  1679. }
  1680. this.cancel();
  1681. this.$emit('done');
  1682. })
  1683. .catch((e) => {
  1684. //this.loading = false;
  1685. });
  1686. } else {
  1687. contactSave(data)
  1688. .then((id) => {
  1689. this.loading = false;
  1690. this.$message.success('新增成功');
  1691. this.tableCertificateDataList.forEach((item) => {
  1692. item['relationId'] = id;
  1693. item['relationName'] = this.form.name;
  1694. contactQcPackSaveAPI(item);
  1695. });
  1696. if (type == 'sub') {
  1697. this.contactSubmit(id);
  1698. return;
  1699. }
  1700. this.cancel();
  1701. this._getById(id);
  1702. this.title = '编辑';
  1703. this.$emit('done');
  1704. this.isUpdate = true;
  1705. })
  1706. .catch((e) => {
  1707. //this.loading = false;
  1708. });
  1709. }
  1710. } catch (error) {
  1711. console.log(error);
  1712. // 表单验证未通过,不执行保存操作
  1713. }
  1714. },
  1715. reload() {
  1716. this.cancel();
  1717. this.$emit('done');
  1718. },
  1719. cancel() {
  1720. this.$nextTick(() => {
  1721. this.activeName = '1';
  1722. // 关闭后,销毁所有的表单数据
  1723. this.resetForm()
  1724. this.visible = false;
  1725. });
  1726. },
  1727. resetForm() {
  1728. this.$set(this, 'form', copyObj(this.formDef));
  1729. this.$set(this, 'otherForm', copyObj(this.otherFormDef));
  1730. this.$set(this, 'tableBankData', []);
  1731. this.$set(this, 'tableLinkData', []);
  1732. this.$set(this, 'categoryIdList', []);
  1733. this.$set(this, 'tableCertificateDataList', []);
  1734. this.$set(this, 'supplyList', []);
  1735. // this.form = copyObj(this.formDef);
  1736. // this.otherForm = copyObj(this.otherFormDef);
  1737. // this.tableBankData = [];
  1738. // this.tableLinkData = [];
  1739. // this.categoryIdList = [];
  1740. // this.tableCertificateDataList = [];
  1741. this.$refs['otherForm'] && this.$refs['otherForm'].resetFields();
  1742. this.$refs['form'] && this.$refs['form'].resetFields();
  1743. },
  1744. async _getById(id) {
  1745. const data = await contactDetail(id);
  1746. this.form = data.base;
  1747. this.otherForm = data.other;
  1748. this.tableBankData = data.bankList;
  1749. this.tableLinkData = data.linkList;
  1750. this.supplyList = data.productList || [];
  1751. // this.tableCertificateDataAdd({});
  1752. this.form.qualificationCensorship =
  1753. this.form.qualificationCensorship || this.enableStatus || '2';
  1754. // if (data.base.businessLicenseFile && data.base.businessLicenseFile.uid) {
  1755. // this.$set(this.form, 'businessLicenseFiles', [
  1756. // data.base.businessLicenseFile
  1757. // ]);
  1758. // }
  1759. this.categoryIdList = this.form.categoryId
  1760. ? deepClone(this.form.categoryId.split(','))
  1761. : [];
  1762. this.$nextTick(() => {
  1763. this.$refs.certificateManagementRef &&
  1764. this.$refs.certificateManagementRef.init(
  1765. this.form.type != 1
  1766. ? this.getLabel == '供货列表'
  1767. ? '3'
  1768. : '6'
  1769. : '4',
  1770. this.form.id,
  1771. this.form.name
  1772. );
  1773. });
  1774. if (this.tableLinkData && this.tableLinkData.length > 0) {
  1775. this.tableLinkData.forEach((e) => (e.status = e.status + ''));
  1776. }
  1777. if (this.otherForm.settlementMode) {
  1778. this.otherForm.settlementMode = this.otherForm.settlementMode + '';
  1779. }
  1780. if (this.form.level) {
  1781. this.form.level = this.form.level + '';
  1782. }
  1783. // 回显地址选择器
  1784. if (this.form.addressId && this.form.addressId.length > 0) {
  1785. this.form.addressId = this.form.addressId.split(',');
  1786. }
  1787. if (this.otherForm.addressId && this.otherForm.addressId.length > 0) {
  1788. this.otherForm.addressId = this.otherForm.addressId.split(',');
  1789. }
  1790. if (this.otherForm.deptId) {
  1791. // 编辑时,默认查询组织相关的用户列表,用于回显
  1792. this.$nextTick(async () => {
  1793. await this.$refs.directorRef.getList({
  1794. groupId: this.otherForm.deptId
  1795. });
  1796. });
  1797. }
  1798. },
  1799. //选择产品
  1800. handSelectSupply() {
  1801. this.$refs.productListRef.open(this.supplyList, -1);
  1802. },
  1803. getSupplyList(obj) {
  1804. obj.forEach((item, index) => {
  1805. let params = {};
  1806. this.$set(params, 'contactId', this.row.id);
  1807. this.$set(params, 'productId', item.id);
  1808. this.$set(params, 'categoryName', item.name);
  1809. this.$set(params, 'productCategoryId', item.categoryLevelId);
  1810. this.$set(params, 'productBrand', item.brandNum);
  1811. this.$set(params, 'productCategoryName', item.categoryLevelPath);
  1812. this.$set(params, 'productCode', item.code);
  1813. this.$set(params, 'productName', item.name);
  1814. this.$set(params, 'modelType', item.modelType);
  1815. this.$set(params, 'availableCountBase', item.availableCountBase);
  1816. this.$set(params, 'measuringUnit', item.measuringUnit);
  1817. this.$set(params, 'specification', item.specification);
  1818. this.$set(params, 'weightUnit', item.weightUnit);
  1819. this.$set(params, 'imgCode', item.imgCode);
  1820. this.$set(params, 'produceType', item.componentAttribute);
  1821. this.$set(params, 'approvalNumber', item.approvalNumber);
  1822. this.$set(params, 'packingSpecification', item.packingSpecification);
  1823. if (item.purchaseOrigins?.length) {
  1824. item.purchaseOrigins = item.purchaseOrigins.map((val) => val + '');
  1825. }
  1826. this.$set(params, 'provenance', item.purchaseOrigins || []);
  1827. this.supplyList.push(params);
  1828. });
  1829. },
  1830. //删除供货产品
  1831. handleRemoveSupply(index) {
  1832. this.supplyList.splice(index, 1);
  1833. },
  1834. handParent() {
  1835. let item = {
  1836. id: this.form.parentId
  1837. };
  1838. this.$refs.parentRef.open(item);
  1839. },
  1840. changeParent(obj) {
  1841. this.$set(this.form, 'parentId', obj.id);
  1842. this.$set(this.form, 'parentName', obj.name);
  1843. },
  1844. changeAddress1(e) {
  1845. if (e.length) {
  1846. this.form.address = '/';
  1847. return;
  1848. }
  1849. this.form.address = '';
  1850. },
  1851. changeAddress2(e) {
  1852. if (e.length) {
  1853. this.otherForm.address = '/';
  1854. return;
  1855. }
  1856. this.otherForm.address = '';
  1857. console.log(e);
  1858. }
  1859. }
  1860. };
  1861. </script>