|
|
@@ -16,7 +16,7 @@ import {TabulatorFull as Tabulator} from "tabulator-tables"; //import Tabulator
|
|
|
import './Tabulator.css';
|
|
|
import {extractFuzhu, match_target} from './utils';
|
|
|
import Button from '@mui/material/Button';
|
|
|
-import {shanchu_djcs, undo_djcs, redo_djcs, danxiangdinge_djcs, updateDercj_djcs, changguidinge_djcs, handleBeizhu_djcs, huan, updateShuliang_djcs} from './editor';
|
|
|
+import {shanchu_djcs, undo_djcs, redo_djcs, danxiangdinge_djcs, updateDercj_djcs, changguidinge_djcs, handleBeizhu_djcs, huan, updateShuliang_djcs, azfy_djcs_eligible, azfy_djcs} from './editor';
|
|
|
import {copy} from './utils';
|
|
|
|
|
|
const {Column, HeaderCell, Cell} = Table;
|
|
|
@@ -28,7 +28,7 @@ function number_equal(a, b) {
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
-export default function Djcs3({name, bh, rgde, jxde, clde, beizhu, beizhuFK, clickCallback, loadingCallback, dingeclick}) {
|
|
|
+export default function Djcs3({name, bh, rgde, jxde, clde, beizhu, beizhuFK, clickCallback, loadingCallback, dingeclick, azfycallback, azfySelect, azfyConfirm}) {
|
|
|
|
|
|
|
|
|
var editCheck = function(cell){
|
|
|
@@ -55,6 +55,9 @@ export default function Djcs3({name, bh, rgde, jxde, clde, beizhu, beizhuFK, cli
|
|
|
if (cell._cell.row.getData()['人材机编码'] == '31130104') {//
|
|
|
return false;
|
|
|
}
|
|
|
+ if (cell._cell.row.getData()['人材机编码'].includes('000FE')) {//
|
|
|
+ return false;
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
@@ -315,7 +318,7 @@ export default function Djcs3({name, bh, rgde, jxde, clde, beizhu, beizhuFK, cli
|
|
|
};
|
|
|
|
|
|
const highlight = React.useRef([]);
|
|
|
-
|
|
|
+ //const [azfyDe, setAzfyDe] = React.useState(null);
|
|
|
|
|
|
const rgdeRef = React.useRef(null);
|
|
|
const jxdeRef = React.useRef(null);
|
|
|
@@ -489,6 +492,43 @@ export default function Djcs3({name, bh, rgde, jxde, clde, beizhu, beizhuFK, cli
|
|
|
beizhuFKRef.current = beizhuFK;
|
|
|
}, [beizhuFK]
|
|
|
);
|
|
|
+
|
|
|
+ React.useEffect(
|
|
|
+ () => {
|
|
|
+ console.log(dingeclick);
|
|
|
+ console.log(azfySelect);
|
|
|
+ if (dingeclick != null && selectedRowKeysTable.current != null && azfy_djcs_eligible(selectedRowKeysTable.current[0])) {
|
|
|
+ const [success, data, key] = azfy_djcs(selectedRowKeysTable.current[0], dingeclick, azfySelect);
|
|
|
+ myTable.current.deselectRow();
|
|
|
+
|
|
|
+ myTable.current.updateData(data.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function(){
|
|
|
+ let getRow = myTable.current.getRows(); //get array of currently selected row components.
|
|
|
+ let component = null;
|
|
|
+ for(let i = 0; i < getRow.length; i++) {
|
|
|
+ let entry = getRow[i]._row.modules.dataTree.children;
|
|
|
+ for(let j = 0; j < entry.length; j++) {
|
|
|
+ let child = entry[j];
|
|
|
+ if(child.data['key'] == key) {
|
|
|
+ //console.log(child);
|
|
|
+ component = child.component;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ component.select();
|
|
|
+ handleSelect(component);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }, [azfyConfirm]
|
|
|
+ );
|
|
|
|
|
|
React.useEffect(
|
|
|
() => {
|
|
|
@@ -574,6 +614,7 @@ export default function Djcs3({name, bh, rgde, jxde, clde, beizhu, beizhuFK, cli
|
|
|
dataTree: false,
|
|
|
selectableRows:1, //make rows selectable
|
|
|
editTriggerEvent:"dblclick",
|
|
|
+ renderVertical: "basic",
|
|
|
|
|
|
columns: [ //Define Table Columns
|
|
|
{title:"ID", field:"ID", width:80, headerSort:false, },
|
|
|
@@ -586,7 +627,7 @@ export default function Djcs3({name, bh, rgde, jxde, clde, beizhu, beizhuFK, cli
|
|
|
{title:"供应厂商", field:"供应厂商", width:80, headerSort:false, },
|
|
|
{title:"人材机类别", field:"人材机类别", width:120, headerSort:false, },
|
|
|
{title:"甲供标志", field:"甲供标志", width:80 , headerSort:false, formatter:"textarea"},
|
|
|
- {title:"含量", field:"含量", width:80 , headerSort:false, formatter:"money", formatterParams:{precision:4}, editor: "input", editable: editCheckRcj },
|
|
|
+ {title:"含量", field:"含量", width:120 , headerSort:false, formatter:"money", formatterParams:{precision:4}, editor: "input", editable: editCheckRcj },
|
|
|
{title:"合价", field:"合价", width:80 , headerSort:false, formatter:"money"},
|
|
|
{title:"暂估价标志", field:"暂估价标志", width:80 , headerSort:false, formatter:"textarea"},
|
|
|
{title:"主要材料标志", field:"主要材料标志", width:100 , headerSort:false, formatter:"textarea"},
|
|
|
@@ -646,9 +687,26 @@ export default function Djcs3({name, bh, rgde, jxde, clde, beizhu, beizhuFK, cli
|
|
|
React.useEffect(
|
|
|
() => {
|
|
|
let input = JSON.parse(dingeclick);
|
|
|
- myTable.current.deselectRow();
|
|
|
- //console.log(dingeclick);
|
|
|
- if (selectedRowKeysTable.current.length > 0 ) {
|
|
|
+ if (input == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!input.hasOwnProperty("DEBH")) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let bh_ = Object.values(input['DEBH'])[0];
|
|
|
+ if (bh_.includes('-F')) {
|
|
|
+ if (selectedRowKeysTable.current.length > 0 ) {
|
|
|
+ if (azfy_djcs_eligible(selectedRowKeysTable.current[0])) {
|
|
|
+ //setAzfyDe(input);
|
|
|
+ azfycallback(bh, input);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ myTable.current.deselectRow();
|
|
|
+ //console.log(dingeclick);
|
|
|
+ if (selectedRowKeysTable.current.length > 0 ) {
|
|
|
const [success, data, key] = changguidinge_djcs(input, selectedRowKeysTable.current[0]);
|
|
|
if (success) {
|
|
|
myTable.current.updateData(data.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function(){
|
|
|
@@ -675,7 +733,10 @@ export default function Djcs3({name, bh, rgde, jxde, clde, beizhu, beizhuFK, cli
|
|
|
|
|
|
});
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}, [dingeclick]//常规添加定额
|
|
|
);
|