xy 1 year ago
parent 78df620162
commit 4fdd9fbaae

@ -3,15 +3,18 @@
<router-view />
<ThemePicker style="display: none;"></ThemePicker>
<OnlineFile></OnlineFile>
</div>
</template>
<script>
import OnlineFile from "@/components/OnlineFile/index.vue";
import ThemePicker from "@/components/ThemePicker/index.vue";
export default {
name: 'App',
components: {
ThemePicker
ThemePicker,
OnlineFile
}
}
</script>

@ -17,3 +17,12 @@ export function sign(params,isLoading = true) {
isLoading
})
}
export function statistics(params,isLoading= true) {
return request({
method: 'get',
url: '/api/oa/attendance/statistics',
params,
isLoading
})
}

@ -6,7 +6,7 @@ export function index(params) {
return request({
url: '/api/oa/document/index',
method: 'get',
params
params,
})
}
export function show(params, isLoading = true) {

@ -194,3 +194,12 @@ export function statistics(type, params, isLoading=true) {
isLoading
})
}
export function updateTime(params,isLoading=true) {
return request({
method: 'get',
url: '/api/oa/flow/update-time',
params,
isLoading
})
}

@ -0,0 +1,54 @@
<template>
<div>
<vxe-modal
:width="840"
:height="600"
show-zoom
:fullscreen="$store.getters.device === 'mobile'"
:z-index="zIndex"
v-model="showModal"
:footer-hide="true"
title="预览"
>
<template>
<iframe
style="width: 100%; height: 100%;"
:src="codeUri"
frameborder="0"
></iframe>
</template>
</vxe-modal>
</div>
</template>
<script>
import { PopupManager } from "element-ui/lib/utils/popup";
export default {
data() {
return {
zIndex: PopupManager.nextZIndex(),
showModal:false,
codeUri: "",
}
},
methods: {
open(url) {
this.codeUri = `${process.env.VUE_APP_PREVIEW}?url=${encodeURIComponent(
new Buffer(url).toString("base64")
)}`;
this.showModal = true;
}
},
computed: {},
created() {
this.$bus.$on('online-file',(url) => this.open(url))
},
beforeDestroy() {
this.$bus.$off('online-file')
}
}
</script>
<style scoped lang="scss">
</style>

@ -79,7 +79,10 @@ if (window.__POWERED_BY_WUJIE__) {
instance = new Vue({
router,
store,
render: h => h(App)
render: h => h(App),
beforeCreate() {
Vue.prototype.$bus = this
}
}).$mount("#app")
window.MODULE_NAME = window.$wujie?.props?.module_name;
console.log('token-wujie',window.MODULE_NAME)
@ -94,7 +97,10 @@ if (window.__POWERED_BY_WUJIE__) {
new Vue({
router,
store,
render: h => h(App)
render: h => h(App),
beforeCreate() {
Vue.prototype.$bus = this
}
}).$mount("#app")
}

@ -18,7 +18,7 @@ const loading = throttle(() => {
const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests
timeout: 5000 // request timeout
timeout: 10000 // request timeout
})
// request interceptor

@ -65,7 +65,7 @@ export default {
required: true
},
users: {
type: Boolean,
type: Array,
default: () => []
}
},

@ -0,0 +1,17 @@
<template>
<div>
</div>
</template>
<script>
export default {
data() {
return {}
},
methods: {},
computed: {},
}
</script>
<style scoped lang="scss">
</style>

