Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into master_hella

master_hella_20240701
zhaoxuebing 8 months ago
parent
commit
41ac840fa5
  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) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} 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 { } 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) => { 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) => { 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) => { 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) => { 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 // 导出备货申请子 Excel
export const exportStockupDetailRequest = async (params) => { 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 = () => { 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 = () => { export const importTemplate = () => {
return request.download({ url: '/wms/stockup-main-request/get-import-template' }) 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:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #code="{row}"> <template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> <el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.code }}</span> <span>{{ row.number }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm <BasicForm
ref="basicFormRef" ref="formRef"
@success="formsSuccess" @success="getList"
:rules="StockupMainRequestRules" :rules="StockupMainRequestRules"
:formAllSchemas="StockupMainRequest.allSchemas" :formAllSchemas="StockupMainRequest.allSchemas"
:tableAllSchemas="StockupDetailRequest.allSchemas" :tableAllSchemas="StockupDetailRequest.allSchemas"
:tableFormRules="StockupDetailRequestRules" :tableFormRules="StockupDetailRequestRules"
:tableData="tableData" :tableData="tableData"
:apiUpdate="StockupMainRequestApi.updateStockupMainRequest" :apiUpdate="StockupMainRequestApi.updateStockupMainRequest"
:apiCreate="StockupMainRequestApi.createStockupMainRequest" :apiCreate="StockupDetailRequestApi.createStockupDetailRequest"
:isBusiness="true" :isBusiness="true"
fromeWhere="StockupMainRequest"
@handleAddTable="handleAddTable" @handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@submitForm="formsSuccess" @submitForm="submitForm"
:isShowButton = isShowButton
/> />
<!-- 详情 --> <!-- 详情 -->
<Detail <Detail
ref="detailRef" ref="detailRef"
:isBasic="false" :isBasic="false"
:allSchemas="StockupDetailRequest.allSchemas" :allSchemas="StockupMainRequest.allSchemas"
:detailAllSchemas="StockupDetailRequest.allSchemas" :detailAllSchemas="StockupDetailRequest.allSchemas"
:detailAllSchemasRules="StockupDetailRequestRules" :detailAllSchemasRules="StockupDetailRequestRules"
:apiCreate="StockupDetailRequestApi.createStockupDetailRequest" :apiCreate="StockupDetailRequestApi.createStockupDetailRequest"
:apiUpdate="StockupDetailRequestApi.updateStockupDetailRequest" :apiUpdate="StockupDetailRequestApi.updateStockupDetailRequest"
:apiPage="StockupDetailRequestApi.getStockupDetailRequestPage" :apiPage="StockupDetailRequestApi.getStockupDetailRequestPage"
:apiDelete="StockupDetailRequestApi.deleteStockupDetailRequest" :apiDelete="StockupDetailRequestApi.deleteStockupDetailRequest"
fromeWhere="StockupDetailRequest"
@searchTableSuccessDetail="searchTableSuccessDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
:detailButtonIsShowAdd="true" :detailButtonIsShowAdd="trueFalse"
:detailButtonIsShowDelete="true" :detailButtonIsShowDelete="trueFalse"
@detailOpenForm="detailOpenForm" @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> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { StockupMainRequest,StockupMainRequestRules,StockupDetailRequest,StockupDetailRequestRules } from './stockupMainRequest.data' import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import * as StockupMainRequestApi from '@/api/wms/stockupMainRequest/' import { StockupMainRequest,StockupMainRequestRules,StockupDetailRequest,StockupDetailRequestRules } from './stockupMainRequest.data'
import * as StockupDetailRequestApi from '@/api/wms/stockupDetailRequest/' import * as StockupMainRequestApi from '@/api/wms/stockupMainRequest'
import * as StockupDetailRequestApi from '@/api/wms/stockupDetailRequest'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
//
defineOptions({ name: 'StockupMainRequest' }) defineOptions({ name: 'StockupMainRequest' })
const message = useMessage() // const message = useMessage() //
@ -102,15 +103,38 @@ const tableColumns = ref(StockupMainRequest.allSchemas.tableColumns)
const isShowButton = ref(true) 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(() => { nextTick(() => {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
formRef.setValues(setV) 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 ) => { const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => { nextTick(() => {
@ -120,11 +144,6 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
}) })
} }
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: StockupMainRequestApi.getStockupMainRequestPage // getListApi: StockupMainRequestApi.getStockupMainRequestPage //
}) })
@ -134,9 +153,9 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:stockupMainRequest:create'}), // defaultButtons.defaultAddBtn({hasPermi:'wms:stockup-main-request:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:stockupMainRequest:import'}), // defaultButtons.defaultImportBtn({hasPermi:'wms:stockup-main-request:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:stockupMainRequest:export'}), // defaultButtons.defaultExportBtn({hasPermi:'wms:stockup-main-request:export'}), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
@ -154,27 +173,119 @@ const HeadButttondata = [
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') { //
openForm('create') openForm('create')
// resetShow()
} else if (val == 'import') { // } else if (val == 'import') { //
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') { //
handleExport() handleExport()
} else if (val == 'refresh') { // } 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 if (val == 'filtrate') { //
} else { // } else { //
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
//
const isShowMainButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// - // -
const butttondata = [ const butttondata = (row) => {
defaultButtons.mainListEditBtn({hasPermi:'wms:stockupMainRequest:update'}), // return [
defaultButtons.mainListDeleteBtn({hasPermi:'wms:stockupMainRequest:delete'}), // 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) => { 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) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
@ -182,39 +293,11 @@ const buttonTableClick = async (val, row) => {
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const formRef = ref()
const openForm = (type: string, row?: any) => { const openForm = (type: string, row?: number) => {
basicFormRef.value.open(type, row) 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 * @param row
*/ */
const detailOpenForm = (type) => { 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) => { const handleDelete = async (id: number) => {
try { try {
// //
await message.delConfirm() await message.delConfirm()
tableObject.loading = true
// //
await StockupMainRequestApi.deleteStockupMainRequest(id) await StockupMainRequestApi.deleteStockupMainRequest(id)
tableObject.loading = false
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()
@ -253,6 +366,14 @@ const handleExport = async () => {
exportLoading.value = false exportLoading.value = false
} }
} }
/**
* tableForm方法
*/
const tableFormKeys = {}
StockupDetailRequest.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([]) const tableData = ref([])
// //
@ -264,16 +385,66 @@ const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1) 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 importFormRef = ref()
const handleImport = () => { const handleImport = () => {
importFormRef.value.open() importFormRef.value.open()
} }
// //
const importTemplateData = reactive({ const importTemplateData = reactive({
templateUrl: '', templateUrl: '',
templateTitle: '备货申请主导入模版.xlsx' templateTitle: '备货申请主导入模版.xlsx'
}) })
// //
const importSuccess = () => { const importSuccess = () => {
getList() getList()
@ -288,10 +459,30 @@ const searchFormClick = (searchData) => {
getList() // 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 () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await StockupMainRequestApi.importTemplate() importTemplateData.templateUrl = await StockupMainRequestApi.importTemplate()
}) })
</script> </script>

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

@ -1,8 +1,42 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { TableColumn } from '@/types/table'
import { dateFormatter } from '@/utils/formatTime' 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({ export const StockupMainRequestRules = reactive({
// deliverPlanNumber: [
// { required: true, message: '请选择客户代码', trigger: 'change' }
// ],
}) })
export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
@ -11,36 +45,98 @@ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: 180,
fixed: 'left'
},
isForm: false,
}, },
{ {
label: '发货计划单号', label: '发货计划单号',
field: 'deliverPlanNumber', field: 'deliverPlanNumber',
sort: 'custom', 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: '从仓库代码', label: '从仓库代码',
field: 'fromWarehouseCode', field: 'fromWarehouseCode',
sort: 'custom', sort: 'custom',
isSearch: false, 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: '到仓库代码', label: '到仓库代码',
field: 'toWarehouseCode', field: 'toWarehouseCode',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
table: {
width: 120
},
isForm: false,
}, },
{ {
label: '从库区类型范围', label: '从库区类型范围',
field: 'fromAreaTypes', field: 'fromAreaTypes',
dictType: DICT_TYPE.LOCATION_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom', sort: 'custom',
isSearch: false, table: {
width: 150
},
isForm: false,
}, },
{ {
label: '从库区代码范围', label: '从库区代码范围',
field: 'fromAreaCodes', field: 'fromAreaCodes',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
table: {
width: 160
},
isForm: false
}, },
{ {
label: '业务类型', label: '业务类型',
@ -48,18 +144,38 @@ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
form: { form: {
component: 'SelectV2' value: 'Stockup',
componentProps: {
disabled: true,
}
}, },
table: {
width: 110
},
isForm: false,
}, },
{ {
label: '备注', label: '创建时间',
field: 'remark', field: 'createTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter,
isSearch: false, 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: '创建时间', label: '发货日期',
field: 'createTime', field: 'deliverDate',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: false, 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')] 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: '申请时间', label: '申请时间',
@ -94,6 +219,9 @@ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
valueFormat: 'x' valueFormat: 'x'
} }
}, },
table: {
width: 180
},
}, },
{ {
label: '截止时间', label: '截止时间',
@ -116,91 +244,190 @@ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
valueFormat: 'x' valueFormat: 'x'
} }
}, },
table: {
width: 180
},
}, },
{ {
label: '部门', label: '部门',
field: 'departmentCode', field: 'departmentCode',
sort: 'custom', 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: '状态', label: '状态',
field: 'status', field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom', sort: 'custom',
isSearch: false, table: {
form: { width: 150
component: 'Radio'
}, },
isForm: false,
}, },
{ {
label: '自动提交', label: '备注',
field: 'autoCommit', field: 'remark',
sort: 'custom',
isSearch: false,
},
{
label: '自动通过',
field: 'autoAgree',
sort: 'custom',
isSearch: false,
},
{
label: '自动执行',
field: 'autoExecute',
sort: 'custom',
isSearch: false,
},
{
label: '直接生成记录',
field: 'directCreateRecord',
sort: 'custom', sort: 'custom',
isSearch: false, 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: '到库区类型范围', label: '到库区类型范围',
field: 'toAreaTypes', field: 'toAreaTypes',
dictType: DICT_TYPE.LOCATION_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom', sort: 'custom',
isSearch: false, table: {
width: 150
},
isForm: false,
}, },
{ {
label: '到库区范围', label: '到库区代码范围',
field: 'toAreaCodes', field: 'toAreaCodes',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
}, table: {
{ width: 120
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'
}
}, },
isForm: false
}, },
{ {
label: '入库库存状态范围', label: '入库库存状态范围',
field: 'inInventoryStatuses', field: 'inInventoryStatuses',
sort: 'custom',
isSearch: false, 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: '出库库存状态范围', label: '出库库存状态范围',
field: 'outInventoryStatuses', field: 'outInventoryStatuses',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
table: {
width: 170
},
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
tableForm: {
disabled: true,
type: 'Select',
width: 150
},
isForm: false
}, },
{ {
label: '操作', label: '操作',
@ -215,16 +442,70 @@ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
// 表单校验 // 表单校验
export const StockupDetailRequestRules = reactive({ 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[]>([ export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '包装号', label: '包装号',
field: 'packingNumber', field: 'packingNumber',
sort: 'custom', 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: '器具号', label: '器具号',
@ -241,45 +522,77 @@ export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '库存状态', label: '库存状态',
field: 'inventoryStatus', field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom', sort: 'custom',
isSearch: true, table: {
form: { width: 150
component: 'Radio'
}, },
tableForm: {
disabled: true,
type: 'Select'
},
form: {
componentProps: {
disabled: true
}
}
}, },
{ {
label: '到货主代码', label: '到货主代码',
field: 'toOwnerCode', field: 'toOwnerCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isTableForm: false,
}, },
{ {
label: '到库位代码', label: '到库位代码',
field: 'toLocationCode', field: 'toLocationCode',
sort: 'custom', sort: 'custom',
isSearch: true, 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', label: '主表ID',
field: 'masterId', field: 'masterId',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
form: { isTableForm: false,
component: 'InputNumber',
value: 0
},
}, },
{ {
label: '单据号', label: '单据号',
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
}, isTableForm: false,
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
}, },
{ {
label: '创建时间', label: '创建时间',
@ -295,37 +608,49 @@ export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
} }
}, },
isForm: false, isTableForm: false,
}, },
{ {
label: '物品代码', label: '物品代码',
field: 'itemCode', field: 'itemCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
}, },
{ {
label: '物品名称', label: '物品名称',
field: 'itemName', field: 'itemName',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isTableForm: false,
}, },
{ {
label: '物品描述1', label: '物品描述1',
field: 'itemDesc1', field: 'itemDesc1',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isTableForm: false,
}, },
{ {
label: '物品描述2', label: '物品描述2',
field: 'itemDesc2', field: 'itemDesc2',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isTableForm: false,
}, },
{ {
label: '项目代码', label: '项目代码',
field: 'projectCode', field: 'projectCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isTableForm: false,
}, },
{ {
label: '数量', label: '数量',
@ -336,6 +661,25 @@ export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '计量单位', label: '计量单位',
field: 'uom', 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', sort: 'custom',
isSearch: true, isSearch: true,
}, },
@ -344,15 +688,7 @@ export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
field: 'fromOwnerCode', field: 'fromOwnerCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
}, isTableForm: false,
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
} }
])) ]))

Loading…
Cancel
Save