Browse Source

生成退料

master
陈薪名 12 months ago
parent
commit
1b1ece9eb4
  1. 67
      src/api/wms/productionreturnRequestDetailNo/index.ts
  2. 37
      src/api/wms/productionreturnRequestMain/index.ts
  3. 67
      src/api/wms/productionreturnRequestMainNo/index.ts
  4. 26
      src/views/wms/basicDataManage/factoryModeling/workshop/workshop.data.ts
  5. 125
      src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue
  6. 503
      src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts
  7. 367
      src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue
  8. 804
      src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/productionreturnRequestMainNo.data.ts

67
src/api/wms/productionreturnRequestDetailNo/index.ts

@ -0,0 +1,67 @@
import request from '@/config/axios'
export interface ProductionreturnRequestDetailVO {
productionLineCode: string
workStationCode: string
inventoryStatus: string
fromOwnerCode: string
packingNumber: string
containerNumber: string
batch: string
fromLocationCode: string
number: string
itemCode: string
remark: string
createTime: Date
creator: string
itemName: string
itemDesc1: string
itemDesc2: string
projectCode: string
qty: number
uom: string
updateTime: Date
updater: string
toOwnerCode: string
}
// 查询生产退料申请子列表
export const getProductionreturnRequestDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/productionreturn-request-detail/senior', data })
} else {
return await request.get({ url: `/wms/productionreturn-request-detail/page`, params })
}
}
// 查询生产退料申请子详情
export const getProductionreturnRequestDetail = async (id: number) => {
return await request.get({ url: `/wms/productionreturn-request-detail/get?id=` + id })
}
// 新增生产退料申请子
export const createProductionreturnRequestDetail = async (data: ProductionreturnRequestDetailVO) => {
return await request.post({ url: `/wms/productionreturn-request-detail/create`, data })
}
// 修改生产退料申请子
export const updateProductionreturnRequestDetail = async (data: ProductionreturnRequestDetailVO) => {
return await request.put({ url: `/wms/productionreturn-request-detail/update`, data })
}
// 删除生产退料申请子
export const deleteProductionreturnRequestDetail = async (id: number) => {
return await request.delete({ url: `/wms/productionreturn-request-detail/delete?id=` + id })
}
// 导出生产退料申请子 Excel
export const exportProductionreturnRequestDetail = async (params) => {
return await request.download({ url: `/wms/productionreturn-request-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/productionreturn-request-detail/get-import-template' })
}

37
src/api/wms/productionreturnRequestMain/index.ts

@ -58,10 +58,45 @@ export const deleteProductionreturnRequestMain = async (id: number) => {
// 导出生产退料申请主 Excel // 导出生产退料申请主 Excel
export const exportProductionreturnRequestMain = async (params) => { export const exportProductionreturnRequestMain = async (params) => {
return await request.download({ url: `/wms/productionreturn-request-main/export-excel`, params }) if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/productionreturn-request-main/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/productionreturn-request-main/export-excel`, params })
}
} }
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/wms/productionreturn-request-main/get-import-template' }) return request.download({ url: '/wms/productionreturn-request-main/get-import-template' })
}
// 关闭
export const close = (id) => {
return request.put({ url: '/wms/productionreturn-request-main/close?id=' + id })
}
// 重新添加
export const reAdd = (id) => {
return request.put({ url: '/wms/productionreturn-request-main/reAdd?id=' + id })
}
// 提交审批
export const submit = (id) => {
return request.put({ url: '/wms/productionreturn-request-main/submit?id=' + id })
}
// 驳回
export const refused = (id) => {
return request.put({ url: '/wms/productionreturn-request-main/refused?id=' + id })
}
// 审批通过
export const agree = (id) => {
return request.put({ url: '/wms/productionreturn-request-main/agree?id=' + id })
}
// 处理
export const handle = (id) => {
return request.put({ url: '/wms/productionreturn-request-main/handle?id=' + id })
} }

67
src/api/wms/productionreturnRequestMainNo/index.ts

