Browse Source

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

master_hella_20240701
ljlong_2630 6 months ago
parent
commit
4551d0f1c6
  1. 4
      .env.wyf
  2. 52
      README.md
  3. 57
      src/api/eam/basicFaultCause/index.ts
  4. 56
      src/api/eam/basicFaultType/index.ts
  5. 56
      src/api/eam/documentType/index.ts
  6. 56
      src/api/eam/equipmentMainPart/index.ts
  7. 1
      src/api/infra/config/index.ts
  8. 10
      src/api/mes/workScheduling/index.ts
  9. 4
      src/api/mes/workSchedulingDetail/index.ts
  10. 11
      src/api/wms/balance/index.ts
  11. 60
      src/api/wms/containerDetailRequest/index.ts
  12. 82
      src/api/wms/containerMainRequest/index.ts
  13. 58
      src/api/wms/containerRecordDetail/index.ts
  14. 56
      src/api/wms/containerRecordMain/index.ts
  15. 63
      src/api/wms/customerDeliveryForecast/index.ts
  16. 10
      src/api/wms/itembasic/index.ts
  17. 6
      src/api/wms/location/index.ts
  18. 1
      src/api/wms/productionreturnRequestDetail/index.ts
  19. 1
      src/api/wms/productionreturnRequestDetailNo/index.ts
  20. 21
      src/api/wms/purchaseprice/index.ts
  21. 10
      src/api/wms/purchasereceiptRecordMain/index.ts
  22. 10
      src/api/wms/purchasereturnRecordMain/index.ts
  23. 23
      src/api/wms/supplier/index.ts
  24. 21
      src/api/wms/supplieritem/index.ts
  25. 15
      src/components/SearchTable/src/SearchTable.vue
  26. 1
      src/locales/en-US.ts
  27. 3
      src/locales/zh-CN.ts
  28. 1
      src/plugins/vueI18n/index.ts
  29. 2
      src/utils/dict.ts
  30. 3
      src/utils/disposition/defaultButtons.ts
  31. 160
      src/views/eam/basicFaultCause/basicFaultCause.data.ts
  32. 244
      src/views/eam/basicFaultCause/index.vue
  33. 147
      src/views/eam/basicFaultType/basicFaultType.data.ts
  34. 244
      src/views/eam/basicFaultType/index.vue
  35. 149
      src/views/eam/documentType/documentType.data.ts
  36. 244
      src/views/eam/documentType/index.vue
  37. 149
      src/views/eam/equipmentMainPart/equipmentMainPart.data.ts
  38. 244
      src/views/eam/equipmentMainPart/index.vue
  39. 3
      src/views/mes/orderDay/components/schedule.vue
  40. 2
      src/views/mes/orderDay/index.vue
  41. 119
      src/views/mes/workScheduling/components/Detail.vue
  42. 127
      src/views/mes/workScheduling/components/qualifiedCheck.vue
  43. 219
      src/views/mes/workScheduling/components/report.vue
  44. 185
      src/views/mes/workScheduling/components/reportAll.vue
  45. 31
      src/views/mes/workScheduling/index.vue
  46. 194
      src/views/qms/inspectionJob/addForm.vue
  47. 135
      src/views/wms/basicDataManage/customerManage/customerDeliveryForecast/customerDeliveryForecast.data.ts
  48. 244
      src/views/wms/basicDataManage/customerManage/customerDeliveryForecast/index.vue
  49. 25
      src/views/wms/basicDataManage/itemManage/packageunit/index.vue
  50. 7
      src/views/wms/basicDataManage/supplierManage/purchaseprice/index.vue
  51. 7
      src/views/wms/basicDataManage/supplierManage/supplier/index.vue
  52. 7
      src/views/wms/basicDataManage/supplierManage/supplieritem/index.vue
  53. 4
      src/views/wms/deliversettlementManage/deliverplan/saleMain/index.vue
  54. 20
      src/views/wms/deliversettlementManage/deliverplan/saleMain/saleMain.data.ts
  55. 504
      src/views/wms/inventoryjobManage/containermanage/containerMainRequest/containerMainRequest.data.ts
  56. 507
      src/views/wms/inventoryjobManage/containermanage/containerMainRequest/index.vue
  57. 284
      src/views/wms/inventoryjobManage/containermanage/containerRecordMain/containerRecordMain.data.ts
  58. 249
      src/views/wms/inventoryjobManage/containermanage/containerRecordMain/index.vue
  59. 462
      src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/index.vue
  60. 475
      src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/initialContainerMainRequest.data.ts
  61. 487
      src/views/wms/inventoryjobManage/containermanage/scrapContainerMainRequest/index.vue
  62. 502
      src/views/wms/inventoryjobManage/containermanage/scrapContainerMainRequest/scrapContainerMainRequest.data.ts
  63. 3
      src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts
  64. 3
      src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue
  65. 3
      src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/productionreturnRequestMainNo.data.ts
  66. 20
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptJobMain/index.vue
  67. 5
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/index.vue
  68. 42
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue
  69. 6
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRecordMain/index.vue
  70. 2
      src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue
  71. 4
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
  72. 66
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

4
.env.wyf

@ -4,9 +4,9 @@ NODE_ENV=test
VITE_DEV=false
# 请求路径
VITE_BASE_URL='http://192.168.0.108:12080'
VITE_BASE_URL='http://192.168.0.113:12080'
# 上传路径
VITE_UPLOAD_URL='http://192.168.0.108:12080/admin-api/infra/file/upload'
VITE_UPLOAD_URL='http://192.168.0.113:12080/admin-api/infra/file/upload'
# # 请求路径
# VITE_BASE_URL='http://dev.ccwin-in.com:25300/api'

52
README.md

@ -1,4 +1,4 @@
## dev发布2024-05-13-002
## dev发布2024-05-15-002
**xxxx.data.ts 文件配置说明**
**form表单查询弹窗配置**
form: {
@ -48,9 +48,47 @@ tableForm:{
}]
},
// 主子合并隐藏子
hiddenInMain:true
// 主子排序 不配置默认999,不要设置0(留给左侧固定列使用)
sortTableDefault:
// 查询条件排序
sortSearchDefault:
**主子表合并需要修改的代码**
1、影响Table表头
const tableColumns =
ref([…”PurchaseMain”.allSchemas.tableColumns,…”PurchaseDetail”.allSchemas.tableMainColumns])
PurchaseMain:主表
PurchaseDetail:子表
2、影响搜索头部
在TableHead标签内部添加属性:
<TableHead
......
:detailAllSchemas="PurchaseDetail.allSchemas"
/>
3、影响操作按钮
3.1 修改<Table 标签中赋值
原有:
#action="{ row }”
:Butttondata=“butttondata(row)"
改为:
#action="{ row,$index }”
:Butttondata="butttondata(row,$index)"
3.2 在按钮回调中添加$index,固定的写死:
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>0&&findIndex<$index){
return []
}
…下面是原有的按钮逻辑,不变
}
4、更换子表的请求接口
const { tableObject, tableMethods } = useTable({
getListApi: “PurchasereceiptRequestDetailApi.getPurchasereceiptRequestDetailPage”// 分页接口
})
5、ts文件配置:
hiddenInMain:true, //子表中数据不展示在主表
sortTableDefault:1000, // 主页面中Table表中展示的排序位置:默认值999 ,最小值1,值越大越靠后,值越小越靠前
sortSearchDefault:1000,// 搜素框中展示的排序位置,用法同sortTableDefault

57
src/api/eam/basicFaultCause/index.ts

