Browse Source

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

master_hella_20240701
陈宜阳 8 months ago
parent
commit
b6505965c3
  1. 2
      README.md
  2. 71
      src/api/wms/productredressJobDetail/index.ts
  3. 87
      src/api/wms/productredressJobMain/index.ts
  4. 77
      src/api/wms/productredressRecordDetail/index.ts
  5. 70
      src/api/wms/productredressRecordMain/index.ts
  6. 73
      src/api/wms/productredressRequestDetail/index.ts
  7. 100
      src/api/wms/productredressRequestMain/index.ts
  8. 8
      src/components/SearchHigh/src/SearchHigh.vue
  9. 244
      src/views/wms/productionManage/productredress/productredressJobMain/index.vue
  10. 523
      src/views/wms/productionManage/productredress/productredressJobMain/productredressJobMain.data.ts
  11. 244
      src/views/wms/productionManage/productredress/productredressRecordMain/index.vue
  12. 446
      src/views/wms/productionManage/productredress/productredressRecordMain/productredressRecordMain.data.ts
  13. 501
      src/views/wms/productionManage/productredress/productredressRequestMain/index.vue
  14. 595
      src/views/wms/productionManage/productredress/productredressRequestMain/productredressRequestMain.data.ts
  15. 3
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue
  16. 3
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

2
README.md

