fix:入账库打印

dev2.5_scan
chenhc 5 months ago
parent aa2005fac0
commit 40bf7f72fe

@ -6,7 +6,7 @@ ENV = 'development'
# 开发环境
# VUE_APP_BASE_API = 'https://mudi.dsxyy.org/UDI_WMS_MC/'
VUE_APP_BASE_API = 'http://192.168.0.188:9991'
VUE_APP_BASE_API = 'http://192.168.0.66:9991'
# VUE_APP_BASE_SPMS_API = 'http://192.168.0.43:9993'
VUE_APP_BASE_SPMS_API = 'http://192.168.0.188:10002/directToSpms'

@ -49,6 +49,37 @@ export function printOrder(data) {
data: data
});
}
export function printOrderDept(data) {
return axios({
url: "/udiwms/inout/resultDetail/filterOrderPrintDept",
method: "post",
headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
responseType: 'arraybuffer', //一定要设置响应类型否则页面会是空白pdf
data: data
});
}
export function printOrderDeptSup(data) {
return axios({
url: "/udiwms/inout/resultDetail/filterOrderPrintDeptSup",
method: "post",
headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
responseType: 'arraybuffer', //一定要设置响应类型否则页面会是空白pdf
data: data
});
}
export function printOrderInvProducts(data) {
return axios({
url: "/udiwms/inout/resultDetail/printOrderInvProducts",
method: "post",
headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
responseType: 'arraybuffer', //一定要设置响应类型否则页面会是空白pdf
data: data
});
}
export function printDev(data) {
return axios({
url: "/udiwms/inout/resultDetail/filterDevPrint",

@ -226,11 +226,14 @@
>查询
</el-button
>
<el-button type="primary" icon="el-icon-printer" @click="optinPrint" :loading="optinPrintLoading">选中打印</el-button>
<el-button type="primary" icon="el-icon-printer" @click="selectPrint" :loading="selectPrinttLoading">查询结果打印</el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" style="width: 100%" highlight-current-row
border>
<el-table v-loading="loading" :data="list" style="width: 100%" highlight-current-row borderv
@selection-change="handleCheckedChange" :row-style="{ height: '32px' }">
<el-table-column type="selection" width="55"></el-table-column>
<!-- <el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="供应商" prop="supName" v-if="showSup" show-overflow-tooltip
width="120"></el-table-column>
@ -405,6 +408,10 @@
</template>
<script>
import {
verifyTemplateFile,
printOrderInvProducts,
} from '@/api/inout/orderDetailResult'
import {getInvListByUserOptimize} from "@/api/system/invWarehouse";
import {getInvProduct, deleteInvProduct, getProduct} from "@/api/inventory/invPorduct";
import {getBasicUnitMaintainsOptimize} from "@/api/basic/basicUnitMaintain";
@ -421,7 +428,9 @@ export default {
name: "InvProducts",
data() {
return {
showSearch: false,
optinPrintLoading: false,
selectPrinttLoading: false,
showSearch: true,
filterQuery: {
nameCode: null,
cpmctymc: null,
@ -473,9 +482,154 @@ export default {
addInvRemindSetDialogVisible: false,
invId: null,
spaceList: [],
orderSelection: [],
actDateRange: [],
};
},
methods: {
handleCheckedChange(val) {
this.orderSelection = val;
},
optinPrint() {
this.$confirm("是否确定打印选中入账库信息, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
if (this.orderSelection == null || this.orderSelection.length <= 0) {
return this.$message.error("请选择打印的明细!");
}
let query = {id: 10};
this.optinPrintLoading = true
verifyTemplateFile(query).then((res) => {
this.optinPrintLoading = false
if (res.code === 20000) {
let printParams = {
mainAction :this.filterQuery.mainAction,
fromInvCode :this.filterQuery.fromInvCode,
startAduditTime :this.filterQuery.startAduditTime,
endAduditTime: this.filterQuery.endAduditTime,
confirmStarTime : this.filterQuery.confirmStarTime ,
confirmEndTime : this.filterQuery.confirmEndTime ,
corpName : this.filterQuery.corpName ,
cpmctymc: this.filterQuery.cpmctymc,
udiCode: this.filterQuery.udiCode,
nameCode: this.filterQuery.nameCode,
ggxh: this.filterQuery.ggxh,
batchNo: this.filterQuery.batchNo,
zczbhhzbapzbh: this.filterQuery.zczbhhzbapzbh,
ylqxzcrbarmc: this.filterQuery.ylqxzcrbarmc,
invCode: this.filterQuery.invCode,
invSpaceCode: this.filterQuery.invSpaceCode,
filterNoInv: this.filterQuery.filterNoInv,
supId: this.filterQuery.supId,
employeeName: this.$store.getters.user.employeeName,
locInvName:this.$store.getters.locInvName,
templateId: res.data,
list: this.orderSelection
};
printOrderInvProducts(printParams).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
})
} else {
this.optinPrintLoading = false
return this.$message.error(res.message);
}
}).catch((error) => {
this.optinPrintLoading = false
this.loading = false;
this.$message.error(error.message);
})
})
.catch(() => {
});
},
selectPrint() {
this.$confirm("是否确定打印所有查询结果数据", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let query = {id: 10};
this.selectPrinttLoading = true
verifyTemplateFile(query).then((res) => {
this.selectPrinttLoading = false
if (res.code === 20000) {
let printParams = {
templateId: res.data,
orderIdFk: this.filterQuery.orderIdFk,
fromInvCode: this.filterQuery.fromInvCode,
coName: this.filterQuery.coName,
spec: this.filterQuery.spec,
manufacturer: this.filterQuery.manufacturer,
actionType: this.filterQuery.actionType,
keyWords: this.filterQuery.keyWords,
mainAction: this.filterQuery.mainAction,
action: this.filterQuery.action,
cpmctymc: this.filterQuery.cpmctymc,
udiCode: this.filterQuery.udiCode,
nameCode: this.filterQuery.nameCode,
ggxh: this.filterQuery.ggxh,
batchNo: this.filterQuery.batchNo,
zczbhhzbapzbh: this.filterQuery.zczbhhzbapzbh,
ylqxzcrbarmc: this.filterQuery.ylqxzcrbarmc,
invCode: this.filterQuery.invCode,
invSpaceCode: this.filterQuery.invSpaceCode,
filterNoInv: this.filterQuery.filterNoInv,
supId: this.filterQuery.supId,
locInvName:this.$store.getters.locInvName,
employeeName: this.$store.getters.user.employeeName,
};
if (this.actDateRange !== null) {
printParams.startAduditTime = this.actDateRange[0];
printParams.endAduditTime = this.actDateRange[1];
} else {
printParams.startAduditTime = null;
printParams.endAduditTime = null;
}
printOrderInvProducts(printParams).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
})
} else {
this.$message.error(res.message);
return
}
}).catch((error) => {
this.selectPrinttLoading = false
this.loading = false;
this.$message.error(error.message);
})
})
.catch(() => {
});
return;
},
onReset() {
this.$router.push({
path: "",

Loading…
Cancel
Save