@ -0,0 +1,57 @@
import request from '@/config/axios'
export interface BasicFaultCauseVO {
id: number
parentId: number
code: string
name: string
describing: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询故障原因列表
export const getBasicFaultCausePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/basic-fault-cause/senior', data })
} else {
return await request.get({ url: `/eam/basic-fault-cause/page`, params })
}
}
// 查询故障原因详情
export const getBasicFaultCause = async (id: number) => {
return await request.get({ url: `/eam/basic-fault-cause/get?id=` + id })
}
// 新增故障原因
export const createBasicFaultCause = async (data: BasicFaultCauseVO) => {
return await request.post({ url: `/eam/basic-fault-cause/create`, data })
}
// 修改故障原因
export const updateBasicFaultCause = async (data: BasicFaultCauseVO) => {
return await request.put({ url: `/eam/basic-fault-cause/update`, data })
}
// 删除故障原因
export const deleteBasicFaultCause = async (id: number) => {
return await request.delete({ url: `/eam/basic-fault-cause/delete?id=` + id })
}
// 导出故障原因 Excel
export const exportBasicFaultCause = async (params) => {
return await request.download({ url: `/eam/basic-fault-cause/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/basic-fault-cause/get-import-template' })
}

56
src/api/eam/basicFaultType/index.ts

@ -0,0 +1,56 @@
import request from '@/config/axios'
export interface BasicFaultTypeVO {
id: number
code: string
name: string
describing: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询故障类型列表
export const getBasicFaultTypePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/basic-fault-type/senior', data })
} else {
return await request.get({ url: `/eam/basic-fault-type/page`, params })
}
}
// 查询故障类型详情
export const getBasicFaultType = async (id: number) => {
return await request.get({ url: `/eam/basic-fault-type/get?id=` + id })
}
// 新增故障类型
export const createBasicFaultType = async (data: BasicFaultTypeVO) => {
return await request.post({ url: `/eam/basic-fault-type/create`, data })
}
// 修改故障类型
export const updateBasicFaultType = async (data: BasicFaultTypeVO) => {
return await request.put({ url: `/eam/basic-fault-type/update`, data })
}
// 删除故障类型
export const deleteBasicFaultType = async (id: number) => {
return await request.delete({ url: `/eam/basic-fault-type/delete?id=` + id })
}
// 导出故障类型 Excel
export const exportBasicFaultType = async (params) => {
return await request.download({ url: `/eam/basic-fault-type/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/basic-fault-type/get-import-template' })
}

56
src/api/eam/documentType/index.ts

@ -0,0 +1,56 @@
import request from '@/config/axios'
export interface DocumentTypeVO {
id: number
code: string
name: string
type: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询文档类型列表
export const getDocumentTypePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/document-type/senior', data })
} else {
return await request.get({ url: `/eam/document-type/page`, params })
}
}
// 查询文档类型详情
export const getDocumentType = async (id: number) => {
return await request.get({ url: `/eam/document-type/get?id=` + id })
}
// 新增文档类型
export const createDocumentType = async (data: DocumentTypeVO) => {
return await request.post({ url: `/eam/document-type/create`, data })
}
// 修改文档类型
export const updateDocumentType = async (data: DocumentTypeVO) => {
return await request.put({ url: `/eam/document-type/update`, data })
}
// 删除文档类型
export const deleteDocumentType = async (id: number) => {
return await request.delete({ url: `/eam/document-type/delete?id=` + id })
}
// 导出文档类型 Excel
export const exportDocumentType = async (params) => {
return await request.download({ url: `/eam/document-type/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/document-type/get-import-template' })
}

56
src/api/eam/equipmentMainPart/index.ts

@ -0,0 +1,56 @@
import request from '@/config/axios'
export interface EquipmentMainPartVO {
id: number
name: string
code: string
type: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询主要部件列表
export const getEquipmentMainPartPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/equipment-main-part/senior', data })
} else {
return await request.get({ url: `/eam/equipment-main-part/page`, params })
}
}
// 查询主要部件详情
export const getEquipmentMainPart = async (id: number) => {
return await request.get({ url: `/eam/equipment-main-part/get?id=` + id })
}
// 新增主要部件
export const createEquipmentMainPart = async (data: EquipmentMainPartVO) => {
return await request.post({ url: `/eam/equipment-main-part/create`, data })
}
// 修改主要部件
export const updateEquipmentMainPart = async (data: EquipmentMainPartVO) => {
return await request.put({ url: `/eam/equipment-main-part/update`, data })
}
// 删除主要部件
export const deleteEquipmentMainPart = async (id: number) => {
return await request.delete({ url: `/eam/equipment-main-part/delete?id=` + id })
}
// 导出主要部件 Excel
export const exportEquipmentMainPart = async (params) => {
return await request.download({ url: `/eam/equipment-main-part/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/equipment-main-part/get-import-template' })
}

1
src/api/infra/config/index.ts

@ -13,6 +13,7 @@ export interface ConfigVO {
visible: boolean
remark: string
createTime: Date
locoationCode: string
}
// 查询参数列表

10
src/api/mes/workScheduling/index.ts

@ -52,10 +52,14 @@ export const importTemplate = () => {
export const completeHandle = async (data) => {
return await request.post({ url: `/mes/workScheduling/completeHandle`, data })
}
//报工
//工序报工
export const reportWorkByProcess = async (data) => {
return await request.post({ url: `/mes/work-scheduling-detail/reportWorkByProcess`, data })
}
//批量报工
export const reportWorkByTask = async (data) => {
return await request.post({ url: `/mes/workScheduling/reportForAll`, data })
}
//检查当前节点是否可以完工
export const getNodePosition = async (params) => {
return await request.get({ url: `/mes/workScheduling/getNodePosition`, params })
@ -68,5 +72,9 @@ export const getCurrentWorkerList = async (params) => {
export const getProcessList = async (params) => {
return await request.get({ url: `/mes/workScheduling/getProcessList`, params })
}
//工序质检
export const processQualified = async (data) => {
return await request.post({ url: `/mes/work-scheduling-detail/processQualified`, data })
}

4
src/api/mes/workSchedulingDetail/index.ts

@ -63,3 +63,7 @@ export const exportWorkSchedulingDetail = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/mes/work-scheduling-detail/get-import-template' })
}
//工序报工
export const reportWorkByProcess = async (data) => {
return await request.post({ url: `/mes/work-scheduling-detail/reportWorkByProcess`, data })
}

11
src/api/wms/balance/index.ts

@ -150,3 +150,14 @@ export const selectLocationTypeToBalance = async (params) => {
return request.get({ url: '/wms/balance/pageLocationCodeToBalance', params})
}
}
// 获得配置筛选出的库存余额分页
export const selectConfigToBalance = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/balance/pageConfigToBalanceSenior', data })
} else {
return request.get({ url: '/wms/balance/pageConfigToBalance', params})
}
}

60
src/api/wms/containerDetailRequest/index.ts

@ -0,0 +1,60 @@
import request from '@/config/axios'
export interface ContainerDetailRequestVO {
id: number
masterId: number
number: string
containerNumber: string
fromLocationCode: string
toLocationCode: string
qty: number
uom: string
remark: string
siteId: string
concurrencyStamp: number
fromOwnerCode: string
toOwnerCode: string
}
// 查询器具管理申请子列表
export const getContainerDetailRequestPage = async (params) => {
console.log(params);
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/container-detail-request/senior', data })
} else {
return await request.get({ url: `/wms/container-detail-request/page`, params })
}
}
// 查询器具管理申请子详情
export const getContainerDetailRequest = async (id: number) => {
return await request.get({ url: `/wms/container-detail-request/get?id=` + id })
}
// 新增器具管理申请子
export const createContainerDetailRequest = async (data: ContainerDetailRequestVO) => {
return await request.post({ url: `/wms/container-detail-request/create`, data })
}
// 修改器具管理申请子
export const updateContainerDetailRequest = async (data: ContainerDetailRequestVO) => {
return await request.put({ url: `/wms/container-detail-request/update`, data })
}
// 删除器具管理申请子
export const deleteContainerDetailRequest = async (id: number) => {
return await request.delete({ url: `/wms/container-detail-request/delete?id=` + id })
}
// 导出器具管理申请子 Excel
export const exportContainerDetailRequest = async (params) => {
return await request.download({ url: `/wms/container-detail-request/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/container-detail-request/get-import-template' })
}

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

@ -0,0 +1,82 @@
import request from '@/config/axios'
export interface ContainerMainRequestVO {
id: number
type: string
available: string
remark: string
extraProperties: string
concurrencyStamp: number
siteId: string
}
// 查询器具管理申请主列表
export const getContainerMainRequestPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/container-main-request/senior', data })
} else {
return await request.get({ url: `/wms/container-main-request/page`, params })
}
}
// 查询器具管理申请主详情
export const getContainerMainRequest = async (id: number) => {
return await request.get({ url: `/wms/container-main-request/get?id=` + id })
}
// 新增器具管理申请主
export const createContainerMainRequest = async (data: ContainerMainRequestVO) => {
return await request.post({ url: `/wms/container-main-request/create`, data })
}
// 修改器具管理申请主
export const updateContainerMainRequest = async (data: ContainerMainRequestVO) => {
return await request.put({ url: `/wms/container-main-request/update`, data })
}
// 删除器具管理申请主
export const deleteContainerMainRequest = async (id: number) => {
return await request.delete({ url: `/wms/container-main-request/delete?id=` + id })
}
// 导出器具管理申请主 Excel
export const exportContainerMainRequest = async (params) => {
return await request.download({ url: `/wms/container-main-request/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/container-main-request/get-import-template' })
}
// 关闭
export const close = (id) => {
return request.put({ url: '/wms/container-main-request/close?id=' + id })
}
// 重新添加
export const reAdd = (id) => {
return request.put({ url: '/wms/container-main-request/reAdd?id=' + id })
}
// 提交审批
export const submit = (id) => {
return request.put({ url: '/wms/container-main-request/submit?id=' + id })
}
// 驳回
export const refused = (id) => {
return request.put({ url: '/wms/container-main-request/refused?id=' + id })
}
// 审批通过
export const agree = (id) => {
return request.put({ url: '/wms/container-main-request/agree?id=' + id })
}
// 处理
export const handle = (id) => {
return request.put({ url: '/wms/container-main-request/handle?id=' + id })
}

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

@ -0,0 +1,58 @@
import request from '@/config/axios'
export interface ContainerRecordDetailVO {
id: number
masterId: number
number: string
containerNumber: string
fromLocationCode: string
toLocationCode: string
qty: number
uom: string
remark: string
siteId: string
concurrencyStamp: number
fromOwnerCode: string
toOwnerCode: string
}
// 查询器具管理记录子列表
export const getContainerRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/container-record-detail/senior', data })
} else {
return await request.get({ url: `/wms/container-record-detail/page`, params })
}
}
// 查询器具管理记录子详情
export const getContainerRecordDetail = async (id: number) => {
return await request.get({ url: `/wms/container-record-detail/get?id=` + id })
}
// 新增器具管理记录子
export const createContainerRecordDetail = async (data: ContainerRecordDetailVO) => {
return await request.post({ url: `/wms/container-record-detail/create`, data })
}
// 修改器具管理记录子
export const updateContainerRecordDetail = async (data: ContainerRecordDetailVO) => {
return await request.put({ url: `/wms/container-record-detail/update`, data })
}
// 删除器具管理记录子
export const deleteContainerRecordDetail = async (id: number) => {
return await request.delete({ url: `/wms/container-record-detail/delete?id=` + id })
}
// 导出器具管理记录子 Excel
export const exportContainerRecordDetail = async (params) => {
return await request.download({ url: `/wms/container-record-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/container-record-detail/get-import-template' })
}

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

@ -0,0 +1,56 @@
import request from '@/config/axios'
export interface ContainerRecordMainVO {
id: number
type: string
number: string
requestNumber: string
status: string
available: string
remark: string
extraProperties: string
concurrencyStamp: number
siteId: string
departmentCode: string
}
// 查询器具管理记录主列表
export const getContainerRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/container-record-main/senior', data })
} else {
return await request.get({ url: `/wms/container-record-main/page`, params })
}
}
// 查询器具管理记录主详情
export const getContainerRecordMain = async (id: number) => {
return await request.get({ url: `/wms/container-record-main/get?id=` + id })
}
// 新增器具管理记录主
export const createContainerRecordMain = async (data: ContainerRecordMainVO) => {
return await request.post({ url: `/wms/container-record-main/create`, data })
}
// 修改器具管理记录主
export const updateContainerRecordMain = async (data: ContainerRecordMainVO) => {
return await request.put({ url: `/wms/container-record-main/update`, data })
}
// 删除器具管理记录主
export const deleteContainerRecordMain = async (id: number) => {
return await request.delete({ url: `/wms/container-record-main/delete?id=` + id })
}
// 导出器具管理记录主 Excel
export const exportContainerRecordMain = async (params) => {
return await request.download({ url: `/wms/container-record-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/container-record-main/get-import-template' })
}

63
src/api/wms/customerDeliveryForecast/index.ts

@ -0,0 +1,63 @@
import request from '@/config/axios'
export interface CustomerDeliveryForecastVO {
schdSite: string
schdOrder: string
schdLine: string
schdCust: string
schdShipto: string
schdDock: string
schdPart: string
schdNetReq: string
schdDate: Date
schdTime: Date
schdReference: string
schdOrdMult: string
schdCustpart: string
schdPkgCode: string
schdModelyr: string
schdCustref: string
schdPcrQty: string
available: string
}
// 查询客户发货预测列表
export const getCustomerDeliveryForecastPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/customer-delivery-forecast/senior', data })
} else {
return await request.get({ url: `/wms/customer-delivery-forecast/page`, params })
}
}
// 查询客户发货预测详情
export const getCustomerDeliveryForecast = async (id: number) => {
return await request.get({ url: `/wms/customer-delivery-forecast/get?id=` + id })
}
// 新增客户发货预测
export const createCustomerDeliveryForecast = async (data: CustomerDeliveryForecastVO) => {
return await request.post({ url: `/wms/customer-delivery-forecast/create`, data })
}
// 修改客户发货预测
export const updateCustomerDeliveryForecast = async (data: CustomerDeliveryForecastVO) => {
return await request.put({ url: `/wms/customer-delivery-forecast/update`, data })
}
// 删除客户发货预测
export const deleteCustomerDeliveryForecast = async (id: number) => {
return await request.delete({ url: `/wms/customer-delivery-forecast/delete?id=` + id })
}
// 导出客户发货预测 Excel
export const exportCustomerDeliveryForecast = async (params) => {
return await request.download({ url: `/wms/customer-delivery-forecast/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/customer-delivery-forecast/get-import-template' })
}

10
src/api/wms/itembasic/index.ts

@ -99,3 +99,13 @@ export const selectTypeToItembasic = async (params) => {
return await request.get({ url: `/wms/itembasic/pageTypeToItembasic`, params })
}
}
// 查询物料类型为器具的信息列表
export const selectConfigToItembasic = async (params) => {
if (params.isSearch) {
const data = {...params}
return request.post({ url: '/wms/itembasic/pageConfigToItembasicSenior', data })
} else {
return await request.get({ url: `/wms/itembasic/pageConfigToItembasic`, params })
}
}

6
src/api/wms/location/index.ts

@ -86,12 +86,12 @@ export const selectBusinessTypeToLocation = async (params) => {
}
export const selectConfigToLocation = async (params) => {
export const selectPageItemAreaToLocation = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/location/pageConfigToLocationSenior', data })
return await request.post({ url: '/wms/location/pageItemAreaToLocationSenior', data })
} else {
return request.get({ url: `/wms/location/pageConfigToLocation`, params })
return request.get({ url: `/wms/location/pageItemAreaToLocation`, params })
}
}

1
src/api/wms/productionreturnRequestDetail/index.ts

@ -27,6 +27,7 @@ export interface ProductionreturnRequestDetailVO {
// 查询生产退料申请子列表
export const getProductionreturnRequestDetailPage = async (params) => {
params.businessType = 'ReturnToStore'
if (params.isSearch) {
delete params.isSearch
const data = {...params}

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

@ -27,6 +27,7 @@ export interface ProductionreturnRequestDetailVO {
// 查询生产退料申请子列表
export const getProductionreturnRequestDetailPage = async (params) => {
params.businessType = 'ReturnToHold'
if (params.isSearch) {
delete params.isSearch
const data = {...params}

21
src/api/wms/purchaseprice/index.ts

@ -22,6 +22,17 @@ export const getPurchasepricePage = async (params) => {
}
}
// 查询采购价格单列表
export const getPurchasepricePageSCP = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/purchaseprice/seniorSCP', data })
} else {
return await request.get({ url: `/wms/purchaseprice/pageSCP`, params })
}
}
// 查询采购价格单详情
export const getPurchaseprice = async (id: number) => {
return await request.get({ url: `/wms/purchaseprice/get?id=` + id })
@ -52,6 +63,16 @@ export const exportPurchaseprice = async (params) => {
}
}
// 导出采购价格单 Excel
export const exportPurchasepriceSCP = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/purchaseprice/export-excel-senior-SCP`, data })
} else {
return await request.download({ url: `/wms/purchaseprice/export-excel-SCP`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/purchaseprice/get-import-template' })

10
src/api/wms/purchasereceiptRecordMain/index.ts

@ -89,6 +89,16 @@ export const exportPurchasereceiptRecordMain = async (params) => {
}
}
// 导出采购收货记录主 Excel
export const exportPurchasereceiptRecordMainSCP = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/purchasereceipt-record-main/export-excel-senior-SCP`, data })
} else {
return await request.download({ url: `/wms/purchasereceipt-record-main/export-excel-SCP`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/purchasereceipt-record-main/get-import-template' })

10
src/api/wms/purchasereturnRecordMain/index.ts

@ -75,6 +75,16 @@ export const exportPurchasereturnRecordMain = async (params) => {
}
}
// 导出采购退货记录主 Excel
export const exportPurchasereturnRecordMainSCP = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/purchasereturn-record-main/export-excel-senior-SCP`, data })
} else {
return await request.download({url: `/wms/purchasereturn-record-main/export-excel-SCP`, params})
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/purchasereturn-record-main/get-import-template' })

23
src/api/wms/supplier/index.ts

@ -31,6 +31,18 @@ export const getSupplierPage = async (params) => {
return await request.get({ url: `/wms/supplier/page`, params })
}
}
// 查询供应商列表分页
export const getSupplierPageSCP = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/supplier/seniorSCP', data })
} else {
return await request.get({ url: `/wms/supplier/pageSCP`, params })
}
}
// 查询供应商列表
export const getSupplierList = async (params) => {
return await request.get({ url: `/wms/supplier/list`, params })
@ -66,6 +78,17 @@ export const exportSupplier = async (params) => {
}
}
// 导出供应商 Excel
export const exportSupplierSCP = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/supplier/export-excel-senior-SCP`, data })
} else {
return await request.download({ url: `/wms/supplier/export-excel-SCP`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/supplier/get-import-template' })

21
src/api/wms/supplieritem/index.ts

@ -31,6 +31,17 @@ export const getSupplieritemPage = async (params) => {
}
}
// 查询供应商物料列表
export const getSupplieritemPageSCP = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/supplieritem/seniorSCP', data })
} else {
return await request.get({ url: `/wms/supplieritem/pageSCP`, params })
}
}
// 查询供应商物料详情
export const getSupplieritem = async (id: number) => {
return await request.get({ url: `/wms/supplieritem/get?id=` + id })
@ -61,6 +72,16 @@ export const exportSupplieritem = async (params) => {
}
}
// 导出供应商物料 Excel
export const exportSupplieritemSCP = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/supplieritem/export-excel-senior-SCP`, data })
} else {
return await request.download({ url: `/wms/supplieritem/export-excel-SCP`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/supplieritem/get-import-template' })

15
src/components/SearchTable/src/SearchTable.vue

@ -1,7 +1,9 @@
<template>
<Dialog :title="dialogTitle" v-model="searchDialogVisible" :width="dialogWidth" >
<!-- 搜索工作栏 -->
<!-- <Search :schema="searchSchema" @search="setSearchParamsRef" @reset="setSearchParamsRef" /> -->
<!-- <ContentWrap>
<Search :schema="searchSchema" @search="setSearchParamsRef" @reset="setSearchParamsRef" />
</ContentWrap> -->
<!-- 列表头部 -->
<TableHead
@ -61,7 +63,7 @@ const getListRef = ref()
const setSearchParamsRef = ref()
const tableObjectRef = ref()
const getPage:any = ref()
// const searchSchema = ref()
const searchSchema = ref()
const tableColumns = ref()
const formFieldRef = ref()
const searchFieldRef = ref()
@ -81,7 +83,7 @@ const openData = (titleName: any, tableObject:any ,allSchemas: any,multiple: any
searchDialogVisible.value = true
multipleBol.value = multiple
allSchemasRef.value = allSchemas
// searchSchema.value = allSchemas.searchSchema
searchSchema.value = allSchemas.searchSchema
tableColumns.value = allSchemas.tableColumns
}
const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, searchField: any,multiple: any, type: any, row: any, searchCondition:any , isCountRequestRe:any,isConcatDetailSchemas=false,detailSchemas: any) => {
@ -94,7 +96,7 @@ const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, s
formFieldRef.value = formField
searchFieldRef.value = searchField
allSchemasRef.value = allSchemas
// searchSchema.value = allSchemas.searchSchema
searchSchema.value = allSchemas.searchSchema
if(isConcatDetailSchemas){
//
console.log('detailSchemas',detailSchemas)
@ -117,9 +119,8 @@ const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, s
if (searchCondition) tableObjectRef.value.params = searchCondition;
//
const { getList } = tableMethods
// setSearchParamsRef.value = setSearchParams
setSearchParamsRef.value = tableObject.params
const { getList , setSearchParams } = tableMethods
setSearchParamsRef.value = setSearchParams
getListRef.value = getList
getList()
}

1
src/locales/en-US.ts

@ -1035,6 +1035,7 @@ export default {
'发票寄出成功!':'Invoice sent successfully!',
:'Supplier invoice request master data',
:'Please provide detailed data',
SCP订单无法打印:'Non SCP orders cannot be printed',
'明细数据条数已超过最大数量限制【999条】':'The number of detailed data items has exceeded the maximum limit [999 items]',
:'Supplier delivery request is led into the template',
:'Supplier invoice request details',

3
src/locales/zh-CN.ts

@ -1018,7 +1018,7 @@ export default {
:'到货检验申请生成成功',
:'采购收货记录主',
退:'采购退货记录主',
:'合同附件t',
:'合同附件',
:'发票附件',
:'货运单附件',
:'其他附件',
@ -1035,6 +1035,7 @@ export default {
'发票寄出成功!':'发票寄出成功!',
:'供应商发票申请主',
:'请添明细数据',
SCP订单无法打印:'非SCP订单无法打印',
'明细数据条数已超过最大数量限制【999条】':'明细数据条数已超过最大数量限制【999条】',
:'供应商发货申请主导入模版',
:'供应商发票申请明细',

1
src/plugins/vueI18n/index.ts

@ -31,6 +31,7 @@ const createI18nOptions = async (): Promise<I18nOptions> => {
sync: true,
silentTranslationWarn: true,
missingWarn: false,
fallbackWarn:false,
silentFallbackWarn: true
}
}

2
src/utils/dict.ts

@ -281,6 +281,7 @@ export enum DICT_TYPE {
PLAN_PRODUCTION_TYPE = "plan_production_type", // 生产计划类型
DELIVER_TYPE="deliver_type",//发货类型
BILL_TYPE="bill_type", // 发票类型
CONTAIN_MANAGE_TYPE="contain_menage_type",//器具管理类型
// ========== 业务 - mes ==========
MESDO_STATUS= 'mes_do_status', // 工单执行状态
@ -335,4 +336,5 @@ export enum DICT_TYPE {
TAX_RATE_DICT='tax_rate_dict', //税率
INTERFACE_STATUS = 'interfaceStatus', // 接口调用信息 接口状态
SYSTEM_DAY = 'system_day', // 系统天数
PURCHASE_INVOICE_ORDER_TYPE = 'purchase_invoice_order_type', // 发票采购订单类型
}

3
src/utils/disposition/defaultButtons.ts

@ -193,8 +193,7 @@ export function formStagingBtn(option:any) {
label: t(`btn.暂存`).replace('btn.', ''),
name: 'staging',
hide: false,
color: '',
color: 'green',
float:'right',
hasPermi: ''
})

160
src/views/eam/basicFaultCause/basicFaultCause.data.ts

@ -0,0 +1,160 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const BasicFaultCauseRules = reactive({
code: [required],
name: [required],
})
export const BasicFaultCause = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '父id(没有则为0)',
field: 'parentId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '设备编码',
field: 'code',
sort: 'custom',
isSearch: true,
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '描述',
field: 'describing',
sort: 'custom',
isSearch: true,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '部门id',
field: 'departmentCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
form: {
component: 'Switch',
value: 'TURE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TURE'
}
},
},
{
label: '删除时间',
field: 'deletionTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '删除人id',
field: 'deleterId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/basicFaultCause/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="BasicFaultCause.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="BasicFaultCause.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="BasicFaultCauseRules"
:formAllSchemas="BasicFaultCause.allSchemas"
:apiUpdate="BasicFaultCauseApi.updateBasicFaultCause"
:apiCreate="BasicFaultCauseApi.createBasicFaultCause"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="BasicFaultCause.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/basic-fault-cause/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { BasicFaultCause,BasicFaultCauseRules } from './basicFaultCause.data'
import * as BasicFaultCauseApi from '@/api/eam/basicFaultCause'
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: 'BasicFaultCause' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(BasicFaultCause.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: BasicFaultCauseApi.getBasicFaultCausePage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:basicFaultCause:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:basicFaultCause:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:basicFaultCause: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:'eam:basicFaultCause:update'}), //
//defaultButtons.mainListDeleteBtn({hasPermi:'eam:basicFaultCause: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 =BasicFaultCause.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 BasicFaultCauseApi.createBasicFaultCause(data)
message.success(t('common.createSuccess'))
} else {
await BasicFaultCauseApi.updateBasicFaultCause(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, 'basicBasicFaultCause')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await BasicFaultCauseApi.deleteBasicFaultCause(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 BasicFaultCauseApi.exportBasicFaultCause(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 BasicFaultCauseApi.importTemplate()
})
</script>

147
src/views/eam/basicFaultType/basicFaultType.data.ts

@ -0,0 +1,147 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const BasicFaultTypeRules = reactive({
code: [required],
name: [required],
})
export const BasicFaultType = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '设备编码',
field: 'code',
sort: 'custom',
isSearch: true,
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '描述',
field: 'describing',
sort: 'custom',
isSearch: true,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '部门id',
field: 'departmentCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
form: {
component: 'Switch',
value: 'TURE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TURE'
}
},
},
{
label: '删除时间',
field: 'deletionTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '删除人id',
field: 'deleterId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/basicFaultType/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="BasicFaultType.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="BasicFaultType.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="BasicFaultTypeRules"
:formAllSchemas="BasicFaultType.allSchemas"
:apiUpdate="BasicFaultTypeApi.updateBasicFaultType"
:apiCreate="BasicFaultTypeApi.createBasicFaultType"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="BasicFaultType.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/basic-fault-type/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { BasicFaultType,BasicFaultTypeRules } from './basicFaultType.data'
import * as BasicFaultTypeApi from '@/api/eam/basicFaultType'
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: 'BasicFaultType' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(BasicFaultType.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: BasicFaultTypeApi.getBasicFaultTypePage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:basicFaultType:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:basicFaultType:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:basicFaultType: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:'eam:basicFaultType:update'}), //
//defaultButtons.mainListDeleteBtn({hasPermi:'eam:basicFaultType: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 =BasicFaultType.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 BasicFaultTypeApi.createBasicFaultType(data)
message.success(t('common.createSuccess'))
} else {
await BasicFaultTypeApi.updateBasicFaultType(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, 'basicBasicFaultType')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await BasicFaultTypeApi.deleteBasicFaultType(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 BasicFaultTypeApi.exportBasicFaultType(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 BasicFaultTypeApi.importTemplate()
})
</script>

149
src/views/eam/documentType/documentType.data.ts

@ -0,0 +1,149 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const DocumentTypeRules = reactive({
code: [required],
name: [required],
type: [required],
concurrencyStamp: [required],
})
export const DocumentType = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '设备编码',
field: 'code',
sort: 'custom',
isSearch: true,
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '类型设备',
field: 'type',
sort: 'custom',
isSearch: true,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '部门id',
field: 'departmentCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
form: {
component: 'Switch',
value: 'TURE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TURE'
}
},
},
{
label: '删除时间',
field: 'deletionTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '删除人id',
field: 'deleterId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/documentType/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="DocumentType.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="DocumentType.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="DocumentTypeRules"
:formAllSchemas="DocumentType.allSchemas"
:apiUpdate="DocumentTypeApi.updateDocumentType"
:apiCreate="DocumentTypeApi.createDocumentType"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DocumentType.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/document-type/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { DocumentType,DocumentTypeRules } from './documentType.data'
import * as DocumentTypeApi from '@/api/eam/documentType'
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: 'DocumentType' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(DocumentType.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: DocumentTypeApi.getDocumentTypePage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:documentType:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:documentType:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:documentType: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:'eam:documentType:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:documentType: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 =DocumentType.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 DocumentTypeApi.createDocumentType(data)
message.success(t('common.createSuccess'))
} else {
await DocumentTypeApi.updateDocumentType(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, 'basicDocumentType')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DocumentTypeApi.deleteDocumentType(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 DocumentTypeApi.exportDocumentType(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 DocumentTypeApi.importTemplate()
})
</script>

149
src/views/eam/equipmentMainPart/equipmentMainPart.data.ts

@ -0,0 +1,149 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const EquipmentMainPartRules = reactive({
name: [required],
code: [required],
type: [required],
})
export const EquipmentMainPart = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '编码',
field: 'code',
sort: 'custom',
isSearch: true,
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '设备工装枚举',
field: 'type',
sort: 'custom',
isSearch: true,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '部门id',
field: 'departmentCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: true,
form: {
component: 'Switch',
value: 'TURE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TURE'
}
},
},
{
label: '删除时间',
field: 'deletionTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '删除人id',
field: 'deleterId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/equipmentMainPart/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EquipmentMainPart.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EquipmentMainPart.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="EquipmentMainPartRules"
:formAllSchemas="EquipmentMainPart.allSchemas"
:apiUpdate="EquipmentMainPartApi.updateEquipmentMainPart"
:apiCreate="EquipmentMainPartApi.createEquipmentMainPart"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentMainPart.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-main-part/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentMainPart,EquipmentMainPartRules } from './equipmentMainPart.data'
import * as EquipmentMainPartApi from '@/api/eam/equipmentMainPart'
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: 'EquipmentMainPart' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(EquipmentMainPart.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: EquipmentMainPartApi.getEquipmentMainPartPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:equipmentMainPart:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:equipmentMainPart:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:equipmentMainPart: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:'eam:equipmentMainPart:update'}), //
//defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipmentMainPart: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 =EquipmentMainPart.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 EquipmentMainPartApi.createEquipmentMainPart(data)
message.success(t('common.createSuccess'))
} else {
await EquipmentMainPartApi.updateEquipmentMainPart(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, 'basicEquipmentMainPart')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EquipmentMainPartApi.deleteEquipmentMainPart(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 EquipmentMainPartApi.exportEquipmentMainPart(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 EquipmentMainPartApi.importTemplate()
})
</script>

3
src/views/mes/orderDay/components/schedule.vue

@ -482,8 +482,9 @@ const publishPlan=()=>{
try{formLoading.value=true
doPublishPlan() }finally{
formLoading.value=false;
}
handleClose()
}
}).catch(() => {
message.info("已取消发布")
})

