/*
 * @Author: Anmin 
 * @Email:changanmin1@crc.com.hk 
 * @Date: 2018-11-12 17:53:20 
 * @Last Modified by: Anmin
 * @Last Modified time: 2018-11-28 16:59:45
 * @description:  操作记录
 */
 <template>
   <div>
    <EMSTable ref="listTable" :server="server" action="operationRecord" :columnsFn="getColumns" :params="searchParams">
    </EMSTable>
   </div>
 </template>
 <script>
 import { EMSTable } from "ems-components";
import Server from "./server.js";

const server = new Server();
export default {
  components:{EMSTable},
  name: "OperationRecord",
  props: {
    receivablesNum: {
      type: String,
      required: true
    },
    receivablesLineNum: {
      type: String,
      required: false
    }
  },
  data() {
    return {
      server: server
    };
  },
  computed: {
    searchParams() {
      return {
        receivablesNum: this.receivablesNum,
        receivablesLineNum: this.receivablesLineNum || ""
      };
    }
  },
  methods: {
    getColumns() {
      return [
        {
          title: "操作时间",
          align: "center",
          key: "createdTime",
          minWidth: 180,
          render: (h, params) => {
            let val = params.row.createdTime;
            return h(
              "div",
              {
                attrs: {
                  class: "ivu-table-cell ivu-table-cell-ellipsis",
                  title: val
                }
              },
              val
            );
          }
        },
        {
          title: "操作人",
          align: "center",
          key: "createdByName",
          minWidth: 180,
          render: (h, params) => {
            let val = params.row.createdByName;
            return h(
              "div",
              {
                attrs: {
                  class: "ivu-table-cell ivu-table-cell-ellipsis",
                  title: val
                }
              },
              val
            );
          }
        },
        // {
        //   title: "操作类型",
        //   align: "center",
        //   key: "modifyType",
        //   minWidth: 180,
        //   render: (h, params) => {
        //     let val = params.row.modifyType;
        //     return h(
        //       "div",
        //       {
        //         attrs: {
        //           class: "ivu-table-cell ivu-table-cell-ellipsis",
        //           title: val
        //         }
        //       },
        //       val
        //     );
        //   }
        // },
        // {
        //   title: "是否删除",
        //   align: "center",
        //   key: "isDel",
        //   minWidth: 180,
        //   render: (h, params) => {
        //     return h(
        //        "Tag",
        //       {
        //         props: {
        //           type: "dot",
        //           color: +params.row.isDel === 0 ? "blue" : "red"
        //         }
        //       },
        //       +params.row.isDel === 0 ? "是" : "否"
        //     ); 
        //   } 
        // },
        {
          title: "操作步骤",
          align: "center",
          key: "activity",
          minWidth: 180,
          render: (h, params) => {
            let val = params.row.activity;
            return h(
              "div",
              {
                attrs: {
                  class: "ivu-table-cell ivu-table-cell-ellipsis",
                  title: val
                }
              },
              val
            );
          }
        },
        {
          title: "操作原因",
          align: "center",
          key: "remark",
          minWidth: 180,
          render: (h, params) => {
            let val = params.row.remark;
            return h(
              "div",
              {
                attrs: {
                  class: "ivu-table-cell ivu-table-cell-ellipsis",
                  title: val
                }
              },
              val
            );
          }
        }
      ];
    }
  }
};
</script>
 
 