Browse Source

fix: bug

master
zhang_li 8 months ago
parent
commit
1dab0f3c49
  1. 2
      .env.development
  2. 16
      src/pages/overhaulOrder/addForm.vue
  3. 25
      src/pages/repairOrder/addForm.vue
  4. 2
      src/store/modules/countStore.ts

2
.env.development

@ -1,3 +1,3 @@
VITE_BASE_URL=http://localhost:12080/admin-api
VITE_BASE_URL=http://192.168.0.106:12080/admin-api
VITE_BASE_URL_IMAGE=http://localhost:12080/admin-api

16
src/pages/overhaulOrder/addForm.vue

@ -107,14 +107,15 @@
const faultType = ref([])
const isDisabled = ref(false)
const choosesingleColumnItem = ref([])
const msg = ref('')
function submit() {
//
if (!form.value.describes) {
proxy.$modal.showToast('请输入故障描述')
return;
}
if (!form.value.deviceNumber) {
proxy.$modal.showToast('请选择设备名称或者维修工单')
if (!form.value.deviceName) {
proxy.$modal.showToast(msg.value)
return;
}
if (!form.value.faultType) {
@ -248,6 +249,7 @@
type: type.value
}).then((res) => {
if (!res.data) {
msg.value = res.msg
form.value.deviceName = ''
form.value.factoryAreaName = ''
form.value.factoryAreaNumber = ''
@ -256,7 +258,9 @@
form.value.deviceName = res.data.name
form.value.factoryAreaName = res.data.factoryAreaName
form.value.factoryAreaNumber = res.data.factoryAreaNumber
}).catch(() => {
}).catch((error) => {
console.log(error)
msg.value = error.msg
form.value.deviceName = ''
form.value.factoryAreaName = ''
form.value.factoryAreaNumber = ''
@ -265,7 +269,9 @@
moldApi.getMoldDetailsByNumber({
number: form.value.deviceNumber
}).then((res) => {
console.log(22,res)
if (!res.data) {
msg.value = res.msg
form.value.deviceName = ''
form.value.factoryAreaName = ''
form.value.factoryAreaNumber = ''
@ -274,7 +280,9 @@
form.value.deviceName = res.data.name
form.value.factoryAreaName = res.data.factoryAreaName
form.value.factoryAreaNumber = res.data.factoryAreaNumber
}).catch(() => {
}).catch((error) => {
console.log(error)
msg.value = error.msg
form.value.deviceName = ''
form.value.factoryAreaName = ''
form.value.factoryAreaNumber = ''

25
src/pages/repairOrder/addForm.vue

@ -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>

2
src/store/modules/countStore.ts

@ -119,9 +119,9 @@ const useStore = defineStore('storeId', {
this.id = ''// 用户编号
this.name = ''
this.avatar = ''
this.roles = ''
this.permissions = ''
this.role = ''
this.roles = []
this.post = ''
this.dept = ''
removeToken()

Loading…
Cancel
Save