2
src/views/mes/orderDay/index.vue

@ -201,9 +201,7 @@ const buttonBaseClick = (val, item) => {
}
const publishClosed=()=>{
//console.log('orderday-publishClosed-200')
nextTick(() => {
getList()
})
}
//

119
src/views/mes/workScheduling/components/Detail.vue

@ -72,7 +72,7 @@
</template> -->
</Table>
<Table
v-if="!isBasic && fromeWhere != 'countPlan'"
v-if="!isBasic"
:columns="detailAllSchemasRef.tableColumns"
:data="tableObjectRef.tableList"
:loading="tableObjectRef.loading"
@ -80,23 +80,14 @@
v-model:pageSize="tableObjectRef.pageSize"
v-model:currentPage="tableObjectRef.currentPage"
>
<template #photos="{ row }">
<div
v-for="(item, index) in row.photos.split(',')"
:key="index"
style="color: #409eff; cursor: pointer"
@click="openImage(item)"
>{{ item }}</div
>
</template>
<template #action="{ row }">
<ButtonBase v-if="row.status == '0'"
:Butttondata="buttondata"
@button-base-click="buttonTableClick($event, row)"
/>
<el-button type="text" v-if="row.status == '0'" @click="buttonClick('pfinished',row)"> 完工</el-button>
<el-button type="text" v-if="row.status == '2'" @click="buttonClick('reprotProcess',row)"> 报工</el-button>
<el-button type="text" v-if="row.status == '4'" @click="buttonClick('checkProcess',row)"> 质检</el-button>
</template>
</Table>
<DetailTable
<!-- <DetailTable
v-if="!isBasic && isShowDrawer"
:columns="detailAllSchemasRef.tableColumns"
:data="tableObjectRef.tableList"
@ -105,13 +96,14 @@
:key="updateKey"
>
<template #action="{ row }">
<ButtonBase v-if="row.status == '0'"
:Butttondata="buttondata"
<ButtonBase
:Butttondata="buttonDetail"
@button-base-click="buttonTableClick($event, row)"
/>
dddddddddd
</template>
</DetailTable>
</DetailTable> -->
</ContentWrap>
<!-- other附件组件:如质检明细 -->
<div
@ -189,6 +181,8 @@
</el-drawer>
<!-- 表格弹窗 -->
<SearchTable ref="searchTableRef" @search-table-success="searchTableSuccess1" />
<reportProcess ref="refreport" ></reportProcess>\
<QualifiedCheck ref="qualifiedCheck" @close="handleClose"></QualifiedCheck>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@ -223,9 +217,10 @@ import * as FileApi from '@/api/wms/file'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import DetailTable from '@/components/DetailTable/src/DetailTable.vue'
import QualifiedCheck from '@/views/mes/workScheduling/components/qualifiedCheck.vue'
import { SearchTable } from '@/components/SearchTable'
import * as WorkSchedulingDetailApi from '@/api/mes/workSchedulingDetail'
import reportProcess from '@/views/mes/workScheduling/components/report.vue'
defineOptions({ name: 'Detail' })
const message = useMessage() //
@ -236,7 +231,7 @@ const routeName = ref()
routeName.value = route.name
routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'Detail'
const updateKey = ref(0)
const qualifiedCheck=ref()
const props = defineProps({
//
tabs: {
@ -400,7 +395,7 @@ const props = defineProps({
const isShowDrawer = ref(false)
const detailLoading = ref(false)
const tabsList = ref(JSON.parse(JSON.stringify(props.tabs ? props.tabs : '')))
const refreport=ref()
if (props.isBasic == true) {
if (tabsList.value && tabsList.value.length > 0) {
tabsList.value.unshift({
@ -554,7 +549,9 @@ const masterParmas = ref({
//
const HeadButttondata = ref()
// -
const buttondata = ref()
const buttondata = ref(
)
/** 表格弹窗 */
const initModel = (schema: FormSchema[], formModel: Recordable) => {
const model: Recordable = { ...formModel }
@ -585,10 +582,13 @@ const searchTableFormType = ref('') // 表单的类型:create - 新增;updat
const formRef = ref()
const titleNameRef = ref()
const titleValueRef = ref()
const planDayCode=ref()
const count = ref(0)
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => {
titleNameRef.value = titleName
titleValueRef.value = titleValue
planDayCode.value=row.planMasterCode
remarksData.data = {
tableId: row.id,
tableName: tableName
@ -658,12 +658,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
})
]
}
if(row.status == '1'){
props.buttondataTable[0].hide = false
}else{
props.buttondataTable[0].hide = true
}
//console.log("props.buttondataTable-663",props.buttondataTable);
buttondata.value = [...detailButtonEdit, ...detailButtonDelete, ...props.buttondataTable]
} finally {
detailLoading.value = false
@ -671,7 +666,6 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
}
}
defineExpose({ openDetail, formRef }) // open
//
const getRemarkList = async () => {
detailLoading.value = true
@ -807,39 +801,46 @@ const opensearchTable = (
// }
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
if (props.isOpenSearchTable) {
searchTableFormType.value = 'update'
if (row?.id || row?.masterId) {
searchTableFormModel.value = Object.assign(unref(searchTableFormModel), row)
}
const item = props.detailAllSchemas.formSchema[0]
opensearchTable(
item.field,
item?.componentProps?.searchField,
item?.componentProps?.searchTitle,
item?.componentProps?.searchAllSchemas,
item?.componentProps?.searchPage,
item?.componentProps?.searchCondition,
item?.componentProps?.multiple,
undefined,
undefined
)
} else {
openForm('update', row)
}
} else if (val == 'delete') {
//
handleDelete(row.id)
} else if (val == 'pfinished') {
// const buttonTableClick = async (val, row) => {
// if (val == 'edit') {
// //
// if (props.isOpenSearchTable) {
// searchTableFormType.value = 'update'
// if (row?.id || row?.masterId) {
// searchTableFormModel.value = Object.assign(unref(searchTableFormModel), row)
// }
// const item = props.detailAllSchemas.formSchema[0]
// opensearchTable(
// item.field,
// item?.componentProps?.searchField,
// item?.componentProps?.searchTitle,
// item?.componentProps?.searchAllSchemas,
// item?.componentProps?.searchPage,
// item?.componentProps?.searchCondition,
// item?.componentProps?.multiple,
// undefined,
// undefined
// )
// } else {
// openForm('update', row)
// }
// } else if (val == 'delete') {
// //
// handleDelete(row.id)
// } else {
// emit('tableFormButton', val, row)
// }
// }
const buttonClick=(type,row)=>{
if (type == 'pfinished') {
WorkSchedulingDetailApi.processFinished(row.id)
getList()
}else {
emit('tableFormButton', val, row)
}else if (type == 'reprotProcess') {
refreport.value.openDetail(row,"工序报工", planDayCode.value)
}else if (type == 'checkProcess') {
qualifiedCheck.value.openDetail(row,"质检",planDayCode.value)
}
getList()
}
/** 添加/修改操作 */
const openForm = async (type: string, row?: number) => {

127
src/views/mes/workScheduling/components/qualifiedCheck.vue

@ -0,0 +1,127 @@
<template>
<Dialog
:title="dialogTitle"
v-model="dialogVisible"
:close-on-click-modal="true"
:vLoading="formLoading"
width="600px"
>
<template #title>{{ dialogTitle }} </template>
<el-form :model="form">
<el-form-item label="工序">
<el-input v-model="form.processCode" disabled />
</el-form-item>
<el-form-item label="生产人员">
<el-select v-model="form.personSelected" multiple>
<el-option v-for="item in personOption" :key="item.workerCode" :label="item.workerName" :value="item.workerCode" />
</el-select>
</el-form-item>
<el-form-item label="质检人员">
<el-input v-model="form.checkPerson" />
</el-form-item>
<el-form-item label="合格数量" @change="handleCount" :key="qcount">
<el-input-number
v-model="form.qualified"
@change="handleCount"
></el-input-number>
</el-form-item>
<el-form-item label="不合格数量">
<el-input-number v-model="form.unqualified" @change="handleCount" :key="qcount"></el-input-number>
</el-form-item>
<el-form-item label="不合格原因">
<el-input v-model="form.remark"></el-input>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="dialogVisible = false">关闭</el-button>
<el-button type="primary" :disabled="saveFlag" @click="saveReport">保存</el-button>
</template> </Dialog
>
</template>
<script lang="ts" setup>
import { Dialog } from '@/components/Dialog'
import * as workschedulingApi from '@/api/mes/workScheduling'
const message = useMessage() //
const { t } = useI18n() //
const rowData = ref()
const dialogVisible = ref(false)
const dialogTitle = ref()
const formLoading = ref(false)
const personOption=ref([])
const saveFlag=ref(false)
const planDayCode=ref()
const form = reactive({
id:0,
planDayCode: "",
processCode:"",
personSelected:[],
qualified:0,
unqualified:0,
remark:"",
checkPerson:""
})
const openDetail = async (row: any, titleName: any,code:string) => {
rowData.value = row
//console.log('row-68',row)
dialogVisible.value = true
dialogTitle.value = titleName
form.processCode=row.nodeCode
form.personSelected=[]
form.planDayCode=code
form.personSelected=[]
form.qualified=0
form.unqualified=0
form.id=row.id
planDayCode.value=code
getCurrentWorkerList(row.nodeCode)
}
//
const getCurrentWorkerList = async (val) => {
let params = {
planDayCode: planDayCode.value,
processCode: val
}
personOption.value = await workschedulingApi.getCurrentWorkerList(params)
}
const qcount=ref(0)
//
const handleCount = () => {
qcount.value++
if (form.qualified> rowData.value.planCount - form.unqualified) {
message.alert('合格数量超限!计划总数【'+rowData.value.planCount+'】')
form.qualified =rowData.value.planCount - form.unqualified
return
}
if (form.unqualified> rowData.value.planCount -form.qualified ) {
message.alert('不合格数量超限!')
form.unqualified =rowData.value.planCount-form.qualified
return
}
}
//
const saveReport = async() => {
saveFlag.value = true
try {
await workschedulingApi.processQualified(form)
}finally{
saveFlag.value = false
dialogVisible.value = false
emit('close')
}
//console.log("report-saveReport-82",data)
//await workschedulingApi.reportWorkByProcess(data)
}
//
const emit = defineEmits(['success', 'close'])
defineOptions({ name: 'qualifiedCheck' })
defineExpose({ openDetail }) // open
</script>

219
src/views/mes/workScheduling/components/report.vue

@ -4,89 +4,38 @@
v-model="dialogVisible"
:close-on-click-modal="true"
:vLoading="formLoading"
width="fit-content"
width="600px"
>
<template #title>{{ dialogTitle }} </template>
<el-button type="primary" @click="addRow" style="float:right;;">添加</el-button>
<el-table :data="tableData" style="border: 1px;stripe; width:1300px ;" >
<el-table-column prop="processName" label="工序名称" width="200px">
<template #default="scope">
<el-select v-model="scope.row.processCodeSelected" @change="processChange" value-key="processCode">
<el-option v-for="item in processOption" :key="item.processCode" :label="item.processName" :value="item.processCode" />
</el-select>
</template>
</el-table-column>
<el-table-column prop="reportName" label="报工人" width="200px">
<template #default="scope">
<el-select v-model="scope.row.personSelected" multiple :value-key="workerCode">
<el-option v-for="item in personOption" :key="item.workerCode" :label="item.workerName" :value="item.workerCode" />
</el-select>
</template>
</el-table-column>
<el-table-column prop="reportCount" label="报工数量" width="200px" >
<template #default="scope">
<el-input-number v-model="scope.row.reportCount" @change="handleCount(scope.row)" :key="count"></el-input-number>
</template>
</el-table-column>
<el-table-column prop="workTerm" label="工时" width="200px" >
<template #default="scope">
<el-input-number v-model="scope.row.workTerm"></el-input-number>
</template>
</el-table-column>
<el-table-column prop="checkFlag" label="已质检" width="80px" >
<template #default="scope">
<el-switch inactive-value="false" v-model="scope.row.checkFlag" ></el-switch>
</template>
</el-table-column>
<el-table-column prop="qualified" label="合格数" width="200px" >
<template #default="scope" >
<el-input-number v-model="scope.row.qualified" @change="handleCount(scope.row)" :key="qcount" :disabled="scope.row.checkFlag=='false'" ></el-input-number>
</template>
</el-table-column>
<el-table-column prop="unqualified" label="不合格数" width="100px">
<template #default="scope">
<el-input v-model="scope.row.unqualified" disabled="true">{{scope.row.unqualified= scope.row.reportCount -scope.row.qualified}}</el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="100px">
<template #default="scope">
<el-button type="text" @click="deleteRow(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- <el-form>
<el-form-item label="选择工序">
<el-select v-model="processCodeSelected" @change="processChange" value-key="processCode">
<el-option v-for="item in processOption" :key="item.processCode" :label="item.processName" :value="item.processCode" />
</el-select>
<el-form :model="form">
<el-form-item label="工序">
<el-input v-model="form.processCode" disabled />
</el-form-item>
<el-form-item label="选择人员">
<el-select v-model="personSelected">
<el-form-item label="选择人员" required="true">
<el-select v-model="form.personSelected" multiple >
<el-option v-for="item in personOption" :key="item.workerCode" :label="item.workerName" :value="item.workerCode" />
</el-select>
</el-form-item>
<el-form-item label="报工数量">
<el-input-number v-model="reportCount" @change="handleCount"></el-input-number>
<el-form-item label="报工数量" required="true">
<el-input-number v-model="form.reportCount" @change="handleCount" ></el-input-number>
</el-form-item>
<el-form-item label="工时">
<el-input-number v-model="workTerm"></el-input-number>
<el-form-item label="工时" required="true">
<el-input-number v-model="form.workTerm"></el-input-number>
</el-form-item>
<el-form-item label="是否已质检">
<el-switch v-model="checkFlag" active-value="true"> </el-switch>
<el-switch v-model="form.checkFlag" active-value="true"> </el-switch>
</el-form-item>
<el-form-item label="合格数量">
<el-form-item label="合格数量" @change="handleCount" >
<el-input-number
v-model="qualified"
:disabled="!checkFlag"
v-model="form.qualified"
:disabled="!form.checkFlag"
@change="handleCount"
></el-input-number>
</el-form-item>
<el-form-item label="不合格数量">
<el-input-number disabled v-model="unqualified"></el-input-number>
<el-input-number disabled v-model="form.unqualified"></el-input-number>
</el-form-item>
</el-form> -->
</el-form>
<template #footer>
<el-button @click="dialogVisible = false">关闭</el-button>
@ -101,105 +50,109 @@ import dayjs from 'dayjs'
const message = useMessage() //
const { t } = useI18n() //
const rowData = ref()
const openDetail = async (row: any, titleName: any) => {
rowData.value = row
dialogVisible.value = true
dialogTitle.value = titleName
getProcessList(row)
}
const dialogVisible = ref(false)
const dialogTitle = ref()
const formLoading = ref(false)
const processOption = ref([])
const personOption=ref([])
const processCodeSelected = ref()
const personSelected = ref()
const checkFlag = ref(false)
const unqualified = ref()
const reportCount = ref()
const qualified = ref()
const workTerm = ref()
const saveFlag=ref(false)
const tableData=ref([{}])
const addRow=()=>{
tableData.value.push({
processCode:processCodeSelected.value,
processName:processOption.value?.find(item=>item.processCode==processCodeSelected.value)?.processName,
reportName:personOption.value?.find(item=>item.workerCode==personSelected.value)?.workerName,
reportCount:reportCount.value,
workTerm:workTerm.value,
checkFlag:checkFlag.value})
const planDayCode=ref()
const form = reactive({
processCode:"",
reportCount:0,
workTerm:0,
checkFlag:"FALSE",
personSelected:[],
qualified:0,
unqualified:0
})
const openDetail = async (row: any, titleName: any,code:string) => {
rowData.value = row
//console.log('row-68',row)
dialogVisible.value = true
dialogTitle.value = titleName
form.processCode=row.nodeCode
form.personSelected=[]
form.reportCount=0,
form.workTerm=0,
form.checkFlag="FALSE",
form.personSelected=[],
form.qualified=0,
form.unqualified=0
planDayCode.value=code
getCurrentWorkerList(row.nodeCode)
}
const deleteRow = (index: number) => {
tableData.value.splice(index, 1)
}
//
const getProcessList=async(row)=>{
let params={
planDayCode:row.planMasterCode,
schedulingCode:row.schedulingCode
}
processOption.value=await workschedulingApi.getProcessList(params)
}
const processChange=(val:any)=>{
//console.log("processChange-81",val)
getCurrentWorkerList(val)
}
//
const getCurrentWorkerList = async (val) => {
//console.log("personOption-91",val)
let params = {
planDayCode: rowData.value.planMasterCode,
planDayCode: planDayCode.value,
processCode: val
}
personOption.value = await workschedulingApi.getCurrentWorkerList(params)
}
const count = ref(0)
const qcount = ref(1)
//
const handleCount = (row) => {
if (row.reportCount > rowData.value.planCount) {
const handleCount = () => {
if (form.reportCount> rowData.value.planCount) {
message.alert('报工数量不能超出计划数量!计划数【'+rowData.value.planCount+'】')
row.reportCount =rowData.value.planCount
form.reportCount =rowData.value.planCount
//tableData.value[index].reportCount =rowData.value.planCount
count.value++
//count.value++
return
}
//message.alert(row.checkFlag==true?'1':'2')
if (row.checkFlag) {
if (row.reportCount < row.qualified) {
if (form.checkFlag) {
if (form.reportCount < form.qualified) {
message.alert('合格数不能超出报工数!')
row.qualified=row.reportCount
qcount.value++
form.qualified=form.reportCount
//qcount.value++
return
}
if (row.qualified == undefined || row.qualified == 0) {
row.qualified = row.reportCount
qcount.value++
if (form.qualified == undefined || form.qualified == 0) {
form.qualified= form.reportCount
//qcount.value++
}
row.unqualified= row.reportCount- row.qualified
form.unqualified= form.reportCount- form.qualified
}
}
//
const saveReport = async() => {
if(form.reportCount<1){
message.alert('报工数量不能小于1!')
return
}
if(form.personSelected.length<1){
message.alert('必须选择一个报工人')
return
}
if(form.workTerm<0){
message.alert('工时数量不能小于0!')
return
}
let listSub=[];
form.personSelected.forEach((item) => {
let data={
reportCount: form.reportCount,
workTerm: form.workTerm,
checkFlag: form.checkFlag,
reportPerson: item,
qualified: form.qualified,
unqualified: form.unqualified
}
listSub.push(data)
})
let data = {
reportDate: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'),
schedulingCode: rowData.value.schedulingCode,
processCode: processCodeSelected.value,
list: [
{
reportCount: reportCount.value,
workTerm: workTerm.value,
reportPerson: personSelected.value,
qualified: qualified.value,
unqualified: unqualified.value
}
]
processCode: form.processCode,
list: listSub
}
//console.log("report-saveReport-137",data)
saveFlag.value = true
try {
await workschedulingApi.reportWorkByProcess(data)
@ -214,6 +167,6 @@ const saveReport = async() => {
}
//
const emit = defineEmits(['success', 'close'])
defineOptions({ name: 'reportProcess' })
defineExpose({ openDetail }) // open
</script>

185
src/views/mes/workScheduling/components/reportAll.vue

@ -0,0 +1,185 @@
<template>
<Dialog
:title="dialogTitle"
v-model="dialogVisible"
:close-on-click-modal="true"
:vLoading="formLoading"
width="fit-content"
>
<template #title>{{ dialogTitle }} </template>
<el-button type="primary" @click="addRow" style="float:right;;">添加</el-button>
<el-table :data="tableData" style="border: 1px;stripe; width:1300px ;" >
<el-table-column prop="processName" label="工序名称" width="200px">
<template #default="scope">
<el-select v-model="scope.row.processCodeSelected" @change="processChange" value-key="processCode">
<el-option v-for="item in processOption" :key="item.processCode" :label="item.processName" :value="item.processCode" />
</el-select>
</template>
</el-table-column>
<el-table-column prop="reportName" label="报工人" width="200px">
<template #default="scope">
<el-select v-model="scope.row.personSelected" multiple :value-key="workerCode">
<el-option v-for="item in personOption" :key="item.workerCode" :label="item.workerName" :value="item.workerCode" />
</el-select>
</template>
</el-table-column>
<el-table-column prop="reportCount" label="报工数量" width="200px" >
<template #default="scope">
<el-input-number v-model="scope.row.reportCount" @change="handleCount(scope.row)" :key="count"></el-input-number>
</template>
</el-table-column>
<el-table-column prop="workTerm" label="工时" width="200px" >
<template #default="scope">
<el-input-number v-model="scope.row.workTerm"></el-input-number>
</template>
</el-table-column>
<el-table-column prop="checkFlag" label="已质检" width="80px" >
<template #default="scope">
<el-switch inactive-value="false" v-model="scope.row.checkFlag" ></el-switch>
</template>
</el-table-column>
<el-table-column prop="qualified" label="合格数" width="200px" >
<template #default="scope" >
<el-input-number v-model="scope.row.qualified" @change="handleCount(scope.row)" :key="qcount" :disabled="scope.row.checkFlag=='false'" ></el-input-number>
</template>
</el-table-column>
<el-table-column prop="unqualified" label="不合格数" width="100px">
<template #default="scope">
<el-input v-model="scope.row.unqualified" disabled="true">{{scope.row.unqualified= scope.row.reportCount -scope.row.qualified}}</el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="100px">
<template #default="scope">
<el-button type="text" @click="deleteRow(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<template #footer>
<el-button @click="dialogVisible = false">关闭</el-button>
<el-button type="primary" :disabled="saveFlag" @click="saveReport">保存</el-button>
</template> </Dialog
>
</template>
<script lang="ts" setup>
import { Dialog } from '@/components/Dialog'
import * as workschedulingApi from '@/api/mes/workScheduling'
import dayjs from 'dayjs'
const message = useMessage() //
const { t } = useI18n() //
const rowData = ref()
const openDetail = async (row: any, titleName: any) => {
rowData.value = row
dialogVisible.value = true
dialogTitle.value = titleName
getProcessList(row)
}
const dialogVisible = ref(false)
const dialogTitle = ref()
const formLoading = ref(false)
const processOption = ref([])
const personOption=ref([])
const processCodeSelected = ref()
const personSelected = ref()
const checkFlag = ref(false)
const reportCount = ref()
const workTerm = ref()
const saveFlag=ref(false)
const tableData=ref([{}])
const addRow=()=>{
if(tableData.value.length<processOption.value.length){
tableData.value.push({
processCode:processCodeSelected.value,
processName:processOption.value?.find(item=>item.processCode==processCodeSelected.value)?.processName,
reportName:personOption.value?.find(item=>item.workerCode==personSelected.value)?.workerName,
reportCount:reportCount.value,
workTerm:workTerm.value,
checkFlag:checkFlag.value})
}else{
message.alert('超出可报工的工序数量,不能再添加!')
}
}
const deleteRow = (index: number) => {
tableData.value.splice(index, 1)
}
//
const getProcessList=async(row)=>{
let params={
planDayCode:row.planMasterCode,
schedulingCode:row.schedulingCode
}
processOption.value=await workschedulingApi.getProcessList(params)
}
const processChange=(val:any)=>{
//console.log("processChange-81",val)
getCurrentWorkerList(val)
}
//
const getCurrentWorkerList = async (val) => {
//console.log("personOption-91",val)
let params = {
planDayCode: rowData.value.planMasterCode,
processCode: val
}
personOption.value = await workschedulingApi.getCurrentWorkerList(params)
}
const count = ref(0)
const qcount = ref(1)
//
const handleCount = (row) => {
if (row.reportCount > rowData.value.planCount) {
message.alert('报工数量不能超出计划数量!计划数【'+rowData.value.planCount+'】')
row.reportCount =rowData.value.planCount
//tableData.value[index].reportCount =rowData.value.planCount
count.value++
return
}
//message.alert(row.checkFlag==true?'1':'2')
if (row.checkFlag) {
if (row.reportCount < row.qualified) {
message.alert('合格数不能超出报工数!')
row.qualified=row.reportCount
qcount.value++
return
}
if (row.qualified == undefined || row.qualified == 0) {
row.qualified = row.reportCount
qcount.value++
}
row.unqualified= row.reportCount- row.qualified
}
}
//
const saveReport = async() => {
saveFlag.value = true
try {
let data = {
planMasterCode: rowData.value.planMasterCode,
schedulingCode: rowData.value.schedulingCode,
schedulingDetailList: tableData.value
}
//console.log("report-saveReport-170",data)
workschedulingApi.reportWorkByTask(data)
}finally{
saveFlag.value = false
dialogVisible.value = false
emit('close')
}
//console.log("report-saveReport-82",data)
//await workschedulingApi.reportWorkByProcess(data)
}
//
const emit = defineEmits(['success', 'close'])
defineExpose({ openDetail }) // open
</script>

31
src/views/mes/workScheduling/index.vue

@ -68,8 +68,10 @@
@searchTableSuccessDetail="searchTableSuccessDetail"
:key="count"
/>
<Report ref="reportRef" @close="handleClose"></Report>
<ReportAll ref="reportRef" @close="handleClose"></ReportAll>
<Finish ref="reportFinishRef" @close="handleClose"></Finish>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/work-scheduling/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
@ -83,10 +85,11 @@ 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.vue'
import Report from './components/report.vue'
import ReportAll from './components/reportAll.vue'
import Finish from './components/finish.vue'
defineOptions({ name: 'MesWorkScheduling' })
const message = useMessage() //
@ -96,17 +99,7 @@ const route = useRoute() // 路由信息
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(WorkScheduling.allSchemas.tableColumns)
// table
const buttondataTable = ref([{
label: '完工',
name: 'pfinished',
hide: false,
type: 'primary',
icon: '',
color: '',
hasPermi: '',
link: true, //
}])
// Bom
const tableFormButton = async (val , row) => {
getList()
@ -191,14 +184,15 @@ const butttondata=(row) =>{ return [
defaultButtons.mainListHandleBtn({label:"暂停",name:'pause',hide: isShowMainButton(row,['1']),hasPermi:'mes:workScheduling:update'}),
defaultButtons.mainListHandleBtn({label:"恢复",name:'resume',hide: isShowMainButton(row,['3']),hasPermi:'mes:workScheduling:update'}),
defaultButtons.mainListHandleBtn({label:"开工",name:'start',hide: isShowMainButton(row,['-1','0']),hasPermi:'mes:workScheduling:update'}),
defaultButtons.mainListHandleBtn({label:"报工",name:'report',hide: isShowMainButton(row,['4'] ),hasPermi:'mes:workScheduling:update'}),
defaultButtons.mainListHandleBtn({label:"质检",name:'check',hide: isShowMainButton(row,['5'] ),hasPermi:'mes:workScheduling:update'}),
// defaultButtons.mainListHandleBtn({label:"",name:'report',hide: isShowMainButton(row,['3','1'] ),hasPermi:'mes:workScheduling:update'}),
//defaultButtons.mainListHandleBtn({label:"",name:'check',hide: isShowMainButton(row,['5'] ),hasPermi:'mes:workScheduling:update'}),
defaultButtons.mainListHandleBtn({label:"完工",name:'finish',hide: isShowMainButton(row,['1']),hasPermi:'mes:workScheduling:update'}),
//defaultButtons.mainListHandleBtn({label:"",name:'callMaterial',hide: isShowMainButton(row,['1']),hasPermi:'mes:workScheduling:update'}),
]}
const reportRef=ref()
const reportFinishRef=ref()
const qualifiedCheck=ref()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
@ -214,7 +208,7 @@ const buttonTableClick = async (val, row) => {
}else if(val=='report'){
reportRef.value.openDetail(row,"报工")
}else if(val=='check'){
//reportRef.value.openDetail(row,"")
//qualifiedCheck.value.openDetail(row,"")
}else if(val=='finish'){
finishReport(row)
} else if(val=='callMaterial'){
@ -228,7 +222,7 @@ const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
//
//
const finishReport=async(row)=>{
let params={
id:row.id,
@ -238,7 +232,8 @@ const finishReport=async(row)=>{
//console.log("workscheduling-finishReport-213",row)
let res=await WorkSchedulingApi.getNodePosition(params)
if(res==='end'){
reportFinishRef.value.openDetail(row,"完工")
//reportFinishRef.value.openDetail(row,"")
WorkSchedulingApi.completeHandle(params)
}else{
message.alert("当前工序不是完工工序,不能进行完工操作!")
}

194
src/views/qms/inspectionJob/addForm.vue

@ -1,13 +1,17 @@
<template>
<div>
<Dialog :title="dialogTitle" v-model="dialogVisible" :width="dialogWidth" :close-on-click-modal="false" :vLoading="formLoading">
<Dialog :title="dialogTitle" v-model="dialogVisible" :width="dialogWidth" :close-on-click-modal="false"
:vLoading="formLoading">
<div style="max-height: 80vh; overflow-y: auto; padding: 0px 20px">
<Form ref="formMainRef" :rules="rules" :schema="formSchema" :is-col="true" @opensearchTable="opensearchTable" />
<div class="small-title">包装列表</div>
<div style="border:1px solid #dedede;margin-bottom:20px;display: flex;">
<TableForm ref="tableFormRef" style="width:100%;" :maxHeight = "490" :tableFields="tableAllSchemas.tableFormColumns" :tableFormRules="tableFormRules" :tableData="data.packageList" :isShowButton="false" :isShowReduceButton="false" />
<TableForm ref="tableFormRef" style="width:100%;" :maxHeight="490"
:tableFields="tableAllSchemas.tableFormColumns" :tableFormRules="tableFormRules"
:tableData="data.packageList" :isShowButton="false" :isShowReduceButton="false" />
</div>
<el-tabs v-model="editableTabsValue" class="demo-tabs" @edit="handleTabsEdit" type="border-card" tab-position="left" :stretch="false">
<el-tabs v-model="editableTabsValue" class="demo-tabs" @edit="handleTabsEdit" type="border-card"
tab-position="left" :stretch="false">
<el-tab-pane v-for="item in data.subList" :key="item.name" :label="item.processDescribe" :name="item.name">
<div class="small-title">检验工序</div>
<el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef">
@ -39,7 +43,8 @@
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="编码">
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.number" placeholder="根据系统生成" :disabled="true" />
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.number" placeholder="根据系统生成"
:disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
@ -50,21 +55,24 @@
<el-col :span="12">
<el-form-item label="检验方法" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionMethodCode">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName" disabled placeholder="请选择检验方法" />
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName" disabled
placeholder="请选择检验方法" />
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="采样过程编码" prop="inspectionJobCharacteristicsUpdateReqVO.samplingProcessCode">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.samplingProcessName" disabled placeholder="请选择采样过程编码" />
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.samplingProcessName" disabled
placeholder="请选择采样过程编码" />
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="样品份数" prop="inspectionJobCharacteristicsUpdateReqVO.sampleQty">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.sampleQty" disabled placeholder="请输入样品份数" />
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.sampleQty" disabled
placeholder="请输入样品份数" />
</div>
</el-form-item>
</el-col>
@ -72,7 +80,8 @@
<el-col :span="12">
<el-form-item label="每份样品量" prop="inspectionJobCharacteristicsUpdateReqVO.samplePieceSize">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.samplePieceSize" disabled placeholder="请输入样品份数" />
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.samplePieceSize" disabled
placeholder="请输入样品份数" />
</div>
</el-form-item>
</el-col>
@ -83,37 +92,47 @@
</el-col>
<el-col :span="12">
<el-form-item label="结果录入方式" prop="inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod">
<el-select v-model="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod" placeholder="请选择结果录入方式" @change="resultEntryMethodChange($event, item)" disabled>
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY)" :key="dict.value" :label="dict.label" :value="dict.value" />
<el-select v-model="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod"
placeholder="请选择结果录入方式" @change="resultEntryMethodChange($event, item)" disabled>
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY)"
:key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="特征类型" prop="inspectionJobCharacteristicsUpdateReqVO.featureType">
<el-select v-model="item.inspectionJobCharacteristicsUpdateReqVO.featureType" placeholder="请选择特征类型" @change="changeFeatureType" disabled>
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE)" :key="dict.value" :label="dict.label" :value="dict.value" />
<el-select v-model="item.inspectionJobCharacteristicsUpdateReqVO.featureType" placeholder="请选择特征类型"
@change="changeFeatureType" disabled>
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE)"
:key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="开始时间" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime">
<el-date-picker v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime" type="datetime" placeholder="请选择开始时间" style="width: 100%" value-format="x" />
<el-date-picker v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime"
type="datetime" placeholder="请选择开始时间" style="width: 100%" value-format="x" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结束时间" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime">
<el-date-picker v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime" type="datetime" placeholder="请选择结束时间" style="width: 100%" value-format="x" />
<el-date-picker v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime"
type="datetime" placeholder="请选择结束时间" style="width: 100%" value-format="x" />
</el-form-item>
</el-col>
<!-- 手动评估的时候显示 -->
<el-col :span="12" v-if="item.samplingProcessRespVO.evaluationMode == 1">
<el-form-item label="评估代码" required>
<el-select v-model="item.inspectionJobCharacteristicsUpdateReqVO.estimateCode" placeholder="请选择评估代码" @change="changeFeatureType">
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.EVALUATION_CODE)" :key="dict.value" :label="dict.label" :value="dict.value" />
<el-select v-model="item.inspectionJobCharacteristicsUpdateReqVO.estimateCode" placeholder="请选择评估代码"
@change="changeFeatureType">
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.EVALUATION_CODE)" :key="dict.value"
:label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="24" v-for="(cur, i) in item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList" :key="i" style="border: 1px solid #dedede; border-radius: 4px; padding-top: 16px; margin-bottom: 10px;">
<el-col :span="24"
v-for="(cur, i) in item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList" :key="i"
style="border: 1px solid #dedede; border-radius: 4px; padding-top: 16px; margin-bottom: 10px;">
<el-row>
<!-- 汇总录入的时候显示 -->
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1">
@ -133,8 +152,10 @@
</el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == '1'">
<el-form-item label="选定集" required>
<el-select v-model="cur.qualitativeCode" placeholder="请选择选定集" @change="changeQualitativeCode($event, item, cur)">
<el-option v-for="dict in item.selectedProjectRespVOList" :key="dict.dictionaryValue" :label="dict.dictionaryLabel" :value="dict.dictionaryValue" />
<el-select v-model="cur.qualitativeCode" placeholder="请选择选定集"
@change="changeQualitativeCode($event, item, cur)">
<el-option v-for="dict in item.selectedProjectRespVOList" :key="dict.dictionaryValue"
:label="dict.dictionaryLabel" :value="dict.dictionaryValue" />
</el-select>
</el-form-item>
</el-col>
@ -349,6 +370,8 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
//
allSamplePieceSize.value += parseFloat((parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty) * parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.samplePieceSize)).toFixed(2))
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
if(!item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList){
//
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 0) {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = []
@ -362,6 +385,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
})
}
} else {
//
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = []
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
@ -373,6 +397,8 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
}
)
}
}
//
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
@ -401,7 +427,9 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
设置采样数量默认第一个包装采样数量<总数量显示数量字段第二个包装和剩下的总数量对比以此类推
第一个包装采样数量>总数量 则显示总数量
*/
for (let i = 0; i < data.value.packageList.length; i++) {
if(data.value.packageList[i].sampleAmount==null){
if (allSamplePieceSize.value > data.value.packageList[i].amount) {
data.value.packageList[i].sampleAmount = data.value.packageList[i].amount
allSamplePieceSize.value = parseFloat((allSamplePieceSize.value - data.value.packageList[i].amount).toFixed(2))
@ -411,6 +439,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
// return;
}
}
}
// data.value.packageList.forEach(item=>{
// })
@ -522,6 +551,10 @@ const buttonBaseClick =async(val) => {
// await InspectionJobMainApi.abandonInspectionJobMain(data.value.id)
dialogVisible.value = false
}
//
else if (val == 'staging') {
staging()
}
}
//
const emit = defineEmits(['submitForm', 'searchTableSuccess'])
@ -661,12 +694,134 @@ const submitForm = async () => {
console.log(111)
}
}
const staging = async () => {
try {
console.log(data.value.subList)
const elForm = unref(formMainRef)?.getElFormRef()
//
if (!elForm) return
const valid = await elForm.validate()
if (!valid) return
//
console.log(11, data.value.packageList)
if (data.value.packageList?.length > 0) {
const validateForm1 = await tableFormRef.value.validateForm()
if (!validateForm1) return
let isPass = data.value.packageList.some(cur => parseFloat(cur.sampleAmount) > parseFloat(cur.amount))
if (isPass) {
message.error(`采样数量不能大于数量`)
return
}
// let number = 0
// data.value.packageList.forEach(cur=>{
// number += parseFloat(cur.sampleAmount)
// })
// number = number.toFixed('2')
// if(number != data.value.sampleTotalAmount){
// message.error(``)
// return
// }
}
const bol2 = await validateForm(formFeaturesRef.value)
if (!bol2) {
message.error(`模板中有检验工序和检验特性未填写完全`)
return
}
//
let arrBol = []
let isOutweigh = []//
let numberList = []//
let parseFloatList = []//
data.value.subList.forEach((item, index) => {
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) {
arrBol.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => {
return !cur.qualifiedQuantity || !cur.unqualifiedQuantity
}
)
)
}
if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0) {
arrBol.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => {
return !cur.inspectionValue
}
)
)
}
if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1) {
arrBol.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => {
return !cur.qualitativeCode
}
)
)
}
//
if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime > item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) {
isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime)
}
//
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) {
parseFloatList.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => {
return String(cur.qualifiedQuantity).indexOf('.') > -1 || String(cur.unqualifiedQuantity).indexOf('.') > -1
}
)
)
//
numberList.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => {
console.log(12, cur.qualifiedQuantity)
console.log(13, cur.unqualifiedQuantity)
console.log(14, item.inspectionJobCharacteristicsUpdateReqVO.sampleQty)
return parseFloat(cur.qualifiedQuantity) + parseFloat(cur.unqualifiedQuantity) != parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty)
}
)
)
}
})
let isEmpty1 = arrBol.some(item => item == true)
let isEmptyNumberList = numberList.some(item => item == true)
let isParseFloat = parseFloatList.some(item => item == true)
if (isEmpty1) {
message.error('检验工序和检验特性有字段未填写完全')
return;
}
if (isOutweigh?.length > 0) {
message.error('检验特性中有开始时间大于结束时间')
return;
}
if (isParseFloat) {
message.error('合格数量和不合格数量之和不可以是小数')
return;
}
if (isEmptyNumberList) {
message.error('合格数量和不合格数量之和必须等于样品份数')
return;
}
await InspectionJobMainApi.stagingInspectionJobMain(data.value);
message.success("暂存成功")
} catch {
console.log(111)
}
}
/** 弹窗按钮 */
let Butttondata : any = []
if (props.footButttondata) {
Butttondata = props.footButttondata
} else {
Butttondata = [
defaultButtons.formStagingBtn(null), //
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null) //
]
@ -854,6 +1009,7 @@ const changeQualitativeCode = (e, item, cur) => {
min-height: 700px !important;
min-width: 150px !important;
}
.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left {
min-width: 120px !important;
}

