This commit is contained in:
lb 2023-03-14 16:17:03 +08:00
parent df9a9a04da
commit 183335f9fe
4 changed files with 22 additions and 147 deletions

View File

@ -81,6 +81,10 @@ export default {
type: Object, type: Object,
default: () => null, default: () => null,
}, },
triggerUpdate: {
type: String,
default: ''
}
}, },
computed: { computed: {
dialogType() { dialogType() {
@ -91,6 +95,14 @@ export default {
console.log("list view with ehad activated.........."); console.log("list view with ehad activated..........");
this.refreshLayoutKey = this.layoutTable(); this.refreshLayoutKey = this.layoutTable();
}, },
watch: {
triggerUpdate(val, oldVal) {
if (val && val !== oldVal) {
// get list
this.getList()
}
}
},
data() { data() {
return { return {
DIALOG_WITH_MENU, DIALOG_WITH_MENU,

View File

@ -7,7 +7,6 @@ export default function () {
const tableProps = [ const tableProps = [
{ type: "index", label: "序号" }, { type: "index", label: "序号" },
{ width: 160, prop: "createTime", label: "添加时间", filter: timeFilter }, { width: 160, prop: "createTime", label: "添加时间", filter: timeFilter },
// { prop: "kilnCode", label: "窑炉" },
{ prop: "batchNo", label: "批次编码" }, { prop: "batchNo", label: "批次编码" },
{ prop: "batchSize", label: "批次重量 [kg]" }, { prop: "batchSize", label: "批次重量 [kg]" },
{ prop: "status", label: "状态" }, { prop: "status", label: "状态" },
@ -25,37 +24,21 @@ export default function () {
// { prop: "remark", label: "备注" }, // { prop: "remark", label: "备注" },
// { prop: 'version', label: '配方号' }, // { prop: 'version', label: '配方号' },
// { prop: 'status', label: '状态', subcomponent: StatusComponent }, // subcomponent // { prop: 'status', label: '状态', subcomponent: StatusComponent }, // subcomponent
// { prop: "description", label: "详情", subcomponent: TableTextComponent }, { prop: "description", label: "详情", subcomponent: TableTextComponent },
{ {
prop: "operations", prop: "operations",
name: "操作", name: "操作",
fixed: "right", fixed: "right",
width: 160, width: 160,
subcomponent: TableOperaionComponent, subcomponent: TableOperaionComponent,
options: ['add', 'edit', 'detail'] // , url: '/pms/trans/pressDeli' }] options: ['add', 'edit']
// options: ["copy", "edit", { name: "delete", emitFull: true, permission: "pms:blenderStep:delete" }],
}, },
]; ];
const headFormFields = [ const headFormFields = [
// {
// prop: "code",
// label: "主订单号",
// input: true,
// default: { value: "" },
// bind: {
// placeholder: "请输入主订单号查询",
// },
// },
{ {
label: '订单批次' label: '订单批次'
}, },
// {
// button: {
// type: "primary",
// name: "查询",
// },
// },
{ {
button: { button: {
type: "plain", type: "plain",
@ -65,129 +48,6 @@ export default function () {
}, },
]; ];
// const dialogConfigs = {
// extraIds: { wsId: 3 }, // 工艺管理里面的相关模块的 dialogWithMenu 需要额外的工序 id
// 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: "bomId",
// options: [],
// 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, externalCode: '', key: '', techId } }),
// },
// ],
// // [
// // {
// // forceDisabled: true,
// // prop: 'bomCode',
// // label: '当前配方'
// // },
// // ],
// [{ 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 },
// // { prop: "specifications", label: "规格", isEditField: true },
// { prop: "value", label: "参数值", isEditField: true },
// { prop: "valueFloor", label: "参数值下限", isEditField: true },
// { prop: "valueTop", label: "参数值上限", isEditField: true },
// { prop: "description", 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: "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 { return {
// dialogConfigs, // dialogConfigs,
tableConfig: { tableConfig: {
@ -203,9 +63,6 @@ export default function () {
page: "/pms/blenderBatch/pageView", page: "/pms/blenderBatch/pageView",
// pageIsPostApi: true, // 使用post接口来获取page数据极少用目前基本上只有工艺管理模块里在用 // pageIsPostApi: true, // 使用post接口来获取page数据极少用目前基本上只有工艺管理模块里在用
// subase: "/pms/equipmentTechParam", // subase: "/pms/equipmentTechParam",
// subpage: "/pms/equipmentTechParam/page",
// copyUrl: "/pms/equipmentTech/copy",
// more...
}, },
}; };
} }

View File

@ -4,6 +4,7 @@
:head-config="headFormConfigs" :head-config="headFormConfigs"
:dialog-configs="dialogConfigs" :dialog-configs="dialogConfigs"
:list-query-extra="[{ blenderOrderId: id }]" :list-query-extra="[{ blenderOrderId: id }]"
:trigger-update="triggerUpdateKey"
/> />
</template> </template>
@ -46,12 +47,16 @@ export default {
headFormConfigs, headFormConfigs,
allUrls: urls, allUrls: urls,
dialogConfigs, dialogConfigs,
triggerUpdateKey: ''
}; };
}, },
watch: { watch: {
$route: { $route: {
handler: val => { handler: function (val) {
console.log('$route', val) if (val.params.id) {
this.triggerUpdateKey = Math.random().toString()
console.log('[$oute changed] val.params.id', val.params.id, this.triggerUpdateKey)
}
}, },
immediate: true, immediate: true,
deep: true deep: true

View File

@ -1,5 +1,6 @@
<template> <template>
<ListViewWithHead <ListViewWithHead
key="blender-order"
:table-config="tableConfig" :table-config="tableConfig"
:head-config="headFormConfigs" :head-config="headFormConfigs"
:dialog-configs="dialogConfigs" :dialog-configs="dialogConfigs"