Este commit está contenido en:
lb 2023-04-25 09:24:59 +08:00
padre f6fde4ba7b
commit 2ea77ba8fa

Ver fichero

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