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.
 
 
 

295 lines
7.3 KiB

import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as SupplierApi from '@/api/wms/supplier'
// import {Supplier} from '@/basicDataManage/supplierManage/supplier/supplier.data'
import { Supplier } from '../supplier/supplier.data'
import { DeliTimeWms } from '../DeliTimeWms/deliTimeWms.data'
import * as DeliTimeWmsApi from '@/api/wms/deliTimeWms'
// 表单校验
export const ModelDeliTimeDetailRules = reactive({
model: [required],
yearAndMonth: [required],
delayDeli: [required],
})
function getMonthArr() {
let dateArr = [];
let year = new Date().getFullYear();
let month = new Date().getMonth();
const n = 12
if (n < month) {
//1.n<month的情况
for (let i = month - n + 1; i <= month; i++) {
let m1 = i < 10 ? "0" + i : i;
dateArr.push({
label: year + '-' + m1,
value: year + '-' + m1
});
}
} else {
//2.n>month的情况
for (let i = (12 - (n - month) + 1); i <= 12; i++) {
let m1 = i < 10 ? "0" + i : i;
dateArr.push({
label: year + '-' + m1,
value: year + '-' + m1
});
}
for (let i = 1; i <= month; i++) {
let m1 = i < 10 ? "0" + i : i;
dateArr.push({
label: (parseFloat(year) + 1) + '-' + m1,
value: (parseFloat(year) + 1) + '-' + m1,
});
}
}
return dateArr;
}
export const ModelDeliTime = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '供应商代码',
// field: 'supplierCode',
// sort: 'custom',
// isSearch: true,
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// enterSearch: true,
// searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
// searchField: 'number', // 查询弹窗赋值字段
// searchTitle: '供应商', // 查询弹窗标题
// searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类
// searchPage: SupplierApi.getSupplierPageSCP, // 查询弹窗所需分页方法
// searchCondition: [
// {
// key: 'available',
// value: "TRUE",
// isMainValue: false
// }
// ],
// // 失去焦点校验参数
// verificationParams: [{
// key: 'code',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: 'true',
// isFormModel: true,
// }]
// }
// }
// },
// {
// label: '供应商名称',
// field: 'supplierName',
// sort: 'custom',
// form :{
// componentProps:{
// disabled:true
// }
// },
// },
{
label: '受入号',
field: 'modelShow',
sort: 'custom',
isSearch: true,
isTable: false,
isDetail: false,
form: {
component: 'Select',
componentProps: {
multiple: true,
collapseTags: true,
collapseTagsTooltip: true,
maxCollapseTags: "2",
optionsAlias: {
labelField: 'label',
valueField: 'value'
}
}
}
},
{
label: '受入号',
field: 'model',
sort: 'custom',
isTable: true,
isDetail: true,
isForm: false,
},
{
label: '年月',
field: 'yearAndMonthShow',
sort: 'custom',
isTable: false,
isDetail: false,
form: {
component: 'Select',
api: () => getMonthArr(),
componentProps: {
multiple: true,
collapseTags: true,
collapseTagsTooltip: true,
maxCollapseTags:"2",
optionsAlias: {
labelField: 'label',
valueField: 'value'
}
}
}
},
{
label: '年月',
field: 'yearAndMonth',
sort: 'custom',
isTable: true,
isDetail: true,
isForm: false,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
type: 'month',
valueFormat: 'YYYY-MM',
}
},
},
{
label: '延后便次',
field: 'delayDeli',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0,
},
},
{
label: '班次',
field: 'shift',
sort: 'custom',
isForm: false,
dictType: DICT_TYPE.SHIFT,
dictClass: 'string',
},
{
label: '编号',
field: 'code',
sort: 'custom',
isForm: false,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
export const ModelDeliTimeDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号',
field: 'code',
sort: 'custom',
isForm: false,
tableForm:{
multiple: true,//多选
isInpuFocusShow: false, // 开启查询弹窗
disabled:true,
searchListPlaceholder: '请选择便次时间配置',// 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '便次时间配置', // 查询弹窗标题
searchAllSchemas: DeliTimeWms.allSchemas, // 查询弹窗所需类
searchPage: DeliTimeWmsApi.getDeliTimePage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
},
],
verificationPage: DeliTimeWmsApi.getDeliTimePage, // tableForm下方输入框校验失去焦点之后是否正确的方法
// isShowTableFormSearch: true, //tableForm下方是否出现输入框
verificationParams: [{
key: 'itemCode',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
disabled:true,
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择品番', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '供应商物料信息', // 查询弹窗标题
searchAllSchemas: DeliTimeWms.allSchemas, // 查询弹窗所需类
searchPage: DeliTimeWmsApi.getDeliTimePage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
},
],
verificationParams: [
{
key: 'itemCode',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
}
}
},
{
label: '班次',
field: 'shift',
sort: 'custom',
isForm: false,
tableForm:{
disabled:true,
}
},
{
label: '开始时间',
field: 'beginTime',
sort: 'custom',
isForm: false,
formatter: dateFormatter,
tableForm:{
disabled:true,
formatter: dateFormatter,
}
},
]))