You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1866 lines
57 KiB
1866 lines
57 KiB
<!--日常打印M100信息模块-->
|
|
<!--日常打印M100信息模块-->
|
|
<template>
|
|
<div class="cr-body-content">
|
|
<div ref="box">
|
|
<flexbox class="content-header">
|
|
<el-form :model="listQuery" ref="queryForm" v-show="showSearch" :inline="true">
|
|
<!-- <el-row> -->
|
|
<el-form-item label="生产线:" prop="productType">
|
|
<el-select v-model="listQuery.productType" clearable placeholder="请选择" size="medium" style="margin-right: 15px"
|
|
@change="ptypeselectChange">
|
|
<el-option v-for="item in productTypeList" :key="item.id" :label="item.name" :value="item.id" />
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="" prop="productLine">
|
|
<el-select v-model="listQuery.productLine" clearable placeholder="请选择" size="medium" style="margin-right: 15px"
|
|
@change="valueselectChange">
|
|
<el-option v-for="item in PLChildList" :key="item.id" :label="item.productLineName" :value="item.productLineCode" />
|
|
</el-select>
|
|
</el-form-item>
|
|
|
|
<el-form-item label="大众工位" prop="fwStation" v-show="this.listQuery.productType === 2">
|
|
<el-select v-model="listQuery.fwStation" clearable placeholder="请选择" size="medium" style="margin-right: 15px"
|
|
@change="fwStation_selectChange">
|
|
<el-option v-for="item in fwStationList" :key="item.id" :label="item.name" :value="item.id" />
|
|
</el-select>
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleFilter">搜索</el-button>
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery('queryForm')">重置</el-button>
|
|
<el-button type="warning" plain icon="el-icon-download" size="mini" style="margin-left: 15px" @click="handleDownload()">导出(Excel)
|
|
</el-button>
|
|
<el-button ref="btn1" type="primary" size="mini" style="margin-left: 15px" @click="print()">打印门板发货排序单
|
|
</el-button>
|
|
|
|
<el-button v-show="this.listQuery.productType !== 2" @click="drawerMBReprint = true" size="mini" type="warning" plain>
|
|
<strong>重新打印门板</strong></el-button>
|
|
<el-button v-show="this.listQuery.productType !== 2" @click="drawerbudaMBPrint = true" size="mini" type="warning" plain>
|
|
<strong>门板补打</strong></el-button>
|
|
<el-button v-show="this.listQuery.productType !== 2" @click="drawerMBDelete = true" size="mini" type="danger" plain>
|
|
<strong>门板作废</strong></el-button>
|
|
|
|
<el-button v-show="this.listQuery.productType === 2" @click="drawerZHBReprint = true" size="mini" type="warning"
|
|
plain>
|
|
<strong>重新打印柱护板</strong></el-button>
|
|
<el-button v-show="this.listQuery.productType === 2" @click="drawerbudaZHBPrint = true" size="mini" type="warning"
|
|
plain>
|
|
<strong>柱护板补打</strong></el-button>
|
|
<el-button v-show="this.listQuery.productType === 2" @click="drawerZHBDelete = true" size="mini" type="danger"
|
|
plain><strong>柱护板作废</strong></el-button>
|
|
<!-- <el-button icon="el-icon-refresh" size="mini" @click="open()"
|
|
>测试</el-button
|
|
>2Z
|
|
<el-button plain @click="open"> 不会自动关闭 </el-button> -->
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<div id="app">
|
|
<div style="
|
|
border: solid 1px darkgray;
|
|
border-radius: 5px;
|
|
margin: 5px;
|
|
padding: 5px;
|
|
">
|
|
<span ref="sp01">{{ content01 }}</span>
|
|
|
|
<span ref="sp05">{{ content05 }}</span>
|
|
|
|
<span ref="sp07">{{ content07 }}</span>
|
|
|
|
<span ref="sp08">{{ content08 }}</span>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
|
|
<!-- </el-row> -->
|
|
</el-form>
|
|
</flexbox>
|
|
</div>
|
|
<!--门板重打-->
|
|
<el-drawer title="门板重新打印" :visible.sync="drawerMBReprint" direction="rtl" size="65%">
|
|
<RepetitionMB v-bind:customerInfosMB="customerInfosMB"></RepetitionMB>
|
|
</el-drawer>
|
|
<!--柱护板重打-->
|
|
<el-drawer title="柱护板重新打印" :visible.sync="drawerZHBReprint" direction="rtl" size="65%">
|
|
<RepetitionZHB v-bind:customerInfosZHB="customerInfosZHB"></RepetitionZHB>
|
|
</el-drawer>
|
|
|
|
<!--门板补打-->
|
|
<el-drawer title="门板补打" :visible.sync="drawerbudaMBPrint" direction="rtl" size="65%">
|
|
<budaMB v-bind:customerInfosMB="customerInfosMB"></budaMB>
|
|
</el-drawer>
|
|
<!--柱护板补打-->
|
|
<el-drawer title="柱护板补打" :visible.sync="drawerbudaZHBPrint" direction="rtl" size="65%">
|
|
<budaZHB v-bind:customerInfosZHB="customerInfosZHB"></budaZHB>
|
|
</el-drawer>
|
|
|
|
<!--门板作废-->
|
|
<el-drawer title="门板作废" :visible.sync="drawerMBDelete" direction="rtl" @open="opens()" size="65%">
|
|
<ScrapMB v-bind:customerInfosMB="customerInfosMB"></ScrapMB>
|
|
</el-drawer>
|
|
<!--柱护板作废-->
|
|
<el-drawer title="柱护板作废" :visible.sync="drawerZHBDelete" direction="rtl" size="65%">
|
|
<ScrapZHB v-bind:customerInfosZHB="customerInfosZHB"></ScrapZHB>
|
|
</el-drawer>
|
|
|
|
<div class="l-table" style="margin-top: -15px">
|
|
<!--表格渲染-->
|
|
<el-table ref="multipleTable" v-loading="listLoading" element-loading-text="拼命加载中..." element-loading-spinner="el-icon-loading"
|
|
class="cr-table" :data="list" :height="tableHeight" :cell-style="cellStyle" :header-cell-style="headerRowStyle"
|
|
size="small" stripe border highlight-current-row style="width: 100%" @sort-change="sortChange" @selection-change="handleSelectionChange"
|
|
@row-click="handleRowClick">
|
|
<el-table-column label="底盘号" prop="vin " sortable="custom" align="center" width="180px">
|
|
<template slot-scope="scope">
|
|
<span class="link-type" @click="handleDrawerOpen(scope.row)">{{
|
|
scope.row.vin
|
|
}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column v-for="(item, index) in getDefaultField" :key="index" :prop="item.prop" :label="item.label"
|
|
:min-width="item.width" :formatter="fieldFormatter" sortable="custom" show-overflow-tooltip :gutter="0">
|
|
<template slot="header" slot-scope="scope">
|
|
{{ scope.column.label }}
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
<div>
|
|
<el-dialog :visible.sync="dialogFormVisible" :close-on-click-modal="false" :title="formTitle" width="700px" @close="closeDialog">
|
|
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="120px">
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-row>
|
|
<el-col :md="10" :xs="24">
|
|
<el-form-item label="要打印数量:" prop="printNum" v-show="this.listQuery.productType === 1">
|
|
<el-input-number v-model="printNum" :min="1" :step="1" @change="valueNumChange"></el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="10" :xs="24">
|
|
<el-form-item label="产线:" prop="printNum" v-show="this.listQuery.productType === 1">
|
|
{{ this.productName }}
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-row>
|
|
<el-col :md="10" :xs="24">
|
|
<el-form-item label="要打印数量:" prop="printNumZHB" v-show="this.listQuery.productType === 2">
|
|
<el-input-number v-model="printNumZHB" :min="1" :step="1" @change="valueNumChangeZHB"></el-input-number>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :md="10" :xs="24">
|
|
<el-form-item label="产线:" v-show="this.listQuery.productType === 2">
|
|
{{ this.productName }}
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
<el-form-item label="大众顺序号:" prop="beginHostSN" v-show="isShowHostSN">
|
|
<el-input v-model.number="form.beginHostSN" placeholder="" clearable type="number" size="small" style="width: 240px"
|
|
@change="beginHostSNChange" />
|
|
<label class="label1">-</label>
|
|
<el-input v-model="form.endHostSN" placeholder="" clearable :disabled="true" size="small" style="width: 240px;" />
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-form-item label="底盘号:" prop="VIN" v-show="isShowVin">
|
|
<el-input v-model="form.beginVin" placeholder="" clearable size="small" style="width: 240px" />
|
|
<label class="label1">-</label>
|
|
<el-input v-model="form.endVin" placeholder="" clearable size="small" style="width: 240px" />
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button type="text" @click="dialogFormVisible = false">取消</el-button>
|
|
<el-button v-loading="formLoading" type="primary" :disabled="isDisable" @click="save" v-debounce="debounceClick">确认</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
</div>
|
|
|
|
<div class="table-footer">
|
|
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"-->
|
|
<pagination v-show="totalCount > 0" :total="totalCount" style="float: right" :page.sync="page" :limit.sync="listQuery.MaxResultCount"
|
|
@pagination="getList" />
|
|
<!-- 抽屉控件 -->
|
|
<el-drawer title="信息详细页" size="75%" direction="rtl" :visible.sync="drawer" :before-close="handleDrawerClose">
|
|
<div>
|
|
<Detail v-bind:customerInfos="customerInfos" style="margin-top: -35px"></Detail>
|
|
</div>
|
|
</el-drawer>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import Pagination from "@/components/Pagination";
|
|
import permission from "@/directive/permission/index.js";
|
|
import CRMTableHead from "../../components/CRMTableHead";
|
|
import importExcel from "@/components/ImportExcel-vw";
|
|
import Lockr from "lockr";
|
|
import {
|
|
mapGetters
|
|
} from "vuex";
|
|
import moment from "moment";
|
|
import Detail from "./detail.vue";
|
|
// import MBDetail from "./detailMB.vue";
|
|
// import ZHBDetail from "./detailZHB.vue";
|
|
import {
|
|
downloadFile
|
|
} from "@/utils/crmindex.js";
|
|
import qs from "qs";
|
|
import RepetitionMB from "./RepetitionMB.vue";
|
|
import RepetitionZHB from "./RepetitionZHB.vue";
|
|
|
|
import budaMB from "./budaMB.vue";
|
|
import budaZHB from "./budaZHB.vue";
|
|
|
|
import ScrapMB from "./ScrapMB.vue";
|
|
import ScrapZHB from "./ScrapZHB.vue";
|
|
import {
|
|
forEach
|
|
} from "jszip/lib/object";
|
|
|
|
export default {
|
|
name: "M100Online",
|
|
components: {
|
|
Pagination,
|
|
CRMTableHead,
|
|
importExcel,
|
|
Detail,
|
|
// MBDetail,
|
|
// ZHBDetail,
|
|
RepetitionMB,
|
|
RepetitionZHB,
|
|
ScrapMB,
|
|
ScrapZHB,
|
|
budaMB,
|
|
budaZHB
|
|
},
|
|
directives: {
|
|
permission
|
|
},
|
|
filters: {
|
|
IsCustomerSignFilter(status) {
|
|
//翻译是否签字
|
|
const statusMap = {
|
|
true: "是",
|
|
false: "否",
|
|
};
|
|
return statusMap[status];
|
|
},
|
|
},
|
|
data() {
|
|
const validVersion = (rule, value, callback) => {
|
|
let numberReg = /^\d{6}$/;
|
|
if (!numberReg.test(value)) {
|
|
callback(new Error("只能为6位数字!"));
|
|
} else {
|
|
callback();
|
|
}
|
|
};
|
|
return {
|
|
content01: "",
|
|
content05: "",
|
|
content07: "",
|
|
content08: "",
|
|
// minute01: this.timeoutMinutes,
|
|
// minute05: this.timeoutMinutes,
|
|
// lastTime01: "14:00",
|
|
// lastTime05: "14:40",
|
|
crmType: "M100Online",
|
|
//productLineList:null,
|
|
isDisable: false,
|
|
drawerMBReprint: false, //显示门板重新打印
|
|
drawerZHBReprint: false,
|
|
|
|
drawerbudaMBPrint: false,
|
|
drawerbudaZHBPrint: false, //显示补打柱护板
|
|
|
|
drawerMBDelete: false, //显示门板报废
|
|
drawerZHBDelete: false,
|
|
activeNames: ["1"],
|
|
printNum: "12",
|
|
printNumZHB: "24",
|
|
rules: {
|
|
erpAssemblyName: [{
|
|
required: true,
|
|
message: "必须输入!",
|
|
trigger: "blur"
|
|
}, ],
|
|
beginHostSN: [{
|
|
required: true,
|
|
message: "必须输入数字!",
|
|
trigger: "number"
|
|
}, ],
|
|
},
|
|
billState: [{
|
|
id: 2,
|
|
name: "未打印"
|
|
},
|
|
{
|
|
id: 3,
|
|
name: "已打印"
|
|
},
|
|
],
|
|
valueSelect: "",
|
|
productName: "",
|
|
customerInfos: [],
|
|
customerInfosMB: [],
|
|
customerInfosZHB: [],
|
|
dialogOptions: [],
|
|
versionValue: "",
|
|
searchContent: "", // 输入内容
|
|
showExcelImport: false,
|
|
form: {},
|
|
drawer: false,
|
|
list: null,
|
|
totalCount: 0,
|
|
listLoading: false,
|
|
listLoaddingPrint: true,
|
|
customerInfo: {
|
|
bomId: "",
|
|
},
|
|
// 高级搜索
|
|
filterObj: {
|
|
type: Object,
|
|
default: () => {
|
|
return {};
|
|
},
|
|
},
|
|
listQuery: {
|
|
SkipCount: 0,
|
|
MaxResultCount: 15,
|
|
productType: 1, //1:门板;2:柱护板
|
|
fwStation: "BA2", //大众工位
|
|
ProductLine: undefined,
|
|
Version: undefined,
|
|
printBillNum: undefined,
|
|
serialNumBegin: undefined,
|
|
serialNumEnd: undefined,
|
|
HostSNBegin: undefined,
|
|
HostSNEnd: undefined,
|
|
KNRBegin: undefined,
|
|
KNREnd: undefined,
|
|
VINBegin: undefined,
|
|
VINEnd: undefined,
|
|
OnlineTimeValue: [],
|
|
OnlineTimeBegin: undefined,
|
|
OnlineTimeEnd: undefined,
|
|
ReceiveTimeValue: [],
|
|
ReceiveTimeBegin: undefined,
|
|
ReceiveTimeEnd: undefined,
|
|
billStatus: undefined,
|
|
state: [],
|
|
},
|
|
listQueryList: {
|
|
SkipCount: 0,
|
|
MaxResultCount: 15,
|
|
ProductLine: undefined,
|
|
BillStatus: undefined,
|
|
CanNotPrint: false,
|
|
ZHBBillStatus: undefined,
|
|
},
|
|
listExportQuery: {
|
|
erpAssemblyCode: undefined,
|
|
erpAssemblyName: undefined,
|
|
},
|
|
listPLQuery: {
|
|
BillType: 2,
|
|
//UserId: this.userinfo.UserId,
|
|
},
|
|
hostSNQuery: {
|
|
productLine: undefined,
|
|
},
|
|
hostCheckQuery: {
|
|
printType: undefined, //0:打印;1:重打;2:补打;
|
|
productLine: undefined,
|
|
beginHostSN: undefined,
|
|
endHostSN: undefined,
|
|
beginVin: undefined,
|
|
endVin: undefined,
|
|
},
|
|
hostPrintQuery: {
|
|
printType: undefined, //0:打印;1:重打;2:补打;
|
|
productLine: undefined,
|
|
beginHostSN: undefined,
|
|
endHostSN: undefined,
|
|
beginVin: undefined,
|
|
endVin: undefined,
|
|
},
|
|
vinPrintQuery: {
|
|
printType: undefined, //0:打印;1:重打;2:补打;
|
|
productLine: undefined,
|
|
beginHostSN: undefined,
|
|
endHostSN: undefined,
|
|
beginVin: undefined,
|
|
endVin: undefined,
|
|
},
|
|
fileQuery: {
|
|
dataname: undefined,
|
|
},
|
|
form: {
|
|
details: [],
|
|
},
|
|
page: 1,
|
|
// 显示搜索条件
|
|
showSearch: true,
|
|
drawer: false,
|
|
dialogFormVisible: false,
|
|
formTitle: "",
|
|
isEdit: false,
|
|
formLoading: false, //关闭窗口
|
|
tableHeight: document.documentElement.clientHeight - 335,
|
|
detailTableHeight: 250,
|
|
details: [], //修改子表数据源
|
|
PLList: [], //产线下拉
|
|
PLChildList: [], //筛选后产线下拉
|
|
productTypeList: [{
|
|
id: 1,
|
|
name: "门板"
|
|
},
|
|
{
|
|
id: 2,
|
|
name: "柱护板"
|
|
},
|
|
],
|
|
fwStationList: [{
|
|
id: "BA2",
|
|
name: "BA2"
|
|
},
|
|
{
|
|
id: "BA5",
|
|
name: "BA5"
|
|
}
|
|
],
|
|
isShowHostSN: false,
|
|
isShowVin: false,
|
|
isShowState: true,
|
|
};
|
|
},
|
|
mounted() {
|
|
this.setTableHeight()
|
|
let _this = this;
|
|
|
|
let timer = setInterval(() => {
|
|
this.open(_this);
|
|
}, 5000);
|
|
},
|
|
created() {
|
|
this.billState.forEach((element, index) => {
|
|
if (index === 0) {
|
|
this.listQuery.state.push(element.id);
|
|
}
|
|
});
|
|
this.getProductLine();
|
|
},
|
|
computed: {
|
|
getDefaultField() {
|
|
var tempsTabs = [];
|
|
tempsTabs.push({
|
|
label: "流水号",
|
|
prop: "serialNum",
|
|
width: 100
|
|
});
|
|
tempsTabs.push({
|
|
label: "大众顺序号",
|
|
prop: "hostSN",
|
|
width: 120
|
|
});
|
|
// tempsTabs.push({
|
|
// label: "底盘号",
|
|
// prop: "vin",
|
|
// width: 130,
|
|
// });
|
|
tempsTabs.push({
|
|
label: "KNR",
|
|
prop: "knr",
|
|
width: 150,
|
|
});
|
|
tempsTabs.push({
|
|
label: "M100上线时间",
|
|
prop: "onlineTime",
|
|
width: 150,
|
|
});
|
|
tempsTabs.push({
|
|
label: "M100接收时间",
|
|
prop: "receiveTime",
|
|
width: 180,
|
|
});
|
|
tempsTabs.push({
|
|
label: "车型代码",
|
|
prop: "vehicleModelCode",
|
|
width: 120,
|
|
});
|
|
tempsTabs.push({
|
|
label: "版本",
|
|
prop: "version",
|
|
width: 150,
|
|
});
|
|
tempsTabs.push({
|
|
label: "R100上线时间",
|
|
prop: "r100OnlineTime",
|
|
width: 150,
|
|
});
|
|
tempsTabs.push({
|
|
label: "R100接收时间",
|
|
prop: "r100ReceiveTime",
|
|
width: 180,
|
|
});
|
|
tempsTabs.push({
|
|
label: "产线",
|
|
prop: "productLine",
|
|
width: 120,
|
|
});
|
|
tempsTabs.push({
|
|
label: "状态",
|
|
prop: "billStatus",
|
|
width: 120,
|
|
});
|
|
|
|
tempsTabs.push({
|
|
label: "柱护板状态",
|
|
prop: "printBillNum",
|
|
width: 120,
|
|
});
|
|
|
|
tempsTabs.push({
|
|
label: "备注",
|
|
prop: "remark",
|
|
width: 120,
|
|
});
|
|
return tempsTabs;
|
|
},
|
|
...mapGetters(["userInfo"]), //获取当前用户信息
|
|
},
|
|
methods: {
|
|
setTableHeight() {
|
|
this.$nextTick(() => {
|
|
var offsetHei = document.documentElement.clientHeight;
|
|
//console.log(offsetHei);
|
|
let boxH = this.$refs.box.offsetHeight;
|
|
this.tableHeight = offsetHei - boxH - 67 - 79 - 10; //57为footer高度,79为页面上部标签高度
|
|
//this.tableHeight = offsetHei -260
|
|
});
|
|
},
|
|
opens() {
|
|
|
|
this.getList();
|
|
},
|
|
open(self) {
|
|
// let productLineList = [];
|
|
// //console.log("门版-主界面传过来的值:11111111111111111111111111111111111111111" );
|
|
// productLineList.forEach(element => {
|
|
// element=this.listQuery.productLine;
|
|
// });
|
|
|
|
//let productLineList = { productLineList: [this.listQuery.productLine] };
|
|
if (this.$refs && this.$refs.sp01) {
|
|
this.$refs.sp01.Visible = false;
|
|
this.$refs.sp05.Visible = false;
|
|
this.$refs.sp07.Visible = false;
|
|
this.$refs.sp08.Visible = false;
|
|
}
|
|
|
|
|
|
let productLineListMain = {
|
|
productLineList: []
|
|
};
|
|
|
|
this.PLChildList.forEach((itm) => {
|
|
productLineListMain.productLineList.push(itm.productLineCode);
|
|
});
|
|
|
|
// console.log(
|
|
// "门版-主界面传过来的值:" + JSON.stringify(productLineListMain)
|
|
// );
|
|
this.$axios
|
|
.posts(
|
|
"/api/newjit/bill-m100/product-line-timeout-remind",
|
|
productLineListMain
|
|
)
|
|
.then((response) => {
|
|
if (response.status == false) {
|
|
this.$message({
|
|
message: response.message,
|
|
type: "warning",
|
|
});
|
|
return;
|
|
} else {
|
|
// console.log(
|
|
// "超时提醒-接口传过来的值:" + JSON.stringify(response.item)
|
|
// );
|
|
|
|
if (response.item !== null) {
|
|
response.item.forEach((JKITEM) => {
|
|
if (JKITEM.productLine == "01") {
|
|
|
|
if (self.$refs && self.$refs.sp01) {
|
|
self.$refs.sp01.Visible = true;
|
|
}
|
|
|
|
this.content01 =
|
|
"大众一厂已经" +
|
|
JKITEM.timeoutMinutes +
|
|
"分钟没收到报文\xa0\xa0\xa0\xa0";
|
|
if (JKITEM.timeoutMinutes >= JKITEM.configMinutes) {
|
|
//写提示信息
|
|
// console.log(
|
|
// "222222222222222222222222222222222222222222222222-1"
|
|
// );
|
|
this.$refs.sp01.style.color = "red";
|
|
this.$refs.sp01.style.fontWeight = "bold";
|
|
} else {
|
|
this.$refs.sp01.style.color = "green";
|
|
}
|
|
}
|
|
if (JKITEM.productLine == "02") {
|
|
this.$refs.sp05.Visible = true;
|
|
this.content05 =
|
|
"大众二厂已经" +
|
|
JKITEM.timeoutMinutes +
|
|
"分钟没收到报文\xa0\xa0\xa0\xa0";
|
|
if (JKITEM.timeoutMinutes >= JKITEM.configMinutes) {
|
|
//写提示信息
|
|
// console.log(
|
|
// "222222222222222222222222222222222222222222222222-2"
|
|
// );
|
|
this.setTableHeight()
|
|
this.$refs.sp05.style.color = "red";
|
|
this.$refs.sp05.style.fontWeight = "bold";
|
|
} else {
|
|
this.$refs.sp05.style.color = "green";
|
|
}
|
|
}
|
|
// if (JKITEM.productLine == "05") {
|
|
// this.$refs.sp05.Visible = true;
|
|
// this.content05 =
|
|
// "05生产线已经" +
|
|
// JKITEM.timeoutMinutes +
|
|
// "分钟没收到报文\xa0\xa0\xa0\xa0";
|
|
// if (JKITEM.timeoutMinutes >= JKITEM.configMinutes) {
|
|
// //写提示信息
|
|
// console.log(
|
|
// "222222222222222222222222222222222222222222222222"
|
|
// );
|
|
// this.$refs.sp05.style.color = "red";
|
|
// this.$refs.sp05.style.fontWeight = "bold";
|
|
// } else {
|
|
// this.$refs.sp05.style.color = "green";
|
|
// }
|
|
// }
|
|
// if (JKITEM.productLine == "07") {
|
|
// this.$refs.sp07.Visible = true;
|
|
// this.content07 =
|
|
// "07生产线已经" +
|
|
// JKITEM.timeoutMinutes +
|
|
// "分钟没收到报文\xa0\xa0\xa0\xa0";
|
|
// if (JKITEM.timeoutMinutes >= JKITEM.configMinutes) {
|
|
// //写提示信息
|
|
// console.log(
|
|
// "222222222222222222222222222222222222222222222222"
|
|
// );
|
|
// this.$refs.sp07.style.color = "red";
|
|
// this.$refs.sp07.style.fontWeight = "bold";
|
|
// } else {
|
|
// this.$refs.sp07.style.color = "green";
|
|
// }
|
|
// }
|
|
// if (JKITEM.productLine == "08") {
|
|
// this.$refs.sp08.Visible = true;
|
|
// this.content08 =
|
|
// JKITEM.productLine +
|
|
// "生产线已经" +
|
|
// JKITEM.timeoutMinutes +
|
|
// "分钟没收到报文";
|
|
// if (JKITEM.timeoutMinutes >= JKITEM.configMinutes) {
|
|
// //写提示信息
|
|
// console.log(
|
|
// "222222222222222222222222222222222222222222222222"
|
|
// );
|
|
// this.$refs.sp08.style.color = "red";
|
|
// this.$refs.sp08.style.fontWeight = "bold";
|
|
// } else {
|
|
// this.$refs.sp08.style.color = "green";
|
|
// }
|
|
// }
|
|
});
|
|
} else {
|
|
this.$message({
|
|
message: "获取接口数据",
|
|
type: "warning",
|
|
});
|
|
return;
|
|
}
|
|
}
|
|
});
|
|
},
|
|
debounceClick() {
|
|
console.log("2秒内点击无数次,都只会触发一次");
|
|
},
|
|
//大众顺序号起止事件改变
|
|
beginHostSNChange(val) {
|
|
if (this.listQuery.productType === 1) {
|
|
this.form.endHostSN =
|
|
parseInt(this.printNum) + parseInt(this.form.beginHostSN) - 1;
|
|
} else if (this.listQuery.productType === 2) {
|
|
this.form.endHostSN =
|
|
parseInt(this.printNumZHB) + parseInt(this.form.beginHostSN) - 1;
|
|
}
|
|
},
|
|
//门板打印数量更改
|
|
valueNumChange(val) {
|
|
this.printNum = val;
|
|
if (val == 12) {
|
|
//默认值是12
|
|
this.$axios
|
|
.gets(
|
|
"/api/newjit/bill-m100/get-print-start-hostsn2",
|
|
this.hostSNQuery
|
|
)
|
|
.then((response) => {
|
|
if (response.item !== null) {
|
|
this.form.beginHostSN = parseInt(response.item);
|
|
//门板
|
|
this.form.endHostSN = parseInt(response.item) + 11;
|
|
} else {
|
|
this.$message({
|
|
message: "获取不到大众顺序号",
|
|
type: "warning",
|
|
});
|
|
return;
|
|
}
|
|
});
|
|
} else {
|
|
//起止顺序号默认数量不为12
|
|
this.form.endHostSN =
|
|
parseInt(this.printNum) + parseInt(this.form.beginHostSN) - 1;
|
|
}
|
|
// this.$axios
|
|
// .gets("/api/newjit/bill-m100/get-print-start-hostsn2", this.hostSNQuery)
|
|
// .then((response) => {
|
|
// if (response.item !== null) {
|
|
// this.form.beginHostSN = parseInt(response.item);
|
|
// if (val == 12) {
|
|
// //门板
|
|
// this.form.endHostSN = parseInt(response.item) + 11;
|
|
// } else {
|
|
// this.form.endHostSN =
|
|
// parseInt(response.item) + parseInt(this.printNum) - 1;
|
|
// }
|
|
// } else {
|
|
// this.$message({
|
|
// message: "获取不到大众顺序号",
|
|
// type: "warning",
|
|
// });
|
|
// return;
|
|
// }
|
|
// });
|
|
},
|
|
//柱护板打印更改
|
|
valueNumChangeZHB(val) {
|
|
this.printNumZHB = val;
|
|
if (val == 12) {
|
|
//默认值是12
|
|
this.$axios
|
|
.gets(
|
|
"/api/newjit/bill-m100/get-print-start-hostsn2",
|
|
this.hostSNQuery
|
|
)
|
|
.then((response) => {
|
|
if (response.item !== null) {
|
|
this.form.beginHostSN = parseInt(response.item);
|
|
//门板
|
|
this.form.endHostSN = parseInt(response.item) + 11;
|
|
} else {
|
|
this.$message({
|
|
message: "获取不到大众顺序号",
|
|
type: "warning",
|
|
});
|
|
return;
|
|
}
|
|
});
|
|
} else {
|
|
//起止顺序号默认数量不为12
|
|
this.form.endHostSN =
|
|
parseInt(this.printNumZHB) + parseInt(this.form.beginHostSN) - 1;
|
|
}
|
|
// this.$axios
|
|
// .gets("/api/newjit/bill-m100/get-print-start-hostsn2", this.hostSNQuery)
|
|
// .then((response) => {
|
|
// if (response.item !== null) {
|
|
// this.form.beginHostSN = parseInt(response.item);
|
|
// if (val == 24) {
|
|
// //柱护板
|
|
// this.form.endHostSN = parseInt(response.item) + 23;
|
|
// } else {
|
|
// this.form.endHostSN =
|
|
// parseInt(response.item) + this.printNumZHB - 1;
|
|
// }
|
|
// } else {
|
|
// this.$message({
|
|
// message: "获取不到大众顺序号",
|
|
// type: "warning",
|
|
// });
|
|
// return;
|
|
// }
|
|
// });
|
|
},
|
|
//抽屉
|
|
handleDrawerOpen(param) {
|
|
debugger
|
|
this.drawer = true;
|
|
//console.log(510)
|
|
//console.log(param)
|
|
var parentId = param.assemblyID; //主键id
|
|
this.customerInfos = [{
|
|
ParentId: parentId,
|
|
BillId: param.id
|
|
}, ];
|
|
},
|
|
|
|
handleDrawerClose(done) {
|
|
done();
|
|
},
|
|
|
|
fetchData(id) {
|
|
//循环动态
|
|
this.$axios
|
|
.gets("/api/newjit/assembly-cfg-erp/" + id)
|
|
.then((response) => {
|
|
this.form = response.item;
|
|
//this.details = response.item.details;
|
|
//console.log(this.details);
|
|
});
|
|
},
|
|
/** 导出功能 */
|
|
handleDownload() {
|
|
this.listLoading = true;
|
|
this.listExportQuery.erpAssemblyCode = this.listQuery.ErpAssemblyCode;
|
|
this.listExportQuery.erpAssemblyName = this.listQuery.ErpAssemblyName;
|
|
console.log(JSON.stringify(this.listQuery));
|
|
this.$axios
|
|
.posts("/api/newjit/assembly-cfg-erp/export", this.listQuery)
|
|
.then((res) => {
|
|
let filename = res.item;
|
|
this.$axios
|
|
.BolbGets("/api/newjit/exclude-part-cfg/download/" + filename)
|
|
.then((response) => {
|
|
if (filename.indexOf("_") != -1) {
|
|
let downName =
|
|
filename.slice(0, filename.lastIndexOf("_")) +
|
|
filename.slice(filename.lastIndexOf("."));
|
|
downloadFile(response, downName);
|
|
this.$notify({
|
|
title: "成功",
|
|
message: "数据-导出成功!",
|
|
type: "success",
|
|
duration: 2000,
|
|
});
|
|
} else {
|
|
downloadFile(response, filename);
|
|
this.$notify({
|
|
title: "成功",
|
|
message: "数据-导出成功!",
|
|
type: "success",
|
|
duration: 2000,
|
|
});
|
|
}
|
|
this.listLoading = false;
|
|
});
|
|
});
|
|
this.listLoading = false;
|
|
},
|
|
/** 重置按钮操作 */
|
|
resetQuery(refName) {
|
|
this.$refs[refName].resetFields();
|
|
this.listQuery.OnlineTimeValue = [];
|
|
this.listQuery.ReceiveTimeValue = [];
|
|
this.listQuery.state = [];
|
|
this.handleQuery();
|
|
this.getProductLine();
|
|
},
|
|
/** 搜索按钮操作 */
|
|
handleQuery() {
|
|
this.listQuery.SkipCount = 1;
|
|
//this.getList();
|
|
},
|
|
selectValue(params) {
|
|
//版本下拉选择
|
|
this.versionValue = params.value;
|
|
this.getList();
|
|
},
|
|
|
|
selectOptionsChange(item) {
|
|
this.getList();
|
|
},
|
|
importExcelData() {
|
|
//关闭导入窗体时调用
|
|
this.showExcelImport = false;
|
|
//this.getList();
|
|
},
|
|
|
|
/** 刷新列表 */
|
|
handleHandle(data) {
|
|
if (data.type !== "edit") {
|
|
this.getList();
|
|
}
|
|
},
|
|
|
|
handleAddDetails() {
|
|
if (this.form.details === undefined) {
|
|
this.form.details = [];
|
|
//console.log(679);
|
|
}
|
|
let obj = {};
|
|
obj.partCode = "";
|
|
obj.partName = "";
|
|
obj.partNum = "";
|
|
obj.isKey = false;
|
|
obj.description = "";
|
|
|
|
//console.log(this.form.details);
|
|
this.form.details.push(obj);
|
|
//console.log(688);
|
|
},
|
|
handleDeleteDetails(index) {
|
|
this.form.details.splice(index, 1);
|
|
//console.log(693);
|
|
},
|
|
|
|
/** 格式化字段 */
|
|
fieldFormatter(row, column) {
|
|
if (column.property === "billStatus") {
|
|
return {
|
|
1: "未匹配",
|
|
2: "未打印",
|
|
3: "已打印"
|
|
} [row[column.property]];
|
|
}
|
|
if (column.property === "zHBBillStatus") {
|
|
return {
|
|
1: "未匹配",
|
|
2: "未打印",
|
|
3: "已打印"
|
|
} [row[column.property]];
|
|
}
|
|
if (column.property == "onlineTime" || column.property == "receiveTime") {
|
|
var date = row[column.property];
|
|
if (date == undefined) {
|
|
return "";
|
|
}
|
|
return moment(date).format("YYYY-MM-DD HH:mm:ss");
|
|
}
|
|
return row[column.property] || "--";
|
|
},
|
|
roleFilter(type) {
|
|
return projectTypeKeyValue[type];
|
|
},
|
|
|
|
/*取M100列表*/
|
|
getList(data) {
|
|
|
|
this.listLoading = true;
|
|
if (data != undefined) {
|
|
this.listQueryList.SkipCount = (this.page - 1) * data.limit;
|
|
} else {
|
|
this.listQueryList.SkipCount = (this.page - 1) * 15;
|
|
}
|
|
if (this.listQuery.productType === 2) {
|
|
this.listQueryList.ZHBBillStatus = 2;
|
|
} else {
|
|
this.listQueryList.ZHBBillStatus = 0;
|
|
}
|
|
if (this.listQuery.productType === 2) {
|
|
this.listQuery.ZHBBillStatus = 2;
|
|
} else {
|
|
this.listQuery.ZHBBillStatus = 0;
|
|
}
|
|
this.listQueryList.BillStatus = 2; //状态
|
|
this.listQueryList.ProductLine = this.listQuery.productLine; //产线
|
|
this.listQueryList.CanNotPrint = false; //不可打印
|
|
this.listQueryList.fwStation = this.listQuery.fwStation; //BA2 BA5
|
|
|
|
this.listQueryList.productType = this.listQuery.productType;
|
|
|
|
console.log(
|
|
"日常打印M100查询条件:" + JSON.stringify(this.listQueryList)
|
|
);
|
|
//this.click();
|
|
this.$axios
|
|
.gets("/api/newjit/bill-m100/list", this.listQueryList)
|
|
.then((response) => {
|
|
this.list = response.items;
|
|
this.totalCount = response.totalCount;
|
|
setTimeout(() => {
|
|
//大数据量加载时
|
|
this.listLoading = false;
|
|
}, 500);
|
|
})
|
|
.catch(() => {
|
|
this.listLoading = false;
|
|
});
|
|
},
|
|
|
|
getDetialList(partCode) {
|
|
this.listLoading = true;
|
|
console.log("详表条件:" + JSON.stringify(this.customerInfo.parentId));
|
|
this.$axios
|
|
.gets("/api/newjit/assembly-cfg-erp/" + this.customerInfo.parentId)
|
|
.then((response) => {
|
|
//console.log(partCode)
|
|
if (partCode !== "" && partCode !== undefined) {
|
|
//console.log(partCode)
|
|
this.list = response.item.details.filter(
|
|
(u) => u.partCode === partCode
|
|
);
|
|
} else {
|
|
this.list = response.item.details;
|
|
}
|
|
//alert(JSON.stringify(response.Items))
|
|
//this.totalCount = response.totalCount;
|
|
setTimeout(() => {
|
|
//大数据量加载时
|
|
this.listLoading = false;
|
|
}, 500);
|
|
})
|
|
.catch(() => {
|
|
this.listLoading = false;
|
|
});
|
|
},
|
|
|
|
valueselectChange(val) {
|
|
this.$forceUpdate();
|
|
this.customerInfosMB = [];
|
|
this.customerInfosZHB = [];
|
|
if (this.listQuery.productType === 1) {
|
|
//把产线值传到子组件
|
|
this.customerInfosMB = [{
|
|
PrintType: 1,
|
|
ProductLine: val,
|
|
fwStation: this.listQuery.fwStation
|
|
}, ];
|
|
}
|
|
if (this.listQuery.productType === 2) {
|
|
//把产线值传到子组件
|
|
this.customerInfosZHB = [{
|
|
PrintType: 1,
|
|
ProductLine: val,
|
|
fwStation: this.listQuery.fwStation
|
|
}, ];
|
|
}
|
|
},
|
|
fwStation_selectChange(val) {
|
|
this.$forceUpdate();
|
|
if (this.listQuery.productType === 1) {
|
|
//把产线值传到子组件
|
|
this.customerInfosMB = [{
|
|
PrintType: 1,
|
|
ProductLine: this.listQuery.productLine,
|
|
fwStation: val
|
|
}, ];
|
|
}
|
|
if (this.listQuery.productType === 2) {
|
|
//把产线值传到子组件
|
|
this.customerInfosZHB = [{
|
|
PrintType: 1,
|
|
ProductLine: this.listQuery.productLine,
|
|
fwStation: val
|
|
}];
|
|
}
|
|
},
|
|
|
|
|
|
handleImportSAP() {},
|
|
|
|
handleFilter() {
|
|
this.page = 1;
|
|
this.getList();
|
|
},
|
|
sortChange(data) {
|
|
const {
|
|
prop,
|
|
order
|
|
} = data;
|
|
if (!prop || !order) {
|
|
this.handleFilter();
|
|
return;
|
|
}
|
|
this.listQuery.Sorting = prop + " " + order;
|
|
this.handleFilter();
|
|
},
|
|
handleSelectionChange(val) {
|
|
this.multipleSelection = val;
|
|
},
|
|
/** 通过回调控制style */
|
|
cellStyle({
|
|
row,
|
|
column,
|
|
rowIndex,
|
|
columnIndex
|
|
}) {
|
|
if (column.property === "qty") {
|
|
return {
|
|
textAlign: "right"
|
|
};
|
|
} else {
|
|
return {
|
|
textAlign: "left"
|
|
};
|
|
}
|
|
},
|
|
/** 通过回调控制表头style */
|
|
headerRowStyle({
|
|
row,
|
|
column,
|
|
rowIndex,
|
|
columnIndex
|
|
}) {
|
|
if (column.property === "qty") {
|
|
return {
|
|
textAlign: "right",
|
|
background: "#FAFAFA"
|
|
};
|
|
} else {
|
|
return {
|
|
textAlign: "left",
|
|
background: "#FAFAFA"
|
|
};
|
|
}
|
|
},
|
|
handleRowClick(row, column, event) {
|
|
//this.$refs.multipleTable.clearSelection();
|
|
this.$refs.multipleTable.toggleRowSelection(row);
|
|
},
|
|
|
|
closeDialog() {},
|
|
/**打印 */
|
|
print() {
|
|
(this.hostPrintQuery = {
|
|
printType: undefined, //0:打印;1:重打;2:补打;
|
|
productLine: undefined,
|
|
beginHostSN: undefined,
|
|
endHostSN: undefined,
|
|
beginVin: undefined,
|
|
endVin: undefined,
|
|
}),
|
|
(this.hostCheckQuery.printType = 0);
|
|
this.hostPrintQuery.printType = 0;
|
|
this.vinPrintQuery.printType = 0;
|
|
|
|
if (
|
|
this.listQuery.productLine === "" ||
|
|
this.listQuery.productLine === undefined
|
|
) {
|
|
this.$message({
|
|
message: "请选择生产线",
|
|
type: "warning",
|
|
});
|
|
return;
|
|
}
|
|
(this.printNum = "12"),
|
|
(this.printNumZHB = "24"),
|
|
|
|
|
|
this.hostSNQuery.productLine = this.listQuery.productLine;
|
|
this.hostSNQuery.fwStation = this.listQuery.fwStation
|
|
this.hostPrintQuery.productLine = this.listQuery.productLine;
|
|
this.hostPrintQuery.fwStation = this.listQuery.fwStation;
|
|
|
|
//后端服务更改了 前端跟着更改成以下方式
|
|
if (this.listQuery.productType === 1) {
|
|
//门板
|
|
this.hostSNQuery.isZhuHuBan = "0";
|
|
console.log("门板hostsn2参数" + JSON.stringify(this.hostSNQuery));
|
|
this.$axios
|
|
.gets(
|
|
"/api/newjit/bill-m100/get-print-start-hostsn3",
|
|
this.hostSNQuery
|
|
)
|
|
.then((response) => {
|
|
console.log("获取hostsn大众顺序号起始");
|
|
console.log(response.item);
|
|
if (response.item !== null) {
|
|
this.form.beginHostSN = parseInt(response.item.beginHostSN);
|
|
this.printNum = parseInt(response.item.count);
|
|
if (this.listQuery.productType === 1) {
|
|
this.form.endHostSN = parseInt(response.item.beginHostSN) + parseInt(response.item.count) - 1;
|
|
} else if (this.listQuery.productType === 2) {
|
|
//柱护板
|
|
this.form.endHostSN = parseInt(response.item) + 23;
|
|
}
|
|
} else {
|
|
this.$message({
|
|
message: "获取不到大众顺序号",
|
|
type: "warning",
|
|
});
|
|
return;
|
|
}
|
|
});
|
|
} else if (this.listQuery.productType === 2) {
|
|
//柱护板
|
|
this.hostSNQuery.isZhuHuBan = "1";
|
|
console.log("柱护板hostsn2参数" + JSON.stringify(this.hostSNQuery));
|
|
|
|
//调用 get-zhuhuban-vin-num 服务 赋值给 this.printNumZHB---------------------------------
|
|
this.$axios
|
|
.gets(
|
|
"/api/newjit/bill-m100/get-zhuhuban-vin-num",
|
|
this.hostSNQuery
|
|
)
|
|
.then((response) => {
|
|
console.log("获取柱护板打印数量");
|
|
console.log(response.item);
|
|
if (response.item !== null) {
|
|
this.printNumZHB = parseInt(response.item);
|
|
|
|
//this.form.endHostSN = this.form.beginHostSN + this.printNumZHB - 1;
|
|
this.form.endHostSN = parseInt(this.printNumZHB) + parseInt(this.form.beginHostSN) - 1;
|
|
} else {
|
|
this.$message({
|
|
message: "获取柱护板打印数量失败,返回空",
|
|
type: "warning",
|
|
});
|
|
return;
|
|
}
|
|
});
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
|
this.$axios
|
|
.gets(
|
|
"/api/newjit/bill-m100/get-print-start-hostsn2",
|
|
this.hostSNQuery
|
|
)
|
|
.then((response) => {
|
|
console.log("获取hostsn大众顺序号起始");
|
|
console.log(response.item);
|
|
if (response.item !== null) {
|
|
this.form.beginHostSN = parseInt(response.item);
|
|
if (this.listQuery.productType === 1) {
|
|
//门板
|
|
this.form.endHostSN = parseInt(response.item) + 11;
|
|
} else if (this.listQuery.productType === 2) {
|
|
//柱护板
|
|
//this.form.endHostSN = parseInt(response.item) + 23;
|
|
this.form.endHostSN = parseInt(this.printNumZHB) + parseInt(this.form.beginHostSN) - 1;
|
|
}
|
|
} else {
|
|
this.$message({
|
|
message: "获取不到大众顺序号",
|
|
type: "warning",
|
|
});
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
if (this.$refs.btn1.$el.innerText === "打印门板发货排序单") {
|
|
this.productName = "";
|
|
switch (this.listQuery.productLine) {
|
|
case "00":
|
|
this.productName = "全部门板";
|
|
break;
|
|
}
|
|
|
|
this.formTitle = "打印-门板发货排序单";
|
|
} else {
|
|
this.productName = "";
|
|
switch (this.listQuery.productLine) {
|
|
case "01":
|
|
this.productName = "大众一厂";
|
|
break;
|
|
case "02":
|
|
this.productName = "大众二厂";
|
|
break;
|
|
}
|
|
this.formTitle = "打印-柱护板发货排序单";
|
|
}
|
|
//this.formTitle = "打印";
|
|
this.dialogFormVisible = true;
|
|
this.form = {
|
|
beginHostSN: "",
|
|
endHostSN: "",
|
|
};
|
|
this.isShowHostSN = true;
|
|
this.isShowVin = false;
|
|
},
|
|
/**重打 */
|
|
rePrint() {
|
|
(this.hostPrintQuery = {
|
|
printType: undefined, //0:打印;1:重打;2:补打;
|
|
productLine: undefined,
|
|
beginHostSN: undefined,
|
|
endHostSN: undefined,
|
|
beginVin: undefined,
|
|
endVin: undefined,
|
|
}),
|
|
(this.hostCheckQuery.printType = 1);
|
|
this.hostPrintQuery.printType = 1;
|
|
this.vinPrintQuery.printType = 1;
|
|
if (
|
|
this.listQuery.productLine === "" ||
|
|
this.listQuery.productLine === undefined
|
|
) {
|
|
this.$message({
|
|
message: "请选择生产线",
|
|
type: "warning",
|
|
});
|
|
return;
|
|
}
|
|
this.formTitle = "重打";
|
|
this.hostPrintQuery.productLine = this.listQuery.productLine;
|
|
this.hostPrintQuery.fwStation = this.listQuery.fwStation;
|
|
this.dialogFormVisible = true;
|
|
this.form = {
|
|
beginVin: "",
|
|
endVin: "",
|
|
};
|
|
this.isShowHostSN = false;
|
|
this.isShowVin = true;
|
|
},
|
|
/**补打 */
|
|
makeUpPrint() {
|
|
(this.hostPrintQuery = {
|
|
printType: undefined, //0:打印;1:重打;2:补打;
|
|
productLine: undefined,
|
|
beginHostSN: undefined,
|
|
endHostSN: undefined,
|
|
beginVin: undefined,
|
|
endVin: undefined,
|
|
}),
|
|
(this.hostCheckQuery.printType = 2);
|
|
this.hostPrintQuery.printType = 2;
|
|
this.vinPrintQuery.printType = 2;
|
|
if (
|
|
this.listQuery.productLine === "" ||
|
|
this.listQuery.productLine === undefined
|
|
) {
|
|
this.$message({
|
|
message: "请选择生产线",
|
|
type: "error",
|
|
});
|
|
return;
|
|
}
|
|
this.formTitle = "补打";
|
|
this.hostPrintQuery.productLine = this.listQuery.productLine;
|
|
this.hostPrintQuery.fwStation = this.listQuery.fwStation;
|
|
this.dialogFormVisible = true;
|
|
this.form = {
|
|
beginVin: "",
|
|
endVin: "",
|
|
};
|
|
this.isShowHostSN = false;
|
|
this.isShowVin = true;
|
|
},
|
|
save() {
|
|
this.$refs.form.validate((valid) => {
|
|
if (valid) {
|
|
//this.listLoaddingPrint = true;
|
|
if (this.isShowHostSN === true) {
|
|
if (this.form.beginHostSN === "") { // || this.form.endHostSN === ""
|
|
this.$message({
|
|
message: "请输入完整的顺序号起始范围",
|
|
type: "error",
|
|
});
|
|
return;
|
|
} else {
|
|
if (this.listQuery.productType === 1) {
|
|
//门板
|
|
if (
|
|
parseInt(this.form.endHostSN) -
|
|
parseInt(this.form.beginHostSN) < 0
|
|
) {
|
|
this.$message({
|
|
message: "起止大众顺序号相减不能为零!",
|
|
type: "error",
|
|
});
|
|
return;
|
|
}
|
|
} else if (this.listQuery.productType === 2) {
|
|
//柱护板
|
|
// if (
|
|
// parseInt(this.form.endHostSN) -
|
|
// parseInt(this.form.beginHostSN) >
|
|
// 23
|
|
// ) {
|
|
// this.$message({
|
|
// message:
|
|
// "最多只能打印24个顺序号,终止顺序号不能大于" +
|
|
// (parseInt(this.form.beginHostSN) + 23),
|
|
// type: "error",
|
|
// });
|
|
// return;
|
|
// }
|
|
}
|
|
}
|
|
}
|
|
if (this.isShowVin === true) {
|
|
if (this.form.beginVin === "" || this.form.endVin === "") {
|
|
this.$message({
|
|
message: "请输入完整的底盘号起始范围",
|
|
type: "error",
|
|
});
|
|
return;
|
|
}
|
|
}
|
|
/**打印时传递大众顺序号范围,接口1获取大众顺序号,接口2验证是否断号,接口3获取打印数据,接口4获得grid++模板的base64编码 */
|
|
if (
|
|
this.formTitle === "打印-门板发货排序单" ||
|
|
this.formTitle === "打印-柱护板发货排序单"
|
|
) {
|
|
this.hostPrintQuery.beginHostSN = parseInt(this.form.beginHostSN);
|
|
this.hostPrintQuery.endHostSN = parseInt(this.form.endHostSN);
|
|
|
|
if (this.listQuery.productType === 1) {
|
|
//门板-打印
|
|
this.hostCheckQuery.beginHostSN = parseInt(this.form.beginHostSN);
|
|
this.hostCheckQuery.endHostSN = parseInt(this.form.endHostSN);
|
|
this.hostCheckQuery.productLine = this.listQuery.productLine;
|
|
this.isDisable = true;
|
|
console.log(
|
|
"检查柱护板-hostCheckQuery" +
|
|
JSON.stringify(this.hostCheckQuery)
|
|
);
|
|
this.$axios
|
|
.posts(
|
|
"/api/newjit/bill-m100/check-mb-hostsn-break-num",
|
|
this.hostCheckQuery
|
|
)
|
|
.then((response) => {
|
|
console.log("检查门板-大众顺序号是否断号");
|
|
// this.isDisable = true;
|
|
// setTimeout(() => {
|
|
// this.isDisable = false;
|
|
// }, 1000);
|
|
|
|
if (response.item.length > 0) {
|
|
//有断号
|
|
this.$confirm(
|
|
"本次打印存在断号是否继续?" + response.item,
|
|
"提示", {
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
type: "warning",
|
|
}
|
|
)
|
|
.then(() => {
|
|
//门板
|
|
//传递大众顺序号起止
|
|
this.private_printMenBan();
|
|
})
|
|
.catch(() => {
|
|
this.isDisable = false;
|
|
});
|
|
} else {
|
|
//无断号
|
|
//门板
|
|
//传递大众顺序号起止
|
|
this.private_printMenBan();
|
|
}
|
|
});
|
|
} else if (this.listQuery.productType === 2) {
|
|
//柱门板
|
|
this.hostCheckQuery.beginHostSN = parseInt(this.form.beginHostSN);
|
|
this.hostCheckQuery.endHostSN = parseInt(this.form.endHostSN);
|
|
this.hostCheckQuery.productLine = this.listQuery.productLine;
|
|
this.hostCheckQuery.fwStation = this.listQuery.fwStation;
|
|
this.isDisable = true;
|
|
this.$axios
|
|
.posts(
|
|
"/api/newjit/bill-m100/check-zhb-hostsn-break-num",
|
|
this.hostCheckQuery
|
|
)
|
|
.then((response) => {
|
|
console.log("检查门板-大众顺序号是否断号");
|
|
// this.isDisable = true;
|
|
// setTimeout(() => {
|
|
// this.isDisable = false;
|
|
// }, 1000);
|
|
if (response.item.length > 0) {
|
|
//有断号
|
|
this.$confirm(
|
|
"本次打印存在断号是否继续?" + response.item,
|
|
"提示", {
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
type: "warning",
|
|
}
|
|
)
|
|
.then(() => {
|
|
//门板
|
|
//传递大众顺序号起止
|
|
this.private_printZhuHuBan(true);
|
|
})
|
|
.catch(() => {
|
|
this.isDisable = false;
|
|
});
|
|
} else {
|
|
//无断号
|
|
//门板
|
|
//传递大众顺序号起止
|
|
this.private_printZhuHuBan(true);
|
|
}
|
|
});
|
|
//柱护板
|
|
|
|
|
|
}
|
|
} else {
|
|
/**接口1获取打印数据,接口2获得grid++模板的base64编码 */
|
|
this.hostPrintQuery.beginVin = this.form.beginVin;
|
|
this.hostPrintQuery.endVin = this.form.endVin;
|
|
//判断productType类型
|
|
if (this.listQuery.productType === 1) {
|
|
//门板
|
|
//传递底盘号起止
|
|
this.private_printMenBan();
|
|
} else if (this.listQuery.productType === 2) {
|
|
//柱护板
|
|
//传递底盘号起止
|
|
this.private_printZhuHuBan(true);
|
|
}
|
|
}
|
|
}
|
|
});
|
|
},
|
|
|
|
/**
|
|
* 保存、加载、打印门板
|
|
*/
|
|
private_printMenBan() {
|
|
this.$axios
|
|
.posts(
|
|
"/api/newjit/bill-m100/save-menban-report",
|
|
this.hostPrintQuery
|
|
)
|
|
.then((response) => {
|
|
console.log("保存门板报表");
|
|
console.log(response);
|
|
console.log(response.status);
|
|
if (response.status === false) {
|
|
this.$message({
|
|
message: response.message,
|
|
type: "error",
|
|
});
|
|
return;
|
|
} else if (response.status === true) {
|
|
let loadInput = response.item;
|
|
//-------------------------------------------
|
|
this.$axios
|
|
.posts(
|
|
"/api/newjit/bill-m100/load-menban-report",
|
|
loadInput
|
|
)
|
|
.then((response) => {
|
|
console.log("加载门板报表");
|
|
console.log(response);
|
|
console.log(response.status);
|
|
if (response.status === false) {
|
|
this.$message({
|
|
message: response.message,
|
|
type: "error",
|
|
});
|
|
return;
|
|
} else if (response.status === true) {
|
|
//传给grid++接口json数据,得到返回的文件base64
|
|
//this.fileQuery.report = "menban";
|
|
this.fileQuery.dataname = JSON.stringify(
|
|
response.item
|
|
);
|
|
//this.fileQuery.dataname = "";
|
|
console.log("打印json");
|
|
console.log(this.fileQuery.dataname);
|
|
this.$axios
|
|
.posts(
|
|
"/Handlers/Handler1.ashx?report=menban",
|
|
qs.stringify(this.fileQuery)
|
|
)
|
|
.then((response) => {
|
|
console.log("获取文件base64编码");
|
|
console.log(response);
|
|
this.formLoading = false;
|
|
this.isDisable = false;
|
|
this.printpdf(response); //打印我文件流
|
|
})
|
|
.catch((error) => {
|
|
this.formLoading = false;
|
|
this.isDisable = false;
|
|
});
|
|
}
|
|
});
|
|
//-------------------------------------------
|
|
}
|
|
});
|
|
},
|
|
|
|
/**
|
|
* 保存、加载、打印柱护板
|
|
*/
|
|
private_printZhuHuBan(isSelAll = true) {
|
|
//门板
|
|
//传递大众顺序号起止
|
|
this.$axios
|
|
.posts(
|
|
"/api/newjit/bill-m100/save-zhuhuban-report",
|
|
this.hostPrintQuery
|
|
)
|
|
.then((response) => {
|
|
console.log("保存柱护板报表");
|
|
console.log(response);
|
|
console.log(response.status);
|
|
if (response.status === false) {
|
|
this.$message({
|
|
message: response.message,
|
|
type: "error",
|
|
});
|
|
return;
|
|
} else if (response.status === true) {
|
|
let loadInput = {};
|
|
loadInput.dataResultType = (isSelAll == true) ? "1" : "2";
|
|
loadInput.reportIdList = response.item;
|
|
loadInput.productLine = this.hostPrintQuery.productLine
|
|
//--------------------------------------
|
|
//门板
|
|
//传递大众顺序号起止
|
|
this.$axios
|
|
.posts(
|
|
"/api/newjit/bill-m100/load-zhuhuban-report",
|
|
loadInput
|
|
)
|
|
.then((response) => {
|
|
console.log("加载柱护板报表");
|
|
console.log(response);
|
|
console.log(response.status);
|
|
if (response.status === false) {
|
|
this.$message({
|
|
message: response.message,
|
|
type: "error",
|
|
});
|
|
return;
|
|
} else if (response.status === true) {
|
|
//传给grid++接口json数据,得到返回的文件base64
|
|
//this.fileQuery.report = "menban";
|
|
this.fileQuery.dataname = JSON.stringify(
|
|
response.item
|
|
);
|
|
//this.fileQuery.dataname = "";
|
|
console.log("打印json");
|
|
console.log(this.fileQuery.dataname);
|
|
|
|
let reporturl = "/Handlers/Handler1.ashx?report=zhuhuban_" + this.hostPrintQuery.productLine + '-' + this.hostPrintQuery
|
|
.fwStation; //zhuhuban_01-BA2
|
|
|
|
this.$axios
|
|
.posts(
|
|
reporturl, //"/Handlers/Handler1.ashx?report=zhuhuban",
|
|
qs.stringify(this.fileQuery)
|
|
)
|
|
.then((response) => {
|
|
console.log("获取文件base64编码");
|
|
console.log(response);
|
|
this.formLoading = false;
|
|
this.isDisable = false;
|
|
this.printpdf(response); //打印我文件流
|
|
})
|
|
.catch((error) => {
|
|
this.formLoading = false;
|
|
this.isDisable = false;
|
|
});
|
|
}
|
|
});
|
|
//--------------------------------------
|
|
}
|
|
});
|
|
},
|
|
|
|
//获取所有产线
|
|
getProductLine() {
|
|
|
|
if (this.userInfo == null || this.userInfo.userId == null) //设置默认值,调试时使用
|
|
{
|
|
this.listPLQuery.UserId = 'AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA';
|
|
} else {
|
|
this.listPLQuery.UserId = this.userInfo.userId;
|
|
}
|
|
|
|
console.log(
|
|
"this.listPLQuery.UserId::" + this.listPLQuery.UserId
|
|
);
|
|
this.$axios
|
|
.gets("/api/newjit/product-line/list", this.listPLQuery)
|
|
.then((response) => {
|
|
//console.log(response);
|
|
this.PLList = response.item;
|
|
this.PLChildList = this.PLList.filter(
|
|
(u) => u.productType === parseInt(this.listQuery.productType)
|
|
).sort((a, b) => {
|
|
return a.productLineCode - b.productLineCode;
|
|
});
|
|
this.listQuery.productLine = this.PLChildList[0].productLineCode;
|
|
if (this.listQuery.productLine != "") {
|
|
//把产线值传到子组件
|
|
this.customerInfosMB = [{
|
|
PrintType: 1,
|
|
ProductLine: this.PLChildList[0].productLineCode,
|
|
}, ];
|
|
}
|
|
this.getList();
|
|
//console.log(this.PLList)
|
|
})
|
|
.catch(() => {});
|
|
},
|
|
//产线类型变更
|
|
ptypeselectChange() {
|
|
this.$forceUpdate();
|
|
//console.log(this.listQuery.productType);
|
|
this.listQuery.productLine = "";
|
|
debugger
|
|
this.PLChildList = this.PLList.filter(
|
|
(u) => u.productType === parseInt(this.listQuery.productType)
|
|
).sort((a, b) => {
|
|
return a.productLineCode - b.productLineCode;
|
|
});
|
|
//console.log(this.PLList)
|
|
this.setTableHeight()
|
|
//变更打印按钮文字
|
|
if (this.listQuery.productType === 1) {
|
|
this.$refs.btn1.$el.innerText = "打印门板发货排序单";
|
|
this.$refs.btn2.$el.innerText = "重新打印门板发货排序单";
|
|
this.$refs.btn3.$el.innerText = "补打门板发货排序单";
|
|
this.listQuery.state.push(this.billState[0].id);
|
|
this.isShowState = true;
|
|
|
|
} else if (this.listQuery.productType === 2) {
|
|
this.$refs.btn1.$el.innerText = "打印柱护板发货排序单";
|
|
this.$refs.btn2.$el.innerText = "重新打印柱护板发货排序单";
|
|
this.$refs.btn3.$el.innerText = "补打柱护板发货排序单";
|
|
this.listQuery.state = [];
|
|
this.isShowState = false;
|
|
}
|
|
|
|
if (this.listQuery.productType === 2) {
|
|
this.listQueryList.ZHBBillStatus = 2;
|
|
} else {
|
|
this.listQueryList.ZHBBillStatus = 0;
|
|
}
|
|
},
|
|
|
|
/*单据状态变更 */
|
|
checkedListChange(index) {
|
|
if (this.listQuery.state.length <= 1) {
|
|
this.listQuery.state.push(this.billState[index].id);
|
|
} else {
|
|
this.listQuery.state = [];
|
|
this.listQuery.state.push(this.billState[index].id);
|
|
}
|
|
},
|
|
/**解析文件流 */
|
|
getUrl() {
|
|
//dataResult.data是后台返回的流
|
|
let pdfUrl = window.URL.createObjectURL(
|
|
new Blob([dataResult.data], {
|
|
type: `application/pdf`
|
|
})
|
|
);
|
|
const fname = item.name + str + "_" + lists[1] + lists[2]; // 下载文件的名字
|
|
const link = document.createElement("a");
|
|
link.href = pdfUrl;
|
|
link.setAttribute("download", "下载的文件名");
|
|
document.body.appendChild(link);
|
|
link.click();
|
|
document.body.removeChild(link);
|
|
},
|
|
//base64转化成流,dataurl是后台返回的base64
|
|
dataURLtoBlob(dataurl) {
|
|
var bstr = atob(dataurl.substring(dataurl.indexOf(",") + 1));
|
|
var n = bstr.length;
|
|
var u8arr = new Uint8Array(n);
|
|
while (n--) {
|
|
u8arr[n] = bstr.charCodeAt(n);
|
|
}
|
|
return new Blob([u8arr], {
|
|
type: "application/pdf"
|
|
});
|
|
},
|
|
doPrint(val) {
|
|
var ordonnance = document.getElementById(val).contentWindow;
|
|
setTimeout(() => {
|
|
// window.print()
|
|
ordonnance.print();
|
|
this.pdfLoading = false;
|
|
}, 100);
|
|
},
|
|
printpdf(dataResult) {
|
|
//打印功能,dataResult是后台返回的base64
|
|
let blob = this.dataURLtoBlob(dataResult);
|
|
var date = new Date().getTime();
|
|
var ifr = document.createElement("iframe");
|
|
ifr.style.frameborder = "no";
|
|
ifr.style.display = "none";
|
|
ifr.style.pageBreakBefore = "always";
|
|
ifr.setAttribute("id", "printPdf" + date);
|
|
ifr.setAttribute("name", "printPdf" + date);
|
|
ifr.src = window.URL.createObjectURL(blob);
|
|
document.body.appendChild(ifr);
|
|
this.doPrint("printPdf" + date);
|
|
window.URL.revokeObjectURL(ifr.src); // 释放URL 对象
|
|
this.dialogFormVisible = false;
|
|
this.getList();
|
|
},
|
|
httpPost(URL, PARAMS) {
|
|
var temp = document.createElement("form");
|
|
temp.action = URL;
|
|
temp.method = "post";
|
|
temp.style.display = "none";
|
|
|
|
for (var x in PARAMS) {
|
|
var opt = document.createElement("textarea");
|
|
opt.name = x;
|
|
opt.value = PARAMS[x];
|
|
temp.appendChild(opt);
|
|
}
|
|
|
|
document.body.appendChild(temp);
|
|
temp.submit();
|
|
|
|
return temp;
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@import "../../../pg-fis/styles/crmtable.scss";
|
|
|
|
// /*表格全选框去除空框*/
|
|
// .el-table >>> .DisabledSelection .cell .el-checkbox__inner {
|
|
// display: none;
|
|
// position: relative;
|
|
// }
|
|
// /*表格全选框改为:选择*/
|
|
// .el-table >>> .DisabledSelection .cell:before {
|
|
// content: "是否Key件";
|
|
// position: absolute;
|
|
// left: 7px;
|
|
// }
|
|
.divider1 {
|
|
margin: 0;
|
|
}
|
|
|
|
.divider2 {
|
|
margin: 10px;
|
|
margin-bottom: 20px;
|
|
width: 95%;
|
|
}
|
|
|
|
.label1 {
|
|
margin-left: 5px;
|
|
margin-right: 5px;
|
|
}
|
|
</style>
|
|
|