会员管理、短信管理、设置、积分商城、资讯管理
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ ENV = 'development'
|
||||
VUE_APP_PROJECT_NAME = 'cereshop-admin-web'
|
||||
|
||||
# 请求服务配置
|
||||
VUE_APP_DEV_REQUEST_DOMAIN_PREFIX = 'http://192.168.10.16:8764'
|
||||
VUE_APP_DEV_REQUEST_DOMAIN_PREFIX = 'http://192.168.10.129:8764'
|
||||
|
||||
# 是否启用验证码
|
||||
VUE_APP_IS_CAPTCHA = true
|
||||
|
||||
Generated
+8
-8
@@ -3820,9 +3820,9 @@
|
||||
}
|
||||
},
|
||||
"vue-loader-v16": {
|
||||
"version": "npm:vue-loader@16.0.0-beta.8",
|
||||
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.0.0-beta.8.tgz",
|
||||
"integrity": "sha512-oouKUQWWHbSihqSD7mhymGPX1OQ4hedzAHyvm8RdyHh6m3oIvoRF+NM45i/bhNOlo8jCnuJhaSUf/6oDjv978g==",
|
||||
"version": "npm:vue-loader@16.2.0",
|
||||
"resolved": "https://registry.nlark.com/vue-loader/download/vue-loader-16.2.0.tgz",
|
||||
"integrity": "sha1-BGpTMI3Ufljv4g3ewe3sAnzjtG4=",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -3832,9 +3832,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"json5": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz",
|
||||
"integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==",
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npm.taobao.org/json5/download/json5-2.2.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjson5%2Fdownload%2Fjson5-2.2.0.tgz",
|
||||
"integrity": "sha1-Lf7+cgxrpSXZ69kJlQ8FFTFsiaM=",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -3843,8 +3843,8 @@
|
||||
},
|
||||
"loader-utils": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
|
||||
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
|
||||
"resolved": "https://registry.npm.taobao.org/loader-utils/download/loader-utils-2.0.0.tgz",
|
||||
"integrity": "sha1-5MrOW4FtQloWa18JfhDNErNgZLA=",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
|
||||
+2
-1
@@ -12,7 +12,8 @@ axios.interceptors.request.use(
|
||||
if (token && isToken) {
|
||||
config.headers.token = 'Bearer ' + token
|
||||
}
|
||||
|
||||
// config.headers.tenant = 1166;
|
||||
// config.headers.tenant = db.get('TENANT', '')
|
||||
const clientId = process.env.VUE_APP_CLIENT_ID
|
||||
const clientSecret = process.env.VUE_APP_CLIENT_SECRET
|
||||
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
import axiosApi from './AxiosApi.js'
|
||||
|
||||
const apiList = {
|
||||
page: {
|
||||
method: 'POST',
|
||||
url: `/MemberTask/page`
|
||||
},
|
||||
update: {
|
||||
method: 'PUT',
|
||||
url: `/MemberTask`
|
||||
},
|
||||
save: {
|
||||
method: 'POST',
|
||||
url: `/MemberTask`
|
||||
},
|
||||
delete: {
|
||||
method: 'DELETE',
|
||||
url: `/MemberTask`
|
||||
},
|
||||
preview: {
|
||||
method: 'POST',
|
||||
url: `/MemberTask/preview`
|
||||
},
|
||||
export: {
|
||||
method: 'POST',
|
||||
url: `/MemberTask/export`
|
||||
},
|
||||
import: {
|
||||
method: 'POST',
|
||||
url: `/MemberTask/import`
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
page(data) {
|
||||
return axiosApi({
|
||||
...apiList.page,
|
||||
data
|
||||
})
|
||||
},
|
||||
query(parentId) {
|
||||
return axiosApi({
|
||||
method: 'GET',
|
||||
url: `/MemberTask/${parentId}`
|
||||
})
|
||||
},
|
||||
save(data) {
|
||||
return axiosApi({
|
||||
...apiList.save,
|
||||
data
|
||||
})
|
||||
},
|
||||
update(data) {
|
||||
return axiosApi({
|
||||
...apiList.update,
|
||||
data
|
||||
})
|
||||
},
|
||||
delete(data) {
|
||||
return axiosApi({
|
||||
...apiList.delete,
|
||||
data
|
||||
})
|
||||
},
|
||||
preview(data) {
|
||||
return axiosApi({
|
||||
...apiList.preview,
|
||||
data
|
||||
})
|
||||
},
|
||||
export(data) {
|
||||
return axiosApi({
|
||||
...apiList.export,
|
||||
responseType: "blob",
|
||||
data
|
||||
})
|
||||
},
|
||||
import(data) {
|
||||
return axiosApi({
|
||||
...apiList.import,
|
||||
data
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
import axiosApi from './AxiosApi.js'
|
||||
|
||||
const apiList = {
|
||||
page: {
|
||||
method: 'POST',
|
||||
url: `/store/information/page`,
|
||||
},
|
||||
query: {
|
||||
method: 'POST',
|
||||
url: `/store/information/query`,
|
||||
},
|
||||
update: {
|
||||
method: 'PUT',
|
||||
url: `/store/information`
|
||||
},
|
||||
save: {
|
||||
method: 'POST',
|
||||
url: `/store/information`
|
||||
},
|
||||
delete: {
|
||||
method: 'DELETE',
|
||||
url: `/store/information`
|
||||
},
|
||||
export: {
|
||||
method: 'POST',
|
||||
url: `/store/information/export`
|
||||
},
|
||||
preview: {
|
||||
method: 'POST',
|
||||
url: `/store/information/preview`
|
||||
},
|
||||
import: {
|
||||
method: 'POST',
|
||||
url: `/store/information/import`
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
page (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.page,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
query (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.query,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
save (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.save,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
update (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.update,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
delete (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.delete,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
export (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.export,
|
||||
responseType: "blob",
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
preview (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.preview,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
import (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.import,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -26,5 +26,11 @@ export default {
|
||||
url: apiList.editTenant,
|
||||
data
|
||||
})
|
||||
},
|
||||
fixRole(tenantCode) {
|
||||
return axiosApi({
|
||||
method: 'GET',
|
||||
url: `/resource/fixRole/${tenantCode}`
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
import axiosApi from './AxiosApi.js'
|
||||
|
||||
const apiList = {
|
||||
page: {
|
||||
method: 'POST',
|
||||
url: `/memberRank/page`
|
||||
},
|
||||
update: {
|
||||
method: 'PUT',
|
||||
url: `/memberRank`
|
||||
},
|
||||
save: {
|
||||
method: 'POST',
|
||||
url: `/memberRank`
|
||||
},
|
||||
delete: {
|
||||
method: 'DELETE',
|
||||
url: `/memberRank`
|
||||
},
|
||||
preview: {
|
||||
method: 'POST',
|
||||
url: `/memberRank/preview`
|
||||
},
|
||||
export: {
|
||||
method: 'POST',
|
||||
url: `/memberRank/export`
|
||||
},
|
||||
import: {
|
||||
method: 'POST',
|
||||
url: `/memberRank/import`
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
page(data) {
|
||||
return axiosApi({
|
||||
...apiList.page,
|
||||
data
|
||||
})
|
||||
},
|
||||
query(parentId) {
|
||||
return axiosApi({
|
||||
method: 'GET',
|
||||
url: `/memberRank/${parentId}`
|
||||
})
|
||||
},
|
||||
save(data) {
|
||||
return axiosApi({
|
||||
...apiList.save,
|
||||
data
|
||||
})
|
||||
},
|
||||
update(data) {
|
||||
return axiosApi({
|
||||
...apiList.update,
|
||||
data
|
||||
})
|
||||
},
|
||||
delete(data) {
|
||||
return axiosApi({
|
||||
...apiList.delete,
|
||||
data
|
||||
})
|
||||
},
|
||||
preview(data) {
|
||||
return axiosApi({
|
||||
...apiList.preview,
|
||||
data
|
||||
})
|
||||
},
|
||||
export(data) {
|
||||
return axiosApi({
|
||||
...apiList.export,
|
||||
responseType: "blob",
|
||||
data
|
||||
})
|
||||
},
|
||||
import(data) {
|
||||
return axiosApi({
|
||||
...apiList.import,
|
||||
data
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
import axiosApi from './AxiosApi.js'
|
||||
|
||||
const apiList = {
|
||||
getLogistics: `/logistics/detail/page`,
|
||||
// addLogistics: `/logistics`,
|
||||
// checkLogistics: `/logistics/detail/`,
|
||||
// updateLogistics: `/logistics`,
|
||||
// deleteLogistics: `/logistics`,
|
||||
// getProductList: `/product/page`,
|
||||
// findDefaultStore: `/store/findDefaultStore`,
|
||||
// updateStore: `/store`
|
||||
}
|
||||
|
||||
export default {
|
||||
// updateStore(data) {
|
||||
// return axiosApi({
|
||||
// method: 'PUT',
|
||||
// url: apiList.updateStore,
|
||||
// data
|
||||
// })
|
||||
// },
|
||||
// findDefaultStore() {
|
||||
// return axiosApi({
|
||||
// method: 'GET',
|
||||
// url: apiList.findDefaultStore
|
||||
// })
|
||||
// },
|
||||
getLogistics(data) {
|
||||
return axiosApi({
|
||||
method: 'POST',
|
||||
url: apiList.getLogistics,
|
||||
data
|
||||
})
|
||||
},
|
||||
// addLogistics(data) {
|
||||
// return axiosApi({
|
||||
// method: 'POST',
|
||||
// url: apiList.addLogistics,
|
||||
// data
|
||||
// })
|
||||
// },
|
||||
// checkLogistics(id) {
|
||||
// return axiosApi({
|
||||
// method: 'GET',
|
||||
// url: apiList.checkLogistics + id
|
||||
// })
|
||||
// },
|
||||
// updateLogistics(data) {
|
||||
// return axiosApi({
|
||||
// method: 'PUT',
|
||||
// url: apiList.updateLogistics,
|
||||
// data
|
||||
// })
|
||||
// },
|
||||
// deleteLogistics(data) {
|
||||
// return axiosApi({
|
||||
// method: 'DELETE',
|
||||
// url: apiList.deleteLogistics,
|
||||
// data
|
||||
// })
|
||||
// },
|
||||
// eidtGroup(data) {
|
||||
// return axiosApi({
|
||||
// method: 'PUT',
|
||||
// url: apiList.productGroup,
|
||||
// data
|
||||
// })
|
||||
// },
|
||||
// deleteGroup(data) {
|
||||
// return axiosApi({
|
||||
// method: 'POST',
|
||||
// url: apiList.deleteGroup,
|
||||
// data
|
||||
// })
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
import axioApi from './AxiosApi'
|
||||
|
||||
|
||||
const apiList = {
|
||||
ceresConfigs: '/config/getdata',
|
||||
printerList:'/config/printerList',
|
||||
// updatePrinter:'/config/updatePrinter',
|
||||
// addPrinter:'/config/addPrinter',
|
||||
// delPrinter:'/config/delPrinter',
|
||||
setdata:'/config/setdata',
|
||||
// getDeductions:'/config/getDeductionList',
|
||||
// addDeduction:'/config/addDeduction',
|
||||
// updateDeduction:'/config/updateDeduction',
|
||||
// delDeduction:'/config/stopDeduction',
|
||||
// startDeduction:'/config/startDeduction',
|
||||
// getSonDeductionList:'/config/getSonDeductionList',
|
||||
addConfig: '/config/addConfig',
|
||||
|
||||
}
|
||||
|
||||
|
||||
export default {
|
||||
// getSonDeductionList(data){
|
||||
// return axioApi({
|
||||
// method: 'POST',
|
||||
// url: apiList.getSonDeductionList,
|
||||
// data
|
||||
// })
|
||||
// },
|
||||
// delDeduction(data){
|
||||
// return axioApi({
|
||||
// method: 'POST',
|
||||
// url: apiList.delDeduction,
|
||||
// data
|
||||
// })
|
||||
// },
|
||||
// startDeduction(data){
|
||||
// return axioApi({
|
||||
// method: 'POST',
|
||||
// url: apiList.startDeduction,
|
||||
// data
|
||||
// })
|
||||
// },
|
||||
// updateDeduction(data){
|
||||
// return axioApi({
|
||||
// method: 'POST',
|
||||
// url: apiList.updateDeduction,
|
||||
// data
|
||||
// })
|
||||
// },
|
||||
// addDeduction(data){
|
||||
// return axioApi({
|
||||
// method: 'POST',
|
||||
// url: apiList.addDeduction,
|
||||
// data
|
||||
// })
|
||||
// },
|
||||
// getDeductions(data){
|
||||
// return axioApi({
|
||||
// method: 'POST',
|
||||
// url: apiList.getDeductions,
|
||||
// data
|
||||
// })
|
||||
// },
|
||||
ceresConfigs(data){
|
||||
return axioApi({
|
||||
method: 'POST',
|
||||
url: apiList.ceresConfigs,
|
||||
data
|
||||
})
|
||||
},
|
||||
printerList(data){
|
||||
return axioApi({
|
||||
method: 'POST',
|
||||
url: apiList.printerList,
|
||||
data
|
||||
})
|
||||
},
|
||||
// updatePrinter(data){
|
||||
// return axioApi({
|
||||
// method: 'POST',
|
||||
// url: apiList.updatePrinter,
|
||||
// data
|
||||
// })
|
||||
// },
|
||||
// addPrinter(data){
|
||||
// return axioApi({
|
||||
// method: 'POST',
|
||||
// url: apiList.addPrinter,
|
||||
// data
|
||||
// })
|
||||
// },
|
||||
// delPrinter(data){
|
||||
// return axioApi({
|
||||
// method: 'POST',
|
||||
// url: apiList.delPrinter,
|
||||
// data
|
||||
// })
|
||||
// },
|
||||
setdata(data){
|
||||
return axioApi({
|
||||
method: 'POST',
|
||||
url: apiList.setdata,
|
||||
data
|
||||
})
|
||||
},
|
||||
addConfig(data) {
|
||||
return axioApi({
|
||||
method: 'POST',
|
||||
url: apiList.addConfig,
|
||||
data
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
import axiosApi from '../AxiosApi.js'
|
||||
|
||||
const apiList = {
|
||||
page: {
|
||||
method: 'POST',
|
||||
url: `/creditGoods/page`,
|
||||
},
|
||||
query: {
|
||||
method: 'POST',
|
||||
url: `/creditGoods/query`,
|
||||
},
|
||||
update: {
|
||||
method: 'PUT',
|
||||
url: `/creditGoods`
|
||||
},
|
||||
save: {
|
||||
method: 'POST',
|
||||
url: `/creditGoods`
|
||||
},
|
||||
delete: {
|
||||
method: 'DELETE',
|
||||
url: `/creditGoods`
|
||||
},
|
||||
export: {
|
||||
method: 'POST',
|
||||
url: `/creditGoods/export`
|
||||
},
|
||||
preview: {
|
||||
method: 'POST',
|
||||
url: `/creditGoods/preview`
|
||||
},
|
||||
import: {
|
||||
method: 'POST',
|
||||
url: `/creditGoods/import`
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
page (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.page,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
query (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.query,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
save (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.save,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
update (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.update,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
delete (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.delete,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
export (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.export,
|
||||
responseType: "blob",
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
preview (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.preview,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
import (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.import,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
import axiosApi from '../AxiosApi.js'
|
||||
|
||||
const apiList = {
|
||||
page: {
|
||||
method: 'POST',
|
||||
url: `/creditGoodsCategory/page`,
|
||||
},
|
||||
query: {
|
||||
method: 'POST',
|
||||
url: `/creditGoodsCategory/query`,
|
||||
},
|
||||
update: {
|
||||
method: 'PUT',
|
||||
url: `/creditGoodsCategory`
|
||||
},
|
||||
save: {
|
||||
method: 'POST',
|
||||
url: `/creditGoodsCategory`
|
||||
},
|
||||
delete: {
|
||||
method: 'DELETE',
|
||||
url: `/creditGoodsCategory`
|
||||
},
|
||||
export: {
|
||||
method: 'POST',
|
||||
url: `/creditGoodsCategory/export`
|
||||
},
|
||||
preview: {
|
||||
method: 'POST',
|
||||
url: `/creditGoodsCategory/preview`
|
||||
},
|
||||
import: {
|
||||
method: 'POST',
|
||||
url: `/creditGoodsCategory/import`
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
page (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.page,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
query (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.query,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
save (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.save,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
update (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.update,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
delete (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.delete,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
export (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.export,
|
||||
responseType: "blob",
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
preview (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.preview,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
import (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.import,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
import axiosApi from '../AxiosApi.js'
|
||||
|
||||
const apiList = {
|
||||
page: {
|
||||
method: 'POST',
|
||||
url: `/store/creditGoodsImg/page`,
|
||||
},
|
||||
query: {
|
||||
method: 'POST',
|
||||
url: `/store/creditGoodsImg/query`,
|
||||
},
|
||||
update: {
|
||||
method: 'PUT',
|
||||
url: `/store/creditGoodsImg`
|
||||
},
|
||||
save: {
|
||||
method: 'POST',
|
||||
url: `/store/creditGoodsImg`
|
||||
},
|
||||
delete: {
|
||||
method: 'DELETE',
|
||||
url: `/store/creditGoodsImg`
|
||||
},
|
||||
export: {
|
||||
method: 'POST',
|
||||
url: `/store/creditGoodsImg/export`
|
||||
},
|
||||
preview: {
|
||||
method: 'POST',
|
||||
url: `/store/creditGoodsImg/preview`
|
||||
},
|
||||
import: {
|
||||
method: 'POST',
|
||||
url: `/store/creditGoodsImg/import`
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
page (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.page,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
query (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.query,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
save (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.save,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
update (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.update,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
delete (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.delete,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
export (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.export,
|
||||
responseType: "blob",
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
preview (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.preview,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
import (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.import,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
import axiosApi from '../AxiosApi.js'
|
||||
|
||||
const apiList = {
|
||||
page: {
|
||||
method: 'POST',
|
||||
url: `/creditOrder/page`,
|
||||
},
|
||||
query: {
|
||||
method: 'POST',
|
||||
url: `/creditOrder/query`,
|
||||
},
|
||||
update: {
|
||||
method: 'PUT',
|
||||
url: `/creditOrder`
|
||||
},
|
||||
save: {
|
||||
method: 'POST',
|
||||
url: `/creditOrder`
|
||||
},
|
||||
delete: {
|
||||
method: 'DELETE',
|
||||
url: `/creditOrder`
|
||||
},
|
||||
export: {
|
||||
method: 'POST',
|
||||
url: `/creditOrder/export`
|
||||
},
|
||||
preview: {
|
||||
method: 'POST',
|
||||
url: `/creditOrder/preview`
|
||||
},
|
||||
import: {
|
||||
method: 'POST',
|
||||
url: `/creditOrder/import`
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
page (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.page,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
query (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.query,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
save (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.save,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
update (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.update,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
delete (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.delete,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
export (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.export,
|
||||
responseType: "blob",
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
preview (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.preview,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
import (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.import,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
import axiosApi from '../AxiosApi.js'
|
||||
|
||||
const apiList = {
|
||||
page: {
|
||||
method: 'POST',
|
||||
url: `/store/creditOrderDelivery/page`,
|
||||
},
|
||||
query: {
|
||||
method: 'POST',
|
||||
url: `/store/creditOrderDelivery/query`,
|
||||
},
|
||||
update: {
|
||||
method: 'PUT',
|
||||
url: `/store/creditOrderDelivery`
|
||||
},
|
||||
save: {
|
||||
method: 'POST',
|
||||
url: `/store/creditOrderDelivery`
|
||||
},
|
||||
delete: {
|
||||
method: 'DELETE',
|
||||
url: `/store/creditOrderDelivery`
|
||||
},
|
||||
export: {
|
||||
method: 'POST',
|
||||
url: `/store/creditOrderDelivery/export`
|
||||
},
|
||||
preview: {
|
||||
method: 'POST',
|
||||
url: `/store/creditOrderDelivery/preview`
|
||||
},
|
||||
import: {
|
||||
method: 'POST',
|
||||
url: `/store/creditOrderDelivery/import`
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
page (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.page,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
query (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.query,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
save (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.save,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
update (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.update,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
delete (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.delete,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
export (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.export,
|
||||
responseType: "blob",
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
preview (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.preview,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
import (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.import,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
import axiosApi from '../AxiosApi.js'
|
||||
|
||||
const apiList = {
|
||||
page: {
|
||||
method: 'POST',
|
||||
url: `/store/creditOrderDetail/page`,
|
||||
},
|
||||
query: {
|
||||
method: 'POST',
|
||||
url: `/store/creditOrderDetail/query`,
|
||||
},
|
||||
update: {
|
||||
method: 'PUT',
|
||||
url: `/store/creditOrderDetail`
|
||||
},
|
||||
save: {
|
||||
method: 'POST',
|
||||
url: `/store/creditOrderDetail`
|
||||
},
|
||||
delete: {
|
||||
method: 'DELETE',
|
||||
url: `/store/creditOrderDetail`
|
||||
},
|
||||
export: {
|
||||
method: 'POST',
|
||||
url: `/store/creditOrderDetail/export`
|
||||
},
|
||||
preview: {
|
||||
method: 'POST',
|
||||
url: `/store/creditOrderDetail/preview`
|
||||
},
|
||||
import: {
|
||||
method: 'POST',
|
||||
url: `/store/creditOrderDetail/import`
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
page (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.page,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
query (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.query,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
save (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.save,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
update (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.update,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
delete (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.delete,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
export (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.export,
|
||||
responseType: "blob",
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
preview (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.preview,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
},
|
||||
import (data, custom = {}) {
|
||||
return axiosApi({
|
||||
...apiList.import,
|
||||
data,
|
||||
custom
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,13 @@
|
||||
>
|
||||
{{ scope.row.status.code | prohibitTips }}
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click.native.prevent="fixRole(scope.row)"
|
||||
>
|
||||
权限恢复
|
||||
</el-button>
|
||||
</template>
|
||||
</table-column>
|
||||
</Table>
|
||||
@@ -130,6 +137,15 @@ export default {
|
||||
this.prohibitPut(item)
|
||||
})
|
||||
},
|
||||
fixRole(item) {
|
||||
Management.fixRole(item.code).then(res => {
|
||||
this.$message({
|
||||
message: '权限修复完成',
|
||||
type: 'success',
|
||||
center: true
|
||||
});
|
||||
});
|
||||
},
|
||||
async prohibitPut(item) {
|
||||
const code = item.status.code
|
||||
const id = item.id
|
||||
|
||||
+107
@@ -32,6 +32,113 @@ export default {
|
||||
github: 'Github Repository'
|
||||
},
|
||||
table: {
|
||||
information: {
|
||||
id: 'ID',
|
||||
storeId: 'storeId',
|
||||
mainTitle: 'mainTitle',
|
||||
viceTitle: 'viceTitle',
|
||||
content: 'content',
|
||||
coverImg: 'coverImg',
|
||||
startTime: 'startTime',
|
||||
endTime: 'endTime',
|
||||
state: 'state',
|
||||
isDelete: 'isDelete',
|
||||
},
|
||||
creditOrder: {
|
||||
id: 'ID',
|
||||
mid: 'mid',
|
||||
orderCode: 'orderCode',
|
||||
amount: 'amount',
|
||||
state: 'state',
|
||||
useTyped: 'useTyped',
|
||||
isDelete: 'isDelete',
|
||||
},
|
||||
creditOrderDetail: {
|
||||
id: 'ID',
|
||||
orderId: 'orderId',
|
||||
goodsId: 'goodsId',
|
||||
categoryId: 'categoryId',
|
||||
name: 'name',
|
||||
description: 'description',
|
||||
worth: 'worth',
|
||||
price: 'price',
|
||||
couponId: 'couponId',
|
||||
canPick: 'canPick',
|
||||
canDelivery: 'canDelivery',
|
||||
goodsMainImg: 'goodsMainImg',
|
||||
goodsViceImg: 'goodsViceImg',
|
||||
goodsNumber: 'goodsNumber',
|
||||
isDelete: 'isDelete',
|
||||
},
|
||||
creditOrderDelivery: {
|
||||
id: 'ID',
|
||||
orderId: 'orderId',
|
||||
state: 'state',
|
||||
username: 'username',
|
||||
phone: 'phone',
|
||||
province: 'province',
|
||||
city: 'city',
|
||||
area: 'area',
|
||||
cityInfo: 'cityInfo',
|
||||
address: 'address',
|
||||
longitude: 'longitude',
|
||||
latitude: 'latitude',
|
||||
isDelete: 'isDelete',
|
||||
},
|
||||
creditGoods: {
|
||||
id: 'ID',
|
||||
categoryId: 'categoryId',
|
||||
name: 'name',
|
||||
description: 'description',
|
||||
worth: 'worth',
|
||||
price: 'price',
|
||||
stock: 'stock',
|
||||
sales: 'sales',
|
||||
isHot: 'isHot',
|
||||
couponId: 'couponId',
|
||||
canPick: 'canPick',
|
||||
canDelivery: 'canDelivery',
|
||||
sortOrder: 'sortOrder',
|
||||
state: 'state',
|
||||
isDelete: 'isDelete',
|
||||
mainImgPath: 'mainImgPath',
|
||||
viceImgPaths: 'viceImgPaths'
|
||||
},
|
||||
creditGoodsImg: {
|
||||
id: 'ID',
|
||||
goodsId: 'goodsId',
|
||||
imgPath: 'imgPath',
|
||||
sortOrder: 'sortOrder',
|
||||
typed: 'typed',
|
||||
enabled: 'enabled',
|
||||
isDelete: 'isDelete',
|
||||
},
|
||||
creditGoodsCategory: {
|
||||
id: 'ID',
|
||||
parentId: 'parentId',
|
||||
name: 'name',
|
||||
miniShow: 'miniShow',
|
||||
sortOrder: 'sortOrder',
|
||||
isDelete: 'isDelete',
|
||||
},
|
||||
memberRank: {
|
||||
id: 'ID',
|
||||
rankName: 'rankName',
|
||||
rankOrigin: 'rankOrigin',
|
||||
rankContent: 'rankContent',
|
||||
rankImg: 'rankImg',
|
||||
status: 'status',
|
||||
},
|
||||
ceresMemberTask: {
|
||||
id: 'ID',
|
||||
name: 'name',
|
||||
type: 'type',
|
||||
limitDay: 'limitDay',
|
||||
rewardType: 'rewardType',
|
||||
rewardValue: 'rewardValue',
|
||||
aspects: 'aspects',
|
||||
status: 'status',
|
||||
},
|
||||
tenant: {
|
||||
code: 'EnterpriseCode',
|
||||
name: 'EnterpriseName',
|
||||
|
||||
+109
@@ -32,6 +32,115 @@ export default {
|
||||
github: '项目地址'
|
||||
},
|
||||
table: {
|
||||
information: {
|
||||
id: 'ID',
|
||||
storeId: '店铺ID',
|
||||
mainTitle: '主标题',
|
||||
viceTitle: '副标题',
|
||||
content: '内容',
|
||||
coverImg: '封面图',
|
||||
startTime: '开始时间',
|
||||
endTime: '结束时间',
|
||||
state: '状态:1-上架,0-下架',
|
||||
isDelete: '逻辑删除:1-删除 0-未删除',
|
||||
},
|
||||
creditOrder: {
|
||||
id: 'ID',
|
||||
mid: '会员ID',
|
||||
orderCode: '订单编号',
|
||||
amount: '金额',
|
||||
state: '状态:1-未完成,2-已完成,9-已取消',
|
||||
useTyped: '使用类型:1-配送,2-自提,3-虚拟',
|
||||
isDelete: '逻辑删除:1-删除 0-未删除',
|
||||
},
|
||||
creditOrderDetail: {
|
||||
id: 'ID',
|
||||
orderId: '订单ID',
|
||||
goodsId: '商品ID',
|
||||
categoryId: '商品分类ID',
|
||||
name: '商品名',
|
||||
description: '商品描述',
|
||||
worth: '商品价值(人民币)',
|
||||
price: '商品价格(积分)',
|
||||
couponId: '优惠券ID(如果该值大于0,则购买之后赠送相应的优惠券)',
|
||||
canPick: '能否自提',
|
||||
canDelivery: '能否配送',
|
||||
goodsMainImg: '商品主图路径',
|
||||
goodsViceImg: '商品副图的路径集合',
|
||||
goodsNumber: '商品数量',
|
||||
isDelete: '逻辑删除:1-删除 0-未删除',
|
||||
},
|
||||
creditOrderDelivery: {
|
||||
id: 'ID',
|
||||
orderId: '订单ID',
|
||||
state: '状态:1-待发货,2-待收货,3-已完成',
|
||||
username: '收货人姓名',
|
||||
phone: '收货手机号',
|
||||
province: '收货地址省份',
|
||||
city: '收货地址城市',
|
||||
area: '收货地址区域',
|
||||
cityInfo: '城市信息',
|
||||
address: '收货详细地址',
|
||||
longitude: '经度',
|
||||
latitude: '纬度',
|
||||
isDelete: '逻辑删除:1-删除 0-未删除',
|
||||
},
|
||||
creditGoods: {
|
||||
id: 'ID',
|
||||
categoryId: '分类ID',
|
||||
name: '商品名',
|
||||
description: '描述',
|
||||
worth: '价值(人民币)',
|
||||
price: '价格(积分)',
|
||||
stock: '库存',
|
||||
sales: '销量',
|
||||
isHot: '是否为热门',
|
||||
couponId: '优惠券ID',
|
||||
canPick: '能否自提',
|
||||
canDelivery: '能否配送',
|
||||
sortOrder: '显示顺序',
|
||||
state: '状态',
|
||||
isDelete: '逻辑删除',
|
||||
mainImgPath: '主图路径',
|
||||
viceImgPaths: '副图列表'
|
||||
},
|
||||
creditGoodsImg: {
|
||||
id: 'ID',
|
||||
goodsId: '商品ID',
|
||||
imgPath: '图片路径',
|
||||
sortOrder: '显示顺序',
|
||||
typed: '类型:1-主图,2-副图',
|
||||
enabled: '是否启用:1-已启用,0-未启用',
|
||||
isDelete: '逻辑删除:1-删除 0-未删除',
|
||||
},
|
||||
creditGoodsCategory: {
|
||||
id: 'ID',
|
||||
parentId: '父分类ID',
|
||||
name: '分类名',
|
||||
miniShow: '小程序是否显示',
|
||||
// miniShow: '小程序是否显示:1-显示,0-不显示',
|
||||
sortOrder: '显示顺序',
|
||||
isDelete: '逻辑删除:1-删除 0-未删除',
|
||||
},
|
||||
memberRank: {
|
||||
id: 'ID',
|
||||
rankName: '等级名称',
|
||||
rankOrigin: '起始分数',
|
||||
rankContent: '等级详情',
|
||||
rankImg: '等级图片',
|
||||
status: '状态',
|
||||
},
|
||||
ceresMemberTask: {
|
||||
id: 'ID',
|
||||
name: '任务名称',
|
||||
type: '任务类型',
|
||||
limitDay: '每日次数限制',
|
||||
rewardType: '奖励类型',
|
||||
// rewardType: '奖励类型1积分 ',
|
||||
rewardValue: '奖励数值',
|
||||
aspects: '切面方法 用,隔开',
|
||||
status: '状态',
|
||||
},
|
||||
tenant: {
|
||||
code: '企业编码',
|
||||
name: '企业名称',
|
||||
|
||||
+203
-2
@@ -215,6 +215,76 @@ const constRouter = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/information',
|
||||
component: Layout,
|
||||
name: "资讯管理",
|
||||
children: [
|
||||
{
|
||||
path: '/information',
|
||||
component: () => import('@/views/information/index'),
|
||||
meta: {
|
||||
title: '资讯管理',
|
||||
affix: true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/creditGoods',
|
||||
component: Layout,
|
||||
name: '积分商城',
|
||||
children: [
|
||||
{
|
||||
path: '/creditGoods/goods',
|
||||
component: () => import('@/views/creditGoods/goods/index'),
|
||||
meta: {
|
||||
title: '商品管理',
|
||||
affix: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/creditGoods/goodsImg',
|
||||
component: () => import('@/views/creditGoods/goodsImg/index'),
|
||||
meta: {
|
||||
title: '商品图片',
|
||||
affix: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/creditGoods/goodsCategory',
|
||||
component: () => import('@/views/creditGoods/goodsCategory/index'),
|
||||
meta: {
|
||||
title: '商品分类',
|
||||
affix: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/creditGoods/order',
|
||||
component: () => import('@/views/creditGoods/order/index'),
|
||||
meta: {
|
||||
title: '订单管理',
|
||||
affix: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/creditGoods/orderDetail',
|
||||
component: () => import('@/views/creditGoods/orderDetail/index'),
|
||||
meta: {
|
||||
title: '订单详情',
|
||||
affix: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/creditGoods/orderDelivery',
|
||||
component: () => import('@/views/creditGoods/orderDelivery/index'),
|
||||
meta: {
|
||||
title: '订单物流',
|
||||
affix: true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/customer-manage',
|
||||
component: Layout,
|
||||
@@ -300,7 +370,8 @@ const constRouter = [
|
||||
meta: { title: 'page404', noCache: true }
|
||||
}
|
||||
]
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"sortValue": 1,
|
||||
children: [{
|
||||
"sortValue": 0,
|
||||
@@ -349,7 +420,112 @@ const constRouter = [
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": true
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"sortValue": 2,
|
||||
children: [{
|
||||
"sortValue": 0,
|
||||
path: "/member/index",
|
||||
name: "任务管理",
|
||||
component: resolve => require(['@/views/member/index'], resolve),
|
||||
meta: {
|
||||
"title": "任务管理",
|
||||
"icon": "",
|
||||
"breadcrumb": true
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": false
|
||||
},
|
||||
{
|
||||
"sortValue": 1,
|
||||
path: "/member/rank",
|
||||
name: "会员等级",
|
||||
component: resolve => require(['@/views/member/rank/index'], resolve),
|
||||
meta: {
|
||||
"title": "会员等级",
|
||||
"icon": "",
|
||||
"breadcrumb": true
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": false
|
||||
}],
|
||||
path: "/member",
|
||||
name: "会员管理",
|
||||
component: Layout,
|
||||
meta: {
|
||||
"title": "会员管理",
|
||||
"icon": "el-icon-user-solid",
|
||||
"breadcrumb": true
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": true
|
||||
},
|
||||
{
|
||||
"sortValue": 3,
|
||||
children: [{
|
||||
"sortValue": 0,
|
||||
path: "/sms/manage",
|
||||
name: "短信管理",
|
||||
component: resolve => require(['@/views/ceres/sms/manage/Index'], resolve),
|
||||
meta: {
|
||||
"title": "短信管理",
|
||||
"icon": "",
|
||||
"breadcrumb": true
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": false
|
||||
},
|
||||
{
|
||||
"sortValue": 1,
|
||||
path: "/sms/manage/edit",
|
||||
name: "短信编辑",
|
||||
component: resolve => require(['@/views/ceres/sms/manage/Edit'], resolve),
|
||||
meta: {
|
||||
"title": "短信编辑",
|
||||
"icon": "",
|
||||
"breadcrumb": true
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": false
|
||||
},
|
||||
{
|
||||
"sortValue": 2,
|
||||
path: "/sms/template",
|
||||
name: "短信模板",
|
||||
component: resolve => require(['@/views/ceres/sms/template/Index'], resolve),
|
||||
meta: {
|
||||
"title": "短信模板",
|
||||
"icon": "",
|
||||
"breadcrumb": true
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": false
|
||||
},
|
||||
{
|
||||
"sortValue": 3,
|
||||
path: "/sms/manage/sendStatusIndex",
|
||||
name: "短信",
|
||||
component: resolve => require(['@/views/ceres/sms/manage/SendStatusIndex'], resolve),
|
||||
meta: {
|
||||
"title": "短信",
|
||||
"icon": "",
|
||||
"breadcrumb": true
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": false
|
||||
}],
|
||||
path: "/sms",
|
||||
name: "短信设置",
|
||||
component: Layout,
|
||||
meta: {
|
||||
"title": "短信设置",
|
||||
"icon": "el-icon-message",
|
||||
"breadcrumb": true
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": true
|
||||
},
|
||||
{
|
||||
"sortValue": 10,
|
||||
children: [{
|
||||
"sortValue": 1,
|
||||
@@ -556,6 +732,31 @@ const constRouter = [
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": true
|
||||
},{
|
||||
"sortValue": 14,
|
||||
children: [{
|
||||
"sortValue": 1,
|
||||
path: "/system/posSystem",
|
||||
name: "系统设置",
|
||||
component: resolve => require(['@/views/System/posSystem'], resolve),
|
||||
meta: {
|
||||
"title": "系统设置",
|
||||
"icon": "",
|
||||
"breadcrumb": true
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": false
|
||||
}],
|
||||
path: "/system",
|
||||
name: "设置",
|
||||
component: Layout,
|
||||
meta: {
|
||||
"title": "设置",
|
||||
"icon": "el-icon-setting",
|
||||
"breadcrumb": true
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": true
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@@ -162,6 +162,80 @@ export default {
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/information',
|
||||
meta: {
|
||||
title: '资讯',
|
||||
icon: 'el-icon-s-promotion'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '/information',
|
||||
name: '资讯管理',
|
||||
meta: {
|
||||
title: '资讯管理',
|
||||
icon: ''
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/creditGoods',
|
||||
meta: {
|
||||
title: '积分商城',
|
||||
icon: 'el-icon-goods'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '/creditGoods/goods',
|
||||
name: '商品管理',
|
||||
meta: {
|
||||
title: '商品管理',
|
||||
icon: ''
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/creditGoods/goodsImg',
|
||||
name: '商品图片',
|
||||
meta: {
|
||||
title: '商品图片',
|
||||
icon: ''
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/creditGoods/goodsCategory',
|
||||
name: '商品分类',
|
||||
meta: {
|
||||
title: '商品分类',
|
||||
icon: ''
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/creditGoods/order',
|
||||
name: '订单管理',
|
||||
meta: {
|
||||
title: '订单管理',
|
||||
icon: ''
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/creditGoods/orderDetail',
|
||||
name: '订单详情',
|
||||
meta: {
|
||||
title: '订单详情',
|
||||
icon: ''
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/creditGoods/orderDelivery',
|
||||
name: '订单物流',
|
||||
meta: {
|
||||
title: '订单物流',
|
||||
icon: ''
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/customer-manage',
|
||||
meta: {
|
||||
@@ -236,7 +310,114 @@ export default {
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": true
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"sortValue": 2,
|
||||
"children": [
|
||||
{
|
||||
"sortValue": 0,
|
||||
"path": "/member/index",
|
||||
"name": "任务管理",
|
||||
"component": "member/index",
|
||||
"meta": {
|
||||
"title": "任务管理",
|
||||
"icon": "",
|
||||
"breadcrumb": true
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": false
|
||||
},
|
||||
{
|
||||
"sortValue": 1,
|
||||
"path": "/member/rank",
|
||||
"name": "会员等级",
|
||||
"component": "member/rank/index",
|
||||
"meta": {
|
||||
"title": "会员等级",
|
||||
"icon": "",
|
||||
"breadcrumb": true
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": false
|
||||
}],
|
||||
"path": "/member",
|
||||
"name": "会员管理",
|
||||
"component": "Layout",
|
||||
"meta": {
|
||||
"title": "会员管理",
|
||||
"icon": "el-icon-user-solid",
|
||||
"breadcrumb": true
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": true
|
||||
},
|
||||
{
|
||||
"sortValue": 3,
|
||||
"children": [{
|
||||
"sortValue": 0,
|
||||
"path": "/sms/manage",
|
||||
"name": "短信管理",
|
||||
"component": "ceres/sms/manage/Index",
|
||||
"meta": {
|
||||
"title": "短信管理",
|
||||
"icon": "",
|
||||
"breadcrumb": true
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": false
|
||||
},
|
||||
{
|
||||
"sortValue": 1,
|
||||
"path": "/sms/template",
|
||||
"name": "短信模板",
|
||||
"component": "ceres/sms/template/Index",
|
||||
"meta": {
|
||||
"title": "短信模板",
|
||||
"icon": "",
|
||||
"breadcrumb": true
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": false
|
||||
},
|
||||
// {
|
||||
// "sortValue": 1,
|
||||
// "path": "/sms/manage/edit",
|
||||
// "name": "短信模板",
|
||||
// "component": "ceres/sms/manage/Edit",
|
||||
// "meta": {
|
||||
// "title": "短信模板",
|
||||
// "icon": "",
|
||||
// "breadcrumb": true
|
||||
// },
|
||||
// "hidden": false,
|
||||
// "alwaysShow": false
|
||||
// },
|
||||
// {
|
||||
// "sortValue": 2,
|
||||
// "path": "/sms/manage/sendStatusIndex",
|
||||
// "name": "短信",
|
||||
// "component": "ceres/sms/manage/SendStatusIndex",
|
||||
// "meta": {
|
||||
// "title": "短信",
|
||||
// "icon": "",
|
||||
// "breadcrumb": true
|
||||
// },
|
||||
// "hidden": false,
|
||||
// "alwaysShow": false
|
||||
// }
|
||||
],
|
||||
"path": "/sms",
|
||||
"name": "短信管理",
|
||||
"component": "Layout",
|
||||
"meta": {
|
||||
"title": "短信管理",
|
||||
"icon": "el-icon-message",
|
||||
"breadcrumb": true
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": true
|
||||
},
|
||||
{
|
||||
"sortValue": 10,
|
||||
"children": [{
|
||||
"sortValue": 1,
|
||||
@@ -443,6 +624,31 @@ export default {
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": true
|
||||
}, {
|
||||
"sortValue": 13,
|
||||
"children": [{
|
||||
"sortValue": 1,
|
||||
"path": "/system/posSystem",
|
||||
"name": "系统设置",
|
||||
"component": "System/posSystem/Index",
|
||||
"meta": {
|
||||
"title": "系统设置",
|
||||
"icon": "",
|
||||
"breadcrumb": true
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": false
|
||||
}],
|
||||
"path": "/system",
|
||||
"name": "设置",
|
||||
"component": "Layout",
|
||||
"meta": {
|
||||
"title": "设置",
|
||||
"icon": "el-icon-setting",
|
||||
"breadcrumb": true
|
||||
},
|
||||
"hidden": false,
|
||||
"alwaysShow": true
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -37,6 +37,8 @@
|
||||
阿里云:使用 ${xx} 作为占位符
|
||||
<br />
|
||||
腾讯云:使用 {xx} 作为占位符
|
||||
<br />
|
||||
云片:使用 #xx# 作为占位符
|
||||
</aside>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.smsTemplate.templateCode')" prop="templateCode">
|
||||
|
||||
@@ -0,0 +1,233 @@
|
||||
<template>
|
||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true" :title="title" :type="type"
|
||||
:visible.sync="isVisible" :width="width" top="50px" v-el-drag-dialog>
|
||||
<el-form :model="creditGoods" :rules="rules" label-position="right" label-width="100px" ref="form">
|
||||
<el-form-item :label="$t('table.creditGoods.categoryId')" prop="categoryId">
|
||||
<el-input type="" v-model="creditGoods.categoryId" placeholder="分类ID"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoods.name')" prop="name">
|
||||
<el-input type="" v-model="creditGoods.name" placeholder="商品名"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoods.mainImgPath')" prop="imgPath">
|
||||
<el-input type="" v-model="creditGoods.mainImgPath" placeholder="图片路径"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoods.viceImgPaths')" prop="imgPath">
|
||||
<el-input type="" v-model="creditGoods.viceImgPaths" placeholder="图片路径"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoods.description')" prop="description">
|
||||
<el-input type="" v-model="creditGoods.description" placeholder="描述"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoods.worth')" prop="worth">
|
||||
<el-input type="" v-model="creditGoods.worth" placeholder="价值(人民币)"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoods.price')" prop="price">
|
||||
<el-input type="" v-model="creditGoods.price" placeholder="价格(积分)"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoods.stock')" prop="stock">
|
||||
<el-input type="" v-model="creditGoods.stock" placeholder="库存"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoods.sales')" prop="sales">
|
||||
<el-input type="" v-model="creditGoods.sales" placeholder="销量"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoods.isHot')" prop="isHot">
|
||||
<el-radio-group v-model="creditGoods.isHot" size="medium">
|
||||
<el-radio-button :label="true">{{ $t("common.yes") }}</el-radio-button>
|
||||
<el-radio-button :label="false">{{ $t("common.no") }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoods.couponId')" prop="couponId">
|
||||
<el-input type="" v-model="creditGoods.couponId" placeholder="优惠券ID(如果该值大于0,则购买之后赠送相应的优惠券)"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoods.canPick')" prop="canPick">
|
||||
<el-radio-group v-model="creditGoods.canPick" size="medium">
|
||||
<el-radio-button :label="true">{{ $t("common.yes") }}</el-radio-button>
|
||||
<el-radio-button :label="false">{{ $t("common.no") }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoods.canDelivery')" prop="canDelivery">
|
||||
<el-radio-group v-model="creditGoods.canDelivery" size="medium">
|
||||
<el-radio-button :label="true">{{ $t("common.yes") }}</el-radio-button>
|
||||
<el-radio-button :label="false">{{ $t("common.no") }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoods.sortOrder')" prop="sortOrder">
|
||||
<el-input type="" v-model="creditGoods.sortOrder" placeholder="显示顺序"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoods.state')" prop="state">
|
||||
<el-input type="" v-model="creditGoods.state" placeholder="状态:1-上架,0-下架"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoods.isDelete')" prop="isDelete">
|
||||
<el-input type="" v-model="creditGoods.isDelete" placeholder="逻辑删除:1-删除 0-未删除"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="dialog-footer" slot="footer">
|
||||
<el-button @click="isVisible = false" plain type="warning">
|
||||
{{ $t("common.cancel") }}
|
||||
</el-button>
|
||||
<el-button @click="submitForm" :disabled="confirmDisabled" plain type="primary">
|
||||
{{ $t("common.confirm") }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import elDragDialog from '@/directive/el-drag-dialog'
|
||||
import creditGoodsApi from "@/api/creditGoods/CreditGoods.js";
|
||||
|
||||
export default {
|
||||
name: "CreditGoodsEdit",
|
||||
directives: { elDragDialog },
|
||||
components: { },
|
||||
props: {
|
||||
dialogVisible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: "add"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
confirmDisabled: false,
|
||||
creditGoods: this.initCreditGoods(),
|
||||
screenWidth: 0,
|
||||
width: this.initWidth(),
|
||||
rules: {
|
||||
|
||||
},
|
||||
// 枚举
|
||||
enums: {
|
||||
},
|
||||
// 字典
|
||||
dicts: {
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isVisible: {
|
||||
get() {
|
||||
return this.dialogVisible;
|
||||
},
|
||||
set() {
|
||||
this.close();
|
||||
this.reset();
|
||||
}
|
||||
},
|
||||
title() {
|
||||
return this.$t("common." + this.type);
|
||||
}
|
||||
},
|
||||
watch: {},
|
||||
mounted() {
|
||||
window.onresize = () => {
|
||||
return (() => {
|
||||
this.width = this.initWidth();
|
||||
})();
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
initCreditGoods() {
|
||||
return {
|
||||
id: "",
|
||||
categoryId: null,
|
||||
name: '',
|
||||
mainImgPath: '',
|
||||
viceImgPaths: [],
|
||||
description: '',
|
||||
worth: null,
|
||||
price: null,
|
||||
stock: null,
|
||||
sales: null,
|
||||
isHot: true,
|
||||
couponId: null, // 如果该值大于0,则购买之后赠送相应的优惠券
|
||||
canPick: true,
|
||||
canDelivery: true,
|
||||
sortOrder: null,
|
||||
state: null, // 1-上架,0-下架
|
||||
isDelete: null, // 1-删除 0-未删除
|
||||
};
|
||||
},
|
||||
initWidth() {
|
||||
this.screenWidth = document.body.clientWidth;
|
||||
if (this.screenWidth < 991) {
|
||||
return "90%";
|
||||
} else if (this.screenWidth < 1400) {
|
||||
return "45%";
|
||||
} else {
|
||||
return "800px";
|
||||
}
|
||||
},
|
||||
setCreditGoods(val = {}) {
|
||||
const vm = this;
|
||||
|
||||
vm.dicts = val['dicts'];
|
||||
vm.enums = val['enums'];
|
||||
if (val['row']) {
|
||||
vm.creditGoods = { ...val['row'] };
|
||||
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.$emit("close");
|
||||
},
|
||||
reset() {
|
||||
// 先清除校验,再清除表单,不然有奇怪的bug
|
||||
this.$refs.form.clearValidate();
|
||||
this.$refs.form.resetFields();
|
||||
this.confirmDisabled = false;
|
||||
this.creditGoods = this.initCreditGoods();
|
||||
},
|
||||
submitForm() {
|
||||
const vm = this;
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
vm.editSubmit();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
editSubmit() {
|
||||
const vm = this;
|
||||
if (vm.type === "edit") {
|
||||
vm.update();
|
||||
} else {
|
||||
vm.save();
|
||||
}
|
||||
},
|
||||
save() {
|
||||
const vm = this;
|
||||
vm.confirmDisabled = true;
|
||||
creditGoodsApi.save(this.creditGoods).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
vm.isVisible = false;
|
||||
vm.$message({
|
||||
message: vm.$t("tips.createSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
vm.$emit("success");
|
||||
}
|
||||
}).finally(()=> vm.confirmDisabled = false);
|
||||
},
|
||||
update() {
|
||||
const vm = this;
|
||||
vm.confirmDisabled = true;
|
||||
creditGoodsApi.update(this.creditGoods).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
vm.isVisible = false;
|
||||
vm.$message({
|
||||
message: this.$t("tips.updateSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
vm.$emit("success");
|
||||
}
|
||||
}).finally(()=> vm.confirmDisabled = false);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,418 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="filter-container">
|
||||
<el-input
|
||||
:placeholder="$t('table.creditGoods.name')"
|
||||
class="filter-item search-item"
|
||||
v-model="queryParams.model.name"
|
||||
/>
|
||||
<el-input
|
||||
:placeholder="$t('table.creditGoods.description')"
|
||||
class="filter-item search-item"
|
||||
v-model="queryParams.model.description"
|
||||
/>
|
||||
|
||||
<el-date-picker :range-separator="null" class="filter-item search-item date-range-item"
|
||||
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期"
|
||||
type="daterange" v-model="queryParams.timeRange" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
/>
|
||||
<el-button @click="search" class="filter-item" plain type="primary">
|
||||
{{ $t("table.search") }}
|
||||
</el-button>
|
||||
<el-button @click="reset" class="filter-item" plain type="warning">
|
||||
{{ $t("table.reset") }}
|
||||
</el-button>
|
||||
<el-button @click="add" class="filter-item" plain type="danger" v-has-permission="['creditGoods:add']">
|
||||
{{ $t("table.add") }}
|
||||
</el-button>
|
||||
<el-dropdown class="filter-item" trigger="click" v-has-any-permission="['creditGoods:delete', 'creditGoods:export',
|
||||
'creditGoods:import']">
|
||||
<el-button>
|
||||
{{ $t("table.more") }}<i class="el-icon-arrow-down el-icon--right" />
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="batchDelete" v-has-permission="['creditGoods:delete']">
|
||||
{{ $t("table.delete") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exportExcel" v-has-permission="['creditGoods:export']">
|
||||
{{ $t("table.export") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exportExcelPreview" v-has-permission="['creditGoods:export']">
|
||||
{{ $t("table.exportPreview") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="importExcel" v-has-permission="['creditGoods:import']">
|
||||
{{ $t("table.import") }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
<el-table :data="tableData.records" :key="tableKey" @cell-click="cellClick"
|
||||
@filter-change="filterChange" @selection-change="onSelectChange" @sort-change="sortChange"
|
||||
border fit row-key="id" ref="table" style="width: 100%;" v-loading="loading">
|
||||
<el-table-column align="center" type="selection" width="40px" :reserve-selection="true"/>
|
||||
<el-table-column :label="$t('table.creditGoods.categoryId')" :show-overflow-tooltip="true" align="center" prop="categoryId"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.categoryId }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoods.name')" :show-overflow-tooltip="true" align="center" prop="name"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoods.description')" :show-overflow-tooltip="true" align="center" prop="description"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.description }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoods.worth')" :show-overflow-tooltip="true" align="center" prop="worth"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.worth }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoods.price')" :show-overflow-tooltip="true" align="center" prop="price"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.price }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoods.stock')" :show-overflow-tooltip="true" align="center" prop="stock"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.stock }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoods.sales')" :show-overflow-tooltip="true" align="center" prop="sales"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.sales }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoods.isHot')" :show-overflow-tooltip="true" align="center" prop="isHot"
|
||||
:filter-multiple="false" column-key="isHot"
|
||||
:filters="[{ text: $t('common.yes'), value: 'true' }, { text: $t('common.no'), value: 'false' }]"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.isHot ? 'success' : 'danger'" slot>
|
||||
{{ scope.row.isHot ? $t("common.yes") : $t("common.no") }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoods.couponId')" :show-overflow-tooltip="true" align="center" prop="couponId"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.couponId }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoods.canPick')" :show-overflow-tooltip="true" align="center" prop="canPick"
|
||||
:filter-multiple="false" column-key="canPick"
|
||||
:filters="[{ text: $t('common.yes'), value: 'true' }, { text: $t('common.no'), value: 'false' }]"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.canPick ? 'success' : 'danger'" slot>
|
||||
{{ scope.row.canPick ? $t("common.yes") : $t("common.no") }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoods.canDelivery')" :show-overflow-tooltip="true" align="center" prop="canDelivery"
|
||||
:filter-multiple="false" column-key="canDelivery"
|
||||
:filters="[{ text: $t('common.yes'), value: 'true' }, { text: $t('common.no'), value: 'false' }]"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.canDelivery ? 'success' : 'danger'" slot>
|
||||
{{ scope.row.canDelivery ? $t("common.yes") : $t("common.no") }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoods.sortOrder')" :show-overflow-tooltip="true" align="center" prop="sortOrder"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.sortOrder }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoods.state')" :show-overflow-tooltip="true" align="center" prop="state"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.state }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoods.isDelete')" :show-overflow-tooltip="true" align="center" prop="isDelete"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.isDelete }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('table.createTime')"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
sortable="custom"
|
||||
width="170px">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.createTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('table.operation')" align="center" column-key="operation" class-name="small-padding fixed-width" width="100px">
|
||||
<template slot-scope="{ row }">
|
||||
<i @click="copy(row)" class="el-icon-copy-document table-operation" :title="$t('common.delete')"
|
||||
style="color: #2db7f5;" v-hasPermission="['creditGoods:add']"/>
|
||||
<i @click="edit(row)" class="el-icon-edit table-operation" :title="$t('common.delete')"
|
||||
style="color: #2db7f5;" v-hasPermission="['creditGoods:update']"/>
|
||||
<i @click="singleDelete(row)" class="el-icon-delete table-operation" :title="$t('common.delete')"
|
||||
style="color: #f50;" v-hasPermission="['creditGoods:delete']"/>
|
||||
<el-link class="no-perm" v-has-no-permission="['creditGoods:update', 'creditGoods:copy', 'creditGoods:delete']">
|
||||
{{ $t("tips.noPermission") }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :limit.sync="queryParams.size" :page.sync="queryParams.current"
|
||||
:total="Number(tableData.total)" @pagination="fetch" v-show="tableData.total > 0"/>
|
||||
<creditGoods-edit :dialog-visible="dialog.isVisible" :type="dialog.type"
|
||||
@close="editClose" @success="editSuccess" ref="edit"/>
|
||||
<creditGoods-import ref="import" :dialog-visible="fileImport.isVisible" :type="fileImport.type"
|
||||
:action="fileImport.action" accept=".xls,.xlsx" @close="importClose" @success="importSuccess" />
|
||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true"
|
||||
title="预览" width="80%" top="50px" :visible.sync="preview.isVisible" v-el-drag-dialog>
|
||||
<el-scrollbar>
|
||||
<div v-html="preview.context"></div>
|
||||
</el-scrollbar>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from "@/components/Pagination";
|
||||
import elDragDialog from '@/directive/el-drag-dialog'
|
||||
import CreditGoodsEdit from "./Edit";
|
||||
import creditGoodsApi from "@/api/creditGoods/CreditGoods.js";
|
||||
import CreditGoodsImport from "@/components/ceres/Import"
|
||||
import {convertEnum} from '@/utils/utils'
|
||||
import {downloadFile, loadEnums, initDicts, initQueryParams} from '@/utils/commons'
|
||||
|
||||
export default {
|
||||
name: "CreditGoodsManage",
|
||||
directives: { elDragDialog },
|
||||
components: { Pagination, CreditGoodsEdit, CreditGoodsImport},
|
||||
filters: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 编辑
|
||||
dialog: {
|
||||
isVisible: false,
|
||||
type: "add"
|
||||
},
|
||||
// 预览
|
||||
preview: {
|
||||
isVisible: false,
|
||||
context: ''
|
||||
},
|
||||
// 导入
|
||||
fileImport: {
|
||||
isVisible: false,
|
||||
type: "import",
|
||||
action: `${process.env.VUE_APP_BASE_API}/creditGoods/import`
|
||||
// action: `${process.env.VUE_APP_BASE_API}/store/creditGoods/import`
|
||||
},
|
||||
tableKey: 0,
|
||||
queryParams: initQueryParams(),
|
||||
selection: [],
|
||||
loading: false,
|
||||
tableData: {
|
||||
total: 0
|
||||
},
|
||||
// 枚举
|
||||
enums: {
|
||||
},
|
||||
// 字典
|
||||
dicts: {
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
mounted() {
|
||||
this.fetch();
|
||||
|
||||
// 初始化字典和枚举
|
||||
const enumList = [];
|
||||
const dictList = [];
|
||||
loadEnums(enumList, this.enums, 'store');
|
||||
initDicts(dictList, this.dicts);
|
||||
},
|
||||
methods: {
|
||||
editClose() {
|
||||
this.dialog.isVisible = false;
|
||||
},
|
||||
editSuccess() {
|
||||
this.search();
|
||||
},
|
||||
onSelectChange(selection) {
|
||||
this.selection = selection;
|
||||
},
|
||||
search() {
|
||||
this.fetch({
|
||||
...this.queryParams
|
||||
});
|
||||
},
|
||||
reset() {
|
||||
this.queryParams = initQueryParams();
|
||||
this.$refs.table.clearSort();
|
||||
this.$refs.table.clearFilter();
|
||||
this.search();
|
||||
},
|
||||
exportExcelPreview() {
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
this.queryParams.map.fileName = '导出数据';
|
||||
creditGoodsApi.preview(this.queryParams).then(response => {
|
||||
const res = response.data;
|
||||
this.preview.isVisible = true;
|
||||
this.preview.context = res.data;
|
||||
});
|
||||
},
|
||||
exportExcel() {
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
this.queryParams.map.fileName = '导出数据';
|
||||
creditGoodsApi.export(this.queryParams).then(response => {
|
||||
downloadFile(response);
|
||||
});
|
||||
},
|
||||
importExcel() {
|
||||
this.fileImport.type = "upload";
|
||||
this.fileImport.isVisible = true;
|
||||
this.$refs.import.setModel(false);
|
||||
},
|
||||
importSuccess() {
|
||||
this.search();
|
||||
},
|
||||
importClose() {
|
||||
this.fileImport.isVisible = false;
|
||||
},
|
||||
singleDelete(row) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(row, true);
|
||||
this.batchDelete();
|
||||
},
|
||||
batchDelete() {
|
||||
if (!this.selection.length) {
|
||||
this.$message({
|
||||
message: this.$t("tips.noDataSelected"),
|
||||
type: "warning"
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$confirm(this.$t("tips.confirmDelete"), this.$t("common.tips"), {
|
||||
confirmButtonText: this.$t("common.confirm"),
|
||||
cancelButtonText: this.$t("common.cancel"),
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
const ids = this.selection.map(u => u.id);
|
||||
this.delete(ids);
|
||||
})
|
||||
.catch(() => {
|
||||
this.clearSelections();
|
||||
});
|
||||
},
|
||||
clearSelections() {
|
||||
this.$refs.table.clearSelection();
|
||||
},
|
||||
delete(ids) {
|
||||
creditGoodsApi.delete({ ids: ids }).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
this.$message({
|
||||
message: this.$t("tips.deleteSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
this.search();
|
||||
}
|
||||
});
|
||||
},
|
||||
add() {
|
||||
this.dialog.type = "add";
|
||||
this.dialog.isVisible = true;
|
||||
this.$refs.edit.setCreditGoods({ enums: this.enums, dicts: this.dicts});
|
||||
},
|
||||
copy(row) {
|
||||
this.$refs.edit.setCreditGoods({row, enums: this.enums, dicts: this.dicts});
|
||||
this.dialog.type = "copy";
|
||||
this.dialog.isVisible = true;
|
||||
},
|
||||
edit(row) {
|
||||
this.$refs.edit.setCreditGoods({row, enums: this.enums, dicts: this.dicts});
|
||||
this.dialog.type = "edit";
|
||||
this.dialog.isVisible = true;
|
||||
},
|
||||
fetch(params = {}) {
|
||||
this.loading = true;
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
|
||||
this.queryParams.current = params.current ? params.current : this.queryParams.current;
|
||||
this.queryParams.size = params.size ? params.size : this.queryParams.size;
|
||||
|
||||
creditGoodsApi.page(this.queryParams).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
this.tableData = res.data;
|
||||
}
|
||||
}).finally(() => this.loading = false);
|
||||
},
|
||||
sortChange(val) {
|
||||
this.queryParams.sort = val.prop;
|
||||
this.queryParams.order = val.order;
|
||||
if (this.queryParams.sort) {
|
||||
this.search();
|
||||
}
|
||||
},
|
||||
filterChange (filters) {
|
||||
for (const key in filters) {
|
||||
if(key.includes('.')) {
|
||||
const val = { };
|
||||
val[key.split('.')[1]] = filters[key][0];
|
||||
this.queryParams.model[key.split('.')[0]] = val;
|
||||
} else {
|
||||
this.queryParams.model[key] = filters[key][0]
|
||||
}
|
||||
}
|
||||
this.search()
|
||||
},
|
||||
cellClick (row, column) {
|
||||
if (column['columnKey'] === "operation") {
|
||||
return;
|
||||
}
|
||||
let flag = false;
|
||||
this.selection.forEach((item)=>{
|
||||
if(item.id === row.id) {
|
||||
flag = true;
|
||||
this.$refs.table.toggleRowSelection(row);
|
||||
}
|
||||
})
|
||||
|
||||
if(!flag){
|
||||
this.$refs.table.toggleRowSelection(row, true);
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,181 @@
|
||||
<template>
|
||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true" :title="title" :type="type"
|
||||
:visible.sync="isVisible" :width="width" top="50px" v-el-drag-dialog>
|
||||
<el-form :model="creditGoodsCategory" :rules="rules" label-position="right" label-width="100px" ref="form">
|
||||
<el-form-item :label="$t('table.creditGoodsCategory.parentId')" prop="parentId">
|
||||
<el-input type="" v-model="creditGoodsCategory.parentId" placeholder="父分类ID"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoodsCategory.name')" prop="name">
|
||||
<el-input type="" v-model="creditGoodsCategory.name" placeholder="分类名"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoodsCategory.miniShow')" prop="miniShow">
|
||||
<el-input type="" v-model="creditGoodsCategory.miniShow" placeholder="小程序是否显示:1-显示,0-不显示"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoodsCategory.sortOrder')" prop="sortOrder">
|
||||
<el-input type="" v-model="creditGoodsCategory.sortOrder" placeholder="显示顺序"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoodsCategory.isDelete')" prop="isDelete">
|
||||
<el-input type="" v-model="creditGoodsCategory.isDelete" placeholder="逻辑删除:1-删除 0-未删除"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="dialog-footer" slot="footer">
|
||||
<el-button @click="isVisible = false" plain type="warning">
|
||||
{{ $t("common.cancel") }}
|
||||
</el-button>
|
||||
<el-button @click="submitForm" :disabled="confirmDisabled" plain type="primary">
|
||||
{{ $t("common.confirm") }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import elDragDialog from '@/directive/el-drag-dialog'
|
||||
import creditGoodsCategoryApi from "@/api/creditGoods/CreditGoodsCategory.js";
|
||||
|
||||
export default {
|
||||
name: "CreditGoodsCategoryEdit",
|
||||
directives: { elDragDialog },
|
||||
components: { },
|
||||
props: {
|
||||
dialogVisible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: "add"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
confirmDisabled: false,
|
||||
creditGoodsCategory: this.initCreditGoodsCategory(),
|
||||
screenWidth: 0,
|
||||
width: this.initWidth(),
|
||||
rules: {
|
||||
|
||||
},
|
||||
// 枚举
|
||||
enums: {
|
||||
},
|
||||
// 字典
|
||||
dicts: {
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isVisible: {
|
||||
get() {
|
||||
return this.dialogVisible;
|
||||
},
|
||||
set() {
|
||||
this.close();
|
||||
this.reset();
|
||||
}
|
||||
},
|
||||
title() {
|
||||
return this.$t("common." + this.type);
|
||||
}
|
||||
},
|
||||
watch: {},
|
||||
mounted() {
|
||||
window.onresize = () => {
|
||||
return (() => {
|
||||
this.width = this.initWidth();
|
||||
})();
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
initCreditGoodsCategory() {
|
||||
return {
|
||||
// id: "",
|
||||
parentId: null,
|
||||
name: '',
|
||||
miniShow: null,
|
||||
sortOrder: null,
|
||||
isDelete: null,
|
||||
};
|
||||
},
|
||||
initWidth() {
|
||||
this.screenWidth = document.body.clientWidth;
|
||||
if (this.screenWidth < 991) {
|
||||
return "90%";
|
||||
} else if (this.screenWidth < 1400) {
|
||||
return "45%";
|
||||
} else {
|
||||
return "800px";
|
||||
}
|
||||
},
|
||||
setCreditGoodsCategory(val = {}) {
|
||||
const vm = this;
|
||||
|
||||
vm.dicts = val['dicts'];
|
||||
vm.enums = val['enums'];
|
||||
if (val['row']) {
|
||||
vm.creditGoodsCategory = { ...val['row'] };
|
||||
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.$emit("close");
|
||||
},
|
||||
reset() {
|
||||
// 先清除校验,再清除表单,不然有奇怪的bug
|
||||
this.$refs.form.clearValidate();
|
||||
this.$refs.form.resetFields();
|
||||
this.confirmDisabled = false;
|
||||
this.creditGoodsCategory = this.initCreditGoodsCategory();
|
||||
},
|
||||
submitForm() {
|
||||
const vm = this;
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
vm.editSubmit();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
editSubmit() {
|
||||
const vm = this;
|
||||
if (vm.type === "edit") {
|
||||
vm.update();
|
||||
} else {
|
||||
vm.save();
|
||||
}
|
||||
},
|
||||
save() {
|
||||
const vm = this;
|
||||
vm.confirmDisabled = true;
|
||||
this.creditGoodsCategory.id = 1;
|
||||
creditGoodsCategoryApi.save(this.creditGoodsCategory).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
vm.isVisible = false;
|
||||
vm.$message({
|
||||
message: vm.$t("tips.createSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
vm.$emit("success");
|
||||
}
|
||||
}).finally(()=> vm.confirmDisabled = false);
|
||||
},
|
||||
update() {
|
||||
const vm = this;
|
||||
vm.confirmDisabled = true;
|
||||
creditGoodsCategoryApi.update(this.creditGoodsCategory).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
vm.isVisible = false;
|
||||
vm.$message({
|
||||
message: this.$t("tips.updateSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
vm.$emit("success");
|
||||
}
|
||||
}).finally(()=> vm.confirmDisabled = false);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,347 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="filter-container">
|
||||
<el-input
|
||||
:placeholder="$t('table.creditGoodsCategory.name')"
|
||||
class="filter-item search-item"
|
||||
v-model="queryParams.model.name"
|
||||
/>
|
||||
|
||||
<el-date-picker :range-separator="null" class="filter-item search-item date-range-item"
|
||||
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期"
|
||||
type="daterange" v-model="queryParams.timeRange" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
/>
|
||||
<el-button @click="search" class="filter-item" plain type="primary">
|
||||
{{ $t("table.search") }}
|
||||
</el-button>
|
||||
<el-button @click="reset" class="filter-item" plain type="warning">
|
||||
{{ $t("table.reset") }}
|
||||
</el-button>
|
||||
<el-button @click="add" class="filter-item" plain type="danger" v-has-permission="['creditGoodsCategory:add']">
|
||||
{{ $t("table.add") }}
|
||||
</el-button>
|
||||
<el-dropdown class="filter-item" trigger="click" v-has-any-permission="['creditGoodsCategory:delete', 'creditGoodsCategory:export',
|
||||
'creditGoodsCategory:import']">
|
||||
<el-button>
|
||||
{{ $t("table.more") }}<i class="el-icon-arrow-down el-icon--right" />
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="batchDelete" v-has-permission="['creditGoodsCategory:delete']">
|
||||
{{ $t("table.delete") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exportExcel" v-has-permission="['creditGoodsCategory:export']">
|
||||
{{ $t("table.export") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exportExcelPreview" v-has-permission="['creditGoodsCategory:export']">
|
||||
{{ $t("table.exportPreview") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="importExcel" v-has-permission="['creditGoodsCategory:import']">
|
||||
{{ $t("table.import") }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
<el-table :data="tableData.records" :key="tableKey" @cell-click="cellClick"
|
||||
@filter-change="filterChange" @selection-change="onSelectChange" @sort-change="sortChange"
|
||||
border fit row-key="id" ref="table" style="width: 100%;" v-loading="loading">
|
||||
<el-table-column align="center" type="selection" width="40px" :reserve-selection="true"/>
|
||||
<el-table-column :label="$t('table.creditGoodsCategory.parentId')" :show-overflow-tooltip="true" align="center" prop="parentId"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.parentId }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoodsCategory.name')" :show-overflow-tooltip="true" align="center" prop="name"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoodsCategory.miniShow')" :show-overflow-tooltip="true" align="center" prop="miniShow"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.miniShow }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoodsCategory.sortOrder')" :show-overflow-tooltip="true" align="center" prop="sortOrder"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.sortOrder }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoodsCategory.isDelete')" :show-overflow-tooltip="true" align="center" prop="isDelete"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.isDelete }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('table.createTime')"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
sortable="custom"
|
||||
width="170px">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.createTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('table.operation')" align="center" column-key="operation" class-name="small-padding fixed-width" width="100px">
|
||||
<template slot-scope="{ row }">
|
||||
<i @click="copy(row)" class="el-icon-copy-document table-operation" :title="$t('common.delete')"
|
||||
style="color: #2db7f5;" v-hasPermission="['creditGoodsCategory:add']"/>
|
||||
<i @click="edit(row)" class="el-icon-edit table-operation" :title="$t('common.delete')"
|
||||
style="color: #2db7f5;" v-hasPermission="['creditGoodsCategory:update']"/>
|
||||
<i @click="singleDelete(row)" class="el-icon-delete table-operation" :title="$t('common.delete')"
|
||||
style="color: #f50;" v-hasPermission="['creditGoodsCategory:delete']"/>
|
||||
<el-link class="no-perm" v-has-no-permission="['creditGoodsCategory:update', 'creditGoodsCategory:copy', 'creditGoodsCategory:delete']">
|
||||
{{ $t("tips.noPermission") }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :limit.sync="queryParams.size" :page.sync="queryParams.current"
|
||||
:total="Number(tableData.total)" @pagination="fetch" v-show="tableData.total > 0"/>
|
||||
<creditGoodsCategory-edit :dialog-visible="dialog.isVisible" :type="dialog.type"
|
||||
@close="editClose" @success="editSuccess" ref="edit"/>
|
||||
<creditGoodsCategory-import ref="import" :dialog-visible="fileImport.isVisible" :type="fileImport.type"
|
||||
:action="fileImport.action" accept=".xls,.xlsx" @close="importClose" @success="importSuccess" />
|
||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true"
|
||||
title="预览" width="80%" top="50px" :visible.sync="preview.isVisible" v-el-drag-dialog>
|
||||
<el-scrollbar>
|
||||
<div v-html="preview.context"></div>
|
||||
</el-scrollbar>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from "@/components/Pagination";
|
||||
import elDragDialog from '@/directive/el-drag-dialog'
|
||||
import CreditGoodsCategoryEdit from "./Edit";
|
||||
import creditGoodsCategoryApi from "@/api/creditGoods/CreditGoodsCategory.js";
|
||||
import CreditGoodsCategoryImport from "@/components/ceres/Import"
|
||||
import {convertEnum} from '@/utils/utils'
|
||||
import {downloadFile, loadEnums, initDicts, initQueryParams} from '@/utils/commons'
|
||||
|
||||
export default {
|
||||
name: "CreditGoodsCategoryManage",
|
||||
directives: { elDragDialog },
|
||||
components: { Pagination, CreditGoodsCategoryEdit, CreditGoodsCategoryImport},
|
||||
filters: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 编辑
|
||||
dialog: {
|
||||
isVisible: false,
|
||||
type: "add"
|
||||
},
|
||||
// 预览
|
||||
preview: {
|
||||
isVisible: false,
|
||||
context: ''
|
||||
},
|
||||
// 导入
|
||||
fileImport: {
|
||||
isVisible: false,
|
||||
type: "import",
|
||||
action: `${process.env.VUE_APP_BASE_API}/creditGoodsCategory/import`
|
||||
// action: `${process.env.VUE_APP_BASE_API}/store/creditGoodsCategory/import`
|
||||
},
|
||||
tableKey: 0,
|
||||
queryParams: initQueryParams(),
|
||||
selection: [],
|
||||
loading: false,
|
||||
tableData: {
|
||||
total: 0
|
||||
},
|
||||
// 枚举
|
||||
enums: {
|
||||
},
|
||||
// 字典
|
||||
dicts: {
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
mounted() {
|
||||
this.fetch();
|
||||
|
||||
// 初始化字典和枚举
|
||||
const enumList = [];
|
||||
const dictList = [];
|
||||
loadEnums(enumList, this.enums, 'store');
|
||||
initDicts(dictList, this.dicts);
|
||||
},
|
||||
methods: {
|
||||
editClose() {
|
||||
this.dialog.isVisible = false;
|
||||
},
|
||||
editSuccess() {
|
||||
this.search();
|
||||
},
|
||||
onSelectChange(selection) {
|
||||
this.selection = selection;
|
||||
},
|
||||
search() {
|
||||
this.fetch({
|
||||
...this.queryParams
|
||||
});
|
||||
},
|
||||
reset() {
|
||||
this.queryParams = initQueryParams();
|
||||
this.$refs.table.clearSort();
|
||||
this.$refs.table.clearFilter();
|
||||
this.search();
|
||||
},
|
||||
exportExcelPreview() {
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
this.queryParams.map.fileName = '导出数据';
|
||||
creditGoodsCategoryApi.preview(this.queryParams).then(response => {
|
||||
const res = response.data;
|
||||
this.preview.isVisible = true;
|
||||
this.preview.context = res.data;
|
||||
});
|
||||
},
|
||||
exportExcel() {
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
this.queryParams.map.fileName = '导出数据';
|
||||
creditGoodsCategoryApi.export(this.queryParams).then(response => {
|
||||
downloadFile(response);
|
||||
});
|
||||
},
|
||||
importExcel() {
|
||||
this.fileImport.type = "upload";
|
||||
this.fileImport.isVisible = true;
|
||||
this.$refs.import.setModel(false);
|
||||
},
|
||||
importSuccess() {
|
||||
this.search();
|
||||
},
|
||||
importClose() {
|
||||
this.fileImport.isVisible = false;
|
||||
},
|
||||
singleDelete(row) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(row, true);
|
||||
this.batchDelete();
|
||||
},
|
||||
batchDelete() {
|
||||
if (!this.selection.length) {
|
||||
this.$message({
|
||||
message: this.$t("tips.noDataSelected"),
|
||||
type: "warning"
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$confirm(this.$t("tips.confirmDelete"), this.$t("common.tips"), {
|
||||
confirmButtonText: this.$t("common.confirm"),
|
||||
cancelButtonText: this.$t("common.cancel"),
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
const ids = this.selection.map(u => u.id);
|
||||
this.delete(ids);
|
||||
})
|
||||
.catch(() => {
|
||||
this.clearSelections();
|
||||
});
|
||||
},
|
||||
clearSelections() {
|
||||
this.$refs.table.clearSelection();
|
||||
},
|
||||
delete(ids) {
|
||||
creditGoodsCategoryApi.delete({ ids: ids }).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
this.$message({
|
||||
message: this.$t("tips.deleteSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
this.search();
|
||||
}
|
||||
});
|
||||
},
|
||||
add() {
|
||||
this.dialog.type = "add";
|
||||
this.dialog.isVisible = true;
|
||||
this.$refs.edit.setCreditGoodsCategory({ enums: this.enums, dicts: this.dicts});
|
||||
},
|
||||
copy(row) {
|
||||
this.$refs.edit.setCreditGoodsCategory({row, enums: this.enums, dicts: this.dicts});
|
||||
this.dialog.type = "copy";
|
||||
this.dialog.isVisible = true;
|
||||
},
|
||||
edit(row) {
|
||||
this.$refs.edit.setCreditGoodsCategory({row, enums: this.enums, dicts: this.dicts});
|
||||
this.dialog.type = "edit";
|
||||
this.dialog.isVisible = true;
|
||||
},
|
||||
fetch(params = {}) {
|
||||
this.loading = true;
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
|
||||
this.queryParams.current = params.current ? params.current : this.queryParams.current;
|
||||
this.queryParams.size = params.size ? params.size : this.queryParams.size;
|
||||
|
||||
creditGoodsCategoryApi.page(this.queryParams).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
this.tableData = res.data;
|
||||
}
|
||||
}).finally(() => this.loading = false);
|
||||
},
|
||||
sortChange(val) {
|
||||
this.queryParams.sort = val.prop;
|
||||
this.queryParams.order = val.order;
|
||||
if (this.queryParams.sort) {
|
||||
this.search();
|
||||
}
|
||||
},
|
||||
filterChange (filters) {
|
||||
for (const key in filters) {
|
||||
if(key.includes('.')) {
|
||||
const val = { };
|
||||
val[key.split('.')[1]] = filters[key][0];
|
||||
this.queryParams.model[key.split('.')[0]] = val;
|
||||
} else {
|
||||
this.queryParams.model[key] = filters[key][0]
|
||||
}
|
||||
}
|
||||
this.search()
|
||||
},
|
||||
cellClick (row, column) {
|
||||
if (column['columnKey'] === "operation") {
|
||||
return;
|
||||
}
|
||||
let flag = false;
|
||||
this.selection.forEach((item)=>{
|
||||
if(item.id === row.id) {
|
||||
flag = true;
|
||||
this.$refs.table.toggleRowSelection(row);
|
||||
}
|
||||
})
|
||||
|
||||
if(!flag){
|
||||
this.$refs.table.toggleRowSelection(row, true);
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,187 @@
|
||||
<template>
|
||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true" :title="title" :type="type"
|
||||
:visible.sync="isVisible" :width="width" top="50px" v-el-drag-dialog>
|
||||
<el-form :model="creditGoodsImg" :rules="rules" label-position="right" label-width="100px" ref="form">
|
||||
<el-form-item :label="$t('table.creditGoodsImg.goodsId')" prop="goodsId">
|
||||
<el-input type="" v-model="creditGoodsImg.goodsId" placeholder="商品ID"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoodsImg.imgPath')" prop="imgPath">
|
||||
<el-input type="" v-model="creditGoodsImg.imgPath" placeholder="图片路径"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoodsImg.sortOrder')" prop="sortOrder">
|
||||
<el-input type="" v-model="creditGoodsImg.sortOrder" placeholder="显示顺序"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoodsImg.typed')" prop="typed">
|
||||
<el-input type="" v-model="creditGoodsImg.typed" placeholder="类型:1-主图,2-副图"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoodsImg.enabled')" prop="enabled">
|
||||
<el-radio-group v-model="creditGoodsImg.enabled" size="medium">
|
||||
<el-radio-button :label="true">{{ $t("common.yes") }}</el-radio-button>
|
||||
<el-radio-button :label="false">{{ $t("common.no") }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditGoodsImg.isDelete')" prop="isDelete">
|
||||
<el-input type="" v-model="creditGoodsImg.isDelete" placeholder="逻辑删除:1-删除 0-未删除"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="dialog-footer" slot="footer">
|
||||
<el-button @click="isVisible = false" plain type="warning">
|
||||
{{ $t("common.cancel") }}
|
||||
</el-button>
|
||||
<el-button @click="submitForm" :disabled="confirmDisabled" plain type="primary">
|
||||
{{ $t("common.confirm") }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import elDragDialog from '@/directive/el-drag-dialog'
|
||||
import creditGoodsImgApi from "@/api/creditGoods/CreditGoodsImg.js";
|
||||
|
||||
export default {
|
||||
name: "CreditGoodsImgEdit",
|
||||
directives: { elDragDialog },
|
||||
components: { },
|
||||
props: {
|
||||
dialogVisible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: "add"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
confirmDisabled: false,
|
||||
creditGoodsImg: this.initCreditGoodsImg(),
|
||||
screenWidth: 0,
|
||||
width: this.initWidth(),
|
||||
rules: {
|
||||
|
||||
},
|
||||
// 枚举
|
||||
enums: {
|
||||
},
|
||||
// 字典
|
||||
dicts: {
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isVisible: {
|
||||
get() {
|
||||
return this.dialogVisible;
|
||||
},
|
||||
set() {
|
||||
this.close();
|
||||
this.reset();
|
||||
}
|
||||
},
|
||||
title() {
|
||||
return this.$t("common." + this.type);
|
||||
}
|
||||
},
|
||||
watch: {},
|
||||
mounted() {
|
||||
window.onresize = () => {
|
||||
return (() => {
|
||||
this.width = this.initWidth();
|
||||
})();
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
initCreditGoodsImg() {
|
||||
return {
|
||||
id: "",
|
||||
goodsId: null,
|
||||
imgPath: '',
|
||||
sortOrder: null,
|
||||
typed: null,
|
||||
enabled: true,
|
||||
isDelete: null,
|
||||
};
|
||||
},
|
||||
initWidth() {
|
||||
this.screenWidth = document.body.clientWidth;
|
||||
if (this.screenWidth < 991) {
|
||||
return "90%";
|
||||
} else if (this.screenWidth < 1400) {
|
||||
return "45%";
|
||||
} else {
|
||||
return "800px";
|
||||
}
|
||||
},
|
||||
setCreditGoodsImg(val = {}) {
|
||||
const vm = this;
|
||||
|
||||
vm.dicts = val['dicts'];
|
||||
vm.enums = val['enums'];
|
||||
if (val['row']) {
|
||||
vm.creditGoodsImg = { ...val['row'] };
|
||||
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.$emit("close");
|
||||
},
|
||||
reset() {
|
||||
// 先清除校验,再清除表单,不然有奇怪的bug
|
||||
this.$refs.form.clearValidate();
|
||||
this.$refs.form.resetFields();
|
||||
this.confirmDisabled = false;
|
||||
this.creditGoodsImg = this.initCreditGoodsImg();
|
||||
},
|
||||
submitForm() {
|
||||
const vm = this;
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
vm.editSubmit();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
editSubmit() {
|
||||
const vm = this;
|
||||
if (vm.type === "edit") {
|
||||
vm.update();
|
||||
} else {
|
||||
vm.save();
|
||||
}
|
||||
},
|
||||
save() {
|
||||
const vm = this;
|
||||
vm.confirmDisabled = true;
|
||||
creditGoodsImgApi.save(this.creditGoodsImg).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
vm.isVisible = false;
|
||||
vm.$message({
|
||||
message: vm.$t("tips.createSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
vm.$emit("success");
|
||||
}
|
||||
}).finally(()=> vm.confirmDisabled = false);
|
||||
},
|
||||
update() {
|
||||
const vm = this;
|
||||
vm.confirmDisabled = true;
|
||||
creditGoodsImgApi.update(this.creditGoodsImg).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
vm.isVisible = false;
|
||||
vm.$message({
|
||||
message: this.$t("tips.updateSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
vm.$emit("success");
|
||||
}
|
||||
}).finally(()=> vm.confirmDisabled = false);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,356 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="filter-container">
|
||||
<el-input
|
||||
:placeholder="$t('table.creditGoodsImg.imgPath')"
|
||||
class="filter-item search-item"
|
||||
v-model="queryParams.model.imgPath"
|
||||
/>
|
||||
|
||||
<el-date-picker :range-separator="null" class="filter-item search-item date-range-item"
|
||||
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期"
|
||||
type="daterange" v-model="queryParams.timeRange" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
/>
|
||||
<el-button @click="search" class="filter-item" plain type="primary">
|
||||
{{ $t("table.search") }}
|
||||
</el-button>
|
||||
<el-button @click="reset" class="filter-item" plain type="warning">
|
||||
{{ $t("table.reset") }}
|
||||
</el-button>
|
||||
<el-button @click="add" class="filter-item" plain type="danger" v-has-permission="['creditGoodsImg:add']">
|
||||
{{ $t("table.add") }}
|
||||
</el-button>
|
||||
<el-dropdown class="filter-item" trigger="click" v-has-any-permission="['creditGoodsImg:delete', 'creditGoodsImg:export',
|
||||
'creditGoodsImg:import']">
|
||||
<el-button>
|
||||
{{ $t("table.more") }}<i class="el-icon-arrow-down el-icon--right" />
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="batchDelete" v-has-permission="['creditGoodsImg:delete']">
|
||||
{{ $t("table.delete") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exportExcel" v-has-permission="['creditGoodsImg:export']">
|
||||
{{ $t("table.export") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exportExcelPreview" v-has-permission="['creditGoodsImg:export']">
|
||||
{{ $t("table.exportPreview") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="importExcel" v-has-permission="['creditGoodsImg:import']">
|
||||
{{ $t("table.import") }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
<el-table :data="tableData.records" :key="tableKey" @cell-click="cellClick"
|
||||
@filter-change="filterChange" @selection-change="onSelectChange" @sort-change="sortChange"
|
||||
border fit row-key="id" ref="table" style="width: 100%;" v-loading="loading">
|
||||
<el-table-column align="center" type="selection" width="40px" :reserve-selection="true"/>
|
||||
<el-table-column :label="$t('table.creditGoodsImg.goodsId')" :show-overflow-tooltip="true" align="center" prop="goodsId"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.goodsId }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoodsImg.imgPath')" :show-overflow-tooltip="true" align="center" prop="imgPath"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.imgPath }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoodsImg.sortOrder')" :show-overflow-tooltip="true" align="center" prop="sortOrder"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.sortOrder }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoodsImg.typed')" :show-overflow-tooltip="true" align="center" prop="typed"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.typed }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoodsImg.enabled')" :show-overflow-tooltip="true" align="center" prop="enabled"
|
||||
:filter-multiple="false" column-key="enabled"
|
||||
:filters="[{ text: $t('common.yes'), value: 'true' }, { text: $t('common.no'), value: 'false' }]"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.enabled ? 'success' : 'danger'" slot>
|
||||
{{ scope.row.enabled ? $t("common.yes") : $t("common.no") }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditGoodsImg.isDelete')" :show-overflow-tooltip="true" align="center" prop="isDelete"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.isDelete }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('table.createTime')"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
sortable="custom"
|
||||
width="170px">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.createTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('table.operation')" align="center" column-key="operation" class-name="small-padding fixed-width" width="100px">
|
||||
<template slot-scope="{ row }">
|
||||
<i @click="copy(row)" class="el-icon-copy-document table-operation" :title="$t('common.delete')"
|
||||
style="color: #2db7f5;" v-hasPermission="['creditGoodsImg:add']"/>
|
||||
<i @click="edit(row)" class="el-icon-edit table-operation" :title="$t('common.delete')"
|
||||
style="color: #2db7f5;" v-hasPermission="['creditGoodsImg:update']"/>
|
||||
<i @click="singleDelete(row)" class="el-icon-delete table-operation" :title="$t('common.delete')"
|
||||
style="color: #f50;" v-hasPermission="['creditGoodsImg:delete']"/>
|
||||
<el-link class="no-perm" v-has-no-permission="['creditGoodsImg:update', 'creditGoodsImg:copy', 'creditGoodsImg:delete']">
|
||||
{{ $t("tips.noPermission") }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :limit.sync="queryParams.size" :page.sync="queryParams.current"
|
||||
:total="Number(tableData.total)" @pagination="fetch" v-show="tableData.total > 0"/>
|
||||
<creditGoodsImg-edit :dialog-visible="dialog.isVisible" :type="dialog.type"
|
||||
@close="editClose" @success="editSuccess" ref="edit"/>
|
||||
<creditGoodsImg-import ref="import" :dialog-visible="fileImport.isVisible" :type="fileImport.type"
|
||||
:action="fileImport.action" accept=".xls,.xlsx" @close="importClose" @success="importSuccess" />
|
||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true"
|
||||
title="预览" width="80%" top="50px" :visible.sync="preview.isVisible" v-el-drag-dialog>
|
||||
<el-scrollbar>
|
||||
<div v-html="preview.context"></div>
|
||||
</el-scrollbar>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from "@/components/Pagination";
|
||||
import elDragDialog from '@/directive/el-drag-dialog'
|
||||
import CreditGoodsImgEdit from "./Edit";
|
||||
import creditGoodsImgApi from "@/api/creditGoods/CreditGoodsImg.js";
|
||||
import CreditGoodsImgImport from "@/components/ceres/Import"
|
||||
import {convertEnum} from '@/utils/utils'
|
||||
import {downloadFile, loadEnums, initDicts, initQueryParams} from '@/utils/commons'
|
||||
|
||||
export default {
|
||||
name: "CreditGoodsImgManage",
|
||||
directives: { elDragDialog },
|
||||
components: { Pagination, CreditGoodsImgEdit, CreditGoodsImgImport},
|
||||
filters: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 编辑
|
||||
dialog: {
|
||||
isVisible: false,
|
||||
type: "add"
|
||||
},
|
||||
// 预览
|
||||
preview: {
|
||||
isVisible: false,
|
||||
context: ''
|
||||
},
|
||||
// 导入
|
||||
fileImport: {
|
||||
isVisible: false,
|
||||
type: "import",
|
||||
action: `${process.env.VUE_APP_BASE_API}/store/creditGoodsImg/import`
|
||||
},
|
||||
tableKey: 0,
|
||||
queryParams: initQueryParams(),
|
||||
selection: [],
|
||||
loading: false,
|
||||
tableData: {
|
||||
total: 0
|
||||
},
|
||||
// 枚举
|
||||
enums: {
|
||||
},
|
||||
// 字典
|
||||
dicts: {
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
mounted() {
|
||||
this.fetch();
|
||||
|
||||
// 初始化字典和枚举
|
||||
const enumList = [];
|
||||
const dictList = [];
|
||||
loadEnums(enumList, this.enums, 'store');
|
||||
initDicts(dictList, this.dicts);
|
||||
},
|
||||
methods: {
|
||||
editClose() {
|
||||
this.dialog.isVisible = false;
|
||||
},
|
||||
editSuccess() {
|
||||
this.search();
|
||||
},
|
||||
onSelectChange(selection) {
|
||||
this.selection = selection;
|
||||
},
|
||||
search() {
|
||||
this.fetch({
|
||||
...this.queryParams
|
||||
});
|
||||
},
|
||||
reset() {
|
||||
this.queryParams = initQueryParams();
|
||||
this.$refs.table.clearSort();
|
||||
this.$refs.table.clearFilter();
|
||||
this.search();
|
||||
},
|
||||
exportExcelPreview() {
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
this.queryParams.map.fileName = '导出数据';
|
||||
creditGoodsImgApi.preview(this.queryParams).then(response => {
|
||||
const res = response.data;
|
||||
this.preview.isVisible = true;
|
||||
this.preview.context = res.data;
|
||||
});
|
||||
},
|
||||
exportExcel() {
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
this.queryParams.map.fileName = '导出数据';
|
||||
creditGoodsImgApi.export(this.queryParams).then(response => {
|
||||
downloadFile(response);
|
||||
});
|
||||
},
|
||||
importExcel() {
|
||||
this.fileImport.type = "upload";
|
||||
this.fileImport.isVisible = true;
|
||||
this.$refs.import.setModel(false);
|
||||
},
|
||||
importSuccess() {
|
||||
this.search();
|
||||
},
|
||||
importClose() {
|
||||
this.fileImport.isVisible = false;
|
||||
},
|
||||
singleDelete(row) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(row, true);
|
||||
this.batchDelete();
|
||||
},
|
||||
batchDelete() {
|
||||
if (!this.selection.length) {
|
||||
this.$message({
|
||||
message: this.$t("tips.noDataSelected"),
|
||||
type: "warning"
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$confirm(this.$t("tips.confirmDelete"), this.$t("common.tips"), {
|
||||
confirmButtonText: this.$t("common.confirm"),
|
||||
cancelButtonText: this.$t("common.cancel"),
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
const ids = this.selection.map(u => u.id);
|
||||
this.delete(ids);
|
||||
})
|
||||
.catch(() => {
|
||||
this.clearSelections();
|
||||
});
|
||||
},
|
||||
clearSelections() {
|
||||
this.$refs.table.clearSelection();
|
||||
},
|
||||
delete(ids) {
|
||||
creditGoodsImgApi.delete({ ids: ids }).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
this.$message({
|
||||
message: this.$t("tips.deleteSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
this.search();
|
||||
}
|
||||
});
|
||||
},
|
||||
add() {
|
||||
this.dialog.type = "add";
|
||||
this.dialog.isVisible = true;
|
||||
this.$refs.edit.setCreditGoodsImg({ enums: this.enums, dicts: this.dicts});
|
||||
},
|
||||
copy(row) {
|
||||
this.$refs.edit.setCreditGoodsImg({row, enums: this.enums, dicts: this.dicts});
|
||||
this.dialog.type = "copy";
|
||||
this.dialog.isVisible = true;
|
||||
},
|
||||
edit(row) {
|
||||
this.$refs.edit.setCreditGoodsImg({row, enums: this.enums, dicts: this.dicts});
|
||||
this.dialog.type = "edit";
|
||||
this.dialog.isVisible = true;
|
||||
},
|
||||
fetch(params = {}) {
|
||||
this.loading = true;
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
|
||||
this.queryParams.current = params.current ? params.current : this.queryParams.current;
|
||||
this.queryParams.size = params.size ? params.size : this.queryParams.size;
|
||||
|
||||
creditGoodsImgApi.page(this.queryParams).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
this.tableData = res.data;
|
||||
}
|
||||
}).finally(() => this.loading = false);
|
||||
},
|
||||
sortChange(val) {
|
||||
this.queryParams.sort = val.prop;
|
||||
this.queryParams.order = val.order;
|
||||
if (this.queryParams.sort) {
|
||||
this.search();
|
||||
}
|
||||
},
|
||||
filterChange (filters) {
|
||||
for (const key in filters) {
|
||||
if(key.includes('.')) {
|
||||
const val = { };
|
||||
val[key.split('.')[1]] = filters[key][0];
|
||||
this.queryParams.model[key.split('.')[0]] = val;
|
||||
} else {
|
||||
this.queryParams.model[key] = filters[key][0]
|
||||
}
|
||||
}
|
||||
this.search()
|
||||
},
|
||||
cellClick (row, column) {
|
||||
if (column['columnKey'] === "operation") {
|
||||
return;
|
||||
}
|
||||
let flag = false;
|
||||
this.selection.forEach((item)=>{
|
||||
if(item.id === row.id) {
|
||||
flag = true;
|
||||
this.$refs.table.toggleRowSelection(row);
|
||||
}
|
||||
})
|
||||
|
||||
if(!flag){
|
||||
this.$refs.table.toggleRowSelection(row, true);
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,184 @@
|
||||
<template>
|
||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true" :title="title" :type="type"
|
||||
:visible.sync="isVisible" :width="width" top="50px" v-el-drag-dialog>
|
||||
<el-form :model="creditOrder" :rules="rules" label-position="right" label-width="100px" ref="form">
|
||||
<el-form-item :label="$t('table.creditOrder.mid')" prop="mid">
|
||||
<el-input type="" v-model="creditOrder.mid" placeholder="会员ID"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrder.orderCode')" prop="orderCode">
|
||||
<el-input type="" v-model="creditOrder.orderCode" placeholder="订单编号"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrder.amount')" prop="amount">
|
||||
<el-input type="" v-model="creditOrder.amount" placeholder="金额"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrder.state')" prop="state">
|
||||
<el-input type="" v-model="creditOrder.state" placeholder="状态:1-未完成,2-已完成,9-已取消"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrder.useTyped')" prop="useTyped">
|
||||
<el-input type="" v-model="creditOrder.useTyped" placeholder="使用类型:1-配送,2-自提,3-虚拟"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrder.isDelete')" prop="isDelete">
|
||||
<el-input type="" v-model="creditOrder.isDelete" placeholder="逻辑删除:1-删除 0-未删除"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="dialog-footer" slot="footer">
|
||||
<el-button @click="isVisible = false" plain type="warning">
|
||||
{{ $t("common.cancel") }}
|
||||
</el-button>
|
||||
<el-button @click="submitForm" :disabled="confirmDisabled" plain type="primary">
|
||||
{{ $t("common.confirm") }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import elDragDialog from '@/directive/el-drag-dialog'
|
||||
import creditOrderApi from "@/api/creditGoods/CreditOrder.js";
|
||||
|
||||
export default {
|
||||
name: "CreditOrderEdit",
|
||||
directives: { elDragDialog },
|
||||
components: { },
|
||||
props: {
|
||||
dialogVisible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: "add"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
confirmDisabled: false,
|
||||
creditOrder: this.initCreditOrder(),
|
||||
screenWidth: 0,
|
||||
width: this.initWidth(),
|
||||
rules: {
|
||||
|
||||
},
|
||||
// 枚举
|
||||
enums: {
|
||||
},
|
||||
// 字典
|
||||
dicts: {
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isVisible: {
|
||||
get() {
|
||||
return this.dialogVisible;
|
||||
},
|
||||
set() {
|
||||
this.close();
|
||||
this.reset();
|
||||
}
|
||||
},
|
||||
title() {
|
||||
return this.$t("common." + this.type);
|
||||
}
|
||||
},
|
||||
watch: {},
|
||||
mounted() {
|
||||
window.onresize = () => {
|
||||
return (() => {
|
||||
this.width = this.initWidth();
|
||||
})();
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
initCreditOrder() {
|
||||
return {
|
||||
id: "",
|
||||
mid: null,
|
||||
orderCode: '',
|
||||
amount: null,
|
||||
state: null,
|
||||
useTyped: null,
|
||||
isDelete: null,
|
||||
};
|
||||
},
|
||||
initWidth() {
|
||||
this.screenWidth = document.body.clientWidth;
|
||||
if (this.screenWidth < 991) {
|
||||
return "90%";
|
||||
} else if (this.screenWidth < 1400) {
|
||||
return "45%";
|
||||
} else {
|
||||
return "800px";
|
||||
}
|
||||
},
|
||||
setCreditOrder(val = {}) {
|
||||
const vm = this;
|
||||
|
||||
vm.dicts = val['dicts'];
|
||||
vm.enums = val['enums'];
|
||||
if (val['row']) {
|
||||
vm.creditOrder = { ...val['row'] };
|
||||
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.$emit("close");
|
||||
},
|
||||
reset() {
|
||||
// 先清除校验,再清除表单,不然有奇怪的bug
|
||||
this.$refs.form.clearValidate();
|
||||
this.$refs.form.resetFields();
|
||||
this.confirmDisabled = false;
|
||||
this.creditOrder = this.initCreditOrder();
|
||||
},
|
||||
submitForm() {
|
||||
const vm = this;
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
vm.editSubmit();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
editSubmit() {
|
||||
const vm = this;
|
||||
if (vm.type === "edit") {
|
||||
vm.update();
|
||||
} else {
|
||||
vm.save();
|
||||
}
|
||||
},
|
||||
save() {
|
||||
const vm = this;
|
||||
vm.confirmDisabled = true;
|
||||
creditOrderApi.save(this.creditOrder).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
vm.isVisible = false;
|
||||
vm.$message({
|
||||
message: vm.$t("tips.createSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
vm.$emit("success");
|
||||
}
|
||||
}).finally(()=> vm.confirmDisabled = false);
|
||||
},
|
||||
update() {
|
||||
const vm = this;
|
||||
vm.confirmDisabled = true;
|
||||
creditOrderApi.update(this.creditOrder).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
vm.isVisible = false;
|
||||
vm.$message({
|
||||
message: this.$t("tips.updateSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
vm.$emit("success");
|
||||
}
|
||||
}).finally(()=> vm.confirmDisabled = false);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,352 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="filter-container">
|
||||
<el-input
|
||||
:placeholder="$t('table.creditOrder.orderCode')"
|
||||
class="filter-item search-item"
|
||||
v-model="queryParams.model.orderCode"
|
||||
/>
|
||||
|
||||
<el-date-picker :range-separator="null" class="filter-item search-item date-range-item"
|
||||
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期"
|
||||
type="daterange" v-model="queryParams.timeRange" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
/>
|
||||
<el-button @click="search" class="filter-item" plain type="primary">
|
||||
{{ $t("table.search") }}
|
||||
</el-button>
|
||||
<el-button @click="reset" class="filter-item" plain type="warning">
|
||||
{{ $t("table.reset") }}
|
||||
</el-button>
|
||||
<el-button @click="add" class="filter-item" plain type="danger" v-has-permission="['creditOrder:add']">
|
||||
{{ $t("table.add") }}
|
||||
</el-button>
|
||||
<el-dropdown class="filter-item" trigger="click" v-has-any-permission="['creditOrder:delete', 'creditOrder:export',
|
||||
'creditOrder:import']">
|
||||
<el-button>
|
||||
{{ $t("table.more") }}<i class="el-icon-arrow-down el-icon--right" />
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="batchDelete" v-has-permission="['creditOrder:delete']">
|
||||
{{ $t("table.delete") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exportExcel" v-has-permission="['creditOrder:export']">
|
||||
{{ $t("table.export") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exportExcelPreview" v-has-permission="['creditOrder:export']">
|
||||
{{ $t("table.exportPreview") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="importExcel" v-has-permission="['creditOrder:import']">
|
||||
{{ $t("table.import") }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
<el-table :data="tableData.records" :key="tableKey" @cell-click="cellClick"
|
||||
@filter-change="filterChange" @selection-change="onSelectChange" @sort-change="sortChange"
|
||||
border fit row-key="id" ref="table" style="width: 100%;" v-loading="loading">
|
||||
<el-table-column align="center" type="selection" width="40px" :reserve-selection="true"/>
|
||||
<el-table-column :label="$t('table.creditOrder.mid')" :show-overflow-tooltip="true" align="center" prop="mid"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.mid }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrder.orderCode')" :show-overflow-tooltip="true" align="center" prop="orderCode"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.orderCode }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrder.amount')" :show-overflow-tooltip="true" align="center" prop="amount"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.amount }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrder.state')" :show-overflow-tooltip="true" align="center" prop="state"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.state }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrder.useTyped')" :show-overflow-tooltip="true" align="center" prop="useTyped"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.useTyped }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrder.isDelete')" :show-overflow-tooltip="true" align="center" prop="isDelete"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.isDelete }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('table.createTime')"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
sortable="custom"
|
||||
width="170px">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.createTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('table.operation')" align="center" column-key="operation" class-name="small-padding fixed-width" width="100px">
|
||||
<template slot-scope="{ row }">
|
||||
<i @click="copy(row)" class="el-icon-copy-document table-operation" :title="$t('common.delete')"
|
||||
style="color: #2db7f5;" v-hasPermission="['creditOrder:add']"/>
|
||||
<i @click="edit(row)" class="el-icon-edit table-operation" :title="$t('common.delete')"
|
||||
style="color: #2db7f5;" v-hasPermission="['creditOrder:update']"/>
|
||||
<i @click="singleDelete(row)" class="el-icon-delete table-operation" :title="$t('common.delete')"
|
||||
style="color: #f50;" v-hasPermission="['creditOrder:delete']"/>
|
||||
<el-link class="no-perm" v-has-no-permission="['creditOrder:update', 'creditOrder:copy', 'creditOrder:delete']">
|
||||
{{ $t("tips.noPermission") }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :limit.sync="queryParams.size" :page.sync="queryParams.current"
|
||||
:total="Number(tableData.total)" @pagination="fetch" v-show="tableData.total > 0"/>
|
||||
<creditOrder-edit :dialog-visible="dialog.isVisible" :type="dialog.type"
|
||||
@close="editClose" @success="editSuccess" ref="edit"/>
|
||||
<creditOrder-import ref="import" :dialog-visible="fileImport.isVisible" :type="fileImport.type"
|
||||
:action="fileImport.action" accept=".xls,.xlsx" @close="importClose" @success="importSuccess" />
|
||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true"
|
||||
title="预览" width="80%" top="50px" :visible.sync="preview.isVisible" v-el-drag-dialog>
|
||||
<el-scrollbar>
|
||||
<div v-html="preview.context"></div>
|
||||
</el-scrollbar>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from "@/components/Pagination";
|
||||
import elDragDialog from '@/directive/el-drag-dialog'
|
||||
import CreditOrderEdit from "./Edit";
|
||||
import creditOrderApi from "@/api/creditGoods/CreditOrder.js";
|
||||
import CreditOrderImport from "@/components/ceres/Import"
|
||||
import {convertEnum} from '@/utils/utils'
|
||||
import {downloadFile, loadEnums, initDicts, initQueryParams} from '@/utils/commons'
|
||||
|
||||
export default {
|
||||
name: "CreditOrderManage",
|
||||
directives: { elDragDialog },
|
||||
components: { Pagination, CreditOrderEdit, CreditOrderImport},
|
||||
filters: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 编辑
|
||||
dialog: {
|
||||
isVisible: false,
|
||||
type: "add"
|
||||
},
|
||||
// 预览
|
||||
preview: {
|
||||
isVisible: false,
|
||||
context: ''
|
||||
},
|
||||
// 导入
|
||||
fileImport: {
|
||||
isVisible: false,
|
||||
type: "import",
|
||||
action: `${process.env.VUE_APP_BASE_API}/store/creditOrder/import`
|
||||
},
|
||||
tableKey: 0,
|
||||
queryParams: initQueryParams(),
|
||||
selection: [],
|
||||
loading: false,
|
||||
tableData: {
|
||||
total: 0
|
||||
},
|
||||
// 枚举
|
||||
enums: {
|
||||
},
|
||||
// 字典
|
||||
dicts: {
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
mounted() {
|
||||
this.fetch();
|
||||
|
||||
// 初始化字典和枚举
|
||||
const enumList = [];
|
||||
const dictList = [];
|
||||
loadEnums(enumList, this.enums, 'store');
|
||||
initDicts(dictList, this.dicts);
|
||||
},
|
||||
methods: {
|
||||
editClose() {
|
||||
this.dialog.isVisible = false;
|
||||
},
|
||||
editSuccess() {
|
||||
this.search();
|
||||
},
|
||||
onSelectChange(selection) {
|
||||
this.selection = selection;
|
||||
},
|
||||
search() {
|
||||
this.fetch({
|
||||
...this.queryParams
|
||||
});
|
||||
},
|
||||
reset() {
|
||||
this.queryParams = initQueryParams();
|
||||
this.$refs.table.clearSort();
|
||||
this.$refs.table.clearFilter();
|
||||
this.search();
|
||||
},
|
||||
exportExcelPreview() {
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
this.queryParams.map.fileName = '导出数据';
|
||||
creditOrderApi.preview(this.queryParams).then(response => {
|
||||
const res = response.data;
|
||||
this.preview.isVisible = true;
|
||||
this.preview.context = res.data;
|
||||
});
|
||||
},
|
||||
exportExcel() {
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
this.queryParams.map.fileName = '导出数据';
|
||||
creditOrderApi.export(this.queryParams).then(response => {
|
||||
downloadFile(response);
|
||||
});
|
||||
},
|
||||
importExcel() {
|
||||
this.fileImport.type = "upload";
|
||||
this.fileImport.isVisible = true;
|
||||
this.$refs.import.setModel(false);
|
||||
},
|
||||
importSuccess() {
|
||||
this.search();
|
||||
},
|
||||
importClose() {
|
||||
this.fileImport.isVisible = false;
|
||||
},
|
||||
singleDelete(row) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(row, true);
|
||||
this.batchDelete();
|
||||
},
|
||||
batchDelete() {
|
||||
if (!this.selection.length) {
|
||||
this.$message({
|
||||
message: this.$t("tips.noDataSelected"),
|
||||
type: "warning"
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$confirm(this.$t("tips.confirmDelete"), this.$t("common.tips"), {
|
||||
confirmButtonText: this.$t("common.confirm"),
|
||||
cancelButtonText: this.$t("common.cancel"),
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
const ids = this.selection.map(u => u.id);
|
||||
this.delete(ids);
|
||||
})
|
||||
.catch(() => {
|
||||
this.clearSelections();
|
||||
});
|
||||
},
|
||||
clearSelections() {
|
||||
this.$refs.table.clearSelection();
|
||||
},
|
||||
delete(ids) {
|
||||
creditOrderApi.delete({ ids: ids }).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
this.$message({
|
||||
message: this.$t("tips.deleteSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
this.search();
|
||||
}
|
||||
});
|
||||
},
|
||||
add() {
|
||||
this.dialog.type = "add";
|
||||
this.dialog.isVisible = true;
|
||||
this.$refs.edit.setCreditOrder({ enums: this.enums, dicts: this.dicts});
|
||||
},
|
||||
copy(row) {
|
||||
this.$refs.edit.setCreditOrder({row, enums: this.enums, dicts: this.dicts});
|
||||
this.dialog.type = "copy";
|
||||
this.dialog.isVisible = true;
|
||||
},
|
||||
edit(row) {
|
||||
this.$refs.edit.setCreditOrder({row, enums: this.enums, dicts: this.dicts});
|
||||
this.dialog.type = "edit";
|
||||
this.dialog.isVisible = true;
|
||||
},
|
||||
fetch(params = {}) {
|
||||
this.loading = true;
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
|
||||
this.queryParams.current = params.current ? params.current : this.queryParams.current;
|
||||
this.queryParams.size = params.size ? params.size : this.queryParams.size;
|
||||
|
||||
creditOrderApi.page(this.queryParams).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
this.tableData = res.data;
|
||||
}
|
||||
}).finally(() => this.loading = false);
|
||||
},
|
||||
sortChange(val) {
|
||||
this.queryParams.sort = val.prop;
|
||||
this.queryParams.order = val.order;
|
||||
if (this.queryParams.sort) {
|
||||
this.search();
|
||||
}
|
||||
},
|
||||
filterChange (filters) {
|
||||
for (const key in filters) {
|
||||
if(key.includes('.')) {
|
||||
const val = { };
|
||||
val[key.split('.')[1]] = filters[key][0];
|
||||
this.queryParams.model[key.split('.')[0]] = val;
|
||||
} else {
|
||||
this.queryParams.model[key] = filters[key][0]
|
||||
}
|
||||
}
|
||||
this.search()
|
||||
},
|
||||
cellClick (row, column) {
|
||||
if (column['columnKey'] === "operation") {
|
||||
return;
|
||||
}
|
||||
let flag = false;
|
||||
this.selection.forEach((item)=>{
|
||||
if(item.id === row.id) {
|
||||
flag = true;
|
||||
this.$refs.table.toggleRowSelection(row);
|
||||
}
|
||||
})
|
||||
|
||||
if(!flag){
|
||||
this.$refs.table.toggleRowSelection(row, true);
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,208 @@
|
||||
<template>
|
||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true" :title="title" :type="type"
|
||||
:visible.sync="isVisible" :width="width" top="50px" v-el-drag-dialog>
|
||||
<el-form :model="creditOrderDelivery" :rules="rules" label-position="right" label-width="100px" ref="form">
|
||||
<el-form-item :label="$t('table.creditOrderDelivery.orderId')" prop="orderId">
|
||||
<el-input type="" v-model="creditOrderDelivery.orderId" placeholder="订单ID"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDelivery.state')" prop="state">
|
||||
<el-input type="" v-model="creditOrderDelivery.state" placeholder="状态:1-待发货,2-待收货,3-已完成"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDelivery.username')" prop="username">
|
||||
<el-input type="" v-model="creditOrderDelivery.username" placeholder="收货人姓名"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDelivery.phone')" prop="phone">
|
||||
<el-input type="" v-model="creditOrderDelivery.phone" placeholder="收货手机号"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDelivery.province')" prop="province">
|
||||
<el-input type="" v-model="creditOrderDelivery.province" placeholder="收货地址省份"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDelivery.city')" prop="city">
|
||||
<el-input type="" v-model="creditOrderDelivery.city" placeholder="收货地址城市"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDelivery.area')" prop="area">
|
||||
<el-input type="" v-model="creditOrderDelivery.area" placeholder="收货地址区域"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDelivery.cityInfo')" prop="cityInfo">
|
||||
<el-input type="" v-model="creditOrderDelivery.cityInfo" placeholder="城市信息"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDelivery.address')" prop="address">
|
||||
<el-input type="" v-model="creditOrderDelivery.address" placeholder="收货详细地址"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDelivery.longitude')" prop="longitude">
|
||||
<el-input type="" v-model="creditOrderDelivery.longitude" placeholder="经度"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDelivery.latitude')" prop="latitude">
|
||||
<el-input type="" v-model="creditOrderDelivery.latitude" placeholder="纬度"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDelivery.isDelete')" prop="isDelete">
|
||||
<el-input type="" v-model="creditOrderDelivery.isDelete" placeholder="逻辑删除:1-删除 0-未删除"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="dialog-footer" slot="footer">
|
||||
<el-button @click="isVisible = false" plain type="warning">
|
||||
{{ $t("common.cancel") }}
|
||||
</el-button>
|
||||
<el-button @click="submitForm" :disabled="confirmDisabled" plain type="primary">
|
||||
{{ $t("common.confirm") }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import elDragDialog from '@/directive/el-drag-dialog'
|
||||
import creditOrderDeliveryApi from "@/api/creditGoods/CreditOrderDelivery.js";
|
||||
|
||||
export default {
|
||||
name: "CreditOrderDeliveryEdit",
|
||||
directives: { elDragDialog },
|
||||
components: { },
|
||||
props: {
|
||||
dialogVisible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: "add"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
confirmDisabled: false,
|
||||
creditOrderDelivery: this.initCreditOrderDelivery(),
|
||||
screenWidth: 0,
|
||||
width: this.initWidth(),
|
||||
rules: {
|
||||
|
||||
},
|
||||
// 枚举
|
||||
enums: {
|
||||
},
|
||||
// 字典
|
||||
dicts: {
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isVisible: {
|
||||
get() {
|
||||
return this.dialogVisible;
|
||||
},
|
||||
set() {
|
||||
this.close();
|
||||
this.reset();
|
||||
}
|
||||
},
|
||||
title() {
|
||||
return this.$t("common." + this.type);
|
||||
}
|
||||
},
|
||||
watch: {},
|
||||
mounted() {
|
||||
window.onresize = () => {
|
||||
return (() => {
|
||||
this.width = this.initWidth();
|
||||
})();
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
initCreditOrderDelivery() {
|
||||
return {
|
||||
id: "",
|
||||
orderId: null,
|
||||
state: null,
|
||||
username: '',
|
||||
phone: '',
|
||||
province: '',
|
||||
city: '',
|
||||
area: '',
|
||||
cityInfo: '',
|
||||
address: '',
|
||||
longitude: null,
|
||||
latitude: null,
|
||||
isDelete: null,
|
||||
};
|
||||
},
|
||||
initWidth() {
|
||||
this.screenWidth = document.body.clientWidth;
|
||||
if (this.screenWidth < 991) {
|
||||
return "90%";
|
||||
} else if (this.screenWidth < 1400) {
|
||||
return "45%";
|
||||
} else {
|
||||
return "800px";
|
||||
}
|
||||
},
|
||||
setCreditOrderDelivery(val = {}) {
|
||||
const vm = this;
|
||||
|
||||
vm.dicts = val['dicts'];
|
||||
vm.enums = val['enums'];
|
||||
if (val['row']) {
|
||||
vm.creditOrderDelivery = { ...val['row'] };
|
||||
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.$emit("close");
|
||||
},
|
||||
reset() {
|
||||
// 先清除校验,再清除表单,不然有奇怪的bug
|
||||
this.$refs.form.clearValidate();
|
||||
this.$refs.form.resetFields();
|
||||
this.confirmDisabled = false;
|
||||
this.creditOrderDelivery = this.initCreditOrderDelivery();
|
||||
},
|
||||
submitForm() {
|
||||
const vm = this;
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
vm.editSubmit();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
editSubmit() {
|
||||
const vm = this;
|
||||
if (vm.type === "edit") {
|
||||
vm.update();
|
||||
} else {
|
||||
vm.save();
|
||||
}
|
||||
},
|
||||
save() {
|
||||
const vm = this;
|
||||
vm.confirmDisabled = true;
|
||||
creditOrderDeliveryApi.save(this.creditOrderDelivery).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
vm.isVisible = false;
|
||||
vm.$message({
|
||||
message: vm.$t("tips.createSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
vm.$emit("success");
|
||||
}
|
||||
}).finally(()=> vm.confirmDisabled = false);
|
||||
},
|
||||
update() {
|
||||
const vm = this;
|
||||
vm.confirmDisabled = true;
|
||||
creditOrderDeliveryApi.update(this.creditOrderDelivery).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
vm.isVisible = false;
|
||||
vm.$message({
|
||||
message: this.$t("tips.updateSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
vm.$emit("success");
|
||||
}
|
||||
}).finally(()=> vm.confirmDisabled = false);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,398 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="filter-container">
|
||||
<el-input
|
||||
:placeholder="$t('table.creditOrderDelivery.username')"
|
||||
class="filter-item search-item"
|
||||
v-model="queryParams.model.username"
|
||||
/>
|
||||
<el-input
|
||||
:placeholder="$t('table.creditOrderDelivery.phone')"
|
||||
class="filter-item search-item"
|
||||
v-model="queryParams.model.phone"
|
||||
/>
|
||||
<el-input
|
||||
:placeholder="$t('table.creditOrderDelivery.address')"
|
||||
class="filter-item search-item"
|
||||
v-model="queryParams.model.address"
|
||||
/>
|
||||
|
||||
<el-date-picker :range-separator="null" class="filter-item search-item date-range-item"
|
||||
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期"
|
||||
type="daterange" v-model="queryParams.timeRange" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
/>
|
||||
<el-button @click="search" class="filter-item" plain type="primary">
|
||||
{{ $t("table.search") }}
|
||||
</el-button>
|
||||
<el-button @click="reset" class="filter-item" plain type="warning">
|
||||
{{ $t("table.reset") }}
|
||||
</el-button>
|
||||
<el-button @click="add" class="filter-item" plain type="danger" v-has-permission="['creditOrderDelivery:add']">
|
||||
{{ $t("table.add") }}
|
||||
</el-button>
|
||||
<el-dropdown class="filter-item" trigger="click" v-has-any-permission="['creditOrderDelivery:delete', 'creditOrderDelivery:export',
|
||||
'creditOrderDelivery:import']">
|
||||
<el-button>
|
||||
{{ $t("table.more") }}<i class="el-icon-arrow-down el-icon--right" />
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="batchDelete" v-has-permission="['creditOrderDelivery:delete']">
|
||||
{{ $t("table.delete") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exportExcel" v-has-permission="['creditOrderDelivery:export']">
|
||||
{{ $t("table.export") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exportExcelPreview" v-has-permission="['creditOrderDelivery:export']">
|
||||
{{ $t("table.exportPreview") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="importExcel" v-has-permission="['creditOrderDelivery:import']">
|
||||
{{ $t("table.import") }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
<el-table :data="tableData.records" :key="tableKey" @cell-click="cellClick"
|
||||
@filter-change="filterChange" @selection-change="onSelectChange" @sort-change="sortChange"
|
||||
border fit row-key="id" ref="table" style="width: 100%;" v-loading="loading">
|
||||
<el-table-column align="center" type="selection" width="40px" :reserve-selection="true"/>
|
||||
<el-table-column :label="$t('table.creditOrderDelivery.orderId')" :show-overflow-tooltip="true" align="center" prop="orderId"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.orderId }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDelivery.state')" :show-overflow-tooltip="true" align="center" prop="state"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.state }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDelivery.username')" :show-overflow-tooltip="true" align="center" prop="username"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.username }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDelivery.phone')" :show-overflow-tooltip="true" align="center" prop="phone"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.phone }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDelivery.province')" :show-overflow-tooltip="true" align="center" prop="province"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.province }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDelivery.city')" :show-overflow-tooltip="true" align="center" prop="city"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.city }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDelivery.area')" :show-overflow-tooltip="true" align="center" prop="area"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.area }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDelivery.cityInfo')" :show-overflow-tooltip="true" align="center" prop="cityInfo"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.cityInfo }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDelivery.address')" :show-overflow-tooltip="true" align="center" prop="address"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.address }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDelivery.longitude')" :show-overflow-tooltip="true" align="center" prop="longitude"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.longitude }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDelivery.latitude')" :show-overflow-tooltip="true" align="center" prop="latitude"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.latitude }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDelivery.isDelete')" :show-overflow-tooltip="true" align="center" prop="isDelete"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.isDelete }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('table.createTime')"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
sortable="custom"
|
||||
width="170px">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.createTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('table.operation')" align="center" column-key="operation" class-name="small-padding fixed-width" width="100px">
|
||||
<template slot-scope="{ row }">
|
||||
<i @click="copy(row)" class="el-icon-copy-document table-operation" :title="$t('common.delete')"
|
||||
style="color: #2db7f5;" v-hasPermission="['creditOrderDelivery:add']"/>
|
||||
<i @click="edit(row)" class="el-icon-edit table-operation" :title="$t('common.delete')"
|
||||
style="color: #2db7f5;" v-hasPermission="['creditOrderDelivery:update']"/>
|
||||
<i @click="singleDelete(row)" class="el-icon-delete table-operation" :title="$t('common.delete')"
|
||||
style="color: #f50;" v-hasPermission="['creditOrderDelivery:delete']"/>
|
||||
<el-link class="no-perm" v-has-no-permission="['creditOrderDelivery:update', 'creditOrderDelivery:copy', 'creditOrderDelivery:delete']">
|
||||
{{ $t("tips.noPermission") }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :limit.sync="queryParams.size" :page.sync="queryParams.current"
|
||||
:total="Number(tableData.total)" @pagination="fetch" v-show="tableData.total > 0"/>
|
||||
<creditOrderDelivery-edit :dialog-visible="dialog.isVisible" :type="dialog.type"
|
||||
@close="editClose" @success="editSuccess" ref="edit"/>
|
||||
<creditOrderDelivery-import ref="import" :dialog-visible="fileImport.isVisible" :type="fileImport.type"
|
||||
:action="fileImport.action" accept=".xls,.xlsx" @close="importClose" @success="importSuccess" />
|
||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true"
|
||||
title="预览" width="80%" top="50px" :visible.sync="preview.isVisible" v-el-drag-dialog>
|
||||
<el-scrollbar>
|
||||
<div v-html="preview.context"></div>
|
||||
</el-scrollbar>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from "@/components/Pagination";
|
||||
import elDragDialog from '@/directive/el-drag-dialog'
|
||||
import CreditOrderDeliveryEdit from "./Edit";
|
||||
import creditOrderDeliveryApi from "@/api/creditGoods/CreditOrderDelivery.js";
|
||||
import CreditOrderDeliveryImport from "@/components/ceres/Import"
|
||||
import {convertEnum} from '@/utils/utils'
|
||||
import {downloadFile, loadEnums, initDicts, initQueryParams} from '@/utils/commons'
|
||||
|
||||
export default {
|
||||
name: "CreditOrderDeliveryManage",
|
||||
directives: { elDragDialog },
|
||||
components: { Pagination, CreditOrderDeliveryEdit, CreditOrderDeliveryImport},
|
||||
filters: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 编辑
|
||||
dialog: {
|
||||
isVisible: false,
|
||||
type: "add"
|
||||
},
|
||||
// 预览
|
||||
preview: {
|
||||
isVisible: false,
|
||||
context: ''
|
||||
},
|
||||
// 导入
|
||||
fileImport: {
|
||||
isVisible: false,
|
||||
type: "import",
|
||||
action: `${process.env.VUE_APP_BASE_API}/store/creditOrderDelivery/import`
|
||||
},
|
||||
tableKey: 0,
|
||||
queryParams: initQueryParams(),
|
||||
selection: [],
|
||||
loading: false,
|
||||
tableData: {
|
||||
total: 0
|
||||
},
|
||||
// 枚举
|
||||
enums: {
|
||||
},
|
||||
// 字典
|
||||
dicts: {
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
mounted() {
|
||||
this.fetch();
|
||||
|
||||
// 初始化字典和枚举
|
||||
const enumList = [];
|
||||
const dictList = [];
|
||||
loadEnums(enumList, this.enums, 'store');
|
||||
initDicts(dictList, this.dicts);
|
||||
},
|
||||
methods: {
|
||||
editClose() {
|
||||
this.dialog.isVisible = false;
|
||||
},
|
||||
editSuccess() {
|
||||
this.search();
|
||||
},
|
||||
onSelectChange(selection) {
|
||||
this.selection = selection;
|
||||
},
|
||||
search() {
|
||||
this.fetch({
|
||||
...this.queryParams
|
||||
});
|
||||
},
|
||||
reset() {
|
||||
this.queryParams = initQueryParams();
|
||||
this.$refs.table.clearSort();
|
||||
this.$refs.table.clearFilter();
|
||||
this.search();
|
||||
},
|
||||
exportExcelPreview() {
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
this.queryParams.map.fileName = '导出数据';
|
||||
creditOrderDeliveryApi.preview(this.queryParams).then(response => {
|
||||
const res = response.data;
|
||||
this.preview.isVisible = true;
|
||||
this.preview.context = res.data;
|
||||
});
|
||||
},
|
||||
exportExcel() {
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
this.queryParams.map.fileName = '导出数据';
|
||||
creditOrderDeliveryApi.export(this.queryParams).then(response => {
|
||||
downloadFile(response);
|
||||
});
|
||||
},
|
||||
importExcel() {
|
||||
this.fileImport.type = "upload";
|
||||
this.fileImport.isVisible = true;
|
||||
this.$refs.import.setModel(false);
|
||||
},
|
||||
importSuccess() {
|
||||
this.search();
|
||||
},
|
||||
importClose() {
|
||||
this.fileImport.isVisible = false;
|
||||
},
|
||||
singleDelete(row) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(row, true);
|
||||
this.batchDelete();
|
||||
},
|
||||
batchDelete() {
|
||||
if (!this.selection.length) {
|
||||
this.$message({
|
||||
message: this.$t("tips.noDataSelected"),
|
||||
type: "warning"
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$confirm(this.$t("tips.confirmDelete"), this.$t("common.tips"), {
|
||||
confirmButtonText: this.$t("common.confirm"),
|
||||
cancelButtonText: this.$t("common.cancel"),
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
const ids = this.selection.map(u => u.id);
|
||||
this.delete(ids);
|
||||
})
|
||||
.catch(() => {
|
||||
this.clearSelections();
|
||||
});
|
||||
},
|
||||
clearSelections() {
|
||||
this.$refs.table.clearSelection();
|
||||
},
|
||||
delete(ids) {
|
||||
creditOrderDeliveryApi.delete({ ids: ids }).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
this.$message({
|
||||
message: this.$t("tips.deleteSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
this.search();
|
||||
}
|
||||
});
|
||||
},
|
||||
add() {
|
||||
this.dialog.type = "add";
|
||||
this.dialog.isVisible = true;
|
||||
this.$refs.edit.setCreditOrderDelivery({ enums: this.enums, dicts: this.dicts});
|
||||
},
|
||||
copy(row) {
|
||||
this.$refs.edit.setCreditOrderDelivery({row, enums: this.enums, dicts: this.dicts});
|
||||
this.dialog.type = "copy";
|
||||
this.dialog.isVisible = true;
|
||||
},
|
||||
edit(row) {
|
||||
this.$refs.edit.setCreditOrderDelivery({row, enums: this.enums, dicts: this.dicts});
|
||||
this.dialog.type = "edit";
|
||||
this.dialog.isVisible = true;
|
||||
},
|
||||
fetch(params = {}) {
|
||||
this.loading = true;
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
|
||||
this.queryParams.current = params.current ? params.current : this.queryParams.current;
|
||||
this.queryParams.size = params.size ? params.size : this.queryParams.size;
|
||||
|
||||
creditOrderDeliveryApi.page(this.queryParams).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
this.tableData = res.data;
|
||||
}
|
||||
}).finally(() => this.loading = false);
|
||||
},
|
||||
sortChange(val) {
|
||||
this.queryParams.sort = val.prop;
|
||||
this.queryParams.order = val.order;
|
||||
if (this.queryParams.sort) {
|
||||
this.search();
|
||||
}
|
||||
},
|
||||
filterChange (filters) {
|
||||
for (const key in filters) {
|
||||
if(key.includes('.')) {
|
||||
const val = { };
|
||||
val[key.split('.')[1]] = filters[key][0];
|
||||
this.queryParams.model[key.split('.')[0]] = val;
|
||||
} else {
|
||||
this.queryParams.model[key] = filters[key][0]
|
||||
}
|
||||
}
|
||||
this.search()
|
||||
},
|
||||
cellClick (row, column) {
|
||||
if (column['columnKey'] === "operation") {
|
||||
return;
|
||||
}
|
||||
let flag = false;
|
||||
this.selection.forEach((item)=>{
|
||||
if(item.id === row.id) {
|
||||
flag = true;
|
||||
this.$refs.table.toggleRowSelection(row);
|
||||
}
|
||||
})
|
||||
|
||||
if(!flag){
|
||||
this.$refs.table.toggleRowSelection(row, true);
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,222 @@
|
||||
<template>
|
||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true" :title="title" :type="type"
|
||||
:visible.sync="isVisible" :width="width" top="50px" v-el-drag-dialog>
|
||||
<el-form :model="creditOrderDetail" :rules="rules" label-position="right" label-width="100px" ref="form">
|
||||
<el-form-item :label="$t('table.creditOrderDetail.orderId')" prop="orderId">
|
||||
<el-input type="" v-model="creditOrderDetail.orderId" placeholder="订单ID"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDetail.goodsId')" prop="goodsId">
|
||||
<el-input type="" v-model="creditOrderDetail.goodsId" placeholder="商品ID"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDetail.categoryId')" prop="categoryId">
|
||||
<el-input type="" v-model="creditOrderDetail.categoryId" placeholder="商品分类ID"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDetail.name')" prop="name">
|
||||
<el-input type="" v-model="creditOrderDetail.name" placeholder="商品名"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDetail.description')" prop="description">
|
||||
<el-input type="" v-model="creditOrderDetail.description" placeholder="商品描述"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDetail.worth')" prop="worth">
|
||||
<el-input type="" v-model="creditOrderDetail.worth" placeholder="商品价值(人民币)"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDetail.price')" prop="price">
|
||||
<el-input type="" v-model="creditOrderDetail.price" placeholder="商品价格(积分)"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDetail.couponId')" prop="couponId">
|
||||
<el-input type="" v-model="creditOrderDetail.couponId" placeholder="优惠券ID(如果该值大于0,则购买之后赠送相应的优惠券)"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDetail.canPick')" prop="canPick">
|
||||
<el-radio-group v-model="creditOrderDetail.canPick" size="medium">
|
||||
<el-radio-button :label="true">{{ $t("common.yes") }}</el-radio-button>
|
||||
<el-radio-button :label="false">{{ $t("common.no") }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDetail.canDelivery')" prop="canDelivery">
|
||||
<el-radio-group v-model="creditOrderDetail.canDelivery" size="medium">
|
||||
<el-radio-button :label="true">{{ $t("common.yes") }}</el-radio-button>
|
||||
<el-radio-button :label="false">{{ $t("common.no") }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDetail.goodsMainImg')" prop="goodsMainImg">
|
||||
<el-input type="" v-model="creditOrderDetail.goodsMainImg" placeholder="商品主图路径"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDetail.goodsViceImg')" prop="goodsViceImg">
|
||||
<el-input type="" v-model="creditOrderDetail.goodsViceImg" placeholder="商品副图的路径集合"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDetail.goodsNumber')" prop="goodsNumber">
|
||||
<el-input type="" v-model="creditOrderDetail.goodsNumber" placeholder="商品数量"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.creditOrderDetail.isDelete')" prop="isDelete">
|
||||
<el-input type="" v-model="creditOrderDetail.isDelete" placeholder="逻辑删除:1-删除 0-未删除"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="dialog-footer" slot="footer">
|
||||
<el-button @click="isVisible = false" plain type="warning">
|
||||
{{ $t("common.cancel") }}
|
||||
</el-button>
|
||||
<el-button @click="submitForm" :disabled="confirmDisabled" plain type="primary">
|
||||
{{ $t("common.confirm") }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import elDragDialog from '@/directive/el-drag-dialog'
|
||||
import creditOrderDetailApi from "@/api/creditGoods/CreditOrderDetail.js";
|
||||
|
||||
export default {
|
||||
name: "CreditOrderDetailEdit",
|
||||
directives: { elDragDialog },
|
||||
components: { },
|
||||
props: {
|
||||
dialogVisible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: "add"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
confirmDisabled: false,
|
||||
creditOrderDetail: this.initCreditOrderDetail(),
|
||||
screenWidth: 0,
|
||||
width: this.initWidth(),
|
||||
rules: {
|
||||
|
||||
},
|
||||
// 枚举
|
||||
enums: {
|
||||
},
|
||||
// 字典
|
||||
dicts: {
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isVisible: {
|
||||
get() {
|
||||
return this.dialogVisible;
|
||||
},
|
||||
set() {
|
||||
this.close();
|
||||
this.reset();
|
||||
}
|
||||
},
|
||||
title() {
|
||||
return this.$t("common." + this.type);
|
||||
}
|
||||
},
|
||||
watch: {},
|
||||
mounted() {
|
||||
window.onresize = () => {
|
||||
return (() => {
|
||||
this.width = this.initWidth();
|
||||
})();
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
initCreditOrderDetail() {
|
||||
return {
|
||||
id: "",
|
||||
orderId: null,
|
||||
goodsId: null,
|
||||
categoryId: null,
|
||||
name: '',
|
||||
description: '',
|
||||
worth: null,
|
||||
price: null,
|
||||
couponId: null,
|
||||
canPick: true,
|
||||
canDelivery: true,
|
||||
goodsMainImg: '',
|
||||
goodsViceImg: '',
|
||||
goodsNumber: null,
|
||||
isDelete: null,
|
||||
};
|
||||
},
|
||||
initWidth() {
|
||||
this.screenWidth = document.body.clientWidth;
|
||||
if (this.screenWidth < 991) {
|
||||
return "90%";
|
||||
} else if (this.screenWidth < 1400) {
|
||||
return "45%";
|
||||
} else {
|
||||
return "800px";
|
||||
}
|
||||
},
|
||||
setCreditOrderDetail(val = {}) {
|
||||
const vm = this;
|
||||
|
||||
vm.dicts = val['dicts'];
|
||||
vm.enums = val['enums'];
|
||||
if (val['row']) {
|
||||
vm.creditOrderDetail = { ...val['row'] };
|
||||
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.$emit("close");
|
||||
},
|
||||
reset() {
|
||||
// 先清除校验,再清除表单,不然有奇怪的bug
|
||||
this.$refs.form.clearValidate();
|
||||
this.$refs.form.resetFields();
|
||||
this.confirmDisabled = false;
|
||||
this.creditOrderDetail = this.initCreditOrderDetail();
|
||||
},
|
||||
submitForm() {
|
||||
const vm = this;
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
vm.editSubmit();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
editSubmit() {
|
||||
const vm = this;
|
||||
if (vm.type === "edit") {
|
||||
vm.update();
|
||||
} else {
|
||||
vm.save();
|
||||
}
|
||||
},
|
||||
save() {
|
||||
const vm = this;
|
||||
vm.confirmDisabled = true;
|
||||
creditOrderDetailApi.save(this.creditOrderDetail).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
vm.isVisible = false;
|
||||
vm.$message({
|
||||
message: vm.$t("tips.createSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
vm.$emit("success");
|
||||
}
|
||||
}).finally(()=> vm.confirmDisabled = false);
|
||||
},
|
||||
update() {
|
||||
const vm = this;
|
||||
vm.confirmDisabled = true;
|
||||
creditOrderDetailApi.update(this.creditOrderDetail).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
vm.isVisible = false;
|
||||
vm.$message({
|
||||
message: this.$t("tips.updateSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
vm.$emit("success");
|
||||
}
|
||||
}).finally(()=> vm.confirmDisabled = false);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,423 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="filter-container">
|
||||
<el-input
|
||||
:placeholder="$t('table.creditOrderDetail.name')"
|
||||
class="filter-item search-item"
|
||||
v-model="queryParams.model.name"
|
||||
/>
|
||||
<el-input
|
||||
:placeholder="$t('table.creditOrderDetail.description')"
|
||||
class="filter-item search-item"
|
||||
v-model="queryParams.model.description"
|
||||
/>
|
||||
<el-input
|
||||
:placeholder="$t('table.creditOrderDetail.goodsMainImg')"
|
||||
class="filter-item search-item"
|
||||
v-model="queryParams.model.goodsMainImg"
|
||||
/>
|
||||
<el-input
|
||||
:placeholder="$t('table.creditOrderDetail.goodsViceImg')"
|
||||
class="filter-item search-item"
|
||||
v-model="queryParams.model.goodsViceImg"
|
||||
/>
|
||||
|
||||
<el-date-picker :range-separator="null" class="filter-item search-item date-range-item"
|
||||
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期"
|
||||
type="daterange" v-model="queryParams.timeRange" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
/>
|
||||
<el-button @click="search" class="filter-item" plain type="primary">
|
||||
{{ $t("table.search") }}
|
||||
</el-button>
|
||||
<el-button @click="reset" class="filter-item" plain type="warning">
|
||||
{{ $t("table.reset") }}
|
||||
</el-button>
|
||||
<el-button @click="add" class="filter-item" plain type="danger" v-has-permission="['creditOrderDetail:add']">
|
||||
{{ $t("table.add") }}
|
||||
</el-button>
|
||||
<el-dropdown class="filter-item" trigger="click" v-has-any-permission="['creditOrderDetail:delete', 'creditOrderDetail:export',
|
||||
'creditOrderDetail:import']">
|
||||
<el-button>
|
||||
{{ $t("table.more") }}<i class="el-icon-arrow-down el-icon--right" />
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="batchDelete" v-has-permission="['creditOrderDetail:delete']">
|
||||
{{ $t("table.delete") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exportExcel" v-has-permission="['creditOrderDetail:export']">
|
||||
{{ $t("table.export") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exportExcelPreview" v-has-permission="['creditOrderDetail:export']">
|
||||
{{ $t("table.exportPreview") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="importExcel" v-has-permission="['creditOrderDetail:import']">
|
||||
{{ $t("table.import") }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
<el-table :data="tableData.records" :key="tableKey" @cell-click="cellClick"
|
||||
@filter-change="filterChange" @selection-change="onSelectChange" @sort-change="sortChange"
|
||||
border fit row-key="id" ref="table" style="width: 100%;" v-loading="loading">
|
||||
<el-table-column align="center" type="selection" width="40px" :reserve-selection="true"/>
|
||||
<el-table-column :label="$t('table.creditOrderDetail.orderId')" :show-overflow-tooltip="true" align="center" prop="orderId"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.orderId }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDetail.goodsId')" :show-overflow-tooltip="true" align="center" prop="goodsId"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.goodsId }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDetail.categoryId')" :show-overflow-tooltip="true" align="center" prop="categoryId"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.categoryId }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDetail.name')" :show-overflow-tooltip="true" align="center" prop="name"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDetail.description')" :show-overflow-tooltip="true" align="center" prop="description"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.description }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDetail.worth')" :show-overflow-tooltip="true" align="center" prop="worth"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.worth }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDetail.price')" :show-overflow-tooltip="true" align="center" prop="price"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.price }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDetail.couponId')" :show-overflow-tooltip="true" align="center" prop="couponId"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.couponId }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDetail.canPick')" :show-overflow-tooltip="true" align="center" prop="canPick"
|
||||
:filter-multiple="false" column-key="canPick"
|
||||
:filters="[{ text: $t('common.yes'), value: 'true' }, { text: $t('common.no'), value: 'false' }]"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.canPick ? 'success' : 'danger'" slot>
|
||||
{{ scope.row.canPick ? $t("common.yes") : $t("common.no") }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDetail.canDelivery')" :show-overflow-tooltip="true" align="center" prop="canDelivery"
|
||||
:filter-multiple="false" column-key="canDelivery"
|
||||
:filters="[{ text: $t('common.yes'), value: 'true' }, { text: $t('common.no'), value: 'false' }]"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.canDelivery ? 'success' : 'danger'" slot>
|
||||
{{ scope.row.canDelivery ? $t("common.yes") : $t("common.no") }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDetail.goodsMainImg')" :show-overflow-tooltip="true" align="center" prop="goodsMainImg"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.goodsMainImg }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDetail.goodsViceImg')" :show-overflow-tooltip="true" align="center" prop="goodsViceImg"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.goodsViceImg }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDetail.goodsNumber')" :show-overflow-tooltip="true" align="center" prop="goodsNumber"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.goodsNumber }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.creditOrderDetail.isDelete')" :show-overflow-tooltip="true" align="center" prop="isDelete"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.isDelete }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('table.createTime')"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
sortable="custom"
|
||||
width="170px">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.createTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('table.operation')" align="center" column-key="operation" class-name="small-padding fixed-width" width="100px">
|
||||
<template slot-scope="{ row }">
|
||||
<i @click="copy(row)" class="el-icon-copy-document table-operation" :title="$t('common.delete')"
|
||||
style="color: #2db7f5;" v-hasPermission="['creditOrderDetail:add']"/>
|
||||
<i @click="edit(row)" class="el-icon-edit table-operation" :title="$t('common.delete')"
|
||||
style="color: #2db7f5;" v-hasPermission="['creditOrderDetail:update']"/>
|
||||
<i @click="singleDelete(row)" class="el-icon-delete table-operation" :title="$t('common.delete')"
|
||||
style="color: #f50;" v-hasPermission="['creditOrderDetail:delete']"/>
|
||||
<el-link class="no-perm" v-has-no-permission="['creditOrderDetail:update', 'creditOrderDetail:copy', 'creditOrderDetail:delete']">
|
||||
{{ $t("tips.noPermission") }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :limit.sync="queryParams.size" :page.sync="queryParams.current"
|
||||
:total="Number(tableData.total)" @pagination="fetch" v-show="tableData.total > 0"/>
|
||||
<creditOrderDetail-edit :dialog-visible="dialog.isVisible" :type="dialog.type"
|
||||
@close="editClose" @success="editSuccess" ref="edit"/>
|
||||
<creditOrderDetail-import ref="import" :dialog-visible="fileImport.isVisible" :type="fileImport.type"
|
||||
:action="fileImport.action" accept=".xls,.xlsx" @close="importClose" @success="importSuccess" />
|
||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true"
|
||||
title="预览" width="80%" top="50px" :visible.sync="preview.isVisible" v-el-drag-dialog>
|
||||
<el-scrollbar>
|
||||
<div v-html="preview.context"></div>
|
||||
</el-scrollbar>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from "@/components/Pagination";
|
||||
import elDragDialog from '@/directive/el-drag-dialog'
|
||||
import CreditOrderDetailEdit from "./Edit";
|
||||
import creditOrderDetailApi from "@/api/creditGoods/CreditOrderDetail.js";
|
||||
import CreditOrderDetailImport from "@/components/ceres/Import"
|
||||
import {convertEnum} from '@/utils/utils'
|
||||
import {downloadFile, loadEnums, initDicts, initQueryParams} from '@/utils/commons'
|
||||
|
||||
export default {
|
||||
name: "CreditOrderDetailManage",
|
||||
directives: { elDragDialog },
|
||||
components: { Pagination, CreditOrderDetailEdit, CreditOrderDetailImport},
|
||||
filters: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 编辑
|
||||
dialog: {
|
||||
isVisible: false,
|
||||
type: "add"
|
||||
},
|
||||
// 预览
|
||||
preview: {
|
||||
isVisible: false,
|
||||
context: ''
|
||||
},
|
||||
// 导入
|
||||
fileImport: {
|
||||
isVisible: false,
|
||||
type: "import",
|
||||
action: `${process.env.VUE_APP_BASE_API}/store/creditOrderDetail/import`
|
||||
},
|
||||
tableKey: 0,
|
||||
queryParams: initQueryParams(),
|
||||
selection: [],
|
||||
loading: false,
|
||||
tableData: {
|
||||
total: 0
|
||||
},
|
||||
// 枚举
|
||||
enums: {
|
||||
},
|
||||
// 字典
|
||||
dicts: {
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
mounted() {
|
||||
this.fetch();
|
||||
|
||||
// 初始化字典和枚举
|
||||
const enumList = [];
|
||||
const dictList = [];
|
||||
loadEnums(enumList, this.enums, 'store');
|
||||
initDicts(dictList, this.dicts);
|
||||
},
|
||||
methods: {
|
||||
editClose() {
|
||||
this.dialog.isVisible = false;
|
||||
},
|
||||
editSuccess() {
|
||||
this.search();
|
||||
},
|
||||
onSelectChange(selection) {
|
||||
this.selection = selection;
|
||||
},
|
||||
search() {
|
||||
this.fetch({
|
||||
...this.queryParams
|
||||
});
|
||||
},
|
||||
reset() {
|
||||
this.queryParams = initQueryParams();
|
||||
this.$refs.table.clearSort();
|
||||
this.$refs.table.clearFilter();
|
||||
this.search();
|
||||
},
|
||||
exportExcelPreview() {
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
this.queryParams.map.fileName = '导出数据';
|
||||
creditOrderDetailApi.preview(this.queryParams).then(response => {
|
||||
const res = response.data;
|
||||
this.preview.isVisible = true;
|
||||
this.preview.context = res.data;
|
||||
});
|
||||
},
|
||||
exportExcel() {
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
this.queryParams.map.fileName = '导出数据';
|
||||
creditOrderDetailApi.export(this.queryParams).then(response => {
|
||||
downloadFile(response);
|
||||
});
|
||||
},
|
||||
importExcel() {
|
||||
this.fileImport.type = "upload";
|
||||
this.fileImport.isVisible = true;
|
||||
this.$refs.import.setModel(false);
|
||||
},
|
||||
importSuccess() {
|
||||
this.search();
|
||||
},
|
||||
importClose() {
|
||||
this.fileImport.isVisible = false;
|
||||
},
|
||||
singleDelete(row) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(row, true);
|
||||
this.batchDelete();
|
||||
},
|
||||
batchDelete() {
|
||||
if (!this.selection.length) {
|
||||
this.$message({
|
||||
message: this.$t("tips.noDataSelected"),
|
||||
type: "warning"
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$confirm(this.$t("tips.confirmDelete"), this.$t("common.tips"), {
|
||||
confirmButtonText: this.$t("common.confirm"),
|
||||
cancelButtonText: this.$t("common.cancel"),
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
const ids = this.selection.map(u => u.id);
|
||||
this.delete(ids);
|
||||
})
|
||||
.catch(() => {
|
||||
this.clearSelections();
|
||||
});
|
||||
},
|
||||
clearSelections() {
|
||||
this.$refs.table.clearSelection();
|
||||
},
|
||||
delete(ids) {
|
||||
creditOrderDetailApi.delete({ ids: ids }).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
this.$message({
|
||||
message: this.$t("tips.deleteSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
this.search();
|
||||
}
|
||||
});
|
||||
},
|
||||
add() {
|
||||
this.dialog.type = "add";
|
||||
this.dialog.isVisible = true;
|
||||
this.$refs.edit.setCreditOrderDetail({ enums: this.enums, dicts: this.dicts});
|
||||
},
|
||||
copy(row) {
|
||||
this.$refs.edit.setCreditOrderDetail({row, enums: this.enums, dicts: this.dicts});
|
||||
this.dialog.type = "copy";
|
||||
this.dialog.isVisible = true;
|
||||
},
|
||||
edit(row) {
|
||||
this.$refs.edit.setCreditOrderDetail({row, enums: this.enums, dicts: this.dicts});
|
||||
this.dialog.type = "edit";
|
||||
this.dialog.isVisible = true;
|
||||
},
|
||||
fetch(params = {}) {
|
||||
this.loading = true;
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
|
||||
this.queryParams.current = params.current ? params.current : this.queryParams.current;
|
||||
this.queryParams.size = params.size ? params.size : this.queryParams.size;
|
||||
|
||||
creditOrderDetailApi.page(this.queryParams).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
this.tableData = res.data;
|
||||
}
|
||||
}).finally(() => this.loading = false);
|
||||
},
|
||||
sortChange(val) {
|
||||
this.queryParams.sort = val.prop;
|
||||
this.queryParams.order = val.order;
|
||||
if (this.queryParams.sort) {
|
||||
this.search();
|
||||
}
|
||||
},
|
||||
filterChange (filters) {
|
||||
for (const key in filters) {
|
||||
if(key.includes('.')) {
|
||||
const val = { };
|
||||
val[key.split('.')[1]] = filters[key][0];
|
||||
this.queryParams.model[key.split('.')[0]] = val;
|
||||
} else {
|
||||
this.queryParams.model[key] = filters[key][0]
|
||||
}
|
||||
}
|
||||
this.search()
|
||||
},
|
||||
cellClick (row, column) {
|
||||
if (column['columnKey'] === "operation") {
|
||||
return;
|
||||
}
|
||||
let flag = false;
|
||||
this.selection.forEach((item)=>{
|
||||
if(item.id === row.id) {
|
||||
flag = true;
|
||||
this.$refs.table.toggleRowSelection(row);
|
||||
}
|
||||
})
|
||||
|
||||
if(!flag){
|
||||
this.$refs.table.toggleRowSelection(row, true);
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,210 @@
|
||||
<template>
|
||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true" :title="title" :type="type"
|
||||
:visible.sync="isVisible" :width="width" top="50px" v-el-drag-dialog>
|
||||
<el-form :model="information" :rules="rules" label-position="right" label-width="100px" ref="form">
|
||||
<el-form-item :label="$t('table.information.storeId')" prop="storeId">
|
||||
<el-input type="" v-model="information.storeId" placeholder="店铺ID"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.information.mainTitle')" prop="mainTitle">
|
||||
<el-input type="" v-model="information.mainTitle" placeholder="主标题"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.information.viceTitle')" prop="viceTitle">
|
||||
<el-input type="" v-model="information.viceTitle" placeholder="副标题"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.information.content')" prop="content">
|
||||
<el-input type="" v-model="information.content" placeholder="内容"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.information.coverImg')" prop="coverImg">
|
||||
<el-input type="" v-model="information.coverImg" placeholder="封面图"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.information.startTime')" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="information.startTime"
|
||||
placeholder="开始时间"
|
||||
:start-placeholder="$t('table.information.startTime')"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
class="filter-item date-range-item"
|
||||
type="datetime"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.information.endTime')" prop="endTime">
|
||||
<el-date-picker
|
||||
v-model="information.endTime"
|
||||
placeholder="结束时间"
|
||||
:start-placeholder="$t('table.information.endTime')"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
class="filter-item date-range-item"
|
||||
type="datetime"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.information.state')" prop="state">
|
||||
<el-input type="" v-model="information.state" placeholder="状态:1-上架,0-下架"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.information.isDelete')" prop="isDelete">
|
||||
<el-input type="" v-model="information.isDelete" placeholder="逻辑删除:1-删除 0-未删除"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="dialog-footer" slot="footer">
|
||||
<el-button @click="isVisible = false" plain type="warning">
|
||||
{{ $t("common.cancel") }}
|
||||
</el-button>
|
||||
<el-button @click="submitForm" :disabled="confirmDisabled" plain type="primary">
|
||||
{{ $t("common.confirm") }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import elDragDialog from '@/directive/el-drag-dialog'
|
||||
import informationApi from "@/api/InformationApi.js";
|
||||
|
||||
export default {
|
||||
name: "InformationEdit",
|
||||
directives: { elDragDialog },
|
||||
components: { },
|
||||
props: {
|
||||
dialogVisible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: "add"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
confirmDisabled: false,
|
||||
information: this.initInformation(),
|
||||
screenWidth: 0,
|
||||
width: this.initWidth(),
|
||||
rules: {
|
||||
|
||||
},
|
||||
// 枚举
|
||||
enums: {
|
||||
},
|
||||
// 字典
|
||||
dicts: {
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isVisible: {
|
||||
get() {
|
||||
return this.dialogVisible;
|
||||
},
|
||||
set() {
|
||||
this.close();
|
||||
this.reset();
|
||||
}
|
||||
},
|
||||
title() {
|
||||
return this.$t("common." + this.type);
|
||||
}
|
||||
},
|
||||
watch: {},
|
||||
mounted() {
|
||||
window.onresize = () => {
|
||||
return (() => {
|
||||
this.width = this.initWidth();
|
||||
})();
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
initInformation() {
|
||||
return {
|
||||
id: "",
|
||||
storeId: null,
|
||||
mainTitle: '',
|
||||
viceTitle: '',
|
||||
content: '',
|
||||
coverImg: '',
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
state: null,
|
||||
isDelete: null,
|
||||
};
|
||||
},
|
||||
initWidth() {
|
||||
this.screenWidth = document.body.clientWidth;
|
||||
if (this.screenWidth < 991) {
|
||||
return "90%";
|
||||
} else if (this.screenWidth < 1400) {
|
||||
return "45%";
|
||||
} else {
|
||||
return "800px";
|
||||
}
|
||||
},
|
||||
setInformation(val = {}) {
|
||||
const vm = this;
|
||||
|
||||
vm.dicts = val['dicts'];
|
||||
vm.enums = val['enums'];
|
||||
if (val['row']) {
|
||||
vm.information = { ...val['row'] };
|
||||
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.$emit("close");
|
||||
},
|
||||
reset() {
|
||||
// 先清除校验,再清除表单,不然有奇怪的bug
|
||||
this.$refs.form.clearValidate();
|
||||
this.$refs.form.resetFields();
|
||||
this.confirmDisabled = false;
|
||||
this.information = this.initInformation();
|
||||
},
|
||||
submitForm() {
|
||||
const vm = this;
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
vm.editSubmit();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
editSubmit() {
|
||||
const vm = this;
|
||||
if (vm.type === "edit") {
|
||||
vm.update();
|
||||
} else {
|
||||
vm.save();
|
||||
}
|
||||
},
|
||||
save() {
|
||||
const vm = this;
|
||||
vm.confirmDisabled = true;
|
||||
informationApi.save(this.information).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
vm.isVisible = false;
|
||||
vm.$message({
|
||||
message: vm.$t("tips.createSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
vm.$emit("success");
|
||||
}
|
||||
}).finally(()=> vm.confirmDisabled = false);
|
||||
},
|
||||
update() {
|
||||
const vm = this;
|
||||
vm.confirmDisabled = true;
|
||||
informationApi.update(this.information).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
vm.isVisible = false;
|
||||
vm.$message({
|
||||
message: this.$t("tips.updateSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
vm.$emit("success");
|
||||
}
|
||||
}).finally(()=> vm.confirmDisabled = false);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,370 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="filter-container">
|
||||
<el-input
|
||||
:placeholder="$t('table.information.mainTitle')"
|
||||
class="filter-item search-item"
|
||||
v-model="queryParams.model.mainTitle"
|
||||
/>
|
||||
|
||||
<el-date-picker :range-separator="null" class="filter-item search-item date-range-item"
|
||||
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期"
|
||||
type="daterange" v-model="queryParams.timeRange" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
/>
|
||||
<el-button @click="search" class="filter-item" plain type="primary">
|
||||
{{ $t("table.search") }}
|
||||
</el-button>
|
||||
<el-button @click="reset" class="filter-item" plain type="warning">
|
||||
{{ $t("table.reset") }}
|
||||
</el-button>
|
||||
<el-button @click="add" class="filter-item" plain type="danger" v-has-permission="['information:add']">
|
||||
{{ $t("table.add") }}
|
||||
</el-button>
|
||||
<el-dropdown class="filter-item" trigger="click" v-has-any-permission="['information:delete', 'information:export',
|
||||
'information:import']">
|
||||
<el-button>
|
||||
{{ $t("table.more") }}<i class="el-icon-arrow-down el-icon--right" />
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="batchDelete" v-has-permission="['information:delete']">
|
||||
{{ $t("table.delete") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exportExcel" v-has-permission="['information:export']">
|
||||
{{ $t("table.export") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exportExcelPreview" v-has-permission="['information:export']">
|
||||
{{ $t("table.exportPreview") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="importExcel" v-has-permission="['information:import']">
|
||||
{{ $t("table.import") }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
<el-table :data="tableData.records" :key="tableKey" @cell-click="cellClick"
|
||||
@filter-change="filterChange" @selection-change="onSelectChange" @sort-change="sortChange"
|
||||
border fit row-key="id" ref="table" style="width: 100%;" v-loading="loading">
|
||||
<el-table-column align="center" type="selection" width="40px" :reserve-selection="true"/>
|
||||
<el-table-column :label="$t('table.information.storeId')" :show-overflow-tooltip="true" align="center" prop="storeId"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.storeId }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.information.mainTitle')" :show-overflow-tooltip="true" align="center" prop="mainTitle"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.mainTitle }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.information.viceTitle')" :show-overflow-tooltip="true" align="center" prop="viceTitle"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.viceTitle }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.information.content')" :show-overflow-tooltip="true" align="center" prop="content"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.content }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.information.coverImg')" :show-overflow-tooltip="true" align="center" prop="coverImg"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.coverImg }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.information.startTime')" :show-overflow-tooltip="true" align="center" prop="startTime"
|
||||
width="170">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.startTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.information.endTime')" :show-overflow-tooltip="true" align="center" prop="endTime"
|
||||
width="170">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.endTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.information.state')" :show-overflow-tooltip="true" align="center" prop="state"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.state }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.information.isDelete')" :show-overflow-tooltip="true" align="center" prop="isDelete"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.isDelete }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('table.createTime')"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
sortable="custom"
|
||||
width="170px">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.createTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('table.operation')" align="center" column-key="operation" class-name="small-padding fixed-width" width="100px">
|
||||
<template slot-scope="{ row }">
|
||||
<i @click="copy(row)" class="el-icon-copy-document table-operation" :title="$t('common.delete')"
|
||||
style="color: #2db7f5;" v-hasPermission="['information:add']"/>
|
||||
<i @click="edit(row)" class="el-icon-edit table-operation" :title="$t('common.delete')"
|
||||
style="color: #2db7f5;" v-hasPermission="['information:update']"/>
|
||||
<i @click="singleDelete(row)" class="el-icon-delete table-operation" :title="$t('common.delete')"
|
||||
style="color: #f50;" v-hasPermission="['information:delete']"/>
|
||||
<el-link class="no-perm" v-has-no-permission="['information:update', 'information:copy', 'information:delete']">
|
||||
{{ $t("tips.noPermission") }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :limit.sync="queryParams.size" :page.sync="queryParams.current"
|
||||
:total="Number(tableData.total)" @pagination="fetch" v-show="tableData.total > 0"/>
|
||||
<information-edit :dialog-visible="dialog.isVisible" :type="dialog.type"
|
||||
@close="editClose" @success="editSuccess" ref="edit"/>
|
||||
<information-import ref="import" :dialog-visible="fileImport.isVisible" :type="fileImport.type"
|
||||
:action="fileImport.action" accept=".xls,.xlsx" @close="importClose" @success="importSuccess" />
|
||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true"
|
||||
title="预览" width="80%" top="50px" :visible.sync="preview.isVisible" v-el-drag-dialog>
|
||||
<el-scrollbar>
|
||||
<div v-html="preview.context"></div>
|
||||
</el-scrollbar>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from "@/components/Pagination";
|
||||
import elDragDialog from '@/directive/el-drag-dialog'
|
||||
import InformationEdit from "./Edit";
|
||||
import informationApi from "@/api/InformationApi.js";
|
||||
import InformationImport from "@/components/ceres/Import"
|
||||
import {convertEnum} from '@/utils/utils'
|
||||
import {downloadFile, loadEnums, initDicts, initQueryParams} from '@/utils/commons'
|
||||
|
||||
export default {
|
||||
name: "InformationManage",
|
||||
directives: { elDragDialog },
|
||||
components: { Pagination, InformationEdit, InformationImport},
|
||||
filters: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 编辑
|
||||
dialog: {
|
||||
isVisible: false,
|
||||
type: "add"
|
||||
},
|
||||
// 预览
|
||||
preview: {
|
||||
isVisible: false,
|
||||
context: ''
|
||||
},
|
||||
// 导入
|
||||
fileImport: {
|
||||
isVisible: false,
|
||||
type: "import",
|
||||
action: `${process.env.VUE_APP_BASE_API}/store/information/import`
|
||||
},
|
||||
tableKey: 0,
|
||||
queryParams: initQueryParams(),
|
||||
selection: [],
|
||||
loading: false,
|
||||
tableData: {
|
||||
total: 0
|
||||
},
|
||||
// 枚举
|
||||
enums: {
|
||||
},
|
||||
// 字典
|
||||
dicts: {
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
mounted() {
|
||||
this.fetch();
|
||||
|
||||
// 初始化字典和枚举
|
||||
const enumList = [];
|
||||
const dictList = [];
|
||||
loadEnums(enumList, this.enums, 'store');
|
||||
initDicts(dictList, this.dicts);
|
||||
},
|
||||
methods: {
|
||||
editClose() {
|
||||
this.dialog.isVisible = false;
|
||||
},
|
||||
editSuccess() {
|
||||
this.search();
|
||||
},
|
||||
onSelectChange(selection) {
|
||||
this.selection = selection;
|
||||
},
|
||||
search() {
|
||||
this.fetch({
|
||||
...this.queryParams
|
||||
});
|
||||
},
|
||||
reset() {
|
||||
this.queryParams = initQueryParams();
|
||||
this.$refs.table.clearSort();
|
||||
this.$refs.table.clearFilter();
|
||||
this.search();
|
||||
},
|
||||
exportExcelPreview() {
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
this.queryParams.map.fileName = '导出数据';
|
||||
informationApi.preview(this.queryParams).then(response => {
|
||||
const res = response.data;
|
||||
this.preview.isVisible = true;
|
||||
this.preview.context = res.data;
|
||||
});
|
||||
},
|
||||
exportExcel() {
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
this.queryParams.map.fileName = '导出数据';
|
||||
informationApi.export(this.queryParams).then(response => {
|
||||
downloadFile(response);
|
||||
});
|
||||
},
|
||||
importExcel() {
|
||||
this.fileImport.type = "upload";
|
||||
this.fileImport.isVisible = true;
|
||||
this.$refs.import.setModel(false);
|
||||
},
|
||||
importSuccess() {
|
||||
this.search();
|
||||
},
|
||||
importClose() {
|
||||
this.fileImport.isVisible = false;
|
||||
},
|
||||
singleDelete(row) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(row, true);
|
||||
this.batchDelete();
|
||||
},
|
||||
batchDelete() {
|
||||
if (!this.selection.length) {
|
||||
this.$message({
|
||||
message: this.$t("tips.noDataSelected"),
|
||||
type: "warning"
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$confirm(this.$t("tips.confirmDelete"), this.$t("common.tips"), {
|
||||
confirmButtonText: this.$t("common.confirm"),
|
||||
cancelButtonText: this.$t("common.cancel"),
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
const ids = this.selection.map(u => u.id);
|
||||
this.delete(ids);
|
||||
})
|
||||
.catch(() => {
|
||||
this.clearSelections();
|
||||
});
|
||||
},
|
||||
clearSelections() {
|
||||
this.$refs.table.clearSelection();
|
||||
},
|
||||
delete(ids) {
|
||||
informationApi.delete({ ids: ids }).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
this.$message({
|
||||
message: this.$t("tips.deleteSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
this.search();
|
||||
}
|
||||
});
|
||||
},
|
||||
add() {
|
||||
this.dialog.type = "add";
|
||||
this.dialog.isVisible = true;
|
||||
this.$refs.edit.setInformation({ enums: this.enums, dicts: this.dicts});
|
||||
},
|
||||
copy(row) {
|
||||
this.$refs.edit.setInformation({row, enums: this.enums, dicts: this.dicts});
|
||||
this.dialog.type = "copy";
|
||||
this.dialog.isVisible = true;
|
||||
},
|
||||
edit(row) {
|
||||
this.$refs.edit.setInformation({row, enums: this.enums, dicts: this.dicts});
|
||||
this.dialog.type = "edit";
|
||||
this.dialog.isVisible = true;
|
||||
},
|
||||
fetch(params = {}) {
|
||||
this.loading = true;
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
|
||||
this.queryParams.current = params.current ? params.current : this.queryParams.current;
|
||||
this.queryParams.size = params.size ? params.size : this.queryParams.size;
|
||||
|
||||
informationApi.page(this.queryParams).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
this.tableData = res.data;
|
||||
}
|
||||
}).finally(() => this.loading = false);
|
||||
},
|
||||
sortChange(val) {
|
||||
this.queryParams.sort = val.prop;
|
||||
this.queryParams.order = val.order;
|
||||
if (this.queryParams.sort) {
|
||||
this.search();
|
||||
}
|
||||
},
|
||||
filterChange (filters) {
|
||||
for (const key in filters) {
|
||||
if(key.includes('.')) {
|
||||
const val = { };
|
||||
val[key.split('.')[1]] = filters[key][0];
|
||||
this.queryParams.model[key.split('.')[0]] = val;
|
||||
} else {
|
||||
this.queryParams.model[key] = filters[key][0]
|
||||
}
|
||||
}
|
||||
this.search()
|
||||
},
|
||||
cellClick (row, column) {
|
||||
if (column['columnKey'] === "operation") {
|
||||
return;
|
||||
}
|
||||
let flag = false;
|
||||
this.selection.forEach((item)=>{
|
||||
if(item.id === row.id) {
|
||||
flag = true;
|
||||
this.$refs.table.toggleRowSelection(row);
|
||||
}
|
||||
})
|
||||
|
||||
if(!flag){
|
||||
this.$refs.table.toggleRowSelection(row, true);
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -8,7 +8,7 @@
|
||||
<Container :data-list="dataList" @fetch="fetch" />
|
||||
<Dialog
|
||||
title="新建商家"
|
||||
:visible.sync="dialogVisible"
|
||||
:visible.sync="dialogVisible"
|
||||
:fullscreen="!true"
|
||||
width="55%"
|
||||
>
|
||||
|
||||
@@ -0,0 +1,229 @@
|
||||
<template>
|
||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true" :title="title" :type="type"
|
||||
:visible.sync="isVisible" :width="width" top="50px" v-el-drag-dialog>
|
||||
<el-form :model="ceresMemberTask" :rules="rules" label-position="right" label-width="100px" ref="form">
|
||||
<el-form-item :label="$t('table.ceresMemberTask.name')" prop="name">
|
||||
<el-input type="" v-model="ceresMemberTask.name" placeholder="任务名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.ceresMemberTask.type')" prop="type">
|
||||
<!-- <el-input type="" v-model="ceresMemberTask.type" placeholder="任务类型"/> -->
|
||||
<el-select v-model="ceresMemberTask.type" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in typeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.ceresMemberTask.limitDay')" prop="limitDay">
|
||||
<el-input type="" v-model="ceresMemberTask.limitDay" placeholder="每日次数限制"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.ceresMemberTask.rewardType')" prop="rewardType">
|
||||
<!-- <el-input type="" v-model="ceresMemberTask.rewardType" placeholder="奖励类型1积分 "/> -->
|
||||
<el-select v-model="ceresMemberTask.rewardType" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in rewardType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.ceresMemberTask.rewardValue')" prop="rewardValue">
|
||||
<el-input type="" v-model="ceresMemberTask.rewardValue" placeholder="奖励数值"/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="$t('table.ceresMemberTask.aspects')" prop="aspects">
|
||||
<el-input type="" v-model="ceresMemberTask.aspects" placeholder="切面方法 用,隔开"/>
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="$t('table.ceresMemberTask.status')" prop="status">
|
||||
<el-radio-group v-model="ceresMemberTask.status" size="medium">
|
||||
<el-radio-button :label="true">{{ $t("common.status.valid") }}</el-radio-button>
|
||||
<el-radio-button :label="false">{{ $t("common.status.invalid") }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="dialog-footer" slot="footer">
|
||||
<el-button @click="isVisible = false" plain type="warning">
|
||||
{{ $t("common.cancel") }}
|
||||
</el-button>
|
||||
<el-button @click="submitForm" :disabled="confirmDisabled" plain type="primary">
|
||||
{{ $t("common.confirm") }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import elDragDialog from '@/directive/el-drag-dialog'
|
||||
import ceresMemberTaskApi from "@/api/CeresMemberTask.js";
|
||||
import { initMsgsEnums } from '@/utils/commons'
|
||||
export default {
|
||||
name: "CeresMemberTaskEdit",
|
||||
directives: { elDragDialog },
|
||||
components: { },
|
||||
props: {
|
||||
dialogVisible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: "add"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
typeOptions: [
|
||||
|
||||
],
|
||||
rewardType: [
|
||||
{
|
||||
value: 1,
|
||||
label: 1
|
||||
}
|
||||
],
|
||||
confirmDisabled: false,
|
||||
// ceresMemberTask: this.initCeresMemberTask(),
|
||||
ceresMemberTask: {...this.initCeresMemberTask(),rewardType: 1},
|
||||
screenWidth: 0,
|
||||
width: this.initWidth(),
|
||||
rules: {
|
||||
|
||||
},
|
||||
// 枚举
|
||||
enums: {
|
||||
},
|
||||
// 字典
|
||||
dicts: {
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isVisible: {
|
||||
get() {
|
||||
return this.dialogVisible;
|
||||
},
|
||||
set() {
|
||||
this.close();
|
||||
this.reset();
|
||||
}
|
||||
},
|
||||
title() {
|
||||
return this.$t("common." + this.type);
|
||||
}
|
||||
},
|
||||
watch: {},
|
||||
mounted() {
|
||||
window.onresize = () => {
|
||||
return (() => {
|
||||
this.width = this.initWidth();
|
||||
})();
|
||||
};
|
||||
initMsgsEnums(['MemberTaskTypeEnums'], this.enums);
|
||||
setTimeout(() => {
|
||||
let obj = this.enums.MemberTaskTypeEnums;
|
||||
for(let key in obj) {
|
||||
let val = {
|
||||
value: key,
|
||||
label: obj[key]
|
||||
}
|
||||
this.typeOptions.push(val)
|
||||
}
|
||||
}, 100)
|
||||
},
|
||||
methods: {
|
||||
initCeresMemberTask() {
|
||||
return {
|
||||
id: "",
|
||||
name: '',
|
||||
type: '',
|
||||
limitDay: null,
|
||||
rewardType: null,
|
||||
rewardValue: null,
|
||||
aspects: '',
|
||||
status: true,
|
||||
};
|
||||
},
|
||||
initWidth() {
|
||||
this.screenWidth = document.body.clientWidth;
|
||||
if (this.screenWidth < 991) {
|
||||
return "90%";
|
||||
} else if (this.screenWidth < 1400) {
|
||||
return "45%";
|
||||
} else {
|
||||
return "800px";
|
||||
}
|
||||
},
|
||||
setCeresMemberTask(val = {}) {
|
||||
const vm = this;
|
||||
|
||||
vm.dicts = val['dicts'];
|
||||
vm.enums = val['enums'];
|
||||
if (val['row']) {
|
||||
vm.ceresMemberTask = { ...val['row'] };
|
||||
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.$emit("close");
|
||||
},
|
||||
reset() {
|
||||
// 先清除校验,再清除表单,不然有奇怪的bug
|
||||
this.$refs.form.clearValidate();
|
||||
this.$refs.form.resetFields();
|
||||
this.confirmDisabled = false;
|
||||
this.ceresMemberTask = this.initCeresMemberTask();
|
||||
},
|
||||
submitForm() {
|
||||
const vm = this;
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
vm.editSubmit();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
editSubmit() {
|
||||
const vm = this;
|
||||
if (vm.type === "edit") {
|
||||
vm.update();
|
||||
} else {
|
||||
vm.save();
|
||||
}
|
||||
},
|
||||
save() {
|
||||
const vm = this;
|
||||
vm.confirmDisabled = true;
|
||||
|
||||
ceresMemberTaskApi.save(this.ceresMemberTask).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
vm.isVisible = false;
|
||||
vm.$message({
|
||||
message: vm.$t("tips.createSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
vm.$emit("success");
|
||||
}
|
||||
}).finally(()=> vm.confirmDisabled = false);
|
||||
},
|
||||
update() {
|
||||
const vm = this;
|
||||
vm.confirmDisabled = true;
|
||||
ceresMemberTaskApi.update(this.ceresMemberTask).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
vm.isVisible = false;
|
||||
vm.$message({
|
||||
message: this.$t("tips.updateSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
vm.$emit("success");
|
||||
}
|
||||
}).finally(()=> vm.confirmDisabled = false);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,360 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="filter-container">
|
||||
|
||||
<el-date-picker :range-separator="null" class="filter-item search-item date-range-item"
|
||||
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期"
|
||||
type="daterange" v-model="queryParams.timeRange" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
/>
|
||||
<el-button @click="search" class="filter-item" plain type="primary">
|
||||
{{ $t("table.search") }}
|
||||
</el-button>
|
||||
<el-button @click="reset" class="filter-item" plain type="warning">
|
||||
{{ $t("table.reset") }}
|
||||
</el-button>
|
||||
<el-button @click="add" class="filter-item" plain type="danger" v-has-permission="['ceresMemberTask:add']">
|
||||
{{ $t("table.add") }}
|
||||
</el-button>
|
||||
<el-dropdown class="filter-item" trigger="click" v-has-any-permission="['ceresMemberTask:delete', 'ceresMemberTask:export',
|
||||
'ceresMemberTask:import']">
|
||||
<el-button>
|
||||
{{ $t("table.more") }}<i class="el-icon-arrow-down el-icon--right" />
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="batchDelete" v-has-permission="['ceresMemberTask:delete']">
|
||||
{{ $t("table.delete") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exportExcel" v-has-permission="['ceresMemberTask:export']">
|
||||
{{ $t("table.export") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exportExcelPreview" v-has-permission="['ceresMemberTask:export']">
|
||||
{{ $t("table.exportPreview") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="importExcel" v-has-permission="['ceresMemberTask:import']">
|
||||
{{ $t("table.import") }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
<el-table :data="tableData.records" :key="tableKey" @cell-click="cellClick"
|
||||
@filter-change="filterChange" @selection-change="onSelectChange" @sort-change="sortChange"
|
||||
border fit row-key="id" ref="table" style="width: 100%;" v-loading="loading">
|
||||
<el-table-column align="center" type="selection" width="40px" :reserve-selection="true"/>
|
||||
<el-table-column :label="$t('table.ceresMemberTask.name')" :show-overflow-tooltip="true" align="center" prop="name"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.ceresMemberTask.type')" :show-overflow-tooltip="true" align="center" prop="type"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.type }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.ceresMemberTask.limitDay')" :show-overflow-tooltip="true" align="center" prop="limitDay"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.limitDay }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.ceresMemberTask.rewardType')" :show-overflow-tooltip="true" align="center" prop="rewardType"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.rewardType }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.ceresMemberTask.rewardValue')" :show-overflow-tooltip="true" align="center" prop="rewardValue"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.rewardValue }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column :label="$t('table.ceresMemberTask.aspects')" :show-overflow-tooltip="true" align="center" prop="aspects"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.aspects }}</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column :label="$t('table.ceresMemberTask.status')" :show-overflow-tooltip="true" align="center" prop="status"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.status }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('table.createTime')"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
sortable="custom"
|
||||
width="170px">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.createTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('table.operation')" align="center" column-key="operation" class-name="small-padding fixed-width" width="100px">
|
||||
<template slot-scope="{ row }">
|
||||
<i @click="copy(row)" class="el-icon-copy-document table-operation" :title="$t('common.delete')"
|
||||
style="color: #2db7f5;" v-hasPermission="['ceresMemberTask:add']"/>
|
||||
<i @click="edit(row)" class="el-icon-edit table-operation" :title="$t('common.delete')"
|
||||
style="color: #2db7f5;" v-hasPermission="['ceresMemberTask:update']"/>
|
||||
<i @click="singleDelete(row)" class="el-icon-delete table-operation" :title="$t('common.delete')"
|
||||
style="color: #f50;" v-hasPermission="['ceresMemberTask:delete']"/>
|
||||
<el-link class="no-perm" v-has-no-permission="['ceresMemberTask:update', 'ceresMemberTask:copy', 'ceresMemberTask:delete']">
|
||||
{{ $t("tips.noPermission") }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :limit.sync="queryParams.size" :page.sync="queryParams.current"
|
||||
:total="Number(tableData.total)" @pagination="fetch" v-show="tableData.total > 0"/>
|
||||
<ceresMemberTask-edit :dialog-visible="dialog.isVisible" :type="dialog.type"
|
||||
@close="editClose" @success="editSuccess" ref="edit"/>
|
||||
<ceresMemberTask-import ref="import" :dialog-visible="fileImport.isVisible" :type="fileImport.type"
|
||||
:action="fileImport.action" accept=".xls,.xlsx" @close="importClose" @success="importSuccess" />
|
||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true"
|
||||
title="预览" width="80%" top="50px" :visible.sync="preview.isVisible" v-el-drag-dialog>
|
||||
<el-scrollbar>
|
||||
<div v-html="preview.context"></div>
|
||||
</el-scrollbar>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from "@/components/Pagination";
|
||||
import elDragDialog from '@/directive/el-drag-dialog'
|
||||
import CeresMemberTaskEdit from "./Edit";
|
||||
import ceresMemberTaskApi from "@/api/CeresMemberTask.js";
|
||||
import CeresMemberTaskImport from "@/components/ceres/Import"
|
||||
import {convertEnum} from '@/utils/utils'
|
||||
import {downloadFile, loadEnums, initDicts, initQueryParams, initMsgsEnums} from '@/utils/commons'
|
||||
|
||||
export default {
|
||||
name: "CeresMemberTaskManage",
|
||||
directives: { elDragDialog },
|
||||
components: { Pagination, CeresMemberTaskEdit, CeresMemberTaskImport},
|
||||
filters: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 编辑
|
||||
dialog: {
|
||||
isVisible: false,
|
||||
type: "add"
|
||||
},
|
||||
// 预览
|
||||
preview: {
|
||||
isVisible: false,
|
||||
context: ''
|
||||
},
|
||||
// 导入
|
||||
fileImport: {
|
||||
isVisible: false,
|
||||
type: "import",
|
||||
action: `${process.env.VUE_APP_BASE_API}/member/ceresMemberTask/import`
|
||||
},
|
||||
tableKey: 0,
|
||||
queryParams: initQueryParams(),
|
||||
selection: [],
|
||||
loading: false,
|
||||
tableData: {
|
||||
total: 0
|
||||
},
|
||||
// 枚举
|
||||
enums: {
|
||||
},
|
||||
// 字典
|
||||
dicts: {
|
||||
},
|
||||
type: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
mounted() {
|
||||
this.fetch();
|
||||
|
||||
// 初始化字典和枚举
|
||||
const enumList = [];
|
||||
const dictList = [];
|
||||
loadEnums(enumList, this.enums, 'member');
|
||||
initDicts(dictList, this.dicts);
|
||||
initMsgsEnums(['MemberTaskTypeEnums'], this.type);
|
||||
},
|
||||
methods: {
|
||||
editClose() {
|
||||
this.dialog.isVisible = false;
|
||||
},
|
||||
editSuccess() {
|
||||
this.search();
|
||||
},
|
||||
onSelectChange(selection) {
|
||||
this.selection = selection;
|
||||
},
|
||||
search() {
|
||||
this.fetch({
|
||||
...this.queryParams
|
||||
});
|
||||
},
|
||||
reset() {
|
||||
this.queryParams = initQueryParams();
|
||||
this.$refs.table.clearSort();
|
||||
this.$refs.table.clearFilter();
|
||||
this.search();
|
||||
},
|
||||
exportExcelPreview() {
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
this.queryParams.map.fileName = '导出数据';
|
||||
ceresMemberTaskApi.preview(this.queryParams).then(response => {
|
||||
const res = response.data;
|
||||
this.preview.isVisible = true;
|
||||
this.preview.context = res.data;
|
||||
});
|
||||
},
|
||||
exportExcel() {
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
this.queryParams.map.fileName = '导出数据';
|
||||
ceresMemberTaskApi.export(this.queryParams).then(response => {
|
||||
downloadFile(response);
|
||||
});
|
||||
},
|
||||
importExcel() {
|
||||
this.fileImport.type = "upload";
|
||||
this.fileImport.isVisible = true;
|
||||
this.$refs.import.setModel(false);
|
||||
},
|
||||
importSuccess() {
|
||||
this.search();
|
||||
},
|
||||
importClose() {
|
||||
this.fileImport.isVisible = false;
|
||||
},
|
||||
singleDelete(row) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(row, true);
|
||||
this.batchDelete();
|
||||
},
|
||||
batchDelete() {
|
||||
if (!this.selection.length) {
|
||||
this.$message({
|
||||
message: this.$t("tips.noDataSelected"),
|
||||
type: "warning"
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$confirm(this.$t("tips.confirmDelete"), this.$t("common.tips"), {
|
||||
confirmButtonText: this.$t("common.confirm"),
|
||||
cancelButtonText: this.$t("common.cancel"),
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
const ids = this.selection.map(u => u.id);
|
||||
this.delete(ids);
|
||||
})
|
||||
.catch(() => {
|
||||
this.clearSelections();
|
||||
});
|
||||
},
|
||||
clearSelections() {
|
||||
this.$refs.table.clearSelection();
|
||||
},
|
||||
delete(ids) {
|
||||
ceresMemberTaskApi.delete({ ids: ids }).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
this.$message({
|
||||
message: this.$t("tips.deleteSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
this.search();
|
||||
}
|
||||
});
|
||||
},
|
||||
add() {
|
||||
this.dialog.type = "add";
|
||||
this.dialog.isVisible = true;
|
||||
this.$refs.edit.setCeresMemberTask({ enums: this.enums, dicts: this.dicts});
|
||||
},
|
||||
copy(row) {
|
||||
this.$refs.edit.setCeresMemberTask({row, enums: this.enums, dicts: this.dicts});
|
||||
this.dialog.type = "copy";
|
||||
this.dialog.isVisible = true;
|
||||
},
|
||||
edit(row) {
|
||||
this.$refs.edit.setCeresMemberTask({row, enums: this.enums, dicts: this.dicts});
|
||||
this.dialog.type = "edit";
|
||||
this.dialog.isVisible = true;
|
||||
},
|
||||
fetch(params = {}) {
|
||||
this.loading = true;
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
|
||||
this.queryParams.current = params.current ? params.current : this.queryParams.current;
|
||||
this.queryParams.size = params.size ? params.size : this.queryParams.size;
|
||||
|
||||
ceresMemberTaskApi.page(this.queryParams).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
this.tableData = res.data;
|
||||
setTimeout(() => {
|
||||
this.tableData.records.forEach(val => {
|
||||
val.type = this.type.MemberTaskTypeEnums[val.type]
|
||||
})
|
||||
}, 10)
|
||||
}
|
||||
}).finally(() => this.loading = false);
|
||||
},
|
||||
sortChange(val) {
|
||||
this.queryParams.sort = val.prop;
|
||||
this.queryParams.order = val.order;
|
||||
if (this.queryParams.sort) {
|
||||
this.search();
|
||||
}
|
||||
},
|
||||
filterChange (filters) {
|
||||
for (const key in filters) {
|
||||
if(key.includes('.')) {
|
||||
const val = { };
|
||||
val[key.split('.')[1]] = filters[key][0];
|
||||
this.queryParams.model[key.split('.')[0]] = val;
|
||||
} else {
|
||||
this.queryParams.model[key] = filters[key][0]
|
||||
}
|
||||
}
|
||||
this.search()
|
||||
},
|
||||
cellClick (row, column) {
|
||||
if (column['columnKey'] === "operation") {
|
||||
return;
|
||||
}
|
||||
let flag = false;
|
||||
this.selection.forEach((item)=>{
|
||||
if(item.id === row.id) {
|
||||
flag = true;
|
||||
this.$refs.table.toggleRowSelection(row);
|
||||
}
|
||||
})
|
||||
|
||||
if(!flag){
|
||||
this.$refs.table.toggleRowSelection(row, true);
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,235 @@
|
||||
<template>
|
||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true" :title="title" :type="type"
|
||||
:visible.sync="isVisible" :width="width" top="50px" v-el-drag-dialog>
|
||||
<el-form :model="memberRank" :rules="rules" label-position="right" label-width="100px" ref="form">
|
||||
<el-form-item :label="$t('table.memberRank.rankName')" prop="rankName">
|
||||
<el-input type="" v-model="memberRank.rankName" placeholder=""/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.memberRank.rankOrigin')" prop="rankOrigin">
|
||||
<el-input type="" v-model="memberRank.rankOrigin" placeholder=""/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.memberRank.rankContent')" prop="rankContent">
|
||||
<!-- <el-input type="" v-model="memberRank.rankContent" placeholder=""/> -->
|
||||
<Tinymce ref="content" v-model="memberRank.rankContent" :height="200" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.memberRank.rankImg')" prop="rankImg">
|
||||
<!-- <el-input type="" v-model="memberRank.rankImg" placeholder=""/> -->
|
||||
<imgUpload
|
||||
ref="imgFileRef"
|
||||
:accept="accept"
|
||||
:accept-size="2 * 1024 * 1024"
|
||||
:auto-upload="true"
|
||||
:data="memberRank.rankImg"
|
||||
:file-list="imgFileList"
|
||||
:show-file-list="false"
|
||||
list-type="picture-card"
|
||||
@setId="setIdAndSubmit"
|
||||
>
|
||||
<i class="el-icon-plus"></i>
|
||||
</imgUpload>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('table.memberRank.status')" prop="status">
|
||||
<el-radio-group v-model="memberRank.status" size="medium">
|
||||
<el-radio-button :label="true">{{ $t("common.status.valid") }}</el-radio-button>
|
||||
<el-radio-button :label="false">{{ $t("common.status.invalid") }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="dialog-footer" slot="footer">
|
||||
<el-button @click="isVisible = false" plain type="warning">
|
||||
{{ $t("common.cancel") }}
|
||||
</el-button>
|
||||
<el-button @click="submitForm" :disabled="confirmDisabled" plain type="primary">
|
||||
{{ $t("common.confirm") }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import elDragDialog from '@/directive/el-drag-dialog'
|
||||
import memberRankApi from "@/api/MemberRank.js";
|
||||
import Tinymce from '@/components/Tinymce'
|
||||
import imgUpload from "@/components/ceres/imgUpload"
|
||||
export default {
|
||||
name: "MemberRankEdit",
|
||||
directives: { elDragDialog },
|
||||
components: { Tinymce, imgUpload },
|
||||
props: {
|
||||
dialogVisible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: "add"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
confirmDisabled: false,
|
||||
memberRank: this.initMemberRank(),
|
||||
screenWidth: 0,
|
||||
width: this.initWidth(),
|
||||
rules: {
|
||||
|
||||
},
|
||||
// 枚举
|
||||
enums: {
|
||||
},
|
||||
// 字典
|
||||
dicts: {
|
||||
},
|
||||
options: {
|
||||
placeholder: '请输入内容',
|
||||
modules: {
|
||||
toolbar: [
|
||||
[{ size: ['small', false, 'large'] }],
|
||||
['bold', 'italic'],
|
||||
[{ header: 1 }, { header: 2 }],
|
||||
[{ list: 'ordered' }, { list: 'bullet' }],
|
||||
['link'],
|
||||
[{ color: [] }, { background: [] }],
|
||||
[{ align: [] }]
|
||||
],
|
||||
history: {
|
||||
delay: 1000,
|
||||
maxStack: 50,
|
||||
userOnly: false
|
||||
}
|
||||
}
|
||||
},
|
||||
accept: "image/jpeg, image/gif, image/png",
|
||||
imgFileList: [],
|
||||
// 上传成功数
|
||||
successNum: 0,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isVisible: {
|
||||
get() {
|
||||
return this.dialogVisible;
|
||||
},
|
||||
set() {
|
||||
this.close();
|
||||
this.reset();
|
||||
}
|
||||
},
|
||||
title() {
|
||||
return this.$t("common." + this.type);
|
||||
}
|
||||
},
|
||||
watch: {},
|
||||
mounted() {
|
||||
window.onresize = () => {
|
||||
return (() => {
|
||||
this.width = this.initWidth();
|
||||
})();
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
setIdAndSubmit(bizId, url) {
|
||||
const vm = this
|
||||
vm.successNum += 1
|
||||
// vm.imgFileData.bizId = bizId
|
||||
vm.memberRank.rankImg = url
|
||||
// vm.user.id = bizId
|
||||
|
||||
// if (vm.successNum === vm.imgFileTotal) {
|
||||
// vm.$store.state.hasLoading = false
|
||||
// }
|
||||
},
|
||||
initMemberRank() {
|
||||
return {
|
||||
id: "",
|
||||
rankName: '',
|
||||
rankOrigin: null,
|
||||
rankContent: '',
|
||||
rankImg: '',
|
||||
status: true,
|
||||
};
|
||||
},
|
||||
initWidth() {
|
||||
this.screenWidth = document.body.clientWidth;
|
||||
if (this.screenWidth < 991) {
|
||||
return "90%";
|
||||
} else if (this.screenWidth < 1400) {
|
||||
return "45%";
|
||||
} else {
|
||||
return "800px";
|
||||
}
|
||||
},
|
||||
setMemberRank(val = {}) {
|
||||
const vm = this;
|
||||
|
||||
vm.dicts = val['dicts'];
|
||||
vm.enums = val['enums'];
|
||||
if (val['row']) {
|
||||
vm.memberRank = { ...val['row'] };
|
||||
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.$emit("close");
|
||||
},
|
||||
reset() {
|
||||
// 先清除校验,再清除表单,不然有奇怪的bug
|
||||
this.$refs.form.clearValidate();
|
||||
this.$refs.form.resetFields();
|
||||
this.confirmDisabled = false;
|
||||
this.memberRank = this.initMemberRank();
|
||||
},
|
||||
submitForm() {
|
||||
const vm = this;
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
vm.editSubmit();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
editSubmit() {
|
||||
const vm = this;
|
||||
if (vm.type === "edit") {
|
||||
vm.update();
|
||||
} else {
|
||||
vm.save();
|
||||
}
|
||||
},
|
||||
save() {
|
||||
const vm = this;
|
||||
vm.confirmDisabled = true;
|
||||
// console.log(this.memberRank);
|
||||
// return;
|
||||
memberRankApi.save(this.memberRank).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
vm.isVisible = false;
|
||||
vm.$message({
|
||||
message: vm.$t("tips.createSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
vm.$emit("success");
|
||||
}
|
||||
}).finally(()=> vm.confirmDisabled = false);
|
||||
},
|
||||
update() {
|
||||
const vm = this;
|
||||
vm.confirmDisabled = true;
|
||||
memberRankApi.update(this.memberRank).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
vm.isVisible = false;
|
||||
vm.$message({
|
||||
message: this.$t("tips.updateSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
vm.$emit("success");
|
||||
}
|
||||
}).finally(()=> vm.confirmDisabled = false);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,347 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="filter-container">
|
||||
|
||||
<el-date-picker :range-separator="null" class="filter-item search-item date-range-item"
|
||||
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期"
|
||||
type="daterange" v-model="queryParams.timeRange" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
/>
|
||||
<el-button @click="search" class="filter-item" plain type="primary">
|
||||
{{ $t("table.search") }}
|
||||
</el-button>
|
||||
<el-button @click="reset" class="filter-item" plain type="warning">
|
||||
{{ $t("table.reset") }}
|
||||
</el-button>
|
||||
<el-button @click="add" class="filter-item" plain type="danger" v-has-permission="['memberRank:add']">
|
||||
{{ $t("table.add") }}
|
||||
</el-button>
|
||||
<el-dropdown class="filter-item" trigger="click" v-has-any-permission="['memberRank:delete', 'memberRank:export',
|
||||
'memberRank:import']">
|
||||
<el-button>
|
||||
{{ $t("table.more") }}<i class="el-icon-arrow-down el-icon--right" />
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="batchDelete" v-has-permission="['memberRank:delete']">
|
||||
{{ $t("table.delete") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exportExcel" v-has-permission="['memberRank:export']">
|
||||
{{ $t("table.export") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="exportExcelPreview" v-has-permission="['memberRank:export']">
|
||||
{{ $t("table.exportPreview") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="importExcel" v-has-permission="['memberRank:import']">
|
||||
{{ $t("table.import") }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
<el-table :data="tableData.records" :key="tableKey" @cell-click="cellClick"
|
||||
@filter-change="filterChange" @selection-change="onSelectChange" @sort-change="sortChange"
|
||||
border fit row-key="id" ref="table" style="width: 100%;" v-loading="loading">
|
||||
<el-table-column align="center" type="selection" width="40px" :reserve-selection="true"/>
|
||||
<el-table-column :label="$t('table.memberRank.rankName')" :show-overflow-tooltip="true" align="center" prop="rankName"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.rankName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.memberRank.rankOrigin')" :show-overflow-tooltip="true" align="center" prop="rankOrigin"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.rankOrigin }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column :label="$t('table.memberRank.rankContent')" :show-overflow-tooltip="true" align="center" prop="rankContent"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.rankContent }}</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column :label="$t('table.memberRank.rankImg')" :show-overflow-tooltip="true" align="center" prop="rankImg"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<!-- <span>{{ scope.row.rankImg }}</span> -->
|
||||
<el-image
|
||||
style="width: 50px; height: 50px"
|
||||
:src="scope.row.rankImg"
|
||||
fit="contain">
|
||||
</el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('table.memberRank.status')" :show-overflow-tooltip="true" align="center" prop="status"
|
||||
width="">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.status }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('table.createTime')"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
sortable="custom"
|
||||
width="170px">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.createTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('table.operation')" align="center" column-key="operation" class-name="small-padding fixed-width" width="100px">
|
||||
<template slot-scope="{ row }">
|
||||
<i @click="copy(row)" class="el-icon-copy-document table-operation" :title="$t('common.delete')"
|
||||
style="color: #2db7f5;" v-hasPermission="['memberRank:add']"/>
|
||||
<i @click="edit(row)" class="el-icon-edit table-operation" :title="$t('common.delete')"
|
||||
style="color: #2db7f5;" v-hasPermission="['memberRank:update']"/>
|
||||
<i @click="singleDelete(row)" class="el-icon-delete table-operation" :title="$t('common.delete')"
|
||||
style="color: #f50;" v-hasPermission="['memberRank:delete']"/>
|
||||
<el-link class="no-perm" v-has-no-permission="['memberRank:update', 'memberRank:copy', 'memberRank:delete']">
|
||||
{{ $t("tips.noPermission") }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :limit.sync="queryParams.size" :page.sync="queryParams.current"
|
||||
:total="Number(tableData.total)" @pagination="fetch" v-show="tableData.total > 0"/>
|
||||
<memberRank-edit :dialog-visible="dialog.isVisible" :type="dialog.type"
|
||||
@close="editClose" @success="editSuccess" ref="edit"/>
|
||||
<memberRank-import ref="import" :dialog-visible="fileImport.isVisible" :type="fileImport.type"
|
||||
:action="fileImport.action" accept=".xls,.xlsx" @close="importClose" @success="importSuccess" />
|
||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true"
|
||||
title="预览" width="80%" top="50px" :visible.sync="preview.isVisible" v-el-drag-dialog>
|
||||
<el-scrollbar>
|
||||
<div v-html="preview.context"></div>
|
||||
</el-scrollbar>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from "@/components/Pagination";
|
||||
import elDragDialog from '@/directive/el-drag-dialog'
|
||||
import MemberRankEdit from "./edit";
|
||||
import memberRankApi from "@/api/MemberRank.js";
|
||||
import MemberRankImport from "@/components/ceres/Import"
|
||||
import {convertEnum} from '@/utils/utils'
|
||||
import {downloadFile, loadEnums, initDicts, initQueryParams} from '@/utils/commons'
|
||||
|
||||
export default {
|
||||
name: "MemberRankManage",
|
||||
directives: { elDragDialog },
|
||||
components: { Pagination, MemberRankEdit, MemberRankImport},
|
||||
filters: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 编辑
|
||||
dialog: {
|
||||
isVisible: false,
|
||||
type: "add"
|
||||
},
|
||||
// 预览
|
||||
preview: {
|
||||
isVisible: false,
|
||||
context: ''
|
||||
},
|
||||
// 导入
|
||||
fileImport: {
|
||||
isVisible: false,
|
||||
type: "import",
|
||||
action: `${process.env.VUE_APP_BASE_API}/memberRank/import`
|
||||
// action: `${process.env.VUE_APP_BASE_API}/member/memberRank/import`
|
||||
},
|
||||
tableKey: 0,
|
||||
queryParams: initQueryParams(),
|
||||
selection: [],
|
||||
loading: false,
|
||||
tableData: {
|
||||
total: 0
|
||||
},
|
||||
// 枚举
|
||||
enums: {
|
||||
},
|
||||
// 字典
|
||||
dicts: {
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
mounted() {
|
||||
this.fetch();
|
||||
|
||||
// 初始化字典和枚举
|
||||
const enumList = [];
|
||||
const dictList = [];
|
||||
loadEnums(enumList, this.enums, 'member');
|
||||
initDicts(dictList, this.dicts);
|
||||
},
|
||||
methods: {
|
||||
editClose() {
|
||||
this.dialog.isVisible = false;
|
||||
},
|
||||
editSuccess() {
|
||||
this.search();
|
||||
},
|
||||
onSelectChange(selection) {
|
||||
this.selection = selection;
|
||||
},
|
||||
search() {
|
||||
this.fetch({
|
||||
...this.queryParams
|
||||
});
|
||||
},
|
||||
reset() {
|
||||
this.queryParams = initQueryParams();
|
||||
this.$refs.table.clearSort();
|
||||
this.$refs.table.clearFilter();
|
||||
this.search();
|
||||
},
|
||||
exportExcelPreview() {
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
this.queryParams.map.fileName = '导出数据';
|
||||
memberRankApi.preview(this.queryParams).then(response => {
|
||||
const res = response.data;
|
||||
this.preview.isVisible = true;
|
||||
this.preview.context = res.data;
|
||||
});
|
||||
},
|
||||
exportExcel() {
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
this.queryParams.map.fileName = '导出数据';
|
||||
memberRankApi.export(this.queryParams).then(response => {
|
||||
downloadFile(response);
|
||||
});
|
||||
},
|
||||
importExcel() {
|
||||
this.fileImport.type = "upload";
|
||||
this.fileImport.isVisible = true;
|
||||
this.$refs.import.setModel(false);
|
||||
},
|
||||
importSuccess() {
|
||||
this.search();
|
||||
},
|
||||
importClose() {
|
||||
this.fileImport.isVisible = false;
|
||||
},
|
||||
singleDelete(row) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(row, true);
|
||||
this.batchDelete();
|
||||
},
|
||||
batchDelete() {
|
||||
if (!this.selection.length) {
|
||||
this.$message({
|
||||
message: this.$t("tips.noDataSelected"),
|
||||
type: "warning"
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$confirm(this.$t("tips.confirmDelete"), this.$t("common.tips"), {
|
||||
confirmButtonText: this.$t("common.confirm"),
|
||||
cancelButtonText: this.$t("common.cancel"),
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
const ids = this.selection.map(u => u.id);
|
||||
this.delete(ids);
|
||||
})
|
||||
.catch(() => {
|
||||
this.clearSelections();
|
||||
});
|
||||
},
|
||||
clearSelections() {
|
||||
this.$refs.table.clearSelection();
|
||||
},
|
||||
delete(ids) {
|
||||
memberRankApi.delete({ ids: ids }).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
this.$message({
|
||||
message: this.$t("tips.deleteSuccess"),
|
||||
type: "success"
|
||||
});
|
||||
this.search();
|
||||
}
|
||||
});
|
||||
},
|
||||
add() {
|
||||
this.dialog.type = "add";
|
||||
this.dialog.isVisible = true;
|
||||
this.$refs.edit.setMemberRank({ enums: this.enums, dicts: this.dicts});
|
||||
},
|
||||
copy(row) {
|
||||
this.$refs.edit.setMemberRank({row, enums: this.enums, dicts: this.dicts});
|
||||
this.dialog.type = "copy";
|
||||
this.dialog.isVisible = true;
|
||||
},
|
||||
edit(row) {
|
||||
this.$refs.edit.setMemberRank({row, enums: this.enums, dicts: this.dicts});
|
||||
this.dialog.type = "edit";
|
||||
this.dialog.isVisible = true;
|
||||
},
|
||||
fetch(params = {}) {
|
||||
this.loading = true;
|
||||
if (this.queryParams.timeRange) {
|
||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||
}
|
||||
|
||||
this.queryParams.current = params.current ? params.current : this.queryParams.current;
|
||||
this.queryParams.size = params.size ? params.size : this.queryParams.size;
|
||||
|
||||
memberRankApi.page(this.queryParams).then(response => {
|
||||
const res = response.data;
|
||||
if (res.isSuccess) {
|
||||
this.tableData = res.data;
|
||||
}
|
||||
}).finally(() => this.loading = false);
|
||||
},
|
||||
sortChange(val) {
|
||||
this.queryParams.sort = val.prop;
|
||||
this.queryParams.order = val.order;
|
||||
if (this.queryParams.sort) {
|
||||
this.search();
|
||||
}
|
||||
},
|
||||
filterChange (filters) {
|
||||
for (const key in filters) {
|
||||
if(key.includes('.')) {
|
||||
const val = { };
|
||||
val[key.split('.')[1]] = filters[key][0];
|
||||
this.queryParams.model[key.split('.')[0]] = val;
|
||||
} else {
|
||||
this.queryParams.model[key] = filters[key][0]
|
||||
}
|
||||
}
|
||||
this.search()
|
||||
},
|
||||
cellClick (row, column) {
|
||||
if (column['columnKey'] === "operation") {
|
||||
return;
|
||||
}
|
||||
let flag = false;
|
||||
this.selection.forEach((item)=>{
|
||||
if(item.id === row.id) {
|
||||
flag = true;
|
||||
this.$refs.table.toggleRowSelection(row);
|
||||
}
|
||||
})
|
||||
|
||||
if(!flag){
|
||||
this.$refs.table.toggleRowSelection(row, true);
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
Reference in New Issue
Block a user