containers.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712
  1. <template>
  2. <div>
  3. <basic-container>
  4. <avue-crud :option="option" :table-loading="loading" :data="assemblyForm.containersList"
  5. :permission="permissionList" :before-open="beforeOpen" v-model="form" id="out-table"
  6. :header-cell-class-name="headerClassName" ref="crud" :row-style="{ height: '20px' }"
  7. :cell-style="{ padding: '0px' }" @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel"
  8. @selection-change="selectionChange" @refresh-change="refreshChange">
  9. <template slot="menuLeft">
  10. <div style="display: flex;align-items: center;justify-content: space-between">
  11. <div>
  12. <!--<el-button type="primary" size="small" @click="DistributionBox">配箱</el-button>-->
  13. <!--<el-button type="danger" size="small"-->
  14. <!-- :disabled="detailData.seeDisabled || pleasereviewType"-->
  15. <!-- @click="revokefun">撤销-->
  16. <!--</el-button>-->
  17. <!--<el-button type="danger" size="small"-->
  18. <!-- :disabled="detailData.seeDisabled || pleasereviewType"-->
  19. <!-- @click="wholeRevokefun">全部撤销-->
  20. <!--</el-button>-->
  21. <!-- <el-button type="warning" size="small" :disabled="detailData.seeDisabled || pleasereviewType || disabled"
  22. @click="cleanCntrNofun">清除箱号
  23. </el-button> -->
  24. <el-button type="success" size="small" plain :disabled="seeDisabled" @click.stop="equalDistribution2()">配箱
  25. </el-button>
  26. <el-button type="primary" size="small" :disabled="detailData.seeDisabled || pleasereviewType || showLock"
  27. @click="oneclickEditing">一键编辑
  28. </el-button>
  29. <el-button type="primary" size="small" :disabled="detailData.seeDisabled || pleasereviewType || disabled"
  30. @click="containersSubmitListfun">一键保存
  31. </el-button>
  32. <!-- <el-button type="danger" size="small" :disabled="detailData.seeDisabled || pleasereviewType || disabled"
  33. @click="handleDelete">一键删除
  34. </el-button> -->
  35. <el-button type="success" size="small"
  36. :disabled="detailData.seeDisabled || !assemblyForm.id || pleasereviewType || showLock"
  37. @click="oepnexcelBox">导入箱号铅封号
  38. </el-button>
  39. <el-button type="danger" size="small" :disabled="detailData.seeDisabled || pleasereviewType || showLock"
  40. @click="handleDelete">删除配箱
  41. </el-button>
  42. <el-button type="success" size="small" plain :disabled="detailData.seeDisabled"
  43. @click.stop="$refs.print.openDialog()">
  44. 报 表
  45. </el-button>
  46. <!-- <el-button type="success" size="small"
  47. :disabled="detailData.seeDisabled || !assemblyForm.id || pleasereviewType || disabled"
  48. @click="excelBox = true">导入箱号,铅封号
  49. </el-button> -->
  50. <!--<el-button type="warning" size="small"-->
  51. <!-- :disabled="numberfalsefun() || assemblyForm.id"-->
  52. <!-- @click="equalDistribution">平均分配</el-button>-->
  53. </div>
  54. <!--<div>-->
  55. <!-- <el-button size="small">Copy</el-button>-->
  56. <!-- <el-button size="small">查看箱信息</el-button>-->
  57. <!-- <el-button size="small">校验箱信息</el-button>-->
  58. <!--</div>-->
  59. </div>
  60. </template>
  61. <!--<template slot-scope="scope" slot="menu">-->
  62. <!-- <el-button v-if="scope.row.edit" :type="scope.type" :size="scope.size" icon="el-icon-edit"-->
  63. <!-- @click.stop="rowSavefun(scope.row, scope.index)">保存-->
  64. <!-- </el-button>-->
  65. <!-- <el-button v-else :type="scope.type" :size="scope.size" icon="el-icon-edit"-->
  66. <!-- :disabled="detailData.seeDisabled || pleasereviewType"-->
  67. <!-- @click.stop="rowCellfun(scope.row, scope.index)">编辑-->
  68. <!-- </el-button>-->
  69. <!-- <el-button :type="scope.type" :size="scope.size" icon="el-icon-delete"-->
  70. <!-- :disabled="detailData.seeDisabled || pleasereviewType"-->
  71. <!-- @click.stop="rowDel(scope.row, scope.index)">删除-->
  72. <!-- </el-button>-->
  73. <!--</template>-->
  74. <template slot-scope="scope" slot="cntrNo">
  75. <el-input v-if="scope.row.edit" v-model="scope.row.cntrNo" maxlength='11' size="small" clearable
  76. placeholder="请输入箱号" @input="cntrNoInput(scope.row, 'cntrNo')"
  77. @change="verifyChange(scope.row, 'cntrNo')"></el-input>
  78. <span v-else>{{ scope.row.cntrNo }}</span>
  79. </template>
  80. <template slot-scope="scope" slot="sealNo">
  81. <el-input v-if="scope.row.edit" v-model="scope.row.sealNo" maxlength='11' size="small" clearable
  82. placeholder="请输入封号" @input="cntrNoInput(scope.row, 'sealNo')"></el-input>
  83. <span v-else>{{ scope.row.sealNo }}</span>
  84. </template>
  85. <template slot-scope="scope" slot="quantity">
  86. <el-input v-if="scope.row.edit" v-model="scope.row.quantity" size="small" clearable
  87. placeholder="请输入件数"></el-input>
  88. <span v-else>{{ Number(scope.row.quantity).toFixed(0) }}</span>
  89. </template>
  90. <template slot-scope="scope" slot="grossWeight">
  91. <el-input v-if="scope.row.edit" v-model="scope.row.grossWeight" size="small" clearable
  92. placeholder="请输入毛重"></el-input>
  93. <span v-else>{{ scope.row.grossWeight }}</span>
  94. </template>
  95. <template slot-scope="scope" slot="netWeight">
  96. <el-input v-if="scope.row.edit" v-model="scope.row.netWeight" size="small" clearable
  97. placeholder="请输入净重"></el-input>
  98. <span v-else>{{ scope.row.netWeight }}</span>
  99. </template>
  100. <template slot-scope="scope" slot="measurement">
  101. <el-input v-if="scope.row.edit" v-model="scope.row.measurement" size="small" clearable
  102. placeholder="请输入尺码"></el-input>
  103. <span v-else>{{ scope.row.measurement }}</span>
  104. </template>
  105. <template slot-scope="scope" slot="remarks">
  106. <el-input v-if="scope.row.edit" v-model="scope.row.remarks" size="small" clearable
  107. placeholder="请输入备注"></el-input>
  108. <span v-else>{{ scope.row.remarks }}</span>
  109. </template>
  110. <template slot-scope="scope" slot="marks">
  111. <el-input v-if="scope.row.edit" v-model="scope.row.marks" size="small" clearable
  112. placeholder="请输入MARKS"></el-input>
  113. <span v-else>{{ scope.row.marks }}</span>
  114. </template>
  115. </avue-crud>
  116. </basic-container>
  117. <business-reports :id="assemblyForm.id" :itemIds="itemIds" ref="print" businessValue="HYJK" classifyCode="业务"
  118. groupCode="配箱预览" :treeType="false" :type="1"></business-reports>
  119. <el-dialog title="导入箱号,铅封号" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
  120. v-dialog-drag>
  121. <avue-form :option="excelOption" v-model="excelForm" :table-loading="excelLoading" :upload-before="uploadBefore"
  122. :upload-after="onSuccess">
  123. <template slot="excelTemplate">
  124. <el-button type="primary" @click="handleGet">
  125. 点击下载<i class="el-icon-download el-icon--right"></i>
  126. </el-button>
  127. </template>
  128. </avue-form>
  129. <p style="text-align: center;color: #DC0505">
  130. 温馨提示 第一次导入时请先下载模板
  131. </p>
  132. </el-dialog>
  133. </div>
  134. </template>
  135. <script>
  136. import {
  137. containersDetail,
  138. containersSubmit,
  139. containersRemove,
  140. containersCleanBoxNo,
  141. containersRevoke,
  142. distributionBox,
  143. containersSubmitList,
  144. containersExportContainers, containersImportBoxNo, containersList
  145. } from "@/api/iosBasicData/containers";
  146. import { getAccurate } from "@/api/boxManagement/buyContainer/index.js";
  147. import { mapGetters } from "vuex";
  148. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  149. import bports from "@/views/iosBasicData/bports/index.vue";
  150. import businessReports from "@/components/tradeAgency/businessReportsJK.vue";
  151. import { bportsList } from "@/api/iosBasicData/bports";
  152. import { getToken } from "@/util/auth";
  153. export default {
  154. components: { SearchQuery, bports, businessReports },
  155. props: {
  156. assemblyForm: {},
  157. detailData: {},
  158. // 请核禁用
  159. pleasereviewType: {
  160. type: Boolean,
  161. default: false,
  162. },
  163. disabled: {
  164. type: Boolean,
  165. default: false,
  166. },
  167. },
  168. data() {
  169. return {
  170. headers: { "Blade-Auth": "Bearer " + getToken() },
  171. // 是否禁用
  172. extendedDisabled: false,
  173. // 装货港数据
  174. polData: [],
  175. // 附件配置
  176. excelOption: {
  177. submitBtn: false,
  178. emptyBtn: false,
  179. column: [
  180. {
  181. label: "模板下载",
  182. prop: "excelTemplate",
  183. formslot: true,
  184. span: 24
  185. },
  186. {
  187. label: "模板上传",
  188. prop: "excelFile",
  189. type: "upload",
  190. drag: true,
  191. loadText: "模板上传中,请稍等",
  192. span: 24,
  193. propsHttp: {
  194. res: "data"
  195. },
  196. tip: "请上传 .xls,.xlsx 标准格式文件",
  197. action: "/api/blade-los/containers/importBoxNo"
  198. }
  199. ]
  200. },
  201. excelForm: {},
  202. excelLoading: false,
  203. excelBox: false,
  204. form: {},
  205. query: {},
  206. loading: false,
  207. // page: {
  208. // pageSize: 10,
  209. // currentPage: 1,
  210. // total: 0
  211. // },
  212. selectionList: [],
  213. option: {
  214. stripe: true,
  215. height: '250',
  216. calcHeight: 30,
  217. tip: false,
  218. searchShow: true,
  219. searchMenuSpan: 6,
  220. border: true,
  221. index: true,
  222. viewBtn: true,
  223. selection: true,
  224. dialogClickModal: false,
  225. refreshBtn: false,
  226. columnBtn: false,
  227. menu: false,
  228. column: [
  229. {
  230. label: "箱型",
  231. prop: "cntrTypeCode",
  232. width: "100",
  233. },
  234. {
  235. label: "箱号",
  236. prop: "cntrNo",
  237. width: "140",
  238. overHidden: true,
  239. },
  240. {
  241. label: "封号",
  242. prop: "sealNo",
  243. width: "140",
  244. overHidden: true,
  245. },
  246. // {
  247. // label: "票数",
  248. // prop: "ticketNumber"
  249. // },
  250. {
  251. label: "件数",
  252. prop: "quantity",
  253. width: "100",
  254. overHidden: true,
  255. },
  256. {
  257. label: "毛重(KGM)",
  258. prop: "grossWeight",
  259. width: "120",
  260. overHidden: true,
  261. },
  262. {
  263. label: "净重(KGM)",
  264. prop: "netWeight",
  265. width: "120",
  266. overHidden: true,
  267. },
  268. {
  269. label: "尺码/体积(CBM)",
  270. prop: "measurement",
  271. width: "140",
  272. overHidden: true,
  273. },
  274. {
  275. label: "POD堆场",
  276. prop: "podStationCname",
  277. width: "140",
  278. overHidden: true,
  279. },
  280. {
  281. label: "还箱日期",
  282. prop: "podEmptyContainerReturnDate",
  283. width: "140",
  284. overHidden: true,
  285. },
  286. {
  287. label: "备注",
  288. prop: "remarks",
  289. type: 'textarea',
  290. overHidden: true,
  291. width: 180,
  292. slot: true,
  293. minRows: 3,
  294. span: 24,
  295. },
  296. {
  297. label: "MARKS",
  298. prop: "marks",
  299. overHidden: true,
  300. },
  301. {
  302. label: "VGM总重(KGM)",
  303. prop: "vgmWeight",
  304. width: "140",
  305. overHidden: true,
  306. },
  307. ]
  308. },
  309. data: []
  310. };
  311. },
  312. computed: {
  313. ...mapGetters(["permission"]),
  314. permissionList() {
  315. return {
  316. addBtn: this.vaildData(this.permission.containers_add, false),
  317. viewBtn: this.vaildData(this.permission.containers_view, false),
  318. delBtn: this.vaildData(this.permission.containers_delete, false),
  319. editBtn: this.vaildData(this.permission.containers_edit, false)
  320. };
  321. },
  322. ids() {
  323. let ids = [];
  324. this.selectionList.forEach(ele => {
  325. ids.push(ele.id);
  326. });
  327. return ids.join(",");
  328. }
  329. },
  330. created() {
  331. },
  332. methods: {
  333. // 输入自动大写
  334. cntrNoInput(row, name) {
  335. this.$set(row, name, row[name].toLocaleUpperCase().replace(/[\W]/g, ''))
  336. },
  337. verifyChange(row, name) {
  338. if (row[name]) {
  339. getAccurate({ accurate: row[name] }).then(res => {
  340. if (res.data.data.records.length == 0) {
  341. const regex = /^([a-zA-Z]{4})([0-9]{7})$/;
  342. if (regex.test(row[name])) {
  343. if (this.calculateCheckDigit(row[name]) == row[name][10]) {
  344. // this.$message.success('集装箱校验正确!')
  345. } else {
  346. this.$confirm(`箱号:${row[name]}是否强制加入系统?`, '提示', {
  347. confirmButtonText: '确定',
  348. cancelButtonText: '取消',
  349. type: 'warning'
  350. }).then(() => {
  351. // this.$message({
  352. // type: 'success',
  353. // message: '删除成功!'
  354. // });
  355. }).catch(() => {
  356. this.$set(row, [name], null)
  357. });
  358. }
  359. } else {
  360. this.$confirm(`箱号:${row[name]}是否强制加入系统?`, '提示', {
  361. confirmButtonText: '确定',
  362. cancelButtonText: '取消',
  363. type: 'warning'
  364. }).then(() => {
  365. // this.$message({
  366. // type: 'success',
  367. // message: '删除成功!'
  368. // });
  369. }).catch(() => {
  370. this.$set(row, [name], null)
  371. });
  372. }
  373. }
  374. })
  375. }
  376. },
  377. calculateCheckDigit(containerNo) {
  378. let charCode = "0123456789A?BCDEFGHIJK?LMNOPQRSTU?VWXYZ";
  379. let num = 0;
  380. for (let i = 0; i < 10; i++) {
  381. let idx = charCode.indexOf(containerNo[i]);
  382. idx = idx * Math.pow(2, i);
  383. num += idx;
  384. }
  385. return num = (num % 11) % 10;
  386. },
  387. uploadBefore(file, done, loading) {
  388. done();
  389. loading = true;
  390. },
  391. // 上传成功
  392. onSuccess(res, done, loading, column) {
  393. this.excelBox = false;
  394. // this.$message.success("导入成功!");
  395. this.containersListfun()
  396. loading = false;
  397. done();
  398. },
  399. // 箱列表
  400. containersListfun() {
  401. containersList(1, 100, { pid: this.assemblyForm.id }).then(res => {
  402. this.assemblyForm.containersList = res.data.data.records
  403. })
  404. },
  405. oepnexcelBox() {
  406. if (!this.assemblyForm.id) {
  407. this.$message({
  408. message: '请先点击右上角保存按钮,保存数据之后才能添加!',
  409. type: 'warning'
  410. });
  411. return
  412. }
  413. this.findObject(this.excelOption.column, "excelFile").action = "/api/blade-los/containers/importBoxNo?billId=" + this.assemblyForm.id
  414. this.excelBox = true
  415. },
  416. // 下载模板
  417. handleGet() {
  418. window.open(
  419. `/api/blade-los/containers/exportContainers?${this.website.tokenHeader
  420. }=${getToken()}&pid=${this.assemblyForm.id}`
  421. );
  422. },
  423. // 查询件数是否为零
  424. numberfalsefun() {
  425. if (!this.assemblyForm.containersList) {
  426. return false
  427. }
  428. for (let item of this.assemblyForm.containersList) {
  429. if (Number(item.quantity) >= 0) {
  430. return true
  431. } else {
  432. return false
  433. }
  434. }
  435. },
  436. // 平均分配
  437. equalDistribution() {
  438. if (this.assemblyForm.waitingBoxList.length <= 0) {
  439. this.$message({
  440. type: "warning",
  441. message: "请先添加集装箱数据!"
  442. });
  443. return
  444. }
  445. this.$confirm("确定平均分配?", {
  446. confirmButtonText: "确定",
  447. cancelButtonText: "取消",
  448. type: "warning"
  449. }).then(() => {
  450. this.$emit('equalDistribution')
  451. })
  452. },
  453. // 编辑
  454. rowCellfun(row, index) {
  455. this.$delete(row, 'edit')
  456. this.$set(row, 'edit', true)
  457. },
  458. // 保存
  459. rowSavefun(row) {
  460. this.$delete(row, 'edit')
  461. this.$set(row, 'edit', false)
  462. this.$emit('rowSavefun', row)
  463. },
  464. // 清除箱号
  465. cleanCntrNofun() {
  466. this.$confirm("确定将数据清除全部箱号?", {
  467. confirmButtonText: "确定",
  468. cancelButtonText: "取消",
  469. type: "warning"
  470. }).then(() => {
  471. let arr = this.assemblyForm.containersList.map(item => {
  472. return item.id
  473. })
  474. // 清除箱号接口
  475. containersCleanBoxNo(arr.join(',')).then(res => {
  476. this.$message({
  477. type: "success",
  478. message: "清除箱号成功!"
  479. });
  480. this.$emit('billsDetailfun')
  481. })
  482. })
  483. },
  484. // 全部撤销
  485. wholeRevokefun() {
  486. this.$confirm("确定将数据撤销全部?", {
  487. confirmButtonText: "确定",
  488. cancelButtonText: "取消",
  489. type: "warning"
  490. }).then(() => {
  491. let arr = this.assemblyForm.containersList.map(item => {
  492. return item.id
  493. })
  494. containersRevoke(arr.join(',')).then(res => {
  495. this.$message({
  496. type: "success",
  497. message: "全部撤销成功!"
  498. });
  499. this.$emit('billsDetailfun')
  500. })
  501. })
  502. },
  503. // 撤销
  504. revokefun() {
  505. if (this.selectionList.length > 0) {
  506. containersRevoke(this.selectionList[0].id).then(res => {
  507. this.$message({
  508. type: "success",
  509. message: "撤销成功!"
  510. });
  511. this.$emit('billsDetailfun')
  512. })
  513. } else {
  514. this.$message({
  515. type: "warning",
  516. message: "请选选择要撤销的数据!"
  517. });
  518. }
  519. },
  520. // 配像一键编辑
  521. oneclickEditing() {
  522. for (let item of this.assemblyForm.containersList) {
  523. this.$delete(item, 'edit')
  524. this.$set(item, 'edit', true)
  525. }
  526. },
  527. // 配箱批量保存
  528. containersSubmitListfun() {
  529. if (!this.assemblyForm.id) {
  530. this.$message.warning('请先大保存')
  531. return
  532. }
  533. this.$confirm("确定全部保存配箱?", {
  534. confirmButtonText: "确定",
  535. cancelButtonText: "取消",
  536. type: "warning"
  537. }).then(() => {
  538. containersSubmitList(this.assemblyForm.containersList).then(res => {
  539. this.$message({
  540. type: "success",
  541. message: "操作成功!"
  542. });
  543. this.$emit('billsDetailfun')
  544. })
  545. })
  546. },
  547. equalDistribution2() {
  548. if (!this.assemblyForm.id) {
  549. this.$message({
  550. message: '请先点击右上角保存按钮,保存数据之后才能添加!',
  551. type: 'warning'
  552. });
  553. return
  554. }
  555. this.$confirm("是否确认配箱?", {
  556. confirmButtonText: "确定",
  557. cancelButtonText: "取消",
  558. type: "warning"
  559. }).then(() => {
  560. distributionBox({ billId: this.assemblyForm.id }).then(res => {
  561. this.$message({
  562. type: "success",
  563. message: "操作成功!"
  564. })
  565. this.$emit('billsDetailfun')
  566. })
  567. })
  568. },
  569. rowSave(row, done, loading) {
  570. containersSubmit(row).then(() => {
  571. // this.onLoad(this.page);
  572. this.$message({
  573. type: "success",
  574. message: "操作成功!"
  575. });
  576. done();
  577. }, error => {
  578. loading();
  579. window.console.log(error);
  580. });
  581. },
  582. rowUpdate(row, index, done, loading) {
  583. containersSubmit(row).then(() => {
  584. // this.onLoad(this.page);
  585. this.$message({
  586. type: "success",
  587. message: "操作成功!"
  588. });
  589. done();
  590. }, error => {
  591. loading();
  592. console.log(error);
  593. });
  594. },
  595. // 删除
  596. rowDel(row) {
  597. this.$confirm("确定将选择数据删除?", {
  598. confirmButtonText: "确定",
  599. cancelButtonText: "取消",
  600. type: "warning"
  601. })
  602. .then(() => {
  603. return containersRemove(row.id);
  604. })
  605. .then(() => {
  606. // this.onLoad(this.page);
  607. this.$message({
  608. type: "success",
  609. message: "操作成功!"
  610. });
  611. this.$emit('billsDetailfun')
  612. });
  613. },
  614. // 一键删除
  615. handleDelete() {
  616. if (this.selectionList.length === 0) {
  617. this.$message.warning("请选择至少一条数据");
  618. return;
  619. }
  620. this.$confirm("确定将选择数据删除?", {
  621. confirmButtonText: "确定",
  622. cancelButtonText: "取消",
  623. type: "warning"
  624. })
  625. .then(() => {
  626. return containersRemove(this.ids);
  627. })
  628. .then(() => {
  629. // this.onLoad(this.page);
  630. this.$message({
  631. type: "success",
  632. message: "操作成功!"
  633. });
  634. this.$emit('billsDetailfun')
  635. this.$refs.crud.toggleSelection();
  636. });
  637. },
  638. beforeOpen(done, type) {
  639. if (["edit", "view"].includes(type)) {
  640. containersDetail(this.form.id).then(res => {
  641. this.form = res.data.data;
  642. });
  643. }
  644. done();
  645. },
  646. // 当选择项发生变化时会触发该事件
  647. selectionChange(list) {
  648. this.selectionList = list
  649. // let arr = []
  650. // if (list.length > 1) {
  651. // this.$refs.crud.toggleSelection() // 先清空所以选择的数据
  652. // arr = [list[list.length -1]] // 获取最新点击的数组
  653. // this.$refs.crud.toggleSelection(arr,true) // 把刚点击的数组变成选择状态
  654. // }else {
  655. // arr = list
  656. // }
  657. // this.selectionList = arr
  658. // this.$emit('selectionChange',this.selectionList)
  659. },
  660. selectionClear() {
  661. this.selectionList = [];
  662. this.$refs.crud.toggleSelection();
  663. },
  664. refreshChange() {
  665. console.log('刷新')
  666. // this.onLoad(this.page, this.query);
  667. },
  668. // onLoad(page, params = {}) {
  669. // this.loading = true;
  670. // containersList(page.currentPage, page.pageSize, {...Object.assign(params, this.query),pid:this.pid}).then(res => {
  671. // const data = res.data.data;
  672. // this.page.total = data.total;
  673. // this.data = data.records
  674. // this.loading = false;
  675. // this.selectionClear();
  676. // });
  677. // }
  678. // 更改表格颜色
  679. headerClassName(tab) {
  680. //颜色间隔
  681. let back = ""
  682. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  683. if (tab.columnIndex % 2 === 0) {
  684. back = "back-one"
  685. } else if (tab.columnIndex % 2 === 1) {
  686. back = "back-two"
  687. }
  688. }
  689. return back;
  690. },
  691. }
  692. };
  693. </script>
  694. <style scoped>
  695. ::v-deep#out-table .back-one {
  696. background: #ecf5ff !important;
  697. text-align: center;
  698. padding: 4px 0;
  699. }
  700. ::v-deep#out-table .back-two {
  701. background: #ecf5ff !important;
  702. text-align: center;
  703. padding: 4px 0;
  704. }
  705. </style>