@ -0,0 +1,198 @@
<template>
<div>
<card-container>
<vxe-toolbar>
<template #buttons>
<el-button icon="el-icon-plus" type="primary" size="small" @click="isShowAdd = true">新增</el-button>
<el-button icon="el-icon-search" type="primary" plain size="small" @click="getList"></el-button>
</template>
</vxe-toolbar>
<vxe-table
ref="table"
stripe
style="margin-top: 10px;"
:loading="loading"
keep-source
show-overflow
:column-config="{ resizable: true }"
:edit-rules="validRules"
:edit-config="{ trigger: 'manual', mode: 'row', showStatus: true, isHover: true, autoClear: false }"
:align="allAlign"
:data="tableData"
>
<vxe-column type="seq" width="58" align="center" />
<vxe-column field="name" width="170" title="名字" :edit-render="{ name: 'input', attrs: { type: 'text' } }" />
<vxe-column field="key" width="150" title="标识" :edit-render="{ name: 'input', attrs: { type: 'text' } }" />
<vxe-column field="value" width="150" title="值" :edit-render="{ name: 'input', attrs: { type: 'text' } }" />
<vxe-column field="mysort" width="80" title="排序" align="center" :edit-render="{ name: 'input', attrs: { type: 'number' } }" />
<vxe-column field="operate" title="操作" min-width="220">
<template #default="{ row }">
<template v-if="isActiveStatus(row)">
<el-button size="small" type="primary" @click="saveRowEvent(row)"></el-button>
<el-button size="small" type="primary" plain @click="cancelRowEvent(row)"></el-button>
</template>
<template v-else>
<el-button size="small" type="warning" @click="editRowEvent(row)"></el-button>
<el-button size="small" type="danger" @click="destroyRowEvent(row)"></el-button>
</template>
</template>
</vxe-column>
</vxe-table>
<el-pagination
style="margin-top: 10px;"
:current-page="select.page"
:page-sizes="[20, 30, 40, 50]"
:page-size="select.page_size"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="e => {
select.page_size = e;
select.page = 1;
getList();
}"
@current-change="e => {
select.page = e;
getList();
}"
/>
</card-container>
<add-vehicle-certificate ref="AddVehicleCertificate" :is-show.sync="isShowAdd" @refresh="getList" />
</div>
</template>
<script>
import { deepCopy } from '@/utils'
import { index, save, destroy } from '@/api/vehicleCertificate'
import AddVehicleCertificate from './components/AddVehicleCertificate.vue'
export default {
components: {
AddVehicleCertificate
},
data() {
return {
isShowAdd: false,
loading: false,
select: {
page: 1,
page_size: 20
},
total: 0,
allAlign: null,
tableData: [],
validRules: {},
form: {
id: '',
vehicle_id: '',
name: '',
grant_at: '',
expire_at: '',
renewed_at: '',
renewed_id: '',
grant_by: '',
serial: ''
}
}
},
computed: {
isActiveStatus() {
return function(row) {
if (this.$refs['table']) {
return this.$refs['table'].isEditByRow(row)
}
}
}
},
created() {
this.getList()
},
methods: {
editRowEvent(row) {
if (this.$refs['table']) {
this.$refs['table'].setEditRow(row)
}
},
cancelRowEvent(row) {
if (this.$refs['table']) {
this.$refs['table'].clearEdit().then(() => {
//
this.$refs['table'].revertData(row)
})
}
},
async getList() {
this.loading = true
try {
const res = await index(this.select)
this.tableData = res.data
this.total = res.total
this.loading = false
} catch (err) {
console.error(err)
this.loading = false
}
},
async saveRowEvent(row) {
try {
const errMap = await this.$refs['table'].validate()
if (errMap) {
throw new Error(errMap)
}
await this.$confirm('确认保存?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消'
})
await this.$refs['table'].clearEdit()
const form = deepCopy(this.form)
for (const key in form) {
form[key] = row[key]
}
if (!form.password) {
delete form.password
}
this.loading = true
await save(form)
await this.getList()
this.loading = false
} catch (err) {
this.loading = false
}
},
async destroyRowEvent(row) {
try {
await this.$confirm('确认删除?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消'
})
this.loading = true
if (row.id) {
await destroy({
id: row.id
})
await this.getList()
} else {
console.log(row)
this.tableData.splice(this.tableData.findIndex(i => i._X_ROW_KEY === row._X_ROW_KEY), 1)
}
this.loading = false
} catch (err) {
this.loading = false
}
}
}
}
</script>
<style scoped lang="scss">
.total {
color: #666;
text-align: right;
line-height: 3;
}
::v-deep .el-tag + .el-tag {
margin-left: 4px;
}
</style>

