Forráskód Böngészése

Merge branch 'xf_dev' into js_dev

# Conflicts:
#	.env.development
qinhb 3 hónapja
szülő
commit
8e5c253576

+ 1 - 1
.env.development

@@ -11,7 +11,7 @@ VITE_APP_BASE_API = '/dev-api'
 VITE_APP_UPLOAD_URL = 'http://192.168.101.4:9000'
 
 # 开发接口地址
-VITE_APP_API_URL = 'http://192.168.101.4:8079'
+VITE_APP_API_URL = 'http://192.168.1.111:8079'
 # Websocket地址
 VITE_WEBSOCKET_URL = 'ws://192.168.101.4:8079'
 ``

+ 2 - 2
docker/Dockerfile

@@ -7,14 +7,14 @@ RUN echo "server {  \
                       listen       80; \
                       client_max_body_size 100m;\
                       location   /client-server/ { \
-                      proxy_pass              http://192.168.101.4:8079/; \
+                      proxy_pass              http://139.155.176.112:8079/; \
                       proxy_redirect          off; \
                       proxy_set_header        Host client-server; \
                       proxy_set_header        X-Real-IP \$remote_addr; \
                       proxy_set_header        X-Forwarded-For \$proxy_add_x_forwarded_for; \
                   } \
                   location /jgfile/ { \
-                              proxy_pass          http://192.168.101.4:9000/jgfile/; \
+                              proxy_pass          http://139.155.176.112:19000/jgfile/; \
                               proxy_redirect      off; \
                               proxy_set_header    Host jgfile; \
                               proxy_set_header    X-Real-IP \$remote_addr; \

+ 14 - 0
src/api/prosteps/screwdriver.ts

@@ -51,3 +51,17 @@ export function startData(data: any): Promise<ResData> {
     data,
   });
 }
+export function setUpData(data: any): Promise<ResData> {
+  return request({
+    url: `/api/v1/process/data/acquisition/setUp`,
+    method: "post",
+    data,
+  });
+}
+export function setUpData1(data: any): Promise<ResData> {
+  return request({
+    url: `/api/v1/process/data/acquisition/setUp1`,
+    method: "post",
+    data,
+  });
+}

+ 10 - 3
src/layout/index.vue

@@ -1,11 +1,18 @@
 <template>
-  <div class="wh-full" v-loading.fullscreen.lock="fullscreenLoading" element-loading-text="加载中..."
-    element-loading-background="rgba(122, 122, 122, 1 )">
+  <div
+    class="wh-full"
+    v-loading.fullscreen.lock="fullscreenLoading"
+    element-loading-text="加载中..."
+    element-loading-background="rgba(122, 122, 122, 1 )"
+  >
     <Header />
     <section class="app-main">
       <router-view>
         <template #default="{ Component, route }">
-          <transition enter-active-class="animate__animated animate__fadeIn" mode="out-in">
+          <transition
+            enter-active-class="animate__animated animate__fadeIn"
+            mode="out-in"
+          >
             <keep-alive :include="['ProcessMain', 'ProSteps']">
               <component :is="Component" />
             </keep-alive>

+ 0 - 2
src/views/login/index.vue

