| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190 |
- <template>
- <div>
- <basic-container v-if="isShow">
- <!-- <el-button
- v-if="roleName.includes('admin') || roleName.includes('箱管')"
- type="warning"
- plain
- size="small"
- @click="allClick('POL空箱提箱进场(EXCEL)')"
- >POL空箱提箱进场(EXCEL)</el-button
- > -->
- <!-- <el-button
- v-if="roleName.includes('admin') || roleName.includes('箱管')"
- type="success"
- plain
- size="small"
- @click="allClick('POL空箱出场(EXCEL)')"
- >POL空箱出场(EXCEL)</el-button
- > -->
- <!-- <el-button v-if="roleName.includes('admin') || roleName.includes('箱管')" type="info" plain size="small"
- @click="allClick('POD空箱进场(EXCEL)')">POD空箱进场(EXCEL)</el-button>-->
- <!-- <el-button type="primary" plain size="small"
- @click="allClick('POL返场(EXCEL)')">POL返场(EXCEL)</el-button> -->
- <!-- <el-button
- v-if="roleName.includes('admin') || roleName.includes('箱管')"
- type="danger"
- plain
- size="small"
- @click="allClick('POL无货返空(EXCEL)')"
- >POL无货返空(EXCEL)</el-button
- > -->
- <!-- <el-button v-if="roleName.includes('admin') || roleName.includes('箱管')" type="primary" plain size="small"
- @click="allClick('进场导入')">进场导入</el-button>
- <el-button v-if="roleName.includes('admin') || roleName.includes('箱管')" type="info" plain size="small"
- @click="allClick('出场导入')">出场导入</el-button> -->
- <el-tabs v-model="activeName" type="card" style="margin-top: 8px;">
- <el-tab-pane label="按港口" name="1">
- <avue-crud
- :option="option"
- :table-loading="loading"
- :data="data"
- :page.sync="page"
- :search.sync="query"
- v-model="form"
- id="out-table"
- :header-cell-class-name="headerClassName"
- ref="crud"
- @search-change="searchChange"
- @search-reset="searchReset"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange"
- @on-load="onLoad"
- :cell-style="cellStyle"
- >
- <template slot="menuLeft">
- <el-button type="warning" size="small" @click="outExport">导 出</el-button>
- <el-button type="warning" size="small" @click="outExport3">导出明细</el-button>
- </template>
- </avue-crud>
- </el-tab-pane>
- <el-tab-pane label="按放箱号" name="2">
- <avue-crud
- :option="option2"
- :table-loading="loading2"
- :data="data2"
- :page.sync="page2"
- :search.sync="query2"
- v-model="form2"
- id="out-table"
- :header-cell-class-name="headerClassName"
- ref="crud2"
- @search-change="searchChange2"
- @search-reset="searchReset2"
- @current-change="currentChange2"
- @size-change="sizeChange2"
- @refresh-change="refreshChange2"
- @on-load="onLoad2"
- :cell-style="cellStyle"
- @resetColumn="resetColumn('crud2', 'option2', 'optionBack2', 466)"
- @saveColumn="saveColumn('crud2', 'option2', 'optionBack2', 466)"
- >
- <template slot="menuLeft">
- <el-button type="warning" size="small" @click="outExport2">导 出</el-button>
- <el-button type="warning" size="small" @click="outExport4">导出明细</el-button>
- <!-- <el-button type="primary" plain size="small"
- @click="allClick('空箱出场(EDI)')">空箱出场(EDI)</el-button> -->
- <!-- <el-button type="success" plain size="small"
- @click="allClick('POL空箱出场(EXCEL)')">POL空箱出场(EXCEL)</el-button> -->
- <!-- <el-button type="primary" plain size="small"
- @click="allClick('POL返场(EXCEL)')">POL返场(EXCEL)</el-button> -->
- <!-- <el-button type="info" plain size="small"
- @click="allClick('POD空箱进场(EXCEL)')">POD空箱进场(EXCEL)</el-button> -->
- <!-- <el-button type="warning" plain size="small"
- @click="allClick('空箱进场(excel)')">空箱进场(excel)</el-button> -->
- <!-- <el-button type="danger" plain size="small"
- @click="allClick('POL无货返空(EXCEL)')">POL无货返空(EXCEL)</el-button> -->
- </template>
- <template slot="menu" slot-scope="{ row, index }">
- <el-button size="small" icon="el-icon-edit" type="text" @click="rowEdit(row)">查看</el-button>
- </template>
- <template slot="containerNumber" slot-scope="{ row }">
- <span style="color: #1e9fff;cursor: pointer;" @click="rowContainerNumber(row)">{{ row.containerNumber }}</span>
- </template>
- </avue-crud>
- </el-tab-pane>
- <!-- <el-tab-pane label="导入文件记录" name="3">
- <avue-crud
- :option="option3"
- :table-loading="loading3"
- :data="data3"
- :page.sync="page3"
- :search.sync="query3"
- v-model="form3"
- id="out-table"
- :header-cell-class-name="headerClassName"
- ref="crud3"
- @search-change="searchChange3"
- @search-reset="searchReset3"
- @current-change="currentChange3"
- @size-change="sizeChange3"
- @refresh-change="refreshChange3"
- @on-load="onLoad3"
- >
- <template slot="menu" slot-scope="{ row, index }">
- <el-button size="small" type="text" @click="rowDownload(row)">下载</el-button>
- </template>
- </avue-crud>
- </el-tab-pane> -->
- </el-tabs>
- <el-dialog title="导入数据" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false" v-dialog-drag>
- <avue-form :option="excelOption" v-model="excelForm" :table-loading="excelLoading" :upload-before="uploadBefore" :upload-after="onSuccess">
- <template slot="excelTemplate">
- <el-button type="primary" @click="handleGet(excelType)"> 点击下载<i class="el-icon-download el-icon--right"></i> </el-button>
- </template>
- </avue-form>
- <p style="text-align: center;color: #DC0505">
- 温馨提示 第一次导入时请先下载模板
- </p>
- </el-dialog>
- <import-module ref="importModule" @refreshData="refreshData" />
- </basic-container>
- <detailsPage v-if="!isShow" :detailData="detailData" @goBack="goBack"></detailsPage>
- </div>
- </template>
- <script>
- import { getList, getList2, getList3, emptyContainerEntryFtp } from "@/api/boxManagement/boxPoolDynamics/index.js";
- import { getWorkDicts } from "@/api/system/dictbiz";
- import detailsPage from "./detailsPage";
- import importModule from "./components/importModule.vue";
- import { getToken } from "@/util/auth";
- import _ from "lodash";
- export default {
- name: "箱池动态",
- data() {
- return {
- roleName: localStorage.getItem("roleName"),
- excelType: 1,
- 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/boxPool/emptyContainerAppearance"
- }
- ]
- },
- activeName: "1",
- isShow: true,
- form: {},
- query: {},
- loading: false,
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0,
- pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
- },
- form2: {},
- query2: {},
- loading2: false,
- page2: {
- pageSize: 10,
- currentPage: 1,
- total: 0,
- pageSizes: [10, 20, 30, 40, 50, 100, 500, 1000]
- },
- form3: {},
- query3: {},
- loading3: false,
- page3: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- selectionList: [],
- option: {
- height: "auto",
- calcHeight: 30,
- menuWidth: 70,
- tip: false,
- searchShow: true,
- searchMenuSpan: 6,
- // header: false,
- menu: false,
- border: true,
- index: true,
- addBtn: false,
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- columnBtn: false,
- searchIcon: true,
- align: "center",
- searchIndex: 3,
- summaryText: "合计",
- showSummary: true,
- sumColumnList: [
- {
- name: "total",
- type: "sum",
- decimals: 0
- },
- {
- name: "remainingTotal",
- type: "sum",
- decimals: 0
- },
- {
- name: "gp20Good",
- type: "sum",
- decimals: 0
- },
- {
- name: "gp40Good",
- type: "sum",
- decimals: 0
- },
- {
- name: "hg40Good",
- type: "sum",
- decimals: 0
- },
- {
- name: "otherGood",
- type: "sum",
- decimals: 0
- },
- {
- name: "gp20Bad",
- type: "sum",
- decimals: 0
- },
- {
- name: "gp40Bad",
- type: "sum",
- decimals: 0
- },
- {
- name: "hg40Bad",
- type: "sum",
- decimals: 0
- },
- {
- name: "otherBad",
- type: "sum",
- decimals: 0
- }
- ],
- column: [
- {
- label: "港口",
- prop: "polId",
- overHidden: true,
- hide: true,
- search: true,
- type: "select",
- filterable: true,
- dicUrl: "/api/blade-los/blade-los/bports/listAll?status=0",
- props: {
- label: "cnName",
- value: "id",
- desc: "code"
- }
- },
- {
- label: "港口",
- prop: "portName",
- overHidden: true
- },
- {
- label: "场站",
- prop: "stationName",
- overHidden: true
- },
- {
- label: "场站",
- prop: "stationId",
- overHidden: true,
- hide: true,
- search: true,
- type: "select",
- filterable: true,
- dicUrl: "/api/blade-los/bcorps/listAll?status=0&corpTypeName=场站",
- props: {
- label: "shortName",
- value: "id"
- }
- },
- {
- label: "放箱号类型",
- prop: "busType",
- width: 100,
- overHidden: true,
- search: true,
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxCategory",
- props: {
- label: "dictValue",
- value: "dictValue"
- }
- },
- {
- label: "场地盘存",
- prop: "total",
- width: 100,
- overHidden: true
- },
- // {
- // label: '操作占用',
- // prop: 'occupyNum',
- // width: 100,
- // overHidden: true,
- // },
- {
- label: "可用箱量",
- prop: "remainingTotal",
- width: 100,
- overHidden: true
- },
- {
- label: "好",
- prop: "good",
- overHidden: true,
- children: [
- {
- label: "20GP",
- prop: "gp20Good",
- width: 60,
- overHidden: true
- },
- {
- label: "40GP",
- prop: "gp40Good",
- width: 60,
- overHidden: true
- },
- {
- label: "40HC",
- prop: "hg40Good",
- width: 60,
- overHidden: true
- },
- {
- label: "OTHER",
- prop: "otherGood",
- width: 70,
- overHidden: true
- }
- ]
- },
- {
- label: "坏",
- prop: "bad",
- overHidden: true,
- children: [
- {
- label: "20GP",
- prop: "gp20Bad",
- width: 60,
- overHidden: true
- },
- {
- label: "40GP",
- prop: "gp40Bad",
- width: 60,
- overHidden: true
- },
- {
- label: "40HC",
- prop: "hg40Bad",
- width: 60,
- overHidden: true
- },
- {
- label: "OTHER",
- prop: "otherBad",
- width: 70,
- overHidden: true
- }
- ]
- }
- ]
- },
- option2: {},
- optionBack2: {
- height: "auto",
- calcHeight: 30,
- menuWidth: 70,
- tip: false,
- searchShow: true,
- searchMenuSpan: 12,
- border: true,
- index: true,
- addBtn: false,
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- searchIcon: true,
- align: "center",
- searchIndex: 3,
- summaryText: "合计",
- showSummary: true,
- sumColumnList: [
- {
- name: "total",
- type: "sum",
- decimals: 0
- },
- {
- name: "remainingTotal",
- type: "sum",
- decimals: 0
- },
- {
- name: "good",
- type: "sum",
- decimals: 0
- },
- {
- name: "bad",
- type: "sum",
- decimals: 0
- },
- {
- name: "occupyNum",
- type: "sum",
- decimals: 0
- }
- ],
- column: [
- {
- label: "港口",
- prop: "polName",
- width: 150,
- overHidden: true
- },
- {
- label: "港口",
- prop: "polId",
- overHidden: true,
- hide: true,
- search: true,
- type: "select",
- filterable: true,
- dicUrl: "/api/blade-los/blade-los/bports/listAll?status=0",
- props: {
- label: "cnName",
- value: "id",
- desc: "code"
- }
- },
- {
- label: "场站",
- prop: "stationId",
- overHidden: true,
- hide: true,
- search: true,
- type: "select",
- filterable: true,
- dicUrl: "/api/blade-los/bcorps/listAll?status=0&corpTypeName=场站",
- props: {
- label: "shortName",
- value: "id"
- }
- },
- {
- label: "放箱号类型",
- prop: "busType",
- width: 150,
- overHidden: true,
- search: true,
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxCategory",
- props: {
- label: "dictValue",
- value: "dictValue"
- }
- },
- {
- label: "放箱号",
- prop: "containerNumber",
- width: 150,
- overHidden: true,
- search: true
- },
- {
- label: "起运港场站/堆场",
- prop: "polStationName",
- width: 150,
- overHidden: true
- },
- {
- label: "目的港",
- prop: "podName",
- width: 150,
- overHidden: true
- },
- {
- label: "目的港",
- prop: "podId",
- width: 150,
- overHidden: true,
- hide: true,
- search: true,
- type: "select",
- filterable: true,
- remote: true,
- dicUrl: "/api/blade-los/bports/listAll?status=0",
- props: {
- label: "cnName",
- value: "id",
- desc: "code"
- }
- },
- {
- label: "目的港场站/堆场",
- prop: "podStationName",
- width: 150,
- overHidden: true
- },
- {
- label: "箱型",
- prop: "boxType",
- width: 150,
- overHidden: true,
- search: true,
- type: "select",
- filterable: true,
- remote: true,
- dicUrl: "/api/blade-los/bcntrtypes/list?status=0&size=20¤t=1&cnName={{key}}",
- props: {
- label: "cnName",
- value: "cnName",
- res: "data.records"
- }
- },
- {
- label: "场地盘存",
- prop: "total",
- width: 100,
- overHidden: true
- },
- {
- label: "操作占用",
- prop: "occupyNum",
- width: 100,
- overHidden: true
- },
- {
- label: "可用箱量",
- prop: "remainingTotal",
- width: 100,
- overHidden: true
- },
- {
- label: "好",
- prop: "good",
- width: 100,
- overHidden: true
- },
- {
- label: "坏",
- prop: "bad",
- width: 100,
- overHidden: true
- }
- ]
- },
- option3: {
- height: "auto",
- calcHeight: 30,
- menuWidth: 70,
- tip: false,
- searchShow: true,
- searchMenuSpan: 12,
- header: false,
- menu: true,
- border: true,
- index: true,
- addBtn: false,
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- searchIcon: true,
- align: "center",
- searchIndex: 3,
- column: [
- {
- label: "文件名",
- prop: "fileName",
- overHidden: true,
- search: true
- },
- {
- label: "文件地址",
- prop: "url",
- overHidden: true
- },
- {
- label: "文件类型",
- prop: "type",
- overHidden: true,
- search: true,
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_file_type",
- props: {
- label: "dictValue",
- value: "dictKey"
- }
- },
- {
- label: "创建时间",
- prop: "createTime",
- overHidden: true
- }
- ]
- },
- data: []
- };
- },
- components: {
- detailsPage,
- importModule
- },
- async created() {
- this.option2 = await this.getColumnData(this.getColumnName(466), this.optionBack2);
- this.$nextTick(() => {
- this.$refs.crud2.dicInit();
- });
- },
- methods: {
- outExport() {
- let config = { params: { ...this.query } };
- if (config.params) {
- for (const propName of Object.keys(config.params)) {
- const value = config.params[propName];
- if (value !== null && typeof value !== "undefined") {
- if (value instanceof Array) {
- for (const key of Object.keys(value)) {
- let params = propName + "[" + key + "]";
- config.params[params] = value[key];
- }
- delete config.params[propName];
- }
- }
- }
- }
- const routeData = this.$router.resolve({
- path: "/api/blade-los/boxPool/listPortExport", //跳转目标窗口的地址
- query: {
- ...config.params, //括号内是要传递给新窗口的参数
- identification: this.url
- }
- });
- window.open(routeData.href.slice(1, routeData.href.length) + "&" + `${this.website.tokenHeader}=${getToken()}`);
- },
- outExport2() {
- let config = { params: { ...this.query2 } };
- if (config.params) {
- for (const propName of Object.keys(config.params)) {
- const value = config.params[propName];
- if (value !== null && typeof value !== "undefined") {
- if (value instanceof Array) {
- for (const key of Object.keys(value)) {
- let params = propName + "[" + key + "]";
- config.params[params] = value[key];
- }
- delete config.params[propName];
- }
- }
- }
- }
- const routeData = this.$router.resolve({
- path: "/api/blade-los/boxPool/listContainerNumberExport", //跳转目标窗口的地址
- query: {
- ...config.params, //括号内是要传递给新窗口的参数
- identification: this.url
- }
- });
- window.open(routeData.href.slice(1, routeData.href.length) + "&" + `${this.website.tokenHeader}=${getToken()}`);
- },
- outExport3() {
- let config = { params: { ...this.query } };
- if (config.params) {
- for (const propName of Object.keys(config.params)) {
- const value = config.params[propName];
- if (value !== null && typeof value !== "undefined") {
- if (value instanceof Array) {
- for (const key of Object.keys(value)) {
- let params = propName + "[" + key + "]";
- config.params[params] = value[key];
- }
- delete config.params[propName];
- }
- }
- }
- }
- const routeData = this.$router.resolve({
- path: "/api/blade-los/boxPool/listPortExportItems", //跳转目标窗口的地址
- query: {
- ...config.params, //括号内是要传递给新窗口的参数
- identification: this.url
- }
- });
- window.open(routeData.href.slice(1, routeData.href.length) + "&" + `${this.website.tokenHeader}=${getToken()}`);
- },
- outExport4() {
- let config = { params: { ...this.query2 } };
- if (config.params) {
- for (const propName of Object.keys(config.params)) {
- const value = config.params[propName];
- if (value !== null && typeof value !== "undefined") {
- if (value instanceof Array) {
- for (const key of Object.keys(value)) {
- let params = propName + "[" + key + "]";
- config.params[params] = value[key];
- }
- delete config.params[propName];
- }
- }
- }
- }
- const routeData = this.$router.resolve({
- path: "/api/blade-los/boxPool/listContainerNumberExportItems", //跳转目标窗口的地址
- query: {
- ...config.params, //括号内是要传递给新窗口的参数
- identification: this.url
- }
- });
- window.open(routeData.href.slice(1, routeData.href.length) + "&" + `${this.website.tokenHeader}=${getToken()}`);
- },
- refreshData() {
- this.refreshChange();
- this.refreshChange2();
- this.refreshChange3();
- },
- uploadBefore(file, done, loading) {
- done();
- loading = true;
- },
- // 上传成功
- onSuccess(res, done, loading, column) {
- if (res == "操作成功") {
- this.$message.success("上传成功!");
- }
- loading = false;
- done();
- this.excelBox = false;
- },
- // 下载模板
- handleGet(type) {
- if (type == 1) {
- window.open(`/api/blade-los/boxPool/emptyContainerAppearance/template?${this.website.tokenHeader}=${getToken()}`);
- } else if (type == 2) {
- window.open(`/api/blade-los/boxPool/emptyContainerEntry/template?${this.website.tokenHeader}=${getToken()}`);
- } else if (type == 3) {
- window.open(`/api/blade-los/boxPool/giveAnEncore/template?${this.website.tokenHeader}=${getToken()}`);
- }
- },
- rowDownload(row) {
- window.open(row.url);
- },
- allClick(name) {
- if (name == "POL空箱出场(EXCEL)") {
- this.$refs.importModule.openDialog(2);
- // this.excelOption.column.forEach(item => {
- // if (item.prop == 'excelFile') {
- // item.action = "/api/blade-los/boxPool/emptyContainerAppearance"
- // }
- // })
- // this.excelType = 1
- // this.excelBox = true
- }
- if (name == "POD空箱进场(EXCEL)") {
- this.$refs.importModule.openDialog(3);
- // this.excelOption.column.forEach(item => {
- // if (item.prop == 'excelFile') {
- // item.action = "/api/blade-los/boxPool/giveAnEncore"
- // }
- // })
- // this.excelType = 3
- // this.excelBox = true
- }
- if (name == "POL无货返空(EXCEL)") {
- this.$refs.importModule.openDialog(4);
- // this.excelOption.column.forEach(item => {
- // if (item.prop == 'excelFile') {
- // item.action = "/api/blade-los/boxPool/returnEmpty"
- // }
- // })
- // this.excelType = 3
- // this.excelBox = true
- }
- if (name == "POL空箱提箱进场(EXCEL)") {
- this.$refs.importModule.openDialog(1);
- // this.excelOption.column.forEach(item => {
- // if (item.prop == 'excelFile') {
- // item.action = "/api/blade-los/boxPool/emptyContainerEntry"
- // }
- // })
- // this.excelType = 2
- // this.excelBox = true
- }
- if (name == "进场导入") {
- this.$DialogForm.show({
- title: "进场导入",
- width: "30%",
- // data: this.assemblyForm.hmmEdi,
- menuPosition: "right",
- option: {
- submitText: "确定",
- emptyText: "取消",
- // labelWidth: 130,
- column: [
- {
- label: "场站",
- span: 24,
- prop: "corpId",
- type: "select",
- filterable: true,
- remote: true,
- dicUrl: "/api/blade-los/bcorps/selectList?status=0&corpTypeName=场站&size=5¤t=1&shortName={{key}}",
- props: {
- label: "shortName",
- value: "id",
- desc: "code",
- res: "data.records"
- },
- rules: [
- {
- required: true,
- message: "选择场站",
- trigger: "blur"
- }
- ]
- }
- ]
- },
- beforeClose: done => {
- done();
- },
- callback: res => {
- res.done();
- let obj = {
- corpId: res.data.corpId,
- type: "IN"
- };
- emptyContainerEntryFtp(obj).then(res => {
- this.$message.success("操作成功!");
- // this.refreshChange()
- this.$refs.importModule.openDialog(5, res.data.data);
- });
- res.close();
- }
- });
- // this.excelOption.column.forEach(item => {
- // if (item.prop == 'excelFile') {
- // item.action = "/api/blade-los/boxPool/emptyContainerEntry"
- // }
- // })
- // this.excelType = 2
- // this.excelBox = true
- }
- if (name == "出场导入") {
- this.$DialogForm.show({
- title: "出场导入",
- width: "30%",
- // data: this.assemblyForm.hmmEdi,
- menuPosition: "right",
- option: {
- submitText: "确定",
- emptyText: "取消",
- // labelWidth: 130,
- column: [
- {
- label: "场站",
- span: 24,
- prop: "corpId",
- type: "select",
- filterable: true,
- remote: true,
- dicUrl: "/api/blade-los/bcorps/selectList?status=0&corpTypeName=场站&size=5¤t=1&shortName={{key}}",
- props: {
- label: "shortName",
- value: "id",
- desc: "code",
- res: "data.records"
- },
- rules: [
- {
- required: true,
- message: "选择场站",
- trigger: "blur"
- }
- ]
- }
- ]
- },
- beforeClose: done => {
- done();
- },
- callback: res => {
- res.done();
- console.log(res);
- let obj = {
- corpId: res.data.corpId,
- type: "OUT"
- };
- emptyContainerEntryFtp(obj).then(res => {
- this.$message.success("操作成功!");
- this.$refs.importModule.openDialog(6, res.data.data);
- });
- res.close();
- }
- });
- // this.excelOption.column.forEach(item => {
- // if (item.prop == 'excelFile') {
- // item.action = "/api/blade-los/boxPool/emptyContainerEntry"
- // }
- // })
- // this.excelType = 2
- // this.excelBox = true
- }
- },
- addButton() {
- this.isShow = false;
- },
- copyButton() {
- this.isShow = false;
- this.detailData = {
- copyId: this.selectionList[0].id
- };
- },
- rowContainerNumber(row) {
- if (this.verifyTags("放箱号")) {
- this.$router.push({
- path: "/boxManagement/containerNumber/index",
- query: {
- id: row.id
- }
- });
- }
- },
- rowEdit(row) {
- this.detailData = {
- id: row.id
- };
- this.isShow = false;
- },
- searchReset() {
- this.query = this.$options.data().query;
- // this.onLoad(this.page);
- },
- // 搜索按钮点击
- searchChange(params, done) {
- this.page.currentPage = 1;
- this.onLoad(this.page, this.query);
- done();
- },
- selectionChange(list) {
- this.selectionList = list;
- },
- currentChange(currentPage) {
- this.page.currentPage = currentPage;
- },
- sizeChange(pageSize) {
- this.page.pageSize = pageSize;
- },
- refreshChange() {
- this.onLoad(this.page, this.query);
- },
- onLoad(page, params = {}) {
- let obj = {};
- obj = {
- ...Object.assign(params, this.query)
- };
- this.loading = true;
- getList(page.currentPage, page.pageSize, obj)
- .then(res => {
- this.data = res.data.data.records;
- this.page.total = res.data.data.total;
- this.$nextTick(() => {
- this.$refs.crud.doLayout();
- });
- })
- .finally(() => {
- this.loading = false;
- });
- },
- searchReset2() {
- this.query2 = this.$options.data().query2;
- // this.onLoad2(this.page2);
- },
- // 搜索按钮点击
- searchChange2(params, done) {
- this.page2.currentPage = 1;
- this.onLoad2(this.page2, this.query2);
- done();
- },
- currentChange2(currentPage) {
- this.page2.currentPage = currentPage;
- },
- sizeChange2(pageSize) {
- this.page2.pageSize = pageSize;
- },
- refreshChange2() {
- this.onLoad2(this.page2, this.query2);
- },
- onLoad2(page, params = {}) {
- let obj = {};
- obj = {
- ...Object.assign(params, this.query2)
- };
- this.loading2 = true;
- getList2(page.currentPage, page.pageSize, obj)
- .then(res => {
- this.data2 = res.data.data.records;
- this.page2.total = res.data.data.total;
- this.$nextTick(() => {
- this.$refs.crud2.doLayout();
- });
- })
- .finally(() => {
- this.loading2 = false;
- });
- },
- searchReset3() {
- this.query3 = this.$options.data().query3;
- // this.onLoad3(this.page3);
- },
- // 搜索按钮点击
- searchChange3(params, done) {
- this.page3.currentPage = 1;
- this.onLoad3(this.page3, this.query3);
- done();
- },
- currentChange3(currentPage) {
- this.page3.currentPage = currentPage;
- },
- sizeChange3(pageSize) {
- this.page3.pageSize = pageSize;
- },
- refreshChange3() {
- this.onLoad3(this.page3, this.query3);
- },
- onLoad3(page, params = {}) {
- let obj = {};
- obj = {
- ...Object.assign(params, this.query3)
- };
- this.loading3 = true;
- getList3(page.currentPage, page.pageSize, obj)
- .then(res => {
- this.data3 = res.data.data.records;
- this.page3.total = res.data.data.total;
- this.$nextTick(() => {
- this.$refs.crud3.doLayout();
- });
- })
- .finally(() => {
- this.loading3 = false;
- });
- },
- cellStyle({ row, column, rowIndex, columnIndex }) {
- if (row.busType == "自有箱") {
- if (row.total < row.remainingTotal) {
- return {
- color: "#F56C6C"
- };
- }
- }
- },
- // 详情的返回列表
- goBack() {
- // 初始化数据
- if (JSON.stringify(this.$route.query) != "{}") {
- this.$router.$avueRouter.closeTag();
- this.$router.push({
- path: "/boxManagement/buyContainer/index"
- });
- }
- this.detailData = {};
- this.isShow = true;
- this.onLoad(this.page, this.query);
- },
- //自定义列保存
- async saveColumn(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;
- this.searchReset();
- }
- },
- //自定义列重置
- async resetColumn(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;
- this.searchReset();
- }
- },
- // 更改表格颜色
- headerClassName(tab) {
- //颜色间隔
- let back = "back-two";
- // if (tab.columnIndex >= 0 && tab.column.level === 1) {
- // if (tab.columnIndex % 2 === 0) {
- // back = "back-one"
- // } else if (tab.columnIndex % 2 === 1) {
- // back = "back-two"
- // }
- // }
- return back;
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- ::v-deep #out-table .back-one {
- background: #ecf5ff !important;
- text-align: center;
- }
- ::v-deep #out-table .back-two {
- background: #ecf5ff !important;
- text-align: center;
- }
- .pointerClick {
- cursor: pointer;
- color: #1e9fff;
- }
- ::v-deep .el-col-md-8 {
- width: 24.33333%;
- }
- </style>
|