作者 王晓刚
1 个管道 的构建 通过 耗费 0 秒

业务员订单筛选问题

... ... @@ -265,6 +265,53 @@ class BirdController extends HomeBaseController
return $result;
}
public function monitoring($indent_id = null){
// if(empty($indent_id)){
// $this->error('缺少必要参数','','','');
// }
// $this->indent_id = $indent_id;
// $where['id'] = ['eq',$this->indent_id];
// $indentModel = new IndentModel();
// $indent = $indentModel->findData($where);
// if(empty($indent)){
// $this->error('未查询到该订单','','','');
// }
//// if($indent['state'] != 2){
//// $this->error('该订单不是已发货状态','','','');
//// }
// //收货地址
// $where2['id'] = ['eq',$indent['indent_address']];
// $addressModel = new AddressModel();
// $address = $addressModel->findData($where2);
//请求url,接口正式地址:http://api.kdniao.com/api/eorderservice 测试环境地址:http://sandboxapi.kdniao.com:8080/kdniaosandbox/gateway/exterfaceInv
defined('ReqURL') or define('ReqURL', 'http://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx');
$jsonResult = $this->getOrder2();
$result = json_decode($jsonResult,true);
dump($result);
if(empty($result['Reason'])){
return ['code'=>20000,'msg'=>'SUCCESS'];//订单轨迹
}else{
return ['code'=>40000,'msg'=>$result['Reason']];
}
}
public function getOrder2(){
$requestData= "{'OrderCode':'','ShipperCode':'YD','LogisticCode':'3718481494155'}";
$datas = array(
'EBusinessID' => EBusinessID,
'RequestType' => '1002',
'RequestData' => urlencode($requestData) ,
'DataType' => '2',
);
$datas['DataSign'] = $this->encrypt($requestData, AppKey);
$result=$this->sendPost(ReqURL, $datas);
//根据公司业务处理返回的信息......
return $result;
}
... ...
... ... @@ -207,6 +207,7 @@
<div class="log_three_list_contant" style="display: block;">
<foreach name="$data" item="vo">
<if condition="$vo.state eq 2">
<php>$arr1[] = $vo;</php>
<div class="log_three_list order_{$vo.id}">
<div class="log_three_list_top">
<div class="log_three_list_top_left">
... ... @@ -246,7 +247,7 @@
{$i_g.book_name}
</div>
<div class="log_three_center_two">×{$i_g.number}</div>
<div class="log_three_center_three"><span></span>{$i_g.price*$i_g.number}</div>
<div class="log_three_center_three"><span></span>{$i_g.price}</div>
</div>
</div>
</foreach>
... ... @@ -265,6 +266,9 @@
查看物流
</div>
</a>
<div class="log_three_bottom" data-indent-id="{$vo.id}">
完成
</div>
</if>
<elseif condition="$vo.state eq 3"/>
<div class="log_three_bottom" data-indent-id="{$vo.id}">
... ... @@ -275,11 +279,15 @@
</div>
</if>
</foreach>
<empty name="$arr1">
<div style="text-align: center;width: 100%;height:100%;margin:0 auto;">暂无数据</div>
</empty>
</div>
<!--已发货-->
<div class="log_three_list_contant">
<foreach name="$data" item="vo">
<if condition="$vo.state eq 5">
<php>$arr2[] = $vo;</php>
<div class="log_three_list order_{$vo.id}">
<div class="log_three_list_top">
<div class="log_three_list_top_left">
... ... @@ -319,7 +327,7 @@
{$i_g.book_name}
</div>
<div class="log_three_center_two">×{$i_g.number}</div>
<div class="log_three_center_three"><span></span>{$i_g.price*$i_g.number}</div>
<div class="log_three_center_three"><span></span>{$i_g.price}</div>
</div>
</div>
</foreach>
... ... @@ -345,14 +353,17 @@
</if>
</div>
</div>
</a>
</if>
</foreach>
<empty name="$arr2">
<div style="text-align: center;width: 100%;height:100%;margin:0 auto;">暂无数据</div>
</empty>
</div>
<!--已完成-->
<div class="log_three_list_contant">
<foreach name="$data" item="vo">
<if condition="$vo.state eq 3">
<php>$arr3 = $vo;</php>
<div class="log_three_list order_{$vo.id}">
<div class="log_three_list_top">
<div class="log_three_list_top_left">
... ... @@ -392,7 +403,7 @@
{$i_g.book_name}
</div>
<div class="log_three_center_two">×{$i_g.number}</div>
<div class="log_three_center_three"><span></span>{$i_g.price*$i_g.number}</div>
<div class="log_three_center_three"><span></span>{$i_g.price}</div>
</div>
</div>
</foreach>
... ... @@ -420,21 +431,26 @@
</div>
</if>
</foreach>
<empty name="$arr3">
<div style="text-align: center;width: 100%;height:100%;margin:0 auto;">暂无数据</div>
</empty>
</div>
</div>
<!-- 底部按钮 -->
<div class="log_three_list_fixed">
<div class="log_three_fixed_left">
<div class="log_three_fixed_left_one">
<img src="__TMPL__/public/assets/images/fangkuang.png" alt=""/>
<div style="position: fixed;bottom:0;width: 100%;">
<div class="log_three_list_fixed">
<div class="log_three_fixed_left">
<div class="log_three_fixed_left_one">
<img src="__TMPL__/public/assets/images/fangkuang.png" alt=""/>
</div>
<div class="log_three_fixed_left_two">
全选
</div>
</div>
<div class="log_three_fixed_left_two">
全选
<div class="log_three_fixed_right unify_all">
统一发货
</div>
</div>
<div class="log_three_fixed_right unify_all">
统一发货
</div>
</div>
<script src="__TMPL__/public/assets/js/jquery.js"></script>
<script src="__TMPL__/public/assets/js/base.js"></script>
... ... @@ -445,7 +461,6 @@
// 选择学校
$(".three_model_school_left").click(function () {
var indexs = $(this).index();
console.log(indexs);
$(".three_model_school_data").eq(indexs).css("display", "block").siblings().css("display", "none");
});
... ... @@ -454,19 +469,38 @@
$(this).addClass("log_three_tab_two").addClass("word_color").addClass('aaa').siblings().removeClass("log_three_tab_two").removeClass("word_color").removeClass("aaa");
$('.log_three_list_contant').eq(tabIndex).css('display', 'block').siblings().css('display', 'none');
search();
$('.log_three_fixed_left_one img').attr('src',"__TMPL__/public/assets/images/fangkuang.png")
});
$(".three_model_school_tab>div").click(function () {
$(this).addClass("three_model_school_hover").addClass("word_color").addClass('aaa').siblings().removeClass("three_model_school_hover").removeClass("word_color").removeClass("aaa");
});
$("body").on('click', '.log_three_list_top_lo', function () {
console.log($(this).find("img").attr("src"));
if ($(this).find("img").attr("src") == "__TMPL__/public/assets/images/fangkuang.png") {
$(this).find("img").attr("src", "__TMPL__/public/assets/images/xuanzhong (1).png");
} else {
$(this).find("img").attr("src", "__TMPL__/public/assets/images/fangkuang.png");
}
//判断订单是否全选了
check();
});
function check(){
var index = $(".log_three_tab_top .log_three_tab_one").index($('.aaa'));
var length = $(".log_three_list_contant").eq(index).find('.log_three_list_top_lo img').length;
var l = 0;
for(var n=0;n<length;n++){
console.log($(".log_three_list_contant").eq(index).find('.log_three_list_top_lo img').eq(n).attr('src'));
if($(".log_three_list_contant").eq(index).find('.log_three_list_top_lo img').eq(n).attr('src') == "__TMPL__/public/assets/images/xuanzhong (1).png"){
l++
}
}
console.log('@@@@@'+l+'@@@@@'+length);
if(l == length){
$('.log_three_fixed_left_one img').attr('src',"__TMPL__/public/assets/images/xuanzhong (1).png")
}else{
$('.log_three_fixed_left_one img').attr('src',"__TMPL__/public/assets/images/fangkuang.png")
}
}
$(".log_three_fixed_left_one").click(function () {
if (
$(this)
... ... @@ -505,13 +539,11 @@
var index = $(this).index();
$(this).addClass('there_unActive').siblings().removeClass('there_unActive');
$('.log_three_select_contant').text($(this).text()).css("color", "#333");
console.log($('.log_three_select_contant').text($(this).text()))
$(".tx_mask_tongyi").hide();
$("#is_courier").val($(this).attr('data-id'))
})
//选择快递方式
$(".log_psong_select").click(function () {
console.log(213)
$(".tx_mask_kuaidi").css({
display: "block"
});
... ... @@ -525,7 +557,6 @@
});
var index = $(".log_three_bottom").index();
$("body").on('click', '.log_three_bottom', function () {
console.log(index);
$(".tx_maskone").css({
display: "block"
});
... ... @@ -544,7 +575,6 @@
$(this).addClass("there_unActive").siblings().removeClass("there_unActive");
if ($(this).hasClass("there_unActive")) {
$xuexiao = $(this).text();
console.log($xuexiao);
$(".there_university").hide();
$(".there_class").show();
$('.three_model_school_left').eq(0).removeClass('word_color').removeClass('three_model_school_hover');
... ... @@ -552,7 +582,6 @@
}
});
$('body').on('click', ".there_class div", function () {
console.log($xuexiao)
var index2 = $(this).index();
$(this).addClass("there_unActive").siblings().removeClass("there_unActive");
if ($xuexiao == undefined) {
... ... @@ -579,14 +608,11 @@
var grade = $('#grade').val();
var state = $('.log_three_tab_top .aaa').attr('data-state');
var is_courier = $('#is_courier').val();
console.log(state);
// if (school == '') {
// alert('请选择学校')
// } else if (grade == '') {
// alert('请选择班级')
// } else {
console.log(school);
console.log(grade);
$.ajax({
'url': "{:url('order_salesman/getOrderSalesman')}",
'type': "GET",
... ... @@ -595,8 +621,11 @@
var index = $('.log_three_tab_top div').index($('.aaa'));
if (data.code == 1) {
var result = data.data;
console.log(result)
var html = '';
if(result == 0){
var html = "<div style=\"text-align: center;width: 100%;height:100%;margin:0 auto;\">暂无数据</div>";
}else{
var html = '';
}
for (var i = 0; i < result.length; i++) {
if (result[i]['state'] == 2) {
var state = '待发货';
... ... @@ -788,7 +817,6 @@
'indent_id': indent_id
},
success: function (res) {
console.log(res);
if (res.code == 1) {
$('.order_' + indent_id).remove();
$(".tx_maskone").css({
... ... @@ -806,9 +834,10 @@
})
});
$('body').on('click', '.unify_all', function () {
var length = $('.log_three_list_top_lo img').length - 1;
var index = $(".log_three_tab_top .log_three_tab_one").index($('.aaa'));
var length = $(".log_three_list_contant").eq(index).find('.log_three_list_top_lo img').length-1;
var arr = [];
for (var i = 0; i <= length; i++) {
for (var i = 0; i < length; i++) {
if ($('.log_three_list_top_lo img').attr('src') == "__TMPL__/public/assets/images/xuanzhong (1).png") {
arr.push($('.log_three_list_top_lo img').eq(i).attr('data-indent-id'));
}
... ... @@ -852,7 +881,6 @@
function update() {
var is_courier = $('#is_courier').val();
var index = $('.log_three_tab_top div').index($('.aaa'));
console.log(is_courier);
if (is_courier == 1 && index == 0) {
$('.log_three_list_fixed').show();
} else if (is_courier == 2 || index != 0) {
... ...
... ... @@ -247,7 +247,7 @@
</div>
</div>
<div class="log_four_order_right">
<span></span>{$i_g.price*$i_g.number}
<span></span>{$i_g.price}
</div>
</div>
</foreach>
... ...
... ... @@ -204,7 +204,7 @@ class WeChatBaseController extends BaseController
*/
public function checkWeChatUserLogin()
{
// $user = Db::name('user')->where('id',5)->find();
// $user = Db::name('user')->where('id',4)->find();
// cmf_update_current_user($user);
$userId = cmf_get_current_user_id();
if (empty($userId)) {
... ...