update 物料配方“
This commit is contained in:
parent
7d0c66ad73
commit
0f0226eaa1
@ -61,6 +61,9 @@
|
|||||||
<el-row v-for="(row, rowIndex) in configs.form.rows" :key="'row_' + rowIndex" :gutter="20">
|
<el-row v-for="(row, rowIndex) in configs.form.rows" :key="'row_' + rowIndex" :gutter="20">
|
||||||
<el-col v-for="(col, colIndex) in row" :key="colIndex" :span="24 / row.length">
|
<el-col v-for="(col, colIndex) in row" :key="colIndex" :span="24 / row.length">
|
||||||
<el-form-item :label="col.label" :prop="col.prop" :rules="col.rules || null">
|
<el-form-item :label="col.label" :prop="col.prop" :rules="col.rules || null">
|
||||||
|
<div v-if="col.forceDisabled" class="force-disabled">
|
||||||
|
<el-tag :key="col.key" :type="col.type">{{ dataForm[col.prop] || "-" }}</el-tag>
|
||||||
|
</div>
|
||||||
<el-input v-if="col.input" v-model="dataForm[col.prop]" clearable :disabled="disableCondition(col.prop)" v-bind="col.elparams" />
|
<el-input v-if="col.input" v-model="dataForm[col.prop]" clearable :disabled="disableCondition(col.prop)" v-bind="col.elparams" />
|
||||||
<el-cascader
|
<el-cascader
|
||||||
v-if="col.cascader"
|
v-if="col.cascader"
|
||||||
@ -449,7 +452,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.loadingStatus = false;
|
this.loadingStatus = false;
|
||||||
// 是否要跳转到附件页
|
// 是否要跳转到附件页
|
||||||
if (menu && menu.key === "attachment") {
|
if (menu && menu.key) {
|
||||||
this.activeMenu = this.configs.menu.find((item) => item.key === menu.key)?.name;
|
this.activeMenu = this.configs.menu.find((item) => item.key === menu.key)?.name;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -881,4 +884,8 @@ ul.file-list > li:hover {
|
|||||||
|
|
||||||
/* .image-preview-dialog {
|
/* .image-preview-dialog {
|
||||||
} */
|
} */
|
||||||
|
|
||||||
|
.force-disabled {
|
||||||
|
margin-top: 42px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -210,4 +210,8 @@ export default {
|
|||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.2);
|
box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.a-small-dialog >>> .el-select {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -31,6 +31,7 @@ export default {
|
|||||||
// viewAttr: i18n.t('viewattr'),
|
// viewAttr: i18n.t('viewattr'),
|
||||||
// preview: i18n.t('preview'),
|
// preview: i18n.t('preview'),
|
||||||
// design: i18n.t('design'),
|
// design: i18n.t('design'),
|
||||||
|
copy: '复制',
|
||||||
edit: '编辑',
|
edit: '编辑',
|
||||||
detail: '详情',
|
detail: '详情',
|
||||||
delete: '删除',
|
delete: '删除',
|
||||||
|
@ -216,15 +216,45 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: `${res.code}: ${res.msg}`,
|
message: `${res.code}: ${res.msg}`,
|
||||||
type: 'error',
|
type: "error",
|
||||||
duration: 1500
|
duration: 1500,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "view-attachment": {
|
case "view-attachment": {
|
||||||
this.openDialog(data, false, { key: "attachment" });
|
this.openDialog(data, false, { key: "attachment" });
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "view-recipe": {
|
||||||
|
this.openDialog(data, false, { key: "attr" });
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "copy": {
|
||||||
|
return this.$http
|
||||||
|
.post(this.urls.copyUrl, data, {
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then(({ data: res }) => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.$message({
|
||||||
|
message: "复制成功!",
|
||||||
|
type: "success",
|
||||||
|
duration: 1500,
|
||||||
|
});
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((errMsg) => {
|
||||||
|
this.$message({
|
||||||
|
message: errMsg,
|
||||||
|
type: "error",
|
||||||
|
duration: 1500,
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -237,17 +267,24 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case "查询": {
|
case "查询": {
|
||||||
const params = {};
|
const params = {};
|
||||||
this.listQueryExtra?.map(cond => {
|
this.listQueryExtra?.map((cond) => {
|
||||||
if (!!payload[cond]) {
|
if (!!payload[cond]) {
|
||||||
params[cond] = payload[cond]
|
params[cond] = payload[cond];
|
||||||
} else {
|
} else {
|
||||||
params[cond] = ''
|
params[cond] = "";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log("查询", params);
|
console.log("查询", params);
|
||||||
this.getList(params);
|
this.getList(params);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case "同步":
|
||||||
|
this.$http.post(this.urls.syncUrl).then(({ data: res }) => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
|
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
|
||||||
import TableTextComponent from "@/components/noTemplateComponents/detailComponent";
|
import TableTextComponent from "@/components/noTemplateComponents/detailComponent";
|
||||||
import { timeFilter, dictFilter } from "@/utils/filters";
|
import { timeFilter, dictFilter } from "@/utils/filters";
|
||||||
import switchBtn from "@/components/noTemplateComponents/switchBtn";
|
// import switchBtn from "@/components/noTemplateComponents/switchBtn";
|
||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
@ -13,8 +13,8 @@ export default function () {
|
|||||||
// { prop: "specifications", label: "程序号" },
|
// { prop: "specifications", label: "程序号" },
|
||||||
// { prop: "unitDictValue", label: "砖型", filter: dictFilter("unit") },
|
// { prop: "unitDictValue", label: "砖型", filter: dictFilter("unit") },
|
||||||
// { prop: "unitDictValue", label: "物料号", filter: dictFilter("unit") },
|
// { prop: "unitDictValue", label: "物料号", filter: dictFilter("unit") },
|
||||||
{ prop: "enabled", label: "状态", subcomponent: switchBtn }, // subcomponent
|
// { prop: "enabled", label: "状态", subcomponent: switchBtn }, // subcomponent
|
||||||
{ prop: "sumqty", label: "配方总重量" },
|
{ prop: "sumqty", label: "配方总重量[kg]", filter: val => !!val ? val + ' kg' : '-' },
|
||||||
{ prop: "sync", label: "同步状态" },
|
{ prop: "sync", label: "同步状态" },
|
||||||
{ prop: "remark", label: "备注" },
|
{ prop: "remark", label: "备注" },
|
||||||
{ prop: "description", label: "详情", subcomponent: TableTextComponent, buttonContent: "查看配方详情", actionName: 'view-recipe' },
|
{ prop: "description", label: "详情", subcomponent: TableTextComponent, buttonContent: "查看配方详情", actionName: 'view-recipe' },
|
||||||
@ -22,9 +22,9 @@ export default function () {
|
|||||||
prop: "operations",
|
prop: "operations",
|
||||||
name: "操作",
|
name: "操作",
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 120,
|
width: 160,
|
||||||
subcomponent: TableOperaionComponent,
|
subcomponent: TableOperaionComponent,
|
||||||
options: ["edit", { name: "delete", emitFull: true, permission: "pms:bom:delete" }],
|
options: ["copy", "edit", { name: "delete", emitFull: true, permission: "pms:bom:delete" }],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -49,6 +49,13 @@ export default function () {
|
|||||||
permission: "pms:bom:save",
|
permission: "pms:bom:save",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
button: {
|
||||||
|
// type: "plain",
|
||||||
|
name: "同步",
|
||||||
|
type: 'primary'
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const dictList = JSON.parse(localStorage.getItem("dictList") || {});
|
const dictList = JSON.parse(localStorage.getItem("dictList") || {});
|
||||||
@ -106,9 +113,11 @@ export default function () {
|
|||||||
elparams: { placeholder: "请输入版本号" },
|
elparams: { placeholder: "请输入版本号" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: true,
|
// input: true,
|
||||||
|
forceDisabled: true,
|
||||||
label: "同步状态",
|
label: "同步状态",
|
||||||
prop: "sync",
|
prop: "sync",
|
||||||
|
key: 'sync',
|
||||||
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
||||||
elparams: { placeholder: "请输入同步状态" },
|
elparams: { placeholder: "请输入同步状态" },
|
||||||
},
|
},
|
||||||
@ -129,9 +138,9 @@ export default function () {
|
|||||||
{ type: "index", label: "序号" },
|
{ type: "index", label: "序号" },
|
||||||
{ prop: "createTime", label: "添加时间", filter: timeFilter },
|
{ prop: "createTime", label: "添加时间", filter: timeFilter },
|
||||||
{ prop: "material", label: "物料", isEditField: true },
|
{ prop: "material", label: "物料", isEditField: true },
|
||||||
{ prop: "qty", label: "配方物料重量", isEditField: true },
|
{ prop: "qty", label: "配方物料重量[kg]", filter: val => !!val ? val + ' kg' : '-', isEditField: true },
|
||||||
{ prop: "sumqty", label: "配方总重量", isEditField: true },
|
{ prop: "sumqty", label: "配方总重量[kg]", filter: val => !!val ? val + ' kg' : '-', isEditField: true },
|
||||||
{ prop: "percent", label: "配比", isEditField: true },
|
{ prop: "percent", label: "配比[%]", filter: val => !!val ? val + ' %' : '-', isEditField: true },
|
||||||
{ prop: "remark", label: "备注", isEditField: true },
|
{ prop: "remark", label: "备注", isEditField: true },
|
||||||
{
|
{
|
||||||
prop: "operations",
|
prop: "operations",
|
||||||
@ -186,7 +195,7 @@ export default function () {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: true,
|
input: true,
|
||||||
label: "物料重量",
|
label: "物料重量[kg]",
|
||||||
prop: "qty",
|
prop: "qty",
|
||||||
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
||||||
elparams: { placeholder: "请输入物料重量" },
|
elparams: { placeholder: "请输入物料重量" },
|
||||||
@ -214,6 +223,8 @@ export default function () {
|
|||||||
urls: {
|
urls: {
|
||||||
base: "/pms/bom",
|
base: "/pms/bom",
|
||||||
page: "/pms/bom/page",
|
page: "/pms/bom/page",
|
||||||
|
syncUrl: "/pms/bom/sync",
|
||||||
|
copyUrl: "/pms/bom/copy",
|
||||||
subase: "/pms/bomMaterial",
|
subase: "/pms/bomMaterial",
|
||||||
subpage: "/pms/bomMaterial/page",
|
subpage: "/pms/bomMaterial/page",
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user