diff --git a/src/api/wms/demandforecastingDetail/index.ts b/src/api/wms/demandforecastingDetail/index.ts index e3303bbd1..309422d37 100644 --- a/src/api/wms/demandforecastingDetail/index.ts +++ b/src/api/wms/demandforecastingDetail/index.ts @@ -72,6 +72,9 @@ const getPageParams = (params)=>{ export const getDemandforecastingDetailPage = async (params) => { if (params.isSearch) { delete params.isSearch + if(params.flag){ + delete params.flag + } const data = {...params} return await request.post({ url: '/wms/demandforecasting-detail/senior', data }) } else { diff --git a/src/api/wms/demandforecastingMain/index.ts b/src/api/wms/demandforecastingMain/index.ts index 7d5596a8f..0433af12c 100644 --- a/src/api/wms/demandforecastingMain/index.ts +++ b/src/api/wms/demandforecastingMain/index.ts @@ -1,4 +1,5 @@ import request from '@/config/axios' +import { isString } from '@/utils/is' export interface DemandforecastingMainVO { supplierCode: string @@ -66,6 +67,56 @@ export const witPurchaseMain = async (id: number) => { return await request.post({ url: `/wms/demandforecasting-main/wit?id=` + id }) } +// 要货预测-列表和头部请求参数 +const getPageParams = (params)=>{ + // 到货日期 + if(params.dueDate&¶ms.dueDate.length>0){ + if(isString(params.dueDate[0])){ + params.startDate = params.dueDate[0] + }else{ + params.startDate = params.dueDate[0].format('YYYY-MM-DD') + } + + } + if(params.dueDate&¶ms.dueDate.length>1){ + if(isString(params.dueDate[1])){ + params.endDate = params.dueDate[1] + }else{ + params.endDate = params.dueDate[1].format('YYYY-MM-DD') + } + } + params.dueDate = '' + + //计划员 + if(params.planerId&¶ms.planerId.length>0){ + params.planers = params.planerId.join(',') + } + params.planerId = '' + // 供应商代码 + if(params.supplierCode&¶ms.supplierCode.length>0){ + let keyValue = params.supplierCode.split(' ') + keyValue.forEach(item=>{item = item.trim()}) + params.supplierCodes = keyValue.join(',') + } + params.supplierCode = '' + + // 物料代码 + if(params.itemCode&¶ms.itemCode.length>0){ + let keyValue = params.itemCode.split(' ') + keyValue.forEach(item=>{item = item.trim()}) + params.itemCodes = keyValue.join(',') + } + params.itemCode = '' + + // 版本号 + if(params.version&¶ms.version.length>0){ + let keyValue = params.version.split(' ') + keyValue.forEach(item=>{item = item.trim()}) + params.versions = keyValue.join(',') + } + params.version = '' + return params +} // 导出要货预测主 Excel export const exportDemandforecastingMain = async (params) => { if (params.isSearch) { @@ -73,6 +124,7 @@ export const exportDemandforecastingMain = async (params) => { const data = {...params} return request.post({ url: '/wms/demandforecasting-main/export-excel-senior', data }) } else { + params = getPageParams(params) return await request.download({ url: `/wms/demandforecasting-main/export-excel`, params }) } } diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index 16dc70ac4..a4a995345 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -107,6 +107,7 @@ :routeName="routeName" @visibleChange="visibleChange" @inputStringFcous='inputStringFcous' + :sureDisabled="sureDisabled" > @@ -119,6 +121,7 @@ import TableHead from '@/components/TableHead/src/TableHead.vue' import AddForm from './addForm.vue' import Detail from './detail.vue' import { getReportUrl } from '@/utils/systemParam' +import { useUserStore } from '@/store/modules/user' // 采购订单 defineOptions({ name: 'inspectionJobMain' }) @@ -129,6 +132,7 @@ const route = useRoute() // 路由信息 const routeName = ref() routeName.value = route.name const tableColumns = ref(InspectionJobMain.allSchemas.tableColumns) +const userStore = useUserStore() // 字段设置 更新主列表字段 const updataTableColumns = (val) => { @@ -199,7 +203,7 @@ const buttonBaseClick = (val, item) => { handleExport() } else if (val == 'refresh') { // 刷新 - if (tableObject.params.filters && tableObject.params.filters.length > 0 ) { + if (tableObject.params.filters && tableObject.params.filters.length > 0) { searchFormClick({ filters: tableObject.params.filters }) @@ -231,24 +235,35 @@ const isShowMainButton2 = (row, val) => { return true } } - +// 根据状态返回该按钮是否显示 +const isShowMainButton1 = (row, val) => { + if (val.indexOf(row.status) > -1) { + if (userStore.getUser.id == row.acceptUserId) { + return false + } else { + return true + } + } else { + return true + } +} // 列表-操作按钮 const butttondata = (row) => { return [ - defaultButtons.mainListJobAccBtn({ - hide: isShowMainButton(row, ['1']), - hasPermi: 'qms:inspection-job-main:accept' - }), // 承接 + // defaultButtons.mainListJobAccBtn({ + // hide: isShowMainButton(row, ['1']), + // hasPermi: 'qms:inspection-job-main:accept' + // }), // 承接 defaultButtons.mainListJobCloBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'qms:inspection-job-main:close' }), // 关闭 defaultButtons.mainListJobAbaBtn({ - hide: isShowMainButton(row, ['2']), + hide: isShowMainButton1(row, ['2']), hasPermi: 'qms:inspection-job-main:abandon' }), // 放弃 defaultButtons.mainListJobExeBtn({ - hide: isShowMainButton(row, ['2']), + hide: isShowMainButton(row, ['1', '2']), hasPermi: 'qms:inspection-job-main:execute' }), // 执行 defaultButtons.mainListOrderPubBtn({ @@ -312,10 +327,19 @@ const openDetail = (row: any, titleName: any, titleValue: any) => { detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionJobMain') } //执行 - const formRef = ref() -const execute = async (type: string, row?: number) => { - formRef.value.open(type, row) +const execute = async (type: string, row?: any) => { + if (row.status == '2') { + if (userStore.getUser.id == row.acceptUserId) { + formRef.value.open(type, row) + } else { + message.error('承接人与当前登录人不一致') + } + } else if (row.status == '1') { + await handleAccept(row.id) + formRef.value.open(type, row) + await getList() + } } /** 关闭按钮操作 */ const handleClose = async (id: number) => { @@ -326,7 +350,7 @@ const handleClose = async (id: number) => { await InspectionJobMainApi.closeInspectionJobMain(id) message.success(t('common.closeSuccess')) // 刷新列表 - buttonBaseClick('refresh',null) + buttonBaseClick('refresh', null) } catch {} } /** 发布按钮操作 */ @@ -338,19 +362,19 @@ const handleRelease = async (id: number) => { await InspectionJobMainApi.releaseInspectionJobMain(id) message.success('发布成功!') // 刷新列表 - buttonBaseClick('refresh',null) + buttonBaseClick('refresh', null) } catch {} } // 承接 const handleAccept = async (id: number) => { try { // 承接的二次确认 - await message.confirm(t('common.confirmAccept')) + // await message.confirm(t('common.confirmAccept')) // 发起承接 await InspectionJobMainApi.acceptInspectionJobMain(id) - message.success(t('common.acceptSuccess')) + // message.success(t('common.acceptSuccess')) // 刷新列表(TB反馈,取消承接后刷新页面) - buttonBaseClick('refresh',null) + // buttonBaseClick('refresh',null) } catch {} } // 放弃任务 @@ -362,7 +386,7 @@ const handleAbandon = async (id: number) => { await InspectionJobMainApi.abandonInspectionJobMain(id) message.success(t('common.giveupSuccess')) // 刷新列表 - buttonBaseClick('refresh',null) + buttonBaseClick('refresh', null) } catch {} } @@ -408,8 +432,8 @@ const submitForm = async (formType, data) => { // 刷新当前列表 if (formType === 'create') { getList() - }else{ - buttonBaseClick('refresh',null) + } else { + buttonBaseClick('refresh', null) } } finally { formRef.value.formLoading = false diff --git a/src/views/wms/basicDataManage/itemManage/bom/bom.data.ts b/src/views/wms/basicDataManage/itemManage/bom/bom.data.ts index a94d3709a..9fd1cfb5d 100644 --- a/src/views/wms/basicDataManage/itemManage/bom/bom.data.ts +++ b/src/views/wms/basicDataManage/itemManage/bom/bom.data.ts @@ -255,7 +255,7 @@ export const Bom = useCrudSchemas(reactive([ sort: 'custom', isDetail: true, isForm: false, - isTable: false, + isTable: true, formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' @@ -278,7 +278,7 @@ export const Bom = useCrudSchemas(reactive([ field: 'updater', isDetail: true, isForm: false, - isTable: false, + isTable: true, table: { width: 150 } diff --git a/src/views/wms/basicDataManage/itemManage/itemarea/itemarea.data.ts b/src/views/wms/basicDataManage/itemManage/itemarea/itemarea.data.ts index cbad1aab2..df0380761 100644 --- a/src/views/wms/basicDataManage/itemManage/itemarea/itemarea.data.ts +++ b/src/views/wms/basicDataManage/itemManage/itemarea/itemarea.data.ts @@ -669,7 +669,7 @@ export const Itemarea = useCrudSchemas(reactive([ field: 'creator', sort: 'custom', isForm: false, - isTable: false, + isTable: true, table: { width: 150 }, @@ -680,7 +680,7 @@ export const Itemarea = useCrudSchemas(reactive([ sort: 'custom', formatter: dateFormatter, isForm: false, - isTable: false, + isTable: true, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, @@ -693,7 +693,7 @@ export const Itemarea = useCrudSchemas(reactive([ field: 'updater', sort: 'custom', isForm: false, - isTable: false, + isTable: true, table: { width: 150 }, diff --git a/src/views/wms/basicDataManage/itemManage/packageunit/packageunit.data.ts b/src/views/wms/basicDataManage/itemManage/packageunit/packageunit.data.ts index 70ae30975..0da0ba386 100644 --- a/src/views/wms/basicDataManage/itemManage/packageunit/packageunit.data.ts +++ b/src/views/wms/basicDataManage/itemManage/packageunit/packageunit.data.ts @@ -199,7 +199,7 @@ export const Packageunit1 = useCrudSchemas(reactive([ sort: 'custom', isDetail: true, isForm: false, - isTable: false, + isTable: true, formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' @@ -222,7 +222,7 @@ export const Packageunit1 = useCrudSchemas(reactive([ field: 'updater', isDetail: true, isForm: false, - isTable: false, + isTable: true, table: { width: 150 } @@ -543,7 +543,7 @@ export const Packageunit = useCrudSchemas(reactive([ sort: 'custom', isDetail: true, isForm: false, - isTable: false, + isTable: true, formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' @@ -566,7 +566,7 @@ export const Packageunit = useCrudSchemas(reactive([ field: 'updater', isDetail: true, isForm: false, - isTable: false, + isTable: true, table: { width: 150 } diff --git a/src/views/wms/basicDataManage/itemManage/productionitemcodeSpareitemcode/productionitemcodeSpareitemcode.data.ts b/src/views/wms/basicDataManage/itemManage/productionitemcodeSpareitemcode/productionitemcodeSpareitemcode.data.ts index 3d6f1be35..2e780eb83 100644 --- a/src/views/wms/basicDataManage/itemManage/productionitemcodeSpareitemcode/productionitemcodeSpareitemcode.data.ts +++ b/src/views/wms/basicDataManage/itemManage/productionitemcodeSpareitemcode/productionitemcodeSpareitemcode.data.ts @@ -129,6 +129,40 @@ export const ProductionitemcodeSpareitemcode = useCrudSchemas(reactive([ sort: 'custom', isDetail: true, isForm: false, - isTable: false, + isTable: true, formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' @@ -269,7 +269,7 @@ export const Productionlineitem = useCrudSchemas(reactive([ field: 'updater', isDetail: true, isForm: false, - isTable: false, + isTable: true, table: { width: 150 } diff --git a/src/views/wms/basicDataManage/itemManage/stdcostprice/stdcostprice.data.ts b/src/views/wms/basicDataManage/itemManage/stdcostprice/stdcostprice.data.ts index 2ea5edca4..c8bc2b996 100644 --- a/src/views/wms/basicDataManage/itemManage/stdcostprice/stdcostprice.data.ts +++ b/src/views/wms/basicDataManage/itemManage/stdcostprice/stdcostprice.data.ts @@ -198,7 +198,7 @@ export const Stdcostprice = useCrudSchemas(reactive([ sort: 'custom', isDetail: true, isForm: false, - isTable: false, + isTable: true, formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' @@ -221,7 +221,7 @@ export const Stdcostprice = useCrudSchemas(reactive([ field: 'updater', isDetail: true, isForm: false, - isTable: false, + isTable: true, table: { width: 150 } diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue index 1057b940a..43c77fb2d 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue @@ -208,13 +208,14 @@ const searchFormClick = (searchData) => { /** 初始化 **/ onMounted(async () => { - try { - await getListHead() - } catch (error) { + // try { + // await getListHead() + // } catch (error) { - } - // updateDateTableColumns() - getList() + // } + // // updateDateTableColumns() + // getList() + seachRef.value.search() importTemplateData.templateUrl = await DemandforecastingMainApi.importTemplate() }) diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/demandforecastingMain.data.ts b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/demandforecastingMain.data.ts index b094557b3..19632d743 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/demandforecastingMain.data.ts +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/demandforecastingMain.data.ts @@ -109,45 +109,45 @@ export const DemandforecastingMain = useCrudSchemas(reactive([ } } }, - { - label: '版本号', - field: 'version', - sort: 'custom', - table: { - width: 150 - }, - isSearch:true, - search: { - // labelMessage: '信息提示说明!!!', - componentProps: { - multiple: true, - enterSearch: true, - isSearchList: true, // 开启查询弹窗 - searchListPlaceholder: '请选择版本号', // 输入框占位文本 - searchField: 'detailVersion', // 查询弹窗赋值字段 - searchTitle: '版本号', // 查询弹窗标题 - searchAllSchemas: Version.allSchemas, // 查询弹窗所需类 - searchPage: DemandforecastingDetailApi.queryVersion, // 查询弹窗所需分页方法 - searchCondition: [{ - key: 'supplierCodes', - value: 'supplierCode', - message: '请填写供应商代码!', - isMainValue: true, - isCSV:true,//是否用逗号分隔参数 - },{ - key: 'itemCodes', - value: 'itemCode', - message: '请填写物料代码!', - isMainValue: true, - isCSV:true,//是否用逗号分隔参数 - },{ - key: 'available', - value: 'TRUE', - isMainValue: false - }] - } - } - }, + // { + // label: '版本号', + // field: 'version', + // sort: 'custom', + // table: { + // width: 150 + // }, + // isSearch:true, + // search: { + // // labelMessage: '信息提示说明!!!', + // componentProps: { + // multiple: true, + // enterSearch: true, + // isSearchList: true, // 开启查询弹窗 + // searchListPlaceholder: '请选择版本号', // 输入框占位文本 + // searchField: 'detailVersion', // 查询弹窗赋值字段 + // searchTitle: '版本号', // 查询弹窗标题 + // searchAllSchemas: Version.allSchemas, // 查询弹窗所需类 + // searchPage: DemandforecastingDetailApi.queryVersion, // 查询弹窗所需分页方法 + // searchCondition: [{ + // key: 'supplierCodes', + // value: 'supplierCode', + // message: '请填写供应商代码!', + // isMainValue: true, + // isCSV:true,//是否用逗号分隔参数 + // },{ + // key: 'itemCodes', + // value: 'itemCode', + // message: '请填写物料代码!', + // isMainValue: true, + // isCSV:true,//是否用逗号分隔参数 + // },{ + // key: 'available', + // value: 'TRUE', + // isMainValue: false + // }] + // } + // } + // }, { label: '到货日期', field: 'dueDate', diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/index.vue index 9e3dea6c8..d53844f8e 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/index.vue @@ -1,7 +1,7 @@