Browse Source

Merge remote-tracking branch 'origin/master_hella' into master_hella

hella_online_20240829
gaojs 5 months ago
parent
commit
9257d60bbb
  1. 2
      src/components/RouterSearch/index.vue
  2. 140
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue
  3. 251
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

2
src/components/RouterSearch/index.vue

@ -17,7 +17,7 @@
/>
</el-select> -->
</ElDialog>
<div v-else class="custom-hover1" @click.stop="showTopSearch = !showTopSearch">
<div v-else class="custom-hover custom-hover1" @click.stop="showTopSearch = !showTopSearch">
<Icon icon="ep:search" color="#ffffff"/>
<el-select
filterable

140
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue

@ -2,7 +2,10 @@
<ContentWrap>
<!-- 搜索工作栏 -->
<Search
:schema="[...PurchasereturnRequestMain.allSchemas.searchSchema,...PurchasereturnRequestDetail.allSchemas.searchSchema]"
:schema="[
...PurchasereturnRequestMain.allSchemas.searchSchema,
...PurchasereturnRequestDetail.allSchemas.searchSchema
]"
@search="setSearchParams"
@reset="setSearchParams"
/>
@ -21,7 +24,8 @@
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -129,9 +133,7 @@ import * as PurchasereturnRequestMainApi from '@/api/wms/purchasereturnRequestMa
import * as PurchasereturnRequestDetailApi from '@/api/wms/purchasereturnRequestDetail'
import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import {
SupplierdeliverRequestPackage
} from '../../supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data'
import { SupplierdeliverRequestPackage } from '../../supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data'
import * as PackageApi from '@/api/wms/package'
import { getAccessToken } from '@/utils/auth'
import * as BalanceApi from '@/api/wms/balance'
@ -142,11 +144,14 @@ defineOptions({ name: 'PurchasereturnRequestMain' })
const message = useMessage() //
const { t } = useI18n() //
const genLabelId = ref(); //ID
const genLabelId = ref() //ID
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...PurchasereturnRequestMain.allSchemas.tableColumns,...PurchasereturnRequestDetail.allSchemas.tableMainColumns])
const tableColumns = ref([
...PurchasereturnRequestMain.allSchemas.tableColumns,
...PurchasereturnRequestDetail.allSchemas.tableMainColumns
])
const isShowButton = ref(true)
@ -158,11 +163,20 @@ const onEnter = async (field,value)=>{
console.log(field, value)
if ('supplierCode' == field) {
//
formRef.value.opensearchTable('purchaseReceiptRecordNumber', 'number', '采购收货记录', PurchasereceiptRecordMain1.allSchemas, PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageReturn,[{
formRef.value.opensearchTable(
'purchaseReceiptRecordNumber',
'number',
'采购收货记录',
PurchasereceiptRecordMain1.allSchemas,
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageReturn,
[
{
key: 'supplierCode',
value: 'supplierCode',
isMainValue: true
}])
}
]
)
} else if ('purchaseReceiptRecordNumber' == field) {
//
}
@ -183,10 +197,10 @@ const submitFormLabel = async (formType, submitData) => {
data.id = data.masterId
}
try {
console.log("formType==",formType)
console.log("data==",data)
console.log('formType==', formType)
console.log('data==', data)
data.subList = detatableData.tableList
console.log("detatableData",detatableData)
console.log('detatableData', detatableData)
await message.confirm(t('ts.是否为此数据生成标签?'))
await PurchasereturnRequestMainApi.genLabel(data) //genLabelId.value
isCreateLabel.value = true
@ -213,15 +227,14 @@ const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row
//
const searchTableSuccess = async (formField, searchField, val, formRef, type, row) => {
console.log('searchTableSuccess', formField, searchField, val, formRef, type, row)
console.log('searchTableSuccess123', val)
nextTick(async () => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
if(formField=='purchaseReceiptRecordNumber'){//--
if (formField == 'purchaseReceiptRecordNumber') {
//--
row['supplierCode'] = val[0]['supplierCode']
row['poNumber'] = val[0]['poNumber']
row['poLine'] = val[0]['poLine']
@ -289,7 +302,8 @@ const searchTableSuccess = async(formField, searchField, val, formRef, type, row
// PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailListToRepeat({
masterId: val[0]['masterId']
}).then((res) => {
})
.then((res) => {
if (res) tableData.value = res
tableData.value.forEach((item) => {
item.batch = item.toBatch
@ -331,7 +345,8 @@ const searchTableSuccess = async(formField, searchField, val, formRef, type, row
item.tableForm.isInpuFocusShow = false
}
})
}).catch((err) => {
})
.catch((err) => {
console.log(err)
})
}
@ -465,7 +480,9 @@ const isShowMainButton = (row, val) => {
// -
const butttondata = (row, $index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
const findIndex = row['masterId']
? tableObject.tableList.findIndex((item) => item['masterId'] == row['masterId'])
: -1
if (findIndex > -1 && findIndex < $index) {
return []
}
@ -497,7 +514,7 @@ const butttondata = (row,$index) => {
defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['1']),
hasPermi: 'wms:purchasereceipt-request-main:update'
}), //
}) //
// {
// label: '',
// name: 'ssbq',
@ -588,10 +605,15 @@ const { wsCache } = useCache()
const detailRef = ref()
const purchaseReceiptRecordNumberRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
purchaseReceiptRecordNumberRef.value = row.purchaseReceiptRecordNumber;
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name
purchaseReceiptRecordNumberRef.value = row.purchaseReceiptRecordNumber
const departmentCode = wsCache
.get(CACHE_KEY.DEPT)
.find((account) => account.id == row.departmentCode)?.name
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
PurchasereturnRequestDetail.allSchemas.tableColumns = PurchasereturnRequestDetail.allSchemas.tableColumns.filter(item=>item.field!='inventoryBalance')
PurchasereturnRequestDetail.allSchemas.tableColumns =
PurchasereturnRequestDetail.allSchemas.tableColumns.filter(
(item) => item.field != 'inventoryBalance'
)
detailRef.value.openDetail(row, titleName, titleValue, 'requestPurchasereturnMain')
}
@ -603,7 +625,8 @@ const handleClose = async (id: number) => {
await PurchasereturnRequestMainApi.closePurchasereturnRequestMain(id)
message.success(t('common.closeSuccess'))
await getList()
} catch {}finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -616,7 +639,8 @@ const handleReAdd = async (id: number) => {
await PurchasereturnRequestMainApi.reAddPurchasereturnRequestMain(id)
message.success(t('common.reAddSuccess'))
await getList()
} catch {}finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -629,7 +653,8 @@ const handleAgree = async (id: number) => {
await PurchasereturnRequestMainApi.agreePurchasereturnRequestMain(id)
message.success(t('common.agreeSuccess'))
await getList()
} catch {}finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -642,7 +667,8 @@ const handleRefused = async (id: number) => {
await PurchasereturnRequestMainApi.refusedPurchasereturnRequestMain(id)
message.success(t('common.refusedSuccess'))
await getList()
} catch {}finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -655,7 +681,8 @@ const handleHandle = async (id: number) => {
await PurchasereturnRequestMainApi.handlePurchasereturnRequestMain(id)
message.success(t('common.handleSuccess'))
await getList()
} catch {}finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -680,7 +707,9 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
const data = await PurchasereturnRequestMainApi.exportPurchasereturnRequestMain(tableObject.params)
const data = await PurchasereturnRequestMainApi.exportPurchasereturnRequestMain(
tableObject.params
)
download.excel(data, '采购退货申请主.xlsx')
} catch {
} finally {
@ -698,12 +727,12 @@ PurchasereturnRequestDetail.allSchemas.tableFormColumns.forEach((item) => {
const tableData = ref([])
const originTableData = ref([])
const searchTableRef = ref()
//
const handleAddTable = () => {
const subTableDFata = originTableData.value.filter(item=> !tableData.value.find(item1=>item1.id == item.id))
const subTableDFata = originTableData.value.filter(
(item) => !tableData.value.find((item1) => item1.id == item.id)
)
if (subTableDFata.length == 0) {
message.warning('暂无可选择数据!')
return
@ -736,7 +765,7 @@ const handleAddTable = () => {
item.width = item.table?.width || 150
})
searchTableRef.value.openData("采购收货记录单号",tableObject,{tableColumns},true)
searchTableRef.value.openData('采购收货记录单号', tableObject, { tableColumns }, true)
// searchTableRef.value.open(
// ('',
// // _searchTableAllSchemas,
@ -750,7 +779,6 @@ const handleAddTable = () => {
// )
// )
// console.log(subTableDFata)
// const {tableObject, tableMethods } = useTable({
// getListApi: getPage.value //
@ -814,11 +842,10 @@ const handleDeleteTable = (item, index, formRef) => {
item.componentProps.disabled = false
}
})
}
}
const tableSelectionDelete = (selection) => {
tableData.value = tableData.value.filter(item => !selection.includes(item))
tableData.value = tableData.value.filter((item) => !selection.includes(item))
if (tableData.value.length == 0) {
isShowButton.value = true
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => {
@ -846,19 +873,19 @@ const submitForm = async (formType, submitData) => {
// message.warning("退")
// return;
// }
if(tableData.value.find(item=>Number(item.qty)>Number(item.inventoryBalance))){
message.warning("退货数量不能大于库存余额")
return;
if (tableData.value.find((item) => Number(item.qty) > Number(item.inventoryBalance))) {
message.warning('退货数量不能大于库存余额')
return
}
data.subList = tableData.value //
try {
if (formType === 'create') {
let flag = false;
let flag = false
data.subList.forEach((item) => {
if (item.qty == 0) {
message.warning("数量不能为0")
flag = true;
return;
message.warning('数量不能为0')
flag = true
return
}
})
if (flag) {
@ -881,14 +908,14 @@ const submitForm = async (formType, submitData) => {
// /
const detailValidate = (data) => {
let tag = false;
let tag = false
if (data.qty <= 0) {
message.warning('数量必须大于0')
tag = false;
return tag;
tag = false
return tag
} else {
tag = true;
return tag;
tag = true
return tag
}
}
@ -919,9 +946,9 @@ const searchFormClick = (searchData) => {
}
const detailOpenForm = (type, row) => {
console.log("type",type);
console.log("row",row);
console.log("AAAAAA",purchaseReceiptRecordNumberRef.value);
console.log('type', type)
console.log('row', row)
console.log('AAAAAA', purchaseReceiptRecordNumberRef.value)
PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => {
if (purchaseReceiptRecordNumberRef.value == '') {
if (item.field == 'itemCode') {
@ -945,7 +972,6 @@ const detailOpenForm = (type, row) =>{
})
}
const BASE_URL = getJmreportBaseUrl()
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
@ -953,7 +979,7 @@ const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAcces
const showLabelRef = ref()
const labelPrint = async (row) => {
tableObject.loading = true
const defaultParams = {'moduleName':'purchasereturn','recordNumber':row.number}
const defaultParams = { moduleName: 'purchasereturn', recordNumber: row.number }
const { tableObject: tableObjectPrint, tableMethods } = useTable({
defaultParams,
getListApi: PackageApi.getLabelDetailPage //
@ -967,7 +993,7 @@ const labelPrint = async (row) => {
tableColumns.forEach((item) => {
item.width = item.table?.width || 150
})
showLabelRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true)
showLabelRef.value.openData('标签信息', tableObjectPrint, { tableColumns }, true)
}
// ---
@ -975,13 +1001,15 @@ const showLabelSuccess = async (formField, searchField, val, formRef, type, row)
console.log('批量打印', val)
if (val.length == 0) {
message.warning("请先选择要打印的数据!")
message.warning('请先选择要打印的数据!')
return
}
await PackageApi.batchPrintingLable(val.map(item1=>item1.number).join(',')).then(res => {
await PackageApi.batchPrintingLable(val.map((item1) => item1.number).join(','))
.then((res) => {
console.log(res)
window.open(src.value + '&asn_number=' + res)
}).catch(err => {
})
.catch((err) => {
console.log(err)
message.error('创建标签失败')
})

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

@ -34,7 +34,8 @@ import { tr } from 'element-plus/es/locale'
/**
* @returns {Array}
*/
export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
export const SupplierdeliverRequestMain = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
@ -44,7 +45,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
fixed: 'left'
},
isForm: false,
isSearch: true,
isSearch: true
},
{
label: '供应商代码',
@ -111,9 +112,10 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
},
{
key: 'available',
value: "TRUE",
value: 'TRUE',
isMainValue: false
}]
}
]
}
}
},
@ -124,7 +126,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
isTable: false,
table: {
width: 150
},
}
},
{
label: '联系人电话',
@ -133,7 +135,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
isTable: false,
table: {
width: 150
},
}
},
{
label: '联系人电子邮件',
@ -142,7 +144,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
isTable: false,
table: {
width: 150
},
}
},
{
label: '供应商发货仓库代码',
@ -208,9 +210,9 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
valueFormat: 'x'
}
}
},
},
{
label: '承运商',
@ -219,7 +221,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
isTable: false,
table: {
width: 150
},
}
},
{
label: '运输方式',
@ -229,7 +231,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
isTable: false,
table: {
width: 150
},
}
},
{
label: '车牌号',
@ -238,7 +240,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
isTable: false,
table: {
width: 150
},
}
},
// {
// label: '业务类型',
@ -281,7 +283,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
valueFormat: 'x'
}
},
isForm: false
@ -314,7 +316,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
valueFormat: 'x'
}
},
isForm: false
@ -337,7 +339,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
valueFormat: 'x'
}
},
isForm: false
@ -402,7 +404,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
valueFormat: 'x'
}
},
isForm: false
@ -434,7 +436,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true,
disabled: true
}
}
},
@ -455,7 +457,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true,
disabled: true
}
}
},
@ -476,7 +478,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true,
disabled: true
}
}
},
@ -497,7 +499,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true,
disabled: true
}
}
},
@ -509,24 +511,17 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
table: {
width: 450,
fixed: 'right'
},
}
]))
}
])
)
//表单校验
export const SupplierdeliverRequestMainRules = reactive({
supplierCode: [
{ required: true, message: '请输入供应商代码', trigger: 'blur' }
],
ppNumber: [
{ required: true, message: '请输入要货计划单号', trigger: 'blur' }
],
asnNumber: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
contactName: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
supplierCode: [{ required: true, message: '请输入供应商代码', trigger: 'blur' }],
ppNumber: [{ required: true, message: '请输入要货计划单号', trigger: 'blur' }],
asnNumber: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }],
contactName: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }],
contactPhone: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' },
{ validator: validateHanset, message: '请输入正确的手机号', trigger: 'blur' }
@ -535,36 +530,20 @@ export const SupplierdeliverRequestMainRules = reactive({
{ max: 50, message: '不得超过50个字符', trigger: 'blur' },
{ validator: validateEmail, message: '请输入正确的邮箱地址', trigger: 'blur' }
],
carrierCode: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
transferMode: [
{ 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' }
],
carrierCode: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }],
transferMode: [{ 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: [
// { required: true, message: '请输入部门', trigger: 'blur' }
// ],
autoCommit: [
{ required: true, message: '请选择是否自动提交', trigger: 'change' }
],
autoAgree: [
{ required: true, message: '请选择是否自动通过', trigger: 'change' }
],
autoExecute: [
{ required: true, message: '请选择是否自动执行', trigger: 'change' }
],
autoCommit: [{ required: true, message: '请选择是否自动提交', trigger: 'change' }],
autoAgree: [{ required: true, message: '请选择是否自动通过', trigger: 'change' }],
autoExecute: [{ required: true, message: '请选择是否自动执行', trigger: 'change' }],
directCreateRecord: [
{ required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' }
],
]
// businessType: [
// { required: true, message: '请输入业务类型', trigger: 'blur' }
// ],
@ -573,7 +552,8 @@ export const SupplierdeliverRequestMainRules = reactive({
/**
* @returns {Array}
*/
export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
export const SupplierdeliverRequestDetail = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '采购订单号',
field: 'poNumber',
@ -603,7 +583,6 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
value: 'TRUE',
isMainValue: false
}
]
}
},
@ -625,7 +604,8 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
]
}
},
{
@ -702,13 +682,13 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
style: { width: '100%' },
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
valueFormat: 'x'
}
},
tableForm: {
type: 'FormDate',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
valueFormat: 'x'
}
},
@ -741,7 +721,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
style: { width: '100%' },
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
valueFormat: 'x'
}
},
@ -749,7 +729,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
tableForm: {
type: 'FormDate',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
valueFormat: 'x'
}
},
{
@ -770,7 +750,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
style: { width: '100%' },
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
valueFormat: 'x'
}
},
// tableForm: {
@ -1001,7 +981,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
valueFormat: 'x'
}
},
sort: 'custom',
@ -1009,7 +989,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
width: 180
},
isTableForm: false,
isForm: false,
isForm: false
},
{
label: '创建者',
@ -1020,7 +1000,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
},
hiddenInMain: true,
isTableForm: false,
isForm: false,
isForm: false
},
{
label: '最后更新时间',
@ -1035,7 +1015,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
valueFormat: 'x'
}
},
hiddenInMain: true,
@ -1044,7 +1024,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
width: 180
},
isTableForm: false,
isForm: false,
isForm: false
},
{
label: '最后更新者',
@ -1055,7 +1035,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
},
hiddenInMain: true,
isTableForm: false,
isForm: false,
isForm: false
},
{
label: '备注',
@ -1064,7 +1044,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
hiddenInMain: true,
table: {
width: 150
},
}
},
{
label: '操作',
@ -1076,20 +1056,21 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
width: 180,
fixed: 'right'
},
isTableForm: false,
isTableForm: false
}
]))
])
)
// 批次校验
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) {
callback();
callback()
} else {
if (!reg.test(value)) {
callback(new Error('英文字母、数字或下划线'));
callback(new Error('英文字母、数字或下划线'))
} else {
callback();
callback()
}
}
}
@ -1098,50 +1079,33 @@ export const SupplierdeliverRequestDetailRules = reactive({
// packingNumber: [
// { required: true, message: '请输入包装号', trigger: 'blur' }
// ],
qty:[
{ required: true, message: '请输入发货数量', trigger: 'change' },
],
qty: [{ required: true, message: '请输入发货数量', trigger: 'change' }],
batch: [
{ required: true, message: '请输入批次', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' },
{ validator: validateBatch, trigger: 'change' }
],
produceDate: [
{ required: true, message: '请输入生产日期', trigger: 'blur' }
],
produceDate: [{ required: true, message: '请输入生产日期', trigger: 'blur' }],
packQty: [
{ required: true, 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' }
{ required: true, 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' }],
secondPackQty: [
{ required: false, message: '请输入包装数量2', 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' }
{ required: false, message: '请输入包装数量2', 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' }]
// secondPackQty:[{ validator:validateInteger, message: '请输入正确的整数', trigger: 'blur'}]
})
export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSchema[]>([
export const SupplierdeliverRequestDetailLabel = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '批次',
field: 'batch',
@ -1171,15 +1135,14 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
style: { width: '100%' },
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
valueFormat: 'x'
}
},
tableForm: {
disabled: true,
type: 'FormDate',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
valueFormat: 'x'
}
},
// {
@ -1214,7 +1177,7 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
style: { width: '100%' },
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
valueFormat: 'x'
}
},
isTableForm: false,
@ -1222,7 +1185,7 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
disabled: true,
type: 'FormDate',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
valueFormat: 'x'
}
},
{
@ -1230,7 +1193,7 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
field: 'expireDate',
formatter: dateFormatter2,
detail: {
dateFormat: 'YYYY-MM-DD',
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
@ -1243,14 +1206,14 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
style: { width: '100%' },
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
valueFormat: 'x'
}
},
tableForm: {
disabled: true,
type: 'FormDate',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
valueFormat: 'x'
}
},
{
@ -1282,7 +1245,6 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
value: 'TRUE',
isMainValue: false
}
]
}
},
@ -1305,7 +1267,8 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
]
}
},
{
@ -1504,7 +1467,6 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
isMainValue: false
}
]
}
},
tableForm: {
@ -1527,7 +1489,8 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
]
}
},
{
@ -1554,10 +1517,14 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0
}
},
{
@ -1588,7 +1555,6 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
isMainValue: false
}
]
}
},
tableForm: {
@ -1612,7 +1578,8 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
]
}
},
{
@ -1639,10 +1606,14 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0
}
},
{
@ -1684,10 +1655,12 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
},
isTableForm: false,
isForm: false
},
]))
}
])
)
export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[]>([
export const SupplierdeliverRequestPackage = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '包装号',
field: 'number',
@ -1695,30 +1668,27 @@ export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[
isSearch: true,
table: {
fixed: 'left'
},
}
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
table: {
},
table: {}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
table: {
},
table: {}
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
},
table: {}
},
{
label: '计量单位',
@ -1729,8 +1699,7 @@ export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[
form: {
component: 'SelectV2'
},
table: {
},
},
]))
table: {}
}
])
)

Loading…
Cancel
Save