transfer add settlement,fixbug add transport lost

This commit is contained in:
qianhy
2023-04-20 14:14:53 +08:00
committed by lccsw
parent bbde8549ed
commit 9fbcd46197
2 changed files with 32 additions and 2 deletions
+25 -2
View File
@@ -245,6 +245,7 @@ class Transfer extends HD_Controller
$trailer_fees .= '-' . $re_biz['biz_name'];
}
$setValue['fees'] = $trailer_fees;
$setValue['settlement'] = in_array('settlement', array_keys($jsondata)) ? $jsondata['settlement'] : '';
$setValue['reason'] = $jsondata['reason'] ? $jsondata['reason'] : '';
}
$lists[] = $setValue;
@@ -365,6 +366,7 @@ class Transfer extends HD_Controller
}
$abnormal['imgs'] = $imgs;
}
$jsondata['settlement'] && $fields[] = ['title' => '调拨结算价', 'value' => $jsondata['settlement']]; # 23.04.20 新增一个字段 调拨结算价
$jsondata['reason'] && $fields[] = ['title' => '调拨理由', 'value' => $jsondata['reason']];
if ($re['trailer_fees']) {
$trailer_fees = $re['trailer_fees'] ? $re['trailer_fees'] . '元' : '';
@@ -395,7 +397,7 @@ class Transfer extends HD_Controller
$view = 'items/transfer/get_add';
$showInfo = ['vin' => $vin, 'items_info' => ['id' => 0, 'title' => '', 'vin' => '', 'cor' => '', 'address' => ''],
'feesTypeAry' => $this->mdTransfer->feesTypeAry(), 'feesBizList' => [], 'uidTypeAry' => $this->mdTransfer->uidTypeAry()];
$info = ['id' => 0, 'status' => -1, 'item_id' => 0, 'arti_id' => [], 'out_bak' => 0, 'in_bak' => 0, 'trailer_fees' => '', 'fees_city' => '', 'trailer_fees' => 0,
$info = ['id' => 0, 'status' => -1, 'item_id' => 0, 'arti_id' => [], 'out_bak' => 0, 'in_bak' => 0, 'settlement' => 0, 'trailer_fees' => '', 'fees_city' => '', 'trailer_fees' => 0,
'fees_type' => 1, 'fees_biz_id' => '', 'transport' => ['name' => '', 'mobile' => '', 'cardid' => ''], 'reason' => ''];
$this->data['transports'] = $this->transports(['type' => 'get']);//运输人员
$this->data['showInfo'] = $showInfo;
@@ -427,6 +429,7 @@ class Transfer extends HD_Controller
$info = ['id' => $id, 'status' => $re['status'], 'out_bak' => 0, 'in_bak' => 0
, 'item_id' => $item_id
, 'arti_id' => $re['arti_id'] ? explode(',', $re['arti_id']) : []
, 'settlement' => in_array('settlement', array_keys($jsondata)) ? $jsondata['settlement'] : ''
, 'trailer_fees' => $re['trailer_fees'] ? $re['trailer_fees'] : ''
, 'fees_city' => $re['fees_city'] ? $re['fees_city'] : ''
, 'fees_type' => $re['fees_type']
@@ -547,15 +550,22 @@ class Transfer extends HD_Controller
{
$info = $this->input->post('info');
$takeCar = $this->input->post('takeCar');
$settlement = $info['settlement'];
if ($settlement == '' && $settlement != '0'){
return $this->show_json(SYS_CODE_FAIL, '调拨结算价不能为空!');
}
$settlement = intval($settlement);
$trailer_fees = intval($info['trailer_fees']);
$remind = $info['remind'];//1提交
$db_status = -1;
$db_status_not2_flag = true;
$jsondata_old = array();
if ($info['id']) {//修改调拨
$re_t = $this->mdTransfer->get(array('id' => $info['id']));
if (!$re_t || empty($re_t)) {
return $this->show_json(SYS_CODE_FAIL, '车辆调拨不存在!');
}
$jsondata_old = $re_t['jsondata'] ? json_decode($re_t['jsondata'], true) : [];
$db_status = $re_t['status'];
if ($db_status == 2) {
$db_status_not2_flag = false; // 2022.12.20 “确认接车”状态的数据,修改提交后:不改状态,不发短信
@@ -613,7 +623,18 @@ class Transfer extends HD_Controller
if ($re && $re['id'] != $info['id']) {
return $this->show_json(SYS_CODE_FAIL, '操作失败,车辆正在调拨中...');
}
$jsondata['transport'] = $info['transport'];//运输人员
$jsondata['settlement'] = $settlement;
if ($info['id']){
# 23.04.20修复:修改时丢失除"name", "cardid", "mobile"数据情况
$transport = $jsondata_old['transport'] ? $jsondata_old['transport'] : [];
$transport['name'] = $info['transport']['name'];
$transport['cardid'] = $info['transport']['cardid'];
$transport['mobile'] = $info['transport']['mobile'];
$jsondata['transport'] = $transport;
}
else{
$jsondata['transport'] = $info['transport'];//运输人员
}
$jsondata['reason'] = $info['reason'];//调拨理由
$c_time = time();
if ($takeCar[3]['type'] == 2) {//接收信息员
@@ -1021,6 +1042,7 @@ class Transfer extends HD_Controller
$temp['in_addr_name'] = $value['in_addr_name'];
$temp['abnormal'] = $value['abnormal'];
$temp['status_name'] = $value['status_name'];
$temp['settlement'] = $value['settlement'];
$temp['trailer_fees'] = $value['trailer_fees'];
$temp['fees'] = $value['fees'];
$temp['reason'] = $value['reason'];
@@ -1038,6 +1060,7 @@ class Transfer extends HD_Controller
'in_addr_name' => '存放地址',
"abnormal" => "异常",
"status_name" => "状态",
"settlement" => "调拨结算价",
"trailer_fees" => "运输费用",
"fees" => "费用承担方",
"reason" => "调拔理由",
+7
View File
@@ -296,6 +296,13 @@
</div>
</div>
<div class="am-form-group">
<label class="am-para-label w100">调拨结算价:</label>
<div class="am-para-inline w120">
<input type="text" v-model="info.settlement" placeholder="输入金额">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label w100">运输费用:</label>
<div class="am-para-inline w120">