首次提交

This commit is contained in:
lupeng_zz 2026-04-03 16:25:30 +08:00
parent 270aeccb57
commit 3c4c5be60e
40 changed files with 32613 additions and 0 deletions

8
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

6
.idea/misc.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/pp-web.iml" filepath="$PROJECT_DIR$/.idea/pp-web.iml" />
</modules>
</component>
</project>

9
.idea/pp-web.iml Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

236
login.html Normal file
View File

@ -0,0 +1,236 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="./scripts/vue.min.js"></script>
<link rel="stylesheet" href="./scripts/elementindex.css">
<script src="./scripts/elementindex.js"></script>
<!--//vue element-ui-css element-ui-js
<script src="https://unpkg.com/vue@2.6.14/dist/vue.js"></script>
<link rel="stylesheet" href="https://unpkg.com/element-ui@2.15.5/lib/theme-chalk/index.css">
<script src="https://unpkg.com/element-ui@2.15.5/lib/index.js"></script>
-->
<script src="scripts/axiosmin.js"></script>
<!--
<script>
localStorage.setItem("online_user","");
localStorage.setItem("uuid","");
</script>
-->
<style>
/*.svg-background {
background: url(scripts/png/bg.jpg);
background-size: 100% 100%;
background-repeat: no-repeat;
background-attachment: fixed;
margin: 0;
padding: 0;
}*/
.svg-background {
background: url(scripts/png/3-1.jpg);
background-size: 100% 100%;
background-repeat: no-repeat;
background-attachment: fixed;
margin: 0;
padding: 0;
}
</style>
</head>
<body class="svg-background">
<div id="app" >
<template>
<div>
<el-form ref="loginForm" :model="form" :rules="rules" label-width="138px" class="login-box">
<h3 class="login-title" style="font-size: 50px;color: #f8f8f8;">六合采购计划管理软件</h3>
<el-form-item label="账号" prop="username">
<el-input type="text" placeholder="请输入账号" v-model="form.username" style="width: 262px;" />
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input type="password" placeholder="请输入密码" v-model="form.password" style="width: 262px;"/>
</el-form-item>
<el-form-item>
<el-button style="width: 262px;" round type="primary" v-on:click="onSubmit('loginForm')">登录</el-button>
<!--<el-button style="width: 124px;" round type="primary" v-on:click="register('loginForm')">注册</el-button>-->
</el-form-item>
</el-form>
<el-dialog title="温馨提示"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose"
:lock-scroll ="false">
<span>请输入账号和密码</span>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
</div>
<script>
new Vue(
{
el: "#app",
data() {
return {
form: {
username: '',
password: ''
},
rules: {
username: [
{ required: true, message: '账号不可为空', trigger: 'blur' }
],
password: [
{ required: true, message: '密码不可为空', trigger: 'blur' }
]
},
dialogVisible: false
}
},
methods: {
onSubmit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
//window.open("main.html","_self","baidu.com");
var _this = this;
axios.post('/pp/login', {
username: _this.$data.form.username,
password: _this.$data.form.password
})
.then(function (response) {
if (response.status != 200 || response.data.r !=0) {
if (response.data.r ==1) {
_this.$message({
message: "用户已登录!",
type: "error",
duration: 1500
});
}else{
_this.$message({
message: "登录失败,请检查用户名和密码是否正确!",
type: "error",
duration: 1500
});
}
}else{
localStorage.setItem("online_user",_this.$data.form.username);
localStorage.setItem("uuid",response.data.uuid);
localStorage.setItem("level",response.data.roleid);
localStorage.setItem("did",response.data.did);
location.href=response.data.url;
}
})
.catch(function (error) {
console.log(error);
});
}
/*else {
this.dialogVisible = true;
return false;
}*/
});
},
register(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
//window.open("main.html","_self","baidu.com");
var _this = this;
axios.post('/deescloud/registerUser', {
username: _this.$data.form.username,
password: _this.$data.form.password
})
.then(function (response) {
if (response.status != 200 || response.data.r !=0) {
if (response.data.r ==1) {
_this.$message({
message: "用户已注册!",
type: "error",
duration: 1500
});
}else{
_this.$message({
message: "注册失败!",
type: "error",
duration: 1500
});
}
}else{
_this.$message({
message: "注册成功!",
type: "success",
duration: 1500
});
}
})
.catch(function (error) {
console.log(error);
});
}
/*else {
this.dialogVisible = true;
return false;
}*/
});
},
handleClose(done) {
this.$confirm("确认关闭?")
.then(_ => {
done();
})
.catch(_ => { });
}
}
})
</script>
<style lang="scss" scoped>
.el-form-item__label {
color: #f8f8f8;
}
.login-box {
/*border: 1px solid #DCDFE6;*/
width: 500px;
margin: 180px auto;
padding: 35px 35px 15px 35px;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
/*box-shadow: 0 0 25px #909399;*/
}
.login-title {
text-align: center;
margin: 0 auto 40px auto;
color: #303133;
}
</style>
</body>
</html>

601
main.html Normal file
View File

@ -0,0 +1,601 @@
<!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/welldata.js"></script>
<script src="scripts/user.js"></script>
<script src="scripts/based.js"></script>
<script src="scripts/loginout.js"></script>
<script src="scripts/exportfile.js"></script>
<script src="scripts/papaparse.min.js"></script>
<!--<script src="https://cdn.bootcss.com/xlsx/0.12.9/xlsx.full.min.js"></script>-->
<script src="scripts/pf.js"></script>
<script src="scripts/ds.js"></script>
<script src="scripts/rsm.js"></script>
<script src="scripts/payment.js"></script>
<script src="scripts/sp1.js"></script>
<script src="scripts/sp2.js"></script>
<script src="scripts/searchByCode.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: 60px;background-color: #3C8DBC;color: #f8f8f8;display: block;">
<div style="float: right;font-size: 14px;line-height: 60px;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: 60px;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;height: calc(100vh - 208px);">
<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: '/scb', component: window.Wellcomponent },
{ path: '/user', component: window.Usercomponent },
{ path: '/puser', component: window.pUsercomponent },
{ path: '/buser', component: window.bUsercomponent },
{ path: '/base_data', component: window.Basecomponent },
{ path: '/pf', component: window.pfcomponent },
{ path: '/ds', component: window.dscomponent },
{ path: '/rsm', component: window.rsmcomponent },
{ path: '/payment', component: window.Paymentcomponent },
{ path: '/sp_1', component: window.sp1component },
{ path: '/sp_2', component: window.sp2component },
{ path: '/search_code', component: window.searchbycodecomponent },
{ path: '*', redirect: '/scb'},
]
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/get_message', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
})
.then(function (response) {
_this.$data.message_Data = response.data.data;
})
.catch(function (error) {
console.log(error);
});*/
axios.post('/pp/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 .child-row {
background: #8DE084;//f0f9eb
color: #FFFFFF;
}
.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: #134857 !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: 1px;
}
.el-table td:first-child .cell{
padding-left: 1px;
}
.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;
}
.fullscreen-dialog {
width: 100vw;
height: 100vh;
margin: 0;
padding: 0;
margin-top: 0px;
}
.custom-input_red input {
color: red;
}
.custom-input_yellow input {
color: #fad355;
}
</style>
</body>
</html>

3
scripts/axiosmin.js Normal file

File diff suppressed because one or more lines are too long

25
scripts/babel.min.js vendored Normal file

File diff suppressed because one or more lines are too long

970
scripts/based.js Normal file
View File

