diff --git a/src/api/wms/countadjustRequestMain/index.ts b/src/api/wms/countadjustRequestMain/index.ts index 903e29a00..ea1246e4c 100644 --- a/src/api/wms/countadjustRequestMain/index.ts +++ b/src/api/wms/countadjustRequestMain/index.ts @@ -57,6 +57,13 @@ export const exportCountadjustRequestMain = async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} + var a = { + "action":"==", + "column":"role", + "value":data.role, + } + data.filters.push(a); + return request.downloadPost({ url: '/wms/countadjust-request-main/export-excel-senior', data }) } else { return await request.download({ url: `/wms/countadjust-request-main/export-excel`, params }) diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue index 1a05e5079..19854cc1e 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -390,6 +390,12 @@ const props = defineProps({ type: Array, required: false, default: null + }, + // tableObject 数据过滤条件 针对 详情扩展标签页 传入不同条件 + tableObjectExtendObj: { + type: Array, + required: false, + default: null }, // tableObject 数据过滤条件 针对 详情扩展标签页 传入不同条件 extendRowKeyValue: { @@ -890,7 +896,26 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: // }) // } // buttondata.value = [...detailButtonEdit,...detailButtonDelete,...buttondataTable.value] + // 如果tab第一列就是列表 + if (props.tabsExtend) { + const { tableObject, tableMethods } = useTable({ + getListApi: props.apiPage // 分页接口 + }) + tableObject.params.masterId = masterParmas.value.masterId + detailAllSchemasRef.value = props.detailAllSchemas + if (props.extendRowKeyValue) { + // params 扩展的字段 + props.extendRowKeyValue.forEach(item => { + tableObject.params[item.key] = row[item.value] + masterParmas.value[item.key] =row[item.value] + }) + } + tableObjectRef.value = tableObject + tableMethodsRef.value = tableMethods + const { getList } = tableMethods + await getList() + } } finally { detailLoading.value = false } @@ -943,6 +968,7 @@ const updateList =async ()=>{ }) } else { await tableMethodsRef.value.getList() + updateKey.value += 1 } } diff --git a/src/views/wms/countManage/count/countCompareDetail/countCompareDetail.data.ts b/src/views/wms/countManage/count/countCompareDetail/countCompareDetail.data.ts index e09448cc0..c0c313cdf 100644 --- a/src/views/wms/countManage/count/countCompareDetail/countCompareDetail.data.ts +++ b/src/views/wms/countManage/count/countCompareDetail/countCompareDetail.data.ts @@ -127,7 +127,7 @@ export const CountCompareDetail = useCrudSchemas( label: '背番', field: 'backNumber', sort: 'custom', - hiddenSearchHigh:false, + hiddenSearchHigh:true, isSearch: true, table:{ width:150 @@ -136,7 +136,7 @@ export const CountCompareDetail = useCrudSchemas( { label: '车型', field: 'project', - hiddenSearchHigh:false, + hiddenSearchHigh:true, sort: 'custom', isSearch: false, table:{ diff --git a/src/views/wms/countManage/countadjust/countadjustRequestMain/index.vue b/src/views/wms/countManage/countadjust/countadjustRequestMain/index.vue index 93b039b3e..e312da0ce 100644 --- a/src/views/wms/countManage/countadjust/countadjustRequestMain/index.vue +++ b/src/views/wms/countManage/countadjust/countadjustRequestMain/index.vue @@ -337,6 +337,7 @@ const handleExport = async () => { // 发起导出 loadStart() const excelTitle = ref(route.meta.title) + tableObject.params.role = 'Finance' const data = await CountadjustRequestMainApi.exportCountadjustRequestMain(tableObject.params) download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) } catch { diff --git a/src/views/wms/countManage/countadjust/countadjustRequestManufactureMain/countadjustRequestMain.data.ts b/src/views/wms/countManage/countadjust/countadjustRequestManufactureMain/countadjustRequestMain.data.ts new file mode 100644 index 000000000..cad4a0851 --- /dev/null +++ b/src/views/wms/countManage/countadjust/countadjustRequestManufactureMain/countadjustRequestMain.data.ts @@ -0,0 +1,765 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { TableColumn } from '@/types/table' + +import { dateFormatter } from '@/utils/formatTime' +import * as getRequestsettingApi from '@/api/wms/requestsetting/index' + +import * as CountRecordMainApi from '@/api/wms/countRecordMain' +import { CountRecordMain } from '../../count/countRecordMain/countRecordMain.data' + +const { t } = useI18n() // 国际化 + +// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 +const queryParams = { + pageSize:10, + pageNo:1, + code:'CountAdjustRequest' +} + const data = await getRequestsettingApi.getRequestsettingPage(queryParams) + const requestsettingData =data?.list[0]||{} + + // 获取当前操作人的部门 +import { useUserStore } from '@/store/modules/user' +const userStore = useUserStore() +const userDept = userStore.userSelfInfo.dept + // id 转str 否则form回显匹配不到 + userDept.id = userDept.id.toString() +const userDeptArray:any = [userDept] + +/** + * @returns {Array} 盘点调整申请主表 + */ +export const CountadjustRequestMain = useCrudSchemas(([ + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 200, + fixed: 'left' + }, + isForm: false, + isSearch: true, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + isForm: false, + sort: 'custom', + table: { + width: 150 + }, + + }, + // { + // label: '任务拆分方式', + // field: 'countSplitType', + // dictType: DICT_TYPE.COUNT_SPLIT_TYPE, + // dictClass: 'string', + // sort: 'custom', + // table: { + // width: 150 + // }, + // isTable:true, + // isForm: true, + // form: { + // value: 'locationCode' + // } + // }, + // { + // label: '任务拆分值', + // field: 'countSplitCode', + // dictClass: 'string', + // sort: 'custom', + // table: { + // width: 150 + // }, + // isTable:true, + // isForm: true + // }, + // { + // label: '申请单号', + // field: 'requestNumber', + // sort: 'custom', + // table: { + // width: 150 + // }, + // isSearch: true, + // isForm: false, + // }, + { + label: '盘点申请单号', + field: 'countRequestNumber', + sort: 'custom', + table: { + width: 220 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择盘点记录单号', // 输入框占位文本 + searchField: 'number', // 查询弹窗赋值字段 + searchTitle: '盘点记录', // 查询弹窗标题 + searchAllSchemas: CountRecordMain.allSchemas, // 查询弹窗所需类 + searchPage: CountRecordMainApi.getCountRecordMainPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } + }, + + // { + // label: '调整金额合计', + // field: 'allAdjustmentPrice', + // sort: 'custom', + // table: { + // width: 150 + // }, + // form: { + // component: 'InputNumber', + // componentProps: { + // min: 1, + // precision: 2 + // } + // }, + // tableForm: { + // type: 'InputNumber', + // min: 1, + // precision: 2 + // } + // }, + + + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: {width:'100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + isForm: false, + }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: {width:'100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + table: { + width: 150, + componentProps: { + disabled: true + } + }, + isForm: false, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + isForm: false, + table: { + width: 150 + }, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userDeptArray.find((account) => account.id == cellValue)?.name + }, + form: { + value: userDept.id, + component: 'Select', + api: () => userDeptArray, + componentProps: { + disabled: true, + optionsAlias: { + labelField: 'name', + valueField: 'id' + } + } + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + isTable: false + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isForm: false, + form: { + component: 'Switch', + value: requestsettingData.autoCommit, + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE', + disabled: true + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isForm: false, + form: { + component: 'Switch', + value: requestsettingData.autoAgree, + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE', + disabled: true + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '自动执行', + field: 'autoExecute', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isForm: false, + form: { + component: 'Switch', + value: requestsettingData.autoExecute, + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE', + disabled: true + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isForm: false, + isTable: false, + form: { + component: 'Switch', + value: requestsettingData.directCreateRecord, + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE', + disabled: true + } + }, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: {width:'100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + isForm: false, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + }, + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isForm: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 300, + fixed: 'right' + }, + } +])) + +//表单校验 +export const CountadjustRequestMainRules = reactive({ + // requestNumber: [ + // { required: true, message: '请选择申请单号', trigger: 'change' } + // ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + // businessType: [ + // { required: true, message: '请输入业务类型', trigger: 'blur' } + // ], +}) + +/** + * @returns {Array} 盘点调整申请子表 + */ +export const CountadjustRequestDetail = useCrudSchemas(reactive([ + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 180 + }, + isTableForm: false, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '盘点明细号', + field: 'countDetailNumber', + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '物料代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '物料名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + isTableForm: false, + isForm: false, + }, + { + label: '物料描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + isTableForm: false, + isForm: false, + }, + { + label: '物料描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + isTableForm: false, + isForm: false, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + // { + // label: '器具号', + // field: 'containerNumber', + // sort: 'custom', + // table: { + // width: 150 + // }, + // }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + tableForm: { + type: 'Select' + } + }, + { + label: '库存数量', + field: 'inventoryQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + componentProps: { + min: 1, + precision: 6 + } + }, + tableForm: { + type: 'InputNumber', + min: 1, + precision: 6 + } + }, + { + label: '盘点数量', + field: 'countQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + componentProps: { + min: 1, + precision: 6 + } + }, + tableForm: { + type: 'InputNumber', + min: 1, + precision: 6 + } + }, + { + label: '调整数量', + field: 'adjustQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + componentProps: { + min: 1, + precision: 6 + } + }, + tableForm: { + type: 'InputNumber', + min: 1, + precision: 6 + } + }, + // { + // label: '标准成本价格', + // field: 'standardCostPrice', + // sort: 'custom', + // table: { + // width: 150 + // }, + // form: { + // component: 'InputNumber', + // componentProps: { + // min: 1, + // precision: 6 + // } + // }, + // tableForm: { + // type: 'InputNumber', + // min: 1, + // precision: 6 + // } + // }, + + // { + // label: '调整后金额', + // field: 'adjustmentPrice', + // sort: 'custom', + // table: { + // width: 150 + // }, + // form: { + // component: 'InputNumber', + // componentProps: { + // min: 1, + // precision: 2 + // } + // }, + // tableForm: { + // type: 'InputNumber', + // min: 1, + // precision: 2 + // } + // }, + { + label: '仓库代码', + field: 'warehouseCode', + sort: 'custom', + table: { + width: 150 + }, + }, + + { + label: '库区代码', + field: 'areaCode', + sort: 'custom', + table: { + width: 150 + }, + },{ + label: '库位组代码', + field: 'locationGroupCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库位代码', + field: 'locationCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + tableForm: { + type: 'Select' + } + }, + { + label: '项目代码', + field: 'projectCode', + sort: 'custom', + table: { + width: 150 + }, + isTableForm: false, + isForm: false, + }, + { + label: '货主代码', + field: 'ownerCode', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: {width:'100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + isTableForm: false, + isForm: false + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isTableForm: false, + isForm: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + isTable:true, + table: { + width: 150, + fixed: 'right' + }, + isTableForm:false, + } +])) + +//表单校验 +export const CountadjustRequestDetailRules = reactive({ + countDetailNumber: [ + { required: true, message: '请输入盘点明细号', trigger: 'blur' } + ], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], + locationCode: [ + { required: true, message: '请选择库位代码', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + inventoryQty: [ + { required: true, message: '请输入库存数量', trigger: 'blur' } + ], + countQty: [ + { required: true, message: '请输入盘点数量', trigger: 'blur' } + ], + adjustQty: [ + { required: true, message: '请输入调整数量', trigger: 'blur' } + ], + // number: [ + // { required: true, message: '请输入单据号', trigger: 'blur' } + // ], + itemCode: [ + { required: true, message: '请选择物料代码', trigger: 'change' } + ], +}) + +export const CountadjustHandle = useCrudSchemas(reactive([ + { + label: '备注', + field: 'remark', + sort: 'custom', + isTable:false, + form: { + component: 'Input', + componentProps:{ + type: 'textarea' + } + }, + }, +])) + +export const CountadjustHandleRules = reactive({ + // remark: [ + // { max: 50, message: '不得超过50个字符', trigger: 'blur' } + // ], +}) \ No newline at end of file diff --git a/src/views/wms/countManage/countadjust/countadjustRequestManufactureMain/index.vue b/src/views/wms/countManage/countadjust/countadjustRequestManufactureMain/index.vue new file mode 100644 index 000000000..f720f10be --- /dev/null +++ b/src/views/wms/countManage/countadjust/countadjustRequestManufactureMain/index.vue @@ -0,0 +1,426 @@ + + + diff --git a/src/views/wms/inventoryManage/balanceDifference/index.vue b/src/views/wms/inventoryManage/balanceDifference/index.vue index 53832e1db..790d3ac57 100644 --- a/src/views/wms/inventoryManage/balanceDifference/index.vue +++ b/src/views/wms/inventoryManage/balanceDifference/index.vue @@ -66,6 +66,7 @@ }]" @changeTabs="changeTabs" :tableObjectExtend="tableObjectExtend" + :extendRowKeyValue="extendRowKeyValue" /> @@ -101,9 +102,13 @@ const route = useRoute() //路由信息 const routeName = ref() routeName.value = route.name const tableColumns = ref(Balance.allSchemas.tableColumns) -const tabsExtend = ref(false) -const apiPage = ref() -const tableObjectExtend = ref() +const tabsExtend = ref(true) +const apiPage = ref( BalanceApi.getTransactionBalancePage) +const tableObjectExtend = ref([]) + const extendRowKeyValue= ref([{ + key: 'masterId', + value: 'id' +}]) //字段设置 更新主列表字段 const updataTableColumns = (val) => { diff --git a/src/views/wms/inventoryManage/differenceRequest/index.vue b/src/views/wms/inventoryManage/differenceRequest/index.vue index 77320f490..5a28fa678 100644 --- a/src/views/wms/inventoryManage/differenceRequest/index.vue +++ b/src/views/wms/inventoryManage/differenceRequest/index.vue @@ -317,7 +317,7 @@ const submitForm = async (formType,submitData) => { if (formType === 'create') { for (const item of data.subList) { if (item.requestQty <= 0) { - message.warning('数量必须大于0') + message.warning('数量不能等于0') return // 这会从整个 submitForm 函数返回 }} await DifferenceRequestMainApi.createMain(data)