|
|
@@ -7,6 +7,9 @@ import Paper from '@mui/material/Paper';
|
|
|
import TextField from '@mui/material/TextField';
|
|
|
import InputAdornment from '@mui/material/InputAdornment';
|
|
|
import CancelIcon from '@mui/icons-material/Cancel';
|
|
|
+import Autocomplete from '@mui/material/Autocomplete';
|
|
|
+import { debounce } from '@mui/material/utils';
|
|
|
+import throttle from 'lodash/throttle';
|
|
|
|
|
|
import { HandsonTable } from 'handsontable/base';
|
|
|
import {HotTable} from "@handsontable/react";
|
|
|
@@ -225,6 +228,7 @@ const MUI_X_PRODUCTS = [
|
|
|
const [value, setValue] = React.useState('1');
|
|
|
const [dwgc, setDwgc] = React.useState(null);
|
|
|
const [zhuanye, setZhuanye] = React.useState(10);
|
|
|
+ const [zhuanye2, setZhuanye2] = React.useState(10);
|
|
|
const [expandedQd, setExpandedQd] = React.useState(true);
|
|
|
const [expandedPb, setExpandedPb] = React.useState(false);
|
|
|
const [expandedDe, setExpandedDe] = React.useState(false);
|
|
|
@@ -238,7 +242,9 @@ const MUI_X_PRODUCTS = [
|
|
|
const [jxde, setJxde] = React.useState(null);
|
|
|
const [open, setOpen] = React.useState(false);
|
|
|
const [dopen, setDopen] = React.useState(false);
|
|
|
-
|
|
|
+
|
|
|
+ const [dopen2, setDopen2] = React.useState(false);
|
|
|
+
|
|
|
const [dingeclick, setDingeclick] = React.useState(null);
|
|
|
const [tihuanClick, setTihuanClick] = React.useState(null);
|
|
|
const tihuanRowRef = React.useRef(null);
|
|
|
@@ -261,6 +267,13 @@ const MUI_X_PRODUCTS = [
|
|
|
let location = useParams();
|
|
|
|
|
|
|
|
|
+ const [acvalue, setAcvalue] = React.useState('');
|
|
|
+ const [acinputvalue, setAcinputvalue] = React.useState('');
|
|
|
+ const [options, setOptions] = React.useState([]);
|
|
|
+ const [suanshiError, setSuanshiError] = React.useState(false);
|
|
|
+ const [helperText, setHelperText] = React.useState('');
|
|
|
+
|
|
|
+
|
|
|
const traverse = (shu) => {
|
|
|
for(let i = 0; i < shu.length; i++) {
|
|
|
let id = shu[i]["id"];
|
|
|
@@ -278,13 +291,19 @@ const MUI_X_PRODUCTS = [
|
|
|
traverse(x);
|
|
|
|
|
|
};
|
|
|
- const handleChangeZhuanye = (event) => {
|
|
|
+ const handleChangeZhuanye = (event) => {
|
|
|
//console.log(event.target.value);
|
|
|
Service.generateDingeshu(event.target.value).then(x=>{
|
|
|
setOutlineDes_(x);
|
|
|
});
|
|
|
setZhuanye(event.target.value);
|
|
|
- };
|
|
|
+ };
|
|
|
+
|
|
|
+ const handleChangeZhuanye2 = (event) => {
|
|
|
+ //console.log(event.target.value);
|
|
|
+
|
|
|
+ setZhuanye2(event.target.value);
|
|
|
+};
|
|
|
|
|
|
const handleChange = (event, newValue) => {
|
|
|
setValue(newValue);
|
|
|
@@ -308,6 +327,10 @@ const MUI_X_PRODUCTS = [
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+ const suanshiCallback = () => {
|
|
|
+ setDopen2(true);
|
|
|
+ };
|
|
|
+
|
|
|
const loadingCallback_djcs = () => {
|
|
|
setOpen(true);
|
|
|
Service.save_djcs().then(x=>{
|
|
|
@@ -341,6 +364,39 @@ const MUI_X_PRODUCTS = [
|
|
|
const handleClose = () => {
|
|
|
setDopen(false);
|
|
|
};
|
|
|
+
|
|
|
+
|
|
|
+ const handleSuanshi = () => {
|
|
|
+ //console.log(acinputvalue);
|
|
|
+ if (/^[A-Z0-9\.\-\[\]\+\*\(\)盐常镇泰补扬南通苏新市附录]+$/.test(acinputvalue)) {
|
|
|
+ //console.log();
|
|
|
+
|
|
|
+ Service.generateSingleDingeXilie(zhuanye2, acinputvalue).then(x=>{
|
|
|
+ let res = JSON.parse(x);
|
|
|
+ let id = res['reverse'];
|
|
|
+ if (id && id != "None") {
|
|
|
+ setSuanshiError(false);
|
|
|
+ setHelperText('');
|
|
|
+ setDopen2(false);
|
|
|
+ res["date"] = Date.now().toString();
|
|
|
+ setDingeclick(JSON.stringify(res));
|
|
|
+ } else {
|
|
|
+ setSuanshiError(true);
|
|
|
+ setHelperText('无效输入');
|
|
|
+ console.log("error");
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ setSuanshiError(true);
|
|
|
+ setHelperText('无效输入');
|
|
|
+ console.log("error");
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ const handleClose2 = () => {
|
|
|
+ setDopen2(false);
|
|
|
+ };
|
|
|
|
|
|
|
|
|
const clickCallback = (qdbm, debh) => {
|
|
|
@@ -840,6 +896,41 @@ const MUI_X_PRODUCTS = [
|
|
|
}, [zhuanye]
|
|
|
);
|
|
|
|
|
|
+ /** <MenuItem value={10}>土建</MenuItem>
|
|
|
+ <MenuItem value={20}>市政</MenuItem>
|
|
|
+ <MenuItem value={30}>安装</MenuItem>
|
|
|
+ <MenuItem value={40}>园林</MenuItem>
|
|
|
+ <MenuItem value={50}>修缮(土建)</MenuItem>
|
|
|
+ <MenuItem value={60}>修缮(安装)</MenuItem> */
|
|
|
+
|
|
|
+ const throttled = React.useRef(throttle((zhuanye2, newValue) => {
|
|
|
+ if (zhuanye2 == 10) {
|
|
|
+ Service.searchDe('土建', newValue).then(x=>{setOptions(x)});
|
|
|
+ }
|
|
|
+ if (zhuanye2 == 20) {
|
|
|
+ Service.searchDe('市政', newValue).then(x=>{setOptions(x)});
|
|
|
+ }
|
|
|
+ if (zhuanye2 == 30) {
|
|
|
+ Service.searchDe('安装', newValue).then(x=>{setOptions(x)});
|
|
|
+ }
|
|
|
+ if (zhuanye2 == 40) {
|
|
|
+ Service.searchDe('园林', newValue).then(x=>{setOptions(x)});
|
|
|
+ }
|
|
|
+ if (zhuanye2 == 50) {
|
|
|
+ Service.searchDe('修缮(土建)', newValue).then(x=>{setOptions(x)});
|
|
|
+ }
|
|
|
+ if (zhuanye2 == 60) {
|
|
|
+ Service.searchDe('修缮(安装)', newValue).then(x=>{setOptions(x)});
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }, 1000));
|
|
|
+ React.useEffect(
|
|
|
+ () => {
|
|
|
+ throttled.current(zhuanye2, acinputvalue);
|
|
|
+ }, [acinputvalue]
|
|
|
+ );
|
|
|
+
|
|
|
return (
|
|
|
|
|
|
<Box sx={{ flexGrow: 1 }}>
|
|
|
@@ -996,6 +1087,7 @@ const MUI_X_PRODUCTS = [
|
|
|
dingeclick={dingeclick}
|
|
|
tihuanCallback={tihuanCallback}
|
|
|
tihuanClick={tihuanClick}
|
|
|
+ suanshiCallback={suanshiCallback}
|
|
|
/>
|
|
|
</TabPanel>
|
|
|
)}
|
|
|
@@ -1113,6 +1205,70 @@ const MUI_X_PRODUCTS = [
|
|
|
|
|
|
</DialogContent>
|
|
|
</Dialog>
|
|
|
+ <Dialog
|
|
|
+ onClose={handleClose2}
|
|
|
+ aria-labelledby="customized-dialog-title"
|
|
|
+ open={dopen2}
|
|
|
+ fullWidth={true}
|
|
|
+ maxWidth="md"
|
|
|
+ >
|
|
|
+ <DialogTitle sx={{ m: 0, p: 2 }} id="customized-dialog-title">
|
|
|
+ 定额(算式)
|
|
|
+ </DialogTitle>
|
|
|
+ <IconButton
|
|
|
+ aria-label="close"
|
|
|
+ onClick={handleClose2}
|
|
|
+ sx={(theme) => ({
|
|
|
+ position: 'absolute',
|
|
|
+ right: 8,
|
|
|
+ top: 8,
|
|
|
+ color: theme.palette.grey[500],
|
|
|
+ })}
|
|
|
+ >
|
|
|
+ <CloseIcon />
|
|
|
+ </IconButton>
|
|
|
+ <DialogContent dividers>
|
|
|
+ <Stack direction='row' spacing={2}>
|
|
|
+ <FormControl size="small">
|
|
|
+ <InputLabel id="demo-multiple-name-label">专业</InputLabel>
|
|
|
+ <Select
|
|
|
+ labelId="demo-multiple-name-label"
|
|
|
+ id="demo-multiple-name"
|
|
|
+ value={zhuanye2}
|
|
|
+ onChange={handleChangeZhuanye2}
|
|
|
+ label="专业"
|
|
|
+ >
|
|
|
+ <MenuItem value={10}>土建</MenuItem>
|
|
|
+ <MenuItem value={20}>市政</MenuItem>
|
|
|
+ <MenuItem value={30}>安装</MenuItem>
|
|
|
+ <MenuItem value={40}>园林</MenuItem>
|
|
|
+ <MenuItem value={50}>修缮(土建)</MenuItem>
|
|
|
+ <MenuItem value={60}>修缮(安装)</MenuItem>
|
|
|
+ </Select>
|
|
|
+ </FormControl>
|
|
|
+ <Autocomplete sx={{ width: 300 }} size="small" disableClearable
|
|
|
+ id="free-solo-demo"
|
|
|
+ freeSolo
|
|
|
+ filterOptions={(x) => x}
|
|
|
+ options={options}
|
|
|
+ value={acvalue}
|
|
|
+ inputValue={acinputvalue}
|
|
|
+ onChange={(event, newValue) => {
|
|
|
+ //setOptions(newValue ? [newValue, ...options] : options);
|
|
|
+ setAcvalue(newValue);
|
|
|
+ }}
|
|
|
+ getOptionDisabled={()=>true}
|
|
|
+ onInputChange={(event, newInputValue) => {
|
|
|
+ setAcinputvalue(newInputValue);
|
|
|
+ }}
|
|
|
+ renderInput={(params) => <TextField {...params} error={suanshiError} helperText={helperText}/>}
|
|
|
+ />
|
|
|
+
|
|
|
+ <Button variant="outlined" size="small" onClick={handleSuanshi}>确定</Button>
|
|
|
+ </Stack>
|
|
|
+
|
|
|
+ </DialogContent>
|
|
|
+ </Dialog>
|
|
|
|
|
|
</Box>
|
|
|
);
|