Browse Source

生产工单 刷新问题bug修复

master_hella_20240701
TengXF 6 months ago
parent
commit
47b9c5b3d2
  1. 35
      src/views/mes/orderDay/components/schedule.vue
  2. 60
      src/views/mes/orderDay/index.vue
  3. 3
      src/views/mes/orderDay/orderDay.data.ts

35
src/views/mes/orderDay/components/schedule.vue

@ -201,7 +201,7 @@
</el-dialog>
</ContentWrap>
<template #footer>
<el-button @click="handleClose" >关闭</el-button>
<el-button @click="handleClose('dddddd')" >关闭</el-button>
<el-button type="primary" @click="publishPlan" >发布计划</el-button>
</template>
<SearchTable ref="searchTableRef" @search-table-success="searchTableSuccess" />
@ -471,20 +471,23 @@ const opensearchTable = (
)
}
const handleClose=()=>{
dialogVisible.value = false,
emit('close')
const handleClose=(val)=>{
dialogVisible.value = false
emit('close',val)
}
const publishPlan=()=>{
message.confirm("确认发布当前计划?","question").then(async () => {
message.confirm("确认发布当前计划?","提示").then( () => {
//isPublish.value=true
//loading.value = true,
try{formLoading.value=true
doPublishPlan() }finally{
try{
formLoading.value=true
let promise = doPublishPlan();
handleClose(promise)
}finally{
formLoading.value=false;
handleClose()
}
}).catch(() => {
message.info("已取消发布")
})
@ -517,12 +520,14 @@ const doPublishPlan= ()=>{
let res = OrderDayApi.publishPlan(data)
res.then(()=>{
message.success("计划发布成功")
}).catch(()=>{
//console.log("---doPublishPlan-- 458--",res.msg)
message.error("计划发布失败!")
})
return res
// res.then(()=>{
// message.success("")
// }).catch(()=>{
// //console.log("---doPublishPlan-- 458--",res.msg)
// message.error("")
// })
}

60
src/views/mes/orderDay/index.vue

@ -57,7 +57,7 @@
:isBusiness="false"
:isSearchFilterButtonHide="true"
@onChange="valueChange"
/>
<!-- 详情 -->
@ -142,7 +142,7 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
if(formField=='workroomCode'){
getProductlines(val[0][searchField])
}
})
}
@ -156,9 +156,9 @@ const valueChange=(filed,cur)=>{
//item.componentProps.required = cur==='ENABLE'?false:true
}
})
}
}
//
@ -199,10 +199,12 @@ const buttonBaseClick = (val, item) => {
console.log('其他按钮', item)
}
}
const publishClosed=()=>{
//console.log('orderday-publishClosed-200')
getList()
const publishClosed=(val)=>{
console.log('orderday-publishClosed-200',val)
nextTick?.(()=>{
getList()
})
}
//
const isShowMainButton = (row,val) => {
@ -227,7 +229,7 @@ const butttondata = (row) => {
type: 'warning',
icon: '',
color: '',
hasPermi: 'mes:orderDay:update'}), //
hasPermi: 'mes:orderDay:update'}), //
// defaultButtons.mainListHandleBtn({label: '',
// name: 'publish',
// hide: isShowMainButton(row,['2']),
@ -268,25 +270,24 @@ const openForm = (type: string, row?: any) => {
// form
const formsSuccess = async (formType,data) => {
if (formType === 'create') {
let ret= OrderDayApi.createOrderDay(data)
if(ret===undefined || ret===null){
message.error(t('common.networkError'))
}else{
message.success(t('common.createSuccess'))
}
await OrderDayApi.createOrderDay(data)
// if(ret===undefined || ret===null){
// message.error(t('common.networkError'))
// }else{
// message.success(t('common.createSuccess'))
// }
} else {
let ret= OrderDayApi.updateOrderDay(data)
if(ret.code==0){
message.success(t('common.updateSuccess'))
}else{
message.error(t('common.networkError'))
}
await OrderDayApi.updateOrderDay(data)
// if(ret.code==0){
// message.success(t('common.updateSuccess'))
// }else{
// message.error(t('common.networkError'))
// }
}
basicFormRef.value.dialogVisible = false
await getList()
}
@ -301,7 +302,7 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
//console.log('orderDay-openDetail-303',row)
sDetailRef.value.open(row, titleName)
}
}
/** 发布操作 */
const scheduleDetailRef = ref()
@ -336,9 +337,10 @@ const handleExport = async () => {
exportLoading.value = false
}
}
const stopPlan = (id) => {
OrderDayApi.stopPlan(id)
const stopPlan = async (id) => {
await OrderDayApi.stopPlan(id)
getList()
}
/** 导入 */
const importFormRef = ref()

3
src/views/mes/orderDay/orderDay.data.ts

@ -49,6 +49,7 @@ export const OrderDay = useCrudSchemas(reactive<CrudSchema[]>([
field: 'id',
sort: 'custom',
isForm: false,
isTable: false,
width: '60px',
},
{
@ -365,7 +366,7 @@ export const OrderDay = useCrudSchemas(reactive<CrudSchema[]>([
field: 'remark',
sort: 'custom',
isSearch: false,
isTable:false,
// isTable:false,
},
{
label: '操作',

Loading…
Cancel
Save