@ -6,7 +6,8 @@
<span>打卡</span>
</button>
<div class="sign-statsu">
<div>当前位置</div>
<div>打卡状态 <el-tag size="small" effect="dark" type="primary">{{ isGetLocation ? '可打卡' : '不可打卡' }}</el-tag></div>
<div>当前位置 <span v-if="isGetLocation">{{pos.lng}},{{pos.lat}}</span></div>
<div>当前距离</div>
<div>最大打卡范围</div>
</div>
@ -26,7 +27,13 @@ export default {
MonthStatics
},
data() {
return {}
return {
isGetLocation: false,
pos: {
lng: '',
lat: ''
}
}
},
computed: {},
methods: {
@ -37,7 +44,73 @@ export default {
} catch (err) {
console.error(err)
}
}, 1000, true)
}, 1000, true),
isAuthPermission() {
if(!navigator.geolocation) {
this.isGetLocation = false
this.$msgbox.alert("您的浏览器不支持获取定位", "提示")
} else {
this.getLocation()
}
},
getLocation() {
navigator.geolocation.getCurrentPosition((pos) => {
this.isGetLocation = true
console.log('经度', pos.coords.latitude);
console.log('纬度', pos.coords.longitude);
this.pos.lng = pos.coords.longitude
this.pos.lat = pos.coords.latitude
}, (error) => {
if (error.code) {
switch (error.code) {
case error.PERMISSION_DENIED:
this.$msgbox.confirm("需授权定位后进行打卡", "提示",{
confirmButtonText: '重试'
}).then(_ => {
this.getLocation()
})
this.isGetLocation = false
break;
case error.POSITION_UNAVAILABLE:
this.$msgbox.confirm("无法获取当前位置,请重试", "提示",{
confirmButtonText: '重试'
}).then(_ => {
this.getLocation()
})
this.isGetLocation = false
break;
case error.TIMEOUT:
this.$msgbox.confirm("获取位置超时,请重试", "提示",{
confirmButtonText: '重试'
}).then(_ => {
this.getLocation()
})
this.isGetLocation = false
break;
case error.UNKNOWN_ERROR:
this.$msgbox.confirm("获取位置错误,请重试", "提示",{
confirmButtonText: '重试'
}).then(_ => {
this.getLocation()
})
this.isGetLocation = false
break;
default:
this.$msgbox.confirm("获取位置错误,请重试", "提示",{
confirmButtonText: '重试'
}).then(_ => {
this.getLocation()
})
this.isGetLocation = false
break;
}
}
});
},
},
created() {
this.isAuthPermission()
}
}
</script>

@ -0,0 +1,85 @@
<template>
<div>
<card-container>
<vxe-toolbar>
<template #buttons>
<el-date-picker v-model="select.month" type="month" size="small" value-format="yyyy-MM"></el-date-picker>
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 6px;" @click="getStatistics"></el-button>
</template>
</vxe-toolbar>
<vxe-table
ref="table"
stripe
style="margin-top: 10px;"
round
:max-height="600"
keep-source
show-header-overflow
show-footer-overflow
show-overflow
:row-config="{ isHover: true }"
:header-cell-style="{ 'white-space': 'wrap' }"
:scroll-x="{ enabled: true, gt: 0 }"
:column-config="{ resizable: true }"
:data="tableData.admins">
<vxe-column type="seq" width="50" align="center" fixed="left"></vxe-column>
<vxe-column field="name" title="姓名" fixed="left" align="center" width="120"></vxe-column>
<vxe-column field="department.name" title="所在部门" align="center" width="150"></vxe-column>
<vxe-colgroup v-for="item in dateTableColumns" align="center" :title="item.title">
<vxe-column title="上午" width="160" align="center">
<template #default="{ row }">
<span>{{ row.attendance[item.date] instanceof Array ? '' : row.attendance[item.date][0].sign_in_at }}</span>
</template>
</vxe-column>
<vxe-column title="下午" width="160" align="center">
<template #default="{ row }">
<span>{{ row.attendance[item.date] instanceof Array ? '' : row.attendance[item.date][0].sign_out_at }}</span>
</template>
</vxe-column>
</vxe-colgroup>
</vxe-table>
</card-container>
</div>
</template>
<script>
import { statistics } from '@/api/attendance'
export default {
data() {
return {
select: {
month: this.$moment().format('YYYY-MM')
},
tableData: {
admins: [],
dates: []
}
}
},
methods: {
async getStatistics() {
try {
const res = await statistics(this.select)
this.tableData = res
} catch (err) {
console.error(err)
}
}
},
computed: {
dateTableColumns() {
return this.tableData.dates.map(i => ({
title: `${this.$moment(i.day).format('YYYY年MM月DD日')} ${i.is_workday ? '工作日' : '公休'}`,
field: i.day,
date: i.date
}))
}
},
created() {
this.getStatistics()
}
}
</script>
<style scoped lang="scss">
</style>

