add:启动注入定时器任务;倒冲领料忽略过账
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="serialNo" width="90" label="序号" />
|
||||
<el-table-column prop="status" width="100" label="状态" :formatter="statusFormat" />
|
||||
<!-- <el-table-column prop="status" width="100" label="状态" :formatter="statusFormat" />-->
|
||||
<el-table-column prop="status" label="单据状态" width="90">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="statusTagType(scope.row.status)" size="mini">{{ statusFormat(scope.row.status) }}</el-tag>
|
||||
@@ -284,8 +284,8 @@ export default {
|
||||
if (this.multipleSelection.length !== 1) return true
|
||||
return this.multipleSelection[0].status !== 10
|
||||
},
|
||||
statusFormat(row) {
|
||||
return this.statusLabel(row.status)
|
||||
statusFormat(status) {
|
||||
return this.statusLabel(status)
|
||||
},
|
||||
statusTagType(status) {
|
||||
const map = { '0': '', '1': 'warning', '10': 'primary', '20': 'primary', '80': 'success', '90': 'danger' }
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
type="sucess"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="allowAgainSubmit()"
|
||||
@click="deductionOrderSync"
|
||||
>
|
||||
重新提交报工
|
||||
@@ -132,7 +133,16 @@
|
||||
<el-descriptions-item label="出入库单号" :span="2">{{ currentRow.requestId }}</el-descriptions-item>
|
||||
<el-descriptions-item label="报工参数" :span="2">{{ currentRow.reportParam }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-table :data="pagedDetails" size="mini" style="width: 100%; margin-top: 12px;">
|
||||
<div style="margin-top: 12px;">
|
||||
<el-button size="mini" type="warning" plain :disabled="!canBatchIgnore" @click="handleBatchIgnore">
|
||||
批量忽略过账
|
||||
</el-button>
|
||||
<el-button size="mini" type="success" plain :disabled="!canBatchRestore" @click="handleBatchRestore">
|
||||
批量恢复过账
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table ref="detailTable" :data="pagedDetails" size="mini" style="width: 100%; margin-top: 8px;" @selection-change="onDetailSelectionChange">
|
||||
<el-table-column type="selection" width="40" />
|
||||
<el-table-column prop="seq" label="序号" width="60" />
|
||||
<el-table-column label="状态" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
@@ -142,23 +152,14 @@
|
||||
<el-table-column prop="materialno" label="物料编号" min-width="120" />
|
||||
<el-table-column prop="materialname" label="物料名称" min-width="180" />
|
||||
<el-table-column prop="unitno" label="单位" min-width="70" />
|
||||
<!-- <el-table-column prop="qty" label="工单扣减数量" min-width="100" />-->
|
||||
<el-table-column prop="baseqty" label="BOM数量" min-width="50" />
|
||||
<el-table-column prop="warehouseno" label="仓库" min-width="60" />
|
||||
<el-table-column prop="remark" label="备注" min-width="180" />
|
||||
<!-- <el-table-column prop="lotnumber" label="批号" min-width="100" />-->
|
||||
<!-- <el-table-column prop="tracknumber" label="追踪号" min-width="120" />-->
|
||||
<el-table-column prop="updateTime" label="更新时间" min-width="130" />
|
||||
<!-- 新增操作列 -->
|
||||
<el-table-column label="操作" width="140" align="center" fixed="right">
|
||||
<el-table-column label="操作" width="110" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
plain
|
||||
@click="handleSyncEasStock(scope.row)"
|
||||
>
|
||||
{{ scope.row.easQty || '库存查询' }}
|
||||
<el-button size="mini" type="primary" plain @click="handleSyncEasStock(scope.row)">
|
||||
EAS库存
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -183,8 +184,7 @@ import rrOperation from '@crud/RR.operation.vue'
|
||||
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 './receiveOutReturn'
|
||||
import { get, uploadReceiveOut, ignoreDetails, restoreDetails } from './receiveOutReturn'
|
||||
|
||||
const createDefaultForm = () => ({
|
||||
id: null,
|
||||
@@ -232,6 +232,7 @@ export default {
|
||||
uploadFlag: true,
|
||||
currentRow: {},
|
||||
detailPage: { page: 1, size: 10 },
|
||||
detailSelections: [],
|
||||
permission: {
|
||||
add: ['purchasemst:add'],
|
||||
edit: ['purchasemst:edit'],
|
||||
@@ -239,10 +240,10 @@ export default {
|
||||
},
|
||||
statusOptions: [
|
||||
{ value: '0', label: '待过账' },
|
||||
{ value: '1', label: '过账成功' },
|
||||
{ value: '1', label: '过账完成' },
|
||||
{ value: '2', label: '过账中' },
|
||||
{ value: '3', label: '过账异常' },
|
||||
{ value: '4', label: '忽略过账' },
|
||||
{ value: '3', label: '重新提交' },
|
||||
{ value: '4', label: '忽略过账' }
|
||||
],
|
||||
rules: {
|
||||
orgno: [{ required: true, message: '请输入机构编号', trigger: 'blur' }],
|
||||
@@ -256,6 +257,14 @@ export default {
|
||||
const list = this.currentRow.details || []
|
||||
const start = (this.detailPage.page - 1) * this.detailPage.size
|
||||
return list.slice(start, start + this.detailPage.size)
|
||||
},
|
||||
canBatchIgnore() {
|
||||
if (!this.detailSelections.length) { return false }
|
||||
return this.detailSelections.every(r => String(r.status) !== '4' && String(r.status) !== '1')
|
||||
},
|
||||
canBatchRestore() {
|
||||
if (!this.detailSelections.length) { return false }
|
||||
return this.detailSelections.every(r => String(r.status) === '4')
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -278,7 +287,7 @@ export default {
|
||||
}
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length == 1) {
|
||||
if (val.length === 1) {
|
||||
if (val[0].status === '0' || val[0].status === '2') {
|
||||
this.uploadFlag = false
|
||||
}
|
||||
@@ -294,8 +303,10 @@ export default {
|
||||
this.currentRow = currentRow
|
||||
}
|
||||
},
|
||||
onDetailSelectionChange(selections) {
|
||||
this.detailSelections = selections
|
||||
},
|
||||
handleSyncEasStock(row) {
|
||||
// 检查必要参数
|
||||
if (!row.materialno) {
|
||||
this.$message.warning('物料编号不能为空')
|
||||
return
|
||||
@@ -306,15 +317,57 @@ export default {
|
||||
}
|
||||
crudReceiveOutReturn.allStock({ 'warehouseno': row.warehouseno, 'materialno': row.materialno }).then(res => {
|
||||
if (res.code === 200) {
|
||||
// 显示同步结果
|
||||
const qty = res.data
|
||||
// 可选:在行中显示查询到的库存数量
|
||||
this.$set(row, 'easQty', qty)
|
||||
} else {
|
||||
this.$message.error(res.message || 'EAS库存查询失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
handleBatchIgnore() {
|
||||
const ids = this.detailSelections.map(r => r.id)
|
||||
if (!ids.length) {
|
||||
this.$message.warning('请选择要操作的明细')
|
||||
return
|
||||
}
|
||||
this.$confirm(`确认将选中的 ${ids.length} 条明细置为忽略过账?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
ignoreDetails(ids).then(() => {
|
||||
this.$message.success('批量忽略过账成功')
|
||||
this.refreshDetailView()
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
handleBatchRestore() {
|
||||
const ids = this.detailSelections.map(r => r.id)
|
||||
if (!ids.length) {
|
||||
this.$message.warning('请选择要操作的明细')
|
||||
return
|
||||
}
|
||||
this.$confirm(`确认恢复选中的 ${ids.length} 条明细的过账状态?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
restoreDetails(ids).then(() => {
|
||||
this.$message.success('批量恢复过账成功')
|
||||
this.refreshDetailView()
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
refreshDetailView() {
|
||||
if (!this.currentRow.id) {
|
||||
return
|
||||
}
|
||||
get(this.currentRow.id).then(res => {
|
||||
this.currentRow = res.data
|
||||
this.detailPage.page = 1
|
||||
this.detailSelections = []
|
||||
})
|
||||
},
|
||||
upload() {
|
||||
const rows = this.crud.selections || []
|
||||
if (rows.length < 1) {
|
||||
@@ -358,9 +411,10 @@ export default {
|
||||
return
|
||||
}
|
||||
const row = rows[0]
|
||||
|
||||
const doUpload = () => {
|
||||
this.fullscreenLoading = true
|
||||
crudReceiveOutReturn.deductionOrderSync(JSON.parse(row.reportParam)).then(() => {
|
||||
crudReceiveOutReturn.reSubmit([row.id]).then(() => {
|
||||
this.crud.notify('单据重新报工成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}).finally(() => {
|
||||
@@ -403,6 +457,10 @@ export default {
|
||||
this.detailPage.page = 1
|
||||
this.viewShow = true
|
||||
})
|
||||
},
|
||||
allowAgainSubmit() {
|
||||
const rows = this.crud.selections || []
|
||||
return rows.some(item => item.status !== '3')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,4 +59,37 @@ export function deductionOrderSync(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, get, easStock, uploadReceiveOut, allStock, deductionOrderSync }
|
||||
export function reSubmit(data) {
|
||||
return request({
|
||||
url: '/api/receiveOutReturn/reSubmit',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function ignoreDetails(ids) {
|
||||
return request({
|
||||
url: '/api/receiveOutReturn/detail/ignore/batch',
|
||||
method: 'put',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
export function restoreDetails(ids) {
|
||||
return request({
|
||||
url: '/api/receiveOutReturn/detail/restore/batch',
|
||||
method: 'put',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
export function ignoreDetail(detailId) {
|
||||
return request({
|
||||
url: '/api/receiveOutReturn/detail/ignore/' + detailId,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
export function restoreDetail(detailId) {
|
||||
return request({
|
||||
url: '/api/receiveOutReturn/detail/restore/' + detailId,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, get, easStock, uploadReceiveOut, allStock, deductionOrderSync, reSubmit, ignoreDetail, restoreDetail, ignoreDetails, restoreDetails }
|
||||
|
||||
Reference in New Issue
Block a user