Commit e699388f by 袁成

Merge branch 'develop' of ssh://nvwa.jiuqi.com.cn:2222/GFP/RBC/rbc-frontend into develop-yuancheng

parents 829c68a6 0fdcb3aa
......@@ -29,6 +29,13 @@ export default {
} else {
GAMS.Common.messagePrompt('请在单据中录入数据');
}
c.$nextTick(()=>{
component.addListener({
close: function() {
GMS.$hideContainer.remove(name);
}
});
})
});
} else {
GAMS.Common.messagePrompt('缺少参数');
......
......@@ -29,6 +29,13 @@ export default {
c.modal_visible = true;
GMS.editSubIndex = bill.getSubFocus();
console.log('param',param,obj);
c.$nextTick(()=>{
component.addListener({
close: function() {
GMS.$hideContainer.remove(name);
}
});
})
});
} else {
GAMS.Common.messagePrompt('缺少参数');
......
......@@ -4,6 +4,10 @@ export default {
if (param) {
let component = null;
let name = GMS.$hideContainer.addComponent(addInfoModal, {}, function (c) {
let BILLID = param.param.billId||'BILLID';
let BILLNAME = param.param.billName||'BILLNAME';
let BILLEDITNAME = param.param.billDefineName||'BILLEDITNAME';
GMS.showDetailAction = true;//详情,点击确定按钮。记录此参数
component = c;
c.bill = bill;
......@@ -13,21 +17,26 @@ export default {
tableName = param.param.tableName
}
let obj = c.getCurrentRowData(tableName);
if(!obj['BILLNAME']&&tableName=='SRMXZB'){
if(!obj[BILLNAME]&&tableName=='SRMXZB'){
GAMS.Common.messagePrompt('此条数据没有详情信息');
return
}
if(!obj['BILLNAME']){
if(!obj[BILLNAME]){
GAMS.Common.messagePrompt('无详情参数');
return
}
c.showDetail = true;
c.selectBill = obj['BILLEDITNAME'].replace(/_E/ig, "_R");//后续创建了_R的单子再说吧
//c.selectBill = obj['BILLEDITNAME'];
c.billId = obj['BILLID'];
c.selectBill = BILLEDITNAME?obj[BILLEDITNAME]:obj['BILLEDITNAME'].replace(/_E/ig, "_R");//后续创建了_R的单子再说吧
c.billId = obj[BILLID];
c.subBillData = obj.BILLDETAILOBJ;
c.modal_visible = true;
console.log('param',param,obj);
c.$nextTick(()=>{
component.addListener({
close: function() {
GMS.$hideContainer.remove(name);
}
});
})
});
} else {
GAMS.Common.messagePrompt('无详情参数');
......
......@@ -4,6 +4,9 @@ export default {
if (param) {
let component = null;
let name = GMS.$hideContainer.addComponent(addInfoModal, {}, function (c) {
let BILLID = param.param.billId||'BILLID';
let BILLNAME = param.param.billName||'BILLNAME';
let BILLEDITNAME = param.param.billDefineName||'BILLEDITNAME';
GMS.showDetailAction = true;//详情,点击确定按钮。记录此参数
component = c;
c.bill = bill;
......@@ -15,20 +18,26 @@ export default {
tableName = param.param.tableName
}
let obj = c.getCurrentRowData(tableName);
if(!obj['BILLNAME']&&tableName=='SRMXZB'){
if(!obj[BILLNAME]&&tableName=='SRMXZB'){
GAMS.Common.messagePrompt('此条数据没有详情信息');
return
}
if(!obj['BILLNAME']){
if(!obj[BILLNAME]){
GAMS.Common.messagePrompt('无详情参数');
return
}
c.showDetail = true;
c.selectBill = obj['BILLEDITNAME'];
c.billId = obj['BILLID'];
c.selectBill = obj[BILLEDITNAME];
c.billId = obj[BILLID];
c.subBillData = obj.BILLDETAILOBJ;
c.modal_visible = true;
console.log('param',param,obj);
c.$nextTick(()=>{
component.addListener({
close: function() {
GMS.$hideContainer.remove(name);
}
});
})
});
} else {
GAMS.Common.messagePrompt('无详情参数');
......
......@@ -614,7 +614,6 @@ export default {
path: billPath,
});
window.open(routeData.href, "_blank");
//this.close();
},
handleAddAssetsSave() {
this.chekData(
......
......@@ -198,24 +198,6 @@ export default {
this.hasFocus = true
this.getBaseDataList()
},
// handleBlur() {
// if (!this.onResultList) {
// this.hasFocus = false
// this.dataListShow = false
// }
// this.selectValue = String(this.selectValue)
// if (this.value === null) {
// this.selectValue = ''
// this.selectIndex = -1
// this.selectedItem = {}
// } else {
// this.selectValue = this.value.name
// this.selectedItem = this.value
// this.findIndex()
// }
// this.$emit('data-change', this.value)
// },
// 输入查询时
handleChange() {
if (this.selectValue === '' || this.selectValue === null) {
......
......@@ -110,7 +110,21 @@ export default {
.catch((XMLHttpRequest, textStatus, errorThrown) => {});
},
handleCancel() {
this.close();
},
addListener(l) {
this.listener = l;
},
close() {
this.modal_visible = false;
if (this.listener) {
this.$nextTick(
function() {
this.$destroy();
this.listener.close();
}.bind(this)
);
}
},
},
watch: {},
......
......@@ -1367,7 +1367,22 @@ export default {
"discard": false,
"path": "资产/通用",
"extends": {
"param": []
"param": [{
"isRequired": false,
"title": "单据id",
"key": "billId",
"type": "String",
},{
"isRequired": false,
"title": "单据标识",
"key": "billName",
"type": "String",
},{
"isRequired": false,
"title": "单据界面",
"key": "billDefineName",
"type": "String",
}]
},
"description": "",
"title": "查看详情[showDetailAction]",
......@@ -1378,7 +1393,22 @@ export default {
"discard": false,
"path": "资产/通用",
"extends": {
"param": []
"param": [{
"isRequired": false,
"title": "单据id",
"key": "billId",
"type": "String",
},{
"isRequired": false,
"title": "单据标识",
"key": "billName",
"type": "String",
},{
"isRequired": false,
"title": "单据界面",
"key": "billDefineName",
"type": "String",
}]
},
"description": "",
"title": "审批查看详情[showDetailSPAction]",
......@@ -4307,6 +4337,22 @@ export default {
"extends": {
"info": {
"param": [],
"name": "SetSubFieldsByBaseData",
"description": "从子表基础数据带出数据到子表同行的其他字段中,支持带出基础数据/普通数据 SetSubFieldsByBaseData(HJ_YSXXZB_I.YSXM,\"jfly#MD_JFLY\",HJ_YSXXZB_I.JFLY,\"zclb#MD_ZCLB\",HJ_YSXXZB_I.ZCLB,\"ysje#\",HJ_YSXXZB_I.YSJE)",
"title": "子表赋值公式:根据子表基础数据给子表其他字段赋值",
"return": 0
}
},
"description": "",
"title": "子表赋值公式:根据子表基础数据给子表其他字段赋值",
"value": "SetSubFieldsByBaseData"
},
{
"discard": false,
"path": "通用",
"extends": {
"info": {
"param": [],
"name": "ApplyTemplateString",
"description": "1.基础数据字段,2.赋值的字段,3.模板字符串4.field+对应基础数据table5.分隔符",
"title": "基础数据赋值模板字符串",
......
// 子表根据基础数据带出基础数据
export default {
execute: function () {
const GLOBAL_PARAM_KEY = 'applyTemplateStringData'
if (arguments && arguments[0] && arguments[1]) {
const context = arguments[1]
if (!context.getGlobalParam(GLOBAL_PARAM_KEY)) {
context.setGlobalParam(GLOBAL_PARAM_KEY, {})
}
const originField = arguments[0][0]
const targetField = arguments[0][1]
let templateString = arguments[0][2].StaticValue
......@@ -12,6 +17,18 @@ export default {
const argList = args.split(',')
const originTableType = context.getTableType(originField.FieldTableCode)
const originTableObject = context.getSubData(originTableType.title)
const oldValue = context.getGlobalParam(GLOBAL_PARAM_KEY)[originTableType.title]
if (originTableObject instanceof Array) {
const newValue = originTableObject
.map((o) => o.getValue(originField.FieldCode))
.filter((o) => o && o.code)
.map((o) => o.code)
.join(',')
if (oldValue != newValue) {
context.getGlobalParam(GLOBAL_PARAM_KEY)[originTableType.title] = newValue
}
else return
}
const requestParam = {
pagination: false,
searchKey: "",
......@@ -19,11 +36,7 @@ export default {
stopflag: -1,
authType: "NONE"
}
const replaceMap = new Map()
const replaceTemplatePart = templateString.match(/{{.+?}}/g)
replaceTemplatePart.forEach((part) => {
replaceMap.set(part, [])
})
const getBaseDataList = (originFieldValue) => {
const promistList = []
for (let i = 0; i < argList.length; i += 2) {
......@@ -63,12 +76,17 @@ export default {
return templateString
}
if (originTableObject instanceof Array) {
const replaceMap = new Map()
const replaceTemplatePart = templateString.match(/{{.+?}}/g)
replaceTemplatePart.forEach((part) => {
replaceMap.set(part, [])
})
const getBasedataPromiseList = []
let count = 0
for (let i = 0; i < originTableObject.length; ++i) {
const originObject = originTableObject[i]
const curOriginFieldValue = originObject.getValue(originField.FieldCode)
if (!curOriginFieldValue || !curOriginFieldValue.objectcode) {
if (!curOriginFieldValue || !curOriginFieldValue.code) {
continue
}
getBasedataPromiseList.push(getBaseDataList(curOriginFieldValue).then((basedataObjectList) => {
......
......@@ -51,5 +51,22 @@ export default {
}
return obj
},
isValidString(s) {
return _.isString(s) && s.length > 0
}
}
export {BaseDataParam , _}
class BaseDataParam {
tableName;
objectcode;
constructor(tableName, objectcode) {
this.objectcode = objectcode;
this.tableName = tableName;
this.queryDataStructure = "ALL"
this.limit = 1;
this.offset = 0;
this.pagination = true
}
}
import FormulaConstants, {BaseDataParam, _} from "./FormulaConstants"
/**
* 子表赋值公式 处理子表基础数据带出基础数据/标准金额/其他字段时 给同行其他字段赋值的问题
* @author fengjiansheng
* @date 2022-03-17
*/
export default {
execute: function () {
let formulaName = "SetSubFieldsByBaseData"
let delimiter = "#";
if (arguments && arguments[0] && arguments[0].length > 1) {
let context = arguments[1]
debugger
let sourceBaseDataField = arguments[0][0]
let sourceBaseData = FormulaConstants.getFormulaParamValue(sourceBaseDataField)
let oldIndex = context.getSubFocus()
let subTableObject = null
let focusData = null
let baseDataParamArrayList = []
let targetSubTableFieldList = []
let sourceCommonValueList = []
let targetSubTableCommonFieldList = []
for (let i = 1; i < arguments[0].length; i += 2) {
let tempTargetSubTableField = arguments[0][i + 1]
let combString = FormulaConstants.getFormulaParamValue(arguments[0][i])
let sourceBaseDataFieldName = combString.split(delimiter)[0]
let targetBaseDataTableName = combString.split(delimiter)[1]
let targetBaseDataValueObjectcode = sourceBaseData[sourceBaseDataFieldName]
if (subTableObject == null) {
subTableObject = context.getTableType(tempTargetSubTableField.FieldTableCode)
}
if (focusData == null) {
focusData = context.getAllSubData()[subTableObject.title][oldIndex].getData()
}
if (!(_.isEqual(focusData[sourceBaseDataField.FieldCode]._field_old_value_, focusData[sourceBaseDataField.FieldCode].value))) {
if (FormulaConstants.isValidString(targetBaseDataTableName) && targetBaseDataTableName.indexOf("MD_") === 0 && FormulaConstants.isValidString(targetBaseDataValueObjectcode)) {
let baseDataParam = new BaseDataParam(targetBaseDataTableName, targetBaseDataValueObjectcode);
baseDataParamArrayList.push(baseDataParam)
targetSubTableFieldList.push(tempTargetSubTableField)
} else {
sourceCommonValueList.push(targetBaseDataValueObjectcode)
targetSubTableCommonFieldList.push(tempTargetSubTableField)
}
}
}
if (sourceCommonValueList.length === targetSubTableCommonFieldList.length && targetSubTableCommonFieldList.length > 0) {
focusData[sourceBaseDataField.FieldCode]._field_old_value_ = focusData[sourceBaseDataField.FieldCode].value
for (let i = 0; i < targetSubTableCommonFieldList.length; i++) {
focusData[targetSubTableCommonFieldList[i].FieldCode]._field_old_value_ = focusData[targetSubTableCommonFieldList[i].FieldCode].value = sourceCommonValueList[i]
}
if (baseDataParamArrayList.length === 0) {
context.refreshSubDataRow(subTableObject.title)
}
}
if (baseDataParamArrayList.length === targetSubTableFieldList.length && targetSubTableFieldList.length > 0) {
this.getCombBaseDataList(baseDataParamArrayList, (baseDataList) => {
let newIndex = context.getSubFocus()
if (oldIndex !== newIndex) {
context.setSubFocus(oldIndex)
}
focusData[sourceBaseDataField.FieldCode]._field_old_value_ = focusData[sourceBaseDataField.FieldCode].value
for (let i = 0; i < targetSubTableFieldList.length; i++) {
focusData[targetSubTableFieldList[i].FieldCode]._field_old_value_ = focusData[targetSubTableFieldList[i].FieldCode].value = baseDataList[i]
}
context.refreshSubDataRow(subTableObject.title)
}, (resp) => {
console.error(resp)
})
}
}
},
getCombBaseDataList(param, callBack, errorCallBack) {
GMS.$http.post("/rbcfunc/getCombBaseDataList", param).then(data => {
let baseDataList = data.data.data
let res = []
baseDataList.forEach(e => {
if (e instanceof Array) {
if (e.length > 0) {
res.push(e[0])
} else {
res.push(null)
}
} else {
res.push(e)
}
})
callBack(res)
}).catch((resp) => {
errorCallBack(resp)
});
},
getResultType: function () {
return FormulaConstants.resultType.anyType
},
}
......@@ -183,8 +183,8 @@ import EqualsMasterAndSubField from "./formula/EqualsMasterAndSubField";
import SubTableHasContainField from "./formula/SubTableHasContainField";
import GetUserStaffInfo from "./formula/GetUserStaffInfo";
import MdFilterInfiniteValue from "./formula/MdFilterInfiniteValue";
import SetSubFieldsByBaseData from "./formula/SetSubFieldsByBaseData";
import UpdateBillMoneyFunction from "./formula/UpdateBillMoneyFunction";
export default {
actions: {
updateFieldAction,
......@@ -276,6 +276,7 @@ export default {
formula: {
MdFilterInfiniteValue,
SubTableSetBaseData,
SetSubFieldsByBaseData,
LoginUserIsContianRole,
SubTableJointString,
GetSubTableRows,
......
......@@ -2,9 +2,7 @@ import mcon from './mcon';
import emcon from './emcon';
import './styles/common/normalize.less'
import Vue from 'vue';
// import ElementUI from 'element-ui';
import { Popover } from 'element-ui';
// import 'element-ui/lib/theme-chalk/index.css';
Vue.use(Popover)
export default {
install: function(){
......
/**
* 请求基础数据
* @param {string} tableName 基础数据表名
* @param {object} param 其他请求参数,如分页、检索等
*/
export const getBaseData = (tableName, param = {}) => {
let defaultParam = {
tableName: tableName,
pagination: false,
queryDataStructure: 'ALL_WITH_REF',
stopflag: -1,
authType: 'NONE',
}
defaultParam = {
...defaultParam,
...param,
}
if (param.limit || param.offset) {
defaultParam = {
limit: 10,
offset: 0,
...defaultParam,
pagination: true,
}
}
return window.GMS.$http.post(
'/baseData/data/list',
defaultParam
).then((res) => {
const result = res && res.data || {}
return result
})
}
\ No newline at end of file
......@@ -36,15 +36,15 @@
},
{
"name": "basedata-app",
"version": "1.0.39"
"version": "1.1.3"
},
{
"name": "basedata-item-auth-plugin",
"version": "1.0.1"
"version": "1.1.2"
},
{
"name": "basedata-rule-auth-plugin",
"version": "1.0.4"
"version": "1.1.2"
},
{
"name": "multi-language-config",
......@@ -179,4 +179,4 @@
}
]
}
}
}
\ No newline at end of file
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