洋浦学校 待办工作阶段代码提交

公车申请自动审批功能
init
gongdi 4 years ago
parent bde0900698
commit 4151d1c527

@ -1,5 +1,5 @@
<template>
<div class="business-item-container-style">
<div ref="businessItem" class="business-item-container-style">
<div class="create-time-style">{{timeHandle(business.create_time)}}</div>
<div class="system-title-style">
<div class="icon-container-style">
@ -24,7 +24,7 @@
</div>
<div v-if="type.id !== 'sendToMe' && type.id !== 'announcement' && (type.id !== 'notice' || (type.id === 'notice' &&
parseInt(business.data_infomation.notice_receipt) === 1))" class="btn-style">
<span class="btn-one-style" @click.stop="">
<span class="btn-one-style" @click.stop="automaticHandle">
{{getBtnName()}}
</span>
<span v-if="type.id === 'approval'" style="color: red;" @click.stop="noPass">
@ -32,12 +32,37 @@
</span>
</div>
</div>
<a-modal
:title="modalTitle"
:visible="visible"
centered
cancelText="取消"
okText="确定"
:closable="false"
:destroyOnClose="true"
@cancel="modalCancel"
@ok="modalOk"
>
<vue-scroll :ops="listScroll" style="height:200px">
<ApproveCom
:hasNext="hasNext"
ref="approveCom"
:checkPersonList="checkPersonList"
:openCopyFlag="openCopyFlag"
:copyPersonType="copyPersonType"
:copyPersonList="copyPersonList"
@changeCheckPerson="changeCheckPerson"
@changeCopyPerson="changeCopyPerson"
/>
</vue-scroll>
</a-modal>
</div>
</template>
<script>
import interConfig from '../modulComponent/interConfig';
import {Modal} from 'ant-design-vue';
import ApproveCom from '../modulComponent/approveCom.vue';
export default {
name: "BusinessItem",
props: {
@ -53,7 +78,19 @@
data: function () {
return {
type: this.typeData,
business: this.businessData
business: this.businessData,
listScroll: this.StaticParams.scrollOption,
visible: false,
modalTitle: "",
openCopyFlag: 0,//
copyPersonType: -1,// 0-1-2-
copyPersonList: [],//
hasNext: 0,//
checkPersonList: [],//
nextLevelId: "",//ID
checkPersonId: "",//ID
checkPersonName: "",//
paramCopyList: [],//
}
},
methods: {
@ -113,9 +150,156 @@
showBusinessDetail: function () {
this.$emit("clickContent", this.businessData)
},
//--
automaticHandle: function () {
let bizCode = this.businessData.biz_code;
let infoBox = this.businessData.data_infomation;
switch (bizCode) {
case "107001001":
let callBack = this.getCarApplyInfo(infoBox);
if (callBack) {
callBack.then((res) => {
let soflowInfo = res.soFlowInfo;//
//
if (soflowInfo.current_level) {
this.openCopyFlag = soflowInfo.current_level.open_copy_flag;// 1 0
if (this.openCopyFlag === 1) {
// 0-1-2-
this.copyPersonType = soflowInfo.current_level.copy_person_type;
this.copyPersonList = soflowInfo.current_level.copy_person_list;
}
}
// 1 2
this.hasNext = soflowInfo.has_next;
if (this.hasNext === 1) {
this.checkPersonList = soflowInfo.next_level.check_person_list;
this.nextLevelId = soflowInfo.next_level.level_id;
}
/**
* visible为true的前提条件
* 1当前节点 开启抄送 并且抄送方式为自选或者指定
* 2存在下一审批节点
* 31和2是或者关系
*/
if ((this.openCopyFlag === 1 && (this.copyPersonType === 0 || this.copyPersonType === 2)) || this.hasNext === 1) {
this.modalTitle = "审批节点";
this.visible = true;
} else {
//
}
})
}
break;
default:
break;
}
},
//--------------------------------------------
//1
getCarApplyInfo: function (info) {
let _this = this;
let p = new Promise(function (resolve, reject) {
let params = {
apply_id: info.apply_id,
run_type: 1,
person_id: _this.BaseConfig.userInfo.person_id
}
_this.InterfaceConfig.callInterface([{
url: interConfig.getCarApplyInfo.url,
params: params,
method: interConfig.getCarApplyInfo.method,
isTestLogin: interConfig.getCarApplyInfo.isTestLogin
}], (result) => {
let res = result[0].data;
if (res.code === 2000) {
resolve(res.data);
}
})
})
return p;
},
changeCheckPerson: function (personId) {
let checkPerson = this.checkPersonList.filter((item) => {
return parseInt(item.person_id) === parseInt(personId);
})
this.checkPersonId = personId;
if (checkPerson.length > 0) {
this.checkPersonName = checkPerson[0].person_name;
}
},
changeCopyPerson: function (personArr) {
this.paramCopyList = personArr;
},
modalCancel: function () {
this.visible = false;
},
modalOk: function () {
let bizCode = this.businessData.biz_code;
let infoBox = this.businessData.data_infomation;
switch (bizCode) {
case "107001001":
//
if (this.hasNext === 1 && this.checkPersonId === "") {
Modal.warning({
title: "请选择审批人",
content: "",
centered: true
})
return
}
let type = 1;
let options = this.$refs.approveCom.options;
let submitParam = {
apply_id: infoBox.apply_id,
check_id: infoBox.check_id,
status_id: type,
person_id: this.BaseConfig.userInfo.person_id_cookie,
check_opinion: options,
has_next: this.hasNext,
}
if (type === 1 && this.hasNext === 1) {
submitParam.next_level_id = this.nextLevelId;
submitParam.next_person_id = this.checkPersonId;
submitParam.next_person_name = this.checkPersonName;
}
if (this.copyPersonType === 1 && this.copyPersonList.length > 0) {
//
submitParam.copy_list = JSON.stringify(this.copyPersonList);
}
if (this.copyPersonType !== 1 && this.paramCopyList.length > 0) {
//
submitParam.copy_list = JSON.stringify(this.paramCopyList);
}
this.InterfaceConfig.callInterface([{
url: interConfig.submitCarCheck.url,
params: submitParam,
method: interConfig.submitCarCheck.method,
isTestLogin: interConfig.submitCarCheck.isTestLogin
}], (result) => {
let res = result[0].data;
if (res.code === 2000) {
Modal.success({
title: "审批成功",
content: "",
centered: true
})
this.$emit("updateModuleData")
this.spinning = false;
} else {
this.spinning = false;
}
})
break;
default:
break;
}
this.visible = false;
},
//--
noPass: function () {
console.log(this.typeData)
console.log(this.businessData)
let bizCode = this.businessData.biz_code;
let param = {};//
switch (bizCode) {
@ -127,8 +311,8 @@
}
},
//
checkLeave:function (info) {
this.getInfo(info.run_id).then((result)=>{
checkLeave: function (info) {
this.getInfo(info.run_id).then((result) => {
let submitParam = {
check_id: info.check_id,
status_id: -1,
@ -150,14 +334,13 @@
content: "",
centered: true
})
}
})
})
},
getInfo:function (runId) {
getInfo: function (runId) {
var _this = this;
var p = new Promise((resolve,reject)=>{
var p = new Promise((resolve, reject) => {
let params = {
run_id: runId,
level_check: 1,
@ -186,6 +369,10 @@
businessData: function (newData) {
this.business = newData;
}
},
components: {
AModal: Modal,
ApproveCom
}
}
</script>

@ -7,25 +7,31 @@
>
<LoginBox>
<div class="login-page-content-style">
<div class="close-top-style"><a-icon type="close" class="icon-style" @click="closePanel" title="取消"/></div>
<div class="close-top-style">
<a-icon type="close" class="icon-style" @click="closePanel" title="取消"/>
</div>
<div class="login-page-title-style">用户登录</div>
<div class="login-item-row-style">
<a-input ref="userNameInput" v-model="account" placeholder="用户名" class="login-input-style" @change="accountChange">
<a-input ref="userNameInput" v-model="account" placeholder="用户名" class="login-input-style"
@change="accountChange">
<my-icon slot="prefix" type="icon-jiaoshixinxi" class="icon-style"/>
</a-input>
<span class="error-tips-style">{{accountErrorTips}}</span>
</div>
<div class="login-item-row-style">
<a-input-password ref="passWordInput" v-model="password" placeholder="密码" class="login-input-style" @change="passwordChange">
<a-input-password ref="passWordInput" v-model="password" placeholder="密码" class="login-input-style"
@change="passwordChange">
<a-icon slot="prefix" type="lock" class="icon-style"/>
</a-input-password>
<span class="error-tips-style">{{passwordErrorTips}}</span>
</div>
<div class="login-item-row-style">
<a-button v-if="!isLogining" class="login-button-style" @click="login"></a-button>
<div v-if="isLogining"><a-spin/><span style="margin-left: 0.5rem">登录中请稍后...</span></div>
<a-button v-if="!isLogining" class="login-button-style" @click="login"></a-button>
<div v-if="isLogining">
<a-spin/>
<span style="margin-left: 0.5rem">登录中请稍后...</span></div>
</div>
</div>
</LoginBox>
@ -37,10 +43,11 @@
* */
import ModalPanel from '../../../../../components/common/modal/ModalPanel';
import LoginBox from './loginBox.vue';
import {Icon,Input,Button,Spin} from 'ant-design-vue';
import {Icon, Input, Button, Spin} from 'ant-design-vue';
import CommonInter from '../../../api/commonInter';
import AInputPassword from "ant-design-vue/es/input/Password";
import InterfaceConfig from '../../../../../commonInterface/interfaceConfig';
import StaticParams from '../../../../../global-llibs/staticParams';
export default{
data(){
return {
@ -51,6 +58,18 @@
passwordErrorTips: "",//
}
},
created(){
//
var _this = this;
document.onkeydown = function (e) {
let key = window.event.keyCode;
if (key == 13) {
if (StaticParams.trim(_this.account) !== "" || StaticParams.trim(_this.password) !== "") {
_this.login();
}
}
}
},
props: {
showPanel: {
type: Boolean,
@ -58,7 +77,7 @@
}
},
methods: {
closePanel:function () {
closePanel: function () {
this.$bus.emit("hide-login-panel");
},
/**
@ -77,7 +96,7 @@
this.passwordErrorTips = "";
}
},
login:function () {
login: function () {
let _this = this;
if (this.account.trim() == "") {
this.accountErrorTips = "账号不能为空";
@ -117,11 +136,11 @@
// this.isLogining = false;
// }
// })
}else {
} else {
this.passwordErrorTips = result[0].data.info;
this.isLogining = false;
}
}else {
} else {
this.isLogining = false;
}
})
@ -129,26 +148,26 @@
/**
* 构建BaseConfig基本信息
*/
buildBaseInfo:function () {
buildBaseInfo: function () {
//BaseConfiguserInfo
this.BaseConfig.userInfo.identity_id_cookie = this.Cookie.get('identity_id');
this.BaseConfig.userInfo.person_id_cookie = this.Cookie.get('person_id');
this.BaseConfig.userInfo.identity_id = this.Cookie.get('identity_id');
this.BaseConfig.userInfo.person_id = this.Cookie.get('person_id');
this.InterfaceConfig.callInterface([{
url:InterfaceConfig.getValueByKey.url,
params:{key:'common.server.location'},
method:InterfaceConfig.getValueByKey.method,
isTestLogin:InterfaceConfig.getValueByKey.isTestLogin
}],(res)=>{
if (res[0].status === 200){
url: InterfaceConfig.getValueByKey.url,
params: {key: 'common.server.location'},
method: InterfaceConfig.getValueByKey.method,
isTestLogin: InterfaceConfig.getValueByKey.isTestLogin
}], (res) => {
if (res[0].status === 200) {
let env = res[0].data;
this.BaseConfig.pt_type = env["common.server.location"];
window.pt_type = env["common.server.location"];
this.BaseConfig.ConfigFn.setParamsValue();
this.BaseConfig.ConfigFn.getPersonInfo_I();
let interval = setInterval(()=>{
if (window.person_info_my){
let interval = setInterval(() => {
if (window.person_info_my) {
clearInterval(interval);
//store
this.$store.commit('userStore/setUser', {
@ -159,7 +178,7 @@
this.isLogining = false;
this.$bus.emit("hide-login-panel");
}
},500)
}, 500)
}
})
},
@ -208,31 +227,32 @@
AInputPassword,
ModalPanel,
LoginBox,
AIcon:Icon,
AInput:Input,
AButton:Button,
ASpin:Spin
AIcon: Icon,
AInput: Input,
AButton: Button,
ASpin: Spin
}
}
</script>
<style scoped lang="scss">
@import "../../../assets/scss/style";
/deep/ .login-modal-style{
/deep/ .login-modal-style {
width: auto !important;
.ant-modal-content{
.ant-modal-content {
background-color: transparent !important;
border: none !important;
box-shadow: none !important;
display: flex;
justify-content: center;
align-items: center;
.login-page-content-style{
.login-page-content-style {
width: 100%;
height: 100%;
color: white;
display: flex;
flex-direction: column;
.close-top-style{
.close-top-style {
width: 100%;
height: 20px;
display: flex;
@ -240,13 +260,13 @@
align-items: center;
padding: 0 10px;
margin-top: 8px;
.icon-style{
.icon-style {
color: $color-default-bright;
font-size: 16px;
cursor: pointer;
}
}
.login-page-title-style{
.login-page-title-style {
width: 100%;
height: 50px;
line-height: 50px;
@ -256,7 +276,7 @@
font-size: 25px;
margin-bottom: 30px;
}
.login-item-row-style{
.login-item-row-style {
width: 100%;
height: 65px;
margin-top: 10px;
@ -265,16 +285,16 @@
justify-content: center;
align-items: center;
padding: 0 100px;
.login-input-style{
.login-input-style {
width: 100%;
height: 45px;
.ant-input-prefix{
.icon-style{
.ant-input-prefix {
.icon-style {
color: #1379c8;
font-size: 20px;
}
}
.ant-input{
.ant-input {
width: 100%;
height: 45px;
line-height: 45px;
@ -291,7 +311,7 @@
line-height: 20px;
font-size: 16px;
}
.login-button-style{
.login-button-style {
width: 100%;
height: 45px;
line-height: 45px;

Loading…
Cancel
Save