业务单据内部码打印功能代码提交

prod
郑明梁 2 years ago
parent 03c61bdbe8
commit 48bcf0306b

@ -30,6 +30,14 @@ export function generateInnerQRCodeText(query) {
data: query
});
}
export function generateInCodeQRCodeText(query) {
return axios({
url: "/udiwms/stock/order/addOrderPrint",
method: "post",
data: query
});
}

@ -0,0 +1,27 @@
/**
* Created by lk on 17/6/4.
*/
import axios from '@/utils/request'
// 获取列表
export function stockQRCodeText(query) {
return axios(
{
url: "/udiwms/stock/qrcode/text/filter",
method: "get",
params: query
}
)
}
export function filterPrint(query) {
return axios(
{
url: "/spms/stockPrint/filter",
method: "get",
params: query
}
)
}

@ -0,0 +1,505 @@
<template>
<div>
<el-card class="el-card">
<el-form :model="query" label-width="100px" v-show="showSearch">
<el-row style="width: 100%">
<el-col :span="6">
<el-form-item label="单据号:">
<el-input v-model="query.billNo" style="width: 90%" placeholder="请输入单据号" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="业务类型:">
<el-select v-model="query.billType" style="width: 90%" placeholder="请选择业务类型" clearable="true" size="mini">
<el-option
v-for="item in busTypes"
:key="item.localName"
:label="item.localName"
:value="item.localAction">
<span style="float: left">{{ item.localName }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="往来单位:">
<el-input v-model="query.corpName" style="width: 90%" placeholder="请输入往来单位" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="当前仓库:">
<el-select v-model="query.invWarehouseCode" style="width: 90%" placeholder="请选择当前仓库" clearable="true"
@change="subInvChange"
size="mini">
<el-option
v-for="item in subInvList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="单据日期:">
<el-date-picker
:picker-options="pickerOptions"
v-model="actDateRange"
type="daterange"
format="yyyy 年 MM 月 dd 日"
style="width: 90%"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="top-right-btn">
<el-button-group style="display:flex;">
<el-button icon="el-icon-view" type="primary" @click="hideSearch">/</el-button>
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="el-icon-search" @click="onSubmit"></el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" style="width: 100%;" border highlight-current-row @row-click="getStockOrderDetailList" ref="multipleTable">
<el-table-column type="selection" width="55">
</el-table-column>
<el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column label="单据号" prop="billNo" show-overflow-tooltip></el-table-column>
<el-table-column label="往来单位" prop="fromInvName" show-overflow-tooltip></el-table-column>
<el-table-column label="单据来源" prop="fromType" width="150">
<template slot-scope="scope">
<span>{{ sourceMap[scope.row.fromType] }}</span>
</template>
</el-table-column>
<el-table-column label="单据日期" prop="createTime"></el-table-column>
<el-table-column label="单据状态">
<template slot-scope="scope">
{{ scope.row.status | statusFilterName }}
</template>
</el-table-column>
<el-table-column label="业务类型" prop="billTypeName" width="150">
</el-table-column>
<el-table-column label="当前仓库" prop="invName" width="150">
</el-table-column>
<el-table-column label="所属科室" prop="deptName" width="120">
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native="qrcodeDetail(scope.row)"
>内部码详情
</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:limit.sync="query.limit"
:page.sync="query.page"
@pagination="handleCurrentChange"
></pagination>
</el-card>
<el-card class="el-card">
<el-table v-loading="detailLoading" :data="detailList" style="width: 100%" border>
<el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column label="产品通用名" prop="coName"></el-table-column>
<el-table-column label="规格型号" prop="spec"></el-table-column>
<el-table-column label="批次号" prop="batchNo"></el-table-column>
<el-table-column label="生产日期" prop="productDate">
<template slot-scope="scope">
<span>{{ convertDateFun(scope.row.productDate) }}</span>
</template>
</el-table-column>
<el-table-column label="失效日期" prop="expireDate">
<template slot-scope="scope">
<span>{{ convertDateFun(scope.row.expireDate) }}</span>
</template>
</el-table-column>
<el-table-column label="实际数量" prop="reCount"></el-table-column>
<el-table-column label="单据数量" prop="count"></el-table-column>
<el-table-column label="价格" prop="price"></el-table-column>
<el-table-column label="生产厂家" prop="ylqxzcrbarmc"></el-table-column>
<el-table-column label="注册/备案凭证号" prop="zczbhhzbapzbh"></el-table-column>
</el-table>
<pagination
v-show="detailTotal>0"
:total="detailTotal"
:limit.sync="detailQuery.limit"
:page.sync="detailQuery.page"
@pagination="detailHandleCurrentChange"
></pagination>
</el-card>
<el-dialog
title="内部码详情"
:visible.sync="qrcodeDetailVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="70%"
v-if="qrcodeDetailVisible"
@close='closeQRCodeDetailDialog'
>
<stockOrderQRCodeDetail
:closeDialog="closeQRCodeDetailDialog"
:idQuery="idQuery"
></stockOrderQRCodeDetail>
</el-dialog>
</div>
</template>
<script>
import {stockOrderList, stockOrderDetail, deleteStockOrderById, deleteStockOrderDetailById,
copyStockOrderDetail, submitStockOrder,
uploadStockOrderDetail, uploadStockOrderDetailCount,
generateStockOrderQRCodeText
} from "@/api/inout/stockOrder";
import stockOrderDistribution from "./stockOrderDistribution";
import stockOrderQRCodeDetail from "./stockOrderQRCodeDetail";
import stockQRCodeExport from "./stockQRCodeExport";
import draggable from "vuedraggable";
import {inspectionStockOrderPDFFromTemplateFile, stockOrderPDFFromTemplateFile} from "@/api/itextpdf/itextpdf";
import store from "@/store";
import {getLocalJoinBusType, getLocalJoinByUser} from "@/api/basic/busLocalType";
import {filterAll, filterAllByUser} from "@/api/system/invWarehouse";
import {filterSubByInv} from "@/api/system/invSubWarehouse";
import {convertDate} from "@/utils/date"
export default {
name: "stockOrder",
data() {
return {
showSearch: true,
convertDateFun: convertDate,
query: {
billType: null,
corpName: null,
locStorageCode: this.$store.getters.locInvCode,
invWarehouseCode: this.$store.getters.locSubInvCode,
billNo: "",
status: "",
page: 1,
limit: 10,
startTime: "",
endTime: "",
},
detailQuery: {
orderIdFk: "",
page: 1,
limit: 20
},
isSp: store.getters.customerId,
storageList: [],
subInvList: [],
busTypes: [],
list: [],
detailList: [],
total: 0,
detailTotal: 0,
loading: false,
detailLoading: false,
sourceMap: {
"1": "UDIMS平台",
"2": "网页新增",
"3": "pda已校验",
"4": "pda未校验",
"5": "pc端扫码精灵",
"6": "单据流转",
"7": "供应商平台",
"8": "平衡补单",
"9": "单据验收直接补单",
"10": "单据复制",
"11": "盘点单据转单",
"12": "申购计划转单",
"13": "领用单据转单",
"14": "第三方单据转单",
},
idQuery: {
id: "",
filterUDIType: null,
},
distributionVisible: false,
detailFormRules: {
batchNo: [
{required: true, message: "请输入批次号", trigger: "blur"}
],
productDate: [
{required: true, message: "请输入生产日期", trigger: "blur"}
],
expireDate: [
{required: true, message: "请输入失效日期", trigger: "blur"}
],
sweepCount: [
{required: true, message: "请输入扫码数量", trigger: "blur"}
]
},
detailFormVisible: false,
detailFormData: {},
detailFormLoading: false,
haveDistributionVisible: true,
qrcodeDetailVisible: false,
qrcodeExportVisible: false,
filterUDIType: true,
actDateRange: [],
pickerOptions: {
shortcuts: [
{
text: "最近一周",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近一个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近三个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
},
},
],
},
}
},
methods: {
onReset() {
this.$router.push({
path: ""
});
this.query = {
billNo: "",
status: "3",
page: 1,
limit: 10,
startTime: "",
endTime: "",
};
this.getList();
this.haveDistributionVisible = true;
this.actDateRange = [];
},
hideSearch() {
this.showSearch = !this.showSearch;
},
onSubmit() {
if (this.actDateRange !== null) {
this.query.startTime = this.actDateRange[0];
this.query.endTime = this.actDateRange[1];
} else {
this.query.startTime = null;
this.query.endTime = null;
}
this.getList();
this.haveDistributionVisible = true;
},
handleCurrentChange(val) {
this.query.page = val.page;
this.getList();
},
detailHandleCurrentChange(val) {
this.detailQuery.page = val.page;
this.getStockOrderDetailList();
},
//
resetForm() {
if (this.$refs["dataForm"]) {
//
this.$refs["dataForm"].clearValidate();
//
this.$refs["dataForm"].resetFields();
this.getList();
}
},
getList() {
this.loading = true;
this.query.corpId = store.getters.customerId;
stockOrderList(this.query)
.then(response => {
this.loading = false;
if (response.code == 20000) {
this.list = response.data.list || [];
this.total = response.data.total || 0;
this.detailList = [];
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.list = [];
this.detailList = [];
this.total = 0;
});
},
closeDialog(type) {
this.distributionVisible = false;
this.getList();
if (this.$isNotBlank(type)) {
this.detailList = [];
}
},
qrcodeDetail(row) {
this.idQuery.id = '';
if (this.$isNotBlank(row.id)) {
this.idQuery.id = row.id;
this.idQuery.formData = row;
this.idQuery.filterUDIType = this.filterUDIType;
this.qrcodeDetailVisible = true;
}
},
closeQRCodeDetailDialog() {
this.qrcodeDetailVisible = false;
this.getList();
},
getStockOrderDetailList(row) {
if (this.$isNotBlank(row)) {
this.detailQuery.orderIdFk = row.billNo;
}
this.detailLoading = true;
stockOrderDetail(this.detailQuery)
.then((response) => {
this.detailLoading = false;
this.detailList = response.data.list || [];
this.detailTotal = response.data.total;
})
.catch(() => {
this.detailLoading = false;
this.detailList = [];
});
},
getBusType() {
let query = {
code: this.query.invWarehouseCode,
enabled: true,
};
getLocalJoinByUser(query)
.then((response) => {
this.busTypes = response.data.list || [];
this.filterQuery.billAction = this.busTypes[0].action;
// this.getList();
})
.catch(() => {
});
},
invChange() {
this.query.invWarehouseCode = "";
this.subInvList = [];
let query = {
pcode: this.query.locStorageCode
};
filterSubByInv(query)
.then((response) => {
this.subInvList = response.data || [];
})
.catch(() => {
});
},
getSubInvList() {
let query = {
filter: 3
};
filterSubByInv(query)
.then((response) => {
this.subInvList = response.data || [];
})
.catch(() => {
});
},
subInvChange() {
this.getBusType();
},
},
components: {
draggable,
stockOrderDistribution,
stockOrderQRCodeDetail,
stockQRCodeExport,
},
filters: {
statusFilterType(status) {
const statusMap = {
0: "gray",
1: "success"
};
return statusMap[status];
},
statusFilterName(status) {
const statusMap = {
"1": "草稿",
"2": "未配货",
"3": "待校验",
};
return statusMap[status];
},
typeFilterName(type) {
const typeMap = {
1: "预入库",
2: "普通采购",
};
return typeMap[type];
}
},
created() {
//
this.getSubInvList();
this.getBusType();
this.getList();
let end = new Date();
let start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
this.actDateRange = [start, end];
}
}
</script>
<style scoped>
</style>

@ -0,0 +1,313 @@
<template>
<div>
<el-form :model="formData" :rules="formRules" ref="dataForm">
<el-button-group style="display: flex">
<el-button
type="primary"
@click.native="submit('0')"
style="margin: -50px 60px 10px auto; height: 35px"
:loading="loading"
>提交
</el-button
>
</el-button-group>
<el-row>
<el-col :span="11">
<el-form-item label="单据号:" prop="billNo">
<el-input v-model="formData.billNo" auto-complete="off" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="单据状态:" prop="status">
<el-input v-model="statusMap[formData.status]" auto-complete="off" :disabled="true"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="单据日期:" prop="billdate">
<el-input v-model="formData.billdate" auto-complete="off" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="供应商:" prop="corpName">
<el-input v-model="formData.corpName" auto-complete="off" :disabled="true"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="业务类型:" prop="billType">
<el-select v-model="formData.billType" placeholder="请选择业务类型" clearable="true" disabled="true">
<el-option
v-for="item in busTypes"
:key="item.localName"
:label="item.localName"
:value="item.localAction">
<span style="float: left">{{ item.localName }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="采购类型:" prop="type">
<el-input v-model="typeMap[formData.type]" auto-complete="off" :disabled="true"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="15">
<el-form-item label="条码:" prop="code">
<el-input
@focus="getInputFocus($event)"
@keypress.enter.native="addCode()"
v-model="code"
auto-complete="off"
ref='inputRef'
></el-input>
</el-form-item>
</el-col>
<el-col :span="2">
<el-button type="primary" size="small" @click.native.stop="addCode()" style="height: 31px; margin-left: 10px">添加</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="codeArray" style="width: 100%;" border max-height="350" height="350" ref="multipleTable">
<el-table-column label="序号" type="index" width="50"></el-table-column>
<el-table-column label="产品通用名" prop="productName" show-overflow-tooltip width="200"></el-table-column>
<el-table-column label="包装规格" prop="spec" show-overflow-tooltip width="200"></el-table-column>
<el-table-column label="批次号" prop="batchNo" show-overflow-tooltip></el-table-column>
<el-table-column label="生产日期" prop="productDate" show-overflow-tooltip></el-table-column>
<el-table-column label="失效日期" prop="expireDate" show-overflow-tooltip></el-table-column>
<el-table-column label="扫码数量" prop="sweepCount" show-overflow-tooltip></el-table-column>
</el-table>
<div class="block">
<pagination
v-show="total>0"
:total="total"
:limit.sync="query.limit"
:page.sync="query.page"
@pagination="handleCurrentChange"
></pagination>
</div>
</el-form>
</div>
</template>
<script>
import {stockOrderDetail, submitStockOrder, submitStockOrderError, uploadStockOrderDetailCount} from "@/api/inout/stockOrder";
import draggable from "vuedraggable";
import {getLocalJoinBusType} from "@/api/basic/busLocalType";
export default {
name: "idQuery",
props: {
closeDialog: {
type: Function,
required: true,
},
idQuery: {
type: Object,
required: true,
},
},
data() {
return {
code: "",
query: {
orderIdFk: "",
page: 1,
limit: 10,
},
formData: {},
formRules: {
corpName: [
{required: true, message: "请输入供应商", trigger: "blur"}
],
billdate: [
{required: true, message: "请输入单据日期", trigger: "blur"}
],
billType: [
{required: true, message: "请选择业务类型", trigger: "blur"}
],
// type: [
// {required: true, message: "", trigger: "blur"}
// ],
},
codeArray: [],
total: 0,
loading: false,
index: null,
formLoading: false,
formVisible: false,
deleteLoading: false,
orderNo: null,
statusMap: {
101: "未处理",
102: "已处理",
201: "未配货",
202: "已配货",
301: "已打印",
401: "异常",
501: "未提交",
502: "已提交",
},
typeMap: {
1: "预入库",
2: "普通采购",
},
busTypes: [],
};
},
components: {
draggable,
},
methods: {
submit(formName) {
if (this.total < 1) {
this.$message.error('未配货');
return;
}
this.$confirm("是否提交?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
let tQuery = {
id: this.idQuery.id
}
this.loading = true;
submitStockOrder(tQuery)
.then((response) => {
this.loading = false;
if (response.code === 20000) {
this.$message.success("提交成功");
this.closeDialog(true);
} else {
this.$message.error(response.message);
}
});
}).catch(() => {
this.loading = false;
});
},
//
resetForm() {
if (this.$refs["dataForm"]) {
//
this.$refs["dataForm"].clearValidate();
//
this.$refs["dataForm"].resetFields();
this.getList();
}
},
addCode() {
this.code = this.code.trim();
if (this.$isBlank(this.code)) return;
this.loading = true;
let tQuery = {
orderId: this.idQuery.id,
code: this.code,
};
//012693548470801311200226172302271020022632100025
uploadStockOrderDetailCount(tQuery).then((response) => {
this.loading = false;
if (response.code === 20000) {
this.idQuery.id = response.data;
this.getStockOrderDetailList();
} else {
this.$alert(response.message, '提示', {
confirmButtonText: '确定',
type: 'warning',
closeOnClickModal: true,
callback: action => {
this.$refs.inputRef.focus();
}
});
}
});
},
getInputFocus(event) {
event.currentTarget.select();
},
tableSelection() {
this.$refs.multipleTable.clearSelection();
this.$refs.multipleTable.toggleAllSelection();
},
handleSizeChange(val) {
this.query.limit = val;
this.getStockOrderDetailList();
},
handleCurrentChange(val) {
this.query.page = val.page;
this.getStockOrderDetailList();
},
getStockOrderDetailList() {
this.loading = true;
stockOrderDetail(this.query) //
.then((response) => {
console.log(response)
this.codeArray = response.data.list || [];
this.total = response.data.total || 0;
this.loading = false;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
intentBack() {
this.$router.go(-1);
},
getBusType() {
let query = {
enabled: true,
};
getLocalJoinBusType(query)
.then((response) => {
this.busTypes = response.data.list || [];
})
.catch(() => {
});
},
},
filters: {},
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
},
created() {
this.getBusType();
this.formData = {};
this.codeArray = [];
if (this.$isNotBlank(this.idQuery.id)) {
this.query.orderIdFk = this.idQuery.id;
this.formData = this.idQuery.formData;
this.getStockOrderDetailList();
}
},
};
</script>
<style>
.ao-text {
width: 100%;
font-size: 13px;
font-family: "Microsoft YaHei";
float: right;
text-align: right;
margin-top: 10px;
}
</style>

@ -0,0 +1,444 @@
<template>
<div>
<el-form :model="formData" :rules="formRules" ref="dataForm" label-width="100px">
<el-row type="flex" justify="end">
<el-button-group style="display: flex;margin-bottom: 15px; margin-right: 50px;margin-top: -10px">
<el-button type="primary" @click.native="generateQRCodeText()" :loading="loading">生成内部码</el-button>
<el-button type="primary" @click.native="printStockOrderDetailPDF()" :loading="loading">打印全部</el-button>
<el-switch style="margin-left: 50px;" v-model="filterUDIType" active-text="过滤已有UDI码的产品"></el-switch>
</el-button-group>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="单据号" prop="billNo">
<el-input v-model="formData.billNo" style="width: 90%" auto-complete="off" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="单据日期" prop="billdate">
<el-input v-model="formData.createTime" style="width: 90%" auto-complete="off" :disabled="true"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="供应商名称" prop="corpName">
<el-input v-model="formData.customerName" style="width: 90%" auto-complete="off" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="业务类型" prop="billTypeName">
<el-input v-model="formData.billTypeName" style="width: 90%" auto-complete="off" :disabled="true"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-table v-loading="loading" :data="codeArray" style="width: 100%;" max-height="350" height="350"
border ref="multipleTable">
<el-table-column label="序号" type="index" width="50"></el-table-column>
<el-table-column label="内部码" prop="udiCode"></el-table-column>
<el-table-column label="状态">
<template slot-scope="scope">
<span>{{ statusMap[scope.row.status] }}</span>
</template>
</el-table-column>
<el-table-column label="标签数量">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.count" placeholder="请输入打印标签数量" style="width: 50%"
oninput="value=value.replace(/[^\d]/g,'')"></el-input>
<!-- <span>{{ scope.row.reCount }}</span>-->
</template>
</el-table-column>
<el-table-column label="时间" prop="create_time" show-overflow-tooltip>
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span>{{ scope.row.updateTime }}</span>
</template>
</el-table-column>
<el-table-column label="操作"width="150">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native="printStockOrderDetailPDF(scope.row)"
>标签打印
</el-button
>
</template>
</el-table-column>
</el-table>
<div class="block">
<pagination
v-show="total>0"
:total="total"
:limit.sync="query.limit"
:page.sync="query.page"
@pagination="handleCurrentChange"
></pagination>
</div>
</el-form>
<el-dialog
title="标签打印文件列表"
:visible.sync="labelPrintVisible"
width="60%"
:close-on-click-modal="false"
:close-on-press-escape="false"
append-to-body
v-if="labelPrintVisible"
>
<el-button-group style="display: flex">
<el-button
type="primary"
@click.native="refeshLabel()"
style="margin: -50px 60px 10px auto; height: 35px"
>刷新
</el-button
>
</el-button-group>
<el-table :data="lableFileLsit" style="width: 100%" border>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="文件名称"
prop="fileName"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="生成状态"
prop="status"
show-overflow-tooltip
>
<template slot-scope="scope">
<el-tag :type="(scope.row.status) | statusFilterType">
{{ printMap[scope.row.status] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="printLabel(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="labltotal>0"
:total="labltotal"
:limit.sync="refreshQuery.limit"
:page.sync="refreshQuery.page"
@pagination="handleLableChange"
></pagination>
</el-dialog>
</div>
</template>
<script>
import {filterPrint} from "@/api/inout/innerOrderQRCode";
import {getLocalJoinBusType} from "@/api/basic/busLocalType";
import draggable from "vuedraggable";
import {
filterTemp,
inspectionOrderDetailPDFFromTemplateFile,
inspectionStockQRCodeTextPDFFromTemplateFile,
orderDetailPDFFromTemplateFile, stockQRCodeTextPDFFromTemplateFile, stockQRCodeTextPDFFromTemplateFileMax
} from "@/api/itextpdf/itextpdf";
import {generateInCodeQRCodeText, generateInnerQRCodeText} from "@/api/inout/innerOrderQRCode";
export default {
name: "idQuery",
props: {
closeDialog: {
type: Function,
required: true,
},
idQuery: {
type: Object,
required: true,
},
},
data() {
return {
code: "",
BASE_URL: process.env.VUE_APP_BASE_API,
query: {
sOrderId: null,
orderIdFk: "",
page: 1,
limit: 10,
},
busTypes: [],
formData: {},
codeArray: [],
total: 0,
loading: false,
index: null,
formLoading: false,
formVisible: false,
deleteLoading: false,
orderNo: null,
labelPrintVisible: false,
lableFileLsit: [],
labltotal: null,
refreshQuery: {
page: 1,
limit: 10,
printCodeIdFk: null,
stockOrderFk: null,
},
filterUDIType:false,
statusMap: {
0: "未打印",
1: "已打印",
},
printMap: {
0: "正在生成",
1: "已生成",
2: "生成失败"
},
};
},
components: {
draggable,
},
methods: {
//
resetForm() {
if (this.$refs["dataForm"]) {
//
this.$refs["dataForm"].clearValidate();
//
this.$refs["dataForm"].resetFields();
this.getList();
}
},
printLabel(row) {
window.open(this.pdffileUrl + row.fileName, '_blank');
},
refeshLabel() {
filterTemp(this.refreshQuery).then((response) => {
if (response.code == 20000) {
this.lableFileLsit = response.data.list;
this.labelPrintVisible = true;
this.labltotal = response.data.total || 0;
}
}).catch(() => {
this.loading = false;
});
},
handleCurrentChange(val) {
this.query.page = val.page;
this.getStockQRCodeTextList();
},
getStockQRCodeTextList() {
this.loading = true;
filterPrint(this.query) //
.then((response) => {
console.log(response)
this.codeArray = response.data.list || [];
this.total = response.data.total || 0;
this.loading = false;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
handleLableChange(val) {
this.refreshQuery.page = val.page;
this.refeshLabel();
this.getOrderQRCodeTextList();
},
getOrderQRCodeTextList() {
this.loading = true;
filterPrint(this.query) //
.then((response) => {
console.log(response)
this.codeArray = response.data.list || [];
this.total = response.data.total || 0;
this.loading = false;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
generateQRCodeText() {
this.$confirm("确定生成内部码?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.loading = true;
generateInCodeQRCodeText({orderIdFk:this.formData.billNo,chack:this.filterUDIType})
.then(response => {
this.loading = false;
if (response.code === 20000) {
this.$message.success("生成成功!");
this.getOrderQRCodeTextList();
this.detailList = [];
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
})
}).catch(() => {
});
},
printStockOrderDetailPDF(row) {
let tQuery = {
queryId: null,
orderId: null,
countList: [],
};
if (row == null) {
tQuery.orderId = this.formData.orderIdFk;
} else {
if (row.reCount <= 0) {
return this.$message.error('数量错误');
}
tQuery.queryId = row.id;
}
this.loading = true;
inspectionStockQRCodeTextPDFFromTemplateFile(tQuery).then((response) => {
if (response.code === 20000) {
if (row != null) {
tQuery.id = row.id;
tQuery.rowCount = row.reCount;
let data = {
queryId: row.id,
rowCount: row.count
}
tQuery.countList.push(data);
} else {
for (let i = 0; i < this.codeArray.length; i++) {
let data = {
queryId: this.codeArray[i].id,
rowCount: this.codeArray[i].count
}
tQuery.countList.push(data);
}
}
let count = 0;
for (let i = 0; i < tQuery.countList.length; i++) {
count = count + tQuery.countList[i].rowCount;
console.log(count);
}
console.log(count);
if (count > 100) {
stockQRCodeTextPDFFromTemplateFileMax(tQuery).then((response) => {
if (response.code == 20000) {
this.lableFileLsit = response.data.list;
this.labltotal = response.data.total || 0;
this.labelPrintVisible = true;
this.refreshQuery = {
page: 1,
limit: 10,
printCodeIdFk: tQuery.queryId,
stockOrderFk: tQuery.orderId,
}
this.loading = false;
this.$message.warning("打印文件正在生成中,请点击刷新按钮查看进度,请勿关闭按钮重复打印!");
}
}).catch(() => {
this.loading = false;
});
} else
stockQRCodeTextPDFFromTemplateFile(tQuery).then((response) => {
//pdfurl
const binaryData = [];
binaryData.push(response);
//blob
let url = window.URL.createObjectURL(
new Blob(binaryData, {type: "application/pdf"})
);
this.loading = false;
window.open(url);//pdf
}).catch(() => {
this.loading = false;
});
} else {
this.loading = false;
this.$message.error(response.message);
}
}).catch(() => {
this.loading = false;
});
},
getBusType() {
let query = {
enabled: true,
};
getLocalJoinBusType(query)
.then((response) => {
this.busTypes = response.data.list || [];
this.filterQuery.billAction = this.busTypes[0].action;
// this.getList();
})
.catch(() => {
});
},
},
filters: {
statusFilterType(status) {
const statusMap = {
0: "warning",
1: "success",
2: "danger"
};
return statusMap[status];
}},
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
},
created() {
// this.getBusType();
this.pdffileUrl = this.BASE_URL + "/spms/donwload/pdf?fileName=";
this.formData = {};
this.codeArray = [];
if (this.$isNotBlank(this.idQuery.id)) {
debugger
this.formData = this.idQuery.formData;
this.query.orderIdFk=this.formData.billNo;
this.query.sOrderId = this.formData.orderIdFk;
this.getStockQRCodeTextList();
}
},
};
</script>
<style>
.ao-text {
width: 100%;
font-size: 13px;
font-family: "Microsoft YaHei";
float: right;
text-align: right;
margin-top: 10px;
}
</style>

@ -0,0 +1,484 @@
<template>
<div>
<el-form :model="formData" :rules="formRules" ref="dataForm">
<el-button-group style="display: flex">
<el-button
type="primary"
@click.native="printStockOrderDetailPDF()"
style="margin: -50px 60px 10px auto; height: 35px"
:loading="loading"
>打印全部
</el-button
>
</el-button-group>
<el-row>
<el-col :span="11">
<el-form-item label="单据号" prop="billNo">
<el-input v-model="formData.billNo" auto-complete="off" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="单据日期" prop="billdate">
<el-input v-model="formData.billdate" auto-complete="off" :disabled="true"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="供应商名称" prop="corpName">
<el-input v-model="formData.corpName" auto-complete="off" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="业务类型" prop="billType">
<el-select v-model="formData.billType" placeholder="请选择业务类型" clearable="true" disabled="true">
<el-option
v-for="item in busTypes"
:key="item.localName"
:label="item.localName"
:value="item.localAction">
<span style="float: left">{{ item.localName }}</span>
<!--<span style="float: right; color: #8492a6; font-size: 13px">{{ item.action }}</span>-->
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-table v-loading="loading" :data="codeArray" style="width: 100%;" max-height="350" border height="350" highlight-current-row ref="multipleTable">
<el-table-column label="序号" type="index" width="50"></el-table-column>
<el-table-column label="码" prop="udiCode"></el-table-column>
<el-table-column label="状态" width="120">
<template slot-scope="scope">
<span>{{ statusMap[scope.row.printStatus] }}</span>
</template>
</el-table-column>
<el-table-column label="时间" width="200" prop="create_time" show-overflow-tooltip>
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span>{{ scope.row.updateTime }}</span>
</template>
</el-table-column>
<el-table-column label="标签数量">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.count" placeholder="请输入打印标签数量" style="width: 50%"
oninput="value=value.replace(/[^\d]/g,'')"></el-input>
<!-- <span>{{ scope.row.reCount }}</span>-->
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native="printStockOrderDetailPDF(scope.row)"
>标签打印
</el-button
>
</template>
</el-table-column>
</el-table>
<div class="block">
<pagination
v-show="total>0"
:total="total"
:limit.sync="query.limit"
:page.sync="query.page"
@pagination="handleCurrentChange"
></pagination>
</div>
</el-form>
<el-dialog
title="标签打印文件列表"
:visible.sync="labelPrintVisible"
width="60%"
:close-on-click-modal="false"
:close-on-press-escape="false"
append-to-body
v-if="labelPrintVisible"
>
<el-button-group style="display: flex">
<el-button
type="primary"
@click.native="refeshLabel()"
style="margin: -50px 60px 10px auto; height: 35px"
>刷新
</el-button
>
</el-button-group>
<el-table :data="lableFileLsit" style="width: 100%">
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="文件名称"
prop="fileName"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="生成状态"
prop="status"
show-overflow-tooltip
>
<template slot-scope="scope">
<span>{{ printMap[scope.row.status] }}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="printLabel(scope.row)"
>标签打印
</el-button
>
</template>
</el-table-column>
</el-table>
<el-pagination
:page-size="refreshQuery.limit"
@current-change="handleLableChange"
layout="prev, pager, next"
:total="labltotal"
:current-page="refreshQuery.page"
>
</el-pagination>
</el-dialog>
</div>
</template>
<script>
import {
stockOrderDetail,
submitStockOrder,
submitStockOrderError,
uploadStockOrderDetailCount,
} from "@/api/inout/stockOrder";
import {stockQRCodeText, filterPrint} from "@/api/inout/stockQRCode";
import draggable from "vuedraggable";
import {
inspectionOrderDetailPDFFromTemplateFile, filterTemp,
inspectionStockQRCodeTextPDFFromTemplateFile,
orderDetailPDFFromTemplateFile, stockQRCodeTextPDFFromTemplateFile, stockQRCodeTextPDFFromTemplateFileMax
} from "@/api/itextpdf/itextpdf";
import {getLocalJoinBusType} from "@/api/basic/busLocalType";
export default {
name: "idQuery",
props: {
closeDialog: {
type: Function,
required: true,
},
idQuery: {
type: Object,
required: true,
},
},
data() {
return {
code: "",
query: {
sOrderId: null,
orderIdFk: "",
page: 1,
limit: 10,
},
labelPrintVisible: false,
busTypes: [],
formData: {},
codeArray: [],
total: 0,
lableFileLsit: [],
loading: false,
index: null,
formLoading: false,
formVisible: false,
deleteLoading: false,
orderNo: null,
statusMap: {
0: "未打印",
1: "已打印",
},
refreshQuery: {
page: 1,
limit: 10,
printCodeIdFk: null,
stockOrderFk: null,
},
labltotal: null,
printMap: {
0: "正在生成",
1: "已生成",
},
pdffileUrl: null,
};
},
components: {
draggable,
},
methods: {
submit(formName) {
if (this.total < 1) {
this.$message.error('未选择条码');
return;
}
this.$confirm("是否提交?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
let tQuery = {
id: this.idQuery.id
}
this.loading = true;
submitStockOrder(tQuery)
.then((response) => {
this.loading = false;
if (response.code === 20000) {
this.$message.success("提交成功");
this.closeDialog(true);
} else {
this.$message.error(response.message);
}
});
}).catch(() => {
this.loading = false;
});
},
refeshLabel() {
filterTemp(this.refreshQuery).then((response) => {
if (response.code == 20000) {
this.lableFileLsit = response.data.list;
this.labelPrintVisible = true;
this.labltotal = response.data.total || 0;
}
}).catch(() => {
this.loading = false;
});
},
printLabel(row) {
window.open(this.pdffileUrl + row.fileName, '_blank');
},
//
resetForm() {
if (this.$refs["dataForm"]) {
//
this.$refs["dataForm"].clearValidate();
//
this.$refs["dataForm"].resetFields();
this.getList();
}
},
getInputFocus(event) {
event.currentTarget.select();
},
tableSelection() {
this.$refs.multipleTable.clearSelection();
this.$refs.multipleTable.toggleAllSelection();
},
handleSizeChange(val) {
this.query.limit = val;
// this.getStockOrderDetailList();
this.getStockQRCodeTextList();
},
handleCurrentChange(val) {
this.query.page = val.page;
// this.getStockOrderDetailList();
this.getStockQRCodeTextList();
},
handleLableChange(val) {
this.refreshQuery.page = val;
this.refeshLabel();
},
getStockOrderDetailList() {
this.loading = true;
filterPrint(this.query) //
.then((response) => {
console.log(response)
this.codeArray = response.data.list || [];
this.total = response.data.total || 0;
this.loading = false;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
getBusType() {
let query = {
enabled: true,
};
getLocalJoinBusType(query)
.then((response) => {
this.busTypes = response.data.list || [];
})
.catch(() => {
});
},
getStockQRCodeTextList() {
this.loading = true;
filterPrint(this.query) //
.then((response) => {
console.log(response)
this.codeArray = response.data.list || [];
this.total = response.data.total || 0;
this.loading = false;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
printStockOrderDetailPDF(row) {
let tQuery = {
queryId: null,
orderId: null,
countList: [],
};
if (row == null) {
tQuery.orderId = this.query.sOrderId;
} else {
if (row.reCount <= 0) {
return this.$message.error('数量错误');
}
tQuery.queryId = row.id;
}
this.loading = true;
inspectionStockQRCodeTextPDFFromTemplateFile(tQuery).then((response) => {
if (response.code === 20000) {
if (row != null) {
tQuery.id = row.id;
tQuery.rowCount = row.reCount;
let data = {
queryId: row.id,
rowCount: row.count
}
tQuery.countList.push(data);
} else {
for (let i = 0; i < this.codeArray.length; i++) {
let data = {
queryId: this.codeArray[i].id,
rowCount: this.codeArray[i].count
}
tQuery.countList.push(data);
}
}
let count = 0;
for (let i = 0; i < tQuery.countList.length; i++) {
count = count + tQuery.countList[i].rowCount;
console.log(count);
}
console.log(count);
if (count > 100) {
stockQRCodeTextPDFFromTemplateFileMax(tQuery).then((response) => {
if (response.code == 20000) {
this.lableFileLsit = response.data.list;
this.labltotal = response.data.total || 0;
this.labelPrintVisible = true;
this.refreshQuery = {
page: 1,
limit: 10,
printCodeIdFk: tQuery.queryId,
stockOrderFk: tQuery.orderId,
}
this.loading = false;
this.$message.warning("打印文件正在生成中,请点击刷新按钮查看进度,请勿关闭按钮重复打印!");
}
}).catch(() => {
this.loading = false;
});
} else
stockQRCodeTextPDFFromTemplateFile(tQuery).then((response) => {
//pdfurl
const binaryData = [];
binaryData.push(response);
//blob
let url = window.URL.createObjectURL(
new Blob(binaryData, {type: "application/pdf"})
);
this.loading = false;
window.open(url);//pdf
}).catch(() => {
this.loading = false;
});
} else {
this.loading = false;
this.$message.error(response.message);
}
}).catch(() => {
this.loading = false;
});
},
intentBack() {
this.$router.go(-1);
},
getPrintList(tQuery) {
}
},
filters: {},
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
},
created() {
this.getBusType();
this.formData = {};
this.codeArray = [];
this.pdffileUrl = BASE_URL + "/spms/donwload/pdf?fileName=";
if (this.$isNotBlank(this.idQuery.id)) {
this.formData = this.idQuery.formData;
// this.query.orderIdFk = this.idQuery.id;
// this.getStockOrderDetailList();
this.query.orderId = this.idQuery.id;
this.query.sOrderId = this.idQuery.id;
console.log(this.query.sOrderId);
this.getStockQRCodeTextList();
}
},
};
</script>
<style>
.ao-text {
width: 100%;
font-size: 13px;
font-family: "Microsoft YaHei";
float: right;
text-align: right;
margin-top: 10px;
}
</style>

@ -381,7 +381,7 @@ export default {
.then(response => {
this.loading = false;
if (response.code === 20000) {
this.$message.success(response.data);
this.$message.success("生成成功!");
this.getOrderQRCodeTextList();
this.detailList = [];
} else {

Loading…
Cancel
Save