Browse Source

【前端pc】pad和pc登录问题兼容开发

ag_report_nev
安虹睿 12 months ago
parent
commit
c58138d3cb
  1. 2
      fe/PC/src/layout/index.vue
  2. 40
      fe/PC/src/permission.js
  3. 27
      fe/PC/src/router/index.js
  4. 119
      fe/PC/src/styles/padMain.scss
  5. 2
      fe/PC/src/utils/detailsTableColumns/index.js
  6. 2
      fe/PC/src/utils/tableColumns/index.js
  7. 2
      fe/PC/src/utils/tabsDesTions/index.js
  8. 16
      fe/PC/src/views/login/index.vue
  9. 513
      fe/PC/src/views/login/indexPad.vue
  10. 14
      fe/PC/src/views/padManage/isPadForKittingPack.vue
  11. 10
      fe/PC/src/views/padManage/isPadForMenuPage.vue
  12. 50
      fe/PC/src/views/padManage/isPadForTransferLibJob.vue
  13. 26
      fe/PC/src/views/padManage/isPadForTransferLibJob_new.vue
  14. 278
      fe/PC/src/views/padManage/isPadForTransferLibJob_old.vue

2
fe/PC/src/layout/index.vue

@ -57,7 +57,7 @@ export default {
data() {
return {
//
isOnlyAppMainPages:['padTransferLibJob','padKittingPack']
isOnlyAppMainPages:['isPadForTransferLibJob','isPadForKittingPack']
}
},
methods: {

40
fe/PC/src/permission.js

@ -17,7 +17,8 @@ NProgress.configure({
showSpinner: false
}) // NProgress Configuration
const whiteList = ['/login', '/auth-redirect', '/testForm'] // no redirect whitelist
const whiteList = ['/login','/loginPad', '/auth-redirect', '/testForm'] // no redirect whitelist
const _isPad = 'isPadFor'
router.beforeEach(async (to, from, next) => {
// 添加路由信息,方便代码修改定位
@ -42,11 +43,26 @@ router.beforeEach(async (to, from, next) => {
// // NProgress.done()
// }
// }
if (to.path === '/login') {
// if is logged in, redirect to the home page
next({
path: '/'
})
if (to.path === '/login' || to.path == '/loginPad') {
// pad
if(to.path == '/loginPad'){
if(to.query && to.query.redirect){
next({
path: to.query.redirect
})
}else{
next({
path: '/isPadForMenuPage'
})
}
}
// pc
else{
// if is logged in, redirect to the home page
next({
path: '/'
})
}
NProgress.done() // hack: https://github.com/PanJiaChen/vue-element-admin/pull/2939
} else {
// determine whether the user has obtained his permission roles through getInfo
@ -80,7 +96,11 @@ router.beforeEach(async (to, from, next) => {
// remove token and go to login page to re-login
await store.dispatch('user/resetToken')
Message.error(error || 'Has Error')
next(`/login?redirect=${to.path}`)
if(to.path.indexOf(_isPad) >= 0){
next(`/loginPad?redirect=${to.path}`)
}else{
next(`/login?redirect=${to.path}`)
}
NProgress.done()
}
}
@ -93,7 +113,11 @@ router.beforeEach(async (to, from, next) => {
next()
} else {
// other pages that do not have permission to access are redirected to the login page.
next(`/login?redirect=${to.path}`)
if(to.path.indexOf(_isPad) >= 0){
next(`/loginPad?redirect=${to.path}`)
}else{
next(`/login?redirect=${to.path}`)
}
NProgress.done()
}
}

27
fe/PC/src/router/index.js

@ -142,22 +142,29 @@ export const constantRoutes = [
}
}]
},
// 【平板】 登录页
{
path: '/loginPad',
component: () => import('@/views/login/indexPad'),
hidden: true
},
// 【平板】 菜单页
{
path: '/padMenuPage',
component: () => import('@/views/padManage/padMenuPage'),
path: '/isPadForMenuPage',
component: () => import('@/views/padManage/isPadForMenuPage'),
hidden: true
},
// 【平板】 业务库移
{
path: '/',
component: Layout,
redirect: '/padTransferLibJob',
redirect: '/isPadForTransferLibJob',
hidden: true,
children: [{
path: 'padTransferLibJob',
component: () => import('@/views/padManage/padTransferLibJob'),
name: 'padTransferLibJob',
path: 'isPadForTransferLibJob',
component: () => import('@/views/padManage/isPadForTransferLibJob'),
name: 'isPadForTransferLibJob',
meta: {
keepAlive : true,
title: '业务库移',
@ -169,12 +176,12 @@ export const constantRoutes = [
{
path: '/',
component: Layout,
redirect: '/padKittingPack',
redirect: '/isPadForKittingPack',
hidden: true,
children: [{
path: 'padKittingPack',
component: () => import('@/views/padManage/padKittingPack'),
name: 'padKittingPack',
path: 'isPadForKittingPack',
component: () => import('@/views/padManage/isPadForKittingPack'),
name: 'isPadForKittingPack',
meta: {
keepAlive : true,
title: 'Kitting组包',

119
fe/PC/src/styles/padMain.scss

@ -0,0 +1,119 @@
@import './variables.scss';
@import './basicData.scss';
.padpageBox {
background:#fff;
margin:10px;
height:calc(100% - 20px);
min-width:800px;
overflow:auto;
// ::v-deep .el-dialog {
// .el-dialog__body {
// padding-bottom: 20px;
// }
// .form1,
// .form2 {
// display: flex;
// flex-direction: column;
// width: 100%;
// height: 100%;
// }
// .form1 .el-form {
// flex: 1;
// padding-left: 70px;
// padding-right: 70px;
// display: flex;
// flex-direction: column;
// overflow: hidden;
// .el-row {
// flex: 2;
// padding-left: 30px;
// padding-right: 30px;
// flex-wrap: wrap;
// overflow: hidden;
// overflow-y: auto;
// }
// .formTable-box {
// flex: 2;
// overflow: hidden;
// .el-form-item__content {
// width: 100%;
// height: 100%;
// display: flex;
// flex-direction: column;
// overflow: hidden;
// margin: 0 !important;
// }
// .heder {
// padding: 5px 0;
// text-align: end;
// span {
// color: rgb(64, 158, 255);
// cursor: pointer;
// &:hover {
// color: blue;
// }
// }
// }
// .el-table {
// flex: 1;
// // white-space: nowrap;
// // display: flex;
// .childTable {
// display: flex;
// justify-content: space-around;
// span {
// cursor: pointer;
// &:nth-child(1) {
// color: red;
// }
// &:nth-child(2) {
// color: green;
// }
// }
// }
// }
// }
// }
// }
// .form2 .el-form {
// flex: 1;
// padding-left: 100px;
// padding-right: 100px;
// display: flex;
// justify-content: flex-start;
// align-content: flex-start;
// flex-wrap: wrap;
// overflow: hidden;
// overflow-y: auto;
// }
// .screen-push {
// color: rgb(64, 158, 255);
// span {
// cursor: pointer;
// &:hover {
// color: blue;
// }
// }
// }
// .formButton {
// padding: 20px 20px 20px 0;
// }
}

2
fe/PC/src/utils/detailsTableColumns/index.js

@ -5193,7 +5193,7 @@ export const KittingIssueNote = [
]
// 【pad】业务库移
export const padTransferLibJob = [
export const isPadForTransferLibJob = [
{ label: "物品代码", prop: "itemCode", fixed: "left" },
{ label: "物品名称", prop: "itemName" },
{ label: "物品描述1", prop: "itemDesc1" },

2
fe/PC/src/utils/tableColumns/index.js

@ -4977,7 +4977,7 @@ export const KittingIssueNote = [
]
// 【pad】业务库移
export const padTransferLibJob = [
export const isPadForTransferLibJob = [
{ label: "任务单号", prop: "number", fixed: "left", type: "name" },
{ label: "申请单号", prop: 'requestNumber',width: orderWidth },
{ label: "状态", prop: "jobStatus",type: "tagFilter", filters: "jobStatus" },

2
fe/PC/src/utils/tabsDesTions/index.js

@ -3746,7 +3746,7 @@ export const KittingIssueNote = [
]
// 【pad】业务库移
export const padTransferLibJob = [
export const isPadForTransferLibJob = [
{ label: "任务单号", prop: "number", fixed: "left", type: "name" },
{ label: "申请单号", prop: 'requestNumber' },
{ label: "状态", prop: "jobStatus",type: "filter", filters: "jobStatus" },

16
fe/PC/src/views/login/index.vue

@ -172,8 +172,20 @@ export default {
this.loading = true
this.$store.dispatch('user/login', this.loginForm)
.then(() => {
this.$router.push({ path: '/'})
this.loading = false
//
let _isPad = 'isPadFor'
if(this.$route.query.redirect.indexOf(_isPad) >= 0){
if(this.$route.query && this.$route.query.redirect){
this.$router.push({ path: this.$route.query.redirect})
}else{
this.$router.push({ path: '/isPadForMenuPage'})
}
}
else{
// pc
this.$router.push({ path: '/'})
this.loading = false
}
})
.catch((error) => {
this.$message.error('用户名或密码错误!')

513
fe/PC/src/views/login/indexPad.vue

@ -0,0 +1,513 @@
<template>
<div class="login-container">
<img class="loginLogoImg" src="../../../public/login_logo.png" alt="">
<div class="login-form-wrapper">
<div class="left"></div>
<div class="right" id="right">
<el-form
ref="loginForm"
:model="loginForm"
:rules="loginRules"
class="login-form"
autocomplete="on"
label-position="left"
>
<div class="title-container">
<h3 class="title">欢迎登录</h3>
</div>
<el-form-item prop="username">
<span class="svg-container">
<svg-icon icon-class="user" />
</span>
<el-input
ref="username"
v-model="loginForm.username"
placeholder="用户名"
name="username"
type="text"
tabindex="1"
autocomplete="on"
/>
</el-form-item>
<el-tooltip
v-model="capsTooltip"
content="Caps lock is On"
placement="right"
manual
>
<el-form-item prop="password">
<span class="svg-container">
<svg-icon icon-class="password" />
</span>
<el-input
:key="passwordType"
ref="password"
v-model="loginForm.password"
:type="passwordType"
placeholder="密码"
name="password"
tabindex="2"
autocomplete="on"
@keyup.native="checkCapslock"
@blur="capsTooltip = false"
@keyup.enter.native="handleLogin"
/>
<span class="show-pwd" @click="showPwd">
<svg-icon
:icon-class="passwordType === 'password' ? 'eye' : 'eye-open'"
/>
</span>
</el-form-item>
</el-tooltip>
<el-button
class="loginButton"
:loading="loading"
type="primary"
@click.native.prevent="handleLogin"
> </el-button
>
</el-form>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Login',
data () {
const validateUsername = (rule, value, callback) => {
if (!value) {
callback(new Error('请输入正确的用户名'))
} else {
callback()
}
}
const validatePassword = (rule, value, callback) => {
if (value.length < 6) {
callback(new Error('密码不能少于6位'))
} else {
callback()
}
}
return {
loginForm: {
grant_type: 'password',
client_id: 'Auth_App',
warehouseCode: localStorage.getItem("warehouseCode"),
company: localStorage.getItem("company"),
username: '',
password: ''
},
loginRules: {
username: [{ required: true, trigger: 'blur', validator: validateUsername }],
password: [{ required: true, trigger: 'blur', validator: validatePassword }]
},
passwordType: 'password',
capsTooltip: false,
loading: false,
redirect: undefined,
otherQuery: {}
}
},
watch: {
$route: {
handler: function (route) {
const query = route.query
if (query) {
this.redirect = query.redirect
this.otherQuery = this.getOtherQuery(query)
}
},
immediate: true
}
},
created () {
// window.addEventListener('storage', this.afterQRScan)
//
document.addEventListener('mousewheel', function (e) {
e = e || window.event;
if ((e.wheelDelta && event.ctrlKey) || e.detail) {
event.preventDefault();
}
}, {
capture: false,
passive: false
});
},
mounted () {
window.showInfoFromJava = this.showInfoFromJava
if (this.loginForm.username === '') {
this.$refs.username.focus()
} else if (this.loginForm.password === '') {
this.$refs.password.focus()
}
},
destroyed () {
// window.removeEventListener('storage', this.afterQRScan)
},
methods: {
showInfoFromJava(msg){
console.log("showInfoFromJava")
alert(msg)
},
checkCapslock (e) {
const { key } = e
this.capsTooltip = key && key.length === 1 && (key >= 'A' && key <= 'Z')
},
showPwd () {
if (this.passwordType === 'password') {
this.passwordType = ''
} else {
this.passwordType = 'password'
}
this.$nextTick(() => {
this.$refs.password.focus()
})
},
handleLogin () {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true
this.$store.dispatch('user/login', this.loginForm)
.then(() => {
if(this.$route.query && this.$route.query.redirect){
this.$router.push({ path: this.$route.query.redirect})
}else{
this.$router.push({ path: '/isPadForMenuPage'})
}
})
.catch((error) => {
this.$message.error('用户名或密码错误!')
this.loading = false
})
} else {
console.log('error submit!!')
return false
}
})
},
getOtherQuery (query) {
return Object.keys(query).reduce((acc, cur) => {
if (cur !== 'redirect') {
acc[cur] = query[cur]
}
return acc
}, {})
},
// afterQRScan() {
// if (e.key === 'x-admin-oauth-code') {
// const code = getQueryObject(e.newValue)
// const codeMap = {
// wechat: 'code',
// tencent: 'code'
// }
// const type = codeMap[this.auth_type]
// const codeName = code[type]
// if (codeName) {
// this.$store.dispatch('LoginByThirdparty', codeName).then(() => {
// this.$router.push({ path: this.redirect || '/' })
// })
// } else {
// alert('')
// }
// }
// }
}
}
</script>
<style lang="scss">
/* 修复input 背景不协调 和光标变色 */
/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
$bg: #283443;
$bg_gray: #ececec;
$light_gray: #fff;
$cursor: #fff;
$dark_gray: #889aa4;
@supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
.login-container .el-input input {
color: $cursor;
}
}
/* reset element-ui css */
.login-container {
.el-select {
display: inline-block;
height: 47px;
width: calc(100% - 30px);
.el-input {
width: 100%;
}
}
.el-input {
display: inline-block;
height: 47px;
width: 85%;
input {
background: transparent;
border: 0px;
appearance: none;
-webkit-appearance: none;
border-radius: 0px;
padding: 12px 5px 12px 15px;
color: $dark_gray;
height: 47px;
caret-color: $dark_gray;
&:-webkit-autofill {
box-shadow: 0 0 0px 1000px $bg_gray inset !important;
-webkit-text-fill-color: $dark_gray !important;
}
}
}
.el-form-item {
border: 1px solid rgba(255, 255, 255, 0.1);
// background: rgba(0, 0, 0, 0.1);
// background-color: $bg;
background-color: $bg_gray;
border-radius: 5px;
color: #454545;
}
}
</style>
<style lang="scss" scoped>
$bg: #2d3a4b;
$dark_gray: #889aa4;
$light_gray: #eee;
.login-container {
background: url('../../../public/LoginBackground.png') no-repeat;
background-size: cover;
background-position: center 0;
height: 100vh;
width: 100vw;
overflow: hidden;
.loginLogoImg{
position: fixed;
left: 30px;
top: 30px;
// width:600px;
height: 110px;
}
// .login-bg-wrapper {
// position: absolute;
// top: 0;
// left: 0;
// height: 100%;
// width: 100%;
// img {
// width: 100%;
// height: 100%;
// // -o-object-fit: cover;
// object-fit: cover;
// }
// }
.login-form-wrapper {
width: 100%;
height: 100%;
display: flex;
align-items: center;
}
.login-form {
padding-top: 30px;
overflow: hidden;
// position: relative;
// width: 520px;
// max-width: 100%;
// padding: 160px 35px 0;
// margin: 0 auto;
// overflow: hidden;
}
.tips {
font-size: 14px;
color: #fff;
margin-bottom: 10px;
span {
&:first-of-type {
margin-right: 16px;
}
}
}
.svg-container {
padding: 6px 5px 6px 15px;
color: $dark_gray;
vertical-align: middle;
width: 30px;
display: inline-block;
}
.title-container {
position: relative;
.title {
font-size: 30px;
letter-spacing:19px;
// color: $light_gray;
color: $bg;
margin: 0px auto 40px auto;
text-align: center;
font-weight: bold;
}
}
.loginButton{
width: 100%;
margin-top: 100px;
height:50px;
font-size:18px
}
.show-pwd {
position: absolute;
right: 10px;
top: 7px;
font-size: 16px;
color: $dark_gray;
cursor: pointer;
user-select: none;
}
.thirdparty-button {
position: absolute;
right: 0;
bottom: 6px;
}
@media only screen and (max-width: 470px) {
.thirdparty-button {
display: none;
}
}
}
@media screen and (min-width: 992px) {
// @media screen and (min-width: 992px) {
.left {
// background-position: center 0;
// background-size: cover;
width: 100%;
height: 100%;
// display: block;
// flex: 1;
}
.right {
height: 100%;
// background-position: center -15px;
// min-width: 650px;
// width: 35%;
width: 440px;
margin-right: 11%;
flex-shrink: 0;
// flex: 1;
display: flex;
justify-content: center;
align-items: center;
.login-form {
width: 100%;
overflow: hidden;
background: #fff;
padding: 80px 40px;
border-radius: 8px;
// position: relative;
// width: 520px;
// max-width: 100%;
// padding: 160px 35px 0;
// margin: 0 auto;
// overflow: hidden;
}
}
}
// @media screen and (max-height: 750px) {
// .login-container {
// background: url('../../../public/LoginBackground-right.png') no-repeat;
// background-size: cover;
// // background-image: none;
// // background-color: $bg;
// }
// .left {
// display: none;
// }
// .right{
// width: 100%;
// .login-form {
// width: 76%;
// margin: 0 auto;
// }
// // background-size: cover;
// // background-position: center 0;
// }
// }
// @media screen and (min-width: 768px) and (max-width: 992px) {
// .login-container {
// background: url('../../../public/LoginBackground-right.png') no-repeat;
// background-size: cover;
// // background-image: none;
// // background-color: $bg;
// }
// .left {
// display: none;
// }
// .right {
// width: 100%;
// .login-form {
// width: 76%;
// margin: 0 auto;
// .title{
// color: $light_gray;
// }
// }
// // flex: 1;
// // display: flex;
// // justify-content: center;
// // align-items: center;
// // .login-form {
// // width: 70%;
// // }
// }
// }
@media screen and (max-width: 992px) {
.login-container {
background: url('../../../public/LoginBackground-right.png') no-repeat;
background-size: cover;
// background-image: none;
// background-color: $bg;
// .loginLogoImg{
// width: 80%;
// }
}
.left {
display: none;
}
.right {
width: 100%;
.login-form {
width: 76%;
margin: 0 auto;
.title{
color: $light_gray;
}
}
// flex: 1;
// min-width: 250px;
// display: flex;
// justify-content: center;
// align-items: center;
// .login-form {
// width: 90%;
// }
}
}
</style>

14
fe/PC/src/views/padManage/padKittingPack.vue → fe/PC/src/views/padManage/isPadForKittingPack.vue

@ -1,6 +1,6 @@
<template>
<div class="page-box" v-loading="loading">
<div class="padKittingPackPage">
<div class="padpageBox" v-loading="loading">
<div class="isPadForKittingPackPage">
<!-- 左侧按钮 -->
<div class="leftBtns">
<div
@ -101,7 +101,7 @@ import { ChassisGetListWithNextCount,pageLockToLogin,pageLockToLogout } from '@/
import { formatTimeStrToStr } from "@/utils/formatTime"
import store from '@/store'
export default {
name: "padKittingPack",
name: "isPadForKittingPack",
data() {
return {
loading:false,
@ -410,16 +410,14 @@ export default {
};
</script>
<style lang="scss" scoped>
@import "@/styles/mainbasicData.scss";
@import "@/styles/padMain.scss";
$boxPadding:15px;
$boxBorder:#ddd solid 1px;
$footerBtn_height:60px;
.page-box{
overflow:auto;
.padpageBox{
background:#f8f8f8;
padding:10px
}
.padKittingPackPage{
.isPadForKittingPackPage{
min-width:1000px;
height:100%;
display:flex;

10
fe/PC/src/views/padManage/padMenuPage.vue → fe/PC/src/views/padManage/isPadForMenuPage.vue

@ -1,13 +1,13 @@
<template>
<div class="padMenuPage">
<div class="item"><el-button type="primary"><a href="/#/padTransferLibJob">业务库移</a></el-button></div>
<div class="item"><el-button type="warning"><a href="/#/padKittingPack">Kitting组包</a></el-button></div>
<div class="isPadForMenuPage">
<div class="item"><el-button type="primary"><a href="/#/isPadForTransferLibJob">业务库移</a></el-button></div>
<div class="item"><el-button type="warning"><a href="/#/isPadForKittingPack">Kitting组包</a></el-button></div>
</div>
</template>
<script>
export default {
name: 'padMenuPage',
name: 'isPadForMenuPage',
data () {
return {}
},
@ -15,7 +15,7 @@
}
</script>
<style lang="scss" scoped>
.padMenuPage{
.isPadForMenuPage{
padding-top: 15px;
text-align:center;
.item{

50
fe/PC/src/views/padManage/padTransferLibJob.vue → fe/PC/src/views/padManage/isPadForTransferLibJob.vue

@ -9,7 +9,7 @@
:totalCount="totalCount"
:multipleSelection="multipleSelection"
:MaxResultCount="PageListParams.MaxResultCount"
@topbutton="topbutton"
@topbutton="topbuttonHandle"
@inlineDialog="inlineDialog"
@sortChange="sortChange"
@alertoldSkipCount="alertoldSkipCount"
@ -69,7 +69,7 @@
:Handle="editHandle"
:Rules="formReveal ? editRules.cerateRule : editRules.editRule"
@FormSubmit="FormSubmitHandle"
@close="FormClose"
@close="FormCloseHandle"
@goBack="goBack"
>
<template>
@ -115,10 +115,10 @@ import { mixins } from "@/mixins/mixins";
import { newAndEdiDialogMixins } from "@/mixins/newAndEdiDialogMixins"
import { filterSelectMixins } from '@/mixins/filter-Select'
import { transferLibJobHandel } from '@/api/wms-job'
import { getInventoryByPackingCode } from '@/api/wms-api'
import { getInventoryByPackingCode,getDetailed } from '@/api/wms-api'
import currenDescriptions from "@/components/currenDescriptions"
export default {
name: "padTransferLibJob",
name: "isPadForTransferLibJob",
components: {
currenDescriptions,
},
@ -156,6 +156,18 @@ export default {
//
currenButtonData: [
// this.defaultImportBtn(),//
{
type: 'warning',
label: '查看待执行数据',
name: "showCanHandle",
size: 'mini'
},
{
type: 'success',
label: '查看所有数据',
name: "showAllData",
size: 'mini'
},
this.defaultFieldSettingBtn(),//
this.defaultFreshBtn(),//
this.defaultFilterBtn(),//
@ -192,6 +204,24 @@ export default {
this.paging();
},
methods:{
topbuttonHandle(val,item){
if(val == 'showCanHandle'){
this.PageListParams.condition.filters.push({
logic:"And",
column:"jobStatus",
action:"In",
value: JSON.stringify([1,2,4,30])
})
this.paging();
}
else if(val == 'showAllData'){
this.PageListParams.condition.filters = this.PageListParams.condition.filters.filter(obj => obj.column != 'jobStatus');
this.paging();
}
else{
this.topbutton(val,item)
}
},
drawerbutton(val){
//
if(val == "handle"){
@ -227,6 +257,18 @@ export default {
}).catch(err => {
this.Loading.newAndEdiLoading = false
})
},
FormCloseHandle(val){
this.FormClose(val)
this.Loading.appMainLoading = true
getDetailed(this.propsData.id, this.URL)
.then(res => {
this.propsData = res
this.Loading.appMainLoading = false
})
.catch(err=>{
this.Loading.appMainLoading = false
})
}
}
};

26
fe/PC/src/views/padManage/isPadForTransferLibJob_new.vue

@ -0,0 +1,26 @@
<template>
<div class="isPadForTransferLibJobPage">
<div class="padListHeader">
</div>
</div>
</template>
<script>
export default {
name: 'isPadForTransferLibJob',
data () {
return {}
},
methods: {}
}
</script>
<style lang="scss" scoped>
.isPadForTransferLibJobPage{
background:#fff;
margin:15px;
height:calc(100% - 30px);
min-width:800px;
overflow:auto;
}
</style>

278
fe/PC/src/views/padManage/isPadForTransferLibJob_old.vue

@ -0,0 +1,278 @@
<template>
<div class="page-box" v-loading="Loading.appMainLoading">
<tablePagination
:currenButtonData="currenButtonData"
:tableData="tableData"
:tableLoading="Loading.tableLoading"
:tableColumns="tableColumns"
@rowDrop="rowDrop"
:totalCount="totalCount"
:multipleSelection="multipleSelection"
:MaxResultCount="PageListParams.MaxResultCount"
@topbutton="topbuttonHandle"
@inlineDialog="inlineDialog"
@sortChange="sortChange"
@alertoldSkipCount="alertoldSkipCount"
@alterResultCount="alterResultCount"
@handleSelectionChange="handleSelectionChange"
:currentPageProps="oldSkipCount"
:quicklySearchOption="quicklySearchOption"
@quicklySearchClick="quicklySearchClick"
@quicklySearchClear="quicklySearchClear"
:primarySearchOption="primarySearchOption"
@overallSearchFormClick="overallSearchFormClick"
:httpOverallSearchData="httpOverallSearchData"
:setUTableHeight="140"
>
</tablePagination>
<!-- 新导入 disabledMethod 导入方式禁用 disabledIsAllowPartImport 是否局部导入禁用-->
<!-- methodValue 导入方式默认选项 是否局部导入 默认选项 -->
<importFile
:loading="Loading.importLoading"
:show="displayDialog.importDialog"
:URL="URL"
:disabledMethod = {method1:false,method2:false,method3:false}
:disabledIsAllowPartImport = {isAllowPartImport1:false,isAllowPartImport2:false}
isAllowPartImportValue="1"
@importClick="postImportMergeClick(arguments)"
@postImportDown="importDown"
></importFile>
<!--抽屉-->
<curren-Drawer
:title="tableColumns"
:DrawerLoading="Loading.DrawerLoading"
:drawer="displayDialog.detailsDialog"
:propsData="propsData"
:tabsDesTions="tabsDesTions"
:Butttondata="DrawerButtonData"
@drawerbutton="drawerbutton"
@drawerShut="(val) => (displayDialog.detailsDialog = val)"
@handleCommand="drawerHandle"
@close-value="closeValue"
:tableColumns="detailsTableColumns"
:totalCount="totalCountDetails"
:MaxResultCount="MaxResultCountDetails"
@alterResultCountDetails="alterResultCountDetails"
@alertoldSkipCountDetails="alertoldSkipCountDetails"
></curren-Drawer>
<!-- 新增与编辑 -->
<newAndEdiDialog
:loading="Loading.newAndEdiLoading"
:active="active"
:pageStatus="pageStatus"
:formReveal="formReveal"
:formTitle="formTitle"
:displayDialog="editDialog"
:FormData="formReveal ? CreateFormData : editFormData"
:Form="formReveal ? CreateForm : editForm"
:Options="editOptions"
:Handle="editHandle"
:Rules="formReveal ? editRules.cerateRule : editRules.editRule"
@FormSubmit="FormSubmitHandle"
@close="FormCloseHandle"
@goBack="goBack"
>
<template>
<curren-descriptions
v-if="this.displayDialog.newDialog"
:border="true"
:column="3"
:direction="'horizontal'"
:colon="false"
:tabsDesTions="detailsTableColumns"
:propsData="propsData.details[0]"
class="drawerDescriptionsFirst"
style="width:100%;padding-top:20px"
>
</curren-descriptions>
</template>
</newAndEdiDialog>
<!-- 搜索按钮窗体组件 -->
<searchPage
ref="searchTable"
:tableLoading="Loading.autoTableLoading"
:advancedFilter="advancedFilter()"
:filterPageListParams="filterPageListParams"
:formTitle="searchTitle"
:displayDialog="displayDialog.AddNewDialog"
:searchTableData="searchData"
:searchTableColumns="searchColumns"
:searchTotalCount="searchTotalCount"
:supplierItemPage="searchPageListParams"
@handleSelectionChange="prepareFormData"
@SizeChange="searchAlterResultCount($event, searchPageListParams)"
@CurrentChange="searchAlertoldSkipCount($event, searchPageListParams)"
@tableButtonClick="searchSubmit(arguments)"
></searchPage>
</div>
</template>
<script>
import { tableMixins } from "@/mixins/TableMixins";
import { LoadingMixins } from "@/mixins/LoadingMixins";
import { drawerMixins } from "@/mixins/drawerMixins";
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins";
import { mixins } from "@/mixins/mixins";
import { newAndEdiDialogMixins } from "@/mixins/newAndEdiDialogMixins"
import { filterSelectMixins } from '@/mixins/filter-Select'
import { transferLibJobHandel } from '@/api/wms-job'
import { getInventoryByPackingCode,getDetailed } from '@/api/wms-api'
import currenDescriptions from "@/components/currenDescriptions"
export default {
name: "isPadForTransferLibJob",
components: {
currenDescriptions,
},
mixins: [
tableMixins,
LoadingMixins,
drawerMixins,
TableHeaderMixins,
mixins,
filterSelectMixins,
newAndEdiDialogMixins
],
computed: {
editDialog: {
get: function () {
return this.displayDialog.newDialog || this.displayDialog.editDialog;
},
},
//
hideButton: function () {
return function (val) {
let data = true
val.forEach(key => {
if (this.propsData.jobStatus == key) {
data = false
}
})
return data
}
}
},
data() {
return {
URL: "wms/store/transfer-lib-job",
//
currenButtonData: [
// this.defaultImportBtn(),//
{
type: 'warning',
label: '查看待执行数据',
name: "showCanHandle",
size: 'mini'
},
{
type: 'success',
label: '查看所有数据',
name: "showAllData",
size: 'mini'
},
this.defaultFieldSettingBtn(),//
this.defaultFreshBtn(),//
this.defaultFilterBtn(),//
],
DrawerButtonData:[
{
type:'success',
label: '完成库移',
name: "handle",
hide: () => { return this.hideButton([1,2,4]) },
size:"mini"
},
],
CreateFormData: {
packingCode:"",
fromLocationCode:"",
toLocationCode:"",
},
CreateForm: [
{ type: "input", label: "箱码", prop: 'packingCode', colSpan: 12, },
{ type: "input", label: "来源库位", prop: 'fromLocationCode', colSpan: 12, },
{ type: "input", label: "目标库位", prop: 'toLocationCode', colSpan: 12, },
],
editRules: {
cerateRule: {
packingCode: [{ required: true, trigger: "blur", message: "不可为空" }],
fromLocationCode: [{ required: true, trigger: "blur", message: "不可为空" }],
toLocationCode: [{ required: true, trigger: "blur", message: "不可为空" }],
},
},
};
},
mounted() {
this.paging();
},
methods:{
topbuttonHandle(val,item){
if(val == 'showCanHandle'){
this.PageListParams.condition.filters.push({
logic:"And",
column:"jobStatus",
action:"In",
value: JSON.stringify([1,2,4,30])
})
this.paging();
}
else if(val == 'showAllData'){
this.PageListParams.condition.filters = this.PageListParams.condition.filters.filter(obj => obj.column != 'jobStatus');
this.paging();
}
else{
this.topbutton(val,item)
}
},
drawerbutton(val){
//
if(val == "handle"){
this.formTitle = "完成库移";
this.formReveal = true
this.theEvent = "newly"
this.displayDialog.newDialog = true;
}
},
FormSubmitHandle(val){
this.Loading.newAndEdiLoading = true
//
getInventoryByPackingCode(this.CreateFormData.packingCode).then(inventory => {
// details
let _data = this.propsData
_data.details[0].handledFromPackingCode = this.CreateFormData.packingCode
_data.details[0].handledToPackingCode = this.CreateFormData.packingCode
_data.details[0].handledFromLocationCode = this.CreateFormData.fromLocationCode
_data.details[0].handledToLocationCode = this.CreateFormData.toLocationCode
_data.details[0].handledToLot = inventory.lot
_data.details[0].handledFromLot = inventory.lot
_data.details[0].handledFromSupplierBatch = inventory.supplierBatch
_data.details[0].handledToSupplierBatch = inventory.supplierBatch
_data.details[0].handledFromQty = inventory.qty
_data.details[0].handledToQty = inventory.qty
transferLibJobHandel(this.propsData.id, _data).then(res => {
this.Loading.newAndEdiLoading = false
this.FormResult("success")
}).catch(err => {
this.Loading.newAndEdiLoading = false
this.FormResult("error")
})
}).catch(err => {
this.Loading.newAndEdiLoading = false
})
},
FormCloseHandle(val){
this.FormClose(val)
this.Loading.appMainLoading = true
getDetailed(this.propsData.id, this.URL)
.then(res => {
this.propsData = res
this.Loading.appMainLoading = false
})
.catch(err=>{
this.Loading.appMainLoading = false
})
}
}
};
</script>
<style lang="scss" scoped>
@import "@/styles/mainbasicData.scss";
</style>
Loading…
Cancel
Save