add:增加需求单功能;
opt:优化组盘表,根据物料编码存储
This commit is contained in:
@@ -24,4 +24,12 @@ export function edit(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
export function getAllGroupInfo(data) {
|
||||
return request({
|
||||
url: 'api/group/getAllGroupInfo',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getAllGroupInfo }
|
||||
|
||||
@@ -179,6 +179,8 @@
|
||||
</div>
|
||||
<!--放引用的组件-->
|
||||
<MaterialDialog :dialog-show.sync="materialDialog" @materialChoose="materialChoose" />
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -190,6 +192,7 @@ import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import MaterialDialog from '@/views/wms/basedata/material/MaterialDialog'
|
||||
import AddDialog from '@/views/wms/basedata/group/AddDialog'
|
||||
|
||||
const defaultForm = {
|
||||
group_id: null,
|
||||
@@ -211,7 +214,7 @@ const defaultForm = {
|
||||
}
|
||||
export default {
|
||||
name: 'Group',
|
||||
components: { pagination, MaterialDialog, crudOperation, rrOperation, udOperation },
|
||||
components: { pagination, MaterialDialog, crudOperation, rrOperation, udOperation, AddDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
tableEnums: ['md_pb_measureunit#unit_name#measure_unit_id'],
|
||||
// 数据字典
|
||||
@@ -243,6 +246,9 @@ export default {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
formattStatus(row) {
|
||||
return this.dict.label.GROUP_STATUS[row.status]
|
||||
},
|
||||
|
||||
51
nladmin-ui/src/views/wms/pm_manage/demand/demand.js
Normal file
51
nladmin-ui/src/views/wms/pm_manage/demand/demand.js
Normal file
@@ -0,0 +1,51 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/pmDemand',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/pmDemand',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/pmDemand',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function queryInventory(skuCode) {
|
||||
return request({
|
||||
url: 'api/pmDemand/queryInventory',
|
||||
method: 'get',
|
||||
params: { skuCode }
|
||||
})
|
||||
}
|
||||
|
||||
export function allocate(data) {
|
||||
return request({
|
||||
url: 'api/pmDemand/allocate',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function push(data) {
|
||||
return request({
|
||||
url: 'api/pmDemand/push',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, queryInventory, allocate, push }
|
||||
262
nladmin-ui/src/views/wms/pm_manage/demand/index.vue
Normal file
262
nladmin-ui/src/views/wms/pm_manage/demand/index.vue
Normal file
@@ -0,0 +1,262 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<div>
|
||||
<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.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>
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="query.status" clearable size="mini" placeholder="请选择状态" class="filter-item" @change="crud.toQuery">
|
||||
<el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="需求日期">
|
||||
<el-date-picker v-model="query.datepick" type="daterange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
|
||||
</el-form-item>
|
||||
<rrOperation :crud="crud" />
|
||||
</el-form>
|
||||
</div>
|
||||
<crudOperation :permission="permission" />
|
||||
<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;">
|
||||
<el-row>
|
||||
<el-col :span="12"><el-form-item label="操作人" prop="creator"><el-input v-model.trim="form.creator" style="width: 280px;" /></el-form-item></el-col>
|
||||
<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="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>
|
||||
<el-col :span="12"><el-form-item label="单位" prop="unit"><el-input v-model.trim="form.unit" style="width: 280px;" /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="目标库存地点" prop="targetArea"><el-input v-model.trim="form.targetArea" style="width: 280px;" /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="产线" prop="productionLine"><el-input v-model.trim="form.productionLine" style="width: 280px;" /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="车辆序列号" prop="sn"><el-input v-model.trim="form.sn" style="width: 280px;" /></el-form-item></el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer"><el-button type="text" @click="crud.cancelCU">取消</el-button><el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button></div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 库存分配对话框 -->
|
||||
<el-dialog :visible.sync="allocateVisible" title="库存分配" width="820px" :close-on-click-modal="false" @close="closeAllocateDialog">
|
||||
<div style="margin-bottom:10px;color:#606266;font-size:13px;">
|
||||
需求单:<strong>{{ currentDemand.workOrder }}</strong> |
|
||||
物料:<strong>{{ currentDemand.skuCode }} {{ currentDemand.skuName }}</strong> |
|
||||
需求数量:<strong style="color:#E6A23C;">{{ currentDemand.qty }} {{ currentDemand.unit }}</strong>
|
||||
</div>
|
||||
<el-table ref="allocateTable" :data="inventoryList" size="small" border v-loading="inventoryLoading" @selection-change="handleInventorySelection">
|
||||
<el-table-column type="selection" width="45" />
|
||||
<el-table-column prop="houseCode" label="仓库编号" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="houseName" label="仓库名称" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="skuCode" label="物料编码" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="qty" label="库存数量" width="110" />
|
||||
<el-table-column label="分配数量" width="160">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="scope.row.allocQty" :min="0" :max="scope.row.qty" :precision="4" size="mini" style="width:130px;" :disabled="!scope.row._selected" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="mini" @click="closeAllocateDialog">取消</el-button>
|
||||
<el-button size="mini" type="primary" :loading="allocateSaving" @click="saveAllocate">保存分配</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<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 />
|
||||
<el-table-column prop="priority" label="优先级" width="80" />
|
||||
<el-table-column prop="status" label="状态" width="90">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="statusTagType(scope.row.status)" size="mini">{{ statusLabel(scope.row.status) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="workOrder" label="工单编号" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="skuCode" label="物料编码" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="skuName" label="物料名称" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="qty" label="数量" width="100" />
|
||||
<el-table-column prop="unit" label="单位" width="80" />
|
||||
<el-table-column prop="targetArea" label="目标库存地点" min-width="140" show-overflow-tooltip />
|
||||
<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 />
|
||||
<el-table-column label="操作" width="240px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation style="display: inline" :data="scope.row" :permission="permission" />
|
||||
<el-button size="mini" type="warning" plain style="margin-left:4px;" @click="openAllocateDialog(scope.row)">分配</el-button>
|
||||
<el-button size="mini" type="success" plain style="margin-left:4px;" :disabled="scope.row.status !== '01'" @click="handlePush(scope.row)">下发</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudDemand, { queryInventory, allocate, push } 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'
|
||||
import rrOperation from '@crud/RR.operation.vue'
|
||||
import pagination from '@crud/Pagination.vue'
|
||||
|
||||
const createDefaultForm = () => ({ id: null, creator: '', createTime: '', priority: 0, status: 0, workOrder: '', skuCode: '', skuName: '', qty: undefined, unit: '', targetArea: '', productionLine: '', sn: '' })
|
||||
|
||||
export default {
|
||||
name: 'Demand',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(createDefaultForm()), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '需求单', url: 'api/pmDemand', idField: 'id', sort: 'priority,desc', crudMethod: { ...crudDemand }, optShow: { add: true, reset: true } })
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
statusOptions: [
|
||||
{ value: 0, label: '生成' },
|
||||
{ value: '01', label: '分配' },
|
||||
{ value: '10', label: '下发' },
|
||||
{ value: '20', label: '执行' },
|
||||
{ value: '80', label: '完成' },
|
||||
{ value: '90', label: '取消' }
|
||||
],
|
||||
allocateVisible: false,
|
||||
inventoryLoading: false,
|
||||
allocateSaving: false,
|
||||
currentDemand: {},
|
||||
inventoryList: [],
|
||||
selectedInventory: [],
|
||||
rules: {
|
||||
creator: [{ required: true, message: '请输入操作人', trigger: 'blur' }],
|
||||
createTime: [{ required: true, message: '请选择需求日期', trigger: 'change' }],
|
||||
priority: [{ required: true, message: '请输入优先级', trigger: 'change' }],
|
||||
workOrder: [{ required: true, message: '请输入工单编号', trigger: 'blur' }],
|
||||
skuCode: [{ required: true, message: '请输入物料编码', trigger: 'blur' }],
|
||||
skuName: [{ required: true, message: '请输入物料名称', trigger: 'blur' }],
|
||||
qty: [{ required: true, message: '请输入数量', trigger: 'change' }],
|
||||
unit: [{ required: true, message: '请输入单位', trigger: 'blur' }],
|
||||
targetArea: [{ required: true, message: '请输入目标库存地点', trigger: 'blur' }],
|
||||
productionLine: [{ required: true, message: '请输入产线', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
if (this.query.datepick) {
|
||||
this.query.startTime = this.query.datepick[0]
|
||||
this.query.endTime = this.query.datepick.length > 1 ? this.query.datepick[1] : this.query.datepick[0]
|
||||
} else {
|
||||
this.query.startTime = ''
|
||||
this.query.endTime = ''
|
||||
}
|
||||
},
|
||||
statusLabel(status) {
|
||||
const target = this.statusOptions.find(item => String(item.value) === String(status))
|
||||
return target ? target.label : status
|
||||
},
|
||||
statusTagType(status) {
|
||||
const map = { 0: '', '01': 'warning', '10': 'primary', '20': 'primary', '80': 'success', '90': 'danger' }
|
||||
return map[String(status)] || ''
|
||||
},
|
||||
openAllocateDialog(row) {
|
||||
this.currentDemand = { ...row }
|
||||
this.inventoryList = []
|
||||
this.selectedInventory = []
|
||||
this.allocateVisible = true
|
||||
this.inventoryLoading = true
|
||||
queryInventory(row.skuCode).then(res => {
|
||||
const demandQty = Number(row.qty) || 0
|
||||
this.inventoryList = (res || []).map(item => ({
|
||||
...item,
|
||||
_selected: false,
|
||||
allocQty: Math.min(Number(item.qty) || 0, demandQty)
|
||||
}))
|
||||
if (row.inventoryDis) {
|
||||
try {
|
||||
const saved = JSON.parse(row.inventoryDis)
|
||||
this.inventoryList.forEach(item => {
|
||||
const match = saved.find(s => s.houseCode === item.houseCode)
|
||||
if (match) {
|
||||
item._selected = true
|
||||
item.allocQty = match.allocQty
|
||||
this.$nextTick(() => {
|
||||
this.$refs.allocateTable && this.$refs.allocateTable.toggleRowSelection(item, true)
|
||||
})
|
||||
}
|
||||
})
|
||||
} catch (e) { }
|
||||
}
|
||||
}).finally(() => {
|
||||
this.inventoryLoading = false
|
||||
})
|
||||
},
|
||||
closeAllocateDialog() {
|
||||
this.allocateVisible = false
|
||||
this.currentDemand = {}
|
||||
this.inventoryList = []
|
||||
this.selectedInventory = []
|
||||
},
|
||||
handleInventorySelection(selection) {
|
||||
this.selectedInventory = selection
|
||||
this.inventoryList.forEach(item => {
|
||||
item._selected = selection.some(s => s.houseCode === item.houseCode)
|
||||
})
|
||||
},
|
||||
saveAllocate() {
|
||||
if (!this.selectedInventory.length) {
|
||||
this.$message.warning('请至少勾选一条库存记录')
|
||||
return
|
||||
}
|
||||
const invalidRow = this.selectedInventory.find(item => !item.allocQty || item.allocQty <= 0)
|
||||
if (invalidRow) {
|
||||
this.$message.warning(`仓库 ${invalidRow.houseCode} 的分配数量必须大于0`)
|
||||
return
|
||||
}
|
||||
const inventoryDis = JSON.stringify(
|
||||
this.selectedInventory.map(item => ({
|
||||
houseCode: item.houseCode,
|
||||
houseName: item.houseName,
|
||||
skuCode: item.skuCode,
|
||||
skuName: item.skuName,
|
||||
qty: item.qty,
|
||||
allocQty: item.allocQty
|
||||
}))
|
||||
)
|
||||
this.allocateSaving = true
|
||||
allocate({ id: this.currentDemand.id, inventoryDis }).then(() => {
|
||||
this.$message.success('库存分配成功')
|
||||
this.closeAllocateDialog()
|
||||
this.crud.toQuery()
|
||||
}).catch(() => {
|
||||
this.$message.error('库存分配失败')
|
||||
}).finally(() => {
|
||||
this.allocateSaving = false
|
||||
})
|
||||
},
|
||||
handlePush(row) {
|
||||
this.$confirm(`确认下发需求单 "${row.workOrder}" 吗?`, '提示', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
push({ id: row.id, workOrder: row.workOrder }).then(() => {
|
||||
this.$message.success('下发成功')
|
||||
this.crud.toQuery()
|
||||
}).catch(() => {
|
||||
this.$message.error('下发失败')
|
||||
})
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@@ -313,7 +313,7 @@ export default {
|
||||
rows.forEach((item) => {
|
||||
let same_mater = true
|
||||
this.form.tableData.forEach((row) => {
|
||||
if (row.pcsn === item.pcsn) {
|
||||
if (row.pcsn === item.pcsn && row.material_id === item.material_id && row.storagevehicle_code === item.storagevehicle_code) {
|
||||
same_mater = false
|
||||
}
|
||||
})
|
||||
|
||||
@@ -77,12 +77,12 @@ import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
import crudRawAssist from '@/views/wms/st/inbill/rawassist'
|
||||
import group, { getAllGroupInfo } from '@/views/wms/basedata/group/group.js'
|
||||
|
||||
const start = new Date()
|
||||
export default {
|
||||
name: 'AddDtl',
|
||||
components: { crudOperation, rrOperation, pagination, DateRangePicker },
|
||||
components: { crudOperation, rrOperation, pagination, DateRangePicker, group },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '用户',
|
||||
@@ -149,10 +149,10 @@ export default {
|
||||
console.log('获取的rows:')
|
||||
console.log(this.rows)
|
||||
this.$emit('tableChanged', this.rows)
|
||||
// crudRawAssist.queryBoxMater(this.rows).then(res => {
|
||||
// this.rows = res
|
||||
// this.$emit('tableChanged', this.rows)
|
||||
// })
|
||||
group.getAllGroupInfo(this.rows).then(res => {
|
||||
this.rows = res.content
|
||||
this.$emit('tableChanged', this.rows)
|
||||
})
|
||||
// this.form = this.$options.data().form
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,6 +72,20 @@
|
||||
label="数量"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
show-overflow-tooltip
|
||||
prop="assign_qty"
|
||||
:formatter="crud.formatNum3"
|
||||
label="分配数量"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
show-overflow-tooltip
|
||||
prop="unassign_qty"
|
||||
:formatter="crud.formatNum3"
|
||||
label="未分配数量"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="source_bill_code" label="源单号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="source_bill_type" label="源单类型" align="center" />
|
||||
@@ -155,10 +169,13 @@
|
||||
:data="form.tableMater"
|
||||
style="width: 100%;"
|
||||
max-height="300"
|
||||
highlight-current-row
|
||||
@row-click="clcikDisRow"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column show-overflow-tooltip type="index" label="序号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具编码" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="批次号" align="center" />
|
||||
@@ -215,7 +232,7 @@ export default {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
storId: {
|
||||
storCode: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
@@ -236,6 +253,7 @@ export default {
|
||||
sect_val: null,
|
||||
form: {
|
||||
dtl_row: null,
|
||||
dis_row: null,
|
||||
storage_qty: '',
|
||||
point_code: null,
|
||||
checked: true,
|
||||
@@ -255,7 +273,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudSectattr.getSectCode({ 'stor_id': this.storId }).then(res => {
|
||||
crudSectattr.getSectCode({ 'stor_code': this.storCode }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
|
||||
@@ -283,11 +301,15 @@ export default {
|
||||
crudRawAssist.getIODtl({ 'bill_code': this.form.dtl_row.bill_code }).then(res => {
|
||||
this.openParam = res
|
||||
this.form.dtl_row = res[row.index]
|
||||
this.form.dis_row = null
|
||||
})
|
||||
crudRawAssist.getDisDtl(row).then(res => {
|
||||
this.form.tableMater = res
|
||||
})
|
||||
},
|
||||
clcikDisRow(row, column, event) {
|
||||
this.form.dis_row = row
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
row.index = rowIndex
|
||||
},
|
||||
@@ -369,6 +391,10 @@ export default {
|
||||
this.crud.notify('请先选择一条明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
if (!this.form.dis_row) {
|
||||
this.crud.notify('请先选择一条分配明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
// 如果勾选了,直接跳后台
|
||||
if (this.form.checked) {
|
||||
if (!this.sect_code) {
|
||||
@@ -385,6 +411,7 @@ export default {
|
||||
crudRawAssist.getDisDtl(this.form.dtl_row).then(res => {
|
||||
this.form.tableMater = res
|
||||
this.divBtn = false
|
||||
this.form.dis_row = null
|
||||
this.crud.notify('分配货位成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
}).finally(() => {
|
||||
@@ -403,9 +430,8 @@ export default {
|
||||
this.crud.notify('不存在载具明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
const flag = this.form.tableMater.some(mater => !mater.struct_code)
|
||||
if (flag) {
|
||||
this.crud.notify('明细存在未分配货位!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
if (!this.form.dis_row) {
|
||||
this.crud.notify('请先选择一条分配明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
// 如果勾选了,直接跳后台
|
||||
@@ -415,6 +441,7 @@ export default {
|
||||
})
|
||||
crudRawAssist.getDisDtl(this.form.dtl_row).then(res => {
|
||||
this.form.tableMater = res
|
||||
this.form.dis_row = null
|
||||
this.crud.notify('取消分配成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -379,7 +379,7 @@ export default {
|
||||
divOpen() {
|
||||
crudRawAssist.getIODtl({ 'bill_code': this.currentRow.bill_code, 'open_flag': '1' }).then(res => {
|
||||
this.openParam = res
|
||||
this.storId = this.currentRow.stor_id
|
||||
this.storCode = this.currentRow.stor_code
|
||||
this.billType = this.currentRow.bill_type
|
||||
this.divShow = true
|
||||
})
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/in/rawAssist',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: '/api/in/rawAssist',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/in/rawAssist',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getIODtl(params) {
|
||||
return request({
|
||||
url: '/api/in/rawAssist/getIODtl',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function commit(data) {
|
||||
return request({
|
||||
url: '/api/in/rawAssist/commit',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function deleteDisDtl(data) {
|
||||
return request({
|
||||
url: '/api/in/rawAssist/deleteDisDtl',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getDisDtl(data) {
|
||||
return request({
|
||||
url: '/api/in/rawAssist/getDisDtl',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function divStruct(data) {
|
||||
return request({
|
||||
url: '/api/in/rawAssist/divStruct',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function unDivStruct(data) {
|
||||
return request({
|
||||
url: '/api/in/rawAssist/unDivStruct',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function divPoint(data) {
|
||||
return request({
|
||||
url: '/api/in/rawAssist/divPoint',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function confirm(data) {
|
||||
return request({
|
||||
url: '/api/in/rawAssist/confirm',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getInBillTaskDtl(data) {
|
||||
return request({
|
||||
url: '/api/in/rawAssist/getInBillTaskDtl',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getIODtl, commit,
|
||||
deleteDisDtl, getDisDtl, divStruct, unDivStruct, divPoint, confirm, getInBillTaskDtl }
|
||||
@@ -157,21 +157,14 @@
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="出库点" prop="point_code">
|
||||
<el-select
|
||||
v-model="form2.point_code"
|
||||
clearable
|
||||
<el-form-item label="出库区" prop="gender2">
|
||||
<el-cascader
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 150px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in pointList"
|
||||
:key="item.point_code"
|
||||
:label="item.point_name"
|
||||
:value="item.point_code"
|
||||
/>
|
||||
</el-select>
|
||||
:options="outBoundRegion"
|
||||
:props="{ checkStrictly: true }"
|
||||
clearable
|
||||
@change="outBoundChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -211,6 +204,7 @@
|
||||
<el-table-column prop="material_name" label="物料名称" width="170px" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||
<el-table-column prop="storagevehicle_code" label="载具号" width="150px" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
|
||||
<el-table-column prop="pcsn" label="批次号" width="150px" :min-width="flexWidth('pcsn',crud.data,'批次号')" />
|
||||
<el-table-column show-overflow-tooltip prop="qty" label="物料总数" :formatter="crud.formatNum3" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="plan_qty" label="出库重量" :formatter="crud.formatNum3" align="center" width="120px" :min-width="flexWidth('plan_qty',crud.data,'出库重量')">
|
||||
<template scope="scope">
|
||||
<el-input-number v-show="mstrow.bill_type === '1011'" v-model="scope.row.plan_qty" :precision="3" :controls="false" :min="1" style="width: 90px" />
|
||||
@@ -239,7 +233,7 @@ import CRUD, { crud } from '@crud/crud'
|
||||
import checkoutbill from '@/views/wms/st/outbill/checkoutbill'
|
||||
import StructIvt from '@/views/wms/st/outbill/StructIvt'
|
||||
import PointDialog from '@/views/wms/sch/point/PointDialog'
|
||||
import crudPoint from '@/views/wms/sch/point/schBasePoint'
|
||||
import crudPoint, { getRegionPoints } from '@/views/wms/sch/point/schBasePoint'
|
||||
import crudSectattr from '@/views/wms/basedata/sectattr/sectattr'
|
||||
import { autoCancel, getOutBillDis } from './checkoutbill'
|
||||
|
||||
@@ -260,7 +254,7 @@ export default {
|
||||
type: Array,
|
||||
default: () => { return [] }
|
||||
},
|
||||
storId: {
|
||||
storCode: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
@@ -292,9 +286,11 @@ export default {
|
||||
form2: {
|
||||
unassign_qty: '0',
|
||||
assign_qty: '0',
|
||||
point_code: ''
|
||||
point_code: '',
|
||||
region_code: ''
|
||||
},
|
||||
sects: [],
|
||||
outBoundRegion: [],
|
||||
pointList: [],
|
||||
rules: {
|
||||
}
|
||||
@@ -320,13 +316,11 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudSectattr.getSectCode({ 'stor_id': this.storId }).then(res => {
|
||||
crudSectattr.getSectCode({ 'stor_code': this.storCode }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
|
||||
const area_type = 'CKQ'
|
||||
crudPoint.getPointList({ 'region_code': area_type }).then(res => {
|
||||
this.pointList = res
|
||||
crudPoint.getRegionPoints({ 'region_code': 'CKQ' }).then(res => {
|
||||
this.outBoundRegion = res.content
|
||||
})
|
||||
},
|
||||
close() {
|
||||
@@ -340,10 +334,11 @@ export default {
|
||||
},
|
||||
PointChanged(row) {
|
||||
this.form2.point_code = row.point_code
|
||||
this.form2.region_code = row.region_code
|
||||
},
|
||||
openStructIvt() {
|
||||
this.currentRow.remark = ''
|
||||
this.currentRow.stor_id = this.storId
|
||||
this.currentRow.stor_code = this.storCode
|
||||
this.loadingAlldiv = true
|
||||
checkoutbill.getStructIvt(this.currentRow).then(res => {
|
||||
this.openParam = res
|
||||
@@ -368,6 +363,20 @@ export default {
|
||||
this.mstrow.sect_code = val[1]
|
||||
}
|
||||
},
|
||||
outBoundChange(val) {
|
||||
if (val.length === 1) {
|
||||
this.form2.region_code = val[0]
|
||||
this.form2.point_code = ''
|
||||
}
|
||||
if (val.length === 0) {
|
||||
this.form2.region_code = ''
|
||||
this.form2.point_code = ''
|
||||
}
|
||||
if (val.length === 2) {
|
||||
this.form2.region_code = val[0]
|
||||
this.form2.point_code = val[1]
|
||||
}
|
||||
},
|
||||
tabledisabled(row) {
|
||||
if ((row.work_status === '00' || row.work_status === '01') && row.is_issued === '0') {
|
||||
return false
|
||||
@@ -460,13 +469,14 @@ export default {
|
||||
}
|
||||
},
|
||||
allSetPointAllDtl() {
|
||||
if (this.form2.point_code === '') {
|
||||
if (this.form2.regon_code === '') {
|
||||
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.loadingSetAllPoint = true
|
||||
const data = {
|
||||
'point_code': this.form2.point_code,
|
||||
'region_code': this.form2.region_code,
|
||||
'iostorinv_id': this.mstrow.iostorinv_id,
|
||||
'bill_code': this.mstrow.bill_code,
|
||||
'checked': this.checked
|
||||
|
||||
@@ -93,7 +93,11 @@
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="托盘编码" align="center" width="250px" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column show-overflow-tooltip sortable prop="pcsn" label="批次号" align="center" width="150px" />
|
||||
<el-table-column show-overflow-tooltip prop="canuse_qty" label="可出重量" :formatter="crud.formatNum3" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="qty" label="可出重量" :formatter="crud.formatNum3" align="center" >
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.qty" clearable style="width: 120px"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="160" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button v-show="!scope.row.edit" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
||||
@@ -200,15 +204,15 @@ export default {
|
||||
}
|
||||
row.edit = !row.edit
|
||||
if (row.edit) {
|
||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) - parseFloat(row.canuse_qty)
|
||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + parseFloat(row.canuse_qty)
|
||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) - parseFloat(row.qty)
|
||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + parseFloat(row.qty)
|
||||
} else {
|
||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - parseFloat(row.canuse_qty)
|
||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - parseFloat(row.qty)
|
||||
// 如果待分配重量等于0则 明细重量 - 已分配重量
|
||||
if (parseInt(this.queryrow.unassign_qty) === 0) {
|
||||
this.queryrow.unassign_qty = parseFloat(this.goal_unassign_qty) - parseFloat(this.queryrow.assign_qty)
|
||||
} else {
|
||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + parseFloat(row.canuse_qty)
|
||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + parseFloat(row.qty)
|
||||
}
|
||||
if (this.queryrow.unassign_qty > this.goal_unassign_qty) {
|
||||
this.queryrow.unassign_qty = JSON.parse(JSON.stringify(this.goal_unassign_qty))
|
||||
|
||||
@@ -203,7 +203,7 @@
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
|
||||
<DivDialog :dialog-show.sync="divShow" :open-array="openParam" :stor-id="storId" :rowmst="mstrow" @DivChanged="querytable" />
|
||||
<DivDialog :dialog-show.sync="divShow" :open-array="openParam" :stor-code="storCode" :rowmst="mstrow" @DivChanged="querytable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -262,7 +262,7 @@ export default {
|
||||
checkrows: [],
|
||||
storlist: [],
|
||||
billtypelist: [],
|
||||
storId: null
|
||||
storCode: null
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
@@ -382,7 +382,7 @@ export default {
|
||||
divOpen() {
|
||||
checkoutbill.getOutBillDtl({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
|
||||
this.openParam = res
|
||||
this.storId = this.currentRow.stor_id
|
||||
this.storCode = this.currentRow.stor_code
|
||||
this.divShow = true
|
||||
this.mstrow = this.currentRow
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user