lipenghui 3 hónapja
szülő
commit
6baaca30ca

+ 1 - 0
package.json

@@ -81,6 +81,7 @@
     "vue-types": "^5.1.1",
     "vue3-signature": "^0.2.4",
     "vuedraggable": "^4.1.0",
+    "vuex": "^4.1.0",
     "web-storage-cache": "^1.1.1",
     "xml-js": "^1.6.11"
   },

+ 27 - 19
src/views/pms/device/IotDeviceForm.vue

@@ -125,7 +125,7 @@
                 v-model="formData.manufacturerId"
                 :model-value="zzLabel"
                 placeholder="请输入制造商"
-                @click="openCustomer"
+                @click="openCustomerZz"
               />
             </el-form-item>
           </el-col>
@@ -146,7 +146,7 @@
                 v-model="formData.supplierId"
                 placeholder="请输入供应商"
                 :model-value="supplierLabel"
-                @click="openCustomer"
+                @click="openCustomerSupplier"
               />
             </el-form-item>
           </el-col>
@@ -326,7 +326,8 @@
   </ContentWrap>
   <BrandList ref="brandFormRef" @choose="brandChoose" />
   <ModelList ref="modelFormRef" @choose="modelChoose" :brand = "formData.brand" />
-  <CustomerList ref="customerFormRef" @choose="customerChoose" />
+  <CustomerList ref="customerZzFormRef" @choose="customerZzChoose" />
+  <CustomerList ref="customerSupplierFormRef" @choose="customerSupplierChoose" />
 </template>
 <script setup lang="ts">
 import { IotDeviceApi, IotDeviceVO } from '@/api/pms/device'
@@ -353,6 +354,7 @@ const productClassifyList = ref<Tree[]>([]) // 树形结构
 const { delView } = useTagsViewStore() // 视图操作
 const { params, name } = useRoute() // 查询参数
 const { currentRoute, push } = useRouter()
+
 const id = params.id
 const isDetail = params.isDetail
 const { t } = useI18n() // 国际化
