80 行
2.6 KiB
PHP
可执行文件
80 行
2.6 KiB
PHP
可执行文件
<?php
|
|
|
|
namespace Retail\Controller;
|
|
|
|
use Common\Business\GoodsClassify;
|
|
use Common\Business\SerialNumberGoods;
|
|
use Common\Business\WarehousingRecord;
|
|
use Think\Controller;
|
|
|
|
//[1.7.90]
|
|
class WarehouseRecordController extends BaseController
|
|
{
|
|
|
|
public function index()
|
|
{
|
|
$merchant_id = session("merchant_userinfo")['id'];
|
|
$arr = array(
|
|
'exportOperation' => '/index.php/Retail/WarehouseRecord/export',
|
|
);
|
|
$authArr = checkFunction($arr);
|
|
$class_name = A('Api/Inventory')->GoodsClass($merchant_id);
|
|
$this->assign('authArr', $authArr);
|
|
$this->assign("goodsClass1", json_encode($class_name));
|
|
$this->display();
|
|
}
|
|
|
|
|
|
//入库记录串号列表
|
|
public function warehouseSerialList()
|
|
{
|
|
$data = I('post.');
|
|
$data['user_type'] = 3;
|
|
$data['serial_type'] = 2;
|
|
$SerialClass = new SerialNumberGoods();
|
|
$result = $SerialClass->recordSerialList($data);
|
|
$this->ajaxReturn($result);
|
|
}
|
|
|
|
|
|
//入库记录
|
|
public function recordList()
|
|
{
|
|
$data = I('post.');
|
|
$data['merchant_id'] = $this->merchant_id;
|
|
$data['operator_type'] = 1;
|
|
$RecordClass = new WarehousingRecord();
|
|
$result = $RecordClass->merchantWarehousingGoodsRecord($data); //商户入库商品记录信息
|
|
$this->ajaxReturn($result);
|
|
}
|
|
|
|
function export()
|
|
{
|
|
ini_set('memory_limit', '-1');
|
|
$content = I('get.');
|
|
$content['merchant_id'] = $this->merchant_id;
|
|
$content['operator_type'] = 1; //web端
|
|
$record = new WarehousingRecord();
|
|
$result = $record->merchantWarehousingGoodsRecord($content); //商户入库商品记录信息
|
|
$fileds_name = "入库记录";
|
|
$arr = array(
|
|
array('index', '序号'),
|
|
array('type_name', '入库类型'),
|
|
array('goods_name', '商品名称'),
|
|
array('sku_name', '规格名称'),
|
|
array('goods_number', '货号'),
|
|
array('goods_code', '条码'),
|
|
array('sku_num', '规格基数'),
|
|
array('company', '单位'),
|
|
array('build_date', '生产日期'),
|
|
array('quality_guarantee_period', '保质期'),
|
|
array('warehouse_num', '入库数量'),
|
|
array('warehouse_price', '入库价'),
|
|
array('subtotal', '合计'),
|
|
array('remarks', '备注'),
|
|
array('add_time', '入库时间'),
|
|
);
|
|
$str = $fileds_name . ',导出日期:' . date('Y-m-d H:i:s', time());
|
|
getExcel($fileds_name, $arr, $result['data']['list'], $str);
|
|
}
|
|
} |