addContactDialog.vue 48 KB

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