Browse Source

自动登录

Lexie 1 year ago
parent
commit
a0fee8d0f3

+ 14 - 0
src/api/jixiaoguanli/jitairibaobiao.js

@@ -994,6 +994,20 @@ export const ChanliangAdd = (data) => {
     data
   })
 }
+export const AdditionalInspectionRecordAdd = (data) => {
+  return service({
+    url:'/mes_server/facility/AdditionalInspectionRecordAdd',
+    method: 'post',
+    data
+  })
+}
+export const ProcessInspectionRecordsItemAdd = (data) => {
+  return service({
+    url:'/mes_server/facility/ProcessInspectionRecordsItemAdd',
+    method: 'post',
+    data
+  })
+}
 //日产量上报添加->工单资料获取
 export const ChanliangWorkorder = (params) => {
   return service({

+ 9 - 1
src/api/user.js

@@ -11,6 +11,14 @@ export const login = (data) => {
   })
 }
 
+export const login2 = (data) => {
+  return service({
+    url: '/base/autologin',
+    method: 'post',
+    data: data
+  })
+}
+
 // @Summary 获取验证码
 // @Produce  application/json
 // @Param data body {username:"string",password:"string"}
@@ -163,4 +171,4 @@ export const resetPassword = (data) => {
     method: 'post',
     data: data
   })
-}
+}

+ 8 - 0
src/api/yunyin/yunying.js

@@ -33,6 +33,14 @@ export const ygjbzledit = (data) => {
         data
     })
 }
+//4.设置法定天数
+export const clockUpdate = (data) => {
+    return service({
+        url: '/mes_server/staff/clockUpdate',
+        method: 'post',
+        data
+    })
+}
 
 /** 产品管理 */
 //1.获取客户信息

+ 3 - 0
src/main.js

@@ -15,6 +15,9 @@ import { store } from '@/pinia'
 import App from './App.vue'
 import { initDom } from './utils/positionToCode'
 
+
+
+
 initDom()
 /**
  * @description 导入加载进度条,防止首屏加载时间过长,用户等待

+ 44 - 2
src/pinia/modules/user.js

@@ -1,4 +1,4 @@
-import { login, getUserInfo, setSelfInfo } from '@/api/user'
+import { login, getUserInfo, setSelfInfo,login2 } from '@/api/user'
 import { jsonInBlacklist } from '@/api/jwt'
 import router from '@/router/index'
 import { ElLoading, ElMessage } from 'element-plus'
@@ -89,6 +89,47 @@ export const useUserStore = defineStore('user', () => {
     }
     loadingInstance.value.close()
   }
+
+  const LoginIn2 = async(loginInfo) => {
+    loadingInstance.value = ElLoading.service({
+      fullscreen: true,
+      text: '登录中,请稍候...',
+    })
+    try {
+      const res = await login2(loginInfo)
+	  console.log(loginInfo)
+	  console.log(res)
+      if (res.code === 0) {
+        setUserInfo(res.data.user)
+        setToken(res.data.token)
+        const routerStore = useRouterStore()
+        await routerStore.SetAsyncRouter()
+        const asyncRouters = routerStore.asyncRouters
+        asyncRouters.forEach(asyncRouter => {
+          router.addRoute(asyncRouter)
+        })
+
+        if (!router.hasRoute(userInfo.value.authority.defaultRouter)) {
+          ElMessage.error('请联系管理员进行授权')
+        } else {
+          await router.replace({ name: userInfo.value.authority.defaultRouter })
+        }
+
+        loadingInstance.value.close()
+
+        const isWin = ref(/windows/i.test(navigator.userAgent))
+        if (isWin.value) {
+          window.localStorage.setItem('osType', 'WIN')
+        } else {
+          window.localStorage.setItem('osType', 'MAC')
+        }
+        return true
+      }
+    } catch (e) {
+      loadingInstance.value.close()
+    }
+    loadingInstance.value.close()
+  }
   /* 登出*/
   const LoginOut = async() => {
     const res = await jsonInBlacklist()
@@ -152,6 +193,7 @@ export const useUserStore = defineStore('user', () => {
     ResetUserInfo,
     GetUserInfo,
     LoginIn,
+    LoginIn2,
     LoginOut,
     changeSideMode,
     mode,
@@ -162,4 +204,4 @@ export const useUserStore = defineStore('user', () => {
     loadingInstance,
     ClearStorage
   }
-})
+})

