| | |
| | | :tableLoading="tableLoading" |
| | | @pagination="pagination"></PIMTable> |
| | | </div> |
| | | <el-dialog v-model="qrDialogVisible" |
| | | title="二维码" |
| | | width="300px"> |
| | | <div style="text-align:center;"> |
| | | <img :src="qrCodeUrl" |
| | | alt="二维码" |
| | | style="width:200px;height:200px;" /> |
| | | <div style="margin:10px 0;"> |
| | | <el-button type="primary" |
| | | @click="downloadQRCode">下载二维码图片</el-button> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog v-model="editDialogVisible" |
| | | title="编辑时间" |
| | | width="500px"> |
| | |
| | | ]); |
| | | const tableData = ref([]); |
| | | const tableLoading = ref(false); |
| | | const qrDialogVisible = ref(false); |
| | | const qrCodeUrl = ref(""); |
| | | const qrRowData = ref(null); |
| | | const editDialogVisible = ref(false); |
| | |
| | | remainingQuantity: 0, |
| | | quantity: 0, |
| | | userName: "", |
| | | workOrderId: "", |
| | | reportWork: "", |
| | | productProcessRouteItemId: "", |
| | | userId: "", |
| | | }); |
| | | const currentReportRowData = ref(null); |
| | | const page = reactive({ |
| | |
| | | tableLoading.value = false; |
| | | }); |
| | | }; |
| | | const showQRCode = async row => { |
| | | // 直接使用URL,不要用JSON.stringify包装 |
| | | const qrContent = proxy.javaApi + "/device-info?deviceId=" + row.id; |
| | | qrCodeUrl.value = await QRCode.toDataURL(qrContent); |
| | | qrRowData.value = row; |
| | | qrDialogVisible.value = true; |
| | | }; |
| | | const downloadQRCode = () => { |
| | | const link = document.createElement("a"); |
| | | link.href = qrCodeUrl.value; |
| | | link.download = `二维码_${qrRowData.value.id}.png`; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | }; |
| | | |
| | | const showTransferCard = async row => { |
| | | transferCardRowData.value = row; |
| | |
| | | reportForm.remainingQuantity = 1; |
| | | reportForm.quantity = 0; |
| | | reportForm.productProcessRouteItemId = row.productProcessRouteItemId; |
| | | reportForm.workOrderId = row.id; |
| | | reportForm.reportWork = row.reportWork; |
| | | // 获取当前登录用户信息 |
| | | |
| | | reportDialogVisible.value = true; |
| | |
| | | }); |
| | | return; |
| | | } |
| | | // console.log(reportForm); |
| | | addProductMain(reportForm).then(res => { |
| | | if (res.code === 200) { |
| | | proxy.$modal.msgSuccess("报工成功"); |