222
schangxiang@126.com
2025-05-06 38b161e4d52362081bfe78fb5b51fbf384db7ce2
HIAWms/web/src/widgets/HIAWms/Controllers/WmsMaterial.ts
@@ -10,7 +10,7 @@
  index: number
}
export const useWmsMaterial = (props: any, ctx?: any) => {
  const wmsmaterial = injectModel<WmsMaterial>('wmsmaterial')
  const wmsMaterial = injectModel<WmsMaterial>('wmsMaterial')
  const { exportFile } = useFile()
  /**
   * 头部配置
@@ -19,7 +19,7 @@
  /**
   * 动态列配置
   */
  const wmsmaterialColumns = ref<Record<string, any>>([])
  const wmsMaterialColumns = ref<Record<string, any>>([])
  /**
   * 搜索值
   */
@@ -85,40 +85,40 @@
      divided: true,
      icon: 'o',
    },
    {
      label: '向上添加',
      fn: (c: CurrentType, pageNum: number) => {
        current.value = null
        sort.value = c.index + 1 + (pageNum - 1) * 50
        dialogConfig.visible = true
        dialogConfig.title = '添加'
        dialogConfig.isAdd = false
      },
      divided: true,
      icon: 'up',
    },
    {
      label: '向下添加',
      fn: (c: CurrentType, pageNum: number) => {
        current.value = null
        sort.value = c.index + 2 + (pageNum - 1) * 50
        dialogConfig.visible = true
        dialogConfig.title = '添加'
        dialogConfig.isAdd = false
      },
      divided: true,
      icon: 'down',
    },
    {
      label: '创建副本',
      fn: async ({ row }: CurrentType) => {
        await wmsmaterial.cloneData([row.id])
        ElMessage.success('创建副本成功')
        tableRef.value?.getList()
      },
      divided: true,
      icon: 'copy',
    },
    // {
    //   label: '向上添加',
    //   fn: (c: CurrentType, pageNum: number) => {
    //     current.value = null
    //     sort.value = c.index + 1 + (pageNum - 1) * 50
    //     dialogConfig.visible = true
    //     dialogConfig.title = '添加'
    //     dialogConfig.isAdd = false
    //   },
    //   divided: true,
    //   icon: 'up',
    // },
    // {
    //   label: '向下添加',
    //   fn: (c: CurrentType, pageNum: number) => {
    //     current.value = null
    //     sort.value = c.index + 2 + (pageNum - 1) * 50
    //     dialogConfig.visible = true
    //     dialogConfig.title = '添加'
    //     dialogConfig.isAdd = false
    //   },
    //   divided: true,
    //   icon: 'down',
    // },
    // {
    //   label: '创建副本',
    //   fn: async ({ row }: CurrentType) => {
    //     await wmsMaterial.cloneData([row.id])
    //     ElMessage.success('创建副本成功')
    //     tableRef.value?.getList()
    //   },
    //   divided: true,
    //   icon: 'copy',
    // },
    {
      label: '删除',
      fn: async (c: CurrentType) => {
@@ -127,7 +127,7 @@
          `是否删除${names.length ? names.join(',') : c.row.name}`
        ).then(async () => {
          const ids = selection.value.map((item: { id: string }) => item.id)
          await wmsmaterial.deleteWmsMaterials(ids.length ? ids : [c.row.id])
          await wmsMaterial.deleteWmsMaterials(ids.length ? ids : [c.row.id])
          ElMessage.success('删除成功')
          tableRef.value.getList()
        })
@@ -172,11 +172,7 @@
   */
  const onExport = () => {
    const params = tableRef.value?.getParams()
    exportFile(
      '/api/v1/hiawms/wmsmaterial/export',
      params,
      'hiawms'
    )
    exportFile('/api/v1/hIAWms/wmsMaterial/export', params, 'hIAWms')
  }
  /**
@@ -245,7 +241,7 @@
    current,
    search,
    sort,
    wmsmaterialColumns,
    wmsMaterialColumns,
    paginationParams,
    headers,
    onBeforeUpload,