|
|
@ -94,8 +94,11 @@ |
|
|
|
import * as moldApi from "@/api/mold.js" |
|
|
|
import * as dictApi from "@/api/dict.js" |
|
|
|
import * as repairOrderApi from "@/api/repairOrder.js" |
|
|
|
|
|
|
|
import { useCountStore } from '@/store' |
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() |
|
|
|
// 获取自定义的store |
|
|
|
const store = useCountStore() |
|
|
|
|
|
|
|
const loading = ref(false) |
|
|
|
const appDeviceMoldType = ref([]) |
|
|
@ -316,6 +319,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
const appDeviceMoldType1 = ref([]) |
|
|
|
onLoad(async option => { |
|
|
|
if (option.type) type.value = option.type; |
|
|
|
if (option.data) { |
|
|
@ -334,17 +338,26 @@ |
|
|
|
}; |
|
|
|
await getDeviceList() |
|
|
|
maintenanceShift.value = await dictApi.getDict('maintenance_shift') |
|
|
|
appDeviceMoldType.value = await dictApi.getDict('app_device_mold_type') |
|
|
|
|
|
|
|
appDeviceMoldType1.value = await dictApi.getDict('app_device_mold_type') |
|
|
|
faultType.value = await dictApi.getDict('fault_type') |
|
|
|
if (type.value == 'MOLD') { |
|
|
|
appDeviceMoldType.value = appDeviceMoldType.value.filter((item => item.value == "MOLD")) |
|
|
|
appDeviceMoldType.value = appDeviceMoldType1.value.filter((item => item.value == "MOLD")) |
|
|
|
} else { |
|
|
|
appDeviceMoldType.value = appDeviceMoldType.value.filter((item => item.value != "MOLD")) |
|
|
|
appDeviceMoldType.value = [] |
|
|
|
|
|
|
|
if(store.roles.some(item=>item.indexOf('device')>-1)){ |
|
|
|
appDeviceMoldType.value = appDeviceMoldType1.value.filter((item => item.value == "DEVICE")) |
|
|
|
} |
|
|
|
if(store.roles.some(item=>item.indexOf('tech')>-1)){ |
|
|
|
appDeviceMoldType.value = appDeviceMoldType1.value.filter((item => item.value == "TECH")) |
|
|
|
} |
|
|
|
if(store.roles.some(item=>item.indexOf('tech')>-1&&item.indexOf('device')>-1)){ |
|
|
|
appDeviceMoldType.value = appDeviceMoldType1.value.filter((item => item.value != "MOLD")) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
form.value.type = appDeviceMoldType.value[0].value |
|
|
|
form.value.typeName = appDeviceMoldType.value[0].label |
|
|
|
faultType.value = await dictApi.getDict('fault_type') |
|
|
|
}) |
|
|
|
</script> |
|
|
|
|
|
|
|