135
src/views/wms/basicDataManage/customerManage/customerDeliveryForecast/customerDeliveryForecast.data.ts

@ -0,0 +1,135 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const CustomerDeliveryForecastRules = reactive({
})
export const CustomerDeliveryForecast = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '地点代码',
field: 'schdSite',
sort: 'custom',
isSearch: true
},
{
label: '销售日程单号',
field: 'schdOrder',
sort: 'custom',
isSearch: true
},
{
label: '日程单行号',
field: 'schdLine',
sort: 'custom',
isSearch: true
},
{
label: '客户代码',
field: 'schdCust',
sort: 'custom',
isSearch: true
},
{
label: '发货至',
field: 'schdShipto',
sort: 'custom',
},
{
label: '码头',
field: 'schdDock',
sort: 'custom',
},
{
label: '物料编码',
field: 'schdPart',
sort: 'custom',
},
{
label: '净需求',
field: 'schdNetReq',
sort: 'custom',
},
{
label: '需求日期',
field: 'schdDate',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '需求时间',
field: 'schdTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '需求参考',
field: 'schdReference',
sort: 'custom',
},
{
label: '包装倍数',
field: 'schdOrdMult',
sort: 'custom',
},
{
label: '客户零件号',
field: 'schdCustpart',
sort: 'custom',
},
{
label: '包装代码',
field: 'schdPkgCode',
sort: 'custom',
},
{
label: '模型年',
field: 'schdModelyr',
sort: 'custom',
},
{
label: '客户参考',
field: 'schdCustref',
sort: 'custom',
},
{
label: '先前累计需求数量',
field: 'schdPcrQty',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
},
// {
// label: '操作',
// field: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
// }
]))

