pms-aomei/src/views/modules/pms/carOrderReport/config.js
2023-08-25 15:21:27 +08:00

259 lines
7.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 switchBtn from "@/components/noTemplateComponents/switchBtn";
// import QuillRichInput from "@/components/noTemplateComponents/richInput";
// import request from "@/utils/request";
import { timeFilter } from "@/utils/filters";
export default function () {
const tableProps = [
// 多选框
{ type: "selection", width: 60, align: "center" },
{ width: 128, prop: "createTime", label: "添加时间", filter: timeFilter },
{ width: 128, prop: "updaterName", label: "更改人" },
{ width: 128, prop: "posCode", label: "位置" },
{ width: 72, prop: "code", label: "窑车号" },
{ width: 128, prop: "orderCode", label: "订单号" },
{ width: 88, prop: "orderCate", label: "订单子号" },
{ width: 72, prop: "shapeCode", label: "砖型" },
{ width: 256, prop: "brand", label: "配方" },
{ width: 128, prop: "goodqty", label: "合格数量" },
{ width: 128, prop: "badqty", label: "报废数量" },
// { prop: "typeDictValue", label: "过渡车", filter: val => ['否', '是'][val] },
// { prop: "enabled", label: "状态", subcomponent: switchBtn }, // subcomponent
{
width: 128,
prop: "team",
label: "班次",
filter: (val) => (val != null ? ["早班", "中班", "晚班"][val] : "-"),
},
{
width: 128,
prop: "report",
label: "报工",
filter: (val) => (val != null ? ["未报工", "已报工"][val] : "-"),
},
{ width: 128, prop: "rtime", label: "报工时间", filter: timeFilter },
{
prop: "operations",
name: "操作",
fixed: "right",
width: 90,
subcomponent: TableOperaionComponent,
options: [
{ name: "edit", label: "编辑", icon: "edit-outline", enable: (row) => row.report == 0 },
// {
// name: "delete",
// icon: "delete",
// label: "删除",
// emitFull: true,
// permission: "pms:carOrderReport:delete",
// },
],
},
];
const now = new Date().getTime();
const headFormFields = [
{
prop: "orderCode",
label: "订单号",
input: true,
default: { value: "" },
bind: {
placeholder: "请输入订单号",
},
},
{
prop: "carCode",
label: "窑车号",
input: true,
default: { value: "" },
bind: {
placeholder: "请输入窑车号",
},
},
{
prop: "team",
label: "班次",
select: [
{ label: "早班", value: "0" },
{ label: "中班", value: "1" },
{ label: "晚班", value: "2" },
],
default: { value: "" },
bind: {
placeholder: "请选择班次",
},
},
{
prop: "report",
label: "报工",
select: [
{ label: "未报工", value: "0" },
{ label: "已报工", value: "1" },
],
default: { value: "0" },
bind: {
placeholder: "请选择报工状态",
},
},
{
prop: "pos",
label: "压机",
select: [
{ label: "压机1", value: "1" },
{ label: "压机2", value: "7" },
],
bind: {
placeholder: "请选择压机",
},
},
{
timerange: true,
prop: "timerange",
label: "时间段",
default: { value: [now - 3600 * 24 * 7 * 1000, now] },
bind: {
placeholder: "请选择时间段",
type: "datetimerange",
"start-placeholder": "开始时间",
"end-placeholder": "结束时间",
},
},
{
button: {
type: "primary",
name: "查询",
},
},
{
button: {
type: "primary",
name: "报工",
permission: "pms:carOrderReport:report",
},
bind: {
plain: true,
},
},
];
/**
* dialog config 有两个版本,一个适用于 DialogWithMenu 组件,另一个适用于 DialogJustForm 组件
* 适用于 DialogWithMenu 组件的配置示例详见 blenderStep/config.js
* 此为后者的配置:
*/
const dialogJustFormConfigs = {
clickModalToClose: false,
form: {
rows: [
[
{
forceDisabled: true,
label: "窑车号",
prop: "code",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入窑车号" },
},
],
[
{
forceDisabled: true,
label: "订单号",
prop: "orderCode",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入订单号" },
},
],
[
{
forceDisabled: true,
label: "订单子号",
prop: "orderCate",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入订单子号" },
},
],
[
{
input: true,
label: "合格数量",
prop: "goodqty",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{
type: "number",
message: "请输入正确的数字类型",
trigger: "blur",
transform: (val) => Number(val),
},
],
elparams: { placeholder: "请输入合格数量" },
},
],
[
{
input: true,
label: "报废数量",
prop: "badqty",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{
type: "number",
message: "请输入正确的数字类型",
trigger: "blur",
transform: (val) => Number(val),
},
],
elparams: { placeholder: "请输入报废数量" },
},
],
// [
// {
// richInput: true,
// label: "描述信息",
// prop: "description",
// },
// ],
// [{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
],
operations: [
{
name: "add",
label: "保存",
type: "primary",
permission: "pms:carOrderReport:save",
showOnEdit: false,
},
{
name: "update",
label: "更新",
type: "primary",
permission: "pms:carOrderReport:update",
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/carOrderReport",
page: "/pms/carOrderReport/pageView",
pageIsPostApi: true,
reportPre: "/pms/workReport/pressReportPre",
report: "/pms/workReport/pressReport",
},
};
}