@ -23,6 +23,8 @@ form: {
]
}
}
**tableForm明细列表查询弹窗配置**
tableForm:{
isInpuFocusShow: true, // 开启查询弹窗 【**与form表单中唯一不同属性**】

71
src/api/wms/productredressJobDetail/index.ts

@ -0,0 +1,71 @@
import request from '@/config/axios'
export interface ProductredressJobDetailVO {
id: number
productionLineCode: string
workStationCode: string
processCode: string
packingNumber: string
containerNumber: string
batch: string
produceDate: Date
expireDate: Date
inventoryStatus: string
toLocationCode: string
woNumber: string
woLine: string
packQty: number
packUnit: string
itemCode: string
itemName: string
itemDesc1: string
itemDesc2: string
projectCode: string
qty: number
uom: string
masterId: number
number: string
remark: string
toOwnerCode: string
}
// 查询制品回收任务子列表
export const getProductredressJobDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/productredress-job-detail/senior', data })
} else {
return await request.get({ url: `/wms/productredress-job-detail/page`, params })
}
}
// 查询制品回收任务子详情
export const getProductredressJobDetail = async (id: number) => {
return await request.get({ url: `/wms/productredress-job-detail/get?id=` + id })
}
// 新增制品回收任务子
export const createProductredressJobDetail = async (data: ProductredressJobDetailVO) => {
return await request.post({ url: `/wms/productredress-job-detail/create`, data })
}
// 修改制品回收任务子
export const updateProductredressJobDetail = async (data: ProductredressJobDetailVO) => {
return await request.put({ url: `/wms/productredress-job-detail/update`, data })
}
// 删除制品回收任务子
export const deleteProductredressJobDetail = async (id: number) => {
return await request.delete({ url: `/wms/productredress-job-detail/delete?id=` + id })
}
// 导出制品回收任务子 Excel
export const exportProductredressJobDetail = async (params) => {
return await request.download({ url: `/wms/productredress-job-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/productredress-job-detail/get-import-template' })
}

87
src/api/wms/productredressJobMain/index.ts

@ -0,0 +1,87 @@
import request from '@/config/axios'
export interface ProductredressJobMainVO {
id: number
requestNumber: string
productionPlanNumber: string
workShopCode: string
team: string
shift: string
details: string
requestTime: Date
requestDueTime: Date
status: string
expiredTime: Date
jobStageStatus: string
priority: number
priorityIncrement: number
departmentCode: string
userGroupCode: string
acceptUserId: string
acceptUserName: string
acceptTime: Date
completeUserId: string
completeUserName: string
completeTime: Date
toWarehouseCode: string
toAreaCodes: string
fromAreaTypes: string
toAreaTypes: string
number: string
type: string
businessType: string
remark: string
autoComplete: string
allowModifyLocation: string
allowModifyQty: string
allowBiggerQty: string
allowSmallerQty: string
allowModifyInventoryStatus: string
allowContinuousScanning: string
allowPartialComplete: string
allowModifyBatch: string
allowModifyPackingNumber: string
inInventoryStatuses: string
outInventoryStatuses: string
}
// 查询制品回收任务主列表
export const getProductredressJobMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/productredress-job-main/senior', data })
} else {
return await request.get({ url: `/wms/productredress-job-main/page`, params })
}
}
// 查询制品回收任务主详情
export const getProductredressJobMain = async (id: number) => {
return await request.get({ url: `/wms/productredress-job-main/get?id=` + id })
}
// 新增制品回收任务主
export const createProductredressJobMain = async (data: ProductredressJobMainVO) => {
return await request.post({ url: `/wms/productredress-job-main/create`, data })
}
// 修改制品回收任务主
export const updateProductredressJobMain = async (data: ProductredressJobMainVO) => {
return await request.put({ url: `/wms/productredress-job-main/update`, data })
}
// 删除制品回收任务主
export const deleteProductredressJobMain = async (id: number) => {
return await request.delete({ url: `/wms/productredress-job-main/delete?id=` + id })
}
// 导出制品回收任务主 Excel
export const exportProductredressJobMain = async (params) => {
return await request.download({ url: `/wms/productredress-job-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/productredress-job-main/get-import-template' })
}

77
src/api/wms/productredressRecordDetail/index.ts

@ -0,0 +1,77 @@
import request from '@/config/axios'
export interface ProductredressRecordDetailVO {
id: number
productionlineCode: string
workStationCode: string
processCode: string
packingNumber: string
containerNumber: string
batch: string
produceDate: Date
expireDate: Date
inventoryStatus: string
toLocationCode: string
toLocationGroupCode: string
toAreaCode: string
toOwnerCode: string
woNumber: string
woLine: string
packQty: number
packUnit: string
bomVersion: string
backFlushDetails: string
masterId: number
number: string
itemCode: string
remark: string
siteId: string
itemName: string
itemDesc1: string
itemDesc2: string
projectCode: string
qty: number
uom: string
interfaceType: string
}
// 查询制品回收记录子列表
export const getProductredressRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/productredress-record-detail/senior', data })
} else {
return await request.get({ url: `/wms/productredress-record-detail/page`, params })
}
}
// 查询制品回收记录子详情
export const getProductredressRecordDetail = async (id: number) => {
return await request.get({ url: `/wms/productredress-record-detail/get?id=` + id })
}
// 新增制品回收记录子
export const createProductredressRecordDetail = async (data: ProductredressRecordDetailVO) => {
return await request.post({ url: `/wms/productredress-record-detail/create`, data })
}
// 修改制品回收记录子
export const updateProductredressRecordDetail = async (data: ProductredressRecordDetailVO) => {
return await request.put({ url: `/wms/productredress-record-detail/update`, data })
}
// 删除制品回收记录子
export const deleteProductredressRecordDetail = async (id: number) => {
return await request.delete({ url: `/wms/productredress-record-detail/delete?id=` + id })
}
// 导出制品回收记录子 Excel
export const exportProductredressRecordDetail = async (params) => {
return await request.download({ url: `/wms/productredress-record-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/productredress-record-detail/get-import-template' })
}

70
src/api/wms/productredressRecordMain/index.ts

@ -0,0 +1,70 @@
import request from '@/config/axios'
export interface ProductredressRecordMainVO {
id: number
requestNumber: string
jobNumber: string
productionPlanNumber: string
workshopCode: string
team: string
shift: string
details: string
outTransactionType: string
inTransactionType: string
executeTime: Date
activeDate: Date
available: string
requestTime: Date
dueTime: Date
departmentCode: string
interfaceType: string
number: string
type: string
businessType: string
remark: string
code: string
toWarehouseCode: string
toAreaTypes: string
toAreaCodes: string
}
// 查询制品回收记录主列表
export const getProductredressRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/productredress-record-main/senior', data })
} else {
return await request.get({ url: `/wms/productredress-record-main/page`, params })
}
}
// 查询制品回收记录主详情
export const getProductredressRecordMain = async (id: number) => {
return await request.get({ url: `/wms/productredress-record-main/get?id=` + id })
}
// 新增制品回收记录主
export const createProductredressRecordMain = async (data: ProductredressRecordMainVO) => {
return await request.post({ url: `/wms/productredress-record-main/create`, data })
}
// 修改制品回收记录主
export const updateProductredressRecordMain = async (data: ProductredressRecordMainVO) => {
return await request.put({ url: `/wms/productredress-record-main/update`, data })
}
// 删除制品回收记录主
export const deleteProductredressRecordMain = async (id: number) => {
return await request.delete({ url: `/wms/productredress-record-main/delete?id=` + id })
}
// 导出制品回收记录主 Excel
export const exportProductredressRecordMain = async (params) => {
return await request.download({ url: `/wms/productredress-record-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/productredress-record-main/get-import-template' })
}

73
src/api/wms/productredressRequestDetail/index.ts

@ -0,0 +1,73 @@
import request from '@/config/axios'
export interface ProductredressRequestDetailVO {
id: number
productionLineCode: string
workStationCode: string
toLocationCode: string
processCode: string
packingNumber: string
containerNumber: string
batch: string
produceDate: Date
expireDate: Date
inventoryStatus: string
woNumber: string
woLine: string
packQty: number
packUnit: string
bomVersion: string
backFlushDetails: string
masterId: number
number: string
itemCode: string
remark: string
itemName: string
itemDesc1: string
itemDesc2: string
projectCode: string
qty: number
uom: string
toOwnerCode: string
}
// 查询制品回收申请子列表
export const getProductredressRequestDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/productredress-request-detail/senior', data })
} else {
return await request.get({ url: `/wms/productredress-request-detail/page`, params })
}
}
// 查询制品回收申请子详情
export const getProductredressRequestDetail = async (id: number) => {
return await request.get({ url: `/wms/productredress-request-detail/get?id=` + id })
}
// 新增制品回收申请子
export const createProductredressRequestDetail = async (data: ProductredressRequestDetailVO) => {
return await request.post({ url: `/wms/productredress-request-detail/create`, data })
}
// 修改制品回收申请子
export const updateProductredressRequestDetail = async (data: ProductredressRequestDetailVO) => {
return await request.put({ url: `/wms/productredress-request-detail/update`, data })
}
// 删除制品回收申请子
export const deleteProductredressRequestDetail = async (id: number) => {
return await request.delete({ url: `/wms/productredress-request-detail/delete?id=` + id })
}
// 导出制品回收申请子 Excel
export const exportProductredressRequestDetail = async (params) => {
return await request.download({ url: `/wms/productredress-request-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/productredress-request-detail/get-import-template' })
}

100
src/api/wms/productredressRequestMain/index.ts

@ -0,0 +1,100 @@
import request from '@/config/axios'
export interface ProductredressRequestMainVO {
id: number
productionPlanNumber: string
workshopCode: string
team: string
shift: string
toWarehouseCode: string
toAreaTypes: string
toAreaCodes: string
number: string
type: string
businessType: string
remark: string
extraProperties: string
siteId: string
requestTime: Date
dueTime: Date
departmentCode: string
status: string
autoCommit: string
autoAgree: string
autoExecute: string
directCreateRecord: string
inInventoryStatuses: string
outInventoryStatuses: string
}
// 查询制品回收申请主列表
export const getProductredressRequestMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/productredress-request-main/senior', data })
} else {
return await request.get({ url: `/wms/productredress-request-main/page`, params })
}
}
// 查询制品回收申请主详情
export const getProductredressRequestMain = async (id: number) => {
return await request.get({ url: `/wms/productredress-request-main/get?id=` + id })
}
// 新增制品回收申请主
export const createProductredressRequestMain = async (data: ProductredressRequestMainVO) => {
return await request.post({ url: `/wms/productredress-request-main/create`, data })
}
// 修改制品回收申请主
export const updateProductredressRequestMain = async (data: ProductredressRequestMainVO) => {
return await request.put({ url: `/wms/productredress-request-main/update`, data })
}
// 删除制品回收申请主
export const deleteProductredressRequestMain = async (id: number) => {
return await request.delete({ url: `/wms/productredress-request-main/delete?id=` + id })
}
// 导出制品回收申请主 Excel
export const exportProductredressRequestMain = async (params) => {
return await request.download({ url: `/wms/productredress-request-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/productredress-request-main/get-import-template' })
}
// 关闭
export const close = (id) => {
return request.put({ url: '/wms/productredress-request-main/close?id=' + id })
}
// 重新添加
export const reAdd = (id) => {
return request.put({ url: '/wms/productredress-request-main/reAdd?id=' + id })
}
// 提交审批
export const submit = (id) => {
return request.put({ url: '/wms/productredress-request-main/submit?id=' + id })
}
// 驳回
export const refused = (id) => {
return request.put({ url: '/wms/productredress-request-main/refused?id=' + id })
}
// 审批通过
export const agree = (id) => {
return request.put({ url: '/wms/productredress-request-main/agree?id=' + id })
}
// 处理
export const handle = (id) => {
return request.put({ url: '/wms/productredress-request-main/handle?id=' + id })
}

8
src/components/SearchHigh/src/SearchHigh.vue

@ -126,6 +126,12 @@ const moreListOptions = ref({
}, {
value: 'isNotNull',
label: '不是空'
}, {
value: 'isStr',
label: '是空字符串'
}, {
value: 'isNotStr',
label: '不是空字符串'
}
]
})
@ -205,7 +211,7 @@ const resetSelect = (val) => {
}
//
const actionSelect = (val)=>{
if(val.action=='isNull'|| val.action == 'isNotNull'){
if(val.action=='isNull'|| val.action == 'isNotNull'|| val.action == 'isStr'|| val.action == 'isNotStr'){
val.disabled = true
}else{
val.disabled = false

244
src/views/wms/productionManage/productredress/productredressJobMain/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ProductredressJobMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ProductredressJobMain.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 #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="ProductredressJobMainRules"
:formAllSchemas="ProductredressJobMain.allSchemas"
:apiUpdate="ProductredressJobMainApi.updateProductredressJobMain"
:apiCreate="ProductredressJobMainApi.createProductredressJobMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ProductredressJobMain.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/productredress-job-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ProductredressJobMain,ProductredressJobMainRules } from './productredressJobMain.data'
import * as ProductredressJobMainApi from '@/api/wms/productredressJobMain'
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: 'ProductredressJobMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ProductredressJobMain.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: ProductredressJobMainApi.getProductredressJobMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:productredressJobMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:productredressJobMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:productredressJobMain:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:productredressJobMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:productredressJobMain:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =ProductredressJobMain.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 ProductredressJobMainApi.createProductredressJobMain(data)
message.success(t('common.createSuccess'))
} else {
await ProductredressJobMainApi.updateProductredressJobMain(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, 'basicProductredressJobMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ProductredressJobMainApi.deleteProductredressJobMain(id)
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 ProductredressJobMainApi.exportProductredressJobMain(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 = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ProductredressJobMainApi.importTemplate()
})
</script>

523
src/views/wms/productionManage/productredress/productredressJobMain/productredressJobMain.data.ts

@ -0,0 +1,523 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const ProductredressJobMainRules = reactive({
})
export const ProductredressJobMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false,
},
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
isSearch: true,
},
{
label: '生产计划单号',
field: 'productionPlanNumber',
sort: 'custom',
isSearch: true,
},
{
label: '车间代码',
field: 'workShopCode',
sort: 'custom',
},
{
label: '班组',
field: 'team',
sort: 'custom',
},
{
label: '班次',
field: 'shift',
sort: 'custom',
},
{
label: '明细',
field: 'details',
sort: 'custom',
},
{
label: '申请时间',
field: 'requestTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '要求截止时间',
field: 'requestDueTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '状态',
field: 'status',
sort: 'custom',
form: {
component: 'Radio'
},
},
{
label: '过期时间',
field: 'expiredTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '最后更新者Id',
field: 'updater',
sort: 'custom',
isForm: false,
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isForm: false,
},
{
label: '状态',
field: 'jobStageStatus',
sort: 'custom',
form: {
component: 'Radio'
},
},
{
label: '优先级',
field: 'priority',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '优先级增量',
field: 'priorityIncrement',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
},
{
label: '用户组',
field: 'userGroupCode',
sort: 'custom',
},
{
label: '承接人用户ID',
field: 'acceptUserId',
sort: 'custom',
},
{
label: '承接人用户名',
field: 'acceptUserName',
sort: 'custom',
},
{
label: '承接时间',
field: 'acceptTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '完成人用户ID',
field: 'completeUserId',
sort: 'custom',
},
{
label: '完成人用户名',
field: 'completeUserName',
sort: 'custom',
},
{
label: '完成时间',
field: 'completeTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '到仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
},
{
label: '到库区代码范围',
field: 'toAreaCodes',
sort: 'custom',
},
{
label: '从库区类型范围',
field: 'fromAreaTypes',
sort: 'custom',
},
{
label: '到库区类型范围',
field: 'toAreaTypes',
sort: 'custom',
},
{
label: '单据号',
field: 'number',
sort: 'custom',
},
{
label: '收货类型',
field: 'type',
sort: 'custom',
form: {
component: 'SelectV2'
},
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
form: {
component: 'SelectV2'
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '创建者id',
field: 'creator',
sort: 'custom',
isForm: false,
},
{
label: '自动完成',
field: 'autoComplete',
sort: 'custom',
},
{
label: '允许修改库位',
field: 'allowModifyLocation',
sort: 'custom',
},
{
label: '允许修改数量',
field: 'allowModifyQty',
sort: 'custom',
},
{
label: '允许大于推荐数量',
field: 'allowBiggerQty',
sort: 'custom',
},
{
label: '允许小于推荐数量',
field: 'allowSmallerQty',
sort: 'custom',
},
{
label: '允许修改库存状态',
field: 'allowModifyInventoryStatus',
sort: 'custom',
form: {
component: 'Radio'
},
},
{
label: '允许连续扫描',
field: 'allowContinuousScanning',
sort: 'custom',
},
{
label: '允许部分完成',
field: 'allowPartialComplete',
sort: 'custom',
},
{
label: '允许修改批次',
field: 'allowModifyBatch',
sort: 'custom',
},
{
label: '允许修改箱码',
field: 'allowModifyPackingNumber',
sort: 'custom',
},
{
label: '入库库存状态范围',
field: 'inInventoryStatuses',
sort: 'custom',
},
{
label: '出库库存状态范围',
field: 'outInventoryStatuses',
sort: 'custom',
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const ProductredressJobDetailRules = reactive({
})
export const ProductredressJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false,
},
{
label: '生产线代码',
field: 'productionLineCode',
sort: 'custom',
isSearch: true,
},
{
label: '工位代码',
field: 'workStationCode',
sort: 'custom',
},
{
label: '工序代码',
field: 'processCode',
sort: 'custom',
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
},
{
label: '器具号',
field: 'containerNumber',
sort: 'custom',
},
{
label: '批次',
field: 'batch',
sort: 'custom',
},
{
label: '生产日期',
field: 'produceDate',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '过期日期',
field: 'expireDate',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '库存状态',
field: 'inventoryStatus',
sort: 'custom',
form: {
component: 'Radio'
},
},
{
label: '到库位代码',
field: 'toLocationCode',
sort: 'custom',
},
{
label: '订单号',
field: 'woNumber',
sort: 'custom',
},
{
label: '订单行',
field: 'woLine',
sort: 'custom',
},
{
label: '包装数量',
field: 'packQty',
sort: 'custom',
},
{
label: '包装规格',
field: 'packUnit',
sort: 'custom',
},
{
label: '物品代码',
field: 'itemCode',
sort: 'custom',
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
},
{
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
},
{
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
},
{
label: '数量',
field: 'qty',
sort: 'custom',
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
},
{
label: '主表ID',
field: 'masterId',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '单据号',
field: 'number',
sort: 'custom',
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '创建者Id',
field: 'creator',
sort: 'custom',
isForm: false,
},
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '最后更新者Id',
field: 'updater',
sort: 'custom',
isForm: false,
},
{
label: '到货主代码',
field: 'toOwnerCode',
sort: 'custom',
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/wms/productionManage/productredress/productredressRecordMain/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ProductredressRecordMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ProductredressRecordMain.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 #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="ProductredressRecordMainRules"
:formAllSchemas="ProductredressRecordMain.allSchemas"
:apiUpdate="ProductredressRecordMainApi.updateProductredressRecordMain"
:apiCreate="ProductredressRecordMainApi.createProductredressRecordMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ProductredressRecordMain.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/productredress-record-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ProductredressRecordMain,ProductredressRecordMainRules } from './productredressRecordMain.data'
import * as ProductredressRecordMainApi from '@/api/wms/productredressRecordMain'
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: 'ProductredressRecordMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ProductredressRecordMain.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: ProductredressRecordMainApi.getProductredressRecordMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:productredressRecordMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:productredressRecordMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:productredressRecordMain:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:productredressRecordMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:productredressRecordMain:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =ProductredressRecordMain.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 ProductredressRecordMainApi.createProductredressRecordMain(data)
message.success(t('common.createSuccess'))
} else {
await ProductredressRecordMainApi.updateProductredressRecordMain(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, 'basicProductredressRecordMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ProductredressRecordMainApi.deleteProductredressRecordMain(id)
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 ProductredressRecordMainApi.exportProductredressRecordMain(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 = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ProductredressRecordMainApi.importTemplate()
})
</script>

446
src/views/wms/productionManage/productredress/productredressRecordMain/productredressRecordMain.data.ts

@ -0,0 +1,446 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const ProductredressRecordMainRules = reactive({
})
export const ProductredressRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
isSearch: true,
},
{
label: '任务单号',
field: 'jobNumber',
sort: 'custom',
},
{
label: '生产计划单号',
field: 'productionPlanNumber',
sort: 'custom',
},
{
label: '车间代码',
field: 'workshopCode',
sort: 'custom',
},
{
label: '班组',
field: 'team',
sort: 'custom',
},
{
label: '班次',
field: 'shift',
sort: 'custom',
},
{
label: '明细',
field: 'details',
sort: 'custom',
},
{
label: '出库事务类型',
field: 'outTransactionType',
sort: 'custom',
form: {
component: 'SelectV2'
},
},
{
label: '入库事务类型',
field: 'inTransactionType',
sort: 'custom',
form: {
component: 'SelectV2'
},
},
{
label: '执行时间',
field: 'executeTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '生效日期',
field: 'activeDate',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
},
{
label: '申请时间',
field: 'requestTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '截止时间',
field: 'dueTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
},
{
label: '接口类型',
field: 'interfaceType',
sort: 'custom',
form: {
component: 'SelectV2'
},
},
{
label: '单据号',
field: 'number',
sort: 'custom',
},
{
label: '收货类型',
field: 'type',
sort: 'custom',
form: {
component: 'SelectV2'
},
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
form: {
component: 'SelectV2'
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '创建者Id',
field: 'creator',
sort: 'custom',
isForm: false,
},
{
label: '代码',
field: 'code',
sort: 'custom',
},
{
label: '到仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
},
{
label: '到库区类型范围',
field: 'toAreaTypes',
sort: 'custom',
},
{
label: '到库区代码范围',
field: 'toAreaCodes',
sort: 'custom',
},
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '最后更新者用户名',
field: 'updater',
sort: 'custom',
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const ProductredressRecordDetailRules = reactive({
productionlineCode: [required],
masterId: [required],
})
export const ProductredressRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false,
},
{
label: '生产线代码',
field: 'productionlineCode',
sort: 'custom',
isSearch: true,
},
{
label: '工位代码',
field: 'workStationCode',
sort: 'custom',
},
{
label: '工序代码',
field: 'processCode',
sort: 'custom',
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
},
{
label: '器具号',
field: 'containerNumber',
sort: 'custom',
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
},
{
label: '生产日期',
field: 'produceDate',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '过期日期',
field: 'expireDate',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '库存状态',
field: 'inventoryStatus',
sort: 'custom',
form: {
component: 'Radio'
},
},
{
label: '到库位代码',
field: 'toLocationCode',
sort: 'custom',
},
{
label: '到库位组代码',
field: 'toLocationGroupCode',
sort: 'custom',
},
{
label: '到库区代码',
field: 'toAreaCode',
sort: 'custom',
},
{
label: '到货主代码',
field: 'toOwnerCode',
sort: 'custom',
},
{
label: '订单号',
field: 'woNumber',
sort: 'custom',
},
{
label: '订单行',
field: 'woLine',
sort: 'custom',
},
{
label: '包装数量',
field: 'packQty',
sort: 'custom',
},
{
label: '包装规格',
field: 'packUnit',
sort: 'custom',
},
{
label: 'BOM版本',
field: 'bomVersion',
sort: 'custom',
},
{
label: '明细',
field: 'backFlushDetails',
sort: 'custom',
},
{
label: '主表ID',
field: 'masterId',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '单据号',
field: 'number',
sort: 'custom',
},
{
label: '物品代码',
field: 'itemCode',
sort: 'custom',
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '创建者Id',
field: 'creator',
sort: 'custom',
isForm: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
},
{
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
},
{
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
},
{
label: '数量',
field: 'qty',
sort: 'custom',
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
},
{
label: '接口类型',
field: 'interfaceType',
sort: 'custom',
form: {
component: 'SelectV2'
},
},
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '最后更新者用户名',
field: 'updater',
sort: 'custom',
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

501
src/views/wms/productionManage/productredress/productredressRequestMain/index.vue

@ -0,0 +1,501 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ProductredressRequestMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ProductredressRequestMain.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 #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="ProductredressRequestMainRules"
:formAllSchemas="ProductredressRequestMain.allSchemas"
:tableAllSchemas="ProductredressRequestDetail.allSchemas"
:tableFormRules="ProductredressRequestDetailRules"
:tableData="tableData"
:apiUpdate="ProductredressRequestMainApi.updateProductredressRequestMain"
:apiCreate="ProductredressRequestMainApi.createProductredressRequestMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="ProductredressRequestMain.allSchemas"
:detailAllSchemas="ProductredressRequestDetail.allSchemas"
:detailAllSchemasRules="ProductredressRequestDetailRules"
:apiCreate="ProductredressRequestDetailApi.createProductredressRequestDetail"
:apiUpdate="ProductredressRequestDetailApi.updateProductredressRequestDetail"
:apiPage="ProductredressRequestDetailApi.getProductredressRequestDetailPage"
:apiDelete="ProductredressRequestDetailApi.deleteProductredressRequestDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
:buttondataTable="buttondataTable"
@tableFormButton="tableFormButton"
:detailValidate="detailValidate"
/>
<!-- bom列表
<Dialog
:title="DialogTitle"
v-model="bomModelVisible"
width="80%"
:scroll="true"
max-height="450px"
>
<Table
:columns="BackflushDetailRequest.allSchemas.tableColumns"
:data="detatableDataBom.tableList"
:loading="detatableDataBom.loading"
:pagination="{
total: detatableDataBom.total
}"
v-model:pageSize="detatableDataBom.pageSize"
v-model:currentPage="detatableDataBom.currentPage"
v-model:sort="detatableDataBom.sort"
/>
</Dialog>-->
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/productredress-request-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { ProductredressRequestMain,ProductredressRequestMainRules,ProductredressRequestDetail,ProductredressRequestDetailRules } from './productredressRequestMain.data'
import * as ProductredressRequestMainApi from '@/api/wms/productredressRequestMain'
import * as ProductredressRequestDetailApi from '@/api/wms/productredressRequestDetail'
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: 'ProductredressRequestMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ProductredressRequestMain.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => {
if (type == 'tableForm') {
if (formField == 'itemCode') {
row['itemCode'] = val[0]['itemCode']
row['qty'] = val[0]['qty']
row['uom'] = val[0]['uom']
row['packingNumber'] = val[0]['packingNumber']
row['batch'] = val[0]['batch']
row['packQty'] = val[0]['packQty']
row['packUnit'] = val[0]['packUnit']
row['inventoryStatus'] = val[0]['inventoryStatus']
}
//
row[formField] = val[0][searchField]
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
if (formField == 'itemCode') {
setV['itemCode'] = val[0]['itemCode']
setV['qty'] = val[0]['qty']
setV['uom'] = val[0]['uom']
setV['packingNumber'] = val[0]['packingNumber']
setV['batch'] = val[0]['batch']
setV['packQty'] = val[0]['packQty']
setV['packUnit'] = val[0]['packUnit']
setV['inventoryStatus'] = val[0]['inventoryStatus']
}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: ProductredressRequestMainApi.getProductredressRequestMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:productredress-request-main:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:productredress-request-main:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:productredress-request-main:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
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 = (row) => {
return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4']), hasPermi:'wms:productredress-request-main:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']), hasPermi:'wms:productredress-request-main:reAdd'}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:productredress-request-main:submit'}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:productredress-request-main:refused'}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:productredress-request-main:agree'}), //
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']), hasPermi:'wms:productredress-request-main:handle'}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:productredress-request-main:update'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { //
await message.confirm('确认要关闭吗?')
tableObject.loading = true
ProductredressRequestMainApi.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
ProductredressRequestMainApi.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
ProductredressRequestMainApi.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
ProductredressRequestMainApi.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
ProductredressRequestMainApi.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') { //
tableObject.loading = true
ProductredressRequestMainApi.handle(row.id).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm =async (type: string, row?: number) => {
tableData.value = [] //
//
if (type == 'update') {
// tableform
ProductredressRequestMain.allSchemas.formSchema.map(itemColumns => {
if(itemColumns.field == 'workshopCode') {
itemColumns.componentProps.isSearchList = false
itemColumns.componentProps.disabled = true
}
})
} else {
// tableform
ProductredressRequestMain.allSchemas.formSchema.map(itemColumns => {
if(itemColumns.field == 'workshopCode') {
itemColumns.componentProps.isSearchList = true
itemColumns.componentProps.disabled = false
}
})
}
formRef.value.open(type, row)
}
//
const { wsCache } = useCache()
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
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,'requestProductreceiptMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
tableObject.loading = true
//
await ProductredressRequestMainApi.deleteProductredressRequestMain(id)
message.success(t('common.delSuccess'))
tableObject.loading = false
//
await getList()
} catch {}finally{
tableObject.loading = false
}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await ProductredressRequestMainApi.exportProductredressRequestMain(tableObject.params)
download.excel(data, '制品回收申请主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
ProductredressRequestDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
let tfk = JSON.parse(JSON.stringify(tableFormKeys))
// tfk.batch = formatTime(new Date(), 'yyyyMMdd')
tableData.value.push(tfk)
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
if(data.subList.find(item => (item.qty <= 0))) {
message.warning('数量必须大于0')
formRef.value.formLoading = false
return
}
try {
if (formType === 'create') {
await ProductredressRequestMainApi.createProductredressRequestMain(data)
message.success(t('common.createSuccess'))
} else {
await ProductredressRequestMainApi.updateProductredressRequestMain(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()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
// Bom
// const tableFormButton = async (val , row) => {
// if (val == 'bom') { // bom
// bomModelVisible.value = true
// DialogTitle.value = '' + row.itemCode + 'Bom'
// detatableDataBom.params = {
// masterId: row.id
// }
// await getDetailListBom()
// }
// }
// /
const detailValidate = (data) => {
let tag = false;
if(data.qty <= 0){
message.warning('数量必须大于0')
tag = false;
return tag;
}else {
tag = true;
return tag;
}
}
// const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
// //
// const handlePoint = async (row) => {
// //
// await PackageApi.getPackagePage({
// requestNumber: row.number
// }).then((res) => {
// if(res.list.length > 0) {
// isCreateLabel.value = true
// if (res.list[0].productionLineCode != null) {
// labelType.value = 'zz'
// } else {
// labelType.value = 'cg'
// }
// } else {
// isCreateLabel.value = false
// }
// }).catch(err => {
// isCreateLabel.value = false
// console.log(err)
// })
// //
// if (isCreateLabel.value) {
// if (labelType.value == 'cg') {
// const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
// window.open(src.value+'&request_number='+row.number)
// } else {
// const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
// window.open(src.value+'&request_number='+row.number)
// }
// } else {
// message.warning('')
// }
// }
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ProductredressRequestMainApi.importTemplate()
})
</script>

595
src/views/wms/productionManage/productredress/productredressRequestMain/productredressRequestMain.data.ts

@ -0,0 +1,595 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as BalanceApi from '@/api/wms/balance'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
// 表单校验
export const ProductredressRequestMainRules = reactive({
autoCommit: [required],
autoAgree: [required],
autoExecute: [required],
directCreateRecord: [required],
})
export const ProductredressRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180,
fixed: 'left'
},
isForm: false,
isSearch: true,
},
// {
// label: '生产计划单号',
// field: 'productionPlanNumber',
// sort: 'custom',
// },
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
value: '1',
componentProps: {
disabled: true
}
}
},
// {
// label: '车间代码',
// field: 'workshopCode',
// sort: 'custom',
// isSearch: true,
// },
// {
// label: '班组',
// field: 'team',
// sort: 'custom',
// },
// {
// label: '班次',
// field: 'shift',
// sort: 'custom',
// },
{
label: '申请时间',
field: 'requestTime',
sort: 'custom',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false
},
{
label: '截止时间',
field: 'dueTime',
sort: 'custom',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false
},
{
label: '到仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
isForm:false,
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
isForm:false,
},
{
label: '自动提交',
field: 'autoCommit',
sort: 'custom',
isForm:false,
},
{
label: '自动通过',
field: 'autoAgree',
sort: 'custom',
isForm:false,
},
{
label: '自动执行',
field: 'autoExecute',
sort: 'custom',
isForm:false,
},
{
label: '直接生成记录',
field: 'directCreateRecord',
sort: 'custom',
isForm:false,
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
isForm:false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '到库区类型范围',
field: 'toAreaTypes',
sort: 'custom',
isForm:false,
},
{
label: '到库区代码范围',
field: 'toAreaCodes',
sort: 'custom',
isForm:false,
},
{
label: '入库库存状态范围',
field: 'inInventoryStatuses',
sort: 'custom',
isForm:false,
},
{
label: '出库库存状态范围',
field: 'outInventoryStatuses',
sort: 'custom',
isForm:false,
},
{
label: '创建者用户名',
field: 'creator',
sort: 'custom',
isForm: false,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false
},
{
label: '最后更新者用户名',
field: 'updater',
sort: 'custom',
isForm: false,
},
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const ProductredressRequestDetailRules = reactive({
})
export const ProductredressRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '生产线代码',
// field: 'productionLineCode',
// sort: 'custom',
// isSearch: true,
// },
// {
// label: '工位代码',
// field: 'workStationCode',
// sort: 'custom',
// },
// {
// label: '目标库位',
// field: 'toLocationCode',
// sort: 'custom',
// },
// {
// label: '工序代码',
// field: 'processCode',
// sort: 'custom',
// },
// {
// label: '器具号',
// field: 'containerNumber',
// sort: 'custom',
// },
// {
// label: '生产日期',
// field: 'produceDate',
// sort: 'custom',
// formatter: dateFormatter,
// detail: {
// dateFormat: 'YYYY-MM-DD HH:mm:ss'
// },
// table: {
// width: 180
// },
// form: {
// component: 'DatePicker',
// componentProps: {
// style: {width: '100%'},
// type: 'datetime',
// dateFormat: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'x',
// }
// },
// isForm: false
// },
// {
// label: '过期日期',
// field: 'expireDate',
// formatter: dateFormatter,
// detail: {
// dateFormat: 'YYYY-MM-DD HH:mm:ss'
// },
// sort: 'custom',
// table: {
// width: 180
// },
// form: {
// component: 'DatePicker',
// componentProps: {
// style: {width: '100%'},
// type: 'datetime',
// dateFormat: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'x',
// }
// },
// isForm: false
// },
// {
// label: '订单号',
// field: 'woNumber',
// sort: 'custom',
// },
// {
// label: '订单行',
// field: 'woLine',
// sort: 'custom',
// },
// {
// label: 'BOM版本',
// field: 'bomVersion',
// sort: 'custom',
// },
{
label: '单据号',
field: 'number',
sort: 'custom',
isForm: false,
isTableForm: false,
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '库存余额信息', // 查询弹窗标题
searchAllSchemas: Balance.allSchemas, // 查询弹窗所需类
searchPage: BalanceApi.getBalancePage, // 查询弹窗所需分页方法
searchCondition:[
{
key: 'inventoryStatus',
value: 'OK',
isMainValue: false
},{
key: 'packingNumber', // 查询列表中字段
value: '', // 指查询具体值
action: '!=', // 查询拼接条件
isSearch: true, // 使用自定义拼接条件
isMainValue: false // 拼接条件必须要 false 同时不能与 isMainValue: true 同用
}]
}
},
tableForm:{
isInpuFocusShow: true,
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '库存余额信息', // 查询弹窗标题
searchAllSchemas: Balance.allSchemas, // 查询弹窗所需类
searchPage: BalanceApi.getBalancePage, // 查询弹窗所需分页方法
searchCondition:[
{
key: 'inventoryStatus',
value: 'OK',
isMainValue: false
},{
key: 'packingNumber', // 查询列表中字段
value: '', // 指查询具体值
action: '!=', // 查询拼接条件
isSearch: true, // 使用自定义拼接条件
isMainValue: false // 拼接条件必须要 false 同时不能与 isMainValue: true 同用
}]
},
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
isForm: false,
isTableForm: false,
},
{
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
isForm: false,
isTableForm: false,
},
{
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
isForm: false,
isTableForm: false,
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
isForm: false,
isTableForm: false,
},
{
label: '数量',
field: 'qty',
sort: 'custom',
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '包装数量',
field: 'packQty',
sort: 'custom',
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '包装规格',
field: 'packUnit',
sort: 'custom',
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '库存状态',
field: 'inventoryStatus',
sort: 'custom',
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '创建者用户名',
field: 'creator',
sort: 'custom',
isTableForm: false,
isForm: false,
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isTableForm: false,
isForm: false
},
{
label: '最后更新者用户名',
field: 'updater',
sort: 'custom',
isForm: false,
isTableForm: false,
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isTableForm: false,
isForm: false
},
{
label: '操作',
field: 'action',
isForm: false,
isTableForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

3
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue

@ -175,7 +175,8 @@ const handlerCreatePurchasereceiptRequest = async (number:string) => {
//
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const documentSrc = ref(BASE_URL + '/jmreport/view/884680688168280064?token=' + getAccessToken())
//const documentSrc = ref(BASE_URL + '/jmreport/view/884680688168280064?token=' + getAccessToken())
const documentSrc = ref(BASE_URL + '/jmreport/view/932556833517789184?token=' + getAccessToken())
const handleDocumentPrint = async (id) => {
window.open(documentSrc.value + '&id=' + id)
}

3
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

@ -601,7 +601,8 @@ const print = async () => {
}
//
const documentSrc = ref(BASE_URL + '/jmreport/view/884680688168280064?token=' + getAccessToken())
// const documentSrc = ref(BASE_URL + '/jmreport/view/884680688168280064?token=' + getAccessToken())
const documentSrc = ref(BASE_URL + '/jmreport/view/932556833517789184?token=' + getAccessToken())
const handleDocumentPrint = async (id) => {
window.open(documentSrc.value + '&id=' + id)
}

Loading…
Cancel
Save