add:库改车投料需求+1 外部调用调拨单

This commit is contained in:
zhaoyf
2026-11-23 16:04:12 +08:00
parent 1a403c08d4
commit e6b97d6516
18 changed files with 545 additions and 298 deletions

View File

@@ -239,8 +239,9 @@ export default {
],
inventoryList: [
{ value: 'R001', label: '中鼎立库' },
{ value: 'R002', label: '五期装配车间平库' },
{ value: 'R003', label: '五期装配车间大件库' },
{ value: 'R002', label: '装配车间平库' },
{ value: 'R003', label: '装配车间大件库' },
{ value: 'R005', label: '库改车原材料库' },
{ value: 'H005', label: '结构件仓库' },
],
deliveryMethodOptions: [

View File

@@ -21,6 +21,8 @@
</el-form>
</div>
<crudOperation :permission="permission">
<el-button slot="right" class="filter-item" type="success" icon="el-icon-s-promotion" size="mini" :loading="pushing" :disabled="isPushDisabled()" @click="handleBatchPush">下推出库</el-button>
<el-button slot="right" class="filter-item" type="warning" icon="el-icon-refresh" size="mini" :loading="transferring" :disabled="isTransferDisabled()" @click="handleTransfer">需求单转移</el-button>
<el-button slot="right" v-permission="permission.del" class="filter-item" type="danger" icon="el-icon-delete" size="mini" :loading="batchDeleting" :disabled="!multipleSelection.length || batchDeleting" @click="handleBatchDelete">批量删除</el-button>
</crudOperation>
@@ -45,6 +47,13 @@
<el-table-column prop="targetHouseCode" label="目标库" min-width="140" show-overflow-tooltip />
<el-table-column prop="inventoryDis" label="出库仓库" width="110" />
<el-table-column prop="outBillCode" label="出库单号" min-width="150" show-overflow-tooltip />
<el-table-column prop="transferStatus" label="转移状态" width="100">
<template slot-scope="scope">
<el-tag :type="scope.row.transferStatus === '1' ? 'success' : 'info'" size="mini">
{{ scope.row.transferStatus === '1' ? '已转移' : '未转移' }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="productionLine" label="产线" min-width="100" show-overflow-tooltip />
<el-table-column prop="sn" label="车辆序列号" min-width="140" show-overflow-tooltip />
<el-table-column prop="createAt" label="创建时间" min-width="160" show-overflow-tooltip />
@@ -55,7 +64,7 @@
</template>
<script>
import crudDemand, { del } from './r005Demand'
import crudDemand, { del, transfer, push } from './r005Demand'
import CRUD, { crud, header, presenter } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation.vue'
import rrOperation from '@crud/RR.operation.vue'
@@ -89,6 +98,8 @@ export default {
{ value: '90', label: '取消' }
],
batchDeleting: false,
transferring: false,
pushing: false,
multipleSelection: []
}
},
@@ -113,6 +124,76 @@ export default {
handleSelectionChange(val) {
this.multipleSelection = val
},
isTransferDisabled() {
if (!this.multipleSelection.length) return true
// 只有未转移、状态为「分配」的需求单可以转普通需求单
return this.multipleSelection.some(item => item.transferStatus === '1' || String(item.status) !== '01')
},
isPushDisabled() {
if (!this.multipleSelection.length) return true
return this.multipleSelection.some(item => item.transferStatus === '1' || String(item.status) !== '01')
},
handleBatchPush() {
if (!this.multipleSelection.length) {
this.$message.warning('请先勾选要下推的需求单')
return
}
const invalidRows = this.multipleSelection.filter(item => item.transferStatus === '1' || String(item.status) !== '01')
if (invalidRows.length) {
this.$message.warning('仅支持下推未转移、状态为“分配”的需求单')
return
}
this.$confirm(`确认下推已勾选的 ${this.multipleSelection.length} 条需求单生成出库单吗?出库完成后将按 PP055 回传 SAP。`, '下推出库', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.pushing = true
push(this.multipleSelection).then(res => {
if (res.code === 400) {
this.$message.error('下推失败' + res.message)
return
}
this.$message.success('下推成功')
this.crud.toQuery()
}).catch(() => {
this.$message.error('下推失败')
}).finally(() => {
this.pushing = false
})
}).catch(() => {})
},
handleTransfer() {
if (!this.multipleSelection.length) {
this.$message.warning('请先勾选要转移的需求单')
return
}
const invalidRows = this.multipleSelection.filter(item => item.transferStatus === '1' || String(item.status) !== '01')
if (invalidRows.length) {
this.$message.warning('仅支持转移未转移、状态为“分配”的需求单')
return
}
const ids = this.multipleSelection.map(item => item.id)
this.$confirm(
`确认将已勾选的 ${ids.length} 条 R005 需求单转为普通需求单吗?转移后需在普通需求单页面人工分配仓库并下推出库。`,
'需求单转移',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}
).then(() => {
this.transferring = true
transfer(ids).then(res => {
const data = res.data || {}
const skipped = data.skipped || 0
this.$message.success('转移成功' + data.transferred + '条' + (skipped ? ',跳过' + skipped + '条(已转移/已取消)' : ''))
this.crud.toQuery()
}).finally(() => {
this.transferring = false
})
}).catch(() => {})
},
handleBatchDelete() {
const ids = this.multipleSelection.map(item => item.id)
if (!ids.length) {

View File

@@ -8,4 +8,26 @@ export function del(ids) {
})
}
export default { del }
/**
* 需求单转移:R005 需求单转成普通需求单(pm_demand),人工分配仓库后出库
*/
export function transfer(ids) {
return request({
url: 'api/pmDemandR005/transfer',
method: 'post',
data: ids
})
}
/**
* 下推出库:生成生产出库单,出库完成后回传 SAP PP055
*/
export function push(data) {
return request({
url: 'api/pmDemandR005/push',
method: 'post',
data
})
}
export default { del, transfer, push }