index.vue 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273
  1. <template>
  2. <div>
  3. <el-row v-show="isShow">
  4. <el-col :span="5">
  5. <div class="box">
  6. <el-scrollbar>
  7. <basic-container>
  8. <avue-tree :option="treeOption" :data="customTypeData" @node-click="nodeClick">
  9. <template slot="addBtn">
  10. <el-tooltip class="item" effect="dark" content="新建分类" placement="top">
  11. <i class="el-icon-setting" style="font-size:18px;line-height: 30px;width: 20px;padding: 0 10px;"
  12. @click="corpTypeVisible = true"></i>
  13. </el-tooltip>
  14. </template>
  15. </avue-tree>
  16. </basic-container>
  17. </el-scrollbar>
  18. </div>
  19. </el-col>
  20. <el-col :span="19">
  21. <basic-container class="page-crad">
  22. <!-- :on-change="handleChange" -->
  23. <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" :permission="permissionList"
  24. id="out-table" :header-cell-class-name="headerClassName" :search.sync="search" :before-open="beforeOpen"
  25. v-model="form" ref="crud" @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel"
  26. @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
  27. @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange"
  28. @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 304)"
  29. @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 304)" @on-load="onLoad">
  30. <template slot="code" slot-scope="scope">
  31. <avue-text-ellipsis :text="scope.row.code" :height="30" use-tooltip placement="top">
  32. <small slot="more">...</small>
  33. </avue-text-ellipsis>
  34. </template>
  35. <template slot="uscc" slot-scope="scope">
  36. <avue-text-ellipsis :text="scope.row.uscc" :height="30" use-tooltip placement="top">
  37. <small slot="more">...</small>
  38. </avue-text-ellipsis>
  39. </template>
  40. <template slot="cnName" slot-scope="scope">
  41. <avue-text-ellipsis :text="scope.row.cnName" :height="30" use-tooltip placement="top">
  42. <small slot="more">...</small>
  43. </avue-text-ellipsis>
  44. </template>
  45. <template slot="enName" slot-scope="scope">
  46. <avue-text-ellipsis :text="scope.row.enName" :height="30" use-tooltip placement="top">
  47. <small slot="more">...</small>
  48. </avue-text-ellipsis>
  49. </template>
  50. <template slot="cnAddr" slot-scope="scope">
  51. <avue-text-ellipsis :text="scope.row.cnAddr" :height="30" use-tooltip placement="top">
  52. <small slot="more">...</small>
  53. </avue-text-ellipsis>
  54. </template>
  55. <template slot="enAddr" slot-scope="scope">
  56. <avue-text-ellipsis :text="scope.row.enAddr" :height="30" use-tooltip placement="top">
  57. <small slot="more">...</small>
  58. </avue-text-ellipsis>
  59. </template>
  60. <template slot="menuLeft">
  61. <el-button type="warning" size="small" icon="el-icon-printer" @click="excelBox = true">导入
  62. </el-button>
  63. <el-button type="success" size="small" @click="handleExport" icon="el-icon-printer">导出</el-button>
  64. </template>
  65. <template slot-scope="{ row, index }" slot="menu">
  66. <el-button type="text" size="small" @click.stop="editOpen(row)">
  67. 编辑
  68. </el-button>
  69. <!-- <el-button type="text" size="small" @click.stop="editOpen(row, 1)">
  70. 编辑
  71. </el-button> -->
  72. <el-button type="text" size="small" @click.stop="rowDel(row, index)" :disabled="row.status > 0">
  73. 删除
  74. </el-button>
  75. </template>
  76. </avue-crud>
  77. </basic-container>
  78. </el-col>
  79. </el-row>
  80. <detailPage v-if="!isShow" ref="detail" @goBack="goBack" @copyOrder="copyOrder" :detailData="detailData"></detailPage>
  81. <!--类别弹窗-->
  82. <el-dialog title="类别" :visible.sync="corpTypeVisible" append-to-body width="60%" :before-close="corpTypeClose">
  83. <div>
  84. <bcorpstypedefine></bcorpstypedefine>
  85. </div>
  86. <span slot="footer" class="dialog-footer">
  87. <el-button @click="corpTypeVisible = false">取 消</el-button>
  88. <el-button type="primary" @click="corpTypeVisible = false">确 定</el-button>
  89. </span>
  90. </el-dialog>
  91. <el-dialog title="导入往来单位" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
  92. v-dialog-drag>
  93. <avue-form :option="excelOption" v-model="excelForm" :table-loading="excelLoading" :upload-before="uploadBefore"
  94. :upload-after="onSuccess">
  95. <template slot="excelTemplate">
  96. <el-button type="primary" @click="handleGet">
  97. 点击下载<i class="el-icon-download el-icon--right"></i>
  98. </el-button>
  99. </template>
  100. </avue-form>
  101. <p style="text-align: center;color: #DC0505">
  102. 温馨提示 第一次导入时请先下载模板
  103. </p>
  104. </el-dialog>
  105. </div>
  106. </template>
  107. <script>
  108. import { getToken } from "@/util/auth";
  109. import detailPage from "./detailsPage";
  110. import { getBcorpsList, getBcorpsDetail, addBcorps, updateBcorps, removeBcorps, downLoadBcorpsTemplate } from "@/api/iosBasicData/bcorps";
  111. import { mapGetters } from "vuex";
  112. import { bcorpstypedefineList } from "@/api/iosBasicData/bcorpstypedefine"
  113. import bcorpstypedefine from "@/views/iosBasicData/bcorps/bcorpstypedefine.vue";
  114. export default {
  115. components: {
  116. detailPage,
  117. bcorpstypedefine
  118. },
  119. data() {
  120. return {
  121. headers: { "Blade-Auth": "Bearer " + getToken() },
  122. // 类别弹窗的开启
  123. corpTypeVisible: false,
  124. treeOption: {
  125. nodeKey: "id",
  126. lazy: true,
  127. treeLoad: function (node, resolve) {
  128. const parentId = node.level === 0 ? 0 : node.data.id;
  129. },
  130. addBtn: false,
  131. menu: false,
  132. size: "small",
  133. props: {
  134. labelText: "标题",
  135. label: "cnName",
  136. value: "id",
  137. children: "children"
  138. }
  139. },
  140. excelForm: {},
  141. search: {},
  142. excelLoading: false,
  143. excelOption: {
  144. submitBtn: false,
  145. emptyBtn: false,
  146. column: [
  147. {
  148. label: "模板下载",
  149. prop: "excelTemplate",
  150. formslot: true,
  151. span: 24
  152. },
  153. {
  154. label: "模板上传",
  155. prop: "excelFile",
  156. type: "upload",
  157. drag: true,
  158. loadText: "模板上传中,请稍等",
  159. span: 24,
  160. propsHttp: {
  161. res: "data"
  162. },
  163. tip: "请上传 .xls,.xlsx 标准格式文件",
  164. action: "/api/blade-los/bcorps/importBCorps"
  165. }
  166. ]
  167. },
  168. // 客户类别数据
  169. customTypeData: [],
  170. excelBox: false,
  171. form: {},
  172. query: {},
  173. detailData: {},
  174. isShow: true,
  175. loading: true,
  176. page: {
  177. pageSize: 10,
  178. currentPage: 1,
  179. total: 0
  180. },
  181. selectionList: [],
  182. option: {},
  183. optionBack: {
  184. height: 'auto',
  185. calcHeight: 30,
  186. tip: false,
  187. excelBtn: true,
  188. searchShow: true,
  189. searchMenuSpan: 24,
  190. border: true,
  191. index: true,
  192. viewBtn: true,
  193. selection: true,
  194. addBtnText: '新建客户',
  195. dialogClickModal: false,
  196. column: [
  197. {
  198. label: "单位编码",
  199. prop: "code",
  200. search: true,
  201. rules: [{
  202. required: true,
  203. message: "请输入单位编码",
  204. trigger: "blur"
  205. }]
  206. },
  207. {
  208. label: "统一社会信用代码",
  209. prop: "uscc",
  210. width: 160,
  211. rules: [{
  212. required: true,
  213. message: "请输入统一社会信用代码",
  214. trigger: "blur"
  215. }]
  216. },
  217. {
  218. label: "首字母",
  219. prop: "initials",
  220. rules: [{
  221. required: true,
  222. message: "请输入首字母",
  223. trigger: "blur"
  224. }]
  225. },
  226. {
  227. label: "简称",
  228. prop: "shortName",
  229. rules: [{
  230. required: true,
  231. message: "请输入简称",
  232. trigger: "blur"
  233. }]
  234. },
  235. {
  236. label: "中文名称",
  237. prop: "cnName",
  238. search: true,
  239. rules: [{
  240. required: true,
  241. message: "请输入中文名称",
  242. trigger: "blur"
  243. }]
  244. },
  245. {
  246. label: "英文名称",
  247. prop: "enName",
  248. search: true,
  249. rules: [{
  250. required: true,
  251. message: "请输入英文名称",
  252. trigger: "blur"
  253. }]
  254. },
  255. {
  256. label: "国家代码",
  257. prop: "cntyCode",
  258. search: true,
  259. rules: [{
  260. required: true,
  261. message: "请输入国家代码",
  262. trigger: "blur"
  263. }]
  264. },
  265. {
  266. label: "国家名称",
  267. prop: "cntyName",
  268. search: true,
  269. rules: [{
  270. required: true,
  271. message: "请输入国家名称",
  272. trigger: "blur"
  273. }]
  274. },
  275. {
  276. label: "省、州",
  277. prop: "province",
  278. rules: [{
  279. required: true,
  280. message: "请输入省、州",
  281. trigger: "blur"
  282. }]
  283. },
  284. {
  285. label: "城市",
  286. prop: "city",
  287. rules: [{
  288. required: true,
  289. message: "请输入城市",
  290. trigger: "blur"
  291. }]
  292. },
  293. {
  294. label: "中文地址",
  295. prop: "cnAddr",
  296. search: true,
  297. rules: [{
  298. required: true,
  299. message: "请输入中文地址",
  300. trigger: "blur"
  301. }]
  302. },
  303. {
  304. label: "英文地址",
  305. prop: "enAddr",
  306. search: true,
  307. rules: [{
  308. required: true,
  309. message: "请输入英文地址",
  310. trigger: "blur"
  311. }]
  312. },
  313. {
  314. label: "电话",
  315. prop: "tel",
  316. search: true,
  317. rules: [{
  318. required: true,
  319. message: "请输入电话",
  320. trigger: "blur"
  321. }]
  322. },
  323. {
  324. label: "传真",
  325. prop: "fax",
  326. rules: [{
  327. required: true,
  328. message: "请输入传真",
  329. trigger: "blur"
  330. }]
  331. },
  332. {
  333. label: "电子邮箱",
  334. prop: "email",
  335. rules: [{
  336. required: true,
  337. message: "请输入电子邮箱",
  338. trigger: "blur"
  339. }]
  340. },
  341. {
  342. label: "负责人姓名",
  343. prop: "mgrName",
  344. width: 100,
  345. rules: [{
  346. required: true,
  347. message: "请输入负责人姓名",
  348. trigger: "blur"
  349. }]
  350. },
  351. {
  352. label: "联系人姓名",
  353. prop: "attnName",
  354. width: 100,
  355. rules: [{
  356. required: true,
  357. message: "请输入联系人姓名",
  358. trigger: "blur"
  359. }]
  360. },
  361. {
  362. label: "联系人电话",
  363. prop: "attnTel",
  364. width: 100,
  365. rules: [{
  366. required: true,
  367. message: "请输入联系人电话",
  368. trigger: "blur"
  369. }]
  370. },
  371. {
  372. label: "客户来源类别",
  373. prop: "sourceType",
  374. width: 100,
  375. rules: [{
  376. required: true,
  377. message: "请输入客户来源类别",
  378. trigger: "blur"
  379. }]
  380. },
  381. {
  382. label: "部门 Id",
  383. prop: "deptId",
  384. hide: true,
  385. display: false,
  386. },
  387. {
  388. label: "部门名称",
  389. prop: "deptName",
  390. rules: [{
  391. required: true,
  392. message: "请输入部门名称",
  393. trigger: "blur"
  394. }]
  395. },
  396. {
  397. label: "业务员 Id",
  398. prop: "salesId",
  399. hide: true,
  400. display: false,
  401. },
  402. {
  403. label: "业务员姓名",
  404. prop: "salesName",
  405. width: 100,
  406. rules: [{
  407. required: true,
  408. message: "请输入业务员姓名",
  409. trigger: "blur"
  410. }]
  411. },
  412. {
  413. label: "所属单位 Id",
  414. prop: "corpId",
  415. hide: true,
  416. display: false,
  417. },
  418. {
  419. label: "所属单位名称",
  420. prop: "corpName",
  421. width: 100,
  422. rules: [{
  423. required: true,
  424. message: "请输入所属单位名称",
  425. trigger: "blur"
  426. }]
  427. },
  428. {
  429. label: "客户类型",
  430. prop: "corpTypeName",
  431. rules: [{
  432. required: true,
  433. message: "请输入客户类型",
  434. trigger: "blur"
  435. }]
  436. },
  437. {
  438. label: "分管员",
  439. prop: "adminProfiles",
  440. rules: [{
  441. required: true,
  442. message: "请输入分管员",
  443. trigger: "blur"
  444. }]
  445. },
  446. {
  447. label: "海运邮箱",
  448. prop: "seaEmail",
  449. rules: [{
  450. required: true,
  451. message: "请输入海运邮箱",
  452. trigger: "blur"
  453. }]
  454. },
  455. {
  456. label: "空运邮箱",
  457. prop: "airEmail",
  458. rules: [{
  459. required: true,
  460. message: "请输入空运邮箱",
  461. trigger: "blur"
  462. }]
  463. },
  464. {
  465. label: "国际编码",
  466. prop: "unCode",
  467. rules: [{
  468. required: true,
  469. message: "请输入国际编码",
  470. trigger: "blur"
  471. }]
  472. },
  473. {
  474. label: "海关编码",
  475. prop: "customsCode",
  476. rules: [{
  477. required: true,
  478. message: "请输入海关编码",
  479. trigger: "blur"
  480. }]
  481. },
  482. {
  483. label: "SCAC 代码",
  484. prop: "scacCode",
  485. width: 100,
  486. rules: [{
  487. required: true,
  488. message: "请输入SCAC 代码",
  489. trigger: "blur"
  490. }]
  491. },
  492. {
  493. label: "iGenZong 代码",
  494. prop: "igenzongCode",
  495. width: 120,
  496. rules: [{
  497. required: true,
  498. message: "请输入iGenZong 代码",
  499. trigger: "blur"
  500. }]
  501. },
  502. {
  503. label: "美线约号",
  504. prop: "amLineAgreementno",
  505. rules: [{
  506. required: true,
  507. message: "请输入美线约号",
  508. trigger: "blur"
  509. }]
  510. },
  511. {
  512. label: "船公司代码",
  513. prop: "carrierCode",
  514. width: 100,
  515. rules: [{
  516. required: true,
  517. message: "请输入船公司代码",
  518. trigger: "blur"
  519. }]
  520. },
  521. {
  522. label: "场站三字码",
  523. prop: "cyCode",
  524. width: 100,
  525. rules: [{
  526. required: true,
  527. message: "请输入场站三字码",
  528. trigger: "blur"
  529. }]
  530. },
  531. {
  532. label: "CMA Laracode",
  533. prop: "cmaLaracode",
  534. width: 120,
  535. rules: [{
  536. required: true,
  537. message: "请输入CMA Laracode",
  538. trigger: "blur"
  539. }]
  540. },
  541. {
  542. label: "CMA Location",
  543. prop: "cmaLocation",
  544. width: 120,
  545. rules: [{
  546. required: true,
  547. message: "请输入CMA Location",
  548. trigger: "blur"
  549. }]
  550. },
  551. {
  552. label: "ZIM CUCC",
  553. prop: "zimCucc",
  554. width: 120,
  555. rules: [{
  556. required: true,
  557. message: "请输入ZIM CUCC",
  558. trigger: "blur"
  559. }]
  560. },
  561. {
  562. label: "关贸云编码",
  563. prop: "gmyCode",
  564. width: 100,
  565. rules: [{
  566. required: true,
  567. message: "请输入关贸云编码",
  568. trigger: "blur"
  569. }]
  570. },
  571. {
  572. label: "INTRRA ICUA",
  573. prop: "inttraIcua",
  574. width: 100,
  575. rules: [{
  576. required: true,
  577. message: "请输入INTRRA ICUA",
  578. trigger: "blur"
  579. }]
  580. },
  581. {
  582. label: "INTRRA ICUA 联系人",
  583. prop: "inttraIcuaAttn",
  584. width: 160,
  585. rules: [{
  586. required: true,
  587. message: "请输入INTRRA ICUA 联系人",
  588. trigger: "blur"
  589. }]
  590. },
  591. {
  592. label: "INTRRA ICUA Email",
  593. prop: "inttraIcuaEmail",
  594. width: 140,
  595. rules: [{
  596. required: true,
  597. message: "请输入INTRRA ICUA Email",
  598. trigger: "blur"
  599. }]
  600. },
  601. {
  602. label: "EDI 格式名称",
  603. prop: "ediFmt",
  604. width: 120,
  605. rules: [{
  606. required: true,
  607. message: "请输入EDI 格式名称",
  608. trigger: "blur"
  609. }]
  610. },
  611. {
  612. label: "EDI FTP 地址",
  613. prop: "ediFtp",
  614. width: 100,
  615. rules: [{
  616. required: true,
  617. message: "请输入EDI FTP 地址",
  618. trigger: "blur"
  619. }]
  620. },
  621. {
  622. label: "EDI 邮箱",
  623. prop: "ediEmail",
  624. rules: [{
  625. required: true,
  626. message: "请输入EDI 邮箱",
  627. trigger: "blur"
  628. }]
  629. },
  630. {
  631. label: "是否 VIP 客户",
  632. prop: "vip",
  633. width: 120,
  634. type: 'select',
  635. dicData: [{
  636. label: '否',
  637. value: 0
  638. }, {
  639. label: '是',
  640. value: 1
  641. }],
  642. rules: [{
  643. required: true,
  644. message: "请输入是否 VIP 客户,0=否,1=是",
  645. trigger: "blur"
  646. }]
  647. },
  648. {
  649. label: "VIP 等级",
  650. prop: "vipLevel",
  651. rules: [{
  652. required: true,
  653. message: "请输入VIP 等级",
  654. trigger: "blur"
  655. }]
  656. },
  657. {
  658. label: "是否已签约",
  659. prop: "isSigned",
  660. type: 'select',
  661. width: 100,
  662. dicData: [{
  663. label: '否',
  664. value: 0
  665. }, {
  666. label: '是',
  667. value: 1
  668. }],
  669. rules: [{
  670. required: true,
  671. message: "请输入是否已签约,0=否,1=是",
  672. trigger: "blur"
  673. }]
  674. },
  675. {
  676. label: "授信状态",
  677. prop: "creditStatus",
  678. rules: [{
  679. required: true,
  680. message: "请输入授信状态",
  681. trigger: "blur"
  682. }]
  683. },
  684. {
  685. label: "授信等级",
  686. prop: "creditLevel",
  687. rules: [{
  688. required: true,
  689. message: "请输入授信等级,A=A级,B=B级,B+=B+级,B-=B-级,C=C级,D=黑名单",
  690. trigger: "blur"
  691. }]
  692. },
  693. {
  694. label: "授信天数",
  695. prop: "creditDay",
  696. rules: [{
  697. required: true,
  698. message: "请输入授信天数",
  699. trigger: "blur"
  700. }]
  701. },
  702. {
  703. label: "授信币种",
  704. prop: "creditCur",
  705. rules: [{
  706. required: true,
  707. message: "请输入授信币种",
  708. trigger: "blur"
  709. }]
  710. },
  711. {
  712. label: "授信额度",
  713. prop: "creditGrant",
  714. rules: [{
  715. required: true,
  716. message: "请输入授信额度",
  717. trigger: "blur"
  718. }]
  719. },
  720. {
  721. label: "授信利率",
  722. prop: "creditRate",
  723. rules: [{
  724. required: true,
  725. message: "请输入授信利率",
  726. trigger: "blur"
  727. }]
  728. },
  729. {
  730. label: "付款方式",
  731. prop: "paymentType",
  732. rules: [{
  733. required: true,
  734. message: "请输入付款方式",
  735. trigger: "blur"
  736. }]
  737. },
  738. {
  739. label: "账期设置",
  740. prop: "accountPeriodType",
  741. rules: [{
  742. required: true,
  743. message: "请输入账期设置",
  744. trigger: "blur"
  745. }]
  746. },
  747. {
  748. label: "最大欠款额",
  749. prop: "maxArrears",
  750. width: 100,
  751. rules: [{
  752. required: true,
  753. message: "请输入最大欠款额",
  754. trigger: "blur"
  755. }]
  756. },
  757. {
  758. label: "协议号",
  759. prop: "agreementNo",
  760. rules: [{
  761. required: true,
  762. message: "请输入协议号",
  763. trigger: "blur"
  764. }]
  765. },
  766. {
  767. label: "绩效系数",
  768. prop: "performanceRate",
  769. rules: [{
  770. required: true,
  771. message: "请输入绩效系数",
  772. trigger: "blur"
  773. }]
  774. },
  775. {
  776. label: "增值税率",
  777. prop: "taxRate",
  778. rules: [{
  779. required: true,
  780. message: "请输入增值税率",
  781. trigger: "blur"
  782. }]
  783. },
  784. {
  785. label: "存在",
  786. prop: "isPs",
  787. type: 'select',
  788. dicData: [{
  789. label: '否',
  790. value: 0
  791. }, {
  792. label: '是',
  793. value: 1
  794. }],
  795. rules: [{
  796. required: true,
  797. message: "请输入存在 PS 0=否 1=是",
  798. trigger: "blur"
  799. }]
  800. },
  801. {
  802. label: "利润分成比例",
  803. prop: "psRate",
  804. width: 100,
  805. rules: [{
  806. required: true,
  807. message: "请输入PS(利润分成) 比例",
  808. trigger: "blur"
  809. }]
  810. },
  811. {
  812. label: "允许付大于收",
  813. prop: "psAllowLargeCredit",
  814. type: 'select',
  815. width: 100,
  816. dicData: [{
  817. label: '否',
  818. value: 0
  819. }, {
  820. label: '是',
  821. value: 1
  822. }],
  823. rules: [{
  824. required: true,
  825. message: "请输入PS允许付大于收 0=否 1=是",
  826. trigger: "blur"
  827. }]
  828. },
  829. // {
  830. // label: "详情,主要用于提单信息",
  831. // prop: "details",
  832. // rules: [{
  833. // required: true,
  834. // message: "请输入详情,主要用于提单信息",
  835. // trigger: "blur"
  836. // }]
  837. // },
  838. // {
  839. // label: "JSON 对象数组,用于不查询的扩展数据, 例如:[{name: "key1", value: "value1"}]",
  840. // prop: "extendedData",
  841. // rules: [{
  842. // required: true,
  843. // message: "请输入JSON 对象数组,用于不查询的扩展数据, 例如:[{name: "key1", value: "value1"}]",
  844. // trigger: "blur"
  845. // }]
  846. // },
  847. {
  848. label: "版本",
  849. prop: "version",
  850. hide: true,
  851. display: false,
  852. },
  853. {
  854. label: "状态",
  855. prop: "status",
  856. type: 'select',
  857. dicData: [{
  858. label: '启用',
  859. value: 0
  860. }, {
  861. label: '停用',
  862. value: 1
  863. }],
  864. rules: [{
  865. required: true,
  866. message: "请输入状态",
  867. trigger: "blur"
  868. }]
  869. },
  870. {
  871. label: "主键",
  872. prop: "id",
  873. hide: true,
  874. display: false,
  875. },
  876. {
  877. label: "分公司 Id",
  878. prop: "branchId",
  879. hide: true,
  880. display: false,
  881. },
  882. {
  883. label: "创建人 Id",
  884. prop: "createUser",
  885. hide: true,
  886. display: false,
  887. },
  888. {
  889. label: "创建人",
  890. prop: "createUserName",
  891. display: false,
  892. },
  893. {
  894. label: "创建部门 Id",
  895. prop: "createDept",
  896. hide: true,
  897. display: false,
  898. },
  899. {
  900. label: "创建部门",
  901. prop: "createDeptName",
  902. display: false,
  903. },
  904. {
  905. label: "创建时间",
  906. prop: "createTime",
  907. width: 160,
  908. display: false,
  909. },
  910. {
  911. label: "修改人 Id",
  912. prop: "updateUser",
  913. hide: true,
  914. display: false,
  915. },
  916. {
  917. label: "修改人",
  918. prop: "updateUserName",
  919. display: false,
  920. },
  921. {
  922. label: "修改时间",
  923. prop: "updateTime",
  924. width: 160,
  925. display: false,
  926. },
  927. {
  928. label: "是否已删除(0 否 1是)",
  929. prop: "isDeleted",
  930. hide: true,
  931. display: false,
  932. },
  933. {
  934. label: "备注",
  935. prop: "remarks",
  936. span: 24,
  937. type: 'textarea',
  938. width: "180",
  939. slot: true,
  940. minRows: 3,
  941. },
  942. ]
  943. },
  944. data: []
  945. };
  946. },
  947. computed: {
  948. ...mapGetters(["permission"]),
  949. permissionList() {
  950. return {
  951. // addBtn: this.vaildData(this.permission.bcorps_add, false),
  952. viewBtn: this.vaildData(this.permission.bcorps_view, false),
  953. delBtn: this.vaildData(this.permission.bcorps_delete, false),
  954. editBtn: this.vaildData(this.permission.bcorps_edit, false)
  955. };
  956. },
  957. ids() {
  958. let ids = [];
  959. this.selectionList.forEach(ele => {
  960. ids.push(ele.id);
  961. });
  962. return ids.join(",");
  963. }
  964. },
  965. async created() {
  966. this.option = await this.getColumnData(this.getColumnName(304), this.optionBack);
  967. this.bcorpstypedefineListfun()
  968. },
  969. methods: {
  970. // 导入
  971. // handleChange(file, fileLis) {
  972. // console.log('daoru');
  973. // // this.$Export.xlsx(file.raw)
  974. // // .then(data => {
  975. // // this.data=data.results;
  976. // // })
  977. // },
  978. // 导出
  979. handleExport() {
  980. // let params = { ...this.search }
  981. // let queryParams = Object.assign({}, params, {
  982. // corpsTypeId: this.treeDeptId,
  983. // corpType: customerParameter.code
  984. // });
  985. // console.log(this.website.tokenHeader)
  986. var condition = ''
  987. for (const key in this.search) {
  988. var value = this.search[key]
  989. if (value) {
  990. condition += `&${key}=${this.search[key]}`
  991. }
  992. }
  993. console.log(condition);
  994. this.$confirm('是否导出客户资料?', '提示', {
  995. confirmButtonText: '确定',
  996. cancelButtonText: '取消',
  997. type: 'warning'
  998. }).then(() => {
  999. window.open(
  1000. `/api/blade-los/bcorps/exportBCorps?${this.website.tokenHeader
  1001. }=${getToken()}${condition}`
  1002. );
  1003. }).catch(() => {
  1004. this.$message({
  1005. type: 'info',
  1006. message: '已取消' //
  1007. });
  1008. })
  1009. // queryParams.code = queryParams.code ? queryParams.code : ''
  1010. // queryParams.cname = queryParams.cname ? queryParams.cname : ''
  1011. // queryParams.belongtoarea = queryParams.belongtoarea ? queryParams.belongtoarea : ''
  1012. // queryParams.belongtocompany = queryParams.belongtocompany ? queryParams.belongtocompany : ''
  1013. // queryParams.attn = queryParams.attn ? queryParams.attn : ''
  1014. // queryParams.goodtypes = queryParams.goodtypes ? queryParams.goodtypes : ''
  1015. // queryParams.creditLevel = queryParams.creditLevel ? queryParams.creditLevel : ''
  1016. // queryParams.adminProfiles = queryParams.adminProfiles ? queryParams.adminProfiles : ''
  1017. // queryParams.corpsTypeId = queryParams.corpsTypeId ? queryParams.corpsTypeId : ''
  1018. // console.log(queryParams)
  1019. // this.$confirm('是否导出客户资料?', '提示', {
  1020. // confirmButtonText: '确定',
  1021. // cancelButtonText: '取消',
  1022. // type: 'warning'
  1023. // }).then(() => {
  1024. // window.open(
  1025. // `/api/blade-los/bcorps/exportBCorps?${this.website.tokenHeader
  1026. // }=${getToken()}&code=${queryParams.code}&cname=${queryParams.cname}&belongtoarea=${queryParams.belongtoarea}&belongtocompany=${queryParams.belongtocompany}&attn=${queryParams.attn}&goodtypes=${queryParams.goodtypes}&creditLevel=${queryParams.creditLevel}&adminProfiles=${queryParams.adminProfiles}&corpsTypeId=${queryParams.corpsTypeId}&corpType=KH`
  1027. // );
  1028. // }).catch(() => {
  1029. // this.$message({
  1030. // type: 'info',
  1031. // message: '已取消' //
  1032. // });
  1033. // })
  1034. },
  1035. // 下载模板
  1036. handleGet() {
  1037. window.open(
  1038. `/api/blade-los/bcorps/exportBCorps/template?${this.website.tokenHeader
  1039. }=${getToken()}`
  1040. );
  1041. },
  1042. // 上传成功
  1043. onSuccess(res, done, loading, column) {
  1044. this.excelBox = false;
  1045. this.$message.success("导入成功!");
  1046. loading = false;
  1047. this.onLoad(this.page);
  1048. done();
  1049. },
  1050. uploadBefore(file, done, loading) {
  1051. done();
  1052. loading = true;
  1053. },
  1054. onError(err, file, fileList) {
  1055. err += ''
  1056. // console.log(JSON.stringify(err.match(/{(\S*)}/)[1]));
  1057. var data = err.match(/{(\S*)}/)[1]
  1058. this.$message.error(data.split("msg\":")[1]);
  1059. },
  1060. // 左侧点击回调
  1061. nodeClick(data) {
  1062. var reqiestData = this.search;
  1063. // // console.log(data, 904)
  1064. reqiestData.corpType = data.id
  1065. this.onLoad(this.page, reqiestData);
  1066. },
  1067. // 获取客户类别
  1068. bcorpstypedefineListfun() {
  1069. bcorpstypedefineList().then(res => {
  1070. this.customTypeData = res.data.data.records
  1071. console.log(this.customTypeData);
  1072. })
  1073. },
  1074. editOpen(row) {
  1075. this.detailData = {
  1076. id: row.id
  1077. };
  1078. this.isShow = false;
  1079. },
  1080. rowSave(row, done, loading) {
  1081. addBcorps(row).then(() => {
  1082. this.onLoad(this.page);
  1083. this.$message({
  1084. type: "success",
  1085. message: "操作成功!"
  1086. });
  1087. done();
  1088. }, error => {
  1089. loading();
  1090. window.console.log(error);
  1091. });
  1092. },
  1093. rowUpdate(row, index, done, loading) {
  1094. updateBcorps(row).then(() => {
  1095. this.onLoad(this.page);
  1096. this.$message({
  1097. type: "success",
  1098. message: "操作成功!"
  1099. });
  1100. done();
  1101. }, error => {
  1102. loading();
  1103. console.log(error);
  1104. });
  1105. },
  1106. rowDel(row) {
  1107. this.$confirm("确定将选择数据删除?", {
  1108. confirmButtonText: "确定",
  1109. cancelButtonText: "取消",
  1110. type: "warning"
  1111. })
  1112. .then(() => {
  1113. return removeBcorps(row.id);
  1114. })
  1115. .then(() => {
  1116. this.onLoad(this.page);
  1117. this.$message({
  1118. type: "success",
  1119. message: "操作成功!"
  1120. });
  1121. });
  1122. },
  1123. handleDelete() {
  1124. if (this.selectionList.length === 0) {
  1125. this.$message.warning("请选择至少一条数据");
  1126. return;
  1127. }
  1128. this.$confirm("确定将选择数据删除?", {
  1129. confirmButtonText: "确定",
  1130. cancelButtonText: "取消",
  1131. type: "warning"
  1132. })
  1133. .then(() => {
  1134. return removeBcorps(this.ids);
  1135. })
  1136. .then(() => {
  1137. this.onLoad(this.page);
  1138. this.$message({
  1139. type: "success",
  1140. message: "操作成功!"
  1141. });
  1142. this.$refs.crud.toggleSelection();
  1143. });
  1144. },
  1145. beforeOpen(done, type) {
  1146. this.isShow = false;
  1147. // if (["edit", "view"].includes(type)) {
  1148. // getBcorpsDetail(this.form.id).then(res => {
  1149. // this.form = res.data.data;
  1150. // });
  1151. // }
  1152. // done();
  1153. },
  1154. searchReset() {
  1155. this.query = {};
  1156. this.onLoad(this.page);
  1157. },
  1158. searchChange(params, done) {
  1159. this.query = params;
  1160. this.page.currentPage = 1;
  1161. this.onLoad(this.page, params);
  1162. done();
  1163. },
  1164. selectionChange(list) {
  1165. this.selectionList = list;
  1166. },
  1167. selectionClear() {
  1168. this.selectionList = [];
  1169. this.$refs.crud.toggleSelection();
  1170. },
  1171. currentChange(currentPage) {
  1172. this.page.currentPage = currentPage;
  1173. },
  1174. sizeChange(pageSize) {
  1175. this.page.pageSize = pageSize;
  1176. },
  1177. refreshChange() {
  1178. this.onLoad(this.page, this.query);
  1179. },
  1180. onLoad(page, params = {}) {
  1181. this.loading = true;
  1182. getBcorpsList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
  1183. const data = res.data.data;
  1184. this.page.total = data.total;
  1185. this.data = data.records;
  1186. this.loading = false;
  1187. this.selectionClear();
  1188. });
  1189. },
  1190. goBack() {
  1191. this.isShow = true;
  1192. },
  1193. // 类别弹窗关闭
  1194. corpTypeClose(done) {
  1195. this.$confirm('确认关闭?')
  1196. .then(_ => {
  1197. done();
  1198. })
  1199. .catch(_ => { });
  1200. },
  1201. //自定义列保存
  1202. async saveColumnTwo(ref, option, optionBack, code) {
  1203. /**
  1204. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1205. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1206. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1207. */
  1208. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  1209. if (inSave) {
  1210. this.$message.success("保存成功");
  1211. //关闭窗口
  1212. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1213. }
  1214. },
  1215. //自定义列重置
  1216. async resetColumnTwo(ref, option, optionBack, code) {
  1217. this[option] = this[optionBack];
  1218. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  1219. if (inSave) {
  1220. this.$message.success("重置成功");
  1221. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1222. }
  1223. },
  1224. // 更改表格颜色
  1225. headerClassName(tab) {
  1226. //颜色间隔
  1227. let back = ""
  1228. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  1229. if (tab.columnIndex % 2 === 0) {
  1230. back = "back-one"
  1231. } else if (tab.columnIndex % 2 === 1) {
  1232. back = "back-two"
  1233. }
  1234. }
  1235. return back;
  1236. },
  1237. }
  1238. };
  1239. </script>
  1240. <style lang="scss" scoped>
  1241. ::v-deep#out-table .back-one {
  1242. background: #ecf5ff !important;
  1243. }
  1244. ::v-deep#out-table .back-two {
  1245. background: #ecf5ff !important;
  1246. }
  1247. ::v-deep .el-input-group__append {
  1248. padding: 0 0px !important;
  1249. }
  1250. /deep/ .el-tree-node__content>.el-tree-node__expand-icon {
  1251. visibility: hidden;
  1252. }
  1253. </style>