| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445 |
- /**
- * 应急物资表单配置
- */
- import type { FormConfig } from '@/types/basic-form';
- import { validateFormTime } from '@/utils/validateFormTime';
- import { NOTIFY_RANGE } from '../constant';
- // 盘点任务表单信息
- export const INVENTORY_TASK_FROM_CONFIG: FormConfig[] = [
- {
- label: '盘点任务名称:',
- prop: 'taskName',
- component: 'ElInput',
- componentProps: {
- placeholder: '请输入盘点任务名称',
- },
- },
- {
- label: '任务截止时间:',
- prop: 'endTime',
- component: 'ElDatePicker',
- componentProps: {
- placeholder: '请选择任务截止时间',
- type: 'datetime',
- format: 'YYYY-MM-DD HH:mm',
- dateFormat: 'MMM DD, YYYY',
- timeFormat: 'HH:mm',
- valueFormat: 'YYYY-MM-DD HH:mm',
- },
- },
- ];
- // 盘点任务表单数据
- export const INVENTORY_TASK_FROM_DATA = {
- taskName: '',
- endTime: '',
- };
- // 盘点任务表单规则
- export const INVENTORY_TASK_FROM_RULES = {
- taskName: [{ required: true, message: '请输入盘点任务名称', trigger: 'blur' }],
- endTime: [
- { required: true, message: '请选择任务截止时间', trigger: 'change' },
- { validator: validateFormTime, trigger: 'change' },
- ],
- };
- const BASIC_EMERGENCY_ITEM_FROM_CONFIG = {
- REQUIRED_QUANTITY: {
- label: '应备数量:',
- prop: 'requiredQuantity',
- slot: 'requiredQuantity',
- },
- CURRENT_QUANTITY: {
- label: '当前数量:',
- prop: 'currentQuantity',
- slot: 'currentQuantity',
- },
- UNIT: {
- label: '数量单位:',
- prop: 'unit',
- component: 'ElInput',
- componentProps: {
- placeholder: '请输入数量单位',
- },
- },
- PARK: {
- label: '园区:',
- prop: 'park',
- slot: 'park',
- },
- LOCATION: {
- label: '地点:',
- prop: 'location',
- slot: 'location',
- },
- KEEPER_NAME: {
- label: '保管人:',
- prop: 'keeperName',
- slot: 'keeperName',
- },
- EXPIRATION_DATE: {
- label: '使用期限:',
- prop: 'expirationDate',
- component: 'ElDatePicker',
- componentProps: {
- placeholder: '请选择使用期限',
- type: 'date',
- format: 'YYYY-MM-DD',
- valueFormat: 'YYYY-MM-DD',
- },
- },
- REMARK: {
- label: '备注:',
- prop: 'remark',
- component: 'ElInput',
- componentProps: {
- placeholder: '请输入备注',
- type: 'textarea',
- rows: 5,
- },
- },
- };
- export const ADD_EMERGENCY_ITEM_FROM_CONFIG: FormConfig[] = [
- {
- label: '应急类型:',
- prop: 'emergencyType',
- slot: 'emergencyType',
- },
- {
- label: '物资类型:',
- prop: 'supplyType',
- slot: 'supplyType',
- },
- {
- label: '应急物资名称:',
- prop: 'supplyName',
- component: 'ElInput',
- componentProps: {
- placeholder: '请输入应急物资名称',
- },
- },
- BASIC_EMERGENCY_ITEM_FROM_CONFIG.REQUIRED_QUANTITY,
- BASIC_EMERGENCY_ITEM_FROM_CONFIG.CURRENT_QUANTITY,
- BASIC_EMERGENCY_ITEM_FROM_CONFIG.UNIT,
- BASIC_EMERGENCY_ITEM_FROM_CONFIG.PARK,
- BASIC_EMERGENCY_ITEM_FROM_CONFIG.LOCATION,
- BASIC_EMERGENCY_ITEM_FROM_CONFIG.KEEPER_NAME,
- BASIC_EMERGENCY_ITEM_FROM_CONFIG.EXPIRATION_DATE,
- BASIC_EMERGENCY_ITEM_FROM_CONFIG.REMARK,
- ];
- export const EDIT_EMERGENCY_ITEM_FROM_CONFIG: FormConfig[] = [
- {
- label: '应急类型:',
- prop: 'emergencyTypeName',
- component: 'ElInput',
- componentProps: {
- disabled: true,
- placeholder: '请输入应急类型',
- },
- },
- {
- label: '物资类型:',
- prop: 'supplyTypeName',
- component: 'ElInput',
- componentProps: {
- disabled: true,
- placeholder: '请输入物资类型',
- },
- },
- {
- label: '应急物资名称:',
- prop: 'supplyName',
- component: 'ElInput',
- componentProps: {
- placeholder: '请输入应急物资名称',
- disabled: true,
- },
- },
- BASIC_EMERGENCY_ITEM_FROM_CONFIG.REQUIRED_QUANTITY,
- BASIC_EMERGENCY_ITEM_FROM_CONFIG.CURRENT_QUANTITY,
- BASIC_EMERGENCY_ITEM_FROM_CONFIG.UNIT,
- BASIC_EMERGENCY_ITEM_FROM_CONFIG.PARK,
- BASIC_EMERGENCY_ITEM_FROM_CONFIG.LOCATION,
- BASIC_EMERGENCY_ITEM_FROM_CONFIG.KEEPER_NAME,
- BASIC_EMERGENCY_ITEM_FROM_CONFIG.EXPIRATION_DATE,
- BASIC_EMERGENCY_ITEM_FROM_CONFIG.REMARK,
- ];
- export const VIEW_EMERGENCY_ITEM_FROM_CONFIG: FormConfig[] = [
- {
- label: '应急类型:',
- prop: 'emergencyTypeName',
- component: 'ElInput',
- componentProps: {
- placeholder: '请输入应急类型',
- },
- },
- {
- label: '物资类型:',
- prop: 'supplyTypeName',
- component: 'ElInput',
- componentProps: {
- placeholder: '请输入物资类型',
- },
- },
- {
- label: '应急物资名称:',
- prop: 'supplyName',
- component: 'ElInput',
- componentProps: {
- placeholder: '请输入应急物资名称',
- },
- },
- {
- label: '应备数量:',
- prop: 'requiredQuantity',
- component: 'ElInput',
- componentProps: {
- placeholder: '请输入应备数量',
- },
- },
- {
- label: '当前数量:',
- prop: 'currentQuantity',
- component: 'ElInput',
- componentProps: {
- placeholder: '请输入当前数量',
- },
- },
- BASIC_EMERGENCY_ITEM_FROM_CONFIG.UNIT,
- {
- label: '园区:',
- prop: 'parkName',
- component: 'ElInput',
- componentProps: {
- placeholder: '请输入园区',
- },
- },
- {
- label: '地点:',
- prop: 'locationName',
- component: 'ElInput',
- componentProps: {
- placeholder: '请输入地点',
- },
- },
- {
- label: '保管人:',
- prop: 'keeperName',
- component: 'ElInput',
- componentProps: {
- placeholder: '请输入保管人',
- },
- },
- BASIC_EMERGENCY_ITEM_FROM_CONFIG.EXPIRATION_DATE,
- BASIC_EMERGENCY_ITEM_FROM_CONFIG.REMARK,
- ];
- const EMERGENCY_ITEM_DATA = {
- emergencyType: '',
- emergencyTypeName: '',
- supplyType: '',
- supplyTypeName: '',
- supplyName: '',
- requiredQuantity: null,
- currentQuantity: null,
- unit: '',
- park: '',
- location: '',
- expirationDate: '',
- remark: '',
- keeperId: null,
- keeperName: '',
- };
- // 盘点任务表单数据
- export const ADD_EMERGENCY_ITEM_DATA = {
- ...EMERGENCY_ITEM_DATA,
- };
- export const EDIT_EMERGENCY_ITEM_DATA = {
- ...EMERGENCY_ITEM_DATA,
- id: null,
- };
- export const VIEW_EMERGENCY_ITEM_DATA = {
- ...EDIT_EMERGENCY_ITEM_DATA,
- parkName: '',
- locationName: '',
- };
- const BASIC_EMERGENCY_ITEM_RULES = {
- requiredQuantity: [{ required: true, message: '请输入应备数量', trigger: 'change' }],
- location: [{ required: true, message: '请选择地点', trigger: 'change' }],
- expirationDate: [{ validator: validateFormTime, trigger: 'change' }],
- keeperName: [{ required: true, message: '请选择保管人', trigger: 'change' }],
- };
- export const ADD_EMERGENCY_ITEM_RULES = {
- emergencyType: [{ required: true, message: '请选择应急类型', trigger: 'change' }],
- supplyType: [{ required: true, message: '请选择物资类型', trigger: 'change' }],
- supplyName: [{ required: true, message: '请输入应急物资名称', trigger: 'change' }],
- park: [{ required: true, message: '请选择园区', trigger: 'change' }],
- ...BASIC_EMERGENCY_ITEM_RULES,
- };
- export const EDIT_EMERGENCY_ITEM_RULES = {
- ...BASIC_EMERGENCY_ITEM_RULES,
- };
- // 导出报废记录表单配置
- export const EXPORT_DISCARD_FROM_CONFIG: FormConfig[] = [
- {
- label: '报废时间段:',
- prop: 'discardTime',
- slot: 'discardTime',
- },
- ];
- // 导出报废记录数据
- export const EXPORT_DISCARD_FROM_DATA = {
- discardTime: [],
- };
- // 导出报废记录规则
- export const EXPORT_DISCARD_FROM_RULES = {
- discardTime: [{ required: true, message: '请输入报废时间段', trigger: 'change' }],
- };
- // 物资报废单数据
- export const SUPPLIES_DISCARD_FROM_CONFIG: FormConfig[] = [
- {
- label: '报废数量:',
- prop: 'quantity',
- slot: 'quantity',
- },
- {
- label: '报废理由:',
- prop: 'scrapReason',
- slot: 'scrapReason',
- },
- {
- label: '报废照片:',
- prop: 'scrapImage',
- slot: 'scrapImage',
- },
- ];
- // 物资报废单数据
- export const SUPPLIES_DISCARD_FROM_DATA = {
- quantity: null,
- scrapReason: '',
- scrapImage: '',
- };
- // 物资报废单规则
- export const SUPPLIES_DISCARD_FROM_RULES = {
- quantity: [{ required: true, message: '请输入报废数量', trigger: 'blur' }],
- scrapReason: [{ required: true, message: '请输入报废理由', trigger: 'blur' }],
- };
- // 物资申领计划表单配置
- export const SUPPLY_REQUEST_FORM_CONFIG: FormConfig[] = [
- {
- label: '物资申领计划:',
- prop: 'planName',
- component: 'ElInput',
- componentProps: {
- placeholder: '请输入物资申领计划',
- },
- },
- {
- label: '采购日期:',
- prop: 'purchaseDate',
- component: 'ElDatePicker',
- componentProps: {
- placeholder: '请选择采购日期',
- type: 'date',
- format: 'YYYY-MM-DD',
- valueFormat: 'YYYY-MM-DD',
- },
- },
- ];
- // 物资申领计划表单数据
- export const SUPPLY_REQUEST_FORM_DATA = {
- planName: '',
- purchaseDate: '',
- };
- // 物资申领计划表单规则
- export const SUPPLY_REQUEST_FORM_RULES = {
- planName: [{ required: true, message: '请输入物资申领计划', trigger: 'blur' }],
- };
- // 发起采购表单配置
- export const START_PURCHASE_FORM_CONFIG: FormConfig[] = [
- {
- label: '采购日期:',
- prop: 'purchaseDate',
- component: 'ElDatePicker',
- componentProps: {
- placeholder: '请选择采购日期',
- type: 'date',
- format: 'YYYY-MM-DD',
- valueFormat: 'YYYY-MM-DD',
- },
- },
- ];
- // 发起采购表单数据
- export const START_PURCHASE_FORM_DATA = {
- purchaseDate: '',
- };
- // 发起采购表单规则
- export const START_PURCHASE_FORM_RULES = {
- purchaseDate: [{ required: true, message: '请选择采购日期', trigger: 'change' }],
- };
- // 物资领用通知表单配置
- export const NOTIFY_DEPARTMENT_FORM_CONFIG: FormConfig[] = [
- {
- label: '通知范围:',
- prop: 'noticeScope',
- slot: 'noticeScope',
- },
- {
- label: '领用时间:',
- prop: 'requestTime',
- component: 'ElDatePicker',
- componentProps: {
- placeholder: '请选择领用时间',
- type: 'date',
- format: 'YYYY-MM-DD',
- valueFormat: 'YYYY-MM-DD',
- },
- },
- {
- label: '领用地点:',
- prop: 'requestLocation',
- component: 'ElInput',
- componentProps: {
- placeholder: '请输入领用地点',
- },
- },
- ];
- // 物资领用通知表单数据
- export const NOTIFY_DEPARTMENT_FORM_DATA = {
- noticeScope: NOTIFY_RANGE.ALL,
- requestTime: '',
- requestLocation: '',
- };
- // 物资领用通知表单规则
- export const NOTIFY_DEPARTMENT_FORM_RULES = {
- noticeScope: [{ required: true, message: '请选择通知范围', trigger: 'change' }],
- requestTime: [{ required: true, message: '请选择领用时间', trigger: 'change' }],
- requestLocation: [{ required: true, message: '请输入领用地点', trigger: 'blur' }],
- };
|