From edf64b592678b236464c974fe467b6ef409a07a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Mon, 28 Aug 2023 14:27:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=91=E5=AE=A4=E8=AE=BE=E5=A4=87=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/inventory/deptDevice.js | 4 +- src/api/inventory/deviceReceiveOrder.js | 18 ++ src/views/inventory/DeptDeviceDetail.vue | 23 +- src/views/inventory/DeviceModelDetail.vue | 146 +++++++++++ src/views/inventory/DeviceReceiveOrderNew.vue | 236 ++++++++++-------- 5 files changed, 311 insertions(+), 116 deletions(-) create mode 100644 src/views/inventory/DeviceModelDetail.vue diff --git a/src/api/inventory/deptDevice.js b/src/api/inventory/deptDevice.js index 592dac1c..479297e6 100644 --- a/src/api/inventory/deptDevice.js +++ b/src/api/inventory/deptDevice.js @@ -26,7 +26,7 @@ export function deleteDeptDevice(data) { export function verifyTemplateFile(data) { return axios({ - url: "/device/receive/order/verifyTemplateFile", + url: "/udiwms/inv/deptDevice/verifyTemplateFile", method: "post", data: data }); @@ -34,7 +34,7 @@ export function verifyTemplateFile(data) { export function printOrder(data) { return axios({ - url: "/device/receive/order/printOrder", + url: "/udiwms/inv/deptDevice/printOrder", method: "post", data: data, headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}, diff --git a/src/api/inventory/deviceReceiveOrder.js b/src/api/inventory/deviceReceiveOrder.js index d7cff2c8..44c9feeb 100644 --- a/src/api/inventory/deviceReceiveOrder.js +++ b/src/api/inventory/deviceReceiveOrder.js @@ -112,5 +112,23 @@ export function selectProduct(data) { }); } +export function verifyTemplateFile(data) { + return axios({ + url: "/device/receive/order/verifyTemplateFile", + method: "post", + data: data + }); +} + +export function printOrder(data) { + return axios({ + url: "/device/receive/order/printOrder", + method: "post", + data: data, + headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}, + responseType: 'arraybuffer', //一定要设置响应类型,否则页面会是空白pdf + }); +} + diff --git a/src/views/inventory/DeptDeviceDetail.vue b/src/views/inventory/DeptDeviceDetail.vue index 0942a162..ac59cc19 100644 --- a/src/views/inventory/DeptDeviceDetail.vue +++ b/src/views/inventory/DeptDeviceDetail.vue @@ -165,6 +165,10 @@ + { this.selectedRowData = row // 将选中的行数据保存到 selectedRow 变量中 - // this.selectedRowData.editType=1; - console.log("1111") - console.log(this.selectedRowData) - // - // }) + this.isInformation = false + this.$nextTick(() => { + //重新加载组件 + this.isInformation = true + }); + }, keyup_submit(event) { this.filterQuery.page = 1; @@ -527,7 +531,8 @@ export default { checkResultPanel, technical, deptDeviceModifyDialog, - inspectSetModifyDialog + inspectSetModifyDialog, + DeviceModelDetail }, created() { this.getDeptList(); diff --git a/src/views/inventory/DeviceModelDetail.vue b/src/views/inventory/DeviceModelDetail.vue new file mode 100644 index 00000000..a5519cff --- /dev/null +++ b/src/views/inventory/DeviceModelDetail.vue @@ -0,0 +1,146 @@ + + + + + diff --git a/src/views/inventory/DeviceReceiveOrderNew.vue b/src/views/inventory/DeviceReceiveOrderNew.vue index b7f4f69f..76b63164 100644 --- a/src/views/inventory/DeviceReceiveOrderNew.vue +++ b/src/views/inventory/DeviceReceiveOrderNew.vue @@ -78,20 +78,9 @@ @@ -127,19 +116,19 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + { + printOrder(row) { + let query = {id: 5}; + this.loading = true; + verifyTemplateFile(query).then((res) => { if (res.code === 20000) { - this.$message.success("提交成功!"); - this.getList(); + let printParams = { + templateId: res.data, + id: row.id + }; + 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); - }); - }, - deleteDialog(rowId) { - this.$confirm('此操作将永久删除该领用记录, 是否继续?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - let params = {id: rowId}; - this.loading = true; - deleteDeviceReceiveOrder(params).then((res) => { - this.loading = false; - if (res.code === 20000) { - this.$message.success("删除成功!"); - this.getList(); - this.detailList = [] - } else { - this.$message.error(res.message); - } - }).catch(() => { - this.loading = false; - }); - }); - }, - closeDialog() { - this.formVisible = false; - this.getList(); - }, - datailSelect(row) { - this.detailQuery = row - this.deviceProjectSelectVisible = true - }, - handleChange(row) { - this.detailQuery.orderIdFk = row.orderId; - this.detailQuery.page = 1; - this.getDetailList(); + }) }, - getDetailList() { - getDeviceReceiveOrderDetailList(this.detailQuery).then((res) => { + addReceiveOrder() { + this.formVisible = true; + this.formName = 'add'; + this.deviceReceiveOrder = {}; + }, + editOrder(row) { + this.formVisible = true; + this.formName = 'edit'; + this.deviceReceiveOrder = row; + }, + submitAudit(row) { + let params = {id: row.id}; + submitAudit(params).then((res) => { + if (res.code === 20000) { + this.$message.success("提交成功!"); + this.getList(); + } else { + this.$message.error(res.message); + } + }).catch((error) => { + this.$message.error(error.message); + }); + }, + deleteDialog(rowId) { + this.$confirm('此操作将永久删除该领用记录, 是否继续?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + let params = {id: rowId}; + this.loading = true; + deleteDeviceReceiveOrder(params).then((res) => { + this.loading = false; if (res.code === 20000) { - this.detailList = res.data.list || []; - this.detailTotal = res.data.total || 0; + this.$message.success("删除成功!"); + this.getList(); + this.detailList = [] } else { - this.detailList = []; - this.detailTotal = 0; + this.$message.error(res.message); } }).catch(() => { - this.detailList = []; - this.detailTotal = 0; + this.loading = false; }); - }, + }); }, - components: { - deviceReceiveOrderModify + closeDialog() { + this.formVisible = false; + this.getList(); }, - mounted() { - document.body.ondrop = function (event) { - event.preventDefault(); - event.stopPropagation(); - }; + datailSelect(row) { + this.detailQuery = row + this.deviceProjectSelectVisible = true }, - created() { - //查询配置项 - getConfig().then((res) => { - if (res.code == 20000 && !isBlank(res.data.paramValue)) { - this.paramValue = res.data.paramValue + handleChange(row) { + this.detailQuery.orderIdFk = row.orderId; + this.detailQuery.page = 1; + this.getDetailList(); + }, + getDetailList() { + getDeviceReceiveOrderDetailList(this.detailQuery).then((res) => { + if (res.code === 20000) { + this.detailList = res.data.list || []; + this.detailTotal = res.data.total || 0; + } else { + this.detailList = []; + this.detailTotal = 0; } - }) - this.getDeptList(); + }).catch(() => { + this.detailList = []; + this.detailTotal = 0; + }); }, -}; +} +, +components: { + deviceReceiveOrderModify +} +, +mounted() +{ + document.body.ondrop = function (event) { + event.preventDefault(); + event.stopPropagation(); + }; +} +, +created() +{ + //查询配置项 + getConfig().then((res) => { + if (res.code == 20000 && !isBlank(res.data.paramValue)) { + this.paramValue = res.data.paramValue + } + }) + this.getDeptList(); +} +, +} +;