detailsPageEdit.vue 26 KB

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