Commit 69b67513 by Joey

Merge branch 'develop' into develop-zhouyi

parents 936a494a c2e78db4
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
"viewerjs": "^1.10.2", "viewerjs": "^1.10.2",
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-router": "^3.2.0", "vue-router": "^3.2.0",
"vuex": "^3.4.0" "vuex": "^3.4.0",
"currency.js": "^1.2.2"
}, },
"files": [ "files": [
"dist", "dist",
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
:id="billId" :id="billId"
:type="billId ? 'load' : 'init'" :type="billId ? 'load' : 'init'"
:state="state" :state="state"
:hideButtonGroup="hideButtonGroup"
@loadFinish="loadFinishFun" @loadFinish="loadFinishFun"
v-if="init" v-if="init"
></gms-bill-form> ></gms-bill-form>
...@@ -39,6 +40,7 @@ export default { ...@@ -39,6 +40,7 @@ export default {
isReadOnly: false, isReadOnly: false,
billClass: null, billClass: null,
oldBillData: null, oldBillData: null,
hideButtonGroup: false
}; };
}, },
watch: { watch: {
......
<template> <template>
<div class="rbc-basedata"> <div class="rbc-basedata">
<el-popover trigger="manual" v-model="dataListShow" :visible-arrow="false" :width="searchPopperMinWidth"> <el-popover ref="popover" trigger="manual" v-model="dataListShow" :visible-arrow="false" :width="searchPopperMinWidth">
<div class="select-box" slot="reference"> <div class="select-box" slot="reference">
<Input ref="searchInput" v-model="selectValue" :disabled="disabled" :readonly="readonly || multiple" :class="{'multiple-input': multiple && !readonly}" placeholder="" @on-change="handleChange" @on-focus="handleFocus" @on-blur="handleBlur" @keydown.down.native="handleSelectNext" @keydown.up.native="handleSelectPrev" @keydown.enter.native="handleSelected"> <Input ref="searchInput" v-model="selectValue" :disabled="disabled" :readonly="readonly || multiple" :class="{'multiple-input': multiple && !readonly}" placeholder="" @on-change="handleChange" @on-focus="handleFocus" @on-blur="handleBlur" @keydown.down.native="handleSelectNext" @keydown.up.native="handleSelectPrev" @keydown.enter.native="handleSelected">
<Icon type="ios-close-circle" :class="{'clear-icon': true, 'hidden-icon': disabled || readonly || !selectValue }" slot="suffix" @click="clearList" /> <Icon type="ios-close-circle" :class="{'clear-icon': true, 'hidden-icon': disabled || readonly || !selectValue }" slot="suffix" @click="clearList" />
...@@ -104,9 +104,38 @@ export default { ...@@ -104,9 +104,38 @@ export default {
} }
}, },
mounted () { mounted () {
this.addDomListener()
addResizeListener(this.$el, this.handleResize) addResizeListener(this.$el, this.handleResize)
}, },
beforeDestroy() {
this.removeDomListener()
},
methods: { methods: {
addDomListener() {
if (this.isVxe) {
let doms = document.querySelectorAll('.rootClass')
if (doms.length) {
doms.forEach(item => {
item.addEventListener('scroll', this.refreshPopover)
})
}
}
},
removeDomListener() {
if (this.isVxe) {
let doms = document.querySelectorAll('.rootClass')
if (doms.length) {
doms.forEach(item => {
item.removeEventListener('scroll', this.refreshPopover)
})
}
}
},
refreshPopover() {
if (this.dataListShow) {
this.$refs.popover.updatePopper()
}
},
handleResize () { handleResize () {
this.searchPopperMinWidth = this.$el.getBoundingClientRect().width this.searchPopperMinWidth = this.$el.getBoundingClientRect().width
}, },
......
...@@ -40,6 +40,14 @@ export default { ...@@ -40,6 +40,14 @@ export default {
}, },
immediate: true immediate: true
}, },
'tmpBill.$attrs.hideButtonGroup': {
handler(nv) {
if (nv) {
this.buttonShow = false
}
},
immediate: true
},
}, },
mounted() { mounted() {
......
...@@ -702,7 +702,14 @@ export default { ...@@ -702,7 +702,14 @@ export default {
"type": "field", "type": "field",
"title": "单据id", "title": "单据id",
"key": "billId" "key": "billId"
} },
{
"isRequired": true,
"ref": "columnField",
"type": "Boolean",
"title": "隐藏工具栏",
"key": "hideButton"
},
] ]
}, },
"description": "指定跳转页面,配置单据id和单据类型,通过在当前页签打开形式进行跳转", "description": "指定跳转页面,配置单据id和单据类型,通过在当前页签打开形式进行跳转",
...@@ -1242,7 +1249,8 @@ export default { ...@@ -1242,7 +1249,8 @@ export default {
}, },
"description": "", "description": "",
"title": "查看详情[showDetailAction]", "title": "查看详情[showDetailAction]",
"value": "showDetailAction" "value": "showDetailAction",
"alwaysUse":true
}, },
{ {
"discard": false, "discard": false,
...@@ -1514,7 +1522,8 @@ export default { ...@@ -1514,7 +1522,8 @@ export default {
}, },
"description": "", "description": "",
"title": "编辑常用审批意见", "title": "编辑常用审批意见",
"value": "approvalEditModalOpen" "value": "approvalEditModalOpen",
"alwaysUse":true
}, },
{ {
"discard": false, "discard": false,
...@@ -1576,7 +1585,8 @@ export default { ...@@ -1576,7 +1585,8 @@ export default {
}, },
"description": "", "description": "",
"title": "添加常用审批意见", "title": "添加常用审批意见",
"value": "approvalMessageAdd" "value": "approvalMessageAdd",
"alwaysUse":true
}, },
{ {
"discard": false, "discard": false,
...@@ -3910,6 +3920,22 @@ export default { ...@@ -3910,6 +3920,22 @@ export default {
"extends": { "extends": {
"info": { "info": {
"param": [], "param": [],
"name": "EqualsMasterAndSubField",
"description": "主子表字段比较公式 e.g. EqualsMasterAndSubField(BXD_H.BXJEXX,BXD_I1.BXJEX1)",
"title": "主子表字段比较公式",
"return": 1
}
},
"description": "",
"title": "主子表字段比较公式",
"value": "EqualsMasterAndSubField"
},
{
"discard": false,
"path": "通用",
"extends": {
"info": {
"param": [],
"name": "CheckReferenceRelation", "name": "CheckReferenceRelation",
"description": "校验单据是否被引用 e.g. CheckReferenceRelation('REF_FLAG','1','当前单据已被引用,暂时无法删除。')", "description": "校验单据是否被引用 e.g. CheckReferenceRelation('REF_FLAG','1','当前单据已被引用,暂时无法删除。')",
"title": "校验单据是否被引用", "title": "校验单据是否被引用",
......
import _ from "./FormulaConstants"; import _ from "./FormulaConstants";
import currency from 'currency.js/dist/currency.js'
/** /**
* 金额比较公式 * 金额比较公式
* 比较左右两个操作数是否相等 参数可以是返回值类型为number的公式 * 比较左右两个操作数是否相等 参数可以是返回值类型为number的公式
...@@ -13,8 +13,8 @@ export default { ...@@ -13,8 +13,8 @@ export default {
let leftOperand = arguments[0][0]; let leftOperand = arguments[0][0];
let rightOperand = arguments[0][1]; let rightOperand = arguments[0][1];
if (leftOperand && rightOperand) { if (leftOperand && rightOperand) {
leftOperand = _.getFormulaParamValue(leftOperand); leftOperand = currency(_.getFormulaParamValue(leftOperand)).value
rightOperand = _.getFormulaParamValue(rightOperand); rightOperand = currency(_.getFormulaParamValue(rightOperand)).value
if (_.isNumber(leftOperand) && _.isNumber(rightOperand)) { if (_.isNumber(leftOperand) && _.isNumber(rightOperand)) {
return _.isAmountEqual(leftOperand, rightOperand); return _.isAmountEqual(leftOperand, rightOperand);
} else { } else {
......
...@@ -19,7 +19,7 @@ export default { ...@@ -19,7 +19,7 @@ export default {
let tempAllSubData = allSubData[tempSubTableObject.title] let tempAllSubData = allSubData[tempSubTableObject.title]
if (tempAllSubData && tempAllSubData instanceof Array) { if (tempAllSubData && tempAllSubData instanceof Array) {
tempAllSubData.forEach(e => { tempAllSubData.forEach(e => {
if (e.getValue(sfjdField.FieldCode)) { if (e.getValue(sfjdField.FieldCode) === 1 || e.getValue(sfjdField.FieldCode) === "1") {
flag = true; flag = true;
} }
tempArray.push(e.getValue(subBillNameField.FieldCode)) tempArray.push(e.getValue(subBillNameField.FieldCode))
......
import _ from 'lodash'
import util from './FormulaConstants'
/**
* 主子表字段比较公式
* 暂时仅实现 主表基础数据子表基础数据的比较
* @author fengjiansheng
* @date 2022-02-16
*/
export default {
formulaName: "EqualsMasterAndSubField",
execute: function () {
if (arguments && arguments[0] && arguments[0].length === 3) {
let context = arguments[1]
let compType = util.getFormulaParamValue(arguments[0][0])
let masterField = arguments[0][1]
if (compType !== 1) {
return true
}
masterField = util.getFormulaParamValue(masterField).id
let tempSubTableObject = context.getTableType(arguments[0][2].FieldTableCode);
if (!_.isEqual(tempSubTableObject.type, "sub")) {
return false
}
let allSubData = context.getAllSubData();
if (!allSubData || _.isEmpty(allSubData)) {
return true
}
let tempAllSubData = context.getAllSubData()[tempSubTableObject.title];
if (!tempAllSubData || _.isEmpty(tempAllSubData)) {
return true
}
if (tempAllSubData instanceof Array) {
for (const tempSubData of tempAllSubData) {
let tempData = tempSubData.getValue(arguments[0][2].FieldCode).id
if (masterField !== tempData) {
return false
}
}
}
return true
} else {
console.error(this.formulaName + _.ERROR_MSG.PARAM_NUM)
return false
}
},
getResultType: function () {
return util.resultType.boolean
}
}
...@@ -174,6 +174,7 @@ import LoginUserIsContianRole from "@/formula/SubTableJointString" ...@@ -174,6 +174,7 @@ import LoginUserIsContianRole from "@/formula/SubTableJointString"
import SubTableSetBaseData from "@/formula/SubTableSetBaseData" import SubTableSetBaseData from "@/formula/SubTableSetBaseData"
import UpdateBillReferenceRelationshipFunction from "./formula/UpdateBillReferenceRelationshipFunction"; import UpdateBillReferenceRelationshipFunction from "./formula/UpdateBillReferenceRelationshipFunction";
import AmountComp from "./formula/AmountComp"; import AmountComp from "./formula/AmountComp";
import EqualsMasterAndSubField from "./formula/EqualsMasterAndSubField";
export default { export default {
actions: { actions: {
updateFieldAction, updateFieldAction,
...@@ -352,6 +353,7 @@ export default { ...@@ -352,6 +353,7 @@ export default {
ClearImageInfoRefState, ClearImageInfoRefState,
CheckReferenceRelation, CheckReferenceRelation,
AmountComp, AmountComp,
EqualsMasterAndSubField,
}, },
routes : { routes : {
showPrint: { showPrint: {
......
...@@ -24,7 +24,8 @@ export default { ...@@ -24,7 +24,8 @@ export default {
{ {
templateName: context.selects[0][param.viewName], templateName: context.selects[0][param.viewName],
id: context.selects[0][param.billId], id: context.selects[0][param.billId],
state: 'readOnly' state: 'readOnly',
hideButtonGroup: param.hideButton? true: false
}, },
{ {
openWay: "FUNCTAB", openWay: "FUNCTAB",
...@@ -39,6 +40,7 @@ export default { ...@@ -39,6 +40,7 @@ export default {
c.modal_visible = true; c.modal_visible = true;
c.isReadOnly = true c.isReadOnly = true
c.state = 'readOnly' c.state = 'readOnly'
c.hideButtonGroup = param.hideButton? true: false
}) })
} }
} }
......
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