This commit is contained in:
lb 2023-02-17 14:02:03 +08:00
parent c2657b190e
commit efb9d3f46e
23 changed files with 442 additions and 413 deletions

View File

@ -38,8 +38,8 @@
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
<script>
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.103:8080/pms-am';
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.49:8080/pms-am'; // tengyun
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.62:8080/pms-am'; // tao
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.49:8080/pms-am'; // tengyun
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.62:8080/pms-am'; // tao
</script>
<% } %>
<!-- 集成测试环境 -->

View File

@ -52,7 +52,7 @@
:key="'upload_' + rowIndex + colIndex"
:action="col.actionUrl"
:file-list="dataForm['files']"
:disabled="detailMode || !dataForm.id"
:disabled="detailMode"
v-bind="col.elparams"
@update-file-list="handleFilelistUpdate"
/>
@ -211,7 +211,14 @@ export default {
typeCode: file.typeCode,
}));
//
this.addOrUpdate("PUT");
if ("id" in this.dataForm && this.dataForm.id !== null && this.dataForm.id !== undefined) this.addOrUpdate("PUT");
else
this.$notify({
title: "等待保存",
message: "已添加文件,请手动点击保存!",
type: "warning",
duration: 2500,
});
},
/** utitilities */
@ -322,11 +329,17 @@ export default {
})
.then(({ data: res }) => {
console.log("[add&update] res is: ", res);
this.loadingStatus = false;
if (res.code === 0) {
this.$message.success(method === "POST" ? "添加成功" : "更新成功");
this.$emit("refreshDataList");
this.loadingStatus = false;
if (method === "POST") this.handleClose();
} else {
this.$message({
message: `${res.code}: ${res.msg}`,
type: "error",
duration: 2000,
});
}
})
.catch((errMsg) => {
@ -352,7 +365,7 @@ export default {
break;
case "add":
case "update":
this.addOrUpdate((payload.name === "add" ? "POST" : "PUT"));
this.addOrUpdate(payload.name === "add" ? "POST" : "PUT");
break;
}
} else {

View File

@ -653,10 +653,19 @@ export default {
})
.then(({ data: res }) => {
console.log("[add&update] res is: ", res);
this.$message.success(payload.name === "add" ? "添加成功" : "更新成功");
this.$emit("refreshDataList");
this.loadingStatus = false;
this.handleClose();
if (res.code === 0) {
this.$message.success(payload.name === "add" ? "添加成功" : "更新成功");
this.$emit("refreshDataList");
this.loadingStatus = false;
this.handleClose();
} else {
this.$message({
message: `${res.code}: ${res.msg}`,
type: "error",
duration: 2000,
});
this.loadingStatus = false;
}
})
.catch((errMsg) => {
this.$message.error("参数错误:" + errMsg);

View File

@ -66,10 +66,8 @@ export default {
const optIsObj = typeof opt === 'object'
if (optIsObj) {
// 可能需要验证权限,如 opt.permission 选项
// 注意为空字符串或null/undefined都会不验证权限
if (!opt.permission || (opt.permission && this.$hasPermission(opt.permission))) {
// console.log('[operation component]: ', opt.permission, this.$hasPermission(opt.permission))
btns.push(
h('el-button',
{

View File

@ -71,7 +71,9 @@ export default {
},
computed: {
filteredList() {
return this.fileList.filter((item) => item.name.startsWith(this.searchCondition));
// return this.fileList.filter((item) => item.name.startsWith(this.searchCondition));
//
return this.fileList.filter((item) => item.name.indexOf(this.searchCondition) !== -1);
},
},
methods: {

View File

@ -12,6 +12,7 @@
@operate-event="handleOperate"
:current-page="page"
:current-size="size"
:refresh-layout-key="refreshLayoutKey"
/>
<el-pagination
@ -85,6 +86,10 @@ export default {
return this.dialogConfigs.menu ? DIALOG_WITH_MENU : DIALOG_JUST_FORM;
},
},
activated() {
console.log("list view with ehad activated..........");
this.refreshLayoutKey = this.layoutTable();
},
data() {
return {
DIALOG_WITH_MENU,
@ -96,6 +101,7 @@ export default {
size: 20, // 20
dataList: [],
tableLoading: false,
refreshLayoutKey: null
};
},
inject: ["urls"],
@ -103,19 +109,6 @@ export default {
this.initDataWhenLoad && this.getList();
},
methods: {
/**
* 转换服务器数据的中间层
* 为了抹平真实服务器数据和我本地的测试服务器数据的差异
**/
prehandle_data(list) {
/** 根据具体情况修改 */
list.forEach((data) => {
data.id = data._id;
delete data._id;
});
return list;
},
/** 获取 列表数据 */
getList(queryParams) {
this.tableLoading = true;
@ -144,25 +137,18 @@ export default {
if ("list" in res.data) {
// real env:
this.dataList = res.data.list.map((item) => {
// if (item.parentId || item.parendName) { /** && */
// //
// return this.reConstructDataList(res.data.list)
// } else {
return {
...item,
id: item._id ?? item.id,
};
// }
});
// this.dataList = res.data.records;
this.totalPage = res.data.total;
} else if ("records" in res.data) {
// dev env:
this.dataList = res.data.records.map((item) => ({
...item,
id: item._id ?? item.id,
}));
// this.dataList = res.data.records;
this.totalPage = res.data.total;
} else {
this.dataList.splice(0);
@ -172,15 +158,8 @@ export default {
});
},
/** 针对树形结构的列表,进行服务器端返回的数据重排 */
reConstructDataList(list) {
// const parentIndex = list.forEach()
},
/** 处理 HeadForm 的操作 */
handleHeadformOperate(payload) {
//
console.log("headform operate: ", payload);
layoutTable() {
return Math.random();
},
/** 处理 表格操作 */
@ -191,7 +170,7 @@ export default {
switch (type) {
case "delete": {
//
return this.$confirm(`是否删除条目: ${data}`, "提示", {
return this.$confirm(`确定要删除 "${data.name}" 吗?`, "提示", {
confirmButtonText: "确认",
cancelButtonText: "我再想想",
type: "warning",
@ -201,7 +180,7 @@ export default {
this.$http({
url: this.urls.base,
method: "DELETE",
data: [`${data}`],
data: [`${data.id}`],
}).then(({ data: res }) => {
if (res.code === 0) {
this.$message.success("删除成功!");

View File

@ -53,8 +53,8 @@ export default function () {
url: '/pms/blenderStep',
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: '请输入混料程序编码' } },
{ 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: 'version', elparams: { placeholder: '请输入版本号' } },
],
[
@ -69,7 +69,7 @@ export default function () {
// ],
// elparams: { placeholder: '请选择城市' }
// },
// { input: true, label: '程序号', prop: '', rules: { required: true, message: 'not empty', trigger: 'blur' }, elparams: { placeholder: '请输入混料程序号' } },
// { input: true, label: '程序号', prop: '', rules: { required: true, message: '必填项不能为空', trigger: 'blur' }, elparams: { placeholder: '请输入混料程序号' } },
],
// [{ switch: true, label: '状态', prop: 'enabled', default: 0 }],
[{ textarea: true, label: '备注', prop: 'remark', elparams: { placeholder: '备注' } }],
@ -114,11 +114,11 @@ export default function () {
extraParam: 'stepId',
rows: [
[
{ input: true, label: '步骤', prop: 'sort', rules: { required: true, message: 'not empty', trigger: 'blur' }, elparams: { placeholder: '请输入步骤' } },
{ input: true, label: '步骤描述', prop: 'description', rules: { required: true, message: 'not empty', trigger: 'blur' }, elparams: { placeholder: '请输入描述' } },
{ input: true, label: '步骤', prop: 'sort', rules: { required: true, message: '必填项不能为空', trigger: 'blur' }, elparams: { placeholder: '请输入步骤' } },
{ input: true, label: '步骤描述', prop: 'description', rules: { required: true, message: '必填项不能为空', trigger: 'blur' }, elparams: { placeholder: '请输入描述' } },
], [
{ input: true, label: '参数名称', prop: 'name', elparams: { placeholder: '请输入参数名称' } },
{ input: true, label: '参数编码', prop: 'code', rules: { required: true, message: 'not empty', trigger: 'blur' }, elparams: { placeholder: '请输入描述' } },
{ input: true, label: '参数编码', prop: 'code', rules: { required: true, message: '必填项不能为空', trigger: 'blur' }, elparams: { placeholder: '请输入描述' } },
], [
{ input: true, label: '参数值上限', prop: 'valueTop', elparams: { placeholder: '请输入参数值上限' } },
{ input: true, label: '参数值下限', prop: 'valueFloor', elparams: { placeholder: '请输入参数值下限' } },

View File

@ -22,7 +22,7 @@ export default function () {
fixed: "right",
width: 120,
subcomponent: TableOperaionComponent,
options: ["edit", { name: "delete", permission: "pms:car:delete" }],
options: ["edit", { name: "delete", emitFull: true, permission: "pms:car:delete" }],
},
];
@ -69,14 +69,14 @@ export default function () {
input: true,
label: "窑车号",
prop: "name",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入窑车号" },
},
{
input: true,
label: "编码",
prop: "code",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入料仓编码" },
},
],

View File

@ -8,10 +8,10 @@ export default function () {
{ prop: "createTime", label: "添加时间", filter: timeFilter },
{ prop: "name", label: "客户名称" },
{ prop: "code", label: "编码" },
{ prop: "contact", label: "联系人" },
{ prop: "tel", label: "联系电话" },
{ prop: "email", label: "联系邮箱" },
{ prop: "address", label: "地址" },
{ prop: "contact", label: "联系人" },
{ prop: "description", label: "描述" },
{ prop: "remark", label: "备注" },
{
@ -20,7 +20,7 @@ export default function () {
fixed: "right",
width: 120,
subcomponent: TableOperaionComponent,
options: ["edit", { name: "delete", permission: "pms:customer:delete" }],
options: ["edit", { name: "delete", emitFull: true, permission: "pms:customer:delete" }],
},
];
@ -65,17 +65,31 @@ export default function () {
input: true,
label: "客户名称",
prop: "name",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入客户名称" },
},
{
input: true,
label: "编码",
prop: "code",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入编码" },
},
],
[
{
input: true,
label: "联系人",
prop: "contact",
elparams: { placeholder: "请输入联系人" },
},
{
input: true,
label: "地址",
prop: "address",
elparams: { placeholder: "请输入客户地址" },
},
],
[
{
input: true,
@ -90,20 +104,7 @@ export default function () {
elparams: { placeholder: "请输入联系邮箱" },
},
],
[
{
input: true,
label: "地址",
prop: "address",
elparams: { placeholder: "请输入客户地址" },
},
{
input: true,
label: "联系人",
prop: "contact",
elparams: { placeholder: "请输入联系人" },
},
],
[{ textarea: true, label: "描述信息", prop: "description", elparams: { placeholder: "描述信息" } }],
[{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
],

View File

@ -21,7 +21,7 @@ export default function () {
fixed: 'right',
width: 120,
subcomponent: TableOperaionComponent,
options: ['edit', { name: 'delete', permission: 'pms:equipment:delete' }]
options: ['edit', { name: 'delete', emitFull: true, permission: 'pms:equipment:delete' }]
}
]
@ -56,13 +56,14 @@ export default function () {
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: '请输入设备名称编码' } },
{ 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: 'version', elparams: { placeholder: '请输入版本号' } },
{
select: true,
label: '设备类型',
prop: 'equipmentTypeId',
prop: 'equipmentTypeId',
rules: { required: true, message: '必填项不能为空', trigger: 'blur' },
options: [
// { label: '1', value: 1 },
// { label: '2', value: 2 },
@ -118,8 +119,8 @@ export default function () {
extraParam: 'equipmentId',
rows: [
[
{ input: true, label: '属性名称', prop: 'attrName', rules: { required: true, message: 'not empty', trigger: 'blur' }, elparams: { placeholder: '请输入属性名称' } },
{ input: true, label: '属性值', prop: 'attrValue', rules: { required: true, message: 'not empty', trigger: 'blur' }, elparams: { placeholder: '请输入属性值' } },
{ input: true, label: '属性名称', prop: 'attrName', rules: { required: true, message: '必填项不能为空', trigger: 'blur' }, elparams: { placeholder: '请输入属性名称' } },
{ input: true, label: '属性值', prop: 'attrValue', rules: { required: true, message: '必填项不能为空', trigger: 'blur' }, elparams: { placeholder: '请输入属性值' } },
],
[
{ textarea: true, label: '备注', prop: 'remark', elparams: { placeholder: '添加备注' } },

View File

@ -18,7 +18,7 @@ export default function () {
fixed: "right",
width: 120,
subcomponent: TableOperaionComponent,
options: ["edit", { name: "delete", permission: "pms:equipmentType:delete" }],
options: ["edit", { name: "delete", emitFull: true, permission: "pms:equipmentType:delete" }],
},
];
@ -64,32 +64,32 @@ export default function () {
input: true,
label: "类型名称",
prop: "name",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入类型名称" },
},
{
input: true,
label: "类型编码",
prop: "code",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入类型编码" },
},
{
prop: "parentId",
cascader: true,
options: [
// {label: '父类1', value: '1'},
// {label: '父类2', value: '2'},
],
// fetchData() 获取普通列表数据
// fetchTreeData() 获取需要展示层级结构的数据
fetchTreeData: () => {
return this.$http.get('/pms/equipmentType/getTree')
},
label: "父类",
rules: { required: false, message: "not empty", trigger: "change" },
elparams: { placeholder: "请输选择父类", 'show-all-levels': false, props: { checkStrictly: true, value: 'id', label: 'name' } },
},
// {
// prop: "parentId",
// cascader: true,
// options: [
// // {label: '父类1', value: '1'},
// // {label: '父类2', value: '2'},
// ],
// // fetchData() 获取普通列表数据
// // fetchTreeData() 获取需要展示层级结构的数据
// fetchTreeData: () => {
// return this.$http.get('/pms/equipmentType/getTree')
// },
// label: "父类",
// rules: { required: false, message: "必填项不能为空", trigger: "change" },
// elparams: { placeholder: "请输选择父类", 'show-all-levels': false, props: { checkStrictly: true, value: 'id', label: 'name' } },
// },
],
// [{ textarea: true, label: "描述信息", prop: "description", elparams: { placeholder: "描述信息" } }],
[{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],

View File

@ -24,6 +24,7 @@ export default function () {
const headFormFields = [
{
prop: 'key',
label: '工厂名称',
input: true,
default: { value: '' },
@ -55,8 +56,8 @@ export default function () {
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: '请输入工厂编码' } },
{ 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: 'address', elparams: { placeholder: '' } }, // '请输入工厂所在地' } },

View File

@ -1,82 +1,76 @@
<!-- 这里单纯的配置表格就好了-->
<template>
<div class="base-list-table w-full">
<el-table
:data="tableData"
v-bind="tableConfig"
ref="base-list-table"
:cell-style="{ padding: 0 }"
:header-cell-style="/** 重写表格样式 **/ {
padding: '8px 0',
}"
row-key="id"
:lazy="true"
:load="loadSubClassFn"
>
<!-- @cell-mouse-enter="(row, col, cell, event) => $emit('cell-mouse-enter', row, col, cell, event)"> -->
<!-- @cell-mouse-leave="(row, col, cell, event) => $emit('cell-mouse-leave', row, col, cell, event)"> -->
<!-- 表格头定义 -->
<template v-for="(head, idx) in columnConfig">
<!-- 索引列 -->
<el-table-column
:key="idx"
v-if="head.type"
:type="head.type"
:label="head.label || head.name || ''"
:header-align="head.align || 'center'"
:align="head.align || 'center'"
:width="head.width || 50"
:index="
head.type === 'index'
? (val) => {
return val + 1 + (page - 1) * size;
}
: null
"
v-bind="head.more"
></el-table-column>
<!-- 普通的表头 -->
<el-table-column
v-else
:key="idx + 'else'"
:label="head.label ? head.label : head.name"
:prop="head.prop || null"
:width="head.width || null"
:min-width="head.minWidth || null"
:fixed="head.fixed || null"
:show-overflow-tooltip="head.showOverflowTooltip || true"
:tooltip-effect="head.tooltipEffect || 'light'"
filter-placement="top"
:align="head.align || null"
v-bind="head.more"
>
<!-- 子组件 -->
<template v-if="head.prop" slot-scope="scope">
<component
v-if="head.subcomponent"
:is="head.subcomponent"
:key="idx + 'sub'"
:inject-data="{ ...scope.row, head }"
@emit-data="handleSubEmitData"
/>
<!-- 直接展示数据或应用过滤器 -->
<span v-else>{{
scope.row[head.prop] | commonFilter(head.filter)
}}</span>
</template>
<div class="base-list-table w-full">
<el-table
:data="tableData"
v-bind="tableConfig"
ref="base-list-table"
:cell-style="{ padding: 0 }"
:header-cell-style="/** 重写表格样式 **/ {
padding: '8px 0',
}"
row-key="id"
:lazy="true"
:load="loadSubClassFn"
>
<!-- @cell-mouse-enter="(row, col, cell, event) => $emit('cell-mouse-enter', row, col, cell, event)"> -->
<!-- @cell-mouse-leave="(row, col, cell, event) => $emit('cell-mouse-leave', row, col, cell, event)"> -->
<!-- 表格头定义 -->
<template v-for="(head, idx) in columnConfig">
<!-- 索引列 -->
<el-table-column
:key="idx"
v-if="head.type"
:type="head.type"
:label="head.label || head.name || ''"
:header-align="head.align || 'center'"
:align="head.align || 'center'"
:width="head.width || 50"
:index="
head.type === 'index'
? (val) => {
return val + 1 + (page - 1) * size;
}
: null
"
v-bind="head.more"
></el-table-column>
<!-- 普通的表头 -->
<el-table-column
v-else
:key="idx + 'else'"
:label="head.label ? head.label : head.name"
:prop="head.prop || null"
:width="head.width || null"
:min-width="head.minWidth || null"
:fixed="head.fixed || null"
:show-overflow-tooltip="head.showOverflowTooltip || true"
:tooltip-effect="head.tooltipEffect || 'light'"
filter-placement="top"
:align="head.align || null"
v-bind="head.more"
>
<!-- 子组件 -->
<template v-if="head.prop" slot-scope="scope">
<component
v-if="head.subcomponent"
:is="head.subcomponent"
:key="idx + 'sub'"
:inject-data="{ ...scope.row, head }"
@emit-data="handleSubEmitData"
/>
<!-- 直接展示数据或应用过滤器 -->
<span v-else>{{ scope.row[head.prop] | commonFilter(head.filter) }}</span>
</template>
<!-- 多级表头 -->
<template v-if="!head.prop && head.children">
<TableHead
v-for="(subhead, subindex) in head.children"
:key="'subhead-' + idx + '-subindex-' + subindex"
:opt="subhead"
/>
</template>
</el-table-column>
</template>
</el-table>
</div>
<!-- 多级表头 -->
<template v-if="!head.prop && head.children">
<TableHead v-for="(subhead, subindex) in head.children" :key="'subhead-' + idx + '-subindex-' + subindex" :opt="subhead" />
</template>
</el-table-column>
</template>
</el-table>
</div>
</template>
<script>
@ -86,52 +80,53 @@ import TableHead from "@/components/TableHead.vue";
// 3. more...
export default {
name: "BaseListTable",
components: { TableHead },
filters: {
commonFilter: (source, filterType = (a) => a) => {
return filterType(source);
},
},
props: {
tableConfig: {
type: Object,
default: () => ({}),
},
columnConfig: {
type: Array,
default: () => [],
},
tableData: {
type: Array,
default: () => [],
},
},
inject: ["urls"],
data() {
return {
page: 1,
size: 20, // 20
dataList: [],
};
},
watch: {
// 'props.tableData': {
// handler: () => {
// this.$refs['base-list-table'].doLayout();
// },
// immediate: true,
// },
},
methods: {
handleSubEmitData(payload) {
console.log("[component] BaseListTable handleSubEmitData(): ", payload);
this.$emit("operate-event", payload);
},
loadSubClassFn(tree, treeNode, resolve) {
this.$emit('load-sub', { tree, treeNode, resolve })
}
},
name: "BaseListTable",
components: { TableHead },
filters: {
commonFilter: (source, filterType = (a) => a) => {
return filterType(source);
},
},
props: {
tableConfig: {
type: Object,
default: () => ({}),
},
columnConfig: {
type: Array,
default: () => [],
},
tableData: {
type: Array,
default: () => [],
},
refreshLayoutKey: {
type: Number,
default: 0,
},
},
inject: ["urls"],
data() {
return {
page: 1,
size: 20, // 20
dataList: [],
};
},
watch: {
refreshLayoutKey(val) {
this.$refs["base-list-table"].doLayout();
},
},
methods: {
handleSubEmitData(payload) {
console.log("[component] BaseListTable handleSubEmitData(): ", payload);
this.$emit("operate-event", payload);
},
loadSubClassFn(tree, treeNode, resolve) {
this.$emit("load-sub", { tree, treeNode, resolve });
},
},
};
</script>

View File

@ -197,13 +197,17 @@ export default {
})
.then(({ data: res }) => {
console.log("[add&update] res is: ", res);
this.loadingStatus = false;
if (res.code === 0) {
this.$message.success(payload.name === "add" ? "添加成功" : "更新成功");
this.loadingStatus = false;
this.$emit("refreshDataList");
this.handleClose();
} else {
this.$message.error(res.msg);
this.$message({
message: `${res.code}: ${res.msg}`,
type: "error",
duration: 2000,
});
}
})
.catch((errMsg) => {

View File

@ -16,6 +16,7 @@
:table-data="dataList"
@operate-event="handleOperate"
@load-sub="handleLoadSub"
:refresh-layout-key="refreshLayoutKey"
/>
<el-pagination
@ -91,6 +92,7 @@ export default {
},
data() {
return {
refreshLayoutKey: null,
DIALOG_WITH_MENU,
DIALOG_JUST_FORM,
dialogVisible: false,
@ -109,7 +111,7 @@ export default {
input: true,
label: "物料名称",
prop: "name",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入物料名称" },
},
],
@ -118,7 +120,7 @@ export default {
input: true,
label: "物料编码",
prop: "code",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入物料编码" },
},
],
@ -140,6 +142,9 @@ export default {
mounted() {
this.initDataWhenLoad && this.getList();
},
activated() {
this.refreshLayoutKey = this.layoutTable();
},
methods: {
handleLoadSub({ tree, treeNode, resolve }) {
// console.log("tree, treeNOde, resovle is:", tree, treeNode, resolve);
@ -158,6 +163,10 @@ export default {
});
},
layoutTable() {
return Math.random();
},
/** 获取 列表数据 */
getList(queryParams) {
this.tableLoading = true;
@ -188,7 +197,7 @@ export default {
// page :
if ("list" in res.data) {
// real env:
this.dataList = res.data.list.map((_) => ({ ..._, hasChildren: true }));
this.dataList = res.data.list.map((_) => ({ ..._, hasChildren: Array.isArray(_.children) && _.children.length > 0 ? true : false }));
// this.dataList = res.data.records;
this.totalPage = res.data.total;
@ -202,12 +211,6 @@ export default {
});
},
/** 处理 HeadForm 的操作 */
handleHeadformOperate(payload) {
//
console.log("headform operate: ", payload);
},
/** 处理 表格操作 */
handleOperate({ type, data }) {
console.log("payload", type, data);
@ -216,7 +219,7 @@ export default {
switch (type) {
case "delete": {
//
return this.$confirm(`是否删除条目: ${data}`, "提示", {
return this.$confirm(`确定要删除 "${data.name}" 吗?`, "提示", {
confirmButtonText: "确认",
cancelButtonText: "我再想想",
type: "warning",
@ -226,7 +229,7 @@ export default {
this.$http({
url: this.urls.base,
method: "DELETE",
data: [`${data}`],
data: [`${data.id}`],
}).then(({ data: res }) => {
if (res.code === 0) {
this.$message.success("删除成功!");

View File

@ -24,7 +24,7 @@ export default function () {
fixed: "right",
width: 180,
subcomponent: TableOperaionComponent,
options: [{ name: "add-sub", permission: "pms:material:save" }, "edit", { name: "delete", permission: "pms:material:save" },],
options: [{ name: "add-sub", permission: "pms:material:save" }, "edit", { name: "delete", emitFull: true, permission: "pms:material:save" },],
},
];
@ -73,17 +73,17 @@ export default function () {
input: true,
label: "物料名称",
prop: "name",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入物料名称" },
},
{
input: true,
label: "物料编码",
prop: "code",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入物料编码" },
},
{ input: true, label: "堆积密度(g/cm3)", prop: "density", elparams: { placeholder: "堆积密度" } },
{ input: true, label: "堆积密度(g/cm³)", prop: "density", elparams: { placeholder: "堆积密度" } },
],
[
@ -93,7 +93,7 @@ export default function () {
prop: "parentId",
// TODO: 待解决DialogWithMenu 中设置default只在初始化的时候有效一旦清空过就无效了
// default: '0',
// rules: { required: true, message: "not empty", trigger: "blur" },
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
options: [{ id: '0', name: '无' }], // 手动注入额外选项,用到的场景不多...
fetchData: () => this.$http.get('/pms/material/page', { params: { page: 1, limit: 999, key: '' } }),
elparams: { placeholder: "请选择父级物料", filterable: true, clearable: true },
@ -109,7 +109,7 @@ export default function () {
select: true,
label: "物料类型",
prop: "typeId",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
options: [],
fetchData: () => this.$http.get('/pms/materialType/page', { params: { page: 1, limit: 999 } }),
elparams: { placeholder: "请输入物料类型" },
@ -128,7 +128,7 @@ export default function () {
// input: true,
// label: "设备类型",
// prop: "eqTypeId",
// rules: { required: true, message: "not empty", trigger: "blur" },
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
// elparams: { placeholder: "请输入设备类型" },
// },
],
@ -183,7 +183,7 @@ export default function () {
subcomponent: TableOperaionComponent,
options: [
{ name: "edit", permission: "pms:materialArrt:save" },
{ name: "delete", permission: "pms:materialArrt:save" },
{ name: "delete", emitFull: true, permission: "pms:materialArrt:save" },
],
},
],

View File

@ -20,7 +20,7 @@ export default function () {
fixed: "right",
width: 120,
subcomponent: TableOperaionComponent,
options: ["edit", { name: "delete", permission: "pms:materialStorage:delete" }],
options: ["edit", { name: "delete", emitFull: true, permission: "pms:materialStorage:delete" }],
},
];
@ -66,14 +66,14 @@ export default function () {
input: true,
label: "料仓名称",
prop: "name",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入料仓名称" },
},
{
input: true,
label: "料仓编码",
prop: "code",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入料仓编码" },
}, {
select: true,
@ -85,7 +85,7 @@ export default function () {
{ label: '中间仓', value: '0' },
{ label: '日料仓', value: '1' },
],
rules: { required: true, message: "not empty", trigger: "change" },
rules: { required: true, message: "必填项不能为空", trigger: "change" },
},
],
[{ textarea: true, label: "描述信息", prop: "description", elparams: { placeholder: "描述信息" } }],

View File

@ -1,55 +1,53 @@
import TableOperaionComponent from '@/components/noTemplateComponents/operationComponent'
import { timeFilter } from '@/utils/filters'
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
import { timeFilter } from "@/utils/filters";
export default function () {
const tableProps = [
{ type: 'index', label: '序号' },
{ type: "index", label: "序号" },
{ prop: "createTime", label: "添加时间", filter: timeFilter },
{ prop: 'name', label: '类型名称' },
{ prop: 'code', label: '类型编码' },
{ prop: 'enName', label: '英文名称' },
{ prop: 'enAb', label: '缩写' },
{ prop: 'description', label: '描述', },
{ prop: 'remark', label: '备注' },
{ prop: "name", label: "类型名称" },
{ prop: "code", label: "类型编码" },
{ prop: "enName", label: "英文名称" },
{ prop: "enAb", label: "缩写" },
{ prop: "description", label: "描述" },
{ prop: "remark", label: "备注" },
{
prop: 'operations',
name: '操作',
fixed: 'right',
prop: "operations",
name: "操作",
fixed: "right",
width: 120,
subcomponent: TableOperaionComponent,
options: ['edit', { name: 'delete', permission: 'pms:materialType:delete' }]
}
]
options: ["edit", { name: "delete", emitFull: true, permission: "pms:materialType:delete" }],
},
];
const headFormFields = [
// {
// prop: 'key',
// label: '工序名称/编码',
// input: true,
// default: { value: '' },
// bind: { // v-bind keyValues
// placeholder: '请输入工序名称或编码'
// }
// },
{
button: {
type: 'primary',
name: '查询'
prop: 'key',
label: '类型名称/编码',
input: true,
default: { value: '' },
bind: { // v-bind keyValues
placeholder: '请输入类型名称或编码'
}
},
{
button: {
type: 'primary',
name: '新增',
permission: 'pms:materialType:save'
type: "primary",
name: "查询",
},
},
{
button: {
type: "primary",
name: "新增",
permission: "pms:materialType:save",
},
bind: {
plain: true,
}
}
]
},
},
];
/**
* dialog config 有两个版本一个适用于 DialogWithMenu 组件另一个适用于 DialogJustForm 组件
@ -60,12 +58,28 @@ export default function () {
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: '请输入物料类型编码' } },
{
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: '请输入英文缩写' } },
{ 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: "描述" } },
],
[
// {
@ -83,24 +97,19 @@ export default function () {
// 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: 'not empty', trigger: 'blur' }, elparams: { placeholder: '请输入混料程序号' } },
],
[
// [{ switch: true, label: '状态', prop: 'enabled', default: 0 }],
{ textarea: true, label: '描述', prop: 'description', elparams: { placeholder: '描述' } },
{ 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: "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: {
@ -109,14 +118,14 @@ export default function () {
},
headFormConfigs: {
rules: null, // 名称是由 BaseSearchForm.vue 组件固定的
fields: headFormFields // 名称是由 BaseSearchForm.vue 组件固定的
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
},
urls: {
base: '/pms/materialType',
page: '/pms/materialType/page',
base: "/pms/materialType",
page: "/pms/materialType/page",
// subase: '/pms/blenderStepParam',
// subpage: '/pms/blenderStepParam/page',
// more...
}
}
}
},
};
}

View File

@ -22,7 +22,7 @@ export default function () {
fixed: "right",
width: 120,
subcomponent: TableOperaionComponent,
options: ["edit", { name: "delete", permission: "pms:product:delete" }],
options: ["edit", { name: "delete", emitFull: true, permission: "pms:product:delete" }],
},
];
@ -68,14 +68,14 @@ export default function () {
input: true,
label: "产品名称/砖型名称",
prop: "name",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入设备名称" },
},
{
input: true,
label: "产品编码/砖型编码",
prop: "code",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入设备编码" },
},
// { input: true, label: '版本号', prop: 'version', elparams: { placeholder: '请输入版本号' } },
@ -88,7 +88,7 @@ export default function () {
},
],
[
// { input: true, label: '单位平方数', prop: 'code', rules: { required: true, message: 'not empty', trigger: 'blur' }, elparams: { placeholder: '请输入设备名称编码' } },
// { input: true, label: '单位平方数', prop: 'code', rules: { required: true, message: '必填项不能为空', trigger: 'blur' }, elparams: { placeholder: '请输入设备名称编码' } },
{
select: true,
label: "单位",
@ -100,14 +100,14 @@ export default function () {
input: true,
label: "规格",
prop: "specifications",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入规格" },
},
{
input: true,
label: "产线完成单位产品用时(s)",
prop: "processTime",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入规格" },
},
],
@ -138,7 +138,7 @@ export default function () {
subcomponent: TableOperaionComponent,
options: [
{ name: "edit", permission: "pms:productArrt:update" },
{ name: "delete", permission: "pms:productArrt:delete" },
{ name: "delete", emitFull: true, permission: "pms:productArrt:delete" },
],
},
],
@ -156,14 +156,14 @@ export default function () {
input: true,
label: "属性名称",
prop: "name",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入属性名称" },
},
{
input: true,
label: "属性值",
prop: "value",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入属性值" },
},
],

View File

@ -21,7 +21,7 @@ export default function () {
fixed: "right",
width: 120,
subcomponent: TableOperaionComponent,
options: ["edit", { name: "delete", permission: "pms:productionLine:delete" }],
options: ["edit", { name: "delete", emitFull: true, permission: "pms:productionLine:delete" }],
},
];
@ -66,14 +66,14 @@ export default function () {
input: true,
label: "产线名称",
prop: "name",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入产线名称" },
},
{
input: true,
label: "产线编码",
prop: "code",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入产线编码" },
},
{
@ -82,7 +82,7 @@ export default function () {
prop: "factoryId",
fetchData: () => this.$http.get("/pms/factory/page", { params: { limit: 999, page: 1 } }),
option: [],
rules: { required: true, message: "not empty", trigger: "change" },
rules: { required: true, message: "必填项不能为空", trigger: "change" },
},
],
// [
@ -91,7 +91,7 @@ export default function () {
// label: "产线TT值",
// prop: "tvalue",
// rules: [
// { required: true, message: "not empty", trigger: "blur" },
// { required: true, message: "必填项不能为空", trigger: "blur" },
// { type: "number", message: "数字", trigger: "blur", transform: (val) => Number(val) },
// ],
// elparams: { placeholder: "设定TT值每小时下片数量" },

View File

@ -17,7 +17,7 @@ export default function () {
fixed: "right",
width: 120,
subcomponent: TableOperaionComponent,
options: ["edit", { name: "delete", permission: "pms:shape:delete" }],
options: ["edit", { name: "delete", emitFull: true, permission: "pms:shape:delete" }],
},
];
@ -62,14 +62,14 @@ export default function () {
input: true,
label: "砖型名称",
prop: "name",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入砖型名称" },
},
{
input: true,
label: "砖型编码",
prop: "code",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入砖型编码" },
},
],
@ -80,14 +80,14 @@ export default function () {
// prop: "factoryId",
// fetchData: () => this.$http.get("/pms/factory/page", { params: { limit: 999, page: 1 } }),
// option: [],
// rules: { required: true, message: "not empty", trigger: "change" },
// rules: { required: true, message: "必填项不能为空", trigger: "change" },
// },
// {
// input: true,
// label: "产线TT值",
// prop: "tvalue",
// rules: [
// { required: true, message: "not empty", trigger: "blur" },
// { required: true, message: "必填项不能为空", trigger: "blur" },
// { type: "number", message: "数字", trigger: "blur", transform: (val) => Number(val) },
// ],
// elparams: { placeholder: "设定TT值每小时下片数量" },

View File

@ -9,10 +9,10 @@ export default function () {
{ prop: "createTime", label: "添加时间", filter: timeFilter },
{ prop: "name", label: "供应商名称" },
{ prop: "code", label: "编码" },
{ prop: "contact", label: "联系人" },
{ prop: "tel", label: "联系电话" },
{ prop: "email", label: "联系邮箱" },
{ prop: "address", label: "地址" },
{ prop: "contact", label: "联系人" },
// { prop: "status", label: "产线状态", subcomponent: switchBtn }, // subcomponent
{ prop: "description", label: "描述" },
{ prop: "remark", label: "备注" },
@ -22,7 +22,7 @@ export default function () {
fixed: "right",
width: 120,
subcomponent: TableOperaionComponent,
options: ["edit", { name: "delete", permission: "pms:supplier:delete" }],
options: ["edit", { name: "delete", emitFull: true, permission: "pms:supplier:delete" }],
},
];
@ -67,66 +67,67 @@ export default function () {
input: true,
label: "供应商名称",
prop: "name",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入供应商名称" },
},
{
input: true,
label: "编码",
prop: "code",
rules: { required: true, message: "not empty", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入编码" },
},
],
[
{
input: true,
label: "联系电话",
prop: "tel",
// rules: { required: true, message: "not empty", trigger: "blur" },
elparams: { placeholder: "请输入联系电话" },
label: "联系",
prop: "contact",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入联系" },
},
{
input: true,
label: "联系邮箱",
prop: "email",
// rules: { required: true, message: "not empty", trigger: "blur" },
elparams: { placeholder: "请输入联系邮箱" },
},
// {
// select: true,
// label: "所属工厂",
// prop: "factoryId",
// fetchData: () => this.$http.get("/pms/factory/page", { params: { limit: 999, page: 1 } }),
// option: [],
// rules: { required: true, message: "not empty", trigger: "change" },
// },
// {
// input: true,
// label: "产线TT值",
// prop: "tvalue",
// rules: [
// { required: true, message: "not empty", trigger: "blur" },
// { type: "number", message: "数字", trigger: "blur", transform: (val) => Number(val) },
// ],
// elparams: { placeholder: "设定TT值每小时下片数量" },
// },
],
[
{
input: true,
label: "地址",
prop: "address",
// rules: { required: true, message: "not empty", trigger: "blur" },
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入供应商地址" },
},
{
input: true,
label: "联系人",
prop: "contact",
// rules: { required: true, message: "not empty", trigger: "blur" },
elparams: { placeholder: "请输入联系人" },
},
[
{
input: true,
label: "联系电话",
prop: "tel",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入联系电话" },
},
{
input: true,
label: "联系邮箱",
prop: "email",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入联系邮箱" },
},
// {
// select: true,
// label: "所属工厂",
// prop: "factoryId",
// fetchData: () => this.$http.get("/pms/factory/page", { params: { limit: 999, page: 1 } }),
// option: [],
// rules: { required: true, message: "必填项不能为空", trigger: "change" },
// },
// {
// input: true,
// label: "产线TT值",
// prop: "tvalue",
// rules: [
// { required: true, message: "必填项不能为空", trigger: "blur" },
// { type: "number", message: "数字", trigger: "blur", transform: (val) => Number(val) },
// ],
// elparams: { placeholder: "设定TT值每小时下片数量" },
// },
],
],
[{ textarea: true, label: "描述信息", prop: "description", elparams: { placeholder: "描述信息" } }],
[{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],

View File

@ -1,54 +1,53 @@
import TableOperaionComponent from '@/components/noTemplateComponents/operationComponent'
import { timeFilter } from '@/utils/filters'
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
import { timeFilter } from "@/utils/filters";
export default function () {
const tableProps = [
{ type: 'index', label: '序号' },
{ type: "index", label: "序号" },
{ prop: "createTime", label: "添加时间", filter: timeFilter },
{ prop: 'name', label: '工序名称' },
{ prop: 'code', label: '工序编码' },
{ prop: 'prdLine', label: '产线名称' },
{ prop: 'description', label: '描述', },
{ prop: 'remark', label: '备注' },
{ prop: "name", label: "工序名称" },
{ prop: "code", label: "工序编码" },
{ prop: "prdLine", label: "产线名称" },
{ prop: "description", label: "描述" },
{ prop: "remark", label: "备注" },
{
prop: 'operations',
name: '操作',
fixed: 'right',
prop: "operations",
name: "操作",
fixed: "right",
width: 120,
subcomponent: TableOperaionComponent,
options: ['edit', { name: 'delete', permission: 'pms:workSequence:delete' }]
}
]
options: ["edit", { name: "delete", emitFull: true, permission: "pms:workSequence:delete" }],
},
];
const headFormFields = [
{
prop: 'key',
label: '工序名称/编码',
prop: "key",
label: "工序名称/编码",
input: true,
default: { value: '' },
bind: { // v-bind keyValues
placeholder: '请输入工序名称或编码'
}
default: { value: "" },
bind: {
// v-bind keyValues
placeholder: "请输入工序名称或编码",
},
},
{
button: {
type: 'primary',
name: '查询'
}
type: "primary",
name: "查询",
},
},
{
button: {
type: 'primary',
name: '新增',
permission: 'pms:workSequence:save'
type: "primary",
name: "新增",
permission: "pms:workSequence:save",
},
bind: {
plain: true,
}
}
]
},
},
];
/**
* dialog config 有两个版本一个适用于 DialogWithMenu 组件另一个适用于 DialogJustForm 组件
@ -59,43 +58,57 @@ export default function () {
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: '请输入工序编码' } },
{
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: "请输入工序编码" },
},
],
[
{
select: true,
label: '产线',
prop: 'prdLineId',
label: "产线",
prop: "prdLineId",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
options: [
// { label: '1', value: 1 },
// { label: '2', value: 2 },
// { label: '3', value: 3 },
],
elparams: { placeholder: '请选择所属产线' },
elparams: { placeholder: "请选择所属产线" },
// fetchData api
fetchData: () => {
return this.$http('/pms/productionLine/page', { limit: 999, page: 1, key: '' })
}
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: 'not empty', trigger: 'blur' }, elparams: { placeholder: '请输入混料程序号' } },
// { input: true, label: '备注', prop: 'remark', elparams: { placeholder: '备注' } },
{ input: true, label: "描述", prop: "description", elparams: { placeholder: "描述" } },
// { input: true, label: '程序号', prop: '', rules: { required: true, message: '必填项不能为空', trigger: 'blur' }, elparams: { placeholder: '请输入混料程序号' } },
],
// [{ switch: true, label: '状态', prop: 'enabled', default: 0 }],
[
{ textarea: true, label: '描述', prop: 'description', elparams: { placeholder: '描述' } },
// { textarea: true, label: '描述', prop: 'description', elparams: { placeholder: '描述' } },
{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } },
],
],
operations: [
{ name: 'add', label: '保存', type: 'primary', permission: 'pms:workSequence:save', showOnEdit: false },
{ name: 'update', label: '更新', type: 'primary', permission: 'pms:workSequence:update', showOnEdit: true },
{ name: 'reset', label: '重置', type: 'warning', showAlways: true },
{ name: "add", label: "保存", type: "primary", permission: "pms:workSequence:save", showOnEdit: false },
{ name: "update", label: "更新", type: "primary", permission: "pms:workSequence:update", showOnEdit: true },
{ name: "reset", label: "重置", type: "warning", showAlways: true },
// { name: 'cancel', label: '取消', showAlways: true },
],
},
};
return {
dialogConfigs: dialogJustFormConfigs,
tableConfig: {
@ -104,14 +117,14 @@ export default function () {
},
headFormConfigs: {
rules: null, // 名称是由 BaseSearchForm.vue 组件固定的
fields: headFormFields // 名称是由 BaseSearchForm.vue 组件固定的
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
},
urls: {
base: '/pms/workSequence',
page: '/pms/workSequence/page',
base: "/pms/workSequence",
page: "/pms/workSequence/page",
// subase: '/pms/blenderStepParam',
// subpage: '/pms/blenderStepParam/page',
// more...
}
}
}
},
};
}