add:增加需求单自动分配
This commit is contained in:
@@ -60,4 +60,11 @@ export function issueReturnBill(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export function batchAllcation(data) {
|
||||
return request({
|
||||
url: '/api/pmDemand/autoAllcation',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, queryInventory, batchAllocate, allocate, push, issueReturnBill }
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<el-form :inline="true" label-position="right" label-width="100px" label-suffix=":" class="demo-form-inline">
|
||||
<el-form-item label="ID"><el-input v-model="query.id" clearable size="mini" placeholder="请输入ID" @keyup.enter.native="crud.toQuery" /></el-form-item>
|
||||
<el-form-item label="操作人"><el-input v-model="query.creator" clearable size="mini" placeholder="请输入操作人" @keyup.enter.native="crud.toQuery" /></el-form-item>
|
||||
<el-form-item label="工单编号"><el-input v-model="query.workOrder" clearable size="mini" placeholder="请输入工单编号" @keyup.enter.native="crud.toQuery" /></el-form-item>
|
||||
<el-form-item label="需求单编号"><el-input v-model="query.workOrder" clearable size="mini" placeholder="请输入需求单编号" @keyup.enter.native="crud.toQuery" /></el-form-item>
|
||||
<el-form-item label="物料编码"><el-input v-model="query.skuCode" clearable size="mini" placeholder="请输入物料编码/名称" @keyup.enter.native="crud.toQuery" /></el-form-item>
|
||||
<el-form-item label="产线"><el-input v-model="query.productionLine" clearable size="mini" placeholder="请输入产线" @keyup.enter.native="crud.toQuery" /></el-form-item>
|
||||
<el-form-item label="目标地点"><el-input v-model="query.targetArea" clearable size="mini" placeholder="请输入目标库存地点" @keyup.enter.native="crud.toQuery" /></el-form-item>
|
||||
@@ -24,6 +24,7 @@
|
||||
<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>
|
||||
<el-button slot="right" class="filter-item" type="success" icon="el-icon-s-promotion" size="mini" :disabled="isBatchAllocateDisabled()" @click="handleBatchAllocation">自动分配</el-button>
|
||||
</crudOperation>
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="900px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px" label-suffix=":" style="border: 1px solid #cfe0df;margin-top: 10px;padding: 10px;">
|
||||
@@ -32,7 +33,7 @@
|
||||
<el-col :span="12"><el-form-item label="需求日期" prop="createTime"><el-date-picker v-model="form.createTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择需求日期" style="width: 280px;" /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="优先级" prop="priority"><el-input-number v-model="form.priority" :min="0" :max="99999" style="width: 280px;" /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="状态" prop="status"><el-select v-model="form.status" style="width: 280px;" placeholder="请选择状态"><el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="工单编号" prop="workOrder"><el-input v-model.trim="form.workOrder" style="width: 280px;" /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="需求单编号" prop="workOrder"><el-input v-model.trim="form.workOrder" style="width: 280px;" /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="物料编码" prop="skuCode"><el-input v-model.trim="form.skuCode" style="width: 280px;" /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="物料名称" prop="skuName"><el-input v-model.trim="form.skuName" style="width: 280px;" /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="数量" prop="qty"><el-input-number v-model="form.qty" :min="0" :precision="4" :step="1" style="width: 280px;" /></el-form-item></el-col>
|
||||
@@ -86,7 +87,7 @@
|
||||
|
||||
<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="workOrder" label="工单编号" min-width="140" 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 />
|
||||
@@ -121,7 +122,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudDemand, { queryInventory, allocate, batchAllocate, push } from './demand'
|
||||
import crudDemand, {queryInventory, allocate, batchAllocate, push, batchAllcation} from './demand'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation.vue'
|
||||
import udOperation from '@crud/UD.operation.vue'
|
||||
@@ -175,7 +176,7 @@ export default {
|
||||
creator: [{ required: true, message: '请输入操作人', trigger: 'blur' }],
|
||||
createTime: [{ required: true, message: '请选择需求日期', trigger: 'change' }],
|
||||
priority: [{ required: true, message: '请输入优先级', trigger: 'change' }],
|
||||
workOrder: [{ required: true, message: '请输入工单编号', trigger: 'blur' }],
|
||||
workOrder: [{ required: true, message: '请输入需求单编号', trigger: 'blur' }],
|
||||
skuCode: [{ required: true, message: '请输入物料编码', trigger: 'blur' }],
|
||||
skuName: [{ required: true, message: '请输入物料名称', trigger: 'blur' }],
|
||||
qty: [{ required: true, message: '请输入数量', trigger: 'change' }],
|
||||
@@ -351,6 +352,34 @@ export default {
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
handleBatchAllocation() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message.warning('请先勾选要下推的需求单')
|
||||
return
|
||||
}
|
||||
const invalidRows = this.multipleSelection.filter(item => String(item.status) !== '0')
|
||||
if (invalidRows.length) {
|
||||
this.$message.warning('仅支持状态为“生成”的自动分配需求单')
|
||||
return
|
||||
}
|
||||
this.$confirm(`确认自动分配已勾选的 ${this.multipleSelection.length} 条需求单吗?`, '提示', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const ids = this.multipleSelection.map(s => s.id)
|
||||
batchAllcation(ids).then(res => {
|
||||
if (res.code === 400) {
|
||||
this.$message.error('自动分配失败' + res.message)
|
||||
return
|
||||
}
|
||||
this.$message.success('自动分配成功')
|
||||
this.crud.toQuery()
|
||||
}).catch(() => {
|
||||
this.$message.error('自动分配失败')
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
isBatchAllocateDisabled() {
|
||||
if (!this.multipleSelection.length) return true
|
||||
return this.multipleSelection.some(item => String(item.status) !== '0')
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
<crudOperation :permission="permission">
|
||||
<el-button slot="right" class="filter-item" type="primary" icon="el-icon-printer" size="mini" :disabled="actionDisabled" @click="printBill">打印</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="success" icon="el-icon-s-promotion" size="mini" :disabled="isPushDisabled()" @click="batchAllocate">自动分配</el-button>
|
||||
</crudOperation>
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" highlight-current-row style="width: 100%;" @selection-change="handleSelectionChange" @current-change="handleCurrentChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
@@ -378,6 +379,33 @@ export default {
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
batchAllocate() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message.warning('请先勾选要下推的退料单')
|
||||
return
|
||||
}
|
||||
const invalidRows = this.multipleSelection.filter(item => String(item.status) !== '10')
|
||||
if (invalidRows.length) {
|
||||
this.$message.warning('仅支持批量下推状态为“分配”退料单')
|
||||
return
|
||||
}
|
||||
this.$confirm(`确认批量下推已勾选的 ${this.multipleSelection.length} 条退料单吗?`, '提示', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
upload(this.multipleSelection[0]).then(res => {
|
||||
if (res.code == 400) {
|
||||
this.$message.warning('分配失败' + res.message)
|
||||
return
|
||||
}
|
||||
this.$message.success('下推成功')
|
||||
this.crud.toQuery()
|
||||
}).catch(() => {
|
||||
this.$message.error('下推失败')
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
printBill() {
|
||||
const selections = this.crud.selections
|
||||
if (!selections || selections.length === 0) {
|
||||
|
||||
@@ -135,23 +135,24 @@
|
||||
<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;">
|
||||
<el-table-column prop="seq" label="行序号" width="80" />
|
||||
<el-table-column label="回传状态" min-width="140">
|
||||
<el-table-column prop="seq" label="序号" width="60" />
|
||||
<el-table-column label="状态" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ statusLabel(scope.row.status) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="materialno" label="物料编号" min-width="120" />
|
||||
<el-table-column prop="unitno" label="单位编号" min-width="100" />
|
||||
<el-table-column prop="qty" label="工单扣减数量" min-width="100" />
|
||||
<el-table-column prop="baseqty" label="bom数量" min-width="100" />
|
||||
<el-table-column prop="warehouseno" label="仓库编号" min-width="120" />
|
||||
<el-table-column prop="updateTime" label="更新时间" min-width="120" />
|
||||
<el-table-column prop="remark" label="说明" min-width="120" />
|
||||
<el-table-column prop="lotnumber" label="批号" min-width="100" />
|
||||
<el-table-column prop="tracknumber" 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="210" align="center" fixed="right">
|
||||
<el-table-column label="操作" width="120" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
|
||||
Reference in New Issue
Block a user