Browse Source

器具管理开发代码

hella_chenfang
chenfang 4 weeks ago
parent
commit
e12b216d7f
  1. 7
      src/api/wms/containerMainRequest/index.ts
  2. 3
      src/views/wms/inventoryjobManage/containermanage/createContainerMainRequest/index.vue
  3. 4
      src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/index.vue
  4. 16
      src/views/wms/inventoryjobManage/containermanage/moveContainerMainRequest/index.vue
  5. 10
      src/views/wms/inventoryjobManage/containermanage/returnContainerMainRequest/index.vue
  6. 24
      src/views/wms/inventoryjobManage/containermanage/returnContainerMainRequest/returnContainerMainRequest.data.ts
  7. 5
      src/views/wms/inventoryjobManage/containermanage/scrapContainerMainRequest/index.vue
  8. 249
      src/views/wms/inventoryjobManage/containermanage/scrapContainerMainRequest/scrapContainerMainRequest.data.ts

7
src/api/wms/containerMainRequest/index.ts

@ -113,11 +113,16 @@ export const exportDeliverContainerMainRequest = async (params) => {
} }
} }
// 下载用户导入模板 // 下载用户导入模板(器具初始化/新增)
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/wms/container-main-request/get-import-template' }) return request.download({ url: '/wms/container-main-request/get-import-template' })
} }
// 下载用户导入模板(器具返回/移动/报废)
export const importTemplateReturnAndMove = () => {
return request.download({ url: '/wms/container-main-request/get-import-template-returnAndMove' })
}
// 关闭 // 关闭
export const close = (id) => { export const close = (id) => {
return request.put({ url: '/wms/container-main-request/close?id=' + id }) return request.put({ url: '/wms/container-main-request/close?id=' + id })

3
src/views/wms/inventoryjobManage/containermanage/createContainerMainRequest/index.vue

@ -81,7 +81,7 @@
/> />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/container-main-request/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" url="/wms/container-main-request/import" :importTemplateData="importTemplateData" @success="importSuccess" :toInventoryStatus= "toInventoryStatus"/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -105,6 +105,7 @@ const toLocationCode = ref()
const importFileName = ref() const importFileName = ref()
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
const toInventoryStatus = 'CREATE'
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(ContainerMainRequest.allSchemas.tableColumns) const tableColumns = ref(ContainerMainRequest.allSchemas.tableColumns)
console.log(99 , routeName.value) console.log(99 , routeName.value)

4
src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/index.vue

@ -81,7 +81,7 @@
/> />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/container-main-request/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" url="/wms/container-main-request/import" :importTemplateData="importTemplateData" @success="importSuccess" :toInventoryStatus= "toInventoryStatus"/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -105,6 +105,7 @@ const toLocationCode = ref()
const importFileName = ref() const importFileName = ref()
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
const toInventoryStatus = 'INITIAL'
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(ContainerMainRequest.allSchemas.tableColumns) const tableColumns = ref(ContainerMainRequest.allSchemas.tableColumns)
console.log(99 , routeName.value) console.log(99 , routeName.value)
@ -537,4 +538,3 @@ onMounted(async () => {
}) })
</script> </script>
./initialContainerMainRequest.data

16
src/views/wms/inventoryjobManage/containermanage/moveContainerMainRequest/index.vue

