Commit 1fa82420 authored by wxl's avatar wxl

添加采购时间

parent 85fa44f9
......@@ -113,6 +113,12 @@ class Order extends BaseEntity
*/
private $adminId;
/**
* 采购时间
* @ORM\Column(name="create_time", type="integer", length=10)
*/
private $createTime;
/**
* 供应商
* @ORM\ManyToOne(targetEntity="Customer\Entity\Supplier", inversedBy="orders")
......@@ -354,4 +360,20 @@ class Order extends BaseEntity
$this->adminId = $adminId;
}
/**
* @return mixed
*/
public function getCreateTime()
{
return $this->createTime;
}
/**
* @param mixed $createTime
*/
public function setCreateTime($createTime)
{
$this->createTime = $createTime;
}
}
\ No newline at end of file
......@@ -121,6 +121,26 @@ class SearchOrderForm extends Form
'class' => 'form-control input-sm'
]
]);
$this->add([
'type' => 'text',
'name' => 'start_time',
'attributes' => [
'id' => 'start_time',
'class' => 'form-control input-sm',
'placeholder' => $this->translator->translate('起始时间')
]
]);
$this->add([
'type' => 'text',
'name' => 'end_time',
'attributes' => [
'id' => 'end_time',
'class' => 'form-control input-sm',
'placeholder' => $this->translator->translate('结束时间')
]
]);
}
public function addInputFilter()
......@@ -198,5 +218,22 @@ class SearchOrderForm extends Form
'name' => 'return_state',
'required' => false
]);
$inputFilter->add([
'name' => 'start_time',
'required' => false,
'filters' => [
['name' => 'StringTrim'],
['name' => 'StripTags']
]
]);
$inputFilter->add([
'name' => 'end_time',
'required' => false,
'filters' => [
['name' => 'StringTrim'],
['name' => 'StripTags']
]
]);
}
}
\ No newline at end of file
......@@ -48,6 +48,8 @@ class OrderRepository extends EntityRepository
if(isset($search['payment_code']) && !empty($search['payment_code'])) $queryBuilder->andWhere($queryBuilder->expr()->eq('o.paymentCode', ':code'))->setParameter('code', $search['payment_code']);
if(isset($search['p_order_state']) && is_numeric($search['p_order_state'])) $queryBuilder->andWhere($queryBuilder->expr()->eq('o.pOrderState', $search['p_order_state']));
if(isset($search['return_state']) && is_numeric($search['return_state'])) $queryBuilder->andWhere($queryBuilder->expr()->eq('o.returnState', $search['return_state']));
if(isset($search['start_time']) && !empty($search['start_time'])) $queryBuilder->andWhere($queryBuilder->expr()->gte('o.createTime', ':startTime'))->setParameter('startTime', strtotime($search['start_time']));
if(isset($search['end_time']) && !empty($search['end_time'])) $queryBuilder->andWhere($queryBuilder->expr()->lte('o.createTime', ':endTime'))->setParameter('endTime', strtotime($search['end_time']));
return $queryBuilder;
}
......
......@@ -49,6 +49,7 @@ class OrderManager
$order->setAdminId($adminId);
$order->setOneSupplier($supplier);
$order->setCreateTime(time());
$array = ['pOrderGoodsAmount' => 0, 'pOrderTaxAmount' => 0, 'pOrderAmount' => 0];
foreach ($goodsData['goodsId'] as $key => $value) {
......
......@@ -29,6 +29,7 @@
<th width="10%"><?php echo $this->translate('采购金额'); ?></th>
<th width="6%"><?php echo $this->translate('状态'); ?></th>
<th width="6%"><?php echo $this->translate('退货'); ?></th>
<th width="10%"><?php echo $this->translate('时间'); ?></th>
<th width="15%"><?php echo $this->translate('操作'); ?></th>
</tr>
<?php
......@@ -77,6 +78,16 @@
<?php echo $this->formElement($sForm->get('return_state')); ?>
<?php echo $this->formElementErrors($sForm->get('return_state'), ['class'=>'error-message']);?>
</td>
<td>
<p>
<?php echo $this->formElement($sForm->get('start_time')); ?>
</p>
<div>
<?php echo $this->formElement($sForm->get('end_time')); ?>
</div>
<?php echo $this->formElementErrors($sForm->get('start_time'), ['class'=>'error-message']); ?>
<?php echo $this->formElementErrors($sForm->get('end_time'), ['class'=>'error-message']); ?>
</td>
<td>
<button type="submit" class="btn btn-info btn-sm"><i class="fa fa-search"></i></button>
<?php
......@@ -101,6 +112,7 @@
<td><?php echo $this->erpCurrencyFormat($order->getPOrderAmount());?></td>
<td><?php echo $this->PurchaseHelper()->orderState($order->getPOrderState(), 2); ?></td>
<td><?php echo ($order->getReturnState() == 1 ? '<b class="text-danger">'.$this->translate('有').'</b>' : $this->translate('无')); ?></td>
<td><?php echo date("Y-m-d H:i", $order->getCreateTime()); ?></td>
<td>
<?php if($order->getPOrderState() == 0) { ?>
<a href="<?php echo $this->url('p-order',
......@@ -140,4 +152,8 @@
</div>
</section>
</div>
\ No newline at end of file
</div>
<script type="text/javascript">
laydate.render({elem: '#start_time'});
laydate.render({elem: '#end_time'});
</script>
\ No newline at end of file
......@@ -67,7 +67,12 @@
<b><?php echo $this->translate('供应商座机'); ?></b><?php echo $this->escapeHtml($this->orderInfo->getSupplierTelephone());?>
</div>
</div>
<div class="col-xs-8 form-group">
<div class="col-xs-4 form-group">
<div class="col-sm-12">
<b><?php echo $this->translate('采购时间'); ?></b><?php echo date("Y-m-d H:i:s", $this->orderInfo->getCreateTime());?>
</div>
</div>
<div class="col-xs-4 form-group">
<div class="col-sm-12">
<b><?php echo $this->translate('备注'); ?></b><?php echo $this->escapeHtml($this->orderInfo->getPOrderInfo());?>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment