You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

753 lines
15 KiB

1 year ago
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import * as ItembasicApi from '@/api/wms/itembasic'
import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
import * as getPlansettingApi from '@/api/wms/plansetting/index'
const { t } = useI18n() // 国际化
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = {
pageSize:10,
pageNo:1,
code:'CountPlan'
}
const data = await getPlansettingApi.getPlansettingPage(queryParams)
const plansettingData =data?.list[0]||{}
/**
* @returns {Array}
*/
export const CountPlanMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180,
fixed: 'left'
},
isSearch: true,
isForm: false,
},
{
label: '盘点类型',
field: 'type',
dictType: DICT_TYPE.COUNT_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '执行周期',
field: 'crontab',
sort: 'custom',
table: {
width: 150
},
},
{
label: '维度',
field: 'dimension',
dictType: DICT_TYPE.COUNT_DIMENSION,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '限值',
field: 'limitedValue',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '物料忽略名单',
field: 'ignoreListOfItem',
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
multiple:true,//是否可以多选
searchListPlaceholder: '请选择物料忽略名单', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物料信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage // 查询弹窗所需分页方法
}
}
},
{
label: '库位忽略名单',
field: 'ignoreListOfLocation',
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
multiple:true,//是否可以多选
searchListPlaceholder: '请选择库位忽略名单', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.getLocationPage // 查询弹窗所需分页方法
}
}
},
// {
// label: '盘点范围列表',
// field: 'scopeList',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '快照盘点',
field: 'isSnapshot',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
isForm:false,
1 year ago
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
sort: 'custom',
table: {
width: 150
},
},
{
label: '冻结盘点',
field: 'isFreeze',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
form: {
component: 'Switch',
value: 'FALSE',
1 year ago
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
sort: 'custom',
table: {
width: 150
},
},
{
label: '盘点空库位',
field: 'isCountEmptyLocation',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
form: {
component: 'Switch',
value: 'FALSE',
1 year ago
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
sort: 'custom',
table: {
width: 150
},
},
{
label: '盘点零库存',
field: 'isCountZeroInventory',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
form: {
component: 'Switch',
value: 'FALSE',
1 year ago
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
sort: 'custom',
table: {
width: 150
},
},
{
label: '盘点负库存',
field: 'isCountNegativeInventory',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
form: {
component: 'Switch',
value: 'FALSE',
1 year ago
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
sort: 'custom',
table: {
width: 150
},
},
{
label: '明盘',
field: 'isOpenCount',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
sort: 'custom',
table: {
width: 150
},
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
11 months ago
isTable:false,
1 year ago
form: {
value: 'Count',
componentProps: {
disabled: true
}
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
11 months ago
isTable:false,
1 year ago
isForm: false,
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
11 months ago
isTable:false,
1 year ago
isForm: false,
},
{
label: '开始时间',
field: 'beginTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '结束时间',
field: 'endTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.PLAN_STATUS,
dictClass: 'string',
isSearch: true,
isForm: false,
1 year ago
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
11 months ago
isSearch: false,
isTable: false,
1 year ago
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
},
{
label: '自动提交',
field: 'autoCommit',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
11 months ago
isTable: false,
isForm: false,
1 year ago
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: plansettingData.autoCommit,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '自动通过',
field: 'autoAgree',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
11 months ago
isTable: false,
isForm: false,
1 year ago
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: plansettingData.autoAgree,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '自动执行',
field: 'autoExecute',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
11 months ago
isTable: false,
isForm: false,
1 year ago
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: plansettingData.autoExecute,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false,
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
11 months ago
isTable:false,
1 year ago
isForm: false,
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 300,
fixed: 'right'
},
}
]))
//表单校验
export const CountPlanMainRules = reactive({
type: [
{ required: true, message: '请选择盘点类型', trigger: 'change' }
],
crontab: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
isSnapshot: [
{ required: true, message: '请选择快照盘点', trigger: 'change' }
],
isFreeze: [
{ required: true, message: '请选择冻结盘点', trigger: 'change' }
],
isCountEmptyLocation: [
{ required: true, message: '请选择盘点空库位', trigger: 'change' }
],
isCountZeroInventory: [
{ required: true, message: '请选择盘点零库存', trigger: 'change' }
],
isCountNegativeInventory: [
{ required: true, message: '请选择盘点负库存', trigger: 'change' }
],
isOpenCount: [
{ required: true, message: '请选择明盘', trigger: 'change' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],
status: [
{ required: true, message: '请选择状态', trigger: 'change' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
})
/**
* @returns {Array}
*/
// export const CountPlanDetail = useCrudSchemas(<CrudSchema[]>([
// {
// label: '盘点范围类型',
// field: 'type',
// dictType: DICT_TYPE.COUNT_TYPE,
// dictClass: 'string',
// isTable: true,
// sort: 'custom',
// table: {
// width: 150
// },
// tableForm: {
// type: 'Select'
// }
// },
// {
// label: '盘点范围值',
// field: 'value',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '单据号',
// field: 'number',
// sort: 'custom',
// table: {
// width: 150,
// },
// isTableForm: false,
// form: {
// componentProps: {
// disabled: true
// }
// }
// },
// {
// label: '物料代码',
// field: 'itemCode',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '备注',
// field: 'remark',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '创建者',
// field: 'creator',
// sort: 'custom',
// table: {
// width: 150
// },
// isTableForm: false,
// isForm: false,
// },
// {
// label: '创建时间',
// field: 'createTime',
// formatter: dateFormatter,
// detail: {
// dateFormat: 'YYYY-MM-DD HH:mm:ss'
// },
// sort: 'custom',
// table: {
// width: 180
// },
// form: {
// component: 'DatePicker',
// componentProps: {
// style: {width:'100%'},
// type: 'datetime',
// dateFormat: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'x',
// }
// },
// isTableForm: false,
// isForm: false,
// },
// {
// label: '最后更新时间',
// field: 'updateTime',
// formatter: dateFormatter,
// detail: {
// dateFormat: 'YYYY-MM-DD HH:mm:ss'
// },
// sort: 'custom',
// table: {
// width: 180
// },
// form: {
// component: 'DatePicker',
// componentProps: {
// style: {width:'100%'},
// type: 'datetime',
// dateFormat: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'x',
// }
// },
// isTableForm: false,
// isForm: false,
// },
// {
// label: '最后更新者',
// field: 'updater',
// sort: 'custom',
// table: {
// width: 150
// },
// isTableForm: false,
// isForm: false,
// },
// {
// label: '计划数量',
// field: 'planQty',
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// component: 'InputNumber',
// componentProps: {
// min: 1,
// precision: 6
// }
// },
// tableForm: {
// type: 'InputNumber',
// min: 1,
// precision: 6
// }
// },
// {
// label: '计量单位',
// field: 'uom',
// dictType: DICT_TYPE.UOM,
// dictClass: 'string',
// isTable: true,
// sort: 'custom',
// table: {
// width: 150
// },
// tableForm: {
// type: 'Select'
// }
// },
// {
// label: '是否可用',
// field: 'available',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string',
// isTable: true,
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// },
// sort: 'custom',
// table: {
// width: 150
// },
// tableForm: {
// type: 'Select'
// }
// },
// {
// label: '操作',
// field: 'action',
// isDetail: false,
// isForm: false ,
// table: {
// width: 150,
// fixed: 'right'
// },
// isTableForm:false,
// }
// ]))
//表单校验
export const CountPlanDetail = useCrudSchemas(<CrudSchema[]>([
{
label: '盘点范围类型',
field: 'type',
dictType: DICT_TYPE.COUNT_SCOPE_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 300
},
tableForm: {
type: 'Select',
width: '300'
}
},
{
label: '盘点范围值',
field: 'value',
isTable: true,
sort: 'custom',
table: {
width: 300
},
tableForm: {
width: '300',
},
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 150,
fixed: 'right'
},
11 months ago
hiddenInMain:true,
1 year ago
isTableForm:false,
}
]))
export const CountPlanDetailRules = reactive({
type: [
{ required: true, message: '请选择盘点范围类型', trigger: 'change' }
],
value: [
{ required: true, message: '请选择盘点范围值', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
})