Browse Source

签到增加业务表名信息

cyy 1 năm trước cách đây
mục cha
commit
7d3633906d

+ 12 - 1
src/api/platform/bpmn/bpmCommonStatment.js

@@ -36,7 +36,18 @@ export function save(params) {
     data: params
   })
 }
-
+/**
+ * 保存数据
+ * @param {*} params
+ */
+export function saveAdjustment(params) {
+  return request({
+    url: BPMN_URL() + '/employee/adjustment/save',
+    method: 'post',
+    isLoading: true,
+    data: params
+  })
+}
 /**
  * 获取数据
  * @param {*} params

+ 105 - 102
src/views/platform/bpmn/siginin/index.vue

@@ -2,7 +2,8 @@
   <div>
     <div class="headTitle">
       <van-row>
-        <van-col span="1.5" style="text-align: center;" @click="backHome"><van-icon name="wap-home-o"
+        <van-col span="1.5" style="text-align: center;" @click="backHome"><van-icon
+name="wap-home-o"
             size="16px" /></van-col>
         <van-col span="2.5" style="font-size: 16px;" @click="backHome">首页</van-col>
         <van-col span="13" offset="7" style="font-size: 18px;">签到</van-col>
@@ -10,124 +11,126 @@
     </div>
     <!-- 签到信息 -->
     <div class="content">
-      <div class="contentNo" v-if="this.statusCode!==2">
+      <div v-if="statusCode!==2" class="contentNo">
         {{statusCode==0?"已签到,请勿重复操作":statusCode==1?"未获取到相关签到信息":statusCode==3?"二维码已失效":statusCode==4?"错误二维码":""}}</div>
-      <div class="contentTitle" v-if="this.statusCode==2">签到信息</div>
-      <div class="contentShow" v-if="this.statusCode==2">
-        <van-row style="padding: 4% 5%;" v-for="(item,index) in  qdInfo" :key="index">
+      <div v-if="statusCode==2" class="contentTitle">签到信息</div>
+      <div v-if="statusCode==2" class="contentShow">
+        <van-row v-for="(item,index) in  qdInfo" :key="index" style="padding: 4% 5%;">
           <van-col span="10" class="contentLeft">{{item.label}}</van-col>
           <van-col span="14" class="contentRight">{{item.value}}</van-col>
         </van-row>
       </div>
     </div>
-    <div class="footBtn"><van-button type="info" @click="interpositionQD()" :disabled="statusCode!==2">点击签到</van-button>
+    <div class="footBtn"><van-button type="info" :disabled="statusCode!==2" @click="interpositionQD()">点击签到</van-button>
     </div>
   </div>
 </template>
 <script>
-  import { mapState } from 'vuex'
-  import Vue from 'vue';
-  import { Toast } from 'vant'
-  Vue.use(Toast)
-  export default {
-    data() {
-      return {
-        qdInfo: [],
-        scanList: [],
-        statusCode: 1,
-        guanlianID: '',
-      }
-    },
-    created() {
-      this.getQdInfo()
-    },
-    computed: {
-      ...mapState('ibps/user', [
-        'info'
-      ]),
-    },
-    methods: {
-      getQdInfo() {
-        // 扫描二维码传递过来的codeId
-        // this.$route.query.codeId = '1244662627406184448'
-        let sql = `select * from t_qrcodeb where id_='${this.$route.query.codeId}'`
-        if (this.$route.query.codeId) {
-          this.$common.request('sql', sql).then(res => {
-            console.log("根据id查询得到的数据", res);
-            let data = res.variables.data || []
-            if (data.length > 0) {
-              this.qdInfo = data[0].xiang_xi_xin_xi_ != '' ? JSON.parse(data[0].xiang_xi_xin_xi_) : 0
-              this.scanList = data[0]
-              if (data[0].zhuang_tai_ == '失效') {
-                // 二维码失效
-                this.statusCode = 3
-              } else {
-                this.getAlreadyQD()
-                this.guanlianID = data[0].guan_lian_id_
-              }
-            }
+import { mapState } from 'vuex'
+import Vue from 'vue'
+import { Toast } from 'vant'
+Vue.use(Toast)
+export default {
+  data() {
+    return {
+      qdInfo: [],
+      scanList: [],
+      statusCode: 1,
+      guanlianID: '',
+      yeWuBiaoMing: ''
+    }
+  },
+  computed: {
+    ...mapState('ibps/user', [
+      'info'
+    ])
+  },
+  created() {
+    this.getQdInfo()
+  },
 
-          })
-        } else {
-          // 错误二维码
-          this.statusCode = 4
-        }
-      },
-      getAlreadyQD() {
-        // t_qdxxb签到信息表
-        let sql = `select * from t_qdxxb where er_wei_ma_id_='${this.$route.query.codeId}' and ren_yuan_id_ = '${this.info.employee.id}'`
+  methods: {
+    getQdInfo() {
+      // 扫描二维码传递过来的codeId
+      // this.$route.query.codeId = '1244662627406184448'
+      const sql = `select * from t_qrcodeb where id_='${this.$route.query.codeId}'`
+      if (this.$route.query.codeId) {
         this.$common.request('sql', sql).then(res => {
-          // console.log("根据this.$route.query.codeId和用户id查询数据库", res);
-          let data = res.variables.data || []
+          console.log('根据id查询得到的数据', res)
+          const data = res.variables.data || []
           if (data.length > 0) {
-            this.statusCode = 0
-          } else {
-            // 1.未获取到相关签到信息2.正常
-            this.statusCode = this.qdInfo.length > 0 ? 2 : 1
-          }
-        })
-      },
-      // 点击签到相当于往数据库添加一条数据
-      interpositionQD() {
-        let ids = []
-        let duixian = {}
-        duixian["parent_id_"] = this.$route.query.codeId
-        duixian["er_wei_ma_id_"] = this.$route.query.codeId
-        duixian["qian_dao_shi_jian"] = this.getNow()
-        duixian["ren_yuan_id_"] = this.info.employee.id
-        duixian["guan_lian_id_"] = this.guanlianID
-        ids.push(duixian)
-        console.log("duixian", duixian);
-        console.log("ids", ids);
-        this.$common.request('add', '{"tableName":"t_qdxxb","paramWhere":' + JSON.stringify(ids) + '}').then(res => {
-          // console.log("res点击签到往数据库添加一条数据", res);
-          if (res.state == 200) {
-            Toast.success('签到成功');
-            setTimeout(() => {
-              this.statusCode = 0
-            }, 1500)
+            this.qdInfo = data[0].xiang_xi_xin_xi_ !== '' ? JSON.parse(data[0].xiang_xi_xin_xi_) : 0
+            this.scanList = data[0]
+            if (data[0].zhuang_tai_ === '失效') {
+              // 二维码失效
+              this.statusCode = 3
+            } else {
+              this.getAlreadyQD()
+              this.guanlianID = data[0].guan_lian_id_
+              this.yeWuBiaoMing = data[0].biao_ming_
+            }
           }
-
         })
-      },
-      // 获取当前时间
-      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 + ':' + seconds;
-        return formattedTime
-      },
-      // 返回首页
-      backHome() {
-        this.$router.push({ name: 'dashboard' });
+      } else {
+        // 错误二维码
+        this.statusCode = 4
       }
+    },
+    getAlreadyQD() {
+      // t_qdxxb签到信息表
+      const sql = `select * from t_qdxxb where er_wei_ma_id_='${this.$route.query.codeId}' and ren_yuan_id_ = '${this.info.employee.id}'`
+      this.$common.request('sql', sql).then(res => {
+        // console.log("根据this.$route.query.codeId和用户id查询数据库", res);
+        const data = res.variables.data || []
+        if (data.length > 0) {
+          this.statusCode = 0
+        } else {
+          // 1.未获取到相关签到信息2.正常
+          this.statusCode = this.qdInfo.length > 0 ? 2 : 1
+        }
+      })
+    },
+    // 点击签到相当于往数据库添加一条数据
+    interpositionQD() {
+      const ids = []
+      const duixian = {}
+      duixian['parent_id_'] = this.$route.query.codeId
+      duixian['er_wei_ma_id_'] = this.$route.query.codeId
+      duixian['qian_dao_shi_jian'] = this.getNow()
+      duixian['ren_yuan_id_'] = this.info.employee.id
+      duixian['guan_lian_id_'] = this.guanlianID
+      duixian['ye_wu_biao_ming_'] = this.yeWuBiaoMing
+      ids.push(duixian)
+      console.log('duixian', duixian)
+      console.log('ids', ids)
+      this.$common.request('add', '{"tableName":"t_qdxxb","paramWhere":' + JSON.stringify(ids) + '}').then(res => {
+        // console.log("res点击签到往数据库添加一条数据", res);
+        if (res.state == 200) {
+          Toast.success('签到成功')
+          setTimeout(() => {
+            this.statusCode = 0
+          }, 1500)
+        }
+      })
+    },
+    // 获取当前时间
+    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 + ':' + seconds
+      return formattedTime
+    },
+    // 返回首页
+    backHome() {
+      this.$router.push({ name: 'dashboard' })
     }
   }
+}
 </script>
 <style scoped lang="scss">
   .headTitle {
@@ -180,4 +183,4 @@
       font-size: 16px;
     }
   }
-</style>
+</style>

+ 85 - 5
src/views/platform/bpmn/siginin/outIndex.vue

@@ -9,6 +9,7 @@
       />
     </van-sticky>
     <van-field
+      v-if="statusCode==2"
       v-model="xingMing"
       required
       label="姓名:"
@@ -17,6 +18,7 @@
       clearable
     />
     <van-field
+      v-if="statusCode==2"
       v-model="keShi"
       label="科室:"
       placeholder="请输入科室"
@@ -24,6 +26,7 @@
       clearable
     />
     <van-field
+      v-if="statusCode==2"
       v-model="zhiWu"
       label="职务:"
       placeholder="请输入职务"
@@ -31,12 +34,13 @@
       clearable
     />
     <ibps-signature
+      v-if="statusCode==2"
       v-model="qianMing"
       label="签名"
       class="qianMing"
       placeholder=" "
     />
-    <div class="qdBtn">
+    <div v-if="statusCode==2" class="qdBtn">
       <van-button
         type="success"
         class="btn btn-back-color"
@@ -45,6 +49,8 @@
         签到
       </van-button>
     </div>
+
+    <div v-if="statusCode!==2" class="contentNo">{{statusCode==0?"已签到,请勿重复操作":statusCode==1?"未获取到相关签到信息":statusCode==3?"二维码已失效":statusCode==4?"错误二维码":""}}</div>
   </div>
 </template>
 <script>
@@ -54,13 +60,59 @@ export default {
       xingMing: '',
       keShi: '',
       zhiWu: '',
-      qianMing: ''
+      qianMing: '',
+      statusCode: 1,
+      guanlianID: '',
+      yeWuBiaoMing: ''
     }
   },
+  created() {
+    this.getQdInfo()
+  },
   mounted() {
     this.$refs.outSideRootClass.style.height = document.documentElement.clientHeight + 'px'
   },
   methods: {
+    getQdInfo() {
+      // 扫描二维码传递过来的codeId
+      // this.$route.query.codeId = '1244662627406184448'
+      const sql = `select * from t_qrcodeb where id_='${this.$route.query.codeId}'`
+      if (this.$route.query.codeId) {
+        this.$common.request('sql', sql).then(res => {
+          console.log('根据id查询得到的数据', res)
+          const data = res.variables.data || []
+          if (data.length > 0) {
+            this.qdInfo = data[0].xiang_xi_xin_xi_ !== '' ? JSON.parse(data[0].xiang_xi_xin_xi_) : 0
+            this.scanList = data[0]
+            if (data[0].zhuang_tai_ === '失效') {
+              // 二维码失效
+              this.statusCode = 3
+            } else {
+              this.getAlreadyQD()
+              this.guanlianID = data[0].guan_lian_id_
+              this.yeWuBiaoMing = data[0].biao_ming_
+            }
+          }
+        })
+      } else {
+        // 错误二维码
+        this.statusCode = 4
+      }
+    },
+    getAlreadyQD() {
+      // t_qdxxb签到信息表
+      const sql = `select * from t_qdxxb where er_wei_ma_id_='${this.$route.query.codeId}' and ren_yuan_id_ = '${this.info.employee.id}'`
+      this.$common.request('sql', sql).then(res => {
+        // console.log("根据this.$route.query.codeId和用户id查询数据库", res);
+        const data = res.variables.data || []
+        if (data.length > 0) {
+          this.statusCode = 0
+        } else {
+          // 1.未获取到相关签到信息2.正常
+          this.statusCode = this.qdInfo.length > 0 ? 2 : 1
+        }
+      })
+    },
     onSubmit() {
       if (this.xingMing === '') {
         this.$toast({
@@ -86,25 +138,42 @@ export default {
         const paramWhere = {
           ren_yuan_xing_min: this.xingMing,
           wai_bu_ren_yuan_q: this.qianMing,
-          xiang_guan_xin_xi: JSON.stringify({ keShi: this.keShi, zhiWu: this.zhiWu })
+          xiang_guan_xin_xi: JSON.stringify({ keShi: this.keShi, zhiWu: this.zhiWu }),
+          parent_id_: this.$route.query.codeId,
+          er_wei_ma_id_: this.$route.query.codeId,
+          qian_dao_shi_jian: this.getNow(),
+          guan_lian_id_: this.guanlianID,
+          ye_wu_biao_ming_: this.yeWuBiaoMing
         }
         const addParams = {
           tableName: 't_qdxxb',
           paramWhere
         }
         this.$common.request('add', addParams).then(res => {
-          const { cont } = res.variables || {}
-          if (cont.length) {
+          if (res.state === 200) {
             this.$toast({
               duration: 2000, // 持续展示 toast
               message: '签到成功'
             })
             setTimeout(() => {
+              this.statusCode = 0
               this.$router.push({ name: 'login' })
             }, 2000)
           }
         })
       }
+    },
+    // 获取当前时间
+    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 + ':' + seconds
+      return formattedTime
     }
   }
 }
@@ -126,6 +195,17 @@ export default {
       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;