@ -0,0 +1,970 @@
var Basecomponent = {
template:`
<div>
<div id="" style="display: flex">
<el-input v-model="code_v" placeholder="编号" clearable style="width: 150px;" @change="input_change"></el-input>
<el-input v-model="name_v" placeholder="名称" clearable style="width: 150px;" @change="input_change"></el-input>
<el-input v-model="supplier_v" placeholder="供应商" clearable style="width: 150px;" @change="input_change"></el-input>
<el-date-picker
style="width: 150px;"
v-model="begin_t_v"
type="date"
placeholder="开始日期"
format="yyyy-MM-dd"
value-format="yyyy/MM/dd"
>
</el-date-picker>
<el-date-picker
style="width: 150px;"
v-model="end_t_v"
type="date"
placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy/MM/dd"
>
</el-date-picker>
<el-checkbox style="margin: 0px;" v-model="checked" @change="if_fin_cahnge" border>已删除</el-checkbox>
<el-button id ="bt_search" plain type="primary" icon="el-icon-search" @click="get_material()">搜索</el-button>
<el-button plain type="primary" icon="el-icon-circle-plus-outline" @click="importCsv()">导入审批物料</el-button>
<!--<el-button style="margin-left: 10px;" id ="bt_export" plain type="primary" icon="el-icon-document" @click="exportSap()">导出</el-button>
-->
<el-button id ="bt_del" plain type="primary" icon="el-icon-circle-plus-outline" @click="del_material()">删除</el-button>
</div>
<div>
<el-progress v-if="if_show_process" :percentage="percent_len" ></el-progress>
</div>
<div class="span">
<el-table
:data="tableData"
style="width: 100%"
:height="tHeight"
:cell-style="{background:'#fff'}"
border
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
>
</el-table-column>
<el-table-column
v-if="if_show_del_filed==true"
prop="del_user"
label="删除人员"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
v-if="if_show_del_filed==true"
prop="del_time"
label="删除时间"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="supplier"
label="供应商名称"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="supplier_code"
label="供应商编号"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="pt"
label="付款方式"
width="80"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="code"
label="六合编号"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="name"
label="名称"
width="120"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="spec"
label="规格"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="unit"
label="单位"
width="60"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="price"
label="单价"
width="60"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<div style="float: right;">{{scope.row.price}}</div>
</template>
</el-table-column>
<el-table-column
prop="update_date"
label="更新日期"
width="80"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="pc"
label="采购周期"
width="80"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="vpoq"
label="有效期"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="effective_time"
label="有效时间"
width="120"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="price_2"
label="单价2"
width="80"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<div style="float: right;">{{scope.row.price_2}}</div>
</template>
</el-table-column>
<el-table-column
prop="update_date_2"
label="更新2"
width="80"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="price_3"
label="单价3"
width="80"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<div style="float: right;">{{scope.row.price_3}}</div>
</template>
</el-table-column>
<el-table-column
prop="update_date_3"
label="更新3"
width="80"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="price_4"
label="单价4"
width="80"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<div style="float: right;">{{scope.row.price_4}}</div>
</template>
</el-table-column>
<el-table-column
prop="update_date_4"
label="更新4"
width="80"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="price_5"
label="单价5"
width="80"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<div style="float: right;">{{scope.row.price_5}}</div>
</template>
</el-table-column>
<el-table-column
prop="update_date_5"
label="更新5"
width="80"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="factory"
label="生产厂家"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="factory_code"
label="厂商编号"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="qs"
label="质量标准"
width="100"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<el-button @click="down_qs_files(scope.row)" type="text" size="small">{{scope.row.qs}}</el-button>
</template>
</el-table-column>
<el-table-column
label="操作"
width="120">
<template slot-scope="scope">
<el-upload
class="upload-demo"
ref="upload"
action="/pp/upload_ds_file"
:on-change="handleChange_file"
:file-list="fileList"
:show-file-list="false"
:on-success="upload_file_success"
:on-error="upload_file_error"
:data="upload_param(scope.row)">
<el-button slot="trigger" size="medium" type="success" >上传</el-button>
</el-upload>
</template>
</el-table-column>
<el-table-column
prop="as"
label="验收标准"
width="100"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<el-button @click="down_as_files(scope.row)" type="text" size="small">{{scope.row.as}}</el-button>
</template>
</el-table-column>
<el-table-column
label="操作"
width="120">
<template slot-scope="scope">
<el-upload
class="upload-demo"
ref="upload"
action="/pp/upload_ds_file"
:on-change="handleChange_file"
:file-list="fileList"
:show-file-list="false"
:on-success="upload_file_success"
:on-error="upload_file_error"
:data="upload_param_2(scope.row)">
<el-button slot="trigger" size="medium" type="success" >上传</el-button>
</el-upload>
</template>
</el-table-column>
<!--
<el-table-column
label="操作"
width="100">
<template slot-scope="scope">
<el-button @click="update_p(scope.row)" type="text" size="medium" >修改</el-button>
</template>
</el-table-column>
-->
</el-table>
</div>
<div class="block">
<span class="demonstration"></span>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[50,100, 200, 300]"
:page-size="pagesize"
layout="total, sizes, prev, pager, next, jumper"
:total="recordTotal">
</el-pagination>
</div>
<el-dialog
title="产品信息"
:visible.sync="dialogVisible"
:lock-scroll ="false"
width="40%"
style="height: 100%;">
<el-form ref="form_p" :model="form" label-width="80px" :rules="rules">
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="产品编号" prop="p_id">
<el-input v-model="form.p_id" :disabled="disabled"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品名称" prop="p_name">
<el-input v-model="form.p_name" ></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button id ="bt_ok" plain type="primary" @click="post_p()"> </el-button>
</span>
</el-dialog>
<el-dialog
title="导入审批物料"
:visible.sync="importdialogVisible"
:lock-scroll ="false"
:before-close="importDialog_close"
width="95%">
<div style="display: flex;">
<el-upload
class="upload-demo"
action=""
:on-change="handleChange"
:file-list="fileListUpload"
:show-file-list="false"
accept=".csv"
:auto-upload="false">
<el-button id ="bt_upload" size="small" plain type="primary">点击上传csv文件</el-button>
</el-upload>
<el-button id ="bt_import" size="small" plain type="primary" @click="importData" style="margin-left: 10px;">确认导入</el-button>
<el-button id ="bt_download" size="small" plain type="primary" @click="download_template" style="margin-left: 10px;">下载导入模板文件</el-button>
</div>
<div>
<el-progress v-if="if_show_process1" :percentage="percent_len" ></el-progress>
</div>
<el-table
:data="importTableData"
style="font-size:13px;margin-top: 10px;width: 100%;"
:height="tHeight"
:cell-style="{background:'#fff'}"
stripe border>
<el-table-column
prop="supplier"
label="供应商名称"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="supplier_code"
label="供应商编号"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="pt"
label="付款方式"
width="80"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="code"
label="六合编号"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="name"
label="名称"
width="120"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="spec"
label="规格"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="unit"
label="单位"
width="60"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="price"
label="单价"
width="60"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="update_date"
label="更新日期"
width="80"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="pc"
label="采购周期"
width="80"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="vpoq"
label="有效期"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="factory"
label="生产厂家"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="factory_code"
label="厂商编号"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="qs"
label="质量标准"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="as"
label="验收标准"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
</el-table>
</el-dialog>
</div>
`,
data(){
// 获取当前屏幕的分辨率
let screenW = window.screen.width;
let screenH = window.innerHeight;
console.log("screen width:",screenW);
console.log("screen height:",screenH);
return {
tHeight:screenH-40-232,
tableData: [],
currentPage: 1,
pagesize:50,
recordTotal:0,
code_v:'',
name_v:'',
supplier_v:'',
form: {
id:'',
p_id: '',
p_name:'',
},
dialogVisible:false,
oper_type:0,
rules: {
p_id: [
{ required: true, message: '产品编号不可为空', trigger: 'blur' }
],
p_name: [
{ required: true, message: '产品名称不可为空', trigger: 'blur' }
],
},
multipleSelection: [],
importdialogVisible:false,
fileListUpload:[],
importTableData:[],
disabled:true,
if_show_process:false,
percent_len:0,
interval:'',
if_show_process1:false,
begin_t_v:'',
end_t_v:'',
fileList:[],
checked:false,
if_show_del_filed:false,
}
},
mounted() {
this.get_material()
},
methods: {
if_fin_cahnge(val){
if(val){
this.$data.if_show_del_filed=true;
this.$data.tableData =[];
}else{
this.$data.if_show_del_filed=false;
this.$data.tableData =[];
}
this.get_material();
},
del_material(){
var ids =[];
for (var i = 0; i < this.$data.multipleSelection.length; i++) {
ids.push(this.$data.multipleSelection[i].id);
}
var _this = this;
axios.post('/pp/del_material', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
ids: ids,
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
s = "删除成功!";
errType = "success"
} else{
s = "删除失败!";
errType = "error"
}
_this.$message({
message: s,
type: errType,
duration: 1500
});
if (r ==0) {
_this.get_material();;//更新页面
}
})
.catch(function (error) {
console.log(error);
});
},
down_qs_files(row){
var downUrl = '/pp/download_ds_file'+"?id="+row.qs;
downloadUrl(row.qs,downUrl);
},
down_as_files(row){
var downUrl = '/pp/download_ds_file'+"?id="+row.as;
downloadUrl(row.as,downUrl);
},
upload_param_2(row){
//console.log("---")
return {
id:row.id,
file_type:"2"
}
},
upload_param(row){
console.log("---")
return {
id:row.id,
file_type:"1"
}
},
upload_file_error(response, file, fileList){
this.$message({
message: "上传失败",
type: "error",
duration: 1500
});
},
upload_file_success(response, file, fileList){
this.$message({
message: "上传成功",
type: "success",
duration: 1500
});
this.get_material();
},
handleChange_file(file, fileList) {
console.log(file);
this.fileList = fileList.slice(-1);
},
download_template(){
document.getElementById("bt_download").blur();
var downUrl = '/pp/download_file'+"?id="+"审批导入.csv";
downloadUrl("导入审批物料模版.csv",downUrl);
},
input_change(value) {
console.log(value);
this.get_material();
},
exportSap(){
document.getElementById("bt_export").blur();
var _this = this;
var objs;
axios.post('/u_ma/export_sap', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
p_id: _this.$data.p_id_v,
p_name: _this.$data.p_name_v,
})
.then(function (response) {
console.log(response.data);
var fileid = response.data.fileId;
var downUrl = '/u_ma/download_file'+"?id="+fileid;
downloadUrl("产品编码名称.csv",downUrl);
})
.catch(function (error) {
console.log(error);
});
},
importData(){
document.getElementById("bt_import").blur();
if(this.$data.importTableData.length==0){
this.$message({
message: "请选择导入文件",
type: "warning",
duration: 1500
});
return;
}
this.$confirm('是否确认导入?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var _this = this;
_this.$data.percent_len=0;
_this.$data.if_show_process1=true;
_this.$data.interval= setInterval(()=>{
if(_this.$data.percent_len>=99){
clearInterval(_this.$data.interval);
return;
}
if (_this.$data.percent_len<98){
_this.$data.percent_len+=2
}
},20)
axios.post('/pp/import_approve_m', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
data:this.$data.importTableData,
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
let len = _this.$data.importTableData.length;
errType = "success"
s = "导入"+len+"条物料成功,批准后更新!";
_this.$data.percent_len=100;
_this.$data.if_show_process1=false;
} else if(r == 1) {
errType = "error"
s = "正在导入物料,请稍后!";
clearInterval(_this.$data.interval);
} else if(r == 2) {
errType = "error"
s = response.data.context;
clearInterval(_this.$data.interval);
} else{
errType = "error"
s = "导入物料失败!";
clearInterval(_this.$data.interval);
}
console.log(s);
_this.$message({
message: s,
type: errType,
duration: 3000
});
_this.$data.importdialogVisible=false;
//更新页面
//_this.get_p();
})
.catch(function (error) {
console.log(error);
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
return;
});
},
handleChange(file, fileList) {
document.getElementById("bt_upload").blur();
this.fileTemp = file.raw
console.log("filetype:",this.fileTemp);
if (this.fileTemp) {
console.log("begin ...")
console.log(this.fileTemp.type);
if ((this.fileTemp.type == 'text/csv') || (this.fileTemp.type == '.csv') || (this.fileTemp.type == 'application/vnd.ms-excel')) {
let _this = this//如果需要点击事件结束之后对DOM进行操作使用)_this.xx=xx进行操作
Papa.parse(_this.fileTemp, {
encoding:'gb2312',
complete (results) {
console.log(results)//这个是csv文件的数据
let data = []
//遍历csv文件中的数据存放到data中 方法不唯一,可自己更改
console.log(results.data)
for (let i = 0; i < results.data.length; ++i) {
if(i==0){
continue;
}
let obj = {}
obj.supplier = results.data[i][0]
if(obj.supplier==""|| obj.supplier==undefined){
continue;
}
obj.supplier_code = results.data[i][1]
/*if(obj.supplier_code==""|| obj.supplier_code==undefined){
continue;
}*/
obj.pt = results.data[i][2]
/*if(obj.pt==""|| obj.pt==undefined){
continue;
}*/
obj.code = results.data[i][3]
/*if(obj.code==""|| obj.code==undefined){
continue;
}*/
obj.name = results.data[i][4]
/*if(obj.name==""|| obj.name==undefined){
continue;
}*/
obj.spec = results.data[i][5]
/*if(obj.spec==""|| obj.spec==undefined){
continue;
}*/
obj.unit = results.data[i][6]
/*if(obj.unit==""|| obj.unit==undefined){
continue;
}*/
obj.price = results.data[i][7]
/*if(obj.price==""|| obj.price==undefined){
continue;
}*/
obj.update_date = results.data[i][8]
/*if(obj.update_date==""|| obj.update_date==undefined){
continue;
}*/
obj.pc = results.data[i][9]
/*if(obj.pc==""|| obj.pc==undefined){
continue;
}*/
obj.vpoq = results.data[i][10]
/*if(obj.vpoq==""|| obj.vpoq==undefined){
continue;
}*/
obj.factory = results.data[i][11]
obj.factory_code = results.data[i][12]
obj.qs = results.data[i][13]
obj.as = results.data[i][14]
console.log(i,":",obj);
data.push(obj)
}
//data.splice(0, 1)//将数组第一位的表格名称去除
let num = 0
console.log('data', data)
_this.$data.importTableData=data;
}
})
} else {
this.$data.fileListUpload=[];
this.$message({
type: 'warning',
message: '附件格式错误,请删除后重新上传!'
})
}
} else {
this.$message({
type: 'warning',
message: '请上传附件!'
})
}
},
importCsv(){
this.$data.fileListUpload=[];
this.$data.importTableData=[];
this.$data.importdialogVisible=true;
},
importDialog_close(done){
done();
},
handleSelectionChange(val) {
console.log("已选择");
console.log(val);
this.multipleSelection = val;
},
post_p(){
this.$refs['form_p'].validate((valid) => {
if(valid){
this.$data.dialogVisible = false;
var _this = this;
console.log(_this.$data.form);
var objs;
axios.post('/u_ma/post_p', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
id: _this.$data.form.id,
p_id: _this.$data.form.p_id,
p_name: _this.$data.form.p_name,
oper_type: _this.$data.oper_type,
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
errType = "success"
} else{
errType = "error"
}
if (_this.$data.oper_type == 1) {
if (r ==0) {
s = "新增产品信息成功!";
} else if(r == 1) {
s = "已存在相同产品信息!";
}else{
s = "新增产品信息失败!";
}
} else if (_this.$data.oper_type ==2){
if (r ==0) {
s = "修改产品信息成功!";
} else{
s = "修改产品信息失败!";
}
}
_this.$message({
message: s,
type: errType,
duration: 1500
});
//更新页面
_this.get_p();
})
.catch(function (error) {
console.log(error);
});
}
});
},
update_p(info){
this.$data.disabled=true;
this.$data.oper_type = 2;
this.$data.form = {
id:info.id,
p_id: info.p_id,
p_name:info.p_name,
};
this.$nextTick(() => {
this.$refs['form_p'].clearValidate()
});
this.$data.dialogVisible = true;
},
get_material(){
document.getElementById("bt_search").blur();
//this.$data.currentPage=1;
var _this = this;
var objs;
axios.post('/pp/get_material', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
index: this.$data.currentPage,
count: this.$data.pagesize,
code: this.$data.code_v,
name:this.$data.name_v,
supplier:this.$data.supplier_v,
bt:this.$data.begin_t_v,
et:this.$data.end_t_v,
if_del:this.$data.checked,
})
.then(function (response) {
console.log(response.data);
objs = response.data.data;
rcnt = response.data.total;
_this.$data.tableData = objs;
_this.$data.recordTotal = rcnt;
})
.catch(function (error) {
console.log(error);
});
},
handleSizeChange(val) {
this.$data.pagesize = val;
this.get_material();
},
handleCurrentChange(val) {
this.$data.currentPage = val;
this.get_material();
}
}
}

171
scripts/browser.js Normal file
View File

@ -0,0 +1,171 @@
/*
# Copyright 2014, Viktor Wahlberg.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Main browser.js Object...
var browserJS = new Object;
// browser.js userAgent array for quick and accurate lookup, if userAgent is added...
browserJS.userAgentStringArray = {
/*
All userAgent strings listed below are incomplete. The object has been
constructed this way so that multiple versions of the same browser can
be detected using the same string. These dynamic values of the
userAgent string are replaced with a underscore followed by a name in
all caps and ended with another underscore. Each of these variables
are handled in the init function.
*/
"Mozilla/5.0 (_OS_) Gecko/_GECKO_ Firefox/_VERSION_": {
"name": "Forefox",
"userAgentLayout": "os,gecko,version"
},
"Mozilla/5.0 (_OS_) AppleWebKit/_WEBKIT_BUILD_ (KHTML, like Gecko) Chrome/_CHROME_VERSION_ Safari/_SAFARI_ OPR/_VERSION_": {
"name": "Opera",
"userAgentLayout": "os,webkit_build,chrome_version,safari,version"
},
"Mozilla/5.0 (_OS_) AppleWebKit/_WEBKIT_BUILD_ (KHTML, like Gecko) Chrome/_CHROME_VERSION_ Maxthon/_VERSION_ Safari/_SAFARI_": {
"name": "Maxthon",
"userAgentLayout": "os,webkit_build,chrome_version,version,safari"
},
// Google Chrome 0 to CURRENT
"Mozilla/5.0 (_OS_) AppleWebKit/_WEBKIT_BUILD_ (KHTML, like Gecko) Chrome/_VERSION_ Safari/_SAFARI_": {
"name": "Google Chrome",
"userAgentLayout": "os,webkit_build,version,safari"
}
};
// Premade object containing all variables of the browser object, when checking browserJS.browser structure and creating browserJS.browser failed state...
browserJS.failedObject = {
"name": "Unknown",
"logicalName": "unknown",
"version": "0",
"os": "Unknown",
"logicalOs": "unknown"
};
// Get object size, used in for loops...
browserJS.getObjectSize = function (obj) {
var size = 0, key;
for (key in obj)
{
if (obj.hasOwnProperty(key)) size++;
}
return size;
}
// Declare current userAgent and create browserJS.browser object...
browserJS.UA = navigator.userAgent;
browserJS.browser = browserJS.failedObject;
// Init function, makes calls for other functions and add values to browserJS.browser Object...
browserJS.init = function () {
// Try to figure out what browser, version, webkit build and os the user is running...
for(var i = 0;browserJS.userAgentStringArray[Object.getOwnPropertyNames(browserJS.userAgentStringArray)[i]];i++)
{
// Make a new variable with the value of the test userAgent string...
var UAUsed = Object.getOwnPropertyNames(browserJS.userAgentStringArray)[i];
// Make a new variable with the value of the real userAgent string...
var UAReal = browserJS.UA;
var skippedVariablesCount = 0;
var userAgentSpecificVariableLayout = browserJS.userAgentStringArray[Object.getOwnPropertyNames(browserJS.userAgentStringArray)[i]]["userAgentLayout"].split(",");
for(var j = 0;userAgentSpecificVariableLayout[j];j++)
{
// Check if UAUsed is string...
if(typeof UAUsed == "string")
{
// Split the string on each userAgent variable and use the first part to split the real userAgent...
// This will allow us to check the static parts of the userAgent only, so that dynamic variables (such as version numbers) don't matter when checking what browser...
UAUsed = UAUsed.split("_" + userAgentSpecificVariableLayout[j].toUpperCase() + "_");
if(typeof(UAUsed != "string"))
{
UAReal = UAReal.split(UAUsed[0]);
if(typeof UAReal == "string")
{
UAReal = browserJS.UA;
break;
}
}
else
{
skippedVariablesCount++;
continue;
}
}
else
{
// When the UAUsed have been split you cannot use the same method, basically does the same thing as above with a different method...
UAUsed = UAUsed[UAUsed.length-1];
UAUsed = UAUsed.split("_" + userAgentSpecificVariableLayout[j].toUpperCase() + "_");
if(typeof UAUsed != "string" && UAUsed.length == 2)
{
var UARealSplit = UAReal[j-skippedVariablesCount].split(UAUsed[0]);
if(UARealSplit.length == 2)
{
var push_value1 = UARealSplit[0];
var push_value2 = UARealSplit[1];
UAReal[j-skippedVariablesCount] = push_value1;
UAReal.push(push_value2);
}
else
{
UAReal = browserJS.UA;
break;
}
}
else
{
skippedVariablesCount++;
continue;
}
}
}
if(UAReal != browserJS.UA)
{
browserJS.browser = browserJS.userAgentStringArray[Object.getOwnPropertyNames(browserJS.userAgentStringArray)[i]];
var userAgentString = browserJS.browser["userAgentLayout"].split(",");
var UA = Object.getOwnPropertyNames(browserJS.userAgentStringArray)[i];
for(var k = 0;userAgentString[k];k++)
{
console.log(UAReal)
console.log(userAgentString["userAgentLayout"])
browserJS.browser[userAgentString[k]] = UAReal[k+1];
}
break;
}
}
}
// Run the browser.js initiation function. This function will run when the script has been loaded, not when the page is loaded. You might want to change this...
browserJS.init();

