Commit a3249b7a by 乔延琦

Merge branch 'develop-zhouyi' into 'develop'

Develop zhouyi

See merge request GFP/RBC/rbc-frontend!155
parents 7fd527b8 a43a0d07
......@@ -27,6 +27,7 @@
},
"files": [
"dist",
"public",
"src",
"app.config.json"
],
......
/*bjca_gangj 2021-4-25
回调层,用户可根据需求修改
*/
/**
* 直接签章回调
*/
function $DirectSignCallback(ret) {
$_$CurSignData[$_$CurStampID] = ret.retVal;
var stampID = $_$CurStampID;
$_$Seal_Pic_Main_Div_Name = "sealPicMain" + stampID;
$_$Seal_Pic_Div_Name = "sealPicDiv" + stampID;
$_$Seal_Img_Name = "sealImg" + stampID;
BWS_GetSignMethod($_$CurSignData[$_$CurStampID], function(ret) {
$_$CurSignMethod[$_$CurStampID] = ret.retVal;
})
var temp = "<div id='sealPicMain" + stampID + "' class='sealPicMain" + stampID + "' style='position: relative; display: block;'><div id='sealPicDiv" + stampID + "'><img id='sealImg" + stampID + "' src='data:image/gif;base64,"+ret.picData+"' /></div></div>";
return temp;
}
function $DirectSignSync(ret) {
$_$CurSignData[$_$CurStampID] = ret.retVal;
var stampID = $_$CurStampID;
$_$Seal_Pic_Main_Div_Name = "sealPicMain" + stampID;
$_$Seal_Pic_Div_Name = "sealPicDiv" + stampID;
$_$Seal_Img_Name = "sealImg" + stampID;
var retMethod = sealSync.GetSignMethod();
if(retMethod == "") {
alert("获取算法失败!");
return;
}
$_$CurSignMethod[$_$CurStampID] = retMethod;
return ret.picData;
}
/**
* 回显签章回调
*/
function $ShowSignCallback(stampID, picData) {
var temp = "<div id='sealPicMain" + stampID + "' class='sealPicMain" + stampID + "' style='position: relative; display: block;'><div id='sealPicDiv" + stampID + "'><img id='sealImg" + stampID + "' src='data:image/gif;base64,"+picData+"' /></div></div>";
return temp;
}
/**
* 拖拽签章回调
*/
function $DragSignCallback(ret) {
if (ret.retVal == "") {
$GetLastErrJS();
document.getElementById($_$Seal_Pic_Div_Name).style.display = "none";
} else {
document.getElementById($_$Seal_Pic_Div_Name).style.display = "block";
document.getElementById("signatureData" + $_$CurStampID).value = ret.retVal;
console.log($getDragSignPosition());
$_$CurSignData[$_$CurStampID] = ret.retVal;
BWS_GetSignMethod($_$CurSignData[$_$CurStampID], function(ret) {
$_$CurSignMethod[$_$CurStampID] = ret.retVal;
})
}
}
function $DragSignRetSync(ret) {
if (ret == "") {
$GetLastErrJS();
document.getElementById($_$Seal_Pic_Div_Name).style.display = "none";
} else {
document.getElementById($_$Seal_Pic_Div_Name).style.display = "block";
document.getElementById("signatureData" + $_$CurStampID).value = ret;
console.log($getDragSignPosition());
$_$CurSignData[$_$CurStampID] = ret;
var retMethod = sealSync.GetSignMethod();
if(retMethod == "") {
alert("获取算法失败!");
return;
}
$_$CurSignMethod[$_$CurStampID] = retMethod;
}
}
/**
* 撤销签章回调
*/
function $RemoveCallback(ret) {
$_$Seal_Pic_Div_Name = "sealPicDiv" + $_$CurStampID;
$_$Seal_Img_Name = "sealImg" + $_$CurStampID;
if (ret.retVal == "") {
$GetLastErrJS();
} else if (ret.retVal == $_$REMOVE_NOT_ALLOWED || ret.retVal == $_$NOT_LOGIN) {
return;
} else {
document.getElementById($_$Seal_Pic_Div_Name).style.display = "none";
if ($_$CurStampID) {
if (document.getElementById("signatureData" + $_$CurStampID)) {
document.getElementById("signatureData" + $_$CurStampID).value = "";
}
}
}
}
/**
* 验证签章回调
*/
function $VerifyCallback(ret) {
$_$Seal_Pic_Div_Name = "sealPicDiv" + $_$CurStampID;
$_$Seal_Img_Name = "sealImg" + $_$CurStampID;
if (document.getElementById($_$Seal_Img_Name)) {
var sealObj = document.getElementById($_$Seal_Img_Name);
sealObj.src = "data:image/gif;base64," + ret.retVal;
}
}
\ No newline at end of file
export function positionSignSync(stampID, orgdata, imgData) {
$_$CurStampID = stampID;
$_$CurOrgData[$_$CurStampID] = orgdata;
// ESeaL_CreateSignMenu("verifyedgif");
var retImg
var retSign
if (imgData) {
retSign = sealSync.SignPic(orgdata, imgData);
if(retSign == "") {
throw new Error('签章失败!')
}
retImg = sealSync.GetESealFromSignature(retSign);
if(retImg == "") {
throw new Error('获取签章后的图片失败!')
}
}
else {
retImg = sealSync.GetStampPic();
if(retImg == "") {
throw new Error('获取印章失败!')
}
retSign = sealSync.Sign(orgdata);
if(retSign == "") {
throw new Error('签章失败!')
}
}
//显示验证后的印章图片
var retObj = {
retVal:retSign,
picData:retImg
};
var imgData = $DirectSignSync(retObj);
const signatureData = $_$CurSignData[$_$CurStampID]
return { imgData, signatureData }
}
//同步验章
export function btnVerifySync(stampID, orgdata, signdata) {
$_$CurOrgData[stampID] = orgdata;
//验证
var sInfo;
var method_name = $_$CurSignMethod[stampID];
var sVerifyResult;
var sVerifyResult = sealSync.Verify(orgdata, signdata);
if (sVerifyResult == true || sVerifyResult == 'true') {
} else if (sVerifyResult == false || sVerifyResult == 'false') {
return
} else{
//当前接口不存在,客户端版本不匹配
alert($_$METHOD_NOT_EXIST);
return;
}
//获取验证图片
let ret = sealSync.GetStampPicAfterVerified();
if (typeof(ret) == "undefined"){
//当前接口不存在,客户端版本不匹配
alert($_$METHOD_NOT_EXIST);
return;
} else if (ret != "") {
return "data:image/gif;base64," + ret
} else {
//获取错误信息,并弹框显示
ret = sealSync.$GetLastErr();
alert(ret);
}
}
export function OnceStartSign() {
//初始化,每次采集都需要调用
var ret = AS_InitSign(1);
if (0 != ret) {
throw new Error('初始化失败 : ' + GetErrorMessage(ret))
}
//设置原文,由于只负责采集手写图片,所以原文内容随意值的base64编码值即可
var plain_base64 = "MTIzNDU=";
ret = AS_SetSignPlain(plain_base64);
if(ret != 0){
throw new Error('设置签名数据原文错误 : ' + GetErrorMessage(ret))
}
//设置采集模式,0为只采集手写
var result = AS_SetEvidenceCollectionModel(0);
if (result != 0) {
throw new Error('设置证据采集模式失败')
}
//设置输出图片格式
var dataType = 0;//手写图片
var fmt = 0;//gif格式
var result = AS_SetImageFormat(dataType, fmt);
if (result != 0) {
throw new Error('设置手写图片格式失败')
}
//设置签名人信息成功,随意设置即可
ret = AS_SetSignerInfo("random", 1, "123");
if (0 != ret) {
throw new Error('设置签名人信息错误')
}
//采集手写图片
ret = AS_AddSignEvidenceData();
if (0 != ret) {
throw new Error('采集签名证据数据错误')
}
//获取手写图片
var resultEvidence = AS_GetSignEvidenceData(0);
if (resultEvidence == "") {
var rv = AS_GetLastError();
throw new Error('当前签名证据数据为空 : ' + GetErrorMessage(rv))
}
return resultEvidence
}
import Bridge from '../components-control/util/bridge'
import SelectApprovers from '../components-control/select-approvers.vue'
import { compareData } from "../components-control/util/dataChange"
import { showSignModal, saveBill, verifyBill } from './util'
export default {
execute: function (bill, param) {
if (bill) {
if (!verifyBill(bill)) {
GMS.$hideContainer.$Message.error('验签失败')
return
}
if (!bill.getGlobalParam('reviewParam') || !bill.getGlobalParam('reviewParam').taskId) {
GMS.$hideContainer.$Message.error('请配置审批轨迹')
return
......@@ -39,7 +45,9 @@ export default {
title: "信息提示",
content: "信息发生变化, 是否保存",
onOk: () => {
this.saveLogical(bill, param, {data: bill.getBuillData(), detailData: []}, this)
saveBill(bill, param).then(() => {
this.approvalLogical(bill, param)
})
},
onCancel: () => {
}
......@@ -56,44 +64,19 @@ export default {
GMS.$hideContainer.$Message.error('缺少参数');
}
},
saveLogical: function (bill, param, postData) {
let url = `/rbc/bill/action/executed/${param.define}/bill.Basic.save?transmission=total`
GMS.$http.post(url, JSON.stringify(postData), {
headers: {
post: {
"Content-Type": "application/json",
},
},
})
.then((response) => {
if (response.data.code == 0) {
//存储返回回来的创建时间、修改时间
bill.getMasterData().setValue("createTime", response.data.content.billData.createTime);
bill.getMasterData().setValue("modifyTime", response.data.content.billData.modifyTime);
bill.getMasterData().setValue("recver", response.data.content.billData.recver);
bill.getMasterData().setValue("billCode", response.data.content.billData.billCode);
let curTagId = window.nros.context.getCurrTag();
if (curTagId) {
GMS.oldBillDataMap[curTagId] = bill.getBuillData()
}
else {
GMS.oldBillData = bill.getBuillData()
}
this.approvalLogical(bill, param)
} else {
response.data.message && GMS.vbus.$Message.error({
content: response.data.message,
duration: 3
});
}
})
},
approvalLogical: function (bill, param) {
const getApprovalList = () => {
const setApprover = (data) => {
bill.getMasterData().setValue('APPROVERPROPERTIES', data, null, 'none')
}
let taskId = bill.getGlobalParam('reviewParam').taskId;
bill.setControlsSate(param["_control_name_"], "enable", false)
let selectedApprovers = []
window.GMS.$http.get(`/bpm/bill/selectApprover/ApproverList/${taskId}`).then((res) => {
setApprover(null)
if (res.data.code == 204) {
this.executeApproval(bill, param)
return
......@@ -128,17 +111,12 @@ export default {
)
},
onOk: () => {
window.GMS.$http.post(
'/bpm/bill/selectApprover/addApprovers',
{
const data = JSON.stringify({
...nodeData,
approvers: selectedApprovers,
}
).then(() => {
this.executeApproval(bill, param)
}).catch(() => {
GMS.$hideContainer.$Message.error('选择审批人发生错误')
})
setApprover(data)
this.executeApproval(bill, param)
},
onCancel: () => {
}
......@@ -172,6 +150,9 @@ export default {
executeApproval: function(bill, param) {
let taskId = bill.getGlobalParam('reviewParam').taskId;
let comments = bill.getGlobalParam('reviewParam').suggestions ? bill.getGlobalParam('reviewParam').suggestions : "";
const fn = () => {
saveBill(bill, param).then(() => {
GMS.$http.post('/rbc/workflow/approve/completed/' + taskId + '?result=1&comments=' + comments).then(
function (response) {
if (response.status == 200 || response.statusText == 'OK') {
......@@ -205,6 +186,24 @@ export default {
GMS.$hideContainer.$Message.error('工作流配置错误,请联系管理员')
}.bind(this)
);
})
}
window.GMS.$http.get(`/rbc/workflow/signatureConfig/${taskId}`).then((res) => {
const { isUseSignature, nodeName } = res.data && res.data.data || {}
if (isUseSignature) {
showSignModal(bill, param, nodeName).then(fn).catch((err) => {
if (err) console.error(err)
bill.setControlsSate(param["_control_name_"], "enable", true)
bill.setControlsSate(param["_control_name_"], "loading", false)
})
}
else {
fn()
}
})
return
},
isApproverEqulloginer: function (bill, param) {
const loginer = GMS.userContext && GMS.userContext.id || window.nros.getUser().conetxtUser.id;
......
import Bridge from '../components-control/util/bridge'
import { compareData } from "../components-control/util/dataChange"
import { SIGNATURE_TABLE_NAME } from '../constant'
import { saveBill } from './util'
export default {
execute: function (bill, param) {
if(bill){
......@@ -17,7 +20,9 @@ export default {
title: "信息提示",
content: "信息发生变化, 是否保存",
onOk: () => {
this.saveLogical(bill, param, {data: bill.getBuillData(), detailData: []}, this)
saveBill(bill, param).then(() => {
this.approvalLogical(bill, param)
})
},
onCancel: () => {
}
......@@ -45,26 +50,6 @@ export default {
this.approval(bill, param);
}
},
saveLogical: function (bill, param, postData) {
let url = `/rbc/bill/action/executed/${param.define}/bill.Basic.save?transmission=total`
GMS.$http.post(url, JSON.stringify(postData), {
headers: {
post: {
"Content-Type": "application/json",
},
},
})
.then((response) => {
if (response.data.code == 0) {
this.approvalLogical(bill, param)
} else {
response.data.message && GMS.vbus.$Message.error({
content: response.data.message,
duration: 3
});
}
})
},
approval: function(bill, param){
if (!bill.getGlobalParam('reviewParam') || !bill.getGlobalParam('reviewParam').taskId) {
GMS.$hideContainer.$Message.error('请配置审批轨迹')
......@@ -72,6 +57,9 @@ export default {
}
let taskId = bill.getGlobalParam('reviewParam').taskId;
let comments = bill.getGlobalParam('reviewParam').suggestions ? bill.getGlobalParam('reviewParam').suggestions:"";
bill.clearSubDatas(SIGNATURE_TABLE_NAME)
saveBill(bill, param).then(() => {
GMS.$http.post('/rbc/workflow/approve/completed/' + taskId + '?result=3&comments='+comments).then(
function(response) {
if (response.status == 200 || response.statusText == 'OK') {
......@@ -104,6 +92,7 @@ export default {
GMS.$hideContainer.$Message.error('工作流配置错误,请联系管理员')
}.bind(this)
);
})
},
isApproverEqulloginer: function (bill, param) {
const loginer = GMS.userContext && GMS.userContext.id || window.nros.getUser().conetxtUser.id;
......
import errorMessageUtil from "./util/errorMessageUtil";
import {minusIndex} from '../query-actions/util/queryTag.js';
import { showSignModal, saveBill } from "./util";
export default {
execute: function (bill, param) {
if (param && param.param && param.param.budgetcontrol) {
......@@ -71,6 +73,8 @@ export default {
submitExecute(bill, param){
if (bill) {
bill.setControlsSate(param["_control_name_"], 'enable', false)
const submitFn = () => {
let postData = {
data: bill.getBuillData(),
};
......@@ -103,6 +107,20 @@ export default {
bill.setControlsSate(param["_control_name_"], "enable", true)
bill.setControlsSate(param["_control_name_"],"loading",false)
})
}
if (param && param.param && param.param.useSignature) {
showSignModal(bill, param, '提交人').then(() => {
saveBill(bill, param).then(submitFn)
}).catch(() => {
bill.setControlsSate(param["_control_name_"], "enable", true)
bill.setControlsSate(param["_control_name_"],"loading",false)
})
}
else {
submitFn()
}
} else {
GMS.$hideContainer.$Spin.hide();
alert('缺少参数');
......
import {
SIGNATURE_TABLE_NAME,
SIGNATURE_TABLE,
BILL_GLOBAL_PARAM,
} from '../../constant'
import { getValueListString } from '../../utils'
import { btnVerifySync } from '../../BJCAWebsign'
import ElectronicSignature from '../../components-control/electronic-signature.vue'
export const saveBill = (bill, param, postData) => {
if (!postData) {
postData = { data: bill.getBuillData(), detailData: [] }
}
let url = `/rbc/bill/action/executed/${param.define}/bill.Basic.save?transmission=total`
return GMS.$http.post(url, JSON.stringify(postData), {
headers: {
post: {
"Content-Type": "application/json",
},
},
})
.then((response) => {
if (response.data.code == 0) {
//存储返回回来的创建时间、修改时间
bill.getMasterData().setValue("createTime", response.data.content.billData.createTime);
bill.getMasterData().setValue("modifyTime", response.data.content.billData.modifyTime);
bill.getMasterData().setValue("recver", response.data.content.billData.recver);
bill.getMasterData().setValue("billCode", response.data.content.billData.billCode);
let curTagId = window.nros.context.getCurrTag();
if (curTagId) {
GMS.oldBillDataMap[curTagId] = bill.getBuillData()
}
else {
GMS.oldBillData = bill.getBuillData()
}
} else {
response.data.message && GMS.vbus.$Message.error({
content: response.data.message,
duration: 3
})
throw new Error()
}
})
}
export const showSignModal = (bill, param, nodeName) => {
const saveSubTableData = ({ signatureValue, operateTime, imgData }) => {
bill.addSubData(SIGNATURE_TABLE_NAME)
const subDataObj = bill.getSubData(SIGNATURE_TABLE_NAME)
const tableLength = subDataObj.length || 0
const subDataIndex = tableLength - 1
subDataObj[subDataIndex].setValue(SIGNATURE_TABLE.SIGNATURE_VALUE, signatureValue, null, 'none')
subDataObj[subDataIndex].setValue(SIGNATURE_TABLE.NODE_NAME, nodeName, null, 'none')
subDataObj[subDataIndex].setValue(SIGNATURE_TABLE.CREATE_TIME, operateTime, null, 'none')
subDataObj[subDataIndex].setValue(SIGNATURE_TABLE.SIGN_IMAGE, imgData, null, 'none')
bill.refreshSubDataRow(SIGNATURE_TABLE_NAME)
}
let signInfoObj = {}
return new Promise((resolve, reject) => {
const h = GMS.$hideContainer.$createElement
const vNode = h(
ElectronicSignature,
{
props: {
bill,
nodeName,
},
on: {
'on-sign': (val) => {
signInfoObj = val
},
}
}
)
GMS.$hideContainer.$msgbox({
title: '电子签章',
message: vNode,
showCancelButton: true,
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(action => {
saveSubTableData(signInfoObj)
vNode.componentInstance && vNode.componentInstance.init()
resolve()
}).catch(() => {
vNode.componentInstance && vNode.componentInstance.init()
reject()
})
})
}
export const verifyBill = (bill) => {
const fields = bill.getGlobalParam(BILL_GLOBAL_PARAM.SIGNATURE_FIELDS)
const valueString = getValueListString(bill, fields)
const dataObjList = bill.getSubData(SIGNATURE_TABLE_NAME)
if (dataObjList instanceof Array) {
const dataObj = dataObjList[dataObjList.length - 1]
const tmp = btnVerifySync(dataObj.getValue(SIGNATURE_TABLE.CREATE_TIME), valueString, dataObj.getValue(SIGNATURE_TABLE.SIGNATURE_VALUE))
return tmp
}
return true
}
<template>
<div class="electronic-signature-wrapper">
<Button size="small" type="primary" ghost @click="getSign('usb')">u-key</Button>&nbsp;&nbsp;
<Button size="small" type="primary" ghost @click="getSign('writingPad')">手写板</Button>
<div class="img-wrapper">
<img :src="imgData" alt="">
</div>
</div>
</template>
<script>
import { getValueListString } from '../utils'
import { positionSignSync, OnceStartSign } from '../BJCAWebsign'
import { BILL_GLOBAL_PARAM } from '../constant';
export default {
props: {
bill: {},
},
data() {
return {
signatureFields: [],
imgData: null,
operateTime: null,
valueString: null,
signatureValue: null,
}
},
mounted() {
this.init()
},
methods: {
init() {
this.imgData = null
this.operateTime = null
this.valueString = null
this.signatureFields = this.bill.getGlobalParam(BILL_GLOBAL_PARAM.SIGNATURE_FIELDS)
},
getSign(type) {
try {
this.operateTime = Date.now()
this.valueString = getValueListString(this.bill, this.signatureFields)
const signData = type === 'writingPad' ? OnceStartSign() : null
const {
imgData,
signatureData: signatureValue,
} = positionSignSync(this.operateTime, this.valueString, signData)
this.signatureValue = signatureValue
this.imgData = 'data:image/gif;base64,' + imgData
this.$emit('on-sign', { signatureValue: this.signatureValue, operateTime: this.operateTime, imgData })
} catch (error) {
this.$Message.error(error.message)
console.error(error)
}
}
}
}
</script>
<style lang="less">
.electronic-signature-wrapper {
.img-wrapper {
width: 250px;
height: 200px;
display: flex;
align-items: center;
justify-content: center;
img {
max-width: 100%;
max-height: 100%;
width: auto;
height: auto;
}
}
}
</style>
\ No newline at end of file
import { SIGNATURE_TABLE_NAME } from '../../constant'
function convertDate(date) {
if (typeof date === "number") {
return date;
......@@ -9,7 +11,10 @@ function convertDate(date) {
}
export function compareData(oldBillData, newBill) {
let that = this;
oldBillData = _.cloneDeep(oldBillData)
newBill = _.cloneDeep(newBill)
delete oldBillData[SIGNATURE_TABLE_NAME]
delete newBill[SIGNATURE_TABLE_NAME]
for (let i in oldBillData) {
if (i.endsWith("RQ") || i.endsWith("Time") || i.endsWith("SJ")) {
oldBillData[i] = convertDate(oldBillData[i]);
......
export const SIGNATURE_TABLE_NAME = 'DZQZZB'
export const SIGNATURE_TABLE = {
SIGNATURE_VALUE: 'signature',
NODE_NAME: 'nodeName',
CREATE_TIME: 'createTime',
SIGN_IMAGE: 'signImage',
}
export const BILL_GLOBAL_PARAM = {
SIGNATURE_FIELDS: 'signatureFields',
}
<template>
<div>
<div class="signature-list">
<div
class="signature-node"
v-for="node in signatureNode"
:key="node.name"
>
<div class="node-name">{{ node.name }}</div>
<div class="img-wrapper">
<img :src="node.src" alt="">
</div>
</div>
</div>
</div>
</template>
<script>
import {
SIGNATURE_TABLE_NAME,
SIGNATURE_TABLE,
BILL_GLOBAL_PARAM,
} from '../constant'
export default {
data() {
return {
imgData: null,
signatureTableData: [],
signatureNode: [],
}
},
props: {
define: {
type: Object,
required: true,
},
context: {
type: Object,
default: () => { }
}
},
methods:{
getSignatureTableData() {
const dataObj = this.context.bill.getSubData(SIGNATURE_TABLE_NAME)
if (dataObj instanceof Array) {
this.signatureTableData = dataObj
}
else {
this.getSignatureTableData = []
}
},
initSignatureImg() {
this.signatureNode = this.signatureTableData.map((dataObj) => {
return {
name: dataObj.getValue(SIGNATURE_TABLE.NODE_NAME),
src: 'data:image/gif;base64,' + dataObj.getValue(SIGNATURE_TABLE.SIGN_IMAGE),
}
})
}
},
mounted() {
this.context.bill.setGlobalParam(BILL_GLOBAL_PARAM.SIGNATURE_FIELDS, this.define.config.fields)
this.getSignatureTableData()
this.initSignatureImg()
},
computed: {
},
beforeDestroy() {
},
}
</script>
<style lang="less" scoped>
.signature-list {
display: flex;
flex-wrap: wrap;
align-items: center;
.signature-node {
display: flex;
align-items: center;
margin-right: 10px;
.node-name {
font-size: 16px;
}
.img-wrapper {
width: 250px;
height: 200px;
display: flex;
align-items: center;
justify-content: center;
img {
max-width: 100%;
max-height: 100%;
width: auto;
height: auto;
}
}
}
}
</style>
......@@ -1869,6 +1869,12 @@ export default {
"type": "Boolean",
"title": "启用预算控制",
"key": "budgetcontrol"
},
{
"useSignature": false,
"type": "Boolean",
"title": "电子签章",
"key": "useSignature"
}
]
},
......
......@@ -70,6 +70,7 @@ import applyDetail from './control/applyDetail';
import linkShowDetail from './control/linkShowDetail';
import ApprovalUserControl from './control/approval-user-control/approval-user-control.vue'
import WorkflowTrack from './control/workflow-track.vue'
import SignatureList from './control/signature-list.vue'
import buttonGroupControl from './control/buttonGrouop'
import rbcBasedataTree from './control/baseDataSelect/index.vue'
import newsDetail from './components-control/news-detail.vue'
......@@ -243,6 +244,7 @@ export default {
buttonGroupControl,
ApprovalUserControl,
WorkflowTrack,
SignatureList,
rbcBasedataTree,
userSelectControl,
integerControl
......
import mcon from './mcon';
import emcon from './emcon';
import { loadScript } from './utils'
import '@rbc/icon/iconfont'
import '@rbc/icon/iconfont.css'
import '@rbc/icon/icon.css'
import './styles/common/normalize.less'
(function() {
if (window.__rcb_bjcawebsign__) return
window.__rcb_bjcawebsign__ = true
const fileList = [
'BJCAWebSign.js',
'config.js',
'BJCAWebSignCallback.js',
'DragSeal.js',
'PopMenu.js',
'clientSealSync.js',
'ASAppComSync.js',
]
const promiseList = fileList.map((fileName) => {
const url = `/output/@gms/gms-plugin-billexpand/public/${fileName}`
return loadScript(url)
})
Promise.all(promiseList).then(() => {
BWS_InitSync()
})
})()
export default {
install: function(){
GMS.getContext().getCollector().addElements(mcon); // 收集所有配置文件
......
......@@ -15,4 +15,35 @@ textarea {
display: flex;
align-items: center;
}
.ivu-message {
z-index: 9999 !important;
}
//element 样式修改
.el-message-box__wrapper {
.el-message-box {
border-radius: 6px;
.el-message-box__btns {
.el-button {
font-size: 14px;
border-color: transparent;
&:hover {
text-decoration: none;
color: #005791;
border-color: transparent;
background-color: white;
}
}
.el-button--primary {
background-color: #005791;
border-color: #005791;
&:hover {
text-decoration: none;
color: white;
border-color: #005791;
background-color: #005791;
}
}
}
}
}
......@@ -31,3 +31,63 @@ export const getBaseData = (tableName, param = {}) => {
return result
})
}
/**
* 从bill中根据字段列表取值,拼字符串
*/
export const getValueListString = (bill, list) => {
const isDateType = (fieldName, tableType) => {
for (let attribute of tableType.attributes) {
if (attribute.name == fieldName) {
return attribute.type && attribute.type.name == 'bcp.type.datetime'
}
}
return false
}
const getValue = (v, isDateType) => {
if (isDateType) return (new Date(v)).getTime()
if (typeof v == 'object' && !Object.is(v, null)) {
return v.code
}
return v
}
const strList = []
for (let field of list) {
const [tableName, fieldName] = field.field.split('.')
const tableType = bill.getTableType(tableName)
if (tableType.type == 'master') {
strList.push(
`${field.field}|${getValue(
bill.getMasterData().getValue(fieldName),
isDateType(fieldName, tableType)
)}`
)
}
else {
const subTableObj = bill.getSubData(tableType.title)
if (!(subTableObj instanceof Array)) continue
subTableObj.forEach((o) => {
strList.push(
`${field.field}|${getValue(
o.getValue(fieldName),
isDateType(fieldName, tableType)
)}`
)
})
}
}
return strList.join(';')
}
export const loadScript = (url) => {
return new Promise((resolve) => {
const scriptElement = document.createElement('script')
scriptElement.onload = resolve
scriptElement.src = url
document.head.appendChild(scriptElement)
})
}
<template>
<div>
<Card title="电子签章" :padding="0" shadow style="margin: 4px">
<Checkbox slot="extra" v-model="useSignature"></Checkbox>
</Card>
</div>
</template>
<script>
export default {
props: {
currentNode: {
type: Object,
required: true,
},
},
data() {
return {
useSignature: false,
};
},
watch: {
useSignature(val) {
this.currentNode.properties.useSignature = val
},
currentNode: {
deep: true,
handler(newValue, oldValue) {
this.$emit("property-change", newValue);
this.initData();
},
},
},
mounted() {
this.initData();
},
methods: {
initData() {
if (!this.currentNode.hasOwnProperty("properties")) {
this.currentNode.properties = new Object();
}
this.useSignature = this.currentNode.properties.useSignature
},
},
};
</script>
<style>
.tablecell {
height: 30px;
display: table-cell;
border: #e8e8e8 1px solid;
vertical-align: middle;
text-align: center;
}
</style>
\ No newline at end of file
......@@ -2,6 +2,7 @@ import UserParticipant from './actions/components/user-participant.vue'
import Leadership from './actions/components/leadership-participant.vue'
import RoleParticipant from './actions/components/role-participant.vue'
import SelectApprover from './control/select-approver.vue'
import UseSignature from './control/use-signature.vue'
import AutoTask from './control/autotask.vue'
import EditableAttr from './control/editable-attr.vue'
......@@ -11,6 +12,7 @@ export default {
SelectApprover,
AutoTask,
EditableAttr,
UseSignature,
},
EventPanel: {},
ParticipantStrategyComponents: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment