2023-02-22 17:04:11 +08:00
|
|
|
|
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
|
|
|
|
|
import TableTextComponent from "@/components/noTemplateComponents/detailComponent";
|
2023-03-17 10:31:11 +08:00
|
|
|
|
// import StatusComponent from "@/components/noTemplateComponents/statusComponent";
|
2023-02-22 17:04:11 +08:00
|
|
|
|
import { timeFilter } from "@/utils/filters";
|
2023-01-16 11:08:54 +08:00
|
|
|
|
|
|
|
|
|
export default function () {
|
|
|
|
|
const tableProps = [
|
2023-02-22 17:04:11 +08:00
|
|
|
|
{ type: "index", label: "序号" },
|
2023-02-14 14:54:26 +08:00
|
|
|
|
{ prop: "createTime", label: "添加时间", filter: timeFilter },
|
2023-02-22 17:04:11 +08:00
|
|
|
|
{ prop: "name", label: "工艺名称" },
|
|
|
|
|
{ prop: "code", label: "工艺编码" },
|
|
|
|
|
// { prop: 'version', label: '配方号' },
|
|
|
|
|
{ prop: "bomCode", label: "配方号" },
|
|
|
|
|
// { prop: 'status', label: '状态', subcomponent: StatusComponent }, // subcomponent
|
|
|
|
|
{ prop: "description", label: "详情", subcomponent: TableTextComponent },
|
|
|
|
|
{ prop: "remark", label: "备注" },
|
2023-01-16 11:08:54 +08:00
|
|
|
|
{
|
2023-02-22 17:04:11 +08:00
|
|
|
|
prop: "operations",
|
|
|
|
|
name: "操作",
|
|
|
|
|
fixed: "right",
|
2023-02-23 17:02:18 +08:00
|
|
|
|
width: 160,
|
2023-01-16 11:08:54 +08:00
|
|
|
|
subcomponent: TableOperaionComponent,
|
2023-03-17 11:32:29 +08:00
|
|
|
|
options: ["copy", { name: "edit", label: "编辑", icon: "edit-outline" }, { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:blenderStep:delete" }],
|
2023-02-22 17:04:11 +08:00
|
|
|
|
},
|
|
|
|
|
];
|
2023-01-16 11:08:54 +08:00
|
|
|
|
|
|
|
|
|
const headFormFields = [
|
|
|
|
|
{
|
2023-02-22 17:04:11 +08:00
|
|
|
|
prop: "key",
|
|
|
|
|
label: "工艺名称/编码",
|
|
|
|
|
input: true,
|
|
|
|
|
default: { value: "" },
|
|
|
|
|
bind: {
|
|
|
|
|
placeholder: "请输入工艺名称或编码",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: "bom",
|
|
|
|
|
label: "配方号",
|
2023-01-16 11:08:54 +08:00
|
|
|
|
input: true,
|
2023-02-22 17:04:11 +08:00
|
|
|
|
default: { value: "" },
|
|
|
|
|
bind: {
|
|
|
|
|
placeholder: "请输入配方号",
|
|
|
|
|
},
|
2023-01-16 11:08:54 +08:00
|
|
|
|
},
|
2023-02-22 17:04:11 +08:00
|
|
|
|
// {
|
|
|
|
|
// prop: 'bom',
|
|
|
|
|
// label: '配方号',
|
|
|
|
|
// input: true,
|
|
|
|
|
// default: { value: '' },
|
|
|
|
|
// bind: {
|
|
|
|
|
// placeholder: '请输入配方号'
|
|
|
|
|
// }
|
|
|
|
|
// },
|
2023-01-16 11:08:54 +08:00
|
|
|
|
{
|
|
|
|
|
button: {
|
2023-02-22 17:04:11 +08:00
|
|
|
|
type: "primary",
|
|
|
|
|
name: "查询",
|
|
|
|
|
},
|
2023-01-16 11:08:54 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
button: {
|
2023-02-22 17:04:11 +08:00
|
|
|
|
type: "plain",
|
|
|
|
|
name: "新增",
|
|
|
|
|
permission: "pms:blenderStep:save",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
];
|
2023-01-16 11:08:54 +08:00
|
|
|
|
|
|
|
|
|
const dialogConfigs = {
|
2023-02-22 17:04:11 +08:00
|
|
|
|
extraIds: { wsId: 1 }, // 工艺管理里面的相关模块的 dialogWithMenu 需要额外的工序 id
|
|
|
|
|
menu: [
|
|
|
|
|
{ name: "混料程序", key: "info" },
|
|
|
|
|
{ name: "工艺参数", key: "attr", onlyEditMode: true },
|
|
|
|
|
],
|
2023-01-16 11:08:54 +08:00
|
|
|
|
form: {
|
|
|
|
|
rows: [
|
|
|
|
|
[
|
2023-02-22 17:04:11 +08:00
|
|
|
|
{
|
|
|
|
|
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,
|
2023-03-02 14:39:19 +08:00
|
|
|
|
label: "配方",
|
2023-02-22 17:04:11 +08:00
|
|
|
|
prop: "bomId",
|
|
|
|
|
options: [],
|
2023-02-23 11:29:31 +08:00
|
|
|
|
refreshOptionsAfterConfirm: true,
|
2023-03-02 17:03:54 +08:00
|
|
|
|
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
2023-02-22 17:04:11 +08:00
|
|
|
|
elparams: { clearable: true, filterable: true, placeholder: "请选择配方" },
|
2023-02-24 14:47:51 +08:00
|
|
|
|
fetchData: (techId = -1) => this.$http.get("/pms/bom/listUnR", { params: { wsId: 1, externalCode: '', key: '', techId } }),
|
2023-02-22 17:04:11 +08:00
|
|
|
|
},
|
2023-01-16 11:08:54 +08:00
|
|
|
|
],
|
2023-03-02 14:39:19 +08:00
|
|
|
|
// [
|
|
|
|
|
// {
|
|
|
|
|
// forceDisabled: true,
|
|
|
|
|
// prop: 'bomCode',
|
|
|
|
|
// label: '当前配方'
|
|
|
|
|
// },
|
|
|
|
|
// ],
|
2023-02-22 17:04:11 +08:00
|
|
|
|
[{ textarea: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
|
2023-01-16 11:08:54 +08:00
|
|
|
|
],
|
|
|
|
|
operations: [
|
2023-02-22 17:04:11 +08:00
|
|
|
|
{ name: "add", label: "保存", type: "primary", permission: "pms:blenderStep:save", showOnEdit: false },
|
|
|
|
|
{ name: "update", label: "更新", type: "primary", permission: "pms:blenderStep:update", showOnEdit: true },
|
|
|
|
|
{ name: "reset", label: "重置", type: "warning", showAlways: true },
|
2023-01-16 11:08:54 +08:00
|
|
|
|
// { name: 'cancel', label: '取消', showAlways: true },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
table: {
|
2023-02-22 17:04:11 +08:00
|
|
|
|
extraParams: ["techId", "key"],
|
2023-01-16 11:08:54 +08:00
|
|
|
|
props: [
|
2023-02-14 14:54:26 +08:00
|
|
|
|
// { type: 'index', label: '序号' },
|
|
|
|
|
// { prop: "createTime", label: "添加时间", filter: timeFilter },
|
2023-02-22 17:04:11 +08:00
|
|
|
|
{ prop: "name", label: "参数名称", isEditField: true },
|
|
|
|
|
{ prop: "code", label: "参数编码", isEditField: true },
|
|
|
|
|
// { prop: "specifications", label: "规格", isEditField: true },
|
2023-03-02 14:39:19 +08:00
|
|
|
|
{ prop: "value", label: "参数值", isEditField: true },
|
|
|
|
|
{ prop: "valueFloor", label: "参数值下限", isEditField: true },
|
|
|
|
|
{ prop: "valueTop", label: "参数值上限", isEditField: true },
|
2023-02-22 17:04:11 +08:00
|
|
|
|
{ prop: "description", label: "描述", isEditField: true },
|
2023-01-16 11:08:54 +08:00
|
|
|
|
{
|
2023-02-22 17:04:11 +08:00
|
|
|
|
prop: "operations",
|
|
|
|
|
name: "操作",
|
|
|
|
|
fixed: "right",
|
2023-01-16 11:08:54 +08:00
|
|
|
|
width: 120,
|
|
|
|
|
subcomponent: TableOperaionComponent,
|
|
|
|
|
options: [
|
2023-03-17 11:32:29 +08:00
|
|
|
|
{ name: { name: "edit", label: "编辑", icon: "edit-outline" }, permission: "pms:blenderStepParam:update" },
|
|
|
|
|
{ name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:blenderStepParam:delete" },
|
2023-02-22 17:04:11 +08:00
|
|
|
|
],
|
|
|
|
|
},
|
2023-01-16 11:08:54 +08:00
|
|
|
|
],
|
|
|
|
|
data: [
|
|
|
|
|
// TOOD 暂时用不到,但获取可以考虑把拉取接口数据的函数迁移到此文件(没有太大必要)
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
subDialog: {
|
2023-02-24 10:23:16 +08:00
|
|
|
|
extraParam: "techId",
|
2023-01-16 11:08:54 +08:00
|
|
|
|
rows: [
|
|
|
|
|
[
|
2023-02-22 17:04:11 +08:00
|
|
|
|
{
|
|
|
|
|
input: true,
|
|
|
|
|
label: "参数名称",
|
|
|
|
|
prop: "name",
|
|
|
|
|
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
|
|
|
|
elparams: { placeholder: "请输入参数名称" },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
input: true,
|
|
|
|
|
label: "参数编码",
|
|
|
|
|
prop: "code",
|
|
|
|
|
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
2023-03-02 14:39:19 +08:00
|
|
|
|
elparams: { placeholder: "请输入参数编码" },
|
2023-02-22 17:04:11 +08:00
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
{ input: true, label: "参数值上限", prop: "valueTop", elparams: { placeholder: "请输入参数值上限" } },
|
|
|
|
|
{ input: true, label: "参数值下限", prop: "valueFloor", elparams: { placeholder: "请输入参数值下限" } },
|
2023-01-16 11:08:54 +08:00
|
|
|
|
],
|
|
|
|
|
[
|
2023-02-22 17:04:11 +08:00
|
|
|
|
{ input: true, label: "参数值", prop: "value", elparams: { placeholder: "请输入参数值" } },
|
|
|
|
|
{
|
|
|
|
|
input: true,
|
|
|
|
|
label: "描述",
|
|
|
|
|
prop: "description",
|
|
|
|
|
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
|
|
|
|
elparams: { placeholder: "请输入描述" },
|
|
|
|
|
},
|
|
|
|
|
],
|
2023-01-16 11:08:54 +08:00
|
|
|
|
],
|
|
|
|
|
operations: [
|
2023-02-22 17:04:11 +08:00
|
|
|
|
{ name: "add", label: "保存", type: "primary", permission: "pms:blenderStepParam:save", showOnEdit: false },
|
|
|
|
|
{ name: "update", label: "更新", type: "primary", permission: "pms:blenderStepParam:update", showOnEdit: true },
|
2023-01-16 11:08:54 +08:00
|
|
|
|
// { name: 'reset', label: '重置', type: 'warning', showAlways: true },
|
|
|
|
|
// { name: 'cancel', label: '取消', showAlways: true },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
dialogConfigs,
|
|
|
|
|
tableConfig: {
|
|
|
|
|
table: null, // 此处可省略,el-table 上的配置项
|
|
|
|
|
column: tableProps, // el-column-item 上的配置项
|
|
|
|
|
},
|
|
|
|
|
headFormConfigs: {
|
|
|
|
|
rules: null, // 名称是由 BaseSearchForm.vue 组件固定的
|
2023-02-22 17:04:11 +08:00
|
|
|
|
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
|
2023-01-16 11:08:54 +08:00
|
|
|
|
},
|
|
|
|
|
urls: {
|
2023-02-22 17:04:11 +08:00
|
|
|
|
base: "/pms/equipmentTech",
|
|
|
|
|
page: "/pms/equipmentTech/pageView",
|
|
|
|
|
pageIsPostApi: true, // 使用post接口来获取page数据,极少用,目前基本上只有工艺管理模块里在用
|
|
|
|
|
subase: "/pms/equipmentTechParam",
|
|
|
|
|
subpage: "/pms/equipmentTechParam/page",
|
2023-02-23 17:02:18 +08:00
|
|
|
|
copyUrl: "/pms/equipmentTech/copy",
|
2023-01-16 11:08:54 +08:00
|
|
|
|
// more...
|
2023-02-22 17:04:11 +08:00
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|