62
scripts/checkuser.js Normal file
View File

@ -0,0 +1,62 @@
var refresh_err_cnt = 0
function checkUser(){
if (localStorage.getItem("online_user") == '') {
location.href = "login.html";
}else{
axios.post('/pp/refreshUser', {
username: localStorage.getItem("online_user"),
uuid: localStorage.getItem("uuid"),
})
.then(function (response) {
if (response.status != 200) {
//location.href="login.html";
refresh_err_cnt+=1;
console.log("refresh_err_cnt:",refresh_err_cnt);
if (refresh_err_cnt>3) {
localStorage.setItem("refresh_err_cnt",refresh_err_cnt);
refresh_err_cnt = 0;
location.href="login.html";
}
}else if (response.status == 200 && response.data.r !=0) {
location.href="login.html";
}else if (response.status == 200 && response.data.r ==0) {
if (refresh_err_cnt > 0) {
refresh_err_cnt = 0;
}
}
})
.catch(function (error) {
refresh_err_cnt+=1;
console.log("refresh_err_cnt:",refresh_err_cnt);
if (refresh_err_cnt>3) {
localStorage.setItem("catch-error",error);
refresh_err_cnt = 0;
location.href="login.html";
}
});
}
}
{
let url = decodeURI(window.location.href);
let argsIndex = url .split("?user=");
console.log("current html argsIndex:",argsIndex);
let arg = argsIndex[1];
console.log("current html arg:",arg);
let argsIndex1 = url .split("uuid=");
console.log("current html argsIndex1:",argsIndex1);
let arg1= argsIndex1[1];
console.log("current html arg1:",arg1);
if (arg == undefined ||arg1 == undefined) {
console.log("user uuid error!")
}else{
localStorage.setItem("online_user",arg);
localStorage.setItem("uuid",arg1);
}
checkUser();
}

512
scripts/ds.js Normal file
View File

@ -0,0 +1,512 @@
var dscomponent = {
template:`
<div>
<div id="" style="display: flex">
<el-input v-model="p_id_v" placeholder="产品编码" clearable style="width: 160px;" @change="input_change"></el-input>
<el-input v-model="p_name_v" placeholder="产品名称" clearable style="width: 160px;" @change="input_change"></el-input>
<el-button id ="bt_search" plain type="primary" icon="el-icon-search" @click="get_ds()">搜索</el-button>
<el-button plain type="primary" icon="el-icon-circle-plus-outline" @click="importCsv()">导入</el-button>
<el-button id ="bt_del" plain type="primary" icon="el-icon-circle-plus-outline" @click="del_ds()">删除</el-button>
</div>
<div>
<el-progress v-if="if_show_process" :percentage="percent_len" ></el-progress>
</div>
<div class="span">
<el-table
:data="tableData"
style="width: 100%"
:height="tHeight"
:cell-style="{background:'#fff'}"
border
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
>
</el-table-column>
<el-table-column
prop="p_id"
label="产品编号"
width="120"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="p_name"
label="产品名称"
width="120"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="serial_num"
label="序列号"
width="120"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="file"
label="原始数据"
width="160"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<el-button @click="down_files(scope.row)" type="text" size="small">{{scope.row.file}}</el-button>
</template>
</el-table-column>
<el-table-column
prop="archive_user"
label="归档人"
width="120"
>
</el-table-column>
<el-table-column
prop="archive_time"
label="归档日期"
width="120"
>
</el-table-column>
<el-table-column
label="操作"
width="120">
<template slot-scope="scope">
<el-upload
class="upload-demo"
ref="upload"
action="/pkpi/upload_ds_file"
:on-change="handleChange_file"
:file-list="fileList"
:show-file-list="false"
:on-success="upload_file_success"
:on-error="upload_file_error"
:data="upload_param(scope.row)">
<el-button slot="trigger" size="medium" type="success" >上传</el-button>
</el-upload>
</template>
</el-table-column>
</el-table>
</div>
<div class="block">
<span class="demonstration"></span>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[50,100, 200, 300]"
:page-size="pagesize"
layout="total, sizes, prev, pager, next, jumper"
:total="recordTotal">
</el-pagination>
</div>
<el-dialog
title="基础数据导入"
:visible.sync="importdialogVisible"
:lock-scroll ="false"
:before-close="importDialog_close"
width="30%">
<div style="display: flex;">
<el-upload
class="upload-demo"
action=""
:on-change="handleChange"
:file-list="fileListUpload"
:show-file-list="false"
accept=".csv"
:auto-upload="false">
<el-button id ="bt_upload" size="small" plain type="primary">点击上传csv文件</el-button>
</el-upload>
<el-button id ="bt_import" size="small" plain type="primary" @click="importData" style="margin-left: 10px;">确认导入</el-button>
<!--<el-button id ="bt_download" size="small" plain type="primary" @click="download_template" style="margin-left: 10px;">下载导入模板文件</el-button>-->
</div>
<div>
<el-progress v-if="if_show_process1" :percentage="percent_len" ></el-progress>
</div>
<el-table
:data="importTableData"
style="font-size:13px;margin-top: 10px;width: 100%;"
:height="tHeight*0.5"
:cell-style="{background:'#fff'}"
stripe border>
<el-table-column
prop="p_id"
label="产品编号"
width="120"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="p_name"
label="产品名称"
width="120"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="serial_num"
label="序列号"
width="120"
:show-overflow-tooltip="true">
</el-table-column>
</el-table>
</el-dialog>
</div>
`,
data(){
// 获取当前屏幕的分辨率
let screenW = window.screen.width;
let screenH = window.screen.height;
console.log("screen width:",screenW);
console.log("screen height:",screenH);
return {
tHeight:screenH*0.8,
tableData: [],
currentPage: 1,
pagesize:50,
recordTotal:0,
p_id_v:'',
p_name_v:'',
dialogVisible:false,
oper_type:0,
multipleSelection: [],
importdialogVisible:false,
fileListUpload:[],
importTableData:[],
disabled:true,
if_show_process:false,
percent_len:0,
interval:'',
if_show_process1:false,
fileList:[],
}
},
mounted() {
var _this = this;
var objs;
axios.post('/pkpi/get_ds', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
p_id: _this.$data.p_id_v,
p_name: _this.$data.p_name_v,
index: _this.$data.currentPage,
count: _this.$data.pagesize
})
.then(function (response) {
console.log(response.data);
objs = response.data.data;
rcnt = response.data.total;
_this.$data.tableData = objs;
_this.$data.recordTotal = rcnt;
})
.catch(function (error) {
console.log(error);
});
},
methods: {
down_files(row){
var downUrl = '/pkpi/download_ds_file'+"?id="+row.file;
downloadUrl(row.file,downUrl);
},
upload_param(row){
console.log("---")
return {
id:row.id,
archive_user:localStorage.getItem("online_user")
}
},
upload_file_error(response, file, fileList){
this.$message({
message: "上传失败",
type: "error",
duration: 1500
});
},
upload_file_success(response, file, fileList){
this.$message({
message: "上传成功",
type: "success",
duration: 1500
});
this.get_ds(this.$data.currentPage);
},
handleChange_file(file, fileList) {
console.log(file);
this.fileList = fileList.slice(-1);
},
input_change(value) {
console.log(value);
this.get_ds();
},
importData(){
document.getElementById("bt_import").blur();
if(this.$data.importTableData.length==0){
this.$message({
message: "请选择导入文件",
type: "warning",
duration: 1500
});
return;
}
this.$confirm('是否确认导入?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var _this = this;
_this.$data.percent_len=0;
_this.$data.if_show_process1=true;
_this.$data.interval= setInterval(()=>{
if(_this.$data.percent_len>=99){
clearInterval(_this.$data.interval);
return;
}
if (_this.$data.percent_len<98){
_this.$data.percent_len+=2
}
},20)
axios.post('/pkpi/import_ds_file', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
data:this.$data.importTableData,
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
let len = _this.$data.importTableData.length;
errType = "success"
s = "导入成功("+len+"条)";
_this.$data.percent_len=100;
_this.$data.if_show_process1=false;
} else if(r == 1) {
errType = "error"
s = "正在导入,请稍后!";
clearInterval(_this.$data.interval);
} else{
errType = "error"
s = "导入失败!";
clearInterval(_this.$data.interval);
}
console.log(s);
_this.$message({
message: s,
type: errType,
duration: 3000
});
_this.$data.importdialogVisible=false;
//更新页面
_this.get_ds();
})
.catch(function (error) {
console.log(error);
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
return;
});
},
handleChange(file, fileList) {
document.getElementById("bt_upload").blur();
this.fileTemp = file.raw
console.log("filetype:",this.fileTemp);
if (this.fileTemp) {
console.log("begin ...")
console.log(this.fileTemp.type);
if ((this.fileTemp.type == 'text/csv') || (this.fileTemp.type == '.csv') || (this.fileTemp.type == 'application/vnd.ms-excel')) {
let _this = this//如果需要点击事件结束之后对DOM进行操作使用)_this.xx=xx进行操作
Papa.parse(_this.fileTemp, {
encoding:'gb2312',
complete (results) {
console.log(results)//这个是csv文件的数据
let data = []
//遍历csv文件中的数据存放到data中 方法不唯一,可自己更改
for (let i = 0; i < results.data.length; ++i) {
if(i==0){
continue;
}
let obj = {}
obj.p_id = results.data[i][0]
if(obj.p_id==""|| obj.p_id==undefined){
continue;
}
obj.p_name = results.data[i][1]
obj.serial_num = results.data[i][2]
data.push(obj)
}
//data.splice(0, 1)//将数组第一位的表格名称去除
console.log('data', data)
_this.$data.importTableData=data;
}
})
} else {
this.$data.fileListUpload=[];
this.$message({
type: 'warning',
message: '附件格式错误,请删除后重新上传!'
})
}
} else {
this.$message({
type: 'warning',
message: '请上传附件!'
})
}
},
importCsv(){
this.$data.fileListUpload=[];
this.$data.importTableData=[];
this.$data.importdialogVisible=true;
},
importDialog_close(done){
done();
},
handleSelectionChange(val) {
console.log("已选择");
console.log(val);
this.multipleSelection = val;
},
del_ds(){
var _this = this;
axios.post('/pkpi/del_ds', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
ids: _this.$data.multipleSelection,
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
s = "删除成功!";
errType = "success"
} else{
s = "删除失败!";
errType = "error"
}
_this.$message({
message: s,
type: errType,
duration: 1500
});
if (r ==0) {
_this.get_ds();//更新页面
}
})
.catch(function (error) {
console.log(error);
});
},
get_ds(cur_page){
document.getElementById("bt_search").blur();
if (cur_page==undefined){
this.$data.currentPage=1;
} else {
this.$data.currentPage=cur_page;
}
var _this = this;
var objs;
axios.post('/pkpi/get_ds', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
p_id: _this.$data.p_id_v,
p_name: _this.$data.p_name_v,
index: this.$data.currentPage,
count: this.$data.pagesize
})
.then(function (response) {
console.log(response.data);
objs = response.data.data;
rcnt = response.data.total;
_this.$data.tableData = objs;
_this.$data.recordTotal = rcnt;
})
.catch(function (error) {
console.log(error);
});
},
handleSizeChange(val) {
this.$data.pagesize = val;
var _this = this;
var objs;
axios.post('/pkpi/get_ds', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
p_id: _this.$data.p_id_v,
p_name: _this.$data.p_name_v,
index: this.$data.currentPage,
count: this.$data.pagesize
})
.then(function (response) {
console.log(response.data);
objs = response.data.data;
rcnt = response.data.total;
_this.$data.tableData = objs;
_this.$data.recordTotal = rcnt;
})
.catch(function (error) {
console.log(error);
});
},
handleCurrentChange(val) {
this.$data.currentPage = val;
var _this = this;
var objs;
axios.post('/pkpi/get_ds', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
p_id: _this.$data.p_id_v,
p_name: _this.$data.p_name_v,
index: this.$data.currentPage,
count: this.$data.pagesize
})
.then(function (response) {
console.log(response.data);
objs = response.data.data;
rcnt = response.data.total;
_this.$data.tableData = objs;
_this.$data.recordTotal = rcnt;
})
.catch(function (error) {
console.log(error);
});
}
}
}

1
scripts/elementindex.css Normal file

File diff suppressed because one or more lines are too long

1
scripts/elementindex.js Normal file

File diff suppressed because one or more lines are too long

88
scripts/exportfile.js Normal file
View File