@@ -288,7 +288,6 @@ function handleLogin() {
     if (valid) {
       //保存用户名和密码
       localStorage.setItem("local_name", loginData.value.userName);
-      localStorage.setItem("local_pwd", loginData.value.password);
 
       loading.value = true;
 
@@ -408,7 +407,6 @@ onMounted?.(() => {
     localStorage.getItem("local_name") !== "null"
   ) {
     loginData.value.userName = localStorage.getItem("local_name");
-    loginData.value.password = localStorage.getItem("local_pwd");
   }
 });
 </script>

+ 2 - 2
src/views/pro-operation/call-materiel/desperse.vue

@@ -41,9 +41,9 @@
               <div>
                 <div class="suit-count">
                   <!--                  <span>数量:</span>-->
-                  <NumberInput v-model="box.totalNum" />
+                  <NumberInput v-model="box.totalNum" :max="box.stockNum"/>
                 </div>
-                <span class="suit-desc">单位:{{ box?.unit }}</span>
+                <span class="suit-desc">库存: {{box.stockNum}} {{ box?.unit }}</span>
               </div>
               <!-- <div class="suit-desc">当前库存</div> -->
             </div>

+ 171 - 27
src/views/pro-steps/components/screwdriver.vue

@@ -24,12 +24,14 @@
             style="font-size: 18px; color: rgb(10, 89, 247); font-weight: 600"
             >新增数据</span
           >
+          <!-- DDLSD -->
           <el-select
             v-model="taskValue"
             v-if="item.deviceType == 'DDLSD'"
             placeholder="请选择任务"
             size="large"
-            style="position: absolute; right: 200px; z-index: 2; width: 140px"
+            @change="changeTask"
+            style="position: absolute; right: 460px; z-index: 2; width: 140px"
           >
             <el-option
               v-for="item in options"
@@ -41,26 +43,85 @@
           <el-button
             class="ces"
             type="primary"
+            style="position: absolute; right: 340px; z-index: 2"
+            v-if="item.deviceType == 'DDLSD'"
+            @click.stop="
+              startTest1(item.deviceName, item.deviceNo, item.deviceType)
+            "
+            :disabled="
+              (item.deviceType == 'DDLSD' && !taskValue) ||
+              btnDisabled ||
+              setDiabledStatus
+            "
+            >设置参数</el-button
+          >
+          <el-select
+            v-model="taskId"
+            v-if="item.deviceType == 'DDLSD'"
+            placeholder="选择任务号"
+            size="large"
+            style="position: absolute; right: 180px; z-index: 2; width: 140px"
+          >
+            <el-option
+              v-for="item in options2"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            />
+          </el-select>
+          <!-- DDLSD -->
+          <!-- WKDLT -->
+
+          <el-input-number
+            @click.stop
+            style="
+              position: absolute;
+              right: 300px;
+              z-index: 2;
+              margin-bottom: 1px;
+            "
+            v-model="tipTemperature"
+            :min="50"
+            :max="450"
+            v-if="item.deviceType == 'WKDLT'"
+          />
+          <span
+            v-if="item.deviceType == 'WKDLT'"
+            style="
+              position: absolute;
+              right: 345px;
+              z-index: 2;
+              margin-bottom: 1px;
+              font-size: 16px;
+              color: black !important;
+            "
+            >℃</span
+          >
+          <el-button
+            class="ces"
+            type="primary"
+            style="position: absolute; right: 180px; z-index: 2"
+            v-if="item.deviceType == 'WKDLT'"
+            @click.stop="setTipTemperature"
+            :disabled="tipTemperatureDisabled"
+            >设置温度</el-button
+          >
+          <!-- WKDLT -->
+          <el-button
+            class="ces"
+            type="primary"
             style="position: absolute; right: 60px; z-index: 2"
             v-if="item.deviceType != 'FJDJC'"
             @click.stop="
               startTest(item.deviceName, item.deviceNo, item.deviceType)
             "
-            :disabled="item.deviceType == 'DDLSD' && !taskValue"
+            :disabled="
+              (item.deviceType == 'DDLSD' && !taskValue) || btnDisabled
+            "
             >开始检测</el-button
           >
         </template>
-        <!-- <el-table
-          :data="DDLSDTableData"
-          v-if="item.deviceType == 'DDLSD'"
-          border
-        >
-          <el-table-column prop="deviceNo" label="任务号" />
-          <el-table-column prop="deviceNo" label="圈数(r)" />
-          <el-table-column prop="deviceNo" label="扭力(mN.m)" />
-          <el-table-column prop="deviceNo" label="拧紧结果" />
-          <el-table-column prop="deviceNo" label="警报" />
-        </el-table> -->
+
         <el-table
           :data="tableData[index]"
           v-if="item.deviceType != 'FJDJC'"
@@ -71,7 +132,6 @@
             :key="str"
             :prop="str"
             :label="showLable(str)"
-            width="230px"
           >
             <template #default="{ row }">
               <div v-if="!row.updateStatus">
@@ -136,25 +196,78 @@ import {
   delAcquisitionData,
   getTaskList,
   startData,
+  setUpData,
+  setUpData1,
 } from "@/api/prosteps/screwdriver";
 import { useProcessStore } from "@/store";
 import { useDictionaryStore } from "@/store";
 import { emitter, EventsNames } from "@/utils/common";
-import dayjs from "dayjs";
+defineOptions({
+  name: "Screwdriver",
+});
 const dictS = useDictionaryStore();
 const store = useProcessStore();
+const tipTemperature = ref(50);
+const tipTemperatureDisabled = ref(false);
+const setTipTemperature = async () => {
+  try {
+    tipTemperatureDisabled.value = true;
+    const { code } = await setUpData1({ tipTemperature: tipTemperature.value });
+    if (code == "200") {
+      ElMessage.success("设置成功!");
+    }
+  } catch (e) {
+  } finally {
+    setTimeout(() => {
+      tipTemperatureDisabled.value = false;
+    }, 5000);
+  }
+};
+const changeTask = () => {
+  setDiabledStatus.value = false;
+};
+const setDiabledStatus = ref(false);
 const tableData = ref([]);
 const materialsData = ref([]);
 const router = useRouter();
 const taskValue = ref("");
+const taskId = ref("1");
+const btnDisabled = ref(false);
 const toStartData = async (data) => {
-  const { code } = await startData(data);
-  if (code == "200") {
-    ElMessage.success("开始检测成功");
+  try {
+    btnDisabled.value = true;
+    const { code } = await startData(data);
+    if (code == "200") {
+      ElMessage.success("开始检测....");
+    }
+  } catch (e) {
+  } finally {
+    setTimeout(() => {
+      btnDisabled.value = false;
+    }, 3000);
+  }
+};
+const toStartData1 = async (data) => {
+  try {
+    btnDisabled.value = true;
+    const { code } = await setUpData(data);
+    if (code == "200") {
+      ElMessage.success("设置成功!");
+      setDiabledStatus.value = true;
+    }
+  } catch (e) {
+  } finally {
+    setTimeout(() => {
+      btnDisabled.value = false;
+    }, 3000);
   }
 };
 const getTask = async () => {
-  const { data } = await getTaskList({});
+  let params = {
+    operationCode: store.processInfo.operationCode,
+    materialNo: store.scanInfo.materialCode,
+  };
+  const { data } = await getTaskList(params);
   options.value = [];
   data.forEach((item) => {
     options.value.push({
@@ -164,7 +277,16 @@ const getTask = async () => {
   });
 };
 const options = ref([]);
-
+const options2 = ref([
+  { value: "1", label: "任务0" },
+  { value: "2", label: "任务1" },
+  { value: "3", label: "任务2" },
+  { value: "4", label: "任务3" },
+  { value: "5", label: "任务4" },
+  { value: "6", label: "任务5" },
+  { value: "7", label: "任务6" },
+  { value: "8", label: "任务7" },
+]);
 const startTest = (a, b, c) => {
   let obj = {
     deviceName: a,
@@ -176,15 +298,33 @@ const startTest = (a, b, c) => {
     seqNo: store.useSeqNo,
     workOrderCode: store.odersData.workOrderCode,
     taskId: taskValue.value,
+    smallTaskId: taskId.value,
   };
   toStartData(obj);
 };
+const startTest1 = (a, b, c) => {
+  let obj = {
+    deviceName: a,
+    deviceNo: b,
+    deviceType: c,
+    operationId: store.scanInfo.operationId,
+    operationName: store.processInfo.operationName,
+    processId: store.scanInfo.id,
+    seqNo: store.useSeqNo,
+    workOrderCode: store.odersData.workOrderCode,
+    taskId: taskValue.value,
+    smallTaskId: taskId.value,
+  };
+  toStartData1(obj);
+};
 const showLable = (key) => {
   switch (key) {
+    case "tipTemperature":
+      return "温度";
     case "CH5Val":
-      return "CH5";
+      return "温度";
     case "CH6Val":
-      return "CH6";
+      return "湿度";
     case "DataTimes":
       return "采集时间";
     case "torquetarget":
@@ -193,6 +333,8 @@ const showLable = (key) => {
       return "拧紧过程中最大扭力值";
     case "taskNo":
       return "当前任务号";
+    case "taskName":
+      return "任务名";
     case "warning":
       return "警报";
     case "tightenResult":
@@ -329,26 +471,28 @@ const toCancel = (index, rowIndex) => {
     );
   }
 };
+//根据类型返横列字段
 const configeObj = (type) => {
   switch (type) {
     //温湿度
     case "WXDJC":
-      return ["CH5Val", "CH6Val", "DataTimes"];
+      return ["CH5Val", "CH6Val"];
     case "YBKC":
       return ["length"];
     case "GDC":
       return ["height"];
     case "WKDLT":
-      return ["temperature"];
+      return ["tipTemperature"];
     //电动螺丝刀
     case "DDLSD":
       return [
+        "taskName",
         "taskNo",
+        "tightenResult",
+        "totalCycles",
         "torquetarget",
         "tightenTorqueMax",
         "warning",
-        "tightenResult",
-        "totalCycles",
       ];
     default:
       return ["数据1", "数据2", "数据3"];
@@ -364,7 +508,7 @@ const addItem = (no, name, type, index) => {
       data = { CH5Val: "", CH6Val: "", DataTimes: "" };
       break;
     case "WKDLT":
-      data = {temperature:""};
+      data = { temperature: "" };
       break;
     case "GDC":
       data = { CH5Val: "", CH6Val: "", DataTimes: "" };

+ 10 - 12
src/views/pro-steps/index.vue

@@ -72,7 +72,7 @@
             <el-scrollbar style="width: 100%">
               <router-view v-slot="{ Component, route }">
                 <keep-alive
-                  include="Dianjian,Jiluxiang,Duomeiticaiji,Esop,Jingu,Mingpaibangding,Shebeijilu,Tiaoshipipei,Wuliaocaiji"
+                  include="Dianjian,Jiluxiang,Duomeiticaiji,Esop,Jingu,Mingpaibangding,Shebeijilu,Tiaoshipipei,Wuliaocaiji,Screwdriver"
                 >
                   <component :is="Component" :key="route.fullPath" />
                 </keep-alive>
@@ -90,11 +90,14 @@ import OperationBar from "@/views/pro-steps/operationBar.vue";
 import { useProcessStore } from "@/store";
 import { getOpCompent } from "@/api/prosteps";
 
+defineOptions({
+  name: "ProSteps",
+});
 const store = useProcessStore();
 const key = ref(false);
-defineOptions({ name: "ProSteps" });
 const route = useRoute();
 const router = useRouter();
+const instance = getCurrentInstance();
 const loading = ref(false);
 const recondOPId = ref(null);
 const qrCode = ref(null);
@@ -215,15 +218,6 @@ const getOpCompentArray = async () => {
 const setSelectIndex = (index) => {
   selectIndex.value = index;
 };
-// const setSelectTag = () => {
-//   const nowRouteName = route.name;
-//   stepComponents.value.forEach((item, index) => {
-//     if (item.name == nowRouteName) {
-//       setSelectIndex(index);
-//     }
-//   });
-// };
-
 onActivated(async () => {
   //缓存组件数据逻辑
   if (recondOPId.value == null || qrCode.value == null) {
@@ -237,10 +231,14 @@ onActivated(async () => {
       //当发生改变时
       setSelectIndex(0);
       await getOpCompentArray();
-
       key.value = !key.value;
     } else {
       await getOpCompentArray();
+      if (
+        !instance.devtoolsRawSetupState.router.options.history.state.forward
+      ) {
+        key.value = !key.value;
+      }
     }
   }
 });