Browse Source

5号机增加车位4

zhangafei 1 week ago
parent
commit
049d1b3fd9
2 changed files with 13 additions and 5 deletions
  1. 12 4
      src/views/home/HomePage.vue
  2. 1 1
      vite.config.ts

+ 12 - 4
src/views/home/HomePage.vue

@@ -104,7 +104,10 @@
               <a-select
                 ref="selectCcmNoRef"
                 class="select-zj"
-                v-if="vehicleInfo.ccmNo === '0' && String(vehicleInfo.positionNum) == '2'"
+                v-if="
+                  vehicleInfo.ccmNo === '0' &&
+                  publicCarPosition.includes(String(vehicleInfo.positionNum))
+                "
                 size="large"
                 :open="selectCcmNoOpen"
                 placeholder="请选择铸机"
@@ -229,7 +232,7 @@ import type { VehicleInfo, VehicleResponse } from './types'
 
 const router = useRouter()
 const route = useRoute()
-const { ccmNo, positionNo } = route.params
+const { ccmNo, positionNo } = route.params as { ccmNo: string; positionNo: string }
 
 const loading = ref(false)
 const vehicleInfo = ref<VehicleInfo>({
@@ -261,12 +264,17 @@ const selectCcmNoOpen = ref(false)
 const amountError = ref(false)
 const selectErrorNum = ref(undefined)
 
+// 可以共用的车位
+const publicCarPosition: string[] = ['2', '4']
+const zjArr: string[] = ['5', '6']
+
 // 获取目的地信息
 const getDestinationOptions = computed(() => {
   if (!ccmNo || !destinationOptions[String(ccmNo)] || !vehicleInfo.value.ccmNo) {
     return []
   }
   const ccmNostr = vehicleInfo.value.ccmNo || ccmNo
+  if (!zjArr.includes(ccmNostr)) return []
   return destinationOptions[String(ccmNostr)].map((oitem: MConfigProps) => oitem)
 })
 
@@ -316,7 +324,7 @@ const getVehicleInfo = () => {
       params: {
         column: 'createTime',
         order: 'desc',
-        ccmNo: positionNo === '2' ? '0' : ccmNo,
+        ccmNo: publicCarPosition.includes(positionNo) ? '0' : ccmNo,
         positionNum: positionNo,
         pageNo: 1,
         pageSize: 1,
@@ -384,7 +392,7 @@ const { start, stop } = useTimeoutFn(() => {
 
 // 按钮操作
 const handleClick = (type: string) => {
-  if (positionNo === '2' && !['5', '6'].includes(vehicleInfo.value.ccmNo)) {
+  if (publicCarPosition.includes(positionNo) && !zjArr.includes(vehicleInfo.value.ccmNo)) {
     message.warning('请先选择铸机!')
     selectCcmNoRef.value.focus()
     return

+ 1 - 1
vite.config.ts

@@ -33,7 +33,7 @@ export default defineConfig({
     open: true,
     proxy: {
       '/jeecgbootbus': {
-        target: 'http://192.168.0.119:9999',
+        target: 'http://192.168.1.53:9999',
         changeOrigin: true,
         ws: true,
         rewrite: (path) => path.replace(/^\/jeecgbootbus/, ''),