@ -0,0 +1,88 @@
function exportToExcel(){
//要导出的json数据
const jsonData = [
{
name:'路人甲',
phone:'123456789',
email:'000@123456.com'
},
{
name:'炮灰乙',
phone:'123456789',
email:'000@123456.com'
},
{
name:'土匪丙',
phone:'123456789',
email:'000@123456.com'
},
{
name:'流氓丁',
phone:'123456789',
email:'000@123456.com'
},
]
//列标题,逗号隔开,每一个逗号就是隔开一个单元格
let str = `姓名,电话,邮箱\n`;
//增加\t为了不让表格显示科学计数法或者其他格式
for(let i = 0 ; i < jsonData.length ; i++ ){
for(let item in jsonData[i]){
str+=`${jsonData[i][item] + '\t'},`;
}
str+='\n';
}
//encodeURIComponent解决中文乱码
let uri = 'data:text/csv;charset=utf-8,\ufeff' + encodeURIComponent(str);
//通过创建a标签实现
let link = document.createElement("a");
link.href = uri;
//对下载的文件命名
link.download = "json数据表.csv";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
function downloadUrl(filename, url) {
var element = document.createElement('a');
element.setAttribute('href', url);
element.setAttribute('download', filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}
function DownloadContent(filename,content) {
var eleLink = document.createElement('a');
eleLink.download = filename;
eleLink.style.display = 'none';
// 字符内容转变成blob地址
var blob = new Blob([content]);
eleLink.href = URL.createObjectURL(blob);
// 触发点击
document.body.appendChild(eleLink);
eleLink.click();
// 然后移除
document.body.removeChild(eleLink);
};
function fakeClick(obj) {
var ev = document.createEvent("MouseEvents");
ev.initMouseEvent("click", true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
obj.dispatchEvent(ev);
}
function exportRaw(name, data) {
var urlObject = window.URL || window.webkitURL || window;
var export_blob = new Blob([data]);
var save_link = document.createElementNS("http://www.w3.org/1999/xhtml", "a")
save_link.href = urlObject.createObjectURL(export_blob);
save_link.download = name;
fakeClick(save_link);
}

View File

@ -0,0 +1,62 @@
// 自适应表格列宽
function flexColumnWidth(str, tableData, flag = 'max') {
// str为该列的字段名(传字符串);tableData为该表格的数据源(传变量);
// flag为可选值可不传该参数,传参时可选'max'或'equal',默认为'max'
// flag为'max'则设置列宽适配该列中最长的内容,flag为'equal'则设置列宽适配该列中第一行内容的长度。
str = str + ''
let columnContent = ''
if (!tableData || !tableData.length || tableData.length === 0 || tableData === undefined) {
return
}
if (!str || !str.length || str.length === 0 || str === undefined) {
return
}
if (flag === 'equal') {
// 获取该列中第一个不为空的数据(内容)
for (let i = 0; i < tableData.length; i++) {
if (tableData[i][str].length > 0) {
// console.log('该列数据[0]:', tableData[0][str])
columnContent = tableData[i][str]
break
}
}
} else {
// 获取该列中最长的数据(内容)
let index = 0
for (let i = 0; i < tableData.length; i++) {
if (tableData[i][str] === null) {
return
}
const now_temp = tableData[i][str] + ''
const max_temp = tableData[index][str] + ''
if (now_temp.length > max_temp.length) {
index = i
}
}
columnContent = tableData[index][str]
}
// console.log('该列数据[i]:', columnContent)
// 以下分配的单位长度可根据实际需求进行调整
let flexWidth = 0
for (const char of columnContent) {
if ((char >= 'A' && char <= 'Z') || (char >= 'a' && char <= 'z')) {
// 如果是英文字符为字符分配8个单位宽度
flexWidth += 8
} else if (char >= '\u4e00' && char <= '\u9fa5') {
// 如果是中文字符为字符分配15个单位宽度
flexWidth += 15
} else {
// 其他种类字符为字符分配8个单位宽度
flexWidth += 8
}
}
if (flexWidth < 80) {
// 设置最小宽度
flexWidth = 80
}
// if (flexWidth > 250) {
// // 设置最大宽度
// flexWidth = 250
// }
return flexWidth + 'px'
}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1635489197628" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2642" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M620.8 704c0-32-12.8-57.6-38.4-83.2L556.8 601.6 556.8 563.2 556.8 473.6 467.2 454.4l0 108.8 0 38.4L441.6 620.8c-25.6 19.2-38.4 51.2-38.4 83.2 0 57.6 51.2 108.8 108.8 108.8S620.8 761.6 620.8 704z" p-id="2643" fill="#bfbfbf"></path><path d="M512 192c38.4 0 64 25.6 64 64l0 307.2 0 25.6 19.2 19.2C627.2 633.6 640 665.6 640 704c0 70.4-57.6 128-128 128s-128-57.6-128-128c0-38.4 12.8-70.4 44.8-96L448 588.8 448 563.2 448 256C448 217.6 473.6 192 512 192M512 128C441.6 128 384 185.6 384 256l0 307.2C345.6 595.2 320 646.4 320 704c0 108.8 83.2 192 192 192s192-83.2 192-192c0-57.6-25.6-108.8-64-140.8L640 256C640 185.6 582.4 128 512 128L512 128z" p-id="2644" fill="#bfbfbf"></path></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

71
scripts/isUTF8.js.js Normal file
View File

@ -0,0 +1,71 @@
function isUTF8(bytes) {
var i = 0;
while (i < bytes.length) {
if ((// ASCII
bytes[i] == 0x09 ||
bytes[i] == 0x0A ||
bytes[i] == 0x0D ||
(0x20 <= bytes[i] && bytes[i] <= 0x7E)
)
) {
i += 1;
continue;
}
if ((// non-overlong 2-byte
(0xC2 <= bytes[i] && bytes[i] <= 0xDF) &&
(0x80 <= bytes[i + 1] && bytes[i + 1] <= 0xBF)
)
) {
i += 2;
continue;
}
if ((// excluding overlongs
bytes[i] == 0xE0 &&
(0xA0 <= bytes[i + 1] && bytes[i + 1] <= 0xBF) &&
(0x80 <= bytes[i + 2] && bytes[i + 2] <= 0xBF)
) ||
(// straight 3-byte
((0xE1 <= bytes[i] && bytes[i] <= 0xEC) ||
bytes[i] == 0xEE ||
bytes[i] == 0xEF) &&
(0x80 <= bytes[i + 1] && bytes[i + 1] <= 0xBF) &&
(0x80 <= bytes[i + 2] && bytes[i + 2] <= 0xBF)
) ||
(// excluding surrogates
bytes[i] == 0xED &&
(0x80 <= bytes[i + 1] && bytes[i + 1] <= 0x9F) &&
(0x80 <= bytes[i + 2] && bytes[i + 2] <= 0xBF)
)
) {
i += 3;
continue;
}
if ((// planes 1-3
bytes[i] == 0xF0 &&
(0x90 <= bytes[i + 1] && bytes[i + 1] <= 0xBF) &&
(0x80 <= bytes[i + 2] && bytes[i + 2] <= 0xBF) &&
(0x80 <= bytes[i + 3] && bytes[i + 3] <= 0xBF)
) ||
(// planes 4-15
(0xF1 <= bytes[i] && bytes[i] <= 0xF3) &&
(0x80 <= bytes[i + 1] && bytes[i + 1] <= 0xBF) &&
(0x80 <= bytes[i + 2] && bytes[i + 2] <= 0xBF) &&
(0x80 <= bytes[i + 3] && bytes[i + 3] <= 0xBF)
) ||
(// plane 16
bytes[i] == 0xF4 &&
(0x80 <= bytes[i + 1] && bytes[i + 1] <= 0x8F) &&
(0x80 <= bytes[i + 2] && bytes[i + 2] <= 0xBF) &&
(0x80 <= bytes[i + 3] && bytes[i + 3] <= 0xBF)
)
) {
i += 4;
continue;
}
return false;
}
return true;
}

24
scripts/loginout.js Normal file
View File

@ -0,0 +1,24 @@
function loginout(){
axios.post('/pp/loginOut', {
username: localStorage.getItem("online_user"),
})
.then(function (response) {
if (response.status != 200 || response.data.r !=0) {
_this.$message({
message: "用户退出失败!",
type: "error",
duration: 1500
});
}
location.href="login.html";
localStorage.setItem("online_user",'');
localStorage.setItem("uuid",'');
})
.catch(function (error) {
console.log(error);
});
}

7
scripts/papaparse.min.js vendored Normal file

File diff suppressed because one or more lines are too long

812
scripts/payment.js Normal file
View File

@ -0,0 +1,812 @@
var Paymentcomponent = {
template:`
<div>
<div id="" style="display: flex">
<el-input v-model="supplier_v" placeholder="供应商" clearable style="width: 150px;" @change="input_change"></el-input>
<el-input v-model="code_v" placeholder="编号" clearable style="width: 150px;" @change="input_change"></el-input>
<el-input v-model="name_v" placeholder="名称" clearable style="width: 150px;" @change="input_change"></el-input>
<!--<el-date-picker
style="width: 150px;"
v-model="begin_t_v"
type="date"
placeholder="开始日期"
format="yyyy-MM-dd"
value-format="yyyy/MM/dd"
>
</el-date-picker>
<el-date-picker
style="width: 150px;"
v-model="end_t_v"
type="date"
placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy/MM/dd"
>
</el-date-picker>
-->
<el-button id ="bt_search" plain type="primary" icon="el-icon-search" @click="get_payment()">搜索</el-button>
<!--<el-button plain type="primary" icon="el-icon-circle-plus-outline" @click="importCsv()">导入审批物料</el-button>
<el-button style="margin-left: 10px;" id ="bt_export" plain type="primary" icon="el-icon-document" @click="exportSap()">导出</el-button>
-->
</div>
<div>
<el-progress v-if="if_show_process" :percentage="percent_len" ></el-progress>
</div>
<div class="span">
<el-table
:data="tableData"
style="width: 100%"
:height="tHeight"
:cell-style="{background:'#fff'}"
border
@selection-change="handleSelectionChange"
>
<!--
<el-table-column
type="selection"
>
</el-table-column>
-->
<el-table-column
prop="id"
label="序号"
width="60">
</el-table-column>
<el-table-column
prop="supplier"
label="供应商"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="code"
label="编号"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="name"
label="名称"
width="120"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="spec"
label="规格"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="unit"
label="单位"
width="60"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="num"
label="数量"
width="60"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="price"
label="单价"
width="60"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="pt"
label="付款方式"
width="80"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="total_p"
label="合计"
width="120"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="paid"
label="已付"
width="120"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="rp"
label="应付"
width="120"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
label="操作"
width="100">
<template slot-scope="scope">
<el-button @click="update_p(scope.row)" type="text" size="medium" >付款详情</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="block">
<span class="demonstration"></span>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[50,100, 200, 300]"
:page-size="pagesize"
layout="total, sizes, prev, pager, next, jumper"
:total="recordTotal">
</el-pagination>
</div>
<el-dialog
title="支付详情"
:visible.sync="dialogVisible"
:lock-scroll ="false"
width="40%"
style="height: 100%;">
<div>
<el-button id ="bt_add" plain type="primary" icon="el-icon-circle-plus-outline" @click="showAddkpiplan_1()">新增付款</el-button>
<span style="margin-left: 10px;">合计{{row.total_p}}</span>
<span style="margin-left: 10px;">已付{{row.paid}}</span>
<span style="margin-left: 10px;">应付{{row.rp}}</span>
</div>
<el-table
:data="row.payment_data"
style="font-size:13px;margin-top: 10px;width: 100%;"
:height="tHeight*0.5"
:cell-style="{background:'#fff'}"
stripe border>
<el-table-column
prop="payment_month"
label="待付月份"
width="120"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="payment"
label="支付金额"
width="120"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="payment_user"
label="支付人"
width="120"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
label="操作"
width="120">
<template slot-scope="scope">
<el-button @click="show_updateplan_dialog(scope.row)" type="text" size="medium" >修改</el-button>
<el-button @click="delKpiplan(scope.row)" type="text" size="medium" >删除</el-button>
<!--<el-button v-if="approve_flag" @click="approve_plan(scope.row)" type="text" size="medium" >审核</el-button>-->
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button id ="bt_ok" plain type="primary" @click="post_p()"> </el-button>
</span>
</el-dialog>
<el-dialog
v-dialogDrag
title="付款信息"
:visible.sync="addplanVisible_1"
:lock-scroll ="false"
width="45%">
<el-form ref="planform_1" :model="planform" :rules="rules" label-width="100px" :inline="false" class="demo-form-inline" size="medium">
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="支付月份" prop="payment_month">
<el-date-picker
v-model="planform.payment_month"
type="date"
placeholder="支付月份"
style="width: 190px;"
format="yyyy/MM/dd"
value-format="yyyy/MM/dd">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="付款金额" prop="payment">
<el-input-number v-model="planform.payment" :min="0" ></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="支付人" prop="payment_user">
<el-input v-model="planform.payment_user" ></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="addplanVisible_1 = false"> </el-button>
<el-button id ="bt_ok" plain type="primary" @click="addkpiplan_1();"> </el-button>
</span>
</el-dialog>
</div>
`,
data(){
// 获取当前屏幕的分辨率
let screenW = window.screen.width;
let screenH = window.innerHeight;
console.log("screen width:",screenW);
console.log("screen height:",screenH);
return {
tHeight:screenH-40-232,
tableData: [],
currentPage: 1,
pagesize:50,
recordTotal:0,
code_v:'',
name_v:'',
supplier_v:'',
row:'',
dialogVisible:false,
oper_type:0,
rules: {
p_id: [
{ required: true, message: '产品编号不可为空', trigger: 'blur' }
],
p_name: [
{ required: true, message: '产品名称不可为空', trigger: 'blur' }
],
payment_month: [
{ required: true, message: '月份不可为空', trigger: 'blur' }
],
payment: [
{ required: true, message: '支付金额不可为空', trigger: 'blur' }
],
},
multipleSelection: [],
importdialogVisible:false,
fileListUpload:[],
importTableData:[],
disabled:true,
if_show_process:false,
percent_len:0,
interval:'',
if_show_process1:false,
begin_t_v:'',
end_t_v:'',
//payment_data:'',
addplanVisible_1:false,
maxid:-1,
planform: {
id:0,
payment_month:'',
payment:'',
payment_user:'',
},
plan_op_type:0,
}
},
mounted() {
this.get_payment()
},
methods: {
delKpiplan(row){
var index =-1;
for(var i=0;i<this.$data.row.payment_data.length;++i){
if(this.$data.row.payment_data[i].id==row.id){
index=i;
break;
}
}
if (index > -1) {
this.$data.row.payment_data.splice(index, 1);
}
var total =0
for(var i=0;i<this.$data.row.payment_data.length;++i){
var t = parseFloat(this.$data.row.payment_data[i].payment)
total = total+t;
}
console.log("已付:",total);
this.$data.row.paid=total.toString();
var t = parseFloat(this.$data.row.total_p)
if (t>total){
this.$data.row.rp = (t-total).toString();
}
},
show_updateplan_dialog(row){
this.$data.planform.payment_month=row.payment_month;
this.$data.planform.payment=row.payment;
this.$data.planform.payment_user=row.payment_user;
this.$data.planform.id =row.id;
this.$data.plan_op_type=2;
this.$nextTick(() => {
this.$refs['planform_1'].clearValidate()
});
this.$data.addplanVisible_1=true;
},
addkpiplan_1(){
this.$refs['planform_1'].validate((valid) => {
if (valid) {
if (this.$data.plan_op_type==1) {
var obj ={
id:this.$data.maxid,
payment_month:this.$data.planform.payment_month,
payment:this.$data.planform.payment.toString(),
payment_user:this.$data.planform.payment_user,
}
this.$data.row.payment_data.push(obj);
this.$data.maxid+=1;
console.log("id:",this.$data.maxid);
} else if (this.$data.plan_op_type==2){
for(var i=0;i<this.$data.row.payment_data.length;++i){
if(this.$data.row.payment_data[i].id==this.$data.planform.id){
this.$data.row.payment_data[i].payment_month=this.$data.planform.payment_month;
this.$data.row.payment_data[i].payment=this.$data.planform.payment.toString();
this.$data.row.payment_data[i].payment_user=this.$data.planform.payment_user;
console.log(this.$data.row);
break;
}
}
}
var total =0
for(var i=0;i<this.$data.row.payment_data.length;++i){
var t = parseFloat(this.$data.row.payment_data[i].payment)
total = total+t;
}
console.log("已付:",total);
this.$data.row.paid=total.toString();
var t = parseFloat(this.$data.row.total_p)
if (t>total){
this.$data.row.rp = (t-total).toString();
}
this.$data.addplanVisible_1 = false;
}
});
},
showAddkpiplan_1(){
this.$data.planform.payment_month='';
this.$data.planform.payment='';
this.$data.planform.payment_user='';
this.$data.plan_op_type=1;
for (var i = 0; i < this.$data.row.payment_data.length; i++) {
if(this.$data.row.payment_data[i].id >this.$data.maxid){
this.$data.maxid = this.$data.row.payment_data[i].id
}
}
if(this.$data.maxid !=-1){
this.$data.maxid+=1;
}else{
this.$data.maxid = 0;
}
this.$nextTick(() => {
this.$refs['planform_1'].clearValidate()
});
this.$data.addplanVisible_1=true;
},
download_template(){
document.getElementById("bt_download").blur();
var downUrl = '/pp/download_file'+"?id="+"审批导入.csv";
downloadUrl("导入审批物料模版.csv",downUrl);
},
input_change(value) {
console.log(value);
this.get_payment();
},
exportSap(){
document.getElementById("bt_export").blur();
var _this = this;
var objs;
axios.post('/u_ma/export_sap', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
p_id: _this.$data.p_id_v,
p_name: _this.$data.p_name_v,
})
.then(function (response) {
console.log(response.data);
var fileid = response.data.fileId;
var downUrl = '/u_ma/download_file'+"?id="+fileid;
downloadUrl("产品编码名称.csv",downUrl);
})
.catch(function (error) {
console.log(error);
});
},
importData(){
document.getElementById("bt_import").blur();
if(this.$data.importTableData.length==0){
this.$message({
message: "请选择导入文件",
type: "warning",
duration: 1500
});
return;
}
this.$confirm('是否确认导入?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var _this = this;
_this.$data.percent_len=0;
_this.$data.if_show_process1=true;
_this.$data.interval= setInterval(()=>{
if(_this.$data.percent_len>=99){
clearInterval(_this.$data.interval);
return;
}
if (_this.$data.percent_len<98){
_this.$data.percent_len+=2
}
},20)
axios.post('/pp/import_approve_m', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
data:this.$data.importTableData,
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
let len = _this.$data.importTableData.length;
errType = "success"
s = "导入"+len+"条物料成功!";
_this.$data.percent_len=100;
_this.$data.if_show_process1=false;
} else if(r == 1) {
errType = "error"
s = "正在导入物料,请稍后!";
clearInterval(_this.$data.interval);
} else{
errType = "error"
s = "导入物料失败!";
clearInterval(_this.$data.interval);
}
console.log(s);
_this.$message({
message: s,
type: errType,
duration: 3000
});
_this.$data.importdialogVisible=false;
//更新页面
//_this.get_p();
})
.catch(function (error) {
console.log(error);
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
return;
});
},
handleChange(file, fileList) {
document.getElementById("bt_upload").blur();
this.fileTemp = file.raw
console.log("filetype:",this.fileTemp);
if (this.fileTemp) {
console.log("begin ...")
console.log(this.fileTemp.type);
if ((this.fileTemp.type == 'text/csv') || (this.fileTemp.type == '.csv') || (this.fileTemp.type == 'application/vnd.ms-excel')) {
let _this = this//如果需要点击事件结束之后对DOM进行操作使用)_this.xx=xx进行操作
Papa.parse(_this.fileTemp, {
encoding:'gb2312',
complete (results) {
console.log(results)//这个是csv文件的数据
let data = []
//遍历csv文件中的数据存放到data中 方法不唯一,可自己更改
for (let i = 0; i < results.data.length; ++i) {
if(i==0){
continue;
}
let obj = {}
obj.supplier = results.data[i][0]
if(obj.supplier==""|| obj.supplier==undefined){
continue;
}
obj.supplier_code = results.data[i][1]
if(obj.supplier_code==""|| obj.supplier_code==undefined){
continue;
}
obj.pt = results.data[i][2]
if(obj.pt==""|| obj.pt==undefined){
continue;
}
obj.code = results.data[i][3]
if(obj.code==""|| obj.code==undefined){
continue;
}
obj.name = results.data[i][4]
if(obj.name==""|| obj.name==undefined){
continue;
}
obj.spec = results.data[i][5]
if(obj.spec==""|| obj.spec==undefined){
continue;
}
obj.unit = results.data[i][6]
if(obj.unit==""|| obj.unit==undefined){
continue;
}
obj.price = results.data[i][7]
if(obj.price==""|| obj.price==undefined){
continue;
}
obj.update_date = results.data[i][8]
if(obj.update_date==""|| obj.update_date==undefined){
continue;
}
obj.pc = results.data[i][9]
if(obj.pc==""|| obj.pc==undefined){
continue;
}
obj.vpoq = results.data[i][10]
if(obj.vpoq==""|| obj.vpoq==undefined){
continue;
}
data.push(obj)
}
//data.splice(0, 1)//将数组第一位的表格名称去除
let num = 0
console.log('data', data)
_this.$data.importTableData=data;
}
})
} else {
this.$data.fileListUpload=[];
this.$message({
type: 'warning',
message: '附件格式错误,请删除后重新上传!'
})
}
} else {
this.$message({
type: 'warning',
message: '请上传附件!'
})
}
},
importCsv(){
this.$data.fileListUpload=[];
this.$data.importTableData=[];
this.$data.importdialogVisible=true;
},
importDialog_close(done){
done();
},
handleSelectionChange(val) {
console.log("已选择");
console.log(val);
this.multipleSelection = val;
},
post_p(){
this.$data.dialogVisible = false;
var _this = this;
var objs;
axios.post('/pp/update_payment', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
data: _this.$data.row,
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
errType = "success"
} else{
errType = "error"
}
if (r ==0) {
s = "修改成功!";
} else{
s = "修改失败!";
}
_this.$message({
message: s,
type: errType,
duration: 1500
});
//更新页面
_this.get_payment();
})
.catch(function (error) {
console.log(error);
});
},
del_p(){
var _this = this;
axios.post('/u_ma/del_p', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
ids: _this.$data.multipleSelection,
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
s = "删除产品信息成功!";
errType = "success"
} else{
s = "删除产品信息失败!";
errType = "error"
}
_this.$message({
message: s,
type: errType,
duration: 1500
});
if (r ==0) {
_this.get_p();//更新页面
}
})
.catch(function (error) {
console.log(error);
});
},
add_p(){
document.getElementById("bt_add").blur();
this.$data.disabled=false;
this.$data.oper_type = 1;
this.$data.form = {
id:'',
p_id: '',
p_name:'',
};
this.$nextTick(() => {
this.$refs['form_p'].clearValidate()
});
this.$data.dialogVisible = true;
},
update_p(info){
this.$data.disabled=true;
this.$data.oper_type = 2;
this.$data.row = {
id:info.id,
supplier:info.supplier,
code:info.code,
name:info.name,
spec:info.spec,
unit:info.unit,
num:info.num,
price:info.price,
pt:info.pt,
total_p:info.total_p,
paid:info.paid,
rp:info.rp,
payment_data:[],
pre_id:info.pre_id,
};
for(var i=0;i<info.payment_data.length;++i){
var obj={
payment_month:info.payment_data[i].payment_month,
payment:info.payment_data[i].payment,
payment_user:info.payment_data[i].payment_user,
}
this.$data.row.payment_data.push(obj);
}
this.$nextTick(() => {
this.$refs['form_p'].clearValidate()
});
this.$data.dialogVisible = true;
},
get_payment(){
document.getElementById("bt_search").blur();
this.$data.currentPage=1;
var _this = this;
var objs;
axios.post('/pp/get_payment', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
index: this.$data.currentPage,
count: this.$data.pagesize,
code: this.$data.code_v,
name:this.$data.name_v,
supplier:this.$data.supplier_v,
})
.then(function (response) {
console.log(response.data);
objs = response.data.data;
rcnt = response.data.total;
_this.$data.tableData = objs;
_this.$data.recordTotal = rcnt;
})
.catch(function (error) {
console.log(error);
});
},
handleSizeChange(val) {
this.$data.pagesize = val;
this.get_payment();
},
handleCurrentChange(val) {
this.$data.currentPage = val;
this.get_payment();
}
}
}

