no message

master
853931625@qq.com 2026-03-25 11:24:51 +08:00
parent 9195a5ad78
commit 583e255167
4 changed files with 86 additions and 37 deletions

View File

@ -29,6 +29,7 @@ module.exports = {
appKey: "", appKey: "",
// fileUrl: "http://192.168.20.240:9787/mnt/", // fileUrl: "http://192.168.20.240:9787/mnt/",
fileUrl: "https://jpfz.qhdsafety.com/gbsFileTest/", fileUrl: "https://jpfz.qhdsafety.com/gbsFileTest/",
// fileUrl: "https://skqhdg.porthebei.com:9004/file/uploadFiles2/",
}, },
// public/index.html注入全局变量 // public/index.html注入全局变量
windowInject: { windowInject: {

View File

@ -240,6 +240,19 @@ function List(props) {
</Button> </Button>
) )
} }
<Button
type="link"
onClick={() =>
Modal.confirm({
title: "提示",
content: "请联系管理员操作!",
onOk: () => {
},
})}
>
修改企业名称
</Button>
{props.permission("qyd-xgf-resetPassword") {props.permission("qyd-xgf-resetPassword")
&& ( && (
<Button <Button
@ -426,6 +439,10 @@ function AddModalComponent(props) {
{ {
name: "corpName", name: "corpName",
label: "企业名称", label: "企业名称",
required: !props.currentId,
componentProps: {
disabled: props.currentId,
},
}, },
{ {
name: "code", name: "code",

View File

@ -98,6 +98,7 @@ function CorpInfo(props) {
const [info, setInfoData] = useState([]); const [info, setInfoData] = useState([]);
const [codeValue, setCodeValue] = useState(""); const [codeValue, setCodeValue] = useState("");
const [corpNameValue, setCorpNameValue] = useState(""); const [corpNameValue, setCorpNameValue] = useState("");
const [corpinfoId, setCorpInfoId] = useState("");
const debouncedCode = useDebounce(codeValue, 600); const debouncedCode = useDebounce(codeValue, 600);
const debouncedCorpName = useDebounce(corpNameValue, 600); const debouncedCorpName = useDebounce(corpNameValue, 600);
function getLastValidCorpTypeName(item) { function getLastValidCorpTypeName(item) {
@ -119,47 +120,49 @@ function CorpInfo(props) {
// 全为空则返回空字符串或默认值 // 全为空则返回空字符串或默认值
return ""; return "";
} }
useEffect(() => { const fetchData = async () => {
const fetchData = async () => { const res = await props["userGetInfo"]();
const res = await props["userGetInfo"](); const { data } = await props["corpInfoDetails"]({
const { data } = await props["corpInfoDetails"]({ id: res.data.corpinfoId,
id: res.data.corpinfoId, });
}); // data.lrMobile = data.lrMobile && data.lrMobile.label;
// data.lrMobile = data.lrMobile && data.lrMobile.label; // data.contactsPhone = data.contactsPhone && data.contactsPhone.label;
// data.contactsPhone = data.contactsPhone && data.contactsPhone.label;
data.region = data.village || data.street || data.country || data.city || data.province; data.region = data.village || data.street || data.country || data.city || data.province;
setInfoData(data); setInfoData(data);
setKeyId({ setCorpInfoId(res.data.corpinfoId)
id: res.data.corpinfoId, setKeyId({
corpinfoId: res.data.userId, id: res.data.corpinfoId,
}); corpinfoId: res.data.userId,
const licenseFile = await getFile({ });
eqType: UPLOAD_FILE_TYPE_ENUM["6"], const licenseFile = await getFile({
eqForeignKey: res.data.userId ? res.data.userId : "", eqType: UPLOAD_FILE_TYPE_ENUM["6"],
}); eqForeignKey: res.data.userId ? res.data.userId : "",
data.INDUSTRYALL = getLastValidCorpTypeName(data); });
data.license = [data.licenseStart, data.licenseEnd]; data.INDUSTRYALL = getLastValidCorpTypeName(data);
data.scaleType = data.scaleType ?? 0; data.license = [data.licenseStart, data.licenseEnd];
data.scaleType = data.scaleType ?? 0;
const hasLicenseFile = Array.isArray(licenseFile) && licenseFile.length > 0; const hasLicenseFile = Array.isArray(licenseFile) && licenseFile.length > 0;
const allRequiredFilled = REQUIRED_FIELDS.every((field) => { const allRequiredFilled = REQUIRED_FIELDS.every((field) => {
const val = data[field]; const val = data[field];
// 允许0值但排除null、undefined和空字符串 // 允许0值但排除null、undefined和空字符串
return val != null && val !== ""; return val != null && val !== "";
}); });
setCanShowQrCode(allRequiredFilled && hasLicenseFile); setCanShowQrCode(allRequiredFilled && hasLicenseFile);
const values = { const values = {
licenseFile, licenseFile,
...data, ...data,
};
form.setFieldsValue({
...values,
});
}; };
form.setFieldsValue({
...values,
});
};
useEffect(() => {
fetchData(); fetchData();
}, []); }, []);
const onSubmit = async (values) => { const onSubmit = async (values) => {
@ -223,7 +226,16 @@ function CorpInfo(props) {
props["corpInfoEdit"](values).then((res) => { props["corpInfoEdit"](values).then((res) => {
if (res.success) { if (res.success) {
message.success("操作成功!"); message.success("操作成功!");
window.location.reload(); props["corpInfoDetails"]({
id: corpinfoId,
}).then(res =>{
res.data.region = res.data.village || res.data.street || res.data.country || res.data.city || res.data.province;
setInfoData(res.data);
});
// data.lrMobile = data.lrMobile && data.lrMobile.label;
// data.contactsPhone = data.contactsPhone && data.contactsPhone.label;
} }
}); });
}; };

View File

@ -250,6 +250,21 @@ function List(props) {
</Button> </Button>
) )
} }
<Button
type="link"
onClick={() =>
Modal.confirm({
title: "提示",
content: "请联系管理员操作!",
onOk: () => {
},
})}
>
修改企业名称
</Button>
{props.permission("gszhxxgl-resetPassword") {props.permission("gszhxxgl-resetPassword")
&& ( && (
<Button <Button
@ -429,7 +444,11 @@ function AddModalComponent(props) {
options={[ options={[
{ {
name: "corpName", name: "corpName",
label: "单位名称", label: "企业名称",
required: !props.currentId,
componentProps: {
disabled: props.currentId,
},
}, },
{ {
name: "code", name: "code",