出入库初始化

This commit is contained in:
2022-10-25 18:43:38 +08:00
parent 24a344b980
commit 2e6a791edf
49 changed files with 11172 additions and 1017 deletions

View File

@@ -0,0 +1,502 @@
<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="85px" label-suffix=":">
<el-input v-show="false" v-model="form.stor_code" placeholder="仓库编码" />
<el-input v-show="false" v-model="form.stor_name" placeholder="仓库名称" />
<el-form-item label="单据号" prop="bill_code">
<label slot="label">单&nbsp;&nbsp;据&nbsp;号:</label>
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
</el-form-item>
<el-form-item label="仓库" prop="stor_id">
<label slot="label">仓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;库:</label>
<el-select
v-model="form.stor_id"
clearable
placeholder="仓库"
class="filter-item"
style="width: 210px"
:disabled="crud.status.view > 0"
@change="storChange"
>
<el-option
v-for="item in storlist"
:key="item.stor_id"
:label="item.stor_name"
:value="item.stor_id"
/>
</el-select>
</el-form-item>
<el-form-item label="业务类型" prop="bill_type">
<el-select
v-model="form.bill_type"
clearable
placeholder="业务类型"
style="width: 210px"
class="filter-item"
:disabled="crud.status.view > 0"
>
<el-option
v-for="item in billtypelist"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="单据状态" prop="bill_status">
<el-select
v-model="form.bill_status"
clearable
style="width: 210px"
placeholder="单据状态"
class="filter-item"
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="明细数" prop="detail_count">
<label slot="label">明&nbsp;&nbsp;细&nbsp;数:</label>
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="总重量" prop="total_qty">
<label slot="label">总&nbsp;&nbsp;重&nbsp;量:</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">
<label slot="label">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</label>
<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">
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="queryDtl()"
>
添加质检物料
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="insertdtl()"
>
新增一行
</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="bill_status" label="订单状态" align="center" :formatter="bill_statusFormat" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="190" align="center">
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.material_code" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="queryMater(scope.$index, scope.row)" />
</el-input>
<span v-show="scope.row.edit">{{ scope.row.material_code }}</span>
</template>
</el-table-column>
<el-table-column prop="material_name" label="物料名称" align="center" min-width="150px" show-overflow-tooltip />
<el-table-column show-overflow-tooltip prop="pcsn" label="批次号" align="center">
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.pcsn" size="mini" />
<span v-show="scope.row.edit">{{ scope.row.pcsn }}</span>
</template>
</el-table-column>
<el-table-column prop="plan_qty" label="重量" width="150" align="center">
<template scope="scope">
<el-input-number v-model="scope.row.plan_qty" :disabled="scope.row.edit" :precision="3" :controls="false" :min="0" style="width: 120px" />
</template>
</el-table-column>
<el-table-column prop="qty_unit_name" label="单位" align="center" />
<el-table-column prop="quality_scode" label="品质类型" align="center" width="110px">
<template slot-scope="scope">
<el-select
v-model="scope.row.quality_scode"
class="filter-item"
:disabled="scope.row.edit"
>
<el-option
v-for="item in dict.ST_QUALITY_SCODE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="ivt_level" label="库存等级" align="center" width="100px">
<template slot-scope="scope">
<el-select
v-model="scope.row.ivt_level"
class="filter-item"
:disabled="scope.row.edit"
>
<el-option
v-for="item in dict.ST_IVT_LEVEL"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="is_active" label="是否可用" align="center" width="110px">
<template slot-scope="scope">
<el-select
v-model="scope.row.is_active"
class="filter-item"
:disabled="scope.row.edit"
>
<el-option
v-for="item in dict.is_used"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" show-overflow-tooltip />
<el-table-column prop="source_bill_code" label="源单号" align="center" width="130px" show-overflow-tooltip />
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center">
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.remark" size="mini" />
<span v-show="scope.row.edit">{{ scope.row.remark }}</span>
</template>
</el-table-column>
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="160" fixed="right">
<template scope="scope">
<el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, form.tableData)" />
<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>
<AddDtl :dialog-show.sync="dtlShow" :open-param="materType" @tableChanged="tableChanged" />
<MaterDialog :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @tableChanged2="tableChanged2" />
</el-dialog>
</template>
<script>
import CRUD, { crud, form } from '@crud/crud'
import AddDtl from '@/views/wms/st/outbill/AddDtl'
import MaterDialog from '@/views/wms/pub/MaterDialog'
import checkoutbill from '@/views/wms/st/outbill/checkoutbill'
import crudStorattr from '@/views/wms/basedata/st/stor/storattr'
import crudRawAssist from '@/views/wms/st/inbill/rawassist'
const defaultForm = {
bill_code: '',
stor_id: '',
stor_code: '',
stor_name: '',
bill_status: '10',
total_qty: '0',
detail_count: '0',
bill_type: '',
remark: '',
biz_date: new Date(),
create_mode: '',
tableData: []
}
export default {
name: 'AddDialog',
components: { AddDtl, MaterDialog },
mixins: [crud(), form(defaultForm)],
props: {
dialogShow: {
type: Boolean,
default: false
}
},
dicts: ['io_bill_status', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_used', 'QC_INV_TYPE'],
data() {
return {
dialogVisible: false,
dtlShow: false,
materType: '',
materShow: false,
flagnow: false,
nowrow: {},
nowindex: '',
storlist: [],
billtypelist: [],
invtypelist: [],
rules: {
stor_id: [
{ required: true, message: '仓库不能为空', trigger: 'blur' }
],
bill_type: [
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
],
biz_date: [
{ required: true, message: '业务日期不能为空', trigger: 'blur' }
]
}
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
// 查询原材料库的仓库
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
this.storlist = res.content
})
crudRawAssist.getType({ 'io_code': '0101', 'io_flag': '01' }).then(res => {
this.billtypelist = res
})
checkoutbill.getInvTypes().then(res => {
this.invtypelist = res
})
},
close() {
this.$emit('AddChanged')
},
[CRUD.HOOK.afterToEdit]() {
checkoutbill.getOutBillDtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
row.edit = true
this.form.tableData.splice(i, 1, row)
}
})
},
[CRUD.HOOK.afterToView]() {
checkoutbill.getOutBillDtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
row.edit = true
this.form.tableData.splice(i, 1, row)
}
})
},
invtypeFormat(row, column) {
for (const item of this.invtypelist) {
if (item.code === row.source_bill_type) {
return item.name
}
}
},
bill_statusFormat(row, column) {
return this.dict.label.io_bill_status[row.bill_status]
},
storChange(row) {
this.storlist.forEach((item) => {
if (item.stor_id === row) {
this.form.stor_code = item.stor_code
this.form.stor_name = item.stor_name
}
})
},
async queryMater(index, row) {
if (this.form.bill_type === '') {
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
checkoutbill.paramByCodeType({ 'bill_type': this.form.bill_type }).then(res => {
this.materType = res.materType
this.materShow = true
this.nowindex = index
this.nowrow = row
})
},
async queryDtl(index, row) {
if (this.form.bill_type === '') {
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
checkoutbill.paramByCodeType({ 'bill_type': this.form.bill_type }).then(res => {
this.materType = res.materType
this.dtlShow = true
})
},
tableChanged(rows) {
const tablemap = new Map()
rows.forEach((item) => {
if (this.form.tableData.length !== 0) {
this.flagnow = false
for (let i = 0; i < this.form.tableData.length; i++) {
if (this.form.tableData[i].material_id === item.material_id) {
this.flagnow = true
}
}
if (!this.flagnow) {
item.edit = true
item.quality_scode = '00'
item.ivt_level = '01'
item.is_active = '1'
item.bill_status = '10'
tablemap.set(item.material_id, item)
}
} else {
item.edit = true
item.quality_scode = '00'
item.ivt_level = '01'
item.is_active = '1'
item.bill_status = '10'
tablemap.set(item.material_id, item)
}
})
for (const value of tablemap.values()) {
this.form.tableData.push(value)
}
this.form.detail_count = this.form.tableData.length
},
tableChanged2(row) {
for (let i = 0; i < this.form.tableData.length; i++) {
if (this.form.tableData[i].material_id === row.material_id) {
this.crud.notify('不允许添加相同物料!')
return false
}
}
this.nowrow.material_id = row.material_id
this.nowrow.material_code = row.material_code
this.nowrow.material_name = row.material_name
this.nowrow.qty_unit_id = row.base_unit_id
this.nowrow.qty_unit_name = row.unit_name
this.form.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
},
async insertdtl() {
if (this.form.bill_type === '') {
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.form.tableData.push({ material_id: '', material_code: '', bill_status: '10', material_name: '', pcsn: '', quality_scode: '00', ivt_level: '01', is_active: '1', plan_qty: '2', qty_unit_name: '', qty_unit_id: '', remark: '', edit: false })
this.form.detail_count = this.form.tableData.length
},
handleEdit(index, row) {
// 判断是否可以关闭编辑状态
if (!row.edit) {
if (!row.material_id || !row.plan_qty || parseFloat(row.plan_qty) <= 0) {
this.crud.notify('物料、数量不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (row.quality_scode !== '00') {
this.crud.notify('请校验物料' + row.material_code + ',品质类型是否正确', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (row.ivt_level !== '01') {
this.crud.notify('请校验物料' + row.material_code + ',库存等级是否正确', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (row.is_active !== '1') {
this.crud.notify('请校验物料' + row.material_code + ',是否可用是否正确', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}
row.edit = !row.edit
this.form.tableData.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
if (row.edit) {
this.form.total_qty = 0
this.form.tableData.forEach((item) => {
this.form.total_qty = this.form.total_qty + item.plan_qty
})
}
},
deleteRow(index, rows) {
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty)
rows.splice(index, 1)
this.nowindex = ''
this.nowrow = {}
this.form.detail_count = this.form.tableData.length
},
[CRUD.HOOK.beforeSubmit]() {
if (this.form.tableData.length === 0) {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
for (let i = 0; i < this.form.tableData.length; i++) {
if (!this.form.tableData[i].edit) {
this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!')
return false
}
}
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .crud-opts-right2 {
margin-left: auto;
padding: 4px 4px;
}
.input-with-select {
background-color: #fff;
}
</style>

View File

@@ -0,0 +1,137 @@
<template>
<el-dialog
title="质检物料选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
:show-close="false"
width="1000px"
@close="close"
@open="open"
>
<div class="head-container">
<div>
<!-- 搜索 -->
<date-range-picker v-model="query.createTime" class="date-item" />
<el-input
v-model="query.bill_code"
clearable
size="mini"
placeholder="质检单号模糊查询"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<el-input
v-model="query.remark"
clearable
size="mini"
placeholder="物料"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<rrOperation />
</div>
</div>
<!--表格渲染-->
<el-table
ref="multipleTable"
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 show-overflow-tooltip prop="biz_date" label="日期" />
<el-table-column show-overflow-tooltip prop="source_bill_code" label="单据号" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" />
<el-table-column show-overflow-tooltip prop="pcsn" label="批次" />
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="检测重量" />
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="重量单位" />
</el-table>
<!--分页组件-->
<pagination />
<span slot="footer" class="dialog-footer">
<el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button>
<el-button slot="left" 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 DateRangePicker from '@/components/DateRangePicker/index'
export default {
name: 'AddDtl',
components: { rrOperation, pagination, DateRangePicker },
cruds() {
return CRUD({ title: '用户', url: 'api/checkoutbill/addDtl', optShow: {
add: false,
edit: false,
del: false,
reset: true,
download: false
}})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
openParam: {
type: String
}
},
data() {
return {
dialogVisible: false,
opendtlParam: '',
rows: []
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
},
openParam: {
handler(newValue, oldValue) {
this.opendtlParam = newValue
}
}
},
methods: {
[CRUD.HOOK.beforeRefresh]() {
this.crud.query.mater_type = this.opendtlParam
},
close() {
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
},
open() {
this.crud.query.mater_type = this.opendtlParam
this.crud.toQuery()
},
submit() {
this.rows = this.$refs.multipleTable.selection
if (this.rows.length <= 0) {
this.$message('请先勾选物料')
return
}
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
this.$emit('tableChanged', this.rows)
}
}
}
</script>

View File

@@ -0,0 +1,502 @@
<template>
<el-dialog
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
:show-close="false"
fullscreen
@close="close"
>
<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>
</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="库区" prop="gender2">
<el-cascader
placeholder="请选择"
:options="sects"
:props="{ checkStrictly: true }"
clearable
@change="sectQueryChange"
/>
</el-form-item>
</el-form>
</div>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="allDiv()"
>
全部分配
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="allCancel()"
>
全部取消
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-check"
size="mini"
:disabled="button1"
@click="oneDiv()"
>
自动分配
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-check"
size="mini"
:disabled="button2"
@click="oneCancel()"
>
自动取消
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
:disabled="button3"
@click="openStructIvt"
>
手工分配
</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
: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" />
<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 prop="unassign_qty" label="未分配重量" :formatter="crud.formatNum3" align="center" />
<el-table-column prop="quality_scode" label="品质类型" align="center" width="110px" :formatter="quality_scodeFormat" />
<el-table-column prop="ivt_level" label="库存等级" align="center" width="100px" :formatter="ivt_levelFormat" />
<el-table-column prop="is_active" label="是否可用" align="center" width="110px" :formatter="is_activeFormat" />
<el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" />
<el-table-column show-overflow-tooltip prop="source_bill_code" label="源单编号" align="center" />
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center" />
</el-table>
</el-card>
<div class="crud-opts2">
<span class="role-span">分配明细</span>
<div class="crud-opts-form">
<el-form ref="form2" :inline="true" :model="form2" size="mini">
<el-form-item label="待分配" prop="unassign_qty">
<el-input-number
v-model="form2.unassign_qty"
:controls="false"
:precision="3"
:min="0"
disabled
/>
</el-form-item>
<el-form-item label="已分配" prop="assign_qty">
<el-input-number
v-model="form2.assign_qty"
:controls="false"
:precision="3"
:min="0"
disabled
/>
</el-form-item>
<el-form-item label="站点选择" prop="point_code">
<el-input v-model="form2.point_code" disabled class="input-with-select" style="width: 200px">
<el-button slot="append" icon="el-icon-search" @click="openPoint" />
</el-input>
</el-form-item>
</el-form>
</div>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
:disabled="button4"
@click="setPoint()"
>
设置站点
</el-button>
</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"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDisCurrentChange"
>
<el-table-column prop="bill_status" label="状态" align="center" width="110px">
<template slot-scope="scope">
<el-select
v-model="scope.row.work_status"
class="filter-item"
: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 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" />
<el-table-column show-overflow-tooltip prop="plan_qty" label="出库重量" :formatter="crud.formatNum3" align="center" />
<el-table-column show-overflow-tooltip prop="struct_code" label="仓位编码" align="center" />
<el-table-column show-overflow-tooltip prop="struct_name" label="仓位名称" align="center" />
<el-table-column show-overflow-tooltip prop="task_code" label="任务号" align="center" />
<el-table-column show-overflow-tooltip prop="point_name" label="出库点" align="center" />
<el-table-column align="center" label="操作" width="160" fixed="right">
<template 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>
<pointDialog ref="child" :dialog-show.sync="pointshow" :dialog-typedisable="typedisable" :dialog-areatype="areatype" @PointChanged="PointChanged" />
<StructIvt :dialog-show.sync="structshow" :open-array="openParam" :rowmst="openRow" @StructIvtClosed="queryTableDtl" />
</el-dialog>
</template>
<script>
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/pub/PointDialog'
import crudSectattr from '@/views/wms/basedata/st/sect/sectattr'
export default {
name: 'DivDialog',
components: { PointDialog, StructIvt },
mixins: [crud()],
dicts: ['io_bill_status', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_used', 'work_status', 'is_usable'],
props: {
dialogShow: {
type: Boolean,
default: false
},
rowmst: {
type: Object
},
openArray: {
type: Array,
default: () => { return [] }
}
},
data() {
return {
dialogVisible: false,
areatype: '',
typedisable: false,
pointshow: false,
structshow: false,
button1: true,
button2: true,
button3: true,
button4: true,
tableDtl: [],
openParam: [],
mstrow: {},
openRow: {},
tabledis: [],
currentRow: {},
currentDis: {},
form: {
gender2: ''
},
form2: {
unassign_qty: '0',
assign_qty: '0',
point_code: ''
},
sects: [],
invtypelist: [],
rules: {
}
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
},
openArray: {
handler(newValue, oldValue) {
this.tableDtl = newValue
}
},
rowmst: {
handler(newValue, oldValue) {
this.mstrow = newValue
this.mstrow.stor_id = ''
}
}
},
created() {
crudSectattr.getSect({ is_materialstore: '1' }).then(res => {
this.sects = res.content
})
checkoutbill.getInvTypes().then(res => {
this.invtypelist = res
})
},
methods: {
close() {
this.$refs['form2'].resetFields()
this.tabledis = []
this.$emit('DivChanged')
this.$emit('update:dialogShow', false)
},
bill_statusFormat(row, column) {
return this.dict.label.io_bill_status[row.bill_status]
},
quality_scodeFormat(row, column) {
return this.dict.label.ST_QUALITY_SCODE[row.quality_scode]
},
ivt_levelFormat(row, column) {
return this.dict.label.ST_IVT_LEVEL[row.ivt_level]
},
is_activeFormat(row, column) {
return this.dict.label.is_usable[row.is_active]
},
invtypeFormat(row, column) {
for (const item of this.invtypelist) {
if (item.code === row.source_bill_type) {
return item.name
}
}
},
openPoint() {
if (this.mstrow.bill_type === '010101') {
this.areatype = "'31'"
} else if (this.mstrow.bill_type === '010201' || this.mstrow.bill_type === '010202' || this.mstrow.bill_type === '010401') {
this.areatype = "'21'"
} else if (this.mstrow.bill_type === '010503' || this.mstrow.bill_type === '010501') {
this.areatype = "'22','23','24'"
} else if (this.mstrow.bill_type === '010502') {
this.areatype = "'21','22','23','24'"
} else if (this.mstrow.bill_type === '010801') {
this.areatype = "'22','23','24','31','35'"
} else if (this.mstrow.bill_type === '010601') {
this.areatype = ''
}
this.pointshow = true
this.$refs.child.getMsg(this.areatype)
},
PointChanged(row) {
this.form2.point_code = row.point_code
},
openStructIvt() {
this.currentRow.remark = ''
checkoutbill.getStructIvt(this.currentRow).then(res => {
this.openParam = res
this.structshow = true
this.openRow = this.currentRow
})
},
sectQueryChange(val) {
if (val.length === 1) {
this.mstrow.stor_id = val[0]
this.mstrow.sect_id = ''
}
if (val.length === 0) {
this.mstrow.sect_id = ''
this.mstrow.stor_id = ''
}
if (val.length === 2) {
this.mstrow.stor_id = val[0]
this.mstrow.sect_id = val[1]
}
},
tabledisabled(row) {
if ((row.work_status === '00' || row.work_status === '01') && row.is_issued === '0') {
return false
} else {
return true
}
},
deleteRow(row) {
checkoutbill.allCancel(row).then(res => {
this.queryTableDtl()
})
},
handleDtlCurrentChange(current) {
if (current !== null) {
this.currentRow = current
this.form2.unassign_qty = current.unassign_qty
this.form2.assign_qty = current.assign_qty
this.tabledis = []
if (current.bill_status === '10') {
this.button1 = false
this.button2 = true
this.button3 = false
} else if (current.bill_status === '30') {
this.button1 = false
this.button2 = false
this.button3 = false
} else if (current.bill_status === '40') {
this.button1 = true
this.button2 = false
this.button3 = true
}
this.queryTableDdis(current.iostorinvdtl_id)
} else {
this.button1 = true
this.button2 = true
this.button3 = true
this.mstrow.iostorinvdtl_id = ''
this.currentRow = {}
this.tabledis = []
}
},
handleDisCurrentChange(current) {
if (current !== null) {
this.currentDis = current
if (current.work_status === '01' || current.work_status === '00') {
this.button4 = false
} else {
this.button4 = true
}
} else {
this.button4 = true
this.mstrow.iostorinvdis_id = ''
this.currentDis = {}
}
},
allDiv() {
checkoutbill.allDiv(this.mstrow).then(res => {
this.crud.notify('分配成功!', CRUD.NOTIFICATION_TYPE.INFO)
this.queryTableDtl()
})
},
oneDiv() {
if (this.currentRow.iostorinvdtl_id !== null) {
this.mstrow.iostorinvdtl_id = this.currentRow.iostorinvdtl_id
checkoutbill.allDiv(this.mstrow).then(res => {
this.queryTableDtl()
})
}
},
allCancel() {
checkoutbill.allCancel(this.mstrow).then(res => {
this.queryTableDtl()
})
},
oneCancel() {
if (this.currentRow.iostorinvdtl_id !== null) {
checkoutbill.allCancel(this.currentRow).then(res => {
this.queryTableDtl()
})
}
},
setPoint() {
if (this.form2.point_code === '') {
this.crud.notify('请先选择检验站点!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
if (this.currentDis.point_code) {
this.crud.notify('站点已设置!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
if (this.currentDis.iostorinvdis_id !== null) {
this.currentDis.point_code = this.form2.point_code
checkoutbill.setPoint(this.currentDis).then(res => {
this.queryTableDdis(this.currentDis.iostorinvdtl_id)
})
}
},
queryTableDtl() {
checkoutbill.getOutBillDtl({ 'iostorinv_id': this.mstrow.iostorinv_id }).then(res => {
this.tableDtl = res
})
},
queryTableDdis(iostorinvdtl_id) {
checkoutbill.getOutBillDis({ 'iostorinvdtl_id': iostorinvdtl_id, 'bill_status': '01' }).then(res => {
this.tabledis = res
}).catch(() => {
this.tabledis = []
})
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size:20px;
color:#303133;
}
.crud-opts2 .role-span {
padding: 10px 0px 10px 0px;
}
.crud-opts2 .crud-opts-form {
padding: 10px 0px 0px 20px;
}
.input-with-select {
background-color: #fff;
}
</style>

View File

@@ -1,165 +0,0 @@
<template>
<el-dialog
title="选择库存"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1200px"
@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-input
v-model="query.material_code"
clearable
size="mini"
placeholder="编码、名称"
@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%;"
size="mini"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@select="handleSelectionChange"
@select-all="onSelectAll"
@current-change="clickChange"
>
<el-table-column v-if="!isSingle" type="selection" width="55" />
<el-table-column v-if="isSingle" label="选择" width="55">
<template slot-scope="scope">
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
</template>
</el-table-column>
<el-table-column prop="material_code" label="物料编码" min-width="150" show-overflow-tooltip />
<el-table-column prop="material_name" label="物料名称" min-width="200" show-overflow-tooltip />
<el-table-column prop="material_spec" label="规格" show-overflow-tooltip />
<el-table-column prop="material_model" label="型号" />
<el-table-column prop="pcsn" label="批次" />
<el-table-column prop="struct_code" label="仓位编码" />
<el-table-column prop="struct_name" label="仓位名称" width="120px" />
<el-table-column prop="vehicle_code" label="载具编码" />
<el-table-column prop="canuse_qty" label="数量" />
<el-table-column prop="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 '@riophae/vue-treeselect/dist/vue-treeselect.css'
import crudRegionioOut from '@/views/wms/st/outbill/regionioOut'
export default {
name: 'MaterDialog',
components: { rrOperation, pagination },
cruds() {
return CRUD({ title: '物料', url: 'api/regionioOut/getMaterial', crudMethod: { ...crudRegionioOut }, optShow: {}})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
isSingle: {
type: Boolean,
default: true
},
materOptCode: {
type: String,
default: '00'
},
openParam: {
type: Object,
default: null
}
},
data() {
return {
dialogVisible: false,
tableRadio: null,
tableData: []
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
clickChange(item) {
this.tableRadio = item
},
open() {
this.query.region_id = this.openParam
this.crud.toQuery()
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
} else {
this.checkrow = row
}
},
onSelectAll() {
this.$refs.table.clearSelection()
},
close() {
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
},
submit() {
// 处理单选
if (this.isSingle && this.tableRadio) {
this.$emit('update:dialogShow', false)
this.$emit('getMaterial', this.tableRadio)
return
}
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选物料')
return
}
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
this.$emit('getMaterial', this.rows)
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>

View File

@@ -0,0 +1,245 @@
<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" type="primary" @click="submit">保存</el-button>
</span>
</div>
</span>
<div class="crud-opts2">
<span class="role-span">可分配库存</span>
<div class="crud-opts-form">
<el-form ref="form2" :inline="true" :model="queryrow" size="mini">
<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="remark">
<el-input
v-model="queryrow.remark"
clearable
style="width: 220px"
size="mini"
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="400"
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" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column show-overflow-tooltip prop="pcsn" label="批次号" align="center" />
<el-table-column show-overflow-tooltip prop="canuse_qty" label="可出重量" :formatter="crud.formatNum3" align="center" />
<el-table-column show-overflow-tooltip prop="plan_qty" label="重量" :formatter="crud.formatNum3" width="160" align="center">
<template scope="scope">
<el-input-number v-show="!scope.row.edit" v-model="scope.row.plan_qty" :precision="3" :max="100000000" />
<span v-show="scope.row.edit">{{ scope.row.plan_qty }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center" />
<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 crudSectattr from '@/views/wms/basedata/st/sect/sectattr'
import checkoutbill from '@/views/wms/st/outbill/checkoutbill'
export default {
name: 'StructIvt',
components: { },
mixins: [header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
rowmst: {
type: Object
},
openArray: {
type: Array,
default: () => { return [] }
}
},
data() {
return {
dialogVisible: false,
dialogVisible2: false,
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
}
}
},
methods: {
open() {
crudSectattr.getSect({ is_materialstore: '1' }).then(res => {
this.sects = res.content
})
},
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
})
},
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) {
if (row.plan_qty > this.queryrow.unassign_qty) {
this.crud.notify('出库重量不能超过未分配数', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (row.plan_qty > row.canuse_qty) {
this.crud.notify('出库重量不能超过库存可出重量', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (row.plan_qty === 0) {
this.crud.notify('出库重量为0不能保存', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}
row.edit = !row.edit
if (row.edit) {
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) - row.plan_qty
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + row.plan_qty
} else {
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + row.plan_qty
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - row.plan_qty
}
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)
}
})
checkoutbill.manualDiv({ 'row': this.queryrow, 'rows': rows }).then(res => {
this.$emit('update:dialogShow', false)
this.$emit('StructIvtClosed')
})
} else {
this.$confirm('未分配重量不为0,是否继续提交?')
.then(_ => {
const rows = []
this.tableDtl.forEach((item) => {
if (item.edit) {
rows.push(item)
}
})
checkoutbill.manualDiv({ 'row': this.queryrow, 'rows': rows }).then(res => {
this.$emit('update:dialogShow', false)
this.$emit('StructIvtClosed')
})
})
.catch(_ => {
})
}
}
}
}
</script>

View File

@@ -0,0 +1,324 @@
<template>
<el-dialog
append-to-body
:visible.sync="dialogVisible"
v-loading.fullscreen.lock="fullscreenLoading"
destroy-on-close
:show-close="false"
fullscreen
@close="close"
>
<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>
</span>
</div>
</span>
<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"
border
: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="bill_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" />
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" 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="source_bill_type" label="源单类型" align="center" />
<el-table-column show-overflow-tooltip prop="source_bill_code" label="源单编号" align="center" />
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center" />
</el-table>
</el-card>
<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 prop="checked">
<el-checkbox v-model="form.checked" @change="queryTableDdis">仅显示未完成的作业指令</el-checkbox>
</el-form-item>
</el-form>
</div>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-position"
size="mini"
:disabled="button1"
@click="issueTask"
>
下发
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-position"
size="mini"
:disabled="button2"
@click="finishTask"
>
标示完成
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-close"
size="mini"
:disabled="button3"
@click="cancleTaskfinish"
>
取消完成
</el-button>
</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"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDisCurrentChange"
>
<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" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" align="center" />
<el-table-column show-overflow-tooltip prop="bucket_num" :formatter="crud.formatNum0" label="桶数" align="center" />
<el-table-column show-overflow-tooltip prop="total_storage_qty" :formatter="crud.formatNum3" label="重量" align="center" />
<el-table-column show-overflow-tooltip prop="start_point_code" label="起始位置" align="center" />
<el-table-column show-overflow-tooltip prop="next_point_code" label="目的位置" align="center" />
<el-table-column show-overflow-tooltip prop="task_code" label="任务号" align="center" />
<el-table-column prop="taskdtl_type" label="任务类型" align="center" width="150px" :formatter="taskdtl_typeFormat" />
<el-table-column prop="task_status" label="状态" align="center" width="110px" :formatter="task_statusFormat" />
<el-table-column align="center" label="操作" width="160" fixed="right">
<template 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)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</el-dialog>
</template>
<script>
import { crud } from '@crud/crud'
import checkoutbill from '@/views/wms/st/outbill/checkoutbill'
export default {
name: 'TaskDialog',
components: { },
mixins: [crud()],
dicts: ['task_status', 'io_bill_status', 'SCH_TASK_TYPE_DTL'],
props: {
dialogShow: {
type: Boolean,
default: false
},
rowmst: {
type: Object
},
openArray: {
type: Array,
default: () => { return [] }
}
},
data() {
return {
dialogVisible: false,
fullscreenLoading: false,
button1: true,
button2: true,
button3: true,
tableDtl: [],
mstrow: {},
tabledis: [],
currentdtl: null,
currentDis: {},
form: {
checked: true
},
rules: {
}
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
},
openArray: {
handler(newValue) {
this.tableDtl = newValue
}
},
rowmst: {
handler(newValue) {
this.mstrow = newValue
}
}
},
methods: {
close() {
this.$emit('update:dialogShow', false)
this.currentDis = {}
this.currentdtl = null
this.tableDtl = []
this.tabledis = []
this.$emit('TaskChanged')
},
bill_statusFormat(row) {
return this.dict.label.io_bill_status[row.bill_status]
},
taskdtl_typeFormat(row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
},
task_statusFormat(row) {
return this.dict.label.task_status[row.task_status]
},
tabledisabled(row) {
if (row.task_status === '01' && row.is_issued === '0') {
return false
} else {
return true
}
},
deleteRow(row) {
checkoutbill.allCancel(row).then(res => {
this.queryTableDtl()
})
},
issueTask() {
if (this.currentDis != null) {
this.fullscreenLoading = true
checkoutbill.issueTask(this.currentDis).then(res => {
this.queryTableDdis()
this.fullscreenLoading = false
}).catch(() => {
this.fullscreenLoading = false
})
}
},
finishTask() {
if (this.currentDis != null) {
this.fullscreenLoading = true
checkoutbill.finishTask(this.currentDis).then(res => {
this.queryTableDdis()
this.fullscreenLoading = false
}).catch(() => {
this.fullscreenLoading = false
})
}
},
cancleTaskfinish() {
if (this.currentDis != null) {
this.fullscreenLoading = true
checkoutbill.cancleTaskfinish(this.currentDis).then(res => {
this.queryTableDdis()
this.fullscreenLoading = false
}).catch(() => {
this.fullscreenLoading = false
})
}
},
handleDtlCurrentChange(current) {
if (current !== null) {
this.tabledis = []
this.currentdtl = current
this.queryTableDdis()
} else {
this.tabledis = []
this.currentdtl = {}
}
},
handleDisCurrentChange(current) {
if (current === null || this.rowmst.bill_status === '99') {
this.button1 = true
this.button2 = true
this.button3 = true
this.currentDis = {}
return
}
this.currentDis = current
if (current.task_status === '01') {
this.button1 = false
} else {
this.button1 = true
}
if (current.task_status !== '99') {
this.button2 = false
this.button3 = true
} else {
this.button2 = true
this.button3 = false
}
},
queryTableDtl() {
this.tableDtl = []
checkoutbill.getOutBillDtl({ 'iostorinv_id': this.mstrow.iostorinv_id }).then(res => {
this.tableDtl = res
})
},
queryTableDdis() {
if (this.currentdtl !== null) {
checkoutbill.getOutBillTask({ 'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id, 'checked': this.form.checked }).then(res => {
this.tabledis = res
}).catch(() => {
this.tabledis = []
})
}
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size:20px;
color:#303133;
}
.crud-opts2 .role-span2 {
padding: 0px 0px 20px 0px;
}
.crud-opts2 .crud-opts-form {
padding: 10px 0px 0px 50px;
}
</style>

View File

@@ -0,0 +1,289 @@
<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="85px" label-suffix=":">
<el-form-item label="单据号" prop="bill_code">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
</el-form-item>
<el-form-item label="仓库" prop="stor_id">
<label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
<el-select
v-model="form.stor_id"
clearable
placeholder="仓库"
class="filter-item"
style="width: 210px"
:disabled="true"
>
<el-option
v-for="item in storlist"
:key="item.stor_id"
:label="item.stor_name"
:value="item.stor_id"
/>
</el-select>
</el-form-item>
<el-form-item label="业务类型" prop="bill_type">
<el-select
v-model="form.bill_type"
clearable
placeholder="业务类型"
style="width: 210px"
class="filter-item"
:disabled="true"
>
<el-option
v-for="item in billtypelist"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="单据状态" prop="bill_status">
<el-select
v-model="form.bill_status"
clearable
style="width: 210px"
placeholder="单据状态"
class="filter-item"
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="明细数" prop="detail_count">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="总重量" prop="total_qty">
<label slot="label">&nbsp;&nbsp;&nbsp;:</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="true" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</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 prop="bill_code" label="出库单号" align="center" />
<el-table-column :formatter="bill_statusFormat" prop="bill_status" label="状态" />
<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="pcsn" label="批次号" align="center" />
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
<el-table-column prop="qty_unit_name" label="单位" align="center" />
<el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" />
<el-table-column prop="source_bill_code" label="源单号" align="center" width="130px" />
<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'}"
@current-change="handleDisCurrentChange"
>
<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="pcsn" label="批次号" align="center" />
<el-table-column prop="storagevehicle_code" label="载具号" align="center" />
<el-table-column prop="bucket_num" label="桶数" :formatter="crud.formatNum0" align="center" />
<el-table-column prop="total_storage_qty" :formatter="crud.formatNum3" label="重量" align="center" />
<el-table-column prop="start_point_code" label="起始位置" align="center" />
<el-table-column prop="next_point_code" label="目的位置" align="center" />
<el-table-column prop="task_code" label="任务号" align="center" />
<el-table-column prop="taskdtl_type" label="任务类型" align="center" width="150px" :formatter="taskdtl_typeFormat" />
<el-table-column prop="task_status" label="状态" align="center" width="110px" :formatter="task_statusFormat" />
</el-table>
</el-card>
</el-dialog>
</template>
<script>
import { crud } from '@crud/crud'
import checkoutbill from '@/views/wms/st/outbill/checkoutbill'
import crudStorattr from "@/views/wms/basedata/st/stor/storattr";
import crudRawAssist from "@/views/wms/st/inbill/rawassist";
export default {
name: 'ViewDialog',
components: { },
mixins: [crud()],
dicts: ['io_bill_status', 'work_status', 'task_status', 'SCH_TASK_TYPE_DTL'],
props: {
dialogShow: {
type: Boolean,
default: false
},
rowmst: {
type: Object
}
},
data() {
return {
dialogVisible: false,
tableDtl: [],
tabledis: [],
billtypelist: [],
storlist: [],
currentdtl: null,
currentDis: {},
form:{}
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
},
rowmst: {
handler(newValue) {
this.form = newValue
}
}
},
created() {
checkoutbill.getInvTypes().then(res => {
this.billtypelist = res
}),
// 查询原材料库的仓库
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
this.storlist = res.content
})
},
methods: {
open() {
this.queryTableDtl()
},
close() {
this.$emit('update:dialogShow', false)
this.currentDis = {}
this.currentdtl = null
this.tableDtl = []
this.tabledis = []
this.$emit('AddChanged')
},
bill_statusFormat(row) {
return this.dict.label.io_bill_status[row.bill_status]
},
taskdtl_typeFormat(row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
},
task_statusFormat(row) {
return this.dict.label.task_status[row.task_status]
},
work_statusFormat(row) {
return this.dict.label.work_status[row.work_status]
},
handleDtlCurrentChange(current) {
if (current !== null) {
this.tabledis = []
this.currentdtl = current
this.queryTableDdis()
} else {
this.tabledis = []
this.currentdtl = {}
}
},
invtypeFormat(row, column) {
for (const item of this.billtypelist) {
if (item.code === row.source_bill_type) {
return item.name
}
}
},
handleDisCurrentChange(current) {
this.currentDis = current
},
queryTableDtl() {
checkoutbill.getOutBillDtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
this.tableDtl = res
})
},
queryTableDdis() {
if (this.currentdtl !== null) {
checkoutbill.getOutBillTask({ 'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id }).then(res => {
this.tabledis = res
}).catch(() => {
this.tabledis = []
})
}
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size:20px;
color:#303133;
}
.crud-opts2 .role-span2 {
padding: 0px 0px 20px 0px;
}
.crud-opts2 {
padding: 10px 0px 0px 50px;
}
</style>

View File

@@ -0,0 +1,158 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/checkoutbill',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/checkoutbill/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/checkoutbill',
method: 'put',
data
})
}
export function getOutBillDtl(params) {
return request({
url: '/api/checkoutbill/getOutBillDtl',
method: 'get',
params
})
}
export function getOutBillDis(params) {
return request({
url: '/api/checkoutbill/getOutBillDis',
method: 'get',
params
})
}
export function getOutBillDisDtl(params) {
return request({
url: '/api/checkoutbill/getOutBillDisDtl',
method: 'get',
params
})
}
export function getOutBillTask(params) {
return request({
url: '/api/checkoutbill/getOutBillTask',
method: 'get',
params
})
}
export function getInvTypes() {
return request({
url: '/api/checkoutbill/getInvTypes',
method: 'get'
})
}
export function insertDtl(data) {
return request({
url: '/api/checkoutbill/insertDtl',
method: 'post',
data
})
}
export function allDiv(data) {
return request({
url: '/api/checkoutbill/allDiv',
method: 'post',
data
})
}
export function allCancel(data) {
return request({
url: '/api/checkoutbill/allCancel',
method: 'post',
data
})
}
export function setPoint(data) {
return request({
url: '/api/checkoutbill/setPoint',
method: 'post',
data
})
}
export function getStructIvt(params) {
return request({
url: '/api/checkoutbill/getStructIvt',
method: 'get',
params
})
}
export function manualDiv(data) {
return request({
url: '/api/checkoutbill/manualDiv',
method: 'post',
data
})
}
export function confirm(data) {
return request({
url: '/api/checkoutbill/confirm',
method: 'post',
data
})
}
export function issueTask(data) {
return request({
url: '/api/checkoutbill/issueTask',
method: 'post',
data
})
}
export function finishTask(data) {
return request({
url: '/api/checkoutbill/finishTask',
method: 'post',
data
})
}
export function cancleTaskfinish(data) {
return request({
url: '/api/checkoutbill/cancleTaskfinish',
method: 'post',
data
})
}
export function paramByCodeType(data) {
return request({
url: '/api/checkoutbill/paramByCodeType',
method: 'post',
data
})
}
export function schAreaType(data) {
return request({
url: '/api/checkoutbill/schAreaType',
method: 'post',
data
})
}
export function backConfirm(data) {
return request({
url: '/api/checkoutbill/backConfirm',
method: 'post',
data
})
}
export function getType() {
return request({
url: '/api/checkoutbill/getType',
method: 'get'
})
}
export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, setPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType,backConfirm, getOutBillDisDtl, getType }

View File

@@ -8,99 +8,102 @@
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="90px"
label-width="80px"
label-suffix=":"
>
<el-form-item label="单据编号">
<el-form-item label="模糊查询">
<el-input
v-model="query.bill_code"
size="mini"
clearable
placeholder="单据编号"
style="width: 185px;"
class="filter-item"
placeholder="出库单号"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="物料编码">
<el-input
v-model="query.material_code"
clearable
placeholder="物料编码、名称"
style="width: 185px;"
class="filter-item"
/>
</el-form-item>
<el-form-item label="载具编号">
<el-input
v-model="query.vehicle_code"
clearable
placeholder="载具编码"
style="width: 185px;"
class="filter-item"
/>
</el-form-item>
<el-form-item label="批次">
<el-input
v-model="query.pcsn"
clearable
placeholder="批次"
style="width: 185px;"
class="filter-item"
/>
</el-form-item>
<el-form-item label="单据状态">
<el-form-item label="所属仓库">
<el-select
v-model="query.bill_status"
v-model="query.stor_id"
clearable
filterable
size="mini"
placeholder="全部"
class="filter-item"
style="width: 185px;"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.st_bill_status"
v-for="item in storlist"
:key="item.stor_id"
:label="item.stor_name"
:value="item.stor_id"
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="query.createTime"
type="daterange"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
@change="crud.toQuery"
/>
</el-form-item>
<el-form-item label="生成方式">
<el-select
v-model="query.create_mode"
clearable
size="mini"
placeholder="生成方式"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.ST_CREATE_MODE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="起始点位">
<el-input
v-model="query.start_point_code"
<el-form-item label="单据状态">
<el-select
v-model="query.bill_status"
clearable
placeholder="点位编码、名称"
style="width: 185px;"
size="mini"
placeholder="单据状态"
class="filter-item"
/>
@change="crud.toQuery"
>
<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-input
v-model="query.end_point_code"
<el-form-item label="业务类型">
<el-select
v-model="query.bill_type"
clearable
placeholder="点位编码、名称"
style="width: 185px;"
filterable
size="mini"
placeholder="业务类型"
class="filter-item"
/>
@change="crud.toQuery"
>
<el-option
v-for="item in billtypelist"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="起始区域">
<el-input
v-model="query.start_region_code"
clearable
placeholder="区域编码、名称"
style="width: 185px;"
class="filter-item"
/>
</el-form-item>
<el-form-item label="终点区域">
<el-input
v-model="query.end_region_code"
clearable
placeholder="区域编码、名称"
style="width: 185px;"
class="filter-item"
/>
</el-form-item>
<rrOperation :crud="crud" />
<rrOperation />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
@@ -111,341 +114,253 @@
type="success"
icon="el-icon-position"
size="mini"
:loading="loading"
:disabled="crud.selections.length !== 1"
@click="createTask"
:disabled="dis_flag"
@click="divOpen"
>
生成任务
分配
</el-button>
<el-button
slot="right"
class="filter-item"
type="success"
:disabled="work_flag"
icon="el-icon-position"
size="mini"
@click="taskOpen"
>
作业任务
</el-button>
<el-button
slot="right"
class="filter-item"
type="warning"
:disabled="confirm_flag"
icon="el-icon-check"
size="mini"
@click="confirm"
>
强制确认
</el-button>
</crudOperation>
<!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0 || crud.status.view > 0 " :title="crud.status.title" width="700px">
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="物料" prop="material_id">
<label slot="label">物&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;料:</label>
<el-input v-model="form.material_name" style="width: 200px;" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="批次">
<label slot="label">批&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;次:</label>
<el-input v-model="form.pcsn" style="width: 200px;" disabled />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="载具编码:">
<el-input v-model="form.vehicle_code" style="width: 200px;" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="数量" prop="qty">
<label slot="label">数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;量:</label>
<el-input v-model="form.qty" style="width: 200px;" disabled />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="起始区域:" prop="start_region_id">
<el-select
v-model="form.start_region_id"
placeholder="请选择"
style="width: 200px;"
:disabled="crud.status.view > 0"
@change="changeStart"
>
<el-option
v-for="item in reginoList"
:label="item.region_name"
:value="item.region_id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="终点区域:" prop="end_region_id">
<el-select
v-model="form.end_region_id"
placeholder="请选择"
style="width: 200px;"
:disabled="crud.status.view > 0"
@change="changeEnd"
>
<el-option
v-for="item in reginoList"
:label="item.region_name"
:value="item.region_id"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="起始点位:" prop="start_point_code">
<el-input v-model="form.start_point_name" style="width: 200px;" :disabled="crud.status.view > 0" @focus="openStartPonit" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="终点点位:" prop="end_point_code">
<el-input v-model="form.end_point_name" style="width: 200px;" :disabled="crud.status.view > 0" @focus="openEndPonit" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注:">
<el-input v-model="form.remark" type="textarea" style="width: 530px;" :disabled="crud.status.view > 0" />
</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" :disabled="crud.status.view > 0" @click="crud.submitCU">确认</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column v-if="false" prop="iostorinv_id" label="出入单标识" />
<el-table-column prop="bill_code" label="单据编号" show-overflow-tooltip width="120px">
<template slot-scope="scope">
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.bill_code }}</el-link>
</template>
</el-table-column>
<el-table-column prop="bill_status" label="单据状态">
<template slot-scope="scope">
{{ dict.label.st_bill_status[scope.row.bill_status] }}
</template>
</el-table-column>
<el-table-column prop="material_code" label="物料编码" show-overflow-tooltip width="120px" />
<el-table-column prop="material_name" label="物料名称" show-overflow-tooltip width="120px" />
<el-table-column prop="pcsn" label="批次" />
<el-table-column prop="vehicle_code" label="载具编码" />
<el-table-column prop="qty" label="数量" :formatter="crud.formatNum2" />
<el-table-column prop="unit_name" label="单位" />
<el-table-column prop="start_point_name" label="起始点位" show-overflow-tooltip width="120px" />
<el-table-column prop="end_point_name" label="终点点位" show-overflow-tooltip width="120px" />
<el-table-column prop="start_region_name" label="起始区域" />
<el-table-column prop="end_region_name" label="终点区域" />
<el-table-column prop="task_id" label="任务标识" show-overflow-tooltip width="120px" />
<el-table-column prop="create_mode" label="生成方式">
<template slot-scope="scope">
{{ dict.label.ST_CREATE_MODE[scope.row.create_mode] }}
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
<el-table-column prop="create_name" label="创建人" />
<el-table-column prop="create_time" label="创建时间" show-overflow-tooltip width="140px" />
<el-table-column prop="update_optname" label="修改人" />
<el-table-column prop="update_time" label="修改时间" show-overflow-tooltip width="140px" />
<el-table-column prop="confirm_optname" label="确认人" />
<el-table-column prop="confirm_time" label="确认时间" show-overflow-tooltip width="140px" />
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<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
v-permission="['admin','checkoutbill:del','checkoutbill:edit']"
label="操作"
width="115"
align="center"
fixed="right"
>
<template slot-scope="scope">
<udOperation
:disabled-edit="scope.row.bill_status !== '10'"
:disabled-dle="scope.row.bill_status !== '10'"
:data="scope.row"
: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="100" prop="bill_status" label="单据状态" />
<el-table-column prop="stor_name" label="仓库" width="100" />
<el-table-column show-overflow-tooltip prop="bill_type" :formatter="bill_typeFormat" min-width="120" label="业务类型" />
<el-table-column show-overflow-tooltip width="135" prop="biz_date" label="业务日期" />
<el-table-column show-overflow-tooltip :formatter="create_modeFormat" prop="create_mode" label="生成方式" width="100" />
<el-table-column label="明细数" align="center" prop="detail_count" width="100" />
<el-table-column show-overflow-tooltip prop="input_time" width="135" label="创建日期" />
</el-table>
<!--分页组件-->
<pagination />
</div>
<MaterDialog :dialog-show.sync="materDialog" :open-param="materParam" @getMaterial="getMaterial" />
<PointDialog :dialog-show.sync="pointDialog" :open-param="pointParam" @tableChanged2="tableChanged2" />
<AddDialog @AddChanged="querytable" />
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
<DivDialog :dialog-show.sync="divShow" :open-array="openParam" :rowmst="mstrow" @DivChanged="querytable" />
<TaskDialog :dialog-show.sync="taskShow" :open-array="openParam" :rowmst="mstrow" @TaskChanged="querytable" />
</div>
</template>
<script>
import crudRegionioOut from '@/views/wms/st/outbill/regionioOut'
import MaterDialog from '@/views/wms/st/outbill/MaterDialog'
import PointDialog from '@/views/wms/pub/PointDialog'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import checkoutbill from '@/views/wms/st/outbill/checkoutbill'
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 crudPoint from '@/views/wms/sch/point/point'
import AddDialog from '@/views/wms/st/outbill/AddDialog'
import DivDialog from '@/views/wms/st/outbill/DivDialog'
import TaskDialog from '@/views/wms/st/outbill/TaskDialog'
import ViewDialog from '@/views/wms/st/outbill/ViewDialog'
import crudStorattr from '@/views/wms/basedata/st/stor/storattr'
import crudRawAssist from '@/views/wms/st/inbill/rawassist'
const defaultForm = {
iostorinv_id: null,
bill_code: null,
io_type: null,
material_id: null,
material_name: null,
pcsn: null,
vehicle_code: null,
qty: null,
qty_unit_id: null,
bill_status: null,
start_point_code: null,
end_point_code: null,
start_point_name: null,
end_point_name: null,
start_region_id: null,
end_region_id: null,
cust_id: null,
create_mode: null,
task_id: null,
remark: null,
create_id: null,
create_name: null,
create_time: null,
update_optid: null,
update_optname: null,
update_time: null,
confirm_optid: null,
confirm_optname: null,
confirm_time: null,
is_delete: null
}
export default {
name: 'RegionioOut',
dicts: ['st_bill_status', 'ST_CREATE_MODE'],
components: { pagination, crudOperation, rrOperation, udOperation, MaterDialog, PointDialog },
mixins: [presenter(), header(), form(defaultForm), crud()],
name: 'Checkoutbill',
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DivDialog, TaskDialog },
cruds() {
return CRUD({
title: '区域出库',
url: 'api/regionioOut',
idField: 'iostorinv_id',
sort: 'iostorinv_id,desc',
crudMethod: { ...crudRegionioOut },
return CRUD({ title: '用户', idField: 'iostorinv_id', url: 'api/checkoutbill', crudMethod: { ...checkoutbill },
optShow: {
add: true,
edit: false,
del: false,
download: false,
reset: true
}
})
reset: true,
download: false
}})
},
mixins: [presenter(), header(), crud()],
// 数据字典
dicts: ['io_bill_status', 'ST_CREATE_MODE'],
data() {
return {
loading: false,
is_startOrEnd: null,
pointParam: null,
materParam: null,
end_region_param: null,
reginoList: [],
materDialog: false,
pointDialog: false,
permission: {},
rules: {
material_id: [
{ required: true, message: '物料不能为空', trigger: 'blur' }
],
qty: [
{ required: true, message: '数量不能为空', trigger: 'blur' }
],
start_region_id: [
{ required: true, message: '起点区域不能为空', trigger: 'blur' }
],
end_region_id: [
{ required: true, message: '终点区域不能为空', trigger: 'blur' }
],
start_point_code: [
{ required: true, message: '起点点位不能为空', trigger: 'blur' }
],
end_point_code: [
{ required: true, message: '终点点位不能为空', trigger: 'blur' }
]
}
height: document.documentElement.clientHeight - 180 + 'px;',
permission: {
add: ['admin', 'checkoutbill:add'],
edit: ['admin', 'checkoutbill:edit'],
del: ['admin', 'checkoutbill:del']
},
divShow: false,
taskShow: false,
dis_flag: true,
work_flag: true,
confirm_flag: true,
openParam: [],
mstrow: {},
viewShow: false,
currentRow: null,
checkrows: [],
storlist: [],
billtypelist: []
}
},
mounted: function() {
const that = this
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 180 + 'px;'
}
},
created() {
crudPoint.getRegion().then(res => {
this.reginoList = res
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
this.storlist = res.content
})
crudRawAssist.getType({ 'io_code': '0101', 'io_flag': '01' }).then(res => {
this.billtypelist = res
})
},
methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据
canUd(row) {
return row.bill_status !== '10'
},
toView(index, row) {
this.mstrow = row
this.viewShow = true
},
[CRUD.HOOK.beforeRefresh]() {
return true
this.crud.query.buss_type = '0101'
this.handleCurrentChange(null)
},
getMater() {
this.materDialog = true
},
setMaterValue(row) {
debugger
this.form.material_id = row.material_id
this.form.material_name = row.material_name
},
changeStart(val) {
this.materParam = val
this.form.start_point_name = null
this.form.start_point_code = null
},
changeEnd(val) {
this.pointParam = val
this.form.end_point_name = null
this.form.end_point_code = null
},
openStartPonit() {
if (this.form.start_region_id === null) {
return this.crud.notify('请选择起始区域', CRUD.NOTIFICATION_TYPE.INFO)
}
this.materDialog = true
},
openEndPonit() {
if (this.form.end_region_id === null) {
return this.crud.notify('请选择终点区域', CRUD.NOTIFICATION_TYPE.INFO)
}
// 2代表终点点位
this.is_startOrEnd = '2'
this.pointDialog = true
},
getMaterial(row) {
this.form.material_id = row.material_id
this.form.material_name = row.material_name
this.form.vehicle_code = row.vehicle_code
this.form.pcsn = row.pcsn
this.form.qty = row.canuse_qty
this.form.start_point_code = row.struct_code
this.form.start_point_name = row.struct_name
},
tableChanged2(row) {
if (this.is_startOrEnd === '1') {
this.form.start_point_code = row.point_code
this.form.start_point_name = row.point_name
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.form.end_point_code = row.point_code
this.form.end_point_name = row.point_name
this.handleCurrentChange(null)
}
},
createTask() {
const _selectData = this.$refs.table.selection
if (_selectData[0].bill_status !== '10') {
return this.crud.notify('只能对生成状态的单据生成任务', CRUD.NOTIFICATION_TYPE.INFO)
onSelectAll() {
this.$refs.table.clearSelection()
this.handleCurrentChange(null)
},
buttonChange(current) {
if (current !== null) {
this.currentRow = current
if (current.bill_status === '10' || current.bill_status === '30' || current.bill_status === '40') {
this.dis_flag = false
} else {
this.dis_flag = true
}
if (current.bill_status === '30' || current.bill_status === '40') {
this.work_flag = false
} else {
this.work_flag = true
}
if (current.bill_status === '50' || current.bill_status === '40') {
this.confirm_flag = false
} else {
this.confirm_flag = true
}
}
const data = _selectData[0]
this.loading = true
crudRegionioOut.createTask(data).then(res => {
this.crud.toQuery()
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.loading = false
}).catch(() => {
this.loading = false
},
stateFormat(row) {
return this.dict.label.io_bill_status[row.bill_status]
},
bill_typeFormat(row) {
for (const item of this.billtypelist) {
if (item.code === row.bill_type) {
return item.name
}
}
},
create_modeFormat(row) {
return this.dict.label.ST_CREATE_MODE[row.create_mode]
},
handleCurrentChange(current) {
if (current === null) {
this.dis_flag = true
this.confirm_flag = true
this.work_flag = true
this.currentRow = {}
}
},
checkboxT(row) {
return row.bill_status !== '99'
},
divOpen() {
checkoutbill.getOutBillDtl({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
this.openParam = res
this.divShow = true
this.mstrow = this.currentRow
})
},
taskOpen() {
checkoutbill.getOutBillDtl({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
this.openParam = res
this.taskShow = true
this.mstrow = this.currentRow
})
},
confirm() {
checkoutbill.confirm({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
this.querytable()
})
},
querytable() {
this.onSelectAll()
this.crud.toQuery()
this.handleCurrentChange(null)
}
}
}
</script>
<style scoped>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 10px;
}
</style>

View File

@@ -1,35 +0,0 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/regionioOut',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/regionioOut/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/regionioOut',
method: 'put',
data
})
}
export function createTask(data) {
return request({
url: 'api/regionioOut/createTask',
method: 'post',
data
})
}
export default { add, edit, del, createTask }