393
scripts/pf.js Normal file
View File

@ -0,0 +1,393 @@
var pfcomponent = {
template:`
<div>
<div id="" style="display: flex">
<el-input v-model="applicant_v" placeholder="申请人" clearable style="width: 160px;" @change="input_change"></el-input>
<el-button id ="bt_search" plain type="primary" icon="el-icon-search" @click="get_approve()">搜索</el-button>
<el-button id ="bt_del" plain type="primary" icon="el-icon-circle-plus-outline" @click="del_approve()">删除</el-button>
</div>
<div>
<el-progress v-if="if_show_process" :percentage="percent_len" ></el-progress>
</div>
<div class="span">
<el-table
:data="tableData"
style="width: 100%"
:height="tHeight"
:cell-style="{background:'#fff'}"
border
@selection-change="handleSelectionChange"
@cell-dblclick="celldblclick_1"
>
<el-table-column
type="selection"
>
</el-table-column>
<el-table-column
prop="id"
label="编号"
width="60"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="applicant"
label="申请人"
width="80"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="time"
label="日期"
width="80"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="record_cnt"
label="申请数量"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="update_cnt"
label="替换数量"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="add_cnt"
label="新增数量"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="state"
label="状态"
width="80"
:show-overflow-tooltip="true">
</el-table-column>
<!--
<el-table-column
label="操作"
width="120">
<template slot-scope="scope">
<el-button @click="update_process(scope.row)" type="text" size="medium" >修改</el-button>
</template>
</el-table-column>
-->
</el-table>
</div>
<div class="block">
<span class="demonstration"></span>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[50,100, 200, 300]"
:page-size="pagesize"
layout="total, sizes, prev, pager, next, jumper"
:total="recordTotal">
</el-pagination>
</div>
<el-dialog
title="审批列表"
:visible.sync="update_visible"
:lock-scroll ="false"
width="80%"
style="height: 100%;">
<el-table
:data="tableData1"
style="width: 100%"
:cell-style="{background:'#fff'}"
border
>
<el-table-column
prop="op_type"
label="更新方式"
width="80"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="price_span"
label="变化"
width="60"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="last_price"
label="最新单价"
width="60"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="code"
label="编号"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="name"
label="名称"
width="120"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="spec"
label="规格"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="unit"
label="单位"
width="60"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="price"
label="单价"
width="60"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="update_date"
label="更新日期"
width="80"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="pc"
label="采购周期"
width="80"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="vpoq"
label="报价有效期"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="effective_time"
label="报价有效时间"
width="120"
:show-overflow-tooltip="true">
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="update_visible = false"> </el-button>
<el-button v-if='state!="已批准"' id ="bt_ok" plain type="primary" @click="post_process()">确认入库</el-button>
</span>
</el-dialog>
</div>
`,
data(){
// 获取当前屏幕的分辨率
let screenW = window.screen.width;
let screenH = window.innerHeight;
console.log("screen width:",screenW);
console.log("screen height:",screenH);
return {
tHeight:screenH-40-232,
tableData: [],
tableData1: [],
currentPage: 1,
pagesize:50,
recordTotal:0,
applicant_v:'',
dialogVisible:false,
multipleSelection: [],
disabled:true,
if_show_process:false,
percent_len:0,
interval:'',
if_show_process1:false,
update_visible:false,
form: {
id:'',
p_id: '',
process_name:'',
process_t:'',
},
rules: {
p_id: [
{ required: true, message: '产品编号不可为空', trigger: 'blur' }
],
process_name: [
{ required: true, message: '工序不可为空', trigger: 'blur' }
],
process_t: [
{ required: true, message: '工时不可为空', trigger: 'blur' }
],
},
id:0,
state:'',
}
},
mounted() {
this.get_approve();
},
methods: {
celldblclick_1(row, column, cell, event){
this.$data.tableData1 = JSON.parse(row.data);
this.$data.id = row.id,
this.$data.state=row.state,
this.$data.update_visible=true;
},
post_process(){
this.$data.update_visible = false;
var _this = this;
console.log(_this.$data.form);
var objs;
axios.post('/pp/approve_ok', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
id:_this.$data.id,
data:_this.$data.tableData1,
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
errType = "success"
} else{
errType = "error"
}
if (r ==0) {
s = "入库成功!";
} else{
s = "入库失败!";
}
_this.$message({
message: s,
type: errType,
duration: 1500
});
//更新页面
_this.get_approve();
})
.catch(function (error) {
console.log(error);
});
},
update_process(row){
this.$data.form = {
id:row.id,
p_id: row.p_id,
process_name:row.process_name,
process_t:row.process_t
};
this.$nextTick(() => {
this.$refs['form_p'].clearValidate()
});
this.$data.update_visible = true;
},
input_change(value) {
console.log(value);
this.get_approve();
},
importDialog_close(done){
done();
},
handleSelectionChange(val) {
console.log("已选择");
console.log(val);
this.multipleSelection = val;
},
del_approve(){
var _this = this;
axios.post('/pp/del_approve', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
ids: _this.$data.multipleSelection,
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
s = "删除成功!";
errType = "success"
} else{
s = "删除失败!";
errType = "error"
}
_this.$message({
message: s,
type: errType,
duration: 1500
});
if (r ==0) {
_this.get_approve();//更新页面
}
})
.catch(function (error) {
console.log(error);
});
},
get_approve(){
document.getElementById("bt_search").blur();
var _this = this;
var objs;
axios.post('/pp/get_approve_m', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
index: this.$data.currentPage,
count: this.$data.pagesize,
applicant:this.$data.applicant_v,
})
.then(function (response) {
console.log(response.data);
objs = response.data.data;
rcnt = response.data.total;
_this.$data.tableData = objs;
_this.$data.recordTotal = rcnt;
})
.catch(function (error) {
console.log(error);
});
},
handleSizeChange(val) {
this.$data.pagesize = val;
this.get_approve();
},
handleCurrentChange(val) {
this.$data.currentPage = val;
this.get_approve();
}
}
}

