pms-aomei/src/views/modules/pms/blenderBatch/config.js

107 lines
4.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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: "序号" },
{ width: 160, prop: "createTime", label: "添加时间", filter: timeFilter },
{ prop: "batchNo", label: "批次编码" },
{ prop: "batchSize", label: "批次重量 [kg]" },
{ prop: "status", label: "状态" },
{ prop: "startTime", label: "开始时间" },
{ prop: "task", label: "任务分类" },
{ prop: "blenderCode", label: "混料机" },
// { width: 120, prop: "orderCate", label: "主订单子号" },
// { width: 160, prop: "code", label: "压制订单号" },
// { prop: "statusDictValue", label: "订单状态", filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝"][val] : "-"), },
// { width: 120, prop: "qty", label: "要求生产数量" },
// { prop: "qtyComplete", label: "完成数量" },
// { prop: "percent", label: "完成进度", filter: (val) => (val !== null && val !== undefined ? val + " %" : "-") },
// { prop: "goodqty", label: "合格数量" },
// { width: 120, prop: "badqty", label: "不合格数量" },
// { prop: "remark", label: "备注" },
// { prop: 'version', label: '配方号' },
// { prop: 'status', label: '状态', subcomponent: StatusComponent }, // subcomponent
{ prop: "description", label: "详情", subcomponent: TableTextComponent, actionName: 'view-blender-batch-details' },
{
prop: "operations",
name: "操作",
fixed: "right",
width: 90,
subcomponent: TableOperaionComponent,
options: [
// 只有 injectRow.task 为手动时,才允许编辑
// { name:"edit", label: "编辑", icon: "edit-outline", enable: injectRow => { return 'task' in injectRow && injectRow.task === 'Manual' } },
// { name: 'delete', icon: 'delete', enable: injectRow => { return 'task' in injectRow && injectRow.task === 'Manual' } },
// 只有 injectRow.status 为 waiting 时,才允许编辑
{ name:"edit", label: "编辑", icon: "edit-outline", enable: injectRow => { return 'status' in injectRow && injectRow.status === 'Waiting' } },
{ name: 'delete', icon: 'delete', emitFull: true, promptField: 'batchNo', enable: injectRow => { return 'status' in injectRow && injectRow.status === 'Waiting' } },
]
},
];
const headFormFields = [
{
label: '订单批次'
},
{
button: {
type: "plain",
name: "新增",
permission: "",
},
},
];
const dialogJustFormConfigs = {
// extra blenderOrderId
// extraIds: {},
form: {
rows: [
[
{
input: true,
label: "批次编码",
prop: "batchNo",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入批次编码" },
},
{
input: true,
label: "批次重量",
prop: "batchSize",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入批次重量" },
},
],
],
operations: [
{ name: "add", label: "保存", type: "primary", permission: "", showOnEdit: false },
{ name: "update", label: "更新", type: "primary", permission: "", showOnEdit: true },
{ name: "reset", label: "重置", type: "warning", showAlways: true },
],
},
};
return {
dialogConfigs: dialogJustFormConfigs,
tableConfig: {
table: null, // 此处可省略el-table 上的配置项
column: tableProps, // el-column-item 上的配置项
},
headFormConfigs: {
rules: null, // 名称是由 BaseSearchForm.vue 组件固定的
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
},
urls: {
base: "/pms/blenderBatch",
page: "/pms/blenderBatch/pageView",
// pageIsPostApi: true, // 使用post接口来获取page数据极少用目前基本上只有工艺管理模块里在用
// subase: "/pms/equipmentTechParam",
},
};
}