Browse Source

Merge branch 'intex' into intex_pandian

intex_pandian
赵雪冰 3 weeks ago
parent
commit
bc2294bb85
  1. 5
      src/api/wms/deliTimeWms/index.ts
  2. 58
      src/api/wms/modelCalendar/index.ts
  3. 4
      src/api/wms/modelDeliTime/index.ts
  4. 56
      src/api/wms/receivedNumberDeliDetail/index.ts
  5. 57
      src/api/wms/receivedNumberDeliMain/index.ts
  6. 359
      src/views/wms/basicDataManage/receivedNumberDeliMain/index.vue
  7. 114
      src/views/wms/basicDataManage/receivedNumberDeliMain/receivedNumberDeliDetail.data.ts
  8. 54
      src/views/wms/basicDataManage/receivedNumberDeliMain/receivedNumberDeliMain.data.ts
  9. 23
      src/views/wms/basicDataManage/supplierManage/deliTimeWms/deliTimeWms.data.ts
  10. 7
      src/views/wms/basicDataManage/supplierManage/deliTimeWms/index.vue
  11. 399
      src/views/wms/basicDataManage/supplierManage/modelCalendar/index.vue
  12. 73
      src/views/wms/basicDataManage/supplierManage/modelCalendar/modelcalendar.data.ts
  13. 114
      src/views/wms/basicDataManage/supplierManage/modelCalendar/modelcalendardetail.data.ts
  14. 60
      src/views/wms/basicDataManage/supplierManage/modelDeliTime/index.vue
  15. 33
      src/views/wms/basicDataManage/supplierManage/modelDeliTime/modelDeliTime.data.ts
  16. 11
      src/views/wms/supplierManage/supplierDeliMain/index.vue
  17. 18
      src/views/wms/supplierManage/supplierDeliMain/supplierDeliMain.data.ts

5
src/api/wms/deliTimeWms/index.ts

@ -50,4 +50,9 @@ export const exportDeliTime = async (params) => {
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/wms/deli-time-wms/get-import-template' }) return request.download({ url: '/wms/deli-time-wms/get-import-template' })
}
// 校验是否使用
export const getIsUse = async (id: number) => {
return await request.get({ url: `/wms/deli-time-wms/get?id=` + id })
} }

58
src/api/wms/modelCalendar/index.ts