@@ -436,13 +438,13 @@ const brandChoose = (row) => {
 const modelChoose = (row) => {
   formData.value.model = row.name
 }
-const customerChoose = (row) => {
-  formData.value[row.customerNature + 'Id'] = row.id
-  if (row.customerNature == 'supplier') {
-    supplierLabel.value = row.name
-  } else {
-    zzLabel.value = row.name
-  }
+const customerSupplierChoose = (row) => {
+  formData.value.supplierId = row.id
+  supplierLabel.value = row.name
+}
+const customerZzChoose = (row) => {
+  formData.value.manufacturerId = row.id
+  zzLabel.value = row.name
 }
 /** 添加/修改操作 */
 const brandFormRef = ref()
@@ -453,9 +455,13 @@ const modelFormRef = ref()
 const openModelForm = () =>{
   modelFormRef.value.open()
 }
-const customerFormRef = ref()
-const openCustomer = () => {
-  customerFormRef.value.open()
+const customerSupplierFormRef = ref()
+const openCustomerSupplier = () => {
+  customerSupplierFormRef.value.open()
+}
+const customerZzFormRef = ref()
+const openCustomerZz = () => {
+  customerZzFormRef.value.open()
 }
 const allshouqi = () => {
   baseIsExpanded.value = false
@@ -495,12 +501,14 @@ const handleInput = (value, obj) => {
 
 const close = () => {
   delView(unref(currentRoute))
-  push({
-    name: 'IotDevicePms',
-    query: {
-      date: new Date().getTime()
-    }
-  })
+  push({ name: 'IotDevicePms', params:{}})
+  // delView(unref(currentRoute))
+  // push({
+  //   name: 'IotDevicePms',
+  //   query: {
+  //     date: new Date().getTime()
+  //   }
+  // })
 }
 const baseInfoClick = () => {
   baseIsExpanded.value = !baseIsExpanded.value // 切换展开状态

+ 1 - 6
src/views/pms/inspect/order/InspectOrderDetail.vue

@@ -203,12 +203,7 @@ const openForm = () => {
 
 const close = () => {
   delView(unref(currentRoute))
-  push({
-    name: 'IotInspectOrder',
-    query: {
-      date: new Date().getTime()
-    }
-  })
+  push({ name: 'IotInspectOrder', params:{}})
 }
 const { wsCache } = useCache()
 /** 提交表单 */

+ 6 - 2
src/views/pms/inspect/order/WriteOrder.vue

@@ -118,13 +118,16 @@
 </template>
 
 <script setup>
-const { push } = useRouter() // 路由
+import {useTagsViewStore} from "@/store/modules/tagsView";
+
 
 const { t } = useI18n() // 国际化
 import { ref, reactive, onMounted } from 'vue'
 import { ElMessage } from 'element-plus'
 import {IotInspectOrderApi} from "@/api/pms/inspect/order";
 import {DICT_TYPE, getBoolDictOptions} from "@/utils/dict";
+const { delView } = useTagsViewStore() // 视图操作
+const { currentRoute, push } = useRouter()
 const message = useMessage() // 消息弹窗
 
 const tabs = ref([])
@@ -227,7 +230,8 @@ const submitForm =  (tabIndex,current,type) => {
     IotInspectOrderApi.writeIotInspectOrder(formData[tabIndex][current], id)
     if (type === 'finish') {
       message.success(t('common.createSuccess'))
-      push({ name: 'IotInspectOrder' })
+      delView(unref(currentRoute))
+      push({ name: 'IotInspectOrder', params:{}})
     }
   } catch (error) {
     ElMessage.error('提交失败,请检查数据')

+ 15 - 8
src/views/pms/inspect/order/index.vue

@@ -62,14 +62,14 @@
         <el-form-item>
           <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
           <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
-          <el-button
-            type="primary"
-            plain
-            @click="openForm('create')"
-            v-hasPermi="['rq:iot-inspect-order:create']"
-          >
-            <Icon icon="ep:plus" class="mr-5px" /> 新增
-          </el-button>
+<!--          <el-button-->
+<!--            type="primary"-->
+<!--            plain-->
+<!--            @click="openForm('create')"-->
+<!--            v-hasPermi="['rq:iot-inspect-order:create']"-->
+<!--          >-->
+<!--            <Icon icon="ep:plus" class="mr-5px" /> 新增-->
+<!--          </el-button>-->
           <el-button
             type="success"
             plain
@@ -218,6 +218,13 @@ const openForm = (id?: number) => {
   push({ name: 'InspectOrderDetail', params:{id} })
 }
 const openWrite = (id?: number) => {
+  IotInspectOrderApi.getIotInspectOrder(id).then((res) => {
+    debugger
+    if (res.status==='finished') {
+      message.warning("该工单已执行");
+      return
+    }
+  })
   push({ name: 'InspectOrderWrite', params:{id} })
 }
 /** 删除按钮操作 */

+ 1 - 1
src/views/pms/inspect/plan/InspectRouteList.vue

@@ -1,5 +1,5 @@
 <template>
-  <Dialog v-model="dialogVisible" title="选择设备路线" style="width: 1300px; max-height: 800px">
+  <Dialog v-model="dialogVisible" title="选择设备路线" style="width: 1300px; min-height: 600px">
     <ContentWrap>
       <el-form
         class="-mb-15px"

+ 8 - 6
src/views/pms/inspect/plan/IotInspectPlan.vue

@@ -208,12 +208,14 @@ const openForm = () => {
 
 const close = () => {
   delView(unref(currentRoute))
-  push({
-    name: 'IotInspectPlan',
-    query: {
-      date: new Date().getTime()
-    }
-  })
+  push({ name: 'IotInspectPlan', params:{}})
+  // delView(unref(currentRoute))
+  // push({
+  //   name: 'IotInspectPlan',
+  //   query: {
+  //     date: new Date().getTime()
+  //   }
+  // })
 }
 const { wsCache } = useCache()
 /** 提交表单 */

+ 3 - 3
src/views/pms/inspect/route/InspectItemList.vue

@@ -1,5 +1,5 @@
 <template>
-  <Dialog v-model="dialogVisible" title="选择巡检项" style="width: 1300px; max-height: 115%">
+  <Dialog v-model="dialogVisible" title="选择巡检项" style="width: 1300px; min-height: 115%">
     <ContentWrap>
       <el-form
         class="-mb-15px"
@@ -159,8 +159,8 @@ const { wsCache } = useCache()
 const getList = async () => {
   loading.value = true
   try {
-    const user = wsCache.get(CACHE_KEY.USER)
-    queryParams.deptId = user.user.deptId
+    // const user = wsCache.get(CACHE_KEY.USER)
+    // queryParams.deptId = user.user.deptId
     console.log(JSON.stringify(queryParams))
 
     const data = await IotInspectItemApi.getIotInspectItemPage(queryParams)

+ 8 - 6
src/views/pms/maintain/IotMaintain.vue

@@ -369,12 +369,14 @@ const endTimeBlur = () => {
 }
 const close = () => {
   delView(unref(currentRoute))
-  push({
-    name: 'IotMaintain',
-    query: {
-      date: new Date().getTime()
-    }
-  })
+  push({ name: 'IotMaintain', params:{}})
+  // delView(unref(currentRoute))
+  // push({
+  //   name: 'IotMaintain',
+  //   query: {
+  //     date: new Date().getTime()
+  //   }
+  // })
 }
 const handleView = () => {
   drawerVisible.value = true

+ 1 - 6
src/views/pms/maintain/IotMaintainDetail.vue

@@ -280,12 +280,7 @@ const formRef = ref() // 表单 Ref
 
 const close = () => {
   delView(unref(currentRoute))
-  push({
-    name: 'IotMaintain',
-    query: {
-      date: new Date().getTime()
-    }
-  })
+  push({ name: 'IotMaintain', params:{}})
 }
 /** 提交表单 */
 onMounted(async () => {