Browse Source

BUG修改

master_hella_20240701
parent
commit
b7c654d15b
  1. 140
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue
  2. 251
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

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

@ -2,7 +2,10 @@
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search <Search
:schema="[...PurchasereturnRequestMain.allSchemas.searchSchema,...PurchasereturnRequestDetail.allSchemas.searchSchema]" :schema="[
...PurchasereturnRequestMain.allSchemas.searchSchema,
...PurchasereturnRequestDetail.allSchemas.searchSchema
]"
@search="setSearchParams" @search="setSearchParams"
@reset="setSearchParams" @reset="setSearchParams"
/> />
@ -21,7 +24,8 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -129,9 +133,7 @@ import * as PurchasereturnRequestMainApi from '@/api/wms/purchasereturnRequestMa
import * as PurchasereturnRequestDetailApi from '@/api/wms/purchasereturnRequestDetail' import * as PurchasereturnRequestDetailApi from '@/api/wms/purchasereturnRequestDetail'
import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail' import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { import { SupplierdeliverRequestPackage } from '../../supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data'
SupplierdeliverRequestPackage
} from '../../supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data'
import * as PackageApi from '@/api/wms/package' import * as PackageApi from '@/api/wms/package'
import { getAccessToken } from '@/utils/auth' import { getAccessToken } from '@/utils/auth'
import * as BalanceApi from '@/api/wms/balance' import * as BalanceApi from '@/api/wms/balance'
@ -142,11 +144,14 @@ defineOptions({ name: 'PurchasereturnRequestMain' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const genLabelId = ref(); //ID const genLabelId = ref() //ID
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name 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) const isShowButton = ref(true)
@ -158,11 +163,20 @@ const onEnter = async (field,value)=>{
console.log(field, value) console.log(field, value)
if ('supplierCode' == field) { if ('supplierCode' == field) {
// //
formRef.value.opensearchTable('purchaseReceiptRecordNumber', 'number', '采购收货记录', PurchasereceiptRecordMain1.allSchemas, PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageReturn,[{ formRef.value.opensearchTable(
'purchaseReceiptRecordNumber',
'number',
'采购收货记录',
PurchasereceiptRecordMain1.allSchemas,
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageReturn,
[
{
key: 'supplierCode', key: 'supplierCode',
value: 'supplierCode', value: 'supplierCode',
isMainValue: true isMainValue: true
}]) }
]
)
} else if ('purchaseReceiptRecordNumber' == field) { } else if ('purchaseReceiptRecordNumber' == field) {
// //
} }
@ -183,10 +197,10 @@ const submitFormLabel = async (formType, submitData) => {
data.id = data.masterId data.id = data.masterId
} }
try { try {
console.log("formType==",formType) console.log('formType==', formType)
console.log("data==",data) console.log('data==', data)
data.subList = detatableData.tableList data.subList = detatableData.tableList
console.log("detatableData",detatableData) console.log('detatableData', detatableData)
await message.confirm(t('ts.是否为此数据生成标签?')) await message.confirm(t('ts.是否为此数据生成标签?'))
await PurchasereturnRequestMainApi.genLabel(data) //genLabelId.value await PurchasereturnRequestMainApi.genLabel(data) //genLabelId.value
isCreateLabel.value = true isCreateLabel.value = true
@ -213,15 +227,14 @@ const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row
// //
const searchTableSuccess = async (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('searchTableSuccess', formField, searchField, val, formRef, type, row)
console.log('searchTableSuccess123', val) console.log('searchTableSuccess123', val)
nextTick(async () => { nextTick(async () => {
if (type == 'tableForm') { if (type == 'tableForm') {
// //
row[formField] = val[0][searchField] row[formField] = val[0][searchField]
if(formField=='purchaseReceiptRecordNumber'){//-- if (formField == 'purchaseReceiptRecordNumber') {
//--
row['supplierCode'] = val[0]['supplierCode'] row['supplierCode'] = val[0]['supplierCode']
row['poNumber'] = val[0]['poNumber'] row['poNumber'] = val[0]['poNumber']
row['poLine'] = val[0]['poLine'] row['poLine'] = val[0]['poLine']
@ -289,7 +302,8 @@ const searchTableSuccess = async(formField, searchField, val, formRef, type, row
// PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({ // PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailListToRepeat({ PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailListToRepeat({
masterId: val[0]['masterId'] masterId: val[0]['masterId']
}).then((res) => { })
.then((res) => {
if (res) tableData.value = res if (res) tableData.value = res
tableData.value.forEach((item) => { tableData.value.forEach((item) => {
item.batch = item.toBatch item.batch = item.toBatch
@ -331,7 +345,8 @@ const searchTableSuccess = async(formField, searchField, val, formRef, type, row
item.tableForm.isInpuFocusShow = false item.tableForm.isInpuFocusShow = false
} }
}) })
}).catch((err) => { })
.catch((err) => {
console.log(err) console.log(err)
}) })
} }
@ -465,7 +480,9 @@ const isShowMainButton = (row, val) => {
// - // -
const butttondata = (row, $index) => { 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) { if (findIndex > -1 && findIndex < $index) {
return [] return []
} }
@ -497,7 +514,7 @@ const butttondata = (row,$index) => {
defaultButtons.mainListEditBtn({ defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['1']), hide: isShowMainButton(row, ['1']),
hasPermi: 'wms:purchasereceipt-request-main:update' hasPermi: 'wms:purchasereceipt-request-main:update'
}), // }) //
// { // {
// label: '', // label: '',
// name: 'ssbq', // name: 'ssbq',
@ -588,10 +605,15 @@ const { wsCache } = useCache()
const detailRef = ref() const detailRef = ref()
const purchaseReceiptRecordNumberRef = ref() const purchaseReceiptRecordNumberRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
purchaseReceiptRecordNumberRef.value = row.purchaseReceiptRecordNumber; purchaseReceiptRecordNumberRef.value = row.purchaseReceiptRecordNumber
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name const departmentCode = wsCache
.get(CACHE_KEY.DEPT)
.find((account) => account.id == row.departmentCode)?.name
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) 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') detailRef.value.openDetail(row, titleName, titleValue, 'requestPurchasereturnMain')
} }
@ -603,7 +625,8 @@ const handleClose = async (id: number) => {
await PurchasereturnRequestMainApi.closePurchasereturnRequestMain(id) await PurchasereturnRequestMainApi.closePurchasereturnRequestMain(id)
message.success(t('common.closeSuccess')) message.success(t('common.closeSuccess'))
await getList() await getList()
} catch {}finally{ } catch {
} finally {
tableObject.loading = false tableObject.loading = false
} }
} }
@ -616,7 +639,8 @@ const handleReAdd = async (id: number) => {
await PurchasereturnRequestMainApi.reAddPurchasereturnRequestMain(id) await PurchasereturnRequestMainApi.reAddPurchasereturnRequestMain(id)
message.success(t('common.reAddSuccess')) message.success(t('common.reAddSuccess'))
await getList() await getList()
} catch {}finally{ } catch {
} finally {
tableObject.loading = false tableObject.loading = false
} }
} }
@ -629,7 +653,8 @@ const handleAgree = async (id: number) => {
await PurchasereturnRequestMainApi.agreePurchasereturnRequestMain(id) await PurchasereturnRequestMainApi.agreePurchasereturnRequestMain(id)
message.success(t('common.agreeSuccess')) message.success(t('common.agreeSuccess'))
await getList() await getList()
} catch {}finally{ } catch {
} finally {
tableObject.loading = false tableObject.loading = false
} }
} }
@ -642,7 +667,8 @@ const handleRefused = async (id: number) => {
await PurchasereturnRequestMainApi.refusedPurchasereturnRequestMain(id) await PurchasereturnRequestMainApi.refusedPurchasereturnRequestMain(id)
message.success(t('common.refusedSuccess')) message.success(t('common.refusedSuccess'))
await getList() await getList()
} catch {}finally{ } catch {
} finally {
tableObject.loading = false tableObject.loading = false
} }
} }
@ -655,7 +681,8 @@ const handleHandle = async (id: number) => {
await PurchasereturnRequestMainApi.handlePurchasereturnRequestMain(id) await PurchasereturnRequestMainApi.handlePurchasereturnRequestMain(id)
message.success(t('common.handleSuccess')) message.success(t('common.handleSuccess'))
await getList() await getList()
} catch {}finally{ } catch {
} finally {
tableObject.loading = false tableObject.loading = false
} }
} }
@ -680,7 +707,9 @@ const handleExport = async () => {
await message.exportConfirm() await message.exportConfirm()
// //
exportLoading.value = true exportLoading.value = true
const data = await PurchasereturnRequestMainApi.exportPurchasereturnRequestMain(tableObject.params) const data = await PurchasereturnRequestMainApi.exportPurchasereturnRequestMain(
tableObject.params
)
download.excel(data, '采购退货申请主.xlsx') download.excel(data, '采购退货申请主.xlsx')
} catch { } catch {
} finally { } finally {
@ -698,12 +727,12 @@ PurchasereturnRequestDetail.allSchemas.tableFormColumns.forEach((item) => {
const tableData = ref([]) const tableData = ref([])
const originTableData = ref([]) const originTableData = ref([])
const searchTableRef = ref() const searchTableRef = ref()
// //
const handleAddTable = () => { const handleAddTable = () => {
const subTableDFata = originTableData.value.filter(
const subTableDFata = originTableData.value.filter(item=> !tableData.value.find(item1=>item1.id == item.id)) (item) => !tableData.value.find((item1) => item1.id == item.id)
)
if (subTableDFata.length == 0) { if (subTableDFata.length == 0) {
message.warning('暂无可选择数据!') message.warning('暂无可选择数据!')
return return
@ -736,7 +765,7 @@ const handleAddTable = () => {
item.width = item.table?.width || 150 item.width = item.table?.width || 150
}) })
searchTableRef.value.openData("采购收货记录单号",tableObject,{tableColumns},true) searchTableRef.value.openData('采购收货记录单号', tableObject, { tableColumns }, true)
// searchTableRef.value.open( // searchTableRef.value.open(
// ('', // ('',
// // _searchTableAllSchemas, // // _searchTableAllSchemas,
@ -750,7 +779,6 @@ const handleAddTable = () => {
// ) // )
// ) // )
// console.log(subTableDFata) // console.log(subTableDFata)
// const {tableObject, tableMethods } = useTable({ // const {tableObject, tableMethods } = useTable({
// getListApi: getPage.value // // getListApi: getPage.value //
@ -814,11 +842,10 @@ const handleDeleteTable = (item, index, formRef) => {
item.componentProps.disabled = false item.componentProps.disabled = false
} }
}) })
} }
} }
const tableSelectionDelete = (selection) => { 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) { if (tableData.value.length == 0) {
isShowButton.value = true isShowButton.value = true
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => {
@ -846,19 +873,19 @@ const submitForm = async (formType, submitData) => {
// message.warning("退") // message.warning("退")
// return; // return;
// } // }
if(tableData.value.find(item=>Number(item.qty)>Number(item.inventoryBalance))){ if (tableData.value.find((item) => Number(item.qty) > Number(item.inventoryBalance))) {
message.warning("退货数量不能大于库存余额") message.warning('退货数量不能大于库存余额')
return; return
} }
data.subList = tableData.value // data.subList = tableData.value //
try { try {
if (formType === 'create') { if (formType === 'create') {
let flag = false; let flag = false
data.subList.forEach((item) => { data.subList.forEach((item) => {
if (item.qty == 0) { if (item.qty == 0) {
message.warning("数量不能为0") message.warning('数量不能为0')
flag = true; flag = true
return; return
} }
}) })
if (flag) { if (flag) {
@ -881,14 +908,14 @@ const submitForm = async (formType, submitData) => {
// / // /
const detailValidate = (data) => { const detailValidate = (data) => {
let tag = false; let tag = false
if (data.qty <= 0) { if (data.qty <= 0) {
message.warning('数量必须大于0') message.warning('数量必须大于0')
tag = false; tag = false
return tag; return tag
} else { } else {
tag = true; tag = true
return tag; return tag
} }
} }
@ -919,9 +946,9 @@ const searchFormClick = (searchData) => {
} }
const detailOpenForm = (type, row) => { const detailOpenForm = (type, row) => {
console.log("type",type); console.log('type', type)
console.log("row",row); console.log('row', row)
console.log("AAAAAA",purchaseReceiptRecordNumberRef.value); console.log('AAAAAA', purchaseReceiptRecordNumberRef.value)
PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => { PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => {
if (purchaseReceiptRecordNumberRef.value == '') { if (purchaseReceiptRecordNumberRef.value == '') {
if (item.field == 'itemCode') { if (item.field == 'itemCode') {
@ -945,7 +972,6 @@ const detailOpenForm = (type, row) =>{
}) })
} }
const BASE_URL = getJmreportBaseUrl() const BASE_URL = getJmreportBaseUrl()
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) 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 showLabelRef = ref()
const labelPrint = async (row) => { const labelPrint = async (row) => {
tableObject.loading = true tableObject.loading = true
const defaultParams = {'moduleName':'purchasereturn','recordNumber':row.number} const defaultParams = { moduleName: 'purchasereturn', recordNumber: row.number }
const { tableObject: tableObjectPrint, tableMethods } = useTable({ const { tableObject: tableObjectPrint, tableMethods } = useTable({
defaultParams, defaultParams,
getListApi: PackageApi.getLabelDetailPage // getListApi: PackageApi.getLabelDetailPage //
@ -967,7 +993,7 @@ const labelPrint = async (row) => {
tableColumns.forEach((item) => { tableColumns.forEach((item) => {
item.width = item.table?.width || 150 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) console.log('批量打印', val)
if (val.length == 0) { if (val.length == 0) {
message.warning("请先选择要打印的数据!") message.warning('请先选择要打印的数据!')
return 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) console.log(res)
window.open(src.value + '&asn_number=' + res) window.open(src.value + '&asn_number=' + res)
}).catch(err => { })
.catch((err) => {
console.log(err) console.log(err)
message.error('创建标签失败') 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} * @returns {Array}
*/ */
export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>([ export const SupplierdeliverRequestMain = useCrudSchemas(
reactive<CrudSchema[]>([
{ {
label: '单据号', label: '单据号',
field: 'number', field: 'number',
@ -44,7 +45,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
fixed: 'left' fixed: 'left'
}, },
isForm: false, isForm: false,
isSearch: true, isSearch: true
}, },
{ {
label: '供应商代码', label: '供应商代码',
@ -111,9 +112,10 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
}, },
{ {
key: 'available', key: 'available',
value: "TRUE", value: 'TRUE',
isMainValue: false isMainValue: false
}] }
]
} }
} }
}, },
@ -124,7 +126,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
isTable: false, isTable: false,
table: { table: {
width: 150 width: 150
}, }
}, },
{ {
label: '联系人电话', label: '联系人电话',
@ -133,7 +135,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
isTable: false, isTable: false,
table: { table: {
width: 150 width: 150
}, }
}, },
{ {
label: '联系人电子邮件', label: '联系人电子邮件',
@ -142,7 +144,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
isTable: false, isTable: false,
table: { table: {
width: 150 width: 150
}, }
}, },
{ {
label: '供应商发货仓库代码', label: '供应商发货仓库代码',
@ -208,9 +210,9 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
style: { width: '100%' }, style: { width: '100%' },
type: 'datetime', type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', valueFormat: 'x'
}
} }
},
}, },
{ {
label: '承运商', label: '承运商',
@ -219,7 +221,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
isTable: false, isTable: false,
table: { table: {
width: 150 width: 150
}, }
}, },
{ {
label: '运输方式', label: '运输方式',
@ -229,7 +231,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
isTable: false, isTable: false,
table: { table: {
width: 150 width: 150
}, }
}, },
{ {
label: '车牌号', label: '车牌号',
@ -238,7 +240,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
isTable: false, isTable: false,
table: { table: {
width: 150 width: 150
}, }
}, },
// { // {
// label: '业务类型', // label: '业务类型',
@ -281,7 +283,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
style: { width: '100%' }, style: { width: '100%' },
type: 'datetime', type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', valueFormat: 'x'
} }
}, },
isForm: false isForm: false
@ -314,7 +316,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
style: { width: '100%' }, style: { width: '100%' },
type: 'datetime', type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', valueFormat: 'x'
} }
}, },
isForm: false isForm: false
@ -337,7 +339,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
style: { width: '100%' }, style: { width: '100%' },
type: 'datetime', type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', valueFormat: 'x'
} }
}, },
isForm: false isForm: false
@ -402,7 +404,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
style: { width: '100%' }, style: { width: '100%' },
type: 'datetime', type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', valueFormat: 'x'
} }
}, },
isForm: false isForm: false
@ -434,7 +436,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
componentProps: { componentProps: {
inactiveValue: 'FALSE', inactiveValue: 'FALSE',
activeValue: 'TRUE', activeValue: 'TRUE',
disabled: true, disabled: true
} }
} }
}, },
@ -455,7 +457,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
componentProps: { componentProps: {
inactiveValue: 'FALSE', inactiveValue: 'FALSE',
activeValue: 'TRUE', activeValue: 'TRUE',
disabled: true, disabled: true
} }
} }
}, },
@ -476,7 +478,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
componentProps: { componentProps: {
inactiveValue: 'FALSE', inactiveValue: 'FALSE',
activeValue: 'TRUE', activeValue: 'TRUE',
disabled: true, disabled: true
} }
} }
}, },
@ -497,7 +499,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
componentProps: { componentProps: {
inactiveValue: 'FALSE', inactiveValue: 'FALSE',
activeValue: 'TRUE', activeValue: 'TRUE',
disabled: true, disabled: true
} }
} }
}, },
@ -509,24 +511,17 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
table: { table: {
width: 450, width: 450,
fixed: 'right' fixed: 'right'
},
} }
])) }
])
)
//表单校验 //表单校验
export const SupplierdeliverRequestMainRules = reactive({ export const SupplierdeliverRequestMainRules = reactive({
supplierCode: [ supplierCode: [{ required: true, message: '请输入供应商代码', trigger: 'blur' }],
{ required: true, message: '请输入供应商代码', trigger: 'blur' } ppNumber: [{ required: true, message: '请输入要货计划单号', trigger: 'blur' }],
], asnNumber: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }],
ppNumber: [ contactName: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }],
{ 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' }
@ -535,36 +530,20 @@ 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: [ carrierCode: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }],
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } transferMode: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }],
], vehiclePlateNumber: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }],
transferMode: [ remark: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }],
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } planArriveTime: [{ required: true, message: '请输入计划到货时间', 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: [ autoCommit: [{ required: true, message: '请选择是否自动提交', trigger: 'change' }],
{ required: true, message: '请选择是否自动提交', trigger: 'change' } autoAgree: [{ 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' }
// ], // ],
@ -573,7 +552,8 @@ export const SupplierdeliverRequestMainRules = reactive({
/** /**
* @returns {Array} * @returns {Array}
*/ */
export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([ export const SupplierdeliverRequestDetail = useCrudSchemas(
reactive<CrudSchema[]>([
{ {
label: '采购订单号', label: '采购订单号',
field: 'poNumber', field: 'poNumber',
@ -603,7 +583,6 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
} }
] ]
} }
}, },
@ -625,7 +604,8 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
}] }
]
} }
}, },
{ {
@ -702,13 +682,13 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
style: { width: '100%' }, style: { width: '100%' },
type: 'date', type: 'date',
dateFormat: 'YYYY-MM-DD', dateFormat: 'YYYY-MM-DD',
valueFormat: 'x', valueFormat: 'x'
} }
}, },
tableForm: { tableForm: {
type: 'FormDate', type: 'FormDate',
dateFormat: 'YYYY-MM-DD', dateFormat: 'YYYY-MM-DD',
valueFormat: 'x', valueFormat: 'x'
} }
}, },
@ -741,7 +721,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
style: { width: '100%' }, style: { width: '100%' },
type: 'date', type: 'date',
dateFormat: 'YYYY-MM-DD', dateFormat: 'YYYY-MM-DD',
valueFormat: 'x', valueFormat: 'x'
} }
}, },
@ -749,7 +729,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
tableForm: { tableForm: {
type: 'FormDate', type: 'FormDate',
dateFormat: 'YYYY-MM-DD', dateFormat: 'YYYY-MM-DD',
valueFormat: 'x', valueFormat: 'x'
} }
}, },
{ {
@ -770,7 +750,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
style: { width: '100%' }, style: { width: '100%' },
type: 'date', type: 'date',
dateFormat: 'YYYY-MM-DD', dateFormat: 'YYYY-MM-DD',
valueFormat: 'x', valueFormat: 'x'
} }
}, },
// tableForm: { // tableForm: {
@ -1001,7 +981,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
style: { width: '100%' }, style: { width: '100%' },
type: 'datetime', type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', valueFormat: 'x'
} }
}, },
sort: 'custom', sort: 'custom',
@ -1009,7 +989,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
width: 180 width: 180
}, },
isTableForm: false, isTableForm: false,
isForm: false, isForm: false
}, },
{ {
label: '创建者', label: '创建者',
@ -1020,7 +1000,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
}, },
hiddenInMain: true, hiddenInMain: true,
isTableForm: false, isTableForm: false,
isForm: false, isForm: false
}, },
{ {
label: '最后更新时间', label: '最后更新时间',
@ -1035,7 +1015,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
style: { width: '100%' }, style: { width: '100%' },
type: 'datetime', type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', valueFormat: 'x'
} }
}, },
hiddenInMain: true, hiddenInMain: true,
@ -1044,7 +1024,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
width: 180 width: 180
}, },
isTableForm: false, isTableForm: false,
isForm: false, isForm: false
}, },
{ {
label: '最后更新者', label: '最后更新者',
@ -1055,7 +1035,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
}, },
hiddenInMain: true, hiddenInMain: true,
isTableForm: false, isTableForm: false,
isForm: false, isForm: false
}, },
{ {
label: '备注', label: '备注',
@ -1064,7 +1044,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
hiddenInMain: true, hiddenInMain: true,
table: { table: {
width: 150 width: 150
}, }
}, },
{ {
label: '操作', label: '操作',
@ -1076,20 +1056,21 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
width: 180, width: 180,
fixed: 'right' fixed: 'right'
}, },
isTableForm: false, isTableForm: false
} }
])) ])
)
// 批次校验 // 批次校验
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()
} }
} }
} }
@ -1098,50 +1079,33 @@ export const SupplierdeliverRequestDetailRules = reactive({
// packingNumber: [ // packingNumber: [
// { required: true, message: '请输入包装号', trigger: 'blur' } // { required: true, message: '请输入包装号', trigger: 'blur' }
// ], // ],
qty:[ qty: [{ required: true, message: '请输入发货数量', trigger: 'change' }],
{ required: true, message: '请输入发货数量', 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: [ produceDate: [{ required: true, message: '请输入生产日期', trigger: 'blur' }],
{ 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'}]
}) })
export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSchema[]>([ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(
reactive<CrudSchema[]>([
{ {
label: '批次', label: '批次',
field: 'batch', field: 'batch',
@ -1171,15 +1135,14 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
style: { width: '100%' }, style: { width: '100%' },
type: 'date', type: 'date',
dateFormat: 'YYYY-MM-DD', dateFormat: 'YYYY-MM-DD',
valueFormat: 'x', valueFormat: 'x'
} }
}, },
tableForm: { tableForm: {
disabled: true, disabled: true,
type: 'FormDate', type: 'FormDate',
dateFormat: 'YYYY-MM-DD', dateFormat: 'YYYY-MM-DD',
valueFormat: 'x', valueFormat: 'x'
} }
}, },
// { // {
@ -1214,7 +1177,7 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
style: { width: '100%' }, style: { width: '100%' },
type: 'date', type: 'date',
dateFormat: 'YYYY-MM-DD', dateFormat: 'YYYY-MM-DD',
valueFormat: 'x', valueFormat: 'x'
} }
}, },
isTableForm: false, isTableForm: false,
@ -1222,7 +1185,7 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
disabled: true, disabled: true,
type: 'FormDate', type: 'FormDate',
dateFormat: 'YYYY-MM-DD', dateFormat: 'YYYY-MM-DD',
valueFormat: 'x', valueFormat: 'x'
} }
}, },
{ {
@ -1230,7 +1193,7 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
field: 'expireDate', field: 'expireDate',
formatter: dateFormatter2, formatter: dateFormatter2,
detail: { detail: {
dateFormat: 'YYYY-MM-DD', dateFormat: 'YYYY-MM-DD'
}, },
sort: 'custom', sort: 'custom',
table: { table: {
@ -1243,14 +1206,14 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
style: { width: '100%' }, style: { width: '100%' },
type: 'date', type: 'date',
dateFormat: 'YYYY-MM-DD', dateFormat: 'YYYY-MM-DD',
valueFormat: 'x', valueFormat: 'x'
} }
}, },
tableForm: { tableForm: {
disabled: true, disabled: true,
type: 'FormDate', type: 'FormDate',
dateFormat: 'YYYY-MM-DD', dateFormat: 'YYYY-MM-DD',
valueFormat: 'x', valueFormat: 'x'
} }
}, },
{ {
@ -1282,7 +1245,6 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
} }
] ]
} }
}, },
@ -1305,7 +1267,8 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
}] }
]
} }
}, },
{ {
@ -1504,7 +1467,6 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
isMainValue: false isMainValue: false
} }
] ]
} }
}, },
tableForm: { tableForm: {
@ -1527,7 +1489,8 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
}] }
]
} }
}, },
{ {
@ -1554,10 +1517,14 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
width: 150 width: 150
}, },
form: { form: {
component: 'InputNumber',
componentProps: { componentProps: {
min: 0
} }
}, },
tableForm: { tableForm: {
type: 'InputNumber',
min: 0
} }
}, },
{ {
@ -1588,7 +1555,6 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
isMainValue: false isMainValue: false
} }
] ]
} }
}, },
tableForm: { tableForm: {
@ -1612,7 +1578,8 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
}] }
]
} }
}, },
{ {
@ -1639,10 +1606,14 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
width: 150 width: 150
}, },
form: { form: {
component: 'InputNumber',
componentProps: { componentProps: {
min: 0
} }
}, },
tableForm: { tableForm: {
type: 'InputNumber',
min: 0
} }
}, },
{ {
@ -1684,10 +1655,12 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
}, },
isTableForm: false, isTableForm: false,
isForm: false isForm: false
}, }
])) ])
)
export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[]>([ export const SupplierdeliverRequestPackage = useCrudSchemas(
reactive<CrudSchema[]>([
{ {
label: '包装号', label: '包装号',
field: 'number', field: 'number',
@ -1695,30 +1668,27 @@ export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[
isSearch: true, isSearch: true,
table: { table: {
fixed: 'left' fixed: 'left'
}, }
}, },
{ {
label: '物料代码', label: '物料代码',
field: 'itemCode', field: 'itemCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: { table: {}
},
}, },
{ {
label: '批次', label: '批次',
field: 'batch', field: 'batch',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: { table: {}
},
}, },
{ {
label: '数量', label: '数量',
field: 'qty', field: 'qty',
sort: 'custom', sort: 'custom',
table: { table: {}
},
}, },
{ {
label: '计量单位', label: '计量单位',
@ -1729,8 +1699,7 @@ export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[
form: { form: {
component: 'SelectV2' component: 'SelectV2'
}, },
table: { table: {}
}, }
}, ])
)
]))

Loading…
Cancel
Save