add:备件入库

This commit is contained in:
2023-09-11 08:52:36 +08:00
parent fb92de15c0
commit 9ece4e9113
36 changed files with 3368 additions and 3 deletions

View File

@@ -0,0 +1,488 @@
<!--suppress ALL -->
<template>
<el-dialog
:title="crud.status.title"
append-to-body
fullscreen
:before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
width="1200px"
@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-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="biz_date">
<el-date-picker
v-model="form.biz_date"
type="date"
placeholder="选择日期"
style="width: 210px"
align="center"
value-format="yyyy-MM-dd"
:disabled="crud.status.view > 0"
/>
</el-form-item>
<el-form-item label="业务类型" prop="bill_type">
<el-select
v-model="form.bill_type"
clearable
size="mini"
placeholder="业务类型"
class="filter-item"
>
<el-option
v-for="item in dict.ST_INV_RAW_IN_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="仓库" prop="stor_id">
<label slot="label">仓库</label>
<el-select
v-model="form.stor_id"
clearable
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="workshop_id">
<label slot="label">车间</label>
<el-select
v-model="form.workshop_id"
clearable
size="mini"
placeholder="全部"
class="filter-item"
>
<el-option
v-for="item in dict.product_area"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="仓位" prop="struct_id">
<label slot="label">仓位:</label>
<el-cascader
v-model="form.struct_id"
placeholder="请选择"
:options="sects"
:props="{ checkStrictly: true }"
clearable
@change="sectQueryChange"
/>
</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.number="form.total_qty"
:controls="false"
:precision="3"
:min="0"
disabled
style="width: 210px"
/>
</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>
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
<div class="crud-opts2" style="margin-bottom: 5px;">
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="insertEvent()"
>
添加备件
</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="55" align="center" />
<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="plan_qty" label="入库数量">
<template slot-scope="scope">
<el-input-number
v-model.number="form.tableData[scope.$index].plan_qty"
size="small"
:controls="false"
controls-position="right"
:precision="3"
:min="0"
@change="changeQty"
/>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" />
<el-table-column show-overflow-tooltip prop="remark" label="明细备注">
<template slot-scope="scope">
<el-input
v-model="form.tableData[scope.$index].remark"
size="small"
:controls="false"
controls-position="right"
/>
</template>
</el-table-column>
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="170" 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)"
/>
</template>
</el-table-column>
</el-table>
<MaterDtl
:dialog-show.sync="materShow"
:is-single="false"
@setMaterValue="tableChanged"
/>
</el-dialog>
</template>
<script>
import CRUD, { crud, form } from '@crud/crud'
import MaterDtl from '@/views/wms/pub/MaterDialog'
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
import crudProductIn from '@/views/wms/device_manage/ios/embiin/embiin'
import crudStructattr from '@/api/wms/basedata/st/structattr'
const defaultForm = {
bill_code: '',
product_code: '',
bill_status: '10',
total_qty: 0,
detail_count: '0',
stor_id: '',
struct_id: '',
bill_type: '',
remark: '',
workshop_id: '',
biz_date: new Date(),
create_mode: '',
tableData: []
}
export default {
name: 'AddDialog',
components: { MaterDtl },
mixins: [crud(), form(defaultForm)],
dicts: ['IO_BILL_STATUS', 'ST_INV_RAW_IN_TYPE', 'ST_QUALITY_SCODE', 'bill_type', 'product_area'],
props: {
dialogShow: {
type: Boolean,
default: false
}
},
data() {
return {
dialogVisible: false,
materShow: false,
billShow: false,
struct_id: '',
sect_id: '',
opendtlParam: null,
storlist: [],
sects: [],
rules: {
product_code: [
{ required: true, message: '生产车间不能为空', trigger: 'blur' }
],
bill_type: [
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
],
biz_date: [
{ required: true, message: '业务日期不能为空', trigger: 'blur' }
]
}
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
crudStorattr.getStor({ 'stor_type': '6' }).then(res => {
this.storlist = res.content
})
},
close() {
this.$emit('AddChanged')
},
[CRUD.HOOK.afterToEdit]() {
// 获取入库单明细
crudProductIn.getIODtl({ '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]
this.form.tableData.splice(i, 1, row)
}
})
},
[CRUD.HOOK.beforeToEdit]() {
this.struct_id = this.crud.form.struct_id
this.sect_id = this.crud.form.sect_id
crudStructattr.getSectCascader({ 'stor_id': this.crud.form.stor_id }).then(res => {
this.sects = res.content
this.form.struct_id = this.search(this.sects, this.struct_id)
})
},
[CRUD.HOOK.afterToView]() {
crudProductIn.getIODtl({ 'bill_code': this.form.bill_code }).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
this.form.tableData.splice(i, 1, row)
}
})
},
[CRUD.HOOK.beforeSubmit]() {
// 提交前校验
if (this.form.tableData.length === 0) {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!this.form.stor_id) {
this.crud.notify('仓库不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!this.struct_id) {
this.crud.notify('仓位不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
if (!row.plan_qty) {
this.crud.notify('数量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
row.sect_id = this.sect_id
row.struct_id = this.struct_id
}
},
storChange(value) {
crudStructattr.getSectCascader({ 'stor_id': value }).then(res => {
this.sects = res.content
})
},
search(object, value) {
for (var key in object) {
if (object[key].value == value) return [object[key].value]
if (object[key].children && Object.keys(object[key].children).length > 0) {
var temp = this.search(object[key].children, value)
if (temp) return [object[key].value, temp].flat()
}
}
},
sectQueryChange(val) {
this.sectProp = val
if (val.length === 1) {
this.sect_id = val[0]
this.struct_id = ''
}
if (val.length === 0) {
this.sect_id = ''
this.struct_id = ''
}
if (val.length === 2) {
this.sect_id = val[0]
this.struct_id = val[1]
}
},
deleteRow(index, rows) {
const material_code = rows[index].material_code
let len = rows.length
while (len--) {
const obj = rows[len]
if (material_code === obj.material_code) {
const index = rows.indexOf(obj)
if (index > -1) { // 移除找到的指定元素
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
}
}
}
},
tableChanged(rows) {
// 对新增的行进行校验不能存在相同物料批次
rows.forEach((item) => {
let same_mater = true
this.form.tableData.forEach((row) => {
if (row.material_code === item.material_code) {
same_mater = false
}
})
if (same_mater) {
item.quality_scode = '01'
item.ivt_level = '01'
item.is_active = '1'
item.plan_qty = 1
item.qty_unit_id = item.base_unit_id
item.qty_unit_name = item.base_unit_name
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
this.form.tableData.splice(-1, 0, item)
}
})
this.form.detail_count = this.form.tableData.length
},
tableChanged2(rows) {
debugger
// 对新增的行进行校验不能存在相同物料批次
rows.forEach((item) => {
let same_mater = true
this.form.tableData.forEach((row) => {
if (row.material_code === item.material_code && row.po_code === item.po.code) {
same_mater = false
}
})
if (same_mater) {
item.quality_scode = '01'
item.ivt_level = '01'
item.is_active = '1'
item.plan_qty = parseFloat(item.need_qty)
item.source_bill_code = item.po_code
item.source_bill_type_name = '原料需求'
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
this.form.tableData.splice(-1, 0, item)
}
})
this.form.detail_count = this.form.tableData.length
},
insertEvent(row) {
this.materShow = true
},
insertBill(row) {
this.billShow = true
},
changeQty() {
this.form.total_qty = 0
this.form.tableData.forEach((item) => {
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
})
}
}
}
</script>
<style>
.crud-opts2 {
padding: 4px 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .crud-opts-right2 {
margin-left: auto;
}
</style>

View File

@@ -0,0 +1,265 @@
<!--suppress ALL -->
<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="生产车间">
<el-select
v-model="form.product_code"
clearable
size="mini"
placeholder="全部"
:disabled="true"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.product_area"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="业务类型">
<el-select
v-model="form.bill_type"
clearable
filterable
size="mini"
:disabled="true"
placeholder="业务类型"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.EM_BI_IN_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</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"
align="center"
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 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="批次" width="150" 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 show-overflow-tooltip prop="remark" label="明细备注" align="center" />
</el-table>
</el-card>
</el-dialog>
</template>
<script>
import { crud } from '@crud/crud'
import crudProductIn from '@/views/wms/device_manage/ios/embiin/embiin'
export default {
name: 'ViewDialog',
components: {},
mixins: [crud()],
dicts: ['EM_BI_IN_TYPE', 'product_area', 'IO_BILL_STATUS'],
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
}
}
},
methods: {
open() {
this.queryTableDtl()
},
close() {
this.$emit('update:dialogShow', false)
this.currentDis = {}
this.currentdtl = null
this.tableDtl = []
this.tabledis = []
this.$emit('AddChanged')
},
stateFormat(row, column) {
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() {
crudProductIn.getIODtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
this.tableDtl = res
})
},
queryTableDdis() {
if (this.currentdtl !== null) {
crudProductIn.getDisTask({ '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,49 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: '/api/emBiIostorinv',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: '/api/emBiIostorinv/delete',
method: 'post',
data: ids
})
}
export function edit(data) {
return request({
url: '/api/emBiIostorinv/update',
method: 'post',
data
})
}
export function confirm(data) {
return request({
url: '/api/emBiIostorinv/confirm',
method: 'post',
data
})
}
export function getIODtl(data) {
return request({
url: '/api/emBiIostorinv/getIODtl',
method: 'post',
data
})
}
export default {
add,
edit,
del,
confirm,
getIODtl
}

View File

@@ -0,0 +1,341 @@
<!--suppress ALL -->
<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="80px"
label-suffix=":"
>
<el-form-item label="仓库">
<el-select
v-model="query.stor_id"
clearable
size="mini"
placeholder="仓库"
class="filter-item"
@change="crud.toQuery"
>
<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="单据类型">
<el-select
v-model="query.bill_type"
clearable
filterable
size="mini"
placeholder="单据类型"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.EM_BI_IN_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生成方式">
<el-select
v-model="query.create_mode"
clearable
filterable
size="mini"
placeholder="生成方式"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.ST_INV_CREATE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</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"
align="center"
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.bill_status"
clearable
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.bill_code"
size="mini"
clearable
placeholder="入库单号"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="车间">
<el-select
v-model="query.workshop_id"
clearable
size="mini"
placeholder="全部"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.product_area"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<rrOperation />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission">
<el-button
slot="right"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
:disabled="confirm_flag"
@click="confirm"
>
强制确认
</el-button>
</crudOperation>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
size="mini"
:data="crud.data"
highlight-current-row
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
@current-change="handleCurrentChange"
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column type="selection" width="55" />
<el-table-column show-overflow-tooltip :formatter="stateFormat" prop="bill_status" label="单据状态" />
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.row)">{{ scope.row.bill_code }}</el-link>
</template>
</el-table-column>
<el-table-column prop="stor_name" label="生产车间" width="130" show-overflow-tooltip />
<el-table-column
show-overflow-tooltip
prop="bill_type"
min-width="120"
label="业务类型"
:formatter="bill_typeFormat"
/>
<el-table-column show-overflow-tooltip min-width="120" prop="biz_date" label="业务日期" />
<el-table-column label="明细数量" align="center" prop="detail_count" />
<el-table-column label="总数量" align="center" prop="total_qty">
<template slot-scope="scope">
{{ fun(scope.row.total_qty) }}
</template>
</el-table-column>
<el-table-column label="仓位" align="center" prop="struct_code" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="制单人" align="center" prop="create_name" />
<el-table-column label="制单时间" align="center" prop="create_time" width="150" />
<el-table-column label="修改人" align="center" prop="update_name" />
<el-table-column label="修改时间" align="center" prop="update_time" width="150" />
<el-table-column label="确认人" align="center" prop="confirm_name" width="150" />
<el-table-column label="确认时间" align="center" prop="confirm_time" width="150" />
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
:disabled-edit="canUd(scope.row)"
:disabled-dle="canUd(scope.row)"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
<AddDialog @AddChanged="querytable" />
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
</div>
</template>
<script>
import rawProductIn from '@/views/wms/device_manage/ios/embiin/embiin'
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 DateRangePicker from '@/components/DateRangePicker/index'
import AddDialog from '@/views/wms/device_manage/ios/embiin/AddDialog'
import ViewDialog from '@/views/wms/device_manage/ios/embiin/ViewDialog'
import { mapGetters } from 'vuex'
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
export default {
name: 'EmBiIn',
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
cruds() {
return CRUD({
title: '',
optShow: { add: true, reset: true },
idField: 'iostorinv_id',
url: '/api/emBiIostorinv',
sort: ['bill_code'],
crudMethod: { ...rawProductIn }
})
},
mixins: [presenter(), header(), crud()],
// 数据字典
dicts: ['IO_BILL_STATUS', 'EM_BI_IN_TYPE', 'product_area', 'ST_INV_CREATE'],
data() {
return {
height: document.documentElement.clientHeight - 180 + 'px;',
permission: {},
dis_flag: true,
confirm_flag: true,
disShow: false,
viewShow: false,
mstrow: {},
divShow: false,
openParam: [],
currentRow: null,
storlist: [],
storId: null
}
},
computed: {
...mapGetters([
'user'
])
},
mounted: function() {
const that = this
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 180 + 'px;'
}
},
created() {
crudStorattr.getStor({ 'stor_type': '6' }).then(res => {
this.storlist = res.content
})
},
methods: {
fun(val) {
return Number(val).toFixed(3)
},
canUd(row) {
return row.bill_status !== '10'
},
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(currentRow) {
if (currentRow !== null) {
this.currentRow = currentRow
if (currentRow.bill_status === '10') {
this.confirm_flag = false
} else {
this.confirm_flag = true
}
}
},
handleCurrentChange(currentRow) {
if (currentRow === null) {
this.dis_flag = true
this.confirm_flag = true
this.currentRow = {}
}
},
bill_typeFormat(row, column) {
return this.dict.label.EM_BI_IN_TYPE[row.bill_type]
},
toView(row) {
this.mstrow = row
this.viewShow = true
},
confirm() {
if (!this.currentRow) {
this.crud.notify('请选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
return
}
rawProductIn.confirm(this.currentRow).then(res => {
this.crud.notify('单据确认成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
})
},
stateFormat(row, column) {
return this.dict.label.IO_BILL_STATUS[row.bill_status]
},
querytable() {
this.onSelectAll()
this.crud.toQuery()
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 10px;
}
</style>