Browse Source

Merge remote-tracking branch 'origin/master'

master
wangpengfei 2 years ago
parent
commit
b5c71033aa
  1. 8
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/flowInstrument/flowInstrument.js
  2. 11
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/oilTank/oilTank.js
  3. 5
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/oilType/oilType.js
  4. 14
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/oilTypeInAndOutBound/oilTypeInAndOutBound.js
  5. 14
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/rawMaterialInAndOutBound/rawMaterialInAndOutBound.js
  6. 8
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/rawMaterialInfo/rawMaterialInfo.js
  7. 4
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/rawMaterialType/rawMaterialType.js
  8. 7
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/supplier/supplier.js
  9. 16
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/user.js
  10. BIN
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/assets/home/bj.jpg
  11. 8
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/layout/components/Navbar.vue
  12. 2
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/router/index.js
  13. 17
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/utils/request.js
  14. 1
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/oilType/index.vue
  15. 34
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/oilType/oilTypeAdd.vue
  16. 10
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/index.vue
  17. 132
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/login/login.vue
  18. 19
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/supervise/recordOilTank/index.vue

8
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/flowInstrument/flowInstrument.js

@ -1,5 +1,5 @@
import request from '@/utils/request'
let tokens = window.sessionStorage.getItem('tokenValue')
export default {
// 查询分页列表
@ -9,7 +9,8 @@ export default {
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'token': tokens
}
})
},
@ -49,7 +50,8 @@ export default {
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'token': tokens
}
})
},

11
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/oilTank/oilTank.js

@ -1,5 +1,5 @@
import request from '@/utils/request'
let tokens = window.sessionStorage.getItem('tokenValue')
export default {
// 查询分页列表
@ -9,7 +9,8 @@ export default {
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'token': tokens
}
})
},
@ -28,7 +29,8 @@ export default {
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'token': tokens
}
})
},
@ -71,7 +73,8 @@ export default {
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'token': tokens
}
});
},

5
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/oilType/oilType.js

@ -1,5 +1,5 @@
import request from '@/utils/request'
let tokens = window.sessionStorage.getItem('tokenValue')
export default {
// 查询分页列表
@ -9,7 +9,8 @@ export default {
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'token': tokens
}
})
},

14
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/oilTypeInAndOutBound/oilTypeInAndOutBound.js

@ -1,5 +1,5 @@
import request from '@/utils/request'
let tokens = window.sessionStorage.getItem('tokenValue')
export default {
// 获取油罐
tankList: function(params) {
@ -8,7 +8,8 @@ export default {
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'token': tokens
}
})
},
@ -29,7 +30,8 @@ export default {
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'token': tokens
}
})
},
@ -51,7 +53,8 @@ export default {
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'token': tokens
}
})
},
@ -70,7 +73,8 @@ export default {
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'token': tokens
}
})
},

14
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/rawMaterialInAndOutBound/rawMaterialInAndOutBound.js

@ -1,5 +1,5 @@
import request from '@/utils/request'
let tokens = window.sessionStorage.getItem('tokenValue')
export default {
// 获取原料
inventoryList: function(params) {
@ -8,7 +8,8 @@ export default {
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'token': tokens
}
})
},
@ -21,7 +22,8 @@ export default {
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'token': tokens
}
})
},
@ -44,7 +46,8 @@ export default {
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'token': tokens
}
})
},
@ -63,7 +66,8 @@ export default {
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'token': tokens
}
})
},

8
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/rawMaterialInfo/rawMaterialInfo.js

@ -1,5 +1,5 @@
import request from '@/utils/request'
let tokens = window.sessionStorage.getItem('tokenValue')
export default {
// 查询分页列表
@ -9,7 +9,8 @@ export default {
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'token': tokens
}
})
},
@ -28,7 +29,8 @@ export default {
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'token': tokens
}
})
},

4
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/rawMaterialType/rawMaterialType.js

@ -1,5 +1,6 @@
import request from '@/utils/request'
let tokens = window.sessionStorage.getItem('tokenValue')
export default {
// 查询分页列表
@ -9,7 +10,8 @@ export default {
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'token': tokens
}
})
},

7
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/supplier/supplier.js

@ -1,5 +1,6 @@
import request from '@/utils/request'
let tokens = window.sessionStorage.getItem('tokenValue')
export default {
// 查询分页列表
@ -9,7 +10,8 @@ export default {
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'token': tokens
}
})
},
@ -51,7 +53,8 @@ export default {
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'token': tokens
}
})
},

