开票申请卡片批量粘贴编辑事件
This commit is contained in:
parent
7c09aa7e66
commit
ffdba003e4
|
@ -0,0 +1,113 @@
|
|||
/*
|
||||
* @Author: mzr
|
||||
* @PageInfo: 开票申请卡片批量粘贴编辑事件
|
||||
* @Date: 2025-05-07 16:30:44
|
||||
* @Last Modified by: mzr
|
||||
* @Last Modified time: 2025-05-07 16:30:44
|
||||
*/
|
||||
import valueChange from "../common/valueChange";
|
||||
|
||||
const BATCHITEM = [
|
||||
'spbm', // 税收分类编码
|
||||
'def1', // 合同销售订单编号
|
||||
'xmmc', //商品名称
|
||||
'ggxh', //规格型号
|
||||
'dw', //单位
|
||||
'xmsl', //商品数量
|
||||
'xmdj', //商品单价
|
||||
'xmje', //无税金额
|
||||
'sl', //税率
|
||||
'se', //税额
|
||||
'xmjshj' //价税合计
|
||||
];
|
||||
|
||||
export default async function batchEvents(obj) {
|
||||
console.log(obj);
|
||||
let areaCode = obj.areaCode; //区域编码
|
||||
let column = obj.column; //列信息
|
||||
let newValue = obj.newValue; //变更的行信息
|
||||
let queryValue = [];
|
||||
let changedrows = obj.changedrows; //变更的信息,仅包含newValue和OldValue
|
||||
let currentIndex = obj.currentIndex; //当前行
|
||||
let indexs = [];
|
||||
let rows = [];
|
||||
let attrcode = column.attrcode; //列code
|
||||
let queryCondition; //统一过滤的过滤条件
|
||||
let isManyCondition = null; //是否多个过滤条件
|
||||
let pasteData = obj.pasteData; //粘贴的值
|
||||
|
||||
if (!BATCHITEM.includes(attrcode)) {
|
||||
return;
|
||||
}
|
||||
if (attrcode == 'def1') {
|
||||
for (let i = 0; i < newValue.length; i++) {
|
||||
//如果需求组织没有值就不允许编辑
|
||||
if (!(newValue[i].values.pk_reqstoorg && newValue[i].values.pk_reqstoorg.value)) {
|
||||
continue;
|
||||
}
|
||||
queryValue.push(newValue[i]);
|
||||
indexs[i] = currentIndex + i;
|
||||
rows[i] = [i];
|
||||
|
||||
queryValue[i].queryCondition = {
|
||||
pk_org: newValue[i].values.pk_reqstoorg.value,
|
||||
// busifuncode: FIELD.STOCKORG,
|
||||
GridRefActionExt: 'nccloud.web.pu.order.ref.RequestWarehouseBodyRefFilter'
|
||||
};
|
||||
}
|
||||
isManyCondition = true;
|
||||
}
|
||||
|
||||
// NCC-231904
|
||||
if (queryValue == null || queryValue.length == 0) {
|
||||
return;
|
||||
}
|
||||
this.props.cardTable
|
||||
.updateAfterBatchChange({
|
||||
areaCode,
|
||||
column,
|
||||
indexs,
|
||||
queryValue,
|
||||
changedrows,
|
||||
pasteData,
|
||||
queryCondition,
|
||||
isManyCondition
|
||||
})
|
||||
.then((res) => {
|
||||
let props = res.props;
|
||||
changedrows = res.changedrows;
|
||||
indexs = res.indexs;
|
||||
|
||||
//执行业务的批量编辑后事件
|
||||
// valueChange.call(props, moduleId, key, newValue);
|
||||
valueChange.call(props, moduleId, key, null, changedrows, index);
|
||||
/*let data = createBodyAfterEventData4BatchMore(
|
||||
props,
|
||||
PAGECODE.cardcode,
|
||||
PAGECODE.cardhead,
|
||||
[PAGECODE.cardbody, PAGECODE.card_fee],
|
||||
areaCode,
|
||||
attrcode,
|
||||
changedrows,
|
||||
indexs
|
||||
);
|
||||
ajax({
|
||||
url: '/nccloud/pu/poordercard/cardbodyafterevent.do', //卡片表体编辑后事件
|
||||
data: data,
|
||||
async: false,
|
||||
success: (res) => {
|
||||
if (res.formulamsg && res.formulamsg instanceof Array && res.formulamsg.length > 0) {
|
||||
props.dealFormulamsg(
|
||||
res.formulamsg, //参数一:返回的公式对象
|
||||
{
|
||||
[PAGECODE.head_payment]: 'cardTable',
|
||||
[PAGECODE.cardbody]: 'cardTable'
|
||||
}
|
||||
);
|
||||
}
|
||||
processExtBillCardBodyEditResult4Batch(props, PAGECODE.cardbody, res.data, indexs);
|
||||
this.forceUpdate();
|
||||
}
|
||||
});*/
|
||||
});
|
||||
}
|
|
@ -13,6 +13,7 @@ import headBtnClick from "./events/headBtnClick"
|
|||
import headAfterEvent from "./events/headAfterEvent"
|
||||
import bodyAfterEvent from "./events/bodyAfterEvent"
|
||||
import bodyBeforeEvent from './events/bodyBeforeEvent'
|
||||
import batchEvents from './events/batchEvents'
|
||||
import backBtnClick from "./events/backBtnClick"
|
||||
import handlePageInfoChange from './events/handlePageInfoChange'
|
||||
import save from './events/headBtnEvents/save'
|
||||
|
@ -311,6 +312,7 @@ class InvoiceCard extends Component {
|
|||
hideAdd={this.state.hideAdd}
|
||||
hideDel={this.state.hideDel}
|
||||
modelDelRow={this.modelDelRow}
|
||||
onBatchChange={() => { batchEvents.call(this) }}
|
||||
>
|
||||
<ButtonGroupListCard
|
||||
areaId={presetVar.cardBodyBtnAreaId}
|
||||
|
|
Loading…
Reference in New Issue