Browse Source

1、月计划工厂编码选择

master_hella_20240701
bjang03 7 months ago
parent
commit
a143d47a72
  1. 10
      src/api/mes/workstation/index.ts
  2. 22
      src/views/mes/ordermonthplan/index.vue
  3. 37
      src/views/mes/ordermonthplan/mesOrderMonthMain.data.ts
  4. 63
      src/views/mes/workstation/index.vue
  5. 58
      src/views/mes/workstation/workstation.data.ts

10
src/api/mes/workstation/index.ts

@ -40,16 +40,6 @@ export const deleteWorkstation = async (id: number) => {
return await request.delete({ url: `/mes/workstation/delete?id=` + id }) return await request.delete({ url: `/mes/workstation/delete?id=` + id })
} }
// 导出工位 Excel
export const exportWorkstation = async (params) => {
return await request.download({ url: `/mes/workstation/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/workstation/get-import-template' })
}
export const getEquipmentPage = async (params) => { export const getEquipmentPage = async (params) => {
params.workstationCode = goalParams.workstationCode params.workstationCode = goalParams.workstationCode
if (params.isSearch) { if (params.isSearch) {

22
src/views/mes/ordermonthplan/index.vue

@ -44,9 +44,10 @@
@success="formsSuccess" @success="formsSuccess"
:rules="MesOrderMonthMainRules" :rules="MesOrderMonthMainRules"
:formAllSchemas="MesOrderMonthMain.allSchemas" :formAllSchemas="MesOrderMonthMain.allSchemas"
:apiUpdate="MesOrderMonthApi.updateMesOrderMonthMain" :apiUpdate="updateMesOrderMonthMain"
:apiCreate="MesOrderMonthApi.createMesOrderMonthMain" :apiCreate="createMesOrderMonthMain"
:apiDelete="MesOrderMonthApi.deleteMesOrderMonthMain" :apiDelete="MesOrderMonthApi.deleteMesOrderMonthMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false" :isBusiness="false"
/> />
@ -106,7 +107,11 @@ import {
MesOrderMonthSubRules MesOrderMonthSubRules
} from "@/views/mes/ordermonthplan/mesOrderMonthSub.data"; } from "@/views/mes/ordermonthplan/mesOrderMonthSub.data";
import * as OrderDayApi from "@/api/mes/orderDay"; import * as OrderDayApi from "@/api/mes/orderDay";
import {breakdown, MesOrderMonthSubVO} from "@/api/mes/ordermonthplan"; import {
breakdown,
MesOrderMonthMainVO,
MesOrderMonthSubVO
} from "@/api/mes/ordermonthplan";
defineOptions({ name: 'MesOrderMonthMain' }) defineOptions({ name: 'MesOrderMonthMain' })
@ -198,6 +203,7 @@ const formsSuccess = async (formType,data) => {
} }
if(data.activeTime==0)data.activeTime = null; if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null; if(data.expireTime==0)data.expireTime = null;
data.factoryName = factoryName
if (formType === 'create') { if (formType === 'create') {
await MesOrderMonthApi.createMesOrderMonthMain(data) await MesOrderMonthApi.createMesOrderMonthMain(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
@ -208,7 +214,6 @@ const formsSuccess = async (formType,data) => {
basicFormRef.value.dialogVisible = false basicFormRef.value.dialogVisible = false
getList() getList()
} }
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
let mainPlanId let mainPlanId
@ -278,8 +283,10 @@ onMounted(async () => {
const detailAllSchemas = ref(MesOrderMonthSub.allSchemas) const detailAllSchemas = ref(MesOrderMonthSub.allSchemas)
// //
let productName let productName
let factoryName
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => { nextTick(() => {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
formRef.setValues(setV) formRef.setValues(setV)
@ -289,6 +296,10 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
productName = val[0].name productName = val[0].name
getBoms(val[0][searchField]) getBoms(val[0][searchField])
} }
if(formField=='factoryCode'){
factoryName = val[0].name
formRef.setValues({factoryCode:val[0]['id']})
}
// if(formField=='workroomCode'){ // if(formField=='workroomCode'){
// getProductlines(val[0][searchField]) // getProductlines(val[0][searchField])
// } // }
@ -304,6 +315,8 @@ const getBoms = async (code: String) => {
} }
}) })
} }
const createMesOrderMonthSub = async (data: MesOrderMonthSubVO) => { const createMesOrderMonthSub = async (data: MesOrderMonthSubVO) => {
data.productName = productName data.productName = productName
return await MesOrderMonthApi.createMesOrderMonthSub(data) return await MesOrderMonthApi.createMesOrderMonthSub(data)
@ -314,7 +327,6 @@ const updateMesOrderMonthSub = async (data: MesOrderMonthSubVO) => {
} }
// -- // --
const detailButtonBaseClick = async (val, item) => { const detailButtonBaseClick = async (val, item) => {
debugger
try { try {
// //
await message.confirm('确定要拆解成日计划吗?') await message.confirm('确定要拆解成日计划吗?')

37
src/views/mes/ordermonthplan/mesOrderMonthMain.data.ts

@ -1,5 +1,6 @@
import type {CrudSchema} from '@/hooks/web/useCrudSchemas' import type {CrudSchema} from '@/hooks/web/useCrudSchemas'
import {dateFormatter} from '@/utils/formatTime' import {dateFormatter} from '@/utils/formatTime'
import * as TenantApi from '@/api/system/tenant'
// 表单校验 // 表单校验
export const MesOrderMonthMainRules = reactive({ export const MesOrderMonthMainRules = reactive({
@ -35,24 +36,24 @@ export const MesOrderMonthMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'factoryCode', field: 'factoryCode',
sort: 'custom', sort: 'custom',
isTable: false, isTable: false,
// form: { form: {
// // labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
// componentProps: { componentProps: {
// isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择工厂', // 输入框占位文本 searchListPlaceholder: '请选择工厂', // 输入框占位文本
// searchField: 'id', // 查询弹窗赋值字段 searchField: 'factoryCode', // 查询弹窗赋值字段
// searchTitle: '请选择工厂', // 查询弹窗标题 searchTitle: '请选择工厂', // 查询弹窗标题
// searchAllSchemas: FactoryList.allSchemas, // 查询弹窗所需类 searchAllSchemas: FactoryList.allSchemas, // 查询弹窗所需类
// searchPage: TenantApi.getTenantPage, // 查询弹窗所需分页方法 searchPage: TenantApi.getTenantPage, // 查询弹窗所需分页方法
// isHideFilterButton: true, isHideFilterButton: true,
// searchCondition: [{ searchCondition: [{
// key: 'available', key: 'available',
// value: 'TRUE', value: 'TRUE',
// isMainValue: false isMainValue: false
// } }
// ] ]
// } }
// } }
}, },
{ {
label: '工厂名称', label: '工厂名称',

63
src/views/mes/workstation/index.vue

@ -69,24 +69,19 @@
@detailOpenForm="detailOpenForm" @detailOpenForm="detailOpenForm"
/> />
<BasicForm <BasicForm
ref="teamListRef" ref="tmpPopListRef"
:formAllSchemas="tmpPopList" :formAllSchemas="tmpPopList"
:isBusiness="false" :isBusiness="false"
/> />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/workstation/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download'
import { import {
Equipment, Equipment,
Process,
Opersteps, Opersteps,
TabsList, TabsList,
Team,
Workstation, Workstation,
WorkstationRules,equipmentPopList,processPopList,stepPopList WorkstationRules,equipmentPopList,stepPopList
} from './workstation.data' } from './workstation.data'
import * as WorkstationApi from '@/api/mes/workstation' import * as WorkstationApi from '@/api/mes/workstation'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -130,8 +125,8 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:workstation:create'}), // defaultButtons.defaultAddBtn({hasPermi:'wms:workstation:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:workstation:import'}), // // defaultButtons.defaultImportBtn({hasPermi:'wms:workstation:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:workstation:export'}), // // defaultButtons.defaultExportBtn({hasPermi:'wms:workstation:export'}), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
@ -148,11 +143,7 @@ const HeadButttondata = [
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') { //
openForm('create') openForm('create')
} else if (val == 'import') { // }else if (val == 'refresh') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') { //
} else { // } else { //
@ -218,37 +209,6 @@ const handleDelete = async (id: number) => {
} catch {} } catch {}
} }
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await WorkstationApi.exportWorkstation(tableObject.params)
download.excel(data, '工位.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '工位导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
// //
const searchFormClick = (searchData) => { const searchFormClick = (searchData) => {
tableObject.params = { tableObject.params = {
@ -261,7 +221,6 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await WorkstationApi.importTemplate()
}) })
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
@ -270,7 +229,7 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicWorkstation') detailRef.value.openDetail(row, titleName, titleValue, 'basicWorkstation')
} }
// //
const detailAllSchemas = ref(Team.allSchemas) const detailAllSchemas = ref(Equipment.allSchemas)
const apiPage = ref(WorkstationApi.getEquipmentPage) const apiPage = ref(WorkstationApi.getEquipmentPage)
const tableKey = ref("Team"); const tableKey = ref("Team");
let tmpPopList = equipmentPopList.allSchemas let tmpPopList = equipmentPopList.allSchemas
@ -283,12 +242,6 @@ const changeTabs = (data) =>{
tabsDeleteApi = WorkstationApi.deleteEquipmentRelation tabsDeleteApi = WorkstationApi.deleteEquipmentRelation
tabsCreateApi = WorkstationApi.createEquipmentRelation tabsCreateApi = WorkstationApi.createEquipmentRelation
tmpPopList = equipmentPopList.allSchemas tmpPopList = equipmentPopList.allSchemas
}else if(data.prop == 'Process'){
apiPage.value = WorkstationApi.getProcessPage
detailAllSchemas.value = Process.allSchemas
tabsDeleteApi = WorkstationApi.deleteProcessRelation
tabsCreateApi = WorkstationApi.createProcessRelation
tmpPopList = processPopList.allSchemas
}else if(data.prop == 'Opersteps'){ }else if(data.prop == 'Opersteps'){
apiPage.value = WorkstationApi.getOperstepsPage apiPage.value = WorkstationApi.getOperstepsPage
detailAllSchemas.value = Opersteps.allSchemas detailAllSchemas.value = Opersteps.allSchemas
@ -297,9 +250,9 @@ const changeTabs = (data) =>{
tmpPopList = stepPopList.allSchemas tmpPopList = stepPopList.allSchemas
} }
} }
const teamListRef = ref() const tmpPopListRef = ref()
const detailOpenForm = async (type, params) => { const detailOpenForm = async (type, params) => {
teamListRef.value.open('create', null, null, 'viewDetail')// tmpPopListRef.value.open('create', null, null, 'viewDetail')//
} }
</script> </script>

58
src/views/mes/workstation/workstation.data.ts

@ -19,10 +19,6 @@ export const TabsList = [{
label: "设备", label: "设备",
prop: 'Equipment', prop: 'Equipment',
}, },
{
label: "工序",
prop: 'Process',
},
{ {
label: "操作步骤", label: "操作步骤",
prop: 'Opersteps', prop: 'Opersteps',
@ -95,13 +91,6 @@ export const Workstation = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{
label: '班组代码',
field: 'teamCode',
sort: 'custom',
isSearch: true,
isForm: false
},
{ {
label: '生效时间', label: '生效时间',
field: 'activeTime', field: 'activeTime',
@ -161,13 +150,14 @@ export const Workstation = useCrudSchemas(reactive<CrudSchema[]>([
label: '操作', label: '操作',
field: 'action', field: 'action',
isForm: false, isForm: false,
isTable: true,
table: { table: {
width: 150, width: 150,
fixed: 'right' fixed: 'right'
} }
} }
])) ]))
export const Team = useCrudSchemas(reactive<CrudSchema[]>([ export const select = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '代码', label: '代码',
field: 'code', field: 'code',
@ -181,17 +171,6 @@ export const Team = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm: false isForm: false
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 150,
fixed: 'right'
},
isTableForm:true,
} }
])) ]))
@ -222,33 +201,6 @@ export const Equipment = useCrudSchemas(reactive<CrudSchema[]>([
isTableForm:true isTableForm:true
} }
])) ]))
export const Process = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '代码',
field: 'code',
sort: 'custom',
isSearch: true,
isForm: false
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
isForm: false
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 150,
fixed: 'right'
},
isTableForm:true,
}
]))
export const Opersteps = useCrudSchemas(reactive<CrudSchema[]>([ export const Opersteps = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '代码', label: '代码',
@ -291,7 +243,7 @@ export const equipmentPopList = useCrudSchemas(reactive<CrudSchema[]>([
searchListPlaceholder: '选择设备', // 输入框占位文本 searchListPlaceholder: '选择设备', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段
searchTitle: '选择设备', // 查询弹窗标题 searchTitle: '选择设备', // 查询弹窗标题
searchAllSchemas: Team.allSchemas, // 查询弹窗所需类 searchAllSchemas: select.allSchemas, // 查询弹窗所需类
searchPage: WorkstationApi.checkEquipmentPageList, // 查询弹窗所需分页方法 searchPage: WorkstationApi.checkEquipmentPageList, // 查询弹窗所需分页方法
searchCondition: [{ searchCondition: [{
key: 'available', key: 'available',
@ -316,7 +268,7 @@ export const processPopList = useCrudSchemas(reactive<CrudSchema[]>([
searchListPlaceholder: '选择工序', // 输入框占位文本 searchListPlaceholder: '选择工序', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段
searchTitle: '选择工序', // 查询弹窗标题 searchTitle: '选择工序', // 查询弹窗标题
searchAllSchemas: Team.allSchemas, // 查询弹窗所需类 searchAllSchemas: select.allSchemas, // 查询弹窗所需类
searchPage: WorkstationApi.checkProcessPageList, // 查询弹窗所需分页方法 searchPage: WorkstationApi.checkProcessPageList, // 查询弹窗所需分页方法
searchCondition: [{ searchCondition: [{
key: 'available', key: 'available',
@ -341,7 +293,7 @@ export const stepPopList = useCrudSchemas(reactive<CrudSchema[]>([
searchListPlaceholder: '选择操作步骤', // 输入框占位文本 searchListPlaceholder: '选择操作步骤', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段
searchTitle: '选择操作步骤', // 查询弹窗标题 searchTitle: '选择操作步骤', // 查询弹窗标题
searchAllSchemas: Team.allSchemas, // 查询弹窗所需类 searchAllSchemas: select.allSchemas, // 查询弹窗所需类
searchPage: WorkstationApi.checkOperstepsPageList, // 查询弹窗所需分页方法 searchPage: WorkstationApi.checkOperstepsPageList, // 查询弹窗所需分页方法
searchCondition: [{ searchCondition: [{
key: 'available', key: 'available',

Loading…
Cancel
Save