add 配方详情

This commit is contained in:
lb
2023-03-20 16:57:46 +08:00
parent 98e92059ce
commit f6066eaccf
10 changed files with 644 additions and 83 deletions

View File

@@ -8,16 +8,18 @@ export default function () {
{ type: "index", label: "序号" },
{ prop: "createTime", label: "添加时间", filter: timeFilter },
{ prop: "name", label: "牌号" },
{ prop: "code", label: "配方编码" },
{ prop: "externalCode", label: "版本号" },
// { prop: "code", label: "配方编码" },
// { prop: "externalCode", label: "版本号" },
// { prop: "specifications", label: "程序号" },
// { prop: "unitDictValue", label: "砖型", filter: dictFilter("unit") },
// { prop: "unitDictValue", label: "物料号", filter: dictFilter("unit") },
// { prop: "enabled", label: "状态", subcomponent: switchBtn }, // subcomponent
{ prop: "sumqty", label: "配方总重量[kg]", filter: val => !!val ? val + ' kg' : '-' },
{ prop: "sync", label: "同步状态" },
{ prop: "remark", label: "备注" },
{ prop: "description", label: "详情", subcomponent: TableTextComponent, buttonContent: "查看配方详情", actionName: 'view-recipe' },
// { prop: "sumqty", label: "配方总重量[kg]", filter: val => !!val ? val + ' kg' : '-' },
// { prop: "sync", label: "同步状态" },
// { prop: "syncTime", label: "同步时间", fitler: timeFilter },
// { prop: "remark", label: "备注" },
// { prop: "description", label: "详情", subcomponent: TableTextComponent, buttonContent: "查看配方详情", actionName: 'view-recipe' },
{ prop: "description", label: "配方", subcomponent: TableTextComponent, buttonContent: "查看配方", actionName: 'view-recipe' },
{
prop: "operations",
name: "操作",
@@ -45,17 +47,24 @@ export default function () {
{
button: {
type: "plain",
name: "新增",
permission: "pms:bom:save",
},
},
{
button: {
// type: "plain",
name: "同步",
type: 'primary'
name: "导入",
permission: "",
},
},
// {
// button: {
// type: "plain",
// name: "新增",
// permission: "pms:bom:save",
// },
// },
// {
// button: {
// // type: "plain",
// name: "同步",
// type: 'primary'
// },
// },
];
const dictList = JSON.parse(localStorage.getItem("dictList") || {});

View File

@@ -0,0 +1,93 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
// import switchBtn from "@/components/noTemplateComponents/switchBtn";
import request from "@/utils/request";
import { dictFilter } from '@/utils/filters'
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: "typeDictValue", label: "料仓类型", filter: dictFilter('liaocang') },
// { prop: "enabled", label: "状态", subcomponent: switchBtn }, // subcomponent
{ prop: "materialTypeDictValue", label: "物料类型", filter: dictFilter('material_category') },
{ prop: "density", label: "物料堆积密度" },
{ prop: "dosHigh", label: "加料上限" },
{ prop: "dosLow", label: "加料下限" },
{ prop: "description", label: "描述" },
{ prop: "remark", label: "备注" },
{
prop: "operations",
name: "操作",
fixed: "right",
width: 90,
subcomponent: TableOperaionComponent,
options: [{ name: "edit", label: "编辑", icon: "edit-outline" }, { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:materialStorage:delete" }],
},
];
/**
* dialog config 有两个版本,一个适用于 DialogWithMenu 组件,另一个适用于 DialogJustForm 组件
* 适用于 DialogWithMenu 组件的配置示例详见 blenderStep/config.js
* 此为后者的配置:
*/
const dialogJustFormConfigs = {
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: "typeDictValue",
// fetchData: () => this.$http.get("/pms/factory/page", { params: { limit: 999, page: 1 } }),
options: [
// TODO: 或许映射可以全权交给数据字典
{ label: '中间仓', value: '0' },
{ label: '日料仓', value: '1' },
],
rules: { required: true, message: "必填项不能为空", trigger: "change" },
},
],
[{ textarea: true, label: "描述信息", prop: "description", elparams: { placeholder: "描述信息" } }],
[{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
],
operations: [
{ name: "add", label: "保存", type: "primary", permission: "pms:materialStorage:save", showOnEdit: false },
{ name: "update", label: "更新", type: "primary", permission: "pms:materialStorage:update", showOnEdit: true },
{ name: "reset", label: "重置", type: "warning", showAlways: true },
// { name: 'cancel', label: '取消', showAlways: true },
],
},
};
// 备注:弹窗弹出的时间和网速有关......
return {
dialogConfigs: dialogJustFormConfigs,
tableConfig: {
table: null, // 此处可省略el-table 上的配置项
column: tableProps, // el-column-item 上的配置项
},
urls: {
base: "/pms/materialStorageDynamic",
page: "/pms/materialStorageDynamic/page",
// subase: '/pms/blenderStepParam',
// subpage: '/pms/blenderStepParam/page',
// more...
},
};
}

View File

@@ -0,0 +1,31 @@
<template>
<ListView :table-config="tableConfig" :dialog-configs="dialogConfigs" :listQueryExtra="['name']" />
</template>
<script>
import initConfig from './config';
import ListView from '@/views/atomViews/ListView.vue';
export default {
name: 'BomDetailsView',
components: { ListView },
provide() {
return {
urls: this.allUrls
}
},
data() {
const { tableConfig, urls, dialogConfigs } = initConfig.call(this);
return {
tableConfig,
allUrls: urls,
dialogConfigs,
};
},
created() {},
mounted() {},
methods: {},
};
</script>
<style scoped></style>

View File

@@ -125,9 +125,9 @@ export default function () {
{ 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 },
{ width: 80, prop: "value", label: "参数值", isEditField: true },
// { prop: "valueFloor", label: "参数值下限", isEditField: true },
// { prop: "valueTop", label: "参数值上限", isEditField: true },
{ prop: "description", label: "描述", isEditField: true },
{
prop: "operations",

View File

@@ -130,9 +130,9 @@ export default function () {
{ 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 },
{ width: 80, prop: "value", label: "参数值", isEditField: true },
// { prop: "valueFloor", label: "参数值下限", isEditField: true },
// { prop: "valueTop", label: "参数值上限", isEditField: true },
{ prop: "description", label: "描述", isEditField: true },
{
prop: "operations",

View File

@@ -131,9 +131,9 @@ export default function () {
{ 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 },
{ width: 80, prop: "value", label: "参数值", isEditField: true },
// { prop: "valueFloor", label: "参数值下限", isEditField: true },
// { prop: "valueTop", label: "参数值上限", isEditField: true },
{ prop: "description", label: "描述", isEditField: true },
{
prop: "operations",