diff --git a/admin/controllers/receiver/Orders.php b/admin/controllers/receiver/Orders.php index a54bde68..27b388f3 100644 --- a/admin/controllers/receiver/Orders.php +++ b/admin/controllers/receiver/Orders.php @@ -114,8 +114,6 @@ class Orders extends HD_Controller $row['entrust_name'] = $row['info_json']['entrust_name'] ? $row['info_json']['entrust_name'] : ''; $row['entrust_idcard'] = $row['info_json']['entrust_idcard'] ? $row['info_json']['entrust_idcard'] : ''; $row['credit'] = $row['info_json']['c_credit'] ? $row['info_json']['c_credit'] : ''; - $row['business_licence'] = $row['info_json']['business_licence'] ? array('value' => $row['info_json']['business_licence'] - , 'src' => build_qiniu_image_url($row['info_json']['business_licence'])) : array('value' => '', 'src' => ''); $row['note'] = $jsondata['note'] ? $jsondata['note'] : ''; //获取车信息 $brand = $this->auto_brand_model->get(['id' => $row['brand_id']], 'name'); @@ -150,10 +148,11 @@ class Orders extends HD_Controller $row['loan_info'] = $loan; } //获取开票 - $bill = $this->order_bills_model->get(['o_id' => $row['id']], 'status,file,cardidA,cardidB'); + $bill = $this->order_bills_model->get(['o_id' => $row['id']], 'status,file,cardidA,cardidB,business_licence'); $bill['file'] = $bill['file'] ? build_qiniu_image_url($bill['file']) : ''; $bill['cardidA'] = $bill['cardidA'] ? array('value' => $bill['cardidA'], 'src' => build_qiniu_image_url($bill['cardidA'])) : array('value' => '', 'src' => ''); $bill['cardidB'] = $bill['cardidB'] ? array('value' => $bill['cardidB'], 'src' => build_qiniu_image_url($bill['cardidB'])) : array('value' => '', 'src' => ''); + $bill['business_licence'] = $bill['business_licence'] ? array('value' => $bill['business_licence'], 'src' => build_qiniu_image_url($bill['business_licence'])) : array('value' => '', 'src' => ''); $bill['status'] = intval($bill['status']); $row['bill'] = $bill; //获取合同文件 @@ -256,13 +255,21 @@ class Orders extends HD_Controller public function edit() { $params = $this->input->post(); - $re = $this->orders_model->get(['id' => $params['id']]); + if (!$params['id']) { + return $this->show_json(SYS_CODE_FAIL, '参数错误!'); + } $result = ''; if ($params['type'] == 1) {//修改备注 + $re = $this->orders_model->get(['id' => $params['id']]); $jsondata = json_decode($re['jsondata'], true); $jsondata['note'] = $params['note']; $upd = array('jsondata' => json_encode($jsondata, JSON_UNESCAPED_UNICODE)); $result = $this->orders_model->update($upd, ['id' => $params['id']]); + } else if ($params['type'] == 2) {//修改营业执照 + if (!$params['business_licence']) { + return $this->show_json(SYS_CODE_FAIL, '请上传营业执照'); + } + $result = $this->order_bills_model->update(array('business_licence' => $params['business_licence']), ['o_id' => $params['id']]); } if ($result) { return $this->show_json(SYS_CODE_SUCCESS, '保存成功'); @@ -310,31 +317,6 @@ class Orders extends HD_Controller } } - /** - * Notes:更新营业执照 - * Created on: 2021/9/26 10:02 - * Created by: dengbw - * @return bool - */ - function edit_business_licence() - { - $id = $this->input->post('id'); - $business_licence = $this->input->post('business_licence'); - if (!$business_licence) { - return $this->show_json(SYS_CODE_FAIL, '请上传营业执照'); - } - $row = $this->orders_model->get(['id' => $id]); - $info_json = json_decode($row['info_json'], true); - $info_json['business_licence'] = $business_licence; - $upd = array('info_json' => json_encode($info_json, JSON_UNESCAPED_UNICODE)); - $result = $this->orders_model->update($upd, ['id' => $id]); - if ($result) { - return $this->show_json(SYS_CODE_SUCCESS, '保存成功'); - } else { - return $this->show_json(SYS_CODE_FAIL, '保存失败'); - } - } - //删除单条数据 public function del() { diff --git a/admin/views/receiver/orders/agentinfo.php b/admin/views/receiver/orders/agentinfo.php index 85da50af..0fcdd657 100644 --- a/admin/views/receiver/orders/agentinfo.php +++ b/admin/views/receiver/orders/agentinfo.php @@ -8,14 +8,14 @@
-
+
-
-
+
-
- +
+
+
+
+
+
+
- +
-
+
-
- +
+
- +
-
+
+
+
+
+
+
-
-
+
-
diff --git a/admin/views/receiver/orders/get.php b/admin/views/receiver/orders/get.php index afd33f9c..01521675 100644 --- a/admin/views/receiver/orders/get.php +++ b/admin/views/receiver/orders/get.php @@ -41,45 +41,26 @@
-
+
-
+
-
- -
- -
-
+
-
- -
- -
-
-
- -
- -
-
-
- +
+
- +
@@ -89,22 +70,44 @@
- 营业执照
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
@@ -528,23 +531,7 @@ , anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数) }); }, - save_edit: function (type) { - var that = this; - var data_post; - if (type == 1) { - data_post = {type: type, id: that.info.id, note: that.info.note}; - } - $.post("/receiver/orders/edit", data_post, function (data) { - if (data.code) { - layer.msg(data.msg, {time: 2000, icon: 1}, function () { - $.form.reload(); - }); - } else { - layer.msg(data.msg, {icon: 2}); - } - }, 'json'); - }, - //保存 + //保存身份证 save_cardID: function () { var that = this; var data_post = { @@ -562,14 +549,19 @@ } }, 'json'); }, - //保存 - save_business_licence: function () { + save_edit: function (type) { var that = this; - var data_post = { - id: that.info.id, - business_licence: that.info.business_licence.value - }; - $.post("/receiver/orders/edit_business_licence", data_post, function (data) { + var data_post; + if (type == 1) { + data_post = {type: type, id: that.info.id, note: that.info.note}; + } else if (type == 2) { + data_post = { + type: type, + id: that.info.id, + business_licence: that.info.bill.business_licence.value + }; + } + $.post("/receiver/orders/edit", data_post, function (data) { if (data.code) { layer.msg(data.msg, {time: 2000, icon: 1}, function () { $.form.reload();