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

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

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

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

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

Loading…
Cancel
Save