初版
This commit is contained in:
@@ -2,39 +2,26 @@
|
||||
<div v-loading.fullscreen.lock="fullscreenLoading" class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-row>
|
||||
<el-col :span="7">
|
||||
<span style="line-height:36px;text-align: center">物料类别:</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<treeselect
|
||||
v-model="query.material_type_id"
|
||||
:load-options="loadChildNodes"
|
||||
:options="classes1"
|
||||
style="width: 200px;"
|
||||
placeholder="请选择"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
模糊查询:
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
size="mini"
|
||||
placeholder="输入物料编码或名称"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="90px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="编码名称">
|
||||
<el-input
|
||||
v-model="query.name"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="编码名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
@@ -54,80 +41,75 @@
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="1200px"
|
||||
width="600px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="160px" label-suffix=":">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<el-input v-model="form.material_code" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料名称" prop="material_name">
|
||||
<el-input v-model="form.material_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
||||
<el-form-item label="规格" prop="material_spec">
|
||||
<label slot="label">规 格</label>
|
||||
<el-input v-model="form.material_spec" style="width: 200px;" />
|
||||
<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="8">
|
||||
<el-form-item label="型号" prop="material_model">
|
||||
<label slot="label">型 号</label>
|
||||
<el-input v-model="form.material_model" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="外部标识" prop="ext_id">
|
||||
<el-input v-model="form.ext_id" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料分类" prop="material_type_id">
|
||||
<treeselect
|
||||
v-model="form.material_type_id"
|
||||
:load-options="loadChildNodes"
|
||||
:options="classes2"
|
||||
style="width: 200px;"
|
||||
placeholder="请选择"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产品系列">
|
||||
<treeselect
|
||||
v-model="form.product_series"
|
||||
:options="classes3"
|
||||
:auto-load-root-options="false"
|
||||
:load-options="loadChildNodes"
|
||||
style="width: 200px;"
|
||||
placeholder="请选择"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="静置时间" prop="standing_time">
|
||||
<el-input-number v-model="form.standing_time" :controls="false" :min="0" label="分钟" style="width: 200px;" />
|
||||
<el-input v-model="form.standing_time" type="number" style="width: 300px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否启用" prop="is_used">
|
||||
<el-radio v-model="form.is_used" label="0">否</el-radio>
|
||||
<el-radio v-model="form.is_used" label="1">是</el-radio>
|
||||
</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">
|
||||
<el-input v-model="form.weight" type="number" style="width: 300px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品编号" prop="product_code">
|
||||
<el-input v-model="form.product_code" type="number" style="width: 300px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="长边长度" prop="a">
|
||||
<el-input v-model="form.a" type="number" style="width: 300px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="短边长度" prop="b">
|
||||
<el-input v-model="form.b" type="number" style="width: 300px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="梯形高度" prop="h">
|
||||
<el-input v-model="form.h" type="number" style="width: 300px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="砖块厚度" prop="w">
|
||||
<el-input v-model="form.w" type="number" style="width: 300px" />
|
||||
</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 type="info" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@@ -140,32 +122,21 @@
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column prop="material_code" label="物料编码" width="160" />
|
||||
<el-table-column prop="material_name" label="物料名称" width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="material_spec" label="物料规格" width="140" />
|
||||
<el-table-column prop="material_model" label="物料型号" />
|
||||
<el-table-column prop="class_name" label="物料分类" width="140" />
|
||||
<el-table-column prop="unit_name" label="计量单位" />
|
||||
<el-table-column prop="standing_time" label="静置时间(分钟)" width="130px" />
|
||||
<el-table-column prop="product_series_name" label="系列" />
|
||||
<el-table-column label="启用" align="center" prop="is_used">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.is_used"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
@change="changeEnabled(scope.row, scope.row.is_used)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="update_optname" label="修改人" />
|
||||
<el-table-column prop="material_code" label="物料编码" width="260" show-overflow-tooltip />
|
||||
<el-table-column prop="standing_time" label="困料时间" width="75" />
|
||||
<el-table-column prop="threshold_time" label="超时时间" width="75" />
|
||||
<el-table-column prop="weight" label="单重" width="75" />
|
||||
<el-table-column prop="product_code" label="产品编号" width="75" />
|
||||
<el-table-column prop="a" label="长边长度" width="75" />
|
||||
<el-table-column prop="b" label="短边长度" width="75" />
|
||||
<el-table-column prop="h" label="梯形高度" width="75" />
|
||||
<el-table-column prop="w" label="砖块厚度" width="75" />
|
||||
<el-table-column prop="update_optname" label="修改人" width="75" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="135" />
|
||||
<el-table-column
|
||||
v-permission="['admin','Materialbase:edit','Materialbase:del']"
|
||||
fixed="right"
|
||||
v-permission="[]"
|
||||
label="操作"
|
||||
fixed="right"
|
||||
width="120px"
|
||||
align="center"
|
||||
>
|
||||
@@ -190,7 +161,7 @@ import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
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'
|
||||
@@ -200,40 +171,26 @@ const defaultForm = {
|
||||
ass_unit_id: null,
|
||||
material_code: null,
|
||||
material_name: null,
|
||||
material_spec: null,
|
||||
material_model: null,
|
||||
english_name: null,
|
||||
base_unit_id: null,
|
||||
approve_fileno: null,
|
||||
print_no: null,
|
||||
material_type_id: null,
|
||||
len_unit_id: null,
|
||||
length: null,
|
||||
width: null,
|
||||
height: null,
|
||||
weight_unit_id: null,
|
||||
gross_weight: null,
|
||||
net_weight: null,
|
||||
cubage_unit_id: null,
|
||||
cubage: 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,
|
||||
is_used_time: null,
|
||||
is_used: null,
|
||||
is_delete: null,
|
||||
ext_id: null,
|
||||
material_height_type: null,
|
||||
product_series: null
|
||||
weight: null
|
||||
}
|
||||
export default {
|
||||
name: 'Materialbase',
|
||||
// 数据字典
|
||||
dicts: ['is_used'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, Treeselect },
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -255,73 +212,19 @@ export default {
|
||||
productSeries: [],
|
||||
permission: {},
|
||||
rules: {
|
||||
material_id: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
material_code: [
|
||||
{ required: true, message: '物料编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
material_name: [
|
||||
{ required: true, message: '物料名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
material_type_id: [
|
||||
{ required: true, message: '物料分类不能为空', trigger: 'blur' }
|
||||
],
|
||||
create_id: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
create_time: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_used: [
|
||||
{ required: true, message: '是否启用不能为空', trigger: 'blur' }
|
||||
],
|
||||
material_height_type: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initClass1()
|
||||
this.initClass2()
|
||||
this.initClass3()
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
initClass1() {
|
||||
const param = {
|
||||
parent_class_code: '09'
|
||||
}
|
||||
crudClassstandard.getClassType(param).then(res => {
|
||||
const data = res.content
|
||||
this.buildTree(data)
|
||||
this.classes1 = data
|
||||
})
|
||||
},
|
||||
initClass2() {
|
||||
const param = {
|
||||
parent_class_code: '09'
|
||||
}
|
||||
crudClassstandard.getClassType(param).then(res => {
|
||||
const data = res.content
|
||||
this.buildTree(data)
|
||||
this.classes2 = data
|
||||
})
|
||||
},
|
||||
initClass3() {
|
||||
const param = {
|
||||
parent_class_code: '07'
|
||||
}
|
||||
crudClassstandard.getClassType(param).then(res => {
|
||||
const data = res.content
|
||||
this.buildTree(data)
|
||||
this.classes3 = data
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.beforeToCU](crud, form) {
|
||||
crudMdPbMeasureunit.getUnit().then(res => {
|
||||
this.measure_unit = res.content
|
||||
@@ -344,10 +247,10 @@ export default {
|
||||
crudClassstandard.getClassSuperior(id).then(res => {
|
||||
const data = res.content
|
||||
that.buildTree(data)
|
||||
if (type == '02') {
|
||||
if (type === '02') {
|
||||
that.classes2 = data
|
||||
}
|
||||
if (type == '03') {
|
||||
if (type === '03') {
|
||||
that.classes3 = data
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user