@ -0,0 +1,58 @@
import request from '@/config/axios'
export interface ModelCalendarMainVO {
id: number
model: string
yearAndMonth: string
delayDeli: number
remark: string
available: string
siteId: string
concurrencyStamp: number
}
// 查询受入号日历主列表
export const getModelCalendarMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/model-calendar-main/senior', data })
} else {
return await request.get({ url: `/wms/model-calendar-main/page`, params })
}
}
// 查询受入号日历主详情
export const getModelCalendarMain = async (id: number) => {
return await request.get({ url: `/wms/model-calendar-main/get?id=` + id })
}
// 新增受入号日历主
export const createModelCalendarMain = async (data: ModelCalendarMainVO) => {
return await request.post({ url: `/wms/model-calendar-main/create`, data })
}
// 修改受入号日历主
export const updateModelCalendarMain = async (data: ModelCalendarMainVO) => {
return await request.put({ url: `/wms/model-calendar-main/update`, data })
}
// 删除受入号日历主
export const deleteModelCalendarMain = async (id: number) => {
return await request.delete({ url: `/wms/model-calendar-main/delete?ids=` + id })
}
// 导出受入号日历主 Excel
export const exportModelCalendarMain = async (params) => {
return await request.download({ url: `/wms/model-calendar-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/model-calendar-main/get-import-template' })
}
// 查询供应商便次配置列表
export const getPageTableHead = async (params) => {
return await request.get({ url: `/wms/supplier-deli-main/queryPageTableHead`, params })
}

4
src/api/wms/modelDeliTime/index.ts

@ -28,6 +28,10 @@ export const createSupplierAddrDeliTimeDetail = async (data: SupplierAddrDeliTim
return await request.post({ url: `/wms/model-deli-time-main/create`, data }) return await request.post({ url: `/wms/model-deli-time-main/create`, data })
} }
export const addModelDeliTimeDetail = async (data: SupplierAddrDeliTimeDetailVO) => {
return await request.post({ url: `/wms/model-deli-time-detail/addDetail`, data })
}
// 修改供应商地点便次时间配置明细 // 修改供应商地点便次时间配置明细
export const updateSupplierAddrDeliTimeDetail = async (data: SupplierAddrDeliTimeDetailVO) => { export const updateSupplierAddrDeliTimeDetail = async (data: SupplierAddrDeliTimeDetailVO) => {
return await request.put({ url: `/wms/model-deli-time-main/update`, data }) return await request.put({ url: `/wms/model-deli-time-main/update`, data })

56
src/api/wms/receivedNumberDeliDetail/index.ts

@ -0,0 +1,56 @@
import request from '@/config/axios'
export interface ReceivedNumberDeliDetailVO {
id: number
masterId: number
serial: number
deliNo: number
delayDeli: number
day: Date
beginTime: Date
remark: string
available: string
siteId: string
concurrencyStamp: number
}
// 查询受入号便次子列表
export const getReceivedNumberDeliDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/received-number-deli-detail/senior', data })
} else {
return await request.get({ url: `/wms/received-number-deli-detail/page`, params })
}
}
// 查询受入号便次子详情
export const getReceivedNumberDeliDetail = async (id: number) => {
return await request.get({ url: `/wms/received-number-deli-detail/get?id=` + id })
}
// 新增受入号便次子
export const createReceivedNumberDeliDetail = async (data: ReceivedNumberDeliDetailVO) => {
return await request.post({ url: `/wms/received-number-deli-detail/create`, data })
}
// 修改受入号便次子
export const updateReceivedNumberDeliDetail = async (data: ReceivedNumberDeliDetailVO) => {
return await request.put({ url: `/wms/received-number-deli-detail/update`, data })
}
// 删除受入号便次子
export const deleteReceivedNumberDeliDetail = async (id: number) => {
return await request.delete({ url: `/wms/received-number-deli-detail/delete?id=` + id })
}
// 导出受入号便次子 Excel
export const exportReceivedNumberDeliDetail = async (params) => {
return await request.download({ url: `/wms/received-number-deli-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/received-number-deli-detail/get-import-template' })
}

57
src/api/wms/receivedNumberDeliMain/index.ts

@ -0,0 +1,57 @@
import request from '@/config/axios'
export interface ReceivedNumberDeliMainVO {
id: number
model: string
yearAndMonth: string
remark: string
available: string
siteId: string
concurrencyStamp: number
}
// 查询受入号便次主列表
export const getReceivedNumberDeliMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/received-number-deli-main/senior', data })
} else {
return await request.get({ url: `/wms/received-number-deli-main/page`, params })
}
}
// 查询受入号便次主详情
export const getReceivedNumberDeliMain = async (id: number) => {
return await request.get({ url: `/wms/received-number-deli-main/get?id=` + id })
}
// 新增受入号便次主
export const createReceivedNumberDeliMain = async (data: ReceivedNumberDeliMainVO) => {
return await request.post({ url: `/wms/received-number-deli-main/create`, data })
}
// 修改受入号便次主
export const updateReceivedNumberDeliMain = async (data: ReceivedNumberDeliMainVO) => {
return await request.put({ url: `/wms/received-number-deli-main/update`, data })
}
// 删除受入号便次主
export const deleteReceivedNumberDeliMain = async (id: number) => {
return await request.delete({ url: `/wms/received-number-deli-main/delete?id=` + id })
}
// 导出受入号便次主 Excel
export const exportReceivedNumberDeliMain = async (params) => {
return await request.download({ url: `/wms/received-number-deli-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/received-number-deli-main/get-import-template' })
}
// 查询供应商便次配置列表
export const getPageTableHead = async (params) => {
return await request.get({ url: `/wms/received-number-deli-main/queryPageTableHead`, params })
}

359
src/views/wms/basicDataManage/receivedNumberDeliMain/index.vue

@ -0,0 +1,359 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ReceivedNumberDeliMain.allSchemas.searchSchema" @search="search" @reset="search" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ReceivedNumberDeliMain.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template v-for="item in dateColumns" :key="item.field" #[item.field]="{row}">
<div :style="{ maxHeight: getMaxHeight(row)}">
<div v-for="(cur,index) in row[item.field]" :key="index">
{{cur}}
</div>
</div>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="ReceivedNumberDeliMainRules"
:formAllSchemas="ReceivedNumberDeliMain.allSchemas"
:apiUpdate="SupplierDeliMainApi.updateSupplierDeliMain"
:apiCreate="SupplierDeliMainApi.createSupplierDeliMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ReceivedNumberDeliMain.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/basic/supplier-deli-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ReceivedNumberDeliMain,ReceivedNumberDeliMainRules } from './receivedNumberDeliMain.data'
import * as SupplierDeliMainApi from '@/api/wms/receivedNumberDeliMain'
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'
import { formatDate } from '@/utils/formatTime'
defineOptions({ name: 'ReceivedNumberDeliMain' })
// const array = [{
// field: "code1",
// isForm: false,
// isTable: true,
// isSearch: true,
// label: "1",
// sort: "custom",
// sortTableDefault: 999,
// width: 150,
// table:{
// width: 150,
// }
// }]
const orginTableColumns = ref(ReceivedNumberDeliMain.allSchemas.tableColumns)
const tableColumns = ref(ReceivedNumberDeliMain.allSchemas.tableColumns)
//
const updataTableColumns = (val: { [x: string]: any; field: string; label?: string | undefined; width?: string | number | undefined; fixed?: "left" | "right" | undefined; children?: any[] | undefined }[]) => {
orginTableColumns.value = val
}
const { tableObject:tableObjectHead, tableMethods:tableMethodsHead } = useTable({
getListApi: SupplierDeliMainApi.getPageTableHead //
})
//
const { getList: getListHead, setSearchParams: setSearchParamsHead } = tableMethodsHead
const search = (mold) => {
setSearchParamsHead(mold)
setSearchParams(mold)
}
const dateColumns = ref([])
watch(()=>tableObjectHead.tableList,()=>{
updateDateTableColumns()
},{deep:true})
const updateDateTableColumns = ()=>{
console.log('tableObjectHead', tableObjectHead)
dateColumns.value = []
if(tableObjectHead.tableList.length>10){
tableObjectHead.tableList.forEach(item=>{
dateColumns.value.push({
width:120,
field: item,
label: item
})
})
}else{
tableObjectHead.tableList.forEach(item=>{
dateColumns.value.push({
field: item,
label: item
})
})
}
tableColumns.value = [...orginTableColumns.value,...dateColumns.value]
console.log('tableColumns',tableColumns.value)
}
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
// const tableColumns = ref(SupplierDeliMain.allSchemas.tableColumns)
//
const searchTableSuccess = (formField: string | number, searchField: string | number, val: { [x: string]: any }[], formRef: { setValues: (arg0: {}) => void }) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
// const updataTableColumns = (val) => {
// tableColumns.value = val
// }
const { tableObject, tableMethods } = useTable({
getListApi: SupplierDeliMainApi.getReceivedNumberDeliMainPage //
})
//
const { getList, setSearchParams } = tableMethods
const getListExecute = () => {
tableObject.params.yearAndMonth=formatDate(new Date(),'YYYY-MM')
getList()
tableObject.tableList.forEach(item=>item.isOpen = false)
}
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:supplierDeliMain:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:supplierDeliMain:import'}), //
defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val: string, item: any) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getListHead()
getListExecute()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = (row) => {
const array = []
// 6
dateColumns.value.forEach(item => {
if (row[item.field]?.length > 6) {
array.push(row)
}
})
return [
{
label: t(`ts.展开更多`).replace('ts.', ''),
name: 'open',
hide: row.isOpen || array.length==0,
type: 'primary',
color: '',
link: true, //
hasPermi: ''
},
{
label: t(`ts.收起`).replace('ts.', ''),
name: 'retract',
hide: !row.isOpen || array.length==0,
type: 'primary',
color: '',
link: true, //
hasPermi: ''
}
]
}
// -
const buttonTableClick = async (val: string, row:any) => {
if (val == 'open') { //
// openForm('update', row)
row.isOpen = true
getMaxHeight(row)
} else if (val == 'retract') { //
row.isOpen = false
getMaxHeight(row)
// handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType: string,data: SupplierDeliMainApi.SupplierDeliMainVO) => {
var isHave =ReceivedNumberDeliMain.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 SupplierDeliMainApi.createSupplierDeliMain(data)
message.success(t('common.createSuccess'))
} else {
await SupplierDeliMainApi.updateSupplierDeliMain(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getListExecute()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicSupplierDeliMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await SupplierDeliMainApi.deleteSupplierDeliMain(id)
message.success(t('common.delSuccess'))
//
await getListExecute()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SupplierDeliMainApi.exportReceivedNumberDeliMain(tableObject.params)
download.excel(data, '受入号便次配置主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '供应商便次配置主导入模版.xlsx'
})
//
const importSuccess = () => {
getListExecute()
}
//
const searchFormClick = (searchData: { filters: any }) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getListExecute() //
}
const getMaxHeight=(row)=> {
//
if (row.isOpen === true) { //
return 'none'; //
}
return '140px'; //
}
/** 初始化 **/
onMounted(async () => {
getListHead()
getListExecute()
//importTemplateData.templateUrl = await SupplierDeliMainApi.importTemplate()
})
</script>
<style lang="scss">
// .el-table .cell.el-tooltip{
// height:140px;
// }
</style>

114
src/views/wms/basicDataManage/receivedNumberDeliMain/receivedNumberDeliDetail.data.ts

@ -0,0 +1,114 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
/*
export const SupplierDeliDetailRules = reactive({
masterId: [required],
deliNo: [required],
delayDeli: [required],
beginTime: [required],
})
*/
export const SupplierDeliDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false,
},
{
label: '主id',
field: 'masterId',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '便次',
field: 'deliNo',
sort: 'custom',
isSearch: true,
},
{
label: '延迟便次',
field: 'delayDeli',
sort: 'custom',
isSearch: true,
},
{
label: '开始时间',
field: 'beginTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
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'
}
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
{
label: '是否可用默认TRUE',
field: 'available',
sort: 'custom',
isSearch: true,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
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')]
}
},
isForm: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isSearch: true,
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

54
src/views/wms/basicDataManage/receivedNumberDeliMain/receivedNumberDeliMain.data.ts

@ -0,0 +1,54 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { formatDate } from '@/utils/formatTime'
// 表单校验
export const ReceivedNumberDeliMainRules = reactive({
supplierCode: [required],
supplierAddress: [required],
yearAndMonth: [required],
})
export const ReceivedNumberDeliMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '受入号',
field: 'model',
sort: 'custom',
isSearch: true,
table:{
width : 180
}
},
{
label: '延迟便次',
field: 'delayDeli',
sort: 'custom',
isSearch: false,
table:{
width : 180
}
},
{
label: '年月',
field: 'yearAndMonth',
sort: 'custom',
isTable: false,
isSearch: true,
search: {
component: 'DatePicker',
value: formatDate(new Date(),'YYYY-MM'),
componentProps: {
type: 'month',
valueFormat: 'YYYY-MM',
}
}
},
// {
// label: '操作',
// field: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
// }
]))

23
src/views/wms/basicDataManage/supplierManage/deliTimeWms/deliTimeWms.data.ts

@ -1,5 +1,5 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter, dateFormatterHHMMSS } from '@/utils/formatTime'
// 表单校验 // 表单校验
export const DeliTimeRules = reactive({ export const DeliTimeRules = reactive({
@ -36,23 +36,30 @@ export const DeliTimeWms = useCrudSchemas(reactive<CrudSchema[]>([
label: '开始时间', label: '开始时间',
field: 'beginTime', field: 'beginTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatterHHMMSS,
isSearch: true, isSearch: true,
table: {
width:120
},
search: { search: {
component: 'DatePicker', component: 'TimePicker',
componentProps: { componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss', type: 'time',
type: 'daterange', dateFormat: 'HH:mm:ss',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] valueFormat: 'x'
} }
}, },
form: { form: {
component: 'DatePicker', component: 'TimePicker',
componentProps: { componentProps: {
type: 'datetime', type: 'time',
dateFormat: 'HH:mm:ss',
valueFormat: 'x' valueFormat: 'x'
} }
}, },
detail: {
dateFormat:'HH:mm:ss'
}
}, },
{ {
label: '创建者', label: '创建者',

7
src/views/wms/basicDataManage/supplierManage/deliTimeWms/index.vue

@ -54,7 +54,7 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeliTimeWms.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="DeliTimeWms.allSchemas" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/basic/deli-time/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" url="/wms/deli-time-wms/import" :importTemplateData="importTemplateData" @success="importSuccess" :isShowOut="true" :updateIsDisable="true" :coverIsDisable="true" :mode="2"/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -191,6 +191,11 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id: number) => { const handleDelete = async (id: number) => {
const isUse = await DeliTimeWmsApi.getIsUse(id)
if (isUse) {
message.warning('该编号已经配置受入号便次时间,不可删除')
return
}
try { try {
// //
await message.delConfirm() await message.delConfirm()

399
src/views/wms/basicDataManage/supplierManage/modelCalendar/index.vue

@ -0,0 +1,399 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ModelCalendar.allSchemas.searchSchema" @search="search" @reset="search" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ModelCalendar.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
row-key="id"
:selection="true"
@getSelectionRows="getSelectionRows"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template v-for="item in dateColumns" :key="item.field" #[item.field]="{row}">
<div :style="{ maxHeight: getMaxHeight(row)}">
<div v-for="(cur,index) in row[item.field]" :key="index">
{{cur}}
</div>
</div>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="ModelCalendarRules"
:formAllSchemas="ModelCalendar.allSchemas"
:apiUpdate="ModelCalendarApi.updateSupplierDeliMain"
:apiCreate="ModelCalendarApi.createSupplierDeliMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ModelCalendar.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/model-calendar-main/import" :importTemplateData="importTemplateData" @success="importSuccess" :showDownLoad="false" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ModelCalendar, ModelCalendarRules } from './modelcalendar.data'
import * as ModelCalendarApi from '@/api/wms/modelCalendar'
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'
import { formatDate } from '@/utils/formatTime'
import { debug } from 'console'
defineOptions({ name: 'modelcalendar' })
// const array = [{
// field: "code1",
// isForm: false,
// isTable: true,
// isSearch: true,
// label: "1",
// sort: "custom",
// sortTableDefault: 999,
// width: 150,
// table:{
// width: 150,
// }
// }]
const orginTableColumns = ref(ModelCalendar.allSchemas.tableColumns)
const tableColumns = ref(ModelCalendar.allSchemas.tableColumns)
//
const updataTableColumns = (val: { [x: string]: any; field: string; label?: string | undefined; width?: string | number | undefined; fixed?: "left" | "right" | undefined; children?: any[] | undefined }[]) => {
orginTableColumns.value = val
}
const { tableObject:tableObjectHead, tableMethods:tableMethodsHead } = useTable({
getListApi: ModelCalendarApi.getPageTableHead //
})
//
const { getList: getListHead, setSearchParams: setSearchParamsHead } = tableMethodsHead
const search = (mold) => {
setSearchParamsHead(mold)
setSearchParams(mold)
}
const dateColumns = ref([])
watch(()=>tableObjectHead.tableList,()=>{
updateDateTableColumns()
},{deep:true})
const updateDateTableColumns = ()=>{
console.log('tableObjectHead', tableObjectHead)
dateColumns.value = []
if(tableObjectHead.tableList.length>10){
tableObjectHead.tableList.forEach(item=>{
dateColumns.value.push({
width:120,
field: item,
label: item
})
})
}else{
tableObjectHead.tableList.forEach(item=>{
dateColumns.value.push({
field: item,
label: item
})
})
}
tableColumns.value = [...orginTableColumns.value,...dateColumns.value]
console.log('tableColumns',tableColumns.value)
}
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
// const tableColumns = ref(ModelCalendar.allSchemas.tableColumns)
//
const searchTableSuccess = (formField: string | number, searchField: string | number, val: { [x: string]: any }[], formRef: { setValues: (arg0: {}) => void }) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
// const updataTableColumns = (val) => {
// tableColumns.value = val
// }
const { tableObject, tableMethods } = useTable({
getListApi: ModelCalendarApi.getModelCalendarMainPage //
})
//
const { getList, setSearchParams } = tableMethods
const getListExecute = () => {
tableObject.params.yearAndMonth=formatDate(new Date(),'YYYY-MM')
getList()
tableObject.tableList.forEach(item=>item.isOpen = false)
}
const selectionRowsData = ref([])//
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:supplierDeliMain:create'}), //
// defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn(null), //
defaultButtons.mainLisSelectiontDeleteBtn(null), //
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val: string, item: any) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'selection_delete') { //
handleDelete()
}else if (val == 'refresh') { //
getListHead()
getListExecute()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = (row) => {
const array = []
// 6
dateColumns.value.forEach(item => {
if (row[item.field]?.length > 6) {
array.push(row)
}
})
return [
{
label: t(`ts.展开更多`).replace('ts.', ''),
name: 'open',
hide: row.isOpen || array.length==0,
type: 'primary',
color: '',
link: true, //
hasPermi: ''
},
{
label: t(`ts.收起`).replace('ts.', ''),
name: 'retract',
hide: !row.isOpen || array.length==0,
type: 'primary',
color: '',
link: true, //
hasPermi: ''
},
defaultButtons.mainListDeleteBtn(null), //
]
}
// -
const buttonTableClick = async (val: string, row:any) => {
if (val == 'open') { //
// openForm('update', row)
row.isOpen = true
getMaxHeight(row)
} else if (val == 'retract') { //
row.isOpen = false
getMaxHeight(row)
} else if(val == 'delete'){
handleDelete(row)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType: string,data: ModelCalendarApi.SupplierDeliMainVO) => {
var isHave =ModelCalendar.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 ModelCalendarApi.createSupplierDeliMain(data)
message.success(t('common.createSuccess'))
} else {
await ModelCalendarApi.updateSupplierDeliMain(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getListExecute()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicSupplierDeliMain')
}
/** 删除按钮操作 */
// const handleDelete = async (row?:any) => {
// const handleDelete = async (id: number) => {
// try {
// //
// await message.delConfirm()
// //
// await ModelCalendarApi.deleteModelCalendarMain(id)
// message.success(t('common.delSuccess'))
// //
// await getListExecute()
// } catch {}
// }
const handleDelete = async (row?:any) => {
try {
//
let str
if (row) {
//
await message.delConfirm()
str = row.id
} else {
console.log(selectionRowsData.value)
if (selectionRowsData.value.length == 0) {
message.warning('请选择数据')
return
}
//
await message.delConfirm()
str = selectionRowsData.value.map(item=>item.id).join(',')
}
await ModelCalendarApi.deleteModelCalendarMain(str)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await ModelCalendarApi.exportModelCalendarMain(tableObject.params)
download.excel(data, '受入号日历.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '受入号日历导入模版.xlsx'
})
//
const importSuccess = () => {
getListExecute()
}
//
const searchFormClick = (searchData: { filters: any }) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getListExecute() //
}
const getMaxHeight=(row)=> {
//
if (row.isOpen === true) { //
return 'none'; //
}
return '140px'; //
}
const getSelectionRows = (currentPage,currentPageSelectionRows) => {
selectionRowsData.value = currentPageSelectionRows
console.log(selectionRowsData.value)
}
/** 初始化 **/
onMounted(async () => {
getListHead()
getListExecute()
importTemplateData.templateUrl = await ModelCalendarApi.importTemplate()
})
</script>
<style lang="scss">
// .el-table .cell.el-tooltip{
// height:140px;
// }
</style>

73
src/views/wms/basicDataManage/supplierManage/modelCalendar/modelcalendar.data.ts

@ -0,0 +1,73 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { formatDate } from '@/utils/formatTime'
// 表单校验
export const ModelCalendarRules = reactive({
supplierCode: [required],
supplierAddress: [required],
yearAndMonth: [required],
})
export const ModelCalendar = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '受入号',
// field: 'model',
// sort: 'custom',
// isSearch: true,
// table:{
// width : 180
// }
// },
// {
// label: '供应商地点',
// field: 'supplierAddress',
// sort: 'custom',
// isSearch: true,
// table:{
// width : 180
// }
// },
{
label: '受入号',
field: 'model',
sort: 'custom',
isSearch: true,
table:{
width : 180
}
},
{
label: '延迟便次',
field: 'delayDeli',
sort: 'custom',
isSearch: false,
table:{
width : 180
}
},
{
label: '年月',
field: 'yearAndMonth',
sort: 'custom',
isTable: false,
isSearch: true,
search: {
component: 'DatePicker',
value: formatDate(new Date(),'YYYY-MM'),
componentProps: {
type: 'month',
valueFormat: 'YYYY-MM',
clearable:false
}
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

114
src/views/wms/basicDataManage/supplierManage/modelCalendar/modelcalendardetail.data.ts

@ -0,0 +1,114 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
/*
export const SupplierDeliDetailRules = reactive({
masterId: [required],
deliNo: [required],
delayDeli: [required],
beginTime: [required],
})
*/
export const SupplierDeliDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false,
},
{
label: '主id',
field: 'masterId',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '便次',
field: 'deliNo',
sort: 'custom',
isSearch: true,
},
{
label: '延迟便次',
field: 'delayDeli',
sort: 'custom',
isSearch: true,
},
{
label: '开始时间',
field: 'beginTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
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'
}
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
{
label: '是否可用默认TRUE',
field: 'available',
sort: 'custom',
isSearch: true,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
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')]
}
},
isForm: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isSearch: true,
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

60
src/views/wms/basicDataManage/supplierManage/modelDeliTime/index.vue

@ -69,16 +69,31 @@
:apiCreate="ModelDeliTimeDetailApi.createPurchaseClaimRequestDetail" :apiCreate="ModelDeliTimeDetailApi.createPurchaseClaimRequestDetail"
:apiUpdate="ModelDeliTimeDetailApi.updatePurchaseClaimRequestDetail" :apiUpdate="ModelDeliTimeDetailApi.updatePurchaseClaimRequestDetail"
:apiPage="ModelDeliTimeDetailApi.getSupplierAddrDeliTimeDetailPage" :apiPage="ModelDeliTimeDetailApi.getSupplierAddrDeliTimeDetailPage"
:apiDelete="ModelDeliTimeDetailApi.deletePurchaseClaimRequestDetail" :apiDelete="ModelDeliTimeDetailApi.deleteSupplierAddrDeliTimeDetail"
:detailButtonIsShowDelete="true" :detailButtonIsShowDelete="true"
:detailButtonIsShowAdd="false" :detailButtonIsShowAdd="true"
:detailButtonIsShowEdit='false'
:detailButtonIsShowAddStatusArray="[]"
@searchTableSuccessDetail="searchTableSuccessDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
:isChangeDetailDrawer="[]"
:changeDetailDrawer="true"
@detailOpenForm="detailOpenForm" @detailOpenForm="detailOpenForm"
/> />
<SearchTable ref="searchTableRef" @searchTableSuccess="submitItem" />
<!-- :detailAllSchemas="ModelDeliTimeDetail.allSchemas" --> <!-- :detailAllSchemas="ModelDeliTimeDetail.allSchemas" -->
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/supplier-addr-deli-time-detail/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm
ref="importFormRef"
url="/wms/model-deli-time-detail/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
:isShowOut="true"
:updateIsDisable="true"
:appendIsDisable="true"
:mode="3"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -90,6 +105,8 @@ 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'
import { debug } from 'console' import { debug } from 'console'
import { DeliTimeWms } from '../deliTimeWms/deliTimeWms.data'
import * as DeliTimeWmsApi from '@/api/wms/deliTimeWms'
defineOptions({ name: 'ModelDeliTime' }) defineOptions({ name: 'ModelDeliTime' })
@ -359,7 +376,9 @@ const formsSuccess = async (formType,data) => {
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const detailData = ref({}) const detailData = ref({})
const masterId = ref(0)
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
masterId.value = row.masterId
detailData.value = row detailData.value = row
detailRef.value.openDetail(row, titleName, titleValue, 'basicSupplierAddrDeliTimeDetail') detailRef.value.openDetail(row, titleName, titleValue, 'basicSupplierAddrDeliTimeDetail')
} }
@ -417,6 +436,41 @@ const searchFormClick = (searchData) => {
getList() // getList() //
} }
const tableSelectionDelete = (selection) => {
tableData.value = tableData.value.filter((item) => !selection.includes(item))
}
const searchTableRef = ref()
const detailOpenForm = (type, row) => {
searchTableRef.value.open(
'便次时间配置',
DeliTimeWms.allSchemas,
DeliTimeWmsApi.getDeliTimePage,
null,
DeliTimeWms.allSchemas.searchSchema,
true,
null,
null,
null,
null,
null
// searchTableSelections.value
)
}
const submitItem = async (formType, data, val, tableList) => {
console.log('formType',formType)
console.log('data',data)
console.log('val',val)
console.log('tableList',tableList)
val.forEach((item) => {
item.masterId = masterId;
});
await ModelDeliTimeDetailApi.addModelDeliTimeDetail(val)
message.success(t('common.createSuccess'))
detailRef.value.updateList()
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

33
src/views/wms/basicDataManage/supplierManage/modelDeliTime/modelDeliTime.data.ts

@ -165,6 +165,10 @@ export const ModelDeliTime = useCrudSchemas(reactive<CrudSchema[]>([
form: { form: {
component: 'InputNumber', component: 'InputNumber',
value: 0, value: 0,
componentProps: {
min:0,
precision:0
}
}, },
}, },
{ {
@ -277,19 +281,32 @@ export const ModelDeliTimeDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'shift', field: 'shift',
sort: 'custom', sort: 'custom',
isForm: false, isForm: false,
dictType: DICT_TYPE.SHIFT,
dictClass: 'string',
tableForm:{ tableForm:{
disabled:true, disabled:true,
type:'Select'
} }
}, },
{ {
label: '开始时间', label: '操作',
field: 'beginTime', field: 'action',
sort: 'custom',
isForm: false, isForm: false,
formatter: dateFormatter, isTableForm:false,
tableForm:{ table: {
disabled:true, width: 150,
formatter: dateFormatter, fixed: 'right'
} }
}, }
// {
// label: '开始时间',
// field: 'beginTime',
// sort: 'custom',
// isForm: false,
// formatter: dateFormatter,
// tableForm:{
// disabled:true,
// formatter: dateFormatter,
// }
// },
])) ]))

11
src/views/wms/supplierManage/supplierDeliMain/index.vue

@ -33,7 +33,7 @@
</el-button> </el-button>
</template> </template>
<template v-for="item in dateColumns" :key="item.field" #[item.field]="{row}"> <template v-for="item in dateColumns" :key="item.field" #[item.field]="{row}">
<div :style="{ maxHeight: getHeight(row) }"> <div :style="{ maxHeight: getMaxHeight(row)}">
<div v-for="(cur,index) in row[item.field]" :key="index"> <div v-for="(cur,index) in row[item.field]" :key="index">
{{cur}} {{cur}}
</div> </div>
@ -240,10 +240,10 @@ const buttonTableClick = async (val: string, row:any) => {
if (val == 'open') { // if (val == 'open') { //
// openForm('update', row) // openForm('update', row)
row.isOpen = true row.isOpen = true
getHeight(row) getMaxHeight(row)
} else if (val == 'retract') { // } else if (val == 'retract') { //
row.isOpen = false row.isOpen = false
getHeight(row) getMaxHeight(row)
// handleDelete(row.id) // handleDelete(row.id)
} }
} }
@ -336,10 +336,11 @@ const searchFormClick = (searchData: { filters: any }) => {
} }
getListExecute() // getListExecute() //
} }
const getHeight=(row)=> {
const getMaxHeight=(row)=> {
// //
if (row.isOpen === true) { // if (row.isOpen === true) { //
return 'auto'; // return 'none'; //
} }
return '140px'; // return '140px'; //
} }

18
src/views/wms/supplierManage/supplierDeliMain/supplierDeliMain.data.ts

@ -60,13 +60,13 @@ export const SupplierDeliMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
// { {
// label: '操作', label: '操作',
// field: 'action', field: 'action',
// isForm: false, isForm: false,
// table: { table: {
// width: 150, width: 150,
// fixed: 'right' fixed: 'right'
// } }
// } }
])) ]))

Loading…
Cancel
Save