244
src/views/wms/basicDataManage/customerManage/customerDeliveryForecast/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="CustomerDeliveryForecast.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="CustomerDeliveryForecast.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="CustomerDeliveryForecastRules"
:formAllSchemas="CustomerDeliveryForecast.allSchemas"
:apiUpdate="CustomerDeliveryForecastApi.updateCustomerDeliveryForecast"
:apiCreate="CustomerDeliveryForecastApi.createCustomerDeliveryForecast"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="CustomerDeliveryForecast.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/customer-delivery-forecast/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { CustomerDeliveryForecast,CustomerDeliveryForecastRules } from './customerDeliveryForecast.data'
import * as CustomerDeliveryForecastApi from '@/api/wms/customerDeliveryForecast'
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: 'CustomerDeliveryForecast' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(CustomerDeliveryForecast.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: CustomerDeliveryForecastApi.getCustomerDeliveryForecastPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:customerDeliveryForecast:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:customerDeliveryForecast:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:customerDeliveryForecast: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:customerDeliveryForecast:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:customerDeliveryForecast: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 =CustomerDeliveryForecast.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 CustomerDeliveryForecastApi.createCustomerDeliveryForecast(data)
message.success(t('common.createSuccess'))
} else {
await CustomerDeliveryForecastApi.updateCustomerDeliveryForecast(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, 'basicCustomerDeliveryForecast')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await CustomerDeliveryForecastApi.deleteCustomerDeliveryForecast(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 CustomerDeliveryForecastApi.exportCustomerDeliveryForecast(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 CustomerDeliveryForecastApi.importTemplate()
})
</script>

25
src/views/wms/basicDataManage/itemManage/packageunit/index.vue

@ -149,6 +149,31 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
if(type == "update"){
Packageunit.allSchemas.formSchema.forEach((item) => {
if (item.field == 'code') {
item.componentProps.disabled = true
}
if (item.field == 'name') {
item.componentProps.disabled = true
}
if (item.field == 'manageBalance') {
item.componentProps.disabled = true
}
})
}else {
Packageunit.allSchemas.formSchema.forEach((item) => {
if (item.field == 'code') {
item.componentProps.disabled = false
}
if (item.field == 'name') {
item.componentProps.disabled = false
}
if (item.field == 'manageBalance') {
item.componentProps.disabled = false
}
})
}
basicFormRef.value.open(type, row)
}

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

