|
|
|
@ -40,6 +40,18 @@
|
|
|
|
|
<el-table-column label="领用记录号" prop="collOrderId" width="180"></el-table-column>
|
|
|
|
|
<el-table-column label="养护日期" prop="createTime" width="180"></el-table-column>
|
|
|
|
|
<el-table-column label="养护人" prop="createUser" width="120"></el-table-column>
|
|
|
|
|
<el-table-column label="养护备注" prop="remark" width="120"></el-table-column>
|
|
|
|
|
<el-table-column label="操作" width="180" fixed="right">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
type="text"
|
|
|
|
|
size="small"
|
|
|
|
|
@click.native.stop="print(scope.row)"
|
|
|
|
|
>打印
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<el-pagination
|
|
|
|
@ -103,7 +115,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {getDeviceMAOrderList, getDeviceMAOrderDetailList} from "@/api/inventory/deviceMAOrder";
|
|
|
|
|
import {getDeviceMAOrderList, getDeviceMAOrderDetailList, verifyTemplateFile, printOrder} from "@/api/inventory/deviceMAOrder";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
@ -201,6 +213,35 @@ export default {
|
|
|
|
|
this.detailTotal = 0;
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
print(row) {
|
|
|
|
|
let query = {moduleId: 7};
|
|
|
|
|
this.loading = true;
|
|
|
|
|
verifyTemplateFile(query).then((res) => {
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
let printParams = {
|
|
|
|
|
templateId: res.data,
|
|
|
|
|
orderId: row.orderId
|
|
|
|
|
};
|
|
|
|
|
printOrder(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.loading = false;
|
|
|
|
|
this.$message.error(res.message);
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.$message.error(error.message);
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getList();
|
|
|
|
|