Bladeren bron

审批人

yanghao 22 uur geleden
bovenliggende
commit
a749e42aa8
3 gewijzigde bestanden met toevoegingen van 26 en 5 verwijderingen
  1. 11 1
      api/fault.js
  2. 2 2
      config/env.dev.js
  3. 13 2
      pages/fault/create.vue

+ 11 - 1
api/fault.js

@@ -70,4 +70,14 @@ export const getFailureApprovalList = () =>
 	request({
 		url: '/rq/iot-failure-report/get/approval',
 		method: 'GET',
-	})
+	})
+
+
+
+// 获取部门名称
+	export function getDeptName(deviceId) {
+		return request({
+			url: `/rq/iot-device/company/${deviceId}`,
+			method: 'GET'
+		});
+	}

+ 2 - 2
config/env.dev.js

@@ -1,7 +1,7 @@
 // 开发环境配置
 export default {
-	// apiUrl: 'http://192.168.188.16:48080',
-	apiUrl: 'https://iot.deepoil.cc',
+	apiUrl: 'http://192.168.188.149:48080',
+	// apiUrl: 'https://iot.deepoil.cc',
 	// apiUrl: 'https://aims.deepoil.cc', //正式
 	apiUrlSuffix: '/admin-api',
 	// 其他开发环境配置...  

+ 13 - 2
pages/fault/create.vue

@@ -125,7 +125,7 @@
             :label="$t('workOrder.approver')"
             name="approvalId"
             :required="true"
-            v-if="maintain.ifDeal == 0"
+            v-if="maintain.ifDeal == 0 && deptName !== 'rh'"
           >
             <uni-data-select
               :clear="false"
@@ -280,7 +280,11 @@ import {
   nextTick,
   getCurrentInstance,
 } from "vue";
-import { createFault, getFailureApprovalList } from "@/api/fault.js";
+import {
+  createFault,
+  getFailureApprovalList,
+  getDeptName,
+} from "@/api/fault.js";
 import dayjs from "dayjs";
 import { uploadFile } from "@/api";
 
@@ -320,6 +324,8 @@ const selectedDevices = ref([]);
 const onAddDevice = () => {
   deviceSingleRef.value.open();
 };
+
+let deptName = ref("");
 const onChooseDevice = (data) => {
   console.log("onChooseDevice", data);
   maintain.value.deviceId = data.id;
@@ -327,6 +333,11 @@ const onChooseDevice = (data) => {
   maintain.value.deviceCode = data.deviceCode;
   maintain.value.deviceName = data.deviceName;
   console.log("onChooseDevice-maintain", maintain.value);
+
+  getDeptName(data.id).then((res) => {
+    console.log("🚀 ~ getDeptName>>>>>>>>>>>>>>>>>>>> ~ res:", res);
+    deptName.value = res.data;
+  });
 };
 // 上传图片
 const upload = async (event) => {