@ -84,7 +84,7 @@ const updataTableColumns = (val) => {
}
const { tableObject, tableMethods } = useTable({
getListApi: PurchasepriceApi.getPurchasepricePage //
getListApi: routeName.value.includes('SCP')?PurchasepriceApi.getPurchasepricePageSCP:PurchasepriceApi.getPurchasepricePage //
})
//
@ -238,8 +238,13 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
if(routeName.value.includes('SCP')){
const data = await PurchasepriceApi.exportPurchasepriceSCP(tableObject.params)
download.excel(data, `${t('ts.采购价格单')}.xlsx`)
}else{
const data = await PurchasepriceApi.exportPurchaseprice(tableObject.params)
download.excel(data, `${t('ts.采购价格单')}.xlsx`)
}
} catch {
} finally {
exportLoading.value = false

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

@ -82,7 +82,7 @@ const updataTableColumns = (val) => {
}
const { tableObject, tableMethods } = useTable({
getListApi: SupplierApi.getSupplierPage //
getListApi: routeName.value.includes('SCP')?SupplierApi.getSupplierPageSCP:SupplierApi.getSupplierPage //
})
//
@ -220,8 +220,13 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
if(routeName.value.includes('SCP')){
const data = await SupplierApi.exportSupplierSCP(tableObject.params)
download.excel(data, `${t('ts.供应商')}.xlsx`)
}else{
const data = await SupplierApi.exportSupplier(tableObject.params)
download.excel(data, `${t('ts.供应商')}.xlsx`)
}
} catch {
} finally {
exportLoading.value = false

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

@ -83,7 +83,7 @@ const updataTableColumns = (val) => {
}
const { tableObject, tableMethods } = useTable({
getListApi: SupplieritemApi.getSupplieritemPage //
getListApi: routeName.value.includes('SCP')?SupplieritemApi.getSupplieritemPageSCP:SupplieritemApi.getSupplieritemPage //
})
//
@ -237,8 +237,13 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
if(routeName.value.includes('SCP')){
const data = await SupplieritemApi.exportSupplieritemSCP(tableObject.params)
download.excel(data, `${t('ts.供应商物料')}.xlsx`)
}else{
const data = await SupplieritemApi.exportSupplieritem(tableObject.params)
download.excel(data, `${t('ts.供应商物料')}.xlsx`)
}
} catch {
} finally {
exportLoading.value = false

4
src/views/wms/deliversettlementManage/deliverplan/saleMain/index.vue

@ -134,8 +134,8 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:sale-main:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:sale-main:import'}), //
// defaultButtons.defaultAddBtn({hasPermi:'wms:sale-main:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:sale-main:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:sale-main:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //

20
src/views/wms/deliversettlementManage/deliverplan/saleMain/saleMain.data.ts

@ -264,16 +264,16 @@ export const SaleMain = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
// {
// label: '操作',
// field: 'action',
// isDetail: false,
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
// }
]))
//表单校验

504
src/views/wms/inventoryjobManage/containermanage/containerMainRequest/containerMainRequest.data.ts

