detailsPage.vue 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009
  1. <template>
  2. <div>
  3. <div class="borderless">
  4. <div class="customer-head">
  5. <div class="customer-back">
  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" size="small" @click="editCustomer">
  12. 保存数据
  13. </el-button>
  14. </div>
  15. </div>
  16. <trade-card title="基础资料" style="margin-top: 60px" v-loading="loadingBtn">
  17. <avue-form ref="form" class="trading-form" v-model="form" :option="option">
  18. <template slot="corpsTypeId">
  19. <div style="display:flex;">
  20. <avue-input-tree v-model="form.corpsTypeId" placeholder="请选择客户分类" :dic="corpTypeList" :props="props">
  21. </avue-input-tree>
  22. <i class="el-icon-circle-plus-outline" style="font-size:18px;line-height: 32px;margin-left:4px"
  23. @click="corpTypeVisible = true"></i>
  24. </div>
  25. </template>
  26. <template slot="deliveryWarehouseId">
  27. <div style="display:flex;">
  28. <avue-input-tree v-model="form.deliveryWarehouseId" placeholder="请选择发货仓库" :dic="corpTypeListCk"
  29. :props="propsCk">
  30. </avue-input-tree>
  31. <i class="el-icon-circle-plus-outline" style="font-size:18px;line-height: 32px;margin-left:4px"
  32. @click="dialogVisibleCK = true"></i>
  33. </div>
  34. </template>
  35. </avue-form>
  36. </trade-card>
  37. <trade-card title="客户联系人" v-loading="loadingBtn">
  38. <avue-crud ref="crudTwo" :option="customerContact" v-model="contactsForm" :data="contactsData"
  39. @saveColumn="saveColumnTwo" @resetColumn="resetColumnTwo" @row-save="rowSave" @row-update="rowUpdate"
  40. @row-del="rowDelTwo">
  41. <template slot-scope="{ type, size, row, disabled,index}" slot="menu">
  42. <el-button :size="size" :disabled="disabled" :type="type"
  43. :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="$refs.crudTwo.rowEdit(row, index)">{{
  44. row.$cellEdit ? '确认' : '修改' }}
  45. </el-button>
  46. <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
  47. @click="rowDelTwo(row, index)">删除
  48. </el-button>
  49. <el-button icon="el-icon-check" :size="size" :type="type" @click="creatingUsers(row)">创建用户</el-button>
  50. </template>
  51. </avue-crud>
  52. </trade-card>
  53. <trade-card title="地址信息" v-loading="loadingBtn">
  54. <avue-crud :option="option2" ref="crud" :data="data" @row-save="rowSave" @row-update="rowUpdate"
  55. @saveColumn="saveColumn" @resetColumn="resetColumn">
  56. <template slot="headerSerial">
  57. <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow"
  58. :disabled="detailData.status == 1" circle></el-button>
  59. </template>
  60. <template slot-scope="{type,size,row,index,disabled}" slot="menu">
  61. <el-button :size="size" :disabled="disabled" :type="type"
  62. :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="$refs.crud.rowEdit(row, index)">{{
  63. row.$cellEdit ? '确认' : '修改' }}
  64. </el-button>
  65. <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type" @click="rowDel(row, index)">删除
  66. </el-button>
  67. </template>
  68. <template slot="defaultAddres" slot-scope="{row,index,disabled}">
  69. <el-switch active-value="1" inactive-value="0" :disabled="disabled" v-model="row.defaultAddres"
  70. @change="addressUnique(row, index)">
  71. </el-switch>
  72. </template>
  73. </avue-crud>
  74. </trade-card>
  75. <containerTitle title="上传附件"></containerTitle>
  76. <c-upload v-loading="loadingBtn" typeUpload="CD" deleteUrl="/api/blade-client/corpsfiles/remove" :data="corpsFiles"
  77. display :enumerationValue="35.1" :disabled="detailData.status == 1"></c-upload>
  78. <el-dialog title="设置客户分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog" width="80%"
  79. append-to-body @closed="corpTypeClosed">
  80. <span>
  81. <corp-type></corp-type>
  82. <!-- <avue-form :key="reload" ref="corpType" v-model="form4" :option="option4" style="margin-top:20px">
  83. </avue-form> -->
  84. </span>
  85. <div class="avue-dialog__footer">
  86. <el-button @click="corpTypeVisible = false" size="mini">取 消</el-button>
  87. <el-button @click="addCorpType" type="primary" size="mini">确 定</el-button>
  88. </div>
  89. </el-dialog>
  90. </div>
  91. <el-dialog title="创建用户" :visible.sync="dialogVisibleBt" append-to-body width="60%">
  92. <avue-form v-if="dialogVisibleBt" ref="formDataTwo" v-model="formDataTwo" :option="optionData">
  93. </avue-form>
  94. <span slot="footer" class="dialog-footer">
  95. <el-button @click="dialogVisibleBt = false">取 消</el-button>
  96. <el-button type="primary" @click="confirmSynchronizationTwo">确 定</el-button>
  97. </span>
  98. </el-dialog>
  99. <el-dialog title="新增仓库" :visible.sync="dialogVisibleCK" append-to-body width="60%">
  100. <avue-form v-if="dialogVisibleCK" ref="formDataThree" v-model="formDataThree" :option="optionDataCK">
  101. </avue-form>
  102. <span slot="footer" class="dialog-footer">
  103. <el-button @click="dialogVisibleCK = false">取 消</el-button>
  104. <el-button type="primary" @click="confirmSynchronizationThree">确 定</el-button>
  105. </span>
  106. </el-dialog>
  107. </div>
  108. </template>
  109. <script>
  110. import { option2, option3 } from "./js/optionList";
  111. // import {getDetails, addCorpType, getCorpType, submit, customerList, itemDel} from "@/api/basicData/client";
  112. import {
  113. getDetails,
  114. getCorpType,
  115. submit,
  116. customerList,
  117. itemDel,
  118. corpsattn
  119. } from "@/api/tirePartsMall/basicData/customerInformation"
  120. import corpType from '@/components/corpType/index'
  121. import { creatingUsersTwo } from "@/api/basicData/customerInformation";
  122. import { getRoleTree } from "@/api/system/role";
  123. import { getDeptTree } from "@/api/system/dept";
  124. import { getPostList } from "@/api/system/post";
  125. import website from "@/config/website";
  126. import {
  127. typeSave,
  128. customerListAll
  129. } from "@/api/tirePartsMall/basicData/warehouse";
  130. export default {
  131. name: "index",
  132. data() {
  133. return {
  134. propsCk: {
  135. label: 'cname',
  136. value: 'id'
  137. },
  138. props: {
  139. label: 'title',
  140. value: 'value'
  141. },
  142. optionData: {
  143. span: 8,
  144. menuBtn: false,
  145. column: [
  146. {
  147. label: "所属角色",
  148. prop: "roleId",
  149. multiple: true,
  150. type: "tree",
  151. dicData: [],
  152. props: {
  153. label: "title"
  154. },
  155. checkStrictly: true,
  156. slot: true,
  157. rules: [
  158. {
  159. required: true,
  160. message: "请选择所属角色",
  161. trigger: "click"
  162. }
  163. ]
  164. },
  165. {
  166. label: "所属部门",
  167. prop: "deptId",
  168. type: "tree",
  169. multiple: true,
  170. dicData: [],
  171. props: {
  172. label: "title"
  173. },
  174. checkStrictly: true,
  175. slot: true,
  176. rules: [
  177. {
  178. required: true,
  179. message: "请选择所属部门",
  180. trigger: "click"
  181. }
  182. ]
  183. },
  184. {
  185. label: "所属岗位",
  186. prop: "postId",
  187. type: "tree",
  188. multiple: true,
  189. dicData: [],
  190. props: {
  191. label: "postName",
  192. value: "id"
  193. },
  194. rules: [
  195. {
  196. required: true,
  197. message: "请选择所属岗位",
  198. trigger: "click"
  199. }
  200. ]
  201. }
  202. ]
  203. },
  204. optionDataCK: {
  205. span: 8,
  206. menuBtn: false,
  207. column: [{
  208. label: "仓库编码",
  209. prop: "code",
  210. search: true,
  211. overHidden: true,
  212. width: 120,
  213. rules: [
  214. {
  215. required: true,
  216. message: " ",
  217. trigger: "blur"
  218. }
  219. ]
  220. }, {
  221. label: "仓库名称",
  222. prop: "cname",
  223. search: true,
  224. overHidden: true,
  225. width: 120,
  226. rules: [
  227. {
  228. required: true,
  229. message: " ",
  230. trigger: "blur"
  231. }
  232. ]
  233. }, {
  234. label: "联系人",
  235. prop: "contacts",
  236. search: true,
  237. overHidden: true,
  238. width: 120,
  239. rules: [
  240. {
  241. required: true,
  242. message: " ",
  243. trigger: "blur"
  244. }
  245. ]
  246. }, {
  247. label: "联系电话",
  248. prop: "tel",
  249. search: true,
  250. overHidden: true,
  251. width: 120,
  252. rules: [
  253. {
  254. required: true,
  255. message: " ",
  256. trigger: "blur"
  257. }
  258. ]
  259. }, {
  260. label: "是否计费",
  261. prop: "chargeOrNot",
  262. search: true,
  263. overHidden: true,
  264. width: 120,
  265. type: "select",
  266. dicData: [{
  267. label: "是",
  268. value: "0"
  269. }, {
  270. label: "否",
  271. value: "1"
  272. }],
  273. rules: [
  274. {
  275. required: true,
  276. message: " ",
  277. trigger: "blur"
  278. }
  279. ]
  280. }, {
  281. label: "库容",
  282. prop: "storageCapacity",
  283. search: true,
  284. overHidden: true,
  285. width: 120,
  286. rules: [
  287. {
  288. required: true,
  289. message: " ",
  290. trigger: "blur"
  291. }
  292. ]
  293. }, {
  294. label: "所属公司",
  295. prop: "artsVisionId",
  296. search: true,
  297. overHidden: true,
  298. width: 120,
  299. rules: [
  300. {
  301. required: true,
  302. message: " ",
  303. trigger: "blur"
  304. }
  305. ]
  306. }, {
  307. label: "共享公司",
  308. prop: "sharedCompany",
  309. search: true,
  310. overHidden: true,
  311. width: 120,
  312. rules: [
  313. {
  314. required: true,
  315. message: " ",
  316. trigger: "blur"
  317. }
  318. ]
  319. }, {
  320. label: "备注",
  321. prop: "remarks",
  322. type: "textarea",
  323. minRows: 3,
  324. span: 24,
  325. overHidden: true,
  326. width: 200
  327. }]
  328. },
  329. dialogVisibleBt: false,
  330. formDataTwo: false,
  331. dialogVisibleCK: false,
  332. formDataThree: false,
  333. customerContact: {},
  334. contactsForm: {},
  335. contactsData: [],
  336. corpTypeList: [],
  337. corpTypeListCk: [],
  338. corpTypeVisible: false,
  339. activeName: 'first',
  340. loadingBtn: false,
  341. addressTitle: null,
  342. addressVisible: false,
  343. form: {},
  344. form2: {},
  345. form3: {},
  346. form4: {},
  347. data: [],
  348. data1: [],
  349. data2: [],
  350. option: {
  351. menuBtn: false,
  352. labelWidth: 130,
  353. column: [
  354. {
  355. label: "客户名称",
  356. prop: "cname",
  357. rules: [
  358. {
  359. required: true,
  360. message: "",
  361. trigger: "blur"
  362. }
  363. ],
  364. span: 8,
  365. },
  366. {
  367. label: "客户分类",
  368. prop: "corpsTypeId",
  369. span: 8,
  370. rules: [{
  371. required: true,
  372. message: " ",
  373. trigger: "blur"
  374. }]
  375. },
  376. {
  377. label: "电话",
  378. prop: "tel",
  379. span: 8,
  380. },
  381. {
  382. label: "业务员",
  383. span: 8,
  384. prop: "salesmanId",
  385. type: "select",
  386. props: {
  387. label: "name",
  388. value: "id"
  389. },
  390. dicUrl: "/api/blade-user/client/gainUser",
  391. filterable: true,
  392. rules: [{
  393. required: true,
  394. message: " ",
  395. trigger: "blur"
  396. }]
  397. },
  398. {
  399. label: "账期",
  400. prop: "accountPeriod",
  401. span: 8,
  402. },
  403. {
  404. label: "发货仓库",
  405. prop: "deliveryWarehouseId",
  406. span: 8,
  407. type: 'select',
  408. props: {
  409. label: 'cname',
  410. value: 'id'
  411. },
  412. dicUrl: '/api/blade-sales-part/storageDesc/listAll',
  413. rules: [{
  414. required: true,
  415. message: " ",
  416. trigger: "blur"
  417. }]
  418. },
  419. {
  420. label: "商城价格",
  421. prop: "priceSystem",
  422. span: 8, filterable: true, type: "select", dicUrl: "/api/blade-system/dict-biz/dictionary?code=mall_price",
  423. props: {
  424. label: "dictValue",
  425. value: "dictKey"
  426. },
  427. rules: [{
  428. required: true,
  429. message: " ",
  430. trigger: "blur"
  431. }]
  432. }, {
  433. label: "信用额度",
  434. prop:
  435. "creditLimit", span: 8,
  436. type: "number", controls: false,
  437. precision: 2
  438. }
  439. ,
  440. {
  441. label: "使用信用额度",
  442. prop: "useCreditLimit", span: 8,
  443. type: "number",
  444. controls: false,
  445. precision: 2
  446. }, {
  447. label: "备注",
  448. prop: "remarks", type: "textarea",
  449. minRows: 2, span: 24,
  450. }
  451. ]
  452. },
  453. option2: {},
  454. option3: {},
  455. option4: {
  456. menuBtn: false,
  457. labelWidth: 80,
  458. column: [{
  459. label: "分类名称",
  460. prop: "cname",
  461. rules: [
  462. {
  463. required: true,
  464. message: "",
  465. trigger: "blur"
  466. }
  467. ],
  468. span: 24,
  469. },
  470. {
  471. label: "上级类型",
  472. prop: "parentId",
  473. dicData: [],
  474. type: "tree",
  475. props: {
  476. label: "cname",
  477. value: "id"
  478. },
  479. span: 24,
  480. }
  481. ]
  482. },
  483. corpsFiles: [],
  484. customerContactBack: {
  485. align: 'center',
  486. index: true,
  487. addBtnText: "录入明细",
  488. refreshBtn: false,
  489. dialogDrag: true,
  490. addBtn: true,
  491. span: 8,
  492. height: 600,
  493. addRowBtn: false,
  494. editBtn: false,
  495. delBtn: false,
  496. menuWidth: 200,
  497. dialogTop: 25,
  498. dialogWidth: "80%",
  499. column: [{
  500. label: '联系人',
  501. prop: 'cname',
  502. cell: true,
  503. rules: [
  504. {
  505. required: true,
  506. message: " ",
  507. trigger: "blur"
  508. }
  509. ]
  510. }, {
  511. label: '电话',
  512. prop: 'tel',
  513. cell: true,
  514. rules: [
  515. {
  516. required: true,
  517. message: " ",
  518. trigger: "blur"
  519. }
  520. ]
  521. }, {
  522. label: '备注',
  523. prop: 'remarks',
  524. cell: true
  525. }]
  526. }
  527. }
  528. },
  529. components: {
  530. corpType
  531. },
  532. props: {
  533. detailData: {
  534. type: Object
  535. }
  536. },
  537. async created() {
  538. this.customerContact = await this.getColumnData(
  539. this.getColumnName(263.1),
  540. this.customerContactBack
  541. );
  542. this.option2 = await this.getColumnData(this.getColumnName(263.2), option2);
  543. // this.option3 = await this.getColumnData(this.getColumnName(208.4), option3);
  544. if (this.detailData.id) {
  545. this.getDetail(this.detailData.id);
  546. }
  547. if (this.detailData.status == 1) {
  548. this.option.disabled = true;
  549. }
  550. if (!website.tenantMode) {
  551. this.initData(website.tenantId);
  552. } else {
  553. this.initData();
  554. }
  555. this.getCorpType()
  556. this.getAllWorkDicts()
  557. this.getCorpTypeCk()
  558. },
  559. methods: {
  560. addressUnique(row, index) {
  561. for (let item in this.data) {
  562. if (index != item) {
  563. if (this.data[item].defaultAddres == 1) {
  564. this.$message.warning("默认地址只能唯一")
  565. return row.defaultAddres = 0
  566. }
  567. }
  568. }
  569. },
  570. initData(tenantId) {
  571. getRoleTree(tenantId).then(res => {
  572. const column = this.findObject(this.optionData.column, "roleId");
  573. column.dicData = res.data.data;
  574. });
  575. getDeptTree(tenantId).then(res => {
  576. const column = this.findObject(this.optionData.column, "deptId");
  577. column.dicData = res.data.data;
  578. });
  579. getPostList(tenantId).then(res => {
  580. const column = this.findObject(this.optionData.column, "postId");
  581. column.dicData = res.data.data;
  582. });
  583. },
  584. //确认创建用户
  585. confirmSynchronizationTwo() {
  586. this.$refs["formDataTwo"].validate((valid, done) => {
  587. done();
  588. if (valid) {
  589. let data = JSON.parse(JSON.stringify(this.formDataTwo));
  590. data.deptId = data.deptId.join(",");
  591. data.roleId = data.roleId.join(",");
  592. data.postId = data.postId.join(",");
  593. creatingUsersTwo({
  594. ...data,
  595. id: this.formRow.id
  596. }).then(res => {
  597. this.dialogVisibleBt = false;
  598. this.formDataTwo = {}
  599. this.$message.success(
  600. "创建用户成功,默认帐号:手机号。默认密码:123456"
  601. );
  602. });
  603. } else {
  604. return false;
  605. }
  606. });
  607. }
  608. ,
  609. //确认创建仓库
  610. confirmSynchronizationThree() {
  611. this.$refs["formDataThree"].validate((valid, done) => {
  612. done();
  613. if (valid) {
  614. typeSave({
  615. ...this.formDataThree,
  616. }).then(res => {
  617. this.dialogVisibleCK = false;
  618. this.formDataThree = {}
  619. this.getCorpTypeCk()
  620. });
  621. } else {
  622. return false;
  623. }
  624. });
  625. }
  626. ,
  627. getAllWorkDicts() {
  628. customerList({ corpType: "KH" }).then(res => {
  629. this.findObject(this.option4.column, "parentId").dicData = res.data.data.records
  630. });
  631. this.getWorkDicts("abbreviation").then(res => {
  632. this.findObject(this.option2.column, "abbreviation").dicData = res.data.data;
  633. });
  634. this.findObject(this.option2.column, "belongtoarea").dicData = JSON.parse(localStorage.getItem('areaTypeTree'))
  635. this.$refs.crud.init();
  636. }
  637. ,
  638. cellStyle() {
  639. return "padding:0;height:40px;";
  640. }
  641. ,
  642. selectValue(value, row) {
  643. if (row.feesId) {
  644. row.feesName = value.cname
  645. } else {
  646. row.feesName = ""
  647. }
  648. }
  649. ,
  650. getDetail(id) {
  651. this.loadingBtn = true
  652. getDetails({ id: id })
  653. .then(res => {
  654. this.form = res.data.data;
  655. this.data = res.data.data.corpsAddrList
  656. this.corpsFiles = res.data.data.corpsFilesList
  657. this.contactsData = res.data.data.corpsAttnList
  658. })
  659. .finally(() => {
  660. this.loadingBtn = false;
  661. });
  662. }
  663. ,
  664. getCorpData(row) {
  665. this.form.corpName = row.cname
  666. }
  667. ,
  668. addRow() {
  669. this.data.push({ $cellEdit: true })
  670. }
  671. ,
  672. rowCell(row, index) {
  673. if (row.$cellEdit == true) {
  674. this.$set(row, "$cellEdit", false);
  675. } else {
  676. this.$set(row, "$cellEdit", true);
  677. }
  678. }
  679. ,
  680. rowDel(row, index) {
  681. this.$confirm("确定删除数据?", {
  682. confirmButtonText: "确定",
  683. cancelButtonText: "取消",
  684. type: "warning"
  685. }).then(() => {
  686. if (row.id) {
  687. itemDel(row.id).then(res => {
  688. this.$message({
  689. type: "success",
  690. message: "删除成功!"
  691. });
  692. this.data.splice(index, 1);
  693. });
  694. } else {
  695. this.$message({
  696. type: "success",
  697. message: "删除成功!"
  698. });
  699. this.data.splice(index, 1);
  700. }
  701. });
  702. }
  703. ,
  704. addRow2() {
  705. this.data2.push({ $cellEdit: true, type: 1 })
  706. }
  707. ,
  708. rowCell2(row, index) {
  709. if (row.$cellEdit == true) {
  710. this.$set(row, "$cellEdit", false);
  711. } else {
  712. this.$set(row, "$cellEdit", true);
  713. }
  714. }
  715. ,
  716. rowDe2(row, index) {
  717. this.$confirm("确定删除数据?", {
  718. confirmButtonText: "确定",
  719. cancelButtonText: "取消",
  720. type: "warning"
  721. }).then(() => {
  722. if (row.id) {
  723. // itemDel(row.id).then(res => {
  724. // this.$message({
  725. // type: "success",
  726. // message: "删除成功!"
  727. // });
  728. // this.data2.splice(index, 1);
  729. // });
  730. } else {
  731. this.$message({
  732. type: "success",
  733. message: "删除成功!"
  734. });
  735. this.data2.splice(index, 1);
  736. }
  737. });
  738. }
  739. ,
  740. corpTypeClosed() {
  741. // this.reload = Math.random();
  742. // this.form4 = this.$options.data().form4
  743. }
  744. ,
  745. getCorpType() {
  746. getCorpType({ corpType: 'KH' }).then(res => {
  747. this.corpTypeList = res.data.data
  748. })
  749. }
  750. ,
  751. getCorpTypeCk() {
  752. customerListAll().then(res => {
  753. this.corpTypeListCk = res.data.data
  754. console.log("!111", this.corpTypeListCk)
  755. })
  756. }
  757. ,
  758. addCorpType() {
  759. // this.$refs["corpType"].validate((valid, done) => {
  760. // done();
  761. // if (valid) {
  762. // addCorpType({ ...this.form4, corpType: 'KH', status: 0 })
  763. // .then(res => {
  764. // this.$message.success("保存成功");
  765. // this.getCorpType()
  766. // this.corpTypeVisible = false
  767. // })
  768. // } else {
  769. // return false;
  770. // }
  771. // });
  772. this.getCorpType()
  773. this.corpTypeVisible = false
  774. }
  775. ,
  776. //修改提交触发
  777. editCustomer() {
  778. this.$refs["form"].validate((valid, done) => {
  779. done();
  780. if (valid) {
  781. this.loadingBtn = true;
  782. submit({
  783. ...this.form,
  784. code: this.form.cname,
  785. corpType: "KH",
  786. corpsAddrList: this.data,
  787. corpsFilesList: this.corpsFiles,
  788. corpsAttnList: this.contactsData,
  789. billType: 1
  790. }).then(res => {
  791. this.$message.success("保存成功");
  792. this.form = res.data.data;
  793. this.data = res.data.data.corpsAddrList
  794. this.corpsFiles = res.data.data.corpsFilesList
  795. }).finally(() => {
  796. this.loadingBtn = false;
  797. });
  798. } else {
  799. return false;
  800. }
  801. });
  802. }
  803. ,
  804. async saveColumn() {
  805. const inSave = await this.saveColumnData(
  806. this.getColumnName(263.2),
  807. this.option2
  808. );
  809. if (inSave) {
  810. this.$nextTick(() => {
  811. this.$refs.crud.doLayout();
  812. });
  813. this.$message.success("保存成功");
  814. //关闭窗口
  815. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  816. }
  817. }
  818. ,
  819. async resetColumn() {
  820. this.option2 = option2;
  821. const inSave = await this.delColumnData(
  822. this.getColumnName(263.2),
  823. option2
  824. );
  825. if (inSave) {
  826. this.$nextTick(() => {
  827. this.$refs.crud.doLayout();
  828. });
  829. this.getAllWorkDicts()
  830. this.$message.success("重置成功");
  831. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  832. }
  833. }
  834. ,
  835. creatingUsers(row) {
  836. if (row.id) {
  837. if (row.tel) {
  838. this.dialogVisibleBt = true;
  839. this.formDataTwo = {};
  840. this.formRow = row;
  841. } else {
  842. this.$message.error("请输入手机号");
  843. }
  844. } else {
  845. this.$message.error("请保存数据后再点击");
  846. }
  847. }
  848. ,
  849. //新增客户联系人保存触发
  850. rowSave(row, done, loading) {
  851. done(row);
  852. }
  853. ,
  854. //修改客户联系人触发
  855. rowUpdate(row, index, done, loading) {
  856. done(row);
  857. }
  858. ,
  859. //删除客户联系人触发
  860. rowDelTwo(row, index, donerowDel) {
  861. this.$confirm("确定将选择数据删除?", {
  862. confirmButtonText: "确定",
  863. cancelButtonText: "取消",
  864. type: "warning"
  865. }).then(() => {
  866. // 数据回调进行刷新
  867. if (row.id) {
  868. corpsattn(row.id).then(res => {
  869. this.$message({
  870. type: "success",
  871. message: "操作成功!"
  872. });
  873. this.contactsData.splice(index, 1);
  874. });
  875. } else {
  876. this.$message({
  877. type: "success",
  878. message: "操作成功!"
  879. });
  880. this.contactsData.splice(index, 1);
  881. }
  882. });
  883. }
  884. ,
  885. async saveColumnTwo() {
  886. const inSave = await this.saveColumnData(
  887. this.getColumnName(263.1),
  888. this.customerContact
  889. );
  890. if (inSave) {
  891. this.$nextTick(() => {
  892. this.$refs.crudTwo.doLayout();
  893. });
  894. this.$message.success("保存成功");
  895. //关闭窗口
  896. this.$refs.crudTwo.$refs.dialogColumn.columnBox = false;
  897. }
  898. }
  899. ,
  900. async resetColumnTwo() {
  901. this.customerContact = this.customerContactBack;
  902. const inSave = await this.delColumnData(
  903. this.getColumnName(263.1),
  904. this.customerContactBack
  905. );
  906. if (inSave) {
  907. this.$nextTick(() => {
  908. this.$refs.crudTwo.doLayout();
  909. });
  910. this.$message.success("重置成功");
  911. this.$refs.crudTwo.$refs.dialogColumn.columnBox = false;
  912. }
  913. }
  914. ,
  915. async saveColumn2() {
  916. const inSave = await this.saveColumnData(
  917. this.getColumnName(208.4),
  918. this.option3
  919. );
  920. if (inSave) {
  921. this.$nextTick(() => {
  922. this.$refs.crud.doLayout();
  923. });
  924. this.$message.success("保存成功");
  925. //关闭窗口
  926. this.$refs.crud2.$refs.dialogColumn.columnBox = false;
  927. }
  928. }
  929. ,
  930. async resetColumn2() {
  931. this.option3 = option3;
  932. const inSave = await this.delColumnData(
  933. this.getColumnName(208.4),
  934. option3
  935. );
  936. if (inSave) {
  937. this.$nextTick(() => {
  938. this.$refs.crud.doLayout();
  939. });
  940. this.getAllWorkDicts()
  941. this.$message.success("重置成功");
  942. this.$refs.crud2.$refs.dialogColumn.columnBox = false;
  943. }
  944. }
  945. ,
  946. //返回列表
  947. backToList() {
  948. this.$emit("goBack");
  949. }
  950. }
  951. }
  952. ;
  953. </script>
  954. <style lang="scss" scoped>
  955. .trading-form ::v-deep .el-form-item {
  956. margin-bottom: 8px !important;
  957. }
  958. ::v-deep .el-dialog__body {
  959. padding: 0px 20px 15px 20px;
  960. }
  961. ::v-deep .el-form-item__error {
  962. display: none !important;
  963. }
  964. .el-dialog ::v-deep .el-form-item__error {
  965. display: none !important;
  966. }
  967. .img-form ::v-deep .el-form-item {
  968. height: 150px;
  969. line-height: 150px;
  970. margin-bottom: 8px !important;
  971. }
  972. .img-form ::v-deep .avue-upload__icon {
  973. font-size: 20px;
  974. width: 150px;
  975. height: 150px;
  976. line-height: 150px;
  977. }
  978. ::v-deep .el-table .cell {
  979. padding: 0 2px !important;
  980. }
  981. ::v-deep .avue-crud .el-table .el-form-item__label {
  982. left: -1px;
  983. }
  984. .addressTabs {
  985. display: flex;
  986. justify-content: center;
  987. span {
  988. width: 100px;
  989. font-size: 18px;
  990. font-weight: 600;
  991. text-align: center;
  992. }
  993. }
  994. </style>