22
schangxiang@126.com
2025-05-20 5b189017d143be6366f56ffcdd3c3699a381e034
22
已添加23个文件
已修改6个文件
已删除2个文件
4513 ■■■■ 文件已修改
HIAWms/server/src/CMS.Plugin.HIAWms/CMS.Plugin.HIAWms.csproj 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/File.ts 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTask.ts 275 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTaskDrawer.tsx 655 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTaskQueryDrawer.tsx 879 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Models/Service/WorkTask.ts 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Models/Service/WorkTaskDrawer.ts 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Models/Service/WorkTaskQueryDrawer.ts 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Models/WorkTask.ts 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Models/WorkTaskDrawer.ts 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Models/WorkTaskQueryDrawer.ts 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/Dialog/WorkTaskDrawer/WorkTaskDrawer.module.scss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/Dialog/WorkTaskDrawer/WorkTaskDrawer.tsx 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/Dialog/WorkTaskQueryDrawer/WorkTaskQueryDrawer.module.scss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/Dialog/WorkTaskQueryDrawer/WorkTaskQueryDrawer.tsx 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/WorkTask/Config.ts 217 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/WorkTask/WorkTask.module.scss 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/WorkTask/WorkTask.tsx 409 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/WorkTask.module.scss 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/WorkTask.tsx 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/config/WorkTask.json 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/enum.ts 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/index.ts 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/type/type.d.ts 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/CMSPluginDbContext.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/20250515064954_Update1.Designer.cs 673 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/20250515064954_Update1.cs 297 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/CMSPluginDbContextModelSnapshot.cs 305 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Scripts/UpdateMigrations.bat 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Weben_CMS专用代码生成器/Code/Templete/Web/Controllers/EntityModeQueryDrawer模板.txt 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HIAWms/server/src/CMS.Plugin.HIAWms/CMS.Plugin.HIAWms.csproj
@@ -11,7 +11,7 @@
    </PropertyGroup>
    <PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
        <CMSRootPath>D:\syc\CMS Editor</CMSRootPath>
      <CMSRootPath>D:\Program Files\CMS Editor</CMSRootPath>
        <OutputPath>$(CMSRootPath)\plugins\cms.plugin.hiawms</OutputPath>
    </PropertyGroup>
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/File.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
import { importFileToService, exportFileToClient } from '@/api/file'
import { ElMessage } from 'element-plus'
import { downloadFile } from '@/utils'
import dayjs from 'dayjs'
export const useFile = () => {
  /**
   * å¯¼å…¥æ–‡ä»¶
   * @param url
   */
  const importFile = async (url: string, file: File) => {
    const formData = new FormData()
    formData.append('file', file)
    await importFileToService(url, formData)
    ElMessage('导入成功')
  }
  /**
   * å¯¼å‡ºæ–‡ä»¶
   * @param url
   */
  const exportFile = async (url: string, params: any, name: string) => {
    const res = await exportFileToClient(url, params)
    downloadFile(res, `${name}_${dayjs().format('YYYYMMDDHHMMss')}.xlsx`)
    ElMessage.success('导出成功')
  }
  return {
    importFile,
    exportFile,
  }
}
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTask.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,275 @@
import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue'
import { injectModel } from '@/libs/Provider/Provider'
import { WorkTask } from '../Models/WorkTask'
import { ElMessage } from 'element-plus'
import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox'
import { useFile } from './File'
interface CurrentType {
  row: any
  index: number
}
export const useWorkTask = (props: any, ctx?: any) => {
  const workTask = injectModel<WorkTask>('workTask')
  const { exportFile } = useFile()
  /**
   * å¤´éƒ¨é…ç½®
   */
  const headers = ref({})
  /**
   * åŠ¨æ€åˆ—é…ç½®
   */
  const workTaskColumns = ref<Record<string, any>>([])
  /**
   * æœç´¢å€¼
   */
  const search = ref('')
  /**
   * æŽ’序
   */
  const sort = ref(0)
  /**
   * é€‰æ‹©é¡¹
   */
  const selection = ref([])
  /**
   * å½“前选中的行
   */
  const current = ref<any>(null)
  /**
   * æ•°æ®æº
   */
  const dataSource: Ref<any[]> = ref([])
  /**
   * è¡¨æ ¼
   */
  const tableRef = ref()
  const dialogConfig = reactive({
    visible: false,
    title: '',
    isAdd: false,
  })
  const dialogConfigForQuery = reactive({
    visible: false,
    title: '',
    isAdd: false,
  })
  const dialogSettingConfig = reactive({
    visible: false,
    title: '',
  })
  /**
   * åˆ†é¡µæ•°æ®
   */
  const paginationParams = ref({})
  /**
   * æ‰“开详情
   * @param row
   */
  const openDetail = (row: any) => {
    current.value = row
    dialogConfig.visible = true
    dialogConfig.title = row.name
    dialogConfig.isAdd = false
    sort.value = row.sort
  }
  const contextMenu = [
    {
      label: '展开详情',
      fn: (c: CurrentType) => {
        current.value = null
        sort.value = c.row.sort
        nextTick(() => openDetail(c.row))
      },
      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 workTask.cloneData([row.id])
    //     ElMessage.success('创建副本成功')
    //     tableRef.value?.getList()
    //   },
    //   divided: true,
    //   icon: 'copy',
    // },
    {
      label: '删除',
      fn: async (c: CurrentType) => {
        const names = selection.value.map((item: { son_TaskCode: string }) => item.son_TaskCode)
        ConfirmBox(
          `是否删除${names.length ? names.join(',') : c.row.son_TaskCode}`
        ).then(async () => {
          const ids = selection.value.map((item: { id: string }) => item.id)
          await workTask.deleteWorkTasks(ids.length ? ids : [c.row.id])
          ElMessage.success('删除成功')
          tableRef.value.getList()
        })
      },
      icon: 'close',
    },
  ]
  const onCheck = (records: any) => {
    selection.value = records
  }
  const onAddWorkTask = () => {
    const params = tableRef.value?.getPaginationParams()
    current.value = null
    dialogConfig.visible = true
    dialogConfig.isAdd = true
    dialogConfig.title = '添加'
    sort.value = params.totalCount + 1
  }
  //点击按钮【高级查询】
  const onAdvancedQuery = () => {
    const params = tableRef.value?.getPaginationParams()
    current.value = null
    dialogConfigForQuery.visible = true
    dialogConfigForQuery.isAdd = true
    dialogConfigForQuery.title = '高级查询'
  }
  const onConfirmWorkTask = async () => {
    dialogConfig.visible = false
    if (dialogConfig.isAdd) {
      tableRef.value?.scrollToRow({
        skip: true,
      })
    } else {
      await tableRef.value?.getList()
    }
  }
  /**
   * è¡Œç‚¹å‡»æ—¶æ›´æ–°current
   */
  const onRowClick = ({ row }: any) => {
    if (dialogConfig.visible && current.value) {
      current.value = row
    }
  }
  /**
   * å¯¼å‡º
   */
  const onExport = (data={}) => {
    //const params = tableRef.value?.getParams()
    exportFile('/api/v1/PipeLineLems/workTask/export', data, '作业任务')
  }
  /**
   * å…³é”®å­—搜索
   */
  const onSearch = () => {
    tableRef.value?.getList({
      Filter: search.value,
    })
  }
  /**
   * é‡ç½®è¡¨æ ¼æ•°æ®
   */
  const reloadList = () => {
    tableRef.value?.getList()
  }
  /**
   * ä¸Šä¼ æˆåŠŸ
   */
  const onSuccess = () => {
    tableRef.value?.getList()
    ElMessage.success('导入成功')
  }
  /**
   * å¤±è´¥
   * @param err
   */
  const onError = (err: any) => {
    try {
      const message = JSON.parse(err.message)
      ElMessage.error(message.msg)
    } catch (error) {
      ElMessage.error('导入失败')
    }
  }
  /**
   * ä¸Šä¼ é’©å­
   */
  const onBeforeUpload = (file: File) => {
    const format = ['xlsx', 'xls', 'csv']
    if (!format.includes(file.name.split('.')[1])) {
      ElMessage.error('导入文件格式不正确,请导入.xlsx/.xls与.csv格式的文件')
      return false
    }
    return true
  }
  onMounted(() => {
    headers.value = {
      Authorization: `Bearer ${sessionStorage.getItem('Token')}`,
      'X-Project': sessionStorage.getItem('X-Project'),
    }
  })
  ctx.expose({
    reloadList,
  })
  return {
    dataSource,
    contextMenu,
    dialogConfig,
    dialogConfigForQuery,
    dialogSettingConfig,
    tableRef,
    current,
    search,
    sort,
    workTaskColumns,
    paginationParams,
    headers,
    onBeforeUpload,
    onError,
    onSuccess,
    openDetail,
    onSearch,
    onExport,
    onRowClick,
    onConfirmWorkTask,
    onCheck,
    onAddWorkTask,
    onAdvancedQuery
  }
}
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTaskDrawer.tsx
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,655 @@
import {
  ref,
  onMounted,
  reactive,
  computed,
  Ref,
  watch,
  SetupContext,
  h,
} from 'vue'
import { injectModel } from '@/libs/Provider/Provider'
import { WorkTaskDrawer } from '../Models/WorkTaskDrawer'
import { ElMessage } from 'element-plus'
import isEqual from 'lodash/isEqual'
import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox'
import { cloneDeep } from 'lodash'
// å¼•入公共选项配置
import {
  BOOLEAN_OPTIONS_AddEdit
} from '@/utils/commonOptionConstants';
export const useWorkTaskDrawer = (props: any, ctx?: any) => {
  const workTaskDrawer = injectModel<WorkTaskDrawer>('workTaskDrawer')
  /**
   * ç”¨æ¥å¯¹æ¯”的初始化数据
   */
  const initiateData: Ref<Record<string, any>> = ref({})
  const formData = ref<Record<string, any>>({})
  // ref
  const formRef = ref()
  const disabled = ref(false)
  const current = computed(() => {
    return props.row || null
  })
  const datePicker = (attrs) => {
    return (
      <el-date-picker
        type="date"
        format="YYYY-MM-DD HH:mm:ss"
        formatValue="YYYY-MM-DD HH:mm:ss"
        {...attrs}
      ></el-date-picker>
    )
  }
  const inputNumber = (attrs) => {
    return (
      <el-input-number
        min="1"
        step="1"
        precision="0"
        {...attrs}
      ></el-input-number>
    )
  }
  const dateTimePicker = (attrs) => {
    return (
      <el-date-picker
        type="datetime"
        format="YYYY-MM-DD HH:mm:ss"
        formatValue="YYYY-MM-DD HH:mm:ss"
        {...attrs}
      ></el-date-picker>
    )
  }
  const visible = computed({
    get() {
      return props.modelValue
    },
    set(val) {
      ctx.emit('update:modelValue', val)
    },
  })
  /**
   * æ·»åŠ çš„form字段
   */
  const formItems = reactive([
                    {
                   label: '子任务编码',
                   prop: 'son_TaskCode',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入子任务编码',
              rules: [{required: true, message: '子任务编码不能为空', trigger: 'blur' }],
                },
                {
                   label: '任务编码',
                   prop: 'taskCode',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入任务编码',
              rules: [{required: true, message: '任务编码不能为空', trigger: 'blur' }],
                },
                {
                   label: '计划状态',
                   prop: 'workPlanStatus',
                   el: 'select',
                   clearable:true,
                   options: [],
                   //disabled: disabled,
                   placeholder: '请输入计划状态',
              rules: [{required: true, message: '计划状态不能为空', trigger: 'blur' }],
                },
                {
                   label: '叫料状态',
                   prop: 'callMaterialStatus',
                   el: 'select',
                   clearable:true,
                   options: [],
                   //disabled: disabled,
                   placeholder: '请输入叫料状态',
              rules: [{required: true, message: '叫料状态不能为空', trigger: 'blur' }],
                },
                {
                   label: '原料标识',
                   prop: 'dataIdentifier',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入原料标识',
                },
                {
                   label: '原料型号',
                   prop: 'materialMode',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入原料型号',
                },
                {
                   label: '长度(mm)',
                   prop: 'length',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(inputNumber, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   step: 0.01,
                   precision: 2,
                   //disabled: disabled,
                   placeholder: '请输入长度(mm)',
              rules: [{required: true, message: '长度(mm)不能为空', trigger: 'blur' }],
                },
                {
                   label: '打码内容',
                   prop: 'markingContent',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入打码内容',
                },
                {
                   label: '打码位置',
                   prop: 'markingPosition',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(inputNumber, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   step: 0.01,
                   precision: 2,
                   //disabled: disabled,
                   placeholder: '请输入打码位置',
              rules: [{required: true, message: '打码位置不能为空', trigger: 'blur' }],
                },
                {
                   label: '切割位置',
                   prop: 'cuttingPosition',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(inputNumber, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   step: 0.01,
                   precision: 2,
                   //disabled: disabled,
                   placeholder: '请输入切割位置',
              rules: [{required: true, message: '切割位置不能为空', trigger: 'blur' }],
                },
                {
                   label: '管段数量',
                   prop: 'quantity',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(inputNumber, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   step: 1,
                   precision: 0,
                   //disabled: disabled,
                   placeholder: '请输入管段数量',
              rules: [{required: true, message: '管段数量不能为空', trigger: 'blur' }],
                },
                {
                   label: '法兰厚度(mm)',
                   prop: 'flangeThickness',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(inputNumber, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   step: 0.01,
                   precision: 2,
                   //disabled: disabled,
                   placeholder: '请输入法兰厚度(mm)',
              rules: [{required: true, message: '法兰厚度(mm)不能为空', trigger: 'blur' }],
                },
                {
                   label: '法兰直径(mm)',
                   prop: 'flangeInnerDiameter',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(inputNumber, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   step: 0.01,
                   precision: 2,
                   //disabled: disabled,
                   placeholder: '请输入法兰直径(mm)',
              rules: [{required: true, message: '法兰直径(mm)不能为空', trigger: 'blur' }],
                },
                {
                   label: '法兰公称压力',
                   prop: 'weldingHeatInput',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入法兰公称压力',
                },
                {
                   label: '法兰冲码内容',
                   prop: 'pipeAllowableStress',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入法兰冲码内容',
                },
                {
                   label: '套管长度(mm)',
                   prop: 'pipeDiameter',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(inputNumber, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   step: 0.01,
                   precision: 2,
                   //disabled: disabled,
                   placeholder: '请输入套管长度(mm)',
              rules: [{required: true, message: '套管长度(mm)不能为空', trigger: 'blur' }],
                },
                {
                   label: '套管直径(mm)',
                   prop: 'pipeWallThickness',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(inputNumber, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   step: 0.01,
                   precision: 2,
                   //disabled: disabled,
                   placeholder: '请输入套管直径(mm)',
              rules: [{required: true, message: '套管直径(mm)不能为空', trigger: 'blur' }],
                },
                {
                   label: '工厂代码',
                   prop: 'factoryCode',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入工厂代码',
                },
                {
                   label: '产品代码',
                   prop: 'productCode',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入产品代码',
                },
                {
                   label: '工位代码',
                   prop: 'workstationCode',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入工位代码',
                },
                {
                   label: '设备代码',
                   prop: 'equipmentCode',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入设备代码',
                },
                {
                   label: '产线编码',
                   prop: 'prodLineCode',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入产线编码',
                },
                {
                   label: '船号',
                   prop: 'shipNumber',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入船号',
                },
                {
                   label: '项目号',
                   prop: 'projectNumber',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入项目号',
                },
                {
                   label: '工序名称',
                   prop: 'processName',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入工序名称',
                },
                {
                   label: '管件编码',
                   prop: 'pipeFittingCode',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入管件编码',
                },
                {
                   label: '顺序号',
                   prop: 'preSerialNumber',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入顺序号',
                },
                {
                   label: '管段编码',
                   prop: 'pipeSpecCode',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入管段编码',
                },
                {
                   label: '管段名称',
                   prop: 'pipeSectionName',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入管段名称',
                },
                {
                   label: '外径(mm)',
                   prop: 'outerDiameter',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(inputNumber, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   step: 0.01,
                   precision: 2,
                   //disabled: disabled,
                   placeholder: '请输入外径(mm)',
              rules: [{required: true, message: '外径(mm)不能为空', trigger: 'blur' }],
                },
                {
                   label: '壁厚(mm)',
                   prop: 'thickness',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(inputNumber, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   step: 0.01,
                   precision: 2,
                   //disabled: disabled,
                   placeholder: '请输入壁厚(mm)',
              rules: [{required: true, message: '壁厚(mm)不能为空', trigger: 'blur' }],
                },
                {
                   label: '材质',
                   prop: 'material',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入材质',
                },
                {
                   label: '工艺流向编号',
                   prop: 'processRouteNumber',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入工艺流向编号',
                },
                {
                   label: '计划开始时间',
                   prop: 'plannedStartTime',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(datePicker, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   //disabled: disabled,
                   placeholder: '请输入计划开始时间',
                },
                {
                   label: '计划完成时间',
                   prop: 'plannedEndTime',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(datePicker, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   //disabled: disabled,
                   placeholder: '请输入计划完成时间',
                },
                {
                   label: '班组信息',
                   prop: 'teamInfo',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入班组信息',
                },
                {
                   label: '时间戳',
                   prop: 'timestamp',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入时间戳',
                },
                {
                   label: '备注',
                   prop: 'remark',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入备注',
                },
  ])
  /**
   * æ ¡éªŒæ˜¯å¦æœ‰æ•°æ®å˜åŒ–
   */
  const checkIsEqualObject = () => {
    const data = {
      formData: formData.value,
    }
    const check = isEqual(initiateData.value, data)
    return check
  }
  const onClose = (done: () => void) => {
    if (visible.value) {
      if (checkIsEqualObject()) {
        visible.value = false
        done && done()
      } else {
        ConfirmBox('是否保存设置?')
          .then(() => {
            onConfirm()
          })
          .catch(() => {
            visible.value = false
            done && done()
          })
      }
    }
  }
  /**
   * ä¿å­˜
   */
  const onConfirm = async () => {
    await formRef.value?.validate()
    const data = {
      son_TaskCode: formData.value.son_TaskCode,
taskCode: formData.value.taskCode,
workPlanStatus: formData.value.workPlanStatus,
callMaterialStatus: formData.value.callMaterialStatus,
dataIdentifier: formData.value.dataIdentifier,
materialMode: formData.value.materialMode,
length: formData.value.length,
markingContent: formData.value.markingContent,
markingPosition: formData.value.markingPosition,
cuttingPosition: formData.value.cuttingPosition,
quantity: formData.value.quantity,
flangeThickness: formData.value.flangeThickness,
flangeInnerDiameter: formData.value.flangeInnerDiameter,
weldingHeatInput: formData.value.weldingHeatInput,
pipeAllowableStress: formData.value.pipeAllowableStress,
pipeDiameter: formData.value.pipeDiameter,
pipeWallThickness: formData.value.pipeWallThickness,
factoryCode: formData.value.factoryCode,
productCode: formData.value.productCode,
workstationCode: formData.value.workstationCode,
equipmentCode: formData.value.equipmentCode,
prodLineCode: formData.value.prodLineCode,
shipNumber: formData.value.shipNumber,
projectNumber: formData.value.projectNumber,
processName: formData.value.processName,
pipeFittingCode: formData.value.pipeFittingCode,
preSerialNumber: formData.value.preSerialNumber,
pipeSpecCode: formData.value.pipeSpecCode,
pipeSectionName: formData.value.pipeSectionName,
outerDiameter: formData.value.outerDiameter,
thickness: formData.value.thickness,
material: formData.value.material,
processRouteNumber: formData.value.processRouteNumber,
plannedStartTime: formData.value.plannedStartTime,
plannedEndTime: formData.value.plannedEndTime,
teamInfo: formData.value.teamInfo,
timestamp: formData.value.timestamp,
remark: formData.value.remark,
    }
    if (!current.value) {
      await workTaskDrawer.addWorkTask(data)
    } else {
      const id = current.value.id
      await workTaskDrawer.updateWorkTask(id, data)
    }
    ElMessage.success('保存成功')
    ctx.emit('confirm')
  }
  const updateCheckData = () => {
    initiateData.value = {
      formData: {
        ...formData.value,
      },
    }
  }
  const updateFormItemOptions = (propName: string, enumData: any[]) => {
    const item = formItems.find((item) => item.prop === propName)
    if (item && enumData) {
      item.options = enumData.map((item) => ({
        label: item.description,
        value: item.value,
      }))
    }
  }
  /**
   * é€šç”¨æŸ¥è¯¢æžšä¸¾
   */
  const commonQueryEnumForFrom = async () => {
    const workPlanStatusEnumEnum = await workTaskDrawer.getWmsEnumData({
 EnumName: 'WorkPlanStatusEnum',
})
updateFormItemOptions('workPlanStatus', workPlanStatusEnumEnum)
const callMaterialStatusEnumEnum = await workTaskDrawer.getWmsEnumData({
 EnumName: 'CallMaterialStatusEnum',
})
updateFormItemOptions('callMaterialStatus', callMaterialStatusEnumEnum)
  }
  commonQueryEnumForFrom()
  /**
   * å¼¹çª—打开获取详情
   */
  const onOpen = async () => {
    if (current.value) {
      const res = await workTaskDrawer.getWorkTaskDetail(current.value)
      formData.value = {
        son_TaskCode: res.son_TaskCode,
taskCode: res.taskCode,
workPlanStatus: res.workPlanStatus,
callMaterialStatus: res.callMaterialStatus,
dataIdentifier: res.dataIdentifier,
materialMode: res.materialMode,
length: res.length,
markingContent: res.markingContent,
markingPosition: res.markingPosition,
cuttingPosition: res.cuttingPosition,
quantity: res.quantity,
flangeThickness: res.flangeThickness,
flangeInnerDiameter: res.flangeInnerDiameter,
weldingHeatInput: res.weldingHeatInput,
pipeAllowableStress: res.pipeAllowableStress,
pipeDiameter: res.pipeDiameter,
pipeWallThickness: res.pipeWallThickness,
factoryCode: res.factoryCode,
productCode: res.productCode,
workstationCode: res.workstationCode,
equipmentCode: res.equipmentCode,
prodLineCode: res.prodLineCode,
shipNumber: res.shipNumber,
projectNumber: res.projectNumber,
processName: res.processName,
pipeFittingCode: res.pipeFittingCode,
preSerialNumber: res.preSerialNumber,
pipeSpecCode: res.pipeSpecCode,
pipeSectionName: res.pipeSectionName,
outerDiameter: res.outerDiameter,
thickness: res.thickness,
material: res.material,
processRouteNumber: res.processRouteNumber,
plannedStartTime: res.plannedStartTime,
plannedEndTime: res.plannedEndTime,
teamInfo: res.teamInfo,
timestamp: res.timestamp,
remark: res.remark,
        id: res.id,
      }
      disabled.value = true
      updateCheckData()
    } else {
      formData.value = {}
      disabled.value = false
      updateCheckData()
    }
  }
  watch(() => current.value, onOpen)
  return {
    formItems,
    formData,
    visible,
    formRef,
    onOpen,
    onClose,
    onConfirm,
  }
}
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTaskQueryDrawer.tsx
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,879 @@
import {
  ref,
  onMounted,
  reactive,
  computed,
  Ref,
  watch,
  SetupContext,
  h,
} from 'vue'
import { injectModel } from '@/libs/Provider/Provider'
import { WorkTaskDrawer } from '../Models/WorkTaskDrawer'
import { ElMessage } from 'element-plus'
import isEqual from 'lodash/isEqual'
import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox'
import { cloneDeep } from 'lodash'
// å¼•入公共选项配置
import {
  FILTER_MODE_OPTIONS_STRING,
  FILTER_MODE_OPTIONS_NUM,
  FILTER_MODE_OPTIONS_BOOL
} from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions';
// å¼•入公共表单工具文件
import { collectFormDataForHighQuery,onResetForHighSelect,onResetForHighQuery } from '@/utils/myformUtils';
import {
  BOOLEAN_OPTIONS
} from '@/utils/commonOptionConstants';
export const useWorkTaskQueryDrawer = (props: any, ctx?: any) => {
  const workTaskDrawer = injectModel<WorkTaskDrawer>('WorkTaskDrawer')
  /**
   * ç”¨æ¥å¯¹æ¯”的初始化数据
   */
  const initiateData: Ref<Record<string, any>> = ref({})
  const formData = ref<Record<string, any>>({})
  // ref
  const formRef = ref()
  const disabled = ref(false)
  const current = computed(() => {
    return props.row || null
  })
  const inputNumber = (attrs) => {
    return (
      <el-input-number
        min="1"
        step="1"
        precision="0"
        {...attrs}
      ></el-input-number>
    )
  }
    const datePickerRange = (attrs) => {
    return (
      <el-date-picker
        type="daterange"
        value-format="YYYY-MM-DD HH:mm:ss"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        {...attrs}
      ></el-date-picker>
    )
  }
  const dateTimePickerRange = (attrs) => {
    return (
      <el-date-picker
        type="datetimerange"
        value-format="YYYY-MM-DD HH:mm:ss"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        {...attrs}
      ></el-date-picker>
    )
  }
  const visible = computed({
    get() {
      return props.modelValue
    },
    set(val) {
      ctx.emit('update:modelValue', val)
    },
  })
  /**
   * é«˜çº§æŸ¥è¯¢çš„form字段
   */
  const formItems = reactive([
                    {
                   label: '子任务编码',
                   prop: 'son_TaskCode',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入子任务编码',
                   highSelectAttrs:{
                     prop: 'son_TaskCode_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '任务编码',
                   prop: 'taskCode',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入任务编码',
                   highSelectAttrs:{
                     prop: 'taskCode_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '计划状态',
                   prop: 'workPlanStatus',
                   el: 'select',
                   clearable:true,
                   option: [],
                   //disabled: disabled,
                   placeholder: '请输入计划状态',
                   highSelectAttrs:{
                     prop: 'workPlanStatus_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_BOOL
                   }
                },
                {
                   label: '叫料状态',
                   prop: 'callMaterialStatus',
                   el: 'select',
                   clearable:true,
                   option: [],
                   //disabled: disabled,
                   placeholder: '请输入叫料状态',
                   highSelectAttrs:{
                     prop: 'callMaterialStatus_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_BOOL
                   }
                },
                {
                   label: '原料标识',
                   prop: 'dataIdentifier',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入原料标识',
                   highSelectAttrs:{
                     prop: 'dataIdentifier_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '原料型号',
                   prop: 'materialMode',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入原料型号',
                   highSelectAttrs:{
                     prop: 'materialMode_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '长度(mm)',
                   prop: 'length',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(inputNumber, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   step: 0.01,
                   precision: 2,
                   //disabled: disabled,
                   placeholder: '请输入长度(mm)',
                   highSelectAttrs:{
                     prop: 'length_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_NUM
                   }
                },
                {
                   label: '打码内容',
                   prop: 'markingContent',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入打码内容',
                   highSelectAttrs:{
                     prop: 'markingContent_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '打码位置',
                   prop: 'markingPosition',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(inputNumber, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   step: 0.01,
                   precision: 2,
                   //disabled: disabled,
                   placeholder: '请输入打码位置',
                   highSelectAttrs:{
                     prop: 'markingPosition_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_NUM
                   }
                },
                {
                   label: '切割位置',
                   prop: 'cuttingPosition',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(inputNumber, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   step: 0.01,
                   precision: 2,
                   //disabled: disabled,
                   placeholder: '请输入切割位置',
                   highSelectAttrs:{
                     prop: 'cuttingPosition_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_NUM
                   }
                },
                {
                   label: '管段数量',
                   prop: 'quantity',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(inputNumber, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   step: 1,
                   precision: 0,
                   //disabled: disabled,
                   placeholder: '请输入管段数量',
                   highSelectAttrs:{
                     prop: 'quantity_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_NUM
                   }
                },
                {
                   label: '法兰厚度(mm)',
                   prop: 'flangeThickness',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(inputNumber, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   step: 0.01,
                   precision: 2,
                   //disabled: disabled,
                   placeholder: '请输入法兰厚度(mm)',
                   highSelectAttrs:{
                     prop: 'flangeThickness_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_NUM
                   }
                },
                {
                   label: '法兰直径(mm)',
                   prop: 'flangeInnerDiameter',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(inputNumber, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   step: 0.01,
                   precision: 2,
                   //disabled: disabled,
                   placeholder: '请输入法兰直径(mm)',
                   highSelectAttrs:{
                     prop: 'flangeInnerDiameter_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_NUM
                   }
                },
                {
                   label: '法兰公称压力',
                   prop: 'weldingHeatInput',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入法兰公称压力',
                   highSelectAttrs:{
                     prop: 'weldingHeatInput_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '法兰冲码内容',
                   prop: 'pipeAllowableStress',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入法兰冲码内容',
                   highSelectAttrs:{
                     prop: 'pipeAllowableStress_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '套管长度(mm)',
                   prop: 'pipeDiameter',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(inputNumber, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   step: 0.01,
                   precision: 2,
                   //disabled: disabled,
                   placeholder: '请输入套管长度(mm)',
                   highSelectAttrs:{
                     prop: 'pipeDiameter_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_NUM
                   }
                },
                {
                   label: '套管直径(mm)',
                   prop: 'pipeWallThickness',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(inputNumber, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   step: 0.01,
                   precision: 2,
                   //disabled: disabled,
                   placeholder: '请输入套管直径(mm)',
                   highSelectAttrs:{
                     prop: 'pipeWallThickness_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_NUM
                   }
                },
                {
                   label: '工厂代码',
                   prop: 'factoryCode',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入工厂代码',
                   highSelectAttrs:{
                     prop: 'factoryCode_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '产品代码',
                   prop: 'productCode',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入产品代码',
                   highSelectAttrs:{
                     prop: 'productCode_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '工位代码',
                   prop: 'workstationCode',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入工位代码',
                   highSelectAttrs:{
                     prop: 'workstationCode_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '设备代码',
                   prop: 'equipmentCode',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入设备代码',
                   highSelectAttrs:{
                     prop: 'equipmentCode_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '产线编码',
                   prop: 'prodLineCode',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入产线编码',
                   highSelectAttrs:{
                     prop: 'prodLineCode_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '船号',
                   prop: 'shipNumber',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入船号',
                   highSelectAttrs:{
                     prop: 'shipNumber_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '项目号',
                   prop: 'projectNumber',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入项目号',
                   highSelectAttrs:{
                     prop: 'projectNumber_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '工序名称',
                   prop: 'processName',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入工序名称',
                   highSelectAttrs:{
                     prop: 'processName_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '管件编码',
                   prop: 'pipeFittingCode',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入管件编码',
                   highSelectAttrs:{
                     prop: 'pipeFittingCode_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '顺序号',
                   prop: 'preSerialNumber',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入顺序号',
                   highSelectAttrs:{
                     prop: 'preSerialNumber_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '管段编码',
                   prop: 'pipeSpecCode',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入管段编码',
                   highSelectAttrs:{
                     prop: 'pipeSpecCode_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '管段名称',
                   prop: 'pipeSectionName',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入管段名称',
                   highSelectAttrs:{
                     prop: 'pipeSectionName_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '外径(mm)',
                   prop: 'outerDiameter',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(inputNumber, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   step: 0.01,
                   precision: 2,
                   //disabled: disabled,
                   placeholder: '请输入外径(mm)',
                   highSelectAttrs:{
                     prop: 'outerDiameter_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_NUM
                   }
                },
                {
                   label: '壁厚(mm)',
                   prop: 'thickness',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(inputNumber, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   step: 0.01,
                   precision: 2,
                   //disabled: disabled,
                   placeholder: '请输入壁厚(mm)',
                   highSelectAttrs:{
                     prop: 'thickness_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_NUM
                   }
                },
                {
                   label: '材质',
                   prop: 'material',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入材质',
                   highSelectAttrs:{
                     prop: 'material_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '工艺流向编号',
                   prop: 'processRouteNumber',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入工艺流向编号',
                   highSelectAttrs:{
                     prop: 'processRouteNumber_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '计划开始时间',
                   prop: 'plannedStartTime',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(dateTimePickerRange, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   //disabled: disabled,
                   placeholder: '请输入计划开始时间',
                   isDateControl: true, // æ˜¾å¼æ ‡è®°ä¸ºæ—¥æœŸæŽ§ä»¶
                },
                {
                   label: '计划完成时间',
                   prop: 'plannedEndTime',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(dateTimePickerRange, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   //disabled: disabled,
                   placeholder: '请输入计划完成时间',
                   isDateControl: true, // æ˜¾å¼æ ‡è®°ä¸ºæ—¥æœŸæŽ§ä»¶
                },
                {
                   label: '班组信息',
                   prop: 'teamInfo',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入班组信息',
                   highSelectAttrs:{
                     prop: 'teamInfo_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '时间戳',
                   prop: 'timestamp',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入时间戳',
                   highSelectAttrs:{
                     prop: 'timestamp_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '创建时间',
                   prop: 'creationTime',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(dateTimePickerRange, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   //disabled: disabled,
                   placeholder: '请输入创建时间',
                   isDateControl: true, // æ˜¾å¼æ ‡è®°ä¸ºæ—¥æœŸæŽ§ä»¶
                },
                {
                   label: '修改时间',
                   prop: 'lastModificationTime',
                   el: (props: any, { attrs }: SetupContext) => {
                     return h(dateTimePickerRange, {
                       ...props,
                       clearable: true,
                       ...attrs,
                     })
                   },
                   width: '100%',
                   //disabled: disabled,
                   placeholder: '请输入修改时间',
                   isDateControl: true, // æ˜¾å¼æ ‡è®°ä¸ºæ—¥æœŸæŽ§ä»¶
                },
                {
                   label: '创建人',
                   prop: 'creatorName',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入创建人',
                   highSelectAttrs:{
                     prop: 'creatorName_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '修改人',
                   prop: 'lastModifierName',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入修改人',
                   highSelectAttrs:{
                     prop: 'lastModifierName_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
                {
                   label: '备注',
                   prop: 'remark',
                   el: 'input',
                   //disabled: disabled,
                   placeholder: '请输入备注',
                   highSelectAttrs:{
                     prop: 'remark_FilterMode',
                     el: 'select',
                     placeholder: '请选择',
                     options:FILTER_MODE_OPTIONS_STRING
                   }
                },
  ])
  /**
   * æ ¡éªŒæ˜¯å¦æœ‰æ•°æ®å˜åŒ–
   */
  const checkIsEqualObject = () => {
    const data = {
      formData: formData.value,
    }
    const check = isEqual(initiateData.value, data)
    return check
  }
//   /**
//  * èŽ·å–è¡¨å•æ•°æ® - ä¼˜åŒ–版
//  */
// const commonGetFormData = () => {
//   const data = {};
//   // éåŽ†è¡¨å•é…ç½®æ”¶é›†æ•°æ®
//   formItems.forEach(item => {
//     // æ”¶é›†åŸºç¡€å­—段
//     data[item.prop] = formData.value[item.prop] || '';
//     // æ”¶é›†è¿‡æ»¤æ¨¡å¼å­—段
//     if (item.highSelectAttrs && item.highSelectAttrs.prop) {
//       const filterModeProp = item.highSelectAttrs.prop;
//       data[filterModeProp] = formData.value[filterModeProp] || '';
//     }
//   });
//   return data;
// }
  const onClose = (done: () => void) => {
    if (visible.value) {
      visible.value = false
      const data =collectFormDataForHighQuery(formItems,formData);
      ctx.emit('close', data)
    }
  }
  /**
   * ç¡®è®¤æŸ¥è¯¢
   */
  const onConfirmQuery = async () => {
    const data =collectFormDataForHighQuery(formItems,formData);
    ctx.emit('confirmQuery', data)
  }
  // /**
  //  * é‡ç½®å…¬å…±select查询
  //  */
  // const onResetForHighSelect = () => {
  //     // éåŽ†æ‰€æœ‰è¡¨å•å­—æ®µ
  //     formItems.forEach(item => {
  //       // æ£€æŸ¥å­—段是否有高级查询的过滤模式配置
  //       if (item.highSelectAttrs && item.highSelectAttrs.prop) {
  //         const filterModeProp = item.highSelectAttrs.prop;
  //         const options = item.highSelectAttrs.options || [];
  //         // å¦‚果存在选项,则设置为第一个选项的值
  //         if (options.length > 0) {
  //           // å‡è®¾é€‰é¡¹æ ¼å¼ä¸º { value, label } æˆ–类似结构
  //           const firstValue = options[0].value !== undefined ? options[0].value : options[0];
  //           formData.value[filterModeProp] = firstValue;
  //         }
  //       }
  //     });
  // }
    /**
    * é‡ç½®æŸ¥è¯¢ - ä¼˜åŒ–版
    */
    const onReset = async () => {
        // // 1. æ¸…空所有基础字段(不包含过滤模式字段)
        // const baseFields = formItems.reduce((acc, item) => {
        // acc[item.prop] = '';
        // return acc;
        // }, {});
        // // 2. åº”用基础字段初始值
        // formData.value = { ...baseFields };
        onResetForHighQuery(formItems,formData);
        // 3. ä½¿ç”¨åŽŸæœ‰æ–¹æ³•é‡ç½®è¿‡æ»¤æ¨¡å¼å­—æ®µ
        onResetForHighSelect(formItems,formData); // ä¿ç•™åŽŸæœ‰æ–¹æ³•è°ƒç”¨
        // 4. å‘父组件发送自定义事件
        ctx.emit('restQuery');
    }
  const updateCheckData = () => {
    initiateData.value = {
      formData: {
        ...formData.value,
      },
    }
  }
  const updateFormItemOptions = (propName: string, enumData: any[]) => {
    const item = formItems.find((item) => item.prop === propName)
    if (item && enumData) {
      item.options = enumData.map((item) => ({
        label: item.description,
        value: item.value,
      }))
    }
  }
  /**
   * é€šç”¨æŸ¥è¯¢æžšä¸¾
   */
  const commonQueryEnumForFrom = async () => {
    const workPlanStatusEnumEnum = await workTaskDrawer.getWmsEnumData({
 EnumName: 'WorkPlanStatusEnum',
})
updateFormItemOptions('workPlanStatus', workPlanStatusEnumEnum)
const callMaterialStatusEnumEnum = await workTaskDrawer.getWmsEnumData({
 EnumName: 'CallMaterialStatusEnum',
})
updateFormItemOptions('callMaterialStatus', callMaterialStatusEnumEnum)
  }
  commonQueryEnumForFrom()
  onResetForHighSelect(formItems,formData);//重置公共select查询
  /**
   * å¼¹çª—打开获取详情
   */
  const onOpen = async () => {
    disabled.value = false
    updateCheckData()
  }
  watch(() => current.value, onOpen)
  return {
    formItems,
    formData,
    visible,
    formRef,
    onOpen,
    onClose,
    onConfirmQuery,
    onReset,
  }
}
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Models/Service/WorkTask.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,30 @@
import { Base } from '@/libs/Base/Base'
const request = Base.request
/**
 * æ·»åŠ 
 * @returns
 */
export const addWorkTask = (data: any) => {
  return request.post('/api/v1/PipeLineLems/workTask', data)
}
/**
 * æ‰¹é‡åˆ é™¤
 * @returns
 */
export const deleteWorkTasks = (ids: string[]) => {
  return request({
    data: ids,
    url: '/api/v1/PipeLineLems/workTask',
    method: 'delete',
  })
}
/**
 * å…‹éš†
 * @returns
 */
export const cloneData = (data: any) => {
  return request.post('/api/v1/PipeLineLems/workTask/clone', data)
}
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Models/Service/WorkTaskDrawer.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,34 @@
import { Base } from '@/libs/Base/Base'
const request = Base.request
/**
 * æ·»åŠ 
 * @returns
 */
export const addWorkTask = (data: any) => {
  return request.post('/api/v1/PipeLineLems/workTask', data)
}
/**
 * èŽ·å–è¯¦æƒ…
 * @returns
 */
export const getWorkTask = (id: string) => {
  return request.get(`/api/v1/PipeLineLems/workTask/${id}`)
}
/**
 * æ›´æ–°
 * @returns
 */
export const updateWorkTask = (id: string, data: Record<string, any>) => {
  return request.put(`/api/v1/PipeLineLems/workTask/${id}`, data)
}
/**
 * èŽ·å–æžšä¸¾
 * @returns
 */
export const getWmsEnumData = (data: any) => {
  return request.post('/api/v1/WareCmsUtilityApi/WmsEnum', data)
}
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Models/Service/WorkTaskQueryDrawer.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,35 @@
import { Base } from '@/libs/Base/Base'
const request = Base.request
/**
 * æ·»åŠ 
 * @returns
 */
export const addWorkTask = (data: any) => {
  return request.post('/api/v1/PipeLineLems/workTask', data)
}
/**
 * èŽ·å–è¯¦æƒ…
 * @returns
 */
export const getWorkTask = (id: string) => {
  return request.get(`/api/v1/PipeLineLems/workTask/${id}`)
}
/**
 * æ›´æ–°
 * @returns
 */
export const updateWorkTask = (id: string, data: Record<string, any>) => {
  return request.put(`/api/v1/PipeLineLems/workTask/${id}`, data)
}
/**
 * èŽ·å–æžšä¸¾
 * @returns
 */
export const getWmsEnumData = (data: any) => {
  return request.post('/api/v1/WareCmsUtilityApi/WmsEnum', data)
}
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Models/WorkTask.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,41 @@
import { Base } from '@/libs/Base/Base'
import {
  deleteWorkTasks,
  addWorkTask,
  cloneData,
} from './Service/WorkTask'
export class WorkTask extends Base<{ [key: string]: any }> {
  constructor() {
    super({
      data: [],
    })
  }
  onMounted() {}
  /**
   * åˆ é™¤
   * @param id
   * @returns
   */
  async deleteWorkTasks(ids: string[]) {
    return deleteWorkTasks(ids)
  }
  /**
   * æ·»åŠ æ•°æ®
   * @param data
   * @returns
   */
  addWorkTask(data: Record<string, any>) {
    return addWorkTask(data)
  }
  /**
   * å…‹éš†
   * @param ids
   * @returns
   */
  cloneData(ids: string[]) {
    return cloneData(ids)
  }
}
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Models/WorkTaskDrawer.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
import { Base } from '@/libs/Base/Base'
import {
  addWorkTask,
  getWorkTask,
  updateWorkTask,
  getWmsEnumData,
} from './Service/WorkTaskDrawer'
import { useGlobalState } from '@/libs/Store/Store'
export class WorkTaskDrawer extends Base<{ [key: string]: any }> {
  constructor() {
    super({
      data: [],
      workTask: {},
    })
  }
  /**
   * æ·»åŠ 
   * @param data
   */
  async addWorkTask(data: Record<string, any>) {
    return addWorkTask(data)
  }
  /**
   * æ›´æ–°
   * @param data
   */
  async updateWorkTask(id: string, data: Record<string, any>) {
    return updateWorkTask(id, data)
  }
  /**
   * èŽ·å–è¯¦æƒ…
   */
  async getWorkTaskDetail(current: any, id?: string) {
    return getWorkTask(id || current?.id)
  }
  //  èŽ·å–æžšä¸¾å€¼
  async getWmsEnumData(data: Record<string, any>) {
    return getWmsEnumData(data)
  }
}
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Models/WorkTaskQueryDrawer.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
import { Base } from '@/libs/Base/Base'
import {
  addWorkTask,
  getWorkTask,
  updateWorkTask,
  getWmsEnumData,
} from './Service/WorkTaskQueryDrawer'
import { useGlobalState } from '@/libs/Store/Store'
export class WorkTaskQueryDrawer extends Base<{ [key: string]: any }> {
  constructor() {
    super({
      data: [],
      workTask: {},
    })
  }
  /**
   * æ·»åŠ 
   * @param data
   */
  async addWorkTask(data: Record<string, any>) {
    return addWorkTask(data)
  }
  /**
   * æ›´æ–°
   * @param data
   */
  async updateWorkTask(id: string, data: Record<string, any>) {
    return updateWorkTask(id, data)
  }
  /**
   * èŽ·å–è¯¦æƒ…
   */
  async getWorkTaskDetail(current: any, id?: string) {
    return getWorkTask(id || current?.id)
  }
  //  èŽ·å–æžšä¸¾å€¼
  async getWmsEnumData(data: Record<string, any>) {
    return getWmsEnumData(data)
  }
}
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/Dialog/WorkTaskDrawer/WorkTaskDrawer.module.scss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,3 @@
.drawer {
  width: 800px;
}
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/Dialog/WorkTaskDrawer/WorkTaskDrawer.tsx
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
import { SetupContext, defineComponent } from 'vue'
import BaseDrawer from '@/components/BaseDrawer/BaseDrawer'
import styles from './WorkTaskDrawer.module.scss'
import { useWorkTaskDrawer } from '../../../../Controllers/WorkTaskDrawer.tsx'
import DyForm from '@/components/DyForm/DyForm'
// @ts-ignore
export default defineComponent<{
  [key: string]: any
}>({
  name: '弹窗',
  props: {
    modelValue: {
      type: Boolean,
      default: false,
    },
    title: {
      type: String,
      default: '',
    },
    row: {
      type: Object,
    },
    sort: {
      type: Number,
      default: 0,
    },
  },
  emits: ['update:modelValue', 'close', 'submit', 'confirm'],
  setup(props: Record<string, any>, ctx: SetupContext) {
    const {
      onClose,
      onConfirm,
      onOpen,
      formRef,
      visible,
      formItems,
      formData,
    } = useWorkTaskDrawer(props, ctx)
    return () => (
      <BaseDrawer
        class={styles.drawer}
        size="800px"
        title={props.title || '添加'}
        v-model={visible.value}
        close-on-click-modal={true}
        onConfirm={onConfirm}
        onOpen={onOpen}
        before-close={onClose}
        onClose={onClose}
      >
        <DyForm
          ref={formRef}
          formData={formData.value}
          labelWidth="106px"
          formItemProps={formItems}
        ></DyForm>
      </BaseDrawer>
    )
  },
})
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/Dialog/WorkTaskQueryDrawer/WorkTaskQueryDrawer.module.scss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,3 @@
.drawer {
  width: 800px;
}
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/Dialog/WorkTaskQueryDrawer/WorkTaskQueryDrawer.tsx
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,71 @@
/*
 * ç‰©æ–™åŸºç¡€ä¿¡æ¯æŸ¥è¯¢å¼¹å‡ºæ¡†
*/
import { SetupContext, defineComponent } from 'vue'
import BaseQueryDrawer from '@/components/BaseQueryDrawer/BaseQueryDrawer'
import styles from './WorkTaskQueryDrawer.module.scss'
import { useWorkTaskQueryDrawer } from '../../../../Controllers/WorkTaskQueryDrawer.tsx'
import DyFormForHighQuery from '@/components/DyFormForHighQuery/DyFormForHighQuery'
// @ts-ignore
export default defineComponent<{
  [key: string]: any
}>({
  name: '弹窗',
  props: {
    //枚举类型字典
    enumListDict:{
      type: Array as () => Array<{ key: string; value: object }>, // å®šä¹‰æ•°ç»„元素类型
      default: () => [] // é»˜è®¤å€¼
    },
    modelValue: {
      type: Boolean,
      default: false,
    },
    title: {
      type: String,
      default: '',
    },
    row: {
      type: Object,
    },
    sort: {
      type: Number,
      default: 0,
    },
  },
  emits: ['update:modelValue', 'close', 'submit', 'confirmquery1'],
  setup(props: Record<string, any>, ctx: SetupContext) {
    const {
      onClose,
      onConfirmQuery,
      onOpen,
      onReset,
      formRef,
      visible,
      formItems,
      formData,
    } = useWorkTaskQueryDrawer(props, ctx)
    return () => (
      <BaseQueryDrawer
        class={styles.drawer}
        size="800px"
        title={props.title || '高级查询'}
        v-model={visible.value}
        close-on-click-modal={true}
        onReset={onReset}
        onConfirmQueryForBase={onConfirmQuery}
        onOpen={onOpen}
        before-close={onClose}
        onClose={onClose}
      >
        <DyFormForHighQuery
          ref={formRef}
          formData={formData.value}
          labelWidth="106px"
          formItemProps={formItems}
        ></DyFormForHighQuery>
      </BaseQueryDrawer>
    )
  },
})
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/WorkTask/Config.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,217 @@
export const columns = [
  {
    type: 'seq',
    width: 60,
    title: '序号',
  },
  {
  field: 'son_TaskCode',
  title: '子任务编码',
  width:160,
},
{
  field: 'taskCode',
  title: '任务编码',
  width:160,
},
{
  field: 'workPlanStatusDesc',
  title: '计划状态',
  width:160,
},
{
  field: 'callMaterialStatusDesc',
  title: '叫料状态',
  width:160,
},
{
  field: 'dataIdentifier',
  title: '原料标识',
  width:160,
},
{
  field: 'materialMode',
  title: '原料型号',
  width:160,
},
{
  field: 'length',
  title: '长度(mm)',
  width:160,
},
{
  field: 'markingContent',
  title: '打码内容',
  width:160,
},
{
  field: 'markingPosition',
  title: '打码位置',
  width:160,
},
{
  field: 'cuttingPosition',
  title: '切割位置',
  width:160,
},
{
  field: 'quantity',
  title: '管段数量',
  width:160,
},
{
  field: 'flangeThickness',
  title: '法兰厚度(mm)',
  width:160,
},
{
  field: 'flangeInnerDiameter',
  title: '法兰直径(mm)',
  width:160,
},
{
  field: 'weldingHeatInput',
  title: '法兰公称压力',
  width:160,
},
{
  field: 'pipeAllowableStress',
  title: '法兰冲码内容',
  width:160,
},
{
  field: 'pipeDiameter',
  title: '套管长度(mm)',
  width:160,
},
{
  field: 'pipeWallThickness',
  title: '套管直径(mm)',
  width:160,
},
{
  field: 'factoryCode',
  title: '工厂代码',
  width:160,
},
{
  field: 'productCode',
  title: '产品代码',
  width:160,
},
{
  field: 'workstationCode',
  title: '工位代码',
  width:160,
},
{
  field: 'equipmentCode',
  title: '设备代码',
  width:160,
},
{
  field: 'prodLineCode',
  title: '产线编码',
  width:160,
},
{
  field: 'shipNumber',
  title: '船号',
  width:160,
},
{
  field: 'projectNumber',
  title: '项目号',
  width:160,
},
{
  field: 'processName',
  title: '工序名称',
  width:160,
},
{
  field: 'pipeFittingCode',
  title: '管件编码',
  width:160,
},
{
  field: 'preSerialNumber',
  title: '顺序号',
  width:160,
},
{
  field: 'pipeSpecCode',
  title: '管段编码',
  width:160,
},
{
  field: 'pipeSectionName',
  title: '管段名称',
  width:160,
},
{
  field: 'outerDiameter',
  title: '外径(mm)',
  width:160,
},
{
  field: 'thickness',
  title: '壁厚(mm)',
  width:160,
},
{
  field: 'material',
  title: '材质',
  width:160,
},
{
  field: 'processRouteNumber',
  title: '工艺流向编号',
  width:160,
},
{
  field: 'plannedStartTime',
  title: '计划开始时间',
  width:180,
},
{
  field: 'plannedEndTime',
  title: '计划完成时间',
  width:180,
},
{
  field: 'teamInfo',
  title: '班组信息',
  width:160,
},
{
  field: 'timestamp',
  title: '时间戳',
  width:160,
},
{
  field: 'creationTime',
  title: '创建时间',
  width:180,
},
{
  field: 'lastModificationTime',
  title: '修改时间',
  width:180,
},
{
  field: 'creatorName',
  title: '创建人',
  width:160,
},
{
  field: 'lastModifierName',
  title: '修改人',
  width:160,
},
{
  field: 'remark',
  title: '备注',
  width:160,
},
]
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/WorkTask/WorkTask.module.scss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,113 @@
.workTaskContent {
  width: 100%;
  height: 100%;
  .workTaskList {
    width: 100%;
    height: calc(100% - 70px);
  }
  .headerContent {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 43px;
  }
  .header {
    margin-bottom: 12px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }
}
.tagBox {
  width: auto;
  min-width: 80px;
  height: 24px;
  background: #ffffff;
  border-radius: 19px 19px 19px 19px;
  opacity: 1;
  border: 1px dashed #bcc4cc;
  width: 50px;
  height: 20px;
  font-size: 14px;
  font-family: PingFang SC, PingFang SC;
  font-weight: 400;
  color: #5a84ff;
  display: flex;
  justify-content: center;
  align-items: center;
  // cursor: pointer;
}
.group {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.groupTable {
  width: 100%;
}
.overBox {
  width: 100%;
  height: calc(100% - 20px);
  overflow: auto;
  :global(.cs-collapse-item__header) {
    background-color: #f1f1f1;
    padding: 0 20px;
    height: 35px;
    font-size: 16px;
    font-family: PingFang SC, PingFang SC;
    font-weight: 500;
  }
  :global(.cs-collapse-item__content) {
    padding-bottom: 0px;
  }
}
.groupHeader {
  width: 100%;
  height: 30px;
  background: #ccc;
}
.hideBlock {
  display: none;
}
.queryForm {
  padding: 10px;
  background: #f5f7fa;
  margin-bottom: 0px;
  border-radius: 4px;
  .el-form-item {
    margin-right: 20px;
    margin-bottom: 0;
    // ç»Ÿä¸€è¾“入框和选择框的宽度
    .el-input, .el-select {
      width: 200px; // è®¾ç½®ç»Ÿä¸€çš„宽度
    }
    // é€‰æ‹©æ¡†å†…部输入框样式
    .el-select .el-input__wrapper {
      height: 32px; // ä¸Žè¾“入框高度一致
      padding: 1px 11px; // ä¸Žè¾“入框内边距一致
    }
    // æ—¥æœŸé€‰æ‹©å™¨å®½åº¦
    .el-date-editor {
      width: 220px;
    }
  }
}
// å¦‚果需要更精确的控制,可以单独设置
.formItem {
  width: 200px;
  &.el-input, &.el-select {
    width: 100%;
  }
}
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/WorkTask/WorkTask.tsx
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,409 @@
import { computed, defineComponent, onMounted, reactive, ref } from 'vue'
import type { Ref } from 'vue'
import BaseTable from '@/components/Table/Table'
import styles from './WorkTask.module.scss'
import { useWorkTask } from '../../../Controllers/WorkTask'
import IconButton from '@/components/IconButton/IconButton'
import WorkTaskDrawer from '../Dialog/WorkTaskDrawer/WorkTaskDrawer'
import WorkTaskQueryDrawer from '../Dialog/WorkTaskQueryDrawer/WorkTaskQueryDrawer'
import Search from '@/components/Search/Search'
import { columns } from './Config'
import TdButton from '@/components/TdButton/TdButton'
import { vPermission } from '@/libs/Permission/Permission'
import dayjs from 'dayjs'
import {
  getWmsEnumData
} from '@/widgets/WorkTask/Models/Service/WorkTaskDrawer'
import {
  ElInput,
  ElSelect,
  ElOption,
  ElDatePicker,
  ElForm,
  ElFormItem,
} from 'element-plus'
import { injectModel } from '@/libs/Provider/Provider'
// å¼•入公共选项配置
import {
  FILTER_MODE_OPTIONS_STRING
} from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions';
interface RenderTableType {
  url?: string
  dataSource: Ref<any[]>
  isDrag?: boolean
  isChecked?: boolean
  isHidePagination?: boolean
  params?: Record<string, any>
  autoHeight?: boolean
}
export default defineComponent({
  name: 'WorkTask',
  directives: {
    permission: vPermission,
  },
  setup(props, ctx) {
    const {
      dataSource,
      contextMenu,
      dialogConfig,
      dialogConfigForQuery,
      tableRef,
      current,
      search,
      sort,
      headers,
      onError,
      onSearch,
      onRowClick,
      onConfirmWorkTask,
      onCheck,
      onAddWorkTask,
      onAdvancedQuery,
      onExport,
      openDetail,
      onSuccess,
      onBeforeUpload,
    } = useWorkTask(props, ctx)
    //定义高级查询引用
   const workTaskQueryDrawerRef=ref(null);
    // æ–°å¢žçš„æŸ¥è¯¢æ¡ä»¶
    const queryForm = ref({
      searchVal: '',
      str_searchFormInputAttrs:[],
      searchVal_FilterMode:''
    })
    //定义整体模糊查询的列数组(注意:必须大小写跟后端的实体类属性名一致,否则会导致匹配不对的问题)
    const _searchFormInputAttrs = ref([
     'Son_TaskCode','TaskCode','DataIdentifier','MaterialMode','MarkingContent','WeldingHeatInput','PipeAllowableStress','FactoryCode','ProductCode','WorkstationCode','EquipmentCode','ProdLineCode','ShipNumber','ProjectNumber','ProcessName','PipeFittingCode','PreSerialNumber','PipeSpecCode','PipeSectionName','Material','ProcessRouteNumber','TeamInfo','Timestamp','CreatorName','LastModifierName','Remark'
    ]);
    const searchFormInputAttrs_Placeholder = ref('请输入子任务编码/任务编码/原料标识/原料型号/打码内容/法兰公称压力/法兰冲码内容/工厂代码/产品代码/工位代码/设备代码/产线编码/船号/项目号/工序名称/管件编码/顺序号/管段编码/管段名称/材质/工艺流向编号/班组信息/时间戳/创建人/修改人/备注');
    // åŠ¨æ€æžšä¸¾é€‰é¡¹
    const enumOptions = reactive({
      workPlanStatus: [] as Array<{label: string; value: any }>,
callMaterialStatus: [] as Array<{label: string; value: any }>,
    })
    // èŽ·å–æžšä¸¾æ•°æ®
    const fetchEnumData = async () => {
      try {
        const workPlanStatusEnumData = await getWmsEnumData({
 EnumName: 'WorkPlanStatusEnum',
})
enumOptions.workPlanStatus = workPlanStatusEnumData.map((item) => ({
  label: item.description,
  value: item.value,
}))
const callMaterialStatusEnumData = await getWmsEnumData({
 EnumName: 'CallMaterialStatusEnum',
})
enumOptions.callMaterialStatus = callMaterialStatusEnumData.map((item) => ({
  label: item.description,
  value: item.value,
}))
      } catch (error) {
        console.error('获取枚举数据失败:', error)
      }
    }
    // å®šä¹‰å“åº”式查询数据
    const _curHighQueryData = ref({ searchVal: '',str_searchFormInputAttrs:[],searchVal_FilterMode:'' });
    // ç»„件挂载时获取枚举数据
    onMounted(() => {
      fetchEnumData()
      queryForm.value.searchVal_FilterMode = FILTER_MODE_OPTIONS_STRING[0]?.value || '';
      _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode;
      _curHighQueryData.value.str_searchFormInputAttrs = _searchFormInputAttrs.value;
    })
    // æ–°ç‰ˆçš„æŸ¥è¯¢æ–¹æ³•(主页面中的按钮【查询】)
    const handleQueryForMain = async () => {
      _curHighQueryData.value.searchVal = queryForm.value.searchVal;
      _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode;
      _curHighQueryData.value.str_searchFormInputAttrs = _searchFormInputAttrs.value;
      tableRef.value.getList(_curHighQueryData.value)
    }
    // æ–°ç‰ˆçš„æŸ¥è¯¢æ–¹æ³•(高级查询中的按钮【查询】)
    const handleQuery = async (extraParams = {}) => {
      let filteredData = commonGetHighQueryForm(extraParams);
      commonSaveCurHighQueryData(filteredData);
      tableRef.value.getList(filteredData)
    }
    // æ–°ç‰ˆçš„æŸ¥è¯¢é‡ç½®
    const resetQuery = () => {
      queryForm.value.searchVal = ''
      queryForm.value.searchVal_FilterMode = FILTER_MODE_OPTIONS_STRING[0]?.value || '';
      queryForm.value.str_searchFormInputAttrs=_searchFormInputAttrs.value;
    }
     //新版的导出方法
     const handleExport=()=>{
      onExport(_curHighQueryData.value);
    }
    // æ–°ç‰ˆçš„æŸ¥è¯¢å¼¹å‡ºæ¡†å…³é—­æ–¹æ³•
    const closeQuery = (extraParams={}) => {
      let filteredData = commonGetHighQueryForm(extraParams);
      console.log("closeQuery方法");
      console.log(filteredData);
      commonSaveCurHighQueryData(filteredData);
    }
    //保存查询值
    const commonSaveCurHighQueryData=(filteredData={})=>{
      _curHighQueryData.value = { ..._curHighQueryData.value, ...filteredData };
      _curHighQueryData.value.searchVal = queryForm.value.searchVal
      _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode
      _curHighQueryData.value.str_searchFormInputAttrs =_searchFormInputAttrs.value;
    }
     //获取高级查询弹出框的查询值
     const commonGetHighQueryForm=(extraParams={})=>{
      // è¿‡æ»¤æŽ‰ undefined çš„值
      let filteredData = Object.assign(
        {},
        ...Object.entries(extraParams).map(([key, value]) =>
          value !== undefined ? { [key]: value } : {}
        )
      )
      //组合模糊查询
      filteredData.searchVal = queryForm.value.searchVal
      filteredData.searchVal_FilterMode = queryForm.value.searchVal_FilterMode
      filteredData.str_searchFormInputAttrs =_searchFormInputAttrs.value;
      return filteredData;
    }
    /**
     * @returns è¡¨æ ¼
     */
    const RenderBaseTable = (props: RenderTableType) => {
      const {
        url,
        dataSource,
        isDrag,
        isChecked,
        isHidePagination,
        params,
        autoHeight,
      } = props
      return (
        <div
          class={{
            [styles.workTaskList]: true,
          }}
        >
          <BaseTable
            ref={tableRef}
            url={url}
            sortUrlTpl="/api/v1/PipeLineLems/workTask/{id}/adjustsort/{sort}"
            v-model:dataSource={dataSource.value}
            columns={columns}
            contextMenu={contextMenu}
            params={params}
            isDrag={isDrag}
            isChecked={isChecked}
            autoHeight={autoHeight}
            onCheck={onCheck}
            onRowClick={onRowClick}
            isHidePagination={isHidePagination}
            pageSize={20}
            v-slots={{
              plannedStartTime: ({ row }: any) => {
 return (
   <div>
     {row.plannedStartTime != null
     ? dayjs(row.plannedStartTime).format('YYYY-MM-DD HH:mm:ss')
      : '-'}
   </div>
  )
},
plannedEndTime: ({ row }: any) => {
 return (
   <div>
     {row.plannedEndTime != null
     ? dayjs(row.plannedEndTime).format('YYYY-MM-DD HH:mm:ss')
      : '-'}
   </div>
  )
},
creationTime: ({ row }: any) => {
 return (
   <div>
     {row.creationTime != null
     ? dayjs(row.creationTime).format('YYYY-MM-DD HH:mm:ss')
      : '-'}
   </div>
  )
},
lastModificationTime: ({ row }: any) => {
 return (
   <div>
     {row.lastModificationTime != null
     ? dayjs(row.lastModificationTime).format('YYYY-MM-DD HH:mm:ss')
      : '-'}
   </div>
  )
},
isDeleted: ({ row }: any) => {
 return (
   <div>
     {row.isDeleted != null ? (row.isDeleted ? '是' : '否') : '-'}
   </div>
  )
},
deletionTime: ({ row }: any) => {
 return (
   <div>
     {row.deletionTime != null
     ? dayjs(row.deletionTime).format('YYYY-MM-DD HH:mm:ss')
      : '-'}
   </div>
  )
},
isDisabled: ({ row }: any) => {
 return (
   <div>
     {row.isDisabled != null ? (row.isDisabled ? '是' : '否') : '-'}
   </div>
  )
},
              name: ({ row }: any) => {
                return row?.name ? (
                  <TdButton
                    onClick={() => openDetail(row)}
                    text={<span style="color:#5a84ff">详情</span>}
                    icon="scale"
                    tip={row?.name}
                    hover
                  >
                    {row?.name}
                  </TdButton>
                ) : (
                  '-'
                )
              },
            }}
          ></BaseTable>
        </div>
      )
    }
    return () => {
      return (
        <div class={styles.workTaskContent}>
          {/* æ·»åŠ /编辑 */}
          <WorkTaskDrawer
            v-model={dialogConfig.visible}
            title={dialogConfig.title}
            row={current.value}
            sort={sort.value}
            onConfirm={onConfirmWorkTask}
          />
          {/* é«˜çº§æŸ¥è¯¢ */}
          <WorkTaskQueryDrawer
            ref="workTaskQueryDrawerRef"
            v-model={dialogConfigForQuery.visible}
            title={dialogConfigForQuery.title}
            row={current.value}
            sort={sort.value}
            onConfirmQuery={handleQuery}
            onRestQuery={resetQuery}
            onClose={closeQuery}
          />
          <div class={styles.headerContent}>
            <div class={styles.header}>
              <IconButton
                v-permission="workTask-add"
                icon="add-p"
                onClick={onAddWorkTask}
                type="primary"
              >
                æ·»åŠ 
              </IconButton>
              <el-divider direction="vertical" />
              <el-upload
                v-permission="workTask-import"
                name="file"
                accept=".xlsx,.xls,.csv"
                show-file-list={false}
                onError={onError}
                onSuccess={onSuccess}
                before-upload={onBeforeUpload}
                headers={headers.value}
                action="/api/v1/PipeLineLems/workTask/import"
              >
                <IconButton icon="in">导入</IconButton>
              </el-upload>
              <IconButton
                v-permission="workTask-output"
                icon="out"
                onClick={handleExport}
              >
                å¯¼å‡º
              </IconButton>
            </div>
            <ElFormItem style={{ marginTop: '15px' }}>
              <ElFormItem label="关键字">
                 <el-tooltip
                  class="box-item"
                  effect="dark"
                  content={searchFormInputAttrs_Placeholder.value}
                  placement="top-start"
                >
                <ElInput
                  v-model={queryForm.value.searchVal}
                  placeholder={searchFormInputAttrs_Placeholder.value}
                  clearable
                  class={styles.formItem}
                />
                </el-tooltip>
              </ElFormItem>
              <ElFormItem label="" style="width:100px;">
                   <ElSelect
                                v-model={queryForm.value.searchVal_FilterMode}
                                placeholder="请选择"
                                class={styles.formItem}
                              >
                                {FILTER_MODE_OPTIONS_STRING.map((option) => (
                                  <ElOption
                                    key={option.value}
                                    label={option.label}
                                    value={option.value}
                                  />
                                ))}
                              </ElSelect>
              </ElFormItem>
              <IconButton type="primary" icon="search" onClick={handleQueryForMain}>
                æŸ¥è¯¢
              </IconButton>
              {/* <IconButton style="" icon="refresh" onClick={resetQuery}>
                é‡ç½®
              </IconButton> */}
              <IconButton
                v-permission="workTask-add"
                icon="search"
                onClick={onAdvancedQuery}
                type="primary"
              >
                é«˜çº§æŸ¥è¯¢
              </IconButton>
            </ElFormItem>
          </div>
          <RenderBaseTable
            url="/api/v1/PipeLineLems/workTask/page"
            dataSource={dataSource}
            isChecked={true}
            isDrag={true}
          />
        </div>
      )
    }
  },
})
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/WorkTask.module.scss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
.WorkTask {
  background-color: #fff;
  border-radius: 5px 5px 0 0;
  width: 100%;
  height: 100%;
  border: 1px solid #dbdbdb;
}
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/WorkTask.tsx
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,80 @@
import {
  Component,
  DefineComponent,
  defineComponent,
  markRaw,
  ref,
  SetupContext,
  onMounted,
} from 'vue'
import styles from './WorkTask.module.scss'
import Tab from '@/components/Tab/Tab'
import { useProvideModels } from '@/libs/Provider/app'
import { usePermission } from '@/libs/Permission/Permission'
import { permissionCodes } from '../enum'
import { ModuleType, TabItem } from '../type/Type'
import { getEntityNames } from '@/hooks/hook'
import TabPane from '@/components/Tab/TabPane'
const Models: ModuleType = import.meta.glob('./config/*.json', {
  eager: true,
})
const entityNames = getEntityNames(Models)
const nameToLabelMap = [{ name: 'WorkTask', label: '作业任务' }]
export default defineComponent({
  name: 'WorkTask',
  setup(props, ctx: SetupContext) {
    useProvideModels()
    usePermission(props, permissionCodes)
    const rf = ref<{
      [key: string]: any
    }>({})
    const tabData = ref<TabItem[]>([])
    const onTabChange = (v: string) => {
      rf.value?.[v]?.reloadList()
    }
    const initTableData = async () => {
      for (const i in entityNames) {
        const name = entityNames[i]
        const module = await import(`./Pages/${name}/${name}.tsx`)
        const WorkTask = markRaw(module.default)
        const foundLabel =
          nameToLabelMap.find((item) => item.name === name)?.label || name
        tabData.value.push({
          label: foundLabel,
          name,
          component: WorkTask,
        })
      }
    }
    initTableData()
    return () => {
      return (
        <div class={styles.WorkTask}>
          <Tab data={tabData.value} type="list" onTab={onTabChange}>
            {tabData.value.map((widgetInfo) => {
              const Widget: any = widgetInfo.component
              return (
                <TabPane label={widgetInfo.label} name={widgetInfo.name}>
                  <Widget
                    ref={(r: any) => (rf.value['WorkTask'] = r)}
                  ></Widget>
                </TabPane>
              )
            })}
          </Tab>
        </div>
      )
    }
  },
})
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/config/WorkTask.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,3 @@
{
  "name": "WorkTask"
}
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/enum.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
export interface TabType {
  label: string
  name: string
  columns?: any[]
  data?: any[]
  isFooter: boolean
  [key: string]: any
}
export const permissionCodes = {
  'workTask-list': '列表-列表',
  'workTask-add': '列表-添加',
  'workTask-import': '列表-导入',
  'workTask-output': '列表-输出',
}
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/index.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
import WorkTask from './Views/WorkTask'
import Setting from '@/components/Setting/Setting'
import { provider } from '@/provider/index'
import p from '../../assets/svg/p.svg'
export default {
  is: 'WorkTask',
  name: '作业任务',
  category: 'run',
  icon: p,
  authorizationRequired: false,
  canvasView: provider(WorkTask),
  settingsView: Setting,
}
PipeLineLems/pipelinelems_web/src/widgets/WorkTask/type/type.d.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,45 @@
import { Component } from 'vue'
export interface DataItemType {
  id?: string
  name?: string
  code?: string
  description?: string
  label?: string
  value?: string | number
}
export interface WorkTaskBaseType {
  id?: string
  name?: string
  code?: string
  value?: number
  description?: string
  options?: Array<DataItemType>
  abilityValue?: number | string
  data?: DataItemType
  defaultValue?: string | number
  flow: string
}
export interface FlowDefinitionType {
  id?: string
  name?: string
  code?: string
  description?: string
}
export type ModuleType = Record<
  string,
  {
    default: Record<string, string>
    name: string
  }
>
export interface TabItem {
  name: string
  label: string
  component: Component
  hidden?: boolean
}
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs
@@ -8,6 +8,7 @@
using CMS.Plugin.OrderManagement.Abstractions.Models;
using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.CallMaterialOrder;
using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan;
using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkTask;
using CMS.Plugin.PipeLineLems.Application.Contracts.Services;
using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrder;
using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrderRecord;
@@ -23,6 +24,7 @@
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using Volo.Abp;
using Volo.Abp.ObjectMapping;
using Volo.Abp.Uow;
namespace CMS.Plugin.PipeLineLems.Application.Implements;
@@ -112,6 +114,14 @@
        //TODO:这里调用wms的叫料接口
        try
        {
            //首先判断库存是否存在
            var dto = await IsExistInWms(input.PipeSpecCode);
            if (dto != null)
            {
                throw new UserFriendlyException($"已经分拣过,库存在库位{dto.PlaceNo},托盘号{dto.ContainerNo}");
            }
            WmsMaterialStockCreateDto param = new WmsMaterialStockCreateDto()
            {
                ContainerNo = input.ContinerNo,
@@ -258,6 +268,7 @@
        };
        return response;
    }
    /// <summary>
    /// åˆ›å»ºä½œä¸šè®¡åˆ’
    /// </summary>
@@ -266,7 +277,6 @@
    /// <param name="workPlanAppService"></param>
    /// <returns></returns>
    /// <exception cref="UserFriendlyException"></exception>
    public async Task<MesOrderResponse> CommonCreatebyApsAsync(List<WorkPlanInput> input, IServiceProvider _serviceProvider,
    WorkPlanAppService workPlanAppService,
    string userId, string userAccount
@@ -306,6 +316,8 @@
        var orderManager = _serviceProvider.GetRequiredService<IOrderManager>();
        var productProvider = _serviceProvider.GetRequiredService<IProductProvider>();
        var formulaProvider = _serviceProvider.GetRequiredService<IFormulaProvider>();
        var workTaskAppService = _serviceProvider.GetRequiredService<IWorkTaskAppService>();
        List<OrderModel> orderModels = new List<OrderModel>();
@@ -443,16 +455,36 @@
                insertObj.CreatorName = userAccount;
                insertObj.Remark = "系统导入";
                await workPlanAppService.CreateAsync(insertObj);
                //增加新增计划任务表数据 ã€Editby shaocx,2025-05-20】
                var org_insertTaskObj = ObjectMapper.Map<WorkPlanCreateDto, WorkTaskCreateDto>(insertObj);
                org_insertTaskObj.Son_TaskCode = insertObj.TaskCode;
                await workTaskAppService.CreateAsync(org_insertTaskObj);
                if (insertObj.ProcessName == "切割工序")
                {//新建 åˆ†æ‹£å·¥åº
                    var insertTaskObj = ObjectMapper.Map<WorkPlanCreateDto, WorkTaskCreateDto>(insertObj);
                    insertTaskObj.Son_TaskCode = insertObj.TaskCode + "_1";
                    insertTaskObj.ProcessName = "分拣工序";
                    await workTaskAppService.CreateAsync(insertTaskObj);
                }
                else if (insertObj.ProcessName == "装配工序")
                {//新建 æ³•兰冲码工序(多个)
                 //目前暂时搞成一个法兰
                    var insertTaskObj = ObjectMapper.Map<WorkPlanCreateDto, WorkTaskCreateDto>(insertObj);
                    insertTaskObj.Son_TaskCode = insertObj.TaskCode + "_1";
                    insertTaskObj.ProcessName = "法兰冲码工序";
                    await workTaskAppService.CreateAsync(insertTaskObj);
                }
            }
            #endregion
            await uow.CompleteAsync();
        }
        catch (Exception)
        catch (Exception ex)
        {
            await uow.RollbackAsync();
            throw;
            throw ex;
        }
        finally
        {
@@ -1150,6 +1182,50 @@
    }
    /// <summary>
    /// ç®¡æ®µç¼–码是否存在库存中
    /// </summary>
    /// <param name="pipeSpecCode"></param>
    /// <returns></returns>
    /// <exception cref="UserFriendlyException"></exception>
    public async Task<WmsMaterialStockDto> IsExistInWms(string pipeSpecCode)
    {
        //TODO:这里调用wms的库存查询接口
        try
        {
            GetWmsMaterialStockInput param = new GetWmsMaterialStockInput()
            {
                RedundantField2 = pipeSpecCode,
                RedundantField2_FilterMode = SearchFilterModeEnum.精准查询
            };
            string baseUrl = @"http://127.0.0.1:18000/api/v1/HIAWms/";
            string url = baseUrl + "LMesOperate/FindListByFilter";
            string json = JsonConvert.SerializeObject(param);
            var result = HttpApiRequest.HttpPost(url, json);
            var res = JsonConvert.DeserializeObject<CmsApiResponse<List<WmsMaterialStockDto>>>(result);
            if (res.Code == 200)
            {
                var retData = res.Data as List<WmsMaterialStockDto>;
                if (retData?.Count > 0)
                {
                    return retData.First();
                }
                return null;
            }
            else
            {
                throw new UserFriendlyException(res.Message);
            };
        }
        catch (Exception)
        {
            throw;
        }
    }
    /// <summary>
    /// ç”Ÿæˆéšæœºçš„WmsTaskNo
    /// </summary>
    /// <returns>随机生成的任务编号</returns>
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/CMSPluginDbContext.cs
@@ -34,6 +34,7 @@
        builder.ConfigureMyTestEntityName();
        builder.ConfigureWorkPlan();
        builder.ConfigureWorkTask();
        builder.ConfigureCallMaterialOrder();
        builder.ConfigureCallMaterialOrderRecord();
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/20250515064954_Update1.Designer.cs
ÎļþÒÑɾ³ý
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/20250515064954_Update1.cs
ÎļþÒÑɾ³ý
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/CMSPluginDbContextModelSnapshot.cs
@@ -125,6 +125,9 @@
                        .HasColumnType("varchar(64)")
                        .HasComment("修改人");
                    b.Property<string>("MaterialBatch")
                        .HasColumnType("longtext");
                    b.Property<string>("MaterialMode")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
@@ -255,6 +258,9 @@
                        .HasColumnType("char(36)")
                        .HasColumnName("LastModifierId")
                        .HasComment("修改人ID");
                    b.Property<string>("MaterialBatch")
                        .HasColumnType("longtext");
                    b.Property<string>("MaterialMode")
                        .HasMaxLength(256)
@@ -665,6 +671,305 @@
                    b.HasComment("作业计划表");
                });
            modelBuilder.Entity("CMS.Plugin.PipeLineLems.Domain.WorkTask.WorkTask", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");
                    b.Property<int>("CallMaterialStatus")
                        .HasColumnType("int")
                        .HasComment("叫料状态");
                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
                        .HasMaxLength(40)
                        .HasColumnType("varchar(40)")
                        .HasColumnName("ConcurrencyStamp")
                        .HasComment("并发戳");
                    b.Property<DateTime>("CreationTime")
                        .HasColumnType("datetime(6)")
                        .HasColumnName("CreationTime")
                        .HasComment("创建时间");
                    b.Property<Guid?>("CreatorId")
                        .HasMaxLength(36)
                        .HasColumnType("char(36)")
                        .HasColumnName("CreatorId")
                        .HasComment("创建人ID");
                    b.Property<string>("CreatorName")
                        .HasMaxLength(64)
                        .HasColumnType("varchar(64)")
                        .HasComment("创建人");
                    b.Property<decimal>("CuttingPosition")
                        .HasColumnType("decimal(18,2)")
                        .HasComment("切割位置");
                    b.Property<string>("DataIdentifier")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("原料标识");
                    b.Property<string>("DeleteRemark")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("删除备注");
                    b.Property<Guid?>("DeleterId")
                        .HasMaxLength(36)
                        .HasColumnType("char(36)")
                        .HasColumnName("DeleterId")
                        .HasComment("删除人ID");
                    b.Property<DateTime?>("DeletionTime")
                        .HasColumnType("datetime(6)")
                        .HasColumnName("DeletionTime")
                        .HasComment("删除时间");
                    b.Property<string>("EquipmentCode")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("设备代码");
                    b.Property<string>("ExtraField1")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("扩展字段1");
                    b.Property<string>("ExtraField2")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("扩展字段2");
                    b.Property<string>("ExtraField3")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("扩展字段3");
                    b.Property<string>("ExtraProperties")
                        .HasColumnType("longtext")
                        .HasColumnName("ExtraProperties")
                        .HasComment("扩展属性");
                    b.Property<string>("FactoryCode")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("工厂代码");
                    b.Property<decimal>("FlangeInnerDiameter")
                        .HasColumnType("decimal(18,2)")
                        .HasComment("法兰直径(mm)");
                    b.Property<decimal>("FlangeThickness")
                        .HasColumnType("decimal(18,2)")
                        .HasComment("法兰厚度(mm)");
                    b.Property<bool>("IsDeleted")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValue(false)
                        .HasColumnName("IsDeleted")
                        .HasComment("是否删除");
                    b.Property<bool?>("IsDisabled")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValue(false)
                        .HasComment("是否禁用");
                    b.Property<DateTime?>("LastModificationTime")
                        .HasColumnType("datetime(6)")
                        .HasColumnName("LastModificationTime")
                        .HasComment("修改时间");
                    b.Property<Guid?>("LastModifierId")
                        .HasMaxLength(36)
                        .HasColumnType("char(36)")
                        .HasColumnName("LastModifierId")
                        .HasComment("修改人ID");
                    b.Property<string>("LastModifierName")
                        .HasMaxLength(64)
                        .HasColumnType("varchar(64)")
                        .HasComment("修改人");
                    b.Property<decimal>("Length")
                        .HasColumnType("decimal(18,2)")
                        .HasComment("长度(mm)");
                    b.Property<string>("MarkingContent")
                        .HasMaxLength(1024)
                        .HasColumnType("varchar(1024)")
                        .HasComment("打码内容");
                    b.Property<decimal>("MarkingPosition")
                        .HasColumnType("decimal(18,2)")
                        .HasComment("打码位置");
                    b.Property<string>("Material")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("材质");
                    b.Property<string>("MaterialMode")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("原料型号");
                    b.Property<string>("OperationRemark")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("操作备注");
                    b.Property<decimal>("OuterDiameter")
                        .HasColumnType("decimal(18,2)")
                        .HasComment("外径(mm)");
                    b.Property<string>("PipeAllowableStress")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("法兰冲码内容");
                    b.Property<decimal>("PipeDiameter")
                        .HasColumnType("decimal(18,2)")
                        .HasComment("套管长度(mm)");
                    b.Property<string>("PipeFittingCode")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("管件编码");
                    b.Property<string>("PipeSectionName")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("管段名称");
                    b.Property<string>("PipeSpecCode")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("管段编码");
                    b.Property<decimal>("PipeWallThickness")
                        .HasColumnType("decimal(18,2)")
                        .HasComment("套管直径(mm)");
                    b.Property<DateTime?>("PlannedEndTime")
                        .HasColumnType("datetime(6)")
                        .HasComment("计划完成时间");
                    b.Property<DateTime?>("PlannedStartTime")
                        .HasColumnType("datetime(6)")
                        .HasComment("计划开始时间");
                    b.Property<string>("PreSerialNumber")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("顺序号");
                    b.Property<string>("ProcessName")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("工序名称");
                    b.Property<string>("ProcessRouteNumber")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("工艺流向编号");
                    b.Property<string>("ProdLineCode")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("产线编码");
                    b.Property<string>("ProductCode")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("产品代码");
                    b.Property<string>("ProjectNumber")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("项目号");
                    b.Property<int>("Quantity")
                        .HasColumnType("int")
                        .HasComment("管段数量");
                    b.Property<string>("Remark")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("备注");
                    b.Property<string>("ShipNumber")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("船号");
                    b.Property<string>("Son_TaskCode")
                        .IsRequired()
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("子任务编码");
                    b.Property<int>("Sort")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int")
                        .HasDefaultValue(0)
                        .HasComment("排序");
                    b.Property<string>("TaskCode")
                        .IsRequired()
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("任务编码");
                    b.Property<string>("TeamInfo")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("班组信息");
                    b.Property<decimal>("Thickness")
                        .HasColumnType("decimal(18,2)")
                        .HasComment("壁厚(mm)");
                    b.Property<string>("Timestamp")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("时间戳");
                    b.Property<string>("WeldingHeatInput")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("法兰公称压力");
                    b.Property<int>("WorkPlanStatus")
                        .HasColumnType("int")
                        .HasComment("计划状态");
                    b.Property<string>("WorkstationCode")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)")
                        .HasComment("工位代码");
                    b.HasKey("Id");
                    b.HasIndex("DataIdentifier");
                    b.HasIndex("PlannedEndTime");
                    b.HasIndex("PlannedStartTime");
                    b.HasIndex("Son_TaskCode")
                        .IsUnique();
                    b.ToTable("scms_worktasks", (string)null);
                    b.HasComment("作业任务表");
                });
#pragma warning restore 612, 618
        }
    }
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Scripts/UpdateMigrations.bat
@@ -1,6 +1,6 @@
cd ../
::dotnet ef migrations add InitialCreate -c CMSPluginDbContext -o Migrations
dotnet ef migrations add Update1 -c CMSPluginDbContext -o Migrations
dotnet ef migrations add Update2 -c CMSPluginDbContext -o Migrations
::dotnet ef migrations add Update2 -c CMSPluginDbContext -o Migrations
::dotnet ef migrations add Update3 -c CMSPluginDbContext -o Migrations
cmd
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/Templete/Web/Controllers/EntityModeQueryDrawerÄ£°å.txt
@@ -20,6 +20,8 @@
  FILTER_MODE_OPTIONS_NUM,
  FILTER_MODE_OPTIONS_BOOL
} from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions';
// å¼•入公共表单工具文件
import { collectFormDataForHighQuery,onResetForHighSelect,onResetForHighQuery } from '@/utils/myformUtils';
import { 
  BOOLEAN_OPTIONS
} from '@/utils/commonOptionConstants';
@@ -122,7 +124,7 @@
  const onClose = (done: () => void) => {
    if (visible.value) {
      visible.value = false
      const data =commonGetFormData();
      const data =collectFormDataForHighQuery(formItems,formData);
      ctx.emit('close', data)
    }
  }
@@ -130,46 +132,20 @@
   * ç¡®è®¤æŸ¥è¯¢
   */
  const onConfirmQuery = async () => {
    const data =commonGetFormData();
    const data =collectFormDataForHighQuery(formItems,formData);
    ctx.emit('confirmQuery', data)
  }
  /**
   * é‡ç½®å…¬å…±select查询
   */
  const onResetForHighSelect = () => {
      // éåŽ†æ‰€æœ‰è¡¨å•å­—æ®µ
      formItems.forEach(item => {
        // æ£€æŸ¥å­—段是否有高级查询的过滤模式配置
        if (item.highSelectAttrs && item.highSelectAttrs.prop) {
          const filterModeProp = item.highSelectAttrs.prop;
          const options = item.highSelectAttrs.options || [];
          // å¦‚果存在选项,则设置为第一个选项的值
          if (options.length > 0) {
            // å‡è®¾é€‰é¡¹æ ¼å¼ä¸º { value, label } æˆ–类似结构
            const firstValue = options[0].value !== undefined ? options[0].value : options[0];
            formData.value[filterModeProp] = firstValue;
          }
        }
      });
  }  
    /**
    * é‡ç½®æŸ¥è¯¢ - ä¼˜åŒ–版
    */
    const onReset = async () => {
        // 1. æ¸…空所有基础字段(不包含过滤模式字段)
        const baseFields = formItems.reduce((acc, item) => {
        acc[item.prop] = '';
        return acc;
        }, {});
        // 1. æ¸…空所有基础字段(不包含过滤模式字段),应用基础字段初始值
        onResetForHighQuery(formItems,formData);
  
        // 2. åº”用基础字段初始值
        formData.value = { ...baseFields };
        // 2. ä½¿ç”¨åŽŸæœ‰æ–¹æ³•é‡ç½®è¿‡æ»¤æ¨¡å¼å­—æ®µ
        onResetForHighSelect();
  
        // 3. ä½¿ç”¨åŽŸæœ‰æ–¹æ³•é‡ç½®è¿‡æ»¤æ¨¡å¼å­—æ®µ
        onResetForHighSelect(); // ä¿ç•™åŽŸæœ‰æ–¹æ³•è°ƒç”¨
        // 4. å‘父组件发送自定义事件
        // 3. å‘父组件发送自定义事件
        ctx.emit('restQuery');
    }