rev 混料工单
This commit is contained in:
287
lms/nladmin-ui/src/views/wms/basedata/bom/index.vue
Normal file
287
lms/nladmin-ui/src/views/wms/basedata/bom/index.vue
Normal file
@@ -0,0 +1,287 @@
|
||||
<template>
|
||||
<div v-loading.fullscreen.lock="fullscreenLoading" class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="90px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="BOM编码">
|
||||
<el-input
|
||||
v-model="query.name"
|
||||
clearable
|
||||
placeholder="BOM编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="600px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="160px" label-suffix=":">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="BOM编码" prop="material_code">
|
||||
<el-input :disabled="crud.status.edit" v-model="form.material_code" clearable style="width: 300px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="静置时间" prop="standing_time">
|
||||
<el-input v-model="form.standing_time" type="number" style="width: 300px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="阈值时间" prop="threshold_time">
|
||||
<el-input v-model="form.threshold_time" type="number" style="width: 300px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="info" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @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 prop="material_code" label="BOM编码" :min-width="flexWidth('material_code',crud.data,'BOM编码')" />
|
||||
<el-table-column prop="standing_time" label="困料时间" :min-width="flexWidth('standing_time',crud.data,'困料时间')" />
|
||||
<el-table-column prop="threshold_time" label="超时时间" :min-width="flexWidth('threshold_time',crud.data,'超时时间')" />
|
||||
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')" />
|
||||
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />
|
||||
<el-table-column prop="update_optname" label="修改人" :min-width="flexWidth('update_optname',crud.data,'修改人')" />
|
||||
<el-table-column prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')" />
|
||||
<el-table-column
|
||||
v-permission="[]"
|
||||
label="操作"
|
||||
fixed="right"
|
||||
width="120px"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:is-visiable-del="false"
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudMaterialbase from '@/api/wms/basedata/materialbase'
|
||||
import CRUD, { crud, form, 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 { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudClassstandard from '@/api/wms/basedata/classstandard'
|
||||
import crudMdPbMeasureunit from '@/api/wms/basedata/mdPbMeasureunit'
|
||||
|
||||
const defaultForm = {
|
||||
material_id: null,
|
||||
ass_unit_id: null,
|
||||
material_code: null,
|
||||
material_name: null,
|
||||
standing_time: null,
|
||||
threshold_time: null,
|
||||
a: null,
|
||||
b: null,
|
||||
h: null,
|
||||
w: null,
|
||||
product_code: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
weight: null,
|
||||
material_type: '2'
|
||||
}
|
||||
export default {
|
||||
name: 'BOM',
|
||||
// 数据字典
|
||||
dicts: ['is_used'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: 'BOM',
|
||||
optShow: { add: false, reset: true },
|
||||
url: 'api/Materialbase',
|
||||
idField: 'material_id',
|
||||
sort: 'material_id,desc',
|
||||
crudMethod: { ...crudMaterialbase },
|
||||
query: {
|
||||
material_type: '2'
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
classes1: [],
|
||||
classes2: [],
|
||||
classes3: [],
|
||||
fullscreenLoading: false,
|
||||
measure_unit: [],
|
||||
productSeries: [],
|
||||
permission: {},
|
||||
rules: {
|
||||
material_code: [
|
||||
{ required: true, message: '物料编码不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
[CRUD.HOOK.beforeToCU](crud, form) {
|
||||
crudMdPbMeasureunit.getUnit().then(res => {
|
||||
this.measure_unit = res.content
|
||||
})
|
||||
// 物料标识为空,新增
|
||||
if (!form.material_type_id) {
|
||||
form.material_type_id = null // 必须为null,否则会出现unknown
|
||||
} else { // 更新
|
||||
this.getSubTypes('02', form.material_type_id)
|
||||
}
|
||||
// 物料系列为空,新增
|
||||
if (!form.product_series) {
|
||||
form.product_series = null // 必须为null,否则会出现unknown
|
||||
} else { // 更新
|
||||
this.getSubTypes('03', form.product_series)
|
||||
}
|
||||
},
|
||||
getSubTypes(type, id) {
|
||||
const that = this
|
||||
crudClassstandard.getClassSuperior(id).then(res => {
|
||||
const data = res.content
|
||||
that.buildTree(data)
|
||||
if (type === '02') {
|
||||
that.classes2 = data
|
||||
}
|
||||
if (type === '03') {
|
||||
that.classes3 = data
|
||||
}
|
||||
})
|
||||
},
|
||||
synchronize() {
|
||||
this.fullscreenLoading = true
|
||||
crudMaterialbase.synchronize(this.crud.query).then(res => {
|
||||
this.fullscreenLoading = false
|
||||
this.crud.notify('同步成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
},
|
||||
queryClassId() {
|
||||
const param = {
|
||||
'class_idStr': this.class_idStr
|
||||
}
|
||||
crudClassstandard.queryClassById(param).then(res => {
|
||||
this.classes = res.content.map(obj => {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
buildTree(classes) {
|
||||
classes.forEach(data => {
|
||||
if (data.children) {
|
||||
this.buildTree(data.children)
|
||||
}
|
||||
if (data.hasChildren && !data.children) {
|
||||
data.children = null // 重点代码
|
||||
}
|
||||
})
|
||||
},
|
||||
// 改变状态
|
||||
changeEnabled(data, val) {
|
||||
this.$confirm('此操作将 "' + this.dict.label.is_used[val] + '" ' + data.material_name + ', 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudMaterialbase.edit(data).then(res => {
|
||||
this.crud.notify(this.dict.label.is_used[val] + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
if (data.is_used === '0') {
|
||||
data.is_used = '1'
|
||||
return
|
||||
}
|
||||
if (data.is_used === '1') {
|
||||
data.is_used = '0'
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
if (data.is_used === '0') {
|
||||
data.is_used = '1'
|
||||
return
|
||||
}
|
||||
if (data.is_used === '1') {
|
||||
data.is_used = '0'
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取子节点数据
|
||||
loadChildNodes({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
|
||||
parentNode.children = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
setTimeout(() => {
|
||||
callback()
|
||||
}, 100)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -14,25 +14,70 @@
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="160px" label-suffix=":">
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<el-input v-model="form.material_code" style="width: 370px;" />
|
||||
<el-input v-model="form.material_code" :disabled="crud.status.edit" placeholder="物料编码" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称">
|
||||
<el-input v-model="form.material_name" style="width: 370px;" />
|
||||
<el-form-item label="物料名称" prop="material_name">
|
||||
<el-input v-model="form.material_name" placeholder="物料名称" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单编号" prop="order_number">
|
||||
<el-input v-model="form.order_number" style="width: 370px;" />
|
||||
<el-form-item label="炉型" prop="furnace">
|
||||
<el-select
|
||||
v-model="form.furnace"
|
||||
placeholder="炉型"
|
||||
style="width: 300px"
|
||||
clearable
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.furnace"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户名称" prop="customer_name">
|
||||
<el-input v-model="form.customer_name" style="width: 370px;" />
|
||||
<el-form-item label="物料砖类型" prop="material_brick_type">
|
||||
<el-select
|
||||
v-model="form.material_brick_type"
|
||||
placeholder="物料砖类型"
|
||||
style="width: 300px"
|
||||
clearable
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.material_brick_type"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品名称" prop="product_name">
|
||||
<el-input v-model="form.product_name" style="width: 370px;" />
|
||||
<el-form-item label="BOM编码" prop="bom_code">
|
||||
<el-input v-model="form.bom_code" placeholder="BOM编码" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品牌号" prop="product_grade">
|
||||
<el-input v-model="form.product_grade" style="width: 370px;" />
|
||||
<el-form-item label="订单编码" prop="order_code">
|
||||
<el-input v-model="form.order_code" placeholder="订单编码" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户编码" prop="customer_code">
|
||||
<el-input v-model="form.customer_code" placeholder="客户编码" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="牌号" prop="product_grade">
|
||||
<el-select
|
||||
v-model="form.product_grade"
|
||||
placeholder="物料砖类型"
|
||||
style="width: 300px"
|
||||
clearable
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_grade"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="砖型" prop="brick_type">
|
||||
<el-input v-model="form.brick_type" style="width: 370px;" />
|
||||
<el-input v-model="form.brick_type" placeholder="砖型" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@@ -59,24 +104,34 @@
|
||||
:min-width="flexWidth('material_name',crud.data,'物料名称')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="order_number"
|
||||
label="订单编号"
|
||||
:min-width="flexWidth('order_number',crud.data,'订单编号')"
|
||||
prop="furnace_name"
|
||||
label="炉型"
|
||||
:min-width="flexWidth('furnace_name',crud.data,'炉型')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="customer_name"
|
||||
label="客户名称"
|
||||
:min-width="flexWidth('customer_name',crud.data,'客户名称')"
|
||||
prop="material_brick_type_name"
|
||||
label="物料砖类型"
|
||||
:min-width="flexWidth('material_brick_type_name',crud.data,'物料砖类型')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="product_name"
|
||||
label="产品名称"
|
||||
:min-width="flexWidth('product_name',crud.data,'产品名称')"
|
||||
prop="bom_code"
|
||||
label="BOM编码"
|
||||
:min-width="flexWidth('bom_code',crud.data,'BOM编码')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="product_grade"
|
||||
label="产品牌号"
|
||||
:min-width="flexWidth('product_grade',crud.data,'产品牌号')"
|
||||
prop="order_code"
|
||||
label="订单编码"
|
||||
:min-width="flexWidth('order_code',crud.data,'订单编码')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="customer_code"
|
||||
label="客户编码"
|
||||
:min-width="flexWidth('customer_code',crud.data,'客户编码')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="product_grade_name"
|
||||
label="牌号"
|
||||
:min-width="flexWidth('product_grade_name',crud.data,'牌号')"
|
||||
/>
|
||||
<el-table-column prop="brick_type" label="砖型" :min-width="flexWidth('brick_type',crud.data,'砖型')" />
|
||||
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')" />
|
||||
@@ -102,7 +157,6 @@
|
||||
<script>
|
||||
import crudMaterialDetail from '@/api/wms/basedata/materialDetail'
|
||||
import CRUD, { crud, form, 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'
|
||||
@@ -111,9 +165,11 @@ const defaultForm = {
|
||||
material_id: null,
|
||||
material_code: null,
|
||||
material_name: null,
|
||||
order_number: null,
|
||||
customer_name: null,
|
||||
product_name: null,
|
||||
furnace: null,
|
||||
material_brick_type: null,
|
||||
bom_code: null,
|
||||
order_code: null,
|
||||
customer_code: null,
|
||||
product_grade: null,
|
||||
brick_type: null,
|
||||
create_id: null,
|
||||
@@ -121,11 +177,13 @@ const defaultForm = {
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null
|
||||
update_time: null,
|
||||
is_delete: '0'
|
||||
}
|
||||
export default {
|
||||
name: 'MaterialDetail',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
dicts: ['furnace', 'material_brick_type', 'product_grade'],
|
||||
components: { pagination, crudOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -149,6 +207,27 @@ export default {
|
||||
rules: {
|
||||
material_code: [
|
||||
{ required: true, message: '物料编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
furnace: [
|
||||
{ required: true, message: '炉型不能为空', trigger: 'blur' }
|
||||
],
|
||||
material_brick_type: [
|
||||
{ required: true, message: '物料砖类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
bom_code: [
|
||||
{ required: true, message: 'BOM编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
order_code: [
|
||||
{ required: true, message: '订单编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
customer_code: [
|
||||
{ required: true, message: '客户编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
product_grade: [
|
||||
{ required: true, message: '牌号不能为空', trigger: 'blur' }
|
||||
],
|
||||
brick_type: [
|
||||
{ required: true, message: '砖型不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,18 +22,7 @@
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="synchronize()"
|
||||
>
|
||||
同步
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
@@ -50,20 +39,6 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="静置时间" prop="standing_time">
|
||||
<el-input v-model="form.standing_time" type="number" style="width: 300px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="阈值时间" prop="threshold_time">
|
||||
<el-input v-model="form.threshold_time" type="number" style="width: 300px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单重" prop="weight">
|
||||
@@ -122,8 +97,6 @@
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||
<el-table-column prop="standing_time" label="困料时间" :min-width="flexWidth('standing_time',crud.data,'困料时间')" />
|
||||
<el-table-column prop="threshold_time" label="超时时间" :min-width="flexWidth('threshold_time',crud.data,'超时时间')" />
|
||||
<el-table-column prop="weight" label="单重" :min-width="flexWidth('weight',crud.data,'单重')" />
|
||||
<el-table-column prop="product_code" label="产品编号" :min-width="flexWidth('product_code',crud.data,'产品编号')" />
|
||||
<el-table-column prop="a" label="长边长度" :min-width="flexWidth('a',crud.data,'长边长度')" />
|
||||
@@ -185,7 +158,8 @@ const defaultForm = {
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
weight: null
|
||||
weight: null,
|
||||
material_type: '1'
|
||||
}
|
||||
export default {
|
||||
name: 'Materialbase',
|
||||
@@ -200,7 +174,10 @@ export default {
|
||||
url: 'api/Materialbase',
|
||||
idField: 'material_id',
|
||||
sort: 'material_id,desc',
|
||||
crudMethod: { ...crudMaterialbase }
|
||||
crudMethod: { ...crudMaterialbase },
|
||||
query: {
|
||||
material_type: '1'
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
|
||||
@@ -98,33 +98,12 @@
|
||||
width="600px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="160px" label-suffix=":">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="false" label="物料标识" prop="material_id">
|
||||
<el-input v-model="form.material_id" style="width: 300px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<el-input
|
||||
:disabled="crud.status.edit"
|
||||
v-model="form.material_code"
|
||||
style="width: 300px"
|
||||
clearable
|
||||
@focus="materialShow=true"
|
||||
@clear="form.material_id=''; form.material_code=''; form.material_name=''"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="生产设备" prop="device_name">
|
||||
<el-input
|
||||
:disabled="crud.status.edit"
|
||||
v-model="form.device_name"
|
||||
:disabled="crud.status.edit"
|
||||
style="width: 300px"
|
||||
clearable
|
||||
@focus="deviceShow=true"
|
||||
@@ -133,17 +112,45 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-show="typeof (form.region_code) === 'string' && form.region_code !== 'HL'" label="物料编码" prop="material_code">
|
||||
<el-input
|
||||
v-model="form.material_code"
|
||||
:disabled="crud.status.edit"
|
||||
style="width: 300px"
|
||||
clearable
|
||||
@focus="materialShow=true"
|
||||
@clear="form.material_id=''; form.material_code=''; form.material_name=''"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-show="typeof (form.region_code) === 'string' && form.region_code === 'HL'" label="BOM编码" prop="material_code">
|
||||
<el-input
|
||||
v-model="form.material_code"
|
||||
:disabled="crud.status.edit"
|
||||
style="width: 300px"
|
||||
clearable
|
||||
@focus="bomShow=true"
|
||||
@clear="form.material_id=''; form.material_code=''; form.material_name=''"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计划数量/重量" prop="plan_qty">
|
||||
<el-input :disabled="crud.status.edit" v-model="form.plan_qty" type="number" style="width: 300px" />
|
||||
<el-input v-model="form.plan_qty" :disabled="crud.status.edit" type="number" style="width: 300px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-show="typeof (form.region_code) === 'string' && form.region_code === 'FJ'" label="木托盘类型" prop="vehicle_type">
|
||||
<el-select :disabled="crud.status.edit" v-model="form.vehicle_type" style="width: 300px" filterable placeholder="请选择">
|
||||
<el-select v-model="form.vehicle_type" :disabled="crud.status.edit" style="width: 300px" filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in dict.wood_vehicle_type"
|
||||
:key="item.id"
|
||||
@@ -157,16 +164,16 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否加急" prop="is_urgent">
|
||||
<el-radio :disabled="crud.status.edit" v-model="form.is_urgent" label="1">是</el-radio>
|
||||
<el-radio :disabled="crud.status.edit" v-model="form.is_urgent" label="0">否</el-radio>
|
||||
<el-radio v-model="form.is_urgent" :disabled="crud.status.edit" label="1">是</el-radio>
|
||||
<el-radio v-model="form.is_urgent" :disabled="crud.status.edit" label="0">否</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否优先包装" prop="is_pri">
|
||||
<el-radio :disabled="crud.status.edit" v-model="form.is_pri" label="1">是</el-radio>
|
||||
<el-radio :disabled="crud.status.edit" v-model="form.is_pri" label="0">否</el-radio>
|
||||
<el-radio v-model="form.is_pri" :disabled="crud.status.edit" label="1">是</el-radio>
|
||||
<el-radio v-model="form.is_pri" :disabled="crud.status.edit" label="0">否</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -238,6 +245,7 @@
|
||||
</div>
|
||||
<MaterDtl :dialog-show.sync="materialShow" :is-single="true" @setMaterValue="setMaterValue" />
|
||||
<DeviceDialog :dialog-show.sync="deviceShow" :is-single="true" @tableChanged="tableChanged" />
|
||||
<BOMDtl :dialog-show.sync="bomShow" :is-single="true" @setBOMValue="setBOMValue" />
|
||||
<ViewDialog ref="child3" />
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
@@ -251,9 +259,10 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实际数量" prop="material_id">
|
||||
<el-input-number
|
||||
style="width: 150px"
|
||||
v-model="orderData.qty"
|
||||
:min="0"/>
|
||||
style="width: 150px"
|
||||
:min="0"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -261,9 +270,10 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合格数量" prop="qualified_qty">
|
||||
<el-input-number
|
||||
style="width: 150px"
|
||||
v-model="orderData.qualified_qty"
|
||||
:min="0"/>
|
||||
style="width: 150px"
|
||||
:min="0"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -271,9 +281,10 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="不合格数量" prop="unqualified_qty">
|
||||
<el-input-number
|
||||
style="width: 150px"
|
||||
v-model="orderData.unqualified_qty"
|
||||
:min="0"/>
|
||||
style="width: 150px"
|
||||
:min="0"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -296,6 +307,7 @@ import pagination from '@crud/Pagination'
|
||||
import MaterDtl from '@/views/wms/pub/MaterDialog'
|
||||
import ViewDialog from '@/views/wms/pdm/workerorder/ViewDialog'
|
||||
import DeviceDialog from '@/views/wms/pub/DeviceDialog'
|
||||
import BOMDtl from '@/views/wms/pub/BOMDialog.vue'
|
||||
|
||||
const defaultForm = {
|
||||
workorder_id: null,
|
||||
@@ -346,7 +358,7 @@ const defaultForm = {
|
||||
}
|
||||
export default {
|
||||
name: 'Produceshiftorder',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, MaterDtl, ViewDialog, DeviceDialog },
|
||||
components: { BOMDtl, pagination, crudOperation, rrOperation, udOperation, MaterDtl, ViewDialog, DeviceDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
dicts: ['pdm_workorder_status', 'priority_direction', 'is_used', 'is_or_not', 'material_type', 'vehicle_type', 'workorder_procedure', 'true_or_false', 'wood_vehicle_type'],
|
||||
cruds() {
|
||||
@@ -371,6 +383,7 @@ export default {
|
||||
materType: '01',
|
||||
materialShow: false,
|
||||
deviceShow: false,
|
||||
bomShow: false,
|
||||
workprocedureList: [],
|
||||
order_status: ['-1'],
|
||||
permission: {},
|
||||
@@ -458,6 +471,10 @@ export default {
|
||||
this.form.device_name = row.device_name
|
||||
this.form.region_code = row.region_code
|
||||
},
|
||||
setBOMValue(row) {
|
||||
this.form.material_id = row.material_id
|
||||
this.form.material_code = row.material_code
|
||||
},
|
||||
// 下发
|
||||
submits(row) {
|
||||
crudWorkorder.submits({ workorder_id: row.workorder_id }).then(res => {
|
||||
|
||||
202
lms/nladmin-ui/src/views/wms/pub/BOMDialog.vue
Normal file
202
lms/nladmin-ui/src/views/wms/pub/BOMDialog.vue
Normal file
@@ -0,0 +1,202 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="BOM选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="90px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="BOM编码">
|
||||
<el-input
|
||||
v-model="query.name"
|
||||
clearable
|
||||
placeholder="BOM编码"
|
||||
@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="BOM编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||
<el-table-column prop="standing_time" label="静置时间" :min-width="flexWidth('standing_time',crud.data,'静置时间')" />
|
||||
<el-table-column prop="threshold_time" label="阈值时间" :min-width="flexWidth('threshold_time',crud.data,'阈值时间')" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="info" @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import crudMaterialbase from '@/api/wms/basedata/materialbase'
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudClassstandard from '@/api/wms/basedata/classstandard'
|
||||
|
||||
export default {
|
||||
name: 'BOMDtl',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: 'BOM',
|
||||
url: 'api/Materialbase',
|
||||
crudMethod: { ...crudMaterialbase },
|
||||
optShow: {},
|
||||
query: {
|
||||
material_type: '2'
|
||||
}
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
dicts: ['product_series'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isSingle: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
materOptCode: {
|
||||
type: String,
|
||||
default: '00'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
classes: [],
|
||||
tableRadio: null,
|
||||
class_idStr: null,
|
||||
checkrow: null,
|
||||
rows: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickChange(item) {
|
||||
this.tableRadio = item
|
||||
},
|
||||
open() {
|
||||
const param = {
|
||||
'materOpt_code': this.materOptCode
|
||||
}
|
||||
crudMaterialbase.getMaterOptType(param).then(res => {
|
||||
this.class_idStr = res.class_idStr
|
||||
this.crud.query.class_idStr = res.class_idStr
|
||||
this.crud.toQuery()
|
||||
this.queryClassId()
|
||||
})
|
||||
},
|
||||
queryClassId() {
|
||||
const param = {
|
||||
'class_idStr': this.class_idStr
|
||||
}
|
||||
crudClassstandard.queryClassById(param).then(res => {
|
||||
this.classes = res.content.map(obj => {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (this.isSingle) {
|
||||
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('setBOMValue', 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('setBOMValue', this.rows)
|
||||
},
|
||||
loadClass({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
|
||||
parentNode.children = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
setTimeout(() => {
|
||||
callback()
|
||||
}, 100)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -46,8 +46,6 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||
<el-table-column prop="standing_time" label="静置时间" :min-width="flexWidth('standing_time',crud.data,'静置时间')" />
|
||||
<el-table-column prop="threshold_time" label="阈值时间" :min-width="flexWidth('threshold_time',crud.data,'阈值时间')" />
|
||||
<el-table-column prop="product_code" label="产品编号" :min-width="flexWidth('product_code',crud.data,'产品编号')" />
|
||||
<el-table-column prop="a" label="长边长度" :min-width="flexWidth('a',crud.data,'长边长度')" />
|
||||
<el-table-column prop="b" label="短边长度" :min-width="flexWidth('b',crud.data,'短边长度')" />
|
||||
@@ -77,7 +75,15 @@ export default {
|
||||
name: 'MaterDtl',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '物料', url: 'api/Materialbase', crudMethod: { ...crudMaterialbase }, optShow: {}})
|
||||
return CRUD({
|
||||
title: '物料',
|
||||
url: 'api/Materialbase',
|
||||
crudMethod: { ...crudMaterialbase },
|
||||
optShow: {},
|
||||
query: {
|
||||
material_type: '1'
|
||||
}
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
dicts: ['product_series'],
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
v-model="form.region_id"
|
||||
placeholder="请选择"
|
||||
style="width: 300px"
|
||||
clearable
|
||||
filterable
|
||||
@change="getPointStatusAndTypeList(form.region_id, 2)"
|
||||
@clear="pointTypesDialogList = null"
|
||||
>
|
||||
@@ -162,6 +162,7 @@
|
||||
v-model="form.point_type"
|
||||
placeholder="点位类型"
|
||||
style="width: 300px"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in pointTypesDialogList"
|
||||
@@ -176,7 +177,7 @@
|
||||
v-model="form.point_status"
|
||||
placeholder="点位状态"
|
||||
style="width: 300px"
|
||||
clearable
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.point_status"
|
||||
@@ -191,6 +192,7 @@
|
||||
v-model="form.lock_type"
|
||||
placeholder="锁定类型"
|
||||
style="width: 300px"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.lock_type"
|
||||
@@ -205,6 +207,7 @@
|
||||
v-model="form.vehicle_type"
|
||||
placeholder="载具类型"
|
||||
style="width: 300px"
|
||||
filterable
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
|
||||
Reference in New Issue
Block a user