import { BASE_PROVIDERS } from "./base";
export default {
  key: "ljProviderSaletaskmx",
  options: [
    {
      groupName: "明细信息",
      printElements: [
        {
          tid: "saletaskmxTable",
          title: "明细(表格)",
          type: "table",
          options: {
            field: "table",
            fields: [
              {
                text: "序",
                field: "printid"
              },
              {
                field: "unit",
                text: "单位"
              },
              {
                field: "mtrlname",
                text: "物料名称"
              },
              {
                field: "mtrlcode",
                text: "物料编码"
              },
              {
                field: "mtrlmode",
                text: "物料规格"
              },
              {
                field: "requiredate",
                text: "要求交期"
              },
              {
                field: "mxdscrp",
                text: "明细备注"
              },
              {
                field: "saleqty",
                text: "数量"
              },
              {
                field: "price",
                text: "人民币实价"
              },
              {
                field: "enprice",
                text: "单价"
              },
              {
                field: "dftsaleprice",
                text: "定价"
              },
              {
                field: "rebate",
                text: "折扣"
              },
              {
                field: "status",
                text: "配置"
              },
              {
                field: "woodcode",
                text: "配置1"
              },
              {
                field: "pcode",
                text: "配置2"
              },
              {
                field: "ddflag",
                text: "调度审核标记"
              },
              {
                field: "pqty",
                text: "安排自制数"
              },
              {
                field: "bqty",
                text: "安排采购数"
              },
              {
                field: "mqty",
                text: "安排库存"
              },
              {
                field: "mtrl_pic",
                text: "图片"
              }
            ],
            // 分组统计字段
            groupFieldsFormatter: "function(type,options,data){ return ['mtrlmode'] }"
          },
          editable: true,
          columnDisplayEditable: true, //列显示是否能编辑
          columnDisplayIndexEditable: true, //列顺序显示是否能编辑
          columnTitleEditable: true, //列标题是否能编辑
          columnResizable: true, //列宽是否能调整
          columnAlignEditable: true, //列对齐是否调整
          columns: [
            [
              {
                title: "序",
                align: "center",
                field: "printid",
                width: 50,
                tableTextType: "sequence"
              },
              {
                field: "mtrlname",
                align: "center",
                title: "物料名称"
              },
              {
                field: "mtrlcode",
                align: "center",
                title: "物料编码"
              },
              {
                field: "mtrlmode",
                align: "center",
                title: "物料规格"
              },
              {
                field: "unit",
                align: "center",
                title: "单位"
              },
              {
                field: "requiredate",
                align: "center",
                title: "要求交期",
                formatter2: function (value: any, row: any, index: any, options: any) {
                  let time = new Date(value);
                  let year = time.getFullYear() + "年";
                  let month = time.getMonth() + 1 + "月";
                  let date = time.getDate() + "日";
                  return [year, month, date].join("");
                }
              },
              {
                field: "mxdscrp",
                align: "center",
                title: "明细备注"
              },
              {
                field: "saleqty",
                align: "center",
                title: "数量",
                tableSummary: "sum"
              },
              {
                field: "price",
                align: "center",
                title: "人民币实价"
              },
              {
                field: "enprice",
                align: "center",
                title: "单价"
              },
              {
                field: "dftsaleprice",
                align: "center",
                title: "定价"
              },
              {
                field: "rebate",
                align: "center",
                title: "折扣"
              },
              {
                field: "status",
                align: "center",
                title: "配置"
              },
              {
                field: "woodcode",
                align: "center",
                title: "配置1"
              },
              {
                field: "pcode",
                align: "center",
                title: "配置2"
              },
              {
                field: "ddflag",
                align: "center",
                title: "调度审核标记"
              },
              {
                field: "pqty",
                align: "center",
                title: "安排自制数"
              },
              {
                field: "bqty",
                align: "center",
                title: "安排采购数"
              },
              {
                field: "mqty",
                align: "center",
                title: "安排库存"
              },
              {
                field: "mtrl_pic",
                title: "图片",
                align: "center",
                renderFormatter: function (value: any, row: any, colIndex: any, options: any, rowIndex: any) {
                  return `<img style="width:100%;height:72pt" src="${value}"></img>`;
                }
              },
              {
                field: "amt",
                align: "center",
                title: "金额"
              }
            ]
          ]
        }
        //   { tid: "_recordscustomText", title: "文本", customText: "自定义文本", custom: true, type: "text" },
        //   {
        //     tid: "_recordslongText",
        //     title: "长文本",
        //     type: "longText",
        //     options: {
        //       field: "test.longText",
        //       width: 200,
        //       testData: "长文本分页/不分页测试"
        //     }
        //   }
      ]
    },
    {
      groupName: "客户信息",
      printElements: [
        {
          tid: "name",
          title: "客户名称",
          type: "text",
          options: {
            field: "name",
            title: "客户名称：",
            height: 16,
            fontSize: 12,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        },
        {
          tid: "cuscode",
          title: "客户编号",
          type: "text",
          options: {
            field: "cuscode",
            title: "客户编号：",
            height: 16,
            fontSize: 12,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        }
      ]
    },
    {
      groupName: "业务员信息",
      printElements: [
        {
          tid: "assign_emp",
          title: "业务员",
          type: "text",
          options: {
            field: "assign_emp",
            title: "业务员：",
            height: 16,
            fontSize: 12,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        },
        {
          tid: "tele1",
          title: "业务员电话",
          type: "text",
          options: {
            field: "tele1",
            title: "业务员电话：",
            height: 16,
            fontSize: 12,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        },
        {
          tid: "freight",
          title: "货运部",
          type: "text",
          options: {
            field: "freight",
            title: "货运部：",
            height: 16,
            fontSize: 12,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        },
        {
          tid: "freight_tele",
          title: "货运部电话",
          type: "text",
          options: {
            field: "freight_tele",
            title: "货运部电话：",
            height: 16,
            fontSize: 12,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        },
        {
          tid: "station_address",
          title: "货运部地址",
          type: "text",
          options: {
            field: "station_address",
            title: "货运部地址：",
            height: 16,
            fontSize: 12,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        },
        {
          tid: "rel_rep",
          title: "联系人",
          type: "text",
          options: {
            field: "rel_rep",
            title: "联系人：",
            height: 16,
            fontSize: 12,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        },
        {
          tid: "cus_tele",
          title: "联系电话",
          type: "text",
          options: {
            field: "cus_tele",
            title: "联系电话：",
            height: 16,
            fontSize: 12,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        }
      ]
    },
    {
      groupName: "单据信息",
      printElements: [
        {
          tid: "taskdate",
          title: "订货日期",
          type: "text",
          options: {
            field: "taskdate",
            title: "订货日期：",
            height: 16,
            fontSize: 12,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        },
        {
          tid: "requiredate",
          title: "交货日期",
          type: "text",
          options: {
            field: "requiredate",
            title: "交货日期：",
            height: 16,
            fontSize: 12,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        },
        {
          tid: "dscrp",
          title: "销售订单备注",
          type: "text",
          options: {
            field: "dscrp",
            title: "销售订单备注：",
            height: 16,
            fontSize: 12,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        },
        {
          tid: "taskcode",
          title: "订单编号",
          type: "text",
          options: {
            field: "taskcode",
            title: "订单编号：",
            height: 16,
            fontSize: 12,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        },
        {
          tid: "accomplishdate",
          title: "订单实际完成时间",
          type: "text",
          options: {
            field: "accomplishdate",
            title: "订单实际完成时间：",
            height: 16,
            fontSize: 12,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        },
        {
          tid: "opemp",
          title: "建立人",
          type: "text",
          options: {
            field: "opemp",
            title: "建立人：",
            height: 16,
            fontSize: 12,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        },
        {
          tid: "relcode",
          title: "相关号",
          type: "text",
          options: {
            field: "relcode",
            title: "相关号：",
            height: 16,
            fontSize: 12,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        },
        {
          tid: "msttakeamt",
          title: "订单金额",
          type: "text",
          options: {
            field: "msttakeamt",
            title: "订单金额：",
            height: 16,
            fontSize: 12,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        },
        {
          tid: "damt",
          title: "定金",
          type: "text",
          options: {
            field: "damt",
            title: "定金：",
            height: 16,
            fontSize: 12,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        },
        {
          tid: "takeamt",
          title: "已收余额",
          type: "text",
          options: {
            field: "takeamt",
            title: "已收余额：",
            height: 16,
            fontSize: 12,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        },
        {
          tid: "takedamt",
          title: "已收订金",
          type: "text",
          options: {
            field: "takedamt",
            title: "已收订金：",
            height: 16,
            fontSize: 12,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        }
      ]
    },
    {
      groupName: "仓管",
      printElements: [
        {
          tid: "creater",
          title: "制单人",
          type: "text",
          options: {
            title: "制单人：",
            testData: "张三",
            height: 16,
            fontSize: 6.75,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        },
        {
          tid: "signer",
          title: "仓管签字",
          type: "text",
          options: {
            title: "库管签字：",
            height: 16,
            fontSize: 6.75,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle"
          }
        }
      ]
    },
    { ...BASE_PROVIDERS }
  ]
};