@ -0,0 +1,504 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { TableColumn } from '@/types/table'
import { dateFormatter } from '@/utils/formatTime'
import * as BalanceApi from '@/api/wms/balance'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
// 表单校验
export const ContainerMainRequestRules = reactive({
type:[
{ required: true, message: '请选择类型', trigger: 'change' },
],
concurrencyStamp: [required],
})
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = {
pageSize:10,
pageNo:1,
code:'ContainerRequest'
}
const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData =data?.list[0]||{}
// 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept
// id 转str 否则form回显匹配不到
userDept.id = userDept.id.toString()
const userDeptArray:any = [userDept]
export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 100
},
}, {
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isSearch: true,
isForm: false,
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '类型',
field: 'type',
sort: 'custom',
dictType: DICT_TYPE.CONTAIN_MANAGE_TYPE,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 120
},
form:{
componentProps:{
disabled: true,
}
}
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isForm: false,
table: {
width: 150
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
isForm: false,
table: {
width: 150
},
isTable:false,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userDeptArray.find((account) => account.id == cellValue)?.name
},
form: {
value: userDept.id,
component: 'Select',
api: () => userDeptArray,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
}
}
}
},
{
label: '自动提交',
field: 'autoCommit',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
isForm: false,
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: false,
isForm: false,
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: false,
isForm: false,
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',
isForm: false,
isTable: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.directCreateRecord,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
table: {
width: 200
},
isForm: false,
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isForm: false,
isTable: false
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
isForm: false,
isTable: false
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isForm: false,
table: {
width: 100
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const ContainerDetailRequestRules = reactive({
toLocationCode: [
{ required: true, message: '请选择目标库位', trigger: 'blur' }
],
containerNumber: [
{ required: true, message: '请选择器具号', trigger: 'blur' }
],
toinventoryStatus: [
{ required: true, message: '请选择倒库存状态', trigger: 'blur' }
],
toQty: [
{ required: true, message: '请输入到数量', trigger: 'blur' }
],
})
export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '主表ID',
field: 'masterId',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '器具号',
field: 'containerNumber',
sort: 'custom',
tableForm:{
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择器具号',
searchField: 'itemCode',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.selectConfigToBalance,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择器具号',
searchField: 'itemCode',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.selectConfigToBalance,
}
}
},
{
label: '来源库位代码',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true,
type: 'Select'
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
disabled: true,
}
}
},
{
label: '目标库位代码',
field: 'toLocationCode',
sort: 'custom',
table: {
width: 150
},
tableForm:{
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择到库位代码',
searchField: 'code',
searchTitle: '库位信息',
searchAllSchemas: Location.allSchemas,
searchPage: LocationApi.selectBusinessTypeToLocation,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择到库位代码',
searchField: 'code',
searchTitle: '库位信息',
searchAllSchemas: Location.allSchemas,
searchPage: LocationApi.selectBusinessTypeToLocation,
}
}
},
{
label: '从库存状态',
field: 'fromInventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
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'
},
},
// {
// label: '从数量',
// field: 'fromQty',
// sort: 'custom',
// tableForm: {
// disabled: true,
// },
// },
{
label: '到数量',
field: 'toQty',
sort: 'custom',
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true,
type: 'Select'
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
table: {
width: 200
},
isForm: false,
isTableForm: false
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '从货主代码',
field: 'fromOwnerCode',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '到货主代码',
field: 'toOwnerCode',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

507
src/views/wms/inventoryjobManage/containermanage/containerMainRequest/index.vue

@ -0,0 +1,507 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ContainerMainRequest.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ContainerMainRequest.allSchemas"
:detailAllSchemas="ContainerDetailRequest.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,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="ContainerMainRequestRules"
:formAllSchemas="ContainerMainRequest.allSchemas"
:tableAllSchemas="ContainerDetailRequest.allSchemas"
:tableFormRules="ContainerDetailRequestRules"
:tableData="tableData"
:apiUpdate="ContainerMainRequestApi.updateContainerMainRequest"
:apiCreate="ContainerMainRequestApi.createContainerMainRequest"
:isBusiness="true"
fromeWhere="ContainerMainRequest"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
:isShowButton = isShowButton
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="ContainerMainRequest.allSchemas"
:detailAllSchemas="ContainerDetailRequest.allSchemas"
:detailAllSchemasRules="ContainerDetailRequestRules"
:apiCreate="ContainerDetailRequestApi.createContainerDetailRequest"
:apiUpdate="ContainerDetailRequestApi.updateContainerDetailRequest"
:apiPage="ContainerDetailRequestApi.getContainerDetailRequestPage"
:apiDelete="ContainerDetailRequestApi.deleteContainerDetailRequest"
fromeWhere="ContainerDetailRequest"
@searchTableSuccessDetail="searchTableSuccessDetail"
:detailButtonIsShowAdd="trueFalse"
:detailButtonIsShowDelete="trueFalse"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/container-main-request/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ContainerMainRequest,ContainerMainRequestRules,ContainerDetailRequest,ContainerDetailRequestRules } from './containerMainRequest.data'
import * as ContainerMainRequestApi from '@/api/wms/containerMainRequest'
import * as ContainerDetailRequestApi from '@/api/wms/containerDetailRequest'
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: 'ContainerManageRequest' })
const message = useMessage() //
const { t } = useI18n() //
const businessType = ref()
const fromLocationCode = ref()
const toLocationCode = ref()
const importFileName = ref()
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ContainerMainRequest.allSchemas.tableColumns)
console.log(99 , routeName.value)
const { tableObject, tableMethods } = useTable({
getListApi: ContainerDetailRequestApi.getContainerDetailRequestPage //
})
//
/**
*
*/
if ( routeName.value == 'ReturnContainerManageRequest') {
tableObject.params = {
type:'RETURN'
}
ContainerMainRequest.allSchemas.formSchema.forEach(item=>{
if(item.field == 'type'){
item.value = "RETURN"
}});
businessType.value = 'ReturnContainerManage'
importFileName.value = '器具返回申请'
} else if ( routeName.value == 'MoveContainerManageRequest') {
tableObject.params = {
type:'MOVE'
}
ContainerMainRequest.allSchemas.formSchema.forEach(item=>{
if(item.field == 'type'){
item.value = "MOVE"
}});
businessType.value = 'MoveContainerManage'
importFileName.value = '器具转移申请'
} else if ( routeName.value == 'DeliverContainerManageRequest') {
tableObject.params = {
type: 'DELIVER',
}
//
ContainerMainRequest.allSchemas.formSchema.forEach(item=>{
if(item.field == 'type'){
item.value = "DELIVER"
}});
businessType.value = 'DeliverContainerManage'
importFileName.value = '器具发运申请'
} else if( routeName.value == 'ContainerManageRequest'){
businessType.value = 'ContainerManage'
importFileName.value = '器具管理申请'
}
// //
const trueFalse = ref(false)
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => {
if (type == 'tableForm') {
if(formField == 'containerNumber') {
row['containerNumber'] = val[0]['itemCode']
row['uom'] = val[0]['uom']
row['fromLocationCode'] = val[0]['locationCode']
row['fromInventoryStatus'] = val[0]['inventoryStatus']
}else if(formField == 'toLocationCode'){
row['toLocationCode'] = val[0]['code']
}else {
row[formField] = val[0][searchField]
}
}
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
if(formField == 'containerNumber') {
setV['containerNumber'] = val[0]['code']
setV['uom'] = val[0]['uom']
}else if(formField == 'toLocationCode'){
setV['toLocationCode'] = val[0]['code']
}else {
setV[formField] = val[0][searchField]
}
formRef.setValues(setV)
})
}
// tableform
ContainerDetailRequest.allSchemas.tableFormColumns.map(item => {
console.log(businessType.value+99999999);
if(item.field == 'containerNumber') {
if (fromLocationCode.value == null) {
item.tableForm.searchCondition = [
{
key: 'businessType',
value: businessType.value ,
isMainValue: false
}
]
item.form.componentProps.searchCondition = [
{
key: 'businessType',
value: businessType.value,
isMainValue: false
}
]
} else {
delete item.tableForm.searchCondition
}
}
if(item.field == "toLocationCode"){
if (toLocationCode.value) {
item.tableForm.searchCondition = [
{
key: 'businessType',
value: businessType.value,
isMainValue: false
}]
item.form.componentProps.searchCondition = [
{
key: 'businessType',
value: businessType.value,
isMainValue: false
}]
}else if (toLocationCode.value == null) {
item.tableForm.searchCondition = [
{
key: 'businessType',
value: businessType.value ,
isMainValue: false
}]
item.form.componentProps.searchCondition = [
{
key: 'businessType',
value: businessType.value,
isMainValue: false
}]
}
}
})
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:container-main-request:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:container-main-request:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:container-main-request: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 isShowMainButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>0&&findIndex<$index){
return []
}
return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:container-main-request:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']),hasPermi:'wms:container-main-request:reAdd'}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:container-main-request:submit'}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:container-main-request:refused'}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:container-main-request:agree'}), //
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:container-main-request:handle'}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:container-main-request:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:container-main-request:delete'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { //
await message.confirm('确认要关闭吗?')
tableObject.loading = true
ContainerMainRequestApi.close(row.masterId).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
ContainerMainRequestApi.reAdd(row.masterId).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
ContainerMainRequestApi.submit(row.masterId).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
ContainerMainRequestApi.refused(row.masterId).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
ContainerMainRequestApi.agree(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainHandle') { //
await message.confirm('确认要处理吗?')
tableObject.loading = true
ContainerMainRequestApi.handle(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
const isShowButton = ref(true)
/**
* tableForm方法
*/
const tableFormKeys = {}
ContainerDetailRequest.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)
}
//true0
const flag = ref()
// form
const submitForm = async (formType,data) => {
data.subList = tableData.value //
data.subList.forEach(item => {
if(item.toQty == 0){
message.error(`到数量不能为0!`)
flag.value = true
return;
}
})
try {
if (formType === 'create') {
data.businessType = businessType.value
await ContainerMainRequestApi.createContainerMainRequest(data)
message.success(t('common.createSuccess'))
} else {
await ContainerMainRequestApi.updateContainerMainRequest(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
} finally {
basicFormRef.value.formLoading = false
}
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicContainerMainRequest')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ContainerMainRequestApi.deleteContainerMainRequest(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 ContainerMainRequestApi.exportContainerMainRequest(tableObject.params)
download.excel(data, '器具管理申请主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: 'importFileName.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ContainerMainRequestApi.importTemplate()
})
</script>

284
src/views/wms/inventoryjobManage/containermanage/containerRecordMain/containerRecordMain.data.ts

@ -0,0 +1,284 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { TableColumn } from '@/types/table'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const ContainerRecordMainRules = reactive({
available: [required],
concurrencyStamp: [required],
})
// 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept
// id 转str 否则form回显匹配不到
userDept.id = userDept.id.toString()
const userDeptArray:any = [userDept]
export const ContainerRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 200
},
},
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
isSearch: true,
},
{
label: '类型',
field: 'type',
sort: 'custom',
dictType: DICT_TYPE.CONTAIN_MANAGE_TYPE,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 120
},
form:{
componentProps:{
disabled: true,
}
}
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isForm: false,
isTable:false
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
isForm: false,
table: {
width: 150
},
isTable:false,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userDeptArray.find((account) => account.id == cellValue)?.name
},
form: {
value: userDept.id,
component: 'Select',
api: () => userDeptArray,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
}
}
}
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isForm: false,
isTable: false
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
isForm: false,
isTable: false
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isForm: false,
table: {
width: 100
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
table: {
width: 200
},
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const ContainerRecordDetailRules = reactive({
fromLocationCode: [required],
toLocationCode: [required],
concurrencyStamp: [required],
})
export const ContainerRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '主表ID',
field: 'masterId',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '单据号',
field: 'number',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '器具号',
field: 'containerNumber',
sort: 'custom'
},
{
label: '来源库位代码',
field: 'fromLocationCode',
sort: 'custom',
},
{
label: '目标库位代码',
field: 'toLocationCode',
sort: 'custom',
},
{
label: '到数量',
field: 'toQty',
sort: 'custom',
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true,
type: 'Select'
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
table: {
width: 200
},
isForm: false,
isTableForm: false
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '从货主代码',
field: 'fromOwnerCode',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '到货主代码',
field: 'toOwnerCode',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

249
src/views/wms/inventoryjobManage/containermanage/containerRecordMain/index.vue

@ -0,0 +1,249 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="[...ContainerRecordMain.allSchemas.searchSchema,...ContainerRecordDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ContainerRecordMain.allSchemas"
:detailAllSchemas="ContainerRecordDetail.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,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="ContainerRecordMainRules"
:formAllSchemas="ContainerRecordMain.allSchemas"
:tableAllSchemas="ContainerRecordDetail.allSchemas"
:tableFormRules="ContainerRecordDetailRules"
:isBusiness="true"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="ContainerRecordMain.allSchemas"
:detailAllSchemas="ContainerRecordDetail.allSchemas"
:detailAllSchemasRules="ContainerRecordDetailRules"
:apiPage="ContainerRecordDetailApi.getContainerRecordDetailPage"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ContainerRecordMain,ContainerRecordMainRules,ContainerRecordDetail,ContainerRecordDetailRules } from './containerRecordMain.data'
import * as ContainerRecordMainApi from '@/api/wms/containerRecordMain'
import * as ContainerRecordDetailApi from '@/api/wms/containerRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
defineOptions({ name: 'ContainerRecordMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const businessType = ref()
const importFileName = ref()
const tableColumns = ref([...ContainerRecordMain.allSchemas.tableColumns,...ContainerRecordDetail.allSchemas.tableMainColumns])
const { tableObject, tableMethods } = useTable({
getListApi: ContainerRecordDetailApi.getContainerRecordDetailPage //
})
//
/**
*
*/
if ( routeName.value == 'ReturnContainerManageRecord') {
tableObject.params = {
type:'RETURN'
}
businessType.value = 'ReturnContainerManage'
importFileName.value = '器具返回记录'
} else if ( routeName.value == 'MoveContainerManageRecord') {
tableObject.params = {
type:'MOVE'
}
businessType.value = 'MoveContainerManage'
importFileName.value = '器具转移记录'
} else if ( routeName.value == 'InitialContainerManageRecord') {
tableObject.params = {
type:'INITIAL',
}
businessType.value = 'InitialContainerManage'
importFileName.value = '器具初始化记录'
}
else if ( routeName.value == 'ScrapContainerManageRecord') {
tableObject.params = {
type:'SCRAP'
}
businessType.value = 'ScrapContainerManage'
importFileName.value = '器具报废记录'
} else if ( routeName.value == 'DeliverContainerManageRecord') {
tableObject.params = {
type: 'DELIVER',
}
businessType.value = 'DeliverContainerManage'
importFileName.value = '器具发运记录'
} else if( routeName.value == 'ContainerManageRecord'){
businessType.value = 'ContainerManage'
importFileName.value = '器具管理记录'
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:container-record-detail:create'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:container-record-detail: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 == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>0&&findIndex<$index){
return []
}
return [
// defaultButtons.mainListEditBtn({hasPermi:'wms:container-record-main:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:container-record-main:delete'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
//
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)
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ContainerRecordMainApi.deleteContainerRecordMain(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 ContainerRecordMainApi.exportContainerRecordMain(tableObject.params)
download.excel(data, '器具管理记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
})
</script>

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

@ -0,0 +1,462 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ContainerMainRequest.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ContainerMainRequest.allSchemas"
:detailAllSchemas="ContainerDetailRequest.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,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="ContainerMainRequestRules"
:formAllSchemas="ContainerMainRequest.allSchemas"
:tableAllSchemas="ContainerDetailRequest.allSchemas"
:tableFormRules="ContainerDetailRequestRules"
:tableData="tableData"
:apiUpdate="ContainerMainRequestApi.updateContainerMainRequest"
:apiCreate="ContainerMainRequestApi.createContainerMainRequest"
:isBusiness="true"
fromeWhere="ContainerMainRequest"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
:isShowButton = isShowButton
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="ContainerMainRequest.allSchemas"
:detailAllSchemas="ContainerDetailRequest.allSchemas"
:detailAllSchemasRules="ContainerDetailRequestRules"
:apiCreate="ContainerDetailRequestApi.createContainerDetailRequest"
:apiUpdate="ContainerDetailRequestApi.createContainerDetailRequest"
:apiPage="ContainerDetailRequestApi.getContainerDetailRequestPage"
:apiDelete="ContainerDetailRequestApi.deleteContainerDetailRequest"
fromeWhere="ContainerDetailRequest"
@searchTableSuccessDetail="searchTableSuccessDetail"
:detailButtonIsShowAdd="trueFalse"
:detailButtonIsShowDelete="trueFalse"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/container-main-request/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ContainerMainRequest,ContainerMainRequestRules,ContainerDetailRequest,ContainerDetailRequestRules } from './initialContainerMainRequest.data'
import * as ContainerMainRequestApi from '@/api/wms/containerMainRequest'
import * as ContainerDetailRequestApi from '@/api/wms/containerDetailRequest'
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: 'InitialContainerManageRequest' })
const message = useMessage() //
const { t } = useI18n() //
const businessType = ref()
const toLocationCode = ref()
const importFileName = ref()
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ContainerMainRequest.allSchemas.tableColumns)
console.log(99 , routeName.value)
const { tableObject, tableMethods } = useTable({
getListApi: ContainerDetailRequestApi.getContainerDetailRequestPage //
})
//
/**
*
*/
if ( routeName.value == 'InitialContainerManageRequest') {
tableObject.params = {
type:'INITIAL',
}
ContainerMainRequest.allSchemas.formSchema.forEach(item=>{
if(item.field == 'type'){
item.value = "INITIAL"
}});
businessType.value = 'InitialContainerManage'
importFileName.value = '器具初始化申请'
}
// //
const trueFalse = ref(false)
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => {
if (type == 'tableForm') {
if(formField == 'containerNumber') {
row['containerNumber'] = val[0]['code']
row['uom'] = val[0]['uom']
row['toInventoryStatus'] = 'OK'
}else if(formField == 'toLocationCode'){
row['toLocationCode'] = val[0]['code']
}else {
row[formField] = val[0][searchField]
}
}
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
if(formField == 'containerNumber') {
setV['containerNumber'] = val[0]['code']
setV['uom'] = val[0]['uom']
}else if(formField == 'toLocationCode'){
setV['toLocationCode'] = val[0]['code']
}else {
setV[formField] = val[0][searchField]
}
formRef.setValues(setV)
})
}
// tableform
ContainerDetailRequest.allSchemas.tableFormColumns.map(item => {
if(item.field == "toLocationCode"){
if (toLocationCode.value) {
item.tableForm.searchCondition = [
{
key: 'businessType',
value: businessType.value,
isMainValue: false
}]
item.form.componentProps.searchCondition = [
{
key: 'businessType',
value: businessType.value,
isMainValue: false
}]
}else if (toLocationCode.value == null) {
item.tableForm.searchCondition = [
{
key: 'businessType',
value: businessType.value ,
isMainValue: false
}]
item.form.componentProps.searchCondition = [
{
key: 'businessType',
value: businessType.value,
isMainValue: false
}]
}
}
})
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const { getList, setSearchParams } = tableMethods
//
const isShowMainButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:container-main-request:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:container-main-request:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:container-main-request: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 = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>0&&findIndex<$index){
return []
}
return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:container-main-request:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']),hasPermi:'wms:container-main-request:reAdd'}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:container-main-request:submit'}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:container-main-request:refused'}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:container-main-request:agree'}), //
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:container-main-request:handle'}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:container-main-request:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:container-main-request:delete'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { //
await message.confirm('确认要关闭吗?')
tableObject.loading = true
ContainerMainRequestApi.close(row.masterId).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
ContainerMainRequestApi.reAdd(row.masterId).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
ContainerMainRequestApi.submit(row.masterId).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
ContainerMainRequestApi.refused(row.masterId).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
ContainerMainRequestApi.agree(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainHandle') { //
await message.confirm('确认要 处理吗?')
tableObject.loading = true
ContainerMainRequestApi.handle(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
const isShowButton = ref(true)
/**
* tableForm方法
*/
const tableFormKeys = {}
ContainerDetailRequest.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)
}
//true0
const flag = ref()
// form
const submitForm = async (formType,data) => {
data.subList = tableData.value //
data.subList.forEach(item => {
if(item.qty == 0){
message.error(`到数量不能为0!`)
flag.value = true
return;
}
})
try {
if (formType === 'create') {
data.businessType = businessType.value
console.log(data.businessType,999);
await ContainerMainRequestApi.createContainerMainRequest(data)
message.success(t('common.createSuccess'))
} else {
await ContainerMainRequestApi.updateContainerMainRequest(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
} finally {
basicFormRef.value.formLoading = false
}
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicContainerMainRequest')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ContainerMainRequestApi.deleteContainerMainRequest(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 ContainerMainRequestApi.exportContainerMainRequest(tableObject.params)
download.excel(data, '器具管理申请主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: 'importFileName.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ContainerMainRequestApi.importTemplate()
})
</script>
./initialContainerMainRequest.data

475
src/views/wms/inventoryjobManage/containermanage/initialContainerMainRequest/initialContainerMainRequest.data.ts

@ -0,0 +1,475 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { TableColumn } from '@/types/table'
import { dateFormatter } from '@/utils/formatTime'
import * as BalanceApi from '@/api/wms/balance'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
// 表单校验
export const ContainerMainRequestRules = reactive({
type:[
{ required: true, message: '请选择类型', trigger: 'change' },
],
concurrencyStamp: [required],
})
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = {
pageSize:10,
pageNo:1,
code:'ContainerRequest'
}
const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData =data?.list[0]||{}
// 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept
// id 转str 否则form回显匹配不到
userDept.id = userDept.id.toString()
const userDeptArray:any = [userDept]
export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 100
},
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isSearch: true,
isForm: false,
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '类型',
field: 'type',
sort: 'custom',
dictType: DICT_TYPE.CONTAIN_MANAGE_TYPE,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 120
},
form:{
componentProps:{
disabled: true,
}
}
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isForm: false,
table: {
width: 150
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
isForm: false,
table: {
width: 150
},
isTable:false,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userDeptArray.find((account) => account.id == cellValue)?.name
},
form: {
value: userDept.id,
component: 'Select',
api: () => userDeptArray,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
}
}
}
},
{
label: '自动提交',
field: 'autoCommit',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
isForm: false,
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: false,
isForm: false,
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: false,
isForm: false,
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',
isForm: false,
isTable: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.directCreateRecord,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
table: {
width: 200
},
isForm: false,
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isForm: false,
isTable: false
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
isForm: false,
isTable: false
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isForm: false,
table: {
width: 100
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 200,
fixed: 'right'
}
}
]))
// 表单校验
export const ContainerDetailRequestRules = reactive({
toLocationCode: [
{ required: true, message: '请选择目标库位', trigger: 'blur' }
],
containerNumber: [
{ required: true, message: '请选择器具号', trigger: 'blur' }
],
toQty: [
{ required: true, message: '请输入到数量', trigger: 'blur' }
],
})
export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '主表ID',
field: 'masterId',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '器具号',
field: 'containerNumber',
sort: 'custom',
tableForm:{
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择器具号',
searchField: 'itemCode',
searchTitle: '器具信息',
searchAllSchemas: Itembasic.allSchemas,
searchPage: ItembasicApi.selectConfigToItembasic,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择器具号',
searchField: 'itemCode',
searchTitle: '器具信息',
searchAllSchemas: Itembasic.allSchemas,
searchPage: ItembasicApi.selectConfigToItembasic,
}
}
},
{
label: '目标库位代码',
field: 'toLocationCode',
sort: 'custom',
table: {
width: 150
},
tableForm:{
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择到库位代码',
searchField: 'code',
searchTitle: '库位信息',
searchAllSchemas: Location.allSchemas,
searchPage: LocationApi.selectBusinessTypeToLocation,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择到库位代码',
searchField: 'code',
searchTitle: '库位信息',
searchAllSchemas: Location.allSchemas,
searchPage: LocationApi.selectBusinessTypeToLocation,
}
}
},
{
label: '到库存状态',
field: 'toInventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true,
type: 'Select'
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '到数量',
field: 'toQty',
sort: 'custom',
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
table: {
width: 200
},
isForm: false,
isTableForm: false
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '从货主代码',
field: 'fromOwnerCode',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '到货主代码',
field: 'toOwnerCode',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 200,
fixed: 'right'
}
}
]))

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

