add:库存调拨
This commit is contained in:
90
nladmin-ui/src/views/wms/st/invtransfer/AddDialog.vue
Normal file
90
nladmin-ui/src/views/wms/st/invtransfer/AddDialog.vue
Normal file
@@ -0,0 +1,90 @@
|
||||
<template>
|
||||
<el-dialog title="调拨单编辑" append-to-body fullscreen :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0 || crud.status.view > 0" @open="open" @close="close">
|
||||
<el-row v-show="crud.status.cu > 0" :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="100px" label-suffix=":">
|
||||
<el-form-item label="单据号"><el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" /></el-form-item>
|
||||
<el-form-item label="调出仓库" prop="source_stor_code"><el-select v-model="form.source_stor_code" clearable placeholder="调出仓库" class="filter-item" style="width: 210px" :disabled="crud.status.view > 0" @change="sourceStorChange"><el-option v-for="item in storlist" :key="item.stor_code" :label="item.stor_name" :value="item.stor_code" /></el-select></el-form-item>
|
||||
<el-form-item label="调出库区" prop="source_sect_code"><el-cascader v-model="sourceSectValue" :options="sourceSects" :props="{ checkStrictly: true }" clearable style="width:210px" @change="sourceSectChange" /></el-form-item>
|
||||
<el-form-item label="调入仓库" prop="target_stor_code"><el-select v-model="form.target_stor_code" clearable placeholder="调入仓库" class="filter-item" style="width: 210px" :disabled="crud.status.view > 0" @change="targetStorChange"><el-option v-for="item in storlist" :key="item.stor_code + 't'" :label="item.stor_name" :value="item.stor_code" /></el-select></el-form-item>
|
||||
<el-form-item label="调入库区" prop="target_sect_code"><el-cascader v-model="targetSectValue" :options="targetSects" :props="{ checkStrictly: true }" clearable style="width:210px" @change="targetSectChange" /></el-form-item>
|
||||
<el-form-item label="业务类型" prop="bill_type"><el-select v-model="form.bill_type" clearable filterable size="mini" placeholder="业务类型" class="filter-item"><el-option v-for="item in dict.ST_INV_OUT_TYPE" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item>
|
||||
<el-form-item label="单据状态"><el-select v-model="form.bill_status" disabled style="width: 210px"><el-option v-for="item in dict.io_bill_status" :key="item.id" :label="item.label" :value="item.value" /></el-select></el-form-item>
|
||||
<el-form-item label="明细数"><el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" /></el-form-item>
|
||||
<el-form-item label="总数量"><el-input-number v-model="form.total_qty" :controls="false" :precision="3" :min="0" disabled style="width: 210px" /></el-form-item>
|
||||
<el-form-item label="业务日期" prop="biz_date"><el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" /></el-form-item>
|
||||
<el-form-item label="备注" prop="remark"><el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="crud.status.view > 0" /></el-form-item>
|
||||
</el-form>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">调拨明细</span>
|
||||
<span v-if="crud.status.cu > 0" class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="queryDtl()"
|
||||
>
|
||||
调拨物料
|
||||
</el-button>
|
||||
</span>
|
||||
</div>
|
||||
<el-table ref="table" :data="form.tableData" style="width: 100%;" border :header-cell-style="{background:'#f5f7fa',color:'#606266'}">
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column prop="material_code" label="物料编码" width="190" align="center" />
|
||||
<el-table-column prop="material_name" label="物料名称" align="center" min-width="150px" show-overflow-tooltip />
|
||||
<el-table-column prop="pcsn" label="批次号" width="150px" align="center" />
|
||||
<el-table-column prop="plan_qty" label="调拨数量" width="150" align="center"><template slot-scope="scope"><el-input-number v-model="scope.row.plan_qty" :precision="3" :controls="false" :min="1" style="width: 120px" :disabled="crud.status.view > 0" /></template></el-table-column>
|
||||
<el-table-column prop="qty_unit_name" label="单位" align="center" />
|
||||
<el-table-column prop="remark" label="明细备注" align="center"><template slot-scope="scope"><el-input v-model="scope.row.remark" size="mini" :disabled="crud.status.view > 0" /></template></el-table-column>
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="120" fixed="right"><template slot-scope="scope"><el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, form.tableData)" /></template></el-table-column>
|
||||
</el-table>
|
||||
<AddDtl :dialog-show.sync="dtlShow" :stor-id="sourceStorId" @tableChanged="tableChanged" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import AddDtl from '@/views/wms/st/invtransfer/AddDtl'
|
||||
import invtransfer from '@/views/wms/st/invtransfer/invtransfer'
|
||||
import crudBsrealstorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
import crudSectattr from '@/views/wms/basedata/sectattr/sectattr'
|
||||
|
||||
const defaultForm = { bill_code: '', source_stor_code: '', source_stor_name: '', source_sect_code: '', source_sect_name: '', target_stor_code: '', target_stor_name: '', target_sect_code: '', target_sect_name: '', bill_status: '10', total_qty: '0', detail_count: '0', bill_type: '', remark: '', biz_date: new Date(), tableData: [] }
|
||||
export default {
|
||||
name: 'InvtransferAddDialog',
|
||||
components: { AddDtl },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
dicts: ['io_bill_status', 'ST_INV_OUT_TYPE'],
|
||||
data() { return { dtlShow: false, storlist: [], sourceSects: [], targetSects: [], sourceSectValue: [], targetSectValue: [], sourceStorId: null, targetStorId: null, rules: { source_stor_code: [{ required: true, message: '调出仓库不能为空', trigger: 'blur' }], source_sect_code: [{ required: true, message: '调出库区不能为空', trigger: 'blur' }], target_stor_code: [{ required: true, message: '调入仓库不能为空', trigger: 'blur' }], target_sect_code: [{ required: true, message: '调入库区不能为空', trigger: 'blur' }], bill_type: [{ required: true, message: '业务类型不能为空', trigger: 'blur' }], biz_date: [{ required: true, message: '业务日期不能为空', trigger: 'blur' }] } } },
|
||||
methods: {
|
||||
open() { crudBsrealstorattr.getStor().then(res => { this.storlist = res.data }); if (this.form.source_stor_code) { this.loadSourceSects() } if (this.form.target_stor_code) { this.loadTargetSects() } },
|
||||
close() { this.$emit('AddChanged') },
|
||||
[CRUD.HOOK.beforeSubmit]() { if (this.form.tableData.length === 0) { this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO); return false } },
|
||||
[CRUD.HOOK.afterToEdit]() { this.fillFormDtl() },
|
||||
[CRUD.HOOK.afterToView]() { this.fillFormDtl() },
|
||||
fillFormDtl() { invtransfer.getDtl({ transfer_id: this.form.transfer_id }).then(res => { this.form.tableData = res.data }) },
|
||||
sourceStorChange(code) { const row = this.storlist.find(item => item.stor_code === code); this.form.source_stor_name = row ? row.stor_name : ''; this.sourceStorId = row ? row.stor_id : null; this.form.source_sect_code = ''; this.form.source_sect_name = ''; this.sourceSectValue = []; this.loadSourceSects() },
|
||||
targetStorChange(code) { const row = this.storlist.find(item => item.stor_code === code); this.form.target_stor_name = row ? row.stor_name : ''; this.targetStorId = row ? row.stor_id : null; this.form.target_sect_code = ''; this.form.target_sect_name = ''; this.targetSectValue = []; this.loadTargetSects() },
|
||||
loadSourceSects() { const row = this.storlist.find(item => item.stor_code === this.form.source_stor_code); if (!row) return; this.sourceStorId = row.stor_id; crudSectattr.getSectCode({ stor_code: row.stor_code }).then(res => { this.sourceSects = res.data }) },
|
||||
loadTargetSects() { const row = this.storlist.find(item => item.stor_code === this.form.target_stor_code); if (!row) return; crudSectattr.getSectCode({ stor_code: row.stor_code }).then(res => { this.targetSects = res.data }) },
|
||||
sourceSectChange(val) { this.form.source_sect_code = val.length ? val[val.length - 1] : ''; const node = this.findNode(this.sourceSects, this.form.source_sect_code); this.form.source_sect_name = node ? node.label : '' },
|
||||
targetSectChange(val) { this.form.target_sect_code = val.length ? val[val.length - 1] : ''; const node = this.findNode(this.targetSects, this.form.target_sect_code); this.form.target_sect_name = node ? node.label : '' },
|
||||
findNode(list, value) { for (const item of list) { if (item.value === value) return item; if (item.children) { const child = this.findNode(item.children, value); if (child) return child } } return null },
|
||||
queryDtl() { if (!this.form.source_stor_code) { this.crud.notify('请选择调出仓库', CRUD.NOTIFICATION_TYPE.INFO); return } this.dtlShow = true },
|
||||
tableChanged(rows) { rows.forEach(item => { item.plan_qty = item.qty; item.edit = true; this.form.tableData.push(item); this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty) }); this.form.detail_count = this.form.tableData.length },
|
||||
deleteRow(index, rows) { this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty); rows.splice(index, 1); this.form.detail_count = this.form.tableData.length }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
48
nladmin-ui/src/views/wms/st/invtransfer/AddDtl.vue
Normal file
48
nladmin-ui/src/views/wms/st/invtransfer/AddDtl.vue
Normal file
@@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<el-dialog title="库存选择" append-to-body :visible.sync="dialogVisible" destroy-on-close width="1000px" @close="close" @open="open">
|
||||
<el-form :inline="true" class="demo-form-inline" label-position="right" label-width="80px" label-suffix=":">
|
||||
<el-form-item label="库区查询"><el-cascader v-model="storQuery" placeholder="库区" :options="sects" :props="{ checkStrictly: true }" @change="sectQueryChange" /></el-form-item>
|
||||
<el-form-item label="货位编码"><el-input v-model="query.struct_code" clearable size="mini" placeholder="货位号模糊查询" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" /></el-form-item>
|
||||
<el-form-item label="物料编码"><el-input v-model="query.material_code" clearable size="mini" placeholder="物料" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" /></el-form-item>
|
||||
<el-form-item label="批次"><el-input v-model="query.pcsn" clearable size="mini" placeholder="批次" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" /></el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" border :header-cell-style="{background:'#f5f7fa',color:'#606266'}">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="turnout_sect_name" label="库区名称" />
|
||||
<el-table-column prop="turnout_struct_code" label="货位编码" />
|
||||
<el-table-column prop="storagevehicle_code" label="载具编码" />
|
||||
<el-table-column prop="material_code" label="物料编码" />
|
||||
<el-table-column prop="material_name" label="物料名称" />
|
||||
<el-table-column prop="pcsn" label="批次" />
|
||||
<el-table-column prop="qty" label="数量" :formatter="crud.formatNum3" />
|
||||
<el-table-column prop="frozen_qty" label="冻结数量" :formatter="crud.formatNum3" />
|
||||
<el-table-column prop="qty_unit_name" label="单位" />
|
||||
</el-table>
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer"><el-button @click="dialogVisible = false">取 消</el-button><el-button type="primary" @click="submit">确 定</el-button></span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudSectattr from '@/views/wms/basedata/sectattr/sectattr'
|
||||
|
||||
export default {
|
||||
name: 'InvtransferAddDtl',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() { return CRUD({ title: '库存物料', optShow: { add: false, edit: false, del: false, reset: true, download: false }, url: 'api/invtransfer/getCanuseIvt', idField: 'struct_id', sort: 'storagevehicleext_id,desc' }) },
|
||||
mixins: [presenter(), header()],
|
||||
props: { dialogShow: { type: Boolean, default: false }, storId: { type: String } },
|
||||
data() { return { sects: [], dialogVisible: false, storQuery: [], rows: [] } },
|
||||
watch: { dialogShow: { handler(newValue) { this.dialogVisible = newValue } } },
|
||||
methods: {
|
||||
open() { this.crud.resetQuery(false); crudSectattr.getSect({ stor_id: this.storId }).then(res => { this.sects = res.data }); this.query.is_used = '1'; this.query.is_delete = '0'; this.query.stor_id = this.storId; this.crud.toQuery() },
|
||||
sectQueryChange(val) { if (val.length === 1) { this.query.stor_id = val[0]; this.query.sect_id = '' } if (val.length === 0) { this.query.sect_id = ''; this.query.stor_id = '' } if (val.length === 2) { this.query.stor_id = val[0]; this.query.sect_id = val[1] } this.crud.toQuery() },
|
||||
close() { this.sects = null; this.$emit('update:dialogShow', false) },
|
||||
submit() { this.rows = this.$refs.table.selection; if (this.rows.length <= 0) { this.$message('请先勾选库存'); return } this.$emit('update:dialogShow', false); this.$emit('tableChanged', this.rows) }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
47
nladmin-ui/src/views/wms/st/invtransfer/DivDialog.vue
Normal file
47
nladmin-ui/src/views/wms/st/invtransfer/DivDialog.vue
Normal file
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<StructIvt :dialog-show.sync="structshow" :stor-code="sourceStorCode" :open-array="openParam" :rowmst="openRow" @StructIvtClosed="queryTableDtl" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import invtransfer from '@/views/wms/st/invtransfer/invtransfer'
|
||||
import StructIvt from '@/views/wms/st/invtransfer/StructIvt'
|
||||
import crudSectattr from '@/views/wms/basedata/sectattr/sectattr'
|
||||
import crudBsrealstorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
|
||||
export default {
|
||||
name: 'InvtransferDivDialog',
|
||||
components: { StructIvt },
|
||||
mixins: [crud()],
|
||||
dicts: ['io_bill_status', 'work_status'],
|
||||
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 } },
|
||||
watch: { dialogShow: { handler(newValue) { this.dialogVisible = newValue } }, openArray: { handler(newValue) { this.tableDtl = newValue } }, rowmst: { handler(newValue) { this.mstrow = { ...newValue } } } },
|
||||
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 }) } }) },
|
||||
close() { this.tabledis = []; this.$emit('DivChanged'); this.$emit('update:dialogShow', false) },
|
||||
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) },
|
||||
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] : '' },
|
||||
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() }) },
|
||||
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 = [] } },
|
||||
allDiv() { this.loadingAlldiv = true; invtransfer.allDiv({ transfer_id: this.mstrow.transfer_id, source_sect_code: this.mstrow.source_sect_code }).then(() => { this.crud.notify('分配成功!', CRUD.NOTIFICATION_TYPE.INFO); this.queryTableDtl(); this.loadingAlldiv = false }).catch(() => { this.loadingAlldiv = false }) },
|
||||
oneDiv() { this.loadingAlldiv = true; invtransfer.allDivOne({ transfer_id: this.mstrow.transfer_id, itransferdtl_id: this.currentRow.itransferdtl_id, source_sect_code: this.mstrow.source_sect_code }).then(() => { this.queryTableDtl(); this.loadingAlldiv = false }).catch(() => { this.loadingAlldiv = false }) },
|
||||
allCancel() { this.loadingAlldiv = true; invtransfer.allCancel({ transfer_id: this.mstrow.transfer_id }).then(() => { this.queryTableDtl(); this.loadingAlldiv = false }).catch(() => { this.loadingAlldiv = false }) },
|
||||
oneCancel() { this.loadingAlldiv = true; invtransfer.autoCancel({ transfer_id: this.mstrow.transfer_id, itransferdtl_id: this.currentRow.itransferdtl_id }).then(() => { this.queryTableDtl(); this.loadingAlldiv = false }).catch(() => { this.loadingAlldiv = false }) },
|
||||
allSetPointAllDtl() { this.loadingSetAllPoint = true; invtransfer.allSetPoint({ transfer_id: this.mstrow.transfer_id }).then(() => { this.queryTableDdis(this.currentRow.itransferdtl_id); this.crud.notify('下发成功!', CRUD.NOTIFICATION_TYPE.INFO); this.loadingSetAllPoint = false }).catch(() => { this.loadingSetAllPoint = false }) },
|
||||
queryTableDtl() { invtransfer.getDtl({ transfer_id: this.mstrow.transfer_id }).then(res => { this.tableDtl = res.data }) },
|
||||
queryTableDdis(itransferdtl_id) { invtransfer.getDis({ itransferdtl_id, bill_status: '01' }).then(res => { this.tabledis = res.data }).catch(() => { this.tabledis = [] }) },
|
||||
cellStyle({ row, column }) { if (column.property === 'assign_qty' && parseFloat(row.assign_qty || 0) > parseFloat(row.plan_qty || 0)) { return 'background: yellow' } }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
301
nladmin-ui/src/views/wms/st/invtransfer/StructIvt.vue
Normal file
301
nladmin-ui/src/views/wms/st/invtransfer/StructIvt.vue
Normal file
@@ -0,0 +1,301 @@
|
||||
<template>
|
||||
<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">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button>
|
||||
<el-button slot="left" v-loading.fullscreen.lock="fullscreenLoading" type="primary" @click="submit">保存</el-button>
|
||||
</span>
|
||||
</div>
|
||||
</span>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span" style="width: 100px">可分配库存</span>
|
||||
<div class="crud-opts-form">
|
||||
<el-form ref="form2" :inline="true" :model="queryrow" size="mini">
|
||||
<el-form-item label="物料" prop="material_code">
|
||||
<el-input-number
|
||||
v-model="queryrow.material_code"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="调出库区" prop="source_sect_code">
|
||||
<el-input
|
||||
v-model="queryrow.source_sect_code"
|
||||
:controls="false"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="调入库区" prop="target_sect_code">
|
||||
<el-input
|
||||
v-model="queryrow.target_sect_code"
|
||||
:controls="false"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="待分配" prop="unassign_qty">
|
||||
<el-input-number
|
||||
v-model="queryrow.unassign_qty"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="已分配" prop="assign_qty">
|
||||
<el-input-number
|
||||
v-model="queryrow.assign_qty"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="手动分配库区" prop="sect_id">
|
||||
<el-cascader
|
||||
placeholder="请选择"
|
||||
:options="sects"
|
||||
:props="{ checkStrictly: true }"
|
||||
clearable
|
||||
@change="sectQueryChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货位编码" prop="struct_code">
|
||||
<el-input
|
||||
v-model="queryrow.struct_code"
|
||||
clearable
|
||||
style="width: 220px"
|
||||
size="mini"
|
||||
placeholder="货位编码"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号" prop="pcsn">
|
||||
<el-input
|
||||
v-model="queryrow.pcsn"
|
||||
clearable
|
||||
style="width: 220px"
|
||||
size="mini"
|
||||
:disabled="pscnDisabled"
|
||||
placeholder="批次号"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="queryStruct">搜索</el-button>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tableDtl"
|
||||
style="width: 100%;"
|
||||
max-height="500"
|
||||
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 show-overflow-tooltip prop="sect_name" label="库区" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="struct_code" label="仓位" align="center" />
|
||||
<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 sortable prop="qty" label="库存数量" align="center" width="150px" />
|
||||
<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-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">
|
||||
<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>
|
||||
<el-button v-show="scope.row.edit" type="success" class="filter-item" size="mini" icon="el-icon-check" @click="handleEdit(scope.$index, scope.row)">完成</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header } from '@crud/crud'
|
||||
import checkoutbill from '@/views/wms/st/outbill/checkoutbill'
|
||||
import crudSectattr from '@/views/wms/basedata/sectattr/sectattr'
|
||||
|
||||
export default {
|
||||
name: 'StructIvt',
|
||||
components: { },
|
||||
mixins: [header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
rowmst: {
|
||||
type: Object
|
||||
},
|
||||
openArray: {
|
||||
type: Array,
|
||||
default: () => { return [] }
|
||||
},
|
||||
storId: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
dialogVisible2: false,
|
||||
fullscreenLoading: false,
|
||||
pscnDisabled: false,
|
||||
goal_unassign_qty: 0,
|
||||
queryrow: {},
|
||||
sects: [],
|
||||
tableDtl: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
openArray: {
|
||||
handler(newValue, oldValue) {
|
||||
this.tableDtl = newValue
|
||||
}
|
||||
},
|
||||
rowmst: {
|
||||
handler(newValue, oldValue) {
|
||||
this.queryrow = newValue
|
||||
if (this.queryrow.pcsn !== '' && this.queryrow.pcsn !== null) {
|
||||
this.pscnDisabled = true
|
||||
}
|
||||
this.goal_unassign_qty = JSON.parse(JSON.stringify(this.queryrow.unassign_qty))
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudSectattr.getSect({ 'stor_id': this.storId }).then(res => {
|
||||
this.sects = res.data
|
||||
})
|
||||
this.query.source_bill_code = this.queryrow.source_bill_code
|
||||
this.query.material_id = this.queryrow.material_id
|
||||
},
|
||||
queryStruct() {
|
||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + parseFloat(this.queryrow.assign_qty)
|
||||
this.queryrow.assign_qty = 0
|
||||
checkoutbill.getStructIvt(this.queryrow).then(res => {
|
||||
this.tableDtl = res.data
|
||||
})
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
if (val.length === 1) {
|
||||
this.queryrow.stor_id = val[0]
|
||||
this.queryrow.sect_id = ''
|
||||
}
|
||||
if (val.length === 0) {
|
||||
this.queryrow.sect_id = ''
|
||||
this.queryrow.stor_id = ''
|
||||
}
|
||||
if (val.length === 2) {
|
||||
this.queryrow.stor_id = val[0]
|
||||
this.queryrow.sect_id = val[1]
|
||||
}
|
||||
},
|
||||
handleEdit(index, row) {
|
||||
// 判断是否可以关闭编辑状态
|
||||
if (row.edit === undefined) {
|
||||
this.$set(row, 'edit', false)
|
||||
}
|
||||
row.edit = !row.edit
|
||||
if (row.edit) {
|
||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) - parseFloat(row.change_qty)
|
||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + parseFloat(row.change_qty)
|
||||
} else {
|
||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - parseFloat(row.change_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.change_qty)
|
||||
}
|
||||
if (this.queryrow.unassign_qty > this.goal_unassign_qty) {
|
||||
this.queryrow.unassign_qty = JSON.parse(JSON.stringify(this.goal_unassign_qty))
|
||||
}
|
||||
// 如果已分配汇总量 > 明细重量 则待分配重量为0
|
||||
if (this.queryrow.assign_qty > this.goal_unassign_qty) {
|
||||
this.queryrow.unassign_qty = parseFloat('0')
|
||||
}
|
||||
}
|
||||
this.tableDtl.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('StructIvtClosed')
|
||||
},
|
||||
submit() {
|
||||
if (parseFloat(this.queryrow.assign_qty) === 0) {
|
||||
this.crud.notify('请分配后再提交', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (parseFloat(this.queryrow.unassign_qty) === 0) {
|
||||
const rows = []
|
||||
this.tableDtl.forEach((item) => {
|
||||
if (item.edit) {
|
||||
rows.push(item)
|
||||
}
|
||||
})
|
||||
this.fullscreenLoading = true
|
||||
checkoutbill.manualDiv({ 'row': this.queryrow, 'rows': rows }).then(res => {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('StructIvtClosed')
|
||||
this.fullscreenLoading = false
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
} else {
|
||||
this.$confirm('未分配重量不为0,是否继续提交?')
|
||||
.then(_ => {
|
||||
const rows = []
|
||||
this.tableDtl.forEach((item) => {
|
||||
if (item.edit) {
|
||||
rows.push(item)
|
||||
}
|
||||
})
|
||||
this.fullscreenLoading = true
|
||||
checkoutbill.manualDiv({ 'row': this.queryrow, 'rows': rows }).then(res => {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('StructIvtClosed')
|
||||
this.fullscreenLoading = false
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
})
|
||||
.catch(_ => {
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
45
nladmin-ui/src/views/wms/st/invtransfer/ViewDialog.vue
Normal file
45
nladmin-ui/src/views/wms/st/invtransfer/ViewDialog.vue
Normal file
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<el-dialog append-to-body title="调拨单详情" :visible.sync="dialogVisible" destroy-on-close fullscreen @close="close" @open="open">
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" size="mini" label-width="100px" label-suffix=":">
|
||||
<el-form-item label="单据号"><el-input v-model="form.bill_code" disabled style="width: 210px" /></el-form-item>
|
||||
<el-form-item label="调出仓库"><el-input v-model="form.source_stor_name" disabled style="width: 210px" /></el-form-item>
|
||||
<el-form-item label="调出库区"><el-input v-model="form.source_sect_name" disabled style="width: 210px" /></el-form-item>
|
||||
<el-form-item label="调入仓库"><el-input v-model="form.target_stor_name" disabled style="width: 210px" /></el-form-item>
|
||||
<el-form-item label="调入库区"><el-input v-model="form.target_sect_name" disabled style="width: 210px" /></el-form-item>
|
||||
<el-form-item label="业务类型"><el-select v-model="form.bill_type" disabled><el-option v-for="item in dict.ST_INV_OUT_TYPE" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item>
|
||||
<el-form-item label="单据状态"><el-select v-model="form.bill_status" disabled><el-option v-for="item in dict.io_bill_status" :key="item.id" :label="item.label" :value="item.value" /></el-select></el-form-item>
|
||||
<el-form-item label="明细数"><el-input v-model="form.detail_count" disabled style="width: 210px" /></el-form-item>
|
||||
<el-form-item label="总数量"><el-input-number v-model="form.total_qty" :controls="false" :precision="3" :min="0" disabled style="width: 210px" /></el-form-item>
|
||||
<el-form-item label="业务日期"><el-date-picker v-model="form.biz_date" type="date" style="width: 210px" value-format="yyyy-MM-dd" :disabled="true" /></el-form-item>
|
||||
<el-form-item label="备注"><el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="true" /></el-form-item>
|
||||
</el-form>
|
||||
<div class="crud-opts2"><span class="role-span2">调拨明细</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" size="mini" border :highlight-current-row="true" :header-cell-style="{background:'#f5f7fa',color:'#606266'}" @current-change="handleDtlCurrentChange"><el-table-column type="index" label="序号" width="55" align="center" /><el-table-column :formatter="bill_statusFormat" prop="bill_status" label="状态" /><el-table-column min-width="140" show-overflow-tooltip prop="material_code" label="物料编码" align="center" /><el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" /><el-table-column prop="pcsn" label="批次号" width="150px" align="center" show-overflow-tooltip /><el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="数量" align="center" /><el-table-column prop="assign_qty" :formatter="crud.formatNum3" label="已分配数量" align="center" width="100px" /><el-table-column :formatter="unassignFormat" label="未分配数量" align="center" width="100px" /><el-table-column prop="qty_unit_name" label="单位" align="center" /><el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center" /></el-table></el-card>
|
||||
<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="300" size="mini" border :highlight-current-row="true" :header-cell-style="{background:'#f5f7fa',color:'#606266'}"><el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center" /><el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" /><el-table-column prop="storagevehicle_code" label="载具号" width="150px" /><el-table-column prop="pcsn" label="批次号" align="center" show-overflow-tooltip /><el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="数量" align="center" /><el-table-column prop="source_struct_code" label="调出仓位" align="center" show-overflow-tooltip /><el-table-column prop="target_struct_code" label="调入仓位" align="center" show-overflow-tooltip /><el-table-column prop="task_code" label="任务号" align="center" /><el-table-column prop="task_status" label="状态" align="center" width="110px" :formatter="work_statusFormat" /></el-table></el-card>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { crud } from '@crud/crud'
|
||||
import invtransfer from '@/views/wms/st/invtransfer/invtransfer'
|
||||
|
||||
export default {
|
||||
name: 'InvtransferViewDialog',
|
||||
mixins: [crud()],
|
||||
dicts: ['io_bill_status', 'work_status', 'ST_INV_OUT_TYPE'],
|
||||
props: { dialogShow: { type: Boolean, default: false }, rowmst: { type: Object } },
|
||||
data() { return { dialogVisible: false, tableDtl: [], tabledis: [], currentdtl: null, form: {} } },
|
||||
watch: { dialogShow: { handler(newValue) { this.dialogVisible = newValue } }, rowmst: { handler(newValue) { this.form = newValue } } },
|
||||
methods: {
|
||||
open() { this.queryTableDtl() },
|
||||
close() { this.$emit('update:dialogShow', false); this.currentdtl = null; this.tableDtl = []; this.tabledis = []; this.$emit('AddChanged') },
|
||||
bill_statusFormat(row) { return this.dict.label.io_bill_status[row.bill_status] },
|
||||
work_statusFormat(row) { return this.dict.label.work_status[row.bill_status] || row.bill_status },
|
||||
unassignFormat(row) { return (parseFloat(row.plan_qty || 0) - parseFloat(row.assign_qty || 0)).toFixed(3) },
|
||||
handleDtlCurrentChange(current) { if (current !== null) { this.currentdtl = current; this.queryTableDdis() } else { this.tabledis = []; this.currentdtl = {} } },
|
||||
queryTableDtl() { invtransfer.getDtl({ transfer_id: this.form.transfer_id }).then(res => { this.tableDtl = res.data }) },
|
||||
queryTableDdis() { if (this.currentdtl !== null) { invtransfer.getTask({ itransferdtl_id: this.currentdtl.itransferdtl_id }).then(res => { this.tabledis = res.data }).catch(() => { this.tabledis = [] }) } }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
153
nladmin-ui/src/views/wms/st/invtransfer/index.vue
Normal file
153
nladmin-ui/src/views/wms/st/invtransfer/index.vue
Normal file
@@ -0,0 +1,153 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form :inline="true" class="demo-form-inline" label-position="right" label-width="90px" label-suffix=":">
|
||||
<el-form-item label="模糊查询">
|
||||
<el-input v-model="query.bill_code" size="mini" clearable placeholder="单据号" @keyup.enter.native="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码">
|
||||
<el-input v-model="query.material_code" size="mini" clearable placeholder="物料编码" @keyup.enter.native="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="调出仓库">
|
||||
<el-select v-model="query.source_stor_code" multiple collapse-tags clearable size="mini" placeholder="全部" class="filter-item">
|
||||
<el-option v-for="item in storlist" :key="item.stor_code" :label="item.stor_name" :value="item.stor_code" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="调入仓库">
|
||||
<el-select v-model="query.target_stor_code" multiple collapse-tags clearable size="mini" placeholder="全部" class="filter-item">
|
||||
<el-option v-for="item in storlist" :key="item.stor_code + 't'" :label="item.stor_name" :value="item.stor_code" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态">
|
||||
<el-select v-model="query.bill_status" multiple collapse-tags clearable size="mini" placeholder="单据状态" class="filter-item">
|
||||
<el-option v-for="item in dict.io_bill_status" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型">
|
||||
<el-select v-model="query.bill_type" multiple collapse-tags clearable filterable size="mini" placeholder="业务类型" class="filter-item">
|
||||
<el-option v-for="item in dict.ST_INV_OUT_TYPE" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号">
|
||||
<el-input v-model="query.pcsn" size="mini" clearable placeholder="批次号" @keyup.enter.native="crud.toQuery" />
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button slot="right" class="filter-item" type="success" icon="el-icon-position" size="mini" :disabled="dis_flag" @click="divOpen">分配</el-button>
|
||||
<el-button slot="right" class="filter-item" type="warning" :loading="loadingConfirm" :disabled="confirm_flag" icon="el-icon-check" size="mini" @click="confirm">强制确认</el-button>
|
||||
</crudOperation>
|
||||
<el-table ref="table" v-loading="crud.loading" size="mini" :data="crud.data" style="width: 100%" :highlight-current-row="true" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange" @select="handleSelectionChange" @select-all="onSelectAll">
|
||||
<el-table-column label="操作" width="250" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation :data="scope.row" style="display: inline" :permission="permission" :disabled-edit="canUd(scope.row)" :disabled-dle="canUd(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :selectable="checkboxT" type="selection" width="55" />
|
||||
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip :formatter="stateFormat" width="80" prop="bill_status" label="单据状态" />
|
||||
<el-table-column show-overflow-tooltip prop="source_stor_name" label="调出仓库" width="120" />
|
||||
<el-table-column show-overflow-tooltip prop="target_stor_name" label="调入仓库" width="120" />
|
||||
<el-table-column show-overflow-tooltip prop="source_sect_name" label="调出库区" width="120" />
|
||||
<el-table-column show-overflow-tooltip prop="target_sect_name" label="调入库区" width="120" />
|
||||
<el-table-column show-overflow-tooltip prop="bill_type" :formatter="bill_typeFormat" label="业务类型" />
|
||||
<el-table-column show-overflow-tooltip width="100" prop="biz_date" label="业务日期" />
|
||||
<el-table-column show-overflow-tooltip label="明细数" align="center" prop="detail_count" width="60" />
|
||||
<el-table-column show-overflow-tooltip label="计划数量" align="center" prop="total_qty" width="100" :formatter="crud.formatNum3" />
|
||||
<el-table-column show-overflow-tooltip label="备注" align="center" prop="remark" width="180" />
|
||||
<el-table-column show-overflow-tooltip label="创建人" align="center" prop="create_name" />
|
||||
<el-table-column show-overflow-tooltip label="创建时间" align="center" prop="create_time" width="140" />
|
||||
<el-table-column show-overflow-tooltip label="修改人" align="center" prop="update_optname" />
|
||||
<el-table-column show-overflow-tooltip label="修改时间" align="center" prop="update_time" width="140" />
|
||||
</el-table>
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
|
||||
<DivDialog :dialog-show.sync="divShow" :open-array="openParam" :rowmst="mstrow" @DivChanged="querytable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import invtransfer from '@/views/wms/st/invtransfer/invtransfer'
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import AddDialog from '@/views/wms/st/invtransfer/AddDialog'
|
||||
import DivDialog from '@/views/wms/st/invtransfer/DivDialog'
|
||||
import ViewDialog from '@/views/wms/st/invtransfer/ViewDialog'
|
||||
import crudBsrealstorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
|
||||
export default {
|
||||
name: 'Invtransfer',
|
||||
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DivDialog },
|
||||
cruds() {
|
||||
return CRUD({ title: '库存调拨', idField: 'transfer_id', url: 'api/invtransfer', crudMethod: { ...invtransfer }, optShow: { add: true, edit: false, del: false, reset: true, download: false }, queryOnPresenterCreated: true })
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
dicts: ['io_bill_status', 'ST_INV_OUT_TYPE'],
|
||||
data() {
|
||||
return {
|
||||
permission: { add: ['admin', 'invtransfer:add'], edit: ['admin', 'invtransfer:edit'], del: ['admin', 'invtransfer:del'], confirm: ['admin', 'invtransfer:confirm'] },
|
||||
loadingConfirm: false,
|
||||
divShow: false,
|
||||
dis_flag: true,
|
||||
confirm_flag: true,
|
||||
openParam: [],
|
||||
mstrow: {},
|
||||
viewShow: false,
|
||||
currentRow: null,
|
||||
storlist: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudBsrealstorattr.getStor().then(res => { this.storlist = res.data })
|
||||
},
|
||||
methods: {
|
||||
canUd(row) { return row.bill_status !== '10' },
|
||||
toView(index, row) { this.mstrow = row; this.viewShow = true },
|
||||
[CRUD.HOOK.beforeRefresh]() { this.handleCurrentChange(null) },
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) { this.$refs.table.clearSelection(); this.$refs.table.toggleRowSelection(val.pop()); this.buttonChange(row) } else if (val.length === 1) { this.buttonChange(row) } else { this.handleCurrentChange(null) }
|
||||
},
|
||||
onSelectAll() { this.$refs.table.clearSelection(); this.handleCurrentChange(null) },
|
||||
buttonChange(current) {
|
||||
if (current !== null) {
|
||||
this.currentRow = current
|
||||
this.dis_flag = !(current.bill_status === '10' || current.bill_status === '20' || current.bill_status === '30' || current.bill_status === '40')
|
||||
this.confirm_flag = !(current.bill_status === '30' || current.bill_status === '40')
|
||||
}
|
||||
},
|
||||
stateFormat(row) { return this.dict.label.io_bill_status[row.bill_status] },
|
||||
bill_typeFormat(row) { return this.dict.label.ST_INV_OUT_TYPE[row.bill_type] },
|
||||
handleCurrentChange(current) {
|
||||
if (current === null) { this.dis_flag = true; this.confirm_flag = true; this.currentRow = {} }
|
||||
},
|
||||
checkboxT(row) { return row.bill_status !== '99' },
|
||||
divOpen() {
|
||||
invtransfer.getDtl({ transfer_id: this.currentRow.transfer_id }).then(res => {
|
||||
this.openParam = res.data
|
||||
this.divShow = true
|
||||
this.mstrow = this.currentRow
|
||||
})
|
||||
},
|
||||
confirm() {
|
||||
this.loadingConfirm = true
|
||||
invtransfer.confirm({ transfer_id: this.currentRow.transfer_id }).then(() => {
|
||||
this.querytable()
|
||||
this.crud.notify('调拨确认成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.loadingConfirm = false
|
||||
}).catch(() => { this.loadingConfirm = false })
|
||||
},
|
||||
querytable() { this.onSelectAll(); this.crud.toQuery(); this.handleCurrentChange(null) }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
59
nladmin-ui/src/views/wms/st/invtransfer/invtransfer.js
Normal file
59
nladmin-ui/src/views/wms/st/invtransfer/invtransfer.js
Normal file
@@ -0,0 +1,59 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({ url: 'api/invtransfer', method: 'post', data })
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({ url: 'api/invtransfer/', method: 'delete', data: ids })
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({ url: 'api/invtransfer', method: 'put', data })
|
||||
}
|
||||
|
||||
export function getDtl(params) {
|
||||
return request({ url: '/api/invtransfer/getDtl', method: 'get', params })
|
||||
}
|
||||
|
||||
export function getDis(params) {
|
||||
return request({ url: '/api/invtransfer/getDis', method: 'get', params })
|
||||
}
|
||||
|
||||
export function allDiv(data) {
|
||||
return request({ url: '/api/invtransfer/allDiv', method: 'post', data })
|
||||
}
|
||||
|
||||
export function allDivOne(data) {
|
||||
return request({ url: '/api/invtransfer/autoDiv', method: 'post', data })
|
||||
}
|
||||
|
||||
export function allCancel(data) {
|
||||
return request({ url: '/api/invtransfer/allCancel', method: 'post', data })
|
||||
}
|
||||
|
||||
export function autoCancel(data) {
|
||||
return request({ url: '/api/invtransfer/autoCancel', method: 'post', data })
|
||||
}
|
||||
|
||||
export function getStructIvt(params) {
|
||||
return request({ url: '/api/invtransfer/getStructIvt', method: 'get', params })
|
||||
}
|
||||
|
||||
export function manualDiv(data) {
|
||||
return request({ url: '/api/invtransfer/manualDiv', method: 'post', data })
|
||||
}
|
||||
|
||||
export function confirm(data) {
|
||||
return request({ url: '/api/invtransfer/confirm', method: 'post', data })
|
||||
}
|
||||
|
||||
export function getTask(data) {
|
||||
return request({ url: '/api/invtransfer/getTask', method: 'post', data })
|
||||
}
|
||||
|
||||
export function allSetPoint(data) {
|
||||
return request({ url: '/api/invtransfer/allSetPoint', method: 'post', data })
|
||||
}
|
||||
|
||||
export default { add, edit, del, allDiv, allCancel, getDtl, getDis, autoCancel, getStructIvt, manualDiv, confirm, allDivOne, getTask, allSetPoint }
|
||||
Reference in New Issue
Block a user