/*
 *    Copyright (c) 2018-2025, cyweb All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 */

export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  editBtn: false,
  delBtn: false,
  addBtn: false,
  dialogHeight:700,
  dic: [],
  column: [
	  // {
    //   label: '主键',
    //   prop: 'id'
    // },
	  // {
    //   label: '创建人',
    //   prop: 'createBy'
    // },
	  // {
    //   label: '创建时间',
    //   prop: 'createTime'
    // },
	  // {
    //   label: '更新人',
    //   prop: 'updateBy'
    // },
	  // {
    //   label: '更新时间',
    //   prop: 'updateTime'
    // },
	  // {
    //   label: '删除标记',
    //   prop: 'delFlag'
    // },
	  // {
    //   label: '租户ID',
    //   prop: 'tenantId'
    // },
	  // {
    //   label: '备注',
    //   prop: 'remarks'
    // },
	  {
      label: '起草部门',
      prop: 'deptCode',
      labelWidth:124,
      searchFilterable:true,
      search:true,
      addDisplay:false,
      editDisabled:true,
      type:'select',
      dicUrl: '/basic/basicdept/getDeptListByLevelTwo',
      props: {
        label: 'deptName',
        value: 'deptCode'
      },
    },
	  {
      label: '合同编号',
      prop: 'contractNo',
      search:true,
      labelWidth:124,
      editDisabled:true,
    },
	  {
      label: '合同名称',
      prop: 'contractName',
      search:true,
      labelWidth:124,
    },
	  {
      label: '合同类型',
      prop: 'contractType',
      labelWidth:124,
      search:true,
      filterable:true,
      searchFilterable:true,
      type:'select',
      dicUrl: '/contract/contracttype/contractTypeTwo',
      props:{
        label:'typeName',
        value:'id'
      },
    },
	  {
      label: '是否招标',
      prop: 'isBidding',
      labelWidth:135,
      type:'radio',
      dicUrl:'/admin/dict/item/type/yes_no',
      props:{
        label:'label',
        value:'value'
      },
    },
	  {
      label: '是否需要法律顾问',
      prop: 'isLegalAdviser',
      labelWidth:135,
      type:'radio',
      dicUrl:'/admin/dict/item/type/yes_no',
      props:{
        label:'label',
        value:'value'
      },
    },
    {
      label: '法律顾问意见',
      prop: 'legalAdviserOpinion',
      labelWidth:135,
      rules: [{
        required: true,
        message: "请选择是否需要法律顾问",
        trigger: "blur"
      }]
    },
	  {
      label: '是否涉及多个部门',
      prop: 'isDepts',
      labelWidth:135,
      type:'radio',
      dicUrl:'/admin/dict/item/type/yes_no',
      props:{
        label:'label',
        value:'value'
      },
    },
	  {
      label: '是否经济类合同',
      prop: 'isEconomy',
      labelWidth:135,
      type:'radio',
      dicUrl:'/admin/dict/item/type/yes_no',
      props:{
        label:'label',
        value:'value'
      },
    },
	  {
      label: '质保期',
      prop: 'warrantyPeriod',
      labelWidth:124,
    },
	  {
      label: '合同开始时间',
      prop: 'startTime',
      labelWidth:124,
      type:'date',
      format:'yyyy-MM-dd',
      valueFormat:'yyyy-MM-dd'
    },
	  {
      label: '合同结束时间',
      prop: 'endTime',
      type:'date',
      format:'yyyy-MM-dd',
      valueFormat:'yyyy-MM-dd',
      labelWidth:124
    },
	  {
      label: '合同金额',
      prop: 'money',
      labelWidth:124,
      type:'number',
      precision:2,
      minRows:0,
    },
	  {
      label: '对方单位',
      prop: 'supplierId',
      labelWidth:124,
      search:true,
      searchFilterable:true,
      formslot:true,
      type:'select',
      dicUrl: '/contract/supplierinfo/getSupplierData',
      props:{
        label:'supplierName',
        value:'id'
      }
    },
    {
      label:'状态',
      prop:'contractStatus',
      search:true,
      addDisplay:false,
      editDisplay:false,
      type:'select',
      dicUrl: '/admin/dict/item/type/contract_status',
      props:{
        value:'value',
        label:'label'
      },
    },
  ]
}
export const contractTableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  editBtn: false,
  delBtn: false,
  addBtn: false,
  expandAll: false,
  tree: true,
  showSummary:true,
  refreshBtn: false,
  showColumn: false,
  filterBtn: false,
  page: false,
  dic: [],
  sumColumnList: [
    {
      label:'合计:',
      name: 'sum',
      type: 'sum',
      decimals:1
    },
    {
      name: 'nums',
      type: 'sum'
    },
    {
      name: 'moneyTotal',
      type: 'sum'
    }],
  column: [
    {
      span: 24,
      label: '合同类别',
      prop: 'typeName',
    },
    {
      label: '合同数',
      prop: 'nums',
      span: 24,
    },
    {
      label: '总金额',
      prop: 'moneyTotal',
      span: 24,
    },
  ]
}
export const supplierTableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  editBtn: false,
  delBtn: false,
  addBtn: false,
  expandAll: false,
  tree: true,
  showSummary:true,
  refreshBtn: false,
  showColumn: false,
  filterBtn: false,
  page: false,
  dic: [],
  sumColumnList: [
    {
      label:'合计:',
      name: 'sum',
      type: 'sum',
      decimals:1
    },
    {
      name: 'nums',
      type: 'sum'
    },
    {
      name: 'moneyTotal',
      type: 'sum'
    }],
  column: [
    {
      span: 24,
      label: '对方单位',
      prop: 'supplierName',
    },
    {
      label: '合同数',
      prop: 'nums',
      span: 24,
    },
    {
      label: '总金额',
      prop: 'moneyTotal',
      span: 24,
    },
  ]
}
