style: 上下模-修复下模设备选择、操作人显示及缓存更新问题

main
zhongwenkai 6 days ago
parent f22a5c9a11
commit 9c1763dfee

@ -439,7 +439,11 @@ const resetForm = () => {
displayTopCategory.value = ''
formRef.value?.resetFields()
}
const isDeviceSelectable = (row: any) => String(row?.moldGroup ?? '').trim() === ''
const isDeviceSelectable = (row: any) => {
const isDown = String(formData.value.operateType) === '2'
const hasMold = String(row?.moldGroup ?? '').trim() !== ''
return isDown ? hasMold : !hasMold
}
const deviceColumns = computed(() => {
const baseColumns = [
@ -780,6 +784,9 @@ const confirmDownMold = async () => {
const openCriticalComponentDialog = async () => {
searchParams.deviceCode=''
searchParams.deviceName=''
// APP
deviceMoldLoaded.value = false
deviceMoldMap.value = new Map()
const rows = selectedDeviceRows.value.map((item) => ({ ...item, id: Number(item.id) }))
deviceSelectDialogRef.value?.open(rows)
}

@ -90,7 +90,7 @@
<el-table-column :label="t('MoldManagement.MoldOperate.moldName')" align="center" prop="moldName" width="500px" sortable />
<el-table-column :label="t('MoldManagement.MoldOperate.deviceName')" align="center" prop="deviceName" sortable />
<el-table-column :label="t('MoldManagement.MoldOperate.productionLine')" align="center" prop="lineName" sortable />
<el-table-column :label="t('MoldManagement.MoldOperate.creatorName')" align="center" prop="creatorName" sortable />
<el-table-column :label="t('MoldManagement.MoldOperate.operatorName')" align="center" :formatter="operatorNameFormatter" sortable />
<el-table-column :label="t('MoldManagement.MoldOperate.remark')" align="center" prop="remark" />
<el-table-column
:label="t('MoldManagement.MoldOperate.createTime')"
@ -137,6 +137,7 @@ import download from '@/utils/download'
import { MoldOperateApi, MoldOperateVO } from '@/api/mes/moldoperate'
import MoldOperateForm from './MoldOperateForm.vue'
import { MoldBrandApi, MoldVO } from '@/api/erp/mold'
import { getSimpleUserList, type UserVO } from '@/api/system/user'
/** 模具上下模 列表 */
defineOptions({ name: 'MoldOperate' })
@ -159,12 +160,23 @@ const queryParams = reactive({
const queryFormRef = ref() //
const exportLoading = ref(false) //
const moldList = ref<MoldVO[]>([]) //
const operatorOptions = ref<UserVO[]>([]) //
/** 操作人 id -> 昵称 映射 */
const operatorNameFormatter = (row: any) => {
if (!operatorOptions.value.length) return ''
const user = operatorOptions.value.find((u) => u.id === row.operatorId)
return user?.nickname || ''
}
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
moldList.value = await MoldBrandApi.getBrandList()
if (!operatorOptions.value.length) {
operatorOptions.value = (await getSimpleUserList()) ?? []
}
const data = await MoldOperateApi.getMoldOperatePage(queryParams)
list.value = data.list
total.value = data.total

Loading…
Cancel
Save