提交 404dfe66 编写于 作者: 钟一霄's avatar 钟一霄

钥匙借还记录、其他bug修正、优化调整

上级 41377805
...@@ -16,12 +16,12 @@ ...@@ -16,12 +16,12 @@
ref="form" ref="form"
label-colon label-colon
:model="formData" :model="formData"
:rules="rules" :rules="formRule"
:label-width="formLabelWidth"> :label-width="formLabelWidth">
<!-- 新增 / 编辑 --> <!-- 新增 / 编辑 -->
<Row v-if="!isDetails"> <Row v-if="!isDetails">
<Col v-bind="grid" v-for="item in formItem.filter(a => a.type != 'file' && (!a.hasOwnProperty('show') || a.show))" :key="item.id"> <Col v-bind="grid" v-for="item in formItem.filter(a => a.type != 'file' && (!a.hasOwnProperty('show') || a.show))" :key="item.id">
<FormItem :label="item.name" :prop="item.name"> <FormItem :label="item.name" :prop="item.id">
<Input <Input
v-if="item.type == 'input'" v-if="item.type == 'input'"
v-model="formData[item.id]" v-model="formData[item.id]"
...@@ -67,6 +67,14 @@ ...@@ -67,6 +67,14 @@
v-model="formData[item['id']]" v-model="formData[item['id']]"
:true-value="1" :true-value="1"
:false-value="0"/> :false-value="0"/>
<TimePicker
v-else-if="item.type == 'timerange'"
v-model="formData[item['id']]"
format="HH:mm"
type="timerange"
placement="bottom-end"
placeholder="请选择时间"/>
</FormItem> </FormItem>
</Col> </Col>
<!-- 文件类型 --> <!-- 文件类型 -->
...@@ -180,7 +188,6 @@ export default { ...@@ -180,7 +188,6 @@ export default {
// 表单数据 // 表单数据
formData: {}, formData: {},
rules: {},
grid: { grid: {
xl: 12, xl: 12,
...@@ -214,6 +221,13 @@ export default { ...@@ -214,6 +221,13 @@ export default {
} else if (addOrEdit == 'edit') { } else if (addOrEdit == 'edit') {
this.modalTitle = '编辑' this.modalTitle = '编辑'
this.formData = cloneDeep(row) this.formData = cloneDeep(row)
// 时间范围处理
let tri = this.formItem.findIndex(a => a.type == 'timerange')
if (tri != -1) {
let id = this.formItem[tri].id
this.formData[id] = this.formData[id].split('-')
}
} }
// 设置上传按钮loading // 设置上传按钮loading
...@@ -267,7 +281,22 @@ export default { ...@@ -267,7 +281,22 @@ export default {
}, },
// 提交 // 提交
onSubmit() { onSubmit() {
this.$emit('onSubmit', cloneDeep(this.formData)) this.$refs.form.validate((valid) => {
if (valid) {
let obj = cloneDeep(this.formData)
// 时间范围处理
let tri = this.formItem.findIndex(a => a.type == 'timerange')
if (tri != -1) {
let id = this.formItem[tri].id
obj[id] = obj[id].join('-')
}
this.$emit('onSubmit', obj)
} else {
this.$Message.warning('请检查输入项')
}
})
}, },
}, },
} }
......
...@@ -26,6 +26,14 @@ ...@@ -26,6 +26,14 @@
:key="it.value" :key="it.value"
:value="it.value">{{ it.label }}</Option> :value="it.value">{{ it.label }}</Option>
</Select> </Select>
<DatePicker
v-else-if="item.type == 'datetime'"
v-model="searchCondObj[item['id']]"
type="datetime"
format="yyyy-MM-dd HH:mm"
placeholder="请选择时间"
@on-change="(val1, val2) => datetimeChange(val1, val2, item.id)"/>
</FormItem> </FormItem>
</Col> </Col>
...@@ -76,6 +84,12 @@ export default { ...@@ -76,6 +84,12 @@ export default {
this.searchCondObj = {} this.searchCondObj = {}
this.$emit('onReset') this.$emit('onReset')
}, },
// 日期时间改变选择
datetimeChange(val1, val2, id) {
// console.log('日期时间改变选择', val1, val2, id)
this.searchCondObj[id] = val1
},
}, },
} }
</script> </script>
......
...@@ -320,7 +320,9 @@ export default { ...@@ -320,7 +320,9 @@ export default {
return { return {
// 搜索项 // 搜索项
searchCondList: [ searchCondList: [
{ id: 'name', name: '类型名称', type: 'input', show: true, optList: [] }, { id: 'user_card_name', name: '用户卡号/姓名', type: 'input', show: true, optList: [] },
{ id: 'place_code_name', name: '场地编号/名称', type: 'input', show: true, optList: [] },
{ id: 'place_type_id', name: '场地类型', type: 'select', show: true, optList: [] },
], ],
// 搜索条件 // 搜索条件
params:{ params:{
...@@ -473,12 +475,12 @@ export default { ...@@ -473,12 +475,12 @@ export default {
cmdActiveId: '', cmdActiveId: '',
cmdTableColumns: [ cmdTableColumns: [
{ type: 'index', title: '序号', align: 'center', width: 80, show: true, fixed: 'left' }, { type: 'index', title: '序号', align: 'center', width: 80, show: true, fixed: 'left' },
{ key: 'name', title: '借用人', align: 'center', minWidth: 150, show: true },
{ key: 'card', title: '借用人卡号', align: 'center', minWidth: 150, show: true },
{ key: 'commodity_name', title: '物资名称', align: 'center', minWidth: 250, show: true }, { key: 'commodity_name', title: '物资名称', align: 'center', minWidth: 250, show: true },
{ key: 'parent_id', title: '父级id', align: 'center', minWidth: 300, show: false }, { key: 'parent_id', title: '父级id', align: 'center', minWidth: 300, show: false },
{ key: 'place_type_id', title: '场地类型id', align: 'center', minWidth: 150, show: false }, { key: 'place_type_id', title: '场地类型id', align: 'center', minWidth: 150, show: false },
{ key: 'place_type_name', title: '场地类型', align: 'center', minWidth: 250, show: true }, { key: 'place_type_name', title: '场地类型', align: 'center', minWidth: 250, show: true },
{ key: 'name', title: '借用人', align: 'center', minWidth: 150, show: true },
{ key: 'card', title: '借用人卡号', align: 'center', minWidth: 150, show: true },
// { key: 'is_enable', title: '启用', align: 'center', minWidth: 80, show: true }, // { key: 'is_enable', title: '启用', align: 'center', minWidth: 80, show: true },
{ slot: 'details', title: '操作', align: 'center', minWidth: 100, show: true, fixed: 'right' }, { slot: 'details', title: '操作', align: 'center', minWidth: 100, show: true, fixed: 'right' },
], ],
...@@ -588,6 +590,7 @@ export default { ...@@ -588,6 +590,7 @@ export default {
} }
}) })
this.formItem[this.formItem.findIndex(a => a.id == 'place_type_id')].optList = arr this.formItem[this.formItem.findIndex(a => a.id == 'place_type_id')].optList = arr
this.searchCondList[this.searchCondList.findIndex(a => a.id == 'place_type_id')].optList = arr
}) })
// 获取场地 // 获取场地
this.asc.getApiCommonGetPlaceSelect({id: ''}).then(res => { this.asc.getApiCommonGetPlaceSelect({id: ''}).then(res => {
...@@ -610,6 +613,8 @@ export default { ...@@ -610,6 +613,8 @@ export default {
Object.keys(val).forEach(a => { Object.keys(val).forEach(a => {
if (val[a]) { if (val[a]) {
this.params[a] = val[a] this.params[a] = val[a]
} else {
this.params[a] = ''
} }
}) })
this.onPageChange(1) this.onPageChange(1)
......
...@@ -154,6 +154,8 @@ export default { ...@@ -154,6 +154,8 @@ export default {
Object.keys(val).forEach(a => { Object.keys(val).forEach(a => {
if (val[a]) { if (val[a]) {
this.params[a] = val[a] this.params[a] = val[a]
} else {
this.params[a] = ''
} }
}) })
this.onPageChange(1) this.onPageChange(1)
......
<template>
<div>
<Modal
:title="addOrEdit == 'add' ? '新增' : '修改'"
v-model="visibleShow"
width="40%"
>
<Form :model="formData" :label-width="100" ref="formData" :rules="rules">
<Row :gutter="32">
<Col span="12">
<FormItem label="ddd" prop="a">
<Input v-model="formData.a"/>
</FormItem>
</Col>
</Row>
</Form>
<div class="demo-drawer-footer" v-if="addOrEdit == 'add'">
<Button style="margin-right: 8px" @click="visibleShow = false">取消</Button>
<Button type="primary" @click="addSubmit">确认新增</Button>
</div>
<div class="demo-drawer-footer" v-if="addOrEdit == 'edit'">
<Button style="margin-right: 8px" @click="visibleShow = false">取消</Button>
<Button type="primary" @click="editSubmit">确认修改</Button>
</div>
</Modal>
</div>
</template>
<script>
export default {
data () {
return {
visibleShow: false,
rules: {
class_code: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
class_name: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
college_id: [
{ required: true, message: '不能为空', trigger: 'change' }
],
grade: [
{ required: true, message: '不能为空', trigger: 'change' }
],
training_id: [
{ required: true, message: '不能为空', trigger: 'change' }
],
},
formData: {
a: ''
},
formList:[],
addOrEdit: ''
}
},
mounted() {
this.getData()
},
methods: {
// 初始化
getData(){
},
// 确认新增
addSubmit() {
this.$refs.formData.validate((valid) => {
if(valid) {
this.$Message.success(res)
this.visibleShow = false
this.$emit('getData')
}
})
},
// 确认修改
editSubmit() {
const {status, ...params} = this.formData //从对象中删除status
this.$refs.formData.validate((valid) => {
if(valid) {
}
})
},
// 点击新增
add() {
this.addOrEdit = "add"
this.visibleShow = true
Object.keys(this.formData).forEach(key => this.formData[key] = '') //es6清空对象属性
},
// 点击修改
edit(row) {
this.addOrEdit = "edit"
this.visibleShow = true
this.formData = Object.assign({},row) //es6深拷贝
}
}
}
</script>
<style>
.demo-drawer-footer{
width: 100%;
position: absolute;
bottom: 0;
left: 0;
border-top: 1px solid #e8e8e8;
padding: 12px 16px;
text-align: right;
background: #fff;
}
</style>
\ No newline at end of file
<template>
<Form :label-width="120">
<Row :gutter="32">
<template v-for="(item, index) in formList">
<Col v-bind="grid" :key="item.code" v-if="!!~[0,1].indexOf(index)">
<FormItem :label="`${item.label}:`" >
<Select v-if="item.option_list" clearable @on-clear="getData" placeholder="请选择" v-model="params[item.code]">
<Option :value="items.value" v-for="items in item.option_list" :key="items.label">{{items.label}}</Option>
</Select>
<Input clearable @on-clear="getData" v-if="!item.option_list" placeholder="请输入" v-model="params[item.code]"></Input>
</FormItem>
</Col>
<template v-if="collapse">
<Col v-bind="grid" :key="item.code" v-if="index>=2">
<FormItem :label="`${item.label}:`">
<Select v-if="item.option_list" clearable @on-clear="getData" placeholder="请选择" v-model="params[item.code]">
<Option :value="items.value" v-for="items in item.option_list" :key="items.label">{{items.label}}</Option>
</Select>
<Input clearable @on-clear="getData" v-if="!item.option_list" placeholder="请输入" v-model="params[item.code]"></Input>
</FormItem>
</Col>
</template>
</template>
<Col v-bind="grid" class="ivu-text-right" v-if="formList.length === 0 ? false : true">
<FormItem type="flex" justify="end">
<Button type="primary" @click="getData">查询</Button>
<a v-font="14" class="ivu-ml-8" @click="collapse = !collapse">
<template v-if="!collapse">
展开 <Icon type="ios-arrow-down"/>
</template>
<template v-else>
收起 <Icon type="ios-arrow-up"/>
</template>
</a>
</FormItem>
</Col>
</Row>
</Form>
</template>
<script>
export default {
data () {
return {
grid: {
xl: 8,
lg: 12,
md: 24,
sm: 24,
xs: 24
},
formList:[
{
label: "所属院系",
code: "college_id",
search_type: "select",
is_must: 0,
option_list: [
{
value: "117c96a1-5c8f-4c71-8574-d45ec049db3b",
label: "电气工程系"
}
]
},
{
label: "状态1",
code: "status",
search_type: "select",
is_must: 0,
option_list: [
{
value: "0",
label: "停用"
}
]
},
{
label: "状态2",
code: "status2",
search_type: "select",
is_must: 0,
option_list: [
{
value: "0",
label: "停用"
}
]
},
{
label: "状态3",
code: "status3",
search_type: "select",
is_must: 0,
option_list: [
{
value: "0",
label: "停用"
}
]
}
],
collapse: false,
params:{
pageIndex: 1,
pageSize: 10,
college_id: '',
status: '',
status2: '',
status3: '',
}
}
},
mounted() {
},
methods: {
getData() {
console.log('搜索条件查询');
}
}
}
</script>
\ No newline at end of file
...@@ -97,9 +97,9 @@ export default { ...@@ -97,9 +97,9 @@ export default {
// 搜索项 // 搜索项
searchCondList: [ searchCondList: [
{ id: 'card_name', name: '卡号或姓名', type: 'input', show: true, optList: [] }, { id: 'card_name', name: '卡号或姓名', type: 'input', show: true, optList: [] },
{ id: 'begin_time', name: '开始时间', type: 'input', show: true, optList: [] }, { id: 'begin_time', name: '开始时间', type: 'datetime', show: true, optList: [] },
{ id: 'end_time', name: '结束时间', type: 'input', show: true, optList: [] }, { id: 'end_time', name: '结束时间', type: 'datetime', show: true, optList: [] },
{ id: 'state', name: '状态', type: 'select', show: true, optList: [{value:0,label:'过期'},{value:1,label:'生效'},{value:2,label:'强制取消'}] }, { id: 'state', name: '状态', type: 'select', show: true, optList: [{value:"0",label:'过期'},{value:"1",label:'生效'},{value:"2",label:'强制取消'}] },
], ],
// 搜索条件 // 搜索条件
params:{ params:{
...@@ -141,9 +141,7 @@ export default { ...@@ -141,9 +141,7 @@ export default {
} }
}, },
// 查询条件初始化 // 查询条件初始化
created(){ created(){},
},
mounted(){ mounted(){
this.getData() this.getData()
}, },
...@@ -153,6 +151,8 @@ export default { ...@@ -153,6 +151,8 @@ export default {
Object.keys(val).forEach(a => { Object.keys(val).forEach(a => {
if (val[a]) { if (val[a]) {
this.params[a] = val[a] this.params[a] = val[a]
} else {
this.params[a] = ''
} }
}) })
this.onPageChange(1) this.onPageChange(1)
......
...@@ -107,7 +107,7 @@ export default { ...@@ -107,7 +107,7 @@ export default {
{ id: 'state', name: '是否可借', type: 'select', disabled: true, require: false, optList: [{label:'可借',value:0},{label:'借出',value:1},{label:'维护中',value:2}] }, { id: 'state', name: '是否可借', type: 'select', disabled: true, require: false, optList: [{label:'可借',value:0},{label:'借出',value:1},{label:'维护中',value:2}] },
// { id: 'file_id', name: '附件', type: 'file', disabled: false, require: false, optList: [] }, // { id: 'file_id', name: '附件', type: 'file', disabled: false, require: false, optList: [] },
{ id: 'file_list', name: '附件', type: 'file', disabled: false, require: false, optList: [] }, { id: 'file_list', name: '附件', type: 'file', disabled: false, require: false, optList: [] },
{ id: 'is_enable', name: '启用', type: 'switch', disabled: false, require: false, optList: [] }, { id: 'is_enable', name: '启用', type: 'switch', disabled: false, require: false, optList: [], show: false },
], ],
defaultFormData: { defaultFormData: {
id: "", id: "",
...@@ -115,7 +115,7 @@ export default { ...@@ -115,7 +115,7 @@ export default {
key_name: "", key_name: "",
place_id: "", place_id: "",
place_name: "", place_name: "",
state: 0, state: 2,
is_enable: 0, is_enable: 0,
is_del: 0, is_del: 0,
createby: null, createby: null,
...@@ -149,6 +149,8 @@ export default { ...@@ -149,6 +149,8 @@ export default {
Object.keys(val).forEach(a => { Object.keys(val).forEach(a => {
if (val[a]) { if (val[a]) {
this.params[a] = val[a] this.params[a] = val[a]
} else {
this.params[a] = ''
} }
}) })
this.onPageChange(1) this.onPageChange(1)
......
...@@ -198,6 +198,8 @@ export default { ...@@ -198,6 +198,8 @@ export default {
Object.keys(val).forEach(a => { Object.keys(val).forEach(a => {
if (val[a]) { if (val[a]) {
this.params[a] = val[a] this.params[a] = val[a]
} else {
this.params[a] = ''
} }
}) })
this.onPageChange(1) this.onPageChange(1)
...@@ -308,6 +310,7 @@ export default { ...@@ -308,6 +310,7 @@ export default {
this.$Message.success(res.response) this.$Message.success(res.response)
this.editModalshow = false this.editModalshow = false
this.getData() this.getData()
this.getTreeData()
} else { } else {
this.$Message.error(res.msg_detail) this.$Message.error(res.msg_detail)
} }
...@@ -318,11 +321,12 @@ export default { ...@@ -318,11 +321,12 @@ export default {
// 删除 // 删除
rowDelete(row) { rowDelete(row) {
// console.log('删除', row); // console.log('删除', row);
this.asc.getApiKeyKeyDel({id:row.id, is_del:1}).then(res => { this.asc.getApiCommodityCommodityDel({id:row.id, is_del:1}).then(res => {
// console.log('删除行后', res) // console.log('删除行后', res)
if (res.code == 1) { if (res.code == 1) {
this.$Message.success(res.msg) this.$Message.success(res.msg)
this.getData() this.getData()
this.getTreeData()
} else { } else {
this.$Message.error(res.msg_detail) this.$Message.error(res.msg_detail)
} }
...@@ -351,7 +355,7 @@ export default { ...@@ -351,7 +355,7 @@ export default {
return { return {
...a, ...a,
title: a.commodity_name, title: a.commodity_name,
expand: true, expand: a.id == '1' ? true : false,
selected: false, selected: false,
} }
}) })
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
ref="ceditmodal" ref="ceditmodal"
v-model="editModalshow" v-model="editModalshow"
:formItem="formItem" :formItem="formItem"
:formRule="formRule"
:loading="editModalLoading" :loading="editModalLoading"
:formLabelWidth="100" :formLabelWidth="100"
:width="800" :width="800"
...@@ -60,6 +61,10 @@ ...@@ -60,6 +61,10 @@
@rowDelete="keyRowDelete" @rowDelete="keyRowDelete"
@onPageChange="keyOnPageChange" @onPageChange="keyOnPageChange"
@onPageSizeChange="keyOnPageSizeChange"> @onPageSizeChange="keyOnPageSizeChange">
<!-- 钥匙借还记录 -->
<template #other="{ row }">
<a @click="keyBTRecordsRow(row)">借还记录</a>
</template>
<template #keystate="{ row }"> <template #keystate="{ row }">
<span v-if="row.state == 0">可借</span> <span v-if="row.state == 0">可借</span>
<span v-if="row.state == 1">借出</span> <span v-if="row.state == 1">借出</span>
...@@ -82,6 +87,41 @@ ...@@ -82,6 +87,41 @@
<Button ghost type="info" @click="addKey">添加钥匙</Button> <Button ghost type="info" @click="addKey">添加钥匙</Button>
<Button @click="detailsModalShow = false">关闭</Button> <Button @click="detailsModalShow = false">关闭</Button>
</template> </template>
<!-- 钥匙借还记录表格Modal -->
<Modal
v-model="keyBTRecordsModalShow"
title="钥匙借还记录"
:width="75">
<CTable
:tableColumns="keyBTRecordsTableColumns.filter(a => a.show)"
:tableData="keyBTRecordsTableData"
:tableLoading="keyBTRecordsTableLoading"
:tableSize="tableSize"
:dataCount="keyBTRecordsDataCount"
:pageIndex="keyBTRecordsParams.page_index"
:pageSize="keyBTRecordsParams.page_size"
@onPageChange="keyBTROnPageChange"
@onPageSizeChange="keyBTROnPageSizeChange">
<!-- <template #action="{ row }">
<a @click="keyBTRecordsRowDetails(row)">详情</a>
</template> -->
</CTable>
<!-- 钥匙记录详情Modal -->
<!-- <CEditModal
ref="keybtrceditmodal"
v-model="keyBTRDetailsModalShow"
:formItem="keyBTRDetailsFormItem"
:loading="keyBTRDetailsModalLoading"
:formLabelWidth="100"
:width="800"
@onClose="keyBTRDetailsModalShow = false"></CEditModal> -->
<template #footer>
<Button @click="keyBTRecordsModalShow = false">关闭</Button>
</template>
</Modal>
</Modal> </Modal>
</Card> </Card>
</div> </div>
...@@ -157,9 +197,9 @@ export default { ...@@ -157,9 +197,9 @@ export default {
{ id: 'place_code', name: '编号', type: 'input', disabled: false, require: false, optList: [] }, { id: 'place_code', name: '编号', type: 'input', disabled: false, require: false, optList: [] },
{ id: 'place_name', name: '场地名称', type: 'input', disabled: false, require: false, optList: [] }, { id: 'place_name', name: '场地名称', type: 'input', disabled: false, require: false, optList: [] },
{ id: 'place_type_id', name: '场地类型', type: 'select', disabled: false, require: false, optList: [] }, { id: 'place_type_id', name: '场地类型', type: 'select', disabled: false, require: false, optList: [] },
{ id: 'place_address', name: '场地地址', type: 'input', disabled: false, require: false, optList: [] }, { id: 'place_address', name: '场地地址', type: 'input', disabled: true, require: false, optList: [] },
{ id: 'building', name: '楼栋', type: 'input', disabled: false, require: false, optList: [] }, { id: 'building', name: '楼栋', type: 'input', disabled: false, require: false, optList: [] },
{ id: 'floor', name: '楼', type: 'input', disabled: false, require: false, optList: [] }, { id: 'floor', name: '楼层', type: 'input', disabled: false, require: false, optList: [] },
{ id: 'room', name: '房间', type: 'input', disabled: false, require: false, optList: [] }, { id: 'room', name: '房间', type: 'input', disabled: false, require: false, optList: [] },
{ id: 'acreage', name: '面积', type: 'input', disabled: false, require: false, optList: [] }, { id: 'acreage', name: '面积', type: 'input', disabled: false, require: false, optList: [] },
{ id: 'capacity', name: '容纳人数', type: 'input', disabled: false, require: false, optList: [] }, { id: 'capacity', name: '容纳人数', type: 'input', disabled: false, require: false, optList: [] },
...@@ -173,6 +213,11 @@ export default { ...@@ -173,6 +213,11 @@ export default {
{ id: 'file_list', name: '附件', type: 'file', disabled: false, require: false, optList: [] }, { id: 'file_list', name: '附件', type: 'file', disabled: false, require: false, optList: [] },
{ id: 'is_enable', name: '启用', type: 'switch', disabled: false, require: false, optList: [] }, { id: 'is_enable', name: '启用', type: 'switch', disabled: false, require: false, optList: [] },
], ],
formRule: {
place_code: [{ required: true, message: '编号不能为空', trigger: 'blur' }],
place_name: [{ required: true, message: '场地名称不能为空', trigger: 'blur' }],
place_type_id: [{ required: true, message: '场地类型不能为空', trigger: 'change' }],
},
defaultFormData: { defaultFormData: {
id: "", id: "",
place_code: "", place_code: "",
...@@ -208,6 +253,7 @@ export default { ...@@ -208,6 +253,7 @@ export default {
{ slot: 'keystate', title: '是否可借', align: 'center', minWidth: 100, show: true }, { slot: 'keystate', title: '是否可借', align: 'center', minWidth: 100, show: true },
// { key: 'is_enable', title: '启用', align: 'center', minWidth: 80, show: true }, // { key: 'is_enable', title: '启用', align: 'center', minWidth: 80, show: true },
{ slot: 'generalSwitch', title: '启用', align: 'center', minWidth: 80, show: true }, { slot: 'generalSwitch', title: '启用', align: 'center', minWidth: 80, show: true },
{ slot: 'other', title: '其他', align: 'center', minWidth: 100, show: true, fixed: 'right' },
{ slot: 'action', title: '操作', align: 'center', minWidth: 150, show: true, fixed: 'right' }, { slot: 'action', title: '操作', align: 'center', minWidth: 150, show: true, fixed: 'right' },
], ],
detailsTableData: [], detailsTableData: [],
...@@ -247,6 +293,42 @@ export default { ...@@ -247,6 +293,42 @@ export default {
modify_time: null, modify_time: null,
file_list: [] file_list: []
}, },
// 钥匙借还记录Modal
keyBTRecordsModalShow: false,
keyBTRecordsTableColumns: [
{ type: 'index', title: '序号', align: 'center', width: 80, show: true, fixed: 'left' },
{ key: 'id', title: 'id', align: 'center', minWidth: 120, show: false },
{ key: 'activity_id', title: '活动id', align: 'center', minWidth: 120, show: false },
{ key: 'card', title: '卡号', align: 'center', minWidth: 120, show: false },
{ key: 'name', title: '姓名', align: 'center', minWidth: 120, show: false },
{ key: 'key_id', title: '钥匙id', align: 'center', minWidth: 120, show: false },
{ key: 'key_code', title: '钥匙编号', align: 'center', minWidth: 120, show: true },
{ key: 'key_name', title: '钥匙名称', align: 'center', minWidth: 200, show: true },
{ key: 'borrow_card', title: '借用者卡号', align: 'center', minWidth: 120, show: true },
{ key: 'borrow_name', title: '借用者', align: 'center', minWidth: 120, show: true },
{ key: 'borrow_time', title: '借用时间', align: 'center', minWidth: 180, show: true },
{ key: 'return_card', title: '归还者卡号', align: 'center', minWidth: 120, show: true },
{ key: 'return_name', title: '归还者', align: 'center', minWidth: 120, show: true },
{ key: 'return_time', title: '归还时间', align: 'center', minWidth: 180, show: true },
{ key: 'state', title: '状态', align: 'center', minWidth: 120, show: true },
{ key: 'borrow_userid', title: '借用者id', align: 'center', minWidth: 120, show: false },
{ key: 'return_userid', title: '归还者id', align: 'center', minWidth: 120, show: false },
{ slot: 'action', title: '操作', align: 'center', minWidth: 150, show: false, fixed: 'right' },
],
keyBTRecordsTableData: [],
keyBTRecordsTableLoading: false,
keyBTRecordsDataCount: 0,
keyBTRecordsParams: {
key_id: "",
card_name: "",
state: "",
page_index: 1,
page_size: 10
},
// keyBTRDetailsModalShow: false,
// keyBTRDetailsModalLoading: false,
// keyBTRDetailsFormItem: [],
} }
}, },
// 查询条件初始化 // 查询条件初始化
...@@ -299,6 +381,8 @@ export default { ...@@ -299,6 +381,8 @@ export default {
Object.keys(val).forEach(a => { Object.keys(val).forEach(a => {
if (val[a]) { if (val[a]) {
this.params[a] = val[a] this.params[a] = val[a]
} else {
this.params[a] = ''
} }
}) })
this.onPageChange(1) this.onPageChange(1)
...@@ -332,6 +416,17 @@ export default { ...@@ -332,6 +416,17 @@ export default {
this.detailsTableLoading = false this.detailsTableLoading = false
}) })
}, },
// 钥匙借还记录列表
getKeyBTRData() {
this.keyBTRecordsTableLoading = true
this.asc.postApiKeyGetKeyTrackList(this.keyBTRecordsParams).then(res => {
// console.log('钥匙借还记录', res)
this.keyBTRecordsTableData = res.response.data
this.keyBTRecordsDataCount = res.response.data_count
this.keyBTRecordsTableLoading = false
})
},
// 改变开关 // 改变开关
switchChange(val, row, index) { switchChange(val, row, index) {
...@@ -516,6 +611,37 @@ export default { ...@@ -516,6 +611,37 @@ export default {
} }
}, },
// 钥匙借还记录
keyBTRecordsRow(row) {
// console.log('钥匙借还记录', row)
this.keyBTRecordsModalShow = true
this.keyBTRecordsParams.key_id = row.id
this.getKeyBTRData()
},
// // 借还记录详情
// keyBTRecordsRowDetails(row) {
// // console.log('借还记录详情', row)
// this.keyBTRDetailsModalShow = true
// this.keyBTRDetailsModalLoading = true
// this.asc.getApiKeyGetKeyTrackInfo({id: row.id}).then(res => {
// console.log('借还记录详情结果', res)
// this.$refs.keybtrceditmodal.modalDetailsInit(res.response, 'key_name')
// this.keyBTRDetailsModalLoading = false
// })
// },
// 更钥匙借还记录匙页码
keyBTROnPageChange(val) {
this.keyBTRecordsParams.page_index = val
this.getKeyBTRData()
},
// 更改钥匙借还记录每页条数
keyBTROnPageSizeChange(val) {
this.keyBTRecordsParams.page_size = val
if (this.keyBTRecordsParams.page_index == 1) {
this.keyBTROnPageChange(1)
}
},
} }
} }
</script> </script>
......
...@@ -91,6 +91,7 @@ export default { ...@@ -91,6 +91,7 @@ export default {
{ key: 'time_split', title: '分割时间段(分钟)', align: 'center', minWidth: 150, show: true }, { key: 'time_split', title: '分割时间段(分钟)', align: 'center', minWidth: 150, show: true },
{ key: 'instructions', title: '使用须知', align: 'center', minWidth: 300, show: true, tooltip: true, tooltipMaxWidth: 800 }, { key: 'instructions', title: '使用须知', align: 'center', minWidth: 300, show: true, tooltip: true, tooltipMaxWidth: 800 },
{ key: 'read_time', title: '阅读时间(秒)', align: 'center', minWidth: 120, show: true }, { key: 'read_time', title: '阅读时间(秒)', align: 'center', minWidth: 120, show: true },
{ key: 'service_interval_time', title: '时间范围', align: 'center', minWidth: 120, show: true },
// { key: 'is_enable', title: '启用', align: 'center', minWidth: 80, show: true }, // { key: 'is_enable', title: '启用', align: 'center', minWidth: 80, show: true },
{ slot: 'generalSwitch', title: '启用', align: 'center', minWidth: 80, show: true }, { slot: 'generalSwitch', title: '启用', align: 'center', minWidth: 80, show: true },
{ slot: 'other', title: '其他', align: 'center', minWidth: 80, show: true, fixed: 'right' }, { slot: 'other', title: '其他', align: 'center', minWidth: 80, show: true, fixed: 'right' },
...@@ -112,6 +113,7 @@ export default { ...@@ -112,6 +113,7 @@ export default {
{ id: 'place_type_name', name: '场地类型名称', type: 'input', disabled: false, require: false, optList: [] }, { id: 'place_type_name', name: '场地类型名称', type: 'input', disabled: false, require: false, optList: [] },
{ id: 'time_split', name: '分割时间段(分钟)', type: 'input', disabled: false, require: false, optList: [] }, { id: 'time_split', name: '分割时间段(分钟)', type: 'input', disabled: false, require: false, optList: [] },
{ id: 'read_time', name: '阅读时间(秒)', type: 'input', disabled: false, require: false, optList: [] }, { id: 'read_time', name: '阅读时间(秒)', type: 'input', disabled: false, require: false, optList: [] },
{ id: 'service_interval_time', name: '时间范围', type: 'timerange', disabled: false, require: false, optList: [] },
{ id: 'instructions', name: '使用须知', type: 'textarea', disabled: false, require: false, optList: [], rows: 6 }, { id: 'instructions', name: '使用须知', type: 'textarea', disabled: false, require: false, optList: [], rows: 6 },
// { id: 'file_id', name: '附件', type: 'file', disabled: false, require: false, optList: [] }, // { id: 'file_id', name: '附件', type: 'file', disabled: false, require: false, optList: [] },
{ id: 'is_enable', name: '启用', type: 'switch', disabled: false, require: false, optList: [] }, { id: 'is_enable', name: '启用', type: 'switch', disabled: false, require: false, optList: [] },
...@@ -152,6 +154,8 @@ export default { ...@@ -152,6 +154,8 @@ export default {
Object.keys(val).forEach(a => { Object.keys(val).forEach(a => {
if (val[a]) { if (val[a]) {
this.params[a] = val[a] this.params[a] = val[a]
} else {
this.params[a] = ''
} }
}) })
this.onPageChange(1) this.onPageChange(1)
......
<template> <template>
<!-- 系统配置 --> <!-- 系统配置 -->
<div class="mainDiv"> <div>
<Card class="bigCard" title="活动时间提醒"> <div class="mainDiv">
<Form label-colon> <Card class="bigCard" title="活动时间提醒">
<Row> <Form label-colon>
<Col span="24"> <Row>
<FormItem label="活动开始前提醒"> <Col span="24">
<RadioGroup v-model="configData.before_activity"> <FormItem label="活动开始前提醒">
<Radio label="5">5分钟</Radio> <RadioGroup v-model="configData.before_activity">
<Radio label="15">15分钟</Radio> <Radio label="5">5分钟</Radio>
<Radio label="30">30分钟</Radio> <Radio label="15">15分钟</Radio>
</RadioGroup> <Radio label="30">30分钟</Radio>
<span>自定义:</span> </RadioGroup>
<Input v-model="configData.before_activity" style="width: 60px;"/>&nbsp; <span>自定义:</span>
<span>分钟</span> <Input v-model="configData.before_activity" style="width: 60px;"/>&nbsp;
</FormItem> <span>分钟</span>
</Col> </FormItem>
<Col span="24"> </Col>
<FormItem label="活动结束前提醒"> <Col span="24">
<RadioGroup v-model="configData.before_end_activity"> <FormItem label="活动结束前提醒">
<Radio label="5">5分钟</Radio> <RadioGroup v-model="configData.before_end_activity">
<Radio label="15">15分钟</Radio> <Radio label="5">5分钟</Radio>
<Radio label="30">30分钟</Radio> <Radio label="15">15分钟</Radio>
</RadioGroup> <Radio label="30">30分钟</Radio>
<span>自定义:</span> </RadioGroup>
<Input v-model="configData.before_end_activity" style="width: 60px;"/>&nbsp; <span>自定义:</span>
<span>分钟</span> <Input v-model="configData.before_end_activity" style="width: 60px;"/>&nbsp;
</FormItem> <span>分钟</span>
</Col> </FormItem>
<Col span="24" style="text-align: right;"> </Col>
<Button type="primary" @click="saveBt('before_activity', 'before_end_activity')">保存</Button> <Col span="24" style="text-align: right;">
</Col> <Button type="primary" @click="saveBt('before_activity', 'before_end_activity')">保存</Button>
</Row> </Col>
</Form> </Row>
</Card> </Form>
<Card class="bigCard kjyyCard" title="评价快捷用语"> </Card>
<template #extra> <Card class="bigCard kjyyCard" title="评价快捷用语">
<a @click="fastContentAdd"><Icon type="md-add" /></a> <template #extra>
</template> <a @click="fastContentAdd"><Icon type="md-add" /></a>
</template>
<p v-for="item in fastContentList" :key="item.id" name="fastCP">
<span>{{ item.content }}</span> <p v-for="item in fastContentList" :key="item.id" name="fastCP">
<span> <span>{{ item.content }}</span>
<a><Icon type="md-create" @click="fastContentEditRow(item)"/></a> <span>
<Poptip confirm transfer title="是否确认删除?" @on-ok="fastContentDelRow(item)"> <a><Icon type="md-create" @click="fastContentEditRow(item)"/></a>
<a name="del"><Icon type="md-close"/></a> <Poptip confirm transfer title="是否确认删除?" @on-ok="fastContentDelRow(item)">
</Poptip> <a name="del"><Icon type="md-close"/></a>
</span> </Poptip>
</p> </span>
</Card> </p>
<Card class="smallCard" title="加时配置"> </Card>
<Form label-colon label-position="top"> <Card class="smallCard" title="加时配置">
<Row> <Form label-colon label-position="top">
<Col span="24"> <Row>
<FormItem label="允许加时时间段个数"> <Col span="24">
<RadioGroup v-model="configData.add_to"> <FormItem label="允许加时时间段个数">
<Radio label="1">1个</Radio> <RadioGroup v-model="configData.add_to">
<Radio label="2">2个</Radio> <Radio label="1">1个</Radio>
<Radio label="3">3个</Radio> <Radio label="2">2个</Radio>
<Radio label="4">4个</Radio> <Radio label="3">3个</Radio>
<Radio label="5">5个</Radio> <Radio label="4">4个</Radio>
</RadioGroup> <Radio label="5">5个</Radio>
<span>自定义:</span> </RadioGroup>
<Input v-model="configData.add_to" style="width: 60px;"/>&nbsp; <span>自定义:</span>
<span>个</span> <Input v-model="configData.add_to" style="width: 60px;"/>&nbsp;
</FormItem> <span>个</span>
</Col> </FormItem>
<Col span="24"> </Col>
<FormItem label="最多加时次数"> <Col span="24">
<RadioGroup v-model="configData.overtime_num"> <FormItem label="最多加时次数">
<Radio label="1">1次</Radio> <RadioGroup v-model="configData.overtime_num">
<Radio label="2">2次</Radio> <Radio label="1">1次</Radio>
<Radio label="3">3次</Radio> <Radio label="2">2次</Radio>
<Radio label="4">4次</Radio> <Radio label="3">3次</Radio>
<Radio label="5">5次</Radio> <Radio label="4">4次</Radio>
</RadioGroup> <Radio label="5">5次</Radio>
<span>自定义:</span> </RadioGroup>
<Input v-model="configData.overtime_num" style="width: 60px;"/>&nbsp; <span>自定义:</span>
<span>次</span> <Input v-model="configData.overtime_num" style="width: 60px;"/>&nbsp;
</FormItem> <span>次</span>
</Col> </FormItem>
<Col span="24" style="text-align: right;"> </Col>
<Button type="primary" @click="saveBt('add_to', 'overtime_num')">保存</Button> <Col span="24" style="text-align: right;">
</Col> <Button type="primary" @click="saveBt('add_to', 'overtime_num')">保存</Button>
</Row> </Col>
</Form> </Row>
</Card> </Form>
<Card class="smallCard cplhsCard" title="差评拉黑数"> </Card>
<p> <Card class="smallCard cplhsCard" title="差评拉黑数">
<RadioGroup v-model="configData.black_num"> <p>
<Radio label="1">1个</Radio> <RadioGroup v-model="configData.black_num">
<Radio label="2">2个</Radio> <Radio label="1">1个</Radio>
<Radio label="3">3个</Radio> <Radio label="2">2个</Radio>
<Radio label="4">4个</Radio> <Radio label="3">3个</Radio>
<Radio label="5">5个</Radio> <Radio label="4">4个</Radio>
</RadioGroup> <Radio label="5">5个</Radio>
</p> </RadioGroup>
<p> </p>
<span>自定义:</span> <p>
<Input v-model="configData.black_num" style="width: 60px;"/>&nbsp; <span>自定义:</span>
<span>个</span> <Input v-model="configData.black_num" style="width: 60px;"/>&nbsp;
</p> <span>个</span>
<p>&nbsp;</p> </p>
<Button class="save-bt" type="primary" @click="saveBt('black_num')">保存</Button> <p>&nbsp;</p>
</Card> <Button class="save-bt" type="primary" @click="saveBt('black_num')">保存</Button>
<Card class="smallCard cplhsCard" title="活动邀请时间限制"> </Card>
<p> <Card class="smallCard cplhsCard" title="活动邀请时间限制">
<RadioGroup v-model="configData.invite_time"> <p>
<Radio label="1">1小时</Radio> <RadioGroup v-model="configData.invite_time">
<Radio label="2">2小时</Radio> <Radio label="1">1小时</Radio>
<Radio label="6">6小时</Radio> <Radio label="2">2小时</Radio>
<Radio label="12">12小时</Radio> <Radio label="6">6小时</Radio>
</RadioGroup> <Radio label="12">12小时</Radio>
</p> </RadioGroup>
<p> </p>
<span>自定义:</span> <p>
<Input v-model="configData.invite_time" style="width: 60px;"/>&nbsp; <span>自定义:</span>
<span>小时</span> <Input v-model="configData.invite_time" style="width: 60px;"/>&nbsp;
</p> <span>小时</span>
<p>&nbsp;</p> </p>
<Button class="save-bt" type="primary" @click="saveBt('invite_time')">保存</Button> <p>&nbsp;</p>
</Card> <Button class="save-bt" type="primary" @click="saveBt('invite_time')">保存</Button>
<Card class="smallCard" title="评价设置"> </Card>
<Form label-colon> <Card class="smallCard" title="评价设置">
<Row> <Form label-colon>
<Col span="24"> <Row>
<FormItem label="自动好评时间"> <Col span="24">
<Input v-model="configData.auto_goodevaluate_day" style="width: 60px;"/>&nbsp; <FormItem label="自动好评时间">
<span>天</span> <Input v-model="configData.auto_goodevaluate_day" style="width: 60px;"/>&nbsp;
</FormItem> <span>天</span>
</Col> </FormItem>
<Col span="24"> </Col>
<FormItem label="自动好评星数"> <Col span="24">
<Rate <FormItem label="自动好评星数">
v-model="configData.auto_goodevaluate_num" <Rate
allow-half v-model="configData.auto_goodevaluate_num"
icon="md-star"/> allow-half
</FormItem> icon="md-star"/>
</Col> </FormItem>
<Col span="24"> </Col>
<FormItem label="催办评价时间"> <Col span="24">
<Input v-model="configData.urge_evaluate_day" style="width: 60px;"/>&nbsp; <FormItem label="催办评价时间">
<span>天</span> <Input v-model="configData.urge_evaluate_day" style="width: 60px;"/>&nbsp;
</FormItem> <span>天</span>
</Col> </FormItem>
<Col span="24" style="text-align: right;"> </Col>
<Button type="primary" @click="saveBt('auto_goodevaluate_day', 'auto_goodevaluate_num', 'urge_evaluate_day')">保存</Button> <Col span="24" style="text-align: right;">
</Col> <Button type="primary" @click="saveBt('auto_goodevaluate_day', 'auto_goodevaluate_num', 'urge_evaluate_day')">保存</Button>
</Row> </Col>
</Form> </Row>
</Card> </Form>
<Card class="smallCard cplhsCard" title="最多邀请次数"> </Card>
<p style="text-align: center;"> <Card class="smallCard cplhsCard" title="最多邀请次数">
<span>最多邀请</span>&nbsp; <p style="text-align: center;">
<Input v-model="configData.invite_num" style="width: 60px;"/>&nbsp; <span>最多邀请</span>&nbsp;
<span>次</span> <Input v-model="configData.invite_num" style="width: 60px;"/>&nbsp;
</p> <span>次</span>
<p>&nbsp;</p> </p>
<Button class="save-bt" type="primary" @click="saveBt('invite_num')">保存</Button> <p>&nbsp;</p>
</Card> <Button class="save-bt" type="primary" @click="saveBt('invite_num')">保存</Button>
<Card class="smallCard cplhsCard" title="黑名单天数"> </Card>
<p style="text-align: center;"> <Card class="smallCard cplhsCard" title="黑名单天数">
<span>黑名单</span>&nbsp; <p style="text-align: center;">
<Input v-model="configData.black_day" style="width: 60px;"/>&nbsp; <span>黑名单</span>&nbsp;
<span>天</span> <Input v-model="configData.black_day" style="width: 60px;"/>&nbsp;
</p> <span>天</span>
<p>&nbsp;</p> </p>
<Button class="save-bt" type="primary" @click="saveBt('black_day')">保存</Button> <p>&nbsp;</p>
</Card> <Button class="save-bt" type="primary" @click="saveBt('black_day')">保存</Button>
</Card>
</div>
<!-- 快捷用语新增修改Modal --> <!-- 快捷用语新增修改Modal -->
<CEditModal <CEditModal
......
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或