/*
 * Author: 黎永顺
 * name: 薪资账套-薪资项目移动到的功能
 * Description:
 * Date: 2023/3/8
 */
import React, { Component } from "react";
import { WeaDialog, WeaSearchGroup, WeaSelect } from "ecCom";
import { Button } from "antd";
import "./index.less";

class LedgerMovoTo extends Component {
  render() {
    const { dataList, value, onChangeMoveVal, onSubmitMoveTo, ...extraProps } = this.props;
    const buttons = [
      <Button type="primary" onClick={onSubmitMoveTo}>移动</Button>,
      <Button type="ghost" onClick={extraProps.onCancel}>取消</Button>
    ];
    return (
      <WeaDialog
        {...extraProps} buttons={buttons} hasScroll initLoadCss className="moveModalWrapper"
        style={{ width: 440, height: Math.ceil((dataList.length - 1) / 3) * 25 + 41 }}>
        <WeaSearchGroup showGroup needTigger={false}>
          <WeaSelect
            options={_.filter(dataList, item => item.showname === "未分类")}
            detailtype={3} value={value}
            onChange={onChangeMoveVal}
          />
          <WeaSelect
            options={_.filter(dataList, item => item.showname !== "未分类")}
            detailtype={3} value={value}
            onChange={onChangeMoveVal}
          />
        </WeaSearchGroup>
      </WeaDialog>
    );
  }
}

export default LedgerMovoTo;

