From b0db47be20b4fc7f2cb159d55997260419bd21ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B7=AF=E6=98=8E=E6=85=A7?= <1191093413@qq.com> Date: Fri, 22 Mar 2024 17:17:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=99=BB=E8=AE=B0=EF=BC=9A?= =?UTF-8?q?=E6=94=BE=E5=BC=80=E7=99=BB=E8=AE=B0=E5=92=8C=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=8C=89=E9=92=AE=EF=BC=8C=E7=82=B9=E5=87=BB=E7=99=BB=E8=AE=B0?= =?UTF-8?q?=E6=88=96=E8=80=85=E7=99=BB=E8=AE=B0=E6=A0=A1=E9=AA=8C=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E6=B7=BB=E5=8A=A0=E5=BF=85=E9=A1=BB=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/digital/registered/index.vue | 176 ++++++++++-------- 1 file changed, 94 insertions(+), 82 deletions(-) diff --git a/jianshui-ui/src/views/digital/registered/index.vue b/jianshui-ui/src/views/digital/registered/index.vue index 37a2c9c..4a15f60 100644 --- a/jianshui-ui/src/views/digital/registered/index.vue +++ b/jianshui-ui/src/views/digital/registered/index.vue @@ -147,7 +147,7 @@ plain icon="el-icon-caret-right" size="mini" - :disabled="multiple" + :disabled="single" @click="obtainLoginStatus" v-hasPermi="['invoiceall:invoiceallyhdj:routerFreedom']" >授权活跃状态查询 @@ -189,7 +189,6 @@ icon="el-icon-s-promotion" @click="registered(scope.row)" v-hasPermi="['invoiceall:invoiceallyhdj:edit']" - v-if="isShowRegistered(scope.row)" >登记 登录校验 @@ -366,6 +364,26 @@ export default { { required: true, message: "属性不能为空", trigger: "blur" } ] }, + + checkRegested:{ + identity: "企业ID", + bsryxm : "办税人员姓名", + dqbm : "地区编码", + dlsf : "登录身份", + dlsfmm : "办税人员登录密码", + dlmm : "登录密码", + dlzh : "登录账号", + nsrmc : "纳税人名称", + nsrsbh : "纳税人识别号", + bsrysfzjhm : "办税人员身份证件号码", + bsrysjhm : "办税人员手机号码" + }, + checkLogin:{ + identity: "企业ID", + dqbm : "地区编码", + nsrsbh : "纳税人识别号", + bsrysfzjhm : "办税人员身份证件号码", + }, //登记参数 registeredParams: { appkey: "935248bf224f6c8431cdc1969f029519", @@ -523,73 +541,97 @@ export default { }, //登记方法 registered(row) { - this.reset(); - this.$modal.confirm('请确认:登记identity为'+row.identity+',登记方式为'+row.dlfs+',登记身份为'+row.dlsf+'?').then(() => { + let msg = this.checkParams(row,this.checkRegested) + if (!msg){ + this.reset(); + this.$modal.confirm('请确认:登记identity为'+row.identity+',登记方式为'+row.dlfs+',登记身份为'+row.dlsf+'?').then(() => { + getCompanyservice(row.identity).then(resp=>{ + //请求成功 + if(resp.code==200 && resp.data){ + this.convertRegistedParam(row,true) + const requestBody = { + key: resp.data.secret, + order: JSON.stringify(this.registeredParams), + } + encrypt(requestBody).then(res => { + if (res.code == 200 && res.data) { + registeredMethod(res.data,row.identity).then(response => { + if (response.code == 200){ + this.$message.success('请求登记成功') + } + }); + }else if (!res.data){ + this.$message.error('报文加密失败') + } + }) + }else if(!resp.data) { + this.$message.error('请检查企业ID配置') + } + + }) + }) + }else{ + this.$message.error(msg) + } + + }, + /** 登陆验证 */ + loginVerificated(row){ + + let msg = this.checkParams(row,this.checkLogin); + + if (!msg){ + this.reset(); getCompanyservice(row.identity).then(resp=>{ //请求成功 - if(resp.code==200 && resp.data != null && resp.data != ""){ - this.convertRegistedParam(row,true) + if(resp.code==200 && resp.data){ + this.convertRegistedParam(row,false) const requestBody = { key: resp.data.secret, - order: JSON.stringify(this.registeredParams), + order: JSON.stringify(this.loginVerificatedParams), } encrypt(requestBody).then(res => { - if (res.code == 200 && res.data != null && res.data != "") { - registeredMethod(res.data,row.identity).then(response => { - if (response.code == 200){ - this.$message.success('请求登记成功') + if (res.code == 200 && res.data) { + qrcodeMethod(res.data,row.identity).then(response => { + if (response.code == 200 && response.data){ + + if (response.data.requestId){ + this.$message.success('登记成功') + }else { + this.$message.error('登记失败') + } + }else { + if(response.msg){ + this.$message.error(response.msg) + }else { + this.$message.error(response.message) + } } }); - }else if (res.data == null || res.data == ""){ + }else if (!res.data){ this.$message.error('报文加密失败') } }) - }else if(resp.data == null || resp.data == "") { + }else if (!resp.data){ this.$message.error('请检查企业ID配置') } }) - }) - + }else { + this.$message.error(msg) + } }, - /** 登陆验证 */ - loginVerificated(row){ - this.reset(); - getCompanyservice(row.identity).then(resp=>{ - //请求成功 - if(resp.code==200 && resp.data != null && resp.data != ""){ - this.convertRegistedParam(row,false) - const requestBody = { - key: resp.data.secret, - order: JSON.stringify(this.loginVerificatedParams), - } - encrypt(requestBody).then(res => { - if (res.code == 200 && res.data != null && res.data != "") { - qrcodeMethod(res.data,row.identity).then(response => { - if (response.code == 200 && response.data != null && response.data != ""){ - - if (response.data.requestId != null && response.data.requestId != ""){ - this.$message.success('登记成功') - }else { - this.$message.error('登记失败') - } - }else { - if(response.msg){ - this.$message.error(response.msg) - }else { - this.$message.error(response.message) - } - } - }); - }else if (res.data == null || res.data == ""){ - this.$message.error('报文加密失败') - } - }) - }else if (resp.data == null || resp.data == ""){ - this.$message.error('请检查企业ID配置') + checkParams(row,check){ + let msg = ''; + Object.keys(check).forEach(key=>{ + if (row[key]==null || row[key]==''){ + msg = msg+check[key]+'、' } - }) + if (msg){ + msg = msg.slice(0,msg.length-1)+ '不能为空' + } + return msg; }, convertRegistedParam(row,flag){ if (flag){ @@ -648,36 +690,6 @@ export default { this.download('invoiceall/invoiceallyhdj/export', { ...this.queryParams }, `invoiceallyhdj_${new Date().getTime()}.xlsx`) - }, - isShowRegistered(row){ - return row.dqbm != null - && row.dqbm != '' - && row.dlfs != null - && row.dlfs != '' - && row.dlsfmm != null - && row.dlsfmm != '' - && row.dlmm != null - && row.dlmm != '' - && row.dlzh != null - && row.dlzh != '' - && row.nsrmc != null - && row.nsrmc != '' - && row.nsrsbh != null - && row.nsrsbh != '' - && row.bsrysfzjhm != null - && row.bsrysfzjhm != '' - && row.identity != null - && row.identity != '' - }, - isShowLoginVerificated(row){ - return row.dqbm != null - && row.dqbm != '' - && row.nsrsbh != null - && row.nsrsbh != '' - && row.bsrysfzjhm != null - && row.bsrysfzjhm != '' - && row.identity != null - && row.identity != '' } } };