26 changed files with 833 additions and 1761 deletions
@ -0,0 +1,207 @@ |
|||
<template> |
|||
<div class="search"> |
|||
<Card> |
|||
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" ref="table" |
|||
sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table> |
|||
<Row type="flex" justify="end" class="page"> |
|||
<Page :current="searchForm.pageNum" :total="total" :page-size="searchForm.pageSize" |
|||
@on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" |
|||
size="small" show-total show-elevator show-sizer></Page> |
|||
</Row> |
|||
</Card> |
|||
</div> |
|||
|
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
deleteComment, |
|||
getCommentList |
|||
} from "@/api/app"; |
|||
import "viewerjs/dist/viewer.css"; |
|||
import Viewer from "viewerjs"; |
|||
export default { |
|||
name: "logisticsAddress", |
|||
components: { |
|||
|
|||
}, |
|||
data() { |
|||
return { |
|||
tableSize: "default", |
|||
loading: true, // 表单加载状态 |
|||
searchForm: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
picture: 0, |
|||
score: 0, |
|||
shopId: "" |
|||
}, |
|||
selectList: [], // 多选数据 |
|||
columns: [ |
|||
{ |
|||
type: "index", |
|||
width: 60, |
|||
align: "center", |
|||
}, |
|||
{ |
|||
title: "评价用户", |
|||
key: "createByName", |
|||
minWidth: 125, |
|||
}, |
|||
{ |
|||
title: "评价时间", |
|||
key: "createTime", |
|||
minWidth: 125, |
|||
render: (h, params) => { |
|||
return h( |
|||
"div", |
|||
this.formatDateTime(params.row.createTime) |
|||
); |
|||
} |
|||
}, |
|||
{ |
|||
title: "星级", |
|||
key: "score", |
|||
minWidth: 125, |
|||
}, |
|||
{ |
|||
title: "评价", |
|||
key: "remark", |
|||
minWidth: 125, |
|||
}, |
|||
{ |
|||
title: "评价图", |
|||
key: "picture", |
|||
minWidth: 125, |
|||
render: (h, params) => { |
|||
|
|||
return h("img", { |
|||
attrs: { |
|||
src: params.row.picture, |
|||
}, |
|||
style: { |
|||
cursor: "zoom-in", |
|||
width: "80px", |
|||
height: "60px", |
|||
margin: "10px 0", |
|||
"object-fit": "contain", |
|||
}, |
|||
on: { |
|||
click: () => { |
|||
this.showPic(params.row.picture); |
|||
}, |
|||
}, |
|||
}); |
|||
}, |
|||
}, |
|||
{ |
|||
title: "操作", |
|||
key: "action", |
|||
width: 200, |
|||
align: "center", |
|||
fixed: "right", |
|||
render: (h, params) => { |
|||
return h("div", [ |
|||
h( |
|||
"a", { |
|||
on: { |
|||
click: () => { |
|||
this.remove(params.row); |
|||
}, |
|||
}, |
|||
}, |
|||
"删除" |
|||
), |
|||
]); |
|||
}, |
|||
}, |
|||
], |
|||
data: [], // 表单数据 |
|||
total: 0, // 表单数据总数 |
|||
}; |
|||
}, |
|||
methods: { |
|||
initRecharge(data) { |
|||
//data是父组件弹窗传递过来的值,我们可以打印看看 |
|||
console.log(data); |
|||
this.searchForm.shopId = data.workerId; |
|||
this.getDataList(); |
|||
}, |
|||
changePage(v) { |
|||
this.searchForm.pageNum = v; |
|||
this.getDataList(); |
|||
}, |
|||
changePageSize(v) { |
|||
this.searchForm.pageSize = v; |
|||
this.getDataList(); |
|||
}, |
|||
remove(v) { |
|||
this.$Modal.confirm({ |
|||
title: "确认删除", |
|||
content: "您确认要删除该评论吗?", |
|||
loading: true, |
|||
onOk: () => { |
|||
deleteComment({ |
|||
orderId: v.id |
|||
}).then((res) => { |
|||
this.$Modal.remove(); |
|||
if (res.success) { |
|||
this.$Message.success("删除成功"); |
|||
this.getDataList(); |
|||
} |
|||
}); |
|||
}, |
|||
}); |
|||
}, |
|||
showPic(v) { |
|||
if(v == ''){ |
|||
this.$Message.warning("没有评价图");return |
|||
} |
|||
let image = new Image(); |
|||
image.src = v; |
|||
let viewer = new Viewer(image, { |
|||
hidden: function() { |
|||
viewer.destroy(); |
|||
}, |
|||
}); |
|||
viewer.show(); |
|||
}, |
|||
formatDateTime(isoString) { |
|||
if (!isoString) return '' |
|||
const date = new Date(isoString) |
|||
const year = date.getFullYear() |
|||
const month = String(date.getMonth() + 1).padStart(2, '0') |
|||
const day = String(date.getDate()).padStart(2, '0') |
|||
const hours = String(date.getHours()).padStart(2, '0') |
|||
const minutes = String(date.getMinutes()).padStart(2, '0') |
|||
const seconds = String(date.getSeconds()).padStart(2, '0') |
|||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}` |
|||
}, |
|||
changeSort(e) { |
|||
this.searchForm.sort = e.key; |
|||
this.searchForm.order = e.order; |
|||
if (e.order === "normal") { |
|||
this.searchForm.order = ""; |
|||
} |
|||
this.getDataList(); |
|||
}, |
|||
changeSelect(e) { |
|||
this.selectList = e; |
|||
}, |
|||
getDataList(params) { |
|||
this.loading = true; |
|||
// 带多条件搜索参数获取表单数据 请自行修改接口 |
|||
getCommentList(this.searchForm).then((res) => { |
|||
this.loading = false; |
|||
if (res.code == 200) { |
|||
this.data = res.result.records; |
|||
this.total = res.result.total; |
|||
} |
|||
}); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
<style lang="less"> |
|||
//@import "@/styles/table-common.less"; |
|||
</style> |
|||
@ -1,264 +0,0 @@ |
|||
<template> |
|||
<div class="company-edit"> |
|||
<!-- Drawer抽屉 --> |
|||
<Drawer |
|||
:title="title" |
|||
v-model="visible" |
|||
width="500" |
|||
draggable |
|||
:mask-closable="type == '0'" |
|||
> |
|||
<div :style="{ maxHeight: maxHeight }" class="drawer-content"> |
|||
<div class="drawer-header"> |
|||
<div style="margin-right: 16px">送车配置</div> |
|||
</div> |
|||
<Form label-colon v-show="type != '2'"> |
|||
<Row :gutter="32"> |
|||
<Col span="24"> |
|||
<FormItem label="车牌号"> |
|||
{{ form.companyName }} |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
</Form> |
|||
<Form |
|||
ref="form" |
|||
:model="form" |
|||
:rules="formValidate" |
|||
label-position="top" |
|||
> |
|||
<Row :gutter="32" v-if="type == '2'"> |
|||
<Col span="24"> |
|||
<FormItem label="车牌号" prop="companyName"> |
|||
<Input v-model="form.companyName" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="12"> |
|||
<FormItem label="联系人" prop="contacts"> |
|||
<Input v-model="form.contacts" /> |
|||
</FormItem> |
|||
</Col> |
|||
<Col span="12"> |
|||
<FormItem label="手机号" prop="mobile"> |
|||
<Input v-model="form.mobile" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="24"> |
|||
<FormItem label="所在地区" prop="companyAddress"> |
|||
<al-cascader |
|||
v-model="form.companyAddress" |
|||
data-type="name" |
|||
level="2" |
|||
transfer |
|||
/> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="24"> |
|||
<FormItem label="详细地址" prop="companyStreet"> |
|||
<Input v-model="form.companyStreet" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="12"> |
|||
<FormItem label="商圈区域" prop="region"> |
|||
<region-tree-choose |
|||
@on-change="handleSelectRegion" |
|||
ref="regionTree" |
|||
></region-tree-choose> |
|||
</FormItem> |
|||
</Col> |
|||
<Col span="12"> |
|||
<FormItem label="返佣金额" prop="rebateAmount"> |
|||
<Input v-model="form.rebateAmount" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="12"> |
|||
<FormItem label="当次缴纳" prop="depoNum"> |
|||
<Input v-model="form.depoNum" /> |
|||
</FormItem> |
|||
</Col> |
|||
<Col span="12"> |
|||
<FormItem label="押金余额" prop="depoBal"> |
|||
<Input v-model="form.depoBal" :disabled="true"/> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="24"> |
|||
<FormItem label="送车信息收费标准说明"> |
|||
<Input type="textarea" v-model="form.remark" :rows="4" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
</Form> |
|||
</div> |
|||
<div class="drawer-footer br" v-show="type != '0'"> |
|||
<Button type="primary" :loading="submitLoading" @click="submit" |
|||
>提交</Button |
|||
> |
|||
<Button @click="visible = false">取消</Button> |
|||
</div> |
|||
</Drawer> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { addLogiticsCompany, editLogiticsCompany } from "@/api/app"; |
|||
import dict from "@/views/my-components/hiver/dict"; |
|||
import uploadPicInput from "@/views/my-components/hiver/upload-pic-input"; |
|||
import regionTreeChoose from "@/views/my-components/hiver/region-tree-choose"; |
|||
export default { |
|||
name: "company", |
|||
components: { |
|||
dict, |
|||
uploadPicInput, |
|||
regionTreeChoose |
|||
}, |
|||
props: { |
|||
value: { |
|||
type: Boolean, |
|||
default: false, |
|||
}, |
|||
data: { |
|||
type: Object, |
|||
}, |
|||
type: { |
|||
type: String, |
|||
default: "0", |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
roleList: [], |
|||
visible: this.value, |
|||
title: "", |
|||
data:[], |
|||
passColor: "", |
|||
submitLoading: false, |
|||
maxHeight: 510, |
|||
form: { |
|||
companyAddress: [], |
|||
companyStreet: '', |
|||
}, |
|||
formValidate: { |
|||
// 表单验证规则 |
|||
companyName: [ |
|||
{ required: true, message: "请输入车牌号", trigger: "change" }, |
|||
], |
|||
contacts: [ |
|||
{ required: true, message: "请输入联系人", trigger: "change" }, |
|||
], |
|||
mobile: [ |
|||
{ required: true, message: "请输入手机号", trigger: "change" }, |
|||
], |
|||
}, |
|||
}; |
|||
}, |
|||
methods: { |
|||
init() { |
|||
|
|||
}, |
|||
changePass(v, grade, strength) { |
|||
this.form.password = strength; |
|||
}, |
|||
submit() { |
|||
|
|||
this.$refs.form.validate((valid) => { |
|||
if (valid) { |
|||
if (this.type == "1") { |
|||
// 编辑 |
|||
this.submitLoading = true; |
|||
editLogiticsCompany(this.form).then((res) => { |
|||
this.submitLoading = false; |
|||
if (res.success) { |
|||
this.$Message.success("操作成功"); |
|||
this.$emit("on-submit", true); |
|||
this.visible = false; |
|||
} |
|||
}); |
|||
} else { |
|||
// 添加 |
|||
this.submitLoading = true; |
|||
addLogiticsCompany(this.form).then((res) => { |
|||
this.submitLoading = false; |
|||
if (res.success) { |
|||
this.$Message.success("操作成功"); |
|||
this.$emit("on-submit", true); |
|||
this.visible = false; |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
handleSelectRegion(v) { |
|||
this.form.region = v; |
|||
}, |
|||
setCurrentValue(value) { |
|||
if (value === this.visible) { |
|||
return; |
|||
} |
|||
if (this.type == "1") { |
|||
this.title = "编辑送车信息"; |
|||
this.maxHeight = |
|||
Number(document.documentElement.clientHeight - 121) + "px"; |
|||
} else if (this.type == "2") { |
|||
this.title = "添加送车信息"; |
|||
this.maxHeight = |
|||
Number(document.documentElement.clientHeight - 121) + "px"; |
|||
} else { |
|||
this.title = "送车信息详情"; |
|||
this.maxHeight = "100%"; |
|||
} |
|||
// 清空数据 |
|||
this.$refs.form.resetFields(); |
|||
if (this.type == "0" || this.type == "1") { |
|||
// 回显数据 |
|||
let data = this.data; |
|||
// 地址 |
|||
if (data.companyAddress) { |
|||
data.companyAddress = data.companyAddress.split(","); |
|||
} else { |
|||
data.companyAddress = []; |
|||
} |
|||
// 商圈 |
|||
this.$refs.regionTree.setData(data.region, data.regionTitle); |
|||
// 回显 |
|||
this.form = data; |
|||
} else { |
|||
// 添加 |
|||
this.form = { |
|||
companyAddress: [], |
|||
signCompany: "4", |
|||
}; |
|||
} |
|||
this.visible = value; |
|||
}, |
|||
}, |
|||
watch: { |
|||
value(val) { |
|||
this.setCurrentValue(val); |
|||
}, |
|||
visible(value) { |
|||
this.$emit("input", value); |
|||
}, |
|||
}, |
|||
mounted() { |
|||
this.init(); |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="less"> |
|||
@import "@/styles/drawer-common.less"; |
|||
</style> |
|||
|
|||
@ -1,181 +0,0 @@ |
|||
<template> |
|||
<div class="company-edit"> |
|||
<!-- Drawer抽屉 --> |
|||
<Drawer :title="title" v-model="visible" width="500" draggable :mask-closable="type == '0'"> |
|||
<div :style="{ maxHeight: maxHeight }" class="drawer-content"> |
|||
<div class="drawer-header"> |
|||
<div style="margin-right: 16px">楼栋配置</div> |
|||
</div> |
|||
<Form label-colon> |
|||
<Row :gutter="32"> |
|||
<Col span="24"> |
|||
<FormItem label="楼栋名称" prop="companyName"> |
|||
<Input v-model="form.name" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
</Form> |
|||
<Form ref="form" :model="form" :rules="formValidate" label-position="top"> |
|||
<Row :gutter="32"> |
|||
<Col span="24"> |
|||
<FormItem label="学校id" prop="companyName"> |
|||
<Input v-model="form.schoolId" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="24"> |
|||
<FormItem label="排序" prop="companyTel"> |
|||
<Input v-model="form.orderByField" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="24"> |
|||
<FormItem label="备注"> |
|||
<Input type="textarea" v-model="form.remark" :rows="4" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
</Form> |
|||
</div> |
|||
<div class="drawer-footer br" v-show="type != '0'"> |
|||
<Button type="primary" :loading="submitLoading" @click="submit">提交</Button> |
|||
<Button @click="visible = false">取消</Button> |
|||
</div> |
|||
</Drawer> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
addLogiticsCompany, |
|||
editLogiticsCompany |
|||
} from "@/api/app"; |
|||
import dict from "@/views/my-components/hiver/dict"; |
|||
import uploadPicInput from "@/views/my-components/hiver/upload-pic-input"; |
|||
import regionTreeChoose from "@/views/my-components/hiver/region-tree-choose"; |
|||
export default { |
|||
name: "expressCompany", |
|||
components: { |
|||
dict, |
|||
uploadPicInput, |
|||
regionTreeChoose |
|||
}, |
|||
props: { |
|||
value: { |
|||
type: Boolean, |
|||
default: false, |
|||
}, |
|||
data: { |
|||
type: Object, |
|||
}, |
|||
type: { |
|||
type: String, |
|||
default: "0", |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
roleList: [], |
|||
visible: this.value, |
|||
title: "", |
|||
passColor: "", |
|||
submitLoading: false, |
|||
maxHeight: 510, |
|||
form: { |
|||
orderByField: '', |
|||
name: '', |
|||
remark: '', |
|||
schoolId: '' |
|||
}, |
|||
formValidate: { |
|||
// 表单验证规则 |
|||
name: [{ |
|||
required: true, |
|||
message: "请输入名称", |
|||
trigger: "change" |
|||
}, ] |
|||
}, |
|||
}; |
|||
}, |
|||
methods: { |
|||
init() { |
|||
|
|||
}, |
|||
handleSelectRegion(v) { |
|||
this.form.region = v; |
|||
}, |
|||
submit() { |
|||
this.$refs.form.validate((valid) => { |
|||
if (valid) { |
|||
if (this.type == "1") { |
|||
// 编辑 |
|||
this.submitLoading = true; |
|||
editLogiticsCompany(this.form).then((res) => { |
|||
this.submitLoading = false; |
|||
if (res.success) { |
|||
this.$Message.success("操作成功"); |
|||
this.$emit("on-submit", true); |
|||
this.visible = false; |
|||
} |
|||
}); |
|||
} else { |
|||
// 添加 |
|||
this.submitLoading = true; |
|||
addLogiticsCompany(this.form).then((res) => { |
|||
this.submitLoading = false; |
|||
if (res.success) { |
|||
this.$Message.success("操作成功"); |
|||
this.$emit("on-submit", true); |
|||
this.visible = false; |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
setCurrentValue(value) { |
|||
if (value === this.visible) { |
|||
return; |
|||
} |
|||
if (this.type == "1") { |
|||
this.title = "编辑楼栋"; |
|||
this.maxHeight = |
|||
Number(document.documentElement.clientHeight - 121) + "px"; |
|||
} else if (this.type == "2") { |
|||
this.title = "添加新楼栋"; |
|||
this.maxHeight = |
|||
Number(document.documentElement.clientHeight - 121) + "px"; |
|||
} |
|||
// 清空数据 |
|||
this.$refs.form.resetFields(); |
|||
if (this.type == "1") { |
|||
// 回显数据 |
|||
let data = this.data; |
|||
|
|||
// 回显 |
|||
this.form = data; |
|||
} else { |
|||
|
|||
} |
|||
this.visible = value; |
|||
}, |
|||
}, |
|||
watch: { |
|||
value(val) { |
|||
this.setCurrentValue(val); |
|||
}, |
|||
visible(value) { |
|||
this.$emit("input", value); |
|||
}, |
|||
}, |
|||
mounted() { |
|||
this.init(); |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="less"> |
|||
@import "@/styles/drawer-common.less"; |
|||
</style> |
|||
@ -1,312 +0,0 @@ |
|||
<template> |
|||
<div class="company-edit"> |
|||
<!-- Drawer抽屉 --> |
|||
<Drawer |
|||
:title="title" |
|||
v-model="visible" |
|||
width="500" |
|||
draggable |
|||
:mask-closable="type == '0'" |
|||
> |
|||
<div :style="{ maxHeight: maxHeight }" class="drawer-content"> |
|||
<div class="drawer-header"> |
|||
<div style="margin-right: 16px">公司配置</div> |
|||
</div> |
|||
<Form label-colon v-show="type != '2'"> |
|||
<Row :gutter="32"> |
|||
<Col span="24"> |
|||
<FormItem label="公司名称"> |
|||
{{ form.companyName }} |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
</Form> |
|||
<Form |
|||
ref="form" |
|||
:model="form" |
|||
:rules="formValidate" |
|||
label-position="top" |
|||
> |
|||
<Row :gutter="32" v-if="type == '2'"> |
|||
<Col span="24"> |
|||
<FormItem label="公司名称" prop="companyName"> |
|||
<Input v-model="form.companyName" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="12"> |
|||
<FormItem label="登录账号" prop="username"> |
|||
<Input v-model="form.username" /> |
|||
</FormItem> |
|||
</Col> |
|||
<Col span="12"> |
|||
<FormItem label="登录密码" prop="password"> |
|||
<SetPassword v-model="form.password" @on-change="changePass" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="12"> |
|||
<FormItem label="公司电话" prop="companyTel"> |
|||
<Input v-model="form.companyTel" /> |
|||
</FormItem> |
|||
</Col> |
|||
<Col span="12"> |
|||
<FormItem label="公司邮箱" prop="companyEmail"> |
|||
<Input v-model="form.companyEmail" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="24"> |
|||
<FormItem label="所在地区" prop="companyAddress"> |
|||
<al-cascader |
|||
v-model="form.companyAddress" |
|||
data-type="name" |
|||
level="2" |
|||
transfer |
|||
/> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="24"> |
|||
<FormItem label="详细地址" prop="companyStreet"> |
|||
<Input v-model="form.companyStreet" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="12"> |
|||
<FormItem label="联系人" prop="contacts"> |
|||
<Input v-model="form.contacts" /> |
|||
</FormItem> |
|||
</Col> |
|||
<Col span="12"> |
|||
<FormItem label="手机号" prop="mobile"> |
|||
<Input v-model="form.mobile" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="12"> |
|||
<FormItem label="商圈区域" prop="region"> |
|||
<region-tree-choose |
|||
@on-change="handleSelectRegion" |
|||
ref="regionTree" |
|||
></region-tree-choose> |
|||
</FormItem> |
|||
</Col> |
|||
<Col span="12"> |
|||
<FormItem label="返佣金额" prop="rebateAmount"> |
|||
<Input v-model="form.rebateAmount" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="12"> |
|||
<FormItem label="当次缴纳" prop="depoNum"> |
|||
<Input v-model="form.depoNum" /> |
|||
</FormItem> |
|||
</Col> |
|||
<Col span="12"> |
|||
<FormItem label="押金余额" prop="depoBal"> |
|||
<Input v-model="form.depoBal" :disabled="true"/> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="24"> |
|||
<FormItem label="是否支持上门取货" prop="canToDoor"> |
|||
<i-switch |
|||
size="large" |
|||
v-model="form.canToDoor" |
|||
:true-value="1" |
|||
:false-value="0" |
|||
> |
|||
<span slot="open">是</span> |
|||
<span slot="close">否</span> |
|||
</i-switch> |
|||
</FormItem> |
|||
</Col> |
|||
<Col span="12"> |
|||
<FormItem label="押金余额" prop="depoBal"> |
|||
<Input v-model="form.depoBal" :disabled="true"/> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="24"> |
|||
<FormItem label="物流公司收费标准说明"> |
|||
<Input type="textarea" v-model="form.remark" :rows="4" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
</Form> |
|||
</div> |
|||
<div class="drawer-footer br" v-show="type != '0'"> |
|||
<Button type="primary" :loading="submitLoading" @click="submit" |
|||
>提交</Button |
|||
> |
|||
<Button @click="visible = false">取消</Button> |
|||
</div> |
|||
</Drawer> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { addLogiticsCompany, editLogiticsCompany } from "@/api/app"; |
|||
import dict from "@/views/my-components/hiver/dict"; |
|||
import uploadPicInput from "@/views/my-components/hiver/upload-pic-input"; |
|||
import regionTreeChoose from "@/views/my-components/hiver/region-tree-choose"; |
|||
export default { |
|||
name: "company", |
|||
components: { |
|||
dict, |
|||
uploadPicInput, |
|||
regionTreeChoose |
|||
}, |
|||
props: { |
|||
value: { |
|||
type: Boolean, |
|||
default: false, |
|||
}, |
|||
data: { |
|||
type: Object, |
|||
}, |
|||
type: { |
|||
type: String, |
|||
default: "0", |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
roleList: [], |
|||
visible: this.value, |
|||
title: "", |
|||
data:[], |
|||
passColor: "", |
|||
submitLoading: false, |
|||
maxHeight: 510, |
|||
form: { |
|||
companyAddress: [], |
|||
companyStreet: '', |
|||
}, |
|||
formValidate: { |
|||
// 表单验证规则 |
|||
companyName: [ |
|||
{ required: true, message: "请输入公司名称", trigger: "change" }, |
|||
], |
|||
contacts: [ |
|||
{ required: true, message: "请输入联系人", trigger: "change" }, |
|||
], |
|||
mobile: [ |
|||
{ required: true, message: "请输入手机号", trigger: "change" }, |
|||
], |
|||
}, |
|||
}; |
|||
}, |
|||
methods: { |
|||
init() { |
|||
|
|||
}, |
|||
changePass(v, grade, strength) { |
|||
this.form.password = strength; |
|||
}, |
|||
submit() { |
|||
|
|||
this.$refs.form.validate((valid) => { |
|||
if (valid) { |
|||
if (this.type == "1") { |
|||
// 编辑 |
|||
this.submitLoading = true; |
|||
editLogiticsCompany(this.form).then((res) => { |
|||
this.submitLoading = false; |
|||
if (res.success) { |
|||
this.$Message.success("操作成功"); |
|||
this.$emit("on-submit", true); |
|||
this.visible = false; |
|||
} |
|||
}); |
|||
} else { |
|||
// 添加 |
|||
this.submitLoading = true; |
|||
this.form.companyAddress = JSON.stringify(this.form.companyAddress) |
|||
this.form.signCompany = "0" |
|||
console.log(this.form) |
|||
|
|||
addLogiticsCompany(this.form).then((res) => { |
|||
this.submitLoading = false; |
|||
if (res.success) { |
|||
this.$Message.success("操作成功"); |
|||
this.$emit("on-submit", true); |
|||
this.visible = false; |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
handleSelectRegion(v) { |
|||
this.form.region = v; |
|||
}, |
|||
setCurrentValue(value) { |
|||
if (value === this.visible) { |
|||
return; |
|||
} |
|||
if (this.type == "1") { |
|||
this.title = "编辑物流公司"; |
|||
this.maxHeight = |
|||
Number(document.documentElement.clientHeight - 121) + "px"; |
|||
} else if (this.type == "2") { |
|||
this.title = "添加物流公司"; |
|||
this.maxHeight = |
|||
Number(document.documentElement.clientHeight - 121) + "px"; |
|||
} else { |
|||
this.title = "物流公司详情"; |
|||
this.maxHeight = "100%"; |
|||
} |
|||
// 清空数据 |
|||
this.$refs.form.resetFields(); |
|||
if (this.type == "0" || this.type == "1") { |
|||
// 回显数据 |
|||
let data = this.data; |
|||
// 地址 |
|||
if (data.companyAddress) { |
|||
data.companyAddress = data.companyAddress.split(","); |
|||
} else { |
|||
data.companyAddress = []; |
|||
} |
|||
// 商圈 |
|||
this.$refs.regionTree.setData(data.region, data.regionTitle); |
|||
// 回显 |
|||
this.form = data; |
|||
} else { |
|||
// 添加 |
|||
this.form = { |
|||
companyAddress: [], |
|||
signCompany: "0", |
|||
}; |
|||
} |
|||
this.visible = value; |
|||
}, |
|||
}, |
|||
watch: { |
|||
value(val) { |
|||
this.setCurrentValue(val); |
|||
}, |
|||
visible(value) { |
|||
this.$emit("input", value); |
|||
}, |
|||
}, |
|||
mounted() { |
|||
this.init(); |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="less"> |
|||
@import "@/styles/drawer-common.less"; |
|||
</style> |
|||
|
|||
@ -1,308 +0,0 @@ |
|||
<template> |
|||
<div class="company-edit"> |
|||
<!-- Drawer抽屉 --> |
|||
<Drawer |
|||
:title="title" |
|||
v-model="visible" |
|||
width="500" |
|||
draggable |
|||
:mask-closable="type == '0'" |
|||
> |
|||
<div :style="{ maxHeight: maxHeight }" class="drawer-content"> |
|||
<div class="drawer-header"> |
|||
<div style="margin-right: 16px">公司配置</div> |
|||
</div> |
|||
<Form label-colon v-show="type != '2'"> |
|||
<Row :gutter="32"> |
|||
<Col span="24"> |
|||
<FormItem label="公司名称"> |
|||
{{ form.companyName }} |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
</Form> |
|||
<Form |
|||
ref="form" |
|||
:model="form" |
|||
:rules="formValidate" |
|||
label-position="top" |
|||
> |
|||
<Row :gutter="32" v-if="type == '2'"> |
|||
<Col span="24"> |
|||
<FormItem label="公司名称" prop="companyName"> |
|||
<Input v-model="form.companyName" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="12"> |
|||
<FormItem label="登录账号" prop="username"> |
|||
<Input v-model="form.username" /> |
|||
</FormItem> |
|||
</Col> |
|||
<Col span="12"> |
|||
<FormItem label="登录密码" prop="password"> |
|||
<SetPassword v-model="form.password" @on-change="changePass" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="12"> |
|||
<FormItem label="公司电话" prop="companyTel"> |
|||
<Input v-model="form.companyTel" /> |
|||
</FormItem> |
|||
</Col> |
|||
<Col span="12"> |
|||
<FormItem label="公司邮箱" prop="companyEmail"> |
|||
<Input v-model="form.companyEmail" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="24"> |
|||
<FormItem label="所在地区" prop="companyAddress"> |
|||
<al-cascader |
|||
v-model="form.companyAddress" |
|||
data-type="name" |
|||
level="2" |
|||
transfer |
|||
/> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="24"> |
|||
<FormItem label="详细地址" prop="companyStreet"> |
|||
<Input v-model="form.companyStreet" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="12"> |
|||
<FormItem label="联系人" prop="contacts"> |
|||
<Input v-model="form.contacts" /> |
|||
</FormItem> |
|||
</Col> |
|||
<Col span="12"> |
|||
<FormItem label="手机号" prop="mobile"> |
|||
<Input v-model="form.mobile" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="12"> |
|||
<FormItem label="商圈区域" prop="region"> |
|||
<region-tree-choose |
|||
@on-change="handleSelectRegion" |
|||
ref="regionTree" |
|||
></region-tree-choose> |
|||
</FormItem> |
|||
</Col> |
|||
<Col span="12"> |
|||
<FormItem label="返佣金额" prop="rebateAmount"> |
|||
<Input v-model="form.rebateAmount" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="12"> |
|||
<FormItem label="当次缴纳" prop="depoNum"> |
|||
<Input v-model="form.depoNum" /> |
|||
</FormItem> |
|||
</Col> |
|||
<Col span="12"> |
|||
<FormItem label="押金余额" prop="depoBal"> |
|||
<Input v-model="form.depoBal" :disabled="true"/> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="24"> |
|||
<FormItem label="是否支持上门取货" prop="canToDoor"> |
|||
<i-switch |
|||
size="large" |
|||
v-model="form.canToDoor" |
|||
:true-value="1" |
|||
:false-value="0" |
|||
> |
|||
<span slot="open">是</span> |
|||
<span slot="close">否</span> |
|||
</i-switch> |
|||
</FormItem> |
|||
</Col> |
|||
<Col span="12"> |
|||
<FormItem label="押金余额" prop="depoBal"> |
|||
<Input v-model="form.depoBal" :disabled="true"/> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
<Row :gutter="32"> |
|||
<Col span="24"> |
|||
<FormItem label="物流公司收费标准说明"> |
|||
<Input type="textarea" v-model="form.remark" :rows="4" /> |
|||
</FormItem> |
|||
</Col> |
|||
</Row> |
|||
</Form> |
|||
</div> |
|||
<div class="drawer-footer br" v-show="type != '0'"> |
|||
<Button type="primary" :loading="submitLoading" @click="submit" |
|||
>提交</Button |
|||
> |
|||
<Button @click="visible = false">取消</Button> |
|||
</div> |
|||
</Drawer> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { addLogiticsCompany, editLogiticsCompany } from "@/api/app"; |
|||
import dict from "@/views/my-components/hiver/dict"; |
|||
import uploadPicInput from "@/views/my-components/hiver/upload-pic-input"; |
|||
import regionTreeChoose from "@/views/my-components/hiver/region-tree-choose"; |
|||
export default { |
|||
name: "company", |
|||
components: { |
|||
dict, |
|||
uploadPicInput, |
|||
regionTreeChoose |
|||
}, |
|||
props: { |
|||
value: { |
|||
type: Boolean, |
|||
default: false, |
|||
}, |
|||
data: { |
|||
type: Object, |
|||
}, |
|||
type: { |
|||
type: String, |
|||
default: "0", |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
roleList: [], |
|||
visible: this.value, |
|||
title: "", |
|||
data:[], |
|||
passColor: "", |
|||
submitLoading: false, |
|||
maxHeight: 510, |
|||
form: { |
|||
companyAddress: [], |
|||
companyStreet: '', |
|||
}, |
|||
formValidate: { |
|||
// 表单验证规则 |
|||
companyName: [ |
|||
{ required: true, message: "请输入公司名称", trigger: "change" }, |
|||
], |
|||
contacts: [ |
|||
{ required: true, message: "请输入联系人", trigger: "change" }, |
|||
], |
|||
mobile: [ |
|||
{ required: true, message: "请输入手机号", trigger: "change" }, |
|||
], |
|||
}, |
|||
}; |
|||
}, |
|||
methods: { |
|||
init() { |
|||
|
|||
}, |
|||
changePass(v, grade, strength) { |
|||
this.form.password = strength; |
|||
}, |
|||
submit() { |
|||
|
|||
this.$refs.form.validate((valid) => { |
|||
if (valid) { |
|||
if (this.type == "1") { |
|||
// 编辑 |
|||
this.submitLoading = true; |
|||
editLogiticsCompany(this.form).then((res) => { |
|||
this.submitLoading = false; |
|||
if (res.success) { |
|||
this.$Message.success("操作成功"); |
|||
this.$emit("on-submit", true); |
|||
this.visible = false; |
|||
} |
|||
}); |
|||
} else { |
|||
// 添加 |
|||
this.submitLoading = true; |
|||
addLogiticsCompany(this.form).then((res) => { |
|||
this.submitLoading = false; |
|||
if (res.success) { |
|||
this.$Message.success("操作成功"); |
|||
this.$emit("on-submit", true); |
|||
this.visible = false; |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
handleSelectRegion(v) { |
|||
this.form.region = v; |
|||
}, |
|||
setCurrentValue(value) { |
|||
if (value === this.visible) { |
|||
return; |
|||
} |
|||
if (this.type == "1") { |
|||
this.title = "编辑物流公司"; |
|||
this.maxHeight = |
|||
Number(document.documentElement.clientHeight - 121) + "px"; |
|||
} else if (this.type == "2") { |
|||
this.title = "添加物流公司"; |
|||
this.maxHeight = |
|||
Number(document.documentElement.clientHeight - 121) + "px"; |
|||
} else { |
|||
this.title = "物流公司详情"; |
|||
this.maxHeight = "100%"; |
|||
} |
|||
// 清空数据 |
|||
this.$refs.form.resetFields(); |
|||
if (this.type == "0" || this.type == "1") { |
|||
// 回显数据 |
|||
let data = this.data; |
|||
// 地址 |
|||
if (data.companyAddress) { |
|||
data.companyAddress = data.companyAddress.split(","); |
|||
} else { |
|||
data.companyAddress = []; |
|||
} |
|||
// 商圈 |
|||
this.$refs.regionTree.setData(data.region, data.regionTitle); |
|||
// 回显 |
|||
this.form = data; |
|||
} else { |
|||
// 添加 |
|||
this.form = { |
|||
companyAddress: [], |
|||
signCompany: "0", |
|||
}; |
|||
} |
|||
this.visible = value; |
|||
}, |
|||
}, |
|||
watch: { |
|||
value(val) { |
|||
this.setCurrentValue(val); |
|||
}, |
|||
visible(value) { |
|||
this.$emit("input", value); |
|||
}, |
|||
}, |
|||
mounted() { |
|||
this.init(); |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="less"> |
|||
@import "@/styles/drawer-common.less"; |
|||
</style> |
|||
|
|||
@ -1,227 +1,185 @@ |
|||
<template> |
|||
<!--1.首先,弹窗页面中要有el-dialog组件即弹窗组件,我们把弹窗中的内容放在el-dialog组件中--> |
|||
<!--2.设置:visible.sync属性,动态绑定一个布尔值,通过这个属性来控制弹窗是否弹出--> |
|||
<div class="search"> |
|||
<Card> |
|||
<Table |
|||
:loading="loading" |
|||
border |
|||
:columns="columns" |
|||
:data="data" |
|||
:size="tableSize" |
|||
ref="table" |
|||
sortable="custom" |
|||
@on-sort-change="changeSort" |
|||
@on-selection-change="changeSelect" |
|||
></Table> |
|||
<Row type="flex" justify="end" class="page"> |
|||
<Page |
|||
:current="searchForm.pageNumber" |
|||
:total="total" |
|||
:page-size="searchForm.pageSize" |
|||
@on-change="changePage" |
|||
@on-page-size-change="changePageSize" |
|||
:page-size-opts="[10, 20, 50]" |
|||
size="small" |
|||
show-total |
|||
show-elevator |
|||
show-sizer |
|||
></Page> |
|||
</Row> |
|||
</Card> |
|||
</div> |
|||
|
|||
<!--1.首先,弹窗页面中要有el-dialog组件即弹窗组件,我们把弹窗中的内容放在el-dialog组件中--> |
|||
<!--2.设置:visible.sync属性,动态绑定一个布尔值,通过这个属性来控制弹窗是否弹出--> |
|||
<div class="search"> |
|||
<Card> |
|||
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" ref="table" |
|||
sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table> |
|||
<Row type="flex" justify="end" class="page"> |
|||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" |
|||
@on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" |
|||
size="small" show-total show-elevator show-sizer></Page> |
|||
</Row> |
|||
</Card> |
|||
</div> |
|||
|
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getWorkerRechargeRecord |
|||
} from "@/api/index"; |
|||
import uploadPicInput from "@/views/my-components/hiver/upload-pic-input"; |
|||
import { shortcuts } from "@/libs/shortcuts"; |
|||
export default { |
|||
name: "rechargeOne", |
|||
components: { |
|||
uploadPicInput, |
|||
}, |
|||
data() { |
|||
return { |
|||
tableSize: "default", |
|||
openSearch: true, // 显示搜索 |
|||
openTip: true, // 显示提示 |
|||
loading: true, // 表单加载状态 |
|||
modalType: 0, // 添加或编辑标识 |
|||
modalVisible: false, // 添加或编辑显示 |
|||
modalTitle: "", // 添加或编辑标题 |
|||
searchForm: { |
|||
// 搜索框初始化对象 |
|||
pageNumber: 1, // 当前页数 |
|||
pageSize: 10, // 页面大小 |
|||
sort: "createTime", // 默认排序字段 |
|||
order: "desc", // 默认排序方式 |
|||
startDate: "", // 起始时间 |
|||
endDate: "", // 终止时间 |
|||
}, |
|||
selectDate: null, |
|||
options: { |
|||
shortcuts: shortcuts, |
|||
}, |
|||
form: { |
|||
// 添加或编辑表单对象初始化数据 |
|||
name: "", |
|||
logo: "", |
|||
clientSecret: "", |
|||
homeUri: "", |
|||
redirectUri: "", |
|||
autoApprove: false, |
|||
}, |
|||
submitLoading: false, // 添加或编辑提交状态 |
|||
selectList: [], // 多选数据 |
|||
columns: [ |
|||
{ |
|||
type: "selection", |
|||
width: 60, |
|||
align: "center", |
|||
fixed: "left", |
|||
}, |
|||
{ |
|||
type: "index", |
|||
width: 60, |
|||
align: "center", |
|||
fixed: "left", |
|||
}, |
|||
{ |
|||
title: "充值编号", |
|||
key: "rechargeId", |
|||
minWidth: 125, |
|||
sortable: true, |
|||
fixed: "left", |
|||
}, |
|||
{ |
|||
title: "被充值人名称", |
|||
key: "rechargeName", |
|||
minWidth: 125, |
|||
sortable: true, |
|||
fixed: "left", |
|||
}, |
|||
{ |
|||
title: "被充值人编号", |
|||
key: "rechargeWorkerId", |
|||
minWidth: 125, |
|||
sortable: true, |
|||
fixed: "left", |
|||
}, |
|||
{ |
|||
title: "充值金额", |
|||
key: "rechargeNum", |
|||
minWidth: 125, |
|||
sortable: true, |
|||
fixed: "left", |
|||
}, |
|||
{ |
|||
title: "充值描述", |
|||
key: "rechargeDescribe", |
|||
minWidth: 125, |
|||
sortable: true, |
|||
fixed: "left", |
|||
}, |
|||
{ |
|||
title: "充值时间", |
|||
key: "createTime", |
|||
width: 170, |
|||
sortable: true, |
|||
sortType: "desc", |
|||
}, |
|||
], |
|||
data: [], // 表单数据 |
|||
total: 0, // 表单数据总数 |
|||
rechargeWorkerId: "", |
|||
detailVisible:false, |
|||
}; |
|||
}, |
|||
methods: { |
|||
init() { |
|||
this.getDataList(); |
|||
}, |
|||
initRecharge(data) { |
|||
this.detailVisible=true; |
|||
//data是父组件弹窗传递过来的值,我们可以打印看看 |
|||
console.log(data); |
|||
this.getDataList1(data); |
|||
}, |
|||
changePage(v) { |
|||
this.searchForm.pageNumber = v; |
|||
this.getDataList(); |
|||
this.clearSelectAll(); |
|||
}, |
|||
changePageSize(v) { |
|||
this.searchForm.pageSize = v; |
|||
this.getDataList(); |
|||
}, |
|||
changeSort(e) { |
|||
this.searchForm.sort = e.key; |
|||
this.searchForm.order = e.order; |
|||
if (e.order === "normal") { |
|||
this.searchForm.order = ""; |
|||
} |
|||
this.getDataList(); |
|||
}, |
|||
clearSelectAll() { |
|||
this.$refs.table.selectAll(false); |
|||
}, |
|||
changeSelect(e) { |
|||
this.selectList = e; |
|||
}, |
|||
selectDateRange(v) { |
|||
if (v) { |
|||
this.searchForm.startDate = v[0]; |
|||
this.searchForm.endDate = v[1]; |
|||
} |
|||
}, |
|||
changeTableSize(v) { |
|||
this.tableSize = v; |
|||
}, |
|||
exportData() { |
|||
this.$refs.table.exportCsv({ |
|||
filename: "数据", |
|||
}); |
|||
}, |
|||
getDataList() { |
|||
this.loading = true; |
|||
// 带多条件搜索参数获取表单数据 请自行修改接口 |
|||
getWorkerRechargeRecord(this.searchForm).then((res) => { |
|||
this.loading = false; |
|||
if (res.success) { |
|||
this.data = res.result.content; |
|||
this.total = res.result.totalElements; |
|||
if (this.data.length == 0 && this.searchForm.pageNumber > 1) { |
|||
this.searchForm.pageNumber -= 1; |
|||
this.getDataList(); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
getDataList1(params) { |
|||
this.loading = true; |
|||
// 带多条件搜索参数获取表单数据 请自行修改接口 |
|||
getWorkerRechargeRecord(params).then((res) => { |
|||
this.loading = false; |
|||
if (res.success) { |
|||
this.data = res.result.content; |
|||
this.total = res.result.totalElements; |
|||
if (this.data.length == 0 && this.searchForm.pageNumber > 1) { |
|||
this.searchForm.pageNumber -= 1; |
|||
this.getDataList(); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
}, |
|||
mounted() { |
|||
//this.init(); |
|||
}, |
|||
}; |
|||
import uploadPicInput from "@/views/my-components/hiver/upload-pic-input"; |
|||
import { |
|||
shortcuts |
|||
} from "@/libs/shortcuts"; |
|||
export default { |
|||
name: "rechargeOne", |
|||
components: { |
|||
uploadPicInput, |
|||
}, |
|||
data() { |
|||
return { |
|||
tableSize: "default", |
|||
openSearch: true, // 显示搜索 |
|||
openTip: true, // 显示提示 |
|||
loading: true, // 表单加载状态 |
|||
modalType: 0, // 添加或编辑标识 |
|||
modalVisible: false, // 添加或编辑显示 |
|||
modalTitle: "", // 添加或编辑标题 |
|||
searchForm: { |
|||
// 搜索框初始化对象 |
|||
pageNumber: 1, // 当前页数 |
|||
pageSize: 10, // 页面大小 |
|||
sort: "createTime", // 默认排序字段 |
|||
order: "desc", // 默认排序方式 |
|||
startDate: "", // 起始时间 |
|||
endDate: "", // 终止时间 |
|||
}, |
|||
selectDate: null, |
|||
options: { |
|||
shortcuts: shortcuts, |
|||
}, |
|||
form: { |
|||
// 添加或编辑表单对象初始化数据 |
|||
name: "", |
|||
logo: "", |
|||
clientSecret: "", |
|||
homeUri: "", |
|||
redirectUri: "", |
|||
autoApprove: false, |
|||
}, |
|||
submitLoading: false, // 添加或编辑提交状态 |
|||
selectList: [], // 多选数据 |
|||
columns: [{ |
|||
type: "selection", |
|||
width: 60, |
|||
align: "center", |
|||
fixed: "left", |
|||
}, |
|||
{ |
|||
type: "index", |
|||
width: 60, |
|||
align: "center", |
|||
fixed: "left", |
|||
}, |
|||
{ |
|||
title: "充值编号", |
|||
key: "rechargeId", |
|||
minWidth: 125, |
|||
sortable: true, |
|||
fixed: "left", |
|||
}, |
|||
{ |
|||
title: "被充值人名称", |
|||
key: "rechargeName", |
|||
minWidth: 125, |
|||
sortable: true, |
|||
fixed: "left", |
|||
}, |
|||
{ |
|||
title: "被充值人编号", |
|||
key: "rechargeWorkerId", |
|||
minWidth: 125, |
|||
sortable: true, |
|||
fixed: "left", |
|||
}, |
|||
{ |
|||
title: "充值金额", |
|||
key: "rechargeNum", |
|||
minWidth: 125, |
|||
sortable: true, |
|||
fixed: "left", |
|||
}, |
|||
{ |
|||
title: "充值描述", |
|||
key: "rechargeDescribe", |
|||
minWidth: 125, |
|||
sortable: true, |
|||
fixed: "left", |
|||
}, |
|||
{ |
|||
title: "充值时间", |
|||
key: "createTime", |
|||
width: 170, |
|||
sortable: true, |
|||
sortType: "desc", |
|||
}, |
|||
], |
|||
data: [], // 表单数据 |
|||
total: 0, // 表单数据总数 |
|||
rechargeWorkerId: "", |
|||
detailVisible: false, |
|||
}; |
|||
}, |
|||
methods: { |
|||
init() { |
|||
this.getDataList(); |
|||
}, |
|||
initRecharge(data) { |
|||
this.detailVisible = true; |
|||
//data是父组件弹窗传递过来的值,我们可以打印看看 |
|||
console.log(data); |
|||
this.getDataList1(data); |
|||
}, |
|||
changePage(v) { |
|||
this.searchForm.pageNumber = v; |
|||
this.getDataList(); |
|||
this.clearSelectAll(); |
|||
}, |
|||
changePageSize(v) { |
|||
this.searchForm.pageSize = v; |
|||
this.getDataList(); |
|||
}, |
|||
changeSort(e) { |
|||
this.searchForm.sort = e.key; |
|||
this.searchForm.order = e.order; |
|||
if (e.order === "normal") { |
|||
this.searchForm.order = ""; |
|||
} |
|||
this.getDataList(); |
|||
}, |
|||
clearSelectAll() { |
|||
this.$refs.table.selectAll(false); |
|||
}, |
|||
changeSelect(e) { |
|||
this.selectList = e; |
|||
}, |
|||
selectDateRange(v) { |
|||
if (v) { |
|||
this.searchForm.startDate = v[0]; |
|||
this.searchForm.endDate = v[1]; |
|||
} |
|||
}, |
|||
changeTableSize(v) { |
|||
this.tableSize = v; |
|||
}, |
|||
exportData() { |
|||
this.$refs.table.exportCsv({ |
|||
filename: "数据", |
|||
}); |
|||
}, |
|||
getDataList() { |
|||
this.loading = true; |
|||
|
|||
}, |
|||
getDataList1(params) { |
|||
this.loading = true; |
|||
|
|||
}, |
|||
}, |
|||
mounted() { |
|||
//this.init(); |
|||
}, |
|||
}; |
|||
</script> |
|||
<style lang="less"> |
|||
//@import "@/styles/table-common.less"; |
|||
//@import "@/styles/table-common.less"; |
|||
</style> |
|||
@ -0,0 +1,209 @@ |
|||
<template> |
|||
<div class="search"> |
|||
<Card> |
|||
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" ref="table" |
|||
sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table> |
|||
<Row type="flex" justify="end" class="page"> |
|||
<Page :current="searchForm.pageNum" :total="total" :page-size="searchForm.pageSize" |
|||
@on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" |
|||
size="small" show-total show-elevator show-sizer></Page> |
|||
</Row> |
|||
</Card> |
|||
</div> |
|||
|
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
deleteComment, |
|||
getCommentList |
|||
} from "@/api/app"; |
|||
import "viewerjs/dist/viewer.css"; |
|||
import Viewer from "viewerjs"; |
|||
export default { |
|||
name: "logisticsAddress", |
|||
components: { |
|||
|
|||
}, |
|||
data() { |
|||
return { |
|||
tableSize: "default", |
|||
loading: true, // 表单加载状态 |
|||
searchForm: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
picture: 0, |
|||
score: 0, |
|||
shopId: "" |
|||
|
|||
}, |
|||
selectList: [], // 多选数据 |
|||
columns: [ |
|||
{ |
|||
type: "index", |
|||
width: 60, |
|||
align: "center", |
|||
}, |
|||
{ |
|||
title: "评价用户", |
|||
key: "createByName", |
|||
minWidth: 125, |
|||
}, |
|||
{ |
|||
title: "评价时间", |
|||
key: "createTime", |
|||
minWidth: 125, |
|||
render: (h, params) => { |
|||
return h( |
|||
"div", |
|||
this.formatDateTime(params.row.createTime) |
|||
); |
|||
} |
|||
}, |
|||
{ |
|||
title: "星级", |
|||
key: "score", |
|||
minWidth: 125, |
|||
}, |
|||
{ |
|||
title: "评价", |
|||
key: "remark", |
|||
minWidth: 125, |
|||
}, |
|||
{ |
|||
title: "评价图", |
|||
key: "picture", |
|||
minWidth: 125, |
|||
render: (h, params) => { |
|||
|
|||
return h("img", { |
|||
attrs: { |
|||
src: params.row.picture, |
|||
}, |
|||
style: { |
|||
cursor: "zoom-in", |
|||
width: "80px", |
|||
height: "60px", |
|||
margin: "10px 0", |
|||
"object-fit": "contain", |
|||
}, |
|||
on: { |
|||
click: () => { |
|||
this.showPic(params.row.picture); |
|||
}, |
|||
}, |
|||
}); |
|||
}, |
|||
}, |
|||
{ |
|||
title: "操作", |
|||
key: "action", |
|||
width: 200, |
|||
align: "center", |
|||
fixed: "right", |
|||
render: (h, params) => { |
|||
return h("div", [ |
|||
h( |
|||
"a", { |
|||
on: { |
|||
click: () => { |
|||
this.remove(params.row); |
|||
}, |
|||
}, |
|||
}, |
|||
"删除" |
|||
), |
|||
]); |
|||
}, |
|||
}, |
|||
], |
|||
data: [], // 表单数据 |
|||
total: 0, // 表单数据总数 |
|||
}; |
|||
}, |
|||
methods: { |
|||
initRecharge(data) { |
|||
//data是父组件弹窗传递过来的值,我们可以打印看看 |
|||
console.log('djdjdjd1',data); |
|||
this.searchForm.shopId = data.id; |
|||
console.log('djdjdjd1',this.searchForm.shopId); |
|||
this.getDataList(); |
|||
}, |
|||
changePage(v) { |
|||
this.searchForm.pageNum = v; |
|||
this.getDataList(); |
|||
}, |
|||
changePageSize(v) { |
|||
this.searchForm.pageSize = v; |
|||
this.getDataList(); |
|||
}, |
|||
remove(v) { |
|||
this.$Modal.confirm({ |
|||
title: "确认删除", |
|||
content: "您确认要删除该评论吗?", |
|||
loading: true, |
|||
onOk: () => { |
|||
deleteComment({ |
|||
orderId: v.id |
|||
}).then((res) => { |
|||
this.$Modal.remove(); |
|||
if (res.success) { |
|||
this.$Message.success("删除成功"); |
|||
this.getDataList(); |
|||
} |
|||
}); |
|||
}, |
|||
}); |
|||
}, |
|||
showPic(v) { |
|||
if(v == ''){ |
|||
this.$Message.warning("没有评价图");return |
|||
} |
|||
let image = new Image(); |
|||
image.src = v; |
|||
let viewer = new Viewer(image, { |
|||
hidden: function() { |
|||
viewer.destroy(); |
|||
}, |
|||
}); |
|||
viewer.show(); |
|||
}, |
|||
formatDateTime(isoString) { |
|||
if (!isoString) return '' |
|||
const date = new Date(isoString) |
|||
const year = date.getFullYear() |
|||
const month = String(date.getMonth() + 1).padStart(2, '0') |
|||
const day = String(date.getDate()).padStart(2, '0') |
|||
const hours = String(date.getHours()).padStart(2, '0') |
|||
const minutes = String(date.getMinutes()).padStart(2, '0') |
|||
const seconds = String(date.getSeconds()).padStart(2, '0') |
|||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}` |
|||
}, |
|||
changeSort(e) { |
|||
this.searchForm.sort = e.key; |
|||
this.searchForm.order = e.order; |
|||
if (e.order === "normal") { |
|||
this.searchForm.order = ""; |
|||
} |
|||
this.getDataList(); |
|||
}, |
|||
changeSelect(e) { |
|||
this.selectList = e; |
|||
}, |
|||
getDataList(params) { |
|||
this.loading = true; |
|||
// 带多条件搜索参数获取表单数据 请自行修改接口 |
|||
getCommentList(this.searchForm).then((res) => { |
|||
this.loading = false; |
|||
if (res.code == 200) { |
|||
this.data = res.result.records; |
|||
this.total = res.result.total; |
|||
} |
|||
}); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
<style lang="less"> |
|||
//@import "@/styles/table-common.less"; |
|||
</style> |
|||
Loading…
Reference in new issue