From 84a4b2999de94aa1652e8f6fc0a424028ba4dce0 Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 15 Aug 2023 11:27:06 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E5=8E=8B=E6=9C=BA=E6=8A=A5=E5=B7=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/pms/carOrderReport/config.js | 231 ++++++++++++++++++ .../modules/pms/carOrderReport/index.vue | 32 +++ 2 files changed, 263 insertions(+) create mode 100644 src/views/modules/pms/carOrderReport/config.js create mode 100644 src/views/modules/pms/carOrderReport/index.vue diff --git a/src/views/modules/pms/carOrderReport/config.js b/src/views/modules/pms/carOrderReport/config.js new file mode 100644 index 0000000..1703eed --- /dev/null +++ b/src/views/modules/pms/carOrderReport/config.js @@ -0,0 +1,231 @@ +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: 'index', label: '序号' }, + { width: 128, prop: "createTime", label: "添加时间", filter: timeFilter }, + { width: 128, prop: "updaterName", label: "更改人" }, + { width: 128, prop: "code", label: "窑车号" }, + { width: 128, prop: "orderCode", label: "订单号" }, + { width: 128, prop: "orderCate", label: "订单子号" }, + { width: 128, prop: "shapeCode", label: "砖型" }, + { width: 128, 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" }, + // { + // name: "delete", + // icon: "delete", + // label: "删除", + // emitFull: true, + // permission: "pms:carOrderReport:delete", + // }, + ], + }, + ]; + + 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: "请输入班次", + }, + }, + { + timerange: true, + prop: "timerange", + label: "时间段", + 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", + }, + }; +} diff --git a/src/views/modules/pms/carOrderReport/index.vue b/src/views/modules/pms/carOrderReport/index.vue new file mode 100644 index 0000000..da21189 --- /dev/null +++ b/src/views/modules/pms/carOrderReport/index.vue @@ -0,0 +1,32 @@ + + + + +