添加 bomTechAndFiring

This commit is contained in:
lb 2023-07-19 08:57:35 +08:00
parent 4c69135048
commit eaf91c90b9
6 changed files with 248 additions and 5 deletions

View File

@ -583,6 +583,8 @@ export default {
this.$http.get(this.urls.base + `/${this.dataForm.id}`).then(({ data: res }) => {
if (res && res.code === 0) {
const dataFormKeys = Object.keys(this.dataForm);
console.log('[DialogWithMenu] dataFormKeys -------->', dataFormKeys)
this.dataForm = __pick(res.data, dataFormKeys);
if ("files" in res.data) {
console.log("[DialogWithMenu] fileList===>", res.data.files, this.fileList);

View File

@ -334,6 +334,7 @@ export default {
.catch((err) => {});
}
case "edit": {
console.log("[edit] ",data)
this.openDialog(data); /** data is ==> id */
break;
}

View File

@ -0,0 +1,204 @@
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: "code", label: "配方号" },
{ prop: "name", label: "牌号" },
// { prop: "createTime", label: "添加时间", filter: timeFilter },
{ prop: "techCode", label: "烧制曲线" },
{ prop: "description", label: "详情", subcomponent: TableTextComponent },
// { prop: "remark", label: "备注" },
{
prop: "operations",
name: "操作",
fixed: "right",
width: 90,
subcomponent: TableOperaionComponent,
options: [
{ name: "edit", label: "编辑", icon: "edit-outline" },
// { name: "copy", label: "复制", icon: "copy-document" },
// { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "" },
],
},
];
const headFormFields = [
{
prop: "key",
label: "配方",
input: true,
default: { value: "" },
bind: {
placeholder: "请输入配方号",
},
},
{
prop: "tech",
label: "烧制曲线",
input: true,
default: { value: "" },
bind: {
placeholder: "请输入烧制曲线",
},
},
{
button: {
type: "primary",
name: "查询",
permission: "",
},
},
];
const dialogConfigs = {
allowAdd: false,
extraIds: { wsId: 3 }, // 工艺管理里面的相关模块的 dialogWithMenu 需要额外的工序 id
// excludeProps: ['code'], // 在add或update时不传递这个参数给后端
menu: [
{ name: "烧成曲线", key: "info" },
{ name: "工艺参数", key: "attr", onlyEditMode: true },
],
form: {
rows: [
[
{
input: true,
label: "配方",
prop: "bomId",
elparams: { placeholder: "请输入配方" },
},
],
[
{
select: true,
label: "工艺",
prop: "techId",
options: [],
fetchData: () =>
this.$http.post("/pms/equipmentTech/pageView", { wsId: 3, bom: "", key: "", limit: 999, page: 1 }),
// refreshOptionsAfterConfirm: true,
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { clearable: true, filterable: true, placeholder: "请选择工艺" },
// fetchData: (techId = -1) =>
// this.$http.get("/pms/bom/listUnR", { params: { wsId: 3, version: "", key: "", techId } }),
// cacheFetchedData: true,
// changeReflects: {
// fromKey: ["code", "version"],
// delimiter: "-",
// toProp: "code",
// },
},
// {
// input: true,
// autoDisabled: true,
// label: "工艺编码",
// prop: "code",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
// elparams: { placeholder: "请输入烧成曲线编码" },
// },
],
// [{ textarea: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
],
operations: [
{ name: "add", label: "保存", type: "primary", permission: "pms:firingStep:save", showOnEdit: false },
{ name: "update", label: "更新", type: "primary", permission: "pms:firingStep:update", showOnEdit: true },
{ name: "reset", label: "重置", type: "warning", showAlways: true },
// { name: 'cancel', label: '取消', showAlways: true },
],
},
table: {
extraParams: ["techId", "key"],
props: [
// { type: 'index', label: '序号' },
// { prop: "createTime", label: "添加时间", filter: timeFilter },
{ prop: "name", label: "参数名称", isEditField: true },
{ prop: "code", label: "参数编码", isEditField: true },
{ width: 80, prop: "value", label: "参数值", isEditField: true },
{ prop: "description", label: "描述", isEditField: true },
{
prop: "operations",
name: "操作",
fixed: "right",
width: 90,
subcomponent: TableOperaionComponent,
options: [
{ name: "edit", label: "编辑", icon: "edit-outline", permission: "pms:blenderStepParam:update" },
// { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:blenderStepParam:delete" },
],
},
],
data: [
// TOOD 暂时用不到,但获取可以考虑把拉取接口数据的函数迁移到此文件(没有太大必要)
],
},
subDialog: {
extraParam: "techId",
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: "valueTop", elparams: { placeholder: "请输入参数值上限" } },
{ input: true, label: "参数值下限", prop: "valueFloor", elparams: { placeholder: "请输入参数值下限" } },
],
[
{ input: true, label: "参数值", prop: "value", elparams: { placeholder: "请输入参数值" } },
{
input: true,
label: "描述",
prop: "description",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入描述" },
},
],
],
operations: [
{ name: "add", label: "保存", type: "primary", showOnEdit: false },
{ name: "update", label: "更新", type: "primary", showOnEdit: true },
// { 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/bomTech",
page: "/pms/bomTech/pageView",
// pageIsPostApi: true, // 使用post接口来获取page数据极少用目前基本上只有工艺管理模块里在用
subase: "/pms/equipmentTechParam",
subpage: "/pms/equipmentTechParam/page",
// copyUrl: "/pms/equipmentTech/copy",
// syncUrl: "/pms/trans/kilnSync"
// more...
},
};
}

View File

@ -0,0 +1,37 @@
<template>
<ListViewWithHead
:table-config="tableConfig"
:head-config="headFormConfigs"
:dialog-configs="dialogConfigs"
:list-query-extra="['key', 'tech']" />
<!-- :list-query-extra="['key', 'bom', { wsId: 3 }]" -->
</template>
<script>
import initConfig from "./config";
import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue";
export default {
name: "BomTechAndFiringView",
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>

View File

@ -392,15 +392,14 @@ export default {
break;
case "压制工艺":
//
alert("跳转至压制工艺页面");
// this.$router.push({ path: "/pms/pressing-process", query: { orderId: payload.id } });
this.$router.push({ name: "pms-shapeStep" });
break;
case "烧制曲线":
// 线
alert("跳转至烧制曲线页面");
this.$router.push({ name: "pms-firingStep" });
break;
case "检测工艺": //
alert("跳转至检测工艺页面");
this.$router.push({ name: "pms-testingStep" });
break;
}
},

View File

@ -12,7 +12,7 @@ import initConfig from "./config";
import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue";
export default {
name: "BlenderView",
name: "ShapeStepView",
components: { ListViewWithHead },
provide() {
return {