博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
select2和mo
阅读量:6553 次
发布时间:2019-06-24

本文共 19951 字,大约阅读时间需要 66 分钟。

hot3.png

title = '订单管理';$this->params['breadcrumbs'] = [$this->title];/** @var \yii\data\DataProviderInterface $dataProvider *//** @var \common\models\Order[] $models *//** @var \backend\models\OrderSearch $searchModel */$models = $dataProvider->getModels();$pagination = $dataProvider->getPagination();$virtualOrderModel = new \common\models\VirtualOrder();?>
render('nav-tabs') ;?>
'__parent_id__']); $cityUrl = \yii\helpers\Url::to(['region/ajax-cities', 'province_id' => '__province_id__']); $districtUrl = \yii\helpers\Url::to(['region/ajax-districts', 'city_id' => '__city_id__']); $labelOptions = ['labelOptions' => ['class' => false]]; $form = \yii\bootstrap\ActiveForm::begin([ 'action' => ['list'], 'layout' => 'inline', 'method' => 'get', ]); ?>
field($searchModel, 'top_category_id', $labelOptions)->widget(Select2Widget::className(), [ 'serverUrl' => \yii\helpers\Url::to(['product-category/ajax-list']), 'itemsName' => 'categories', 'selectedItem' => $searchModel->topCategory ? [$searchModel->topCategory->id => $searchModel->topCategory->name] : [], 'options' => ['prompt'=>'选择类目', 'class' => 'form-control'], 'placeholderId' => '0', 'placeholder' => '选择类目', 'eventSelect' => new JsExpression(" $('#category_id').val('0').trigger('change'); ") ])?>
field($searchModel, 'category_id')->widget(Select2Widget::className(), [ 'serverUrl' => \yii\helpers\Url::to(['product-category/ajax-list']), 'itemsName' => 'categories', 'selectedItem' => $searchModel->category ? [$searchModel->category->id => $searchModel->category->name] : [], 'options' => ['prompt'=>'选择类目', 'class' => 'form-control'], 'placeholderId' => '0', 'placeholder' => '选择类目', 'eventOpening' => new JsExpression(" var id = $('#top_category_id').val(); serverUrl = '{
$categoryUrl}'.replace('__parent_id__', id ? id : '-1'); ") ])?>
field($searchModel, 'province_id', $labelOptions)->widget(Select2Widget::className(), [ 'serverUrl' => \yii\helpers\Url::to(['region/ajax-provinces']), 'itemsName' => 'provinces', 'selectedItem' => $searchModel->province ? [$searchModel->province->id => $searchModel->province->province_name] : [], 'options' => ['class' => 'form-control', 'prompt'=>'请选择省份'], 'placeholderId' => '0', 'placeholder' => '请选择省份', 'eventSelect' => new JsExpression(" $('#city_id').val('0').trigger('change'); $('#district_id').val('0').trigger('change'); ") ]); ?>
field($searchModel, 'city_id')->widget(Select2Widget::className(), [ 'serverUrl' => \yii\helpers\Url::to(['region/ajax-cities', 'province_id' => '__province_id__']), 'itemsName' => 'cities', 'selectedItem' => $searchModel->city ? [$searchModel->city->id => $searchModel->city->name] : [], 'options' => ['class' => 'form-control', 'prompt'=>'请选择城市'], 'placeholderId' => '0', 'placeholder' => '请选择城市', 'eventSelect' => new JsExpression(" $('#district_id').val('0').trigger('change'); "), 'eventOpening' => new JsExpression(" var id = $('#province_id').val(); serverUrl = '{
$cityUrl}'.replace('__province_id__', id ? id : '-1'); ") ]); ?>
field($searchModel, 'district_id')->widget(Select2Widget::className(), [ 'serverUrl' => \yii\helpers\Url::to(['region/ajax-districts', 'city_id' => '__city_id__']), 'selectedItem' => $searchModel->district ? [$searchModel->district->id => $searchModel->district->name] : [], 'options' => ['class' => 'form-control', 'prompt'=>'请选择地区'], 'placeholderId' => '0', 'placeholder' => '请选择地区', 'itemsName' => 'districts', 'eventOpening' => new JsExpression(" var id = $('#city_id').val(); serverUrl = '{
$districtUrl}'.replace('__city_id__', id ? id : '-1'); ") ]); ?>
field($searchModel, 'type', $labelOptions)->widget(Select2Widget::className(), [ 'selectedItem' => \backend\models\OrderSearch::getTypes(), 'placeholderId' => '0', 'placeholder' => '请选择类型', 'options' => ['class' => 'form-control', 'prompt'=>'请选择类型'], 'static' => true, ]) ?>
field($searchModel, 'keyword', $labelOptions)->textInput() ?>
$status)) ?>
find()->where(['id'=> $model->virtual_order_id])->one();?>
下单时间 订单号 客户姓名/联系方式 公司名称 所购商品 地区 业务人员 嘟嘟妹 客服 服务人员 订单金额 订单状态 操作
formatter->asDatetime($model->created_at);?>
sn; ?>
user->name;?>/
user->phone;?>
company_name ;?>
product_name ;?>
province_name ;?>-
city_name ;?>-
district_name ;?>
creator_name ;?>
supervisor_name;?>
customer_service_name ;?>
status == Order::STATUS_PENDING_PAY || $model->status == Order::STATUS_PENDING_ALLOT || $model->status == Order::STATUS_PENDING_SERVICE || $model->status == Order::STATUS_IN_SERVICE): ?>
clerk_name ;?>
status == Order::STATUS_PENDING_SERVICE || $model->status == Order::STATUS_IN_SERVICE): ?>
price ;?>
isRefund() && $model->refund_status == Order::REFUND_STATUS_APPLY): ?>
退款原因:
refund_reason] ;?>
退款金额:
refund_amount ;?>
status == Order::STATUS_PENDING_PAY && $virtualModel->status == 2): ?>
未付清
已付金额:
payment_amount ;?>
未付金额:
total_amount, $virtualModel->payment_amount);?>
status == Order::STATUS_IN_SERVICE): ?>
调取当前流程节点的后台提示内容标题
status == Order::STATUS_BREAK_SERVICE): ?> 已取消
getStatusName(); ?>
isRefund()): ?>
refund_status == Order::REFUND_STATUS_APPLY):?>
refund_status == Order::REFUND_STATUS_AUDITED): ?>
查看详情
status == Order::STATUS_PENDING_ALLOT && !$model->clerk_id): ?>
status == Order::STATUS_PENDING_SERVICE): ?>
status == Order::STATUS_IN_SERVICE): ?> 查看详情
status == Order::STATUS_COMPLETE_SERVICE || $model->status == Order::STATUS_BREAK_SERVICE): ?> 查看详情
跟进记录
status == Order::STATUS_PENDING_PAY): ?>
下次跟进时间:
$pagination, 'options' => [ 'class' => 'pagination pull-right' ], ]); ?>
{name}{phone}';$changeClerkTemplate = '{name}{phone}{area}';$ajaxRefundInfoUrl = \yii\helpers\Url::to(['ajax-refund-info', 'id' => '__id__']);$ajaxChangeCustomerServiceInfoUrl = \yii\helpers\Url::to(['ajax-change-customer-service-info']);$ajaxClerkListUrl = \yii\helpers\Url::to(['clerk/ajax-list']);$startServiceUrl = Url::to(['order/ajax-start-service']);$paymentUrl = Url::to(['order/ajax-payment']);$cancelOrderUrl = Url::to(['order/ajax-cancel-order']);$districtPriceTemplate = '';$this->registerJs(<<
< rs.model.length; i++) { var item = changeCustomerServiceTemplate.replace('{id}', rs.model[i].id).replace('{phone}', rs.model[i].phone).replace('{name}', rs.model[i].name); $('.change-customer-service-table table tbody').append(item); } } },'json'); }); //修改服务人员 $('.clerk-btn').click(function(){ //清空表格内容 $('.change-clerk-table table tbody').empty(); $('#clerk-form .modal-title').text('修改服务人员'); var changeClerkTemplate = '{
$changeClerkTemplate}'; var id = $(this).attr('data-id'); var product_id = $(this).attr('data-product-id'); var district_id = $(this).attr('data-district-id'); var form = $('#clerk-form'); form.attr('action', form.attr('action').replace('__order_id__', id)); //console.log('{
$ajaxClerkListUrl}'); $.get('{
$ajaxClerkListUrl}', {
product_id: product_id,district_id: district_id}, function(rs){ if(rs.status==200){ for(var i = 0;i < rs.models.length; i++) { var item = changeClerkTemplate.replace('{id}', rs.models[i].id).replace('{phone}', rs.models[i].phone).replace('{name}', rs.models[i].name).replace('{area}', rs.models[i].areas); $('.change-clerk-table table tbody').append(item); form.trigger('reset.yiiActiveForm'); } } },'json'); }); //派单服务人员 $('.clerk-allot-btn').click(function(){ //清空表格内容 $('.change-clerk-table table tbody').empty(); $('#clerk-form .modal-title').text('派单给服务人员'); var changeClerkTemplate = '{
$changeClerkTemplate}'; var id = $(this).attr('data-id'); var form = $('#clerk-form'); form.attr('action', form.attr('action').replace('__order_id__', id)); $.post('',function(rs){ if(rs.status==200){ for(var i = 0;i < rs.models.length; i++) { var item = changeClerkTemplate.replace('{id}', rs.models[i].id).replace('{phone}', rs.models[i].phone).replace('{name}', rs.models[i].name).replace('{area}', rs.models[i].areas); $('.change-clerk-table table tbody').append(item); form.trigger('reset.yiiActiveForm'); } } },'json'); }); //开始服务 $('.start-service-btn').on('click', function(){ var id = $(this).attr('data-id'); var btn = $('#order-start-service-modal .sure-btn'); btn.unbind('click'); btn.click(function(){ $.post('{
$startServiceUrl}', {
order_id: id}, function(rs){ if(rs.status == 200) { window.location.reload(); $('#order-start-service-modal').modal('hide'); } else { $('#order-start-service-modal .warning-active').text(rs.message); } }, 'json'); }); }); //确认付款 $('.sure-payment-btn').on('click', function(){ var id = $(this).attr('data-id'); var btn = $('#payment-modal .sure-btn'); btn.unbind('click'); btn.click(function(){ $.post('{
$paymentUrl}', {
order_id: id}, function(rs){ if(rs.status == 200) { window.location.reload(); $('#payment-modal').modal('hide'); } else { $('#payment-modal .warning-active').text(rs.message); } }, 'json'); }); }); //取消订单 $('.cancel-order-btn').on('click', function(){ var id = $(this).attr('data-id'); var btn = $('#cancel-order-modal .sure-btn'); btn.unbind('click'); btn.click(function(){ $.post('{
$cancelOrderUrl}', {
order_id: id}, function(rs){ if(rs.status == 200) { window.location.reload(); $('#cancel-order-modal').modal('hide'); } else { $('#cancel-order-modal .warning-active').text(rs.message); } }, 'json'); }); }); JS);?>
registerJs(<<

转载于:https://my.oschina.net/botkenni/blog/1826973

你可能感兴趣的文章
Dom4j学习笔记
查看>>
C语言 HTTP上传文件-利用libcurl库上传文件
查看>>
[MEAN Stack] First API -- 7. Using Route Files to Structure Server Side API
查看>>
Hibernate 的HQL语句,初级
查看>>
调试逆向分为动态分析技术和静态分析技术(转)
查看>>
Android webview使用详解
查看>>
业务对象和BAPI
查看>>
程序源系统与当前系统不一致:Carry out repairs in non-original systems only if urgent
查看>>
微软职位内部推荐-Senior Software Engineer
查看>>
程序中的魔鬼数字
查看>>
SVN高速新手教程
查看>>
session cookie
查看>>
如何在Vblock里配置Boot from SAN
查看>>
ZBar之ZBarReaderViewController
查看>>
Android学习笔记——Handler(一)
查看>>
Nuget~管理自己的包包~丢了的包包快速恢复
查看>>
Hadoop单机模式安装-(3)安装和配置Hadoop
查看>>
$.extend({},defaults, options) --(初体验三)
查看>>
自己主动瀑布流布局和实现代码加载
查看>>
maven的一些依赖
查看>>