基础分类、分切输送线
This commit is contained in:
@@ -210,6 +210,18 @@ function CRUD(options) {
|
||||
callVmHook(crud, CRUD.HOOK.afterToAdd, crud.form)
|
||||
callVmHook(crud, CRUD.HOOK.afterToCU, crud.form)
|
||||
},
|
||||
/**
|
||||
* 启动添加 可携带参数
|
||||
*/
|
||||
toAddAndData(data) {
|
||||
crud.resetForm(JSON.parse(JSON.stringify(data)))
|
||||
if (!(callVmHook(crud, CRUD.HOOK.beforeToAdd, crud.form) && callVmHook(crud, CRUD.HOOK.beforeToCU, crud.form))) {
|
||||
return
|
||||
}
|
||||
crud.status.add = CRUD.STATUS.PREPARED
|
||||
callVmHook(crud, CRUD.HOOK.afterToAdd, crud.form)
|
||||
callVmHook(crud, CRUD.HOOK.afterToCU, crud.form)
|
||||
},
|
||||
/**
|
||||
* 启动编辑
|
||||
* @param {*} data 数据项
|
||||
|
||||
@@ -72,4 +72,11 @@ export function getClassTable(params) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getClass, getClassSuperior, getClassType, getClassTable, getType, queryClassById }
|
||||
export function getClassName() {
|
||||
return request({
|
||||
url: 'api/Classstandard/getClassName',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getClass, getClassSuperior, getClassType, getClassTable, getType, queryClassById, getClassName }
|
||||
|
||||
@@ -2,33 +2,49 @@
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<span style="line-height:36px;text-align: center">基础分类:</span>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-select
|
||||
v-model="query.base_data_type"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.base_data"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<rrOperation />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<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-select
|
||||
v-model="query.class_code"
|
||||
placeholder="请选择分类名称"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
style="width: 185px;"
|
||||
@change="hand">
|
||||
<el-option
|
||||
v-for="item in classNames"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation :crud="crud" />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="success"
|
||||
icon="el-icon-s-operation"
|
||||
@click="ToExpandall"
|
||||
>
|
||||
全部展开
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
@@ -44,21 +60,6 @@
|
||||
<el-form-item label="分类名称" prop="class_name">
|
||||
<el-input v-model="form.class_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="基础分类" prop="base_data_type">
|
||||
<el-select
|
||||
v-model="form.base_data_type"
|
||||
placeholder=""
|
||||
@change="dataTypeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.base_data"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<span style="color: #C0C0C0;margin-left: 10px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="简要描述" prop="class_desc">
|
||||
<el-input v-model="form.class_desc" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
@@ -105,17 +106,20 @@
|
||||
<el-table-column
|
||||
v-permission="['admin','Classstandard:edit','Classstandard:del']"
|
||||
label="操作"
|
||||
width="150px"
|
||||
width="250px"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
style="display: inline"
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:disabled-edit="scope.row.is_modify === '0'"
|
||||
:disabled-dle="scope.row.is_modify === '0'"
|
||||
msg="确定删除吗,如果存在下级节点则一并删除,此操作不能撤销!"
|
||||
/>
|
||||
<el-button slot="right" size="mini" type="text" icon="el-icon-circle-plus-outline" @click="crud.toAddAndData(addSibling(scope.row))">新增同级</el-button>
|
||||
<el-button slot="right" size="mini" type="text" icon="el-icon-circle-plus" @click="crud.toAddAndData(addChildren(scope.row))">新增子级</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -135,7 +139,7 @@ import udOperation from '@crud/UD.operation'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = {
|
||||
let defaultForm = {
|
||||
class_id: null,
|
||||
base_data_type: null,
|
||||
path_code: null,
|
||||
@@ -180,14 +184,12 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
classes: [],
|
||||
classNames: [],
|
||||
permission: {},
|
||||
rules: {
|
||||
class_id: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
base_data_type: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
path_code: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
@@ -218,7 +220,15 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getClassNames() // 获取分类
|
||||
},
|
||||
methods: {
|
||||
getClassNames() {
|
||||
crudClassstandard.getClassName().then((res) => { // 获取分类名称,查询根据分类编码查找对应分支树
|
||||
this.classNames = res
|
||||
})
|
||||
},
|
||||
getClassDatas(tree, treeNode, resolve) {
|
||||
const params = { pid: tree.id }
|
||||
setTimeout(() => {
|
||||
@@ -318,6 +328,72 @@ export default {
|
||||
}, 100)
|
||||
})
|
||||
}
|
||||
},
|
||||
clearFrom() {
|
||||
defaultForm = {
|
||||
id: null,
|
||||
class_id: null,
|
||||
base_data_type: null,
|
||||
path_code: null,
|
||||
class_code: null,
|
||||
long_class_code: null,
|
||||
class_name: null,
|
||||
class_desc: null,
|
||||
parent_class_id: null,
|
||||
is_leaf: null,
|
||||
sub_count: null,
|
||||
is_modify: null,
|
||||
is_delete: null,
|
||||
class_level: null,
|
||||
ext_id: null,
|
||||
ext_parent_id: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
isTop: null
|
||||
}
|
||||
},
|
||||
addSibling(row) {
|
||||
this.clearFrom() // 将默认的表单数据清除
|
||||
defaultForm.id = row.id // 获取分类树的id - 懒加载依赖此id,不可为空
|
||||
defaultForm.class_id = row.class_id
|
||||
defaultForm.parent_class_id = row.parent_class_id // 同级为父类class_id
|
||||
defaultForm.isTop = row.isTop
|
||||
return defaultForm
|
||||
},
|
||||
addChildren(row) {
|
||||
this.clearFrom()
|
||||
defaultForm.id = row.id // 获取分类树的id
|
||||
defaultForm.class_id = row.parent_class_id
|
||||
defaultForm.parent_class_id = row.id // 子级为本身的class_id
|
||||
defaultForm.isTop = row.isTop
|
||||
return defaultForm
|
||||
},
|
||||
// 全部展开 参考:https://www.cnblogs.com/toughy/p/12667805.html
|
||||
ToExpandall() {
|
||||
const els = document.getElementsByClassName('el-table__expand-icon')
|
||||
if (this.crud.data.length !== 0 && els.length !== 0) {
|
||||
for (let j1 = 0; j1 < els.length; j1++) {
|
||||
els[j1].classList.add('dafult')
|
||||
}
|
||||
if (this.$el.getElementsByClassName('el-table__expand-icon--expanded')) {
|
||||
const open = this.$el.getElementsByClassName('el-table__expand-icon--expanded')
|
||||
for (let j = 0; j < open.length; j++) {
|
||||
open[j].classList.remove('dafult')
|
||||
}
|
||||
const dafult = this.$el.getElementsByClassName('dafult')
|
||||
for (let a = 0; a < dafult.length; a++) {
|
||||
debugger
|
||||
dafult[a].click()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,19 +92,6 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="基础分类" prop="class_id">
|
||||
<treeselect
|
||||
v-model="form.class_id"
|
||||
:load-options="loadClass"
|
||||
:options="classes"
|
||||
style="width: 200px;"
|
||||
placeholder="请选择"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" style="width: 600px;" type="textarea" />
|
||||
</el-form-item>
|
||||
|
||||
@@ -228,7 +228,11 @@
|
||||
<el-table-column prop="ivt_qty" label="库存数" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="qty_unit_name" label="计量单位" />
|
||||
<el-table-column prop="instorage_time" label="入库时间" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="product_area" label="生产区域" />
|
||||
<el-table-column prop="product_area" label="生产区域" >
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.product_area[scope.row.product_area] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="point_location" label="位置" >
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.point_location[scope.row.point_location] }}
|
||||
|
||||
@@ -2,25 +2,137 @@
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="90px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="点位编码">
|
||||
<el-input
|
||||
v-model="query.point_code"
|
||||
clearable
|
||||
placeholder="输入点位编码"
|
||||
style="width: 185px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产区域">
|
||||
<el-select
|
||||
v-model="query.product_area"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
style="width: 185px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_area"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="点位状态">
|
||||
<el-select
|
||||
v-model="query.point_status"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
style="width: 185px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.delivery_point_status"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用">
|
||||
<el-switch
|
||||
@change="hand"
|
||||
v-model="query.is_used"
|
||||
active-value="0"
|
||||
inactive-value="1"
|
||||
active-color="#C0CCDA"
|
||||
inactive-color="#409EFF"/>
|
||||
</el-form-item>
|
||||
<rrOperation :crud="crud" />
|
||||
</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="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="点位编码" prop="point_code">
|
||||
<el-input v-model="form.point_code" style="width: 370px;" />
|
||||
<el-input v-model="form.point_code" style="width: 370px;" :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产区域">
|
||||
<el-input v-model="form.product_area" style="width: 370px;" />
|
||||
<el-select
|
||||
v-model="form.product_area"
|
||||
size="mini"
|
||||
placeholder="生产区域"
|
||||
class="filter-item"
|
||||
style="width: 370px;"
|
||||
:disabled="true"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_area"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具码">
|
||||
<el-input v-model="form.vehicle_code" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="气涨轴">
|
||||
<el-input v-model="form.qzzno" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="点位状态">
|
||||
<el-select
|
||||
v-model="form.point_status"
|
||||
size="mini"
|
||||
placeholder="点位状态"
|
||||
class="filter-item"
|
||||
style="width: 370px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.delivery_point_status"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="位置">
|
||||
<el-input v-model="form.point_location" style="width: 370px;" />
|
||||
<el-select
|
||||
v-model="form.point_location"
|
||||
size="mini"
|
||||
placeholder="位置"
|
||||
class="filter-item"
|
||||
style="width: 370px;"
|
||||
:disabled="true"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.point_location"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="顺序号" prop="sort_seq">
|
||||
<el-input v-model="form.sort_seq" style="width: 370px;" />
|
||||
<el-form-item label="顺序号" prop="sort_seq" >
|
||||
<el-input v-model="form.sort_seq" style="width: 370px;" :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用" prop="is_used">
|
||||
<el-input v-model="form.is_used" style="width: 370px;" />
|
||||
<el-switch v-model="form.is_used" active-value="1" inactive-value="0"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" style="width: 370px;" />
|
||||
@@ -35,16 +147,36 @@
|
||||
<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 prop="point_code" label="点位编码" />
|
||||
<el-table-column prop="product_area" label="生产区域" />
|
||||
<el-table-column prop="point_location" label="位置" />
|
||||
<el-table-column prop="is_used" label="是否启用" />
|
||||
<el-table-column prop="vehicle_code" label="载具码" />
|
||||
<el-table-column prop="qzzno" label="气涨轴" />
|
||||
<el-table-column prop="point_status" label="点位状态" >
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.delivery_point_status[scope.row.point_status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="product_area" label="生产区域" >
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.product_area[scope.row.product_area] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="point_location" label="位置" >
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.point_location[scope.row.point_location] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="is_used" label="是否启用" >
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.is_used[scope.row.is_used] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="update_time" label="修改时间" />
|
||||
<el-table-column prop="update_time" label="修改时间" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:is-visiable-del="false"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -63,13 +195,27 @@ import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = { ivt_id: null, point_code: null, product_area: null, point_location: null, sort_seq: null, is_used: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null }
|
||||
const defaultForm = { ivt_id: null, point_code: null, product_area: null, qzzno: null, vehicle_code: null, point_status: null, point_location: null, sort_seq: null, is_used: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null }
|
||||
export default {
|
||||
name: 'DeliveryPointIvt',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
dicts: ['delivery_point_status', 'product_area', 'is_used', 'point_location'],
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '分切输送线', url: 'api/deliverypointivt', idField: 'ivt_id', sort: 'ivt_id,desc', crudMethod: { ...crudDeliverypointivt }})
|
||||
return CRUD({
|
||||
title: '分切输送线',
|
||||
url: 'api/deliverypointivt',
|
||||
idField: 'ivt_id',
|
||||
sort: 'ivt_id,desc',
|
||||
crudMethod: { ...crudDeliverypointivt },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: true,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -79,9 +225,6 @@ export default {
|
||||
point_code: [
|
||||
{ required: true, message: '点位编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
sort_seq: [
|
||||
{ required: true, message: '顺序号不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_used: [
|
||||
{ required: true, message: '是否启用不能为空', trigger: 'blur' }
|
||||
]
|
||||
@@ -91,6 +234,9 @@ export default {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user