113 lines
3.5 KiB
JavaScript
113 lines
3.5 KiB
JavaScript
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
|
||
import switchBtn from "@/components/noTemplateComponents/switchBtn";
|
||
import QuillRichInput from "@/components/noTemplateComponents/richInput";
|
||
import request from "@/utils/request";
|
||
import { dictFilter } from '@/utils/filters'
|
||
|
||
export default function () {
|
||
const tableProps = [
|
||
{ prop: "name", label: "窑车号" },
|
||
{ prop: "code", label: "编码" },
|
||
{ prop: "typeDictValue", label: "过渡车", filter: val => ['否', '是'](val) },
|
||
{ prop: "status", label: "状态", subcomponent: switchBtn }, // subcomponent
|
||
{ prop: "currentQty", label: "载量" },
|
||
{ prop: "currentPos", label: "当前位置" },
|
||
{ prop: "description", label: "描述" },
|
||
{ prop: "remark", label: "备注" },
|
||
{
|
||
prop: "operations",
|
||
name: "操作",
|
||
fixed: "right",
|
||
width: 120,
|
||
subcomponent: TableOperaionComponent,
|
||
options: ["edit", { name: "delete", permission: "pms:car:delete" }],
|
||
},
|
||
];
|
||
|
||
const headFormFields = [
|
||
{
|
||
prop: 'name',
|
||
label: "窑车号",
|
||
input: true,
|
||
default: { value: "" },
|
||
bind: {
|
||
// placeholder: '请输入产线名称或编码'
|
||
placeholder: '请输入料仓名称'
|
||
}
|
||
},
|
||
{
|
||
button: {
|
||
type: "primary",
|
||
name: "查询",
|
||
},
|
||
},
|
||
{
|
||
button: {
|
||
type: "primary",
|
||
name: "新增",
|
||
permission: "pms:materialStorage:save"
|
||
},
|
||
bind: {
|
||
plain: true,
|
||
}
|
||
},
|
||
];
|
||
|
||
/**
|
||
* dialog config 有两个版本,一个适用于 DialogWithMenu 组件,另一个适用于 DialogJustForm 组件
|
||
* 适用于 DialogWithMenu 组件的配置示例详见 blenderStep/config.js
|
||
* 此为后者的配置:
|
||
*/
|
||
const dialogJustFormConfigs = {
|
||
clickModalToClose: false,
|
||
form: {
|
||
rows: [
|
||
[
|
||
{
|
||
input: true,
|
||
label: "窑车号",
|
||
prop: "name",
|
||
rules: { required: true, message: "not empty", trigger: "blur" },
|
||
elparams: { placeholder: "请输入窑车号" },
|
||
},
|
||
{
|
||
input: true,
|
||
label: "编码",
|
||
prop: "code",
|
||
rules: { required: true, message: "not empty", trigger: "blur" },
|
||
elparams: { placeholder: "请输入料仓编码" },
|
||
},
|
||
],
|
||
[{ component: QuillRichInput, label: "描述信息", prop: "description" }],
|
||
[{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
|
||
],
|
||
operations: [
|
||
{ name: "add", label: "保存", type: "primary", permission: "pms:car:save", showOnEdit: false },
|
||
{ name: "update", label: "更新", type: "primary", permission: "pms:car:update", showOnEdit: true },
|
||
{ name: "reset", label: "重置", type: "warning", showAlways: true },
|
||
// { name: 'cancel', label: '取消', 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/car",
|
||
page: "/pms/car/page",
|
||
// subase: '/pms/blenderStepParam',
|
||
// subpage: '/pms/blenderStepParam/page',
|
||
// more...
|
||
},
|
||
};
|
||
}
|