diff --git a/develop/@gms/gms-plugin-billexpand/src/actions/editAction.js b/develop/@gms/gms-plugin-billexpand/src/actions/editAction.js index bb0b43a..48c28a6 100644 --- a/develop/@gms/gms-plugin-billexpand/src/actions/editAction.js +++ b/develop/@gms/gms-plugin-billexpand/src/actions/editAction.js @@ -15,6 +15,10 @@ export default { tableName = arr[0].param.field[0].targetTableName; } + c.actionParam = c.actionParam || {} + c.actionParam.param = c.actionParam.param || {} + c.actionParam.param.masterSubRelation = bill.getTableType('sub_table') + if(param.param && param.param.tableName){ tableName = param.param.tableName } @@ -28,7 +32,6 @@ export default { c.subBillData = obj.BILLDETAILOBJ; c.modal_visible = true; GMS.editSubIndex = bill.getSubFocus(); - console.log('param',param,obj); c.$nextTick(()=>{ component.addListener({ close: function() { diff --git a/develop/@gms/gms-plugin-billexpand/src/actions/labourUnion/gh_agreeAction.js b/develop/@gms/gms-plugin-billexpand/src/actions/labourUnion/gh_agreeAction.js index 7291797..64d9858 100644 --- a/develop/@gms/gms-plugin-billexpand/src/actions/labourUnion/gh_agreeAction.js +++ b/develop/@gms/gms-plugin-billexpand/src/actions/labourUnion/gh_agreeAction.js @@ -89,8 +89,9 @@ export default { fn() } else { bill.setControlsSate(param["_control_name_"], "enable", true) - if (data.message.includes('还款金额不能大于未还金额')) { - GMS.$hideContainer.$message.error("还款金额不能大于未还金额!"); + if (data.message) { + const errMsg = data.message.split('nested exception is') + GMS.$hideContainer.$message.error(errMsg && errMsg[1] || '操作异常请联系管理员'); } else { GMS.$hideContainer.$message.error("操作异常请联系管理员"); @@ -117,7 +118,7 @@ export default { } const fn = () => { - saveBill(bill, param).then(() => { + // saveBill(bill, param).then(() => { GMS.$http.post( `/rbc/bill/action/zgh/change/work/${param.define}/bill.Basic.accept`, { @@ -159,7 +160,7 @@ export default { GMS.$hideContainer.$Message.error('工作流配置错误,请联系管理员') }.bind(this) ); - }) + // }) } fn() diff --git a/develop/@gms/gms-plugin-billexpand/src/actions/labourUnion/gh_rejectAction.js b/develop/@gms/gms-plugin-billexpand/src/actions/labourUnion/gh_rejectAction.js index 92385d0..5c5c28b 100644 --- a/develop/@gms/gms-plugin-billexpand/src/actions/labourUnion/gh_rejectAction.js +++ b/develop/@gms/gms-plugin-billexpand/src/actions/labourUnion/gh_rejectAction.js @@ -40,7 +40,13 @@ export default { this.approval(bill, param); } else { bill.setControlsSate(param["_control_name_"], "enable", true) - GMS.$hideContainer.$message.error("操作异常请联系管理员"); + if (data.message) { + const errMsg = data.message.split('nested exception is') + GMS.$hideContainer.$message.error(errMsg && errMsg[1] || '操作异常请联系管理员'); + } + else { + GMS.$hideContainer.$message.error("操作异常请联系管理员"); + } } }.bind(this)); } else { @@ -56,8 +62,8 @@ export default { ? bill.getGlobalParam(BILL_GLOBAL_PARAM.APPROVAL_COMMENT).suggestions : '' - bill.clearSubDatas(SIGNATURE_TABLE_NAME) - saveBill(bill, param).then(() => { + // bill.clearSubDatas(SIGNATURE_TABLE_NAME) + // saveBill(bill, param).then(() => { GMS.$http.post( `/rbc/bill/action/zgh/change/work/${param.define}/bill.Basic.reject`, { @@ -90,14 +96,14 @@ export default { } }.bind(this) ) - .catch( - function (error) { - bill.setControlsSate(param["_control_name_"], "loading", false) - bill.setControlsSate(param["_control_name_"], "enable", true) - GMS.$hideContainer.$Message.error('工作流配置错误,请联系管理员') - }.bind(this) - ); - }) + .catch( + function (error) { + bill.setControlsSate(param["_control_name_"], "loading", false) + bill.setControlsSate(param["_control_name_"], "enable", true) + GMS.$hideContainer.$Message.error('工作流配置错误,请联系管理员') + }.bind(this) + ); + // }) } showCommentModal(bill, param, true).then(fn).catch((error) => { diff --git a/develop/@gms/gms-plugin-billexpand/src/actions/labourUnion/gh_retrieveAction.js b/develop/@gms/gms-plugin-billexpand/src/actions/labourUnion/gh_retrieveAction.js index 0c7bbc7..bea1a38 100644 --- a/develop/@gms/gms-plugin-billexpand/src/actions/labourUnion/gh_retrieveAction.js +++ b/develop/@gms/gms-plugin-billexpand/src/actions/labourUnion/gh_retrieveAction.js @@ -2,31 +2,60 @@ export default { execute(bill, param) { bill = bill.dom || bill bill.setControlsSate(param["_control_name_"], "enable", false) - GMS.$http.post( - `/rbc/bill/action/zgh/change/work/${param.define}/bill.Basic.retrieve`, - { - approvalComments: comments, - data: bill.getBuillData(), - detailData: [], + + const fn = () => { + GMS.$http.post( + `/rbc/bill/action/zgh/change/work/${param.define}/bill.Basic.retrieve`, + { + data: bill.getBuillData(), + detailData: [], + } + ).then((res) => { + if (res.data && res.data.code == 0) { + GMS.$hideContainer.$Message.success('操作成功!') + const curTagId = window.nros.context.getCurrTag(); + GMS.vbus.$emit('change-form-state', { state: 'readOnly'},curTagId) + } + else { + const { data } = res + if (data.message) { + const errMsg = data.message.split('nested exception is') + GMS.$hideContainer.$message.error(errMsg && errMsg[1] || '操作异常请联系管理员'); + } + else { + GMS.$hideContainer.$message.error("操作异常请联系管理员"); + } + } + bill.setControlsSate(param["_control_name_"], "loading", false) + bill.setControlsSate(param["_control_name_"], "enable", true) + }).catch((err) => { + GMS.$hideContainer.$Message.error('系统错误,请联系管理员') + console.error(err); + bill.setControlsSate(param["_control_name_"], "loading", false) + bill.setControlsSate(param["_control_name_"], "enable", true) + }) + } + + if (param.param.actions) { + let saveParam = { + actions: param.param.actions } - ).then((res) => { - if (res.data && res.data.code == 0) { - GMS.$hideContainer.$Message.success('操作成功!') - } - else { - const { data } = res - data.message && GMS.$hideContainer.$Message.error({ - content: errorMessageUtil.submitAction.getErrorMessage(data.message), - duration: 3 - }); - } - bill.setControlsSate(param["_control_name_"], "loading", false) - bill.setControlsSate(param["_control_name_"], "enable", true) - bill.setControlsSate(param["_control_name_"], "loading", false) - }).catch(() => { - GMS.$hideContainer.$Message.error('系统错误,请联系管理员') - bill.setControlsSate(param["_control_name_"], "enable", true) - bill.setControlsSate(param["_control_name_"], "loading", false) - }) + bill.executeServerAction(saveParam, function (code, data) { + if (code === 200) { + fn() + } else { + bill.setControlsSate(param["_control_name_"], "enable", true) + if (data.message) { + const errMsg = data.message.split('nested exception is') + GMS.$hideContainer.$message.error(errMsg && errMsg[1] || '操作异常请联系管理员'); + } + else { + GMS.$hideContainer.$message.error("操作异常请联系管理员"); + } + } + }.bind(this)); + } else { + fn() + } }, } diff --git a/develop/@gms/gms-plugin-billexpand/src/actions/labourUnion/gh_submitAction.js b/develop/@gms/gms-plugin-billexpand/src/actions/labourUnion/gh_submitAction.js index c6c7b0f..ba4b19d 100644 --- a/develop/@gms/gms-plugin-billexpand/src/actions/labourUnion/gh_submitAction.js +++ b/develop/@gms/gms-plugin-billexpand/src/actions/labourUnion/gh_submitAction.js @@ -111,16 +111,40 @@ export default { }) } - 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) - }) + const fn = () => { + 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 { - submitFn() + + if (param.param.actions) { + let saveParam = { + actions: param.param.actions + } + bill.executeServerAction(saveParam, function (code, data) { + if (code === 200) { + fn() + } else { + bill.setControlsSate(param["_control_name_"], "enable", true) + if (data.message) { + const errMsg = data.message.split('nested exception is') + GMS.$hideContainer.$message.error(errMsg && errMsg[1] || '操作异常请联系管理员'); + } + else { + GMS.$hideContainer.$message.error("操作异常请联系管理员"); + } + } + }.bind(this)); + } else { + fn() } } else { diff --git a/develop/@gms/gms-plugin-billexpand/src/actions/util/index.js b/develop/@gms/gms-plugin-billexpand/src/actions/util/index.js index 8e034f4..b6d9a62 100644 --- a/develop/@gms/gms-plugin-billexpand/src/actions/util/index.js +++ b/develop/@gms/gms-plugin-billexpand/src/actions/util/index.js @@ -141,6 +141,15 @@ export const showCommentModal = (bill, param, checkComment) => { }, } ) + const obj = bill.getGlobalParam(BILL_GLOBAL_PARAM.APPROVAL_COMMENT) || {} + bill.setGlobalParam( + BILL_GLOBAL_PARAM.APPROVAL_COMMENT, + { + ...obj, + suggestions: '', + } + ) + window.GMS.vbus.$emit(GLOBAL_EVENT.APPROVAL_USER_CONTROL_RESETVALUE) return GMS.$hideContainer.$msgbox({ diff --git a/develop/@gms/gms-plugin-billexpand/src/constant.js b/develop/@gms/gms-plugin-billexpand/src/constant.js index 2116592..67d5034 100644 --- a/develop/@gms/gms-plugin-billexpand/src/constant.js +++ b/develop/@gms/gms-plugin-billexpand/src/constant.js @@ -16,15 +16,17 @@ export const APPROVAL_TRACK_TABLE = { CURRENT_NODE: 'currnode', CREATOR_FULL_NAME: 'creatorfullname', OPERATION: 'operation', + STAGE: 'vinstance', } export const BILL_GLOBAL_PARAM = { SIGNATURE_FIELDS: 'signatureFields', APPROVAL_COMMENT: 'approvalComment', + TAB_CONTAINER_INFO_MAP: 'tabContainerInfoMap', } export const GLOBAL_EVENT = { VERIFY_SIGNATURE_FAIL: 'verifySignatureFail', APPROVAL_USER_CONTROL_RESETVALUE: 'approvalUserControlResetValue', - + CHANGE_TAB_CONTAINER_HIDDEN_TABS: 'changeContainerHiddenTabs', } diff --git a/develop/@gms/gms-plugin-billexpand/src/control/credit-memo-label.vue b/develop/@gms/gms-plugin-billexpand/src/control/credit-memo-label.vue new file mode 100644 index 0000000..d6415b9 --- /dev/null +++ b/develop/@gms/gms-plugin-billexpand/src/control/credit-memo-label.vue @@ -0,0 +1,51 @@ +<template> + <div class="credit-memo-wrapper" v-if="HCDBillcode"> + <div class="credit-memo-label" v-if="hcje == ydje">全部红冲</div> + <div class="credit-memo-label" v-else>部分红冲</div> + </div> +</template> + +<script> +export default { + props: { + define: { + type: Object, + required: true, + }, + context: { + type: Object, + default: () => ({}) + } + }, + data() { + return { + HCDBillcode: null, + hcje: null, + ydje: null, + } + }, + mounted() { + this.HCDBillcode = this.context.bill.getMasterData().getValue('HCD_BILLCODE') + this.hcje = this.context.bill.getMasterData().getValue('HCJE') + this.ydje = this.context.bill.getMasterData().getValue('YDJE') + } +} +</script> + +<style lang="less" scoped> +.credit-memo-wrapper { + position: relative; + .credit-memo-label { + user-select: none; + position: absolute; + height: 50px; + width: 100px; + border-radius: 5px; + border: 1px solid red; + color: red; + display: flex; + align-items: center; + justify-content: center; + } +} +</style> \ No newline at end of file diff --git a/develop/@gms/gms-plugin-billexpand/src/control/modification-track/modification-track.vue b/develop/@gms/gms-plugin-billexpand/src/control/modification-track/modification-track.vue index fbdc63f..62ea99e 100644 --- a/develop/@gms/gms-plugin-billexpand/src/control/modification-track/modification-track.vue +++ b/develop/@gms/gms-plugin-billexpand/src/control/modification-track/modification-track.vue @@ -3,13 +3,13 @@ <div class="modification-button" :style="{top: styleTop, right: styleRight}" @click="showDrawer = true"> <div class="icon"> <svg width="28px" height="28px" viewBox="0 0 28 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> - <use xlink:href="#icon-a-28_BILLEXPAND_C_RBC_xinshenpiguiji"></use> + <use xlink:href="#icon-a-28_BILLEXPAND_C_RBC_biangengguiji"></use> </svg> </div> </div> <Drawer :transfer="false" - title="变更轨迹" + title="变更记录" :closable="true" v-model="showDrawer" :width="styleDrawerWidth" diff --git a/develop/@gms/gms-plugin-billexpand/src/control/workflow-track.vue b/develop/@gms/gms-plugin-billexpand/src/control/workflow-track/workflow-track-info.vue similarity index 56% rename from develop/@gms/gms-plugin-billexpand/src/control/workflow-track.vue rename to develop/@gms/gms-plugin-billexpand/src/control/workflow-track/workflow-track-info.vue index 5e1fc46..e0a63f0 100644 --- a/develop/@gms/gms-plugin-billexpand/src/control/workflow-track.vue +++ b/develop/@gms/gms-plugin-billexpand/src/control/workflow-track/workflow-track-info.vue @@ -1,102 +1,80 @@ <template> - <div> - <div class="workflow-button" :style="{top: styleTop, right: styleRight}" @click="showDrawer = true"> - <div class="icon"> - <svg width="28px" height="28px" viewBox="0 0 28 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> - <use xlink:href="#icon-a-28_BILLEXPAND_C_RBC_xinshenpiguiji"></use> - </svg> - </div> - </div> - <Drawer - :transfer="false" - title="审批轨迹" - :closable="true" - v-model="showDrawer" - :width="styleDrawerWidth" - :inner="true" - :mask="false" + <div v-if="data && data.length" class="workflow-step-wrapper"> + <div + class="workflow-step" + v-for="step, k in data" + :key="k" > - <div v-if="!data || data.length == 0">暂无数据</div> - <div v-if="data && data.length" class="workflow-step-wrapper"> - <div - class="workflow-step" - v-for="step, k in data" - :key="k" - > - <div class="step-head"> - <div class="step-icon"> - <svg :class="`step-icon ${isCurrentStep(step, k) ? 'waiting-icon' : 'finish-icon'}`" aria-hidden="true"> - <!-- 未到达 --> - <use v-if="step.state == 1" xlink:href="#icon-a-24_BILLEXPAND_C_RBC_weidaoda"></use> - <!-- 通过 --> - <use v-else-if="step.result == 1" xlink:href="#icon-a-24_BILLEXPAND_C_RBC_shenpitongguo"></use> - <!-- 提交 --> - <use v-else-if="step.result == -1" xlink:href="#icon-a-24_BILLEXPAND_C_RBC_shenpitijiao"></use> - <!-- 驳回 --> - <use v-else-if="isRejectStep(step)" xlink:href="#icon-a-24_BILLEXPAND_C_RBC_shenpibohui"></use> - <!-- 末端节点 --> - <use v-else-if="step.result == -2" xlink:href="#icon-a-24_BILLEXPAND_C_RBC_moduanjiedian"></use> - </svg> + <div class="step-head"> + <div class="step-icon"> + <svg :class="`step-icon ${isCurrentStep(step, k) ? 'waiting-icon' : 'finish-icon'}`" aria-hidden="true"> + <!-- 未到达 --> + <use v-if="step.state == 1" xlink:href="#icon-a-24_BILLEXPAND_C_RBC_weidaoda"></use> + <!-- 通过 --> + <use v-else-if="step.result == 1" xlink:href="#icon-a-24_BILLEXPAND_C_RBC_shenpitongguo"></use> + <!-- 取回 --> + <use v-else-if="step.result == 4" xlink:href="#icon-a-24_BILLEXPAND_C_RBC_quhui"></use> + <!-- 提交 --> + <use v-else-if="step.result == -1" xlink:href="#icon-a-24_BILLEXPAND_C_RBC_shenpitijiao"></use> + <!-- 驳回 --> + <use v-else-if="isRejectStep(step)" xlink:href="#icon-a-24_BILLEXPAND_C_RBC_shenpibohui"></use> + <!-- 末端节点 --> + <use v-else-if="step.result == -2" xlink:href="#icon-a-24_BILLEXPAND_C_RBC_moduanjiedian"></use> + </svg> + </div> + <div :class="`step-line ${step.state === 2 ? 'finish-line' : 'waiting-line'}`" v-if="k != data.length - 1"></div> + </div> + <div class="step-main"> + <div class="step-main-body"> + <div :class="`${isCurrentStep(step, k) ? 'text-black' : isRejectStep(step) ? 'text-error' : 'text-grey'}`"> + <div v-if="step.result == -2"> + <span class="result">审批结束</span> </div> - <div :class="`step-line ${step.state === 2 ? 'finish-line' : 'waiting-line'}`" v-if="k != data.length - 1"></div> - </div> - <div class="step-main"> - <div class="step-main-body"> - <div :class="`${isCurrentStep(step, k) ? 'text-black' : isRejectStep(step) ? 'text-error' : 'text-grey'}`"> - <div v-if="step.result == -2"> - <span class="result">审批结束</span> - </div> - <div v-else-if="step.state == 2"> - <span v-if="step.actualOwner" class="participants">{{step.actualOwner}} </span> - <span class="result">{{step.result == -1 ? '提交' : step.result == 1 ? '通过' : '驳回'}}</span> - </div> - <div v-else> - <span v-if="isCurrentStep(step, k)" class="participants">等待</span> - <span class="participants">{{step.participants.join('、')}}</span> - <span class="result"> 审批</span> - </div> - </div> - <div v-if="isCurrentStep(step, k) || step.state == 2">{{formatStepTime(step)}}</div> - <div class="comment" v-if="step.comments"> - <div class="label">审批意见:</div> - <div class="text">{{step.comments}}</div> - </div> - <div v-if="step.title" :class="isRejectStep(step) ? 'text-error' : 'text-main'">环节名称: {{step.title}}</div> + <div v-else-if="step.state == 2"> + <span v-if="step.actualOwner" class="participants">{{step.actualOwner}} </span> + <span class="result"> + {{ + step.result == -1 + ? '提交' + : step.result == 1 + ? '通过' + : step.result == 4 + ? '取回' + : '驳回' + }} + </span> + </div> + <div v-else> + <span v-if="isCurrentStep(step, k)" class="participants">等待</span> + <span class="participants">{{step.participants.join('、')}}</span> + <span class="result"> 审批</span> </div> </div> + <div v-if="isCurrentStep(step, k) || step.state == 2">{{formatStepTime(step)}}</div> + <div class="comment" v-if="step.comments"> + <div class="label">审批意见:</div> + <div class="text">{{step.comments}}</div> + </div> + <div v-if="step.title" :class="isRejectStep(step) ? 'text-error' : 'text-main'">环节名称: {{step.title}}</div> </div> </div> - </Drawer> + </div> </div> </template> <script> -import { APPROVAL_TRACK_TABLE } from '../constant' - export default { - data() { - return { - showDrawer: false, - data: { - "procState": 2, - "startTime": "2021-10-12T07:28:04Z", - "finishTime": "2021-10-13T02:15:40Z", - "steps": [], - "submitter": "ylq" - }, + props: { + data: { + default: () => [], } }, - props: { - define: { - type: Object, - required: true, - }, - context: { - type: Object, - default: () => { } + data() { + return { + } }, - methods:{ + methods: { isCurrentStep(step, k) { if (k != 0) return false return step.result != -2 @@ -158,195 +136,13 @@ export default { return this.formatDate(step.completeTime) } }, - }, - mounted() { - const { tableName, subTableSource } = this.define.config - if (subTableSource) { - const subTable = this.context.bill.getSubData(tableName) - if (subTable instanceof Array) { - this.data = subTable.map((obj) => { - const operation = obj.getValue(APPROVAL_TRACK_TABLE.OPERATION) - const currNode = obj.getValue(APPROVAL_TRACK_TABLE.CURRENT_NODE) - - return { - state: 2, - result: - currNode == 99 - ? -2 - : operation == '提交' - ? -1 - : operation == '同意' - ? 1 - : operation == '驳回' - ? 3 - : -2, - actualOwner: obj.getValue(APPROVAL_TRACK_TABLE.CREATOR_FULL_NAME), - createTime: obj.getValue(APPROVAL_TRACK_TABLE.CREATE_TIME), - completeTime: obj.getValue(APPROVAL_TRACK_TABLE.CREATE_TIME), - comments: obj.getValue(APPROVAL_TRACK_TABLE.APPROVAL_COMMENT), - title: obj.getValue(APPROVAL_TRACK_TABLE.NODE_NAME), - } - }) - this.data = this.data.reverse() - } - return - } - window.GAMS.Util.invokeServer({ - path: 'gms/workflow/task/approved', - type: 'GET', - contentType: 'application/json', - params: { - bizName: this.context.bill.getBillDefine(), - bizObjId: this.context.bill.getMasterData().getValue('id'), - }, - }).then((res) => { - const formatTrack = (curTrack) => { - if (!curTrack) return [] - curTrack.steps = curTrack.steps.reverse() - curTrack.steps = curTrack.steps.map((step) => { - if (step.subTasks && step.subTasks.length) { - let participants = [] - let actualOwnerList = [] - let commentList = [] - let resultFlag = 0 - let rejectFlag = false - for (let task of step.subTasks) { - if (task.state == 2 && task.result == 3 || task.state == 3) { - rejectFlag = true - break - } - } - - for (let task of step.subTasks) { - if (task.participants) { - participants = participants.concat(task.participants) - } - if (task.actualOwner) { - if (!rejectFlag || task.state == 2 && task.result == 3) { - actualOwnerList.push(task.actualOwner) - } - } - if (task.comments) { - commentList.push(task.comments) - } - const curResult = task.result || 0 - resultFlag |= 1 << curResult - } - - step.result = - resultFlag & 8 - ? 3 - : resultFlag & 1 - ? 0 - : 1 - - rejectFlag && (step.state = 2) - step.comments = commentList.join(';\n') - step.participants = participants - step.actualOwner = actualOwnerList.join('、') - } - return step - }) - curTrack.steps.push({ - title: "提交申请", - state: 2, - createTime: curTrack.startTime, - completeTime: curTrack.startTime, - comments: null, - result: -1, - actualOwner: curTrack.submitter, - }) - // 审批流程结束贴一个结束节点 - if (curTrack.procState === 2) { - curTrack.steps.unshift({ - state: curTrack.procState, - createTime: curTrack.finishTime, - completeTime: curTrack.finishTime, - result: -2, - }) - } - // 否则从当前节点切断, - else { - for (let i = 0; i < curTrack.steps.length - 1; ++i) { - if (curTrack.steps[i].state === 1 && curTrack.steps[i + 1].state === 2) { - curTrack.steps = curTrack.steps.slice(i) - break - } - } - } - return curTrack.steps || [] - } - - res = res || [] - let count = 0 - for (let o of res) { - if (o.procState == 1) { - ;++count - } - } - if (count > 1) { - this.$Message.error('工作流数据异常') - } - this.data = [] - for (let i = res.length - 1; i >= 0; --i) { - const o = res[i] - this.data = this.data.concat(formatTrack(o)) - } - // 去掉中间的审批结束节点 - for (let i = 1; i < this.data.length; ++i) { - if (this.data[i].result == -2) { - this.data.splice(i, 1) - ;--i - } - } - }) - }, - computed: { - styleTop() { - return this.define.layout.top || this.define.config.topDistance || '0px' - }, - styleRight() { - return this.define.layout.right || this.define.config.rightDistance || '0px' - }, - styleDrawerWidth() { - return this.define.layout.drawerWidth || this.define.config.drawerWidth || '400px' - }, - }, - beforeDestroy() { - }, + } } </script> <style lang="less" scoped> @icon-width: 24px; @main-color: #0DA2E6; -.workflow-button { - cursor: pointer; - position: absolute; - z-index: 700; - padding-top: 4px; - width: 42px; - height: 36px; - background: #005791; - box-shadow: 0 0 4px 0 rgba(109,109,109,0.50); - border-radius: 100px 0 0 100px; - .icon { - width: 28px; - height: 28px; - margin-left: 11px; - } - .text { - margin-top: 2px; - text-align: center; - height: 17px; - font-size: 12px; - font-family: PingFangSC-Medium, PingFang SC; - font-weight: 500; - color: #FFFFFF; - line-height: 17px; - text-shadow: 0px 1px 6px rgba(255, 169, 56, 0.8); - } -} .workflow-step-wrapper { width: 100%; .workflow-step { @@ -426,4 +222,4 @@ export default { } } } -</style> +</style> \ No newline at end of file diff --git a/develop/@gms/gms-plugin-billexpand/src/control/workflow-track/workflow-track.vue b/develop/@gms/gms-plugin-billexpand/src/control/workflow-track/workflow-track.vue new file mode 100644 index 0000000..b606937 --- /dev/null +++ b/develop/@gms/gms-plugin-billexpand/src/control/workflow-track/workflow-track.vue @@ -0,0 +1,326 @@ +<template> + <div> + <div class="workflow-button" :style="{top: styleTop, right: styleRight}" @click="showDrawer = true"> + <div class="icon"> + <svg width="28px" height="28px" viewBox="0 0 28 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <use xlink:href="#icon-a-28_BILLEXPAND_C_RBC_xinshenpiguiji"></use> + </svg> + </div> + </div> + <Drawer + :transfer="false" + title="审批轨迹" + :closable="true" + v-model="showDrawer" + :width="styleDrawerWidth" + :inner="true" + :mask="false" + > + <div v-if="useSubTableSource"> + <div v-if="stagedSteps.length == 0"></div> + <div + class="collapse-stage" + v-for="stageData, k in stagedSteps" + :key="stageData.stage" + > + <div class="collapse-header" @click="toggleDetail(k)"> + <Icon type="md-arrow-dropdown" v-if="expandMap[k]" /> + <Icon type="md-arrow-dropright" v-else /> + <div class="title">{{stageData.stageTitle}}</div> + </div> + <WorkflowTrackInfo v-show="expandMap[k]" :data="stageData" /> + </div> + </div> + <div v-else> + <div v-if="!data || data.length == 0">暂无数据</div> + <WorkflowTrackInfo :data="data" /> + </div> + + </Drawer> + </div> +</template> + +<script> +import { APPROVAL_TRACK_TABLE } from '../../constant' +import WorkflowTrackInfo from './workflow-track-info.vue' + +export default { + components: { + WorkflowTrackInfo + }, + data() { + return { + showDrawer: false, + data: { + "procState": 2, + "startTime": "2021-10-12T07:28:04Z", + "finishTime": "2021-10-13T02:15:40Z", + "steps": [], + "submitter": "ylq" + }, + stagedSteps: [], + expandMap: [], + useSubTableSource: false, + } + }, + props: { + define: { + type: Object, + required: true, + }, + context: { + type: Object, + default: () => { } + } + }, + methods:{ + toggleDetail(index) { + this.expandMap[index] = !this.expandMap[index] + this.expandMap = [...this.expandMap] + }, + getStageTitle(stage) { + const stageMap = { + '01': '项目立项', + '02': '年初一上一下', + '03': '年初二上二下', + '04': '年中一上一下', + '05': '年中二上二下', + } + return stageMap[stage] + }, + }, + mounted() { + const { tableName, subTableSource } = this.define.config + if (subTableSource) { + this.useSubTableSource = true + const subTable = this.context.bill.getSubData(tableName) + if (subTable instanceof Array) { + this.data = subTable.map((obj) => { + const operation = obj.getValue(APPROVAL_TRACK_TABLE.OPERATION) + const currNode = obj.getValue(APPROVAL_TRACK_TABLE.CURRENT_NODE) + const createTime = obj.getValue(APPROVAL_TRACK_TABLE.CREATE_TIME) + + return { + state: 2, + result: + currNode == 99 + ? -2 + : operation == '提交' + ? -1 + : operation == '同意' + ? 1 + : operation == '驳回' + ? 3 + : 4, + actualOwner: obj.getValue(APPROVAL_TRACK_TABLE.CREATOR_FULL_NAME), + createTime, + timestamp: new Date(createTime).getTime(), + completeTime: obj.getValue(APPROVAL_TRACK_TABLE.CREATE_TIME), + comments: obj.getValue(APPROVAL_TRACK_TABLE.APPROVAL_COMMENT), + title: obj.getValue(APPROVAL_TRACK_TABLE.NODE_NAME), + stage: obj.getValue(APPROVAL_TRACK_TABLE.STAGE), + } + }) + this.data = this.data.sort((a, b) => a.timestamp - b.timestamp) + let temArray = [] + for (let step of this.data) { + temArray.push(step) + temArray.stage = step.stage + temArray.stageTitle = this.getStageTitle(step.stage) + if (step.result == -2) { + temArray.finishStageFlag = true + this.stagedSteps.push(temArray) + temArray = [] + } + } + if (temArray.length) { + this.stagedSteps.push(temArray) + } + + this.expandMap = new Array(this.stagedSteps.length) + if (this.stagedSteps.length == 5 && this.stagedSteps[4].finishStageFlag) { + this.expandMap = this.expandMap.fill(true) + } + else { + this.expandMap = this.expandMap.fill(false) + if (!this.stagedSteps[this.stagedSteps.length - 1].finishStageFlag) { + this.expandMap[this.expandMap.length - 1] = true + } + } + } + return + } + window.GAMS.Util.invokeServer({ + path: 'gms/workflow/task/approved', + type: 'GET', + contentType: 'application/json', + params: { + bizName: this.context.bill.getBillDefine(), + bizObjId: this.context.bill.getMasterData().getValue('id'), + }, + }).then((res) => { + const formatTrack = (curTrack) => { + if (!curTrack) return [] + curTrack.steps = curTrack.steps.reverse() + curTrack.steps = curTrack.steps.map((step) => { + if (step.subTasks && step.subTasks.length) { + let participants = [] + let actualOwnerList = [] + let commentList = [] + let resultFlag = 0 + let rejectFlag = false + for (let task of step.subTasks) { + if (task.state == 2 && task.result == 3 || task.state == 3) { + rejectFlag = true + break + } + } + + for (let task of step.subTasks) { + if (task.participants) { + participants = participants.concat(task.participants) + } + if (task.actualOwner) { + if (!rejectFlag || task.state == 2 && task.result == 3) { + actualOwnerList.push(task.actualOwner) + } + } + if (task.comments) { + commentList.push(task.comments) + } + const curResult = task.result || 0 + resultFlag |= 1 << curResult + } + + step.result = + resultFlag & 8 + ? 3 + : resultFlag & 1 + ? 0 + : 1 + + rejectFlag && (step.state = 2) + step.comments = commentList.join(';\n') + step.participants = participants + step.actualOwner = actualOwnerList.join('、') + } + return step + }) + curTrack.steps.push({ + title: "提交申请", + state: 2, + createTime: curTrack.startTime, + completeTime: curTrack.startTime, + comments: null, + result: -1, + actualOwner: curTrack.submitter, + }) + // 审批流程结束贴一个结束节点 + if (curTrack.procState === 2) { + curTrack.steps.unshift({ + state: curTrack.procState, + createTime: curTrack.finishTime, + completeTime: curTrack.finishTime, + result: -2, + }) + } + // 否则从当前节点切断, + else { + for (let i = 0; i < curTrack.steps.length - 1; ++i) { + if (curTrack.steps[i].state === 1 && curTrack.steps[i + 1].state === 2) { + curTrack.steps = curTrack.steps.slice(i) + break + } + } + } + return curTrack.steps || [] + } + + res = res || [] + let count = 0 + for (let o of res) { + if (o.procState == 1) { + ;++count + } + } + if (count > 1) { + this.$Message.error('工作流数据异常') + } + this.data = [] + for (let i = res.length - 1; i >= 0; --i) { + const o = res[i] + this.data = this.data.concat(formatTrack(o)) + } + // 去掉中间的审批结束节点 + for (let i = 1; i < this.data.length; ++i) { + if (this.data[i].result == -2) { + this.data.splice(i, 1) + ;--i + } + } + }) + }, + computed: { + styleTop() { + return this.define.layout.top || this.define.config.topDistance || '0px' + }, + styleRight() { + return this.define.layout.right || this.define.config.rightDistance || '0px' + }, + styleDrawerWidth() { + return this.define.layout.drawerWidth || this.define.config.drawerWidth || '400px' + }, + }, + beforeDestroy() { + }, +} +</script> + +<style lang="less" scoped> +.workflow-button { + cursor: pointer; + position: absolute; + z-index: 700; + padding-top: 4px; + width: 42px; + height: 36px; + background: #005791; + box-shadow: 0 0 4px 0 rgba(109,109,109,0.50); + border-radius: 100px 0 0 100px; + .icon { + width: 28px; + height: 28px; + margin-left: 11px; + } + .text { + margin-top: 2px; + text-align: center; + height: 17px; + font-size: 12px; + font-family: PingFangSC-Medium, PingFang SC; + font-weight: 500; + color: #FFFFFF; + line-height: 17px; + text-shadow: 0px 1px 6px rgba(255, 169, 56, 0.8); + } +} + +.collapse-stage { + margin-bottom: 5px; + .collapse-header { + background-color: #e5e5e5; + height: 26px; + font-size: 24px; + display: flex; + justify-content: flex-start; + align-items: center; + cursor: pointer; + user-select: none; + .title { + font-size: 14px; + } + } +} + + +</style> diff --git a/develop/@gms/gms-plugin-billexpand/src/emcon.js b/develop/@gms/gms-plugin-billexpand/src/emcon.js index c192842..38bdaa5 100644 --- a/develop/@gms/gms-plugin-billexpand/src/emcon.js +++ b/develop/@gms/gms-plugin-billexpand/src/emcon.js @@ -1,6 +1,18 @@ export default { billControl: [ { + "title": "红冲标识", + "description": "", + "discard": false, + "dynamicComponent": 'billForm', + "extends": { + "config": [ + ], + }, + "value": "CreditMemoLabel", + "path": "报销/通用" + }, + { "title": "变更轨迹", "description": "", "discard": false, @@ -2294,7 +2306,15 @@ export default { "type": "Boolean", "title": "电子签章", "key": "useSignature" - } + }, + { + "clearable": true, + "ref": "gams2.bill", + "type": "select", + "title": "执行动作", + "key": "actions", + "innerRef": "actions" + }, ] }, "description": "", @@ -2363,6 +2383,14 @@ export default { "path": "报销/工会", "extends": { "param": [ + { + "clearable": true, + "ref": "gams2.bill", + "type": "select", + "title": "执行动作", + "key": "actions", + "innerRef": "actions" + }, ] }, "description": "", @@ -2554,6 +2582,25 @@ export default { "extends": { "info": { "param": [ + + ], + "name": "CheckFieldEditableOfBJZGH", + "description": "CheckFieldEditableOfBJZGH", + "title": "CheckFieldEditableOfBJZGH", + "return": 0 + } + }, + + "description": "CheckFieldEditableOfBJZGH", + "title": "CheckFieldEditableOfBJZGH", + "value": "CheckFieldEditableOfBJZGH" + }, + { + "discard": false, + "path": "通用", + "extends": { + "info": { + "param": [ ], "name": "GetMDByObjectcode", "description": "GetMDByObjectcode", @@ -5059,6 +5106,22 @@ export default { "discard": false, "path": "通用", "extends": { + "info": { + "param": [], + "name": "HideTabContainerTabs", + "description": "设置tabContainer的页签状态", + "title": "设置tabContainer的页签状态", + "return": 0 + } + }, + "description": "设置tabContainer的页签状态", + "title": "设置tabContainer的页签状态", + "value": "HideTabContainerTabs" + }, + { + "discard": false, + "path": "通用", + "extends": { "info": { "param": [ diff --git a/develop/@gms/gms-plugin-billexpand/src/formula/CheckFieldEditableOfBJZGH.js b/develop/@gms/gms-plugin-billexpand/src/formula/CheckFieldEditableOfBJZGH.js new file mode 100644 index 0000000..49905b5 --- /dev/null +++ b/develop/@gms/gms-plugin-billexpand/src/formula/CheckFieldEditableOfBJZGH.js @@ -0,0 +1,27 @@ +export default { + execute: function ([target], context) { + const SBBM = context.getMasterData().getValue('SBBM') || {} + const djlczt = context.getMasterData().getValue('DJLCZT') + const res = $.ajax({ + type: 'POST', + + url: `${osConfig.baseUrl}/rbczgh/check/editable`, + async: false, + contentType: 'application/json', + dataType: 'json', + beforeSend: function (request) { + request.setRequestHeader("Authorization", GMS.util.getAuthorization()); + }, + data: JSON.stringify({ + fieldName: target.StaticValue, + djlczt, + bmObjectCode: SBBM.objectcode, + }) + }) + + return res.responseJSON + }, + getResultType: function () { + return FMR.ConstDataTypes.Bool; + }, +} \ No newline at end of file diff --git a/develop/@gms/gms-plugin-billexpand/src/formula/HideTabContainerTabs.js b/develop/@gms/gms-plugin-billexpand/src/formula/HideTabContainerTabs.js new file mode 100644 index 0000000..7940463 --- /dev/null +++ b/develop/@gms/gms-plugin-billexpand/src/formula/HideTabContainerTabs.js @@ -0,0 +1,23 @@ +import { BILL_GLOBAL_PARAM, GLOBAL_EVENT } from '../constant' + +export default { + execute: function ([containerInfo, tabInfo, statusInfo], context) { + const containerId = containerInfo.StaticValue + const tabIndexList = JSON.parse(tabInfo.StaticValue) + const status = statusInfo.StaticValue + if (!containerId || !tabIndexList || !status) return + const tabContainerInfoMap = context.getGlobalParam(BILL_GLOBAL_PARAM.TAB_CONTAINER_INFO_MAP) || {} + const currentContainerInfo = tabContainerInfoMap[containerId] || {} + currentContainerInfo[status] = tabIndexList + window.GMS.vbus.$emit( + GLOBAL_EVENT.CHANGE_TAB_CONTAINER_HIDDEN_TABS, + { + containerId, + info: currentContainerInfo, + } + ) + }, + getResultType: function () { + return FMR.ConstDataTypes.General; + }, +} \ No newline at end of file diff --git a/develop/@gms/gms-plugin-billexpand/src/mcon.js b/develop/@gms/gms-plugin-billexpand/src/mcon.js index 95759d8..06a7f0d 100644 --- a/develop/@gms/gms-plugin-billexpand/src/mcon.js +++ b/develop/@gms/gms-plugin-billexpand/src/mcon.js @@ -81,7 +81,7 @@ import GH_djTransfer from "./query-actions/labourUnion/gh_djTransfer.js" 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 WorkflowTrack from './control/workflow-track/workflow-track.vue' import SignatureList from './control/signature-list.vue' import buttonGroupControl from './control/buttonGrouop' import rbcBasedataTree from './control/baseDataSelect/index.vue' @@ -94,6 +94,7 @@ import InputModalControl from './control/InputModalControl.vue' import Achievements from './control/vxe-achievements/achievements.vue' import VxeSubjectControl from './control/vxeTableExpand/VxeSubjectControl.js' import ModificationTrack from './control/modification-track/modification-track.vue' +import CreditMemoLabel from './control/credit-memo-label.vue' //formula import GeneralImportFile from './formula/GeneralImportFile.js'; @@ -179,9 +180,11 @@ import SubTableHasContainField from "./formula/SubTableHasContainField"; import SetSubFieldsByBaseData from "./formula/SetSubFieldsByBaseData"; import SubTableSetData from "./formula/SubTableSetData"; import GetOwnProperty from "./formula/GetOwnProperty"; +import CheckFieldEditableOfBJZGH from "./formula/CheckFieldEditableOfBJZGH"; import GetMDByObjectcode from "./formula/GetMDByObjectcode"; import SetSubValueToMaster from "./formula/SetSubValueToMaster"; import UnsafeApplyFunction from "./formula/UnsafeApplyFunction"; +import HideTabContainerTabs from "./formula/HideTabContainerTabs"; export default { actions: { updateFieldAction, @@ -291,6 +294,7 @@ export default { Achievements, VxeSubjectControl, ModificationTrack, + CreditMemoLabel, }, formula: { SubTableSetBaseData, @@ -367,8 +371,10 @@ export default { SubTableSetData, GetMDByObjectcode, GetOwnProperty, + CheckFieldEditableOfBJZGH, SetSubValueToMaster, UnsafeApplyFunction, + HideTabContainerTabs, ...GeneralImportFile, }, routes : {