import { remote } from './remote';
import store  from '@/store';
import { genWarehouseAuthSearchModal,genWarehouseLocatorSearchModal } from  '@/views/kzyWMS/SearchModal';

let warehouseId = null;

const items = [
  // 仓库
  	...genWarehouseAuthSearchModal(1, true, false,null,null,
  			{ span: 8, labelCol: { span: 6 } }
  		),
	
	// 货位
		/* ...genWarehouseLocatorSearchModal(1, false, false,
				function(vn,p){
					p.params.warehouseId = warehouseId;
					return p;
				}, 
				function (rowData, form) {
					if (!rowData) {
						form.setFieldsValue({
							warehouseLocatorId: '',
							warehouseLocatorCode:'',
							warehouseLocatorName:'',
						})
					} else {
						form.setFieldsValue({
							warehouseLocatorId: rowData[0].warehouseLocatorId,
							warehouseLocatorCode: rowData[0].warehouseLocatorCode,
							warehouseLocatorName: rowData[0].warehouseLocatorName,
						})
					}
				},
				{ span: 8, labelCol: { span: 6 } }
			), */
	/* 货位id隐藏字段*/
	
	  /* {type:'select',name:'containerCode',label: '容器', ...remote('pub_container_containertype') }, */
	  {type: 'input',name: 'billCode',label: '订单编码',value: '',},
	  {type: 'input',name: 'billId',label: '订单id',value: '',},
	  {type: 'input',name: 'itemCode',label: '商品编号',value: '',},
	  {type: 'input',name: 'waveId',label: '波次',value: '',},
	 
   {
		span: 8,
		type: 'buttonGroup',
		style: { textAlign: 'center'},
		// labelCol: { span: 8 },	//标签布局 如：{span: 3, offset: 12}
		// wrapperCol: { span: 12 },  // 输入控件布局+标签布局=span
		options: [
		   {value: '查询',icon: 'search',btnType: 'primary',style: 'margin-right:16px',htmlType: 'submit'},
		   {value: '重置',name: 'ccz',icon: 'redo',
			on: {
			  click(event, form) {
				form.resetFields();
				 form.setFieldsValue({
				  		warehouseName: '',
						warehouseId:'',
						locatorId:'',
						warehouseLocatorName:'',
				 });
					}
				}
			}
	 ]}
];
 
const columns = [
	{ dataIndex:'id', title:'id',hidden:true },
	{ dataIndex:'billCode', title:'订单编码' },
	{ dataIndex:'lotNo', title:'批号' },
	{ dataIndex:'locatorId', title:'货位',scopedSlots:{customRender:'locatorId'} },
	{ dataIndex:'locatorType', title:'货位类型', scopedSlots:{customRender:'locatorType'} },
	{ dataIndex:'warehouseAreaCode', title:'库区' },
	{ dataIndex:'waveId', title:'波次' },
	{ dataIndex:'billId', title:'订单id' },
	{ dataIndex:'itemCode', title:'商品编号' },
	{ dataIndex:'itemName', title:'商品名称' },
	{ dataIndex:'qty', title:'数量' },
	{ dataIndex:'warehouseId', title:'仓库',scopedSlots:{customRender:'warehouseId'} },
]
 export { items,columns }
