搜索字段用null会报错
This commit is contained in:
parent
a665c0acb3
commit
c5039efba8
@ -16,7 +16,8 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleComplete(array, value = '', key = 'name', indexKey = 'id') {
|
handleComplete(array, value = '', key = 'name', indexKey = 'id') {
|
||||||
if (value === '') {
|
if (value === '' || value === null) {
|
||||||
|
console.log(array);
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ export default {
|
|||||||
Object.assign(data, this.parseTime(init_options.time));
|
Object.assign(data, this.parseTime(init_options.time));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (init_options[k] !== '' || init_options[k] !== undefined) {
|
if (init_options[k] !== '' && init_options[k] !== undefined && init_options[k] !== null) {
|
||||||
data[k] = init_options[k];
|
data[k] = init_options[k];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,8 +7,8 @@ export default {
|
|||||||
show: false
|
show: false
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
name: null,
|
name: '',
|
||||||
time: null
|
time: ''
|
||||||
},
|
},
|
||||||
data: [],
|
data: [],
|
||||||
list: [],
|
list: [],
|
||||||
@ -104,7 +104,7 @@ export default {
|
|||||||
|
|
||||||
resetSearch() {
|
resetSearch() {
|
||||||
for (let k in this.options) {
|
for (let k in this.options) {
|
||||||
this.options[k] = null;
|
this.options[k] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
this.index();
|
this.index();
|
||||||
|
@ -17,8 +17,8 @@ export default {
|
|||||||
},
|
},
|
||||||
types: [],
|
types: [],
|
||||||
options: {
|
options: {
|
||||||
company_name: null,
|
company_name: '',
|
||||||
package_name: null,
|
package_name: '',
|
||||||
type: [],
|
type: [],
|
||||||
month: this.moment().subtract('2', 'months').startOf('month').format('YYYY-MM')
|
month: this.moment().subtract('2', 'months').startOf('month').format('YYYY-MM')
|
||||||
},
|
},
|
||||||
@ -227,7 +227,7 @@ export default {
|
|||||||
} else if (k === 'type') {
|
} else if (k === 'type') {
|
||||||
this.options[k] = [];
|
this.options[k] = [];
|
||||||
} else {
|
} else {
|
||||||
this.options[k] = null;
|
this.options[k] = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,9 +16,9 @@ export default {
|
|||||||
options: {}
|
options: {}
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
company_name: null,
|
company_name: '',
|
||||||
package_name: null,
|
package_name: '',
|
||||||
pay_channel: null,
|
pay_channel: '',
|
||||||
time: [
|
time: [
|
||||||
this.moment().subtract('2', 'months').startOf('month').format('YYYY-MM-DD'),
|
this.moment().subtract('2', 'months').startOf('month').format('YYYY-MM-DD'),
|
||||||
this.moment().subtract('2', 'months').endOf('month').format('YYYY-MM-DD')
|
this.moment().subtract('2', 'months').endOf('month').format('YYYY-MM-DD')
|
||||||
@ -191,7 +191,7 @@ export default {
|
|||||||
this.moment().subtract('2', 'months').endOf('month').format('YYYY-MM-DD')
|
this.moment().subtract('2', 'months').endOf('month').format('YYYY-MM-DD')
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
this.options[k] = null;
|
this.options[k] = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ export default{
|
|||||||
my_show: false,
|
my_show: false,
|
||||||
params: {
|
params: {
|
||||||
type: 0,
|
type: 0,
|
||||||
parent_id: null,
|
parent_id: '',
|
||||||
name: '',
|
name: '',
|
||||||
title: '',
|
title: '',
|
||||||
description: '',
|
description: '',
|
||||||
@ -196,8 +196,6 @@ export default{
|
|||||||
this.params[k] = 0;
|
this.params[k] = 0;
|
||||||
} else if (k == 'status') {
|
} else if (k == 'status') {
|
||||||
this.params[k] = 1;
|
this.params[k] = 1;
|
||||||
} else if (k == 'parent_id') {
|
|
||||||
this.params[k] = null;
|
|
||||||
} else {
|
} else {
|
||||||
this.params[k] = '';
|
this.params[k] = '';
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import * as API from 'api/base/permissions';
|
import * as API from 'api/base/permissions';
|
||||||
import { isIntNum } from 'validate';
|
import {
|
||||||
|
isIntNum
|
||||||
|
} from 'validate';
|
||||||
|
|
||||||
export default{
|
export default {
|
||||||
name: 'Permissions',
|
name: 'Permissions',
|
||||||
components: {
|
components: {
|
||||||
UiEdit: resolve => require(['views/system/permissions/edit'], resolve)
|
UiEdit: resolve => require(['views/system/permissions/edit'], resolve)
|
||||||
@ -97,9 +99,9 @@ export default{
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [openIcon 选择图标]
|
* [openIcon 选择图标]
|
||||||
* @return {[type]} [description]
|
* @return {[type]} [description]
|
||||||
*/
|
*/
|
||||||
openIcon() {
|
openIcon() {
|
||||||
this.iconObj = {
|
this.iconObj = {
|
||||||
show: true,
|
show: true,
|
||||||
@ -115,10 +117,10 @@ export default{
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [selectIconSuccess 图标选择成功触发事件]
|
* [selectIconSuccess 图标选择成功触发事件]
|
||||||
* @param {[type]} icon [description]
|
* @param {[type]} icon [description]
|
||||||
* @return {[type]} [description]
|
* @return {[type]} [description]
|
||||||
*/
|
*/
|
||||||
selectIconSuccess(icon) {
|
selectIconSuccess(icon) {
|
||||||
this.params.icon = icon;
|
this.params.icon = icon;
|
||||||
},
|
},
|
||||||
@ -138,9 +140,9 @@ export default{
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [destroy 批量删除]
|
* [destroy 批量删除]
|
||||||
* @return {[type]} [description]
|
* @return {[type]} [description]
|
||||||
*/
|
*/
|
||||||
destroy() {
|
destroy() {
|
||||||
let ids = [];
|
let ids = [];
|
||||||
if (!this.checked.length) {
|
if (!this.checked.length) {
|
||||||
@ -155,7 +157,9 @@ export default{
|
|||||||
ids.push(item.id);
|
ids.push(item.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
API.destroy({ ids: ids.join(',') }).then(res => {
|
API.destroy({
|
||||||
|
ids: ids.join(',')
|
||||||
|
}).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
// 如果删除的是包含当前编辑项,清空编辑项
|
// 如果删除的是包含当前编辑项,清空编辑项
|
||||||
if (ids.includes(this.id)) {
|
if (ids.includes(this.id)) {
|
||||||
@ -242,17 +246,15 @@ export default{
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [clear 清空]
|
* [clear 清空]
|
||||||
* @return {[type]} [description]
|
* @return {[type]} [description]
|
||||||
*/
|
*/
|
||||||
clear() {
|
clear() {
|
||||||
for (let k in this.params) {
|
for (let k in this.params) {
|
||||||
if (['type', 'displayorder', 'open', 'height', 'width'].includes(k)) {
|
if (['type', 'displayorder', 'open', 'height', 'width'].includes(k)) {
|
||||||
this.params[k] = 0;
|
this.params[k] = 0;
|
||||||
} else if (k == 'status') {
|
} else if (k == 'status') {
|
||||||
this.params[k] = 1;
|
this.params[k] = 1;
|
||||||
} else if (k == 'parent_id') {
|
|
||||||
this.params[k] = null;
|
|
||||||
} else {
|
} else {
|
||||||
this.params[k] = '';
|
this.params[k] = '';
|
||||||
}
|
}
|
||||||
|
@ -8,12 +8,12 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
params: {
|
params: {
|
||||||
'id': null,
|
id: '',
|
||||||
'sim': null,
|
sim: '',
|
||||||
'company_name': null,
|
company_name: '',
|
||||||
'package_name': null,
|
package_name: '',
|
||||||
'carrier_operator': null,
|
carrier_operator: '',
|
||||||
'time': []
|
time: []
|
||||||
},
|
},
|
||||||
list_data: null,
|
list_data: null,
|
||||||
detailObj: {
|
detailObj: {
|
||||||
@ -161,7 +161,7 @@ export default {
|
|||||||
if (k === 'time') {
|
if (k === 'time') {
|
||||||
this.params[k] = [];
|
this.params[k] = [];
|
||||||
} else {
|
} else {
|
||||||
this.params[k] = null;
|
this.params[k] = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.index(1);
|
this.index(1);
|
||||||
|
@ -9,9 +9,9 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
options: {
|
options: {
|
||||||
company_name: null,
|
company_name: '',
|
||||||
name: null,
|
name: '',
|
||||||
carrier_operator: null,
|
carrier_operator: '',
|
||||||
month: this.moment().subtract('2', 'months').startOf('month').format('YYYY-MM')
|
month: this.moment().subtract('2', 'months').startOf('month').format('YYYY-MM')
|
||||||
},
|
},
|
||||||
list_data: null,
|
list_data: null,
|
||||||
@ -350,7 +350,7 @@ export default {
|
|||||||
if (k === 'month') {
|
if (k === 'month') {
|
||||||
this.options[k] = this.moment().subtract('2', 'months').startOf('month').format('YYYY-MM');
|
this.options[k] = this.moment().subtract('2', 'months').startOf('month').format('YYYY-MM');
|
||||||
} else {
|
} else {
|
||||||
this.options[k] = null;
|
this.options[k] = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,11 +10,11 @@ export default {
|
|||||||
return {
|
return {
|
||||||
params: {
|
params: {
|
||||||
type: 0,
|
type: 0,
|
||||||
sn: null,
|
sn: '',
|
||||||
company_name: null,
|
company_name: '',
|
||||||
package_name: null,
|
package_name: '',
|
||||||
order_status: null,
|
order_status: '',
|
||||||
carrier_operator: null,
|
carrier_operator: '',
|
||||||
time: []
|
time: []
|
||||||
},
|
},
|
||||||
list_data: null,
|
list_data: null,
|
||||||
@ -550,7 +550,7 @@ export default {
|
|||||||
if (k === 'time') {
|
if (k === 'time') {
|
||||||
this.params[k] = [];
|
this.params[k] = [];
|
||||||
} else {
|
} else {
|
||||||
this.params[k] = null;
|
this.params[k] = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.index(1);
|
this.index(1);
|
||||||
|
@ -7,9 +7,9 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
params: {
|
params: {
|
||||||
name: null,
|
name: '',
|
||||||
carrier_operator: null,
|
carrier_operator: '',
|
||||||
sn: null
|
sn: ''
|
||||||
},
|
},
|
||||||
type: 0,
|
type: 0,
|
||||||
trashed: null,
|
trashed: null,
|
||||||
@ -229,7 +229,7 @@ export default {
|
|||||||
|
|
||||||
resetSearch() {
|
resetSearch() {
|
||||||
for (let k in this.params) {
|
for (let k in this.params) {
|
||||||
this.params[k] = null;
|
this.params[k] = '';
|
||||||
}
|
}
|
||||||
this.trashed = null;
|
this.trashed = null;
|
||||||
this.index(1);
|
this.index(1);
|
||||||
|
@ -8,10 +8,10 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
params: {
|
params: {
|
||||||
company_id: null,
|
company_id: '',
|
||||||
carrier_operator: null,
|
carrier_operator: '',
|
||||||
name: null,
|
name: '',
|
||||||
package_name: null
|
package_name: ''
|
||||||
},
|
},
|
||||||
editObj: {
|
editObj: {
|
||||||
show: false,
|
show: false,
|
||||||
@ -213,9 +213,7 @@ export default {
|
|||||||
},
|
},
|
||||||
resetSearch() {
|
resetSearch() {
|
||||||
for (let k in this.params) {
|
for (let k in this.params) {
|
||||||
if (k !== 'company_id') {
|
this.params[k] = '';
|
||||||
this.params[k] = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.index();
|
this.index();
|
||||||
},
|
},
|
||||||
|
2
public/js/app.aa00184d.js
Normal file
2
public/js/app.aa00184d.js
Normal file
File diff suppressed because one or more lines are too long
1
public/js/app.aa00184d.js.map
Normal file
1
public/js/app.aa00184d.js.map
Normal file
File diff suppressed because one or more lines are too long
2
public/js/chunk-36cd36e2.17dd6236.js
Normal file
2
public/js/chunk-36cd36e2.17dd6236.js
Normal file
File diff suppressed because one or more lines are too long
1
public/js/chunk-36cd36e2.17dd6236.js.map
Normal file
1
public/js/chunk-36cd36e2.17dd6236.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=\favicon.ico><script src=\config.js></script><title></title><link href=/css/chunk-36cd36e2.6cd40709.css rel=prefetch><link href=/js/chunk-00ae0766.9e6b7bf3.js rel=prefetch><link href=/js/chunk-36cd36e2.26bb8c16.js rel=prefetch><link href=/css/app.ce4b14dc.css rel=preload as=style><link href=/css/chunk-vendors.3c3b2e85.css rel=preload as=style><link href=/js/app.84367b81.js rel=preload as=script><link href=/js/chunk-vendors.02a4e5bc.js rel=preload as=script><link href=/css/chunk-vendors.3c3b2e85.css rel=stylesheet><link href=/css/app.ce4b14dc.css rel=stylesheet></head><body><noscript><strong>很抱歉,如果没有启用JavaScript,程序不能正常工作,若要继续使用请启用它。</strong></noscript><div id=app></div><script src=/js/chunk-vendors.02a4e5bc.js></script><script src=/js/app.84367b81.js></script></body></html>
|
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=\favicon.ico><script src=\config.js></script><title></title><link href=/css/chunk-36cd36e2.6cd40709.css rel=prefetch><link href=/js/chunk-00ae0766.9e6b7bf3.js rel=prefetch><link href=/js/chunk-36cd36e2.17dd6236.js rel=prefetch><link href=/css/app.ce4b14dc.css rel=preload as=style><link href=/css/chunk-vendors.3c3b2e85.css rel=preload as=style><link href=/js/app.aa00184d.js rel=preload as=script><link href=/js/chunk-vendors.02a4e5bc.js rel=preload as=script><link href=/css/chunk-vendors.3c3b2e85.css rel=stylesheet><link href=/css/app.ce4b14dc.css rel=stylesheet></head><body><noscript><strong>很抱歉,如果没有启用JavaScript,程序不能正常工作,若要继续使用请启用它。</strong></noscript><div id=app></div><script src=/js/chunk-vendors.02a4e5bc.js></script><script src=/js/app.aa00184d.js></script></body></html>
|
Loading…
x
Reference in New Issue
Block a user