|
@@ -16,7 +16,7 @@ import TimeNode from './TimeNode';
|
|
|
import FilesModal from './FilesModal';
|
|
|
import VersionModal from './VersionModal';
|
|
|
import CommitAuditModal from './CommitAuditModal';
|
|
|
-// import CommentContent from '@/components/CommentContent';
|
|
|
+import CommentContent from '@/components/CommentContent';
|
|
|
import MergeModal from './MergeModal';
|
|
|
import { GetTokenFromUrl, getToken } from '@/utils/utils';
|
|
|
import {
|
|
@@ -50,6 +50,7 @@ function Detail(props) {
|
|
|
typeOptions,
|
|
|
classifyList,
|
|
|
excelFileList,
|
|
|
+ comment,
|
|
|
} = props;
|
|
|
const [versionTreeVisible, setVersionTreeVisible] = useState(false);
|
|
|
const [commentVisible, setCommentVisible] = useState(false);
|
|
@@ -80,6 +81,7 @@ function Detail(props) {
|
|
|
edit: false,
|
|
|
compare: false,
|
|
|
});
|
|
|
+ const cellPosition = useRef({});
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (!version.attachment_id) return;
|
|
@@ -181,6 +183,9 @@ function Detail(props) {
|
|
|
cid: cell.cid,
|
|
|
sheet_index: String(s.seq || 0),
|
|
|
};
|
|
|
+ cellPosition.current = {
|
|
|
+ ...payload,
|
|
|
+ };
|
|
|
dispatch({
|
|
|
type: 'detail/queryComment',
|
|
|
payload,
|
|
@@ -217,7 +222,7 @@ function Detail(props) {
|
|
|
});
|
|
|
};
|
|
|
// 更新表单,flag为true时不判断是否属于审批,强制更新
|
|
|
- const onUpdate = (flag) => {
|
|
|
+ const onUpdate = flag => {
|
|
|
if (!flag && flow.active != 0) return;
|
|
|
let currentData = sheetRef.current.getSheetJson().data;
|
|
|
let sheets = JSON.parse(JSON.stringify(currentData));
|
|
@@ -387,7 +392,17 @@ function Detail(props) {
|
|
|
}
|
|
|
} catch (error) {}
|
|
|
};
|
|
|
-
|
|
|
+ const handleSubmitCell = (value, callback) => {
|
|
|
+ if (!value) return;
|
|
|
+ dispatch({
|
|
|
+ type: 'detail/addComment',
|
|
|
+ payload: {
|
|
|
+ ...cellPosition.current,
|
|
|
+ comment: value,
|
|
|
+ },
|
|
|
+ callback,
|
|
|
+ });
|
|
|
+ };
|
|
|
useEffect(() => {
|
|
|
dispatch({
|
|
|
type: 'detail/queryProjectRecord',
|
|
@@ -521,33 +536,51 @@ function Detail(props) {
|
|
|
projectId={projectId}
|
|
|
setAuditVisible={setAuditVisible}
|
|
|
></TimeNode>
|
|
|
-
|
|
|
- {/* 判断是否为比对模式 */}
|
|
|
- {compareList.length == 2 ? (
|
|
|
- <>
|
|
|
- <Alert
|
|
|
- message={`比对结果:${updateCount.diff}项差异。${updateCount.add}项新增`}
|
|
|
- type="info"
|
|
|
- />
|
|
|
- <div className={styles.sheetBox}>{compareList.map(renderSheetDom)}</div>
|
|
|
- </>
|
|
|
- ) : (
|
|
|
- <div className={styles.sheetBox}>
|
|
|
- {version.id && (
|
|
|
- <LuckySheet
|
|
|
- className={styles.sheet}
|
|
|
- ref={sheetRef}
|
|
|
- onClickCell={onClickCell}
|
|
|
- version={version}
|
|
|
- templateId={templateId}
|
|
|
- getUser={getUser}
|
|
|
- onUpdate={onUpdate}
|
|
|
- onDelSheet={onDelSheet}
|
|
|
+ <div
|
|
|
+ className={styles.content}
|
|
|
+ style={{
|
|
|
+ // 合同清单先显示附件再显示清单详情
|
|
|
+ flexDirection: version?.TemplateNodeInfo?.flow_id == 9 ? 'column-reverse' : 'column',
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {/* 判断是否为比对模式 */}
|
|
|
+ {compareList.length == 2 ? (
|
|
|
+ <>
|
|
|
+ <Alert
|
|
|
+ message={`比对结果:${updateCount.diff}项差异。${updateCount.add}项新增`}
|
|
|
+ type="info"
|
|
|
/>
|
|
|
- )}
|
|
|
- </div>
|
|
|
- )}
|
|
|
-
|
|
|
+ <div className={styles.sheetBox}>{compareList.map(renderSheetDom)}</div>
|
|
|
+ </>
|
|
|
+ ) : (
|
|
|
+ <div className={styles.sheetBox}>
|
|
|
+ {version.id && (
|
|
|
+ <LuckySheet
|
|
|
+ className={styles.sheet}
|
|
|
+ ref={sheetRef}
|
|
|
+ onClickCell={onClickCell}
|
|
|
+ version={version}
|
|
|
+ templateId={templateId}
|
|
|
+ getUser={getUser}
|
|
|
+ onUpdate={onUpdate}
|
|
|
+ onDelSheet={onDelSheet}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+
|
|
|
+ <FormAndFilesNode
|
|
|
+ formData={version?.ding_schema}
|
|
|
+ excelFileList={excelFileList}
|
|
|
+ version={version}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <CommentContent
|
|
|
+ title="单元格沟通记录"
|
|
|
+ comment={comment}
|
|
|
+ onSubmit={handleSubmitCell}
|
|
|
+ loading={loading.effects['detail/queryComment'] || loading.effects['detail/addComment']}
|
|
|
+ />
|
|
|
<HistoryDrawer
|
|
|
versionTree={versionTree}
|
|
|
version={version}
|
|
@@ -556,11 +589,6 @@ function Detail(props) {
|
|
|
onClose={() => setVersionTreeVisible(false)}
|
|
|
/>
|
|
|
|
|
|
- <FormAndFilesNode
|
|
|
- formData={version?.ding_schema}
|
|
|
- excelFileList={excelFileList}
|
|
|
- version={version}
|
|
|
- />
|
|
|
<RightDrawer
|
|
|
version={version}
|
|
|
visible={commentVisible}
|
|
@@ -631,5 +659,6 @@ export default connect(({ detail, user, xflow, loading }) => ({
|
|
|
typeOptions: detail.typeOptions,
|
|
|
classifyList: detail.classifyList,
|
|
|
excelFileList: detail.excelFileList,
|
|
|
+ comment: detail.comment,
|
|
|
loading,
|
|
|
}))(Detail);
|