@ -81,7 +81,7 @@
/> />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/container-main-request/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" url="/wms/container-main-request/import" :importTemplateData="importTemplateData" @success="importSuccess" :toInventoryStatus= "toInventoryStatus"/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -105,6 +105,7 @@ const toLocationCode = ref()
const importFileName = ref() const importFileName = ref()
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
const toInventoryStatus = 'MOVE'
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(ContainerMainRequest.allSchemas.tableColumns) const tableColumns = ref(ContainerMainRequest.allSchemas.tableColumns)
console.log(99 , routeName.value) console.log(99 , routeName.value)
@ -119,12 +120,12 @@ const { tableObject, tableMethods } = useTable({
if ( routeName.value == 'MoveContainerManageRequest') { if ( routeName.value == 'MoveContainerManageRequest') {
tableObject.params = { tableObject.params = {
type:'Move', type:'MOVE',
} }
searchType.value = 'Move' searchType.value = 'MOVE'
ContainerMainRequest.allSchemas.formSchema.forEach(item=>{ ContainerMainRequest.allSchemas.formSchema.forEach(item=>{
if(item.field == 'type'){ if(item.field == 'type'){
item.value = "Move" item.value = "MOVE"
} }
}); });
@ -148,9 +149,12 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
if(val.length==0) return if(val.length==0) return
val.forEach(item=>{ val.forEach(item=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow['containerNumber'] = item['code'] newRow['containerNumber'] = item['itemCode']
newRow['uom'] = item['uom'] newRow['uom'] = item['uom']
newRow['toInventoryStatus'] = 'OK' newRow['toInventoryStatus'] = 'OK'
newRow['fromLocationCode'] = item['locationCode']
newRow['fromInventoryStatus'] = item['inventoryStatus']
newRow['toQty'] = item['qty']
tableData.value.push(newRow) tableData.value.push(newRow)
}) })
@ -531,7 +535,7 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await ContainerMainRequestApi.importTemplate() importTemplateData.templateUrl = await ContainerMainRequestApi.importTemplateReturnAndMove()
}) })
</script> </script>

10
src/views/wms/inventoryjobManage/containermanage/returnContainerMainRequest/index.vue

@ -81,7 +81,7 @@
/> />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/container-main-request/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" url="/wms/container-main-request/import" :importTemplateData="importTemplateData" @success="importSuccess":toInventoryStatus= "toInventoryStatus"/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -105,6 +105,7 @@ const toLocationCode = ref()
const importFileName = ref() const importFileName = ref()
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
const toInventoryStatus = 'RETURN'
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(ContainerMainRequest.allSchemas.tableColumns) const tableColumns = ref(ContainerMainRequest.allSchemas.tableColumns)
console.log(99 , routeName.value) console.log(99 , routeName.value)
@ -148,9 +149,12 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
if(val.length==0) return if(val.length==0) return
val.forEach(item=>{ val.forEach(item=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow['containerNumber'] = item['code'] newRow['containerNumber'] = item['itemCode']
newRow['uom'] = item['uom'] newRow['uom'] = item['uom']
newRow['toInventoryStatus'] = 'OK' newRow['toInventoryStatus'] = 'OK'
newRow['fromLocationCode'] = item['locationCode']
newRow['fromInventoryStatus'] = item['inventoryStatus']
newRow['toQty'] = item['qty']
tableData.value.push(newRow) tableData.value.push(newRow)
}) })
@ -531,7 +535,7 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await ContainerMainRequestApi.importTemplate() importTemplateData.templateUrl = await ContainerMainRequestApi.importTemplateReturnAndMove()
}) })
</script> </script>

24
src/views/wms/inventoryjobManage/containermanage/returnContainerMainRequest/returnContainerMainRequest.data.ts

@ -488,7 +488,29 @@ export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
{ {
label: '库存状态', label: '从库存状态',
field: 'fromInventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isForm: false,
isTableForm: false,
isTable: false,
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true,
type: 'Select'
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '到库存状态',
field: 'toInventoryStatus', field: 'toInventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS, dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string', dictClass: 'string',

5
src/views/wms/inventoryjobManage/containermanage/scrapContainerMainRequest/index.vue

@ -81,7 +81,7 @@
/> />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/container-main-request/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" url="/wms/container-main-request/import" :importTemplateData="importTemplateData" @success="importSuccess" :toInventoryStatus= "toInventoryStatus"/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -107,6 +107,7 @@ const toLocationCode = ref()
const fromLocationCode = ref() const fromLocationCode = ref()
const importFileName = ref() const importFileName = ref()
const route = useRoute() // const route = useRoute() //
const toInventoryStatus = 'SCRAP'
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(ContainerMainRequest.allSchemas.tableColumns) const tableColumns = ref(ContainerMainRequest.allSchemas.tableColumns)
@ -556,7 +557,7 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await ContainerMainRequestApi.importTemplate() importTemplateData.templateUrl = await ContainerMainRequestApi.importTemplateReturnAndMove()
}) })
</script> </script>

249
src/views/wms/inventoryjobManage/containermanage/scrapContainerMainRequest/scrapContainerMainRequest.data.ts

