| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'service/order/order/index' + location.search,
- // edit_url: 'service/order/order/edit',
- multi_url: 'service/order/order/multi',
- import_url: 'service/order/order/import',
- table: 'service_order',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- fixedColumns: true,
- fixedRightNumber: 1,
- columns: [
- [
-
- {field: 'goods_id', title: __('项目信息'),operate: false, cellStyle: function () {return {css: {"min-width": "266px"}}},formatter:function (value,row) {
- return `
- <div>
- <div style="display: flex;align-items: center;justify-content: space-between;color: #666;margin-bottom: 10px;">
- <div>订单编号:${row.orderId}</div>
- <div style="margin-left: 20px;">ID:${row.id}</div>
- </div>
- <div style="display: flex">
- <image style="width: 112px;height: 112px;border-radius: 10px" src="${row.detail.image}"></image>
- <div style="margin-left: 25px;">
- <div style="display: flex;align-items: center;margin-bottom: 8px;">
- <div style="font-size: 16px;font-weight: bold;">${row.detail.name}</div>
- <div style="margin-left: 10px;width: 68px;height: 26px;line-height: 26px;text-align: center;background: rgba(97, 22, 255, 0.10);border-radius: 13px;color: #6116FF;font-size: 12px;">${row.to_shop_text}</div>
- </div>
- <div style="display: flex;align-items: center;margin-bottom: 6px;">
- <span style="margin-right: 30px;color: #999;font-size: 14px;">规格</span>
- <span style="color: #333;font-size: 14px">${row.detail.sku_name}</span>
- </div>
- <div style="display: flex;align-items: center;margin-bottom: 6px;">
- <span style="margin-right: 30px;color: #999;font-size: 14px;">数量</span>
- <span style="color: #333;font-size: 14px">X${row.detail.num}</span>
- </div>
- <div style="display: flex;align-items: center;margin-bottom: 6px;">
- <span style="margin-right: 30px;color: #999;font-size: 14px;">价格</span>
- <span style="color: #333;font-size: 14px">${row.detail.price}</span>
- </div>
- </div>
- </div>
-
- </div>
- `
-
- }},
-
- {field: 'status', title: __('状态'),operate: false, cellStyle: function () {return {css: {"width": "200px"}}},formatter:function (value,row){
- let result = '';
- if(row.to_shop == 'shop' && row.status == 2){
- result += ` <div style="height: 58px;width: 196px;background: linear-gradient(90deg, #F0FAF3 0%, rgba(240,250,243,0) 100%);display: flex;
- align-items: center;justify-content: flex-start;padding-left: 20px;">
- <span style="color: #999;font-size: 14px;margin-right: 30px;">订单状态</span>
- <span style="color: #62CB81;font-size: 14px;font-weight: bold;">待核销</span>
- </div>`
- } else {
- result += `<div style="height: 58px;width: 196px;background: linear-gradient(90deg, #F0FAF3 0%, rgba(240,250,243,0) 100%);display: flex;
- align-items: center;justify-content: flex-start;padding-left: 20px;">
- <span style="color: #999;font-size: 14px;margin-right: 30px;">订单状态</span>
- <span style="color: #62CB81;font-size: 14px;font-weight: bold;">${row.status_text}</span>
- </div>`
- }
- result += `<div style="height: 58px;width: 196px;background: linear-gradient(90deg, #FFF2F2 0%, rgba(255,242,242,0) 100%);display: flex;
- align-items: center;justify-content: flex-start;padding-left: 20px;">
- <span style="color: #999;font-size: 14px;margin-right: 30px;">售后状态</span>
- <span style="color: #62CB81;font-size: 14px;font-weight: bold;">${row.is_service_text}</span>
- </div>
- <div style="height: 58px;width: 196px;background: linear-gradient(90deg, #FFF7E6 0%, rgba(255,247,230,0) 100%);display: flex;
- align-items: center;justify-content: flex-start;padding-left: 20px;">
- <span style="color: #999;font-size: 14px;margin-right: 30px;">投诉状态</span>
- <span style="color: #62CB81;font-size: 14px;font-weight: bold;">${row.is_complaint_text}</span>
- </div>`
- return result
-
- }},
-
-
- {field: 'user_id', title: __('用户信息'),operate: false, cellStyle: function () {return {css: {"min-width": "248px"}}},formatter:function (value,row){
- let result = `<div>
- <div style="display: flex;align-items: flex-start;">
- <img src="${row.user.avatar}" alt="" style="width: 48px;height: 48px;flex-shrink: 0;border-radius: 50%;">
- <div style="margin-left: 14px;flex: 1;">
- <div style="margin-bottom: 5px;display: flex;justify-content: space-between;">
- <span style="font-size: 16px;color: #333;">${row.user.nickname}</span>
- </div>
- <div style="display: flex;justify-content: space-between;">
- <span style="font-size: 14px;color: #666;">${row.user.mobile}</span>
- </div>`
- if(row.to_shop == 'door'){
- result += ` <div style="font-size: 14px;color: #666;text-align: left;margin-top:10px;">预约信息:${row.address.name+''+row.address.mobile}</div>
- <div style="font-size: 14px;color: #666;margin: 10px 0;text-align: left;">地址:${row.address.province+row.address.city+row.address.district+row.address.area+row.address.address}</div>
- <div style="font-size: 14px;color: #666;text-align: left;">预约时间:${row.starttime_text}</div>
- `
- }else {
- result += `<div style="font-size: 14px;color: #666;text-align: left;margin-top:10px;">核销码:${row.check_name}</div>
- <div style="font-size: 14px;color: #666;text-align: left;margin-top:10px;">核销二维码:<img style="width:40px;height:40px;" src="${row.qrcode_image}" /></div>
- `
- }
-
- result += `</div></div></div>`
- return result
- }},
- {field: 'shop_id', title: __('服务者/门店信息'),operate: false, cellStyle: function () {return {css: {"min-width": "248px"}}},formatter:function (value,row){
- if(row.shop && row.skill){
- return `<div>
-
- <div style="background: #F7F7F7;padding: 12px;border-radius: 10px;margin-top: 16px;">
- <div style="display: flex;align-items: center;justify-content: center;width: 64px;height: 18px;background: #1677FF;color: #FFF;margin-bottom: 8px;font-size: 12px;border-radius: 2px;">门店信息</div>
- <div style="display: flex;align-items: center;">
- <img src="${row.shop.logo_image}" alt="" style="width: 48px;height: 48px;flex-shrink: 0;border-radius: 50%;">
- <div style="margin-left: 14px;flex: 1;">
- <div style="margin-bottom: 5px;display: flex;justify-content: space-between;">
- <span style="font-size: 16px;color: #333;">${row.shop.name}</span>
- </div>
- <div style="display: flex;justify-content: space-between;">
- <span style="font-size: 14px;color: #666;">${row.shop.leader_name+''+row.shop.leader_mobile}</span>
- </div>
- </div>
- </div>
- </div>
- <div style="background: #F7F7F7;padding: 12px;border-radius: 10px;margin-top: 16px;">
- <div style="display: flex;align-items: center;justify-content: center;width: 50px;height: 18px;background: #6116FF;color: #FFF;margin-bottom: 8px;font-size: 12px;border-radius: 2px;">服务者</div>
- <div style="display: flex;align-items: center;">
- <img src="${row.skill.image}" alt="" style="width: 48px;height: 48px;flex-shrink: 0;border-radius: 50%;">
- <div style="margin-left: 14px;flex: 1;">
- <div style="margin-bottom: 5px;display: flex;justify-content: space-between;">
- <span style="font-size: 16px;color: #333;">${row.skill.name}</span>
- </div>
- <div style="display: flex;justify-content: space-between;">
- <span style="font-size: 14px;color: #666;">${row.skill.mobile}</span>
- </div>
- </div>
- </div>
- </div>
-
- </div>`
- }else if(row.skill){
- return `<div>
-
- <div style="background: #F7F7F7;padding: 12px;border-radius: 10px;margin-top: 16px;">
- <div style="display: flex;align-items: center;justify-content: center;width: 50px;height: 18px;background: #6116FF;color: #FFF;margin-bottom: 8px;font-size: 12px;border-radius: 2px;">服务者</div>
- <div style="display: flex;align-items: center;">
- <img src="${row.skill.image}" alt="" style="width: 48px;height: 48px;flex-shrink: 0;border-radius: 50%;">
- <div style="margin-left: 14px;flex: 1;">
- <div style="margin-bottom: 5px;display: flex;justify-content: space-between;">
- <span style="font-size: 16px;color: #333;">${row.skill.name}</span>
- </div>
- <div style="display: flex;justify-content: space-between;">
- <span style="font-size: 14px;color: #666;">${row.skill.mobile}</span>
- </div>
- </div>
- </div>
- </div>
-
- </div>`
- }else if(row.shop){
- return `<div>
-
- <div style="background: #F7F7F7;padding: 12px;border-radius: 10px;margin-top: 16px;">
- <div style="display: flex;align-items: center;justify-content: center;width: 64px;height: 18px;background: #1677FF;color: #FFF;margin-bottom: 8px;font-size: 12px;border-radius: 2px;">门店信息</div>
- <div style="display: flex;align-items: center;">
- <img src="${row.shop.logo_image}" alt="" style="width: 48px;height: 48px;flex-shrink: 0;border-radius: 50%;">
- <div style="margin-left: 14px;flex: 1;">
- <div style="margin-bottom: 5px;display: flex;justify-content: space-between;">
- <span style="font-size: 16px;color: #333;">${row.shop.name}</span>
- </div>
- <div style="display: flex;justify-content: space-between;">
- <span style="font-size: 14px;color: #666;">${row.shop.leader_name+''+row.shop.leader_mobile}</span>
- </div>
- </div>
- </div>
- </div>
-
- </div>`
- }else {
- return ''
- }
-
- }},
-
- {field: 'price', title: __('付款信息'),operate: false, cellStyle: function () {return {css: {"min-width": "108px"}}},formatter:function (value,row){
- return `<div>
-
- <div style="display:flex;align-items: center;margin-bottom: 10px;">
- <div style="color: #999999;font-size: 14px;width: 72px;text-align:right;margin-right:20px;">总计</div>
- <div style="color: #E4484B;font-size: 18px;font-weight: bold;">${row.payprice}</div>
- </div>
- <div style="display:flex;align-items: center;margin-bottom: 6px;">
- <div style="color: #999999;font-size: 14px;width: 72px;text-align:right;margin-right:20px;">项目费</div>
- <div style="color: #3C78FF;font-size: 14px;">${row.price}</div>
- </div>
- <div style="display:flex;align-items: center;margin-bottom: 6px;">
- <div style="color: #999999;font-size: 14px;width: 72px;text-align:right;margin-right:20px;">项目折扣</div>
- <div style="color: #3C78FF;font-size: 14px;">${row.discount/10}</div>
- </div>
- <div style="display:flex;align-items: center;margin-bottom: 6px;">
- <div style="color: #999999;font-size: 14px;width: 72px;text-align:right;margin-right:20px;">优惠券</div>
- <div style="color: #3C78FF;font-size: 14px;">${row.coupon_price}</div>
- </div>
- <div style="display:flex;align-items: center;margin-bottom: 6px;">
- <div style="color: #999999;font-size: 14px;width: 72px;text-align:right;margin-right:20px;">车费</div>
- <div style="color: #3C78FF;font-size: 14px;">${row.travel_price}</div>
- </div>
- <div style="display:flex;align-items: center;margin-bottom: 6px;">
- <div style="color: #999999;font-size: 14px;width: 72px;text-align:right;margin-right:20px;">补差价</div>
- <div style="color: #3C78FF;font-size: 14px;">${row.premium_price}</div>
- </div>
- <div style="display:flex;align-items: center;margin-bottom: 6px;">
- <div style="color: #999999;font-size: 14px;width: 72px;text-align:right;margin-right:20px;">加项费</div>
- <div style="color: #3C78FF;font-size: 14px;">${row.add_price}</div>
- </div>
- <div style="display:flex;align-items: center;">
- <div style="color: #999999;font-size: 14px;width: 72px;text-align:right;margin-right:20px;">退款金额</div>
- <div style="color: #3C78FF;font-size: 14px;">${row.refund_price}</div>
- </div>
-
- </div>`
-
- }},
- {field: 'id', title: __('财务'),operate: false, cellStyle: function () {return {css: {"min-width": "250px"}}},formatter:function (value,row){
- if(row.is_settle == 2){
- let result = `
- <div style="display: flex;align-items: center;justify-content:space-between;padding: 0 20px;width: 250px;height: 66px;">
- <span style="font-size: 14px;color: #999;">付款方式</span>
- <span style="color: #3C78FF;font-size: 14px;">${row.paytype_text}</span>
- </div>
- <div style="display: flex;align-items: center;justify-content:space-between;padding: 0 20px;width: 250px;height: 66px;">
- <span style="font-size: 14px;color: #999;">服务者佣金</span>
- <span style="color: #3C78FF;font-size: 14px;">${row.skillRebate || 0}</span>
- </div>`
- if(row.shop_id > 0){
- result +=`
- <div style="display: flex;align-items: center;justify-content:space-between;padding: 0 20px;width: 250px;height: 66px;border-top: 1px solid #EEEEEE;">
- <span style="font-size: 14px;color: #999;">商户佣金</span>
- <span style="color: #3C78FF;font-size: 14px;">${row.shopRebate}</span>
- </div>
- `
- }
- return result
- }else {
- let result = `
- <div style="display: flex;align-items: center;justify-content:space-between;padding: 0 20px;width: 250px;height: 66px;">
- <span style="font-size: 14px;color: #999;">付款方式</span>
- <span style="color: #3C78FF;font-size: 14px;">${row.paytype_text}</span>
- </div>
- <div style="display: flex;align-items: center;justify-content:space-between;padding: 0 20px;width: 250px;height: 66px;">
- <span style="font-size: 14px;color: #999;">服务者佣金</span>
- <span style="color: #3C78FF;font-size: 14px;">${row.is_settle_text}</span>
- </div>`
- if(row.shop_id > 0){
- result +=`
- <div style="display: flex;align-items: center;justify-content:space-between;padding: 0 20px;width: 250px;height: 66px;border-top: 1px solid #EEEEEE;">
- <span style="font-size: 14px;color: #999;">商户佣金</span>
- <span style="color: #3C78FF;font-size: 14px;">${row.is_settle_text}</span>
- </div>
- `
- }
- if(row.leader_id>0){
- result +=`
- <div style="display: flex;align-items: center;justify-content:space-between;padding: 0 20px;width: 250px;height: 66px;border-top: 1px solid #EEEEEE;">
- <span style="font-size: 14px;color: #999;">一级佣金</span>
- <span style="color: #3C78FF;font-size: 14px;">${row.is_settle_text}</span>
- </div>
- `
- }
- if(row.rec_leader_id>0){
- result +=`
- <div style="display: flex;align-items: center;justify-content:space-between;padding: 0 20px;width: 250px;height: 66px;border-top: 1px solid #EEEEEE;">
- <span style="font-size: 14px;color: #999;">二级佣金</span>
- <span style="color: #3C78FF;font-size: 14px;">${row.is_settle_text}</span>
- </div>
- `
- }
- return result
-
- }
-
- }},
- {field: 'id', title: __('时间'),operate: false, cellStyle: function () {return {css: {"min-width": "180px"}}},formatter:function (value,row){
- return `
- <div style="margin-bottom: 10px;">
- <div style="color: #999999;font-size: 14px;margin-bottom: 8px;text-align:left;">创建时间</div>
- <div style="color: #333333;font-size: 14px;text-align:left;">${row.create_time}</div>
- </div>
- <div style="margin-bottom: 10px;">
- <div style="color: #999999;font-size: 14px;margin-bottom: 8px;text-align:left;">支付时间</div>
- <div style="color: #333333;font-size: 14px;text-align:left;">${row.paytime_text}</div>
- </div>
- <div>
- <div style="color: #999999;font-size: 14px;margin-bottom: 8px;text-align:left;">预约时间</div>
- <div style="color: #333333;font-size: 14px;text-align:left;">${row.starttime_text}</div>
- </div>
- `
- }},
- // {checkbox: true},
- {field: 'id', title: __('Id'),visible: false},
- {field: 'orderId', title: __('Orderid'), operate: 'LIKE', width:148,visible: false},
-
-
- // {field: 'reach_images', title: __('Reach_images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
- // {field: 'finish_images', title: __('Finish_images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
- {field: 'user_id', title: __('User_id'),visible: false},
- {field: 'skill_id', title: __('Skill_id'),visible: false},
- {field: 'leader_id', title: __('leader_id'),visible: false},
- {field: 'rec_leader_id', title: __('rec_leader_id'),visible: false},
- {field: 'shop_id', title: __('Shop_id'),visible: false},
- {field: 'goods_id', title: __('Goods_id'),visible: false},
- {field: 'traveltype', title: __('Traveltype'), searchList: {"0":__('Traveltype 0'),"1":__('Traveltype 1'),"2":__('Traveltype 2')}, formatter: Table.api.formatter.normal,visible: false},
- {field: 'choose_skill_type', title: __('Choose_skill_type'), searchList: {"0":__('Choose_skill_type 0'),"1":__('Choose_skill_type 1')}, formatter: Table.api.formatter.normal,visible: false},
- {field: 'paytype', title: __('Paytype'), searchList: {"0":__('Paytype 0'),"1":__('Paytype 1'),"2":__('Paytype 2'),"3":__('Paytype 3'),"4":__('Paytype 4')}, formatter: Table.api.formatter.normal,visible: false},
- {field: 'to_shop', title: __('To_shop'), searchList: {"door":__('To_shop door'),"shop":__('To_shop shop')}, formatter: Table.api.formatter.normal,visible: false},
-
- {field: 'price', title: __('Price'), operate:'BETWEEN',visible: false},
- // {field: 'distance', title: __('Distance'), operate:'BETWEEN'},
- // {field: 'travel_price', title: __('Travel_price'), operate:'BETWEEN'},
- // {field: 'sumprice', title: __('Sumprice'), operate:'BETWEEN'},
- // {field: 'goods_total_price', title: __('Goods_total_price'), operate:'BETWEEN'},
- // {field: 'discount', title: __('Discount')},
- // {field: 'coupon_id', title: __('Coupon_id')},
- // {field: 'coupon_price', title: __('Coupon_price'), operate:'BETWEEN'},
- // {field: 'premium_price', title: __('Premium_price'), operate:'BETWEEN'},
- // {field: 'add_price', title: __('Add_price'), operate:'BETWEEN'},
- {field: 'payprice', title: __('Payprice'), operate:'BETWEEN',visible: false},
- {field: 'act_travel_price', title: __('Act_travel_price'), operate:'BETWEEN',visible: false},
- {field: 'refund_price', title: __('Refund_price'), operate:'BETWEEN',visible: false},
- {field: 'settle_price', title: __('Settle_price'), operate:'BETWEEN',visible: false},
- {field: 'total_cost_seconds', title: __('Total_cost_seconds'),visible: false},
- {field: 'starttime', title: __('Starttime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime,visible: false},
- {field: 'endtime', title: __('Endtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime,visible: false},
- //{field: 'actendtime', title: __('Actendtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- //{field: 'trade_no', title: __('Trade_no'), operate: 'LIKE'},
- {field: 'memo', title: __('Memo'), operate: 'LIKE',visible: false},
- {field: 'qrcode_image', title: __('Qrcode_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image,visible: false},
- {field: 'check_name', title: __('Check_name'),visible: false},
- {field: 'is_service', title: __('Is_service'), searchList: {"0":__('Is_service 0'),"1":__('Is_service 1'),"2":__('Is_service 2'),"-1":__('Is_service -1')}, formatter: Table.api.formatter.normal,visible: false},
- {field: 'is_complaint', title: __('Is_complaint'), searchList: {"0":__('Is_complaint 0'),"1":__('Is_complaint 1')}, formatter: Table.api.formatter.normal,visible: false},
- //{field: 'is_pool', title: __('Is_pool'), searchList: {"0":__('Is_pool 0'),"1":__('Is_pool 1')}, formatter: Table.api.formatter.normal},
- {field: 'is_settle', title: __('Is_settle'), searchList: {"0":__('Is_settle 0'),"1":__('Is_settle 1'),"2":__('Is_settle 2')}, formatter: Table.api.formatter.normal,visible: false},
- // {field: 'reach_images', title: __('Reach_images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
- // {field: 'finish_images', title: __('Finish_images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
- {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4'),"5":__('Status 5'),"6":__('Status 6'),"7":__('Status 7'),"-1":__('Status -1')}, formatter: Table.api.formatter.status,visible: false},
- {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime,visible: false},
- {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate,
- buttons: [
- {
- name: 'detail',
- text: __('订单详情'),
- title: __('订单详情'),
- classname: 'btn btn-xs btn-detail btn-dialog',
- icon: 'fa fa-detail',
- url: function(row){
- return 'service/order/order/info?ids='+row.id;
- },
- },
- {
- name: 'users',
- text: __('分配商户'),
- title: __('分配商户'),
- classname: 'btn btn-xs btn-change btn-dialog',
- url: function(row){
- return 'service/order/order/updateshop?ids='+row.id;
- },
- visible:function(row){
- if(row.status == 1 && !row.shop_id && !row.skill_id && (row.is_service == 0 || row.is_service == -1)){
- return true;
- }
- }
- },
- {
- name: 'users',
- text: __('分配服务者'),
- title: __('分配服务者'),
- classname: 'btn btn-xs btn-change btn-dialog',
-
- url: function(row){
- return 'service/order/order/updateskill?ids='+row.id;
- },
- visible:function(row){
- if(row.status == 1 && !row.skill_id && row.to_shop == 'door' && (row.is_service == 0 || row.is_service == -1)){
- return true;
- }
- }
- },
- {
- name: 'users',
- text: __('更换服务者'),
- title: __('更换服务者'),
- classname: 'btn btn-xs btn-change btn-dialog',
- url: function(row){
- return 'service/order/order/updateskill?ids='+row.id;
- },
- visible:function(row){
- if(row.skill_id && (row.status == 1 || row.status == 2) && (row.is_service == 0 || row.is_service == -1)){
- return true;
- }
- }
- },
- {
- name: 'accept',
- text: __('订单接取'),
- title: __('订单接取'),
- classname: 'btn btn-xs btn-status btn-ajax',
-
- url: 'service/order/order/handleOrder?state=2',
- success: function (data, ret) {
- $(".btn-refresh").trigger('click');
- },
- visible:function(row){
- if((row.skill_id) && row.status === 1 && (row.is_service == 0 || row.is_service == -1)){
- return true;
- }
- }
- },
- {
- name: 'go',
- text: __('服务者出发'),
- title: __('服务者出发'),
- classname: 'btn btn-xs btn-status btn-ajax',
-
- url: 'service/order/order/handleOrder?state=3',
- success: function (data, ret) {
- $(".btn-refresh").trigger('click');
- },
- visible:function(row){
- if(row.status === 2 && row.to_shop == 'door' && (row.is_service == 0 || row.is_service == -1)){
- return true;
- }
- }
- },
- {
- name: 'check',
- text: __('订单已核销'),
- title: __('订单已核销'),
- classname: 'btn btn-xs btn-status btn-ajax',
-
- url: 'service/order/order/handleOrder?state=6',
- success: function (data, ret) {
- $(".btn-refresh").trigger('click');
- },
- visible:function(row){
- if(row.status === 2 && row.to_shop == 'shop' && (row.is_service == 0 || row.is_service == -1)){
- return true;
- }
- }
- },
- {
- name: '',
- text: __('服务者到达'),
- title: __('服务者到达'),
- classname: 'btn btn-xs btn-status btn-ajax',
-
- url: 'service/order/order/handleOrder?state=4',
- success: function (data, ret) {
- $(".btn-refresh").trigger('click');
- },
- visible:function(row){
- if(row.status === 3 && row.to_shop == 'door' && (row.is_service == 0 || row.is_service == -1)){
- return true;
- }
- }
- },
- {
- name: '',
- text: __('开始服务'),
- title: __('开始服务'),
- classname: 'btn btn-xs btn-status btn-ajax',
-
- url: 'service/order/order/handleOrder?state=5',
- success: function (data, ret) {
- $(".btn-refresh").trigger('click');
- },
- visible:function(row){
- if(row.status === 4 && row.to_shop == 'door' && (row.is_service == 0 || row.is_service == -1)){
- return true;
- }
- }
- },
- {
- name: '',
- text: __('服务完成'),
- title: __('服务完成'),
- classname: 'btn btn-xs btn-status btn-ajax',
-
- url: 'service/order/order/handleOrder?state=6',
- success: function (data, ret) {
- $(".btn-refresh").trigger('click');
- },
- visible:function(row){
- if(row.status === 5 && (row.is_service == 0 || row.is_service == -1)){
- return true;
- }
- }
- },
- {
- name: 'comment',
- text: __('订单评价'),
- title: __('订单评价'),
- classname: 'btn btn-xs btn-success btn-comment btn-dialog',
-
- url: function(row){
- return 'service/order/comment/index?order_id='+row.id;
- },
- visible:function(row){
- if(row.status === 7){
- return true;
- }
- }
- },
- {
- name: 'refund',
- text: __('退款'),
- title: __('退款'),
- classname: 'btn btn-xs btn-cancel btn-dialog',
-
- url: function(row){
- return 'service/order/order/refund?ids='+row.id;
- },
- hidden:function(row){
- if(row.is_settle === 2 || row.is_service === 2 || row.status == -1 || row.status == 0){
- return true;
- }
- }
- },
- ],
- formatter: Table.api.formatter.operate}
- ]
- ]
- });
- // 为表格绑定事件
- Table.api.bindevent(table);
- },
- recyclebin: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- 'dragsort_url': ''
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: 'service/order/order/recyclebin' + location.search,
- pk: 'id',
- sortName: 'id',
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id')},
- {
- field: 'deletetime',
- title: __('Deletetime'),
- operate: 'RANGE',
- addclass: 'datetimerange',
- formatter: Table.api.formatter.datetime
- },
- {
- field: 'operate',
- width: '140px',
- title: __('Operate'),
- table: table,
- events: Table.api.events.operate,
- buttons: [
- {
- name: 'Restore',
- text: __('Restore'),
- classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
- icon: 'fa fa-rotate-left',
- url: 'service/order/order/restore',
- refresh: true
- },
- {
- name: 'Destroy',
- text: __('Destroy'),
- classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
- icon: 'fa fa-times',
- url: 'service/order/order/destroy',
- refresh: true
- }
- ],
- formatter: Table.api.formatter.operate
- }
- ]
- ]
- });
- // 为表格绑定事件
- Table.api.bindevent(table);
- },
- add: function () {
- Controller.api.bindevent();
- },
- edit: function () {
- Controller.api.bindevent();
- },
- updateshop: function () {
-
- $(document).on('click', '.btn-embossed', function () {
- parent.$(".btn-refresh").trigger('click');
- });
- Controller.api.bindevent();
- },
- updateskill: function () {
-
- $(document).on('click', '.btn-embossed', function () {
- parent.$(".btn-refresh").trigger('click');
- });
- Controller.api.bindevent();
- },
- refund: function () {
-
- $(document).on('click', '.btn-embossed', function () {
- parent.$(".btn-refresh").trigger('click');
- });
- Controller.api.bindevent();
- },
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- }
- }
- };
- return Controller;
- });
|