|
|
@ -27,7 +27,6 @@ |
|
|
|
:pagination="pagination" |
|
|
|
:pagination="pagination" |
|
|
|
style="margin-top: 8px;" |
|
|
|
style="margin-top: 8px;" |
|
|
|
@pageChange="handlePageChange" |
|
|
|
@pageChange="handlePageChange" |
|
|
|
@selectRowChange="handleSelectRowChange" |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
<template v-slot:action="props"> |
|
|
|
<template v-slot:action="props"> |
|
|
|
<a @click="submitForm(props)">保存</a> |
|
|
|
<a @click="submitForm(props)">保存</a> |
|
|
@ -52,7 +51,7 @@ |
|
|
|
import ZyStyleModelModal from './modules/ZyStyleModelModal' |
|
|
|
import ZyStyleModelModal from './modules/ZyStyleModelModal' |
|
|
|
import {deleteAction, getAction, postAction, putAction, postFormAction, httpAction} from "@api/manage"; |
|
|
|
import {deleteAction, getAction, postAction, putAction, postFormAction, httpAction} from "@api/manage"; |
|
|
|
import store from "@/store"; |
|
|
|
import store from "@/store"; |
|
|
|
import { validateDuplicateValue } from '@/utils/util' |
|
|
|
import {filterObj, validateDuplicateValue} from '@/utils/util' |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: 'ZyStyleModelList', |
|
|
|
name: 'ZyStyleModelList', |
|
|
@ -86,11 +85,13 @@ |
|
|
|
pageSizeOptions: ['10', '20', '30', '100', '200'], |
|
|
|
pageSizeOptions: ['10', '20', '30', '100', '200'], |
|
|
|
// 数据总数(目前并不知道真实的总数,所以先填写0,在后台查出来后再赋值) |
|
|
|
// 数据总数(目前并不知道真实的总数,所以先填写0,在后台查出来后再赋值) |
|
|
|
total: 0, |
|
|
|
total: 0, |
|
|
|
|
|
|
|
showQuickJumper: true, |
|
|
|
|
|
|
|
showSizeChanger: true, |
|
|
|
|
|
|
|
id:null |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 选择的行 |
|
|
|
|
|
|
|
selectedRows: [], |
|
|
|
|
|
|
|
// 数据源,控制表格的数据 |
|
|
|
// 数据源,控制表格的数据 |
|
|
|
dataSource: [], |
|
|
|
|
|
|
|
columns: [ |
|
|
|
columns: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '款式', |
|
|
|
title: '款式', |
|
|
@ -144,15 +145,19 @@ |
|
|
|
exportXlsUrl: "/zystylemodel/zyStyleModel/exportXls", |
|
|
|
exportXlsUrl: "/zystylemodel/zyStyleModel/exportXls", |
|
|
|
importExcelUrl: "zystylemodel/zyStyleModel/importExcel", |
|
|
|
importExcelUrl: "zystylemodel/zyStyleModel/importExcel", |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
//参数 |
|
|
|
|
|
|
|
loadRouteType:false, |
|
|
|
|
|
|
|
id:null, |
|
|
|
rowId:'', |
|
|
|
rowId:'', |
|
|
|
dictOptions:{}, |
|
|
|
dictOptions:{}, |
|
|
|
superFieldList:[], |
|
|
|
superFieldList:[], |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
created() { |
|
|
|
this.loadData(); |
|
|
|
//this.loadData(); |
|
|
|
|
|
|
|
this.loadParameter() ; |
|
|
|
//备份model原始值 |
|
|
|
//备份model原始值 |
|
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
|
|
|
//this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
|
importExcelUrl: function(){ |
|
|
|
importExcelUrl: function(){ |
|
|
@ -179,8 +184,6 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
submitForm (props) { |
|
|
|
submitForm (props) { |
|
|
|
this.model = Object.assign({}, props); |
|
|
|
this.model = Object.assign({}, props); |
|
|
|
// console.log(props.rowId) |
|
|
|
|
|
|
|
// console.log(this.model) |
|
|
|
|
|
|
|
var str = props.rowId; |
|
|
|
var str = props.rowId; |
|
|
|
let httpurl = ''; |
|
|
|
let httpurl = ''; |
|
|
|
let method = ''; |
|
|
|
let method = ''; |
|
|
@ -200,25 +203,38 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
//加载传递参数 |
|
|
|
|
|
|
|
loadParameter() { |
|
|
|
|
|
|
|
if (this.loadRouteType == false) { |
|
|
|
|
|
|
|
this.id = this.$route.query.id; |
|
|
|
|
|
|
|
this.loadRouteType = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 加载数据 |
|
|
|
// 加载数据 |
|
|
|
loadData() { |
|
|
|
loadData(arg) { |
|
|
|
// 封装查询条件 |
|
|
|
//加载数据 若传入参数1则加载第一页的内容 |
|
|
|
let formData = { |
|
|
|
if (arg === 1) { |
|
|
|
pageNo: this.pagination.current, |
|
|
|
this.pagination.current = 1; |
|
|
|
pageSize: this.pagination.pageSize |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
// 调用查询数据接口 |
|
|
|
// 调用查询数据接口 |
|
|
|
this.loading = true |
|
|
|
this.loadParameter(); |
|
|
|
getAction(this.url.list, formData).then(res => { |
|
|
|
var params = this.getQueryParams();//查询条件 |
|
|
|
|
|
|
|
this.loading = true; |
|
|
|
|
|
|
|
getAction(this.url.list, params).then(res => { |
|
|
|
if (res.success) { |
|
|
|
if (res.success) { |
|
|
|
// 后台查询回来的 total,数据总数量 |
|
|
|
/*// 后台查询回来的 total,数据总数量 |
|
|
|
this.pagination.total = res.result.total |
|
|
|
this.pagination.total = res.result.total*/ |
|
|
|
// 将查询的数据赋值给 dataSource |
|
|
|
// 将查询的数据赋值给 dataSource |
|
|
|
this.dataSource = res.result.records |
|
|
|
this.dataSource = res.result.records||res.result; |
|
|
|
console.log(this.dataSource,'aaa') |
|
|
|
console.log(this.dataSource,'abc') |
|
|
|
// 重置选择 |
|
|
|
if(res.result.total) |
|
|
|
this.selectedRows = [] |
|
|
|
{ |
|
|
|
|
|
|
|
this.pagination.total = res.result.total; |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
this.pagination.total = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//this.dataSource = res.result.records |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.$error({title: '主表查询失败', content: res.message}) |
|
|
|
this.$error({title: '主表查询失败', content: res.message}) |
|
|
|
} |
|
|
|
} |
|
|
@ -237,7 +253,20 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
initDictConfig(){ |
|
|
|
initDictConfig(){ |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
getQueryParams() { |
|
|
|
|
|
|
|
//获取查询条件 |
|
|
|
|
|
|
|
let sqp = {} |
|
|
|
|
|
|
|
if(this.superQueryParams){ |
|
|
|
|
|
|
|
sqp['superQueryParams']=encodeURI(this.superQueryParams) |
|
|
|
|
|
|
|
sqp['superQueryMatchType'] = this.superQueryMatchType |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters); |
|
|
|
|
|
|
|
param.field = this.getQueryField(); |
|
|
|
|
|
|
|
param.pageNo = this.ipagination.current; |
|
|
|
|
|
|
|
param.pageSize = this.ipagination.pageSize; |
|
|
|
|
|
|
|
param.styleId=this.id |
|
|
|
|
|
|
|
return filterObj(param); |
|
|
|
|
|
|
|
}, |
|
|
|
getSuperFieldList(){ |
|
|
|
getSuperFieldList(){ |
|
|
|
let fieldList=[]; |
|
|
|
let fieldList=[]; |
|
|
|
fieldList.push({type:'string',value:'styleId',text:'款式id',dictCode:''}) |
|
|
|
fieldList.push({type:'string',value:'styleId',text:'款式id',dictCode:''}) |
|
|
|