no message
parent
9195a5ad78
commit
583e255167
|
|
@ -29,6 +29,7 @@ module.exports = {
|
|||
appKey: "",
|
||||
// fileUrl: "http://192.168.20.240:9787/mnt/",
|
||||
fileUrl: "https://jpfz.qhdsafety.com/gbsFileTest/",
|
||||
// fileUrl: "https://skqhdg.porthebei.com:9004/file/uploadFiles2/",
|
||||
},
|
||||
// public/index.html注入全局变量
|
||||
windowInject: {
|
||||
|
|
|
|||
|
|
@ -240,6 +240,19 @@ function List(props) {
|
|||
</Button>
|
||||
)
|
||||
}
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() =>
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "请联系管理员操作!",
|
||||
onOk: () => {
|
||||
|
||||
},
|
||||
})}
|
||||
>
|
||||
修改企业名称
|
||||
</Button>
|
||||
{props.permission("qyd-xgf-resetPassword")
|
||||
&& (
|
||||
<Button
|
||||
|
|
@ -426,6 +439,10 @@ function AddModalComponent(props) {
|
|||
{
|
||||
name: "corpName",
|
||||
label: "企业名称",
|
||||
required: !props.currentId,
|
||||
componentProps: {
|
||||
disabled: props.currentId,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "code",
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ function CorpInfo(props) {
|
|||
const [info, setInfoData] = useState([]);
|
||||
const [codeValue, setCodeValue] = useState("");
|
||||
const [corpNameValue, setCorpNameValue] = useState("");
|
||||
const [corpinfoId, setCorpInfoId] = useState("");
|
||||
const debouncedCode = useDebounce(codeValue, 600);
|
||||
const debouncedCorpName = useDebounce(corpNameValue, 600);
|
||||
function getLastValidCorpTypeName(item) {
|
||||
|
|
@ -119,47 +120,49 @@ function CorpInfo(props) {
|
|||
// 全为空则返回空字符串或默认值
|
||||
return "";
|
||||
}
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const res = await props["userGetInfo"]();
|
||||
const { data } = await props["corpInfoDetails"]({
|
||||
id: res.data.corpinfoId,
|
||||
});
|
||||
// data.lrMobile = data.lrMobile && data.lrMobile.label;
|
||||
// data.contactsPhone = data.contactsPhone && data.contactsPhone.label;
|
||||
const fetchData = async () => {
|
||||
const res = await props["userGetInfo"]();
|
||||
const { data } = await props["corpInfoDetails"]({
|
||||
id: res.data.corpinfoId,
|
||||
});
|
||||
// data.lrMobile = data.lrMobile && data.lrMobile.label;
|
||||
// data.contactsPhone = data.contactsPhone && data.contactsPhone.label;
|
||||
|
||||
data.region = data.village || data.street || data.country || data.city || data.province;
|
||||
setInfoData(data);
|
||||
setKeyId({
|
||||
id: res.data.corpinfoId,
|
||||
corpinfoId: res.data.userId,
|
||||
});
|
||||
const licenseFile = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["6"],
|
||||
eqForeignKey: res.data.userId ? res.data.userId : "",
|
||||
});
|
||||
data.INDUSTRYALL = getLastValidCorpTypeName(data);
|
||||
data.license = [data.licenseStart, data.licenseEnd];
|
||||
data.scaleType = data.scaleType ?? 0;
|
||||
data.region = data.village || data.street || data.country || data.city || data.province;
|
||||
setInfoData(data);
|
||||
setCorpInfoId(res.data.corpinfoId)
|
||||
setKeyId({
|
||||
id: res.data.corpinfoId,
|
||||
corpinfoId: res.data.userId,
|
||||
});
|
||||
const licenseFile = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["6"],
|
||||
eqForeignKey: res.data.userId ? res.data.userId : "",
|
||||
});
|
||||
data.INDUSTRYALL = getLastValidCorpTypeName(data);
|
||||
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 val = data[field];
|
||||
// 允许0值,但排除null、undefined和空字符串
|
||||
return val != null && val !== "";
|
||||
});
|
||||
const allRequiredFilled = REQUIRED_FIELDS.every((field) => {
|
||||
const val = data[field];
|
||||
// 允许0值,但排除null、undefined和空字符串
|
||||
return val != null && val !== "";
|
||||
});
|
||||
|
||||
setCanShowQrCode(allRequiredFilled && hasLicenseFile);
|
||||
setCanShowQrCode(allRequiredFilled && hasLicenseFile);
|
||||
|
||||
const values = {
|
||||
licenseFile,
|
||||
...data,
|
||||
};
|
||||
form.setFieldsValue({
|
||||
...values,
|
||||
});
|
||||
const values = {
|
||||
licenseFile,
|
||||
...data,
|
||||
};
|
||||
form.setFieldsValue({
|
||||
...values,
|
||||
});
|
||||
};
|
||||
useEffect(() => {
|
||||
|
||||
fetchData();
|
||||
}, []);
|
||||
const onSubmit = async (values) => {
|
||||
|
|
@ -223,7 +226,16 @@ function CorpInfo(props) {
|
|||
props["corpInfoEdit"](values).then((res) => {
|
||||
if (res.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;
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -250,6 +250,21 @@ function List(props) {
|
|||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() =>
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "请联系管理员操作!",
|
||||
onOk: () => {
|
||||
|
||||
},
|
||||
})}
|
||||
>
|
||||
修改企业名称
|
||||
</Button>
|
||||
|
||||
{props.permission("gszhxxgl-resetPassword")
|
||||
&& (
|
||||
<Button
|
||||
|
|
@ -429,7 +444,11 @@ function AddModalComponent(props) {
|
|||
options={[
|
||||
{
|
||||
name: "corpName",
|
||||
label: "单位名称",
|
||||
label: "企业名称",
|
||||
required: !props.currentId,
|
||||
componentProps: {
|
||||
disabled: props.currentId,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "code",
|
||||
|
|
|
|||
Loading…
Reference in New Issue