This commit is contained in:
weipengfei 2023-08-15 17:10:07 +08:00
parent 0786519038
commit 31e6dea192
5 changed files with 440 additions and 393 deletions

View File

@ -2,7 +2,7 @@ import type { App } from 'vue'
import 'highlight.js/styles/github.css'
import hljs from 'highlight.js/lib/common'
import hljsVuePlugin from '@highlightjs/vue-plugin'
console.log(hljs)
// console.log(hljs)
export default (app: App<Element>) => {
app.use(hljsVuePlugin)
}

View File

@ -57,10 +57,14 @@
align="center"
>
<template #default="{ row }">
{{ row.company.company_name || '/' }}
{{ row.company.company_name || "/" }}
</template>
</el-table-column>
<el-table-column label="所在乡镇" prop="street_name" min-width="120" />
<el-table-column
label="所在乡镇"
prop="street_name"
min-width="120"
/>
<el-table-column label="授权身份" prop="role_name" min-width="120" />
<el-table-column
label="是否签约"
@ -69,11 +73,17 @@
min-width="120"
>
<template #default="{ row }">
<span v-if="row.is_contract == 1" style="color: #67c23a">已签约</span>
<span v-if="row.is_contract == 1" style="color: #67c23a"
>已签约</span
>
<span v-else style="color: #fe0000">未签约</span>
</template>
</el-table-column>
<el-table-column label="最近登录时间" prop="login_time" min-width="180" />
<el-table-column
label="最近登录时间"
prop="login_time"
min-width="180"
/>
<el-table-column
label="创建时间"
prop="create_time"
@ -81,7 +91,11 @@
align="center"
/>
<el-table-column label="最近登录IP" prop="login_ip" min-width="120" />
<el-table-column label="账号状态" min-width="100" v-perms="['auth.admin/edit']">
<el-table-column
label="账号状态"
min-width="100"
v-perms="['auth.admin/edit']"
>
<template #default="{ row }">
<el-switch
v-if="row.root != 1"
@ -93,7 +107,12 @@
</template>
</el-table-column>
<el-table-column label="操作" width="230" align="center" fixed="right">
<el-table-column
label="操作"
width="230"
align="center"
fixed="right"
>
<template #default="{ row }">
<div style="display: flex">
<el-button
@ -171,10 +190,16 @@
确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约
</div>
<p class="btn_menu">
<el-button type="primary" size="large" v-if="showConctactPop" @click="creContct"
<el-button
type="primary"
size="large"
v-if="showConctactPop"
@click="creContct"
>确认创建</el-button
>
<el-button type="primary" size="large" v-else @click="sendMsg">确认</el-button>
<el-button type="primary" size="large" v-else @click="sendMsg"
>确认</el-button
>
<el-button type="info" size="large" @click="offPop">返回</el-button>
</p>
</el-dialog>
@ -188,48 +213,48 @@ import {
adminDelete,
generateGontract,
sendMsgApi,
abolition
} from '@/api/perms/admin'
import { roleAll } from '@/api/perms/role'
import { useDictOptions } from '@/hooks/useDictOptions'
import { usePaging } from '@/hooks/usePaging'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
const route = useRoute()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
abolition,
} from "@/api/perms/admin";
import { roleAll } from "@/api/perms/role";
import { useDictOptions } from "@/hooks/useDictOptions";
import { usePaging } from "@/hooks/usePaging";
import feedback from "@/utils/feedback";
import EditPopup from "./edit.vue";
const route = useRoute();
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
//
const formData = reactive({
name: '',
role_id: '',
company_id: ''
})
const contractId = ref('')
name: "",
role_id: "",
company_id: "",
});
const contractId = ref("");
//
const showPop = ref(false)
const showConctactPop = ref(false)
const showPop = ref(false);
const showConctactPop = ref(false);
const offPop = () => {
showPop.value = false
showConctactPop.value = false
}
showPop.value = false;
showConctactPop.value = false;
};
const creContct = () => {
// feedback.msgSuccess("");
generateGontract({ id: contractId.value }).then(() => {
feedback.msgSuccess('发送成功')
})
offPop()
}
feedback.msgSuccess("发送成功");
});
offPop();
};
const sendMsg = () => {
sendMsgApi({ id: contractId.value }).then((res) => {
feedback.msgSuccess('发送成功')
})
offPop()
}
feedback.msgSuccess("发送成功");
});
offPop();
};
//
const showEdit = ref(false)
const showEdit = ref(false);
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: adminLists,
params: formData
})
params: formData,
});
const changeStatus = (data: any) => {
adminEdit({
@ -238,65 +263,65 @@ const changeStatus = (data: any) => {
name: data.name,
role_id: data.role_id,
disable: data.disable,
multipoint_login: data.multipoint_login
multipoint_login: data.multipoint_login,
}).finally(() => {
getLists()
})
}
getLists();
});
};
//
const isCheck = ref(false)
const isCheck = ref(false);
const handleCheck = async (data: any) => {
isCheck.value = true
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
}
isCheck.value = true;
showEdit.value = true;
await nextTick();
editRef.value?.open("edit");
editRef.value?.setFormData(data);
};
const handleAdd = async () => {
isCheck.value = false
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
isCheck.value = false;
showEdit.value = true;
await nextTick();
editRef.value?.open("add");
};
const handleEdit = async (data: any) => {
isCheck.value = false
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
}
isCheck.value = false;
showEdit.value = true;
await nextTick();
editRef.value?.open("edit");
editRef.value?.setFormData(data);
};
const handleView = async (data: any) => {
isCheck.value = false
showEdit.value = true
await nextTick()
editRef.value?.open('view')
editRef.value?.setFormData(data)
}
isCheck.value = false;
showEdit.value = true;
await nextTick();
editRef.value?.open("view");
editRef.value?.setFormData(data);
};
const handleDelete = async (id: number) => {
await feedback.confirm('确定要删除?')
await adminDelete({ id })
getLists()
}
await feedback.confirm("确定要删除?");
await adminDelete({ id });
getLists();
};
const handleAbolition = async (id: number) => {
await feedback.confirm('确定要废除合同?')
await abolition({ id })
getLists()
}
await feedback.confirm("确定要废除合同?");
await abolition({ id });
getLists();
};
const { optionsData } = useDictOptions<{
role: any[]
role: any[];
}>({
role: {
api: roleAll
}
})
api: roleAll,
},
});
if (route.query.company_id) {
formData.company_id = route.query.company_id?.toString()
formData.company_id = route.query.company_id?.toString();
}
onMounted(() => {
getLists()
})
getLists();
});
</script>
<style lang="scss" scoped>
h1 {

View File

@ -3,7 +3,7 @@
<el-card class="!border-none" v-loading="loading" shadow="never">
<div style="display: flex; justify-content: space-between">
<el-button
v-perms="['flow_type/add']"
v-perms="['task.taskCalendar/add']"
type="primary"
@click="handleAdd"
>

View File

@ -1,7 +1,12 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px] formtabel" :model="queryParams" inline label-width="100px">
<el-form
class="mb-[-16px] formtabel"
:model="queryParams"
inline
label-width="100px"
>
<el-form-item label="区域经理" prop="create_user_id">
<el-input
class="w-[280px]"
@ -19,7 +24,9 @@
/>
</el-form-item>
<el-form-item>
<el-button class="el-btn" type="primary" @click="resetPage">查询</el-button>
<el-button class="el-btn" type="primary" @click="resetPage"
>查询</el-button
>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
@ -46,8 +53,16 @@
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="区域经理" prop="admin_name" show-overflow-tooltip />
<el-table-column label="公司" prop="company_name" show-overflow-tooltip />
<el-table-column
label="区域经理"
prop="admin_name"
show-overflow-tooltip
/>
<el-table-column
label="公司"
prop="company_name"
show-overflow-tooltip
/>
<el-table-column
label="公司类型"
prop="company_type_name"
@ -70,13 +85,13 @@
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button v-perms="['task.calendar']" type="primary" link>
<el-button v-perms="['task.task_calendar']" type="primary" link>
<router-link
:to="{
path: getRoutePath('task.calendar'),
path: getRoutePath('task.task_calendar'),
query: {
id: row.id
}
id: row.id,
},
}"
>任务日程</router-link
>
@ -100,65 +115,68 @@
</template>
<script lang="ts" setup name="taskSchedulingLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiTaskSchedulingLists, apiTaskSchedulingEdit } from '@/api/task_scheduling'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import { dictDataLists } from '@/api/setting/dict'
import { getRoutePath } from '@/router'
import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions";
import {
apiTaskSchedulingLists,
apiTaskSchedulingEdit,
} from "@/api/task_scheduling";
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
import EditPopup from "./edit.vue";
import { dictDataLists } from "@/api/setting/dict";
import { getRoutePath } from "@/router";
const datalist = ref([])
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const datalist = ref([]);
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
//
const showEdit = ref(false)
const showEdit = ref(false);
//
const queryParams = reactive({
create_user_id: '',
template_id: '',
company_id: '',
type: '',
status: ''
})
create_user_id: "",
template_id: "",
company_id: "",
type: "",
status: "",
});
//
const selectData = ref<any[]>([])
const selectData = ref<any[]>([]);
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
selectData.value = val.map(({ id }) => id);
};
//
const { dictData } = useDictData('')
const { dictData } = useDictData("");
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiTaskSchedulingLists,
params: queryParams
})
params: queryParams,
});
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
showEdit.value = true;
await nextTick();
editRef.value?.open("add");
};
const changeStatus = (data: any) => {
apiTaskSchedulingEdit({
id: data.id,
status: data.status
status: data.status,
}).finally(() => {
getLists()
})
}
getLists();
});
};
dictDataLists({ type_id: 10 }).then((res) => {
datalist.value = res.lists
})
datalist.value = res.lists;
});
getLists()
getLists();
</script>
<style lang="scss" scoped>
.formtabel {

View File

@ -100,7 +100,11 @@
fixed="right"
>
<template #default="{ row }">
<el-button v-perms="['flow/edit']" type="primary" link>
<el-button
v-perms="['user_informationg.user_informationg/details']"
type="primary"
link
>
<router-link
:to="{
path: 'user_informationg/details',