BIN
scripts/png/3-1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 KiB

BIN
scripts/png/3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

BIN
scripts/png/4290923.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
scripts/png/bg.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 779 KiB

BIN
scripts/png/bgg.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 MiB

BIN
scripts/png/title.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

7200
scripts/polyfill.js Normal file

File diff suppressed because it is too large Load Diff

271
scripts/rsm.js Normal file
View File

@ -0,0 +1,271 @@
//组件
var rsmcomponent = {
template:`
<div>
<div id="" style="display: inline-block;width: 100%;">
<div style="float: left; width: 20%;">
<el-input v-model="input" placeholder="请输入维修状态" clearable @change="input_change"></el-input>
</div>
<div style="float: left;">
<el-button id ="bt_search" plain type="primary" icon="el-icon-search" @click="get_rs(input)">搜索</el-button>
<el-button id ="bt_add" plain type="primary" icon="el-icon-circle-plus-outline" @click="addRs()">新增</el-button>
</div>
</div>
<div class="span">
<el-table
:data="tableData"
style="width: 100%"
:height="tHeight"
:cell-style="{background:'#fff'}"
border
>
<el-table-column
prop="rs"
label="维修状态"
width="160">
</el-table-column>
<el-table-column
label="操作"
width="100">
<template slot-scope="scope">
<el-button @click="updateRs(scope.row)" type="text" size="medium" >修改</el-button>
<el-button @click="delRs(scope.row)" type="text" size="medium" >删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<el-dialog
title="用户信息"
:visible.sync="dialogVisible"
:lock-scroll ="false"
width="30%">
<el-form ref="userform" :model="form" label-width="80px" :rules="rules">
<el-form-item label="维修状态" prop="rs">
<el-input v-model="form.rs"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button id ="bt_ok" plain type="primary" @click="postRs()"> </el-button>
</span>
</el-dialog>
</div>
`,
data(){
// 获取当前屏幕的分辨率
let screenW = window.screen.width;
let screenH = window.screen.height;
console.log("screen width:",screenW);
console.log("screen height:",screenH);
return {
tHeight:screenH*0.8,
tableData: [],
input:'',
currentPage: 1,
pagesize:50,
recordTotal:0,
form: {
id:0,
rs: '',
},
dialogVisible:false,
oper_type:0,
rules: {
rs: [
{ required: true, message: '维修状态不可为空', trigger: 'blur' }
],
},
}
},
mounted() {
var _this = this;
var objs;
axios.post('/u_ma/get_rs', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
state: '',
})
.then(function (response) {
console.log(response.data);
objs = response.data.data;
rcnt = response.data.total;
_this.$data.tableData = objs;
})
.catch(function (error) {
console.log(error);
});
},
methods: {
input_change(value) {
console.log(value);
this.get_rs(this.$data.input);
},
postRs(){
this.$refs['userform'].validate((valid) => {
if(valid){
this.$data.dialogVisible = false;
var _this = this;
console.log(_this.$data.form);
var objs;
axios.post('/u_ma/postRs', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
id: _this.$data.form.id,
rs:_this.$data.form.rs,
oper_type: _this.$data.oper_type,
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
errType = "success"
} else{
errType = "error"
}
if (_this.$data.oper_type == 1) {
if (r ==0) {
s = "新增成功!";
} else if(r == 1) {
s = "已存在相同维修状态!";
}else{
s = "新增失败!";
}
} else if (_this.$data.oper_type ==2){
if (r ==0) {
s = "修改成功!";
} else{
s = "修改失败!";
}
}
_this.$message({
message: s,
type: errType,
duration: 1500
});
//更新页面
_this.get_rs(_this.$data.input);
})
.catch(function (error) {
console.log(error);
});
}
});
},
delRs(info){
this.$data.oper_type = 3;
var _this = this;
var objs;
axios.post('/u_ma/postRs', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
id: info.id,
oper_type: _this.$data.oper_type,
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
s = "删除成功!";
errType = "success"
} else{
s = "删除失败!";
errType = "error"
}
_this.$message({
message: s,
type: errType,
duration: 1500
});
if (r ==0) {
_this.get_rs("");//更新页面
}
})
.catch(function (error) {
console.log(error);
});
},
addRs(){
document.getElementById("bt_add").blur();
this.$data.oper_type = 1;
this.$data.form = {
id: 0,
rs: '',
};
this.$nextTick(() => {
this.$refs['userform'].clearValidate()
});
this.$data.dialogVisible = true;
},
updateRs(info){
this.$data.oper_type = 2;
this.$data.form = {
id: info.id,
rs: info.rs,
};
this.$nextTick(() => {
this.$refs['userform'].clearValidate()
});
this.$data.dialogVisible = true;
},
get_rs(_search_name){
document.getElementById("bt_search").blur();
this.$data.currentPage=1;
var _this = this;
var objs;
axios.post('/u_ma/get_rs', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
state: _search_name,
})
.then(function (response) {
console.log(response.data);
objs = response.data.data;
rcnt = response.data.total;
_this.$data.tableData = objs;
})
.catch(function (error) {
console.log(error);
});
},
}
}

436
scripts/searchByCode.js Normal file
View File

@ -0,0 +1,436 @@
var searchbycodecomponent = {
template:`
<div>
<div style="display: flex;">
<el-upload
class="upload-demo"
action=""
:on-change="handleChange"
:file-list="fileListUpload"
:show-file-list="false"
accept=".csv"
:auto-upload="false">
<el-button id ="bt_upload" size="small" plain type="primary">点击上传csv文件</el-button>
</el-upload>
<el-button id ="bt_import" size="small" plain type="primary" @click="importData" style="margin-left: 10px;">确认导入</el-button>
<el-button id ="bt_download" size="small" plain type="primary" @click="download_template" style="margin-left: 10px;">下载导入模板文件</el-button>
<el-button id ="bt_export_1" plain type="primary" icon="el-icon-document" @click="export_plan_1()" style="margin-left: 0px;padding-left: 10px;padding-right: 10px;">导出</el-button>
</div>
<div>
<el-progress v-if="if_show_process" :percentage="percent_len" :stroke-width="2"></el-progress>
</div>
<div class="span">
<el-table
:data="importTableData"
style="font-size:14px;margin-top: 10px;width: 100%;"
:row-class-name="tableRowClassName"
stripe border>
<el-table-column
prop="code"
label="六合编号"
width="80"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="order_date"
label="日期"
width="80"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="price"
label="单价"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="supplier"
label="供应商"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="rdm"
label="需求任务"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
</el-table>
</div>
</div>
`,
data(){
// 获取当前屏幕的分辨率
let screenW = window.screen.width;
let screenH = window.innerHeight;
console.log("screen width:",screenW);
console.log("screen height:",screenH);
return {
tHeight:screenH-40-232,
tableData: [],
tableData1: [],
currentPage: 1,
pagesize:50,
recordTotal:0,
applicant_v:'',
dialogVisible:false,
multipleSelection: [],
disabled:true,
if_show_process:false,
percent_len:0,
interval:'',
if_show_process1:false,
update_visible:false,
form: {
id:'',
p_id: '',
process_name:'',
process_t:'',
},
id:0,
state:'',
fileListUpload: [],
importTableData: [],
codes:[]
}
},
methods: {
celldblclick_1(row, column, cell, event){
this.$data.tableData1 = JSON.parse(row.data);
this.$data.id = row.id,
this.$data.state=row.state,
this.$data.update_visible=true;
},
tableRowClassName({row, rowIndex}) {
if (row.cti != undefined && row.cti.length>0){
return 'success-row';
}else{
/*var n = rowIndex%2;
if (n == 1) {
return 'success-row';
}*/
}
return '';
},
download_template(){
document.getElementById("bt_download").blur();
var downUrl = '/pp/download_file'+"?id="+"根据编号物料匹配.csv";
downloadUrl("根据编号物料匹配.csv",downUrl);
},
handleChange(file, fileList) {
document.getElementById("bt_upload").blur();
this.fileTemp = file.raw
console.log("filetype:",this.fileTemp);
if (this.fileTemp) {
console.log("begin ...")
console.log(this.fileTemp.type);
if ((this.fileTemp.type == 'text/csv') || (this.fileTemp.type == '.csv') || (this.fileTemp.type == 'application/vnd.ms-excel')) {
let _this = this//如果需要点击事件结束之后对DOM进行操作使用)_this.xx=xx进行操作
Papa.parse(_this.fileTemp, {
encoding:'gb2312',
complete (results) {
console.log(results)//这个是csv文件的数据
let data = []
let codes = []
//遍历csv文件中的数据存放到data中 方法不唯一,可自己更改
var cnt = 1
for (let i = 0; i < results.data.length; ++i) {
if(i==0){
continue;
}
let obj = {}
obj.code = results.data[i][0]
if(obj.code !=''){
cnt +=1
data.push(obj)
codes.push(obj.code)
}
}
//data.splice(0, 1)//将数组第一位的表格名称去除
let num = 0
_this.$data.importTableData=data;
_this.$data.codes = codes;
console.log("_this.$data.codes",_this.$data.codes)
}
})
} else {
this.$data.fileListUpload=[];
this.$message({
type: 'warning',
message: '附件格式错误,请删除后重新上传!'
})
}
} else {
this.$message({
type: 'warning',
message: '请上传附件!'
})
}
},
//导入CSV
importData(){
console.log("this.$data.importTableData",this.$data.importTableData);
document.getElementById("bt_import").blur();
if(this.$data.importTableData.length==0){
this.$message({
message: "请选择导入文件",
type: "warning",
duration: 1500
});
return;
}
this.$data.percent_len=0;
this.$data.if_show_process=true;
this.$data.interval= setInterval(()=>{
if(this.$data.percent_len>=99){
clearInterval(this.$data.interval);
return;
}
this.$data.percent_len+=1
},20)
var _this = this;
axios.post('/pp/search_plan_by_code', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
codes:this.$data.codes,
})
.then(function (response) {
var data = response.data.data;
console.log("r:",data);
let s = ""
let errType = ""
_this.$data.importTableData=data;
_this.$data.importdialogVisible=false;
//更新页面
// _this.get_ma_plan();
})
.catch(function (error) {
console.log(error);
});
},
export_plan_1(){
var _this = this;
var objs;
axios.post('/pp/export_plan_by_code', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
codes:this.$data.codes,
})
.then(function (response) {
var date = new Date();
//年 getFullYear():四位数字返回年份
var year = date.getFullYear()%2000; //getFullYear()代替getYear()
console.log(year.toString());
//月 getMonth()0 ~ 11
var month = date.getMonth() + 1;
if(month<10){
month='0'+month
}
//日 getDate()(1 ~ 31)
var day = date.getDate();
if(day<10){
day='0'+day;
}
//时 getHours()(0 ~ 23)
var hour = date.getHours();
if (hour<10){
hour='0'+hour;
}
//分 getMinutes() (0 ~ 59)
var minute = date.getMinutes();
if (minute<10){
minute='0'+minute;
}
//秒 getSeconds()(0 ~ 59)
var second = date.getSeconds();
if (second<10){
second='0'+second;
}
var filename=year.toString()+month.toString()+day.toString() +" " + hour.toString()+minute.toString()+second.toString();
filename = "物料匹配 "+filename+".csv"
console.log(response.data);
var fileid = response.data.fileId;
var downUrl = '/pp/download_file'+"?id="+fileid;
downloadUrl(filename,downUrl);
})
.catch(function (error) {
console.log(error);
});
},
post_process(){
this.$data.update_visible = false;
var _this = this;
console.log(_this.$data.form);
var objs;
axios.post('/pp/approve_ok', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
id:_this.$data.id,
data:_this.$data.tableData1,
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
errType = "success"
} else{
errType = "error"
}
if (r ==0) {
s = "入库成功!";
} else{
s = "入库失败!";
}
_this.$message({
message: s,
type: errType,
duration: 1500
});
//更新页面
_this.get_approve();
})
.catch(function (error) {
console.log(error);
});
},
update_process(row){
this.$data.form = {
id:row.id,
p_id: row.p_id,
process_name:row.process_name,
process_t:row.process_t
};
this.$nextTick(() => {
this.$refs['form_p'].clearValidate()
});
this.$data.update_visible = true;
},
input_change(value) {
console.log(value);
this.get_approve();
},
importDialog_close(done){
done();
},
handleSelectionChange(val) {
console.log("已选择");
console.log(val);
this.multipleSelection = val;
},
del_approve(){
var _this = this;
axios.post('/pp/del_approve', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
ids: _this.$data.multipleSelection,
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
s = "删除成功!";
errType = "success"
} else{
s = "删除失败!";
errType = "error"
}
_this.$message({
message: s,
type: errType,
duration: 1500
});
if (r ==0) {
_this.get_approve();//更新页面
}
})
.catch(function (error) {
console.log(error);
});
},
get_approve(){
document.getElementById("bt_search").blur();
var _this = this;
var objs;
axios.post('/pp/get_plan_by_code', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
index: this.$data.currentPage,
count: this.$data.pagesize,
applicant:this.$data.applicant_v,
})
.then(function (response) {
console.log(response.data);
objs = response.data.data;
rcnt = response.data.total;
_this.$data.tableData = objs;
_this.$data.recordTotal = rcnt;
})
.catch(function (error) {
console.log(error);
});
},
handleSizeChange(val) {
this.$data.pagesize = val;
this.get_approve();
},
handleCurrentChange(val) {
this.$data.currentPage = val;
this.get_approve();
}
}
}

