update 数据字典 & add 料仓、设备类型
This commit is contained in:
107
src/views/modules/pms/equipmentType/config.js
Normal file
107
src/views/modules/pms/equipmentType/config.js
Normal file
@@ -0,0 +1,107 @@
|
||||
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
|
||||
import StatusComponent from "@/components/noTemplateComponents/statusComponent";
|
||||
import request from "@/utils/request";
|
||||
import { dictFind, timeFilter } from '@/utils/filters'
|
||||
|
||||
export default function () {
|
||||
const tableProps = [
|
||||
{ prop: "createTime", label: "添加时间", filter: timeFilter },
|
||||
{ prop: "name", label: "类型名称" },
|
||||
{ prop: "code", label: "类型编码" },
|
||||
{ prop: "description", label: "描述" },
|
||||
{ prop: "remark", label: "备注" },
|
||||
{
|
||||
prop: "operations",
|
||||
name: "操作",
|
||||
fixed: "right",
|
||||
width: 120,
|
||||
subcomponent: TableOperaionComponent,
|
||||
options: ["edit", { name: "delete", permission: "pms:equipmentType:delete" }],
|
||||
},
|
||||
];
|
||||
|
||||
const headFormFields = [
|
||||
{
|
||||
prop: 'key',
|
||||
label: "类型名称",
|
||||
input: true,
|
||||
default: { value: "" },
|
||||
bind: {
|
||||
// placeholder: '请输入产线名称或编码'
|
||||
placeholder: '请输入类型名称'
|
||||
}
|
||||
},
|
||||
{
|
||||
button: {
|
||||
type: "primary",
|
||||
name: "查询",
|
||||
},
|
||||
},
|
||||
{
|
||||
button: {
|
||||
type: "primary",
|
||||
name: "新增",
|
||||
permission: "pms:equipmentType:save"
|
||||
},
|
||||
bind: {
|
||||
plain: true,
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* dialog config 有两个版本,一个适用于 DialogWithMenu 组件,另一个适用于 DialogJustForm 组件
|
||||
* 适用于 DialogWithMenu 组件的配置示例详见 blenderStep/config.js
|
||||
* 此为后者的配置:
|
||||
*/
|
||||
const dialogJustFormConfigs = {
|
||||
form: {
|
||||
rows: [
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: "类型名称",
|
||||
prop: "name",
|
||||
rules: { required: true, message: "not empty", trigger: "blur" },
|
||||
elparams: { placeholder: "请输入类型名称" },
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: "类型编码",
|
||||
prop: "code",
|
||||
rules: { required: true, message: "not empty", trigger: "blur" },
|
||||
elparams: { placeholder: "请输入类型编码" },
|
||||
},
|
||||
],
|
||||
[{ textarea: true, label: "描述信息", prop: "description", elparams: { placeholder: "描述信息" } }],
|
||||
[{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
|
||||
],
|
||||
operations: [
|
||||
{ name: "add", label: "保存", type: "primary", permission: "pms:equipmentType:save", showOnEdit: false },
|
||||
{ name: "update", label: "更新", type: "primary", permission: "pms:equipmentType:update", showOnEdit: true },
|
||||
{ name: "reset", label: "重置", type: "warning", showAlways: true },
|
||||
// { name: 'cancel', label: '取消', showAlways: true },
|
||||
],
|
||||
},
|
||||
};
|
||||
// 备注:弹窗弹出的时间和网速有关......
|
||||
|
||||
return {
|
||||
dialogConfigs: dialogJustFormConfigs,
|
||||
tableConfig: {
|
||||
table: null, // 此处可省略,el-table 上的配置项
|
||||
column: tableProps, // el-column-item 上的配置项
|
||||
},
|
||||
headFormConfigs: {
|
||||
rules: null, // 名称是由 BaseSearchForm.vue 组件固定的
|
||||
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
|
||||
},
|
||||
urls: {
|
||||
base: "/pms/equipmentType",
|
||||
page: "/pms/equipmentType/page",
|
||||
// subase: '/pms/blenderStepParam',
|
||||
// subpage: '/pms/blenderStepParam/page',
|
||||
// more...
|
||||
},
|
||||
};
|
||||
}
|
||||
32
src/views/modules/pms/equipmentType/index.vue
Normal file
32
src/views/modules/pms/equipmentType/index.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<ListViewWithHead :table-config="tableConfig" :head-config="headFormConfigs" :dialog-configs="dialogConfigs" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import initConfig from './config';
|
||||
import ListViewWithHead from '@/views/atomViews/ListViewWithHead.vue';
|
||||
|
||||
export default {
|
||||
name: 'ProductionLineView',
|
||||
components: { ListViewWithHead },
|
||||
provide() {
|
||||
return {
|
||||
urls: this.allUrls
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
|
||||
return {
|
||||
tableConfig,
|
||||
headFormConfigs,
|
||||
allUrls: urls,
|
||||
dialogConfigs,
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
118
src/views/modules/pms/materialStorage/config.js
Normal file
118
src/views/modules/pms/materialStorage/config.js
Normal file
@@ -0,0 +1,118 @@
|
||||
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
|
||||
import StatusComponent from "@/components/noTemplateComponents/statusComponent";
|
||||
import request from "@/utils/request";
|
||||
import { dictFind } from '@/utils/filters'
|
||||
|
||||
export default function () {
|
||||
const tableProps = [
|
||||
{ prop: "name", label: "料仓名称" },
|
||||
{ prop: "code", label: "料仓编码" },
|
||||
{ prop: "typeDictValue", label: "料仓类型", filter: dictFind('料仓') },
|
||||
{ prop: "status", label: "产线状态", subcomponent: StatusComponent }, // subcomponent
|
||||
{ prop: "description", label: "描述" },
|
||||
{ prop: "remark", label: "备注" },
|
||||
{
|
||||
prop: "operations",
|
||||
name: "操作",
|
||||
fixed: "right",
|
||||
width: 120,
|
||||
subcomponent: TableOperaionComponent,
|
||||
options: ["edit", { name: "delete", permission: "pms:materialStorage:delete" }],
|
||||
},
|
||||
];
|
||||
|
||||
const headFormFields = [
|
||||
{
|
||||
prop: 'name',
|
||||
label: "料仓名称",
|
||||
input: true,
|
||||
default: { value: "" },
|
||||
bind: {
|
||||
// placeholder: '请输入产线名称或编码'
|
||||
placeholder: '请输入料仓名称'
|
||||
}
|
||||
},
|
||||
{
|
||||
button: {
|
||||
type: "primary",
|
||||
name: "查询",
|
||||
},
|
||||
},
|
||||
{
|
||||
button: {
|
||||
type: "primary",
|
||||
name: "新增",
|
||||
permission: "pms:materialStorage:save"
|
||||
},
|
||||
bind: {
|
||||
plain: true,
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* dialog config 有两个版本,一个适用于 DialogWithMenu 组件,另一个适用于 DialogJustForm 组件
|
||||
* 适用于 DialogWithMenu 组件的配置示例详见 blenderStep/config.js
|
||||
* 此为后者的配置:
|
||||
*/
|
||||
const dialogJustFormConfigs = {
|
||||
form: {
|
||||
rows: [
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: "料仓名称",
|
||||
prop: "name",
|
||||
rules: { required: true, message: "not empty", trigger: "blur" },
|
||||
elparams: { placeholder: "请输入料仓名称" },
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: "料仓编码",
|
||||
prop: "code",
|
||||
rules: { required: true, message: "not empty", trigger: "blur" },
|
||||
elparams: { placeholder: "请输入料仓编码" },
|
||||
}, {
|
||||
select: true,
|
||||
label: "料仓类型",
|
||||
prop: "typeDictValue",
|
||||
// fetchData: () => this.$http.get("/pms/factory/page", { params: { limit: 999, page: 1 } }),
|
||||
options: [
|
||||
{ label: '中间仓', value: 0 },
|
||||
{ label: '日料仓', value: 1 },
|
||||
],
|
||||
rules: { required: true, message: "not empty", trigger: "change" },
|
||||
},
|
||||
],
|
||||
[{ textarea: true, label: "描述信息", prop: "description", elparams: { placeholder: "描述信息" } }],
|
||||
[{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
|
||||
],
|
||||
operations: [
|
||||
{ name: "add", label: "保存", type: "primary", permission: "pms:materialStorage:save", showOnEdit: false },
|
||||
{ name: "update", label: "更新", type: "primary", permission: "pms:materialStorage:update", showOnEdit: true },
|
||||
{ name: "reset", label: "重置", type: "warning", showAlways: true },
|
||||
// { name: 'cancel', label: '取消', showAlways: true },
|
||||
],
|
||||
},
|
||||
};
|
||||
// 备注:弹窗弹出的时间和网速有关......
|
||||
|
||||
return {
|
||||
dialogConfigs: dialogJustFormConfigs,
|
||||
tableConfig: {
|
||||
table: null, // 此处可省略,el-table 上的配置项
|
||||
column: tableProps, // el-column-item 上的配置项
|
||||
},
|
||||
headFormConfigs: {
|
||||
rules: null, // 名称是由 BaseSearchForm.vue 组件固定的
|
||||
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
|
||||
},
|
||||
urls: {
|
||||
base: "/pms/materialStorage",
|
||||
page: "/pms/materialStorage/page",
|
||||
// subase: '/pms/blenderStepParam',
|
||||
// subpage: '/pms/blenderStepParam/page',
|
||||
// more...
|
||||
},
|
||||
};
|
||||
}
|
||||
32
src/views/modules/pms/materialStorage/index.vue
Normal file
32
src/views/modules/pms/materialStorage/index.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<ListViewWithHead :table-config="tableConfig" :head-config="headFormConfigs" :dialog-configs="dialogConfigs" :listQueryExtra="['name']" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import initConfig from './config';
|
||||
import ListViewWithHead from '@/views/atomViews/ListViewWithHead.vue';
|
||||
|
||||
export default {
|
||||
name: 'ProductionLineView',
|
||||
components: { ListViewWithHead },
|
||||
provide() {
|
||||
return {
|
||||
urls: this.allUrls
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
|
||||
return {
|
||||
tableConfig,
|
||||
headFormConfigs,
|
||||
allUrls: urls,
|
||||
dialogConfigs,
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
Reference in New Issue
Block a user