| | |
| | | title: '', |
| | | isAdd: false, |
| | | }) |
| | | |
| | | const dialogConfigForQuery = reactive({ |
| | | visible: false, |
| | | title: '', |
| | | isAdd: false, |
| | | }) |
| | | const dialogSettingConfig = reactive({ |
| | | visible: false, |
| | | 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 onConfirmWmsContainer = async () => { |
| | | dialogConfig.visible = false |
| | | if (dialogConfig.isAdd) { |
| | |
| | | } |
| | | } |
| | | /** |
| | | |
| | | * å¯¼åº |
| | | */ |
| | | const onExport = () => { |
| | | const params = tableRef.value?.getParams() |
| | | exportFile('/api/v1/HIAWms/wmsContainer/export', params, 'wmsContainer') |
| | | const onExport = (data = {}) => { |
| | | //const params = tableRef.value?.getParams() |
| | | exportFile('/api/v1/HIAWms/wmsContainer/export', data, 'æç管ç') |
| | | } |
| | | |
| | | /** |
| | |
| | | current, |
| | | search, |
| | | sort, |
| | | dialogConfigForQuery, |
| | | wmsContainerColumns, |
| | | paginationParams, |
| | | headers, |
| | |
| | | onRowClick, |
| | | onConfirmWmsContainer, |
| | | onCheck, |
| | | onAdvancedQuery, |
| | | onAddWmsContainer, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { |
| | | ref, |
| | | onMounted, |
| | | reactive, |
| | | computed, |
| | | Ref, |
| | | watch, |
| | | SetupContext, |
| | | h, |
| | | } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { WmsContainerDrawer } from '../Models/WmsContainerDrawer' |
| | | 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 { BOOLEAN_OPTIONS } from '@/utils/commonOptionConstants' |
| | | |
| | | export const useWmsContainerQueryDrawer = (props: any, ctx?: any) => { |
| | | const wmsContainerDrawer = |
| | | injectModel<WmsContainerDrawer>('WmsContainerDrawer') |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | | 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: 'containerNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æçç¼å·', |
| | | highSelectAttrs: { |
| | | prop: 'containerNo_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options: FILTER_MODE_OPTIONS_STRING, |
| | | }, |
| | | }, |
| | | { |
| | | label: 'æçç±»å', |
| | | prop: 'containerType', |
| | | el: 'select', |
| | | clearable: true, |
| | | option: [], |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æçç±»å', |
| | | highSelectAttrs: { |
| | | prop: 'containerType_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options: FILTER_MODE_OPTIONS_BOOL, |
| | | }, |
| | | }, |
| | | { |
| | | label: 'æçç¶æ', |
| | | prop: 'containerStatus', |
| | | el: 'select', |
| | | clearable: true, |
| | | option: [], |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æçç¶æ', |
| | | highSelectAttrs: { |
| | | prop: 'containerStatus_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options: FILTER_MODE_OPTIONS_BOOL, |
| | | }, |
| | | }, |
| | | { |
| | | label: 'é¿åº¦', |
| | | prop: 'specLength', |
| | | el: (props: any, { attrs }: SetupContext) => { |
| | | return h(inputNumber, { |
| | | ...props, |
| | | clearable: true, |
| | | ...attrs, |
| | | }) |
| | | }, |
| | | width: '100%', |
| | | step: 0.01, |
| | | precision: 2, |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥é¿åº¦', |
| | | highSelectAttrs: { |
| | | prop: 'specLength_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options: FILTER_MODE_OPTIONS_NUM, |
| | | }, |
| | | }, |
| | | { |
| | | label: '宽度', |
| | | prop: 'specWidth', |
| | | el: (props: any, { attrs }: SetupContext) => { |
| | | return h(inputNumber, { |
| | | ...props, |
| | | clearable: true, |
| | | ...attrs, |
| | | }) |
| | | }, |
| | | width: '100%', |
| | | step: 0.01, |
| | | precision: 2, |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å®½åº¦', |
| | | highSelectAttrs: { |
| | | prop: 'specWidth_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options: FILTER_MODE_OPTIONS_NUM, |
| | | }, |
| | | }, |
| | | { |
| | | label: 'é«åº¦', |
| | | prop: 'specHeight', |
| | | el: (props: any, { attrs }: SetupContext) => { |
| | | return h(inputNumber, { |
| | | ...props, |
| | | clearable: true, |
| | | ...attrs, |
| | | }) |
| | | }, |
| | | width: '100%', |
| | | step: 0.01, |
| | | precision: 2, |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥é«åº¦', |
| | | highSelectAttrs: { |
| | | prop: 'specHeight_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options: FILTER_MODE_OPTIONS_NUM, |
| | | }, |
| | | }, |
| | | { |
| | | label: 'éé¿', |
| | | prop: 'limitLength', |
| | | el: (props: any, { attrs }: SetupContext) => { |
| | | return h(inputNumber, { |
| | | ...props, |
| | | clearable: true, |
| | | ...attrs, |
| | | }) |
| | | }, |
| | | width: '100%', |
| | | step: 0.01, |
| | | precision: 2, |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥éé¿', |
| | | highSelectAttrs: { |
| | | prop: 'limitLength_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options: FILTER_MODE_OPTIONS_NUM, |
| | | }, |
| | | }, |
| | | { |
| | | label: 'é宽', |
| | | prop: 'limitWidth', |
| | | el: (props: any, { attrs }: SetupContext) => { |
| | | return h(inputNumber, { |
| | | ...props, |
| | | clearable: true, |
| | | ...attrs, |
| | | }) |
| | | }, |
| | | width: '100%', |
| | | step: 0.01, |
| | | precision: 2, |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥é宽', |
| | | highSelectAttrs: { |
| | | prop: 'limitWidth_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options: FILTER_MODE_OPTIONS_NUM, |
| | | }, |
| | | }, |
| | | { |
| | | label: 'éé«', |
| | | prop: 'limitHeight', |
| | | el: (props: any, { attrs }: SetupContext) => { |
| | | return h(inputNumber, { |
| | | ...props, |
| | | clearable: true, |
| | | ...attrs, |
| | | }) |
| | | }, |
| | | width: '100%', |
| | | step: 0.01, |
| | | precision: 2, |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥éé«', |
| | | highSelectAttrs: { |
| | | prop: 'limitHeight_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options: FILTER_MODE_OPTIONS_NUM, |
| | | }, |
| | | }, |
| | | { |
| | | label: 'è½½éä¸é', |
| | | prop: 'maxWeight', |
| | | el: (props: any, { attrs }: SetupContext) => { |
| | | return h(inputNumber, { |
| | | ...props, |
| | | clearable: true, |
| | | ...attrs, |
| | | }) |
| | | }, |
| | | width: '100%', |
| | | step: 0.01, |
| | | precision: 2, |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥è½½éä¸é', |
| | | highSelectAttrs: { |
| | | prop: 'maxWeight_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options: FILTER_MODE_OPTIONS_NUM, |
| | | }, |
| | | }, |
| | | // { |
| | | // label: 'å¼å¸¸æ°é', |
| | | // prop: 'exceptionNumber', |
| | | // el: (props: any, { attrs }: SetupContext) => { |
| | | // return h(inputNumber, { |
| | | // ...props, |
| | | // clearable: true, |
| | | // ...attrs, |
| | | // }) |
| | | // }, |
| | | // width: '100%', |
| | | // step: 1, |
| | | // precision: 0, |
| | | // //disabled: disabled, |
| | | // placeholder: '请è¾å
¥å¼å¸¸æ°é', |
| | | // highSelectAttrs: { |
| | | // prop: 'exceptionNumber_FilterMode', |
| | | // el: 'select', |
| | | // placeholder: 'è¯·éæ©', |
| | | // options: FILTER_MODE_OPTIONS_NUM, |
| | | // }, |
| | | // }, |
| | | // { |
| | | // label: 'ç©ææ°é', |
| | | // prop: 'materialNumber', |
| | | // el: (props: any, { attrs }: SetupContext) => { |
| | | // return h(inputNumber, { |
| | | // ...props, |
| | | // clearable: true, |
| | | // ...attrs, |
| | | // }) |
| | | // }, |
| | | // width: '100%', |
| | | // step: 1, |
| | | // precision: 0, |
| | | // //disabled: disabled, |
| | | // placeholder: '请è¾å
¥ç©ææ°é', |
| | | // highSelectAttrs: { |
| | | // prop: 'materialNumber_FilterMode', |
| | | // el: 'select', |
| | | // placeholder: 'è¯·éæ©', |
| | | // options: FILTER_MODE_OPTIONS_NUM, |
| | | // }, |
| | | // }, |
| | | // { |
| | | // label: 'åä½å段1 - é¢çæ©å±ç¨é', |
| | | // prop: 'redundantField1', |
| | | // el: 'input', |
| | | // //disabled: disabled, |
| | | // placeholder: '请è¾å
¥åä½å段1 - é¢çæ©å±ç¨é', |
| | | // highSelectAttrs: { |
| | | // prop: 'redundantField1_FilterMode', |
| | | // el: 'select', |
| | | // placeholder: 'è¯·éæ©', |
| | | // options: FILTER_MODE_OPTIONS_STRING, |
| | | // }, |
| | | // }, |
| | | // { |
| | | // label: 'åä½å段2 - é¢çæ©å±ç¨é', |
| | | // prop: 'redundantField2', |
| | | // el: 'input', |
| | | // //disabled: disabled, |
| | | // placeholder: '请è¾å
¥åä½å段2 - é¢çæ©å±ç¨é', |
| | | // highSelectAttrs: { |
| | | // prop: 'redundantField2_FilterMode', |
| | | // el: 'select', |
| | | // placeholder: 'è¯·éæ©', |
| | | // options: FILTER_MODE_OPTIONS_STRING, |
| | | // }, |
| | | // }, |
| | | // { |
| | | // label: 'åä½å段3 - é¢çæ©å±ç¨é', |
| | | // prop: 'redundantField3', |
| | | // el: 'input', |
| | | // //disabled: disabled, |
| | | // placeholder: '请è¾å
¥åä½å段3 - é¢çæ©å±ç¨é', |
| | | // highSelectAttrs: { |
| | | // prop: 'redundantField3_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, |
| | | }, |
| | | }, |
| | | // { |
| | | // 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, // æ¾å¼æ è®°ä¸ºæ¥ææ§ä»¶ |
| | | // }, |
| | | ]) |
| | | /** |
| | | * æ ¡éªæ¯å¦ææ°æ®åå |
| | | */ |
| | | const checkIsEqualObject = () => { |
| | | const data = { |
| | | formData: formData.value, |
| | | } |
| | | const check = isEqual(initiateData.value, data) |
| | | return check |
| | | } |
| | | const commonGetFormData = () => { |
| | | const data = { |
| | | containerNo: formData.value.containerNo || '', |
| | | containerNo_FilterMode: formData.value.containerNo_FilterMode || '', |
| | | containerType: formData.value.containerType || '', |
| | | containerType_FilterMode: formData.value.containerType_FilterMode || '', |
| | | containerStatus: formData.value.containerStatus || '', |
| | | containerStatus_FilterMode: |
| | | formData.value.containerStatus_FilterMode || '', |
| | | specLength: formData.value.specLength || '', |
| | | specLength_FilterMode: formData.value.specLength_FilterMode || '', |
| | | specWidth: formData.value.specWidth || '', |
| | | specWidth_FilterMode: formData.value.specWidth_FilterMode || '', |
| | | specHeight: formData.value.specHeight || '', |
| | | specHeight_FilterMode: formData.value.specHeight_FilterMode || '', |
| | | limitLength: formData.value.limitLength || '', |
| | | limitLength_FilterMode: formData.value.limitLength_FilterMode || '', |
| | | limitWidth: formData.value.limitWidth || '', |
| | | limitWidth_FilterMode: formData.value.limitWidth_FilterMode || '', |
| | | limitHeight: formData.value.limitHeight || '', |
| | | limitHeight_FilterMode: formData.value.limitHeight_FilterMode || '', |
| | | maxWeight: formData.value.maxWeight || '', |
| | | maxWeight_FilterMode: formData.value.maxWeight_FilterMode || '', |
| | | exceptionNumber: formData.value.exceptionNumber || '', |
| | | exceptionNumber_FilterMode: |
| | | formData.value.exceptionNumber_FilterMode || '', |
| | | materialNumber: formData.value.materialNumber || '', |
| | | materialNumber_FilterMode: formData.value.materialNumber_FilterMode || '', |
| | | redundantField1: formData.value.redundantField1 || '', |
| | | redundantField1_FilterMode: |
| | | formData.value.redundantField1_FilterMode || '', |
| | | redundantField2: formData.value.redundantField2 || '', |
| | | redundantField2_FilterMode: |
| | | formData.value.redundantField2_FilterMode || '', |
| | | redundantField3: formData.value.redundantField3 || '', |
| | | redundantField3_FilterMode: |
| | | formData.value.redundantField3_FilterMode || '', |
| | | remark: formData.value.remark || '', |
| | | remark_FilterMode: formData.value.remark_FilterMode || '', |
| | | creationTime: formData.value.creationTime || '', |
| | | lastModificationTime: formData.value.lastModificationTime || '', |
| | | } |
| | | return data |
| | | } |
| | | const onClose = (done: () => void) => { |
| | | if (visible.value) { |
| | | visible.value = false |
| | | const data = commonGetFormData() |
| | | ctx.emit('close', data) |
| | | } |
| | | } |
| | | /** |
| | | * 确认æ¥è¯¢ |
| | | */ |
| | | const onConfirmQuery = async () => { |
| | | const data = commonGetFormData() |
| | | ctx.emit('confirmQuery', data) |
| | | } |
| | | /** |
| | | * éç½®å
Œ
±selectæ¥è¯¢ |
| | | */ |
| | | const onResetForHighSelect = async () => { |
| | | formData.value.containerNo_FilterMode = 1 |
| | | formData.value.containerType_FilterMode = 2 |
| | | formData.value.containerStatus_FilterMode = 2 |
| | | formData.value.specLength_FilterMode = 2 |
| | | formData.value.specWidth_FilterMode = 2 |
| | | formData.value.specHeight_FilterMode = 2 |
| | | formData.value.limitLength_FilterMode = 2 |
| | | formData.value.limitWidth_FilterMode = 2 |
| | | formData.value.limitHeight_FilterMode = 2 |
| | | formData.value.maxWeight_FilterMode = 2 |
| | | formData.value.exceptionNumber_FilterMode = 2 |
| | | formData.value.materialNumber_FilterMode = 2 |
| | | formData.value.redundantField1_FilterMode = 1 |
| | | formData.value.redundantField2_FilterMode = 1 |
| | | formData.value.redundantField3_FilterMode = 1 |
| | | formData.value.remark_FilterMode = 1 |
| | | } |
| | | /** |
| | | * éç½®æ¥è¯¢ |
| | | */ |
| | | const onReset = async () => { |
| | | formData.value = {} |
| | | onResetForHighSelect() //éç½®å
Œ
±selectæ¥è¯¢ |
| | | formData.value.containerNo = '' |
| | | formData.value.containerType = '' |
| | | formData.value.containerStatus = '' |
| | | formData.value.specLength = '' |
| | | formData.value.specWidth = '' |
| | | formData.value.specHeight = '' |
| | | formData.value.limitLength = '' |
| | | formData.value.limitWidth = '' |
| | | formData.value.limitHeight = '' |
| | | formData.value.maxWeight = '' |
| | | formData.value.exceptionNumber = '' |
| | | formData.value.materialNumber = '' |
| | | formData.value.redundantField1 = '' |
| | | formData.value.redundantField2 = '' |
| | | formData.value.redundantField3 = '' |
| | | formData.value.remark = '' |
| | | formData.value.creationTime = '' |
| | | formData.value.lastModificationTime = '' |
| | | //åç¶ç»ä»¶åéèªå®ä¹äºä»¶ |
| | | 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 containerTypeEnumEnum = await wmsContainerDrawer.getWmsEnumData({ |
| | | EnumName: 'ContainerTypeEnum', |
| | | }) |
| | | updateFormItemOptions('containerType', containerTypeEnumEnum) |
| | | const containerStatusEnumEnum = await wmsContainerDrawer.getWmsEnumData({ |
| | | EnumName: 'ContainerStatusEnum', |
| | | }) |
| | | updateFormItemOptions('containerStatus', containerStatusEnumEnum) |
| | | } |
| | | commonQueryEnumForFrom() |
| | | onResetForHighSelect() //éç½®å
Œ
±selectæ¥è¯¢ |
| | | /** |
| | | * å¼¹çªæå¼è·å详æ
|
| | | */ |
| | | const onOpen = async () => { |
| | | disabled.value = false |
| | | updateCheckData() |
| | | } |
| | | |
| | | watch(() => current.value, onOpen) |
| | | |
| | | return { |
| | | formItems, |
| | | formData, |
| | | visible, |
| | | formRef, |
| | | onOpen, |
| | | onClose, |
| | | onConfirmQuery, |
| | | onReset, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsContainer = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsContainer', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsContainer = (id: string) => { |
| | | return request.get(`/api/v1/HIAWms/wmsContainer/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsContainer = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/HIAWms/wmsContainer/${id}`, data) |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸¾ |
| | | * @returns |
| | | */ |
| | | export const getWmsEnumData = (data: any) => { |
| | | return request.post('/api/v1/WareCmsUtilityApi/WmsEnum', data) |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsContainer, |
| | | getWmsContainer, |
| | | updateWmsContainer, |
| | | getWmsEnumData, |
| | | } from './Service/WmsContainerQueryDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsContainerQueryDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsContainer: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsContainer(data: Record<string, any>) { |
| | | return addWmsContainer(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsContainer(id: string, data: Record<string, any>) { |
| | | return updateWmsContainer(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsContainerDetail(current: any, id?: string) { |
| | | return getWmsContainer(id || current?.id) |
| | | } |
| | | |
| | | // è·åæä¸¾å¼ |
| | | async getWmsEnumData(data: Record<string, any>) { |
| | | return getWmsEnumData(data) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .drawer { |
| | | width: 800px; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * ç©æåºç¡ä¿¡æ¯æ¥è¯¢å¼¹åºæ¡ |
| | | */ |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseQueryDrawer from '@/components/BaseQueryDrawer/BaseQueryDrawer' |
| | | import styles from './WmsContainerQueryDrawer.module.scss' |
| | | import { useWmsContainerQueryDrawer } from '../../../../Controllers/WmsContainerQueryDrawer.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, |
| | | } = useWmsContainerQueryDrawer(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> |
| | | ) |
| | | }, |
| | | }) |
| | |
| | | .wmsContainerContent { |
| | | width: 100%; |
| | | height: 90%; |
| | | height: 100%; |
| | | |
| | | .wmsContainerList { |
| | | width: 100%; |
| | |
| | | .header { |
| | | margin-bottom: 12px; |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | justify-content: flex-end; |
| | | align-items: center; |
| | | } |
| | | } |
| | |
| | | .hideBlock { |
| | | display: none; |
| | | } |
| | | |
| | | .queryForm { |
| | | padding: 10px; |
| | | background: #f5f7fa; |
| | |
| | | import { useWmsContainer } from '../../../Controllers/WmsContainer' |
| | | import IconButton from '@/components/IconButton/IconButton' |
| | | import WmsContainerDrawer from '../Dialog/WmsContainerDrawer/WmsContainerDrawer' |
| | | import WmsContainerQueryDrawer from '../Dialog/WmsContainerQueryDrawer/WmsContainerQueryDrawer' |
| | | import Search from '@/components/Search/Search' |
| | | import { columns } from './Config' |
| | | import TdButton from '@/components/TdButton/TdButton' |
| | | import { vPermission } from '@/libs/Permission/Permission' |
| | | import { getWmsEnumData } from '@/widgets/HIAWms/Models/Service/WmsMaterialDrawer' |
| | | import { ElForm, ElFormItem, ElInput, ElOption, ElSelect } from 'element-plus' |
| | | import dayjs from 'dayjs' |
| | | import { getWmsEnumData } from '@/widgets/WmsContainer/Models/Service/WmsContainerDrawer' |
| | | 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, |
| | | contextMenu, |
| | | dialogConfig, |
| | | dialogConfigForQuery, |
| | | tableRef, |
| | | current, |
| | | search, |
| | |
| | | onConfirmWmsContainer, |
| | | onCheck, |
| | | onAddWmsContainer, |
| | | onAdvancedQuery, |
| | | onExport, |
| | | openDetail, |
| | | onSuccess, |
| | | onBeforeUpload, |
| | | } = useWmsContainer(props, ctx) |
| | | |
| | | //å®ä¹é«çº§æ¥è¯¢å¼ç¨ |
| | | const wmsContainerQueryDrawerRef = ref(null) |
| | | // æ°å¢çæ¥è¯¢æ¡ä»¶ |
| | | const queryForm = ref({ |
| | | containerNo: '', |
| | | containerType: '', |
| | | containerStatus: '', |
| | | filter: '', |
| | | searchVal: '', |
| | | str_searchFormInputAttrs: [], |
| | | searchVal_FilterMode: '', |
| | | }) |
| | | |
| | | const queryParams = computed(() => ({ |
| | | ...queryForm.value, |
| | | containerType: queryForm.value.containerType || '', // å¤ç䏿 |
| | | containerStatus: queryForm.value.containerStatus || '', |
| | | })) |
| | | //å®ä¹æ´ä½æ¨¡ç³æ¥è¯¢çåæ°ç»(注æï¼å¿
须大å°åè·å端çå®ä½ç±»å±æ§åä¸è´ï¼å¦åä¼å¯¼è´å¹é
ä¸å¯¹çé®é¢) |
| | | const _searchFormInputAttrs = ref(['ContainerNo']) |
| | | const searchFormInputAttrs_Placeholder = ref('请è¾å
¥æçç¼å·') |
| | | |
| | | // 卿æä¸¾é项 |
| | | const enumOptions = reactive({ |
| | |
| | | // è·åæä¸¾æ°æ® |
| | | const fetchEnumData = async () => { |
| | | try { |
| | | // è·åç©æç±»åæä¸¾ |
| | | const containerTypeData = await getWmsEnumData({ |
| | | const containerTypeEnumData = await getWmsEnumData({ |
| | | EnumName: 'ContainerTypeEnum', |
| | | }) |
| | | enumOptions.containerType = containerTypeData.map((item) => ({ |
| | | enumOptions.containerType = containerTypeEnumData.map((item) => ({ |
| | | label: item.description, |
| | | value: item.value, |
| | | })) |
| | | |
| | | // è·åéè´ç±»åæä¸¾ |
| | | const containerStatusData = await getWmsEnumData({ |
| | | const containerStatusEnumData = await getWmsEnumData({ |
| | | EnumName: 'ContainerStatusEnum', |
| | | }) |
| | | enumOptions.containerStatus = containerStatusData.map((item) => ({ |
| | | enumOptions.containerStatus = containerStatusEnumData.map((item) => ({ |
| | | label: item.description, |
| | | value: item.value, |
| | | })) |
| | |
| | | } |
| | | } |
| | | |
| | | // å®ä¹ååºå¼æ¥è¯¢æ°æ® |
| | | 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 handleQuery = async () => { |
| | | console.log('æ¥è¯¢æ¡ä»¶:', queryParams.value) |
| | | // tableRef.value.getTableList() |
| | | tableRef.value.getList(queryParams.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 = { |
| | | containerNo: '', |
| | | containerType: '', |
| | | containerStatus: '', |
| | | filter: '', |
| | | 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 |
| | | } |
| | | |
| | | /** |
| | |
| | | params, |
| | | autoHeight, |
| | | } = props |
| | | console.log(dataSource.value) |
| | | |
| | | return ( |
| | | <div |
| | | class={{ |
| | |
| | | onCheck={onCheck} |
| | | onRowClick={onRowClick} |
| | | isHidePagination={isHidePagination} |
| | | pageSize={50} |
| | | pageSize={20} |
| | | v-slots={{ |
| | | isDisabled: ({ row }: any) => { |
| | | return ( |
| | | <div> |
| | | {row.isDisabled != null |
| | | ? row.isDisabled |
| | | ? 'æ¯' |
| | | : 'å¦' |
| | | : '-'} |
| | | </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> |
| | | ) |
| | | }, |
| | | name: ({ row }: any) => { |
| | | return row?.name ? ( |
| | | <TdButton |
| | |
| | | </div> |
| | | ) |
| | | } |
| | | |
| | | return () => { |
| | | return ( |
| | | <div class={styles.wmsContainerContent}> |
| | |
| | | sort={sort.value} |
| | | onConfirm={onConfirmWmsContainer} |
| | | /> |
| | | |
| | | {/* æ°å¢çæ¥è¯¢è¡¨å */} |
| | | <ElForm |
| | | inline |
| | | model={queryForm.value} |
| | | class={styles.queryForm} |
| | | label-width="80px" |
| | | > |
| | | <ElFormItem label="å
³é®å"> |
| | | <ElInput |
| | | v-model={queryForm.value.filter} |
| | | placeholder="请è¾å
¥å
³é®åæç´¢" |
| | | clearable |
| | | class={styles.formItem} |
| | | {/* é«çº§æ¥è¯¢ */} |
| | | <WmsContainerQueryDrawer |
| | | ref="wmsContainerQueryDrawerRef" |
| | | v-model={dialogConfigForQuery.visible} |
| | | title={dialogConfigForQuery.title} |
| | | row={current.value} |
| | | sort={sort.value} |
| | | onConfirmQuery={handleQuery} |
| | | onRestQuery={resetQuery} |
| | | onClose={closeQuery} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="ç©æç¼ç "> |
| | | <ElInput |
| | | v-model={queryForm.value.containerNo} |
| | | placeholder="请è¾å
¥æçç¼ç " |
| | | clearable |
| | | class={styles.formItem} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="ç©æç±»å"> |
| | | <ElSelect |
| | | v-model={queryForm.value.containerType} |
| | | placeholder="è¯·éæ©æçç±»å" |
| | | clearable |
| | | loading={enumOptions.containerType.length === 0} |
| | | class={styles.formItem} |
| | | > |
| | | {enumOptions.containerType.map((option) => ( |
| | | <ElOption |
| | | key={option.value} |
| | | label={option.label} |
| | | value={option.value} |
| | | /> |
| | | ))} |
| | | </ElSelect> |
| | | </ElFormItem> |
| | | <ElFormItem label="æçç¶æ"> |
| | | <ElSelect |
| | | v-model={queryForm.value.containerStatus} |
| | | placeholder="è¯·éæ©æçç¶æ" |
| | | clearable |
| | | loading={enumOptions.containerStatus.length === 0} |
| | | class={styles.formItem} |
| | | > |
| | | {enumOptions.containerStatus.map((option) => ( |
| | | <ElOption |
| | | key={option.value} |
| | | label={option.label} |
| | | value={option.value} |
| | | /> |
| | | ))} |
| | | </ElSelect> |
| | | </ElFormItem> |
| | | {/* <ElFormItem label="æ¥æèå´"> |
| | | <ElDatePicker |
| | | v-model={queryForm.value.dateRange} |
| | | type="daterange" |
| | | range-separator="è³" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | value-format="YYYY-MM-DD" |
| | | /> |
| | | </ElFormItem> */} |
| | | <ElFormItem> |
| | | <IconButton type="primary" icon="search" onClick={handleQuery}> |
| | | æ¥è¯¢ |
| | | </IconButton> |
| | | <IconButton |
| | | style="margin-left: 10px;" |
| | | icon="refresh" |
| | | onClick={resetQuery} |
| | | > |
| | | éç½® |
| | | </IconButton> |
| | | </ElFormItem> |
| | | </ElForm> |
| | | |
| | | <div class={styles.headerContent}> |
| | | <div class={styles.header}> |
| | |
| | | æ·»å |
| | | </IconButton> |
| | | <el-divider direction="vertical" /> |
| | | |
| | | <el-upload |
| | | v-permission="wmsContainer-import" |
| | | name="file" |
| | |
| | | <IconButton |
| | | v-permission="wmsContainer-output" |
| | | icon="out" |
| | | onClick={onExport} |
| | | onClick={handleExport} |
| | | > |
| | | å¯¼åº |
| | | </IconButton> |
| | | </div> |
| | | {/* <Search |
| | | placeholder="请è¾å
¥å
³é®å" |
| | | v-model={search.value} |
| | | onConfirm={onSearch} |
| | | style={{ marginTop: '-1px' }} |
| | | /> */} |
| | | <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="wmsContainer-add" |
| | | icon="search" |
| | | onClick={onAdvancedQuery} |
| | | type="primary" |
| | | > |
| | | é«çº§æ¥è¯¢ |
| | | </IconButton> |
| | | </ElFormItem> |
| | | </div> |
| | | |
| | | <RenderBaseTable |
| | | url="/api/v1/HIAWms/wmsContainer" |
| | | url="/api/v1/HIAWms/wmsContainer/page" |
| | | dataSource={dataSource} |
| | | isChecked={true} |
| | | isDrag={true} |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | using CmsQueryExtensions.Extension; |
| | | using Volo.Abp.Application.Dtos; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsContainer; |
| | | |
| | | /// <summary> |
| | | /// WmsContaineræ¥è¯¢åæ°å¯¹è±¡ |
| | | /// æçç®¡çæ¥è¯¢åæ° |
| | | /// </summary> |
| | | public class GetWmsContainerInput : ExtensiblePagedAndSortedResultRequestDto |
| | | { |
| | | /// <summary> |
| | | /// Gets or sets the filter. |
| | | /// </summary> |
| | | public string Filter { get; set; } |
| | | |
| | | #region å
³é®åæ¥è¯¢ |
| | | |
| | | /// <summary> |
| | | /// Gets or sets the name. |
| | | /// å
³é®åæ¨¡ç³æ¥è¯¢ï¼æ³¨ææ¯å°åï¼ï¼ |
| | | /// </summary> |
| | | public string Name { get; set; } |
| | | public string searchVal { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éç¨æ¥è¯¢é
ç½® (1:æ¨¡ç³æ¥è¯¢ , 2:ç²¾åæ¥è¯¢)ï¼æ³¨ææ¯å°åï¼ï¼ |
| | | /// </summary> |
| | | public SearchFilterModeEnum searchVal_FilterMode { get; set; } = SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// åæç´¢ç»ä»¶ä¼ éçéç¨æ¥è¯¢é
ç½®ç屿§åï¼æ³¨ææ¯å°åï¼ï¼ |
| | | /// </summary> |
| | | [NoAutoQuery] |
| | | public string str_searchFormInputAttrs { get; set; } |
| | | /// <summary> |
| | | /// åæç´¢ç»ä»¶ä¼ éçéç¨æ¥è¯¢é
ç½®ç屿§åï¼æ³¨ææ¯å°åï¼ï¼ |
| | | /// </summary> |
| | | public List<string> searchFormInputAttrs |
| | | { |
| | | get |
| | | { |
| | | if (!string.IsNullOrEmpty(str_searchFormInputAttrs)) |
| | | { |
| | | return str_searchFormInputAttrs.Split(',').ToList(); |
| | | } |
| | | return new List<string>(); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// æçç¼å· |
| | |
| | | public string ContainerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¼å·-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum ContainerNo_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// æçç±»å |
| | | /// </summary> |
| | | public ContainerTypeEnum ContainerType { get; set; } |
| | | public ContainerTypeEnum? ContainerType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç±»å-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum ContainerType_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// æçç¶æ |
| | | /// </summary> |
| | | public ContainerStatusEnum ContainerStatus { get; set; } |
| | | public ContainerStatusEnum? ContainerStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¶æ-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum ContainerStatus_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// é¿åº¦ |
| | | /// </summary> |
| | | public decimal? SpecLength { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¿åº¦-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum SpecLength_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// 宽度 |
| | | /// </summary> |
| | | public decimal? SpecWidth { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 宽度-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum SpecWidth_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// é«åº¦ |
| | | /// </summary> |
| | | public decimal? SpecHeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é«åº¦-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum SpecHeight_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// éé¿ |
| | | /// </summary> |
| | | public decimal? LimitLength { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éé¿-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum LimitLength_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// é宽 |
| | | /// </summary> |
| | | public decimal? LimitWidth { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é宽-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum LimitWidth_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// éé« |
| | | /// </summary> |
| | | public decimal? LimitHeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éé«-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum LimitHeight_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// è½½éä¸é |
| | | /// </summary> |
| | | public decimal? MaxWeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è½½éä¸é-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum MaxWeight_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// å¼å¸¸æ°é |
| | | /// </summary> |
| | | public int? ExceptionNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¼å¸¸æ°é-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum ExceptionNumber_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// ç©ææ°é |
| | | /// </summary> |
| | | public int? MaterialNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©ææ°é-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum MaterialNumber_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段1 - é¢çæ©å±ç¨é-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum RedundantField1_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段2 - é¢çæ©å±ç¨é-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum RedundantField2_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½å段3 - é¢çæ©å±ç¨é-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum RedundantField3_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// æåº |
| | | /// </summary> |
| | | public int? Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåº-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum Sort_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum Remark_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨-æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum IsDisabled_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public string CreationTime { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string CreatorId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// -æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum CreatorId_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public string LastModificationTime { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string LastModifierId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// -æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum LastModifierId_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public bool? IsDeleted { get; set; } |
| | | |
| | | /// <summary> |
| | | /// -æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum IsDeleted_FilterMode { get; set; }= SearchFilterModeEnum.ç²¾åæ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string DeleterId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// -æ¥è¯¢å
³ç³»è¿ç®ç¬¦ |
| | | /// </summary> |
| | | public SearchFilterModeEnum DeleterId_FilterMode { get; set; }= SearchFilterModeEnum.æ¨¡ç³æ¥è¯¢; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public string DeletionTime { get; set; } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsContainers; |
| | | using CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | using CmsQueryExtensions; |
| | | using CmsQueryExtensions.Extension; |
| | | using System.Linq.Expressions; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Data; |
| | |
| | | input.Sorting = nameof(WmsContainer.Sort); |
| | | } |
| | | |
| | | var specification = new WmsContainerSpecification(input.Name); |
| | | var container = ObjectMapper.Map < GetWmsContainerInput, WmsContainer>(input); |
| | | var count = await _wmscontainerRepository.GetCountAsync(container,input.Filter, specification); |
| | | var list = await _wmscontainerRepository.GetListAsync(container,input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification); |
| | | #region 卿æé æ¥è¯¢æ¡ä»¶ |
| | | |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | var count = await _wmscontainerRepository.GetCountAsync(whereConditions); |
| | | var list = await _wmscontainerRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount); |
| | | |
| | | return new PagedResultDto<WmsContainerDto>(count, ObjectMapper.Map<List<WmsContainer>, List<WmsContainerDto>>(list)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 卿æé æ¥è¯¢æ¡ä»¶ |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥åæ°</param> |
| | | /// <returns></returns> |
| | | private FunReturnResultModel<Expression<Func<WmsContainer, bool>>> DynamicGetQueryParams(GetWmsContainerInput input) |
| | | { |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = WhereConditionsExtensions.GetWhereConditions<WmsContainer, GetWmsContainerInput>(input); |
| | | if (!whereConditions.IsSuccess) |
| | | { |
| | | throw new Exception("卿æé æ¥è¯¢æ¡ä»¶å¤±è´¥:" + whereConditions.ErrMsg); |
| | | } |
| | | |
| | | //ä¹å¯å次èªå®ä¹æå»ºæ¥è¯¢æ¡ä»¶ |
| | | Expression<Func<WmsContainer, bool>> extendExpression = a => a.IsDeleted == false; |
| | | // ä½¿ç¨ System.Linq.PredicateBuilder ç And |
| | | var pres = (System.Linq.Expressions.Expression<Func<WmsContainer, bool>>)(whereConditions.data); |
| | | whereConditions.data = System.Linq.PredicateBuilder.And(pres, extendExpression); |
| | | |
| | | return whereConditions; |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | /// <summary> |
| | | /// å¯¼åºæç管ç |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsContainerInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | |
| | | input.Sorting = nameof(WmsContainer.Sort); |
| | | } |
| | | |
| | | var specification = new WmsContainerSpecification(input.Name); |
| | | var container = ObjectMapper.Map<GetWmsContainerInput, WmsContainer>(input); |
| | | var list = await _wmscontainerRepository.GetListAsync(container,input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification, includeDetails: true); |
| | | #region 卿æé æ¥è¯¢æ¡ä»¶ |
| | | |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | var list = await _wmscontainerRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount, includeDetails: true); |
| | | var result = ObjectMapper.Map<List<WmsContainer>, List<WmsContainerDto>>(list); |
| | | |
| | | var sheets = new Dictionary<string, object> |
| | |
| | | ["é
ç½®"] = ExportHelper.ConvertListToExportData(result), |
| | | }; |
| | | |
| | | var fileName = result.Count > 1 ? "WmsContainerå表" : result.Count == 1 ? result.First()?.ContainerNo : "WmsContainer模ç"; |
| | | var fileName = "æç管ç"; |
| | | return (sheets, fileName); |
| | | } |
| | | |
| | |
| | | using CmsQueryExtensions.Extension; |
| | | using System.Linq.Expressions; |
| | | using Volo.Abp.Domain.Repositories; |
| | | using Volo.Abp.Specifications; |
| | | |
| | |
| | | /// <param name="includeDetails">if set to <c>true</c> [include details].</param> |
| | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | /// <returns></returns> |
| | | Task<List<WmsContainer>> GetListAsync(WmsContainer? container, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, string filter = null, Specification<WmsContainer> specification = null, bool includeDetails = false, CancellationToken cancellationToken = default); |
| | | Task<List<WmsContainer>> GetListAsync(FunReturnResultModel<Expression<Func<WmsContainer, bool>>> whereConditions, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, bool includeDetails = false, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// Gets the count asynchronous. |
| | |
| | | /// <param name="specification">The specification.</param> |
| | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | /// <returns></returns> |
| | | Task<long> GetCountAsync(WmsContainer? container, string filter = null, Specification<WmsContainer> specification = null, CancellationToken cancellationToken = default); |
| | | Task<long> GetCountAsync(FunReturnResultModel<Expression<Func<WmsContainer, bool>>> whereConditions, CancellationToken cancellationToken = default); |
| | | } |
| | |
| | | using System.Linq.Dynamic.Core; |
| | | using System.Linq.Expressions; |
| | | using CMS.Plugin.HIAWms.Domain.WmsContainers; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | using CmsQueryExtensions.Extension; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢å表 |
| | | /// è·åå页å表æç管ç |
| | | /// </summary> |
| | | /// <param name="container"></param> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="sorting"></param> |
| | | /// <param name="maxResultCount"></param> |
| | | /// <param name="skipCount"></param> |
| | | /// <param name="filter"></param> |
| | | /// <param name="specification"></param> |
| | | /// <param name="includeDetails"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<List<WmsContainer>> GetListAsync(WmsContainer? container,string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, string filter = null, Specification<WmsContainer> specification = null, bool includeDetails = false, CancellationToken cancellationToken = default) |
| | | public async Task<List<WmsContainer>> GetListAsync(FunReturnResultModel<Expression<Func<WmsContainer, bool>>> whereConditions, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, bool includeDetails = false, CancellationToken cancellationToken = default) |
| | | { |
| | | specification ??= new WmsContainerSpecification(); |
| | | return await (await GetDbSetAsync()) |
| | | .IncludeDetails(includeDetails) |
| | | .Where(specification.ToExpression()) |
| | | .WhereIf(whereConditions != null, whereConditions.data) |
| | | .Where(x => !x.IsDeleted) |
| | | .WhereIf(!filter.IsNullOrWhiteSpace(), u => u.ContainerNo.Contains(filter)) |
| | | .WhereIf(!string.IsNullOrEmpty(container.ContainerNo),u=>u.ContainerNo.Contains(container.ContainerNo)) |
| | | .WhereIf(container.ContainerStatus>0, u=>u.ContainerStatus == u.ContainerStatus) |
| | | .WhereIf(container.ContainerType>0, u=>u.ContainerType == u.ContainerType) |
| | | .OrderBy(sorting.IsNullOrEmpty() ? nameof(WmsContainer.Sort) : sorting) |
| | | .OrderByDescending(x => x.CreationTime) |
| | | .PageBy(skipCount, maxResultCount) |
| | | .ToListAsync(GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢æ°é |
| | | /// è·åæ»æ°æç管ç |
| | | /// </summary> |
| | | /// <param name="container"></param> |
| | | /// <param name="filter"></param> |
| | | /// <param name="specification"></param> |
| | | /// <param name="whereConditions"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<long> GetCountAsync(WmsContainer? container, string filter = null, Specification<WmsContainer> specification = null, CancellationToken cancellationToken = default) |
| | | public async Task<long> GetCountAsync(FunReturnResultModel<Expression<Func<WmsContainer, bool>>> whereConditions, CancellationToken cancellationToken = default) |
| | | { |
| | | specification ??= new WmsContainerSpecification(); |
| | | return await (await GetQueryableAsync()) |
| | | .Where(specification.ToExpression()) |
| | | .WhereIf(whereConditions != null, whereConditions.data) |
| | | .Where(x => !x.IsDeleted) |
| | | .WhereIf(!string.IsNullOrEmpty(container.ContainerNo), u => u.ContainerNo.Contains(container.ContainerNo)) |
| | | .WhereIf(container.ContainerStatus > 0, u => u.ContainerStatus == u.ContainerStatus) |
| | | .WhereIf(container.ContainerType > 0, u => u.ContainerType == u.ContainerType) |
| | | .WhereIf(!filter.IsNullOrWhiteSpace(), u => u.ContainerNo.Contains(filter)) |
| | | .CountAsync(cancellationToken: GetCancellationToken(cancellationToken)); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | [表å]:scms_wmscontainers |
| | | [å®ä½ç±»å]:WmsContainer |
| | | [å®ä½ç±»å¯¹è±¡å]:WmsContainer |
| | | [页é¢èåå]:æç管ç |
| | | [页é¢èå对象缩å]:wmsContainer |
| | | [表çä¸ææ³¨è§£]:æç管ç |
| | | [é夿§æ ¡éªå段]:ContainerNo |
| | | [å é¤æç¤ºåæ®µ]:ContainerNo |
| | | [æ¨¡ç³æ¥è¯¢å段]:'ContainerNo' |
| | | [æ¨¡ç³æ¥è¯¢å段å]:请è¾å
¥æçç¼å· |
| | | [项ç®å½å空é´]:HIAWms |
| | | [æä¸¾ç±»ååæ®µéå]:ContainerType,ContainerTypeEnum&ContainerStatus,ContainerStatusEnum |
| | | [åç«¯æ ¹æä»¶å¤¹åç§°]:web |
| | | [æåº]:CreationTime |