<template>
|
<div class="page-list-container">
|
<el-card class="scan-card">
|
<div slot="header" class="clearfix">
|
<span>PC组板</span>
|
</div>
|
<el-form ref="form" :model="formData" label-width="120px">
|
<el-form-item label="选择打印机">
|
<el-select v-model="formData.printName" placeholder="请选择打印机" class="w-300">
|
<el-option v-for="(item, index) in printList" :key="index" :label="item" :value="item"></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="选择口岸">
|
<el-select v-model="formData.port_Id" placeholder="请选择口岸" class="w-300">
|
<el-option v-for="(item, index) in portOptions" :key="index" :label="item.portName" :value="item.port_Id">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="运单号">
|
<el-col :span="5">
|
<el-input ref="wayBillCode" v-model="formData.wayBillCode" class="w-300" @keyup.native.enter.stop="checkPanel"></el-input>
|
</el-col>
|
</el-form-item>
|
<el-form-item label="托盘号">
|
<el-col :span="5">
|
<el-input ref="trayCode" :disabled="true" v-model="formData.trayCode" class="w-300" @keyup.native.enter.stop="getData"></el-input>
|
</el-col>
|
<el-col :span="19">
|
<span :class="panelResult==true? 'successClass':'errorClass'">{{ panelMsg }}</span>
|
</el-col>
|
</el-form-item>
|
</el-form>
|
</el-card>
|
<el-row :gutter="10" class="margin-top-5">
|
<el-col :span="16">
|
<el-card class="field-card">
|
<div slot="header" class="clearfix">
|
<span>正常运单</span>
|
</div>
|
<el-table :data="wayBillList" size="mini" style="width: 100%">
|
<el-table-column prop="orderStatus" label="运单状态" width="130">
|
</el-table-column>
|
<el-table-column prop="wayBillCode" label="运单编号" width="130">
|
</el-table-column>
|
<el-table-column prop="portName" label="口岸" width="100">
|
</el-table-column>
|
<el-table-column prop="expressCorpName" label="口岸快递">
|
</el-table-column>
|
<el-table-column prop="expressCode" label="快递单号">
|
</el-table-column>
|
<el-table-column prop="plateCode" label="托盘号">
|
</el-table-column>
|
<el-table-column prop="orderType" label="订单类型">
|
</el-table-column>
|
<!-- <el-table-column fixed="right" label="操作" width="50">
|
<template slot-scope="scope">
|
<el-button type="text" size="small" @click="toWayBill(scope.row)">选中</el-button>
|
</template>
|
</el-table-column> -->
|
</el-table>
|
</el-card>
|
</el-col>
|
<el-col :span="8">
|
<el-card class="field-card">
|
<div slot="header" class="clearfix">
|
<span>异常运单</span>
|
</div>
|
<el-table :data="abnormalWaybillList" size="运单状态" style="width: 100%">
|
<el-table-column prop="orderStatus" label="运单状态" width="130">
|
</el-table-column>
|
<el-table-column prop="wayBillCode" label="运单编号">
|
</el-table-column>
|
<el-table-column prop="abnormalReason" label="异常原因">
|
</el-table-column>
|
<!-- <el-table-column label="操作" width="60">
|
<template slot-scope="scope">
|
<el-button size="small" type="text" @click="deleteWayBill(scope)">移除</el-button>
|
</template>
|
</el-table-column> -->
|
</el-table>
|
</el-card>
|
</el-col>
|
</el-row>
|
<!-- 显示打印模板 -->
|
<print v-if="showprint" ref="printRef" :print-name="formData.printName" :ids="''+print_Ids" :menu-id="''+menu_Id" :is-auto-print="true" :is-auto-load="false"></print>
|
</div>
|
</template>
|
|
<script>
|
import { getLodop } from "@/utils/LodopFuncs";
|
import print from "@/views/sys/print/base";
|
|
export default {
|
name: "tms-panel-pcpanel",
|
components: {
|
print
|
},
|
data() {
|
return {
|
formData: {
|
wayBillCode: null, // 运单号
|
trayCode: null, // 托盘号
|
printName: null // 打印及名称
|
},
|
showprint: false, // 显示print
|
print_Ids: 0, // 订单Id
|
menu_Id: 0, // 模板Id
|
panelResult: true, // 组板结果
|
panelMsg: null, // 组板信息
|
wayBillList: [], // 正常运单
|
abnormalWaybillList: [], // 异常运单
|
printList: [], // 打印机设备列表
|
printName: null, // 打印及名称
|
// 口岸名称下拉框数据列表
|
portOptions: []
|
};
|
},
|
mounted() {
|
this.getPrintList();
|
this.getPortList();
|
},
|
activated() {
|
if (!this.formData.printName) {
|
this.$message.warning("请正确选择打印机");
|
}
|
},
|
methods: {
|
// 获取口岸下拉框
|
getPortList() {
|
const url = "/api/basicInfo/base/port/getList";
|
const params = {};
|
var callback = res => {
|
if (res.result) {
|
var portList = [{ port_Id: 0, portName: "[全部口岸]" }];
|
this.portOptions = portList.concat(res.data);
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
},
|
// 打印
|
btnClickPrint() {},
|
// 加载数据
|
getData() {},
|
// 校验并生成组板
|
checkPanel() {
|
if (!this.formData.printName) {
|
this.$message.error("请选择打印机");
|
return;
|
}
|
var url = "/api/tms/panel/checkPCPanel";
|
var params = {
|
port_Id: this.formData.port_Id,
|
wayBillCode: this.formData.wayBillCode
|
};
|
this.common.ajax(
|
url,
|
params,
|
res => {
|
if (res.result) {
|
this.showprint = true;
|
this.panelResult = true;
|
this.panelMsg = res.data.groupBoard;
|
this.formData.trayCode = res.data.plateCode;
|
this.wayBillList.push(res.data);
|
this.print_Ids = res.data.wayBill_Id;
|
this.menu_Id = res.dynamic;
|
this.$nextTick(() => {
|
this.$refs.printRef.loadModuleData();
|
});
|
} else {
|
this.panelResult = false;
|
this.$message.error(res.msg);
|
if (res.data) {
|
this.abnormalWaybillList.push(res.data);
|
}
|
this.panelMsg = "组板失败";
|
}
|
this.$refs.wayBillCode.select();
|
this.$refs.wayBillCode.focus();
|
},
|
true
|
);
|
},
|
// 获得打印机列表
|
getPrintList() {
|
window.setTimeout(() => {
|
const LODOP = getLodop();
|
var iPrinterCount = LODOP.GET_PRINTER_COUNT();
|
for (var i = 0; i < iPrinterCount; i++) {
|
this.printList.push(LODOP.GET_PRINTER_NAME(i));
|
}
|
}, 1000);
|
}
|
}
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
@import "../../../styles/scan.scss";
|
.successClass {
|
color: green;
|
font-size: 40px;
|
margin-left: 200px;
|
}
|
.errorClass {
|
color: red;
|
font-size: 40px;
|
margin-left: 200px;
|
}
|
</style>
|