Browse Source

解决代码缺失

master_hella_20240701
wangyufei 5 months ago
parent
commit
475d42e7cc
  1. 499
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

499
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

@ -1,5 +1,5 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime' import { dateFormatter,dateFormatter2 } from '@/utils/formatTime'
import * as SupplierApi from '@/api/wms/supplier' import * as SupplierApi from '@/api/wms/supplier'
import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data' import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data'
import * as getRequestsettingApi from '@/api/wms/requestsetting/index' import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
@ -9,7 +9,7 @@ import { validateHanset, validateEmail } from '@/utils/validator'
import { Itempackaging } from '@/views/wms/basicDataManage/itemManage/itempackage/itempackage.data' import { Itempackaging } from '@/views/wms/basicDataManage/itemManage/itempackage/itempackage.data'
import * as ItemPackageApi from '@/api/wms/itempackage/index' import * as ItemPackageApi from '@/api/wms/itempackage/index'
import { validateInteger } from '@/utils/validator' import {validateInteger} from '@/utils/validator'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 // 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
@ -21,15 +21,15 @@ const queryParams = {
const data = await getRequestsettingApi.getRequestsettingPage(queryParams) const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData = data?.list[0] || {} const requestsettingData = data?.list[0] || {}
// 获取当前操作人的部门 // 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import { TableColumn } from '@/types/table' import { TableColumn } from '@/types/table'
import { tr } from 'element-plus/es/locale' import { tr } from 'element-plus/es/locale'
const userStore = useUserStore() const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept const userDept = userStore.userSelfInfo.dept
// id 转str 否则form回显匹配不到 // id 转str 否则form回显匹配不到
userDept.id = userDept.id.toString() userDept.id = userDept.id.toString()
const userDeptArray: any = [userDept] const userDeptArray:any = [userDept]
/** /**
* @returns {Array} * @returns {Array}
@ -556,10 +556,18 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
//表单校验 //表单校验
export const SupplierdeliverRequestMainRules = reactive({ export const SupplierdeliverRequestMainRules = reactive({
supplierCode: [{ required: true, message: '请输入供应商代码', trigger: 'blur' }], supplierCode: [
ppNumber: [{ required: true, message: '请输入要货计划单号', trigger: 'blur' }], { required: true, message: '请输入供应商代码', trigger: 'blur' }
asnNumber: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], ],
contactName: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], ppNumber: [
{ required: true, message: '请输入要货计划单号', trigger: 'blur' }
],
asnNumber: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
contactName: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
contactPhone: [ contactPhone: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }, { max: 50, message: '不得超过50个字符', trigger: 'blur' },
{ validator: validateHanset, message: '请输入正确的手机号', trigger: 'blur' } { validator: validateHanset, message: '请输入正确的手机号', trigger: 'blur' }
@ -568,20 +576,36 @@ export const SupplierdeliverRequestMainRules = reactive({
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }, { max: 50, message: '不得超过50个字符', trigger: 'blur' },
{ validator: validateEmail, message: '请输入正确的邮箱地址', trigger: 'blur' } { validator: validateEmail, message: '请输入正确的邮箱地址', trigger: 'blur' }
], ],
carrierCode: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], carrierCode: [
transferMode: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], { max: 50, message: '不得超过50个字符', trigger: 'blur' }
vehiclePlateNumber: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], ],
remark: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], transferMode: [
planArriveTime: [{ required: true, message: '请输入计划到货时间', trigger: 'blur' }], { max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
vehiclePlateNumber: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
planArriveTime: [
{ required: true, message: '请输入计划到货时间', trigger: 'blur' }
],
// departmentCode: [ // departmentCode: [
// { required: true, message: '请输入部门', trigger: 'blur' } // { required: true, message: '请输入部门', trigger: 'blur' }
// ], // ],
autoCommit: [{ required: true, message: '请选择是否自动提交', trigger: 'change' }], autoCommit: [
autoAgree: [{ required: true, message: '请选择是否自动通过', trigger: 'change' }], { required: true, message: '请选择是否自动提交', trigger: 'change' }
autoExecute: [{ required: true, message: '请选择是否自动执行', trigger: 'change' }], ],
autoAgree: [
{ required: true, message: '请选择是否自动通过', trigger: 'change' }
],
autoExecute: [
{ required: true, message: '请选择是否自动执行', trigger: 'change' }
],
directCreateRecord: [ directCreateRecord: [
{ required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' }
] ],
// businessType: [ // businessType: [
// { required: true, message: '请输入业务类型', trigger: 'blur' } // { required: true, message: '请输入业务类型', trigger: 'blur' }
// ], // ],
@ -591,70 +615,7 @@ export const SupplierdeliverRequestMainRules = reactive({
* @returns {Array} * @returns {Array}
*/ */
export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '采购订单号',
field: 'poNumber',
sort: 'custom',
table: {
width: 150
},
isSearch:true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择订单号',
searchField: 'number',
searchTitle: '要货计划信息',
searchAllSchemas: PurchasePlanDetail.allSchemas,
searchPage: PurchasePlanDetailApi.getPurchasePlanDetailPage,
searchCondition: [
{
key: 'number',
value: 'ppNumber',
message: '请填写要货计划单号!',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择订单号',
searchField: 'number',
searchTitle: '要货计划信息',
searchAllSchemas: PurchasePlanDetail.allSchemas,
searchPage: PurchasePlanDetailApi.getPurchasePlanDetailPage,
searchCondition: [
{
key: 'number',
value: 'ppNumber',
message: '请填写要货计划单号!',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'flag',
value: '1',
isMainValue: false
},
{
key: 'isAll',
value: '1',
isMainValue: false
}]
}
},
{ {
label: '订单行', label: '订单行',
field: 'poLine', field: 'poLine',
@ -679,7 +640,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
table: { table: {
width: 150 width: 150
}, },
sortTableDefault:2, sortTableDefault:3,
form: { form: {
componentProps: { componentProps: {
disabled: true disabled: true
@ -690,26 +651,24 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
} }
}, },
{ {
label: '批次', label: '申请发货数量',
field: 'batch', field: 'qty',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
hiddenInMain:true, sortTableDefault:4,
tableForm: { form: {
disabled: true component: 'InputNumber',
} componentProps: {
}, min: 1,
{ precision: 6
label: '供应商批次', }
field: 'supplierBatch',
sort: 'custom',
table: {
width: 150
}, },
tableForm: { tableForm: {
disabled: false type: 'InputNumber',
min: 1,
precision: 6
} }
}, },
{ {
@ -723,6 +682,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
table: { table: {
width: 180 width: 180
}, },
sortTableDefault:7,
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -738,6 +698,73 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
valueFormat: 'x', valueFormat: 'x',
} }
}, },
{
label: '供应商批次',
field: 'supplierBatch',
sort: 'custom',
table: {
width: 150
},
sortTableDefault:8,
tableForm: {
disabled: false
}
},
{
label: '发货批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
hiddenInMain:true,
tableForm: {
disabled: true
}
},
{
label: '计划数量',
field: 'planQty',
sort: 'custom',
table: {
width: 150
},
isTable:false,
tableForm: {
disabled: true,
type: 'InputNumber',
precision: 6
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6
}
}
},
{
label: '已发货数量',
field: 'shippedQty',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true,
type: 'InputNumber',
precision: 6
},
isTable: false,
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6
}
}
},
// { // {
// label: '替代批次', // label: '替代批次',
@ -784,6 +811,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
hiddenInMain:true, hiddenInMain:true,
field: 'expireDate', field: 'expireDate',
formatter: dateFormatter2, formatter: dateFormatter2,
isTableForm:false,
detail: { detail: {
dateFormat: 'YYYY-MM-DD' dateFormat: 'YYYY-MM-DD'
}, },
@ -810,27 +838,27 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
disabled: true disabled: true
} }
}, },
{ // {
label: '发货数量', // label: '发货数量',
field: 'qty', // field: 'qty',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
sortTableDefault:2, // sortTableDefault:2,
form: { // form: {
component: 'InputNumber', // component: 'InputNumber',
componentProps: { // componentProps: {
min: 1, // min: 1,
precision: 6 // precision: 6
} // }
}, // },
tableForm: { // tableForm: {
type: 'InputNumber', // type: 'InputNumber',
min: 1, // min: 1,
precision: 6 // precision: 6
} // }
}, // },
{ {
label: '订单数量', label: '订单数量',
field: 'orderQty', field: 'orderQty',
@ -838,6 +866,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
width: 150 width: 150
}, },
hiddenInMain:true, hiddenInMain:true,
isTableForm: false,
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps: { componentProps: {
@ -938,7 +967,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
dictType: DICT_TYPE.UOM, dictType: DICT_TYPE.UOM,
dictClass: 'string', dictClass: 'string',
isTable: true, isTable: true,
sortTableDefault:3, sortTableDefault:5,
table: { table: {
width: 150 width: 150
}, },
@ -947,7 +976,83 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
type: 'Select' type: 'Select'
} }
}, },
{
label: '采购订单号',
field: 'poNumber',
sort: 'custom',
table: {
width: 150
},
isSearch:true,
sortTableDefault:10,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
disabled:true,
// isSearchList: true,
searchListPlaceholder: '请选择订单号',
searchField: 'number',
searchTitle: '要货计划信息',
searchAllSchemas: PurchasePlanDetail.allSchemas,
searchPage: PurchasePlanDetailApi.getPurchasePlanDetailPage,
searchCondition: [
{
key: 'number',
value: 'ppNumber',
message: '请填写要货计划单号!',
isMainValue: true
},
{
key: 'flag',
value: 1,
isMainValue: false
},
{
key: 'isAll',
value: '1',
isMainValue: false
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
tableForm: {
disabled:true,
isInpuFocusShow: false,
searchListPlaceholder: '请选择订单号',
searchField: 'number',
searchTitle: '要货计划信息',
searchAllSchemas: PurchasePlanDetail.allSchemas,
searchPage: PurchasePlanDetailApi.getPurchasePlanDetailPage,
searchCondition: [
{
key: 'number',
value: 'ppNumber',
message: '请填写要货计划单号!',
isMainValue: true
},
{
key: 'flag',
value: 1,
isMainValue: false
},
{
key: 'isAll',
value: '1',
isMainValue: false
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
{ {
label: '从货主代码', label: '从货主代码',
field: 'fromOwnerCode', field: 'fromOwnerCode',
@ -1088,6 +1193,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
label: '备注', label: '备注',
field: 'remark', field: 'remark',
sort: 'custom', sort: 'custom',
isTable: false,
hiddenInMain:true, hiddenInMain:true,
table: { table: {
width: 150 width: 150
@ -1109,15 +1215,15 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
// 批次校验 // 批次校验
const validateBatch = (rule: any, value: any, callback: any) => { const validateBatch = (rule: any, value: any, callback: any) => {
const reg = /^[_a-zA-Z0-9]+$/ const reg = /^[_a-zA-Z0-9]+$/;
if (value == '' || value == undefined || value == null) { if (value == '' || value == undefined || value == null) {
callback() callback();
} else { } else {
if (!reg.test(value)) { if (!reg.test(value)) {
callback(new Error('英文字母、数字或下划线')) callback(new Error('英文字母、数字或下划线'));
} else { } else {
callback() callback();
} }
} }
} }
@ -1135,29 +1241,46 @@ export const SupplierdeliverRequestDetailRules = reactive({
// { required: true, message: '请输入包装号', trigger: 'blur' } // { required: true, message: '请输入包装号', trigger: 'blur' }
// ], // ],
qty:[ qty:[
{ required: true, message: '请输入发货数量', trigger: 'change' }, { required: true, message: '请输入发货数量1', trigger: 'change' },
// { validator: validateQty, trigger: 'change' },
], ],
batch: [ batch: [
{ required: true, message: '请输入批次', trigger: 'blur' }, { required: true, message: '请输入批次', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }, { max: 50, message: '不得超过50个字符', trigger: 'blur' },
{ validator: validateBatch, trigger: 'change' } { validator: validateBatch, trigger: 'change' }
], ],
produceDate: [{ required: true, message: '请输入生产日期', trigger: 'blur' }], produceDate: [
{ required: true, message: '请输入生产日期', trigger: 'blur' }
],
packQty: [ packQty: [
{ required: true, message: '请输入包装数量', trigger: 'blur' } { required: true, message: '请输入包装数量', trigger: 'blur' },
// { validator: validateInteger, message: '请输入正确的整数', trigger: 'blur' } { validator: validateInteger, message: '请输入正确的整数', trigger: 'blur' }
],
poNumber: [
{ required: true, message: '请选择订单号', trigger: 'change' }
],
poLine: [
{ required: true, message: '请选择订单行', trigger: 'change' }
],
packUnit: [
{ required: true, message: '请选择包装规格', trigger: 'change' }
],
secondPackUnit: [
{ required: false, message: '请选择包装规格2', trigger: 'change' }
], ],
poNumber: [{ required: true, message: '请选择订单号', trigger: 'change' }],
poLine: [{ required: true, message: '请选择订单行', trigger: 'change' }],
packUnit: [{ required: true, message: '请选择包装规格', trigger: 'change' }],
secondPackUnit: [{ required: false, message: '请选择包装规格2', trigger: 'change' }],
secondPackQty: [ secondPackQty: [
{ required: false, message: '请输入包装数量2', trigger: 'blur' } { required: false, message: '请输入包装数量2', trigger: 'blur' },
// { validator: validateInteger, message: '请输入正确的整数', trigger: 'blur' } { validator: validateInteger, message: '请输入正确的整数', trigger: 'blur' }
],
convertRate: [
{ required: true, message: '请输入转换率', trigger: 'blur' }
],
itemCode: [
{ required: true, message: '请选择物料代码', trigger: 'change' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
], ],
convertRate: [{ required: true, message: '请输入转换率', trigger: 'blur' }],
itemCode: [{ required: true, message: '请选择物料代码', trigger: 'change' }],
remark: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }]
// secondPackQty:[{ validator:validateInteger, message: '请输入正确的整数', trigger: 'blur'}] // secondPackQty:[{ validator:validateInteger, message: '请输入正确的整数', trigger: 'blur'}]
}) })
@ -1505,8 +1628,6 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
}, },
tableForm: { tableForm: {
type: 'Select', type: 'Select',
labelField: 'packName',
valueField: 'packUnit',
initOptions: [{ initOptions: [{
label: '', label: '',
value: '' value: ''
@ -1536,8 +1657,6 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
}, },
tableForm: { tableForm: {
type: 'Select', type: 'Select',
labelField: 'packName',
valueField: 'packUnit',
initOptions: [{ initOptions: [{
label: '', label: '',
value: '' value: ''
@ -1559,6 +1678,7 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
disabled:true disabled:true
} }
}, },
{ {
label: '物料名称', label: '物料名称',
field: 'itemName', field: 'itemName',
@ -1601,47 +1721,50 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
}, },
])) ]))
export const SupplierdeliverRequestPackage = useCrudSchemas( export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[]>([
reactive<CrudSchema[]>([ {
{ label: '包装号',
label: '包装号', field: 'number',
field: 'number', sort: 'custom',
sort: 'custom', isSearch: true,
isSearch: true, table: {
table: { fixed: 'left'
fixed: 'left'
}
}, },
{ },
label: '物料代码', {
field: 'itemCode', label: '物料代码',
sort: 'custom', field: 'itemCode',
isSearch: true, sort: 'custom',
table: {} isSearch: true,
}, table: {
{ },
label: '批次', },
field: 'batch', {
sort: 'custom', label: '批次',
isSearch: true, field: 'batch',
table: {} sort: 'custom',
}, isSearch: true,
{ table: {
label: '数量', },
field: 'qty', },
sort: 'custom', {
table: {} label: '数量',
}, field: 'qty',
{ sort: 'custom',
label: '计量单位', table: {
field: 'uom', },
sort: 'custom', },
dictType: DICT_TYPE.UOM, {
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 label: '计量单位',
form: { field: 'uom',
component: 'SelectV2' sort: 'custom',
}, dictType: DICT_TYPE.UOM,
table: {} dictClass: 'string', // 默认都是字符串类型其他暂不考虑
} form: {
]) component: 'SelectV2'
) },
table: {
},
},
]))

Loading…
Cancel
Save