Browse Source

备货模块前端展示页面

master_hella_20240701
chenfang 9 months ago
parent
commit
2111bd98bc
  1. 16
      src/api/wms/stockupDetailRequest/index.ts
  2. 29
      src/api/wms/stockupMainRequest/index.ts
  3. 333
      src/views/wms/deliversettlementManage/stockup/stockupMainRequest/index.vue
  4. 500
      src/views/wms/deliversettlementManage/stockup/stockupMainRequest/stockupMainRequest.data.ts

16
src/api/wms/stockupDetailRequest/index.ts

@ -28,38 +28,38 @@ export const getStockupDetailRequestPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/request/stockup-detail-request/senior', data })
return await request.post({ url: '/wms/stockup-detail-request/senior', data })
} else {
return await request.get({ url: `/request/stockup-detail-request/page`, params })
return await request.get({ url: `/wms/stockup-detail-request/page`, params })
}
}
// 查询备货申请子详情
export const getStockupDetailRequest = async (id: number) => {
return await request.get({ url: `/request/stockup-detail-request/get?id=` + id })
return await request.get({ url: `/wms/stockup-detail-request/get?id=` + id })
}
// 新增备货申请子
export const createStockupDetailRequest = async (data: StockupDetailRequestVO) => {
return await request.post({ url: `/request/stockup-detail-request/create`, data })
return await request.post({ url: `/wms/stockup-detail-request/create`, data })
}
// 修改备货申请子
export const updateStockupDetailRequest = async (data: StockupDetailRequestVO) => {
return await request.put({ url: `/request/stockup-detail-request/update`, data })
return await request.put({ url: `/wms/stockup-detail-request/update`, data })
}
// 删除备货申请子
export const deleteStockupDetailRequest = async (id: number) => {
return await request.delete({ url: `/request/stockup-detail-request/delete?id=` + id })
return await request.delete({ url: `/wms/stockup-detail-request/delete?id=` + id })
}
// 导出备货申请子 Excel
export const exportStockupDetailRequest = async (params) => {
return await request.download({ url: `/request/stockup-detail-request/export-excel`, params })
return await request.download({ url: `/wms/stockup-detail-request/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/request/stockup-detail-request/get-import-template' })
return request.download({ url: '/wms/stockup-detail-request/get-import-template' })
}

29
src/api/wms/stockupMainRequest/index.ts

@ -71,3 +71,32 @@ export const exportStockupMainRequest = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/wms/stockup-main-request/get-import-template' })
}
// 关闭
export const close = (id) => {
return request.put({ url: '/wms/stockup-main-request/close?id=' + id })
}
// 重新添加
export const reAdd = (id) => {
return request.put({ url: '/wms/stockup-main-request/reAdd?id=' + id })
}
// 提交审批
export const submit = (id) => {
return request.put({ url: '/wms/stockup-main-request/submit?id=' + id })
}
// 驳回
export const refused = (id) => {
return request.put({ url: '/wms/stockup-main-request/refused?id=' + id })
}
// 审批通过
export const agree = (id) => {
return request.put({ url: '/wms/stockup-main-request/agree?id=' + id })
}
// 处理
export const handle = (id) => {
return request.put({ url: '/wms/stockup-main-request/handle?id=' + id })
}

333
src/views/wms/deliversettlementManage/stockup/stockupMainRequest/index.vue

@ -27,69 +27,70 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.code }}</span>
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
ref="formRef"
@success="getList"
:rules="StockupMainRequestRules"
:formAllSchemas="StockupMainRequest.allSchemas"
:tableAllSchemas="StockupDetailRequest.allSchemas"
:tableFormRules="StockupDetailRequestRules"
:tableData="tableData"
:apiUpdate="StockupMainRequestApi.updateStockupMainRequest"
:apiCreate="StockupMainRequestApi.createStockupMainRequest"
:apiCreate="StockupDetailRequestApi.createStockupDetailRequest"
:isBusiness="true"
fromeWhere="StockupMainRequest"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="formsSuccess"
:isShowButton = isShowButton
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="StockupDetailRequest.allSchemas"
:allSchemas="StockupMainRequest.allSchemas"
:detailAllSchemas="StockupDetailRequest.allSchemas"
:detailAllSchemasRules="StockupDetailRequestRules"
:apiCreate="StockupDetailRequestApi.createStockupDetailRequest"
:apiUpdate="StockupDetailRequestApi.updateStockupDetailRequest"
:apiPage="StockupDetailRequestApi.getStockupDetailRequestPage"
:apiDelete="StockupDetailRequestApi.deleteStockupDetailRequest"
fromeWhere="StockupDetailRequest"
@searchTableSuccessDetail="searchTableSuccessDetail"
:detailButtonIsShowAdd="true"
:detailButtonIsShowDelete="true"
:detailButtonIsShowAdd="trueFalse"
:detailButtonIsShowDelete="trueFalse"
@detailOpenForm="detailOpenForm"
/>
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/request/stockup-main-request/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm ref="importFormRef" url="/wms/stockup-main-request/import" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { StockupMainRequest,StockupMainRequestRules,StockupDetailRequest,StockupDetailRequestRules } from './stockupMainRequest.data'
import * as StockupMainRequestApi from '@/api/wms/stockupMainRequest/'
import * as StockupDetailRequestApi from '@/api/wms/stockupDetailRequest/'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { StockupMainRequest,StockupMainRequestRules,StockupDetailRequest,StockupDetailRequestRules } from './stockupMainRequest.data'
import * as StockupMainRequestApi from '@/api/wms/stockupMainRequest'
import * as StockupDetailRequestApi from '@/api/wms/stockupDetailRequest'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
//
defineOptions({ name: 'StockupMainRequest' })
const message = useMessage() //
@ -102,15 +103,38 @@ const tableColumns = ref(StockupMainRequest.allSchemas.tableColumns)
const isShowButton = ref(true)
// //
const trueFalse = ref(false)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
const setV = {}
setV[formField] = val[0][searchField]
if (type == 'tableForm') {
if(formField == 'packingNumber') {
row['packingNumber'] = val[0]['packingNumber']
row['containerNumber'] = val[0]['containerNumber']
row['batch'] = val[0]['batch']
row['inventoryStatus'] = val[0]['inventoryStatus']
row['fromLocationCode'] = val[0]['locationCode']
row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom']
} else {
row[formField] = val[0][searchField]
}
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
@ -120,11 +144,6 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: StockupMainRequestApi.getStockupMainRequestPage //
})
@ -134,9 +153,9 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:stockupMainRequest:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:stockupMainRequest:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:stockupMainRequest:export'}), //
defaultButtons.defaultAddBtn({hasPermi:'wms:stockup-main-request:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:stockup-main-request:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:stockup-main-request:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -154,27 +173,119 @@ const HeadButttondata = [
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
// resetShow()
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
getList()
}
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
//
const isShowMainButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:stockupMainRequest:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:stockupMainRequest:delete'}), //
]
const butttondata = (row) => {
return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:stockup-main-request:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']),hasPermi:'wms:stockup-main-request:reAdd'}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:stockup-main-request:submit'}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:stockup-main-request:refused'}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:stockup-main-request:agree'}), //
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:stockup-main-request:handle'}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:stockup-main-request:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:stockup-main-request:delete'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
if (val == 'mainClose') { //
await message.confirm('确认要关闭吗?')
tableObject.loading = true
StockupMainRequestApi.close(row.id).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainReAdd') { //
await message.confirm('确认要重新添加吗?')
tableObject.loading = true
StockupMainRequestApi.reAdd(row.id).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainSubmit') { //
await message.confirm('确认要提交审批吗?')
tableObject.loading = true
StockupMainRequestApi.submit(row.id).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainTurnDown') { //
await message.confirm('确认要驳回吗?')
tableObject.loading = true
StockupMainRequestApi.refused(row.id).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainApprove') { //
await message.confirm('确认要审批通过吗?')
tableObject.loading = true
StockupMainRequestApi.agree(row.id).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainHandle') { //
await message.confirm('确认要处理吗?')
tableObject.loading = true
StockupMainRequestApi.handle(row.id).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
@ -182,39 +293,11 @@ const buttonTableClick = async (val, row) => {
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
const formRef = ref()
const openForm = (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
// form
const formsSuccess = async (formType,data) => {
var isHave =StockupMainRequest.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await StockupMainRequestApi.createStockupMainRequest(data)
message.success(t('common.createSuccess'))
} else {
await StockupMainRequestApi.updateStockupMainRequest(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicStockupMainRequest')
}
/**
@ -222,16 +305,46 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
* @param row
*/
const detailOpenForm = (type) => {
// if(type == 'update'){
// StockupDetailRequest.allSchemas.formSchema.forEach(() => {
// if(itemDetail.field == 'itemCode'){
// itemDetail.componentProps.isSearchList = false
// itemDetail.componentProps.disabled = true
// }
// })}
// else {
// StockupDetailRequest.allSchemas.formSchema.forEach(() => {
// if(itemDetail.field == 'itemCode'){
// itemDetail.componentProps.isSearchList = true
// }s
// })
// }
}
//
// const { wsCache } = useCache()
// /** */
// const detailRef = ref()
// const openDetail = (row: any, titleName: any, titleValue: any) => {
// if(row.deliverPlanNumber != null){
// trueFalse.value = false
// }else {
// trueFalse.value = true
// }
// const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name
// if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
// detailRef.value.openDetail(row, titleName, titleValue,'requestDeliverMain')
// }
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
tableObject.loading = true
//
await StockupMainRequestApi.deleteStockupMainRequest(id)
tableObject.loading = false
message.success(t('common.delSuccess'))
//
await getList()
@ -253,6 +366,14 @@ const handleExport = async () => {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
StockupDetailRequest.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
@ -264,16 +385,66 @@ const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//true0
const flag = ref(false)
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
let isExist = false
tableData.value.forEach(item => {
// let rs = tableData.value.filter(filterItem => (filterItem.itemCode == item.itemCode))
// if(rs.length > 1) isExist = true
// })
// if (isExist) {
// formRef.value.formLoading = false
// return message.warning('')
// }
// data.subList.forEach(obj => {
// if(obj.qty == 0){
// message.warning(`0!`)
// flag.value = true
// return;
// }
})
// if(flag.value){
// formRef.value.formLoading = false
// return
// }
try {
if (formType === 'create') {
if(tableData.value.length <= 0){
message.warning(`子表明细不能为空!`)
flag.value = true
formRef.value.formLoading = false
return;
}
await StockupDetailRequestApi.createStockupDetailRequest(data)
message.success(t('common.createSuccess'))
} else {
await StockupDetailRequestApi.updateStockupDetailRequest(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '备货申请主导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
@ -288,10 +459,30 @@ const searchFormClick = (searchData) => {
getList() //
}
// /
//
const resetShow = async () => {
isShowButton.value = true // tableform
// tableform
StockupDetailRequest.allSchemas.tableFormColumns.map(item => {
// if(item.field == 'itemCode') {
// item.isInpuFocusShow = true
// item.tableForm.isInpuFocusShow = true
// item.tableForm.disabled = false
// }
// if(item.field == 'uom') {
// item.tableForm.disabled = false
// }
// if(item.field == 'available') {
// item.tableForm.disabled = false
// }
})
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await StockupMainRequestApi.importTemplate()
})
</script>

500
src/views/wms/deliversettlementManage/stockup/stockupMainRequest/stockupMainRequest.data.ts

@ -1,8 +1,42 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { TableColumn } from '@/types/table'
import { dateFormatter } from '@/utils/formatTime'
import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
import * as DeliverPlanMainApi from '@/api/wms/deliverPlanMain'
import { DeliverPlanMain } from '../../deliverplan/deliverPlanMain/deliverPlanMain.data'
import * as BalanceApi from '@/api/wms/balance'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
import * as locationApi from '@/api/wms/location'
import { Location } from '../../../basicDataManage/factoryModeling/location/location.data'
const { t } = useI18n() // 国际化
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = {
pageSize:10,
pageNo:1,
code:'StockupRequest'
}
const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData =data?.list[0]||{}
// 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept
// id 转str 否则form回显匹配不到
userDept.id = userDept.id.toString()
const userDeptArray:any = [userDept]
// 表单校验
export const StockupMainRequestRules = reactive({
// deliverPlanNumber: [
// { required: true, message: '请选择客户代码', trigger: 'change' }
// ],
})
export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
@ -11,36 +45,98 @@ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
field: 'number',
sort: 'custom',
isSearch: true,
table: {
width: 180,
fixed: 'left'
},
isForm: false,
},
{
label: '发货计划单号',
field: 'deliverPlanNumber',
sort: 'custom',
isSearch: true,
table: {
width: 140
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择发货计划单号', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '发货计划信息', // 查询弹窗标题
searchAllSchemas: DeliverPlanMain.allSchemas, // 查询弹窗所需类
searchPage: DeliverPlanMainApi.getDeliverPlanMainPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'status',
value: '6',
isMainValue: false
}]
}
}
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
isSearch: false,
table: {
width: 120
},
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择从仓库代码', // 输入框占位文本
// searchField: 'number', // 查询弹窗赋值字段
// searchTitle: '仓库信息', // 查询弹窗标题
// searchAllSchemas: Itemwarehouse.allSchemas, // 查询弹窗所需类
// searchPage: WarehouseApi.getWarehousePage, // 查询弹窗所需分页方法
// searchCondition: [{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }]
// }
// }
isForm: false
},
{
label: '到仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
isSearch: false,
table: {
width: 120
},
isForm: false,
},
{
label: '从库区类型范围',
field: 'fromAreaTypes',
dictType: DICT_TYPE.LOCATION_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
isSearch: false,
table: {
width: 150
},
isForm: false,
},
{
label: '从库区代码范围',
field: 'fromAreaCodes',
sort: 'custom',
isSearch: false,
table: {
width: 160
},
isForm: false
},
{
label: '业务类型',
@ -48,18 +144,38 @@ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: false,
form: {
component: 'SelectV2'
value: 'Stockup',
componentProps: {
disabled: true,
}
},
table: {
width: 110
},
isForm: false,
},
{
label: '备注',
field: 'remark',
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
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')]
}
},
table: {
width: 180
},
isForm: false,
},
{
label: '创建时间',
field: 'createTime',
label: '发货日期',
field: 'deliverDate',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
@ -71,7 +187,16 @@ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
table: {
width: 180
},
},
{
label: '申请时间',
@ -94,6 +219,9 @@ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
valueFormat: 'x'
}
},
table: {
width: 180
},
},
{
label: '截止时间',
@ -116,91 +244,190 @@ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
valueFormat: 'x'
}
},
table: {
width: 180
},
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
isSearch: false,
table: {
width: 150
},
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userDeptArray.find((account) => account.id == cellValue)?.name
},
form: {
value: userDept.id,
component: 'Select',
api: () => userDeptArray,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
}
}
}
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
isSearch: false,
form: {
component: 'Radio'
table: {
width: 150
},
isForm: false,
},
{
label: '自动提交',
field: 'autoCommit',
sort: 'custom',
isSearch: false,
},
{
label: '自动通过',
field: 'autoAgree',
sort: 'custom',
isSearch: false,
},
{
label: '自动执行',
field: 'autoExecute',
sort: 'custom',
isSearch: false,
},
{
label: '直接生成记录',
field: 'directCreateRecord',
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
},
{
label: '自动提交',
field: 'autoCommit',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.autoCommit,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '自动通过',
field: 'autoAgree',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.autoAgree,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '自动执行',
field: 'autoExecute',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.autoExecute,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '直接生成记录',
field: 'directCreateRecord',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.directCreateRecord,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '到库区类型范围',
field: 'toAreaTypes',
dictType: DICT_TYPE.LOCATION_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
isSearch: false,
table: {
width: 150
},
isForm: false,
},
{
label: '到库区范围',
label: '到库区代码范围',
field: 'toAreaCodes',
sort: 'custom',
isSearch: false,
},
{
label: '发货日期',
field: 'deliverDate',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
table: {
width: 120
},
isForm: false
},
{
label: '入库库存状态范围',
field: 'inInventoryStatuses',
sort: 'custom',
isSearch: false,
table: {
width: 170
},
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
tableForm: {
disabled: true,
type: 'Select',
width: 150
},
isForm: false
},
{
label: '出库库存状态范围',
field: 'outInventoryStatuses',
sort: 'custom',
isSearch: false,
table: {
width: 170
},
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
tableForm: {
disabled: true,
type: 'Select',
width: 150
},
isForm: false
},
{
label: '操作',
@ -215,16 +442,70 @@ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
// 表单校验
export const StockupDetailRequestRules = reactive({
itemCode: [required],
packingNumber: [
{ required: true, message: '请选择包装号', trigger: 'change' }
],
batch: [
{ required: true, message: '请选择批次', trigger: 'change' }
],
inventoryStatus: [
{ required: true, message: '请选择库存状态', trigger: 'change' }
],
uom: [
{ required: true, message: '请选择计量单位', trigger: 'change' }
],
itemCode: [
{ required: true, message: '请选择物料代码', trigger: 'change' }
],
toLocationCode : [
{ required: true, message: '请选择计量单位', trigger: 'change' }
]
})
//子表
// //子表
export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
tableForm:{
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择包装号',
searchField: 'packingNumber',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.getBalanceItemPage,
searchCondition: [
// {
// key:'customerCode', // 查询列表中字段
// value:'customerCode', // 指主表某字段
// message: '请选择客户代码!', // 当前置条件为空时 弹出信息提示
// isMainValue: true // 表示查询条件是主表的字段的值
// }
]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择包装号',
searchField: 'packingNumber',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.getBalanceItemPage,
searchCondition: [
// {
// key:'customerCode', // 查询列表中字段
// value:'customerCode', // 指主表某字段
// message: '请选择客户代码!', // 当前置条件为空时 弹出信息提示
// isMainValue: true // 表示查询条件是主表的字段的值
// }
]
}
}
},
{
label: '器具号',
@ -241,45 +522,77 @@ export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
table: {
width: 150
},
tableForm: {
disabled: true,
type: 'Select'
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '到货主代码',
field: 'toOwnerCode',
sort: 'custom',
isSearch: true,
isTableForm: false,
},
{
label: '到库位代码',
field: 'toLocationCode',
sort: 'custom',
isSearch: true,
tableForm:{
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择库位代码',
searchField: 'location',
searchTitle: '库位基础信息',
searchAllSchemas: Location.allSchemas,
searchPage: locationApi.getLocationPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
},
form: {
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择库位代码',
searchField: 'location',
searchTitle: '库位基础信息',
searchAllSchemas: Location.allSchemas,
searchPage: locationApi.getLocationPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '主表ID',
field: 'masterId',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
isTableForm: false,
},
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
isTableForm: false,
},
{
label: '创建时间',
@ -295,37 +608,49 @@ export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
isTableForm: false,
},
{
label: '物品代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
isSearch: true,
isTableForm: false,
},
{
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
isSearch: true,
isTableForm: false,
},
{
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
isSearch: true,
isTableForm: false,
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
isSearch: true,
isTableForm: false,
},
{
label: '数量',
@ -336,6 +661,25 @@ export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
@ -344,15 +688,7 @@ export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
field: 'fromOwnerCode',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
isTableForm: false,
}
]))

Loading…
Cancel
Save