+ 19 - 15
src/utils/request.js

@@ -106,21 +106,25 @@ service.interceptors.response.use(
 
     switch (error.response.status) {
       case 500:
-        ElMessageBox.confirm(`
-        <p>检测到接口错误${error}</p>
-        <p>错误码<span style="color:red"> 500 </span>:此类错误内容常见于后台panic,请先查看后台日志,如果影响您正常使用可强制登出清理缓存</p>
-        `, '接口报错', {
-          dangerouslyUseHTMLString: true,
-          distinguishCancelAndClose: true,
-          confirmButtonText: '清理缓存',
-          cancelButtonText: '取消'
-        })
-          .then(() => {
-            const userStore = useUserStore()
-            userStore.token = ''
-            localStorage.clear()
-            router.push({ name: 'Login', replace: true })
-          })
+        // ElMessageBox.confirm(`
+        // <p>检测到接口错误${error}</p>
+        // <p>错误码<span style="color:red"> 500 </span>:此类错误内容常见于后台panic,请先查看后台日志,如果影响您正常使用可强制登出清理缓存</p>
+        // `, '接口报错', {
+        //   dangerouslyUseHTMLString: true,
+        //   distinguishCancelAndClose: true,
+        //   confirmButtonText: '清理缓存',
+        //   cancelButtonText: '取消'
+        // })
+        //   .then(() => {
+        //     const userStore = useUserStore()
+        //     userStore.token = ''
+        //     localStorage.clear()
+        //     router.push({ name: 'Login', replace: true })
+        //   })
+		ElMessage({
+		  type: 'error',
+		  message: '请稍后重试'
+		})
         break
       case 404:
         ElMessageBox.confirm(`

+ 126 - 129
src/view/login/index.vue

@@ -1,26 +1,26 @@
 <template>
-  <div
-    id="userLayout"
-    class="w-full h-full relative"
-  >
+  <div id="userLayout" class="w-full h-full relative">
     <div
       class="rounded-lg flex items-center justify-evenly w-full h-full bg-white md:w-screen md:h-screen md:bg-[#194bfb]"
     >
       <div class="md:w-3/5 w-10/12 h-full flex items-center justify-evenly">
-        <div class="oblique h-[130%] w-3/5 bg-white transform -rotate-12 absolute -ml-52" />
+        <div
+          class="oblique h-[130%] w-3/5 bg-white transform -rotate-12 absolute -ml-52"
+        />
         <!-- 分割斜块 -->
-        <div class="z-[999] pt-12 pb-10 md:w-96 w-full  rounded-lg flex flex-col justify-between box-border">
+        <div
+          class="z-[999] pt-12 pb-10 md:w-96 w-full rounded-lg flex flex-col justify-between box-border"
+        >
           <div>
             <div class="flex items-center justify-center">
-              <img
-                class="w-24"
-                :src="$GIN_VUE_ADMIN.appLogo"
-                alt
-              >
+              <img class="w-24" :src="$GIN_VUE_ADMIN.appLogo" alt />
             </div>
             <div class="mb-9">
-              <p class="text-center text-4xl font-bold">{{ $GIN_VUE_ADMIN.appName }}</p>
-              <p class="text-center text-sm font-normal text-gray-500 mt-2.5">A management platform using Golang and Vue
+              <p class="text-center text-4xl font-bold">
+                {{ $GIN_VUE_ADMIN.appName }}
+              </p>
+              <p class="text-center text-sm font-normal text-gray-500 mt-2.5">
+                A management platform using Golang and Vue
               </p>
             </div>
             <el-form
@@ -30,10 +30,7 @@
               :validate-on-rule-change="false"
               @keyup.enter="submitForm"
             >
-              <el-form-item
-                prop="username"
-                class="mb-6"
-              >
+              <el-form-item prop="username" class="mb-6">
                 <el-input
                   v-model="loginFormData.username"
                   size="large"
@@ -41,10 +38,7 @@
                   suffix-icon="user"
                 />
               </el-form-item>
-              <el-form-item
-                prop="password"
-                class="mb-6"
-              >
+              <el-form-item prop="password" class="mb-6">
                 <el-input
                   v-model="loginFormData.password"
                   show-password
@@ -72,7 +66,7 @@
                       :src="picPath"
                       alt="请输入验证码"
                       @click="loginVerify()"
-                    >
+                    />
                   </div>
                 </div>
               </el-form-item>
@@ -82,61 +76,38 @@
                   type="primary"
                   size="large"
                   @click="submitForm"
-                >登 录</el-button>
+                  >登 录</el-button
+                >
               </el-form-item>
-
             </el-form>
           </div>
         </div>
       </div>
-      <div class="hidden md:block w-1/2 h-full float-right bg-[#194bfb]"><img
-        class="h-full"
-        src="@/assets/login_right_banner.jpg"
-        alt="banner"
-      ></div>
+      <div class="hidden md:block w-1/2 h-full float-right bg-[#194bfb]">
+        <img
+          class="h-full"
+          src="@/assets/login_right_banner.jpg"
+          alt="banner"
+        />
+      </div>
     </div>
 
-    <BottomInfo class="left-0 right-0 absolute bottom-3 mx-auto  w-full z-20">
+    <BottomInfo class="left-0 right-0 absolute bottom-3 mx-auto w-full z-20">
       <div class="links items-center justify-center gap-2 hidden md:flex">
-        <a
-          href="http://doc.henrongyi.top/"
-          target="_blank"
-        >
-          <img
-            src="@/assets/docs.png"
-            class="w-8 h-8"
-            alt="文档"
-          >
+        <a href="http://doc.henrongyi.top/" target="_blank">
+          <img src="@/assets/docs.png" class="w-8 h-8" alt="文档" />
         </a>
-        <a
-          href="https://support.qq.com/product/371961"
-          target="_blank"
-        >
-          <img
-            src="@/assets/kefu.png"
-            class="w-8 h-8"
-            alt="客服"
-          >
+        <a href="https://support.qq.com/product/371961" target="_blank">
+          <img src="@/assets/kefu.png" class="w-8 h-8" alt="客服" />
         </a>
         <a
           href="https://github.com/flipped-aurora/gin-vue-admin"
           target="_blank"
         >
-          <img
-            src="@/assets/github.png"
-            class="w-8 h-8"
-            alt="github"
-          >
+          <img src="@/assets/github.png" class="w-8 h-8" alt="github" />
         </a>
-        <a
-          href="https://space.bilibili.com/322210472"
-          target="_blank"
-        >
-          <img
-            src="@/assets/video.png"
-            class="w-8 h-8"
-            alt="视频站"
-          >
+        <a href="https://space.bilibili.com/322210472" target="_blank">
+          <img src="@/assets/video.png" class="w-8 h-8" alt="视频站" />
         </a>
       </div>
     </BottomInfo>
@@ -144,111 +115,111 @@
 </template>
 
 <script setup>
-import { captcha } from '@/api/user'
-import { checkDB } from '@/api/initdb'
-import BottomInfo from '@/view/layout/bottomInfo/bottomInfo.vue'
-import { reactive, ref } from 'vue'
-import { ElMessage } from 'element-plus'
-import { useRouter } from 'vue-router'
-import { useUserStore } from '@/pinia/modules/user'
+import { captcha } from "@/api/user";
+import { checkDB } from "@/api/initdb";
+import BottomInfo from "@/view/layout/bottomInfo/bottomInfo.vue";
+import { reactive, ref } from "vue";
+import { ElMessage } from "element-plus";
+import { useRouter } from "vue-router";
+import { useUserStore } from "@/pinia/modules/user";
 
 defineOptions({
-  name: 'Login',
-})
+  name: "Login",
+});
 
-const router = useRouter()
+const router = useRouter();
 // 验证函数
 const checkUsername = (rule, value, callback) => {
   if (value.length < 3) {
-    return callback(new Error('请输入正确的用户名'))
+    return callback(new Error("请输入正确的用户名"));
   } else {
-    callback()
+    callback();
   }
-}
+};
 const checkPassword = (rule, value, callback) => {
   if (value.length < 6) {
-    return callback(new Error('请输入正确的密码'))
+    return callback(new Error("请输入正确的密码"));
   } else {
-    callback()
+    callback();
   }
-}
+};
 
 // 获取验证码
 const loginVerify = () => {
-  captcha({}).then(async(ele) => {
+  captcha({}).then(async (ele) => {
     rules.captcha.push({
       max: ele.data.captchaLength,
       min: ele.data.captchaLength,
       message: `请输入${ele.data.captchaLength}位验证码`,
-      trigger: 'blur',
-    })
-    picPath.value = ele.data.picPath
-    loginFormData.captchaId = ele.data.captchaId
-    loginFormData.openCaptcha = ele.data.openCaptcha
-	console.log()
-  })
-}
-loginVerify()
+      trigger: "blur",
+    });
+    picPath.value = ele.data.picPath;
+    loginFormData.captchaId = ele.data.captchaId;
+    loginFormData.openCaptcha = ele.data.openCaptcha;
+    console.log();
+  });
+};
+loginVerify();
 
 // 登录相关操作
-const loginForm = ref(null)
-const picPath = ref('')
+const loginForm = ref(null);
+const picPath = ref("");
 const loginFormData = reactive({
-  username: '',
-  password: '',
-  captcha: '',
-  captchaId: '',
+  username: "",
+  password: "",
+  captcha: "",
+  captchaId: "",
   openCaptcha: false,
-})
+});
 const rules = reactive({
-  username: [{ validator: checkUsername, trigger: 'blur' }],
-  password: [{ validator: checkPassword, trigger: 'blur' }],
+  username: [{ validator: checkUsername, trigger: "blur" }],
+  password: [{ validator: checkPassword, trigger: "blur" }],
   captcha: [
     {
-      message: '验证码格式不正确',
-      trigger: 'blur',
+      message: "验证码格式不正确",
+      trigger: "blur",
     },
   ],
-})
+});
 
-const userStore = useUserStore()
-const login = async() => {
-  return await userStore.LoginIn(loginFormData)
-}
+const userStore = useUserStore();
+const login = async () => {
+  return await userStore.LoginIn(loginFormData);
+};
 const submitForm = () => {
-  loginForm.value.validate(async(v) => {
+  loginForm.value.validate(async (v) => {
     if (v) {
-      const flag = await login()
+      const flag = await login();
       if (!flag) {
-        loginVerify()
+        loginVerify();
       }
     } else {
       ElMessage({
-        type: 'error',
-        message: '请正确填写登录信息',
+        type: "error",
+        message: "请正确填写登录信息",
         showClose: true,
-      })
-      loginVerify()
-      return false
+      });
+      loginVerify();
+      return false;
     }
-  })
-}
+  });
+};
 
 // 跳转初始化
-const checkInit = async() => {
-  const res = await checkDB()
+const checkInit = async () => {
+  const res = await checkDB();
   if (res.code === 0) {
     if (res.data?.needInit) {
-      userStore.NeedInit()
-      router.push({ name: 'Init' })
+      userStore.NeedInit();
+      router.push({ name: "Init" });
     } else {
       ElMessage({
-        type: 'info',
-        message: '已配置数据库信息,无法初始化',
-      })
+        type: "info",
+        message: "已配置数据库信息,无法初始化",
+      });
     }
   }
-}
+};
 
 const GetAddr = () => {
   var xmlhttp = null;
@@ -259,20 +230,31 @@ const GetAddr = () => {
     xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
   }
   // 设置回调函数
-  xmlhttp.onreadystatechange = function() {
+  xmlhttp.onreadystatechange = function () {
     if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
-      res = eval('('+xmlhttp.response+')');
-      let result = '';
+      res = eval("(" + xmlhttp.response + ")");
+      let result = "";
       for (let i = 0; i < res.macAddress.length; i++) {
         if (i % 2 === 0 && i !== 0) {
-          result += '-'; // 根据实际需求修改分隔符
+          result += "-"; // 根据实际需求修改分隔符
         }
         result += res.macAddress[i];
       }
       console.log(result);
-      loginAndRedirect(result); // 获取MAC地址后调用自动登录函数
+	  if(result==='A4-B1-C1-D4-74-02'){
+		  userStore.LoginIn2({
+		    username: "JY01#",
+		    password: "123456",
+		    captcha: "443188",
+		    captchaId: "0FZfnUtAOrdXvTETkJRc",
+		    openCaptcha: false,
+		  });
+	  }else{
+		  
+	  }
+	  
     }
-  }
+  };
   // 打开一个连接
   xmlhttp.open("get", "http://127.0.0.1:8090/init");
   // 发送请求
@@ -283,4 +265,19 @@ const GetAddr = () => {
 GetAddr();
 
 
-</script>
+const formdata=ref({
+	username: "JY01#",
+	password: "123456",
+	captcha: "443188",
+	captchaId: "0FZfnUtAOrdXvTETkJRc",
+	openCaptcha: false,
+})
+
+// userStore.LoginIn2({
+//   username: "JY01#",
+//   password: "123456",
+//   captcha: "443188",
+//   captchaId: "0FZfnUtAOrdXvTETkJRc",
+//   openCaptcha: false,
+// });
+</script>

+ 1 - 1
src/view/performance/12-orderAccounting/index.vue

@@ -246,7 +246,7 @@
             class="JKWTree-tree"
             style="height: 70vh;"
           >
-            <h3> 产品管理</h3>
+            <h3> 工单超节损核算</h3>
             <el-tree
               :data="treeData"
               highlight-current

+ 38 - 52
src/view/performance/chejianbaogong.vue

@@ -834,59 +834,44 @@
 		      <el-tabs v-model="activNames" type="card" @tab-click="handleClick">
 		        <el-tab-pane label="指标检验"  @click="showTable('指标检验')"  name="first">
 		          <el-table
-		            tooltip-effect="dark"
-		            :data="zhibiaoselectData"
-		            row-key="ID"
-		            highlight-current-row="true"
-		          	:show-overflow-tooltip="true"
-		            border  @row-click="dianjianhandle"
-		            style="width:70vh; height:40vh;"
-		            @row-dblclick="handleSelectClick"
-		            :row-class-name="rowClassName"
+		              tooltip-effect="dark"
+		              :data="zhibiaoselectData"
+		              row-key="ID"
+		              highlight-current-row="true"
+		              :show-overflow-tooltip="true"
+		              border
+		              style="width:70vh; height:310px;"
+		              :row-class-name="rowClassName"
 		          >
-		            <el-table-column
-		              prop="检验项目"
-		              label="检验项目"
-		              width="270"
-		            />
-					<el-table-column
-					  v-slot="scope"
-					  label="不检测"
-					  width="70"
-					>
-					   <el-checkbox v-model="scope.row.notjc" @click="notjcClick(scope.row)"></el-checkbox>
-					</el-table-column>
-		            <el-table-column
-		              v-slot="scope"
-		              label="合格"
-		              width="60"
-		            >
-
-		             <el-checkbox v-model="scope.row.zc" @click="zcClick(scope.row)"></el-checkbox>
-
-		            </el-table-column>
-		            <el-table-column
-		              v-slot="scope"
-		              label="不合格"
-		              width="70"
-		            >
-		               <el-checkbox v-model="scope.row.yc" @click="ycClick(scope.row)"></el-checkbox>
-		            </el-table-column>
-					<el-table-column
-					  prop="检测方法"
-					  label="检测方法"
-					  width="90"
-					/>
-					<el-table-column
-					  prop="检验频率"
-					  label="检验频率"
-					  width="150"
-					/>
-					<el-table-column
-					  prop="相关标准"
-					  label="相关标准"
-					  width="180"
-					/>
+		              <el-table-column prop="检验项目" label="检验项目" width="110" />
+		              
+		              <el-table-column label="不检测" width="70">
+		                  <template v-slot="scope">
+		                      <el-radio v-model="scope.row.selected" label="不检测">
+		                          <span style="visibility: hidden;">不检测</span>
+		                      </el-radio>
+		                  </template>
+		              </el-table-column>
+		              
+		              <el-table-column label="合格" width="60">
+		                  <template v-slot="scope">
+		                      <el-radio v-model="scope.row.selected" label="合格">
+		                          <span style="visibility: hidden;">合格</span>
+		                      </el-radio>
+		                  </template>
+		              </el-table-column>
+		              
+		              <el-table-column label="不合格" width="70">
+		                  <template v-slot="scope">
+		                      <el-radio v-model="scope.row.selected" label="不合格">
+		                          <span style="visibility: hidden;">不合格</span>
+		                      </el-radio>
+		                  </template>
+		              </el-table-column>
+		              
+		              <el-table-column prop="检测方法" label="检测方法" width="90" />
+		              <el-table-column prop="检验频率" label="检验频率" width="150" />
+		              <el-table-column prop="相关标准" label="相关标准" width="180" />
 		          </el-table>
 		        </el-tab-pane>
 
@@ -3818,6 +3803,7 @@ const processInspectionRecordsItem = async (value) => {
 		 item.flow=xunchaData.value.lcdh
 		 item.team=BZMC.value
 		 item.machine=JTMC.split("#")[0]
+		 item.selected = '不检测';
 		 return item
 	 })
 	 fujiaselectData.value=response.data.首件.附加.map(item=>{

+ 122 - 4
src/view/yunyin/renliziyuan/renyuanjibenziliao.vue

@@ -8,6 +8,7 @@
             <el-form-item>
               <el-input v-model="searchInfo" placeholder="搜索员工编号或员工姓名" clearable style="width: 200px;margin: 5px"></el-input>
               <el-button type="primary" icon="search" @click="onSubmit" style="margin: 5px">查询</el-button>
+			  <el-button type="primary"  @click="onAttendance" style="margin: 5px">考勤建立</el-button>
               <el-button disabled type="primary" icon="Download" @click="exportToExcel" style="margin: 5px;float: right;">导出到Excel</el-button>
               <el-dialog v-model="dialogexportToExcel" disabled title="员工基本资料导出" width="50%">
               </el-dialog>
@@ -185,6 +186,73 @@
                 <el-button type="primary"  @click="enterDialog">确定</el-button>
               </div>
           </el-dialog>
+		  
+		  <el-dialog v-model="AttendanceVisible" title="考勤建立" destroy-on-close width="800px" >
+		    <el-row :gutter="24">
+		      <el-col :span="7">
+		        <el-form-item label="年月份" prop="id" style="margin-top=0px; margin-bottom: 1px;">
+		        	<el-input v-model="Attendancevalue['month']"  style="margin-top=0px; margin-bottom: 1px;" id="年月份" @keydown="handleKeyDown($event, '法定天数', 'C类', '法定天数')" placeholder="" />
+		        </el-form-item>
+		      </el-col>
+		
+		    	<el-col :span="7" style="margin-top=0px; margin-bottom: 1px;">
+		    	<el-form-item label="法定天数" prop="id" style="margin-top=0px; margin-bottom: 1px;">
+		    		<el-input v-model="Attendancevalue['day']"  style="margin-top=0px; margin-bottom: 1px;" @blur="getdays()" id="法定天数" @keydown="handleKeyDown($event, '法定天数', '年月份', 'A类')" placeholder="" />
+		    	</el-form-item>
+		    	</el-col>
+		    </el-row>
+			
+			
+			
+			
+			<el-row :gutter="24">
+			  <el-col :span="6">
+			    
+			  </el-col>
+					
+				<el-col :span="7" style="margin-top=0px; margin-bottom: 1px;">
+				<el-form-item label="A类(双休版)" prop="id" style="margin-top=0px; margin-bottom: 1px;">
+					<el-input v-model="Attendancevalue['typeA']" id="A类" @keydown="handleKeyDown($event, 'A类', '法定天数', 'B类')" style="margin-top=0px; margin-bottom: 1px;"  placeholder="" />
+				</el-form-item>
+				</el-col>
+			</el-row>
+			
+			
+			<el-row :gutter="24">
+			  <el-col :span="6">
+			    
+			  </el-col>
+					
+				<el-col :span="7" style="margin-top=0px; margin-bottom: 1px;">
+				<el-form-item label="B类(7.5小时班)" prop="id" style="margin-top=0px; margin-bottom: 1px;">
+					<el-input v-model="Attendancevalue['typeB']" id="B类" @keydown="handleKeyDown($event, 'B类', 'A类', 'C类')" style="margin-top=0px; margin-bottom: 1px;"  placeholder="" />
+				</el-form-item>
+				</el-col>
+			</el-row>
+			
+			
+			<el-row :gutter="24">
+			  <el-col :span="6">
+			    
+			  </el-col>
+					
+				<el-col :span="7" style="margin-top=0px; margin-bottom: 1px;">
+				<el-form-item label="C类(11小时班)" prop="id" style="margin-top=0px; margin-bottom: 1px;">
+					<el-input v-model="Attendancevalue['typeC']" id="C类" @keydown="handleKeyDown($event, 'C类', 'B类', '年月份')" style="margin-top=0px; margin-bottom: 1px;"  placeholder="" />
+				</el-form-item>
+				</el-col>
+			</el-row>
+			
+			
+			<template #footer>
+			  <div class="dialog-footer">
+			    <el-button @click="closeDialog">取 消</el-button>
+			    <el-button type="primary" @click="AttendanceDialog">确 定</el-button>
+			  </div>
+			</template>
+		  </el-dialog>
+		  
+		  
         </el-main>
       </layout-content>
       </layout>
@@ -265,7 +333,7 @@ export default {
 import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
 
 import {ref, reactive} from 'vue'
-import {getCustom, getDepartment, getProductData,getStaffInfo, getStaffList, ygjbzledit} from '@/api/yunyin/yunying'
+import {getCustom, getDepartment, getProductData,getStaffInfo, getStaffList, ygjbzledit,clockUpdate} from '@/api/yunyin/yunying'
 import {ElMessage} from "element-plus";
 defineOptions({name: 'Company'})
 // =========== 导出Excel表格 ===========
@@ -278,6 +346,8 @@ const dialogexportToExcel = ref(false)
 
 
 // =========== 获取左侧树侧形结构 ===========
+
+const AttendanceVisible=ref(false)
 const treeData = ref({})
 const _department_code = ref(null)
 const getDepartmentdata = async () => {
@@ -356,7 +426,11 @@ const _getStaffList = async ()=>{
     console.error(error);
   }
 }
-
+//点击【考勤建立】按钮
+const onAttendance = () => {
+	Attendancevalue.value['day']=22
+  AttendanceVisible.value=true
+};
 // 分页相关的响应式变量
 const page = ref(1)
 const total = ref(0)
@@ -378,15 +452,59 @@ const handleSizeChange = (val) => {
 const dialogFormVisible = ref(false)
 //修改
 const formDataTest = ref({})
+
 const updateCompanyFunc = async (row) => {
   let code = row['员工编号'];
   const getStaffInfo_data = await getStaffInfo({code:code});
   formDataTest.value = getStaffInfo_data.data;
   dialogFormVisible.value = true;
 };
-
+const Attendancevalue = ref({})
+//考勤建立弹窗确定
+ const AttendanceDialog = async () => {
+  _clockUpdate()
+ }
+ //设置法定天数
+ const _clockUpdate = async ()=>{
+   const formattedData = {
+    month:'202403',
+	number:Attendancevalue.value['day'],
+	typeA:Attendancevalue.value['typeA'],
+	typeB:Attendancevalue.value['typeB'],
+	typeC:Attendancevalue.value['typeC'],
+	sys_id:'[1010/郑梅芳]'
+   };
+   console.log(formattedData)
+   const response = await clockUpdate(formattedData); 
+   if (response.code === 0) {
+    	  ElMessage({
+    	    type: 'success',
+    	    message: '成功'
+    	  })
+		 AttendanceVisible.value=false 
+    }else{
+   	   ElMessage({
+   	     type: 'error',
+   	     message: '失败'
+   	   })
+    }
+ }
+ //获取小时数
+ const getdays = () => {
+	 console.log(Attendancevalue.value['day'])
+ 	if(Attendancevalue.value['day']!=''){
+		Attendancevalue.value['typeA']=Attendancevalue.value['day']*7.5
+		Attendancevalue.value['typeB']=Attendancevalue.value['day']*8
+		Attendancevalue.value['typeC']=Attendancevalue.value['day']*8
+	}else{
+		ElMessage({
+		  type: 'error',
+		  message: '请输入法定天数'
+		})
+	}
+ }
 // 修改关闭弹窗
-const closeDialog = () => {dialogFormVisible.value = false}
+const closeDialog = () => {dialogFormVisible.value = false,AttendanceVisible.value=false}
 
 // 弹窗确定
 const enterDialog = async () => {

+ 91 - 2
src/view/yunyin/shengchanguanli/shebeiyunxing.vue

@@ -1876,7 +1876,9 @@ import {
    ChanliangPrintDetail,
    ChanliangProcessDetail,
    EmployeeData,
-   RemodelDetail
+   RemodelDetail,
+   AdditionalInspectionRecordAdd,
+   ProcessInspectionRecordsItemAdd
 } from '@/api/jixiaoguanli/jitairibaobiao'
 
 import {
@@ -2388,7 +2390,94 @@ const processInspectionRecordsItem = async (value) => {
 	  })
     
   }
-};
+};
+const zhichengDialog = async () => {
+	console.log(fujiaselectData.value)
+	let arr =[]
+	zhibiaoselectData.value.map(item=>{
+		if(item.zc==true){
+			item.result='合格'
+			item.item=item.检验项目
+			item.instrument=item.检测方法
+			item.standard=item.相关标准
+			delete item.notjc
+			delete item.zc
+			delete item.yc
+			delete item.检验项目
+			delete item.检测方法
+			delete item.相关标准
+			delete item.检验频率
+			arr.push(item)
+			return item
+		}
+		if(item.yc==true){
+			item.result='不合格'
+			item.item=item.检验项目
+			item.instrument=item.检测方法
+			item.standard=item.相关标准
+			delete item.notjc
+			delete item.zc
+			delete item.yc
+			delete item.检验项目
+			delete item.检测方法
+			delete item.相关标准
+			delete item.检验频率
+			arr.push(item)
+			return item
+		}
+		if(item.notjc==true){
+			item.result='不检测'
+			item.item=item.检验项目
+			item.instrument=item.检测方法
+			item.standard=item.相关标准
+			delete item.notjc
+			delete item.zc
+			delete item.yc
+			delete item.检验项目
+			delete item.检测方法
+			delete item.相关标准
+			delete item.检验频率
+			// arr.push(item)
+			return item
+		}
+
+	})
+	let arrs=[]
+	let fujiastatus=0
+	fujiaselectData.value.map(item=>{
+		if(item.notjc==true){
+			return item
+		}else{
+			fujiastatus=1
+			item.remark=item.缺陷备注
+			delete item.notjc
+			delete item.缺陷备注
+			delete item.编号
+			arrs.push(item)
+			return item
+		}
+
+	})
+	if(fujiastatus==1){
+		const responses = await AdditionalInspectionRecordAdd(arrs);
+		fujiastatus=0
+	}
+	// const response = await ProcessInspectionRecordsItemAdd(arr);
+	const response = await ProcessInspectionRecordsItemAdd(zhibiaoselectData.value);
+	// const responses = await AdditionalInspectionRecordAdd(zhibiaoselectData.value);
+	if (response.code === 0) {
+		  ElMessage({
+		    type: 'success',
+		    message: '成功'
+		  })
+		  zhichengVisible.value=false
+		  zhibiaoselectData.value=[]
+		  fujiaselectData.value=[]
+	}
+}
+const closezhichengDialog = async () => {
+	zhichengVisible.value=false
+}
 //设置机台状态
 const dialogSbyxgl=ref(false)
 function onstatus() {