123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311 |
- 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', {})
- });
|