addContactDialog.vue 61 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980
  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. @header-dragend="handleHeaderDragend">
  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. @header-dragend="onSub1HeaderDragend">
  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. @header-dragend="handleHeaderDragend"> -->
  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. @header-dragend="onSub2HeaderDragend">
  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. contactApprovalEnabled
  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. import { saveOrEdit } from '@/api/saleManage/contact';
  856. import tabMixins from '@/mixins/tableColumnsMixin';
  857. export default {
  858. props: {
  859. categoryTreeList: Array
  860. },
  861. mixins: [dictMixins, tabMixins],
  862. components: {
  863. processSubmitDialog,
  864. // fileMain,
  865. searchTable,
  866. certificateQualificationsDialog,
  867. fileUpload,
  868. deptSelect,
  869. personSelect,
  870. parentList,
  871. productList,
  872. certificateManagement
  873. },
  874. data() {
  875. let formDef = {
  876. objectType: 1,
  877. address: '',
  878. addressId: '',
  879. addressName: '',
  880. authorizationLimit: 0,
  881. businessLicenseFiles: [],
  882. businessLicenseFile: [],
  883. businessScope: '',
  884. categoryId: '',
  885. companyCategoryId: '',
  886. companyCategoryName: '',
  887. enterpriseTypeId: '',
  888. enterpriseTypeName: '',
  889. legalPerson: '',
  890. registeredCapital: '',
  891. parentId: '',
  892. industry: '',
  893. industryCode: '',
  894. industryFullName: '',
  895. mainProduct: '',
  896. name: '',
  897. officialIndustry: '',
  898. phone: '',
  899. registerDate: '',
  900. remark: '',
  901. serialNo: '',
  902. simpleName: '',
  903. type: 1,
  904. unifiedSocialCreditCode: '',
  905. enterpriseHonor: '',
  906. enterpriseScale: '',
  907. staffCount: '',
  908. enterpriseProfile: '',
  909. englishName: '',
  910. taxpayerQualification: '',
  911. qualificationCensorship: '2'
  912. };
  913. let otherFormDef = {
  914. settlementMode: '',
  915. settlementModeName: '',
  916. taxRate: 0,
  917. address: '',
  918. addressId: '',
  919. deptId: '',
  920. deptName: '',
  921. discount: 0,
  922. salesmanId: '',
  923. salesmanName: '',
  924. sender: '',
  925. senderPhone: ''
  926. };
  927. return {
  928. cacheKeyUrl: 'views_saleManage_contact_components_addContactDialog',
  929. enableStatus: '2',
  930. contactApprovalEnabled: false,
  931. fullscreen: false,
  932. visible: false,
  933. certificateQualificationsDialogFlag: false,
  934. processSubmitDialogFlag: false,
  935. title: '',
  936. row: {},
  937. activeName: '1',
  938. formDef,
  939. editVersion: null,
  940. supplyList: [],
  941. otherFormDef,
  942. form: copyObj(formDef),
  943. otherForm: copyObj(otherFormDef),
  944. // removeBankList: [],
  945. // removeLinkList: [],
  946. tableBankData: [],
  947. tableLinkData: [],
  948. categoryIdList: [],
  949. dictList: {},
  950. ifChiefList: [
  951. {
  952. value: 0,
  953. label: '否'
  954. },
  955. {
  956. value: 1,
  957. label: '是'
  958. }
  959. ],
  960. _bankColumns: [
  961. {
  962. type: 'index',
  963. width: 55,
  964. align: 'center'
  965. },
  966. {
  967. label: '单位名称',
  968. prop: 'accountName',
  969. slot: 'accountName',
  970. action: 'accountName',
  971. headerSlot: 'accountNameHeader',
  972. align: 'center'
  973. },
  974. {
  975. label: '银行账号',
  976. prop: 'accountNo',
  977. slot: 'accountNo',
  978. action: 'accountNo',
  979. align: 'center'
  980. },
  981. {
  982. label: '开户行',
  983. prop: 'bankName',
  984. slot: 'bankName',
  985. action: 'bankName',
  986. align: 'center'
  987. },
  988. {
  989. label: '银行银联号',
  990. prop: 'interbankNo',
  991. slot: 'interbankNo',
  992. action: 'interbankNo',
  993. align: 'center'
  994. },
  995. {
  996. action: 'action',
  997. slot: 'action',
  998. label: '操作',
  999. align: 'center'
  1000. }
  1001. ],
  1002. _certificateColumns: [
  1003. {
  1004. type: 'index',
  1005. width: 55,
  1006. align: 'center'
  1007. },
  1008. {
  1009. label: '编码',
  1010. prop: 'code',
  1011. slot: 'code',
  1012. align: 'center',
  1013. minWidth: 120
  1014. },
  1015. {
  1016. label: '名称',
  1017. prop: 'name',
  1018. slot: 'name',
  1019. align: 'center',
  1020. minWidth: 120
  1021. },
  1022. {
  1023. label: '创建时间',
  1024. prop: 'createTime',
  1025. slot: 'createTime',
  1026. align: 'center',
  1027. minWidth: 120
  1028. },
  1029. {
  1030. label: '状态',
  1031. prop: 'processStatus',
  1032. slot: 'processStatus',
  1033. align: 'center',
  1034. width: 120,
  1035. formatter: (_row, _column, cellValue) => {
  1036. return reviewStatus[_row.processStatus];
  1037. }
  1038. },
  1039. {
  1040. label: '备注',
  1041. prop: 'remark',
  1042. slot: 'remark',
  1043. align: 'center',
  1044. minWidth: 120
  1045. },
  1046. {
  1047. action: 'action',
  1048. slot: 'action',
  1049. label: '操作',
  1050. align: 'center',
  1051. width: 200
  1052. }
  1053. ],
  1054. otherRules: {
  1055. // settlementMode: [
  1056. // { required: true, message: '请输入结算方式', trigger: 'blur' }
  1057. // ],
  1058. address: [
  1059. { required: false, message: '请选择地址', trigger: 'change' }
  1060. ]
  1061. },
  1062. options: {
  1063. cityData,
  1064. categoryData
  1065. },
  1066. // 提交状态
  1067. loading: false,
  1068. // 是否是修改
  1069. isUpdate: false,
  1070. // 组织机构树形结构数据
  1071. groupTreeData: [],
  1072. // 组织机构平铺数据
  1073. groupData: [],
  1074. parentShow: false,
  1075. tableCertificateDataList: []
  1076. };
  1077. },
  1078. computed: {
  1079. // 标准 mixin 列宽持久化:包成 computed 让 applyColumnWidth 应用缓存列宽
  1080. certificateColumns() {
  1081. this.columnsVersion;
  1082. return this.applyColumnWidth(this._certificateColumns);
  1083. },
  1084. bankColumns() {
  1085. this.columnsVersion;
  1086. return this.applyColumnWidth(this._bankColumns);
  1087. },
  1088. rules() {
  1089. return {
  1090. categoryId: [
  1091. { required: true, message: '请选择分类', trigger: 'change' }
  1092. ],
  1093. name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
  1094. unifiedSocialCreditCode: [
  1095. {
  1096. required: this.form.objectType == 1 ? true : false,
  1097. message: '请输入统一社会信用代码',
  1098. trigger: 'blur'
  1099. }
  1100. ],
  1101. authorizationLimit: [
  1102. { required: true, message: '请输入授信额度', trigger: 'blur' }
  1103. ],
  1104. // addressId: [
  1105. // { required: true, message: '请选择地址', trigger: 'change' }
  1106. // ],
  1107. // qualificationCensorship: [
  1108. // { required: true, message: '请选择', trigger: 'change' }
  1109. // ]
  1110. }
  1111. },
  1112. clientEnvironmentId() {
  1113. return this.$store.state.user.info.clientEnvironmentId;
  1114. },
  1115. linkColumns() {
  1116. // 副表(联系人信息)列宽持久化,scope: sub1
  1117. this.columnsVersion;
  1118. return this.applyScopedColumnWidth( [{
  1119. type: 'index',
  1120. width: 55,
  1121. align: 'center'
  1122. },
  1123. {
  1124. label: '姓名',
  1125. prop: 'linkName',
  1126. slot: 'linkName',
  1127. action: 'linkName',
  1128. headerSlot: 'linkNameHeader',
  1129. align: 'center'
  1130. },
  1131. {
  1132. label: '手机',
  1133. prop: 'mobilePhone',
  1134. slot: 'mobilePhone',
  1135. action: 'mobilePhone',
  1136. // headerSlot: 'mobilePhoneHeader',
  1137. align: 'center'
  1138. },
  1139. {
  1140. label: '电话',
  1141. prop: 'phone',
  1142. slot: 'phone',
  1143. action: 'phone',
  1144. align: 'center'
  1145. },
  1146. {
  1147. label: '微信号',
  1148. prop: 'wechat',
  1149. slot: 'wechat',
  1150. action: 'wechat',
  1151. align: 'center'
  1152. },
  1153. {
  1154. label: '邮箱',
  1155. prop: 'email',
  1156. slot: 'email',
  1157. action: 'email',
  1158. align: 'center'
  1159. },
  1160. {
  1161. label: '部门',
  1162. prop: 'deptName',
  1163. slot: 'deptName',
  1164. action: 'deptName',
  1165. align: 'center'
  1166. },
  1167. {
  1168. label: '职务',
  1169. prop: 'post',
  1170. slot: 'post',
  1171. action: 'post',
  1172. align: 'center'
  1173. },
  1174. {
  1175. label: '状态',
  1176. prop: 'status',
  1177. slot: 'status',
  1178. action: 'status',
  1179. headerSlot: 'statusHeader',
  1180. align: 'center'
  1181. },
  1182. {
  1183. label: '是否首要',
  1184. prop: 'ifChief',
  1185. slot: 'ifChief',
  1186. action: 'ifChief',
  1187. align: 'center'
  1188. },
  1189. {
  1190. label: `是否默认${this.form.type == 1 ? '收件' : '寄件'}人`,
  1191. prop: 'isDefault',
  1192. slot: 'isDefault',
  1193. align: 'center'
  1194. },
  1195. {
  1196. label: '备注',
  1197. prop: 'remark',
  1198. slot: 'remark',
  1199. action: 'remark',
  1200. align: 'center'
  1201. },
  1202. {
  1203. action: 'action',
  1204. slot: 'action',
  1205. label: '操作',
  1206. align: 'center'
  1207. }
  1208. ], 'sub1');
  1209. },
  1210. getLabel() {
  1211. return this.categoryIdList
  1212. .map((item) => {
  1213. let data = this.$refs?.treeSelect?.getNodeByValue(item);
  1214. return data?.rootCategoryLevelId;
  1215. })
  1216. .includes('20250317001')
  1217. ? '生产列表'
  1218. : '供货列表';
  1219. },
  1220. supplyColumns() {
  1221. // 副表(供货列表)列宽持久化,scope: sub2
  1222. this.columnsVersion;
  1223. return this.applyScopedColumnWidth( [{
  1224. columnKey: 'index',
  1225. type: 'index',
  1226. width: 50,
  1227. align: 'center',
  1228. showOverflowTooltip: true,
  1229. label: '序号'
  1230. },
  1231. {
  1232. prop: 'productCode',
  1233. label: '编码',
  1234. align: 'center',
  1235. showOverflowTooltip: true,
  1236. minWidth: 110
  1237. },
  1238. {
  1239. prop: 'productName',
  1240. label: '名称',
  1241. align: 'center',
  1242. showOverflowTooltip: true,
  1243. minWidth: 110
  1244. },
  1245. {
  1246. prop: 'purchasingCycle',
  1247. label: '采购周期',
  1248. align: 'center',
  1249. slot: 'purchasingCycle',
  1250. showOverflowTooltip: true,
  1251. minWidth: 150
  1252. },
  1253. {
  1254. prop: 'purchaseMultiplier',
  1255. label: '倍数',
  1256. slot: 'purchaseMultiplier',
  1257. align: 'center',
  1258. showOverflowTooltip: true,
  1259. minWidth: 100
  1260. },
  1261. {
  1262. prop: 'minimumOrderQuantity',
  1263. label: '最低订购数量',
  1264. slot: 'minimumOrderQuantity',
  1265. align: 'center',
  1266. showOverflowTooltip: true,
  1267. minWidth: 150
  1268. },
  1269. {
  1270. prop: 'provenance',
  1271. label: '产地',
  1272. slot: 'provenance',
  1273. align: 'center',
  1274. showOverflowTooltip: true,
  1275. minWidth: 200
  1276. },
  1277. {
  1278. prop: 'manufacturer',
  1279. label: '生产厂家',
  1280. slot: 'manufacturer',
  1281. align: 'center',
  1282. showOverflowTooltip: true,
  1283. minWidth: 200,
  1284. show: this.getLabel == '供货列表'
  1285. },
  1286. {
  1287. prop: 'imgCode',
  1288. align: 'center',
  1289. label: '图号/件号',
  1290. showOverflowTooltip: true,
  1291. minWidth: 110
  1292. },
  1293. {
  1294. prop: 'produceType',
  1295. align: 'center',
  1296. label: '属性类型',
  1297. showOverflowTooltip: true,
  1298. minWidth: 110,
  1299. formatter: (row, column) => {
  1300. if (row.produceType) {
  1301. return row.produceType
  1302. .map((item) => {
  1303. return lbjtList[item];
  1304. })
  1305. .toString();
  1306. }
  1307. }
  1308. },
  1309. {
  1310. prop: 'packingSpecification',
  1311. align: 'center',
  1312. label: '包装规格',
  1313. showOverflowTooltip: true,
  1314. minWidth: 110
  1315. },
  1316. {
  1317. prop: 'brandNum',
  1318. align: 'center',
  1319. label: '牌号',
  1320. showOverflowTooltip: true
  1321. },
  1322. {
  1323. prop: 'modelType',
  1324. label: '型号',
  1325. align: 'center',
  1326. showOverflowTooltip: true
  1327. },
  1328. {
  1329. prop: 'specification',
  1330. label: '规格',
  1331. align: 'center',
  1332. showOverflowTooltip: true
  1333. },
  1334. {
  1335. prop: 'measuringUnit',
  1336. label: '计量单位',
  1337. showOverflowTooltip: true,
  1338. align: 'center',
  1339. minWidth: 90
  1340. },
  1341. {
  1342. prop: 'createTime',
  1343. label: '创建时间',
  1344. showOverflowTooltip: true,
  1345. align: 'center',
  1346. minWidth: 160
  1347. },
  1348. {
  1349. slot: 'action',
  1350. align: 'center',
  1351. minWidth: 90,
  1352. fixed: 'right',
  1353. label: '操作'
  1354. }
  1355. ], 'sub2');
  1356. }
  1357. },
  1358. watch: {
  1359. categoryIdList(val) {
  1360. if (val.length > 0) {
  1361. this.$refs.form?.clearValidate('categoryId');
  1362. this.form.categoryId = this.categoryIdList.join(',');
  1363. } else {
  1364. this.form.categoryId = '';
  1365. this.$refs.form?.validateField('categoryId');
  1366. }
  1367. }
  1368. },
  1369. created() {
  1370. this.getGroupAll();
  1371. this.requestDict('生产类型');
  1372. // 副表(联系人信息、供货列表)列宽缓存,与主表列配置隔离
  1373. this.loadScopedColumnWidth('sub1');
  1374. this.loadScopedColumnWidth('sub2');
  1375. parameterGetByCode({ code: 'contact_is_approval' }).then((res) => {
  1376. this.contactApprovalEnabled = String(res.value) === '1';
  1377. });
  1378. },
  1379. methods: {
  1380. // 副表(联系人信息)表头拖拽列宽持久化,scope: sub1
  1381. onSub1HeaderDragend(newWidth, oldWidth, column) {
  1382. this.persistScopedColumnWidth(
  1383. 'sub1',
  1384. column && (column.property || column.columnKey),
  1385. newWidth
  1386. );
  1387. },
  1388. // 副表(供货列表)表头拖拽列宽持久化,scope: sub2
  1389. onSub2HeaderDragend(newWidth, oldWidth, column) {
  1390. this.persistScopedColumnWidth(
  1391. 'sub2',
  1392. column && (column.property || column.columnKey),
  1393. newWidth
  1394. );
  1395. },
  1396. async open(type, row, contactCategoryId, pageType) {
  1397. this.resetForm()
  1398. this.editVersion = null;
  1399. // return
  1400. this.form.type = pageType || 1;
  1401. this.title = type;
  1402. this.row = row;
  1403. this.visible = true;
  1404. if (!row.id) {
  1405. console.log('新增', this.form);
  1406. this.isUpdate = false;
  1407. // 默认带出列表页面选中的分类
  1408. this.$nextTick(() => {
  1409. this.categoryIdList = contactCategoryId ? [contactCategoryId] : [];
  1410. // 客户审查 //2不启用 1启用
  1411. parameterGetByCode({
  1412. code: 'eom_saleManage_contact_qualificationCensorship'
  1413. }).then((res) => {
  1414. console.log('客户审查', res)
  1415. this.form.qualificationCensorship = res.value;
  1416. this.enableStatus = res.value
  1417. });
  1418. this.$refs.certificateManagementRef &&
  1419. this.$refs.certificateManagementRef.init(
  1420. this.form.type != 1
  1421. ? this.getLabel == '供货列表'
  1422. ? '3'
  1423. : '6'
  1424. : '4',
  1425. this.form.id,
  1426. this.form.name,
  1427. true
  1428. );
  1429. });
  1430. } else {
  1431. this.isUpdate = true;
  1432. await this._getById(row.id);
  1433. }
  1434. },
  1435. handleActive(val) {
  1436. console.log(val);
  1437. },
  1438. nameChange() {
  1439. this.tableBankData.forEach((item) => {
  1440. item.accountName = this.form.name;
  1441. });
  1442. },
  1443. // 获取公司数据
  1444. getGroupAll() {
  1445. listOrganizations().then((list) => {
  1446. this.groupData = list;
  1447. this.groupTreeData = this.$util.toTreeData({
  1448. data: list,
  1449. idField: 'id',
  1450. parentIdField: 'parentId'
  1451. });
  1452. });
  1453. },
  1454. // //新增/查看/修改资质
  1455. // addCertificate(type, row, index) {
  1456. // this.certificateQualificationsDialogFlag = true;
  1457. // this.$nextTick(() => {
  1458. // console.log(index);
  1459. // this.$refs.certificateQualificationsDialogRef.init(type, row, index);
  1460. // });
  1461. // },
  1462. // /* 证书资质表格数据源 */
  1463. // tableCertificateData() {
  1464. // contactQcPackPageAPI({
  1465. // certificationType: this.form.type,
  1466. // relationId: this.form.id
  1467. // }).then((res) => {
  1468. // this.tableCertificateDataList = res;
  1469. // });
  1470. // },
  1471. // tableCertificateDataAdd({ form = {}, index = '' }) {
  1472. // if (this.form.id) {
  1473. // this.tableCertificateData();
  1474. // } else {
  1475. // if (index + '') {
  1476. // this.$set(this.tableCertificateDataList, index, form);
  1477. // } else {
  1478. // this.tableCertificateDataList.push(form);
  1479. // }
  1480. // }
  1481. // },
  1482. // //删除资质包
  1483. // handleRemove(row) {
  1484. // contactQcPackDeleteAPI([row.id]).then((res) => {
  1485. // this.$message.success('删除成功!');
  1486. // this.tableCertificateDataAdd({});
  1487. // });
  1488. // },
  1489. //开启提交流程
  1490. async contactSubmit(row) {
  1491. const { base } = await contactDetail(this.form.id || row);
  1492. this.processSubmitDialogFlag = true;
  1493. this.$nextTick(() => {
  1494. let params = {
  1495. businessId: base.id,
  1496. businessKey: 'contact_approve',
  1497. formCreateUserId: base.createUserId,
  1498. variables: {
  1499. certificationType: 1,
  1500. businessCode: base.code,
  1501. businessName: base.name,
  1502. businessType: '客户审核'
  1503. }
  1504. };
  1505. this.$refs.processSubmitDialogRef.init(params);
  1506. });
  1507. },
  1508. //开启资质提交流程
  1509. async submit(row) {
  1510. this.processSubmitDialogFlag = true;
  1511. this.$nextTick(() => {
  1512. let params = {
  1513. businessId: row.id,
  1514. businessKey: 'contact_qc_approve',
  1515. formCreateUserId: row.createUserId,
  1516. variables: {
  1517. certificationType: this.form.type,
  1518. businessName: row.name
  1519. }
  1520. };
  1521. this.$refs.processSubmitDialogRef.init(params);
  1522. });
  1523. },
  1524. //获取代号
  1525. unifiedSocialCreditCodeChange(val) {
  1526. this.form.serialNo = this.form.serialNo || val.slice(-4);
  1527. },
  1528. // 选择负责人部门
  1529. change_principalDep(id) {
  1530. const info = this.groupData.find((e) => e.id == id);
  1531. this.otherForm.deptName = info.name;
  1532. this.otherForm.salesmanId = '';
  1533. this.otherForm.salesmanName = '';
  1534. // 根据部门获取人员
  1535. const params = { groupId: id };
  1536. this.$nextTick(() => {
  1537. this.$refs.directorRef.getList(params);
  1538. });
  1539. },
  1540. salesmanChange(val, info) {
  1541. this.otherForm.salesmanName = info.name;
  1542. },
  1543. settlementModeChange(info) {
  1544. this.otherForm.settlementModeName = info.dictValue;
  1545. },
  1546. ifChiefChange(value, idx) {
  1547. if (value === 1) {
  1548. this.tableLinkData.forEach((e) => (e.ifChief = 0));
  1549. this.tableLinkData[idx].ifChief = 1;
  1550. }
  1551. },
  1552. addBank() {
  1553. this.tableBankData.push({
  1554. accountName: this.form.name,
  1555. accountNo: '',
  1556. bankName: '',
  1557. interbankNo: ''
  1558. });
  1559. },
  1560. addLink() {
  1561. this.tableLinkData.push({
  1562. linkName: '',
  1563. mobilePhone: '',
  1564. phone: '',
  1565. email: '',
  1566. post: '',
  1567. status: '1',
  1568. ifChief: 0,
  1569. remark: ''
  1570. });
  1571. },
  1572. handleBankDel(row, index) {
  1573. this.tableBankData.splice(index, 1);
  1574. if (row?.id) {
  1575. // this.removeBankList.push(row.id);
  1576. }
  1577. },
  1578. handleLinkDel(row, index) {
  1579. this.tableLinkData.splice(index, 1);
  1580. if (row?.id) {
  1581. // this.removeLinkList.push(row.id);
  1582. }
  1583. },
  1584. formValid() {
  1585. return new Promise((resolve, reject) => {
  1586. this.$refs.form.validate((valid) => {
  1587. if (!valid) {
  1588. this.activeName = '1';
  1589. reject(false);
  1590. } else {
  1591. resolve(true);
  1592. }
  1593. });
  1594. });
  1595. },
  1596. otherFormValid() {
  1597. return new Promise((resolve, reject) => {
  1598. this.$refs.otherForm.validate((valid) => {
  1599. console.log(valid, 'valid');
  1600. if (!valid) {
  1601. this.activeName = '1';
  1602. reject(false);
  1603. } else {
  1604. resolve(true);
  1605. }
  1606. });
  1607. });
  1608. },
  1609. tableLinkDataValid() {
  1610. return new Promise((resolve, reject) => {
  1611. if (this.tableLinkData.length == 0) {
  1612. this.activeName = '3';
  1613. this.$message.error('联系人信息至少有1条');
  1614. reject(false);
  1615. } else {
  1616. resolve(true);
  1617. }
  1618. });
  1619. },
  1620. getValidate() {
  1621. return Promise.all([
  1622. this.formValid(),
  1623. this.otherFormValid(),
  1624. this.tableLinkDataValid()
  1625. ]);
  1626. },
  1627. async pageChange(type) {
  1628. if (type == 'up') {
  1629. this.activeName = (parseInt(this.activeName) - 1).toString();
  1630. }
  1631. if (type == 'next') {
  1632. if (this.activeName == '1' && !(await this.formValid())) {
  1633. return;
  1634. }
  1635. if (this.activeName == '3' && !(await this.tableLinkDataValid())) {
  1636. this.$message.error('联系人信息至少有1条');
  1637. return;
  1638. }
  1639. // if (this.activeName == 4 && !(await this.otherFormValid())) {
  1640. // return;
  1641. // }
  1642. this.activeName = (parseInt(this.activeName) + 1).toString();
  1643. }
  1644. },
  1645. async save(type = '') {
  1646. try {
  1647. await this.getValidate();
  1648. // 表单验证通过,执行保存操作
  1649. this.loading = true;
  1650. // 基本信息处理
  1651. if (this.$refs.address.getCheckedNodes()) {
  1652. let node = this.$refs.address.getCheckedNodes()[0];
  1653. if (node) {
  1654. this.form.addressId = node.path.join();
  1655. this.form.addressName = node.pathLabels.join();
  1656. } else {
  1657. this.form.addressId = '';
  1658. this.form.addressName = '';
  1659. }
  1660. }
  1661. this.form.categoryId = this.categoryIdList.join(',');
  1662. if (this.form.companyCategoryId) {
  1663. this.form.companyCategoryName = this.getDictValue(
  1664. '营业类型',
  1665. this.form.companyCategoryId
  1666. );
  1667. }
  1668. if (this.form.industryCode) {
  1669. this.form.industryFullName = this.getDictValue(
  1670. '所属行业',
  1671. this.form.industryCode
  1672. );
  1673. }
  1674. if (this.form.enterpriseTypeId) {
  1675. this.form.enterpriseTypeName = this.getDictValue(
  1676. '企业类型',
  1677. this.form.enterpriseTypeId
  1678. );
  1679. }
  1680. // if (
  1681. // this.form.businessLicenseFiles &&
  1682. // this.form.businessLicenseFiles.length > 0
  1683. // ) {
  1684. // this.form.businessLicenseFile = this.form.businessLicenseFiles[0];
  1685. // } else {
  1686. // this.form.businessLicenseFile = null;
  1687. // }
  1688. // 其他信息处理
  1689. if (this.form.settlementMode) {
  1690. this.form.settlementModeName = this.getDictValue(
  1691. '结算方式',
  1692. this.form.settlementMode
  1693. );
  1694. }
  1695. if (this.$refs.sendAddress.getCheckedNodes()) {
  1696. let node = this.$refs.sendAddress.getCheckedNodes()[0];
  1697. if (node) {
  1698. this.otherForm.addressId = node.path.join();
  1699. this.otherForm.addressName = node.pathLabels.join();
  1700. } else {
  1701. this.otherForm.addressId = '';
  1702. this.otherForm.addressName = '';
  1703. }
  1704. }
  1705. if (!this.isUpdate) {
  1706. delete this.form.id;
  1707. } else {
  1708. // this.form.removeBankList = this.removeBankList;
  1709. // this.form.removeLinkList = this.removeLinkList;
  1710. }
  1711. this.form.type =
  1712. this.form.type != 1 ? (this.getLabel == '供货列表' ? '2' : '3') : 1;
  1713. console.log(this.form, 'this.form~~~~~~~~');
  1714. const data = {
  1715. base: this.isUpdate ? { ...this.form, version: this.editVersion } : this.form,
  1716. other: this.otherForm,
  1717. bankList: this.tableBankData,
  1718. linkList: this.tableLinkData,
  1719. productList: this.supplyList
  1720. };
  1721. this.tableCertificateDataList = this.$refs.certificateManagementRef.getTableValue();
  1722. if (this.isUpdate) {
  1723. if (this.editVersion == null) {
  1724. this.loading = false;
  1725. this.$message.error('客户版本缺失,请刷新后重试');
  1726. return;
  1727. }
  1728. contactUpdate(data)
  1729. .then((res) => {
  1730. this.loading = false;
  1731. this.$message.success('修改成功');
  1732. if (type == 'sub') {
  1733. this.contactSubmit(res);
  1734. return;
  1735. }
  1736. this.cancel();
  1737. this.$emit('done');
  1738. })
  1739. .catch((e) => {
  1740. //this.loading = false;
  1741. });
  1742. } else {
  1743. contactSave(data)
  1744. .then(async (id) => {
  1745. this.loading = false;
  1746. this.$message.success('新增成功');
  1747. await Promise.all(this.tableCertificateDataList.map((item) => {
  1748. item['holderId'] = id;
  1749. item['holder'] = this.form.name;
  1750. return saveOrEdit(item);
  1751. })).catch((error) => {
  1752. this.$message.error('证书资质保存失败,请重试');
  1753. throw error;
  1754. });
  1755. if (type == 'sub') {
  1756. this.contactSubmit(id);
  1757. return;
  1758. }
  1759. this.cancel();
  1760. this._getById(id);
  1761. this.title = '编辑';
  1762. this.$emit('done');
  1763. this.isUpdate = true;
  1764. })
  1765. .catch((e) => {
  1766. //this.loading = false;
  1767. });
  1768. }
  1769. } catch (error) {
  1770. console.log(error);
  1771. // 表单验证未通过,不执行保存操作
  1772. }
  1773. },
  1774. reload() {
  1775. this.cancel();
  1776. this.$emit('done');
  1777. },
  1778. cancel() {
  1779. this.$nextTick(() => {
  1780. this.activeName = '1';
  1781. // 关闭后,销毁所有的表单数据
  1782. this.resetForm()
  1783. this.visible = false;
  1784. });
  1785. },
  1786. resetForm() {
  1787. this.$set(this, 'form', copyObj(this.formDef));
  1788. this.$set(this, 'otherForm', copyObj(this.otherFormDef));
  1789. this.$set(this, 'tableBankData', []);
  1790. this.$set(this, 'tableLinkData', []);
  1791. this.$set(this, 'categoryIdList', []);
  1792. this.$set(this, 'tableCertificateDataList', []);
  1793. this.$set(this, 'supplyList', []);
  1794. // this.form = copyObj(this.formDef);
  1795. // this.otherForm = copyObj(this.otherFormDef);
  1796. // this.tableBankData = [];
  1797. // this.tableLinkData = [];
  1798. // this.categoryIdList = [];
  1799. // this.tableCertificateDataList = [];
  1800. this.$refs['otherForm'] && this.$refs['otherForm'].resetFields();
  1801. this.$refs['form'] && this.$refs['form'].resetFields();
  1802. },
  1803. async _getById(id) {
  1804. const data = await contactDetail(id);
  1805. this.form = data.base;
  1806. this.editVersion = data.base.version;
  1807. this.otherForm = data.other;
  1808. this.tableBankData = data.bankList || [];
  1809. this.tableLinkData = data.linkList;
  1810. this.supplyList = data.productList || [];
  1811. // this.tableCertificateDataAdd({});
  1812. this.form.qualificationCensorship =
  1813. this.form.qualificationCensorship || this.enableStatus || '2';
  1814. // if (data.base.businessLicenseFile && data.base.businessLicenseFile.uid) {
  1815. // this.$set(this.form, 'businessLicenseFiles', [
  1816. // data.base.businessLicenseFile
  1817. // ]);
  1818. // }
  1819. this.categoryIdList = this.form.categoryId
  1820. ? deepClone(this.form.categoryId.split(','))
  1821. : [];
  1822. this.$nextTick(() => {
  1823. this.$refs.certificateManagementRef &&
  1824. this.$refs.certificateManagementRef.init(
  1825. this.form.type != 1
  1826. ? this.getLabel == '供货列表'
  1827. ? '3'
  1828. : '6'
  1829. : '4',
  1830. this.form.id,
  1831. this.form.name
  1832. );
  1833. });
  1834. if (this.tableLinkData && this.tableLinkData.length > 0) {
  1835. this.tableLinkData.forEach((e) => (e.status = e.status + ''));
  1836. }
  1837. if (this.otherForm.settlementMode) {
  1838. this.otherForm.settlementMode = this.otherForm.settlementMode + '';
  1839. }
  1840. if (this.form.level) {
  1841. this.form.level = this.form.level + '';
  1842. }
  1843. // 回显地址选择器
  1844. if (this.form.addressId && this.form.addressId.length > 0) {
  1845. this.form.addressId = this.form.addressId.split(',');
  1846. }
  1847. if (this.otherForm.addressId && this.otherForm.addressId.length > 0) {
  1848. this.otherForm.addressId = this.otherForm.addressId.split(',');
  1849. }
  1850. if (this.otherForm.deptId) {
  1851. // 编辑时,默认查询组织相关的用户列表,用于回显
  1852. this.$nextTick(async () => {
  1853. await this.$refs.directorRef.getList({
  1854. groupId: this.otherForm.deptId
  1855. });
  1856. });
  1857. }
  1858. },
  1859. //选择产品
  1860. handSelectSupply() {
  1861. this.$refs.productListRef.open(this.supplyList, -1);
  1862. },
  1863. getSupplyList(obj) {
  1864. obj.forEach((item, index) => {
  1865. let params = {};
  1866. this.$set(params, 'contactId', this.row.id);
  1867. this.$set(params, 'productId', item.id);
  1868. this.$set(params, 'categoryName', item.name);
  1869. this.$set(params, 'productCategoryId', item.categoryLevelId);
  1870. this.$set(params, 'productBrand', item.brandNum);
  1871. this.$set(params, 'productCategoryName', item.categoryLevelPath);
  1872. this.$set(params, 'productCode', item.code);
  1873. this.$set(params, 'productName', item.name);
  1874. this.$set(params, 'modelType', item.modelType);
  1875. this.$set(params, 'availableCountBase', item.availableCountBase);
  1876. this.$set(params, 'measuringUnit', item.measuringUnit);
  1877. this.$set(params, 'specification', item.specification);
  1878. this.$set(params, 'weightUnit', item.weightUnit);
  1879. this.$set(params, 'imgCode', item.imgCode);
  1880. this.$set(params, 'produceType', item.componentAttribute);
  1881. this.$set(params, 'approvalNumber', item.approvalNumber);
  1882. this.$set(params, 'packingSpecification', item.packingSpecification);
  1883. if (item.purchaseOrigins?.length) {
  1884. item.purchaseOrigins = item.purchaseOrigins.map((val) => val + '');
  1885. }
  1886. this.$set(params, 'provenance', item.purchaseOrigins || []);
  1887. this.supplyList.push(params);
  1888. });
  1889. },
  1890. //删除供货产品
  1891. handleRemoveSupply(index) {
  1892. this.supplyList.splice(index, 1);
  1893. },
  1894. handParent() {
  1895. let item = {
  1896. id: this.form.parentId
  1897. };
  1898. this.$refs.parentRef.open(item);
  1899. },
  1900. changeParent(obj) {
  1901. this.$set(this.form, 'parentId', obj.id);
  1902. this.$set(this.form, 'parentName', obj.name);
  1903. },
  1904. changeAddress1(e) {
  1905. if (e.length) {
  1906. this.form.address = '/';
  1907. return;
  1908. }
  1909. this.form.address = '';
  1910. },
  1911. changeAddress2(e) {
  1912. if (e.length) {
  1913. this.otherForm.address = '/';
  1914. return;
  1915. }
  1916. this.otherForm.address = '';
  1917. console.log(e);
  1918. }
  1919. }
  1920. };
  1921. </script>