1213
scripts/sp1.js Normal file

File diff suppressed because it is too large Load Diff

842
scripts/sp2.js Normal file
View File

@ -0,0 +1,842 @@
var sp2component = {
template:`
<div>
<div style="display: flex;">
<el-input v-model="contract_id_v" placeholder="合同号" clearable style="width: 100px;" @change="input_change"></el-input>
<!--<el-input v-model="supplier_v" placeholder="供应商" clearable style="width: 100px;" @change="input_change"></el-input> -->
<el-input v-model="contract_name_v" placeholder="合同名称" clearable style="width: 120px;" @change="input_change"></el-input>
<el-input v-model="rdm_v" placeholder="RDM" clearable style="width: 100px;" @change="input_change"></el-input>
<el-input v-model="buyer_v" placeholder="采购人员" clearable style="width: 120px;" @change="input_change"></el-input>
<el-checkbox style="margin: 0px;" v-model="checked" @change="if_fin_cahnge" border>已处理</el-checkbox>
<el-button id ="bt_serach" plain type="primary" icon="el-icon-search" @click="get_ma_plan()" style="padding-left: 10px;padding-right: 10px;">搜索</el-button>
<el-button id ="bt_add" v-if='level==1' plain type="primary" icon="el-icon-circle-check" @click="mul_update_pp_plan_num()" style="margin-left: 0px;padding-left: 10px;padding-right: 10px;">批量审批</el-button>
</div>
<div>
<el-progress v-if="if_show_process1" :percentage="percent_len1" ></el-progress>
</div>
<div >
<div class="span">
<el-table
:data="tableData"
style="width: 100%;font-size:14px"
:height="tHeight"
:row-class-name="tableRowClassName"
@selection-change="handleSelectionChange"
border
:row-style="selectedRowStyle"
@cell-dblclick="celldblclick_1"
:header-cell-style="tableHeaderColor"
>
<el-table-column
type="selection"
width="30"
>
</el-table-column>
<el-table-column
prop="id"
label="序号"
width="60"
>
</el-table-column>
<el-table-column
prop="contract_id"
label="合同号"
width="120"
:show-overflow-tooltip="true">
</el-table-column>
// <el-table-column
// prop="supplier"
// label="供应商名称"
// width="120"
// :show-overflow-tooltip="true">
// </el-table-column>
<el-table-column
prop="contract_name"
label="正式合同"
width="160"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<el-button style="margin-right: 10px;" size="medium" type="text" @click="down_file_22(scope.row)" >{{scope.row.contract_name}}</el-button>
</template>
</el-table-column>
<el-table-column
prop="contract_name"
label="合同操作"
width="160"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<el-upload
v-if='scope.row.if_modify'
class="upload-demo"
ref="upload"
action="/pp/upload_sp_2_file"
:on-change="handleChange_file"
:file-list="fileList_1"
:show-file-list="false"
:on-success="upload_file_success"
:on-error="upload_file_error"
:data="upload_param_2(scope.row)">
<el-button v-show='scope.row.contract_name==""' slot="trigger" size="medium" type="success" >上传</el-button>
<el-button size="medium" type="success" @click="del_contract_file(scope.row)">删除</el-button>
</el-upload>
</template>
</el-table-column>
<el-table-column
label="RDM"
width="100"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<div v-for="(item, index) in scope.row.rdm.split(/[, ]+/)" :key="index">
<el-button :style="scope.row.redmine_color" @click="to_redmine_1(item)" type="text" size="medium">{{item}}</el-button>
</div>
</template>
</el-table-column>
<el-table-column
prop="state"
label="审批状态"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<!--<el-table-column
prop="amount"
label="合同金额"
width="100"
:show-overflow-tooltip="true">
</el-table-column>-->
<el-table-column
prop="amount_1"
label="审批金额"
width="100"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<div style="float: right;">{{convert(scope.row.amount_1)}}</div>
</template>
</el-table-column>
<el-table-column
prop="warehouse_entry_number"
label="入库单号"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="buyer"
label="采购人员"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="state_1"
label="付款审批"
width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
label="操作"
width="100">
<template slot-scope="scope">
<el-button v-if='level==1' class="t_hover_button" @click="show_update_dialog(scope.row)" type="text" size="medium" >修改</el-button>
<!--<el-button style="margin-left: 3px;margin-right: 0px;" @click="remove_ma_plan(scope.row)" type="text" size="medium" >删除</el-button>
-->
</template>
</el-table-column>
</el-table>
</div>
<div class="block">
<span class="demonstration"></span>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[50,100, 200, 300]"
:page-size="pagesize"
:total="recordTotal"
layout="total, sizes, prev, pager, next, jumper"
>
</el-pagination>
</div>
</div>
<el-dialog
title="付款申请审批"
:visible.sync="updatedialogVisible_ex"
:lock-scroll ="false"
width="70%">
<el-form ref="authform_ex" :model="form" :rules="rules" label-width="160px" :inline="false" class="demo-form-inline" size="medium">
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="合同号" prop="contract_id" >
<el-input v-model="form.contract_id" :disabled="true" ></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="供应商名称" prop="supplier">
<el-input v-model="form.supplier" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同" prop="contract_name">
<el-input v-model="form.contract_name" :disabled="true"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="RDM" prop="rdm" >
<el-input v-model="form.rdm" :disabled="true" ></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="审批状态" prop="state">
<el-input v-model="form.state" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="合同金额" prop="amount">
<el-input v-model="form.amount" :disabled="true"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="8" >
<el-form-item label="审批金额" prop="amount_1">
<el-input v-model="form.amount_1" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="入库单号" prop="warehouse_entry_number">
<el-input v-model="form.warehouse_entry_number" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="采购人员" prop="buyer">
<el-input v-model="form.buyer" :disabled="true"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="8" >
<el-form-item label="付款审批" prop="state_1">
<!--<el-input v-model="form.state_1" :disabled="false" ></el-input>
-->
<el-select clearable v-model="form.state_1" placeholder="审批状态" style="width: 160px;" @change="input_change">
<el-option label="批准" value="批准"></el-option>
<el-option label="拒绝" value="拒绝"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="updatedialogVisible_ex = false"> </el-button>
<el-button id ="bt_ok" plain type="primary" @click="update_ma_ex();"> </el-button>
</span>
</el-dialog>
</div>
`,
data(){
// 获取当前屏幕的分辨率
let screenW = window.screen.width;
let screenH = window.innerHeight;
console.log("screen width:",screenW);
console.log("screen height:",screenH);
return {
tHeight:screenH-40-232,
tHeight_1:screenH-80-34,
tableData: Array(0),
tableData1: Array(0),
currentPage: 1,
pagesize:50,
pagecnt:1,
recordTotal:0,
checked:false,
contract_id_v:'',
supplier_v:'',
contract_name_v:'',
rdm_v:'',
buyer_v:'',
bt_v:'',
et_v:'',
msid_v:'',
pname_v:'',
supplier_v:'',
state_v:'',
rid_v:'',
repairer_v:'',
rs_v:'',
regional_head_v:'',
ms_v:'',
asc_v:'',
updatedialogVisible_ex:false,
form: {
id:0,
contract_id:0,
supplier:'',
contract_name:'',
rdm:'',
state:'',
amount:'',
amount_1:'',
warehouse_entry_number:'',
buyer:'',
state_1:'',
task_ids:'',
},
rules: {
product_id: [
{ required: true, message: '六合编号不可为空', trigger: 'blur' }
],
},
options: [],
importdialogVisible:false,
fileTemp: null,
fileListUpload: [],
importTableData: [],
multipleSelection: [],
if_show_processed:true,
if_del_show:false,
if_del:false,
p_id_options:[],
loading: false,
percent_len:0,
if_show_process:false,
interval:'',
if_show_process1:false,
percent_len1:0,
ma_users:[],
disabled:false,
if_do:true,
rs_data:[],
show_child:false,
pre_id:0,
child_data:[],
row:'',
dialogVisible:false,
addplanVisible_1:false,
maxid:-1,
planform: {
id:0,
payment_month:'',
payment:'',
payment_user:'',
},
plan_op_type:0,
if_paid_all:false,
buyer_data:[],
warning_dialogVisible:false,
warning_data:[],
warning_checked:false,
more_query_v:'',
fileList_1:'',
level:0,
}
},
mounted() {
var op_user = localStorage.getItem("online_user");
this.$data.level = localStorage.getItem("level");
this.get_ma_plan();
this.get_buyer();
},
methods: {
convert(amount){
let numStr = (amount.replaceAll(",","").trim() * 1).toFixed(2);
let thousandSeparated = numStr.replace(/\d(?=(\d{3})+\.)/g, '$&,');
return thousandSeparated;
},
del_contract_file(row){
var _this = this;
var objs;
axios.post('/pp/del_contract_ex_file', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
data: row,
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
errType = "success"
} else{
errType = "error"
}
if (r ==0) {
s = "删除成功!";
} else{
s = "删除失败!";
}
_this.$message({
message: s,
type: errType,
duration: 1500
});
_this.get_ma_plan();;
})
.catch(function (error) {
console.log(error);
});
},
upload_param_2(row){
console.log("---")
return {
id:row.id,
file_type:"1"
}
},
upload_file_error(response, file, fileList){
this.$message({
message: "上传失败",
type: "error",
duration: 1500
});
},
upload_file_success(response, file, fileList){
this.$message({
message: "上传成功",
type: "success",
duration: 1500
});
this.get_ma_plan();
},
handleChange_file(file, fileList) {
console.log(file);
this.fileList_1 = fileList.slice(-1);
},
down_file_22(row){
var downUrl = '/pp/download_sp_2_file'+"?id="+row.id;
downloadUrl(row.contract_name,downUrl);
return;
var index = row.contract_name.lastIndexOf(".")
if(row.contract_name.slice(index) == ".pdf"){
var downUrl = '/file/'+'sp_1/'+row.contract_name;
window.open(downUrl, '_blank');
}else{
var downUrl = '/pp/download_sp_1_file'+"?id="+row.contract_name;
downloadUrl(row.contract_name,downUrl);
}
},
more_query_select(value){
console.log(value);
console.log(this.$data.more_query_v);
if (value=="采购人员"){
} else{
this.$data.buyer_v = ''
}
console.log("更多查询",value)
this.get_ma_plan();
},
down_qs_files(row){
var downUrl = '/pp/download_ds_file'+"?id="+row.qs;
downloadUrl(row.qs,downUrl);
},
get_buyer(){
var _this = this;
var objs;
axios.post('/pp/getUsers', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
index: 1,
count: 1000
})
.then(function (response) {
console.log(response.data);
objs = response.data.data;
rcnt = response.data.total;
for(var i =0; i< objs.length; ++i){
if(objs[i].if_buyer ==1){
var obj ={
value: objs[i].username,
label: objs[i].username,
}
_this.$data.buyer_data.push(obj);
}
}
})
.catch(function (error) {
console.log(error);
});
},
tableHeaderColor({ row, column, rowIndex, columnIndex }) {
return;
console.log(column);
if (rowIndex === 0 && column.label == "RDM") {
return 'background-color: #FAD355; ';//绿色
} else if (rowIndex === 0 && column.label =="六合编号") {
return 'background-color: #FAD355; ';//橙色
} else if (rowIndex === 0 && column.label =="名称") {
return 'background-color: #BACEFD; ';//橙色
} else if (rowIndex === 0 && column.label =="规格") {
return 'background-color: #BACEFD; ';//橙色
} else if (rowIndex === 0 && column.label =="单位") {
return 'background-color: #BACEFD; ';//橙色
} else if (rowIndex === 0 && column.label =="数量") {
return 'background-color: #FAD355; ';//橙色
} else if (rowIndex === 0 && column.label =="单价") {
return 'background-color: #BACEFD; ';//橙色
} else if (rowIndex === 0 && column.label =="付款方式") {
return 'background-color: #BACEFD; ';//橙色
} else if (rowIndex === 0 && column.label =="交付日期") {
return 'background-color: #FAD355; ';//橙色
} else if (rowIndex === 0 && column.label =="采购周期") {
return 'background-color: #BACEFD; ';//橙色
} else {
return 'background: #ffffff;';
}
},
mul_update_pp_plan_num(){
if(this.$data.multipleSelection.length ==0){
this.$message({
message: "请选择计划",
type: "warning",
duration: 1500
});
return;
}
var _this = this;
var objs;
axios.post('/pp/mul_sp_2', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
data: _this.$data.multipleSelection,
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
errType = "success"
} else{
errType = "error"
}
if (r ==0) {
s = "修改成功!";
} else{
s = "修改失败!";
}
_this.$message({
message: s,
type: errType,
duration: 1500
});
_this.get_ma_plan();
})
.catch(function (error) {
console.log(error);
});
},
celldblclick_1(row, column, cell, event){
this.show_update_dialog(row);
},
to_redmine_1(rdm){
let id = parseInt(rdm);
if (id<10000){
return;
}
url = encodeURI("http://123.54.1.214:10010/redmine/issues/"+rdm);
window.open(url, "");
},
to_redmine(row){
if(row.mt!=""){
url = encodeURI(row.buy_record);
window.open(url, "");
}
},
input_change(value) {
console.log(value);
this.get_ma_plan();
},
if_fin_cahnge(val){
if(val){
this.$data.if_do=false;
}else{
this.$data.if_do=true;
}
this.get_ma_plan();
},
selectedRowStyle({ row, rowIndex }) {
for(var i=0; i< this.$data.multipleSelection.length;i++){
if(this.$data.multipleSelection[i].id == row.id){
let styleJson ={
"background":"#134857",
"color":"#FFFFFF",
};
return styleJson;
}
}
},
handleSelectionChange(val) {
console.log("已选择");
console.log(val);
this.multipleSelection = val;
},
tableRowClassName({row, rowIndex}) {
return;
if (row.cti != undefined && row.cti.length>0){
return 'child-row';
}else{
/*var n = rowIndex%2;
if (n == 1) {
return 'success-row';
}*/
}
return '';
},
show_update_dialog(row){
this.$data.form = {
id:row.id,
contract_id:row.contract_id,
supplier:row.supplier,
contract_name:row.contract_name,
rdm:row.rdm,
state:row.state,
amount:row.amount,
amount_1:row.amount_1,
warehouse_entry_number:row.warehouse_entry_number,
buyer:row.buyer,
state_1:row.state_1,
task_ids:row.task_ids,
};
console.log(this.$data.form)
//this.get_ma_user();
var op_user = localStorage.getItem("online_user");
var level = localStorage.getItem("level");
var did = localStorage.getItem("did");
if(level==1){
this.$data.disabled=false;
}else{
this.$data.disabled =true;
}
console.log(level,this.$data.disabled);
this.$data.updatedialogVisible_ex = true;
},
update_ma_ex(){
this.$refs['authform_ex'].validate((valid) => {
if (valid) {
var _this = this;
axios.post('/pp/update_sp_2', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
data:_this.form,
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
errType = "success"
s = "修改成功!";
} else{
errType = "error"
s = "修改失败!";
}
_this.$message({
message: s,
type: errType,
duration: 1500
});
//更新页面
if(r==0){
_this.get_ma_plan();
_this.$data.updatedialogVisible_ex = false;
}
})
.catch(function (error) {
console.log(error);
});
}
});
},
remove_ma_plan(row){
this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var _this = this;
axios.post('/pp/remove_ma_plan', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
id:row.id
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
errType = "success"
s = "删除成功!";
if (row.flag!="2"){
_this.get_ma_plan();
} else if (row.flag=="2"){
var arr1 = new Array(); //创建一个空数组
for(var i = 0; i < _this.$data.child_data.length;++i){
arr1.push(_this.$data.child_data[i].id);
}
_this.get_single_pp(arr1);
_this.get_ma_plan();
}
} else if(r==1){
errType = "warning"
s = "有子任务,请先删除子任务再删除主任务!";
} else{
errType = "error"
s = "删除失败!";
}
_this.$message({
message: s,
type: errType,
duration: 1500
});
})
.catch(function (error) {
console.log(error);
});
}).catch(() => {
});
},
get_ma_plan(){
document.getElementById("bt_serach").blur();
var _this = this;
var objs;
axios.post('/pp/get_sp_2', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
index: this.$data.currentPage,
count: this.$data.pagesize,
contract_id:parseInt(this.$data.contract_id_v),
supplier:this.$data.supplier_v,
contract_name:this.$data.contract_name_v,
rdm:this.$data.rdm_v,
buyer:this.$data.buyer_v,
if_done:this.$data.checked,
})
.then(function (response) {
console.log(response.data);
objs = response.data.data;
rcnt = response.data.total;
_this.$data.tableData = objs;
_this.$data.recordTotal = rcnt;
//_this.$data.pagecnt = response.data.pagecnt;
})
.catch(function (error) {
console.log(error);
});
},
handleSizeChange(val) {
//console.log(`每页 ${val} 条`);
this.$data.pagesize = val;
this.get_ma_plan();
},
handleCurrentChange(val) {
//console.log(`当前页: ${val}`);
this.$data.currentPage = val;
this.get_ma_plan();
},
}
}

