Commit bbe7b26d97b322f48fdd8e0cf4739e15102a87e0

Authored by zhangz
1 parent 2aeda4f5

commonbill新增修改保存复制控制;

src/components/Common/CommonTable/index.js
@@ -12179,11 +12179,15 @@ const useGetTableBtnOprSetting = props => { @@ -12179,11 +12179,15 @@ const useGetTableBtnOprSetting = props => {
12179 if (btnType === "add") { 12179 if (btnType === "add") {
12180 resultTemp.mesAdd = params => { 12180 resultTemp.mesAdd = params => {
12181 const { sDefault: str } = btnTableAddConfig; 12181 const { sDefault: str } = btnTableAddConfig;
12182 - const disabled = props.getBtnDisabled({ 12182 + let disabled = props.getBtnDisabled({
12183 str, 12183 str,
12184 defaultValue: false, 12184 defaultValue: false,
12185 record: {} 12185 record: {}
12186 }); 12186 });
  12187 +
  12188 + if (props.parentProps.bMesBill && !str) {
  12189 + disabled = !props.enabled;
  12190 + }
12187 12191
12188 return ( 12192 return (
12189 <Button 12193 <Button
@@ -12208,11 +12212,14 @@ const useGetTableBtnOprSetting = props =&gt; { @@ -12208,11 +12212,14 @@ const useGetTableBtnOprSetting = props =&gt; {
12208 resultTemp.mesDel = params => { 12212 resultTemp.mesDel = params => {
12209 const { record } = params; 12213 const { record } = params;
12210 const { sDefault: str } = btnTableDelConfig; 12214 const { sDefault: str } = btnTableDelConfig;
12211 - const disabled = props.getBtnDisabled({ 12215 + let disabled = props.getBtnDisabled({
12212 str, 12216 str,
12213 defaultValue: false, 12217 defaultValue: false,
12214 record 12218 record
12215 }); 12219 });
  12220 + if (props.parentProps.bMesBill && !str) {
  12221 + disabled = !props.enabled;
  12222 + }
12216 return ( 12223 return (
12217 <Button 12224 <Button
12218 disabled={disabled} 12225 disabled={disabled}
@@ -12226,10 +12233,15 @@ const useGetTableBtnOprSetting = props =&gt; { @@ -12226,10 +12233,15 @@ const useGetTableBtnOprSetting = props =&gt; {
12226 ); 12233 );
12227 }; 12234 };
12228 } else if (btnType === "copy") { 12235 } else if (btnType === "copy") {
12229 - resultTemp.mesCopy = params => (  
12230 - <Button 12236 + resultTemp.mesCopy = params => {
  12237 + let disabled = false;
  12238 + if (props.parentProps.bMesBill) {
  12239 + disabled = !props.enabled;
  12240 + }
  12241 + return <Button
12231 className={styles.mesCopy} 12242 className={styles.mesCopy}
12232 icon={<CopyOutlined />} 12243 icon={<CopyOutlined />}
  12244 + disabled={disabled}
12233 onClick={e => { 12245 onClick={e => {
12234 e.stopPropagation(); 12246 e.stopPropagation();
12235 props.onMesTableLineCopy && 12247 props.onMesTableLineCopy &&
@@ -12239,7 +12251,8 @@ const useGetTableBtnOprSetting = props =&gt; { @@ -12239,7 +12251,8 @@ const useGetTableBtnOprSetting = props =&gt; {
12239 }); 12251 });
12240 }} 12252 }}
12241 /> 12253 />
12242 - ); 12254 + }
  12255 + ;
12243 } else if (btnType === "save") { 12256 } else if (btnType === "save") {
12244 resultTemp.mesSave = () => ( 12257 resultTemp.mesSave = () => (
12245 <Button 12258 <Button