detailsPageEdit.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945
  1. <template>
  2. <div class="borderless">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <!-- <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->
  6. <el-button
  7. type="danger"
  8. style="border: none;background: none;color: red"
  9. icon="el-icon-arrow-left"
  10. @click="backToList"
  11. >返回列表
  12. </el-button>
  13. </div>
  14. <div class="add-customer-btn">
  15. <el-button type="primary" @click="openFlow" size="small"
  16. >审 核
  17. </el-button>
  18. <el-button
  19. type="primary"
  20. :disabled="disabled"
  21. @click="editCustomer"
  22. size="small"
  23. >{{ form.id ? "确认修改" : "确认新增" }}
  24. </el-button>
  25. </div>
  26. </div>
  27. <div class="customer-main">
  28. <el-form
  29. :model="form"
  30. ref="form"
  31. label-width="100px"
  32. class="demo-ruleForm"
  33. >
  34. <containerTitle title="基础资料"></containerTitle>
  35. <basic-container>
  36. <el-row>
  37. <el-col
  38. v-for="(item, index) in basicData.column"
  39. :key="index"
  40. :span="item.span ? item.span : 8"
  41. >
  42. <el-form-item
  43. :label="item.label"
  44. :prop="item.prop"
  45. :rules="item.rules"
  46. >
  47. <avue-input-tree
  48. v-if="item.prop === 'corpsTypeId'"
  49. leaf-only
  50. multiple
  51. style="width: 100%;"
  52. size="small"
  53. :props="{ label: 'title' }"
  54. v-model="form[item.prop]"
  55. placeholder=" "
  56. type="tree"
  57. :dic="dic"
  58. ></avue-input-tree>
  59. <el-cascader
  60. v-else-if="item.prop === 'belongtoarea'"
  61. v-model="form[item.prop]"
  62. collapse-tags
  63. :options="dicArea"
  64. :props="props"
  65. size="small"
  66. style="width: 100%;"
  67. :show-all-levels="false"
  68. ></el-cascader>
  69. <el-select
  70. v-else-if="item.prop === 'adminProfiles'"
  71. size="small"
  72. style="width: 100%;"
  73. v-model="form[item.prop]"
  74. multiple
  75. placeholder=""
  76. >
  77. <el-option
  78. v-for="item in userList"
  79. :key="item.id"
  80. :label="item.name"
  81. :value="item.id"
  82. >
  83. </el-option>
  84. </el-select>
  85. <el-select
  86. v-else-if="item.prop === 'creditRating'"
  87. size="small"
  88. style="width: 100%;"
  89. v-model="form[item.prop]"
  90. placeholder=""
  91. >
  92. <el-option
  93. v-for="item in creditRatingList"
  94. :key="item.id"
  95. :label="item.dictValue"
  96. :value="item.dictValue"
  97. >
  98. </el-option>
  99. </el-select>
  100. <crop-select
  101. v-else-if="item.prop === 'belongtocompany'"
  102. v-model="form[item.prop]"
  103. corpType="GS"
  104. ></crop-select>
  105. <el-input
  106. type="age"
  107. v-else
  108. v-model="form[item.prop]"
  109. size="small"
  110. autocomplete="off"
  111. ></el-input>
  112. </el-form-item>
  113. </el-col>
  114. </el-row>
  115. </basic-container>
  116. <containerTitle title="联系方式"></containerTitle>
  117. <basic-container>
  118. <el-row>
  119. <el-col
  120. v-for="(item, index) in contactInformation.column"
  121. :key="index"
  122. :span="item.span ? item.span : 8"
  123. >
  124. <el-form-item
  125. :label="item.label"
  126. :prop="item.prop"
  127. :rules="item.rules"
  128. >
  129. <el-input
  130. type="age"
  131. v-model="form[item.prop]"
  132. size="small"
  133. autocomplete="off"
  134. ></el-input>
  135. </el-form-item>
  136. </el-col>
  137. </el-row>
  138. </basic-container>
  139. <containerTitle title="财务资料"></containerTitle>
  140. <basic-container>
  141. <el-row>
  142. <el-col
  143. v-for="(item, index) in financialInformation.column"
  144. :key="index"
  145. :span="item.span ? item.span : 8"
  146. >
  147. <el-form-item
  148. :label="item.label"
  149. :prop="item.prop"
  150. :rules="item.rules"
  151. >
  152. <el-switch
  153. v-if="item.prop === 'creditstatus'"
  154. v-model="form[item.prop]"
  155. active-value="0"
  156. inactive-value="1"
  157. active-text="开启"
  158. inactive-text="关闭"
  159. >
  160. </el-switch>
  161. <el-select
  162. v-else-if="item.prop === 'paymentType'"
  163. v-model="form[item.prop]"
  164. clearable
  165. filterable
  166. size="small"
  167. style="width: 100%;"
  168. >
  169. <el-option
  170. v-for="(item, index) in paymentOption"
  171. :key="index"
  172. :label="item.dictValue"
  173. :value="item.dictValue"
  174. ></el-option>
  175. </el-select>
  176. <el-input
  177. v-else
  178. type="age"
  179. v-model="form[item.prop]"
  180. size="small"
  181. autocomplete="off"
  182. ></el-input>
  183. </el-form-item>
  184. </el-col>
  185. </el-row>
  186. </basic-container>
  187. <containerTitle title="客户联系人"></containerTitle>
  188. <basic-container>
  189. <avue-crud
  190. ref="crud"
  191. :option="customerContact"
  192. v-model="contactsForm"
  193. :data="contactsData"
  194. @saveColumn="saveColumn"
  195. @resetColumn="resetColumn"
  196. @row-save="rowSave"
  197. @row-update="rowUpdate"
  198. @row-del="rowDel"
  199. ></avue-crud>
  200. </basic-container>
  201. <!-- <containerTitle title="客户优势项目"></containerTitle>
  202. <basic-container style="margin-bottom: 10px">
  203. <avue-crud
  204. :option="advantageProject"
  205. v-model="advantageProjectForm"
  206. :data="advantageProjectData"
  207. @row-save="rowSaveProject"
  208. @row-update="rowUpdateProject"
  209. @row-del="rowDelProject"
  210. ></avue-crud>
  211. </basic-container> -->
  212. <containerTitle title="客户开户行"></containerTitle>
  213. <basic-container>
  214. <avue-crud
  215. ref="crud2"
  216. :option="bankOfDeposit"
  217. v-model="bankOfDepositForm"
  218. :data="bankOfDepositData"
  219. @saveColumn="saveColumn2"
  220. @resetColumn="resetColumn2"
  221. @row-save="rowSaveBankOfDeposit"
  222. @row-update="rowUpdateBankOfDeposit"
  223. @row-del="rowDelBankOfDeposit"
  224. ></avue-crud>
  225. </basic-container>
  226. <containerTitle title="收发货地址"></containerTitle>
  227. <basic-container>
  228. <avue-crud
  229. ref="crud3"
  230. :option="addressOption"
  231. v-model="addressForm"
  232. :data="addressData"
  233. @saveColumn="saveColumn3"
  234. @resetColumn="resetColumn3"
  235. @row-save="rowSaveAddress"
  236. @row-update="rowUpdateAddress"
  237. @row-del="rowDelAddress"
  238. ></avue-crud>
  239. </basic-container>
  240. </el-form>
  241. </div>
  242. <flow-dialog :switchDialog="switchDialog" @onClose="onClose()">
  243. <template slot="content"> </template>
  244. </flow-dialog>
  245. </div>
  246. </template>
  247. <script>
  248. import {
  249. customerList,
  250. typeSave,
  251. detail,
  252. deleteDetails,
  253. corpstypeTree,
  254. corpsattn,
  255. corpsbank,
  256. corpsfiles,
  257. corpsitem,
  258. areaTypeTree,
  259. corpsAddrDelete
  260. } from "@/api/basicData/customerInformation";
  261. import customerContact from "./configuration/customerContact.json";
  262. import advantageProject from "./configuration/advantageProject.json";
  263. import bankOfDeposit from "./configuration/bankOfDeposit.json";
  264. import flowDialog from "@/components/flow-dialog/main";
  265. import { supplierParameter } from "@/enums/management-type";
  266. import { gainUser } from "@/api/basicData/customerInquiry";
  267. import addressOption from "./configuration/addressOption.json";
  268. export default {
  269. name: "detailsPage",
  270. data() {
  271. return {
  272. switchDialog: false,
  273. form: {},
  274. disabled: false,
  275. contactsForm: {},
  276. creditRatingList: [],
  277. advantageProjectForm: {},
  278. bankOfDepositForm: {},
  279. contactsData: [],
  280. advantageProjectData: [],
  281. bankOfDepositData: [],
  282. dic: [],
  283. dicArea: [],
  284. props: {
  285. value: "name",
  286. label: "name",
  287. multiple: true
  288. },
  289. customerContact: {},
  290. advantageProject:advantageProject,
  291. bankOfDeposit: {},
  292. contactInformation: {
  293. column: [
  294. {
  295. label: "联系人",
  296. prop: "attn",
  297. rules: [
  298. {
  299. required: false,
  300. message: "请输入联系人",
  301. trigger: "blur"
  302. }
  303. ]
  304. },
  305. {
  306. label: "联系电话",
  307. prop: "tel",
  308. rules: [
  309. {
  310. required: false,
  311. message: "请输入联系电话",
  312. trigger: "blur"
  313. }
  314. ]
  315. },
  316. {
  317. label: "职位",
  318. prop: "position",
  319. rules: [
  320. {
  321. required: false,
  322. message: "请输入联系电话",
  323. trigger: "blur"
  324. }
  325. ]
  326. },
  327. {
  328. label: "单位地址",
  329. prop: "addr",
  330. rules: [
  331. {
  332. required: false,
  333. message: "请输入单位地址",
  334. trigger: "blur"
  335. }
  336. ]
  337. },
  338. {
  339. label: "仓库地址",
  340. prop: "storageAddr",
  341. rules: [
  342. {
  343. required: false,
  344. message: "请输入仓库地址",
  345. trigger: "blur"
  346. }
  347. ]
  348. },
  349. {
  350. label: "分仓地址",
  351. prop: "subStorageAddr",
  352. rules: [
  353. {
  354. required: false,
  355. message: "请输入分仓地址",
  356. trigger: "blur"
  357. }
  358. ]
  359. }
  360. ]
  361. },
  362. financialInformation: {
  363. column: [
  364. {
  365. label: "账户名称",
  366. prop: "accountName",
  367. rules: [
  368. {
  369. required: false,
  370. message: " ",
  371. trigger: "blur"
  372. }
  373. ]
  374. },
  375. {
  376. label: "开户银行",
  377. prop: "accountBank",
  378. rules: [
  379. {
  380. required: false,
  381. message: " ",
  382. trigger: "blur"
  383. }
  384. ]
  385. },
  386. {
  387. label: "银行帐号",
  388. prop: "accountNo",
  389. rules: [
  390. {
  391. required: false,
  392. message: " ",
  393. trigger: "blur"
  394. }
  395. ]
  396. },
  397. {
  398. label: "外币账户名称",
  399. prop: "accountNameFcy",
  400. rules: [
  401. {
  402. required: false,
  403. message: " ",
  404. trigger: "blur"
  405. }
  406. ]
  407. },
  408. {
  409. label: "外币开户银行",
  410. prop: "accountBankFcy",
  411. rules: [
  412. {
  413. required: false,
  414. message: " ",
  415. trigger: "blur"
  416. }
  417. ]
  418. },
  419. {
  420. label: "外币银行账号",
  421. prop: "accountNoFcy",
  422. rules: [
  423. {
  424. required: false,
  425. message: " ",
  426. trigger: "blur"
  427. }
  428. ]
  429. },
  430. {
  431. label: "授信状态",
  432. prop: "creditstatus",
  433. rules: [
  434. {
  435. required: false,
  436. message: " ",
  437. trigger: "blur"
  438. }
  439. ]
  440. },
  441. {
  442. label: "授信等级",
  443. prop: "creditLevel",
  444. rules: [
  445. {
  446. required: false,
  447. message: " ",
  448. trigger: "blur"
  449. }
  450. ]
  451. },
  452. {
  453. label: "授信额度",
  454. prop: "creditGrant",
  455. rules: [
  456. {
  457. required: false,
  458. message: " ",
  459. trigger: "blur"
  460. }
  461. ]
  462. },
  463. {
  464. label: "授信天数",
  465. prop: "creditDay",
  466. rules: [
  467. {
  468. required: false,
  469. message: " ",
  470. trigger: "blur"
  471. }
  472. ]
  473. },
  474. {
  475. label: "授信利率",
  476. prop: "creditRate",
  477. rules: [
  478. {
  479. required: false,
  480. message: " ",
  481. trigger: "blur"
  482. }
  483. ]
  484. },
  485. {
  486. label: "FOB系数",
  487. prop: "coefficient"
  488. },
  489. {
  490. label: "付款方式",
  491. prop: "paymentType"
  492. }
  493. ]
  494. },
  495. basicData: {
  496. column: [
  497. {
  498. label: "编码",
  499. prop: "code",
  500. rules: [
  501. {
  502. required: true,
  503. message: " ",
  504. trigger: "blur"
  505. }
  506. ]
  507. },
  508. {
  509. label: "名称",
  510. prop: "cname",
  511. rules: [
  512. {
  513. required: true,
  514. message: " ",
  515. trigger: "blur"
  516. }
  517. ]
  518. },
  519. {
  520. label: "类别",
  521. prop: "corpsTypeId",
  522. rules: [
  523. {
  524. required: true,
  525. message: " ",
  526. trigger: "blur"
  527. }
  528. ]
  529. },
  530. {
  531. label: "企业类型",
  532. prop: "companytype",
  533. rules: [
  534. {
  535. required: false,
  536. message: " ",
  537. trigger: "blur"
  538. }
  539. ]
  540. },
  541. {
  542. label: "代理品牌",
  543. prop: "goodtypes",
  544. rules: [
  545. {
  546. required: false,
  547. message: " ",
  548. trigger: "blur"
  549. }
  550. ]
  551. },
  552. {
  553. label: "所属公司",
  554. prop: "belongtocompany",
  555. rules: [
  556. {
  557. required: false,
  558. message: " ",
  559. trigger: "blur"
  560. }
  561. ]
  562. },
  563. {
  564. label: "分管员",
  565. prop: "adminProfiles",
  566. span: 8
  567. },
  568. {
  569. label: "代理区域",
  570. prop: "belongtoarea",
  571. span: 8,
  572. mock: {
  573. type: "county"
  574. }
  575. },
  576. {
  577. label: "信用等级",
  578. prop: "creditRating",
  579. span: 8
  580. },
  581. {
  582. label: "备注",
  583. prop: "remarks",
  584. span: 24,
  585. mock: {
  586. type: "county"
  587. }
  588. }
  589. ]
  590. },
  591. paymentOption: [],
  592. addressOption: {},
  593. addressForm: {},
  594. addressData: []
  595. };
  596. },
  597. props: {
  598. detailData: {
  599. type: Object
  600. }
  601. },
  602. components: {
  603. flowDialog
  604. },
  605. async created() {
  606. this.customerContact = await this.getColumnData(
  607. this.getColumnName(147),
  608. customerContact
  609. );
  610. this.bankOfDeposit = await this.getColumnData(
  611. this.getColumnName(148),
  612. bankOfDeposit
  613. );
  614. this.addressOption = await this.getColumnData(
  615. this.getColumnName(149),
  616. addressOption
  617. );
  618. corpstypeTree({ corpType: supplierParameter.code }).then(res => {
  619. this.dic = res.data.data;
  620. });
  621. areaTypeTree().then(res => {
  622. this.dicArea = res.data.data;
  623. });
  624. this.getWorkDicts("payment_term").then(res => {
  625. this.paymentOption = res.data.data;
  626. });
  627. this.getWorkDicts("credit_rating").then(res => {
  628. this.creditRatingList = res.data.data;
  629. });
  630. if (this.detailData.id) {
  631. detail(this.detailData.id).then(res => {
  632. if (res.data.data.adminProfiles) {
  633. res.data.data.adminProfiles = res.data.data.adminProfiles.split(",");
  634. }
  635. this.form = res.data.data;
  636. this.contactsData = this.form.corpsAttnList;
  637. this.bankOfDepositData = this.form.corpsBankList;
  638. this.advantageProjectData = this.form.corpsItems;
  639. this.addressData =
  640. this.form.corpsAddrList.length > 0 ? this.form.corpsAddrList : [];
  641. if (this.form.belongtoarea) {
  642. this.form.belongtoarea = this.form.belongtoarea
  643. .split(",")
  644. .map(item => item.split("/"));
  645. }
  646. delete this.form.corpsAttnList;
  647. delete this.form.corpsBankList;
  648. delete this.form.corpsItems;
  649. delete this.form.corpsAddrList;
  650. });
  651. } else if (this.detailData.treeDeptId) {
  652. this.$set(this.form, "corpsTypeId", this.detailData.treeDeptId);
  653. }
  654. gainUser().then(res => {
  655. this.userList = res.data.data;
  656. });
  657. },
  658. methods: {
  659. //新增客户联系人保存触发
  660. rowSave(row, done, loading) {
  661. console.log(row, done, loading);
  662. this.contactsData.push(row);
  663. done();
  664. },
  665. //修改客户联系人触发
  666. rowUpdate(row, index, done, loading) {
  667. done(row);
  668. },
  669. //删除客户联系人触发
  670. rowDel(row, index, donerowDel) {
  671. this.$confirm("确定将选择数据删除?", {
  672. confirmButtonText: "确定",
  673. cancelButtonText: "取消",
  674. type: "warning"
  675. }).then(() => {
  676. // 数据回调进行刷新
  677. if (row.id) {
  678. corpsattn(row.id).then(res => {
  679. this.$message({
  680. type: "success",
  681. message: "操作成功!"
  682. });
  683. this.contactsData.splice(index, 1);
  684. });
  685. } else {
  686. this.$message({
  687. type: "success",
  688. message: "操作成功!"
  689. });
  690. this.contactsData.splice(index, 1);
  691. }
  692. });
  693. },
  694. //新增客户优势项目保存触发
  695. rowSaveProject(row, done, loading) {
  696. console.log(row, done, loading);
  697. this.advantageProjectData.push(row);
  698. done();
  699. },
  700. //修改客户优势项目触发
  701. rowUpdateProject(row, index, done, loading) {
  702. done(row);
  703. },
  704. //删除客户优势项目触发
  705. rowDelProject(row, index, donerowDel) {
  706. this.$confirm("确定将选择数据删除?", {
  707. confirmButtonText: "确定",
  708. cancelButtonText: "取消",
  709. type: "warning"
  710. }).then(() => {
  711. if (row.id) {
  712. corpsitem(row.id).then(res => {
  713. this.$message({
  714. type: "success",
  715. message: "操作成功!"
  716. });
  717. this.advantageProjectData.splice(index, 1);
  718. });
  719. } else {
  720. this.$message({
  721. type: "success",
  722. message: "操作成功!"
  723. });
  724. this.advantageProjectData.splice(index, 1);
  725. }
  726. });
  727. },
  728. //新增客户优势项目保存触发
  729. rowSaveBankOfDeposit(row, done, loading) {
  730. console.log(row, done, loading);
  731. this.bankOfDepositData.push(row);
  732. done();
  733. },
  734. //修改客户优势项目触发
  735. rowUpdateBankOfDeposit(row, index, done, loading) {
  736. done(row);
  737. },
  738. //删除客户优势项目触发
  739. rowDelBankOfDeposit(row, index, donerowDel) {
  740. this.$confirm("确定将选择数据删除?", {
  741. confirmButtonText: "确定",
  742. cancelButtonText: "取消",
  743. type: "warning"
  744. }).then(() => {
  745. if (row.id) {
  746. corpsbank(row.id).then(res => {
  747. this.$message({
  748. type: "success",
  749. message: "操作成功!"
  750. });
  751. this.bankOfDepositData.splice(index, 1);
  752. });
  753. } else {
  754. this.$message({
  755. type: "success",
  756. message: "操作成功!"
  757. });
  758. this.bankOfDepositData.splice(index, 1);
  759. }
  760. });
  761. },
  762. //修改提交触发
  763. editCustomer() {
  764. this.$refs["form"].validate(valid => {
  765. if (valid) {
  766. this.form.corpsAttnList = this.contactsData;
  767. this.form.corpsBankList = this.bankOfDepositData;
  768. this.form.corpsItems = this.advantageProjectData;
  769. this.form.corpsAddrList = this.addressData;
  770. if (typeof this.form.corpsTypeId == "object") {
  771. this.form.corpsTypeId = this.form.corpsTypeId.join(",");
  772. }
  773. this.disabled = true;
  774. if (this.form.belongtoarea) {
  775. this.form.belongtoarea = this.form.belongtoarea
  776. .map(e => e.join("/"))
  777. .join(",");
  778. }
  779. if (this.form.adminProfiles) {
  780. this.form.adminProfiles = this.form.adminProfiles.join(",");
  781. }
  782. this.form.corpType = supplierParameter.code;
  783. typeSave(this.form).then(res => {
  784. if (res.data.data === "error") {
  785. this.disabled = false;
  786. this.$message({
  787. showClose: true,
  788. message: res.data.msg,
  789. type: "error"
  790. });
  791. } else {
  792. this.$message({
  793. type: "success",
  794. message: this.form.id ? "修改成功!" : "新增成功!"
  795. });
  796. this.form = res.data.data;
  797. if (this.form.belongtoarea) {
  798. this.form.belongtoarea = this.form.belongtoarea
  799. .split(",")
  800. .map(item => item.split("/"));
  801. }
  802. this.disabled = false;
  803. }
  804. });
  805. } else {
  806. return false;
  807. }
  808. });
  809. },
  810. backToList() {
  811. this.$emit("goBack");
  812. },
  813. openFlow() {
  814. this.switchDialog = !this.switchDialog;
  815. },
  816. onClose(val) {
  817. this.switchDialog = val;
  818. },
  819. //新增收发货地址保存触发
  820. rowSaveAddress(row, done, loading) {
  821. this.addressData.push(row);
  822. done();
  823. },
  824. //修改收发货地址优势项目触发
  825. rowUpdateAddress(row, index, done, loading) {
  826. done(row);
  827. },
  828. async saveColumn() {
  829. const inSave = await this.saveColumnData(
  830. this.getColumnName(147),
  831. this.customerContact
  832. );
  833. if (inSave) {
  834. this.$nextTick(() => {
  835. this.$refs.crud.doLayout();
  836. });
  837. this.$message.success("保存成功");
  838. //关闭窗口
  839. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  840. }
  841. },
  842. async resetColumn() {
  843. this.customerContact = customerContact;
  844. const inSave = await this.delColumnData(
  845. this.getColumnName(147),
  846. customerContact
  847. );
  848. if (inSave) {
  849. this.$nextTick(() => {
  850. this.$refs.crud.doLayout();
  851. });
  852. this.$message.success("重置成功");
  853. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  854. }
  855. },
  856. async saveColumn2() {
  857. const inSave = await this.saveColumnData(
  858. this.getColumnName(148),
  859. this.bankOfDeposit
  860. );
  861. if (inSave) {
  862. this.$nextTick(() => {
  863. this.$refs.crud2.doLayout();
  864. });
  865. this.$message.success("保存成功");
  866. //关闭窗口
  867. this.$refs.crud2.$refs.dialogColumn.columnBox = false;
  868. }
  869. },
  870. async resetColumn2() {
  871. this.bankOfDeposit = bankOfDeposit;
  872. const inSave = await this.delColumnData(
  873. this.getColumnName(148),
  874. bankOfDeposit
  875. );
  876. if (inSave) {
  877. this.$nextTick(() => {
  878. this.$refs.crud2.doLayout();
  879. });
  880. this.$message.success("重置成功");
  881. this.$refs.crud2.$refs.dialogColumn.columnBox = false;
  882. }
  883. },
  884. async saveColumn3() {
  885. const inSave = await this.saveColumnData(
  886. this.getColumnName(149),
  887. this.addressOption
  888. );
  889. if (inSave) {
  890. this.$nextTick(() => {
  891. this.$refs.crud3.doLayout();
  892. });
  893. this.$message.success("保存成功");
  894. //关闭窗口
  895. this.$refs.crud3.$refs.dialogColumn.columnBox = false;
  896. }
  897. },
  898. async resetColumn3() {
  899. this.addressOption = addressOption;
  900. const inSave = await this.delColumnData(
  901. this.getColumnName(149),
  902. addressOption
  903. );
  904. if (inSave) {
  905. this.$nextTick(() => {
  906. this.$refs.crud3.doLayout();
  907. });
  908. this.$message.success("重置成功");
  909. this.$refs.crud3.$refs.dialogColumn.columnBox = false;
  910. }
  911. },
  912. //删除收发货地址优势项目触发
  913. rowDelAddress(row, index, donerowDel) {
  914. this.$confirm("确定将选择数据删除?", {
  915. confirmButtonText: "确定",
  916. cancelButtonText: "取消",
  917. type: "warning"
  918. }).then(() => {
  919. if (row.id) {
  920. corpsAddrDelete(row.id).then(res => {
  921. this.$message({
  922. type: "success",
  923. message: "操作成功!"
  924. });
  925. this.addressData.splice(index, 1);
  926. });
  927. } else {
  928. this.$message({
  929. type: "success",
  930. message: "操作成功!"
  931. });
  932. this.addressData.splice(index, 1);
  933. }
  934. });
  935. }
  936. }
  937. };
  938. </script>
  939. <style lang="scss" scoped>
  940. ::v-deep .el-form-item {
  941. margin-bottom: 0;
  942. }
  943. </style>