add:退料入库
This commit is contained in:
@@ -129,6 +129,19 @@
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer"><el-button type="primary" @click="viewShow = false">关闭</el-button></div>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
title="打印预览"
|
||||
:visible.sync="printPreviewVisible"
|
||||
width="700px"
|
||||
@close="closePrintPreview"
|
||||
>
|
||||
<iframe ref="printIframe" src="about:blank" style="width: 100%; height: 500px; border: 1px solid #ddd;" />
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="info" @click="printPreviewVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="doPrint">打印</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="inventoryLoading" title="仓库分配" width="820px" :close-on-click-modal="false" @close="closeAllocateDialog">
|
||||
<div style="margin-bottom:10px;color:#606266;font-size:13px;">
|
||||
物料编码:<strong>{{ currentReturn.sku_code }}</strong> |
|
||||
@@ -155,7 +168,8 @@ import rrOperation from '@crud/RR.operation.vue'
|
||||
import crudOperation from '@crud/CRUD.operation.vue'
|
||||
import udOperation from '@crud/UD.operation.vue'
|
||||
import pagination from '@crud/Pagination.vue'
|
||||
import {allocate, upload} from '@/views/wms/pm_manage/pmReturn/pmReturn'
|
||||
import QRCode from 'qrcode'
|
||||
import { allocate, upload } from '@/views/wms/pm_manage/pmReturn/pmReturn'
|
||||
|
||||
const createDefaultForm = () => ({
|
||||
id: '',
|
||||
@@ -202,10 +216,11 @@ export default {
|
||||
selectedInventory: '',
|
||||
allocateSaving: false,
|
||||
actionDisabled: true,
|
||||
printPreviewVisible: false,
|
||||
permission: {
|
||||
add: ['admin', 'pmReturn:add'],
|
||||
edit: ['admin', 'pmReturn:edit'],
|
||||
del: ['admin', 'pmReturn:del']
|
||||
add: ['pmReturn:add'],
|
||||
edit: ['pmReturn:edit'],
|
||||
del: ['pmReturn:del']
|
||||
},
|
||||
statusOptions: [
|
||||
{ value: 0, label: '生成' },
|
||||
@@ -317,8 +332,8 @@ export default {
|
||||
}
|
||||
this.currentReturn.targetHouseCode = this.selectedInventory
|
||||
allocate(this.currentReturn).then(res => {
|
||||
if (res.code == 400){
|
||||
this.$message.warning('分配失败'+res.message)
|
||||
if (res.code == 400) {
|
||||
this.$message.warning('分配失败' + res.message)
|
||||
return
|
||||
}
|
||||
this.$message.success('分配成功')
|
||||
@@ -343,8 +358,8 @@ export default {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
upload(this.multipleSelection[0]).then(res => {
|
||||
if (res.code == 400){
|
||||
this.$message.warning('分配失败'+res.message)
|
||||
if (res.code == 400) {
|
||||
this.$message.warning('分配失败' + res.message)
|
||||
return
|
||||
}
|
||||
this.$message.success('下推成功')
|
||||
@@ -366,10 +381,72 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.crud.notify('当前项目暂未接入打印接口', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
this.printPreviewVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.renderPrintContent(selections)
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
async renderPrintContent(dtlList) {
|
||||
const iframe = this.$refs.printIframe
|
||||
if (!iframe) return
|
||||
const doc = iframe.contentDocument || (iframe.contentWindow && iframe.contentWindow.document)
|
||||
if (!doc) {
|
||||
setTimeout(() => this.renderPrintContent(dtlList), 100)
|
||||
return
|
||||
}
|
||||
let html = '<!DOCTYPE html><html><head><meta charset="utf-8"><style>'
|
||||
html += '*{margin:0;padding:0;box-sizing:border-box}'
|
||||
html += 'body{font-family:"Microsoft YaHei",Arial,sans-serif;padding:10px}'
|
||||
html += '.label{page-break-after:always;padding:10px;text-align:center;}'
|
||||
html += '.label:last-child{page-break-after:auto}'
|
||||
html += 'h3{text-align:center;font-size:13px;margin-bottom:3px}'
|
||||
html += 'table{width:463px;border-collapse:collapse;margin:0 auto;height:224px}'
|
||||
html += 'td{padding:3px 5px;border:2px solid #333;font-size:17px}'
|
||||
html += '.lbl{width:25%;text-align:right;background:#f9f9f9}'
|
||||
html += '.val{width:45%;text-align:left}'
|
||||
html += '.qr{width:30%;text-align:center;vertical-align:middle}'
|
||||
html += '@media print{@page{size:auto;margin:5mm}}'
|
||||
html += '</style></head><body>'
|
||||
for (const dtl of dtlList) {
|
||||
const orderNo = dtl.orderCode || ''
|
||||
const itemNo = dtl.serialNo || ''
|
||||
const skuCode = dtl.skuCode || ''
|
||||
const skuName = dtl.skuName || ''
|
||||
const house_code = dtl.targetHouseCode || ''
|
||||
const qty = dtl.qty || ''
|
||||
// const qrText = orderNo + '#' + itemNo + '#' + skuCode + '#' + skuName + '##' + qty + '#'
|
||||
const qrText = dtl.orderCode
|
||||
const imgSrc = await QRCode.toDataURL(qrText, {
|
||||
width: 300
|
||||
})
|
||||
html += '<div class="label">'
|
||||
html += '<h3>上海诺力</h3>'
|
||||
html += '<table>'
|
||||
html += '<tr><td class="lbl">单据号</td><td class="val">' + orderNo + '</td><td class="qr" rowspan="6"><img src="' + imgSrc + '" width="150" height="150" /></td></tr>'
|
||||
html += '<tr><td class="lbl">行号</td><td class="val">' + itemNo + '</td></tr>'
|
||||
html += '<tr><td class="lbl">物料编码</td><td class="val">' + skuCode + '</td></tr>'
|
||||
html += '<tr><td class="lbl">物料名称</td><td class="val">' + skuName + '</td></tr>'
|
||||
html += '<tr><td class="lbl">数量</td><td class="val">' + qty + '</td></tr>'
|
||||
html += '<tr><td class="lbl">仓库</td><td class="val">' + house_code + '</td></tr>'
|
||||
html += '</table></div>'
|
||||
}
|
||||
html += '</body></html>'
|
||||
doc.open()
|
||||
doc.write(html)
|
||||
doc.close()
|
||||
},
|
||||
doPrint() {
|
||||
const iframe = this.$refs.printIframe
|
||||
if (!iframe) return
|
||||
iframe.contentWindow.focus()
|
||||
iframe.contentWindow.print()
|
||||
},
|
||||
closePrintPreview() {
|
||||
this.printPreviewVisible = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user