| | |
| | | <el-form-item label=""> |
| | | <el-button type="primary" @click="fnCanelPrintRed()">撤销生成(红字)</el-button> |
| | | </el-form-item> |
| | | <el-form-item label=""> |
| | | <el-button type="success" @click="manualSync()">手动同步</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table :data="tableData" border style="width: 100%" row-key="finterid" @selection-change="handleSelectionChange" max-height="650"> |
| | | <el-table-column type="selection" > |
| | |
| | | }); |
| | | return ; |
| | | } |
| | | // 打印前确认 |
| | | if (izPrint === '是') { |
| | | ElementPlus.ElMessageBox.confirm('确定打印吗?') |
| | | .then(() => { |
| | | print(izPrint,0) |
| | | print(izPrint, 0); |
| | | }) |
| | | .catch(() => { |
| | | // catch error |
| | | }) |
| | | // 取消 |
| | | }); |
| | | } else { |
| | | print(izPrint, 0); |
| | | } |
| | | } |
| | | |
| | | // 手动同步 |
| | | function manualSync() { |
| | | if (selectList.value.length === 0){ |
| | | ElementPlus.ElMessage({ |
| | | message: "请先选择要同步的数据", |
| | | type: 'error' |
| | | }); |
| | | return ; |
| | | } |
| | | |
| | | ElementPlus.ElMessageBox.confirm('确定要同步选中的数据到WMS吗?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const loading = ElementPlus.ElLoading.service({ |
| | | lock: true, |
| | | text: '同步中...', |
| | | background: 'rgba(0, 0, 0, 0.7)', |
| | | }); |
| | | |
| | | // 构建同步参数(使用当前查询条件) |
| | | const syncParams = { |
| | | startDate: null, |
| | | endDate: null |
| | | }; |
| | | |
| | | if (tableSearchParam.value.fplancommitdate) { |
| | | const date = new Date(tableSearchParam.value.fplancommitdate); |
| | | syncParams.startDate = date.toISOString().split('T')[0]; |
| | | syncParams.endDate = date.toISOString().split('T')[0]; |
| | | } |
| | | |
| | | $.ajax({ |
| | | url: "http://127.0.0.1:8133/api/materialReceive/sync/manual", |
| | | headers: { |
| | | 'token': localStorage.getItem('token') |
| | | }, |
| | | data: syncParams, |
| | | method: 'GET', |
| | | success: function(res) { |
| | | loading.close(); |
| | | if (res.code == 200) { |
| | | ElementPlus.ElMessage({ |
| | | message: res.data.message || "同步任务已提交", |
| | | type: 'success' |
| | | }); |
| | | // 刷新列表 |
| | | setTimeout(() => { |
| | | page(); |
| | | }, 2000); |
| | | } else { |
| | | ElementPlus.ElMessage({ |
| | | message: res.msg || "同步失败", |
| | | type: 'error' |
| | | }); |
| | | } |
| | | }, |
| | | error: function() { |
| | | loading.close(); |
| | | ElementPlus.ElMessage({ |
| | | message: "同步请求失败", |
| | | type: 'error' |
| | | }); |
| | | } |
| | | }); |
| | | }).catch(() => { |
| | | // 取消 |
| | | }); |
| | | } |
| | | |
| | | function fnPrintView(izPrint){ |
| | |
| | | }); |
| | | return ; |
| | | } |
| | | print(izPrint,0) |
| | | // 打印预览直接调用打印接口(后端不校验出库完成状态) |
| | | print(izPrint, 0); |
| | | } |
| | | |
| | | function fnPrintRedView(izPrint) { |
| | |
| | | }); |
| | | return ; |
| | | } |
| | | // 打印预览直接调用打印接口(后端不校验出库完成状态) |
| | | print(izPrint,1); |
| | | } |
| | | |
| | |
| | | }); |
| | | return ; |
| | | } |
| | | ElementPlus.ElMessageBox.confirm('确定红字打印吗?') |
| | | // 打印前确认 |
| | | if (izPrint === '是') { |
| | | ElementPlus.ElMessageBox.confirm('确定打印吗?') |
| | | .then(() => { |
| | | print(izPrint,1); |
| | | }) |
| | | .catch(() => { |
| | | // catch error |
| | | }) |
| | | |
| | | // 取消 |
| | | }); |
| | | } else { |
| | | print(izPrint, 1); |
| | | } |
| | | } |
| | | |
| | | function print(izPrint,izRed){ |
| | |
| | | type: 'success' |
| | | }); |
| | | page() |
| | | LODOP.PRINT_INITA(0,0,800,1100,"生产领料单"); |
| | | LODOP.PRINT_INITA(0,0,800,1100,"生成领料单"); |
| | | LODOP.SET_PRINT_PAGESIZE(1,0,0,"A4"); |
| | | LODOP.SET_PRINT_MODE("PRINT_NOCOLLATE",1); |
| | | if(izRed==1) |
| | | { |
| | | LODOP.ADD_PRINT_TEXT(28,268,331,36,"生产领料单(红字)"); |
| | | LODOP.ADD_PRINT_TEXT(28,268,331,36,"生成领料单(红字)"); |
| | | } |
| | | else{ |
| | | LODOP.ADD_PRINT_TEXT(28,268,331,36,"生产领料单"); |
| | | LODOP.ADD_PRINT_TEXT(28,268,331,36,"生成领料单"); |
| | | } |
| | | |
| | | |
| | | LODOP.SET_PRINT_STYLEA(0,"FontSize",20); |
| | | LODOP.SET_PRINT_STYLEA(0,"ItemType",1); |
| | | LODOP.ADD_PRINT_TEXT(69,21,213,25,"生产线:"+depName.value); |
| | |
| | | LODOP.SET_PRINT_STYLEA(0,"ItemType",1); |
| | | LODOP.ADD_PRINT_TABLE(96,16,2000,960,CreateTable(res.data)); |
| | | LODOP.SET_PRINT_STYLEA(0,"TableHeightScope",1); |
| | | |
| | | LODOP.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW",true); |
| | | |
| | | if(izPrint=="是") |
| | | { |
| | | LODOP.PRINT(); |
| | |
| | | else{ |
| | | LODOP.PREVIEW(); |
| | | } |
| | | |
| | | |
| | | // LODOP.PRINT_DESIGN(); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | ElementPlus.ElMessage({ |
| | | message: res.msg, |
| | | // 后端返回错误信息(校验失败) |
| | | ElementPlus.ElMessageBox.alert(res.msg || "打印失败", '错误', { |
| | | confirmButtonText: '确定', |
| | | type: 'error' |
| | | }); |
| | | } |
| | | }, |
| | | error: function(xhr, status, error) { |
| | | loading.close() |
| | | ElementPlus.ElMessage({ |
| | | message: "打印请求失败,请稍后重试", |
| | | type: 'error' |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | |
| | | fnCanelPrintRed, |
| | | fnPrintRed, |
| | | fnPrintRedView, |
| | | manualSync, |
| | | handleSizeChange, |
| | | handleCurrentChange, |
| | | handleSelectionChange |