16
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/user.js

@ -2,6 +2,22 @@ import request from '@/utils/request'
// eslint-disable-next-line no-unused-vars
import qs from 'qs'
// 登录
export function doLogin(data) {
return request({
url: '/cyf/sys/doLogin',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
})
}
// 获取登录人员信息
export function getUserById(sid) {
return request({
url: '/cyf/sys/getUserById/' + sid
})
}
// 登录
export function login(data) {
return request({

BIN
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/assets/home/bj.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

8
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/layout/components/Navbar.vue

@ -19,18 +19,12 @@
export default {
data() {
return {
Orgname: '',
departmentName: '',
name: '',
year:'',
pNameAndDepartmentNameAndPostName:''
}
},
mounted() {
this.Orgname = window.sessionStorage.getItem('Orgname')
this.departmentName = window.sessionStorage.getItem('departmentName')
this.pNameAndDepartmentNameAndPostName = window.sessionStorage.getItem('defaultOrgPathName')
this.name = window.sessionStorage.getItem('name')
this.name = window.sessionStorage.getItem('userName')
var nowDate = new Date()
this.year = nowDate.getFullYear()
},

2
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/router/index.js

@ -20,7 +20,7 @@ export const constantRoutes = [{
},
{
path: '/',
redirect: 'index'
redirect: 'login'
}, {
path: '/login',
component: () => import('@/views/login/login.vue')

17
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/utils/request.js

@ -1,7 +1,13 @@
import axios from 'axios'
import { MessageBox, Message } from 'element-ui'
import {
MessageBox,
Message
} from 'element-ui'
import store from '@/store'
import { getToken, getStorage } from '@/utils/auth'
import {
getToken,
getStorage
} from '@/utils/auth'
// create an axios instance
const service = axios.create({
@ -51,7 +57,7 @@ service.interceptors.response.use(
response => {
const res = response.data
const statusCode = response.status
console.log('statusCode>>>' + statusCode)
// if the custom code is not 20000, it is judged as an error.
if (statusCode !== 200) {
Message({
@ -62,7 +68,8 @@ service.interceptors.response.use(
})
// 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
if (statusCode === 401 || res.code === '5000' || res.code === 5000 || res.code === 50012 || res.code === 50014) {
if (statusCode === 401 || res.code === '5000' || res.code === 5000 || res.code === 50012 || res.code ===
50014) {
// to re-login
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
confirmButtonText: '重新登录',
@ -77,7 +84,7 @@ service.interceptors.response.use(
}
return Promise.reject(new Error(res.message || 'Error'))
} else {
if (!res.success) {
if (!res.success && res.success !== null && res.success !== undefined) {
Message({
message: res.msg || 'Error',
type: 'error',

1
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/oilType/index.vue

@ -37,6 +37,7 @@
<el-table-column label="原油名称" prop="name" align="center" />
<el-table-column label="原油编码" prop="number" align="center" />
<el-table-column label="原油Code" prop="code" align="center" />
<el-table-column label="原油单价" prop="price" align="center" />
</el-table>
</div>
<div class="pages">

34
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/oilType/oilTypeAdd.vue

@ -28,6 +28,11 @@
<span class="item_text">原油Code</span>
<el-input v-model="formobj.code" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">原油单价</span>
<el-input v-model="formobj.price" @input="limitInput($event,'slPrice')" placeholder="" class="item_input"
clearable />
</div>
</el-card>
</div>
@ -45,13 +50,31 @@
sid: "",
name: "",
number: "",
code: ""
code: "",
price: "",
}
}
},
methods: {
/**
* 1必须为数字
* 2只能有一个小数点
* 3小数点后保留两位小数
* 4当第一位输入小数点的时候自动补全补为 0.
* 5除非是小数否则数字不能以0开头
* @param {string} value - 输入的值
* @param {string} name - 匹配的对象属性 [mkPrice | slPrice]
*/
limitInput(value, name) {
this.formobj.price =
("" + value) //
.replace(/[^\d^\.]+/g, "") //
.replace(/^0+(\d)/, "$1") // 00
.replace(/^\./, "0.") // 0.
.match(/^\d*(\.?\d{0,2})/g)[0] || ""; // 02
},
saveOrUpdate() {
if(this.formobj.sid){
if (this.formobj.sid) {
req.updateData(this.formobj)
.then(resp => {
if (resp.success) {
@ -66,7 +89,7 @@
}
})
.catch(() => {})
}else{
} else {
req.addInfo(this.formobj)
.then(resp => {
if (resp.success) {
@ -90,7 +113,8 @@
sid: "",
name: "",
number: "",
code: ""
code: "",
price: "",
}
this.$emit('doback')
},
@ -99,7 +123,7 @@
},
showEdit(row) {
console.log("sid>>>>>>>>>",row.sid)
console.log("sid>>>>>>>>>", row.sid)
req.fetchBySid(row.sid)
.then(resp => {
if (resp.success) {

10
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/index.vue

@ -11,8 +11,16 @@
name: '',
data() {
return {
token:''
token1:'',
token2:''
}
},
created() {
this.token1 = window.sessionStorage.getItem('tokenName');
this.token2 = window.sessionStorage.getItem('tokenValue');
console.log("tokenName2222", this.token1)
console.log("tokenValue222222", this.token2)
},
methods:{
// getToken(){

132
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/login/login.vue

@ -1,8 +1,9 @@
<template>
<div class="login">
<div class="logoTitle">
<img src="../../assets/loginImg/logo.png" /><span>贷后监管</span>
<p class="title">贷后监管体系</p>
<div class="logoTitle" style="margin-left: 50px;margin-top: 50px;">
<img src="../../assets/loginImg/cyf_logo.jpg"
style="width: 50px;height: 50px; margin-right: 10px;" /><span>醇油坊</span>
<p class="title" style="margin-top: 5px;">醇油坊进销存管理平台</p>
</div>
<div class="main">
<div class="content">
@ -13,18 +14,21 @@
</el-input>
</el-form-item>
<el-form-item>
<el-input v-model="loginForm.password" autocomplete="off" placeholder="请输入密码" prefix-icon="el-icon-lock" show-password>
<el-input v-model="loginForm.password" autocomplete="off" placeholder="请输入密码" prefix-icon="el-icon-lock"
show-password>
</el-input>
<span class="nopsw register" @click="forgetPwd = true">忘记密码 </span>
</el-form-item>
<el-form-item v-show="showMsg" style="margin-bottom:0;">
<span class="text-danger">提示用户名或密码错误请重试</span>
</el-form-item>
<el-form-item>
<el-popover placement="top" width="400" trigger="click" v-model="loginCode" @show="codeShow">
<el-button type="primary" class="login-btn" v-loading="loading" @click="login"> </el-button>
<!-- <el-popover placement="top" width="400" trigger="click" v-model="loginCode" @show="codeShow">
<imgCodeRole @login="login" ref="imgCodeRole"></imgCodeRole>
<el-button slot="reference" type="primary" class="login-btn" v-loading="loading"> </el-button>
</el-popover>
</el-popover> -->
<!--<router-link :to="{name: 'registUser'}" target="_blank" tag="a" class="register fl">个人注册</router-link>
<router-link :to="{name: 'registOrg'}" target="_blank" tag="a" class="register fr">单位注册</router-link>-->
</el-form-item>
@ -51,20 +55,28 @@
</template>
<script>
import { login, imgCode } from '@/api/user.js'
import user from '@/api/User/login.js'
import { setToken, getToken, setSession } from '@/utils/auth'
import imgCodeRole from '@/components/imgCodeRole/index.vue'
import qs from 'qs'
export default {
components: { imgCodeRole },
import {
doLogin,
getUserById,
imgCode
} from '@/api/user.js'
import user from '@/api/User/login.js'
import {
setToken,
getToken,
setSession
} from '@/utils/auth'
import imgCodeRole from '@/components/imgCodeRole/index.vue'
import qs from 'qs'
export default {
components: {
imgCodeRole
},
data() {
return {
loginForm: {
userName: '',
password: '',
verifyCode: '',
uuid: '',
},
imgCode: '',
loading: false,
@ -78,21 +90,58 @@ export default {
}
},
methods: {
login(data) {
this.loading = true
this.loginForm.verifyCode = data.verifyCode
this.loginForm.uuid = data.uuid
this.$store
.dispatch('user/login', this.loginForm)
.then((res) => {
// this.$setStorage.dispatch('user/getInfo')
this.$router.push({ path: '/home' })
this.loading = false
login() {
doLogin(this.loginForm).then((response) => {
if (response.code == 200) {
console.log(" response", response)
this.$router.push({
path: '/index'
})
.catch(() => {
this.loading = false
this.$refs.imgCodeRole.getCodeImage()
this.getUserInfo(response.data.loginId)
window.sessionStorage.setItem('tokenName', response.data.tokenName)
window.sessionStorage.setItem('tokenValue', response.data.tokenValue)
console.log(" tokenName", response.data.tokenName)
console.log(" tokenValue", response.data.tokenValue)
}
}).catch(() => {
this.loading = false
})
// this.loading = true
// this.loginForm.verifyCode = data.verifyCode
// this.loginForm.uuid = data.uuid
// this.$store
// .dispatch('user/login', this.loginForm)
// .then((res) => {
// // this.$setStorage.dispatch('user/getInfo')
// this.$router.push({
// path: '/home'
// })
// this.loading = false
// })
// .catch(() => {
// this.loading = false
// this.$refs.imgCodeRole.getCodeImage()
// })
},
getUserInfo(id) {
getUserById(id).then((response) => {
if (response.code == 200) {
console.log(" response", response)
let user = response.data
//
window.sessionStorage.setItem('staffSid', user.staffSid)
window.sessionStorage.setItem('sid', user.sid)
window.sessionStorage.setItem('userName', user.userName)
}
}).catch(() => {
})
},
codeShow() {
if (this.loginForm.password == '' || this.loginForm.userName == '') {
@ -106,28 +155,32 @@ export default {
user.reGetPwd(this.nopassword).then((res) => {})
},
},
}
}
</script>
<style lang="scss">
.login {
.login {
position: relative;
width: 100%;
height: 100%;
background-size: 100% 100%;
background-image: url(../../assets/loginImg/bgImg.png);
background-image: url(../../assets/home/bj.jpg);
background-position: center;
overflow: hidden;
.logoTitle {
margin: 30px;
img {
width: 70px;
}
span {
font-size: 40px;
color: #191919;
}
.title {
font-size: 25px;
font-family: Source Han Sans CN;
@ -136,6 +189,7 @@ export default {
margin: 0;
}
}
.main {
width: 30%;
/*height: 640px;*/
@ -160,9 +214,11 @@ export default {
}*/
}
}
}
.login-form {
}
.login-form {
padding: 30px 50px;
.title1 {
margin: 0px auto 30px auto;
text-align: center;
@ -171,10 +227,12 @@ export default {
font-size: 23px;
font-weight: 500;
}
.el-input {
border: none;
background-color: transparent;
}
.code {
position: absolute;
top: 3px;
@ -184,6 +242,7 @@ export default {
cursor: pointer;
z-index: 9;
}
.nopsw {
position: absolute;
bottom: -30px;
@ -192,13 +251,16 @@ export default {
font-size: 15px;
line-height: 30px;
}
.register {
color: #018ad2;
}
.register:hover,
.nopsw:hover {
cursor: pointer;
}
.btn-eye {
cursor: pointer;
}
@ -213,20 +275,24 @@ export default {
background-color: #007fff;
border: 0;
}
.login-btn:hover {
background-color: #007fdd;
border: 0;
}
.el-input--prefix .el-input__inner {
border: 1px solid #018ad2;
background: transparent;
color: #333 !important;
}
.el-form-item {
margin-bottom: 40px;
}
.el-loading-mask {
background-color: rgba(255, 255, 255, 0.6);
}
}
}
</style>

19
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/supervise/recordOilTank/index.vue

@ -24,7 +24,7 @@
</div>
<div class="item">
<span class="item_text">油罐库存高度</span>
<el-input v-model="formobj.height" placeholder="" class="item_input" clearable />
<el-input v-model="formobj.height" placeholder="" @input="limitInput($event,'slPrice')" class="item_input" clearable />
</div>
<div class="item" style="margin-top: 70px;">
<span class="item_text">登记材料</span>
@ -65,6 +65,23 @@
this.getTankList()
},
methods: {
/**
* 1必须为数字
* 2只能有一个小数点
* 3小数点后保留两位小数
* 4当第一位输入小数点的时候自动补全补为 0.
* 5除非是小数否则数字不能以0开头
* @param {string} value - 输入的值
* @param {string} name - 匹配的对象属性 [mkPrice | slPrice]
*/
limitInput(value, name) {
this.formobj.height =
("" + value) //
.replace(/[^\d^\.]+/g, "") //
.replace(/^0+(\d)/, "$1") // 00
.replace(/^\./, "0.") // 0.
.match(/^\d*(\.?\d{0,2})/g)[0] || ""; // 02
},
getTankList() {
req2.tankList().then((res) => {
if (res.success) {

Loading…
Cancel
Save