@ -112,16 +112,21 @@
</div>
<div class="mycard__body quick-menu__body">
<router-link
:to="item.url"
tag="div"
v-for="item in quickMenus"
:key="item.key"
>
<div>
{{ item.name }}
</div>
</router-link>
<el-badge :value="item.num"
:max="99"
:hidden="!item.num"
class="item"
v-for="item in quickMenus"
:key="item.key">
<router-link
:to="item.url"
tag="div"
>
<div>
{{ item.name }}
</div>
</router-link>
</el-badge>
</div>
</div>
@ -269,7 +274,7 @@ export default {
]),
weather: {},
calendar: this.$moment().format("YYYY-MM"),
calendar: this.$moment().format("YYYY-MM-DD"),
attendanceData: {
attendances: [],
},
@ -278,22 +283,27 @@ export default {
{
name: "我收藏的",
url: "/flow/list/fav",
num: 0
},
{
name: "我办理过的",
url: "/flow/list/handled",
num: 0
},
{
name: "我发起的",
url: "/flow/list/my",
num: 0
},
{
name: "所有待办",
url: "/flow/list/todo",
num: 0
},
{
name: "抄送给我的",
url: "/flow/list/cc",
num: 0
},
],
@ -377,7 +387,22 @@ export default {
console.error(err);
}
},
async getTotal() {},
async getTotal() {
try {
const res = await axios.get(`${process.env.VUE_APP_BASE_API}/api/oa/statistics/notifications`,{
headers: {
Authorization: `Bearer ${getToken()}`,
}
});
if (res.status === 200) {
console.log(res)
this.quickMenus[3].num = res.data.data?.count_unread ?? 0
this.quickMenus[4].num = res.data.data?.count_unread_ccs ?? 0
}
} catch (err) {
console.error(err);
}
},
async getWeather() {
try {
const res = await axios.get(
@ -518,6 +543,9 @@ $btn-colors: linear-gradient(90deg, #d4bbfd 0%, #af7bff 100%),
::v-deep .el-calendar {
border-radius: 0 0 10px 10px;
}
::v-deep .el-badge__content.is-fixed {
z-index: 1;
}
::v-deep .el-calendar-table .is-today {
position: relative;
&::after {
@ -711,7 +739,7 @@ $btn-colors: linear-gradient(90deg, #d4bbfd 0%, #af7bff 100%),
cursor: pointer;
border-radius: 10px;
margin: 10px 10px 0 0;
overflow: hidden;
// overflow: hidden;
position: relative;
&::before {
@ -829,6 +857,7 @@ $btn-colors: linear-gradient(90deg, #d4bbfd 0%, #af7bff 100%),
background: var(--theme-color);
padding: 2px 4px;
margin-left: auto;
text-align: center;
}
.sign-out {
margin-top: 4px;
@ -839,6 +868,7 @@ $btn-colors: linear-gradient(90deg, #d4bbfd 0%, #af7bff 100%),
background-color: #251f83;
padding: 2px 4px;
margin-left: auto;
text-align: center;
}
}

@ -0,0 +1,152 @@
<template>
<div>
<vxe-modal
:z-index="zIndex"
:value="isShow"
show-footer
title="公共文件柜"
show-confirm-button
:width="600"
:height="400"
:fullscreen="$store.getters.device === 'mobile'"
esc-closable
@input="e => $emit('update:isShow',e)"
>
<el-form ref="elForm" :model="form" :rules="rules" label-position="top" label-width="100">
<el-form-item label="所属栏目" prop="document_menu_id" required>
<Treeselect
v-model="form.document_menu_id"
:options="list"
:multiple="false"
no-children-text="无子菜单"
:normalizer="node => ({
id: node.id,
label: node.name,
children: node.children,
isDefaultExpanded: true
})"
/>
</el-form-item>
<el-form-item label="名称" prop="name" required>
<el-input v-model="form.name" />
</el-form-item>
<el-form-item label="文件" prop="file_id">
<el-upload
:action="action"
:headers="{
Authorization: `Bearer ${getToken()}`
}"
:before-upload="beforeUpload"
:on-success="uploadSuccess"
multiple
:file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">上传文件不超过10Mb</div>
</el-upload>
</el-form-item>
<el-form-item label="排序" prop="myindex">
<el-input-number v-model="form.myindex" :controls="false" :precision="0" />
</el-form-item>
</el-form>
<template #footer>
<el-button type="primary" :loading="loading" @click="submit"></el-button>
</template>
</vxe-modal>
</div>
</template>
<script>
import { getToken } from '@/utils/auth'
import { save } from '@/api/document'
import { PopupManager } from "element-ui/lib/utils/popup";
export default {
props: {
list: {
type: Array,
default: () => []
},
isShow: {
type: Boolean,
default: false,
required: true
},
users: {
type: Array,
default: () => []
}
},
data() {
return {
action: process.env.VUE_APP_UPLOAD_API,
fileList: [],
zIndex: PopupManager.nextZIndex(),
loading: false,
form: {
document_menu_id: '',
name: '',
file_id: '',
update_children_ids: '',
myindex: ''
},
rules: {
document_menu_id: [
{ required: true, message: '请选择栏目' }
],
name: [
{ required: true, message: '请输入名称' }
]
}
}
},
computed: {
},
watch: {
isShow(newVal) {
if(newVal) {
this.zIndex = PopupManager.nextZIndex()
}
}
},
methods: {
getToken,
beforeUpload(file) {
const isLt10M = file.size / 1024 / 1024 < 10
if (!isLt10M) {
this.$message.error('上传头像图片大小不能超过 10MB!')
}
return isLt10M
},
uploadSuccess(response, file, fileList) {
this.fileList = fileList
},
submit() {
this.$refs['elForm'].validate(async valid => {
if (valid) {
this.loading = true
try {
await Promise.all(this.fileList.map(i => save({
...this.form,
file_id: i.response?.data?.id
})))
// await save(this.form)
this.$message.success('新增成功')
this.$emit('refresh')
this.$emit('update:isShow', false)
this.loading = false
this.$refs['elForm'].resetFields()
} catch (err) {
this.loading = false
}
}
})
}
}
}
</script>
<style scoped lang="scss">
</style>

@ -11,6 +11,7 @@
ref="tree"
:indent="10"
style="margin-top: 8px;"
:expand-on-click-node="false"
class="filter-tree"
:data="types"
:props="{
@ -18,6 +19,7 @@
}"
default-expand-all
:filter-node-method="filterNode"
@node-click="treeClick"
/>
</el-card>
@ -41,15 +43,47 @@
:data="tableData"
>
<vxe-column type="seq" width="64" align="center" />
<vxe-column field="document_menu.name" title="所属栏目" width="140" align="center" />
<vxe-column field="name" title="名称" width="160" align="center" />
<vxe-column field="file.original_name" title="文件" min-width="180" header-align="center" align="left" />
<vxe-column field="operate" title="操作" min-width="220">
<template #default="{ row }">
<el-button size="small" type="primary" icon="el-icon-search" @click="preview(row)"></el-button>
<el-button size="small" type="danger" @click="destroyRowEvent(row)"></el-button>
</template>
</vxe-column>
</vxe-table>
<el-pagination
style="margin-top: 10px;"
:current-page="select.page"
:page-sizes="[20, 30, 40, 50]"
:page-size="select.page_size"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="e => {
select.page_size = e;
select.page = 1;
getList();
}"
@current-change="e => {
select.page = e;
getList();
}"
/>
</card-container>
<AddDocument :is-show.sync="isShowAdd" ref="AddDocument" :list="types" @refresh="getList"></AddDocument>
</div>
</template>
<script>
import { menuIndex, index } from '@/api/document'
import AddDocument from './components/AddDocument.vue'
import { menuIndex, index, destroy } from '@/api/document'
export default {
components: {
AddDocument
},
data() {
return {
filterText: '',
@ -58,7 +92,16 @@ export default {
validRules: {
},
tableData: [],
types: []
total: 0,
types: [],
select: {
show_relation: ['file', 'document_menu'],
page: 1,
page_size: 20,
'filter[0][key]': 'document_menu_id',
'filter[0][eq]': 'eq',
'filter[0][value]': ''
}
}
},
computed: {},
@ -72,6 +115,15 @@ export default {
this.getList()
},
methods: {
preview(row) {
this.$bus.$emit('online-file', row.file?.url)
},
treeClick(data) {
this.select['filter[0][value]'] = data.id
this.select.page = 1
this.getList()
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
@ -79,7 +131,9 @@ export default {
async getList() {
try {
const res = await index()
const res = await index(this.select)
this.tableData = res.data
this.total = res.total
} catch (err) {
console.error(err)
}
@ -91,6 +145,27 @@ export default {
} catch (err) {
console.error(err)
}
},
async destroyRowEvent(row) {
try {
await this.$confirm('确认删除?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消'
})
this.loading = true
if (row.id) {
await destroy({
id: row.id
})
await this.getList()
} else {
console.log(row)
this.tableData.splice(this.tableData.findIndex(i => i._X_ROW_KEY === row._X_ROW_KEY), 1)
}
this.loading = false
} catch (err) {
this.loading = false
}
}
}
}
@ -106,15 +181,17 @@ export default {
}
& > div:nth-child(2) {
flex-basis: 78%;
margin-left: 10px;
}
}
@media (max-width: 768px) {
@media (max-width: 992px) {
.container {
display: initial;
& > div:nth-child(2) {
margin-top: 10px;
margin-left: 0;
}
}
}

@ -388,7 +388,7 @@ export default {
}
});
this.form['flow_title'] = this.config?.flow?.title ?? ''
this.form['flow_title'] = this.config?.flow?.title ?? `${this.config.customModel.name}${this.$store.getters.name} ${this.$moment().format('YYYY-MM-DD HH:mm')}`
},
formatTime(time) {
const days = parseInt(time / (1000 * 60 * 60 * 24));

@ -86,9 +86,10 @@
}"
:custom-config="{ mode: 'popup' }"
:data="list"
@cell-dblclick="cellDblclickEvent"
>
<vxe-column
v-if="$route.params.type === 'created-by-me'"
v-if="$route.params.type === 'all'"
align="center"
type="checkbox"
width="40"
@ -101,21 +102,21 @@
title="工作名称"
></vxe-column>
<vxe-column
v-if="$route.params.type === 'created-by-me'"
v-if="$route.params.type === 'all'"
width="80"
align="center"
field="id"
title="流水号"
></vxe-column>
<vxe-column
v-if="$route.params.type === 'created-by-me'"
v-if="$route.params.type === 'all'"
width="80"
title="发起人"
align="center"
field="creator.name"
></vxe-column>
<vxe-column
v-if="$route.params.type !== 'created-by-me'"
v-if="$route.params.type !== 'all'"
width="80"
title="承办人员"
align="center"
@ -128,14 +129,14 @@
title="流程名称"
></vxe-column>
<vxe-column
v-if="$route.params.type !== 'created-by-me'"
v-if="$route.params.type !== 'all'"
align="center"
width="140"
field="current_node.name"
title="当前节点"
></vxe-column>
<vxe-column
v-if="$route.params.type !== 'created-by-me'"
v-if="$route.params.type !== 'all'"
title="收藏状态"
width="90"
field="my_fav"
@ -158,7 +159,7 @@
></vxe-column>
<vxe-column
width="200"
v-if="$route.params.type === 'created-by-me'"
v-if="$route.params.type === 'all'"
align="center"
field="created_at"
title="发起日期"
@ -193,7 +194,7 @@
<vxe-column v-if="device === 'mobile'" field="m-operate" type="expand" width="60" fixed="left">
<template #content="{ row }">
<div>
<template v-if="$route.params.type !== 'created-by-me'">
<template v-if="$route.params.type !== 'all'">
<el-button
v-if="row.my_log"
type="primary"
@ -241,7 +242,7 @@
fixed="right"
>
<template #default="{ row }">
<template v-if="$route.params.type !== 'created-by-me'">
<template v-if="$route.params.type !== 'all'">
<el-button
v-if="row.my_log"
type="primary"
@ -475,6 +476,39 @@ export default {
this.loading = false;
}
},
async cellDblclickEvent({ row, column }) {
console.log(row, column)
const h = this.$createElement;
if(column.field === 'created_at' || column.field === 'updated_at') {
this.$msgbox({
title: '时间更新',
message: h('el-date-picker'),
showCancelButton: true,
confirmButtonText: '确定',
cancelButtonText: '取消',
beforeClose: (action, instance, done) => {
if (action === 'confirm') {
instance.confirmButtonLoading = true;
instance.confirmButtonText = '执行中...';
setTimeout(() => {
done();
setTimeout(() => {
instance.confirmButtonLoading = false;
}, 300);
}, 3000);
} else {
done();
}
}
}).then(action => {
this.$message({
type: 'info',
message: 'action: ' + action
});
})
}
},
},
computed: {
device() {

@ -23,21 +23,60 @@
:data="tableData"
>
<vxe-column type="seq" width="58" align="center" />
<vxe-column field="date" width="170" title="日期" :edit-render="{}">
<vxe-column field="name" width="160" title="型号" :edit-render="{ name: 'input', attrs: { type: 'text' } }" />
<vxe-column field="type" title="类型" width="120" :edit-render="{ name: 'select', options: [{ label: '', value: 'vehicle' },{ label: '', value: 'boat' }] }" />
<vxe-column field="license" width="140" title="号码" :edit-render="{ name: 'input', attrs: { type: 'text' } }" />
<vxe-column field="driver" width="120" title="驾驶员" :edit-render="{ name: 'input', attrs: { type: 'text' } }" />
<vxe-column field="start_date" width="170" title="上牌日期" :edit-render="{}">
<template #edit="{ row }">
<el-date-picker style="width: 100%;" v-model="row.date" value-format="yyyy-MM-dd" />
<el-date-picker style="width: 100%;" v-model="row.start_date" value-format="yyyy-MM-dd" />
</template>
</vxe-column>
<vxe-column field="type" title="类型" width="120" :edit-render="{}">
<vxe-column width="200" title="照片" field="">
</vxe-column>
<vxe-column field="insurance_expire" width="170" title="保险到期日期" :edit-render="{}">
<template #edit="{ row }">
<el-date-picker style="width: 100%;" v-model="row.insurance_expire" value-format="yyyy-MM-dd" />
</template>
</vxe-column>
<vxe-column field="inspect_date" width="170" title="年检日期" :edit-render="{}">
<template #edit="{ row }">
<el-date-picker style="width: 100%;" v-model="row.inspect_date" value-format="yyyy-MM-dd" />
</template>
</vxe-column>
<vxe-column field="maintain_expire" width="170" title="保养日期" :edit-render="{}">
<template #edit="{ row }">
<el-date-picker style="width: 100%;" v-model="row.maintain_expire" value-format="yyyy-MM-dd" />
</template>
</vxe-column>
<vxe-column field="discard_date" width="170" title="报废日期" :edit-render="{}">
<template #edit="{ row }">
<el-date-picker style="width: 100%;" v-model="row.discard_date" value-format="yyyy-MM-dd" />
</template>
</vxe-column>
<vxe-column field="end_date" width="170" title="归属结束日期" :edit-render="{}">
<template #edit="{ row }">
<el-date-picker style="width: 100%;" v-model="row.end_date" value-format="yyyy-MM-dd" />
</template>
</vxe-column>
<vxe-column field="status" title="车辆状态" width="120" :edit-render="{}">
<template #edit="{ row }">
<el-select v-model="row.status" style="width: 100%;">
<el-option :value="1" label="正常可用" />
<el-option :value="-1" label="维修中" />
</el-select>
</template>
</vxe-column>
<vxe-column field="is_open_detail" title="是否开放精准预约" width="120" :edit-render="{}">
<template #edit="{ row }">
<el-select v-model="row.type">
<el-option value="workday" label="工作日" />
<el-option value="holiday" label="节假日" />
<el-select v-model="row.is_open_detail" style="width: 100%;">
<el-option :value="1" label="开放" />
<el-option :value="0" label="不开放" />
</el-select>
</template>
</vxe-column>
<vxe-column field="reason" min-width="180" title="说明" align="center" :edit-render="{ name: 'input', attrs: { type: 'text' } }" />
<vxe-column field="operate" title="操作" min-width="220">
<vxe-column field="operate" title="操作" min-width="220" fixed="right">
<template #default="{ row }">
<template v-if="isActiveStatus(row)">
<el-button size="small" type="primary" @click="saveRowEvent(row)"></el-button>
@ -90,7 +129,8 @@ export default {
loading: false,
select: {
page: 1,
page_size: 20
page_size: 20,
// show_relation: ['photo_file']
},
total: 0,
allAlign: null,

Loading…
Cancel
Save