|
|
|
@ -3,6 +3,12 @@ import {deviceChangeStatus, deviceChangeType, deviceStatus} from "@/utils/enum";
|
|
|
|
|
import {downloadBase64Image} from "@/utils";
|
|
|
|
|
import deptDeviceDetail from "@/views/dev/DeptDeviceDetail.vue";
|
|
|
|
|
import {updateOrderItem } from "@/api/dev/deviceInfoApi";//保存到info
|
|
|
|
|
import {
|
|
|
|
|
verifyTemplateFile,
|
|
|
|
|
printDev,
|
|
|
|
|
excelInoutImport, postExcelInoutImport
|
|
|
|
|
} from '@/api/inout/orderDetailResult'
|
|
|
|
|
|
|
|
|
|
let query = {
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 10,
|
|
|
|
@ -44,6 +50,7 @@ export default {
|
|
|
|
|
loading: false,
|
|
|
|
|
total: .0,
|
|
|
|
|
list: [],
|
|
|
|
|
orderSelection: [],
|
|
|
|
|
query: {...query},
|
|
|
|
|
//设备详情=============================================
|
|
|
|
|
detailLoading: false,
|
|
|
|
@ -156,7 +163,171 @@ export default {
|
|
|
|
|
}).catch(e => {
|
|
|
|
|
this.loading = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
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: 6};
|
|
|
|
|
verifyTemplateFile(query).then((res) => {
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
let printParams = {
|
|
|
|
|
deptCode :this.query.deptCode,
|
|
|
|
|
deviceCode: this.query.deviceCode,
|
|
|
|
|
productName: this.query.productName,
|
|
|
|
|
status: this.query.status,
|
|
|
|
|
templateId: res.data,
|
|
|
|
|
list: this.orderSelection
|
|
|
|
|
};
|
|
|
|
|
printDev(printParams).then((response) => {
|
|
|
|
|
//将pdf文件转换为url。
|
|
|
|
|
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 {
|
|
|
|
|
return this.$message.error(res.message);
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.$message.error(error.message);
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
selectPrint() {
|
|
|
|
|
this.$confirm("是否确定打印所有查询结果数据", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning",
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
|
|
|
|
|
let query = {id: 6};
|
|
|
|
|
verifyTemplateFile(query).then((res) => {
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
let printParams = {
|
|
|
|
|
templateId: res.data,
|
|
|
|
|
deptCode :this.query.deptCode,
|
|
|
|
|
deviceCode: this.query.deviceCode,
|
|
|
|
|
productName: this.query.productName,
|
|
|
|
|
status: this.query.status,
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
printDev(printParams).then((response) => {
|
|
|
|
|
//将pdf文件转换为url。
|
|
|
|
|
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.loading = false;
|
|
|
|
|
this.$message.error(error.message);
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
selectExport() {
|
|
|
|
|
this.$confirm("是否确定导出选中出入库明细, 是否继续?", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning",
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
if (this.orderSelection == null || this.orderSelection.length <= 0) {
|
|
|
|
|
return this.$message.error("请选择需要导出的明细!");
|
|
|
|
|
}
|
|
|
|
|
let printParams = {
|
|
|
|
|
list: this.orderSelection
|
|
|
|
|
};
|
|
|
|
|
postExcelInoutImport(printParams).then((response) => {
|
|
|
|
|
let blob = new Blob([response], {type: "application/vnd.ms-excel"});
|
|
|
|
|
let url = window.URL.createObjectURL(blob); // 创建一个临时的url指向blob对象
|
|
|
|
|
let a = document.createElement("a");
|
|
|
|
|
a.href = url;
|
|
|
|
|
a.click();
|
|
|
|
|
this.$message("成功")
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
searchExport() {
|
|
|
|
|
this.$confirm("是否确定导出所有查询结果数据", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning",
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
|
|
|
|
|
let printParams = {
|
|
|
|
|
orderIdFk: this.filterQuery.orderIdFk,
|
|
|
|
|
nameCode: this.filterQuery.nameCode,
|
|
|
|
|
coName: this.filterQuery.coName,
|
|
|
|
|
spec: this.filterQuery.spec,
|
|
|
|
|
batchNo: this.filterQuery.batchNo,
|
|
|
|
|
zczbhhzbapzbh: this.filterQuery.zczbhhzbapzbh,
|
|
|
|
|
manufacturer: this.filterQuery.manufacturer,
|
|
|
|
|
actionType: this.filterQuery.actionType,
|
|
|
|
|
keyWords: this.filterQuery.keyWords,
|
|
|
|
|
mainAction: this.filterQuery.mainAction,
|
|
|
|
|
action: this.filterQuery.action
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (this.filterQuery.actionType == 'preInDetail') {
|
|
|
|
|
printParams.invCode = '1000001'
|
|
|
|
|
} else if (this.filterQuery.actionType == 'preDetail') {
|
|
|
|
|
printParams.invCode = '1000002'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.actDateRange !== null) {
|
|
|
|
|
printParams.startAduditTime = this.actDateRange[0];
|
|
|
|
|
printParams.endAduditTime = this.actDateRange[1];
|
|
|
|
|
} else {
|
|
|
|
|
printParams.startAduditTime = null;
|
|
|
|
|
printParams.endAduditTime = null;
|
|
|
|
|
}
|
|
|
|
|
excelInoutImport(printParams).then((response) => {
|
|
|
|
|
let blob = new Blob([response], {type: "application/vnd.ms-excel"});
|
|
|
|
|
let url = window.URL.createObjectURL(blob); // 创建一个临时的url指向blob对象
|
|
|
|
|
let a = document.createElement("a");
|
|
|
|
|
a.href = url;
|
|
|
|
|
a.click();
|
|
|
|
|
this.$message("成功")
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
components:{
|
|
|
|
|
deptDeviceDetail
|
|
|
|
|