336 lines
12 KiB
JavaScript
336 lines
12 KiB
JavaScript
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: "kilnCode", label: "窑炉" },
|
||
{ width: 128, prop: "orderCode", label: "主订单号" },
|
||
{ width: 60, prop: "orderCate", label: "子号" },
|
||
// { width: 128, prop: "code", label: "混料订单号" },
|
||
{
|
||
width: 80,
|
||
prop: "percent",
|
||
label: "进度",
|
||
filter: (val) => (val !== null && val !== undefined ? val + " %" : "-"),
|
||
},
|
||
{
|
||
prop: "statusDictValue",
|
||
label: "订单状态",
|
||
filter: (val) =>
|
||
val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][val] : "-",
|
||
},
|
||
// { prop: "startTime", label: "开始时间" },
|
||
// { prop: "shapeCode", label: "砖型" },
|
||
{ prop: "bomCode", label: "配方" },
|
||
{ width: 180, prop: "bomName", label: "牌号" },
|
||
{ width: 60, prop: "ai", label: "版本" },
|
||
{ width: 120, prop: "qty", label: "混料总量 [kg]" },
|
||
{ width: 120, prop: "comqty", label: "已完成量 [kg]" },
|
||
{ prop: "blenderCode", label: "混料机" },
|
||
{ width: 160, prop: "createTime", label: "添加时间", filter: timeFilter },
|
||
// { width: 120, prop: "badqty", label: "不合格数量" },
|
||
// { prop: "remark", label: "备注" },
|
||
// { prop: 'version', label: '配方号' },
|
||
// { prop: 'status', label: '状态', subcomponent: StatusComponent }, // subcomponent
|
||
// { prop: "description", label: "详情", subcomponent: TableTextComponent },
|
||
{
|
||
prop: "operations",
|
||
name: "操作",
|
||
fixed: "right",
|
||
width: 210,
|
||
subcomponent: TableOperaionComponent,
|
||
options: [
|
||
{
|
||
name: "edit",
|
||
label: "编辑",
|
||
emitFull: true,
|
||
icon: "edit-outline",
|
||
enable: (injectData) => {
|
||
const v = injectData.statusDictValue;
|
||
if (v && +v === 1) return true;
|
||
return false;
|
||
},
|
||
},
|
||
{
|
||
name: "view-batch",
|
||
label: "查看批次",
|
||
color: "#ff8000",
|
||
toRouter: "pms-blenderBatch",
|
||
icon: "document-copy",
|
||
}, // 路由跳转至 pms-blenderBatch
|
||
{ name: "detach", label: "下发", color: "#099", icon: "bottom-right" },
|
||
{ name: "start-blender", label: "开始", color: "#0b58ff", icon: "video-play" },
|
||
{ name: "pause-blender", label: "暂停", color: "#f10000", icon: "video-pause" },
|
||
],
|
||
},
|
||
];
|
||
|
||
const headFormFields = [
|
||
{
|
||
prop: "code",
|
||
label: "主订单号",
|
||
input: true,
|
||
default: { value: "" },
|
||
bind: {
|
||
placeholder: "请输入主订单号查询",
|
||
},
|
||
},
|
||
{
|
||
prop: "cate",
|
||
label: "主订单子号",
|
||
input: true,
|
||
default: { value: "" },
|
||
bind: {
|
||
placeholder: "请输入主订单子号查询",
|
||
},
|
||
},
|
||
// {
|
||
// prop: "bom",
|
||
// label: "配方号",
|
||
// input: true,
|
||
// default: { value: "" },
|
||
// bind: {
|
||
// placeholder: "请输入配方号",
|
||
// },
|
||
// },
|
||
{
|
||
prop: "viewType",
|
||
label: "状态",
|
||
select: [
|
||
{ value: 0, label: "未结束" },
|
||
{ value: 1, label: "结束" },
|
||
{ value: 2, label: "全部" },
|
||
],
|
||
default: { value: 0 },
|
||
},
|
||
{
|
||
prop: "blenderId",
|
||
label: "混料机",
|
||
select: [
|
||
{ value: 3, label: "M1" },
|
||
{ value: 4, label: "M2" },
|
||
{ value: null, label: "全部" },
|
||
],
|
||
default: { value: null },
|
||
},
|
||
{
|
||
button: {
|
||
type: "primary",
|
||
name: "查询",
|
||
},
|
||
},
|
||
// {
|
||
// button: {
|
||
// type: "plain",
|
||
// name: "新增",
|
||
// permission: "pms:blenderStep:save",
|
||
// },
|
||
// },
|
||
];
|
||
|
||
const dialogConfigs = {
|
||
form: {
|
||
rows: [
|
||
[
|
||
{
|
||
forceDisabled: true,
|
||
prop: "code",
|
||
label: "混料订单号",
|
||
},
|
||
],
|
||
[
|
||
{
|
||
select: true,
|
||
label: "配方",
|
||
prop: "bomId",
|
||
options: [],
|
||
optionLabelProp: "code",
|
||
/** ====== */
|
||
fetchData: (bomCode) =>
|
||
this.$http.get("/pms/bom/pageVersion", { params: { key: bomCode, limit: 999, page: 1 } }),
|
||
fetchDataParam: "bomCode",
|
||
delayRequest: true,
|
||
/** ====== */
|
||
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
||
elparams: { clearable: true, filterable: true, placeholder: "请选择配方" },
|
||
},
|
||
],
|
||
[
|
||
{
|
||
select: true,
|
||
label: "混料机",
|
||
prop: "blender",
|
||
options: [],
|
||
optionLabelProp: "code",
|
||
fetchData: () => this.$http.get("/pms/equipment/list", { params: { workSequenceName: "混料工序" } }),
|
||
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
||
elparams: { clearable: true, filterable: true, 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 },
|
||
],
|
||
},
|
||
};
|
||
|
||
// 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: { 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: {
|
||
"cell-class-name": ({ row, column, rowIndex, columnIndex }) => {
|
||
if ("statusDictValue" in row && row.statusDictValue == "2") {
|
||
return "cell-in-production";
|
||
}
|
||
},
|
||
},
|
||
column: tableProps, // el-column-item 上的配置项
|
||
},
|
||
headFormConfigs: {
|
||
rules: null, // 名称是由 BaseSearchForm.vue 组件固定的
|
||
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
|
||
},
|
||
urls: {
|
||
// base: "/pms/equipmentTech",
|
||
page: "/pms/blenderOrder/pageView",
|
||
detach: "/pms/trans/blenderDeli",
|
||
pauseBlender: "/pms/trans/blenderPause",
|
||
startBlender: "/pms/trans/blenderStart",
|
||
pageIsPostApi: true, // 使用post接口来获取page数据,极少用,目前基本上只有工艺管理模块里在用
|
||
changeBlender: "/pms/order/changeBlender",
|
||
// subase: "/pms/equipmentTechParam",
|
||
// subpage: "/pms/equipmentTechParam/page",
|
||
// copyUrl: "/pms/equipmentTech/copy",
|
||
// more...
|
||
},
|
||
};
|
||
}
|