| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082 |
- <template>
- <basic-container>
- <avue-crud
- :option="option"
- :search.sync="search"
- v-model="form"
- :table-loading="loading"
- :data="dataList"
- ref="crud"
- :key="key"
- :before-open="beforeOpen"
- @on-load="onLoad"
- @row-save="rowSave"
- @row-update="rowUpdate"
- @search-change="searchChange"
- :upload-delete="uploadDelete"
- @row-del="rowDel"
- @refresh-change="refreshChange"
- @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 234)"
- @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 234)"
- :page.sync="page"
- >
- <template slot="menuLeft">
- <el-button type="success" size="small" @click="importData">导入</el-button>
- <el-button type="warning" size="small" @click="outExport">导 出 </el-button>
- </template>
- <!-- <template slot-scope="{ type, size, row, index }" slot="menu">
- <el-button icon="el-icon-edit" :size="size" type="text" @click="$refs.crud.rowEdit(row, index)">查 看 </el-button>
- </template> -->
- <tempalte slot="boxMakingCompanyForm">
- <dic-select
- v-model="form.boxMakingCompany"
- placeholder="造箱公司"
- key="id"
- label="cnName"
- res="records"
- url="/blade-los/bcorps/selectList?corpTypeName=箱东"
- :filterable="true"
- :remote="true"
- dataName="cnName"
- @selectChange="dicChange('boxMakingCompany', $event)"
- ></dic-select>
- </tempalte>
- <template slot-scope="{ type, size, row, index, disabled }" slot="code">
- <span class="el-button--text" style="cursor: pointer" @click="track(row)">{{ row.code }}</span>
- </template>
- <template slot-scope="{ type, size, row, index, disabled }" slot="menu">
- <el-button size="small" :disabled="disabled" type="text" @click="rowEdit(row, $index)">编辑 </el-button>
- </template>
- </avue-crud>
- <el-dialog
- title="箱轨迹"
- :visible.sync="boxTrack"
- :append-to-body="true"
- :destroy-on-close="true"
- :close-on-click-modal="false"
- v-if="boxTrack"
- top="1vh"
- width="80%"
- v-dialog-drag
- >
- <span>
- <avue-crud
- ref="crudTrack"
- :option="optionTrack"
- :data="dataTrackList"
- :search.sync="searchTwo"
- :page.sync="pageTwo"
- :table-loading="loadingTwo"
- @on-load="onLoadTrack"
- @search-change="searchChangeTwo"
- @row-update="rowUpdateTrack"
- @resetColumn="resetColumnTwo('crudTrack', 'optionTrack', 'optionTrackBack', 234.1)"
- @saveColumn="saveColumnTwo('crudTrack', 'optionTrack', 'optionTrackBack', 234.1)"
- v-model="formTrack"
- >
- <template slot-scope="{ type, size, row, index, disabled }" slot="code">
- <span class="el-button--text" style="cursor: pointer" @click="contractNoJump(row)">{{ row.code }}</span>
- </template>
- <template slot-scope="{ type, size, row, index, disabled }" slot="menu">
- <el-button icon="el-icon-edit" :size="size" :disabled="disabled" :type="type" @click="$refs.crudTrack.rowEdit(row, index)"
- >编辑
- </el-button>
- <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type" @click="rowDel(row, index, 'GJ')">删除 </el-button>
- </template>
- </avue-crud>
- </span>
- </el-dialog>
- <el-dialog title="导入数据" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false" v-dialog-drag>
- <avue-form
- v-if="excelBox"
- :option="excelOption"
- v-model="excelForm"
- :table-loading="excelLoading"
- :upload-before="uploadBefore"
- :upload-after="onSuccess"
- >
- <template slot="excelTemplate">
- <el-button type="primary" @click="handleGet"> 点击下载<i class="el-icon-download el-icon--right"></i> </el-button>
- </template>
- </avue-form>
- <p style="text-align: center;color: #DC0505">
- 温馨提示 第一次导入时请先下载模板
- </p>
- </el-dialog>
- </basic-container>
- </template>
- <script>
- import { addUpdate, boxRemove, getList, remove, archivestrajectory, update } from "@/api/box/archives";
- import { getToken } from "@/util/auth";
- import { getAllBoxs } from "@/api/basicData/portinformation";
- import dicSelect from "@/components/dicSelect/main";
- import fa from "element-ui/src/locale/lang/fa";
- export default {
- name: "箱档案",
- components: {
- dicSelect
- },
- data() {
- return {
- excelBox: false,
- excelForm: {},
- excelLoading: false,
- excelOption: {
- submitBtn: false,
- emptyBtn: false,
- column: [
- {
- label: "模板下载",
- prop: "excelTemplate",
- formslot: true,
- span: 24
- },
- {
- label: "模板上传",
- prop: "excelFile",
- type: "upload",
- drag: true,
- loadText: "模板上传中,请稍等",
- span: 24,
- propsHttp: {
- res: "data"
- },
- tip: "请上传 .xls,.xlsx 标准格式文件",
- action: "/api/blade-los/archives/import-descParts-info"
- }
- ]
- },
- boxTrack: false,
- dataTrackList: [],
- loadingTwo: false,
- searchTwo: {},
- formTrack: {},
- optionTrack: {},
- optionTrackBack: {
- align: "center",
- index: true,
- menu: false,
- addBtnText: "录入明细",
- refreshBtn: false,
- addBtn: false,
- span: 8,
- searchMenuPosition: "right",
- searchSpan: 6,
- searchMenuSpan: 6,
- searchIcon: true,
- searchIndex: 3,
- addRowBtn: false,
- cellBtn: false,
- editBtn: false,
- delBtn: false,
- menuWidth: 200,
- dialogTop: 25,
- dialogWidth: "80%",
- column: [
- {
- label: "箱号",
- prop: "code",
- overHidden: true
- // search: true
- },
- {
- label: "放箱号",
- prop: "containerNumber",
- overHidden: true
- },
- {
- label: "箱型",
- prop: "boxType",
- overHidden: true
- },
- {
- label: "箱东",
- prop: "boxEastName",
- overHidden: true
- },
- {
- label: "放箱号类型",
- prop: "boxCategory",
- overHidden: true
- // search: true
- },
- {
- label: "箱动态",
- prop: "boxDynamics",
- overHidden: true,
- search: true,
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxDynamics",
- props: {
- label: "dictValue",
- value: "dictValue"
- }
- },
- {
- label: "动态日期",
- prop: "newDate",
- overHidden: true
- },
- {
- label: "港口",
- prop: "portCname",
- overHidden: true
- // search: true,
- // type: "select",
- // filterable: true,
- // remote: true,
- // dicUrl: "/api/blade-los/bports/list?size=20¤t=1&cnName={{key}}",
- // props: {
- // label: "cnName",
- // value: "cnName",
- // res: "data.records"
- // }
- },
- {
- label: "港口",
- prop: "portId",
- overHidden: true,
- search: true,
- type: "select",
- filterable: true,
- remote: true,
- hide: true,
- dicUrl: "/api/blade-los/bports/list?size=20¤t=1&cnName={{key}}",
- props: {
- label: "cnName",
- value: "id",
- res: "data.records"
- }
- },
- {
- label: "场站",
- prop: "stationCname",
- overHidden: true,
- search: true,
- type: "select",
- filterable: true,
- remote: true,
- dicUrl: "/api/blade-los/bcorps/selectList?corpTypeName=场站&cnName={{key}}",
- props: {
- label: "cnName",
- value: "cnName",
- res: "data.records"
- }
- },
- // {
- // label: '客户名称',
- // prop: 'corpName',
- // overHidden: true,
- // search: true,
- // type: "select",
- // filterable: true,
- // remote: true,
- // dicUrl: "/api/blade-los/bcorps/selectList?size=20¤t=1&cnName={{key}}",
- // props: {
- // label: "cnName",
- // value: "cnName",
- // res: "data.records"
- // }
- // },
- {
- label: "提单号",
- prop: "mblno",
- overHidden: true
- },
- {
- label: "船名",
- prop: "shipCname",
- overHidden: true
- },
- {
- label: "航次",
- prop: "voyage",
- overHidden: true
- },
- {
- label: "ETD",
- prop: "etd",
- overHidden: true
- },
- {
- label: "POL堆场",
- prop: "polCyCname",
- overHidden: true
- },
- {
- label: "POL免箱使天数",
- prop: "polFreeBoxUseDays",
- width: 110,
- overHidden: true
- },
- {
- label: "POL提前出场日期",
- prop: "polPreAppearanceDate",
- width: 120,
- overHidden: true
- },
- {
- label: "POL场站空箱出场日期",
- prop: "polStationEmptyContainerExitDate",
- width: 140,
- overHidden: true
- },
- {
- label: "POL还箱日期",
- prop: "polReturnDate",
- width: 100,
- overHidden: true
- },
- {
- label: "POL超期箱使天数",
- prop: "polOverdueBoxUseDays",
- width: 120,
- overHidden: true
- },
- {
- label: "ETA",
- prop: "eta",
- overHidden: true
- },
- {
- label: "POD空箱还箱日期",
- prop: "podEmptyContainerReturnDate",
- width: 120,
- overHidden: true
- },
- {
- label: "POD场站",
- prop: "podStationCname",
- overHidden: true
- },
- {
- label: "POD免箱使天数",
- prop: "podFreeBoxUseDays",
- width: 110,
- overHidden: true
- },
- {
- label: "POD箱使天数",
- prop: "podBoxUseDays",
- width: 100,
- overHidden: true
- }
- ]
- },
- loading: false,
- search: {},
- form: {},
- dataList: [],
- page: {
- pageSize: 20,
- currentPage: 1,
- total: 0,
- pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
- },
- key: 0,
- option: {},
- optionList: {
- index: true,
- dialogDrag: true,
- addBtn: false,
- delBtn: false,
- viewBtn: false,
- editBtn: false,
- saveBtn: false,
- cancelBtnText: "关闭",
- span: 8,
- border: true,
- height: "auto",
- searchMenuPosition: "right",
- align: "center",
- searchSpan: 6,
- searchMenuSpan: 18,
- searchIcon: true,
- searchIndex: 3,
- menuWidth: 60,
- highlightCurrentRow: true,
- dialogWidth: "70%",
- column: [
- {
- label: "箱号",
- prop: "code",
- width: 100,
- overHidden: true,
- search: true,
- disabled: true
- },
- {
- label: "合同号",
- prop: "contractNo",
- width: 100,
- disabled: true,
- overHidden: true,
- search: true
- },
- {
- label: "港口",
- prop: "addressCname",
- width: 100,
- overHidden: true,
- search: true,
- disabled: true,
- type: "select",
- filterable: true,
- remote: true,
- dicUrl: "/api/blade-los/bports/list?current=1&size=20&cnName={{key}}",
- props: {
- label: "cnName",
- value: "cnName",
- res: "data.records"
- }
- },
- {
- label: "场站",
- prop: "stationCname",
- width: 100,
- overHidden: true,
- disabled: true
- },
- {
- label: "放箱号",
- prop: "containerNumber",
- width: 100,
- overHidden: true,
- disabled: true
- },
- {
- label: "箱型",
- prop: "typeName",
- width: 100,
- overHidden: true,
- search: true,
- disabled: true,
- type: "select",
- filterable: true,
- remote: true,
- dicUrl: "/api/blade-los/bcntrtypes/list?status=0¤t=1&size=20&cnName={{key}}",
- props: {
- label: "cnName",
- value: "cnName",
- res: "data.records"
- }
- },
- {
- label: "动态日期",
- prop: "newDate",
- width: 100,
- searchProp: "newDateList",
- overHidden: true,
- search: true,
- disabled: true,
- type: "date",
- searchRange: true,
- searchDefaultTime: ["00:00:00", "23:59:59"],
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- },
- {
- label: "箱状态",
- width: 100,
- overHidden: true,
- disabled: true,
- search: true,
- filterable: true,
- prop: "status",
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_archives_status",
- props: {
- label: "dictValue",
- value: "dictKey"
- }
- },
- {
- label: "箱属",
- prop: "boxBelongsTo",
- width: 100,
- overHidden: true,
- disabled: true
- },
- {
- label: "放箱号类型",
- prop: "containerNumberType",
- width: 100,
- overHidden: true,
- disabled: true,
- search: true,
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxCategory",
- props: {
- label: "dictValue",
- value: "dictValue"
- }
- },
- {
- label: "放箱号OW",
- prop: "containerNumberOw",
- width: 100,
- overHidden: true,
- disabled: true
- },
- {
- label: "放箱号类型OW",
- prop: "containerNumberTypeOw",
- width: 110,
- labelWidth: 100,
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxCategory",
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- overHidden: true,
- disabled: false
- },
- // {
- // label: "箱东",
- // prop: "boxEastName",
- // width: 100,
- // overHidden: true,
- // disabled: true
- // },
- {
- label: "限制港口",
- prop: "restrictedPortsName",
- width: 100,
- overHidden: true,
- disabled: true
- },
- {
- label: "限制船公司",
- prop: "restrictingShippingCompaniesName",
- width: 100,
- overHidden: true,
- disabled: true
- },
- {
- label: "启用日期",
- prop: "activationDate",
- width: 100,
- overHidden: true,
- disabled: true,
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- },
- {
- label: "租赁公司",
- prop: "leasingCompany",
- width: 100,
- overHidden: true,
- search: true,
- disabled: true,
- type: "select",
- filterable: true,
- remote: true,
- dicUrl: "/api/blade-los/bcorps/selectList?current=1&size=5&corpTypeName=箱东&shortName={{key}}",
- props: {
- label: "shortName",
- value: "shortName",
- desc: "code",
- res: "data.records"
- }
- },
- {
- label: "箱来源",
- prop: "boxSource",
- width: 100,
- overHidden: true,
- disabled: true,
- search: true,
- filterable: true,
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_source",
- props: {
- label: "dictValue",
- value: "dictKey"
- }
- },
- {
- label: "箱好坏",
- prop: "boxStatus",
- width: 100,
- overHidden: true,
- disabled: true,
- search: true,
- filterable: true,
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_status",
- props: {
- label: "dictValue",
- value: "dictKey"
- }
- },
- {
- label: "租赁方式",
- prop: "leaseMethod",
- width: 100,
- overHidden: true,
- filterable: true,
- type: "select",
- disabled: true,
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=lease_method",
- props: {
- label: "dictValue",
- value: "dictKey"
- }
- },
- {
- label: "空重(kg)",
- prop: "emptyWeight",
- width: 100,
- overHidden: true,
- disabled: false
- },
- {
- label: "毛重(kg)",
- prop: "gorssWeight",
- width: 100,
- overHidden: true,
- disabled: false
- },
- {
- label: "皮重(kg)",
- prop: "tare",
- width: 100,
- overHidden: true,
- disabled: false
- },
- {
- label: "装载重量(kg)",
- prop: "loadingWeight",
- width: 100,
- overHidden: true,
- disabled: false
- },
- {
- label: "容积(m³)",
- prop: "volume",
- overHidden: true,
- disabled: false,
- width: 100
- },
- {
- label: "造箱公司",
- prop: "boxMakingCompany",
- disabled: false,
- width: 100,
- overHidden: true,
- search: true,
- type: "select",
- filterable: true,
- remote: true,
- dicUrl: "/api/blade-los/bcorps/selectList?current=1&size=5&corpTypeName=箱东&shortName={{key}}",
- props: {
- label: "shortName",
- value: "shortName",
- desc: "code",
- res: "data.records"
- }
- },
- {
- label: "造箱日期",
- prop: "boxMakingDate",
- searchProp: "boxMakingDateList",
- width: 100,
- overHidden: true,
- disabled: false,
- search: true,
- type: "date",
- searchRange: true,
- searchDefaultTime: ["00:00:00", "23:59:59"],
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- },
- {
- label: "起租日期",
- prop: "leaseCommencementDate",
- searchProp: "leaseCommencementDateList",
- width: 100,
- overHidden: true,
- search: true,
- type: "date",
- disabled: true,
- searchRange: true,
- searchDefaultTime: ["00:00:00", "23:59:59"],
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- },
- {
- label: "购入日期",
- prop: "purchaseDate",
- width: 100,
- overHidden: true,
- type: "date",
- disabled: true,
- searchRange: true,
- searchDefaultTime: ["00:00:00", "23:59:59"],
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- },
- {
- label: "箱龄(月)",
- prop: "boxAge",
- overHidden: true,
- disabled: false,
- width: 100
- },
- {
- label: "备注",
- prop: "remarks",
- type: "textarea",
- minRows: 2,
- span: 24
- }
- ]
- }
- };
- },
- async created() {
- this.option = await this.getColumnData(this.getColumnName(234), this.optionList);
- this.optionTrack = await this.getColumnData(this.getColumnName(234.1), this.optionTrackBack);
- this.key++;
- let i = 0;
- this.option.column.forEach(item => {
- if (item.search) i++;
- });
- },
- methods: {
- importData() {
- this.excelForm = {};
- this.excelBox = true;
- },
- // 上传成功
- onSuccess(res, done, loading, column) {
- if (res.length > 0) {
- this.$message.success("上传成功!");
- }
- this.excelBox = false;
- // this.$message.success("导入成功!");
- this.onLoad(this.page, this.search);
- loading = false;
- done();
- },
- // 下载模板
- handleGet() {
- window.open(`/api/blade-los/archives/export-archives-info?${this.website.tokenHeader}=${getToken()}`);
- },
- dicChange(name, row) {
- if (name == "typeName") {
- if (row) {
- this.form.typeId = row.id;
- } else {
- this.form.typeId = null;
- this.form.typeName = null;
- }
- }
- if (name == "purchaseCompanyName") {
- if (row) {
- this.form.boxMakingCompanyId = row.id;
- } else {
- this.form.boxMakingCompanyId = null;
- this.form.boxMakingCompany = null;
- }
- }
- },
- rowEdit(row, index) {
- // this.option.column.forEach(item => {
- // if (
- // item.prop == "code" ||
- // item.prop == "contractNo" ||
- // item.prop == "addressCname" ||
- // item.prop == "stationCname" ||
- // item.prop == "containerNumber" ||
- // item.prop == "containerNumber" ||
- // item.prop == "typeName" ||
- // item.prop == "newDate" ||
- // item.prop == "status" ||
- // item.prop == "boxBelongsTo" ||
- // item.prop == "containerNumberOw" ||
- // item.prop == "containerNumberTypeOw"||
- // item.prop == "restrictedPortsName"||
- // item.prop == "restrictingShippingCompaniesName"||
- // item.prop == "activationDate"||
- // item.prop == "leasingCompany"||
- // item.prop == "boxSource"||
- // item.prop == "boxStatus"||
- // item.prop == "leaseMethod"||
- // item.prop == "leaseCommencementDate"||
- // item.prop == "purchaseDate"
- // ) {
- // item.disabled = false;
- // }
- // });
- this.$refs.crud.rowEdit(row, index);
- },
- // 箱轨迹里合同号跳转
- contractNoJump(row) {
- this.boxTrack = false;
- if (row.billType == "BUY") {
- this.$router.push({
- path: "/boxManagement/buyContainer/index",
- query: {
- id: row.srcId
- }
- });
- }
- if (row.billType == "OW-N") {
- this.$router.push({
- path: "/ow/owTask/index",
- query: {
- id: row.srcId
- }
- });
- }
- if (row.billType == "OW-F") {
- this.$router.push({
- path: "/ow/owPut/index",
- query: {
- id: row.srcId
- }
- });
- }
- if (row.billType == "ZR") {
- this.$router.push({
- path: "/boxManagement/rentalBox/index",
- query: {
- id: row.srcId
- }
- });
- }
- if (row.billType == "DL") {
- this.$router.push({
- path: "/boxManagement/agentBox/index",
- query: {
- id: row.srcId
- }
- });
- }
- },
- track(row) {
- // this.dataTrackList = row
- this.formSearch = row;
- this.boxTrack = true;
- },
- rowUpdateTrack(form, index, done, loading) {
- update(form).then(res => {
- done();
- this.$message.success("操作成功");
- this.onLoadTrack(this.pageTwo, this.searchTwo);
- });
- },
- //打开表单前
- beforeOpen(done, type) {
- if (type === "add") {
- this.findObject(this.option.column, "boxSource").value =
- this.$refs.crud.DIC.boxSource.length > 0 ? this.$refs.crud.DIC.boxSource[0].dictKey : "";
- this.findObject(this.option.column, "boxStatus").value =
- this.$refs.crud.DIC.boxStatus.length > 0 ? this.$refs.crud.DIC.boxStatus[0].dictKey : "";
- }
- done();
- },
- searchChangeTwo(params, done) {
- done();
- this.onLoadTrack(this.pageTwo, params);
- },
- onLoadTrack(page, params = {}) {
- params = {
- ...params,
- current: page.currentPage,
- size: page.pageSize,
- code: this.formSearch.code
- };
- this.loadingTwo = true;
- archivestrajectory(params)
- .then(res => {
- this.dataTrackList = res.data.data.records;
- this.pageTwo.total = res.data.data.total;
- this.$nextTick(() => {
- this.$refs.crudTrack.doLayout();
- this.$refs.crudTrack.dicInit();
- });
- })
- .finally(() => {
- this.loadingTwo = false;
- });
- },
- //导出
- outExport() {
- this.$confirm("是否导出当前所有箱档案?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- let queryParams = this.search;
- const routeData = this.$router.resolve({
- path: "/api/blade-los/archives/export-archives-out", //跳转目标窗口的地址
- query: {
- "Blade-Auth": getToken(),
- ...queryParams //括号内是要传递给新窗口的参数
- }
- });
- window.open(routeData.href.slice(1, routeData.href.length));
- })
- .catch(() => {
- this.$message({
- type: "info",
- message: "已取消" //
- });
- });
- },
- derivation() {
- window.open(`/api/blade-box-tube/archives/export-archives-info?${this.website.tokenHeader}=${getToken()}`);
- },
- uploadBefore(file, done, loading) {
- loading = true;
- done();
- },
- uploadAfter(res, done, loading, column) {
- this.excelBox = false;
- this.$message.success("导入成功!");
- this.onLoad(this.page, this.search);
- loading = false;
- done();
- },
- balabala(val) {
- if (val === null) {
- this.form.address = "";
- } else {
- this.form.address = val.name;
- }
- },
- getGSData(row) {
- this.form.leasingCompany = row.cname;
- },
- //关闭弹窗前
- beforeClose(done, type) {
- this.onLoad(this.page, this.search);
- done();
- },
- //刷新
- refreshChange() {
- this.onLoad(this.page, this.search);
- },
- rowDel(form, index) {
- this.$confirm("此操作将永久删除该行, 是否继续?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- remove(form.id).then(res => {
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- this.onLoad(this.page, this.search);
- });
- })
- .catch(() => {});
- },
- uploadDelete(file, column) {
- return new Promise((resolve, reject) => {
- this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- if (this.form.filesList[file.uid].id) {
- boxRemove(this.form.filesList[file.uid].id).then(res => {
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- resolve();
- });
- } else {
- resolve();
- }
- })
- .catch(() => {
- reject();
- this.$message({
- type: "info",
- message: "已取消删除"
- });
- });
- });
- },
- rowSave(form, done, loading, index) {
- done();
- addUpdate(form).then(res => {
- this.onLoad(this.page, this.search);
- });
- },
- rowUpdate(row, index, done, loading) {
- done();
- addUpdate(row).then(res => {
- this.onLoad(this.page, this.search);
- });
- },
- searchChange(params, done) {
- done();
- this.onLoad(this.page, params);
- },
- onLoad(page, params = {}) {
- params = {
- ...params,
- current: page.currentPage,
- size: page.pageSize,
- ...Object.assign(params, this.search)
- };
- this.loading = true;
- getList(params)
- .then(res => {
- this.dataList = res.data.data.records;
- this.page.total = res.data.data.total;
- this.loading = false;
- this.$nextTick(() => {
- this.$refs.crud.doLayout();
- this.$refs.crud.dicInit();
- });
- })
- .finally(() => {
- this.loading = false;
- });
- },
- //自定义列保存
- async saveColumnTwo(ref, option, optionBack, code) {
- /**
- * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
- * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
- * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
- */
- const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
- if (inSave) {
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列重置
- async resetColumnTwo(ref, option, optionBack, code) {
- this[option] = this[optionBack];
- const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
- if (inSave) {
- this.$message.success("重置成功");
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-col-md-8 {
- width: 24.33333%;
- }
- </style>
|