cyy 1 год назад
Родитель
Сommit
f4628bf566

+ 3 - 2
.env.development

@@ -22,12 +22,13 @@ VUE_APP_API_DOMAIN_NAME=a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a
 # singleApp  是否单体应用 0:否,1:是
 # ---开发环境
 VUE_APP_BASE_API_0_0_DEV = ${VUE_APP_BASE_API}
+VUE_APP_BASE_API_2_0_DEV2 = http://dev2.local/ibps
 # ---本地环境1
 VUE_APP_BASE_API_1_0_134WY = http://192.168.2.134:5100/ibps
 # ---本地环境2
-VUE_APP_BASE_API_2_0_247GZL = http://192.168.2.247:5100/ibps
+VUE_APP_BASE_API_2_0_8GZL = http://192.168.2.8:5100/ibps
 # ---演示环境
-VUE_APP_BASE_API_2_0_7LY = http://192.168.2.7:5100/ibps
+VUE_APP_BASE_API_2_0_9LY = http://192.168.2.9:5100/ibps
 # ---测试环境
 VUE_APP_BASE_API_2_0_TEST = http://test1.local/ibps
 # ---演示环境

+ 35 - 0
src/api/platform/feature/alienRegistration.js

@@ -0,0 +1,35 @@
+import request from '@/utils/request'
+
+/**
+ * 获取二维码数据
+ * @param {*} params
+ */
+export function query(params) {
+  return request({
+    url: '/business/v3/employee/registrationOutsiders/query',
+    method: 'post',
+    data: params
+  })
+}
+/**
+ * 获取签到数据
+ * @param {*} params
+ */
+// export function querySign(params) {
+//   return request({
+//     url: '/business/v3/employee/signInformation/query',
+//     method: 'post',
+//     data: params
+//   })
+// }
+/**
+ * 保存签到数据
+ * @param {*} params
+ */
+export function save(params) {
+  return request({
+    url: '/business/v3/employee/registrationOutsiders/save',
+    method: 'post',
+    data: params
+  })
+}

+ 6 - 0
src/router/routes.js

@@ -366,6 +366,12 @@ const frameCustom = [
         meta: { title: '签到' },
         component: _import('/platform/bpmn/siginin/outIndex')
       },
