kpi-web/main1.html

561 lines
18 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="./scripts/vue.min.js"></script>
<script src="./scripts/vue-router.js"></script>
<!--
<script src="https://unpkg.com/vue-router@3.5.2/dist/vue-router.js"></script>
-->
<link rel="stylesheet" href="./scripts/elementindex.css">
<script src="./scripts/elementindex.js"></script>
<!--
<script src="https://unpkg.com/axios@0.21.1/dist/axios.min.js"></script>
-->
<script src="scripts/axiosmin.js"></script>
<script src="scripts/checkuser.js"></script>
<script src="scripts/loginout.js"></script>
<script src="scripts/exportfile.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/PapaParse/5.3.2/papaparse.min.js"></script>
<!--<script src="https://cdn.bootcss.com/xlsx/0.12.9/xlsx.full.min.js"></script>-->
<script src="scripts/imm.js"></script>
<script src="scripts/ibase.js"></script>
<script src="scripts/tpm.js"></script>
<script src="scripts/ledger.js"></script>
<script src="scripts/user.js"></script>
<script src="scripts/ledger-out.js"></script>
<script src="scripts/ledger-r.js"></script>
</head>
<body>
<div id="app" class="homeWrap">
<!--<el-container style="height: 100%; border: 1px solid #eee">-->
<!--<el-header style="text-align: right; font-size: 14px">-->
<!--<el-header style="height: 100%;">-->
<div style="border: 0px solid #eee;margin-bottom: 0px;height: 80px;background-color: #3C8DBC;color: #f8f8f8;display: block;">
<div style="float: right;font-size: 14px;line-height: 80px;padding-right: 10px;">
<el-dropdown @command="handleCommand">
<span class="el-dropdown-link">
{{onlineuser}}<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown" style="font-size: 12px;">
<el-dropdown-item command='exit'>退出</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div v-if="did==1" style="float: right;line-height: 80px;margin-right: 5px;">
<svg v-if="message_Data.length==0" @click="show_message" style="margin-top: 32px;cursor: pointer;" t="1684119894746" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8545" width="16" height="16"><path d="M512 986.387692a148.361846 148.361846 0 0 1-147.101538-130.520615h-287.901539a39.384615 39.384615 0 0 1-39.384615-39.384615 39.384615 39.384615 0 0 1 39.384615-39.384616h91.136V381.479385A344.300308 344.300308 0 0 1 512 37.572923a344.300308 344.300308 0 0 1 343.906462 343.906462v395.657846h91.136a39.384615 39.384615 0 0 1 39.384615 39.384615 39.384615 39.384615 0 0 1-39.384615 39.384616h-287.940924A148.361846 148.361846 0 0 1 512 986.387692z m-66.953846-130.520615a69.474462 69.474462 0 0 0 66.953846 51.751385 69.474462 69.474462 0 0 0 66.953846-51.751385z m175.852308-78.769231h156.396307V381.479385A265.452308 265.452308 0 0 0 512 116.342154a265.452308 265.452308 0 0 0-265.137231 265.137231v395.657846z" fill="#f8f8f8" p-id="8546"></path></svg>
<svg v-if="message_Data.length>0" @click="show_message" style="margin-top: 32px;cursor: pointer;" t="1684119894746" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8545" width="16" height="16"><path d="M512 986.387692a148.361846 148.361846 0 0 1-147.101538-130.520615h-287.901539a39.384615 39.384615 0 0 1-39.384615-39.384615 39.384615 39.384615 0 0 1 39.384615-39.384616h91.136V381.479385A344.300308 344.300308 0 0 1 512 37.572923a344.300308 344.300308 0 0 1 343.906462 343.906462v395.657846h91.136a39.384615 39.384615 0 0 1 39.384615 39.384615 39.384615 39.384615 0 0 1-39.384615 39.384616h-287.940924A148.361846 148.361846 0 0 1 512 986.387692z m-66.953846-130.520615a69.474462 69.474462 0 0 0 66.953846 51.751385 69.474462 69.474462 0 0 0 66.953846-51.751385z m175.852308-78.769231h156.396307V381.479385A265.452308 265.452308 0 0 0 512 116.342154a265.452308 265.452308 0 0 0-265.137231 265.137231v395.657846z" fill="#ff0000" p-id="8546"></path></svg>
</div>
<div style="text-align: center; font-size: 18px;line-height: 80px;float: none;">
<span style="font-size: 30px;font-weight: bolder;">六合生产计划管理软件 V1.0</span>
</div>
<el-drawer
title="详情"
:visible.sync="show_message_flag"
direction="rtl"
:before-close="handleClose"
size="40%"
style="margin-top: 80px;height: 60%;right: 20px;"
>
<div v-if="message_Data.length>0" >
<el-tag style="margin-left: 5px;margin-bottom: 10px;" type="success" effect="dark">
转入{{message_Data|show_msg_len}}条生产计划,请及时处理。
</el-tag>
<el-button size="small " type="primary" @click="mark_read" >标记已读</el-button>
</div>
<el-table
:data="message_Data"
style="font-size:14px;margin-left: 5px;"
:cell-style="{background:'#fff'}"
border
>
<el-table-column
prop="task_id"
label="计划/项目号"
width="150"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="product_id"
label="编号"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="total_num"
label="数量"
width="60">
</el-table-column>
<el-table-column
prop="demand_date"
label="需求日期"
width="80">
</el-table-column>
<el-table-column
prop="rdm_id"
label="RDM"
width="60"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<el-button @click="to_redmine(scope.row)" type="text" size="medium">{{scope.row.rdm_id}}</el-button>
</template>
</el-table-column>
<el-table-column
prop="conveyer"
label="交付人"
width="60">
</el-table-column>
</el-table>
</el-drawer>
</div>
<div>
<el-menu
mode="horizontal"
background-color="#304156"
text-color="#bfcbd9"
active-text-color="#ffd04b"
:default-active="$route.path" router style="padding-left: 0px;" :unique-opened=true >
<template v-for="item in NavigateItem">
<el-submenu v-if="item.items.length" :index="item.index" :key="item.key" >
<!--<template slot="title" ><svg style="position:relative; bottom:2px;" class="icon" viewBox="0 0 1024 1024" width="18" height="18"><path :d="item.svg.first" fill="#707070"></path><path :d="item.svg.second" fill="#707070"></path></svg>&nbsp;&nbsp;&nbsp;{{item.title}}</template>-->
<template slot="title" ><svg style="position:relative; bottom:2px;" class="icon" viewBox="0 0 1024 1024" width="18" height="18"><path :d="item.svg.first" fill="#f8f8f8"></path><path :d="item.svg.second" fill="#f8f8f8"></path></svg>&nbsp;&nbsp;&nbsp;{{item.title}}</template>
<el-menu-item
v-for="(it,key) in item.items"
:key="key"
:index="it.index"
style="font-size: 13px;padding-left: 20px;"
>{{it.title}}</el-menu-item>
</el-submenu>
<el-menu-item v-else :index="item.index" :key="item.key">{{ item.title }} </el-menu-item>
</template>
</el-menu>
</div>
<!--</el-header>--->
<!--<el-container>-->
<!--<el-aside width="15%" style="background-color: rgb(ff, ff, ff)">-->
<!--</el-aside>-->
<!--<el-main>-->
<div style="margin-top: 20px">
<router-view v-if="NavigateItem.length"></router-view>
</div>
<!--</el-main>
</el-container>
</el-container>-->
<el-divider></el-divider>
<div v-show="if_show" style="background-color: #ffffff;height: 30px;">
<div style="text-align: center;padding-top: 10px;font-size: 12px;">
<span>版权所有 &#169;</span>
<span style="color: #116699;">北京六合伟业科技股份有限公司</span>
</div>
</div>
</div>
<script>
history.pushState(null, null, document.URL);
window.addEventListener('popstate', function () {
console.log(document.URL);
history.pushState(null, null, document.URL);
});
setInterval(checkUser,5000);
Vue.directive('dialogDrag', {
bind(el, binding, vnode, oldVnode) {
// 获取拖拽内容头部
const dialogHeaderEl = el.querySelector('.el-dialog__header')
// 获取拖拽内容整体 这个rrc-dialog是我自己封装的组件 如果使用element的组件应写成.el-dialog
const dragDom = el.querySelector('.el-dialog') || el.querySelector('.ele-form-dialog')
dialogHeaderEl.style.cursor = 'move'
// 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null)
// const sty = window.getComputedStyle(dragDom, null)
// 鼠标按下事件
dialogHeaderEl.onmousedown = (e) => {
// 鼠标按下,计算当前元素距离可视区的距离 (鼠标点击位置距离可视窗口的距离)
const disX = e.clientX - dialogHeaderEl.offsetLeft
const disY = e.clientY - dialogHeaderEl.offsetTop
console.log('e.clientX', e.clientX)
console.log('e.clientY ', e.clientY)
console.log('dialogHeaderEl', dialogHeaderEl)
console.log('dialogHeaderEl.offsetLeft', dialogHeaderEl.offsetLeft)
console.log('dialogHeaderEl.offsetTop', dialogHeaderEl.offsetTop)
// 获取到的值带px 正则匹配替换
let styL, styT
// 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
if (sty.left.includes('%')) {
styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100)
styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100)
} else {
styL = +sty.left.replace(/\px/g, '')
styT = +sty.top.replace(/\px/g, '')
}
console.log('styL', styL)
console.log('styT', styT)
// 鼠标拖拽事件
document.onmousemove = function(e) {
// 通过事件委托,计算移动的距离 (开始拖拽至结束拖拽的距离)
const l = e.clientX - disX // 计算出从左往右边拖动了多少
const t = e.clientY - disY // 计算出从上往下拖动了多少
console.log('l', l)
console.log('t', t)
let finallyL = l + styL
let finallyT = t + styT
// 边界值判定 注意clientWidth scrollWidth区别 要减去之前的top left值
// dragDom.offsetParent表示弹窗阴影部分
if (finallyL < 0) {
// finallyL = 0
finallyL = l + styL
console.log('finallyL', finallyL)
} else if (finallyL > dragDom.offsetParent.clientWidth - dragDom.clientWidth - dragDom.offsetParent.offsetLeft) {
finallyL = dragDom.offsetParent.clientWidth - dragDom.clientWidth - dragDom.offsetParent.offsetLeft
}
if (finallyT < 0) {
// finallyT = 0
finallyT = t + styT
console.log('finallyT', finallyT)
} else if (finallyT > dragDom.offsetParent.clientHeight - dragDom.clientHeight - dragDom.offsetParent.offsetLeft) {
(
finallyT = dragDom.offsetParent.clientHeight - dragDom.clientHeight - dragDom.offsetParent.offsetLeft
)
}
// 移动当前元素
dragDom.style.left = `${finallyL}px`
dragDom.style.top = `${finallyT}px`
// 将此时的位置传出去
// binding.value({x:e.pageX,y:e.pageY})
}
document.onmouseup = function(e) {
document.onmousemove = null
document.onmouseup = null
}
}
}
})
</script>
<script>
var home = { template: '<div>welcome 首页</div>' }
var routes = [
{ path: '/imm', component: window.immcomponent },
{ path: '/ibase', component: window.ibasecomponent },
{ path: '/tpm', component: window.tpmcomponent },
{ path: '/ledger', component: window.ledgercomponent },
{ path: '/ledger_out', component: window.ledgeroutcomponent },
{ path: '/ledger_r', component: window.ledgerrcomponent },
{ path: '/user', component: window.Usercomponent },
{ path: '*', redirect: '/ledger'},
]
var router = new VueRouter({
routes: routes
})
new Vue(
{
el:"#app",
data(){
return{
ifhidden:false,
onlineuser:localStorage.getItem("online_user"),
NavigateItem:[],
if_show:false,
show_message_flag:false,
message_Data:[],
did:localStorage.getItem("did"),
level:localStorage.getItem("level"),
}
},
router:router,
filters: {
show_msg_len(data){
return data.length;
},
},
methods:{
mark_read(){
var _this = this;
axios.post('/pkpi/message_mark', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
})
.then(function (response) {
_this.show_message();
})
.catch(function (error) {
console.log(error);
});
},
show_message(){
var _this = this;
axios.post('/pkpi/get_message', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
})
.then(function (response) {
_this.$data.message_Data = response.data.data;
_this.$data.show_message_flag=true;
})
.catch(function (error) {
console.log(error);
});
},
handleClose(done) {
done();
},
handleCommand(command) {
if (command === 'exit') {
loginout();
}else if (command === 'help'){
var url = 'help.html';
url = encodeURI(url);
window.open(url, "");
}
},
},
mounted() {
var _this = this;
axios.post('/pkpi/getMenu', {
username: localStorage.getItem("online_user"),
uuid: localStorage.getItem("uuid")
})
.then(function (response) {
_this.$data.NavigateItem = response.data.data;
console.log(_this.$data.NavigateItem);
_this.$data.if_show = true;
})
.catch(function (error) {
console.log(error);
});
}
}
);
</script>
<style>
/* 设置背景色 */
.packageDownLoad-tooltip {
background: #8abcd1 !important;
}
.el-tooltip__popper[x-placement^=right] .popper__arrow{
border-right-color: #8abcd1;
}
.el-tooltip__popper[x-placement^=right] .popper__arrow:after {
border-right-color: #8abcd1;
}
.el-tooltip__popper[x-placement^=left] .popper__arrow{
border-left-color: #8abcd1;
}
.el-tooltip__popper[x-placement^=left] .popper__arrow:after {
border-left-color: #8abcd1;
}
.el-dialog__footer {
text-align: center;
}
.el-dropdown-link {
cursor: pointer;
color: #F8F8F8;
}
.el-card {
text-align: center;
padding: 10px;
font-size: 16px;
}
.el-card span{
margin-left: 3px;
}
.span{
margin-top: 10px;
}
.el-table button{
padding-top: 0px;
padding-bottom: 0px;
}
.el-divider--horizontal{
margin-top: 20px;
margin-bottom: 0px;
height: 0.5px;
background-color: #EBEEF5;
}
.el-divider--vertical{
display: inline-block;
width: 1px;
height: 100%;
margin: 0 8px;
vertical-align: middle;
position: relative;
border-top: 1px dashed #e8eaec;
}
.el-table .success-row {
background: #D9E1F2;//f0f9eb
}
.el-table .warning-row-1 {
color: #F9C57A;
}
.el-table .warning-row {
color: #ff0000;
}
.el-menu{
font-family: "Microsoft YaHei",Arial,Helvetica,sans-serif,"宋体";
}
.el-table{
font-family: "Microsoft YaHei",Arial,Helvetica,sans-serif,"宋体";
overflow: auto;
}
.t_hover_button{
color: #409EFF;
}
.t_hover_button_1{
color: #FFFFFF;
}
.el-table__body tr:hover>td{
background: #F9C57A !important;
color: #FFFFFF;
}
/*.el-table__body tr:hover > td .t_hover_button {
color: #FFFFFF;
}*/
.el-table th{
border-top: 1px solid #D4D4D4;
border-right: 1px solid #D4D4D4;
}
.el-table th:first-child{
border-left: 1px solid #D4D4D4;
}
.el-table th:first-child .cell{
padding-left: 0px;
}
.el-table td:first-child .cell{
padding-left: 0px;
}
.el-table td
{
border-right: 1px solid #D4D4D4;
border-top: 1px solid #D4D4D4;
}
.el-table td:first-child{
border-left: 1px solid #D4D4D4;
}
/*.el-table th.is-leaf,{
border-width: 0.5px;
}*/
.el-table th.gutter{
display: table-cell!important;
width: 0px;
}
.el-table td>.cell{
padding-top: 3px;
padding-bottom: 3px;
padding-left: 0rem;
padding-right: 0rem;
border-spacing: 0rem;
font-weight: normal;
text-align: center;
font-size: 13px;
}
.el-table td {
padding-top: 0rem;
padding-bottom: 0rem;
padding-left: 0rem;
padding-right: 0rem;
border-spacing: 0rem;
}
.el-table th {
padding-top: 10px;
padding-bottom: 5px;
padding-left: 0rem;
padding-right: 0rem;
border-spacing: 0rem;
}
.el-table th>.cell {
padding: 0px;
border-spacing: 0rem;
/*color:#4e545d;
font-weight: bold;*/
text-align: center;
}
.homeWrap {
/*position: absolute;*/
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.el-drawer {
overflow: visible;
}
</style>
</body>
</html>