update 2023.4.6

This commit is contained in:
lb
2023-04-06 09:52:41 +08:00
parent aa91d41412
commit 247cca284e
6 changed files with 229 additions and 41 deletions

View File

@@ -0,0 +1,127 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
import { timeFilter } from "@/utils/filters";
export default function () {
const tableProps = [
{ prop: "name", label: "名称" },
{ prop: "code", label: "编码" },
// { prop: "enName", label: "英文名称" },
// { prop: "enAb", label: "缩写" },
{ prop: "description", label: "描述" },
{ prop: "remark", label: "备注" },
{ type: "index", label: "序号" },
{ prop: "createTime", label: "添加时间", filter: timeFilter },
{
prop: "operations",
name: "操作",
fixed: "right",
width: 90,
subcomponent: TableOperaionComponent,
options: [{ name: "edit", label: "编辑", icon: "edit-outline" }, { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:materialType:delete" }],
},
];
const headFormFields = [
{
prop: 'key',
label: '原料名称/编码',
input: true,
default: { value: '' },
bind: { // v-bind keyValues
placeholder: '请输入原料名称或编码'
}
},
{
button: {
type: "primary",
name: "查询",
},
},
{
button: {
type: "primary",
name: "新增",
permission: "pms:materialType:save",
},
bind: {
plain: true,
},
},
];
const dialogJustFormConfigs = {
form: {
rows: [
[
{
input: true,
label: "名称",
prop: "name",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入物料类型名称" },
},
{
input: true,
label: "编码",
prop: "code",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入物料类型编码" },
},
],
// [
// { input: true, label: "英文名称", prop: "enName", elparams: { placeholder: "请输入英文名称" } },
// { input: true, label: "英文缩写", prop: "enAb", elparams: { placeholder: "请输入英文缩写" } },
// ],
[
// [{ switch: true, label: '状态', prop: 'enabled', default: 0 }],
{ textarea: true, label: "描述", prop: "description", elparams: { placeholder: "描述" } },
],
[
// {
// select: true,
// label: '产线',
// prop: 'prdLineId',
// options: [
// // { label: '1', value: 1 },
// // { label: '2', value: 2 },
// // { label: '3', value: 3 },
// ],
// elparams: { placeholder: '请选择所属产线' },
// // fetchData api
// fetchData: () => {
// return this.$http('/pms/productionLine/page', { limit: 999, page: 1, key: '' })
// }
// },
{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } },
// { input: true, label: '程序号', prop: '', rules: { required: true, message: '必填项不能为空', trigger: 'blur' }, elparams: { placeholder: '请输入混料程序号' } },
],
],
operations: [
{ name: "add", label: "保存", type: "primary", permission: "pms:materialType:save", showOnEdit: false },
{ name: "update", label: "更新", type: "primary", permission: "pms:materialType: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/baseMaterial",
page: "/pms/baseMaterial/page",
// subase: '/pms/blenderStepParam',
// subpage: '/pms/blenderStepParam/page',
// more...
},
};
}

View 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: 'MaterialTypeView',
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>