add 压制工艺

This commit is contained in:
lb 2023-02-22 16:11:50 +08:00
parent 921506bd78
commit 38323fdecf
5 changed files with 306 additions and 36 deletions

View File

@ -16,7 +16,7 @@
<div class="dialog-body__inner relative"> <div class="dialog-body__inner relative">
<!-- v-if="dataForm.id && !detailMode && /属性|详情/.test(activeMenu) && $hasPermission()" --> <!-- v-if="dataForm.id && !detailMode && /属性|详情/.test(activeMenu) && $hasPermission()" -->
<el-button <el-button
v-if="dataForm.id && !detailMode && /属性|详情/.test(activeMenu)" v-if="dataForm.id && !detailMode && /属性|详情|参数/.test(activeMenu)"
plain plain
type="primary" type="primary"
size="small" size="small"

View File

@ -121,16 +121,29 @@ export default {
}; };
if (!queryParams && this.listQueryExtra && this.listQueryExtra.length) { if (!queryParams && this.listQueryExtra && this.listQueryExtra.length) {
this.listQueryExtra.map((name) => { this.listQueryExtra.map((nameOrObj) => {
params[name] = ""; if (typeof nameOrObj === "string") params[nameOrObj] = "";
else if (typeof nameOrObj === "object") {
Object.keys(nameOrObj).forEach((key) => {
params[key] = nameOrObj[key];
});
}
}); });
} }
this.$http // if (this.urls.pageIsPostApi) {
.get(this.urls.page, { // } else {
// get page
this.$http[this.urls.pageIsPostApi ? "post" : "get"](
this.urls.page,
this.urls.pageIsPostApi
? {
...params,
}
: {
params, params,
}) }
.then(({ data: res }) => { ).then(({ data: res }) => {
console.log("[http response] res is: ", res); console.log("[http response] res is: ", res);
// page : // page :
@ -156,6 +169,7 @@ export default {
} }
this.tableLoading = false; this.tableLoading = false;
}); });
// }
}, },
layoutTable() { layoutTable() {
@ -268,11 +282,17 @@ export default {
case "查询": { case "查询": {
const params = {}; const params = {};
this.listQueryExtra?.map((cond) => { this.listQueryExtra?.map((cond) => {
if (typeof cond === "string") {
if (!!payload[cond]) { if (!!payload[cond]) {
params[cond] = payload[cond]; params[cond] = payload[cond];
} else { } else {
params[cond] = ""; params[cond] = "";
} }
} else if (typeof cond === 'object') {
Object.keys(cond).forEach(key => {
params[key] = cond[key]
})
}
}); });
console.log("查询", params); console.log("查询", params);
this.getList(params); this.getList(params);

View File

@ -82,10 +82,10 @@ export default function () {
}, },
{ {
input: true, input: true,
label: "物料编码", label: "配方编码",
prop: "code", prop: "code",
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入物料编码" }, elparams: { placeholder: "请输入配方编码" },
}, },
// { input: true, label: '版本号', prop: 'version', elparams: { placeholder: '请输入版本号' } }, // { input: true, label: '版本号', prop: 'version', elparams: { placeholder: '请输入版本号' } },
// { // {

View File

@ -0,0 +1,199 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
import TableTextComponent from "@/components/noTemplateComponents/detailComponent";
import StatusComponent from "@/components/noTemplateComponents/statusComponent";
import { timeFilter } from "@/utils/filters";
export default function () {
const tableProps = [
{ type: "index", label: "序号" },
{ prop: "createTime", label: "添加时间", filter: timeFilter },
{ prop: "name", label: "工艺名称" },
{ prop: "code", label: "工艺编码" },
// { prop: 'version', label: '配方号' },
{ prop: "shapeCode", label: "砖型" },
// { prop: 'status', label: '状态', subcomponent: StatusComponent }, // subcomponent
{ prop: "description", label: "详情", subcomponent: TableTextComponent },
{ prop: "remark", label: "备注" },
{
prop: "operations",
name: "操作",
fixed: "right",
width: 120,
subcomponent: TableOperaionComponent,
options: ["edit", { name: "delete", emitFull: true, permission: "pms:shapeStep:delete" }],
},
];
const headFormFields = [
{
prop: "key",
label: "工艺名称/编码",
input: true,
default: { value: "" },
bind: {
placeholder: "请输入工艺名称或编码",
},
},
{
prop: "shape",
label: "砖型",
input: true,
default: { value: "" },
bind: {
placeholder: "请输入砖型",
},
},
// {
// prop: 'bom',
// label: '配方号',
// input: true,
// default: { value: '' },
// bind: {
// placeholder: '请输入配方号'
// }
// },
{
button: {
type: "primary",
name: "查询",
},
},
{
button: {
type: "plain",
name: "新增",
permission: "pms:shapeStep:save",
},
},
];
const dialogConfigs = {
menu: [{ name: "压制工艺", key: 'info' }, { name: "工艺参数", key: 'attr', onlyEditMode: true }],
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: "请输入混料程序编码" },
},
{
select: true,
label: "砖型",
prop: "shape",
options: [],
elparams: { clearable: true, filterable: true, placeholder: "请选择砖型" },
fetchData: () => this.$http.get("/pms/shape/page", { params: { limit: 999, page: 1 } }),
},
],
[{ textarea: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
],
operations: [
{ name: "add", label: "保存", type: "primary", permission: "pms:shapeStep:save", showOnEdit: false },
{ name: "update", label: "更新", type: "primary", permission: "pms:shapeStep:update", showOnEdit: true },
{ name: "reset", label: "重置", type: "warning", showAlways: true },
// { name: 'cancel', label: '取消', showAlways: true },
],
},
table: {
extraParams: "techId ",
props: [
// { type: 'index', label: '序号' },
// { prop: "createTime", label: "添加时间", filter: timeFilter },
{ prop: "name", label: "参数名称", isEditField: true },
{ prop: "code", label: "参数编码", isEditField: true },
{ prop: "specifications", label: "规格", isEditField: true },
{ prop: "description", label: "描述", isEditField: true },
{ prop: "value", label: "设定值", isEditField: true },
{ prop: "valueFloor", label: "值下限", isEditField: true },
{ prop: "valueTop", label: "值上限", isEditField: true },
{
prop: "operations",
name: "操作",
fixed: "right",
width: 120,
subcomponent: TableOperaionComponent,
options: [
{ name: "edit", permission: "pms:blenderStepParam:update" },
{ name: "delete", emitFull: true, permission: "pms:blenderStepParam:delete" },
],
},
],
data: [
// TOOD 暂时用不到,但获取可以考虑把拉取接口数据的函数迁移到此文件(没有太大必要)
],
},
subDialog: {
extraParam: "stepId",
rows: [
[
{
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: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入描述" },
},
],
[
{ input: true, label: "参数值上限", prop: "valueTop", elparams: { placeholder: "请输入参数值上限" } },
{ input: true, label: "参数值下限", prop: "valueFloor", elparams: { placeholder: "请输入参数值下限" } },
],
[{ input: true, label: "参数值", prop: "value", elparams: { placeholder: "请输入参数值" } }],
],
operations: [
{ name: "add", label: "保存", type: "primary", permission: "pms:blenderStepParam:save", showOnEdit: false },
{ name: "update", label: "更新", type: "primary", permission: "pms:blenderStepParam:update", showOnEdit: true },
// { 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 组件固定的
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
},
urls: {
base: "/pms/equipmentTech",
page: "/pms/equipmentTech/pageView",
pageIsPostApi: true, // 使用post接口来获取page数据极少用目前基本上只有工艺管理模块里在用
subase: "/pms/equipmentTechParam",
subpage: "/pms/equipmentTechParam/page",
// more...
},
};
}

View File

@ -0,0 +1,51 @@
<template>
<ListViewWithHead
:table-config="tableConfig"
:head-config="headFormConfigs"
:dialog-configs="dialogConfigs"
:list-query-extra="['key', 'shape', { wsId: 2 }]"
/>
</template>
<script>
import initConfig from "./config";
import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue";
export default {
name: "BlenderView",
components: { ListViewWithHead },
provide() {
return {
urls: this.allUrls,
};
},
// urls: {
// type: Object,
// required: true,
// default: () => ({
// /** url **/ list: null,
// /** url **/ page: null,
// /** url **/ edit: null,
// /** url **/ delete: null,
// /** url **/ detail: null,
// /** url **/ export: null,
// /** url **/ import: null,
// /** url **/ other: null,
// }),
// },
data() {
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
return {
tableConfig,
headFormConfigs,
allUrls: urls,
dialogConfigs,
};
},
created() {},
mounted() {},
methods: {},
};
</script>
<style scoped></style>