This commit is contained in:
lb 2023-04-25 09:24:59 +08:00
parent f6fde4ba7b
commit 2ea77ba8fa

View File

@ -24,7 +24,7 @@ export default function () {
const operations = { const operations = {
ongoing: [ ongoing: [
// { name: 'confirm-order', label: '确认', icon: 'success', showText: true }, // { name: 'confirm-order', label: '确认', icon: 'success', showText: true },
{ name: 'view-ongoing', label: '查看详情', icon: 'view', emitFull: true }, { name: "view-ongoing", label: "查看详情", icon: "view", emitFull: true },
{ name: "end-order", label: "结束", icon: "finished" }, { name: "end-order", label: "结束", icon: "finished" },
{ name: "move-up", label: "上移", icon: "arrow-up" }, { name: "move-up", label: "上移", icon: "arrow-up" },
{ name: "move-down", label: "下移", icon: "arrow-down" }, { name: "move-down", label: "下移", icon: "arrow-down" },
@ -34,7 +34,7 @@ export default function () {
], ],
pending: [ pending: [
{ name: "edit", label: "编辑", icon: "edit-outline" }, { name: "edit", label: "编辑", icon: "edit-outline" },
{ name: 'view', label: '查看详情', icon: 'view' }, { name: "view", label: "查看详情", icon: "view" },
{ name: "confirm-order", label: "确认订单", icon: "success" }, { name: "confirm-order", label: "确认订单", icon: "success" },
{ name: "move-up", label: "上移", icon: "arrow-up" }, { name: "move-up", label: "上移", icon: "arrow-up" },
{ name: "move-down", label: "下移", icon: "arrow-down" }, { name: "move-down", label: "下移", icon: "arrow-down" },
@ -43,13 +43,14 @@ export default function () {
{ name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "" }, { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "" },
], ],
finished: [ finished: [
{ name: 'view-ongoing', label: '查看详情', icon: 'view', emitFull: true }, { name: "view-ongoing", label: "查看详情", icon: "view", emitFull: true },
// { name: 'view', label: '查看详情' } // { name: 'view', label: '查看详情' }
// { name: 'end-order', label: '结束订单', icon: 'error', showText: true }, // { name: 'end-order', label: '结束订单', icon: 'error', showText: true },
], ],
}; };
const startTimeProp = (type) => ({ const startTimeProp = (type) =>
({
ongoing: [ ongoing: [
{ width: 120, prop: "startTime", label: "开始时间", filter: timeFilter }, // "订单砖数" }, { width: 120, prop: "startTime", label: "开始时间", filter: timeFilter }, // "订单砖数" },
], ],
@ -57,7 +58,7 @@ export default function () {
finished: [ finished: [
{ width: 120, prop: "startTime", label: "开始时间", filter: timeFilter }, // "订单砖数" }, { width: 120, prop: "startTime", label: "开始时间", filter: timeFilter }, // "订单砖数" },
], ],
})[type]; }[type]);
const genTableProps = (type /** ongoing, pending, finished */) => [ const genTableProps = (type /** ongoing, pending, finished */) => [
{ width: 60, type: "index", label: "序号", fixed: true }, { width: 60, type: "index", label: "序号", fixed: true },
@ -98,7 +99,7 @@ export default function () {
subcomponent: TableOperaionComponent, subcomponent: TableOperaionComponent,
options: operations[type], options: operations[type],
width: operations[type].length > 1 ? operations[type].length * 35 : 90, width: operations[type].length > 1 ? operations[type].length * 35 : 90,
} },
// type !== "finished" // type !== "finished"
// ? { // ? {
@ -120,7 +121,7 @@ export default function () {
prop: "code", prop: "code",
input: true, input: true,
default: { value: "" }, default: { value: "" },
bind: { placeholder: "输入订单号" }, bind: { placeholder: "输入订单号" },
}, },
{ {
// 时间段 // 时间段
@ -147,7 +148,7 @@ export default function () {
label: "订单号", label: "订单号",
prop: "code", prop: "code",
input: true, input: true,
bind: { placeholder: "输入订单号" }, bind: { placeholder: "输入订单号" },
}, },
{ {
// 查询 // 查询
@ -183,7 +184,7 @@ export default function () {
label: "订单号", label: "订单号",
prop: "code", prop: "code",
input: true, input: true,
bind: { placeholder: "输入订单号" }, bind: { placeholder: "输入订单号" },
}, },
{ {
// 查询 // 查询
@ -215,7 +216,11 @@ export default function () {
return h( return h(
"span", "span",
{ style: { display: "block", marginTop: "0" } }, { style: { display: "block", marginTop: "0" } },
this.useBuiltin ? this.orderStatusMap[this.modelValue] ?? "-" : this.modelValue.toString().trim() === "" ? "-" : this.modelValue.toString() this.useBuiltin
? this.orderStatusMap[this.modelValue] ?? "-"
: this.modelValue.toString().trim() === ""
? "-"
: this.modelValue.toString()
); );
}, },
}; };
@ -225,7 +230,7 @@ export default function () {
form: { form: {
field: [ field: [
{ {
title: '生产订单', title: "生产订单",
rows: [ rows: [
[ [
{ {
@ -238,7 +243,7 @@ export default function () {
label: "订单号", label: "订单号",
prop: "code", prop: "code",
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "输入订单号" }, elparams: { placeholder: "输入订单号" },
}, },
{ {
input: true, input: true,
@ -246,39 +251,31 @@ export default function () {
prop: "cate", prop: "cate",
rules: [ rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" }, { required: true, message: "必填项不能为空", trigger: "blur" },
{ type: "number", message: "输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) }, { type: "number", message: "输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) },
], ],
elparams: { placeholder: "输入订单子号" }, elparams: { placeholder: "输入订单子号" },
}, },
{ {
datetime: true, datetime: true,
label: '计划开始时间', label: "计划开始时间",
prop: 'planStartTime', prop: "planStartTime",
rules: { rules: {
required: true, required: true,
message: "必填项不能为空", message: "必填项不能为空",
trigger: "blur" trigger: "blur",
}, },
elparams: { elparams: {
placeholder: "选择计划开始时间", placeholder: "选择计划开始时间",
type: 'datetime' type: "datetime",
}, },
}, },
] ],
] ],
}, },
{ {
title: '设备与参数', title: "设备与参数",
rows: [ rows: [
[ [
{
input: true,
label: "生产订单类型",
prop: "specifications",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入生产订单类型" },
},
{ {
select: true, select: true,
label: "压机", label: "压机",
@ -286,8 +283,8 @@ export default function () {
options: [], options: [],
optionLabel: "code", optionLabel: "code",
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
fetchData: () => this.$http.get("/pms/equipment/search", { params: { equipmentTypeCode: 'Press' } }), fetchData: () => this.$http.get("/pms/equipment/search", { params: { equipmentTypeCode: "Press" } }),
elparams: { placeholder: "选择压机", filterable: true }, elparams: { placeholder: "选择压机", filterable: true },
}, },
{ {
select: true, select: true,
@ -296,8 +293,8 @@ export default function () {
options: [], options: [],
optionLabel: "code", optionLabel: "code",
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
fetchData: () => this.$http.get("/pms/equipment/search", { params: { equipmentTypeCode: 'Mix' } }), fetchData: () => this.$http.get("/pms/equipment/search", { params: { equipmentTypeCode: "Mix" } }),
elparams: { placeholder: "选择混料机", filterable: true }, elparams: { placeholder: "选择混料机", filterable: true },
}, },
{ {
select: true, select: true,
@ -305,25 +302,32 @@ export default function () {
prop: "kiln", prop: "kiln",
options: [], options: [],
optionLabel: "code", optionLabel: "code",
fetchData: () => this.$http.get("/pms/equipment/search", { params: { equipmentTypeCode: 'Kiln' } }), fetchData: () => this.$http.get("/pms/equipment/search", { params: { equipmentTypeCode: "Kiln" } }),
elparams: { placeholder: "请选择隧道窑号", filterable: true }, elparams: { placeholder: "选择隧道窑", filterable: true },
},
{
input: true,
label: "Add on",
prop: "sapParam1",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "输入addon" },
}, },
], ],
[ [
{ {
select: true, select: true,
label: "牌号", label: "牌号",
prop: "bomId", prop: "bomId",
options: [], options: [],
// optionLabel: '', // optionLabel: '',
fetchData: () => this.$http.get("/pms/bom/page", { params: { limit: 999, page: 1, key: "", externalCode: "" } }), fetchData: () =>
elparams: { placeholder: "请选择牌号", filterable: true }, this.$http.get("/pms/bom/page", { params: { limit: 999, page: 1, key: "", externalCode: "" } }),
elparams: { placeholder: "选择牌号", filterable: true },
// TODO: 选择后,需要带出一些数据 // TODO: 选择后,需要带出一些数据
injectTo: [ injectTo: [
['bomCode', 'code'], ["bomCode", "code"],
['ai', 'externalCode'] ["ai", "externalCode"],
] ],
}, },
{ {
// input: true, // input: true,
@ -334,7 +338,7 @@ export default function () {
// optionLabel: 'code', // optionLabel: 'code',
// fetchData: () => this.$http.get("/pms/bom/page", { params: { limit: 999, page: 1, key: "" } }), // fetchData: () => this.$http.get("/pms/bom/page", { params: { limit: 999, page: 1, key: "" } }),
// rules: { required: true, message: "必填项不能为空", trigger: "blur" }, // rules: { required: true, message: "必填项不能为空", trigger: "blur" },
// elparams: { placeholder: "选择配方" }, // elparams: { placeholder: "选择配方" },
component: textOnlyComponent, component: textOnlyComponent,
bind: { bind: {
useBuiltin: false, useBuiltin: false,
@ -348,6 +352,21 @@ export default function () {
useBuiltin: false, useBuiltin: false,
}, },
}, },
{
select: true,
label: "包装代码",
prop: "packTech",
options: [],
optionLabel: "code",
fetchData: () =>
this.$http.post("/pms/equipmentTech/pageView", { limit: 999, page: 1, key: "", shape: "", wsId: 5 }),
// label: "单位",
// prop: "unitDictValue",
// options: dictList["unit"].map((u) => ({ label: u.dictLabel, value: u.dictValue })),
elparams: { placeholder: "选择包装代码", filterable: true },
},
],
[
{ {
select: true, select: true,
label: "物料", label: "物料",
@ -361,11 +380,8 @@ export default function () {
// label: "单位", // label: "单位",
// prop: "unitDictValue", // prop: "unitDictValue",
// options: dictList["unit"].map((u) => ({ label: u.dictLabel, value: u.dictValue })), // options: dictList["unit"].map((u) => ({ label: u.dictLabel, value: u.dictValue })),
elparams: { placeholder: "选择物料", filterable: true }, elparams: { placeholder: "选择物料", filterable: true },
}, },
],
[
{ {
select: true, select: true,
label: "砖型", label: "砖型",
@ -376,7 +392,7 @@ export default function () {
// label: "单位", // label: "单位",
// prop: "unitDictValue", // prop: "unitDictValue",
// options: dictList["unit"].map((u) => ({ label: u.dictLabel, value: u.dictValue })), // options: dictList["unit"].map((u) => ({ label: u.dictLabel, value: u.dictValue })),
elparams: { placeholder: "选择砖型", filterable: true }, elparams: { placeholder: "选择砖型", filterable: true },
}, },
{ {
input: true, input: true,
@ -384,9 +400,9 @@ export default function () {
prop: "sapParam6", prop: "sapParam6",
rules: [ rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" }, { required: true, message: "必填项不能为空", trigger: "blur" },
{ type: "number", message: "输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) }, { type: "number", message: "输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) },
], ],
elparams: { placeholder: "输入烧成温度" }, elparams: { placeholder: "输入烧成温度" },
}, },
{ {
input: true, input: true,
@ -394,39 +410,33 @@ export default function () {
prop: "sapParam7", prop: "sapParam7",
rules: [ rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" }, { required: true, message: "必填项不能为空", trigger: "blur" },
{ type: "number", message: "输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) }, { type: "number", message: "输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) },
], ],
elparams: { placeholder: "请输入烧成时间" }, elparams: { placeholder: "输入烧成时间" },
},
{
select: true,
label: "包装代码",
prop: "packTech",
options: [],
optionLabel: "code",
fetchData: () => this.$http.post("/pms/equipmentTech/pageView", { limit: 999, page: 1, key: "", shape: "", wsId: 5 }),
// label: "单位",
// prop: "unitDictValue",
// options: dictList["unit"].map((u) => ({ label: u.dictLabel, value: u.dictValue })),
elparams: { placeholder: "请选择物料", filterable: true },
}, },
], ],
] ],
}, },
{ {
title: '其他', title: "其他",
rows: [ rows: [
[ [
{
input: true,
label: "生产订单类型",
prop: "specifications",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "输入生产订单类型" },
},
{ {
input: true, input: true,
label: "生产订单砖数", label: "生产订单砖数",
prop: "prodqty", prop: "prodqty",
rules: [ rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" }, { required: true, message: "必填项不能为空", trigger: "blur" },
{ type: "number", message: "输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) }, { type: "number", message: "输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) },
], ],
elparams: { placeholder: "输入要求生产的数量" }, elparams: { placeholder: "输入要求生产的数量" },
}, },
{ {
input: true, input: true,
@ -435,9 +445,9 @@ export default function () {
// rules: { required: true, message: "必填项不能为空", trigger: "blur" }, // rules: { required: true, message: "必填项不能为空", trigger: "blur" },
rules: [ rules: [
// { required: true, message: "必填项不能为空", trigger: "blur" }, // { required: true, message: "必填项不能为空", trigger: "blur" },
{ type: "number", message: "输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) }, { type: "number", message: "输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) },
], ],
elparams: { placeholder: "输入已经生产的数量" }, elparams: { placeholder: "输入已经生产的数量" },
}, },
{ {
input: true, input: true,
@ -445,33 +455,25 @@ export default function () {
prop: "pcsKilnCar", prop: "pcsKilnCar",
rules: [ rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" }, { required: true, message: "必填项不能为空", trigger: "blur" },
{ type: "number", message: "输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) }, { type: "number", message: "输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) },
], ],
elparams: { placeholder: "请输入要求生产的数量" }, elparams: { placeholder: "输入托盘码放砖数" },
},
{
input: true,
label: "Add on",
prop: "sapParam1",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入addon" },
}, },
], ],
[ [
{ {
input: true, input: true,
label: "销售订单号", label: "销售订单号",
prop: "saleNo", prop: "saleNo",
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "输入销售订单号" }, elparams: { placeholder: "输入销售订单号" },
}, },
{ {
input: true, input: true,
label: "销售订单item号", label: "销售订单item号",
prop: "saleOrderItem", prop: "saleOrderItem",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" }, // rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "输入销售订单item号" }, elparams: { placeholder: "输入销售订单item号" },
}, },
{ {
input: true, input: true,
@ -479,9 +481,9 @@ export default function () {
prop: "soqty", prop: "soqty",
rules: [ rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" }, { required: true, message: "必填项不能为空", trigger: "blur" },
{ type: "number", message: "输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) }, { type: "number", message: "输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) },
], ],
elparams: { placeholder: "输入销售订单砖数" }, elparams: { placeholder: "输入销售订单砖数" },
}, },
{ {
// time // time
@ -489,7 +491,7 @@ export default function () {
label: "销售时间", label: "销售时间",
prop: "deliveryTime", prop: "deliveryTime",
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "选择销售时间" }, elparams: { placeholder: "选择销售时间" },
}, },
], ],
[ [
@ -501,21 +503,21 @@ export default function () {
optionLabel: "name", optionLabel: "name",
fetchData: () => this.$http.get("/pms/customer/page", { params: { limit: 999, page: 1, name: "" } }), fetchData: () => this.$http.get("/pms/customer/page", { params: { limit: 999, page: 1, name: "" } }),
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "选择客户" }, elparams: { placeholder: "选择客户" },
}, },
// { // {
// input: true, // input: true,
// label: "版本号", // label: "版本号",
// prop: "ai", // prop: "ai",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" }, // rules: { required: true, message: "必填项不能为空", trigger: "blur" },
// elparams: { placeholder: "输入版本号" }, // elparams: { placeholder: "输入版本号" },
// }, // },
// { // {
// input: true, // input: true,
// label: "物料号销售文本", // label: "物料号销售文本",
// prop: "shortDesc", // prop: "shortDesc",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" }, // rules: { required: true, message: "必填项不能为空", trigger: "blur" },
// elparams: { placeholder: "输入物料号销售文本" }, // elparams: { placeholder: "输入物料号销售文本" },
// }, // },
{ {
label: "物料号销售文本", label: "物料号销售文本",
@ -526,10 +528,10 @@ export default function () {
}, },
}, },
{}, {},
{}, {}
], ],
[ [
{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } } { input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } },
// { // {
// select: true, // select: true,
// label: "原料类别", // label: "原料类别",
@ -539,8 +541,8 @@ export default function () {
// // autoDisabled: true // // autoDisabled: true
// }, // },
], ],
] ],
} },
], ],
operations: [ operations: [
{ name: "add", label: "保存", type: "primary", permission: "", showOnEdit: false }, { name: "add", label: "保存", type: "primary", permission: "", showOnEdit: false },
@ -568,8 +570,8 @@ export default function () {
unConfirmedOrder: "/pms/order/pageUnCom", unConfirmedOrder: "/pms/order/pageUnCom",
base: "/pms/order", base: "/pms/order",
importUrl: "/pms-am/pms/order/importExcelOrder", importUrl: "/pms-am/pms/order/importExcelOrder",
templateUrl: '/importTemplates/orderImport.xlsx', templateUrl: "/importTemplates/orderImport.xlsx",
payload: '/pms/carHandle', payload: "/pms/carHandle",
}, },
}; };
} }