|
|
@@ -2046,7 +2046,7 @@ class WorkOrder extends Api
|
|
|
$list['出库记录'] = \db('设备_报工日志')
|
|
|
->where('order_id|款号',$param['order'])
|
|
|
->where('name','出库')
|
|
|
- ->field('order_id as 订单编号,款号,number as 数量,rq as 出库时间,sys_id as 上报机台,recipient as 出库人员')
|
|
|
+ ->field('order_id as 订单编号,款号,number as 数量,rq as 出库时间,sys_id as 上报机台,receipt_number as 出库单据编号,recipient as 出库人员')
|
|
|
->order('出库时间 desc')
|
|
|
->select();
|
|
|
//退还记录查询
|
|
|
@@ -2200,4 +2200,87 @@ class WorkOrder extends Api
|
|
|
->select();
|
|
|
$this->success('成功',$list);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 单据号查询数据
|
|
|
+ * @return void
|
|
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
+ * @throws \think\db\exception\ModelNotFoundException
|
|
|
+ * @throws \think\exception\DbException
|
|
|
+ */
|
|
|
+ public function ReceiptDetail()
|
|
|
+ {
|
|
|
+ if ($this->request->isGet() === false){
|
|
|
+ $this->error('请求错误');
|
|
|
+ }
|
|
|
+ $param = $this->request->param();
|
|
|
+ if (empty($param)){
|
|
|
+ $this->error('参数错误');
|
|
|
+ }
|
|
|
+ $list = \db('设备_报工日志')
|
|
|
+ ->where('receipt_number','like','%',$param['receipt'].'%')
|
|
|
+ ->field('order_id as 订单编号,款号,物料名称,number as 数量,rq as 日期,sys_id as 操作机台,receipt_number as 出库单据编号,recipient as 领用人员')
|
|
|
+ ->select();
|
|
|
+ if (empty($list)){
|
|
|
+ $this->error('未找到该出库单');
|
|
|
+ }else{
|
|
|
+ $this->success('成功',$list);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 出库单列表
|
|
|
+ * @return void
|
|
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
+ * @throws \think\db\exception\ModelNotFoundException
|
|
|
+ * @throws \think\exception\DbException
|
|
|
+ */
|
|
|
+ public function ReceiptList()
|
|
|
+ {
|
|
|
+ if ($this->request->isGet() === false){
|
|
|
+ $this->error('请求错误');
|
|
|
+ }
|
|
|
+ $param = $this->request->param();
|
|
|
+ if (empty($param)){
|
|
|
+ $this->error('参数错误');
|
|
|
+ }
|
|
|
+ $list = \db('设备_报工日志')
|
|
|
+ ->where('rq','like','%'.$param['mouth'].'%')
|
|
|
+ ->field('receipt_number as 出库单,order_id as 订单编号,款号,物料名称,rq as 日期,sys_id as 操作机台,recipient as 领料人员')
|
|
|
+ ->group('出库单')
|
|
|
+ ->order('rq desc')
|
|
|
+ ->select();
|
|
|
+ if (empty($list)){
|
|
|
+ $this->success('未找到数据');
|
|
|
+ }else{
|
|
|
+ $this->success('成功',$list);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 出库单左侧菜单
|
|
|
+ * @return void
|
|
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
+ * @throws \think\db\exception\ModelNotFoundException
|
|
|
+ * @throws \think\exception\DbException
|
|
|
+ */
|
|
|
+ public function getReceiptTab()
|
|
|
+ {
|
|
|
+ if ($this->request->isGet() === false){
|
|
|
+ $this->error('请求错误');
|
|
|
+ }
|
|
|
+ $list = \db('设备_报工日志')
|
|
|
+ ->field([
|
|
|
+ "DATE_FORMAT(rq, '%Y-%m') AS month",
|
|
|
+ ])
|
|
|
+ ->group('month')
|
|
|
+ ->order('month DESC')
|
|
|
+ ->select();
|
|
|
+ if (empty($list)){
|
|
|
+ $this->error('未找到数据');
|
|
|
+ }else{
|
|
|
+ $this->success('成功',$list);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|