@ -9,6 +9,7 @@ import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data' import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
import * as getRequestsettingApi from '@/api/wms/requestsetting/index' import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
import * as getBusinessTypeApi from '@/api/wms/businesstype/index'
// 表单校验 // 表单校验
export const ContainerMainRequestRules = reactive({ export const ContainerMainRequestRules = reactive({
@ -27,6 +28,17 @@ const queryParams = {
const data = await getRequestsettingApi.getRequestsettingPage(queryParams) const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData = data?.list[0] || {} const requestsettingData = data?.list[0] || {}
const businessTypeQueryParams = {
pageSize:10,
pageNo:1,
code:'ScrapContainerManage',
name:'器具报废管理'
}
const businessTypeValue = await getBusinessTypeApi.getBusinesstypePage(businessTypeQueryParams)
const businessTypeData =businessTypeValue?.list[0]||{}
// 获取当前操作人的部门 // 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore() const userStore = useUserStore()
@ -63,6 +75,49 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
// {
// label: '到库位代码',
// field: 'toLocationCode',
// sort: 'custom',
// table: {
// width: 150
// },
// tableForm:{
// isInpuFocusShow: true, // 开启查询弹窗
// searchListPlaceholder: '请选择到库位代码',
// searchField: 'code',
// searchTitle: '库位信息',
// searchAllSchemas: Location.allSchemas,
// searchPage: LocationApi.selectBusinessTypeToLocation,
// searchCondition: [{
// key: 'businessType',
// value: businessTypeData.code,
// },{
// key: 'isIn',
// value: 'in',
// isMainValue: false
// }]
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择到库位代码',
// searchField: 'code',
// searchTitle: '库位信息',
// searchAllSchemas: Location.allSchemas,
// searchPage: LocationApi.selectBusinessTypeToLocation,
// searchCondition: [{
// key: 'businessType',
// value: businessTypeData.code,
// },{
// key: 'isIn',
// value: 'in',
// isMainValue: false
// }]
// }
// }
// },
{ {
label: '类型', label: '类型',
field: 'type', field: 'type',
@ -96,16 +151,18 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
field: 'mainRemark', field: 'mainRemark',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isTable: true isForm: true,
isTable: false,
}, },
{ {
label: '部门', label: '部门',
field: 'departmentCode', field: 'departmentCode',
sort: 'custom', sort: 'custom',
isForm: false,
table: { table: {
width: 150 width: 150
}, },
isSearch: false,
isForm: false,
isTable: false, isTable: false,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userDeptArray.find((account) => account.id == cellValue)?.name return userDeptArray.find((account) => account.id == cellValue)?.name
@ -218,7 +275,9 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
detail: { detail: {
dateFormat : 'YYYY-MM-DD HH:mm:ss' dateFormat : 'YYYY-MM-DD HH:mm:ss'
}, },
isSearch: true, isSearch: false,
isForm: false,
isTable: false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -227,8 +286,6 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
} }
}, },
isTable: true,
isForm: false,
}, },
{ {
label: '创建者', label: '创建者',
@ -236,8 +293,9 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 130 width: 130
}, },
isSearch: false,
isForm: false, isForm: false,
isTable: true isTable: false,
}, },
{ {
label: '最后更新时间', label: '最后更新时间',
@ -267,6 +325,7 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '最后更新者', label: '最后更新者',
field: 'updater', field: 'updater',
isDetail: true, isDetail: true,
isSearch: false,
isForm: false, isForm: false,
isTable: false, isTable: false,
table: { table: {
@ -277,8 +336,9 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '扩展属性', label: '扩展属性',
field: 'extraProperties', field: 'extraProperties',
sort: 'custom', sort: 'custom',
isSearch: false,
isForm: false, isForm: false,
isTable: false isTable: false,
}, },
{ {
label: '并发乐观锁', label: '并发乐观锁',
@ -288,13 +348,15 @@ export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
component: 'InputNumber', component: 'InputNumber',
value: 0 value: 0
}, },
isSearch: false,
isForm: false, isForm: false,
isTable: false isTable: false,
}, },
{ {
label: '地点ID', label: '地点ID',
field: 'siteId', field: 'siteId',
sort: 'custom', sort: 'custom',
isSearch: false,
isForm: false, isForm: false,
isTable: false, isTable: false,
}, },
@ -364,7 +426,7 @@ export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'itemCode', searchField: 'itemCode',
searchTitle: '库存余额信息', searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas, searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.selectConfigToBalance, searchPage: BalanceApi.getBalanceByQJ,
}, },
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
@ -374,7 +436,7 @@ export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'itemCode', searchField: 'itemCode',
searchTitle: '库存余额信息', searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas, searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.selectConfigToBalance, searchPage: BalanceApi.getBalanceByQJ,
} }
} }
}, },
@ -382,6 +444,9 @@ export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '来源库位代码', label: '来源库位代码',
field: 'fromLocationCode', field: 'fromLocationCode',
sort: 'custom', sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false,
table: { table: {
width: 150 width: 150
}, },
@ -396,83 +461,70 @@ export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{ // {
label: '目标库位代码', // label: '目标库位代码',
field: 'toLocationCode', // field: 'toLocationCode',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
tableForm: { // tableForm: {
enterSearch:true, // enterSearch:true,
isInpuFocusShow: true, // 开启查询弹窗 // isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择到库位代码', // searchListPlaceholder: '请选择到库位代码',
searchField: 'code', // searchField: 'code',
searchTitle: '库位信息', // searchTitle: '库位信息',
searchAllSchemas: Location.allSchemas, // searchAllSchemas: Location.allSchemas,
searchPage: LocationApi.selectPageItemAreaToLocation, // searchPage: LocationApi.selectPageItemAreaToLocation,
// 失去焦点校验参数 // // 失去焦点校验参数
verificationParams: [{ // verificationParams: [{
key: 'code', // key: 'code',
action: '==', // action: '==',
value: '', // value: '',
isMainValue: false, // isMainValue: false,
isSearch: 'true', // isSearch: 'true',
isFormModel: true, // isFormModel: true,
}] // }]
}, // },
form: { // form: {
// labelMessage: '信息提示说明!!!', // // labelMessage: '信息提示说明!!!',
componentProps: { // componentProps: {
enterSearch: true, // enterSearch: true,
isSearchList: true, // 开启查询弹窗 // isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择到库位代码', // searchListPlaceholder: '请选择到库位代码',
searchField: 'code', // searchField: 'code',
searchTitle: '库位信息', // searchTitle: '库位信息',
searchAllSchemas: Location.allSchemas, // searchAllSchemas: Location.allSchemas,
searchPage: LocationApi.selectPageItemAreaToLocation, // searchPage: LocationApi.selectPageItemAreaToLocation,
// 失去焦点校验参数 // // 失去焦点校验参数
verificationParams: [{ // verificationParams: [{
key: 'code', // key: 'code',
action: '==', // action: '==',
value: '', // value: '',
isMainValue: false, // isMainValue: false,
isSearch: 'true', // isSearch: 'true',
isFormModel: true, // isFormModel: true,
}] // }]
} // }
} // }
}, // },
{ // {
label: '从库存状态', // label: '从库存状态',
field: 'fromInventoryStatus', // field: 'fromInventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS, // dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string', // dictClass: 'string',
isTable: true, // isForm: false,
sort: 'custom', // isTableForm: false,
table: { // isTable: false,
width: 150 // sort: 'custom',
}, // table: {
tableForm: { // width: 150
disabled: true, // },
type: 'Select' // tableForm: {
}, // disabled: true,
}, // type: 'Select'
{ // },
label: '到库存状态', // },
field: 'toInventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: true
},
},
// { // {
// label: '从数量', // label: '从数量',
// field: 'fromQty', // field: 'fromQty',
@ -482,7 +534,7 @@ export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
// }, // },
// }, // },
{ {
label: '数量', label: '数量',
field: 'toQty', field: 'toQty',
sort: 'custom', sort: 'custom',
form: { form: {
@ -514,11 +566,30 @@ export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
type: 'Select' type: 'Select'
} }
}, },
{
label: '到库存状态',
field: 'toInventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isForm: false,
isTableForm: false,
isTable: false,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: true
},
},
{ {
label: '子备注', label: '子备注',
field: 'remark', field: 'remark',
sort: 'custom', sort: 'custom',
isTable: true isTable: true,
isForm: false,
isTableForm: false
}, },
{ {
label: '创建时间', label: '创建时间',

Loading…
Cancel
Save