detailsPageEdit.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953
  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: 16,
  572. mock: {
  573. type: "county"
  574. }
  575. },
  576. {
  577. label: "信用等级",
  578. prop: "creditRating",
  579. span: 8
  580. },{
  581. label: "首字母",
  582. prop: "initials",
  583. span: 8
  584. },
  585. {
  586. label: "备注",
  587. prop: "remarks",
  588. span: 24,
  589. mock: {
  590. type: "county"
  591. }
  592. }
  593. ]
  594. },
  595. paymentOption: [],
  596. addressOption: {},
  597. addressForm: {},
  598. addressData: []
  599. };
  600. },
  601. props: {
  602. detailData: {
  603. type: Object
  604. }
  605. },
  606. components: {
  607. flowDialog
  608. },
  609. async created() {
  610. this.customerContact = await this.getColumnData(
  611. this.getColumnName(147),
  612. customerContact
  613. );
  614. this.bankOfDeposit = await this.getColumnData(
  615. this.getColumnName(148),
  616. bankOfDeposit
  617. );
  618. this.addressOption = await this.getColumnData(
  619. this.getColumnName(149),
  620. addressOption
  621. );
  622. corpstypeTree({ corpType: supplierParameter.code }).then(res => {
  623. this.dic = res.data.data;
  624. });
  625. areaTypeTree().then(res => {
  626. this.dicArea = res.data.data;
  627. });
  628. this.getWorkDicts("payment_term").then(res => {
  629. this.paymentOption = res.data.data;
  630. });
  631. this.getWorkDicts("credit_rating").then(res => {
  632. this.creditRatingList = res.data.data;
  633. });
  634. if (this.detailData.id) {
  635. detail(this.detailData.id).then(res => {
  636. if (res.data.data.adminProfiles) {
  637. res.data.data.adminProfiles = res.data.data.adminProfiles.split(",");
  638. }
  639. this.form = res.data.data;
  640. this.contactsData = this.form.corpsAttnList;
  641. this.bankOfDepositData = this.form.corpsBankList;
  642. this.advantageProjectData = this.form.corpsItems;
  643. this.addressData =
  644. this.form.corpsAddrList.length > 0 ? this.form.corpsAddrList : [];
  645. if (this.form.belongtoarea) {
  646. this.form.belongtoarea = this.form.belongtoarea
  647. .split(",")
  648. .map(item => item.split("/"));
  649. }
  650. delete this.form.corpsAttnList;
  651. delete this.form.corpsBankList;
  652. delete this.form.corpsItems;
  653. delete this.form.corpsAddrList;
  654. });
  655. } else if (this.detailData.treeDeptId) {
  656. this.$set(this.form, "corpsTypeId", this.detailData.treeDeptId);
  657. }
  658. gainUser().then(res => {
  659. this.userList = res.data.data;
  660. });
  661. this.getWorkDicts("currency").then(res => {
  662. this.findObject(this.bankOfDeposit.column, "fcyno").dicData =
  663. res.data.data;
  664. });
  665. },
  666. methods: {
  667. //新增客户联系人保存触发
  668. rowSave(row, done, loading) {
  669. console.log(row, done, loading);
  670. this.contactsData.push(row);
  671. done();
  672. },
  673. //修改客户联系人触发
  674. rowUpdate(row, index, done, loading) {
  675. done(row);
  676. },
  677. //删除客户联系人触发
  678. rowDel(row, index, donerowDel) {
  679. this.$confirm("确定将选择数据删除?", {
  680. confirmButtonText: "确定",
  681. cancelButtonText: "取消",
  682. type: "warning"
  683. }).then(() => {
  684. // 数据回调进行刷新
  685. if (row.id) {
  686. corpsattn(row.id).then(res => {
  687. this.$message({
  688. type: "success",
  689. message: "操作成功!"
  690. });
  691. this.contactsData.splice(index, 1);
  692. });
  693. } else {
  694. this.$message({
  695. type: "success",
  696. message: "操作成功!"
  697. });
  698. this.contactsData.splice(index, 1);
  699. }
  700. });
  701. },
  702. //新增客户优势项目保存触发
  703. rowSaveProject(row, done, loading) {
  704. console.log(row, done, loading);
  705. this.advantageProjectData.push(row);
  706. done();
  707. },
  708. //修改客户优势项目触发
  709. rowUpdateProject(row, index, done, loading) {
  710. done(row);
  711. },
  712. //删除客户优势项目触发
  713. rowDelProject(row, index, donerowDel) {
  714. this.$confirm("确定将选择数据删除?", {
  715. confirmButtonText: "确定",
  716. cancelButtonText: "取消",
  717. type: "warning"
  718. }).then(() => {
  719. if (row.id) {
  720. corpsitem(row.id).then(res => {
  721. this.$message({
  722. type: "success",
  723. message: "操作成功!"
  724. });
  725. this.advantageProjectData.splice(index, 1);
  726. });
  727. } else {
  728. this.$message({
  729. type: "success",
  730. message: "操作成功!"
  731. });
  732. this.advantageProjectData.splice(index, 1);
  733. }
  734. });
  735. },
  736. //新增客户优势项目保存触发
  737. rowSaveBankOfDeposit(row, done, loading) {
  738. console.log(row, done, loading);
  739. this.bankOfDepositData.push(row);
  740. done();
  741. },
  742. //修改客户优势项目触发
  743. rowUpdateBankOfDeposit(row, index, done, loading) {
  744. done(row);
  745. },
  746. //删除客户优势项目触发
  747. rowDelBankOfDeposit(row, index, donerowDel) {
  748. this.$confirm("确定将选择数据删除?", {
  749. confirmButtonText: "确定",
  750. cancelButtonText: "取消",
  751. type: "warning"
  752. }).then(() => {
  753. if (row.id) {
  754. corpsbank(row.id).then(res => {
  755. this.$message({
  756. type: "success",
  757. message: "操作成功!"
  758. });
  759. this.bankOfDepositData.splice(index, 1);
  760. });
  761. } else {
  762. this.$message({
  763. type: "success",
  764. message: "操作成功!"
  765. });
  766. this.bankOfDepositData.splice(index, 1);
  767. }
  768. });
  769. },
  770. //修改提交触发
  771. editCustomer() {
  772. this.$refs["form"].validate(valid => {
  773. if (valid) {
  774. this.form.corpsAttnList = this.contactsData;
  775. this.form.corpsBankList = this.bankOfDepositData;
  776. this.form.corpsItems = this.advantageProjectData;
  777. this.form.corpsAddrList = this.addressData;
  778. if (typeof this.form.corpsTypeId == "object") {
  779. this.form.corpsTypeId = this.form.corpsTypeId.join(",");
  780. }
  781. this.disabled = true;
  782. if (this.form.belongtoarea) {
  783. this.form.belongtoarea = this.form.belongtoarea
  784. .map(e => e.join("/"))
  785. .join(",");
  786. }
  787. if (this.form.adminProfiles) {
  788. this.form.adminProfiles = this.form.adminProfiles.join(",");
  789. }
  790. this.form.corpType = supplierParameter.code;
  791. typeSave(this.form).then(res => {
  792. if (res.data.data === "error") {
  793. this.disabled = false;
  794. this.$message({
  795. showClose: true,
  796. message: res.data.msg,
  797. type: "error"
  798. });
  799. } else {
  800. this.$message({
  801. type: "success",
  802. message: this.form.id ? "修改成功!" : "新增成功!"
  803. });
  804. this.form = res.data.data;
  805. if (this.form.belongtoarea) {
  806. this.form.belongtoarea = this.form.belongtoarea
  807. .split(",")
  808. .map(item => item.split("/"));
  809. }
  810. this.disabled = false;
  811. }
  812. });
  813. } else {
  814. return false;
  815. }
  816. });
  817. },
  818. backToList() {
  819. this.$emit("goBack");
  820. },
  821. openFlow() {
  822. this.switchDialog = !this.switchDialog;
  823. },
  824. onClose(val) {
  825. this.switchDialog = val;
  826. },
  827. //新增收发货地址保存触发
  828. rowSaveAddress(row, done, loading) {
  829. this.addressData.push(row);
  830. done();
  831. },
  832. //修改收发货地址优势项目触发
  833. rowUpdateAddress(row, index, done, loading) {
  834. done(row);
  835. },
  836. async saveColumn() {
  837. const inSave = await this.saveColumnData(
  838. this.getColumnName(147),
  839. this.customerContact
  840. );
  841. if (inSave) {
  842. this.$nextTick(() => {
  843. this.$refs.crud.doLayout();
  844. });
  845. this.$message.success("保存成功");
  846. //关闭窗口
  847. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  848. }
  849. },
  850. async resetColumn() {
  851. this.customerContact = customerContact;
  852. const inSave = await this.delColumnData(
  853. this.getColumnName(147),
  854. customerContact
  855. );
  856. if (inSave) {
  857. this.$nextTick(() => {
  858. this.$refs.crud.doLayout();
  859. });
  860. this.$message.success("重置成功");
  861. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  862. }
  863. },
  864. async saveColumn2() {
  865. const inSave = await this.saveColumnData(
  866. this.getColumnName(148),
  867. this.bankOfDeposit
  868. );
  869. if (inSave) {
  870. this.$nextTick(() => {
  871. this.$refs.crud2.doLayout();
  872. });
  873. this.$message.success("保存成功");
  874. //关闭窗口
  875. this.$refs.crud2.$refs.dialogColumn.columnBox = false;
  876. }
  877. },
  878. async resetColumn2() {
  879. this.bankOfDeposit = bankOfDeposit;
  880. const inSave = await this.delColumnData(
  881. this.getColumnName(148),
  882. bankOfDeposit
  883. );
  884. if (inSave) {
  885. this.$nextTick(() => {
  886. this.$refs.crud2.doLayout();
  887. });
  888. this.$message.success("重置成功");
  889. this.$refs.crud2.$refs.dialogColumn.columnBox = false;
  890. }
  891. },
  892. async saveColumn3() {
  893. const inSave = await this.saveColumnData(
  894. this.getColumnName(149),
  895. this.addressOption
  896. );
  897. if (inSave) {
  898. this.$nextTick(() => {
  899. this.$refs.crud3.doLayout();
  900. });
  901. this.$message.success("保存成功");
  902. //关闭窗口
  903. this.$refs.crud3.$refs.dialogColumn.columnBox = false;
  904. }
  905. },
  906. async resetColumn3() {
  907. this.addressOption = addressOption;
  908. const inSave = await this.delColumnData(
  909. this.getColumnName(149),
  910. addressOption
  911. );
  912. if (inSave) {
  913. this.$nextTick(() => {
  914. this.$refs.crud3.doLayout();
  915. });
  916. this.$message.success("重置成功");
  917. this.$refs.crud3.$refs.dialogColumn.columnBox = false;
  918. }
  919. },
  920. //删除收发货地址优势项目触发
  921. rowDelAddress(row, index, donerowDel) {
  922. this.$confirm("确定将选择数据删除?", {
  923. confirmButtonText: "确定",
  924. cancelButtonText: "取消",
  925. type: "warning"
  926. }).then(() => {
  927. if (row.id) {
  928. corpsAddrDelete(row.id).then(res => {
  929. this.$message({
  930. type: "success",
  931. message: "操作成功!"
  932. });
  933. this.addressData.splice(index, 1);
  934. });
  935. } else {
  936. this.$message({
  937. type: "success",
  938. message: "操作成功!"
  939. });
  940. this.addressData.splice(index, 1);
  941. }
  942. });
  943. }
  944. }
  945. };
  946. </script>
  947. <style lang="scss" scoped>
  948. ::v-deep .el-form-item {
  949. margin-bottom: 0;
  950. }
  951. </style>