@ -0,0 +1,67 @@
import request from '@/config/axios'
export interface ProductionreturnRequestMainVO {
workshopCode: string
fromWarehouseCode: string
fromLocationTypes: string
fromAreaCodes: string
number: string
businessType: string
remark: string
createTime: Date
creator: string
requestTime: Date
dueTime: Date
departmentCode: string
status: string
updateTime: Date
updater: string
toWarehouseCode: string
toLocationTypes: string
toAreaCodes: string
autoCommit: string
autoAgree: string
autoExecute: string
directCreateRecord: string
}
// 查询生产退料申请主列表
export const getProductionreturnRequestMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/productionreturn-request-main/senior', data })
} else {
return await request.get({ url: `/wms/productionreturn-request-main/page`, params })
}
}
// 查询生产退料申请主详情
export const getProductionreturnRequestMain = async (id: number) => {
return await request.get({ url: `/wms/productionreturn-request-main/get?id=` + id })
}
// 新增生产退料申请主
export const createProductionreturnRequestMain = async (data: ProductionreturnRequestMainVO) => {
return await request.post({ url: `/wms/productionreturn-request-main/create`, data })
}
// 修改生产退料申请主
export const updateProductionreturnRequestMain = async (data: ProductionreturnRequestMainVO) => {
return await request.put({ url: `/wms/productionreturn-request-main/update`, data })
}
// 删除生产退料申请主
export const deleteProductionreturnRequestMain = async (id: number) => {
return await request.delete({ url: `/wms/productionreturn-request-main/delete?id=` + id })
}
// 导出生产退料申请主 Excel
export const exportProductionreturnRequestMain = async (params) => {
return await request.download({ url: `/wms/productionreturn-request-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/productionreturn-request-main/get-import-template' })
}

26
src/views/wms/basicDataManage/factoryModeling/workshop/workshop.data.ts

@ -14,7 +14,6 @@ export const Workshop = useCrudSchemas(reactive<CrudSchema[]>([
field: 'code', field: 'code',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150,
fixed: 'left' fixed: 'left'
}, },
isSearch: true isSearch: true
@ -23,9 +22,6 @@ export const Workshop = useCrudSchemas(reactive<CrudSchema[]>([
label: '名称', label: '名称',
field: 'name', field: 'name',
sort: 'custom', sort: 'custom',
table: {
width: 150
},
isSearch: true isSearch: true
}, },
{ {
@ -36,9 +32,6 @@ export const Workshop = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
isTable: true, isTable: true,
sort: 'custom', sort: 'custom',
table: {
width: 150
},
}, },
{ {
label: '是否可用', label: '是否可用',
@ -48,9 +41,6 @@ export const Workshop = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
isTable: true, isTable: true,
sort: 'custom', sort: 'custom',
table: {
width: 150
},
form: { form: {
component: 'Switch', component: 'Switch',
value: 'TRUE', value: 'TRUE',
@ -69,9 +59,6 @@ export const Workshop = useCrudSchemas(reactive<CrudSchema[]>([
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, },
sort: 'custom', sort: 'custom',
table: {
width: 180
},
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -91,9 +78,6 @@ export const Workshop = useCrudSchemas(reactive<CrudSchema[]>([
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, },
sort: 'custom', sort: 'custom',
table: {
width: 180
},
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -112,9 +96,6 @@ export const Workshop = useCrudSchemas(reactive<CrudSchema[]>([
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, },
sort: 'custom', sort: 'custom',
table: {
width: 180
},
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -131,17 +112,11 @@ export const Workshop = useCrudSchemas(reactive<CrudSchema[]>([
label: '备注', label: '备注',
field: 'remark', field: 'remark',
sort: 'custom', sort: 'custom',
table: {
width: 150
},
}, },
{ {
label: '创建者', label: '创建者',
field: 'creator', field: 'creator',
sort: 'custom', sort: 'custom',
table: {
width: 150
},
isForm: false, isForm: false,
isTable: false isTable: false
}, },
@ -151,7 +126,6 @@ export const Workshop = useCrudSchemas(reactive<CrudSchema[]>([
isDetail: false, isDetail: false,
isForm: false , isForm: false ,
table: { table: {
width: 150,
fixed: 'right' fixed: 'right'
} }
} }

125
src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue

@ -67,13 +67,9 @@
:apiUpdate="ProductionreturnRequestDetailApi.updateProductionreturnRequestDetail" :apiUpdate="ProductionreturnRequestDetailApi.updateProductionreturnRequestDetail"
:apiPage="ProductionreturnRequestDetailApi.getProductionreturnRequestDetailPage" :apiPage="ProductionreturnRequestDetailApi.getProductionreturnRequestDetailPage"
:apiDelete="ProductionreturnRequestDetailApi.deleteProductionreturnRequestDetail" :apiDelete="ProductionreturnRequestDetailApi.deleteProductionreturnRequestDetail"
:Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
/> />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/productionreturn-request-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -104,18 +100,30 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
nextTick(() => { nextTick(() => {
if (type == 'tableForm') { if (type == 'tableForm') {
// //
if(formField == 'packingNumber') { if(formField == 'itemCode') {
row['packingNumber'] = val[0]['packingNumber'] // row['packingNumber'] = val[0]['packingNumber']
row['containerNumber'] = val[0]['containerNumber'] // row['containerNumber'] = val[0]['containerNumber']
row['batch'] = val[0]['batch'] row['batch'] = val[0]['batch']
row['itemCode'] = val[0]['itemCode'] row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom'] row['uom'] = val[0]['uom']
row['inventoryStatus'] = val[0]['inventoryStatus']
row['qty'] = val[0]['qty']
// tableform
ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'qty') {
item.tableForm.max = val[0]['qty']
}
})
} else if(formField == 'workStationCode') {
row['workStationCode'] = val[0]['code']
row['fromLocationCode'] = val[0]['rawLocationCode']
} else { } else {
row[formField] = val[0][searchField] row[formField] = val[0][searchField]
} }
} else { } else {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
tableData.value = [] //
formRef.setValues(setV) formRef.setValues(setV)
} }
}) })
@ -137,10 +145,6 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
}) })
} }
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: ProductionreturnRequestMainApi.getProductionreturnRequestMainPage // getListApi: ProductionreturnRequestMainApi.getProductionreturnRequestMainPage //
}) })
@ -150,28 +154,18 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:productionreturn-request-main:create'}), // defaultButtons.defaultAddBtn({hasPermi:'wms:productionreturn-request-main:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:productionreturn-request-main:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:productionreturn-request-main:export'}), // defaultButtons.defaultExportBtn({hasPermi:'wms:productionreturn-request-main:export'}), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
] ]
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') { //
openForm('create') openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { // } else if (val == 'export') { //
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') { //
@ -194,31 +188,66 @@ const isShowMainButton = (row,val) => {
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), // defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4']), hasPermi:'wms:productionreturn-request-main:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5'])}), // defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']), hasPermi:'wms:productionreturn-request-main:reAdd'}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1'])}), // defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:productionreturn-request-main:submit'}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2'])}), // defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:productionreturn-request-main:refused'}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2'])}), // defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:productionreturn-request-main:handle'}), //
defaultButtons.mainListEditBtn({hasPermi:'wms:productionreturn-request-main:update'}), // defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']), hasPermi:'wms:productionreturn-request-main:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:productionreturn-request-main:delete'}), // defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:productionreturn-request-main:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:productionreturn-request-main:delete'}), //
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { // if (val == 'mainClose') { //
console.log('列表-操作按钮事件-关闭') await message.confirm('确认要关闭吗?')
ProductionreturnRequestMainApi.close(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainReAdd') { // } else if (val == 'mainReAdd') { //
console.log('列表-操作按钮事件-重新添加') await message.confirm('确认要重新添加吗?')
ProductionreturnRequestMainApi.reAdd(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainSubmit') { // } else if (val == 'mainSubmit') { //
console.log('列表-操作按钮事件-提交审批') await message.confirm('确认要重新添加吗?')
ProductionreturnRequestMainApi.submit(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainTurnDown') { // } else if (val == 'mainTurnDown') { //
console.log('列表-操作按钮事件-驳回') await message.confirm('确认要重新添加吗?')
ProductionreturnRequestMainApi.refused(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainApprove') { // } else if (val == 'mainApprove') { //
console.log('列表-操作按钮事件-审批通过') ProductionreturnRequestMainApi.agree(row.id).then(() => {
} else if (val == 'edit') { // message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainHandle') { //
ProductionreturnRequestMainApi.handle(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'edit') { //
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
@ -288,6 +317,8 @@ const handleDeleteTable = (item, index) => {
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
data.subList = tableData.value // data.subList = tableData.value //
// 退 isOK
data.isOK = true
try { try {
if (formType === 'create') { if (formType === 'create') {
await ProductionreturnRequestMainApi.createProductionreturnRequestMain(data) await ProductionreturnRequestMainApi.createProductionreturnRequestMain(data)
@ -304,23 +335,6 @@ const submitForm = async (formType, data) => {
} }
} }
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '生产退料申请主导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
// //
const searchFormClick = (searchData) => { const searchFormClick = (searchData) => {
tableObject.params = { tableObject.params = {
@ -333,6 +347,5 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await ProductionreturnRequestMainApi.importTemplate()
}) })
</script> </script>

503
src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts

@ -59,36 +59,6 @@ export const ProductionreturnRequestMain = useCrudSchemas(reactive<CrudSchema[]>
} }
}, },
}, },
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
table: {
width: 150
},
isForm: false,
},
{
label: '从库位类型范围',
field: 'fromLocationTypes',
dictType: DICT_TYPE.LOCATION_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
isForm: false,
},
{
label: '从库区代码范围',
field: 'fromAreaCodes',
sort: 'custom',
table: {
width: 150
},
isForm: false,
},
{ {
label: '单据号', label: '单据号',
field: 'number', field: 'number',
@ -101,53 +71,22 @@ export const ProductionreturnRequestMain = useCrudSchemas(reactive<CrudSchema[]>
isSearch: true, isSearch: true,
}, },
{ {
label: '业务类型', label: '状态',
field: 'businessType', field: 'status',
sort: 'custom', dictType: DICT_TYPE.REQUEST_STATUS,
table: { dictClass: 'string',
width: 150 isSearch: true,
}, isTable: true,
isForm: false,
},
{
label: '备注',
field: 'remark',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
isTable: false
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: { form: {
component: 'DatePicker', value: '1',
componentProps: { componentProps: {
style: {width:'100%'}, disabled: true
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
} }
}, }
isForm: false
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isForm: false
}, },
{ {
label: '申请时间', label: '申请时间',
@ -193,23 +132,21 @@ export const ProductionreturnRequestMain = useCrudSchemas(reactive<CrudSchema[]>
}, },
}, },
{ {
label: '部门', label: '从库位类型范围',
field: 'departmentCode', field: 'fromLocationTypes',
dictType: DICT_TYPE.LOCATION_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
form: { isForm: false,
value: userDept.name,
componentProps: {
disabled: true
}
}
}, },
{ {
label: '状态', label: '到库位类型范围',
field: 'status', field: 'toLocationTypes',
dictType: DICT_TYPE.REQUEST_STATUS, dictType: DICT_TYPE.LOCATION_TYPE,
dictClass: 'string', dictClass: 'string',
isSearch: true, isSearch: true,
isTable: true, isTable: true,
@ -217,43 +154,34 @@ export const ProductionreturnRequestMain = useCrudSchemas(reactive<CrudSchema[]>
table: { table: {
width: 150 width: 150
}, },
form: { isForm: false,
value: '1',
componentProps: {
disabled: true
}
}
}, },
{ {
label: '最后更新时间', label: '从库区代码范围',
field: 'updateTime', field: 'fromAreaCodes',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom', sort: 'custom',
table: { table: {
width: 180 width: 150
}, },
form: { isForm: false,
component: 'DatePicker', },
componentProps: { {
style: {width:'100%'}, label: '到库区代码范围',
type: 'datetime', field: 'toAreaCodes',
dateFormat: 'YYYY-MM-DD HH:mm:ss', sort: 'custom',
valueFormat: 'x', table: {
} width: 150
}, },
isForm: false isForm: false,
}, },
{ {
label: '最后更新者', label: '从仓库代码',
field: 'updater', field: 'fromWarehouseCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
isForm: false isForm: false,
}, },
{ {
label: '到仓库代码', label: '到仓库代码',
@ -265,27 +193,37 @@ export const ProductionreturnRequestMain = useCrudSchemas(reactive<CrudSchema[]>
isForm: false, isForm: false,
}, },
{ {
label: '到库位类型范围', label: '备注',
field: 'toLocationTypes', field: 'remark',
dictType: DICT_TYPE.LOCATION_TYPE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
isForm: false, isTable: false
}, },
{ {
label: '到库区代码范围', label: '业务类型',
field: 'toAreaCodes', field: 'businessType',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
isForm: false, isForm: false,
}, },
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
table: {
width: 150
},
form: {
value: userDept.name,
componentProps: {
disabled: true
}
}
},
{ {
label: '自动提交', label: '自动提交',
field: 'autoCommit', field: 'autoCommit',
@ -366,6 +304,68 @@ export const ProductionreturnRequestMain = useCrudSchemas(reactive<CrudSchema[]>
} }
} }
}, },
{
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',
}
},
isForm: false
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isForm: 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',
}
},
isForm: false
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
isForm: false
},
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
@ -436,6 +436,10 @@ export const ProductionreturnRequestDetail = useCrudSchemas(reactive<CrudSchema[
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
},{
key: 'workshopCode',
value: 'workshopCode',
isMainValue: true
}] }]
} }
}, },
@ -450,6 +454,10 @@ export const ProductionreturnRequestDetail = useCrudSchemas(reactive<CrudSchema[
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
},{
key: 'workshopCode',
value: 'workshopCode',
isMainValue: true
}] }]
}, },
}, },
@ -473,6 +481,14 @@ export const ProductionreturnRequestDetail = useCrudSchemas(reactive<CrudSchema[
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
},{
key: 'workshopCode',
value: 'workshopCode',
isMainValue: true
},{
key: 'productionLineCode',
value: 'productionLineCode',
isMainValue: true
}] }]
} }
}, },
@ -487,46 +503,36 @@ export const ProductionreturnRequestDetail = useCrudSchemas(reactive<CrudSchema[
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
},{
key: 'workshopCode',
value: 'workshopCode',
isMainValue: true
},{
key: 'productionLineCode',
value: 'productionLineCode',
isMainValue: true
}] }]
}, },
}, },
{ {
label: '库存状态', label: '从库位代码',
field: 'inventoryStatus', field: 'fromLocationCode',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
tableForm: { tableForm: {
type: 'Select' disabled: true
}
},
{
label: '从货主代码',
field: 'fromOwnerCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '到货主代码',
field: 'toOwnerCode',
sort: 'custom',
table: {
width: 150
}, },
isTableForm: false, form: {
isForm: false, componentProps: {
disabled: true
}
}
}, },
{ {
label: '包装号', label: '物品代码',
field: 'packingNumber', field: 'itemCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -535,41 +541,100 @@ export const ProductionreturnRequestDetail = useCrudSchemas(reactive<CrudSchema[
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择包装号', // 输入框占位文本 searchListPlaceholder: '请选择物品代码', // 输入框占位文本
searchField: 'packingNumber', // 查询弹窗赋值字段 searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '库存余额信息', // 查询弹窗标题 searchTitle: '库存余额信息', // 查询弹窗标题
searchAllSchemas: Balance.allSchemas, // 查询弹窗所需类 searchAllSchemas: Balance.allSchemas, // 查询弹窗所需类
searchPage: BalanceApi.getBalancePage // 查询弹窗所需分页方法 searchPage: BalanceApi.getBalancePage, // 查询弹窗所需分页方法
searchCondition:[{
key: 'locationCode',
value: 'fromLocationCode',
isMainValue: true
}]
} }
}, },
tableForm:{ tableForm:{
isInpuFocusShow: true, isInpuFocusShow: true,
searchListPlaceholder: '请选择包装号', // 输入框占位文本 searchListPlaceholder: '请选择物品代码', // 输入框占位文本
searchField: 'packingNumber', // 查询弹窗赋值字段 searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '库存余额信息', // 查询弹窗标题 searchTitle: '库存余额信息', // 查询弹窗标题
searchAllSchemas: Balance.allSchemas, // 查询弹窗所需类 searchAllSchemas: Balance.allSchemas, // 查询弹窗所需类
searchPage: BalanceApi.getBalancePage // 查询弹窗所需分页方法 searchPage: BalanceApi.getBalancePage, // 查询弹窗所需分页方法
searchCondition:[{
key: 'locationCode',
value: 'fromLocationCode',
isMainValue: true
}]
}, },
}, },
// {
// label: '包装号',
// field: 'packingNumber',
// sort: 'custom',
// table: {
// width: 150
// },
// tableForm: {
// disabled: true
// },
// form: {
// componentProps: {
// disabled: true
// }
// }
// },
// {
// label: '器具号',
// field: 'containerNumber',
// sort: 'custom',
// table: {
// width: 150
// },
// tableForm: {
// disabled: true
// },
// form: {
// componentProps: {
// disabled: true
// }
// }
// },
{ {
label: '器具号', label: '物品名称',
field: 'containerNumber', field: 'itemName',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
tableForm: { isTableForm: false,
disabled: true isForm: false,
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
}, },
form: { form: {
component: 'InputNumber',
componentProps: { componentProps: {
disabled: true min: 1,
precision: 6
} }
},
tableForm: {
type: 'InputNumber',
min: 1,
precision: 6
} }
}, },
{ {
label: '批次', label: '计量单位',
field: 'batch', field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -584,8 +649,8 @@ export const ProductionreturnRequestDetail = useCrudSchemas(reactive<CrudSchema[
} }
}, },
{ {
label: '从库位代码', label: '物品描述1',
field: 'fromLocationCode', field: 'itemDesc1',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -594,27 +659,37 @@ export const ProductionreturnRequestDetail = useCrudSchemas(reactive<CrudSchema[
isForm: false, isForm: false,
}, },
{ {
label: '单据号', label: '物品描述2',
field: 'number', field: 'itemDesc2',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
isTableForm: false, isTableForm: false,
form: { isForm: false,
componentProps: {
disabled: true
}
}
}, },
{ {
label: '物品代码', label: '项目代码',
field: 'itemCode', field: 'projectCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
tableForm: { tableForm: {
type: 'Select',
disabled: true disabled: true
}, },
form: { form: {
@ -624,59 +699,48 @@ export const ProductionreturnRequestDetail = useCrudSchemas(reactive<CrudSchema[
} }
}, },
{ {
label: '备注', label: '批次',
field: 'remark', field: 'batch',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, tableForm: {
{ disabled: true
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
}, },
form: { form: {
component: 'DatePicker',
componentProps: { componentProps: {
style: {width:'100%'}, disabled: true
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
} }
}, }
isTableForm: false,
isForm: false
}, },
{ {
label: '创建者', label: '从库位代码',
field: 'creator', field: 'fromLocationCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
isTableForm: false, isTableForm: false,
isForm: false isForm: false,
}, },
{ {
label: '物品名称', label: '单据号',
field: 'itemName', field: 'number',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
isTableForm: false, isTableForm: false,
isForm: false, form: {
componentProps: {
disabled: true
}
}
}, },
{ {
label: '物品描述1', label: '从货主代码',
field: 'itemDesc1', field: 'fromOwnerCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -685,8 +749,8 @@ export const ProductionreturnRequestDetail = useCrudSchemas(reactive<CrudSchema[
isForm: false, isForm: false,
}, },
{ {
label: '物品描述2', label: '到货主代码',
field: 'itemDesc2', field: 'toOwnerCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -695,48 +759,45 @@ export const ProductionreturnRequestDetail = useCrudSchemas(reactive<CrudSchema[
isForm: false, isForm: false,
}, },
{ {
label: '项目代码', label: '备注',
field: 'projectCode', field: 'remark',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
isTableForm: false,
isForm: false,
}, },
{ {
label: '数量', label: '创建时间',
field: 'qty', field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 180
}, },
form: { form: {
component: 'InputNumber', component: 'DatePicker',
componentProps: { componentProps: {
min: 1, style: {width:'100%'},
precision: 6 type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
} }
}, },
tableForm: { isTableForm: false,
type: 'InputNumber', isForm: false
min: 1,
precision: 6
}
}, },
{ {
label: '计量单位', label: '创建者',
field: 'uom', field: 'creator',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
tableForm: { isTableForm: false,
type: 'Select' isForm: false
}
}, },
{ {
label: '最后更新时间', label: '最后更新时间',

367
src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue

@ -0,0 +1,367 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ProductionreturnRequestMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ProductionreturnRequestMain.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="ProductionreturnRequestMainRules"
:formAllSchemas="ProductionreturnRequestMain.allSchemas"
:tableAllSchemas="ProductionreturnRequestDetail.allSchemas"
:tableFormRules="ProductionreturnRequestDetailRules"
:tableData="tableData"
:apiUpdate="ProductionreturnRequestMainNoApi.updateProductionreturnRequestMain"
:apiCreate="ProductionreturnRequestMainNoApi.createProductionreturnRequestMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="ProductionreturnRequestMain.allSchemas"
:detailAllSchemas="ProductionreturnRequestDetail.allSchemas"
:detailAllSchemasRules="ProductionreturnRequestDetailRules"
:apiCreate="ProductionreturnRequestDetailNoApi.createProductionreturnRequestDetail"
:apiUpdate="ProductionreturnRequestDetailNoApi.updateProductionreturnRequestDetail"
:apiPage="ProductionreturnRequestDetailNoApi.getProductionreturnRequestDetailPage"
:apiDelete="ProductionreturnRequestDetailNoApi.deleteProductionreturnRequestDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" :url="importFormUrlRef" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ProductionreturnRequestMain,ProductionreturnRequestMainRules,ProductionreturnRequestDetail,ProductionreturnRequestDetailRules } from './productionreturnRequestMainNo.data'
import * as ProductionreturnRequestMainNoApi from '@/api/wms/productionreturnRequestMainNo'
import * as ProductionreturnRequestDetailNoApi from '@/api/wms/productionreturnRequestDetailNo'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
// 退
defineOptions({ name: 'ProductionreturnRequestMainNo' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ProductionreturnRequestMain.allSchemas.tableColumns)
const importFormUrlRef = ref('/wms/productionreturn-request-main/import')
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => {
if (type == 'tableForm') {
//
if(formField == 'packingNumber') {
row['packingNumber'] = val[0]['packingNumber']
row['containerNumber'] = val[0]['containerNumber']
row['batch'] = val[0]['batch']
row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom']
} else {
row[formField] = val[0][searchField]
}
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
if(formField == 'packingNumber') {
setV['packingNumber'] = val[0]['packingNumber']
setV['containerNumber'] = val[0]['containerNumber']
setV['batch'] = val[0]['batch']
setV['itemCode'] = val[0]['itemCode']
setV['uom'] = val[0]['uom']
} else {
setV[formField] = val[0][searchField]
}
formRef.setValues(setV)
})
}
const { tableObject, tableMethods } = useTable({
getListApi: ProductionreturnRequestMainNoApi.getProductionreturnRequestMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
{
label: '新增合格',
name: 'xzhg',
hide: false,
type: 'primary',
icon: 'ep:plus',
color: '',
hasPermi:'wms:productionreturn-request-main:create'
},
{
label: '新增不合格',
name: 'xzbhg',
hide: false,
type: 'primary',
icon: 'ep:plus',
color: '',
hasPermi:'wms:productionreturn-request-main:create'
},
{
label: '导入合格',
name: 'drhg',
hide: false,
type: 'warning',
icon: 'ep:upload',
color: '',
hasPermi:'wms:productionreturn-request-main:import'
},
{
label: '导入不合格',
name: 'drbhg',
hide: false,
type: 'warning',
icon: 'ep:upload',
color: '',
hasPermi:'wms:productionreturn-request-main:import'
},
defaultButtons.defaultExportBtn({hasPermi:'wms:productionreturn-request-main:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'xzhg') { //
openForm('create')
} else if (val == 'xzbhg') { //
openForm('create')
} else if (val == 'drhg') { //
handleImport()
} else if (val == 'drbhg') { //
importFormUrlRef.value = '/wms/productionreturn-request-main/importNO'
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','6'])}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5'])}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1'])}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListEditBtn({hasPermi:'wms:productionreturn-request-main:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:productionreturn-request-main:delete'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { //
console.log('列表-操作按钮事件-关闭')
} else if (val == 'mainReAdd') { //
console.log('列表-操作按钮事件-重新添加')
} else if (val == 'mainSubmit') { //
console.log('列表-操作按钮事件-提交审批')
} else if (val == 'mainTurnDown') { //
console.log('列表-操作按钮事件-驳回')
} else if (val == 'mainApprove') { //
console.log('列表-操作按钮事件-审批通过')
} 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 = [] //
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ProductionreturnRequestMainNoApi.deleteProductionreturnRequestMain(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 ProductionreturnRequestMainNoApi.exportProductionreturnRequestMain(setSearchParams)
download.excel(data, '生产退料申请主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
ProductionreturnRequestDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
try {
if (formType === 'create') {
await ProductionreturnRequestMainNoApi.createProductionreturnRequestMain(data)
message.success(t('common.createSuccess'))
} else {
await ProductionreturnRequestMainNoApi.updateProductionreturnRequestMain(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() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ProductionreturnRequestMainNoApi.importTemplate()
})
</script>

804
src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/productionreturnRequestMainNo.data.ts

@ -0,0 +1,804 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
import * as WorkshopApi from '@/api/wms/workshop'
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
import * as ProductionlineApi from '@/api/wms/productionline'
import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data'
import * as WorkstationApi from '@/api/wms/workstation'
import { Workstation } from '@/views/wms/basicDataManage/factoryModeling/workstation/workstation.data'
import * as BalanceApi from '@/api/wms/balance'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
const { t } = useI18n() // 国际化
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = {
pageSize:10,
pageNo:1,
code:'MaterialReturnRequest'
}
const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData =data?.list[0]||{}
// 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept
/**
* @returns {Array} 退
*/
export const ProductionreturnRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '车间代码',
field: 'workshopCode',
sort: 'custom',
table: {
width: 150
},
isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择车间代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '车间信息', // 查询弹窗标题
searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类
searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法
searchCondition:[{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
table: {
width: 150
},
isForm: false,
},
{
label: '从库位类型范围',
field: 'fromLocationTypes',
dictType: DICT_TYPE.LOCATION_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
isForm: false,
},
{
label: '从库区代码范围',
field: 'fromAreaCodes',
sort: 'custom',
table: {
width: 150
},
isForm: false,
},
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 150,
fixed: 'left'
},
isForm: false,
isSearch: true,
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
isForm: false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTable: 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',
}
},
isForm: false
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isForm: false
},
{
label: '申请时间',
field: 'requestTime',
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: 'dueTime',
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',
}
},
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
table: {
width: 150
},
form: {
value: userDept.name,
componentProps: {
disabled: true
}
}
},
{
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: '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',
}
},
isForm: false
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
isForm: false
},
{
label: '到仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
table: {
width: 150
},
isForm: false,
},
{
label: '到库位类型范围',
field: 'toLocationTypes',
dictType: DICT_TYPE.LOCATION_TYPE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
isForm: false,
},
{
label: '到库区代码范围',
field: 'toAreaCodes',
sort: 'custom',
table: {
width: 150
},
isForm: false,
},
{
label: '自动提交',
field: 'autoCommit',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.autoCommit,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true,
}
}
},
{
label: '自动通过',
field: 'autoAgree',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.autoAgree,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true,
}
}
},
{
label: '自动执行',
field: 'autoExecute',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.autoExecute,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true,
}
}
},
{
label: '直接生成记录',
field: 'directCreateRecord',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.directCreateRecord,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true,
}
}
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 300,
fixed: 'right'
},
}
]))
//表单校验
export const ProductionreturnRequestMainRules = reactive({
// fromWarehouseCode: [
// { required: true, message: '请输入从仓库代码', trigger: 'blur' }
// ],
// fromLocationTypes: [
// { required: true, message: '请选择从库位类型范围', trigger: 'change' }
// ],
// toWarehouseCode: [
// { required: true, message: '请输入到仓库代码', trigger: 'blur' }
// ],
// toLocationTypes: [
// { required: true, message: '请选择到库位类型范围', trigger: 'change' }
// ],
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }
],
autoCommit: [
{ required: true, message: '请选择是否自动提交', trigger: 'change' }
],
autoAgree: [
{ required: true, message: '请选择是否自动通过', trigger: 'change' }
],
autoExecute: [
{ required: true, message: '请选择是否自动执行', trigger: 'change' }
],
directCreateRecord: [
{ required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' }
],
// businessType: [
// { required: true, message: '请输入业务类型', trigger: 'blur' }
// ],
})
/**
* @returns {Array} 退
*/
export const ProductionreturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '生产线代码',
field: 'productionLineCode',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '生产线信息', // 查询弹窗标题
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
searchCondition:[{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
tableForm:{
isInpuFocusShow: true,
searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '生产线信息', // 查询弹窗标题
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
searchCondition:[{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
},
},
{
label: '工位代码',
field: 'workStationCode',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择工位代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '工位信息', // 查询弹窗标题
searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类
searchPage: WorkstationApi.getWorkstationPage, // 查询弹窗所需分页方法
searchCondition:[{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
tableForm:{
isInpuFocusShow: true,
searchListPlaceholder: '请选择工位代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '工位信息', // 查询弹窗标题
searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类
searchPage: WorkstationApi.getWorkstationPage, // 查询弹窗所需分页方法
searchCondition:[{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
},
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select'
}
},
{
label: '从货主代码',
field: 'fromOwnerCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '到货主代码',
field: 'toOwnerCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择包装号', // 输入框占位文本
searchField: 'packingNumber', // 查询弹窗赋值字段
searchTitle: '库存余额信息', // 查询弹窗标题
searchAllSchemas: Balance.allSchemas, // 查询弹窗所需类
searchPage: BalanceApi.getBalancePage // 查询弹窗所需分页方法
}
},
tableForm:{
isInpuFocusShow: true,
searchListPlaceholder: '请选择包装号', // 输入框占位文本
searchField: 'packingNumber', // 查询弹窗赋值字段
searchTitle: '库存余额信息', // 查询弹窗标题
searchAllSchemas: Balance.allSchemas, // 查询弹窗所需类
searchPage: BalanceApi.getBalancePage // 查询弹窗所需分页方法
},
},
{
label: '器具号',
field: 'containerNumber',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '物品代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
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: 'creator',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 6
}
},
tableForm: {
type: 'InputNumber',
min: 1,
precision: 6
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select'
}
},
{
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: 'updater',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 150,
fixed: 'right'
},
isTableForm:false,
}
]))
//表单校验
export const ProductionreturnRequestDetailRules = reactive({
packingNumber: [
{ required: true, message: '请选择包装号', trigger: 'change' }
],
batch: [
{ required: true, message: '请输入批次', trigger: 'blur' }
],
inventoryStatus: [
{ required: true, message: '请选择库存状态', trigger: 'change' }
],
// fromLocationCode: [
// { required: true, message: '请输入从库位代码', trigger: 'blur' }
// ],
itemCode: [
{ required: true, message: '请输入物品代码', trigger: 'blur' }
],
})
Loading…
Cancel
Save