fix:优化出库逻辑

This commit is contained in:
zhangzq
2026-07-22 16:53:25 +08:00
parent 5d7393fa16
commit 8298df2cf6
25 changed files with 466 additions and 710 deletions

View File

@@ -82,7 +82,11 @@
>
<el-table-column type="selection" width="55" />
<el-table-column prop="request_Id" label="回传业务单据号" min-width="170" />
<el-table-column prop="request_type" label="回传类型" min-width="120" :formatter="formatRequestType" />
<el-table-column prop="request_type" label="回传类型" min-width="120" >
<template slot-scope="scope">
{{ dict.label.INANDOUT_BILL_TYPE[scope.row.request_type] }}
</template>
</el-table-column>
<el-table-column prop="status" label="状态" min-width="90" :formatter="formatStatus" />
<el-table-column prop="error_msg" label="ERP处理失败记录" min-width="220" show-overflow-tooltip />
<el-table-column prop="create_time" label="单据创建时间" min-width="160" />
@@ -124,7 +128,7 @@
</template>
<script>
import inandoutreturn from '@/views/wms/st/inAndOutReturn/inandoutreturn'
import inandoutreturn from './inandoutreturn'
import CRUD, { crud, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
@@ -148,6 +152,7 @@ export default {
})
},
mixins: [presenter(), header(), crud()],
dicts: ['INANDOUT_BILL_TYPE'],
data() {
return {
permission: {},
@@ -158,14 +163,6 @@ export default {
{ value: '1', label: '成功' },
{ value: '2', label: '失败' }
],
typeStatusMap: {
'生产入库': '0001',
'采购入库': '0005',
'手工入库': '0009',
'销售出库': '1001',
'生产出库': '1005',
'手工出库': '1009'
},
jsonDialog: {
visible: false,
edit: false,

View File

@@ -129,6 +129,7 @@ export default {
},
isPushDisabled() {
// 没有选中、选中多行、或选中的行状态不是 '0' 时禁用
// eslint-disable-next-line no-debugger
if (this.multipleSelection.length !== 1) return true
return this.multipleSelection[0].bill_status !== '0'
},
@@ -177,6 +178,7 @@ export default {
},
handleSelectionChange(val, row) {
console.log(val.length)
this.multipleSelection = val
if (val.length == 0) {
this.audit_flag = true
} else {
@@ -200,27 +202,22 @@ export default {
return
}
// eslint-disable-next-line eqeqeq
debugger
const invalidRows = this.multipleSelection.filter(item => String(item.bill_status) === '99')
if (invalidRows.length) {
this.$message.warning('仅支持批量下推状态为“分配”的需求单')
return
}
this.$confirm(`确认批量下推已勾选的 ${this.multipleSelection.length} 条需求单吗?`, '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
crudPurchase.outPush(this.multipleSelection[0]).then(res => {
if (res.code === 200) {
this.$message.success('下推成功')
this.crud.toQuery()
} else {
this.$message.error(res.message)
}
}).catch(() => {
this.$message.error('下推失败')
})
}).catch(() => {})
crudPurchase.outPush(this.multipleSelection[0]).then(res => {
if (res.code === 200) {
this.$message.success('下推成功')
this.crud.toQuery()
} else {
this.$message.error(res.message)
}
}).catch(() => {
this.$message.error('下推失败')
})
},
issueReturnBill() {

View File

@@ -53,5 +53,11 @@ export function pushZD(data) {
data
})
}
export default { add, edit, del, get, issueReturnBill, print, pushZD }
export function outPush(data) {
return request({
url: '/api/purchasemst/outPush',
method: 'post',
data
})
}
export default { add, edit, del, get, issueReturnBill, print, pushZD, outPush }

View File

@@ -156,7 +156,7 @@ import crudOperation from '@crud/CRUD.operation.vue'
import udOperation from '@crud/UD.operation.vue'
import pagination from '@crud/Pagination.vue'
import { get } from './receiveOutReturn'
import { uploadReceiveOut } from '@/views/wms/st/inAndOutReturn/inandoutreturn'
import { uploadReceiveOut } from './receiveOutReturn'
const createDefaultForm = () => ({
id: null,

View File

@@ -37,5 +37,11 @@ export function easStock(param) {
params: param
})
}
export default { add, edit, del, get, easStock }
export function uploadReceiveOut(data) {
return request({
url: '/api/receiveOutReturn/upload',
method: 'post',
data
})
}
export default { add, edit, del, get, easStock, uploadReceiveOut }

View File

@@ -70,7 +70,7 @@
:disabled="button1"
@click="oneDiv()"
>
自动分配
按行分配
</el-button>
<el-button
v-if="this.mstrow.bill_type !== '1011'"
@@ -83,7 +83,7 @@
:disabled="button2"
@click="oneCancel()"
>
自动取消
按行取消
</el-button>
<el-button
slot="left"
@@ -162,7 +162,7 @@
<el-form-item label="出库区" prop="gender2">
<el-cascader
placeholder="请选择"
:options="outBoundRegion"
:options="outBoundPoint"
:props="{ checkStrictly: true }"
clearable
@change="outBoundChange"
@@ -293,6 +293,7 @@ export default {
},
sects: [],
outBoundRegion: [],
outBoundPoint: [],
pointList: [],
rules: {
}
@@ -323,6 +324,7 @@ export default {
})
crudPoint.getRegionPoints({ 'regionCode': 'CKQ' }).then(res => {
this.outBoundRegion = res.data
this.outBoundPoint = res.data
})
},
close() {
@@ -397,9 +399,11 @@ export default {
this.form2.unassign_qty = current.unassign_qty
this.form2.assign_qty = current.assign_qty
if (current.source_load_port !== null) {
this.outBoundRegion = [
this.outBoundPoint = [
{ label: current.source_load_port, value: current.source_load_port }
];
]
} else {
this.outBoundPoint = this.outBoundRegion
}
this.tabledis = []
if (current.bill_status === '10') {
@@ -407,9 +411,9 @@ export default {
this.button2 = true
this.button3 = false
} else if (current.bill_status === '30') {
this.button1 = false
this.button1 = true
this.button2 = false
this.button3 = false
this.button3 = true
} else if (current.bill_status === '40') {
this.button1 = true
this.button2 = false

View File

@@ -97,7 +97,7 @@
<el-table-column show-overflow-tooltip sortable prop="frozen_qty" label="冻结数量" align="center" width="150px" />
<el-table-column show-overflow-tooltip prop="qty" label="分配数量" :formatter="crud.formatNum3" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.change_qty" clearable style="width: 120px" />
<el-input-number v-model="scope.row.change_qty" :max="scope.row.qty" clearable style="width: 100px" />
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="160" fixed="right">