add:按行确认收货,调拨推中鼎单据类型修复
This commit is contained in:
@@ -140,9 +140,9 @@ export default {
|
||||
return {
|
||||
api: {},
|
||||
permission: {
|
||||
add: ['admin', 'sapMaterialDocument:add'],
|
||||
edit: ['admin', 'sapMaterialDocument:edit'],
|
||||
del: ['admin', 'sapMaterialDocument:del']
|
||||
add: ['sapMaterialDocument:add'],
|
||||
edit: ['sapMaterialDocument:edit'],
|
||||
del: ['sapMaterialDocument:del']
|
||||
},
|
||||
viewShow: false,
|
||||
mstrow: {},
|
||||
|
||||
@@ -41,6 +41,16 @@
|
||||
:disabled="isConfirmDisabled()"
|
||||
@click="handleConfirmReceipt"
|
||||
>收货确认</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-s-order"
|
||||
size="mini"
|
||||
:loading="lineConfirming"
|
||||
:disabled="isLineConfirmDisabled()"
|
||||
@click="openLineConfirm"
|
||||
>按行确认</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
@@ -218,6 +228,7 @@
|
||||
>
|
||||
<div style="line-height: 24px; margin-bottom: 12px;">
|
||||
已选择 <strong>{{ confirmVbelns.length }}</strong> 张交货单,确认后回传 SAP MM054 收货确认。
|
||||
<div style="color: #909399; font-size: 12px; margin-top: 4px;">已按行确认过的明细会自动跳过,只回传未确认的行。</div>
|
||||
</div>
|
||||
<el-checkbox v-model="batchLgort">批量修改存储地点</el-checkbox>
|
||||
<div v-if="batchLgort" style="margin-top: 12px;">
|
||||
@@ -239,6 +250,55 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
:visible.sync="lineConfirmVisible"
|
||||
title="按行确认"
|
||||
width="1050px"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="margin-bottom: 10px; color: #606266; font-size: 13px;">
|
||||
交货单号:<strong>{{ lineVbeln }}</strong> |
|
||||
已确认 <strong>{{ lineConfirmedCount }}</strong> / {{ lineItems.length }} 行 |
|
||||
勾选需要收货确认的明细行后提交,已确认的行不可再选。
|
||||
</div>
|
||||
<el-table
|
||||
ref="lineTable"
|
||||
v-loading="lineLoading"
|
||||
:data="lineItems"
|
||||
size="small"
|
||||
border
|
||||
max-height="420"
|
||||
row-key="id"
|
||||
@selection-change="onLineSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="50" :selectable="isLineSelectable" />
|
||||
<el-table-column prop="posnr" label="行项目号" width="90" align="center" />
|
||||
<el-table-column prop="material" label="物料编号" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="matl_desc" label="物料描述" min-width="170" show-overflow-tooltip />
|
||||
<el-table-column prop="deliv_qty" label="交货数量" width="100" align="right" />
|
||||
<el-table-column prop="unit" label="单位" width="70" align="center" />
|
||||
<el-table-column prop="lgort" label="存储地点" width="90" align="center" />
|
||||
<el-table-column prop="po_number" label="采购凭证" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="确认状态" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="isLineConfirmed(scope.row) ? 'success' : 'info'" size="mini">
|
||||
{{ isLineConfirmed(scope.row) ? '已确认' : '未确认' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="mini" @click="lineConfirmVisible = false">取消</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
:loading="lineConfirming"
|
||||
:disabled="!lineSelection.length"
|
||||
@click="submitLineConfirm"
|
||||
>确认收货({{ lineSelection.length }} 行)</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
:visible.sync="syncVisible"
|
||||
title="收货单同步"
|
||||
@@ -291,6 +351,13 @@
|
||||
<el-table-column prop="po_item" label="采购行" width="80" align="center" />
|
||||
<el-table-column prop="werks" label="工厂" width="80" align="center" />
|
||||
<el-table-column prop="lgort" label="存储地点" width="90" align="center" />
|
||||
<el-table-column label="确认状态" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="isLineConfirmed(scope.row) ? 'success' : 'info'" size="mini">
|
||||
{{ isLineConfirmed(scope.row) ? '已确认' : '未确认' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="mini" @click="closeDetailDialog">关闭</el-button>
|
||||
@@ -346,7 +413,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudSapDelivery, { getDetail, confirmReceipt, syncSapJhd } from './sapDelivery'
|
||||
import crudSapDelivery, { getDetail, confirmReceipt, confirmItems, syncSapJhd } from './sapDelivery'
|
||||
import { getStor } from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation.vue'
|
||||
@@ -416,6 +483,12 @@ export default {
|
||||
confirmVbelns: [],
|
||||
batchLgort: false,
|
||||
confirmLgort: '',
|
||||
lineConfirmVisible: false,
|
||||
lineVbeln: '',
|
||||
lineItems: [],
|
||||
lineSelection: [],
|
||||
lineLoading: false,
|
||||
lineConfirming: false,
|
||||
storList: [],
|
||||
detailVisible: false,
|
||||
detailLoading: false,
|
||||
@@ -429,6 +502,9 @@ export default {
|
||||
computed: {
|
||||
isEditMode() {
|
||||
return this.crud.status.edit > 0
|
||||
},
|
||||
lineConfirmedCount() {
|
||||
return this.lineItems.filter(item => this.isLineConfirmed(item)).length
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -498,6 +574,57 @@ export default {
|
||||
}
|
||||
return this.multipleSelection.some(item => String(item.status) !== '0')
|
||||
},
|
||||
isLineConfirmed(row) {
|
||||
return !!row && String(row.confirm_status) === '1'
|
||||
},
|
||||
isLineSelectable(row) {
|
||||
return !this.isLineConfirmed(row)
|
||||
},
|
||||
isLineConfirmDisabled() {
|
||||
if (this.multipleSelection.length !== 1) {
|
||||
return true
|
||||
}
|
||||
return String(this.multipleSelection[0].status) !== '0'
|
||||
},
|
||||
openLineConfirm() {
|
||||
if (this.isLineConfirmDisabled()) {
|
||||
this.crud.notify('请勾选一张生成状态的交货单', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
const row = this.multipleSelection[0]
|
||||
this.lineVbeln = row.vbeln
|
||||
this.lineItems = []
|
||||
this.lineSelection = []
|
||||
this.lineConfirmVisible = true
|
||||
this.lineLoading = true
|
||||
getDetail(row.vbeln).then(res => {
|
||||
const detail = res.data || {}
|
||||
this.lineItems = detail.items || []
|
||||
}).catch(() => {
|
||||
this.lineItems = []
|
||||
}).finally(() => {
|
||||
this.lineLoading = false
|
||||
})
|
||||
},
|
||||
onLineSelectionChange(selection) {
|
||||
this.lineSelection = selection
|
||||
},
|
||||
submitLineConfirm() {
|
||||
if (!this.lineSelection.length) {
|
||||
this.crud.notify('请勾选要确认收货的明细行', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
const itemIds = this.lineSelection.map(item => item.id)
|
||||
this.lineConfirming = true
|
||||
confirmItems(this.lineVbeln, itemIds).then(res => {
|
||||
const result = res.data || {}
|
||||
this.crud.notify(result.respMsg || '按行确认成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.lineConfirmVisible = false
|
||||
this.crud.toQuery()
|
||||
}).finally(() => {
|
||||
this.lineConfirming = false
|
||||
})
|
||||
},
|
||||
addItem() {
|
||||
if (!this.form.items) {
|
||||
this.$set(this.form, 'items', [])
|
||||
|
||||
@@ -45,6 +45,20 @@ export function confirmReceipt(vbelns, lgort) {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 按行收货确认:只确认勾选的明细行
|
||||
* @param {String} vbeln 交货单号
|
||||
* @param {Array} itemIds 勾选的明细行ID
|
||||
* @param {String} lgort 指定存储地点,为空则按明细原存储地点
|
||||
*/
|
||||
export function confirmItems(vbeln, itemIds, lgort) {
|
||||
return request({
|
||||
url: 'api/sapDelivery/confirmItems',
|
||||
method: 'post',
|
||||
data: { vbeln, itemIds, lgort }
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* MM067 按收货单号从 SAP 同步交货单
|
||||
* @param {String} vbeln 收货单号
|
||||
@@ -57,4 +71,4 @@ export function syncSapJhd(vbeln) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getDetail, confirmReceipt, syncSapJhd }
|
||||
export default { add, edit, del, getDetail, confirmReceipt, confirmItems, syncSapJhd }
|
||||
|
||||
Reference in New Issue
Block a user