477
scripts/user.js Normal file
View File

@ -0,0 +1,477 @@
//组件
var Usercomponent = {
template:`
<div>
<div id="" style="display: inline-block;width: 100%;">
<div style="float: left; width: 20%;">
<el-input v-model="input" placeholder="请输入用户" clearable @change="input_change"></el-input>
</div>
<div style="float: left;">
<el-button id ="bt_search" plain type="primary" icon="el-icon-search" @click="getUser(input)">搜索</el-button>
<el-button id ="bt_add" plain type="primary" icon="el-icon-circle-plus-outline" @click="addUser()">新增</el-button>
</div>
</div>
<div class="span">
<el-table
:data="tableData"
style="width: 100%"
:height="tHeight"
:cell-style="{background:'#fff'}"
border
>
<el-table-column
prop="username"
label="用户名"
width="100">
</el-table-column>
<el-table-column
prop="rolename"
label="角色"
width="120">
</el-table-column>
</el-table-column>
<el-table-column
prop="if_buyer"
label="是否采购人员"
width="120">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.if_buyer==1" @change="handleCheckboxChange(scope.row)" />
</template>
</el-table-column>
<!--<el-table-column
prop="department"
label="部门"
width="120">
</el-table-column>-->
<el-table-column
label="操作"
width="100">
<template slot-scope="scope">
<!--style="height:23px;padding:0px" -->
<el-button @click="updateUser(scope.row)" type="text" size="medium" >修改</el-button>
<el-button @click="delUser(scope.row)" type="text" size="medium" >删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="block">
<span class="demonstration"></span>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[50,100, 200, 300]"
:page-size="pagesize"
layout="total, sizes, prev, pager, next, jumper"
:total="recordTotal">
</el-pagination>
</div>
<el-dialog
title="用户信息"
:visible.sync="dialogVisible"
:lock-scroll ="false"
width="30%">
<el-form ref="userform" :model="form" label-width="80px" :rules="rules">
<el-form-item label="用户名" prop="username">
<el-input v-model="form.username"></el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input v-model="form.password" show-password></el-input>
</el-form-item>
<!--
<el-form-item label="部门" prop="department">
<el-select v-model="form.department" placeholder="请选择部门">
<el-option-group
key="1"
label="">
<el-option label="生产" value="生产"></el-option>
<el-option label="质检" value="质检"></el-option>
<el-option label="供应链" value="供应链"></el-option>
<el-option label="交付" value="交付"></el-option>
<el-option label="研发" value="研发"></el-option>
<el-option label="保温瓶" value="保温瓶"></el-option>
<el-option label="技术" value="技术"></el-option>
</el-option-group>
</el-select>
</el-form-item>
-->
<el-form-item label="角色" prop="role">
<el-select v-model="form.role" placeholder="请选择职位">
<el-option-group
key="1"
label="">
<el-option label="普通用户" value="普通用户"></el-option>
<el-option label="管理员" value="管理员"></el-option>
</el-option-group>
</el-select>
</el-form-item>
<!--<el-form-item label="状态" prop="state" >
<el-select v-model="form.state" placeholder="请选择" :disabled="state_dis">
<el-option-group
key="1"
label="">
<el-option label="状态1" value="状态1"></el-option>
<el-option label="状态2" value="状态2"></el-option>
</el-option-group>
</el-select>
</el-form-item>-->
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button id ="bt_ok" plain type="primary" @click="postUser()"> </el-button>
</span>
</el-dialog>
</div>
`,
data(){
// 获取当前屏幕的分辨率
let screenW = window.screen.width;
let screenH = window.innerHeight;
console.log("screen width:",screenW);
console.log("screen height:",screenH);
return {
tHeight:screenH-40-232,
tableData: [],
input:'',
currentPage: 1,
pagesize:50,
recordTotal:0,
form: {
id:'',
username: '',
password:'',
role: '',
department:'',
state:'',
},
dialogVisible:false,
oper_type:0,
rules: {
username: [
{ required: true, message: '用户不可为空', trigger: 'blur' }
],
password: [
{ required: true, message: '密码不可为空', trigger: 'blur' }
],
role: [
{ required: true, message: '用户角色不可为空', trigger: 'blur' }
],
state: [
{ required: true, message: '用户状态不可为空', trigger: 'blur' }
]
},
state_dis:false,
}
},
mounted() {
var _this = this;
var objs;
axios.post('/pp/getUsers', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
id: '',
index: this.$data.currentPage,
count: this.$data.pagesize
})
.then(function (response) {
console.log(response.data);
objs = response.data.data;
rcnt = response.data.total;
_this.$data.tableData = objs;
_this.$data.recordTotal = rcnt;
})
.catch(function (error) {
console.log(error);
});
},
methods: {
handleCheckboxChange(row){
var flag = row.if_buyer;
if (flag ==0){
flag=1
}else{
flag=0
}
var _this = this;
var objs;
axios.post('/pp/update_user_buyer', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
id: row.userid,
if_buyer:flag,
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
errType = "success"
} else{
errType = "error"
}
if (r ==0) {
s = "修改用户成功!";
} else{
s = "修改用户失败!";
}
_this.$message({
message: s,
type: errType,
duration: 1500
});
//更新页面
_this.getUser(_this.$data.input);
})
.catch(function (error) {
console.log(error);
});
},
input_change(value) {
console.log(value);
this.getUser(this.$data.input);
},
postUser(){
this.$refs['userform'].validate((valid) => {
if(valid){
this.$data.dialogVisible = false;
var _this = this;
console.log(_this.$data.form);
var objs;
axios.post('/pp/postUser', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
id: _this.$data.form.id,
username:_this.$data.form.username,
password: _this.$data.form.password,
role: _this.$data.form.role,
department:_this.$data.form.department,
oper_type: _this.$data.oper_type,
state:_this.$data.form.state,
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
errType = "success"
} else{
errType = "error"
}
if (_this.$data.oper_type == 1) {
if (r ==0) {
s = "新增用户成功!";
} else if(r == 1) {
s = "已存在相同用户名!";
}else{
s = "新增用户失败!";
}
} else if (_this.$data.oper_type ==2){
if (r ==0) {
s = "修改用户成功!";
} else{
s = "修改用户失败!";
}
}
_this.$message({
message: s,
type: errType,
duration: 1500
});
//更新页面
_this.getUser(_this.$data.input);
})
.catch(function (error) {
console.log(error);
});
}
});
},
delUser(userinfo){
this.$data.oper_type = 3;
var _this = this;
var objs;
axios.post('/pp/postUser', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
id: userinfo.userid,
username:userinfo.username,
password: userinfo.password,
role: userinfo.rolename,
department:userinfo.user_department,
oper_type: _this.$data.oper_type
})
.then(function (response) {
let r = response.data.r;
let s = ""
let errType = ""
if (r == 0) {
s = "删除用户成功!";
errType = "success"
} else{
s = "删除用户失败!";
errType = "error"
}
_this.$message({
message: s,
type: errType,
duration: 1500
});
if (r ==0) {
_this.getUser("");//更新页面
}
})
.catch(function (error) {
console.log(error);
});
},
addUser(){
document.getElementById("bt_add").blur();
this.$data.oper_type = 1;
this.$data.form = {
id:'',
username: '',
password:'',
role: '',
department:'',
state:'状态1'
};
this.$data.state_dis=true;
this.$nextTick(() => {
this.$refs['userform'].clearValidate()
});
this.$data.dialogVisible = true;
},
updateUser(userinfo){
this.$data.oper_type = 2;
this.$data.form = {
id:userinfo.userid,
username: userinfo.username,
password:userinfo.password,
role: userinfo.rolename,
department:userinfo.department,
state:userinfo.state,
};
this.$data.state_dis=false;
this.$nextTick(() => {
this.$refs['userform'].clearValidate()
});
this.$data.dialogVisible = true;
},
getUser(_search_name){
document.getElementById("bt_search").blur();
this.$data.currentPage=1;
var _this = this;
var objs;
axios.post('/pp/getUsers', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
id: _search_name,
index: this.$data.currentPage,
count: this.$data.pagesize
})
.then(function (response) {
console.log(response.data);
objs = response.data.data;
rcnt = response.data.total;
_this.$data.tableData = objs;
_this.$data.recordTotal = rcnt;
})
.catch(function (error) {
console.log(error);
});
},
handleSizeChange(val) {
this.$data.pagesize = val;
var _this = this;
var objs;
axios.post('/pp/getUsers', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
id: this.$data.input,
index: this.$data.currentPage,
count: this.$data.pagesize
})
.then(function (response) {
console.log(response.data);
objs = response.data.data;
rcnt = response.data.total;
_this.$data.tableData = objs;
_this.$data.recordTotal = rcnt;
})
.catch(function (error) {
console.log(error);
});
},
handleCurrentChange(val) {
this.$data.currentPage = val;
var _this = this;
var objs;
axios.post('/pp/getUsers', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
id: this.$data.input,
index: this.$data.currentPage,
count: this.$data.pagesize
})
.then(function (response) {
console.log(response.data);
objs = response.data.data;
rcnt = response.data.total;
_this.$data.tableData = objs;
_this.$data.recordTotal = rcnt;
})
.catch(function (error) {
console.log(error);
});
}
}
}

3151
scripts/vue-router.js Normal file

File diff suppressed because it is too large Load Diff

12014
scripts/vue.min.js vendored Normal file

File diff suppressed because it is too large Load Diff

2932
scripts/welldata.js Normal file

File diff suppressed because it is too large Load Diff