@ -0,0 +1,487 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ContainerMainRequest.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ContainerMainRequest.allSchemas"
:detailAllSchemas="ContainerDetailRequest.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,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="ContainerMainRequestRules"
:formAllSchemas="ContainerMainRequest.allSchemas"
:tableAllSchemas="ContainerDetailRequest.allSchemas"
:tableFormRules="ContainerDetailRequestRules"
:tableData="tableData"
:apiUpdate="ContainerMainRequestApi.updateContainerMainRequest"
:apiCreate="ContainerMainRequestApi.createContainerMainRequest"
:isBusiness="true"
fromeWhere="ContainerMainRequest"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
:isShowButton = isShowButton
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="ContainerMainRequest.allSchemas"
:detailAllSchemas="ContainerDetailRequest.allSchemas"
:detailAllSchemasRules="ContainerDetailRequestRules"
:apiCreate="ContainerDetailRequestApi.createContainerDetailRequest"
:apiUpdate="ContainerDetailRequestApi.updateContainerDetailRequest"
:apiPage="ContainerDetailRequestApi.getContainerDetailRequestPage"
:apiDelete="ContainerDetailRequestApi.deleteContainerDetailRequest"
fromeWhere="ContainerDetailRequest"
@searchTableSuccessDetail="searchTableSuccessDetail"
:detailButtonIsShowAdd="trueFalse"
:detailButtonIsShowDelete="trueFalse"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/container-main-request/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ContainerMainRequest,ContainerMainRequestRules,ContainerDetailRequest,ContainerDetailRequestRules } from './scrapContainerMainRequest.data'
import * as ContainerMainRequestApi from '@/api/wms/containerMainRequest'
import * as ContainerDetailRequestApi from '@/api/wms/containerDetailRequest'
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: 'ScrapContainerManageRequest' })
const message = useMessage() //
const { t } = useI18n() //
const businessType = ref()
const toLocationCode = ref()
const fromLocationCode = ref()
const importFileName = ref()
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ContainerMainRequest.allSchemas.tableColumns)
console.log(99 , routeName.value)
const { tableObject, tableMethods } = useTable({
getListApi: ContainerDetailRequestApi.getContainerDetailRequestPage //
})
//
/**
*
*/
if ( routeName.value == 'ScrapContainerManageRequest') {
tableObject.params = {
type:'SCRAP'
}
ContainerMainRequest.allSchemas.formSchema.forEach(item=>{
if(item.field == 'type'){
item.value = "SCRAP"
}});
businessType.value = 'ScrapContainerManage'
importFileName.value = '器具报废申请'
}
// //
const trueFalse = ref(false)
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => {
if (type == 'tableForm') {
if(formField == 'containerNumber') {
row['containerNumber'] = val[0]['itemCode']
row['uom'] = val[0]['uom']
row['fromLocationCode'] = val[0]['locationCode']
row['fromInventoryStatus'] = val[0]['inventoryStatus']
row['toInventoryStatus'] = 'SCRAP'
}else if(formField == 'toLocationCode'){
row['toLocationCode'] = val[0]['code']
}else {
row[formField] = val[0][searchField]
}
}
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
if(formField == 'containerNumber') {
setV['containerNumber'] = val[0]['itemCode']
setV['uom'] = val[0]['uom']
}else if(formField == 'toLocationCode'){
setV['toLocationCode'] = val[0]['code']
}else {
setV[formField] = val[0][searchField]
}
formRef.setValues(setV)
})
}
// tableform
ContainerDetailRequest.allSchemas.tableFormColumns.map(item => {
if(item.field == 'containerNumber') {
if (fromLocationCode.value == null) {
item.tableForm.searchCondition = [
{
key: 'businessType',
value: businessType.value ,
isMainValue: false
}
]
item.form.componentProps.searchCondition = [
{
key: 'businessType',
value: businessType.value,
isMainValue: false
}
]
} else {
delete item.tableForm.searchCondition
}
}
if(item.field == "toLocationCode"){
if (toLocationCode.value) {
item.tableForm.searchCondition = [
{
key: 'businessType',
value: businessType.value,
isMainValue: false
}]
item.form.componentProps.searchCondition = [
{
key: 'businessType',
value: businessType.value,
isMainValue: false
}]
}else if (toLocationCode.value == null) {
item.tableForm.searchCondition = [
{
key: 'businessType',
value: businessType.value ,
isMainValue: false
}]
item.form.componentProps.searchCondition = [
{
key: 'businessType',
value: businessType.value,
isMainValue: false
}]
}
}
})
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const { getList, setSearchParams } = tableMethods
//
const isShowMainButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:container-main-request:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:container-main-request:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:container-main-request: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 = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>0&&findIndex<$index){
return []
}
return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:container-main-request:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']),hasPermi:'wms:container-main-request:reAdd'}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:container-main-request:submit'}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:container-main-request:refused'}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:container-main-request:agree'}), //
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:container-main-request:handle'}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:container-main-request:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:container-main-request:delete'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { //
await message.confirm('确认要关闭吗?')
tableObject.loading = true
ContainerMainRequestApi.close(row.masterId).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
ContainerMainRequestApi.reAdd(row.masterId).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
ContainerMainRequestApi.submit(row.masterId).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
ContainerMainRequestApi.refused(row.masterId).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
ContainerMainRequestApi.agree(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainHandle') { //
await message.confirm('确认要 处理吗?')
tableObject.loading = true
ContainerMainRequestApi.handle(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
const isShowButton = ref(true)
/**
* tableForm方法
*/
const tableFormKeys = {}
ContainerDetailRequest.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
if(item.field == 'toInventoryStatus'){
tableFormKeys[item.field] = "SCRAP"
}
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//true0
const flag = ref()
// form
const submitForm = async (formType,data) => {
data.subList = tableData.value //
data.subList.forEach(item => {
if(item.qty == 0){
message.error(`到数量不能为0!`)
flag.value = true
return;
}
})
try {
if (formType === 'create') {
data.businessType = businessType.value
console.log(data.businessType,999);
await ContainerMainRequestApi.createContainerMainRequest(data)
message.success(t('common.createSuccess'))
} else {
await ContainerMainRequestApi.updateContainerMainRequest(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
} finally {
basicFormRef.value.formLoading = false
}
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicContainerMainRequest')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ContainerMainRequestApi.deleteContainerMainRequest(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 ContainerMainRequestApi.exportContainerMainRequest(tableObject.params)
download.excel(data, '器具管理申请主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: 'importFileName.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ContainerMainRequestApi.importTemplate()
})
</script>

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

@ -0,0 +1,502 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { TableColumn } from '@/types/table'
import { dateFormatter } from '@/utils/formatTime'
import * as BalanceApi from '@/api/wms/balance'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
// 表单校验
export const ContainerMainRequestRules = reactive({
type: [
{ required: true, message: '请选择类型', trigger: 'change' },
],
concurrencyStamp: [required],
})
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = {
pageSize: 10,
pageNo: 1,
code: 'ContainerRequest'
}
const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData = data?.list[0] || {}
// 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept
// id 转str 否则form回显匹配不到
userDept.id = userDept.id.toString()
const userDeptArray: any = [userDept]
export const ContainerMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 100
},
}, {
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isSearch: true,
isForm: false,
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '类型',
field: 'type',
sort: 'custom',
dictType: DICT_TYPE.CONTAIN_MANAGE_TYPE,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 120
},
form: {
componentProps: {
disabled: true,
}
}
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isForm: false,
table: {
width: 150
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
isForm: false,
table: {
width: 150
},
isTable: false,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userDeptArray.find((account) => account.id == cellValue)?.name
},
form: {
value: userDept.id,
component: 'Select',
api: () => userDeptArray,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
}
}
}
},
{
label: '自动提交',
field: 'autoCommit',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
isForm: false,
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: false,
isForm: false,
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: false,
isForm: false,
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',
isForm: false,
isTable: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.directCreateRecord,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
table: {
width: 200
},
isForm: false,
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isForm: false,
isTable: false
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
isForm: false,
isTable: false
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isForm: false,
table: {
width: 100
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const ContainerDetailRequestRules = reactive({
toLocationCode: [
{ required: true, message: '请选择目标库位', trigger: 'blur' }
],
containerNumber: [
{ required: true, message: '请选择器具号', trigger: 'blur' }
],
toQty: [
{ required: true, message: '请输入到数量', trigger: 'blur' }
],
})
export const ContainerDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '主表ID',
field: 'masterId',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '器具号',
field: 'containerNumber',
sort: 'custom',
tableForm: {
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择器具号',
searchField: 'itemCode',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.selectConfigToBalance,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择器具号',
searchField: 'itemCode',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.selectConfigToBalance,
}
}
},
{
label: '来源库位代码',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true,
type: 'Select'
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
disabled: true,
}
}
},
{
label: '目标库位代码',
field: 'toLocationCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择到库位代码',
searchField: 'code',
searchTitle: '库位信息',
searchAllSchemas: Location.allSchemas,
searchPage: LocationApi.selectPageItemAreaToLocation,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择到库位代码',
searchField: 'code',
searchTitle: '库位信息',
searchAllSchemas: Location.allSchemas,
searchPage: LocationApi.selectPageItemAreaToLocation,
}
}
},
{
label: '从库存状态',
field: 'fromInventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
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: '从数量',
// field: 'fromQty',
// sort: 'custom',
// tableForm: {
// disabled: true,
// },
// },
{
label: '到数量',
field: 'toQty',
sort: 'custom',
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true,
type: 'Select'
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
table: {
width: 200
},
isForm: false,
isTableForm: false
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '从货主代码',
field: 'fromOwnerCode',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '到货主代码',
field: 'toOwnerCode',
sort: 'custom',
isForm: false,
isTableForm: false,
isTable: false
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

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

@ -1031,12 +1031,11 @@ export const ProductionreturnRequestDetail = useCrudSchemas(reactive<CrudSchema[
},
{
label: '操作',
hiddenInMain:true,
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 150,
width: 250,
fixed: 'right'
},
isTableForm:false,

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

@ -562,6 +562,9 @@ const submitForm = async (formType, data) => {
data.subList = tableData.value //
// 退 isOK
data.isOK = false // false
data.subList.forEach(item => {
item.productionLineCode = data.productionLineCode
})
try {
if (formType === 'create') {
//

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

@ -552,12 +552,11 @@ export const ProductionreturnRequestDetail = useCrudSchemas(reactive<CrudSchema[
},
{
label: '操作',
hiddenInMain:true,
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 150,
width: 250,
fixed: 'right'
},
isTableForm:false,

20
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptJobMain/index.vue

@ -205,16 +205,16 @@ const butttondata = (row,$index) => {
// defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-job-main:close'}), //
// defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), //
// defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), //
// {
// label: '',
// name: 'mainJobClo',
// hide: isShowMainButton(row, ['1']),
// type: 'primary',
// icon: '',
// color: '',
// hasPermi: 'wms:purchasereceipt-job-main:close',
// link: true //
// }
{
label: '拒收',
name: 'mainJobClo',
hide: isShowMainButton(row, ['1']),
type: 'primary',
icon: '',
color: '',
hasPermi: 'wms:purchasereceipt-job-main:close',
link: true //
}
]
}

5
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/index.vue

@ -267,8 +267,13 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
if(routeName.value.includes('SCP')){
const data = await PurchasereceiptRecordMainApi.exportPurchasereceiptRecordMainSCP(tableObject.params)
download.excel(data, `${t('ts.采购收货记录主')}.xlsx`)
}else{
const data = await PurchasereceiptRecordMainApi.exportPurchasereceiptRecordMain(tableObject.params)
download.excel(data, `${t('ts.采购收货记录主')}.xlsx`)
}
} catch {
} finally {
exportLoading.value = false

42
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue

@ -198,7 +198,7 @@ const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
//console.log("formRef",formRef)
//console.log("supplierCode",formRef.value.formRef.formModel.supplierCode)
console.log("searchTableSuccess",formField, searchField, val, formRef, type, row)
nextTick(() => {
if (type == 'tableForm') {
//
@ -206,7 +206,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
if(formField == 'itemCode') {
row['itemCode'] = val[0]['code']
} else if(formField == 'poNumber') {
row['poNumber'] = val[0]['number']
updateTableData(val)
// row['poNumber'] = val[0]['number']
} else if(formField == 'poLine'){
//--
val.forEach(item=>{
@ -457,6 +459,27 @@ const searchTableSuccess1 = async (formField, searchField, val, formRef, type, r
})
}
const updateTableData = (tableList)=>{
tableList.forEach(row=>{
//poNumber poLine itemCode batch
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row}))
newRow['poLine'] = row['lineNumber']
newRow['itemCode'] = row['itemCode']
newRow['uom'] = row['uom']
newRow['poNumber'] =row['number']
newRow['supplierCode'] =row['supplierCode']
//
newRow['produceDate'] = dayjs().valueOf()
newRow['arriveDate'] = dayjs().valueOf()
//
newRow['batch'] = formatDate(newRow['produceDate'],'YYYYMMDD');
newRow['defaultToLocationCode'] =row['defaultLocation']
if(!tableData.value.find((item:object)=>item.poNumber == newRow.poNumber&&item.itemCode == newRow.itemCode&&item.poLine == newRow.poLine&&item.batch == newRow.batch)){
tableData.value.push(newRow)
}
})
}
const getSearchTableData = async (number,isEnter=false)=>{
const {tableObject ,tableMethods} = useTable({
defaultParams:{number},
@ -470,29 +493,16 @@ const getSearchTableData = async (number,isEnter=false)=>{
item.width = item.table?.width || 150
})
tableData.value = []
updateTableData(tableObject.tableList)
const itemCodes = []
tableObject.tableList.forEach(row=>{
itemCodes.push(row['itemCode'])
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row}))
newRow['poLine'] = row['lineNumber']
newRow['itemCode'] = row['itemCode']
newRow['uom'] = row['uom']
newRow['poNumber'] =row['number']
newRow['supplierCode'] =row['supplierCode']
//
newRow['produceDate'] = dayjs().valueOf()
newRow['arriveDate'] = dayjs().valueOf()
//
newRow['batch'] = formatDate(newRow['produceDate'],'YYYYMMDD');
newRow['defaultToLocationCode'] =row['defaultLocation']
tableData.value.push(newRow)
if(isEnter){
//--
const setV = {}
setV['poNumber'] = number
setV['supplierCode'] = row.supplierCode
formRef.value.formRef.setValues(setV)
}
})
//

6
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRecordMain/index.vue

@ -167,8 +167,14 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
if(routeName.value.includes('SCP')){
const data = await PurchasereturnRecordMainApi.exportPurchasereturnRecordMainSCP(tableObject.params)
download.excel(data, `${t('ts.采购退货记录主')}.xlsx`)
}else{
const data = await PurchasereturnRecordMainApi.exportPurchasereturnRecordMain(tableObject.params)
download.excel(data, `${t('ts.采购退货记录主')}.xlsx`)
}
} catch {
} finally {
exportLoading.value = false

2
src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue

@ -146,7 +146,9 @@ console.log('PurchaseMain.allSchemas.searchSchema',PurchaseMain.allSchemas.searc
if(val.length>0){
//frm
const setV = {}
if(val[0]['supplierCode']!=formRef.formModel.supplierCode){
tableData.value = [] //
}
setV['contactName']=val[0]['contacts']
setV['contactPhone']=val[0]['phone']
setV['contactEmail']=val[0]['email']

4
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue

@ -395,6 +395,7 @@ const handleImport = () => {
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type : string, row ?: number) => {
if(row&&row.procurementCreator) row.procurementCreator = Number(row.procurementCreator)
//
SupplierinvoiceRequestMainApi.checkInvoicingCalendar({}).then(res => {
if(res.flag){
@ -743,6 +744,9 @@ const importSuccess = () => {
let id = res[i];
handleSupplierdeliverRecordPrint(id);
}
}else{
message.warning(t('ts.非SCP订单无法打印'))
return;
}
})
}

66
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

@ -28,6 +28,7 @@ const requestsettingData = data?.list[0] || {}
userDept.id = userDept.id.toString()
const userDeptArray:any = [userDept]
const procurementCreators = await SupplierinvoiceRequestMainApi.queryUserInfoByRoleCode({ roleCode: 'purchase',pageSize: 1000,pageNo: 1,sort: '',by: 'ASC' })
/**
* @returns {Array}
*/
@ -153,7 +154,7 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
{
label: '订单类型',
field: 'orderType',
dictType: DICT_TYPE.PURCHASE_ORDER_TYPE,
dictType: DICT_TYPE.PURCHASE_INVOICE_ORDER_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
@ -514,25 +515,44 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
width: 150
},
isForm: true,
isTable: false,
form: {
// labelMessage: '信息提示说明!!!',
component: 'Select',
api: () => procurementCreators.list,
componentProps: {
isSearchList: true, // 开启查询弹窗
hiddenFilterButton:true,//是否隐藏筛选按钮
dialogWidth:'665px',//搜索出来弹窗的宽度
searchListPlaceholder: '请选择采购员', // 输入框占位文本
searchField: 'id', // 查询弹窗赋值字段
searchTitle: '采购员信息', // 查询弹窗标题
searchAllSchemas: PurchaseMemberInfo.allSchemas, // 查询弹窗所需类
searchPage: SupplierinvoiceRequestMainApi.queryUserInfoByRoleCode, // 查询弹窗所需分页方法
searchCondition: [{
key: 'roleCode', // 查询列表中字段
value: 'purchase', // 指查询具体值
isMainValue: false // 表示查询条件不是主表的字段的值
}]
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
}
},
// labelMessage: '信息提示说明!!!',
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// hiddenFilterButton:true,//是否隐藏筛选按钮
// dialogWidth:'665px',//搜索出来弹窗的宽度
// searchListPlaceholder: '请选择采购员', // 输入框占位文本
// searchField: 'id', // 查询弹窗赋值字段
// searchTitle: '采购员信息', // 查询弹窗标题
// searchAllSchemas: PurchaseMemberInfo.allSchemas, // 查询弹窗所需类
// searchPage: SupplierinvoiceRequestMainApi.queryUserInfoByRoleCode, // 查询弹窗所需分页方法
// searchCondition: [{
// key: 'roleCode', // 查询列表中字段
// value: 'purchase', // 指查询具体值
// isMainValue: false // 表示查询条件不是主表的字段的值
// }]
// }
}
},
{
label: '采购价格审批人',
field: 'procurementCreatorName',
sortTableDefault:1003,
table: {
width: 150
},
isTable:true,
isForm: false,
},
{
label: '采购审批时间',
field: 'procurementCreateTime',
@ -711,6 +731,20 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
}
]))
const singlePriceFormart = (row, column, cellValue) => {
cellValue= Number(cellValue).toFixed(5)
cellValue = cellValue + '' || ''
let x = cellValue.split('.')
let x1 = x[0]
let x2 = x.length > 1 ? '.' + x[1] : ''
const reg = /(\d+)(\d{3})/
while(reg.test(x1)){
x1 = x1.replace(reg, '$1,$2')
}
return x1+x2
}
function validateTaxRate(rule, value, callback) {
if (value>0) {
callback()
@ -893,7 +927,7 @@ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive<CrudSchema[]
{
label: '合同价格',
field: 'singlePrice',
formatter: accountantFormart,
formatter: singlePriceFormart,
table: {
width: 150
},

Loading…
Cancel
Save