layui.define(['table', 'form'], function(exports) { var $ = layui.$, table = layui.table, form = layui.form; //我的订单 table.render({ elem: '#company-order-table', url: layui.setter.urlbase + '/product_order/order' , cols: [ [{ type: 'numbers', width: 80, title: '序号', sort: true }, { field: 'order_no', title: '订单编号' }, { title: '产品', field: 'product' },{ field: 'pay_date', title: '时间' }, { field: 'money', title: '价格(元)', },{ title: '订单状态', templet: '#orderState' }, { title: '操作', width: 150, align: 'center', fixed: 'right', toolbar: '#table-order-state' }] ], page: true, limit: 10, limits: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], text: '对不起,加载出现异常!' }); //监听工具条 table.on('tool(company-order-table)', function(obj) { var data = obj.data; if(obj.event === 'look') { $.ajax({ type: 'post', url: layui.setter.urlbase + '/module_open/loginunionaccount', data: { sys: data.type }, success: function(res) { if(res.code == 0) { //跳转至应用 if(data.type === 'boss_live') { window.open('https://live.yunxiekeji.cn/live/index/index.html?passport=' + res.passport + '&username=' + data.username, '_blank'); } else if(data.type === 'wqbp') { window.open('http://wqbp.yunxiekeji.cn/guide/index/index.html?passport=' + res.passport + '&username=' + data.username, '_blank'); } else if(data.type === 'zqxg'){ window.open('https://www.shangxueshe.cn/zqxg/show.html', '_blank'); }else { window.open('https://live.yunxiekeji.cn/live/index/index.html?passport=' + res.passport + '&username=' + data.username, '_blank'); } } } }); } }); /* *订单管理 */ table.render({ elem: '#company-buying-products-table', url: layui.setter.urlbase + '/product_order/buying_products' , cols: [ [{ type: 'numbers', width: 80, title: '序号', sort: true }, { field: 'product', title: '产品' }, { field: 'end_date', title: '产品到期时间' }, { templet: '#orderState', title: '产品状态' }, { title: '操作', width: 300, align: 'center', fixed: 'right', toolbar: '#table-buying_products-state' }] ], page: true, limit: 10, limits: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], text: '对不起,加载出现异常!' }); //监听工具条 table.on('tool(company-buying-products-table)', function(obj) { var data = obj.data; if(obj.event === 'look') { $.ajax({ type: 'post', url: layui.setter.urlbase + '/module_open/loginunionaccount', data: { sys: data.type }, success: function(res) { if(res.code == 0) { //跳转至应用 if(data.type === 'boss_live') { window.open('https://live.yunxiekeji.cn/live/index/index.html?passport=' + res.passport + '&username=' + data.username, '_blank'); } else if(data.type === 'wqbp') { window.open('http://wqbp.yunxiekeji.cn/guide/index/index.html?passport=' + res.passport + '&username=' + data.username, '_blank'); }else if(data.type === 'zqxg'){ window.open('https://www.shangxueshe.cn/zqxg/show.html', '_blank'); }else if(data.type === 'crm'){ window.open('http://crm.shangxueshe.cn/index/login/loginapi.html?passport=' + res.passport + '&username=' + data.username, '_blank'); }else { window.open('https://live.yunxiekeji.cn/live/index/index.html?passport=' + res.passport + '&username=' + data.username, '_blank'); } } } }); } }); /* * 优惠卷 */ table.render({ elem: '#company-coupon-table', //url: layui.setter.urlbase + '/product_order/coupon' , cols: [ [{ type: 'numbers', width: 80, title: '序号', sort: true }, { field: 'car', title: '优惠卷' }, { field: 'get_time', title: '获取时间' }, { field: 'end_time', title: '有效期' }, { field: 'state', title: '产品状态' }, { title: '操作', width: 150, align: 'center', fixed: 'right', toolbar: '#table-dailyWechatLabel-edit' }] ], data:[{ "car": "200元全场通用卷", "get_time": "2020-11-19 10:45:64", "end_time": "2020-12-19 10:45:64", "state": "使用中" },{ "car": "7折全场通用卷", "get_time": "2020-11-19 10:45:64", "end_time": "2020-12-19 10:45:64", "state": "使用中" }], page: true, limit: 10, limits: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], text: '对不起,加载出现异常!' }); //工单列表 table.render({ elem: '#work-order-table', url: layui.setter.urlbase + '/work_order/order' , cols: [ [{ type: 'numbers', width: 80, title: '序号', sort: true }, { field: 'order_no', title: '工单编号' }, { title: '类型', field: 'type' },{ field: 'addtime', title: '创建时间' },{ title: '工单单状态', field: 'state' }, { title: '操作', width: 150, align: 'center', fixed: 'right', toolbar: '#table-order-state' }] ], page: true, limit: 10, limits: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], text: '对不起,加载出现异常!' }); //监听工具条 table.on('tool(work-order-table)', function(obj) { var data = obj.data; if(obj.event === 'checkdetail') { var tr = $(obj.tr); layer.open({ type: 2, title: '工单详情', content: '/company/work_order/workorderdetail?id=' + data.id, area: ['800px', '600px'], }) }else if(obj.event === 'endOrder'){ layer.confirm('确定结束工单吗?', function(index) { $.ajax({ type: 'post', url: layui.setter.urlbase + "/work_order/endOrder", data: { id: data.id }, success: function(res) { layer.msg(res.msg, {anim: 0}, function () { location.reload(); }); } }); }); } }); /* * 优惠卷cypher */ table.render({ elem: '#company-cypher-table', url: layui.setter.urlbase + '/product_order/coupon' , cols: [ [{ type: 'numbers', width: 80, title: '序号', sort: true }, { field: 'name', title: '优惠卷活动' }, { field: 'addtime', title: '获取时间' }, { field: 'end_time', title: '有效期' }, { templet: '#usedState', title: '状态' }, { title: '操作', width: 150, align: 'center', fixed: 'right', toolbar: '#table-dailyWechatLabel-edit' }] ], // data:[{ // "car": "200元全场通用卷", // "get_time": "2020-11-19 10:45:64", // "end_time": "2020-12-19 10:45:64", // "state": "使用中" // },{ // "car": "7折全场通用卷", // "get_time": "2020-11-19 10:45:64", // "end_time": "2020-12-19 10:45:64", // "state": "使用中" // }], page: true, limit: 10, limits: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], text: '对不起,加载出现异常!' }); exports('dailywechat', {}) });