+      {
+        path: 'alienRegistration/index',
+        name: 'alienRegistration',
+        meta: { title: '外来人员登记' },
+        component: _import('/platform/bpmn/alienRegistration/index')
+      },
       {
         path: 'report/oralReport',
         name: 'oralReport',

+ 2 - 1
src/setting.js

@@ -27,7 +27,8 @@ export default {
     '/ziliao',
     '/sealCompleted',
     '/fileView',
-    '/bpmn/siginin/outIndex'
+    '/bpmn/siginin/outIndex',
+    '/bpmn/alienRegistration/index'
   ],
   // 全局key
   globalKey: 'ibps-app-' + version,

+ 458 - 0
src/views/platform/bpmn/alienRegistration/index.vue

@@ -0,0 +1,458 @@
+<template>
+  <div ref="alienRegistrationRootClass" class="alienRegistrationRootClass20241028">
+    <van-sticky>
+      <van-nav-bar
+        :title="'外来人员登记'"
+        :left-text="$t('common.button.back')"
+        left-arrow
+        @click-left="$router.push({ name: 'login' })"
+      />
+    </van-sticky>
+    <div v-if="statusCode==='1'">
+      <van-form validate-first @failed="onFailed">
+        <van-field
+          v-model="waiLaiRenYuan"
+          required
+          label="姓名:"
+          placeholder="请输入姓名"
+          label-width="7em"
+          clearable
+        />
+        <van-field
+          v-model="keHuMing"
+          label="单位:"
+          placeholder="请输入单位"
+          label-width="7em"
+          clearable
+        />
+        <van-field
+          v-model="jinRuYuanYin"
+          required
+          label="进入原因:"
+          placeholder="请输入原因"
+          label-width="7em"
+          clearable
+        />
+        <van-field
+          v-model="jinRuQuYu"
+          label="进入区域:"
+          placeholder="请输入区域"
+          label-width="7em"
+          clearable
+        />
+        <van-field
+          v-model="shouJiHao"
+          required
+          label="手机号:"
+          placeholder="请输入您的手机号"
+          label-width="7em"
+          :rules="[{ validator, message: '请输入正确内容' }]"
+          clearable
+        />
+        <van-field
+          v-model="peiTongRen"
+          required
+          label="接待人:"
+          placeholder="请输入人员名称"
+          label-width="7em"
+          clearable
+        /><van-field
+          v-model="jieDaiBuMen"
+          label="接待部门:"
+          placeholder="请输入部门"
+          label-width="7em"
+          clearable
+        />
+        <van-field
+          v-model="beiZhu"
+          label="备注:"
+          placeholder="请输入备注"
+          label-width="7em"
+          clearable
+        />
+        <div class="qdBtn">
+          <van-button
+            type="success"
+            class="btn btn-back-color"
+            @click="onSubmit"
+          >
+            登记进入
+          </van-button>
+        </div>
+      </van-form>
+    </div>
+    <div v-if="statusCode==='2'">
+      <!-- <button class="btn68">登记离开</button> -->
+      <van-form validate-first @failed="onFailed">
+        <van-field
+          v-model="shouJiHao"
+          label="手机号:"
+          required
+          placeholder="请输入您的手机号"
+          label-width="7em"
+          clearable
+          :rules="[{ validator, message: '请输入正确内容' }]"
+        />
+        <div class="qdBtn">
+          <van-button
+            type="success"
+            class="btn btn-back-color"
+            @click="onSubmit"
+          >
+            登记离开
+          </van-button>
+        </div>
+      </van-form>
+    </div>
+  </div>
+</template>
+<script>
+import { query, save } from '@/api/platform/feature/alienRegistration'
+import ActionUtils from '@/utils/action'
+export default {
+  data() {
+    const { userInfo } = this.$store.getters
+    return {
+      userInfo,
+      qdInfo: [],
+      statusCode: '1',
+      waiLaiRenYuan: '',
+      keHuMing: '',
+      jinRuYuanYin: '',
+      jinRuQuYu: '',
+      peiTongRen: '',
+      jieDaiBuMen: '',
+      beiZhu: '',
+      shouJiHao: ''
+      // aa: ''
+    }
+  },
+  created() {
+    // console.log(navigator)
+    // document.addEventListener('plusready', function() {
+    //   this.aa = plus.device.uuid
+    // }, true)
+    this.getQdInfo()
+  },
+  mounted() {
+    this.$refs.alienRegistrationRootClass.style.height = document.documentElement.clientHeight + 'px'
+  },
+  methods: {
+    validator(val) {
+      return /^1[3-9]\d{9}$/.test(val)
+    },
+    onFailed(errorInfo) {
+      console.log('failed', errorInfo)
+    },
+    getQdInfo() {
+      console.log(this.$route.query)
+      // type: 1.登记进入,2.登记离开
+      if (this.$route.query.type) {
+        this.statusCode = this.$route.query.type
+        // query(this.getSearcFormData('qrcode')).then(res => {
+        //   const data = res.data.dataResult || []
+        //   console.log(data)
+        //   // if (data.length > 0) {
+        //   //   this.qdInfo = data[0].xiangXiXinXi !== '' ? JSON.parse(data[0].xiangXiXinXi) : 0
+        //   //   this.scanList = data[0]
+        //   //   if (data[0].zhuangTai === '失效') {
+        //   //     // 二维码失效
+        //   //     this.statusCode = 3
+        //   //   } else {
+        //   //     this.guanlianID = data[0].guanLianId
+        //   //     this.yeWuBiaoMing = data[0].biaoMing
+        //   //     this.statusCode = 2
+        //   //   }
+        //   // }
+        // })
+      } else {
+        // 无type
+        this.statusCode = '0'
+      }
+    },
+    getAlreadyQD() {
+      const paramWhere1 = {
+        bianZhiShiJian: this.getNow().slice(0, 10),
+        waiLaiRenYuan: this.waiLaiRenYuan,
+        keHuMing: this.keHuMing,
+        jinRuYuanYin: this.jinRuYuanYin,
+        jinRuQuYu: this.jinRuQuYu,
+        peiTongRen: this.peiTongRen,
+        jieDaiBuMen: this.jieDaiBuMen,
+        beiZhu: this.beiZhu,
+        shouJiHao: this.shouJiHao,
+        jinRuShiJian: this.getNow(),
+        shiFouGuoShen: '已暂存'
+      }
+      const paramWhere2 = {
+        shouJiHao: this.shouJiHao,
+        liKaiShiJian: this.getNow(),
+        shiFouGuoShen: '已完成'
+      }
+      query(this.getSearcFormData('qrcode')).then(res => {
+        const data = res.data.dataResult || []
+        console.log(data)
+        if (this.statusCode === '1') {
+          if (data.length === 0 || !data.some(r => r.liKaiShiJian === null || r.liKaiShiJian === '')) {
+            save(paramWhere1).then(res => {
+              if (res.state === 200) {
+                this.$toast({
+                  duration: 30000, // 持续展示 toast
+                  message: '登记进入成功'
+                })
+                setTimeout(() => {
+                  this.statusCode = '0'
+                  this.$router.push({ name: 'login' })
+                }, 1000)
+              }
+            })
+          } else if (data.length > 0 && data.some(r => r.liKaiShiJian === null || r.liKaiShiJian === '')) {
+            this.$toast({
+              duration: 30000, // 持续展示 toast
+              message: '该手机号存在未登记离开数据,请扫离开码登记离开!'
+            })
+          }
+        } else if (this.statusCode === '2') {
+          if (data.length > 0 && data.some(r => r.liKaiShiJian === null || r.liKaiShiJian === '')) {
+            paramWhere2.id = data[0].id
+            save(paramWhere2).then(res => {
+              if (res.state === 200) {
+                this.$toast({
+                  duration: 30000, // 持续展示 toast
+                  message: '登记离开成功'
+                })
+                setTimeout(() => {
+                  this.statusCode = '0'
+                  this.$router.push({ name: 'login' })
+                }, 1000)
+              }
+            })
+          } else {
+            this.$toast({
+              duration: 30000, // 持续展示 toast
+              message: '该手机号不存在未登记离开的数据!'
+            })
+          }
+        } else {
+          this.$toast({
+            duration: 30000, // 持续展示 toast
+            message: '进入路径错误,请联系管理人员!'
+          })
+        }
+      })
+    },
+    onSubmit() {
+      console
+      if (this.statusCode === '1') {
+        if (this.waiLaiRenYuan === '') {
+          this.$toast({
+            duration: 2000, // 持续展示 toast
+            message: '请输入外来人员姓名'
+          })
+        } else if (this.waiLaiRenYuan.length > 200) {
+          this.$toast({
+            duration: 2000, // 持续展示 toast
+            message: '外来人员姓名长度超出'
+          })
+        } else if (this.jinRuYuanYin === '') {
+          this.$toast({
+            duration: 2000, // 持续展示 toast
+            message: '请输入进入原因'
+          })
+        } else if (this.jinRuYuanYin.length > 1000) {
+          this.$toast({
+            duration: 2000, // 持续展示 toast
+            message: '进入原因长度超出'
+          })
+        } else if (this.peiTongRen === '') {
+          this.$toast({
+            duration: 2000, // 持续展示 toast
+            message: '请输入接待人'
+          })
+        } else if (this.peiTongRen.length > 200) {
+          this.$toast({
+            duration: 2000, // 持续展示 toast
+            message: '接待人长度超出'
+          })
+        } else if (this.keHuMing.length > 1000) {
+          this.$toast({
+            duration: 2000, // 持续展示 toast
+            message: '外来人员单位长度超出'
+          })
+        } else if (this.jinRuQuYu.length > 200) {
+          this.$toast({
+            duration: 2000, // 持续展示 toast
+            message: '进入区域长度超出'
+          })
+        } else if (this.jieDaiBuMen.length > 200) {
+          this.$toast({
+            duration: 2000, // 持续展示 toast
+            message: '接待部门长度超出'
+          })
+        } else if (this.beiZhu.length > 1000) {
+          this.$toast({
+            duration: 2000, // 持续展示 toast
+            message: '备注长度超出'
+          })
+        } else if (this.shouJiHao.length === '') {
+          this.$toast({
+            duration: 2000, // 持续展示 toast
+            message: '请输入手机号'
+          })
+        } else if (this.shouJiHao.length > 200) {
+          this.$toast({
+            duration: 2000, // 持续展示 toast
+            message: '手机号长度超出'
+          })
+        } else if (!(/^1[3-9]\d{9}$/.test(this.shouJiHao))) {
+          this.$toast({
+            duration: 2000, // 持续展示 toast
+            message: '手机号格式不正确'
+          })
+        } else {
+          this.getAlreadyQD()
+        }
+      } else if (this.statusCode === '2') {
+        if (this.shouJiHao === '') {
+          this.$toast({
+            duration: 2000, // 持续展示 toast
+            message: '请输入手机号'
+          })
+        } else if (this.shouJiHao.length > 200) {
+          this.$toast({
+            duration: 2000, // 持续展示 toast
+            message: '手机号长度超出'
+          })
+        } else if (!(/^1[3-9]\d{9}$/.test(this.shouJiHao))) {
+          this.$toast({
+            duration: 2000, // 持续展示 toast
+            message: '手机号格式不正确'
+          })
+        } else {
+          this.getAlreadyQD()
+        }
+      }
+    },
+    // 获取当前时间
+    getNow() {
+      const now = new Date()
+      const year = now.getFullYear()
+      const month = ('0' + (now.getMonth() + 1)).slice(-2)
+      const day = ('0' + now.getDate()).slice(-2)
+      const hours = ('0' + now.getHours()).slice(-2)
+      const minutes = ('0' + now.getMinutes()).slice(-2)
+      // const seconds = ('0' + now.getSeconds()).slice(-2)
+      const formattedTime = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes
+      return formattedTime
+    },
+    /**
+     * 获取格式化参数
+     */
+    getSearcFormData(val) {
+      const params = { 'Q^shou_ji_hao_^SL': this.shouJiHao }
+      const sorts = { 'create_time_': 'DESC' }
+      return ActionUtils.formatParams(
+        params,
+        {},
+        sorts)
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.alienRegistrationRootClass20241028{
+  background-color: #f8f8f8;
+  overflow-y: scroll;
+  overflow-x: hidden;
+  .qdBtn{
+    text-align: center;
+    .btn {
+      width: 90%;
+      margin-top: 15px;
+      padding: 15px;
+      border-radius: 5px;
+    }
+    .btn-back-color {
+      background-color: #1989fa !important;
+      border: none;
+    }
+  }
+  .contentNo {
+    width: 96%;
+    height: 20%;
+    text-align: center;
+    line-height: 160px;
+    font-size: 20px;
+    font-weight: 600;
+    margin: 5% auto;
+    background-color: #fff;
+    border-radius: 10px;
+  }
+
+  ::v-deep .qianMing .van-cell--borderless {
+    padding-left: 8px;
+  }
+  ::v-deep .qianMing .van-cell .van-field__label {
+    display: flex;
+    align-items: center;
+    justify-content: left;
+    font-size: 14px;
+    color: #646566;
+  }
+  ::v-deep .qianMing .van-cell .van-field__label::before {
+    content: '';
+    width: 5px;
+    height: 14px;
+    background-color: #2979ff;
+    border-radius: 2px;
+    margin-right: 5px;
+  }
+  .btn68{
+    width: 120px;
+    height: 120px;
+    background-color: #0093E9;
+    color: #ffffff;
+    font-size: 16px;
+    font-weight: bold;
+    letter-spacing: 2px;
+    border: none;
+    border-radius: 100%;
+    cursor: pointer;
+    position: relative;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    transition: all .1s linear;
+    margin: 20% auto 0;
+  }
+  .btn68:before,.btn68:after{
+    content: '';
+    width: 120px;
+    height: 120px;
+    border-radius: 100%;
+    position: absolute;
+    animation: eff68 1.4s linear infinite;
+  }
+  .btn68:after{
+    animation-delay: 0.7s;
+  }
+  @keyframes eff68{
+    0%{
+      box-shadow: 0 0 0 0px #0093E9;
+      opacity: 0.2;
+    }
+    100%{
+      box-shadow: 0 0 0 30px #0093E9;
+      opacity: 0;
+    }
+  }
+  .btn68:active{
+    transform: scale(0.96);
+  }
+
+}
+.alienRegistrationRootClass20241028::-webkit-scrollbar{
+  width: 0;
+}
+
+</style>