add:同步eas平库库存功能;
opt:出入库单据模块
This commit is contained in:
377
nladmin-ui/src/views/wms/pm_manage/allocationIn/index.vue
Normal file
377
nladmin-ui/src/views/wms/pm_manage/allocationIn/index.vue
Normal file
@@ -0,0 +1,377 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form :inline="true" class="demo-form-inline" label-position="right" label-width="80px" label-suffix=":">
|
||||
<el-form-item label="模糊查询">
|
||||
<el-input
|
||||
v-model="query.blurry"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="单据号/订单号/供应商"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据编号">
|
||||
<el-input
|
||||
v-model="query.bill_id"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="单据编号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号">
|
||||
<el-input
|
||||
v-model="query.order_no"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="订单号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商">
|
||||
<el-input
|
||||
v-model="query.supplier_name"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="供应商名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态">
|
||||
<el-select
|
||||
v-model="query.bill_status"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option v-for="item in billStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-s-promotion"
|
||||
size="mini"
|
||||
:disabled="audit_flag"
|
||||
@click="issueReturnBill"
|
||||
>下发回传单
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-printer"
|
||||
size="mini"
|
||||
:disabled="audit_flag"
|
||||
@click="printBill"
|
||||
>打印
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
size="mini"
|
||||
:data="crud.data"
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="handleCurrentChange"
|
||||
@select="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column
|
||||
v-permission="['admin','purchasemst:del','purchasemst:edit']"
|
||||
label="操作"
|
||||
width="115"
|
||||
align="center"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:disabled-edit="canUd(scope.row)"
|
||||
:disabled-dle="canUd(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="bill_id" width="160" label="单据编号">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_id }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="order_no" width="150" label="订单号" />
|
||||
<el-table-column show-overflow-tooltip prop="order_type" width="100" label="订单类型" />
|
||||
<el-table-column :formatter="billStatusFormat" prop="bill_status" width="100" label="单据状态" />
|
||||
<el-table-column label="明细数" align="center" prop="dtl_count" width="80" />
|
||||
<el-table-column label="单据总数" align="center" prop="total_qty" width="80" />
|
||||
<el-table-column label="入库数量" align="center" prop="instock_qty" width="80" />
|
||||
<el-table-column label="转发中鼎" align="center" prop="forwardZD" width="80">
|
||||
<template slot-scope="scope">
|
||||
<p v-if="scope.row.forwardZD == '0'">-</p>
|
||||
<template v-else-if="scope.row.forwardZD == '1'">
|
||||
<el-popconfirm
|
||||
confirm-button-text="是"
|
||||
cancel-button-text="否"
|
||||
icon="el-icon-info"
|
||||
icon-color="red"
|
||||
title="是否重新转发中鼎?"
|
||||
@confirm="toForwardZD(scope.row)"
|
||||
>
|
||||
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
<p v-else>成功</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="supplier_code" width="120" label="供应商编码" />
|
||||
<el-table-column show-overflow-tooltip prop="supplier_name" width="150" label="供应商名称" />
|
||||
<el-table-column show-overflow-tooltip prop="creator" width="100" label="创建人" />
|
||||
<el-table-column show-overflow-tooltip prop="create_time" width="150" label="创建时间">
|
||||
<template slot-scope="scope">{{ formatDate(scope.row.create_time) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="modify_date" width="150" label="修改时间">
|
||||
<template slot-scope="scope">{{ formatDate(scope.row.modify_date) }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<ViewDialog :dialog-show.sync="viewShow" :row-mst="mstrow" @AddChanged="querytable" />
|
||||
<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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudPurchase from '@/views/wms/pm_manage/allocationIn/purchase'
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import AddDialog from '@/views/wms/pm_manage/purchase/AddDialog'
|
||||
import ViewDialog from '@/views/wms/pm_manage/purchase/ViewDialog'
|
||||
import QRCode from 'qrcode'
|
||||
|
||||
export default {
|
||||
name: 'AllocationIn',
|
||||
components: { AddDialog, ViewDialog, crudOperation, rrOperation, udOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '调拨入库单',
|
||||
optShow: { add: true, reset: true },
|
||||
idField: 'id',
|
||||
url: '/api/purchasemst/107',
|
||||
crudMethod: { ...crudPurchase },
|
||||
queryOnPresenterCreated: true
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
add: ['admin', 'purchasemst:add'],
|
||||
edit: ['admin', 'purchasemst:edit'],
|
||||
del: ['admin', 'purchasemst:del']
|
||||
},
|
||||
viewShow: false,
|
||||
mstrow: {},
|
||||
currentRow: null,
|
||||
audit_flag: true,
|
||||
printPreviewVisible: false,
|
||||
billStatusOptions: [{ value: '0', label: '已创建' }, { value: '1', label: '执行中' }, { value: '2', label: '已完成' }]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
canUd(row) {
|
||||
return row.bill_status !== '0'
|
||||
},
|
||||
billStatusFormat(row) {
|
||||
return ({ '0': '已创建', '1': '执行中', '2': '已完成' })[row.bill_status] || row.bill_status
|
||||
},
|
||||
formatDate(val) {
|
||||
if (!val) return ''
|
||||
if (typeof val === 'string') return val
|
||||
const d = new Date(val)
|
||||
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')} ${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}:${String(d.getSeconds()).padStart(2, '0')}`
|
||||
},
|
||||
toForwardZD(row) {
|
||||
crudPurchase.pushZD({
|
||||
billid: row.bill_id,
|
||||
orderNo: row.order_no,
|
||||
orderType: row.order_type,
|
||||
red: row.red,
|
||||
status: row.status
|
||||
})
|
||||
}, toView(index, row) {
|
||||
this.mstrow = row
|
||||
this.viewShow = true
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
this.audit_flag = val.length == 0
|
||||
},
|
||||
handleCurrentChange(currentRow) {
|
||||
this.currentRow = currentRow || {}
|
||||
this.audit_flag = this.crud.selections.length === 0
|
||||
},
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
issueReturnBill() {
|
||||
const selections = this.crud.selections
|
||||
if (!selections || selections.length === 0) {
|
||||
this.crud.notify('请至少选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
const ids = selections.map(s => s.id)
|
||||
const billIds = selections.map(s => s.bill_id).join('、')
|
||||
this.$confirm('确认下发以下单据的回传单?\n' + billIds, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudPurchase.issueReturnBill(ids).then(() => {
|
||||
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}).catch(() => {
|
||||
this.crud.notify('下发失败', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
printBill() {
|
||||
const selections = this.crud.selections
|
||||
if (!selections || selections.length === 0) {
|
||||
this.crud.notify('请至少选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
const billIds = selections.map(s => s.order_no).join('、')
|
||||
this.$confirm('确认打印以下单据的物料标签?\n' + billIds, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.fetchDetailsAndPrint(selections)
|
||||
}).catch(() => {})
|
||||
},
|
||||
fetchDetailsAndPrint(selections) {
|
||||
const promises = selections.map(bill => {
|
||||
return crudPurchase.get(bill.id).then(res => {
|
||||
const dtlList = (res && res.data && res.data.tableData) || []
|
||||
return dtlList.map(dtl => ({
|
||||
...dtl,
|
||||
order_no: bill.order_no,
|
||||
bill_id: bill.bill_id
|
||||
}))
|
||||
})
|
||||
})
|
||||
Promise.all(promises).then(results => {
|
||||
const allDtls = results.reduce((acc, cur) => acc.concat(cur), [])
|
||||
if (allDtls.length === 0) {
|
||||
this.crud.notify('未查询到明细数据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.printPreviewVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.renderPrintContent(allDtls)
|
||||
})
|
||||
}).catch(() => {
|
||||
this.crud.notify('查询明细失败', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
})
|
||||
},
|
||||
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:100%;border-collapse:collapse;margin:0 auto;max-width:450px}'
|
||||
html += 'td{padding:3px 5px;border:2px solid #333;font-size:13px}'
|
||||
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.order_no || ''
|
||||
const itemNo = dtl.item_no || ''
|
||||
const skuCode = dtl.sku_code || ''
|
||||
const skuName = dtl.sku_name || ''
|
||||
const qty = dtl.qty || ''
|
||||
const qrText = orderNo + '#' + itemNo + '#' + skuCode + '#' + skuName + '##' + qty + '#'
|
||||
const imgSrc = await QRCode.toDataURL(qrText, {
|
||||
width: 200
|
||||
})
|
||||
html += '<div class="label">'
|
||||
html += '<h3>上海诺力</h3>'
|
||||
html += '<table>'
|
||||
html += '<tr><td class="lbl">订单号</td><td class="val">' + orderNo + '</td><td class="qr" rowspan="5"><img src="' + imgSrc + '" width="100" height="100" /></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 += '</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>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
58
nladmin-ui/src/views/wms/pm_manage/allocationIn/purchase.js
Normal file
58
nladmin-ui/src/views/wms/pm_manage/allocationIn/purchase.js
Normal file
@@ -0,0 +1,58 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: '/api/purchasemst',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function get(id) {
|
||||
return request({
|
||||
url: '/api/purchasemst/107/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function issueReturnBill(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst/issueReturnBill',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function print(ids) {
|
||||
return request({
|
||||
url: '/api/purchasemst/print',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function pushZD(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst/pushZD',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, get, issueReturnBill, print, pushZD }
|
||||
205
nladmin-ui/src/views/wms/pm_manage/allocationOut/index.vue
Normal file
205
nladmin-ui/src/views/wms/pm_manage/allocationOut/index.vue
Normal file
@@ -0,0 +1,205 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form :inline="true" class="demo-form-inline" label-position="right" label-width="80px" label-suffix=":">
|
||||
<el-form-item label="模糊查询">
|
||||
<el-input v-model="query.blurry" size="mini" clearable placeholder="单据号/订单号/供应商" @keyup.enter.native="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="query.bill_id" size="mini" clearable placeholder="单据编号" @keyup.enter.native="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号">
|
||||
<el-input v-model="query.order_no" size="mini" clearable placeholder="订单号" @keyup.enter.native="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商">
|
||||
<el-input v-model="query.supplier_name" size="mini" clearable placeholder="供应商名称" @keyup.enter.native="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态">
|
||||
<el-select v-model="query.bill_status" clearable size="mini" placeholder="全部" class="filter-item" @change="crud.toQuery">
|
||||
<el-option v-for="item in billStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker v-model="query.createTime" type="daterange" value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" @change="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button slot="right" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">下发回传单</el-button>
|
||||
</crudOperation>
|
||||
<el-table ref="table" v-loading="crud.loading" size="mini" :data="crud.data" highlight-current-row style="width: 100%;" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange" @select="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-permission="['admin','purchasemst:del','purchasemst:edit']" label="操作" width="115" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation :data="scope.row" :permission="permission" :disabled-edit="canUd(scope.row)" :disabled-dle="canUd(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="bill_id" width="160" label="单据编号">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_id }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="order_no" width="150" label="订单号" />
|
||||
<el-table-column show-overflow-tooltip prop="order_type" width="100" label="订单类型" />
|
||||
<el-table-column :formatter="billStatusFormat" prop="bill_status" width="100" label="单据状态" />
|
||||
<el-table-column label="明细数" align="center" prop="dtl_count" width="80" />
|
||||
<el-table-column label="单据总数" align="center" prop="total_qty" width="80" />
|
||||
<el-table-column label="入库数量" align="center" prop="instock_qty" width="80" />
|
||||
<el-table-column label="转发中鼎" align="center" prop="forwardZD" width="80">
|
||||
<template slot-scope="scope">
|
||||
<p v-if="scope.row.forwardZD == '0'">-</p>
|
||||
<template v-else-if="scope.row.forwardZD == '1'">
|
||||
<el-popconfirm confirm-button-text="是" cancel-button-text="否" icon="el-icon-info" icon-color="red" title="是否重新转发中鼎?" @confirm="toForwardZD(scope.row)">
|
||||
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
<p v-else>成功</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="supplier_code" width="120" label="供应商编码" />
|
||||
<el-table-column show-overflow-tooltip prop="supplier_name" width="150" label="供应商名称" />
|
||||
<el-table-column show-overflow-tooltip prop="creator" width="100" label="创建人" />
|
||||
<el-table-column show-overflow-tooltip prop="create_time" width="150" label="创建时间">
|
||||
<template slot-scope="scope">{{ formatDate(scope.row.create_time) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="modify_date" width="150" label="修改时间">
|
||||
<template slot-scope="scope">{{ formatDate(scope.row.modify_date) }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<ViewDialog :dialog-show.sync="viewShow" :row-mst="mstrow" @AddChanged="querytable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudPurchase from '@/views/wms/pm_manage/allocationOut/purchase'
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import AddDialog from '@/views/wms/pm_manage/purchase/AddDialog'
|
||||
import ViewDialog from '@/views/wms/pm_manage/purchase/ViewDialog'
|
||||
|
||||
export default {
|
||||
name: 'AllocationOut',
|
||||
components: { AddDialog, ViewDialog, crudOperation, rrOperation, udOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '调拨出库单',
|
||||
optShow: { add: true, reset: true },
|
||||
idField: 'id',
|
||||
url: '/api/purchasemst/106',
|
||||
crudMethod: { ...crudPurchase },
|
||||
queryOnPresenterCreated: true
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
add: ['admin', 'purchasemst:add'],
|
||||
edit: ['admin', 'purchasemst:edit'],
|
||||
del: ['admin', 'purchasemst:del']
|
||||
},
|
||||
viewShow: false,
|
||||
mstrow: {},
|
||||
currentRow: null,
|
||||
audit_flag: true,
|
||||
billStatusOptions: [
|
||||
{ value: '0', label: '已创建' },
|
||||
{ value: '1', label: '执行中' },
|
||||
{ value: '2', label: '已完成' }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
canUd(row) {
|
||||
return row.bill_status !== '0'
|
||||
},
|
||||
billStatusFormat(row) {
|
||||
const map = { '0': '已创建', '1': '执行中', '2': '已完成' }
|
||||
return map[row.bill_status] || row.bill_status
|
||||
},
|
||||
auditStatusFormat(row) {
|
||||
const map = { '0': '未审核', '1': '已审核' }
|
||||
return map[row.status] || row.status || '-'
|
||||
},
|
||||
formatDate(val) {
|
||||
if (!val) return ''
|
||||
if (typeof val === 'string') return val
|
||||
const d = new Date(val)
|
||||
const y = d.getFullYear()
|
||||
const m = String(d.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(d.getDate()).padStart(2, '0')
|
||||
const h = String(d.getHours()).padStart(2, '0')
|
||||
const min = String(d.getMinutes()).padStart(2, '0')
|
||||
const s = String(d.getSeconds()).padStart(2, '0')
|
||||
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
|
||||
},
|
||||
toForwardZD() {
|
||||
crudPurchase.pushZD({
|
||||
billid: row.bill_id,
|
||||
orderNo: row.order_no,
|
||||
orderType: row.order_type,
|
||||
red: row.red,
|
||||
status: row.status
|
||||
})
|
||||
},
|
||||
toView(index, row) {
|
||||
this.mstrow = row
|
||||
this.viewShow = true
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
console.log(val.length)
|
||||
if (val.length == 0) {
|
||||
this.audit_flag = true
|
||||
} else {
|
||||
this.audit_flag = false
|
||||
}
|
||||
},
|
||||
handleCurrentChange(currentRow) {
|
||||
if (currentRow === null) {
|
||||
this.currentRow = {}
|
||||
} else {
|
||||
this.currentRow = currentRow
|
||||
}
|
||||
this.audit_flag = this.crud.selections.length === 0
|
||||
},
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
issueReturnBill() {
|
||||
const selections = this.crud.selections
|
||||
if (!selections || selections.length === 0) {
|
||||
this.crud.notify('请至少选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
const ids = selections.map(s => s.id)
|
||||
const billIds = selections.map(s => s.bill_id).join('、')
|
||||
this.$confirm('确认下发以下单据的回传单?\n' + billIds, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudPurchase.issueReturnBill(ids).then(() => {
|
||||
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}).catch(() => {
|
||||
this.crud.notify('下发失败', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
})
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
58
nladmin-ui/src/views/wms/pm_manage/allocationOut/purchase.js
Normal file
58
nladmin-ui/src/views/wms/pm_manage/allocationOut/purchase.js
Normal file
@@ -0,0 +1,58 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: '/api/purchasemst',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function get(id) {
|
||||
return request({
|
||||
url: '/api/purchasemst/106/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function issueReturnBill(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst/issueReturnBill',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function print(ids) {
|
||||
return request({
|
||||
url: '/api/purchasemst/print',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function pushZD(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst/pushZD',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, get, issueReturnBill, print, pushZD }
|
||||
325
nladmin-ui/src/views/wms/pm_manage/otherIn/index.vue
Normal file
325
nladmin-ui/src/views/wms/pm_manage/otherIn/index.vue
Normal file
@@ -0,0 +1,325 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form :inline="true" class="demo-form-inline" label-position="right" label-width="80px" label-suffix=":">
|
||||
<el-form-item label="模糊查询">
|
||||
<el-input v-model="query.blurry" size="mini" clearable placeholder="单据号/订单号/供应商" @keyup.enter.native="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="query.bill_id" size="mini" clearable placeholder="单据编号" @keyup.enter.native="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号">
|
||||
<el-input v-model="query.order_no" size="mini" clearable placeholder="订单号" @keyup.enter.native="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商">
|
||||
<el-input v-model="query.supplier_name" size="mini" clearable placeholder="供应商名称" @keyup.enter.native="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态">
|
||||
<el-select v-model="query.bill_status" clearable size="mini" placeholder="全部" class="filter-item" @change="crud.toQuery">
|
||||
<el-option v-for="item in billStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker v-model="query.createTime" type="daterange" value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" @change="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button slot="right" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">下发回传单</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-printer"
|
||||
size="mini"
|
||||
:disabled="audit_flag"
|
||||
@click="printBill"
|
||||
>打印
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<el-table ref="table" v-loading="crud.loading" size="mini" :data="crud.data" highlight-current-row style="width: 100%;" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange" @select="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-permission="['admin','purchasemst:del','purchasemst:edit']" label="操作" width="115" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation :data="scope.row" :permission="permission" :disabled-edit="canUd(scope.row)" :disabled-dle="canUd(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="bill_id" width="160" label="单据编号">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_id }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="order_no" width="150" label="订单号" />
|
||||
<el-table-column show-overflow-tooltip prop="order_type" width="100" label="订单类型" />
|
||||
<el-table-column :formatter="billStatusFormat" prop="bill_status" width="100" label="单据状态" />
|
||||
<el-table-column label="明细数" align="center" prop="dtl_count" width="80" />
|
||||
<el-table-column label="单据总数" align="center" prop="total_qty" width="80" />
|
||||
<el-table-column label="入库数量" align="center" prop="instock_qty" width="80" />
|
||||
<el-table-column label="转发中鼎" align="center" prop="forwardZD" width="80">
|
||||
<template slot-scope="scope">
|
||||
<p v-if="scope.row.forwardZD == '0'">-</p>
|
||||
<template v-else-if="scope.row.forwardZD == '1'">
|
||||
<el-popconfirm confirm-button-text="是" cancel-button-text="否" icon="el-icon-info" icon-color="red" title="是否重新转发中鼎?" @confirm="toForwardZD(scope.row)">
|
||||
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
<p v-else>成功</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="supplier_code" width="120" label="供应商编码" />
|
||||
<el-table-column show-overflow-tooltip prop="supplier_name" width="150" label="供应商名称" />
|
||||
<el-table-column show-overflow-tooltip prop="creator" width="100" label="创建人" />
|
||||
<el-table-column show-overflow-tooltip prop="create_time" width="150" label="创建时间">
|
||||
<template slot-scope="scope">{{ formatDate(scope.row.create_time) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="modify_date" width="150" label="修改时间">
|
||||
<template slot-scope="scope">{{ formatDate(scope.row.modify_date) }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<ViewDialog :dialog-show.sync="viewShow" :row-mst="mstrow" @AddChanged="querytable" />
|
||||
<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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudPurchase from '@/views/wms/pm_manage/otherIn/purchase'
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import AddDialog from '@/views/wms/pm_manage/purchase/AddDialog'
|
||||
import ViewDialog from '@/views/wms/pm_manage/purchase/ViewDialog'
|
||||
import QRCode from 'qrcode'
|
||||
|
||||
export default {
|
||||
name: 'OtherIn',
|
||||
components: { AddDialog, ViewDialog, crudOperation, rrOperation, udOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '其他入库单',
|
||||
optShow: { add: true, reset: true },
|
||||
idField: 'id',
|
||||
url: '/api/purchasemst/109',
|
||||
crudMethod: { ...crudPurchase },
|
||||
queryOnPresenterCreated: true
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
add: ['admin', 'purchasemst:add'],
|
||||
edit: ['admin', 'purchasemst:edit'],
|
||||
del: ['admin', 'purchasemst:del']
|
||||
},
|
||||
viewShow: false,
|
||||
mstrow: {},
|
||||
currentRow: null,
|
||||
audit_flag: true,
|
||||
printPreviewVisible: false,
|
||||
billStatusOptions: [
|
||||
{ value: '0', label: '已创建' },
|
||||
{ value: '1', label: '执行中' },
|
||||
{ value: '2', label: '已完成' }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
canUd(row) {
|
||||
return row.bill_status !== '0'
|
||||
},
|
||||
billStatusFormat(row) {
|
||||
const map = { '0': '已创建', '1': '执行中', '2': '已完成' }
|
||||
return map[row.bill_status] || row.bill_status
|
||||
},
|
||||
auditStatusFormat(row) {
|
||||
const map = { '0': '未审核', '1': '已审核' }
|
||||
return map[row.status] || row.status || '-'
|
||||
},
|
||||
formatDate(val) {
|
||||
if (!val) return ''
|
||||
if (typeof val === 'string') return val
|
||||
const d = new Date(val)
|
||||
const y = d.getFullYear()
|
||||
const m = String(d.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(d.getDate()).padStart(2, '0')
|
||||
const h = String(d.getHours()).padStart(2, '0')
|
||||
const min = String(d.getMinutes()).padStart(2, '0')
|
||||
const s = String(d.getSeconds()).padStart(2, '0')
|
||||
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
|
||||
},
|
||||
toForwardZD() {
|
||||
crudPurchase.pushZD({
|
||||
billid: row.bill_id,
|
||||
orderNo: row.order_no,
|
||||
orderType: row.order_type,
|
||||
red: row.red,
|
||||
status: row.status
|
||||
})
|
||||
},
|
||||
toView(index, row) {
|
||||
this.mstrow = row
|
||||
this.viewShow = true
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
console.log(val.length)
|
||||
if (val.length == 0) {
|
||||
this.audit_flag = true
|
||||
} else {
|
||||
this.audit_flag = false
|
||||
}
|
||||
},
|
||||
handleCurrentChange(currentRow) {
|
||||
if (currentRow === null) {
|
||||
this.currentRow = {}
|
||||
} else {
|
||||
this.currentRow = currentRow
|
||||
}
|
||||
this.audit_flag = this.crud.selections.length === 0
|
||||
},
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
issueReturnBill() {
|
||||
const selections = this.crud.selections
|
||||
if (!selections || selections.length === 0) {
|
||||
this.crud.notify('请至少选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
const ids = selections.map(s => s.id)
|
||||
const billIds = selections.map(s => s.bill_id).join('、')
|
||||
this.$confirm('确认下发以下单据的回传单?\n' + billIds, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudPurchase.issueReturnBill(ids).then(() => {
|
||||
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}).catch(() => {
|
||||
this.crud.notify('下发失败', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
printBill() {
|
||||
const selections = this.crud.selections
|
||||
if (!selections || selections.length === 0) {
|
||||
this.crud.notify('请至少选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
const billIds = selections.map(s => s.order_no).join('、')
|
||||
this.$confirm('确认打印以下单据的物料标签?\n' + billIds, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.fetchDetailsAndPrint(selections)
|
||||
}).catch(() => {})
|
||||
},
|
||||
fetchDetailsAndPrint(selections) {
|
||||
const promises = selections.map(bill => {
|
||||
return crudPurchase.get(bill.id).then(res => {
|
||||
const dtlList = (res && res.data && res.data.tableData) || []
|
||||
return dtlList.map(dtl => ({
|
||||
...dtl,
|
||||
order_no: bill.order_no,
|
||||
bill_id: bill.bill_id
|
||||
}))
|
||||
})
|
||||
})
|
||||
Promise.all(promises).then(results => {
|
||||
const allDtls = results.reduce((acc, cur) => acc.concat(cur), [])
|
||||
if (allDtls.length === 0) {
|
||||
this.crud.notify('未查询到明细数据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.printPreviewVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.renderPrintContent(allDtls)
|
||||
})
|
||||
}).catch(() => {
|
||||
this.crud.notify('查询明细失败', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
})
|
||||
},
|
||||
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:100%;border-collapse:collapse;margin:0 auto;max-width:450px}'
|
||||
html += 'td{padding:3px 5px;border:2px solid #333;font-size:13px}'
|
||||
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.order_no || ''
|
||||
const itemNo = dtl.item_no || ''
|
||||
const skuCode = dtl.sku_code || ''
|
||||
const skuName = dtl.sku_name || ''
|
||||
const qty = dtl.qty || ''
|
||||
const qrText = orderNo + '#' + itemNo + '#' + skuCode + '#' + skuName + '##' + qty + '#'
|
||||
const imgSrc = await QRCode.toDataURL(qrText, {
|
||||
width: 200
|
||||
})
|
||||
html += '<div class="label">'
|
||||
html += '<h3>上海诺力</h3>'
|
||||
html += '<table>'
|
||||
html += '<tr><td class="lbl">订单号</td><td class="val">' + orderNo + '</td><td class="qr" rowspan="5"><img src="' + imgSrc + '" width="100" height="100" /></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 += '</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>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
57
nladmin-ui/src/views/wms/pm_manage/otherIn/purchase.js
Normal file
57
nladmin-ui/src/views/wms/pm_manage/otherIn/purchase.js
Normal file
@@ -0,0 +1,57 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: '/api/purchasemst',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function get(id) {
|
||||
return request({
|
||||
url: '/api/purchasemst/109/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function issueReturnBill(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst/issueReturnBill',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function print(ids) {
|
||||
return request({
|
||||
url: '/api/purchasemst/print',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
export function pushZD(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst/pushZD',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, get, issueReturnBill, print, pushZD }
|
||||
205
nladmin-ui/src/views/wms/pm_manage/otherOut/index.vue
Normal file
205
nladmin-ui/src/views/wms/pm_manage/otherOut/index.vue
Normal file
@@ -0,0 +1,205 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form :inline="true" class="demo-form-inline" label-position="right" label-width="80px" label-suffix=":">
|
||||
<el-form-item label="模糊查询">
|
||||
<el-input v-model="query.blurry" size="mini" clearable placeholder="单据号/订单号/供应商" @keyup.enter.native="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="query.bill_id" size="mini" clearable placeholder="单据编号" @keyup.enter.native="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号">
|
||||
<el-input v-model="query.order_no" size="mini" clearable placeholder="订单号" @keyup.enter.native="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商">
|
||||
<el-input v-model="query.supplier_name" size="mini" clearable placeholder="供应商名称" @keyup.enter.native="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态">
|
||||
<el-select v-model="query.bill_status" clearable size="mini" placeholder="全部" class="filter-item" @change="crud.toQuery">
|
||||
<el-option v-for="item in billStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker v-model="query.createTime" type="daterange" value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" @change="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button slot="right" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">下发回传单</el-button>
|
||||
</crudOperation>
|
||||
<el-table ref="table" v-loading="crud.loading" size="mini" :data="crud.data" highlight-current-row style="width: 100%;" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange" @select="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-permission="['admin','purchasemst:del','purchasemst:edit']" label="操作" width="115" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation :data="scope.row" :permission="permission" :disabled-edit="canUd(scope.row)" :disabled-dle="canUd(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="bill_id" width="160" label="单据编号">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_id }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="order_no" width="150" label="订单号" />
|
||||
<el-table-column show-overflow-tooltip prop="order_type" width="100" label="订单类型" />
|
||||
<el-table-column :formatter="billStatusFormat" prop="bill_status" width="100" label="单据状态" />
|
||||
<el-table-column label="明细数" align="center" prop="dtl_count" width="80" />
|
||||
<el-table-column label="单据总数" align="center" prop="total_qty" width="80" />
|
||||
<el-table-column label="入库数量" align="center" prop="instock_qty" width="80" />
|
||||
<el-table-column label="转发中鼎" align="center" prop="forwardZD" width="80">
|
||||
<template slot-scope="scope">
|
||||
<p v-if="scope.row.forwardZD == '0'">-</p>
|
||||
<template v-else-if="scope.row.forwardZD == '1'">
|
||||
<el-popconfirm confirm-button-text="是" cancel-button-text="否" icon="el-icon-info" icon-color="red" title="是否重新转发中鼎?" @confirm="toForwardZD(scope.row)">
|
||||
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
<p v-else>成功</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="supplier_code" width="120" label="供应商编码" />
|
||||
<el-table-column show-overflow-tooltip prop="supplier_name" width="150" label="供应商名称" />
|
||||
<el-table-column show-overflow-tooltip prop="creator" width="100" label="创建人" />
|
||||
<el-table-column show-overflow-tooltip prop="create_time" width="150" label="创建时间">
|
||||
<template slot-scope="scope">{{ formatDate(scope.row.create_time) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="modify_date" width="150" label="修改时间">
|
||||
<template slot-scope="scope">{{ formatDate(scope.row.modify_date) }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<ViewDialog :dialog-show.sync="viewShow" :row-mst="mstrow" @AddChanged="querytable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudPurchase from '@/views/wms/pm_manage/otherOut/purchase'
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import AddDialog from '@/views/wms/pm_manage/purchase/AddDialog'
|
||||
import ViewDialog from '@/views/wms/pm_manage/purchase/ViewDialog'
|
||||
|
||||
export default {
|
||||
name: 'OtherOut',
|
||||
components: { AddDialog, ViewDialog, crudOperation, rrOperation, udOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '其他出库单',
|
||||
optShow: { add: true, reset: true },
|
||||
idField: 'id',
|
||||
url: '/api/purchasemst/108',
|
||||
crudMethod: { ...crudPurchase },
|
||||
queryOnPresenterCreated: true
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
add: ['admin', 'purchasemst:add'],
|
||||
edit: ['admin', 'purchasemst:edit'],
|
||||
del: ['admin', 'purchasemst:del']
|
||||
},
|
||||
viewShow: false,
|
||||
mstrow: {},
|
||||
currentRow: null,
|
||||
audit_flag: true,
|
||||
billStatusOptions: [
|
||||
{ value: '0', label: '已创建' },
|
||||
{ value: '1', label: '执行中' },
|
||||
{ value: '2', label: '已完成' }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
canUd(row) {
|
||||
return row.bill_status !== '0'
|
||||
},
|
||||
billStatusFormat(row) {
|
||||
const map = { '0': '已创建', '1': '执行中', '2': '已完成' }
|
||||
return map[row.bill_status] || row.bill_status
|
||||
},
|
||||
auditStatusFormat(row) {
|
||||
const map = { '0': '未审核', '1': '已审核' }
|
||||
return map[row.status] || row.status || '-'
|
||||
},
|
||||
formatDate(val) {
|
||||
if (!val) return ''
|
||||
if (typeof val === 'string') return val
|
||||
const d = new Date(val)
|
||||
const y = d.getFullYear()
|
||||
const m = String(d.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(d.getDate()).padStart(2, '0')
|
||||
const h = String(d.getHours()).padStart(2, '0')
|
||||
const min = String(d.getMinutes()).padStart(2, '0')
|
||||
const s = String(d.getSeconds()).padStart(2, '0')
|
||||
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
|
||||
},
|
||||
toForwardZD() {
|
||||
crudPurchase.pushZD({
|
||||
billid: row.bill_id,
|
||||
orderNo: row.order_no,
|
||||
orderType: row.order_type,
|
||||
red: row.red,
|
||||
status: row.status
|
||||
})
|
||||
},
|
||||
toView(index, row) {
|
||||
this.mstrow = row
|
||||
this.viewShow = true
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
console.log(val.length)
|
||||
if (val.length == 0) {
|
||||
this.audit_flag = true
|
||||
} else {
|
||||
this.audit_flag = false
|
||||
}
|
||||
},
|
||||
handleCurrentChange(currentRow) {
|
||||
if (currentRow === null) {
|
||||
this.currentRow = {}
|
||||
} else {
|
||||
this.currentRow = currentRow
|
||||
}
|
||||
this.audit_flag = this.crud.selections.length === 0
|
||||
},
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
issueReturnBill() {
|
||||
const selections = this.crud.selections
|
||||
if (!selections || selections.length === 0) {
|
||||
this.crud.notify('请至少选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
const ids = selections.map(s => s.id)
|
||||
const billIds = selections.map(s => s.bill_id).join('、')
|
||||
this.$confirm('确认下发以下单据的回传单?\n' + billIds, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudPurchase.issueReturnBill(ids).then(() => {
|
||||
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}).catch(() => {
|
||||
this.crud.notify('下发失败', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
})
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
57
nladmin-ui/src/views/wms/pm_manage/otherOut/purchase.js
Normal file
57
nladmin-ui/src/views/wms/pm_manage/otherOut/purchase.js
Normal file
@@ -0,0 +1,57 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: '/api/purchasemst',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function get(id) {
|
||||
return request({
|
||||
url: '/api/purchasemst/108/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function issueReturnBill(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst/issueReturnBill',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function print(ids) {
|
||||
return request({
|
||||
url: '/api/purchasemst/print',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
export function pushZD(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst/pushZD',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, get, issueReturnBill, print, pushZD }
|
||||
267
nladmin-ui/src/views/wms/pm_manage/purchase/AddDialog.vue
Normal file
267
nladmin-ui/src/views/wms/pm_manage/purchase/AddDialog.vue
Normal file
@@ -0,0 +1,267 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="crud.status.title"
|
||||
append-to-body
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
|
||||
fullscreen
|
||||
width="1200px"
|
||||
@open="open"
|
||||
@close="close"
|
||||
>
|
||||
<el-row v-show="crud.status.cu > 0" :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="85px" label-suffix=":">
|
||||
<el-form-item label="单据编号" prop="bill_id">
|
||||
<label slot="label">单 据 号:</label>
|
||||
<el-input v-model.trim="form.bill_id" :disabled="crud.status.edit > 0 || crud.status.view > 0" placeholder="单据编号" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号" prop="order_no">
|
||||
<el-input v-model.trim="form.order_no" :disabled="crud.status.view > 0" placeholder="订单号" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单类型" prop="order_type">
|
||||
<el-input v-model.trim="form.order_type" :disabled="crud.status.view > 0" placeholder="订单类型" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商编码" prop="supplier_code">
|
||||
<el-input v-model.trim="form.supplier_code" :disabled="crud.status.view > 0" placeholder="供应商编码" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商名称" prop="supplier_name">
|
||||
<el-input v-model.trim="form.supplier_name" :disabled="crud.status.view > 0" placeholder="供应商名称" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="bill_status">
|
||||
<el-select v-model="form.bill_status" clearable style="width: 210px" placeholder="单据状态" class="filter-item" disabled>
|
||||
<el-option v-for="item in billStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="明细数" prop="dtl_count">
|
||||
<label slot="label">明 细 数:</label>
|
||||
<el-input v-model.trim="form.dtl_count" size="mini" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div class="crud-opts2" style="margin-bottom: 5px;">
|
||||
<span class="crud-opts-right2">
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
v-if="crud.status.cu > 0"
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="insertEvent"
|
||||
>
|
||||
添加明细行
|
||||
</el-button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="form.tableData"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column show-overflow-tooltip width="120" prop="item_no" label="行号">
|
||||
<template scope="scope">
|
||||
<el-input v-if="crud.status.cu > 0" v-model="scope.row.item_no" size="mini" />
|
||||
<span v-else>{{ scope.row.item_no }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip width="120" prop="category_code" label="分类编码">
|
||||
<template scope="scope">
|
||||
<el-input v-if="crud.status.cu > 0" v-model="scope.row.category_code" size="mini" />
|
||||
<span v-else>{{ scope.row.category_code }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip width="120" prop="category_name" label="分类名称">
|
||||
<template scope="scope">
|
||||
<el-input v-if="crud.status.cu > 0" v-model="scope.row.category_name" size="mini" />
|
||||
<span v-else>{{ scope.row.category_name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip width="120" prop="sku_code" label="物料编码">
|
||||
<template scope="scope">
|
||||
<el-input v-if="crud.status.cu > 0" v-model="scope.row.sku_code" size="mini" />
|
||||
<span v-else>{{ scope.row.sku_code }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip width="140" prop="sku_name" label="物料名称">
|
||||
<template scope="scope">
|
||||
<el-input v-if="crud.status.cu > 0" v-model="scope.row.sku_name" size="mini" />
|
||||
<span v-else>{{ scope.row.sku_name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip width="100" prop="model" label="规格型号">
|
||||
<template scope="scope">
|
||||
<el-input v-if="crud.status.cu > 0" v-model="scope.row.model" size="mini" />
|
||||
<span v-else>{{ scope.row.model }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip width="100" prop="house_code" label="仓库编码">
|
||||
<template scope="scope">
|
||||
<el-input v-if="crud.status.cu > 0" v-model="scope.row.house_code" size="mini" />
|
||||
<span v-else>{{ scope.row.house_code }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip width="120" prop="batch_no" label="批次号">
|
||||
<template scope="scope">
|
||||
<el-input v-if="crud.status.cu > 0" v-model="scope.row.batch_no" size="mini" />
|
||||
<span v-else>{{ scope.row.batch_no }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip width="100" prop="qty" label="数量">
|
||||
<template scope="scope">
|
||||
<el-input-number v-if="crud.status.cu > 0" v-model="scope.row.qty" :controls="false" :min="0" size="mini" style="width: 80px" />
|
||||
<span v-else>{{ scope.row.qty }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip width="80" prop="unit" label="单位">
|
||||
<template scope="scope">
|
||||
<el-input v-if="crud.status.cu > 0" v-model="scope.row.unit" size="mini" />
|
||||
<span v-else>{{ scope.row.unit }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip width="120" prop="track_no" label="跟踪号">
|
||||
<template scope="scope">
|
||||
<el-input v-if="crud.status.cu > 0" v-model="scope.row.track_no" size="mini" />
|
||||
<span v-else>{{ scope.row.track_no }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="80" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, form.tableData)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import crudPurchase from '@/views/wms/pm_manage/purchase/purchase'
|
||||
|
||||
const defaultForm = {
|
||||
id: '',
|
||||
bill_id: '',
|
||||
order_no: '',
|
||||
order_type: '',
|
||||
supplier_code: '',
|
||||
supplier_name: '',
|
||||
creator: '',
|
||||
create_time: null,
|
||||
modify_date: null,
|
||||
status: 0,
|
||||
red: 0,
|
||||
bill_status: '0',
|
||||
audit_status: '',
|
||||
audit_msg: '',
|
||||
dtl_count: '0',
|
||||
tableData: []
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
billStatusOptions: [
|
||||
{ value: '0', label: '已创建' },
|
||||
{ value: '1', label: '执行中' },
|
||||
{ value: '2', label: '已完成' },
|
||||
{ value: '3', label: '审核成功' },
|
||||
{ value: '4', label: '审核失败' }
|
||||
],
|
||||
rules: {
|
||||
bill_id: [
|
||||
{ required: true, message: '单据编号不能为空', trigger: 'blur' }
|
||||
],
|
||||
order_no: [
|
||||
{ required: true, message: '订单号不能为空', trigger: 'blur' }
|
||||
],
|
||||
supplier_code: [
|
||||
{ required: true, message: '供应商编码不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
},
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
[CRUD.HOOK.afterToEdit]() {
|
||||
crudPurchase.get(this.form.id).then(res => {
|
||||
if (res.data && res.data.tableData) {
|
||||
this.form.tableData = res.data.tableData
|
||||
}
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.afterToView]() {
|
||||
crudPurchase.get(this.form.id).then(res => {
|
||||
if (res.data && res.data.tableData) {
|
||||
this.form.tableData = res.data.tableData
|
||||
}
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
if (this.form.tableData.length === 0) {
|
||||
this.crud.notify('请至少添加一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
},
|
||||
insertEvent() {
|
||||
this.form.tableData.push({
|
||||
item_no: String(this.form.tableData.length + 1),
|
||||
category_code: '',
|
||||
category_name: '',
|
||||
sku_code: '',
|
||||
sku_name: '',
|
||||
model: '',
|
||||
house_code: '',
|
||||
batch_no: '',
|
||||
qty: 0,
|
||||
unit_code: '',
|
||||
unit: '',
|
||||
track_no: ''
|
||||
})
|
||||
this.form.dtl_count = String(this.form.tableData.length)
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
rows.splice(index, 1)
|
||||
this.form.dtl_count = String(this.form.tableData.length)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 4px 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
}
|
||||
</style>
|
||||
159
nladmin-ui/src/views/wms/pm_manage/purchase/ViewDialog.vue
Normal file
159
nladmin-ui/src/views/wms/pm_manage/purchase/ViewDialog.vue
Normal file
@@ -0,0 +1,159 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
append-to-body
|
||||
title="单据详情"
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
fullscreen
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" size="mini" label-width="85px" label-suffix=":">
|
||||
<el-form-item label="单据编号" prop="bill_id">
|
||||
<label slot="label">单 据 号:</label>
|
||||
<el-input v-model="form.bill_id" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号" prop="order_no">
|
||||
<el-input v-model="form.order_no" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单类型" prop="order_type">
|
||||
<el-input v-model="form.order_type" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商编码" prop="supplier_code">
|
||||
<el-input v-model="form.supplier_code" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商名称" prop="supplier_name">
|
||||
<el-input v-model="form.supplier_name" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="bill_status">
|
||||
<el-select v-model="form.bill_status" disabled style="width: 210px">
|
||||
<el-option v-for="item in billStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态" prop="audit_status">
|
||||
<el-input v-model="auditStatusLabel" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审核信息" prop="audit_msg">
|
||||
<el-input v-model="form.audit_msg" disabled style="width: 380px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creator">
|
||||
<el-input v-model="form.creator" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="create_time">
|
||||
<el-input :value="formatDate(form.create_time)" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span2">入库明细</span>
|
||||
</div>
|
||||
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
|
||||
<el-table ref="table" :data="tableDtl" style="width: 100%;" max-height="400" size="mini" border :header-cell-style="{background:'#f5f7fa',color:'#606266'}">
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="item_no" label="行号" width="80" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="category_code" label="分类编码" width="120" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="category_name" label="分类名称" width="120" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="sku_code" label="物料编码" width="120" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="sku_name" label="物料名称" min-width="140" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="model" label="规格型号" width="100" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="house_code" label="仓库编码" width="100" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="batch_no" label="批次号" width="120" align="center" />
|
||||
<el-table-column prop="qty" label="数量" width="80" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="unit" label="单位" width="80" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="track_no" label="跟踪号" width="120" align="center" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { crud } from '@crud/crud'
|
||||
import crudPurchase from '@/views/wms/pm_manage/purchase/purchase'
|
||||
|
||||
export default {
|
||||
name: 'ViewDialog',
|
||||
mixins: [crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
rowMst: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
tableDtl: [],
|
||||
form: {},
|
||||
billStatusOptions: [
|
||||
{ value: '0', label: '已创建' },
|
||||
{ value: '1', label: '执行中' },
|
||||
{ value: '2', label: '已完成' },
|
||||
{ value: '3', label: '审核成功' },
|
||||
{ value: '4', label: '审核失败' }
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
auditStatusLabel() {
|
||||
const map = { '0': '未审核', '1': '已审核' }
|
||||
return map[this.form.status] || this.form.status || '-'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
rowMst: {
|
||||
handler(newValue) {
|
||||
this.form = newValue || {}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
if (this.form && this.form.id) {
|
||||
crudPurchase.get(this.form.id).then(res => {
|
||||
this.tableDtl = (res && res.data.tableData) || []
|
||||
})
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('AddChanged')
|
||||
this.tableDtl = []
|
||||
},
|
||||
formatDate(val) {
|
||||
if (!val) return ''
|
||||
if (typeof val === 'string') return val
|
||||
const d = new Date(val)
|
||||
const y = d.getFullYear()
|
||||
const m = String(d.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(d.getDate()).padStart(2, '0')
|
||||
const h = String(d.getHours()).padStart(2, '0')
|
||||
const min = String(d.getMinutes()).padStart(2, '0')
|
||||
const s = String(d.getSeconds()).padStart(2, '0')
|
||||
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 10px 0px 0px 10px;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.crud-opts2 .role-span2 {
|
||||
font-size: 16px;
|
||||
color: #303133;
|
||||
}
|
||||
</style>
|
||||
346
nladmin-ui/src/views/wms/pm_manage/purchase/index.vue
Normal file
346
nladmin-ui/src/views/wms/pm_manage/purchase/index.vue
Normal file
@@ -0,0 +1,346 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form :inline="true" class="demo-form-inline" label-position="right" label-width="80px" label-suffix=":">
|
||||
<el-form-item label="模糊查询">
|
||||
<el-input v-model="query.blurry" size="mini" clearable placeholder="单据号/订单号/供应商" @keyup.enter.native="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="query.bill_id" size="mini" clearable placeholder="单据编号" @keyup.enter.native="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号">
|
||||
<el-input v-model="query.order_no" size="mini" clearable placeholder="订单号" @keyup.enter.native="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商">
|
||||
<el-input v-model="query.supplier_name" size="mini" clearable placeholder="供应商名称" @keyup.enter.native="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态">
|
||||
<el-select v-model="query.bill_status" clearable size="mini" placeholder="全部" class="filter-item" @change="crud.toQuery">
|
||||
<el-option v-for="item in billStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker v-model="query.createTime" type="daterange" value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" @change="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button slot="right" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">下发回传单</el-button>
|
||||
<el-button slot="right" class="filter-item" type="primary" icon="el-icon-printer" size="mini" :disabled="audit_flag" @click="printBill">打印</el-button>
|
||||
</crudOperation>
|
||||
<el-table ref="table" v-loading="crud.loading" size="mini" :data="crud.data" highlight-current-row style="width: 100%;" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange" @select="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-permission="['admin','purchasemst:del','purchasemst:edit']" label="操作" width="115" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation :data="scope.row" :permission="permission" :disabled-edit="canUd(scope.row)" :disabled-dle="canUd(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="bill_id" width="160" label="单据编号">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_id }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="order_no" width="150" label="订单号" />
|
||||
<el-table-column show-overflow-tooltip prop="order_type" width="100" label="订单类型" />
|
||||
<el-table-column :formatter="billStatusFormat" prop="bill_status" width="100" label="单据状态" />
|
||||
<el-table-column label="明细数" align="center" prop="dtl_count" width="80" />
|
||||
<el-table-column label="单据总数" align="center" prop="total_qty" width="80" />
|
||||
<el-table-column label="入库数量" align="center" prop="instock_qty" width="80" />
|
||||
<el-table-column label="转发中鼎" align="center" prop="forwardZD" width="80">
|
||||
<template slot-scope="scope">
|
||||
<p v-if="scope.row.forwardZD == '0'">-</p>
|
||||
<template v-else-if="scope.row.forwardZD == '1'">
|
||||
<el-popconfirm
|
||||
confirm-button-text="是"
|
||||
cancel-button-text="否"
|
||||
icon="el-icon-info"
|
||||
icon-color="red"
|
||||
title="是否重新转发中鼎?"
|
||||
@confirm="toForwardZD(scope.row)"
|
||||
>
|
||||
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
<!-- <a style="color: red;text-decoration: underline" v-else-if="scope.row.forwardZD == '1'">-->
|
||||
<!-- <el-popconfirm-->
|
||||
<!-- class="box-item"-->
|
||||
<!-- title="是否重新转发?"-->
|
||||
<!-- placement="top-start"-->
|
||||
<!-- >-->
|
||||
<!-- <template #reference>-->
|
||||
<!-- 失败-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-popconfirm>-->
|
||||
<!-- </a>-->
|
||||
<p v-else>成功</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="supplier_code" width="120" label="供应商编码" />
|
||||
<el-table-column show-overflow-tooltip prop="supplier_name" width="150" label="供应商名称" />
|
||||
<el-table-column show-overflow-tooltip prop="creator" width="100" label="创建人" />
|
||||
<el-table-column show-overflow-tooltip prop="create_time" width="150" label="创建时间">
|
||||
<template slot-scope="scope">
|
||||
{{ formatDate(scope.row.create_time) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="modify_date" width="150" label="修改时间">
|
||||
<template slot-scope="scope">
|
||||
{{ formatDate(scope.row.modify_date) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="status" :formatter="auditStatusFormat" width="100" label="审核状态" />-->
|
||||
<!-- <el-table-column show-overflow-tooltip prop="audit_msg" width="150" label="审核信息" />-->
|
||||
</el-table>
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<ViewDialog :dialog-show.sync="viewShow" :row-mst="mstrow" @AddChanged="querytable" />
|
||||
<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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudPurchase from '@/views/wms/pm_manage/purchase/purchase'
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import AddDialog from '@/views/wms/pm_manage/purchase/AddDialog'
|
||||
import ViewDialog from '@/views/wms/pm_manage/purchase/ViewDialog'
|
||||
import QRCode from 'qrcode'
|
||||
|
||||
export default {
|
||||
name: 'Purchase',
|
||||
components: { AddDialog, ViewDialog, crudOperation, rrOperation, udOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '采购入库单',
|
||||
optShow: { add: true, reset: true },
|
||||
idField: 'id',
|
||||
url: '/api/purchasemst/103',
|
||||
crudMethod: { ...crudPurchase },
|
||||
queryOnPresenterCreated: true
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
add: ['admin', 'purchasemst:add'],
|
||||
edit: ['admin', 'purchasemst:edit'],
|
||||
del: ['admin', 'purchasemst:del']
|
||||
},
|
||||
viewShow: false,
|
||||
mstrow: {},
|
||||
currentRow: null,
|
||||
audit_flag: true,
|
||||
printPreviewVisible: false,
|
||||
billStatusOptions: [
|
||||
{ value: '0', label: '已创建' },
|
||||
{ value: '1', label: '执行中' },
|
||||
{ value: '2', label: '已完成' }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
canUd(row) {
|
||||
return row.bill_status !== '0'
|
||||
},
|
||||
billStatusFormat(row) {
|
||||
const map = { '0': '已创建', '1': '执行中', '2': '已完成' }
|
||||
return map[row.bill_status] || row.bill_status
|
||||
},
|
||||
auditStatusFormat(row) {
|
||||
const map = { '0': '未审核', '1': '已审核' }
|
||||
return map[row.status] || row.status || '-'
|
||||
},
|
||||
formatDate(val) {
|
||||
if (!val) return ''
|
||||
if (typeof val === 'string') return val
|
||||
const d = new Date(val)
|
||||
const y = d.getFullYear()
|
||||
const m = String(d.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(d.getDate()).padStart(2, '0')
|
||||
const h = String(d.getHours()).padStart(2, '0')
|
||||
const min = String(d.getMinutes()).padStart(2, '0')
|
||||
const s = String(d.getSeconds()).padStart(2, '0')
|
||||
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
|
||||
},
|
||||
toForwardZD(row) {
|
||||
crudPurchase.pushZD({
|
||||
billid: row.bill_id,
|
||||
orderNo: row.order_no,
|
||||
orderType: row.order_type,
|
||||
red: row.red,
|
||||
status: row.status
|
||||
}).then(res => {
|
||||
this.crud.notify(res.respMsg)
|
||||
this.crud.init()
|
||||
})
|
||||
},
|
||||
toView(index, row) {
|
||||
this.mstrow = row
|
||||
this.viewShow = true
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
console.log(val.length)
|
||||
if (val.length == 0) {
|
||||
// this.$refs.table.clearSelection()
|
||||
// this.$refs.table.toggleRowSelection(val.pop())
|
||||
this.audit_flag = true
|
||||
} else {
|
||||
this.audit_flag = false
|
||||
}
|
||||
},
|
||||
|
||||
handleCurrentChange(currentRow) {
|
||||
if (currentRow === null) {
|
||||
this.currentRow = {}
|
||||
} else {
|
||||
this.currentRow = currentRow
|
||||
}
|
||||
this.audit_flag = this.crud.selections.length === 0
|
||||
},
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
issueReturnBill() {
|
||||
const selections = this.crud.selections
|
||||
if (!selections || selections.length === 0) {
|
||||
this.crud.notify('请至少选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
const ids = selections.map(s => s.id)
|
||||
const billIds = selections.map(s => s.bill_id).join('、')
|
||||
this.$confirm('确认下发以下单据的回传单?\n' + billIds, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudPurchase.issueReturnBill(ids).then(() => {
|
||||
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}).catch(() => {
|
||||
this.crud.notify('下发失败', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
printBill() {
|
||||
const selections = this.crud.selections
|
||||
if (!selections || selections.length === 0) {
|
||||
this.crud.notify('请至少选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
const billIds = selections.map(s => s.order_no).join('、')
|
||||
this.$confirm('确认打印以下单据的物料标签?\n' + billIds, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.fetchDetailsAndPrint(selections)
|
||||
}).catch(() => {})
|
||||
},
|
||||
fetchDetailsAndPrint(selections) {
|
||||
const promises = selections.map(bill => {
|
||||
return crudPurchase.get(bill.id).then(res => {
|
||||
const dtlList = (res && res.data && res.data.tableData) || []
|
||||
return dtlList.map(dtl => ({
|
||||
...dtl,
|
||||
order_no: bill.order_no,
|
||||
bill_id: bill.bill_id
|
||||
}))
|
||||
})
|
||||
})
|
||||
Promise.all(promises).then(results => {
|
||||
const allDtls = results.reduce((acc, cur) => acc.concat(cur), [])
|
||||
if (allDtls.length === 0) {
|
||||
this.crud.notify('未查询到明细数据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.printPreviewVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.renderPrintContent(allDtls)
|
||||
})
|
||||
}).catch(() => {
|
||||
this.crud.notify('查询明细失败', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
})
|
||||
},
|
||||
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:100%;border-collapse:collapse;margin:0 auto;max-width:450px}'
|
||||
html += 'td{padding:3px 5px;border:2px solid #333;font-size:13px}'
|
||||
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.order_no || ''
|
||||
const itemNo = dtl.item_no || ''
|
||||
const skuCode = dtl.sku_code || ''
|
||||
const skuName = dtl.sku_name || ''
|
||||
const qty = dtl.qty || ''
|
||||
const qrText = orderNo + '#' + itemNo + '#' + skuCode + '#' + skuName + '##' + qty + '#'
|
||||
const imgSrc = await QRCode.toDataURL(qrText, {
|
||||
width: 200
|
||||
})
|
||||
html += '<div class="label">'
|
||||
html += '<h3>上海诺力</h3>'
|
||||
html += '<table>'
|
||||
html += '<tr><td class="lbl">订单号</td><td class="val">' + orderNo + '</td><td class="qr" rowspan="5"><img src="' + imgSrc + '" width="100" height="100" /></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 += '</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>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
58
nladmin-ui/src/views/wms/pm_manage/purchase/purchase.js
Normal file
58
nladmin-ui/src/views/wms/pm_manage/purchase/purchase.js
Normal file
@@ -0,0 +1,58 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: '/api/purchasemst',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function get(id) {
|
||||
return request({
|
||||
url: '/api/purchasemst/103/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function issueReturnBill(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst/issueReturnBill',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function print(ids) {
|
||||
return request({
|
||||
url: '/api/purchasemst/print',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function pushZD(data) {
|
||||
return request({
|
||||
url: '/api/purchasemst/pushZD',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, get, issueReturnBill, print, pushZD }
|
||||
Reference in New Issue
Block a user