dev
This commit is contained in:
parent
6fd2c14396
commit
a69f1c39a6
|
|
@ -11,6 +11,7 @@ ul, li {
|
|||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
outline: none!important;
|
||||
}
|
||||
|
||||
html, body {
|
||||
|
|
@ -95,3 +96,20 @@ body {
|
|||
padding: 0 !important;
|
||||
//border: 1px solid #4D6DE4 !important;
|
||||
}
|
||||
$btn-color: #4d99e4;
|
||||
$lighter-color: #6eaeed;
|
||||
.btn{
|
||||
cursor: pointer;
|
||||
width: 120px;
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
background: $btn-color;
|
||||
border-radius: 6px;
|
||||
color: #FFF;
|
||||
font-size: 15px;
|
||||
text-align: center;
|
||||
&:hover{
|
||||
background: $lighter-color;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -12,11 +12,28 @@
|
|||
</el-tabs>
|
||||
</div>
|
||||
<div class="tip">
|
||||
<el-input v-model="search_keyword" style="width: 240px" placeholder="名称/编号" :suffix-icon="Search" size="large"
|
||||
clearable @change="change_search"/>
|
||||
<div class="right">
|
||||
<el-button type="primary" @click="start_type">更新目录</el-button>
|
||||
<div class="search_input">
|
||||
<el-input v-model="search_keyword" placeholder="名称/编号" :suffix-icon="Search" size="large" clearable @change="change_search"/>
|
||||
|
||||
</div>
|
||||
<div class="search_btn"><div class="btn" @click="change_search">搜索</div></div>
|
||||
<div class="middel">
|
||||
|
||||
</div>
|
||||
<div class="op_btn">
|
||||
<el-dropdown placement="bottom">
|
||||
<div class="btn">目录更新</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item @click="start_type">基础更新</el-dropdown-item>
|
||||
<el-dropdown-item @click="openUpdateBox(1312)">有效期更新</el-dropdown-item>
|
||||
<el-dropdown-item @click="openUpdateBox(1318)">限价信息更新</el-dropdown-item>
|
||||
<el-dropdown-item @click="openUpdateBox(1319)">自付比例更新</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="content" ref="content">
|
||||
<el-table :data="tableData" v-loading="isDownLoading" style="width: 100%" height="100%">
|
||||
|
|
@ -30,13 +47,27 @@
|
|||
v-model:current-page="current_page" @current-change="change_page"/>
|
||||
</div>
|
||||
</div>
|
||||
<Mask :is-show="loading" :width="300" :height="300" title="更新版本" :close="false">
|
||||
<Mask :is-show="UpdateDirectoryLoading" :width="300" :height="300" title="更新版本" :close="false">
|
||||
{{ tip_message }}
|
||||
<div class="demo-progress" style="margin-top: 20px">
|
||||
<el-progress :percentage="100" :stroke-width="15" striped
|
||||
striped-flow :show-text="false"/>
|
||||
</div>
|
||||
</Mask>
|
||||
|
||||
<Mask :is-show="isUpdate1312" :width="600" :height="300" title="有效期更新" @close="isUpdate1312=false">
|
||||
<div class="update_box">
|
||||
<el-date-picker
|
||||
v-model="updt_time"
|
||||
type="date"
|
||||
placeholder="选择一个起始日期"
|
||||
size="default"
|
||||
/>
|
||||
<div class="btn" @click="update1312(1)">开始更新</div>
|
||||
<div class="tip">{{tip}}</div>
|
||||
</div>
|
||||
|
||||
</Mask>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -46,14 +77,17 @@ import {ElNotification, type TabsPaneContext} from 'element-plus'
|
|||
import {post} from '@/utils/request.ts'
|
||||
import {Search} from '@element-plus/icons-vue'
|
||||
import Mask from "@/components/common/Mask.vue";
|
||||
|
||||
|
||||
let isUpdate1312=ref(false)
|
||||
let isUpdate1318=ref(false)
|
||||
let isUpdate1319=ref(false)
|
||||
let updt_time = ref(new Date())
|
||||
let current_page = ref(1);
|
||||
let total_page = ref(0)
|
||||
let current_tab = ref(1301);
|
||||
let column_list = ref([]);
|
||||
let search_keyword = ref("");
|
||||
let isDownLoading = ref(false);
|
||||
let tip=ref("")
|
||||
const tabs = [
|
||||
{label: '中西成药', name: 1301},
|
||||
{label: '中药饮片', name: 1302},
|
||||
|
|
@ -69,6 +103,47 @@ const tabs = [
|
|||
];
|
||||
let tableData: any = ref([])
|
||||
let content: any = ref(null);
|
||||
let update1312 = (current_page:number) => {
|
||||
if(current_page==1){
|
||||
tip.value="开始更新第1页"
|
||||
}
|
||||
post("social/directory_upinfo/get_page", {
|
||||
updt_time: updt_time.value,
|
||||
page:current_page
|
||||
}, {catch_error: true}).then((res: any) => {
|
||||
let pages = res.pages;
|
||||
let number = res.number;
|
||||
if (current_page < pages&&isUpdate1312.value) {
|
||||
current_page++
|
||||
let percent = Math.floor((current_page / pages) * 100)
|
||||
tip.value= "开始更新第:" + current_page + "/" + pages;
|
||||
update1312(current_page);
|
||||
} else {
|
||||
tip.value= "所有更新已完成"
|
||||
isUpdate1312.value = false
|
||||
}
|
||||
|
||||
}).catch((err: any) => {
|
||||
isUpdate1312.value = false;
|
||||
current_page=1;
|
||||
})
|
||||
}
|
||||
const openUpdateBox = (type:number) => {
|
||||
//获取30天前时间
|
||||
let start_time = new Date();
|
||||
start_time.setDate(start_time.getDate() - 30);
|
||||
updt_time.value = start_time;
|
||||
if(type==1312){
|
||||
isUpdate1312.value = true
|
||||
}
|
||||
if(type==1318){
|
||||
isUpdate1318.value = true
|
||||
}
|
||||
if(type==1319){
|
||||
isUpdate1319.value = true
|
||||
}
|
||||
|
||||
}
|
||||
onMounted(() => {
|
||||
init()
|
||||
});
|
||||
|
|
@ -122,10 +197,8 @@ let change_tab = (tab: TabsPaneContext, event: Event) => {
|
|||
nextTick(()=>{
|
||||
init()
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
let loading = ref(false)
|
||||
let UpdateDirectoryLoading = ref(false)
|
||||
let uploadMsg = ref("正在更新目录,请稍后...")
|
||||
const format = ((p: number) => {
|
||||
return `正在更新`
|
||||
|
|
@ -134,12 +207,12 @@ let percentage = ref(0)
|
|||
|
||||
const tip_message = ref("正在更新目录,请稍后...")
|
||||
const start_type = () => {
|
||||
loading.value = true
|
||||
UpdateDirectoryLoading.value = true
|
||||
post("social/directory_version/get_current", {type: current_tab.value}, {catch_error: true}).then((res: any) => {
|
||||
tip_message.value = "正在更新目录,上一个版本:" + res.currentVersionName + ",请不要强制关闭程序,否则数据不完整";
|
||||
download(res.currentVersionName, current_tab.value);
|
||||
}).catch((err: any) => {
|
||||
loading.value = false;
|
||||
UpdateDirectoryLoading.value = false;
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: "当前是最新版本",
|
||||
|
|
@ -150,7 +223,7 @@ const start_type = () => {
|
|||
let download = (ver: any, type: any) => {
|
||||
post("social/directory/download", {ver: ver, type: type}).then((res: any) => {
|
||||
if (res == null || res == "") {
|
||||
loading.value = false;
|
||||
UpdateDirectoryLoading.value = false;
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: "当前是最新版本",
|
||||
|
|
@ -162,7 +235,7 @@ let download = (ver: any, type: any) => {
|
|||
start_type()
|
||||
|
||||
}).catch((err: any) => {
|
||||
loading.value = false;
|
||||
UpdateDirectoryLoading.value = false;
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: "当前是最新版本",
|
||||
|
|
@ -174,6 +247,12 @@ let download = (ver: any, type: any) => {
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.update_box{
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 20px;
|
||||
}
|
||||
.container-wrapper {
|
||||
box-sizing: border-box;
|
||||
padding: 20px;
|
||||
|
|
@ -182,6 +261,7 @@ let download = (ver: any, type: any) => {
|
|||
flex-direction: column;
|
||||
height: 100%;
|
||||
|
||||
|
||||
.top {
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
|
|
@ -193,7 +273,21 @@ let download = (ver: any, type: any) => {
|
|||
|
||||
.tip {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.search_input{
|
||||
flex: 1;
|
||||
}
|
||||
.search_btn{
|
||||
width: 140px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
.middel{
|
||||
width: 200px;
|
||||
}
|
||||
.op_btn{
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.content {
|
||||
|
|
|
|||
Loading…
Reference in New Issue