This commit is contained in:
jiashuai 2025-09-17 10:20:15 +08:00
parent 346e1142fe
commit ac6d5375a6
17 changed files with 1613 additions and 30634 deletions

8
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CoolRequestCommonStatePersistent">
<option name="searchCache" value="src/purp/pp/supplierprice/list/events/batchEvents.js" />
</component>
</project>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="NCHomeConfig">
<option name="loginToken" value="" />
</component>
</project>

7
.idea/misc.xml Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ASMSmaliIdeaPluginConfiguration">
<asm skipDebug="true" skipFrames="true" skipCode="false" expandFrames="false" />
<groovy codeStyle="LEGACY" />
</component>
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/tk2312-web.iml" filepath="$PROJECT_DIR$/.idea/tk2312-web.iml" />
</modules>
</component>
</project>

12
.idea/tk2312-web.iml Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -1,10 +1,32 @@
{
"buildEntryPath": [
"./src/mmpac/mmpac/pmo/*/index.js",
"./src/mmpac/mmpac/pickm/*/index.js"
"./src/mmpac/mmpac/pickm/*/index.js",
"./src/mmpac/mmpac/pickm/*/*/index.js"
],
"buildEntryPath1": [
"./src/uapbd/refer/pub/*/index.js",
"./src/ic/ic/sapplybill/*/index.js",
"./src/uapbd/refer/pub/*/index.js",
"./src/arap/paybill/paybill/*/index.js",
"./src/sscrp/public/common/components/job-style/*/index.js",
"./src/ssctp/sscuser/sscapprove/*/index.js",
"./src/cmp/informer/SettlementCenter/*/index.js",
"./src/fbm/fbm/gather/*/index.js",
"./src/sscivm/invoiceSale/*/*/index.js",
"./src/sscivm/invoiceSale/*/*/invoiceSaleList.js",
"./src/sscivm/invoiceSale/*/*/invoiceSaleCard.js",
"./src/sscivm/invoiceApplication/invoiceApl/*/index.js",
"./src/mmpac/mmpac/pickm/*/index.js",
"./src/mmpac/mmpac/pickm/*/*/index.js",
"./src/purp/pp/supplierprice/*/index.js",
"./src/uapbd/mmbase/bom0202/*/index.js",
"./src/uapbd/material/material_grp/*/index.js",
"./src/pu/pu/buyingreq/*/index.js",
"./src/uapbd/mmbase/bom0202/*/index.js",
"./src/uapbd/material/material_grp/*/index.js"
],
"proxyJson": false,
"proxy": "http://127.0.0.1:8080/",
"proxy": "http://127.0.0.1:80/",
"buildWithoutHTML": [
"uap/refer",
"uapbd/refer"
@ -16,7 +38,7 @@
"department": "",
"project": "",
"branch": ""
} ,
},
"eslint": {
"path": [],
"enable": true,

31457
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,137 +1,126 @@
import { ajax, toast, base } from 'nc-lightapp-front';
let { NCModal, NCButton, NCTooltip, NCHotKeys } = base;
import { AREA, URL, DIALOGCODE, FIELD, PAGECARDCODE } from '../../constance';
import { initLang, getLangByResId } from '../../../../../mmpub/mmpub/pub/tool/multiLangUtil';
import PickmReplaceDlg from '../../pickmreplace/list';
import { RownoUtils } from '../../../../../mmpub/mmpub/pub/tool/cardTableTools';
import { buttonController } from '../viewController/index';
import { showSuccessInfo, showErrorInfo, showWarningInfo, showWarningDialog } from '../../../../../mmpub/mmpub/pub/tool/messageUtil';
import {ajax, base, toast} from 'nc-lightapp-front';
import {AREA, DIALOGCODE, FIELD, URL} from '../../constance';
import {getLangByResId} from '../../../../../mmpub/mmpub/pub/tool/multiLangUtil';
import {showWarningInfo} from '../../../../../mmpub/mmpub/pub/tool/messageUtil';
import PickmBorrowDlg from "../../pickmborrow/list";
const TABLE_HEAD = 'replace_head';
const TABLE_BODY = 'replace_body'
export default function replaceBtnClick(props, data) {
let {NCModal, NCButton, NCTooltip, NCHotKeys} = base;
const TABLE_HEAD = 'borrow_list';
export default function borrowBtnClick(props, record) {
let _this = this;
this.headDatas = [];
this.bodyDatas = {};
let setHeadDatas = (val) => {
this.headDatas = val;
};
let setBodyDatas = (val) => {
this.bodyDatas = val;
};
let getBodyDatas = () => {
return this.bodyDatas;
this.props = {};
let setProps = (val) => {
this.props = val;
}
this.replaceProps = {};
let setReplaceProps = (val) => {
this.replaceProps = val;
let bids = [];
let hid;
let rows = props.cardTable.getCheckedRows(AREA.bodyTable);
// 如果没有选中行,则提示并返回,不进行任何操作
if (!rows) {
return;
}
if (rows.length <= 0) {
hid = this.props.form.getFormItemsValue(AREA.formArea, FIELD.hid).value;
} else {
rows.map((item) => {
let cpickm_bid = props.cardTable.getValByKeyAndIndex(AREA.bodyTable, item.index, 'cpickm_bid').value;
bids.push(cpickm_bid);
});
}
let appcode = props.getAppCode();
let param = {
cpickmid: hid,
cpickmbids: bids,
pageid: DIALOGCODE.CLQUERYDLG,
appcode: appcode
}
ajax({
url: URL.replaceQueryURL,
url: URL.pickmItemsQuery,
data: param,
success: res => {
if (res.success && res.data) {
// let showdata = res.data;
let rows = res.data.data;
// console.log('bids = ', bids);
/*let rows1 = [];
rows.map((item) => {
let values = item.data.values;
// 借料数量 = 计划出库数量-累计出库数量-累计发货数量-累计委外数量所有数值用getNumber处理null转0
values.borrowedQty = {
value: getNumber(values.nplanoutastnum) - getNumber(values.naccoutastnum) -
getNumber(values.nshouldastnum) - getNumber(values.npscastnum)
};
let form = props.form.getAllFormValue(AREA.formArea);
values.cmaterialvid = form.rows[0].values["cmaterialvid"];
values.cmaterialvidName = {
value: form.rows[0].values["cmaterialvid.name"].value
};
if (undefined != form.rows[0].values["cmaterialvid.def26"]) {
values.cmaterialvidDef26 = {
value: form.rows[0].values["cmaterialvid.def26"].value
};
}
let rowItem = {
isOptimized: false,
status: '0',
values: values
};
// 确保 bids 是数组类型
if (!Array.isArray(bids)) {
bids = [bids];
}
if (values.cpickm_bid && values.cpickm_bid.value && (bids.indexOf(values.cpickm_bid.value) > -1) && values.borrowedQty.value > 0) {
rows1.push(rowItem);
}
});*/
props.modal.show('BorrowDlg', {
size: 'max',
title: getLangByResId(this, '5008Pickm-000093'),/* 国际化处理: 替代*/
content: <PickmBorrowDlg showdata={rows}
setProps={setProps}/>,
userControl: true,
// leftBtnName: '',
// rightBtnName: getLangByResId(this, '5008Pickm-000013'),/* 国际化处理: 取消*/
beSureBtnClick: oKBtnClicks.bind(this, props, true),
cancelBtnClick: () => {
props.modal.close('BorrowDlg');
}
});
}
}
});
}
function oKBtnClicks(props) {
let rowids = [];
let hids = [];
let hid;
let rows = props.table.getCheckedRows(AREA.borrowMaterialDialog);
hid = props.form.getFormItemsValue(AREA.formArea, FIELD.hid).value;
hids.push(hid);
// 如果没有选中行,则提示并返回,不进行任何操作
if (!rows || rows.length <= 0) {
showWarningInfo('请选择行');
return;
}
for (let i = 0; i < rows.length; i++) {
rowids.push(rows[i].data.values.cpickm_bid.value);
}
let data = {
cpickmids: hids,
cpickmbids: rowids
}
console.log('data = ', data);
ajax({
url: URL.pickmItemsQuery,
data: data,
success: res => {
if (res.success && res.data) {
props.modal.show('ReplaceDlg', {
size: 'xlg',
title: getLangByResId(this, '5008Pickm-000093'),/* 国际化处理: 替代*/
content: <PickmReplaceDlg showdata={res.data} setHeadDatas={setHeadDatas} setBodyDatas={setBodyDatas} getBodyDatas={getBodyDatas} setReplaceProps={setReplaceProps} />,
userControl: true,
leftBtnName: '',
rightBtnName: getLangByResId(this, '5008Pickm-000013'),/* 国际化处理: 取消*/
beSureBtnClick: replaceOKBtnClicks.bind(this, props, true),
cancelBtnClick: () => {
props.modal.close('ReplaceDlg');
},
showCustomBtns: true,
customBtns: <div><NCButton fieldid="autoMatch" onClick={() => { autoMatchBtnClick.call(this, props) }}>{getLangByResId(this, '5008Pickm-000103')}</NCButton>
<NCTooltip
placement="top"
inverse
overlay={`${getLangByResId(this, '5008Pickm-000102')} (${NCHotKeys.USUAL_KEYS.NC_MODAL_CONFIRM})`}
trigger={['hover', 'focus']}
className="model-helper-overlay"
>
<NCButton fieldid="confirm" colors="primary" onClick={() => {
replaceOKBtnClicks.call(this, props, true);
}}>{getLangByResId(this, '5008Pickm-000102')}(<u>Y</u>)</NCButton>{/* */}
</NCTooltip>
<NCTooltip
placement="top"
inverse
overlay={`${getLangByResId(this, '5008Pickm-000013')} (${NCHotKeys.USUAL_KEYS.NC_MODAL_CALCEL})`}
trigger={['focus', 'hover']}
className="model-helper-overlay"
>
<NCButton fieldid="cancel" onClick={() => {
props.modal.close('ReplaceDlg');
}}>{getLangByResId(this, '5008Pickm-000013')}(<u>N</u>)</NCButton>{/* */}
</NCTooltip></div>,
hideRightBtn: false, //隐藏足部右边的按钮默认是false不隐藏隐藏是true
hideLeftBtn: false //隐藏足部左边的按钮默认是false不隐藏隐藏是true
});
}
}
});
}
function autoMatchBtnClick(props) {
let repBodys = {};
let repHeads = this.replaceProps.editTable.getAllRows('replace_head');
let pickmbid;
let headbid = repHeads[0].values.cpickm_bid.value;
let bodys = [];
repHeads.forEach((head) => {
pickmbid = head.values.cpickm_bid.value;
if (this.bodyDatas && this.bodyDatas[pickmbid]) {
bodys = [];
this.bodyDatas[pickmbid].forEach((item) => {
bodys.push(item);
});
if (bodys.length > 0) {
repBodys[pickmbid] = JSON.stringify({
pageid: DIALOGCODE.REPLACEDLG,
model: {
areaType: "table",
pageinfo: null,
rows: bodys,
areacode: 'replace_body'
}
});
}
}
});
let param = {
pageid: PAGECARDCODE,
repHeads: JSON.stringify({
pageid: DIALOGCODE.REPLACEDLG,
model: {
areaType: "table",
pageinfo: null,
rows: repHeads,
areacode: 'replace_head',
}
}),
repBodys: repBodys
}
ajax({
url: URL.replaceAutoMatchURL,
data: param,
success: res => {
if (res.success && res.data) {
this.bodyDatas = res.data.body;
this.replaceProps.setBodyDatas(res.data.body)
this.replaceProps.setHeadDatas( res.data.head[TABLE_HEAD]);
this.replaceProps.editTable.setTableData(TABLE_HEAD, { rows: res.data.head[TABLE_HEAD].rows });
let bodys = [];
if (res.data.body[headbid]) {
bodys = res.data.body[headbid]
}
this.replaceProps.editTable.setTableData(TABLE_BODY, { rows: bodys });
if (res.data.msg) {
showWarningInfo(res.data.msg);
}
else{
showSuccessInfo(getLangByResId(this, '5008Pickm-000104'));
if (res.success) {
toast({color: 'success', title: "推送成功"});
this.props.modal.close(AREA.borrowMaterialDialog);
}
}
},
@ -141,129 +130,76 @@ function autoMatchBtnClick(props) {
content: error.message
});
}
});
}
function replaceOKBtnClicks(props, flag) {
let repHeads = [];
let repBodys = {};
let bodys = [];
let mainIds = [];
let heads = this.replaceProps.editTable.getAllRows('replace_head');
if (heads) {
let pickmbid;
heads.forEach((head) => {
pickmbid = head.values.cpickm_bid.value;
if (this.bodyDatas && this.bodyDatas[pickmbid]) {
bodys = [];
this.bodyDatas[pickmbid].forEach((item) => {
if (item.values.rep_repnum && item.values.rep_repnum.value && item.values.rep_repnum.value > 0) {
bodys.push(item);
}
});
if (bodys.length > 0) {
mainIds.push(pickmbid);
repHeads.push(head);
repBodys[pickmbid] = JSON.stringify({
pageid: DIALOGCODE.REPLACEDLG,
model: {
areaType: "table",
pageinfo: null,
rows: bodys,
areacode: 'replace_body'
}
});
}
}
});
}
if (repHeads.length < 1) {
props.modal.close('ReplaceDlg');
return;
}
let bodyData = props.cardTable.getAllRows(AREA.bodyTable);
let oldReplaces=[];
let rownos=[];
bodyData.map((item, i) => {
if(item.values.vrowno && item.values.vrowno.value){
rownos.push(item.values.vrowno.value);
}
if (item.values.creplacesrcid && item.values.creplacesrcid.value && mainIds.includes(item.values.creplacesrcid.value)) {
oldReplaces.push(item);
}
});
let param = {
pageid: PAGECARDCODE,
isCheckAtp: flag,
repHeads: JSON.stringify({
pageid: DIALOGCODE.REPLACEDLG,
model: {
areaType: "table",
pageinfo: null,
rows: repHeads,
areacode: 'replace_head',
}
}),
repBodys: repBodys,
rownos:rownos,
oldRepBodys:JSON.stringify({
pageid: PAGECARDCODE,
model: {
areaType: "table",
pageinfo: null,
rows: oldReplaces,
areacode: AREA.bodyTable,
}
})
}
function doQuery(props, hid, bids, rows) {
let appcode = props.getAppCode();
ajax({
url: URL.replaceDoURL,
data: param,
success: res => {
if (res.success && res.data) {
if (res.data && res.data.isAtpCheckResume && res.data.isAtpCheckResume == true) {
showWarningDialog(getLangByResId(this, '5008Pickm-000001')/* 国际化处理: 提示*/, res.data.atpCheckMsg
, {
beSureBtnClick: replaceOKBtnClicks.bind(this, props, false)
});
return;
}
props.modal.close('ReplaceDlg');
let len=props.cardTable.getNumberOfRows(AREA.bodyTable);
let cpcikmbid;
let updateArray = [];
let indexs=[];
let repItem={};
for (let i = 0; i < len; i++) {
cpcikmbid=props.cardTable.getValByKeyAndIndex(AREA.bodyTable,i,'cpickm_bid');
if(cpcikmbid&&cpcikmbid.value&&res.data[cpcikmbid.value]){
let obj = { index: i, data: res.data[cpcikmbid.value].mainItem };
updateArray.push(obj);
repItem[i]=res.data[cpcikmbid.value].repItems;
indexs.push(i);
}
}
if (updateArray.length > 0) {
props.cardTable.updateDataByIndexs(AREA.bodyTable, updateArray);
for(let j=indexs.length-1;j>=0;j--){
props.cardTable.insertRowsAfterIndex(AREA.bodyTable,repItem[indexs[j]],indexs[j]);
}
RownoUtils.setRowNo(props, AREA.bodyTable, FIELD.vrowno);
props.cardTable.selectAllRows(AREA.bodyTable, false);
props.cardTable.setAllCheckboxAble(AREA.bodyTable, true);
buttonController.lineSelected.call(this);
}
}
url: '/nccloud/mmpac/pickm/pickmItemsQuery.do',
data: {
cpickmid: hid,
cpickmbids: bids,
pageid: DIALOGCODE.CLQUERYDLG,
appcode: appcode
},
error: (error) => {
toast({
color: 'warning',
content: error.message
});
success: res => {
let bids = res.data.data;
// console.log('bids = ', bids);
let rows1 = [];
rows.map((item) => {
let values = item.data.values;
// 借料数量 = 计划出库数量-累计出库数量-累计发货数量-累计委外数量所有数值用getNumber处理null转0
values.borrowedQty = {
value: getNumber(values.nplanoutastnum) - getNumber(values.naccoutastnum) -
getNumber(values.nshouldastnum) - getNumber(values.npscastnum)
};
let def26 = this.props.form.getFormItemsValue(AREA.formArea, "cmaterialvid").value;
// let def27 = this.props.form.getFormItemsValue(AREA.formArea,"cmaterialvid.name").value;
let form = this.props.form.getAllFormValue(AREA.formArea);
values.cmaterialvid = form.rows[0].values["cmaterialvid"];
values.cmaterialvidName = {
value: form.rows[0].values["cmaterialvid.name"].value
};
if (undefined != form.rows[0].values["cmaterialvid.def26"]) {
values.cmaterialvidDef26 = {
value: form.rows[0].values["cmaterialvid.def26"].value
};
}
let rowItem = {
isOptimized: false,
status: '0',
values: values
};
// 确保 bids 是数组类型
if (!Array.isArray(bids)) {
bids = [bids];
}
// 筛选出未生成的行
// console.log('values.cpickm_bid = ', values.cpickm_bid.value);
// console.log('values.indexOf = ', bids.indexOf(values.cpickm_bid.value));
if (values.cpickm_bid && values.cpickm_bid.value && (bids.indexOf(values.cpickm_bid.value) > -1) && values.borrowedQty.value > 0) {
rows1.push(rowItem);
}
});
let data = {
areacode: 'clquery',
rows: rows1
};
// console.log('rows = ', rows);
// console.log('data = ', data);
props.table.setAllTableData(AREA.borrowMaterialDialog, data);
props.modal.show(AREA.borrowMaterialDialog);
}
});
}
// 本地安全数值转换方法null/undefined/空对象转0
function getNumber(data) {
if (data && data.value != null) {
return +data.value;
} else {
return 0;
}
}

View File

@ -272,6 +272,7 @@ class PickmCard extends Component {
{createModal('TakeOverDlg', {zIndex: "300"})}
{createModal('SetBackDeliverDlg', {zIndex: "280"})}
{createModal('ReplaceDlg', {zIndex: "300"})}
{createModal('BorrowDlg', {zIndex: "300"})}
{createModal(AREA.borrowMaterialDialog, {
title: '借料入库明细',

View File

@ -42,6 +42,7 @@ import {pickmTakeOver} from '../../../pub/pickmtakeover';
import {getLangByResId} from '../../../../../mmpub/mmpub/pub/tool/multiLangUtil';
import {pickmBackDeliverWithSet} from '../../../pub/pickmbackdeliverwithset';
import {toast} from "../../../../../gl/public/components/utils";
import borrowBtnClick from "../btnClicks/borrowBtnClick";
export default async function clickBtn(props, id, text, record, index) {
let _this = this;
@ -818,33 +819,11 @@ export default async function clickBtn(props, id, text, record, index) {
showWarningInfo(getLangByResId(this, '5008Pickm-000061'));
return;
}
// console.log('selectRows = ', selectRows);
// 判断选中行的借料数量是否>0,如果存在<=0的行则提示并返回
let hasInvalidRow = false;
let warningMessage = getLangByResId(this, '5008Pickm-000106'); /* 国际化处理: 借料数量必须大于0*/
// for (const item of selectRows) {
// let values = item.data.values;
// // 借料数量 = 计划出库数量-累计出库数量-累计发货数量-累计委外数量
// let borrowedQty = getNumber(values.nplanoutastnum) - getNumber(values.naccoutastnum) -
// getNumber(values.nshouldastnum) - getNumber(values.npscastnum);
// if (borrowedQty <= 0) {
// hasInvalidRow = true;
// // 获取行号用于提示信息
// let vrowno = props.cardTable.getValByKeyAndIndex(AREA.bodyTable, item.index, 'vrowno');
// warningMessage = warningMessage + ' 行号:' + `[${vrowno.value}]`;
// break;
// }
// }
// if (hasInvalidRow) {
// showErrorInfo('错误', warningMessage);
// return;
// }
billstatus = props.form.getFormItemsValue(AREA.formArea, 'fbillstatus');
//审批态
if (billstatus && billstatus.value && billstatus.value == 1) {
detailqueryBtnClick.call(this, this.props, record);
// detailqueryBtnClick.call(this, this.props, record);
borrowBtnClick.call(this, this.props, record);
} else {
toast({color: 'warning', title: "只有审批后单据才能生产其他入库单"});
}

View File

@ -10,7 +10,8 @@ const AREA = {
cardHeadBtnArea: 'card_head', //卡片表头按钮区域
cardBodyBtnArea: 'card_body', //卡片表体按钮区域
cardBodyInnerBtnArea: 'card_body_inner', //卡片表体操作按钮区域
borrowMaterialDialog: 'NCTable_83c3abf9' //借料弹窗
borrowMaterialDialog: 'NCTable_83c3abf9', //借料弹窗
borrowList: 'borrow_list' //借料弹窗
};
const MANUFACTURE = 'fa';//製造場景
@ -23,7 +24,8 @@ const DIALOGCODE = {
BACKDELIVERDLG: '50080102_backdeliver',
SETBACKDELIVERDLG: '50080102_backdeliverwithset',
TAKEOVERDLG: '50080102_takeover',
REPLACEDLG: '50080102_replace'
REPLACEDLG: '50080102_replace',
BORROWDLG: '50080102_borrow'
}
const LIST_BTN = {

View File

@ -1,5 +1,3 @@
import headBeforeEvent from './headBeforeEvent';
import headAfterEvent from './headAfterEvent';
import bodyAfterEvent from './bodyAfterEvent';
import bodyBeforeEvent from './bodyBeforeEvent';
export { headBeforeEvent,headAfterEvent,bodyAfterEvent, bodyBeforeEvent };
export { headBeforeEvent,headAfterEvent };

View File

@ -1,20 +1,18 @@
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import { createPage, ajax, base, high } from 'nc-lightapp-front';
const { Refer } = high;
import { initTemplate } from './init';
import { initLang, getLangByResId } from '../../../../../mmpub/mmpub/pub/tool/multiLangUtil';
import { headAfterEvent, headBeforeEvent, bodyAfterEvent, bodyBeforeEvent } from './events';
import { AREA, URL, DIALOGCODE, FIELD, PAGECARDCODE } from '../../constance';
const { NCModal } = base;
const TABLE_HEAD = 'replace_head';
const TABLE_BODY = 'replace_body'
import React, {Component} from 'react';
import {base, createPage, high} from 'nc-lightapp-front';
import {initTemplate} from './init';
import {initLang} from '../../../../../mmpub/mmpub/pub/tool/multiLangUtil';
import {headAfterEvent} from './events';
import {DIALOGCODE} from "../../constance";
class PickmReplaceDlg extends Component {
const {Refer} = high;
const {NCModal} = base;
const TABLE_HEAD = 'borrow_list';
class PickmBorrowDlg extends Component {
constructor(props) {
super(props);
props.use.editTable(TABLE_HEAD);
props.use.editTable(TABLE_BODY);
this.state = {
totalRepNum: {}
};
@ -24,124 +22,39 @@ class PickmReplaceDlg extends Component {
componentDidMount() {
this.initData();
}
//请求列表数据
initData = () => {
let showdata = this.props.showdata;
let heads = [];
let bodys = [];
if (showdata && showdata.head) {
heads = showdata.head[TABLE_HEAD].rows;
if (showdata.body) {
bodys = showdata.body[TABLE_BODY].rows;
}
let cpickmbid = showdata.head[TABLE_HEAD].rows[0].values.cpickm_bid.value;
let bodyData = {};
bodyData[cpickmbid] = bodys;
this.setState({
bodyDatas: bodyData
});
}
this.props.editTable.setTableData(TABLE_HEAD, { rows: heads });
this.props.editTable.setTableData(TABLE_BODY, { rows: bodys });
this.props.setReplaceProps(this.props);
this.props.editTable.setTableData(TABLE_HEAD, showdata);
this.props.setProps(this.props);
};
onRowClick = (props, moduleId, record, index, e) => {
this.loadBodyInfo(props, record, index);
}
loadBodyInfo(props, record, index) {
let bodyData = this.props.getBodyDatas();
let cpickmbid = this.props.editTable.getValByKeyAndIndex(TABLE_HEAD, index, 'cpickm_bid');
let bodys = [];
let totalRepNum = this.state.totalRepNum;
if (bodyData && bodyData[cpickmbid.value]) {
let cmatreilvid;
let devOrg;
bodys = bodyData[cpickmbid.value];
if (bodys && bodys.length > 0) {
bodys.forEach(body => {
cmatreilvid = body.values.cbmaterialvid.value;
devOrg = body.values.cdeliverorgid.value;
if (totalRepNum && totalRepNum[devOrg + cmatreilvid]) {
body.values.rep_totalrepnum = totalRepNum[devOrg + cmatreilvid].num;
body.values.rep_totalrepastnum = totalRepNum[devOrg + cmatreilvid].astNum;
}
});
}
this.props.editTable.setTableData(TABLE_BODY, { rows: bodys });
}
else {
let userjson = {};
if (totalRepNum) {
Object.keys(totalRepNum).forEach(key => {
userjson[key] = totalRepNum[key].num.value;
})
}
let param = {
pageid: DIALOGCODE.REPLACEDLG,
model: {
areaType: "table",
pageinfo: null,
rows: [record],
areacode: TABLE_HEAD,
},
userjson: JSON.stringify(
userjson
)
};
ajax({
url: URL.replaceBodyQueryURL,
data: param,
success: res => {
if (res.success) {
if (res.data) {
bodys = res.data[TABLE_BODY].rows;
}
bodyData[cpickmbid.value] = bodys;
this.props.editTable.setTableData(TABLE_BODY, { rows: bodys });
}
}
});
}
}
onRowDoubleClick = (record, index, props, e) => {
this.loadBodyInfo(props, record, index);
}
render() {
let { editTable } = this.props;
let { createEditTable } = editTable;
return <div class="flex-container" style={{ height: '100%' }}>
let {editTable} = this.props;
let {createEditTable} = editTable;
return <div class="flex-container" style={{height: '100%'}}>
<div className='flex-container'>
{createEditTable(TABLE_HEAD, {
showIndex: true,
// height: 100,
onRowClick: this.onRowClick.bind(this),
onRowDoubleClick: this.onRowDoubleClick.bind(this),
onBeforeEvent: headBeforeEvent.bind(this),
// onRowClick: this.onRowClick.bind(this),
// onRowDoubleClick: this.onRowDoubleClick.bind(this),
// onBeforeEvent: headBeforeEvent.bind(this),
onAfterEvent: headAfterEvent.bind(this),
isAddRow: false,
showCheck: false
})}
</div>
<div className='flex-container'>
{createEditTable(TABLE_BODY, {
onBeforeEvent: bodyBeforeEvent.bind(this),
onAfterEvent: bodyAfterEvent.bind(this),
showCheck: false,
showIndex: true,
hideAdd: false,
adaptionHeight: true
})}
</div>
</div>;
}
}
PickmReplaceDlg = createPage({
PickmBorrowDlg = createPage({
billinfo: {
billtype: 'grid',
pagecode: '50080102_replace',
bodycode: 'replace_body'
pagecode: DIALOGCODE.BORROWDLG
}//,
})(PickmReplaceDlg);
})(PickmBorrowDlg);
export default PickmReplaceDlg;
export default PickmBorrowDlg;

View File

@ -1,7 +1,7 @@
import { DIALOGCODE } from '../../../constance';
import { getLangByResId } from '../../../../../../mmpub/mmpub/pub/tool/multiLangUtil';
const TABLE_HEAD = 'replace_head';
const TABLE_BODY = 'replace_body'
const TABLE_HEAD = 'borrow_list';
export default function (props) {
let appcode = props.getAppCode();
if (props.getAppCode().startsWith('5009')) {
@ -14,15 +14,15 @@ export default function (props) {
props.createUIDom(
{
appcode: appcode,
pagecode: DIALOGCODE.REPLACEDLG
pagecode: DIALOGCODE.BORROWDLG
},
(templedata) => {
if (templedata.template) {
let meta = templedata.template;
modifierMeta.call(this, this.props, meta);
// modifierMeta.call(this, this.props, meta);
props.meta.setMeta(meta);
props.editTable.setStatus(TABLE_HEAD, 'edit');
props.editTable.setStatus(TABLE_BODY, 'edit');
// props.editTable.setStatus(TABLE_BODY, 'edit');
}
});
}

View File

@ -39,7 +39,7 @@ const headKeys = ['pk_org', 'pk_customer', 'gmf_zh', 'pk_customer_v', 'gmf_dz',
* def1:合同销售订单编号
*/
const bodyKeys = ['xmdj', 'sl', 'xmje', 'se', 'xmsl', 'xmjshj', 'pk_materiel',
'zkje', 'fphxz', 'taxcode', 'spbm', 'sl', 'xmjshj', 'def1'];
'zkje', 'fphxz', 'taxcode', 'spbm', 'sl', 'def1'];
export default function (moduleId, key, value, changedrows, index, record) {
// console.log('valueChange', moduleId, key, value, changedrows, index);
@ -48,9 +48,9 @@ export default function (moduleId, key, value, changedrows, index, record) {
(moduleId == presetVar.bodyAreaId && bodyKeys.indexOf(key) > -1)) {
hasChange = true;
}
// if (bodyKeys.includes(key)) {
// debugger;
// }
/*if (bodyKeys.includes(key)) {
debugger;
}*/
if (hasChange) {
// 取得表头数据
let headBodyData;
@ -72,7 +72,9 @@ export default function (moduleId, key, value, changedrows, index, record) {
checkrule: 'true',
templateid: this.props.meta.getMeta().pageid
}
// console.log('sendData = ', sendData);
if (key == 'xmjshj') {
console.log('sendData = ', sendData);
}
requestApi.valueChange({
data: sendData,
success: (data) => {