|
|
|
@@ -1,7 +1,7 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<el-dialog append-to-body :visible.sync="dialogVisible" destroy-on-close :show-close="false" fullscreen @close="close" @open="open">
|
|
|
|
<el-dialog append-to-body :visible.sync="dialogVisible" destroy-on-close :show-close="false" fullscreen @close="close" @open="open">
|
|
|
|
<span slot="title" class="dialog-footer"><div class="crud-opts2"><span class="el-dialog__title2">调拨分配</span><span class="crud-opts-right2"><el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button></span></div></span>
|
|
|
|
<span slot="title" class="dialog-footer"><div class="crud-opts2"><span class="el-dialog__title2">调拨分配</span><span class="crud-opts-right2"><el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button></span></div></span>
|
|
|
|
<div class="crud-opts2"><span class="role-span">调拨明细</span><div class="crud-opts-form"><el-form ref="form" :inline="true" :model="form" size="mini"><el-form-item label="调出库区"><el-cascader placeholder="请选择" :options="sects" :props="{ checkStrictly: true }" clearable @change="sectQueryChange" /></el-form-item></el-form></div><span class="crud-opts-right2"><el-button class="filter-item" :loading="loadingAlldiv" type="primary" size="mini" @click="allDiv">全部分配</el-button><el-button class="filter-item" :loading="loadingAlldiv" type="primary" size="mini" @click="allCancel">全部取消</el-button><el-button class="filter-item" :loading="loadingAlldiv" type="primary" size="mini" :disabled="button1" @click="oneDiv">按行分配</el-button><el-button class="filter-item" type="primary" :loading="loadingAlldiv" size="mini" :disabled="button2" @click="oneCancel">按行取消</el-button><el-button class="filter-item" type="primary" size="mini" :loading="loadingAlldiv" :disabled="button3" @click="openStructIvt">手工分配</el-button><el-button class="filter-item" type="warning" :loading="loadingSetAllPoint" size="mini" @click="allSetPointAllDtl">一键下发</el-button></span></div>
|
|
|
|
<div class="crud-opts2"><span class="role-span">调拨明细</span><div class="crud-opts-form"><el-form ref="form" :inline="true" :model="form" size="mini"><el-form-item label="调出库区"><el-cascader v-model="sourceSectValue" placeholder="请选择" :options="sects" :props="{ checkStrictly: true }" clearable @change="sectQueryChange" /></el-form-item></el-form></div><span class="crud-opts-right2"><el-button class="filter-item" :loading="loadingAlldiv" type="primary" size="mini" @click="allDiv">全部分配</el-button><el-button class="filter-item" :loading="loadingAlldiv" type="primary" size="mini" @click="allCancel">全部取消</el-button><el-button class="filter-item" :loading="loadingAlldiv" type="primary" size="mini" :disabled="button1" @click="oneDiv">按行分配</el-button><el-button class="filter-item" type="primary" :loading="loadingAlldiv" size="mini" :disabled="button2" @click="oneCancel">按行取消</el-button><el-button class="filter-item" type="primary" size="mini" :loading="loadingAlldiv" :disabled="button3" @click="openStructIvt">手工分配</el-button><el-button class="filter-item" type="warning" :loading="loadingSetAllPoint" size="mini" @click="allSetPointAllDtl">一键下发</el-button></span></div>
|
|
|
|
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}"><el-table ref="table" :data="tableDtl" style="width: 100%;" max-height="300" border :cell-style="cellStyle" :highlight-current-row="true" :header-cell-style="{background:'#f5f7fa',color:'#606266'}" @current-change="handleDtlCurrentChange"><el-table-column prop="bill_status" label="状态" align="center" width="110px" :formatter="bill_statusFormat" /><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" width="140px" /><el-table-column show-overflow-tooltip prop="plan_qty" label="调拨数量" :formatter="crud.formatNum3" align="center" /><el-table-column show-overflow-tooltip prop="assign_qty" label="已分配数量" :formatter="crud.formatNum3" align="center" /><el-table-column show-overflow-tooltip label="未分配数量" :formatter="unassignFormat" align="center" /></el-table></el-card>
|
|
|
|
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}"><el-table ref="table" :data="tableDtl" style="width: 100%;" max-height="300" border :cell-style="cellStyle" :highlight-current-row="true" :header-cell-style="{background:'#f5f7fa',color:'#606266'}" @current-change="handleDtlCurrentChange"><el-table-column prop="bill_status" label="状态" align="center" width="110px" :formatter="bill_statusFormat" /><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" width="140px" /><el-table-column show-overflow-tooltip prop="plan_qty" label="调拨数量" :formatter="crud.formatNum3" align="center" /><el-table-column show-overflow-tooltip prop="assign_qty" label="已分配数量" :formatter="crud.formatNum3" align="center" /><el-table-column show-overflow-tooltip label="未分配数量" :formatter="unassignFormat" align="center" /></el-table></el-card>
|
|
|
|
<div class="crud-opts2"><span class="role-span">分配明细</span></div>
|
|
|
|
<div class="crud-opts2"><span class="role-span">分配明细</span></div>
|
|
|
|
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}"><el-table ref="table2" :data="tabledis" style="width: 100%;" max-height="400" size="mini" border :highlight-current-row="true" :header-cell-style="{background:'#f5f7fa',color:'#606266'}"><el-table-column type="index" label="序号" width="50" align="center" /><el-table-column prop="bill_status" label="状态" align="center" width="110px"><template slot-scope="scope"><el-select v-model="scope.row.bill_status" :disabled="true"><el-option v-for="item in dict.work_status" :key="item.value" :label="item.label" :value="item.value" /></el-select></template></el-table-column><el-table-column prop="material_code" label="物料编码" width="150px" /><el-table-column prop="material_name" label="物料名称" width="170px" /><el-table-column prop="storagevehicle_code" label="载具号" width="150px" /><el-table-column prop="pcsn" label="批次号" width="150px" /><el-table-column prop="plan_qty" label="调拨数量" :formatter="crud.formatNum3" align="center" width="120px" /><el-table-column prop="source_sect_code" width="120px" label="调出库区" align="center" /><el-table-column prop="source_struct_code" width="150px" label="调出仓位" align="center" /><el-table-column prop="target_sect_code" width="120px" label="调入库区" align="center" /><el-table-column prop="target_struct_code" width="150px" label="调入仓位" align="center" /><el-table-column prop="task_code" width="150px" label="任务号" align="center" /><el-table-column align="center" label="操作" width="120" fixed="right"><template slot-scope="scope"><el-button :disabled="tabledisabled(scope.row)" type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.row)" /></template></el-table-column></el-table></el-card>
|
|
|
|
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}"><el-table ref="table2" :data="tabledis" style="width: 100%;" max-height="400" size="mini" border :highlight-current-row="true" :header-cell-style="{background:'#f5f7fa',color:'#606266'}"><el-table-column type="index" label="序号" width="50" align="center" /><el-table-column prop="bill_status" label="状态" align="center" width="110px"><template slot-scope="scope"><el-select v-model="scope.row.bill_status" :disabled="true"><el-option v-for="item in dict.work_status" :key="item.value" :label="item.label" :value="item.value" /></el-select></template></el-table-column><el-table-column prop="material_code" label="物料编码" width="150px" /><el-table-column prop="material_name" label="物料名称" width="170px" /><el-table-column prop="storagevehicle_code" label="载具号" width="150px" /><el-table-column prop="pcsn" label="批次号" width="150px" /><el-table-column prop="plan_qty" label="调拨数量" :formatter="crud.formatNum3" align="center" width="120px" /><el-table-column prop="source_sect_code" width="120px" label="调出库区" align="center" /><el-table-column prop="source_struct_code" width="150px" label="调出仓位" align="center" /><el-table-column prop="target_sect_code" width="120px" label="调入库区" align="center" /><el-table-column prop="target_struct_code" width="150px" label="调入仓位" align="center" /><el-table-column prop="task_code" width="150px" label="任务号" align="center" /><el-table-column align="center" label="操作" width="120" fixed="right"><template slot-scope="scope"><el-button :disabled="tabledisabled(scope.row)" type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.row)" /></template></el-table-column></el-table></el-card>
|
|
|
|
@@ -22,15 +22,17 @@ export default {
|
|
|
|
mixins: [crud()],
|
|
|
|
mixins: [crud()],
|
|
|
|
dicts: ['io_bill_status', 'work_status'],
|
|
|
|
dicts: ['io_bill_status', 'work_status'],
|
|
|
|
props: { dialogShow: { type: Boolean, default: false }, rowmst: { type: Object }, openArray: { type: Array, default: () => [] } },
|
|
|
|
props: { dialogShow: { type: Boolean, default: false }, rowmst: { type: Object }, openArray: { type: Array, default: () => [] } },
|
|
|
|
data() { return { dialogVisible: false, loadingAlldiv: false, loadingSetAllPoint: false, structshow: false, button1: true, button2: true, button3: true, tableDtl: [], openParam: [], mstrow: {}, openRow: {}, tabledis: [], currentRow: {}, form: { }, sects: [], sourceStorCode: null } },
|
|
|
|
data() { return { dialogVisible: false, loadingAlldiv: false, loadingSetAllPoint: false, structshow: false, button1: true, button2: true, button3: true, tableDtl: [], openParam: [], mstrow: {}, openRow: {}, tabledis: [], currentRow: {}, form: { }, sects: [], sourceStorCode: null, sourceSectValue: null } },
|
|
|
|
watch: { dialogShow: { handler(newValue) { this.dialogVisible = newValue } }, openArray: { handler(newValue) { this.tableDtl = newValue } }, rowmst: { handler(newValue) { this.mstrow = { ...newValue } } } },
|
|
|
|
watch: { dialogShow: { handler(newValue) { this.dialogVisible = newValue } }, openArray: { handler(newValue) { this.tableDtl = newValue } }, rowmst: { handler(newValue) { this.mstrow = { ...newValue } } } },
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
open() { crudBsrealstorattr.getStor().then(res => { const stor = res.data.find(item => item.stor_code === this.mstrow.source_stor_code); this.sourceStorCode = stor ? stor.stor_code : null; if (this.sourceStorCode) { crudSectattr.getSectCode({ stor_code: this.sourceStorCode }).then(resp => { this.sects = resp.data }) } }) },
|
|
|
|
open() { crudBsrealstorattr.getStor().then(res => { const stor = res.data.find(item => item.stor_code === this.mstrow.source_stor_code); this.sourceStorCode = stor ? stor.stor_code : null; if (this.sourceStorCode) { crudSectattr.getSectCode({ stor_code: this.sourceStorCode }).then(resp => { this.sects = resp.data || []; this.initDefaultSect() }) } }) },
|
|
|
|
|
|
|
|
// 默认选中第一个库区的第一行:父级选第一个仓库,子级选它的第一个库区
|
|
|
|
|
|
|
|
initDefaultSect() { if (!Array.isArray(this.sects) || this.sects.length === 0) { return } const firstStor = this.sects[0]; if (!firstStor) { return } const firstSect = (firstStor.children && firstStor.children.length) ? firstStor.children[0] : null; const val = firstSect ? [firstStor.value, firstSect.value] : [firstStor.value]; this.sourceSectValue = val; this.sectQueryChange(val) },
|
|
|
|
close() { this.tabledis = []; this.$emit('DivChanged'); this.$emit('update:dialogShow', false) },
|
|
|
|
close() { this.tabledis = []; this.$emit('DivChanged'); this.$emit('update:dialogShow', false) },
|
|
|
|
bill_statusFormat(row) { return this.dict.label.io_bill_status[row.bill_status] },
|
|
|
|
bill_statusFormat(row) { return this.dict.label.io_bill_status[row.bill_status] },
|
|
|
|
unassignFormat(row) { return (parseFloat(row.plan_qty || 0) - parseFloat(row.assign_qty || 0)).toFixed(3) },
|
|
|
|
unassignFormat(row) { return (parseFloat(row.plan_qty || 0) - parseFloat(row.assign_qty || 0)).toFixed(3) },
|
|
|
|
openStructIvt() { this.loadingAlldiv = true; const query = { ...this.currentRow, source_sect_code: this.mstrow.source_sect_code, target_sect_code: this.mstrow.target_sect_code }; invtransfer.getStructIvt(query).then(res => { this.openParam = res.data; this.structshow = true; this.openRow = query; this.loadingAlldiv = false }).catch(() => { this.loadingAlldiv = false }) },
|
|
|
|
openStructIvt() { this.loadingAlldiv = true; const query = { ...this.currentRow, source_sect_code: this.mstrow.source_sect_code, target_sect_code: this.mstrow.target_sect_code }; invtransfer.getStructIvt(query).then(res => { this.openParam = res.data; this.structshow = true; this.openRow = query; this.loadingAlldiv = false }).catch(() => { this.loadingAlldiv = false }) },
|
|
|
|
sectQueryChange(val) { this.mstrow.source_sect_code = val.length ? val[val.length - 1] : '' },
|
|
|
|
sectQueryChange(val) { this.sourceSectValue = val; this.mstrow.source_sect_code = (val && val.length) ? val[val.length - 1] : '' },
|
|
|
|
tabledisabled(row) { return !((row.bill_status === '00' || row.bill_status === '01') && row.is_issued === '0') },
|
|
|
|
tabledisabled(row) { return !((row.bill_status === '00' || row.bill_status === '01') && row.is_issued === '0') },
|
|
|
|
deleteRow(row) { invtransfer.autoCancel({ transfer_id: row.transfer_id, itransferdtl_id: row.itransferdtl_id }).then(() => { this.queryTableDtl() }) },
|
|
|
|
deleteRow(row) { invtransfer.autoCancel({ transfer_id: row.transfer_id, itransferdtl_id: row.itransferdtl_id }).then(() => { this.queryTableDtl() }) },
|
|
|
|
handleDtlCurrentChange(current) { if (current !== null) { this.currentRow = current; if (current.bill_status === '10') { this.button1 = false; this.button2 = true; this.button3 = false } else if (current.bill_status === '30' || current.bill_status === '40') { this.button1 = true; this.button2 = false; this.button3 = true } this.queryTableDdis(current.itransferdtl_id) } else { this.button1 = true; this.button2 = true; this.button3 = true; this.currentRow = {}; this.tabledis = [] } },
|
|
|
|
handleDtlCurrentChange(current) { if (current !== null) { this.currentRow = current; if (current.bill_status === '10') { this.button1 = false; this.button2 = true; this.button3 = false } else if (current.bill_status === '30' || current.bill_status === '40') { this.button1 = true; this.button2 = false; this.button3 = true } this.queryTableDdis(current.itransferdtl_id) } else { this.button1 = true; this.button2 = true; this.button3 = true; this.currentRow = {}; this.tabledis = [] } },
|
|
|
|
|