add:销售出库单、手动退料单
fix:手动推中鼎
This commit is contained in:
@@ -600,7 +600,7 @@ export default {
|
||||
return false
|
||||
}
|
||||
crudStoragevehicleinfo.getVehicle(code).then(res => {
|
||||
this.form.vehicle_code = res.value
|
||||
this.form.vehicle_code = res.data.value
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
icon="el-icon-info"
|
||||
icon-color="red"
|
||||
title="是否重新转发中鼎?"
|
||||
@confirm="toForwardZD(scope.row)"
|
||||
@confirm="() => toForwardZD(scope.row)"
|
||||
>
|
||||
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
||||
</el-popconfirm>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<crudOperation :permission="permission">
|
||||
<crudOperation :permission="permission">
|
||||
<el-button slot="right" v-has-user="['admin']" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">强制回传EAS</el-button>
|
||||
<el-button slot="right" class="filter-item" type="success" icon="el-icon-s-promotion" size="mini" :disabled="isPushDisabled()" @click="handleBatchPush">下推出库</el-button>
|
||||
</crudOperation>
|
||||
@@ -56,7 +56,7 @@
|
||||
<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)">
|
||||
<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>
|
||||
@@ -81,7 +81,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudPurchase, {outPush} from '@/views/wms/pm_manage/allocationOut/purchase'
|
||||
import crudPurchase, { outPush } 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'
|
||||
@@ -89,7 +89,7 @@ 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 {push} from "@/views/wms/pm_manage/demand/demand";
|
||||
import { push } from '@/views/wms/pm_manage/demand/demand'
|
||||
|
||||
export default {
|
||||
name: 'AllocationOut',
|
||||
@@ -144,7 +144,7 @@ export default {
|
||||
'2': '完成',
|
||||
'3': '审核成功',
|
||||
'4': '审核失败'
|
||||
};
|
||||
}
|
||||
return map[bill_status] || bill_status
|
||||
},
|
||||
auditStatusFormat(row) {
|
||||
@@ -191,7 +191,7 @@ export default {
|
||||
const s = String(d.getSeconds()).padStart(2, '0')
|
||||
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
|
||||
},
|
||||
toForwardZD() {
|
||||
toForwardZD(row) {
|
||||
crudPurchase.pushZD({
|
||||
billid: row.bill_id,
|
||||
orderNo: row.order_no,
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<rrOperation :crud="crud" />
|
||||
</el-form>
|
||||
</div>
|
||||
<crudOperation :permission="permission" >
|
||||
<crudOperation :permission="permission">
|
||||
<el-button slot="right" v-has-user="['admin']" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">强制回传EAS</el-button>
|
||||
<el-button slot="right" class="filter-item" type="success" icon="el-icon-s-promotion" size="mini" :disabled="isPushDisabled()" @click="handleBatchPush">下推出库</el-button>
|
||||
<el-button slot="right" class="filter-item" type="warning" icon="el-icon-house" size="mini" :disabled="isBatchAllocateDisabled()" @click="openBatchAllocateDialog">批量分配</el-button>
|
||||
@@ -86,7 +86,8 @@
|
||||
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="id" label="ID" width="220" show-overflow-tooltip />
|
||||
<el-table-column prop="workOrder" label="工单编号" min-width="140" show-overflow-tooltip />
|
||||
<!-- <el-table-column prop="id" label="ID" width="220" show-overflow-tooltip />-->
|
||||
<el-table-column prop="creator" label="操作人" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="createTime" label="需求日期" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="priority" label="优先级" width="80" />
|
||||
@@ -95,7 +96,6 @@
|
||||
<el-tag :type="statusTagType(scope.row.status)" size="mini">{{ statusLabel(scope.row.status) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="workOrder" label="工单编号" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="skuCode" label="物料编码" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="skuName" label="物料名称" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="qty" label="数量" width="100" />
|
||||
@@ -127,7 +127,7 @@ import crudOperation from '@crud/CRUD.operation.vue'
|
||||
import udOperation from '@crud/UD.operation.vue'
|
||||
import rrOperation from '@crud/RR.operation.vue'
|
||||
import pagination from '@crud/Pagination.vue'
|
||||
import crudPurchase from "@/views/wms/pm_manage/allocationOut/purchase";
|
||||
import crudPurchase from '@/views/wms/pm_manage/allocationOut/purchase'
|
||||
|
||||
const createDefaultForm = () => ({ id: null, creator: '', createTime: '', priority: 0, status: 0, workOrder: '', skuCode: '', skuName: '', qty: undefined, unit: '', targetArea: '', productionLine: '', sn: '' })
|
||||
|
||||
@@ -140,7 +140,11 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
permission: {
|
||||
add: ['purchasemst:add'],
|
||||
edit: ['purchasemst:edit'],
|
||||
del: ['purchasemst:del']
|
||||
},
|
||||
statusOptions: [
|
||||
{ value: '0', label: '生成' },
|
||||
{ value: '01', label: '分配' },
|
||||
@@ -337,7 +341,7 @@ export default {
|
||||
}).then(() => {
|
||||
push(this.multipleSelection).then(res => {
|
||||
if (res.code === 400) {
|
||||
this.$message.error('下推失败'+res.message)
|
||||
this.$message.error('下推失败' + res.message)
|
||||
return
|
||||
}
|
||||
this.$message.success('下推成功')
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<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)">
|
||||
<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>
|
||||
@@ -174,7 +174,7 @@ export default {
|
||||
const s = String(d.getSeconds()).padStart(2, '0')
|
||||
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
|
||||
},
|
||||
toForwardZD() {
|
||||
toForwardZD(row) {
|
||||
crudPurchase.pushZD({
|
||||
billid: row.bill_id,
|
||||
orderNo: row.order_no,
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<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)">
|
||||
<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>
|
||||
@@ -144,7 +144,7 @@ export default {
|
||||
'2': '完成',
|
||||
'3': '审核成功',
|
||||
'4': '审核失败'
|
||||
};
|
||||
}
|
||||
return map[bill_status] || bill_status
|
||||
},
|
||||
auditStatusFormat(row) {
|
||||
@@ -163,7 +163,7 @@ export default {
|
||||
const s = String(d.getSeconds()).padStart(2, '0')
|
||||
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
|
||||
},
|
||||
toForwardZD() {
|
||||
toForwardZD(row) {
|
||||
crudPurchase.pushZD({
|
||||
billid: row.bill_id,
|
||||
orderNo: row.order_no,
|
||||
|
||||
@@ -50,8 +50,8 @@
|
||||
</el-button>
|
||||
<el-switch
|
||||
slot="right"
|
||||
v-has-user="['admin']"
|
||||
v-model="forwardAllZD"
|
||||
v-has-user="['admin']"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#dcdfe6"
|
||||
active-text="开启转发中鼎"
|
||||
@@ -90,7 +90,7 @@
|
||||
icon="el-icon-info"
|
||||
icon-color="red"
|
||||
title="是否重新转发中鼎?"
|
||||
@confirm="toForwardZD(scope.row)"
|
||||
@confirm="() => toForwardZD(scope.row)"
|
||||
>
|
||||
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
||||
</el-popconfirm>
|
||||
|
||||
335
nladmin-ui/src/views/wms/pm_manage/returnIn/index.vue
Normal file
335
nladmin-ui/src/views/wms/pm_manage/returnIn/index.vue
Normal file
@@ -0,0 +1,335 @@
|
||||
<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" v-has-user="['admin']" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">强制回传EAS</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 prop="bill_status" label="单据状态" width="90">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="statusTagType(scope.row.bill_status)" size="mini">{{ billStatusFormat(scope.row) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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: 'ReturnIn',
|
||||
components: { AddDialog, ViewDialog, crudOperation, rrOperation, udOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '其他入库单',
|
||||
optShow: { add: true, reset: true },
|
||||
idField: 'id',
|
||||
url: '/api/purchasemst/104',
|
||||
crudMethod: { ...crudPurchase },
|
||||
queryOnPresenterCreated: true
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
add: ['purchasemst:add'],
|
||||
edit: ['purchasemst:edit'],
|
||||
del: ['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 || '-'
|
||||
},
|
||||
statusTagType(status) {
|
||||
const map = { '0': 'warning', '1': 'primary', '2': 'success' }
|
||||
return map[String(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
|
||||
})
|
||||
},
|
||||
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: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.order_no || ''
|
||||
const itemNo = dtl.item_no || ''
|
||||
const skuCode = dtl.sku_code || ''
|
||||
const house_code = dtl.house_code || ''
|
||||
const skuName = dtl.sku_name || ''
|
||||
const qty = dtl.qty || ''
|
||||
const qrText = orderNo + '#' + itemNo + '#' + skuCode + '#' + skuName + '##' + qty + '#'
|
||||
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>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
57
nladmin-ui/src/views/wms/pm_manage/returnIn/purchase.js
Normal file
57
nladmin-ui/src/views/wms/pm_manage/returnIn/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 }
|
||||
@@ -56,7 +56,7 @@
|
||||
<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)">
|
||||
<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>
|
||||
@@ -163,7 +163,7 @@ export default {
|
||||
const s = String(d.getSeconds()).padStart(2, '0')
|
||||
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
|
||||
},
|
||||
toForwardZD() {
|
||||
toForwardZD(row) {
|
||||
crudPurchase.pushZD({
|
||||
billid: row.bill_id,
|
||||
orderNo: row.order_no,
|
||||
|
||||
Reference in New Issue
Block a user