Commit 4db5fb9f authored by 李苏's avatar 李苏 💬

包装调整Ⅲ

parent f37d827e
......@@ -647,7 +647,21 @@ export const powerRoutes = [
},
name: 'bz',
path: "bz",
}
},
/* 包装作业*/
{
component: 'ccgl/kngl/bzzy/index',
hidden: false,
meta: {
"title": "包装作业",
"icon": "",
"noCache": false,
"link": null,
"mkid": '920070200',
},
name: 'bzzy',
path: "bzzy",
},
]
},
]
......
......@@ -136,8 +136,8 @@ const permission = {
newmenus.push(mi)
}
})
// dynamicRouter([...newCommonList,...newErpList,...newPowerRoutes],asymenus)
res.data=dynamicRouter([...newCommonList,...newErpList,...newPowerRoutes],asymenus)||[...newCommonList,...newErpList,...newPowerRoutes]
// res.data=[...newCommonList,...newErpList,...newPowerRoutes]
const sdata = JSON.parse(JSON.stringify(res.data))
const rdata = JSON.parse(JSON.stringify(res.data))
const sidebarRoutes = filterAsyncRouter(sdata)
......
......@@ -19,18 +19,54 @@
editColItemList: [
{
label: '编码',
prop: 'hzcode',
prop: 'code',
span: 12,
type: 'input',
required:true,
},
{
label: '名称',
prop: 'hzname',
prop: 'name',
span: 12,
type: 'input',
required:true,
},
{
label: '联系人',
prop: 'lxr',
span: 12,
type: 'input',
},
{
label: '电话',
prop: 'tel',
span: 12,
type: 'input',
},
{
label: '邮件',
prop: 'email',
span: 12,
type: 'input',
},
{
label: '传真',
prop: 'fax',
span: 12,
type: 'input',
},
{
label: '地址',
prop: 'address',
span: 12,
type: 'input',
},
{
label: '邮件',
prop: 'email',
span: 12,
type: 'input',
},
{
label: '备注',
prop: 'bz',
......
......@@ -18,19 +18,48 @@
return {
config: {
/* 基本配置*/
url: 'lxyl/jcsj/uhz',
url: 'wms/jcsj/hz',
tableTitle: [{
title: "编码",
field: "hzcode",
field: "code",
fieldType: "upper",
width: 140
},
{
title: "名称",
field: "hzname",
field: "name",
width: 140
},
{
title: "联系人",
field: "lxr",
width: 140
},
{
title: "电话",
field: "tel",
width: 140
},
{
title: "邮件",
field: "email",
width: 140
},
{
title: "传真",
field: "fax",
width: 140
},
{
title: "地址",
field: "address",
width: 140
},
{
title: "邮件",
field: "email",
width: 140
},{
title: "备注",
field: "bz",
width: 200
......
......@@ -12,10 +12,8 @@
<Mx ref="mx" class="full" />
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</div>
</template>
......@@ -41,11 +39,8 @@
this.$refs.mx.$refs.basePage.$refs['TablePager'].pageQuery({
setFirstCurrent: true
})
},
}
}
</script>
......
......@@ -12,7 +12,11 @@
</template>
<script>
import wlsx from 'common/src/mixin/wlsx.js'
import wlphsx from 'common/src/mixin/wlphsx.js'
export default {
mixins:[wlphsx,wlsx],
data() {
return {
power: {
......@@ -45,11 +49,7 @@
// field: "rqCode",
// width: 140
// },
{
title: "货主",
field: "hzName",
width: 140
},
/* 分割*/
{
title: "物料编码",
......@@ -77,13 +77,13 @@
width: 140
},
{
title: "装包数量",
field: "zbsl",
title: "原包装数量",
field: "bzsl",
width: 140
},
{
title: "包装数量",
field: "bzsl",
title: "装包数量",
field: "zbsl",
width: 140
},
{
......
......@@ -32,28 +32,35 @@
}
},
async mounted() {
const {
id
} = _.cloneDeep(this.app.singleItem)
this.$post('wms/kcgl/bzdj/query/detail', {
mid: id
}).then(res => {
let source = _.cloneDeep(res.data.records[0])
source.packmxid = source.id
delete source.id
this.form = source
})
},
data() {
return {
readonly: false,
editColItemList: [{
editColItemList: [
{
label: '唯一码',
prop: 'packCode',
span: 12,
type: 'input',
readonly: true
type: 'AuxInput',
typeConfig: {
isRequest: true,
code: 'PACKID',
label: 'packCode',
transform: {
value: 'id',
label: 'name'
},
give:(row)=>{
this.$post('wms/jcsj/pack/query/detail',{
mid:row.id
}).then(res=>{
res.data.records[0].bzsl= res.data.records[0].sl
this.form=res.data.records[0]
})
}
}
},
{
label: '物料编码',
......@@ -91,8 +98,8 @@
readonly: true
},
{
label: '装包数量',
prop: 'zbsl',
label: '原包装数量',
prop: 'bzsl',
span: 12,
type: 'inputNumber',
readonly: true
......@@ -115,21 +122,22 @@
save() {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.cfsl > this.form.zbsl) {
this.$warning('拆分数量不能大于装包数量')
if (this.form.cfsl > this.form.bzsl) {
this.$warning('拆分数量不能大于原包装数量')
} else {
let params = {
packid: this.app.singleItem.packid,
hzid:this.form.hzid,
packid: this.form.packid,
"djly": "M",
"datas": [this.form].map(item => {
let nitem = {}
nitem.wlid = item.wlid
nitem.wlph = item.wlph
nitem.zlh = item.zlh
nitem.zbsl = item.zbsl
nitem.bzsl = item.bzsl
nitem.cfsl = item.cfsl
nitem.hzid = item.hzid
nitem.packmxid = item.packmxid
nitem.packmxid = item.id
return nitem
})
}
......
......@@ -3,12 +3,12 @@
<template #dialog="ctx">
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
<zb :app='ctx.basePage' v-if="ctx.basePage.showDialog&&ctx.basePage.DialogTitle=='装包'" />
<cb :app='ctx.basePage' v-if="ctx.basePage.showDialog&&ctx.basePage.DialogTitle=='调整'" />
<cb :app='ctx.basePage' v-if="ctx.basePage.showDialog&&ctx.basePage.DialogTitle=='拆包'" />
</template>
<template #toolbar="ctx">
<el-button @click="zb(ctx.basePage)" size='mini' type="primary">装包</el-button>
<el-button @click="cb(ctx.basePage)" size='mini' type="primary">调整</el-button>
<el-button @click="cb(ctx.basePage)" size='mini' type="primary">拆包</el-button>
</template>
</BasePage>
......@@ -39,7 +39,8 @@
queryDetail: true,
/* 基本配置*/
url: 'wms/kcgl/bzdj',
tableTitle: [{
tableTitle: [
{
title: "类型",
field: "djlx",
width: 80,
......@@ -66,6 +67,11 @@
fieldType: "ftString",
width: 260
},
{
title: "货主",
field: "hzName",
width: 140
},
{
title: "单据来源",
field: "djly",
......@@ -114,7 +120,7 @@
field: "cjsj",
fieldType: "ftDateTime",
hidden: true
},
}
],
queryParams: [
[{
......@@ -132,10 +138,9 @@
span: 6,
type: 'input',
value: ''
}
]
},
],
]
/* 默认启停用 */
}
......@@ -152,14 +157,9 @@
ctx.showDialog=true
},
cb(ctx){
if(ctx.singleItem&&ctx.singleItem.id){
ctx.DialogWidth='50vw'
ctx.DialogTitle='调整'
ctx.DialogTitle='拆包'
ctx.showDialog=true
}else{
this.$warning('请选择一条数据操作')
}
},
},
components: {
......
......@@ -40,6 +40,22 @@
source:{},
readonly:false,
editColItemList: [
{
label: '货主',
prop: 'hzid',
span: 12,
type: 'AuxInput',
required: true,
typeConfig: {
isRequest: true,
code: 'HZID',
label: 'hzName',
transform: {
value: 'id',
label: 'name'
}
}
},
{
label: '物料',
prop: 'wlid',
......@@ -65,12 +81,14 @@
prop: 'wlxxCode',
span: 12,
type: 'input',
readonly:true
},
{
label: '物料规格',
prop: 'wlxxGg',
span: 12,
type: 'input',
readonly:true
},
{
label: '制令号',
......@@ -93,22 +111,7 @@
type: 'inputNumber',
required: true,
},
{
label: '货主',
prop: 'hzid',
span: 12,
required: true,
type: 'AuxInput',
typeConfig: {
isRequest: true,
code: 'HZID',
label: 'hzName',
transform: {
value: 'id',
label: 'name'
}
}
}
]
......@@ -119,6 +122,7 @@
this.$refs['form'].validate((valid) => {
if (valid) {
let params={
hzid:this.form.hzid,
"djly":"M",
"datas":[this.form]
}
......
<template>
<div class="outer">
<div class=" higher flex-column">
<!-- 分层-->
<div class="top">
<Top @getRow='topGetRow' ref="top"></Top>
</div>
<div class="bottom flex">
<div class="full" >
<el-tabs class="full" v-model="activeName" >
<el-tab-pane class="full" label="明细" name="first">
<Mx ref="mx" class="full" />
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</div>
</template>
<script>
import Top from './top/index.vue'
import Mx from './mx.vue'
export default {
components: {
Top,
Mx
},
data(){
return{
activeName:'first'
}
},
methods: {
topGetRow(row) {
/* dom赋值*/
let mid = row.id
this.$refs.mx.$refs.basePage.queryParams.mid = mid
this.$refs.mx.$refs.basePage.$refs['TablePager'].pageQuery({
setFirstCurrent: true
})
},
}
}
</script>
<style lang="scss" scoped>
.outer {
overflow: auto;
height: calc(100vh - 84px);
width: 100%;
.top {
width: 100%;
height: 45%;
}
.bottom {
width: 100%;
height: 55%;
.left {
width: 50%;
height: 100%;
}
.right {
width: 50%;
height: 100%;
}
}
}
.higher {
height: 140vh;
}
.flex-column {
display: flex;
flex-direction: column;
}
::v-deep .el-tabs__content{
height: calc(100% - 40px);
}
::v-deep .el-tabs__nav-scroll{
padding-left: 10px;
}
</style>
<template>
<BasePage @getRow='getRow' ref="basePage" :power='power' :toolButton='false' class="min_full"
style="height: 100%;border-top: 0px;" :autoQuery='false' :config="config">
<template #dialog="ctx">
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
</template>
<template #toolbar="ctx">
</template>
</BasePage>
</template>
<script>
export default {
data() {
return {
power: {
add: false,
copy: false,
/* 手动控制删除 */
delButton: false,
/* 手动控制编辑按钮权限 */
editButton: false,
/* 是否渲染右侧操作按钮 */
operateButtons: false,
/* 是否开启工作流按钮 */
workFlow: false,
/* 表格开启选择,以及记住选择 */
showSelection: false,
saveSelected: false
},
config: {
/* 基本配置*/
url: 'wms/kcgl/bzdj',
queryUrl: 'wms/kcgl/bzdj/query/detail',
tableTitle: [
// {
// title: "唯一码",
// field: "packCode",
// width: 140
// },
// {
// title: "容器",
// field: "rqCode",
// width: 140
// },
{
title: "货主",
field: "hzName",
width: 140
},
/* 分割*/
{
title: "物料编码",
field: "wlxxCode",
width: 140
},
{
title: "物料名称",
field: "wlxxName",
width: 140
},
{
title: "物料规格",
field: "wlxxGg",
width: 140
},
{
title: "物料批号",
field: "wlph",
width: 140
},
{
title: "制令号",
field: "zlh",
width: 140
},
{
title: "装包数量",
field: "zbsl",
width: 140
},
{
title: "包装数量",
field: "bzsl",
width: 140
},
{
title: "拆分数量",
field: "cfsl",
width: 140
}
],
queryParams: [],
}
}
},
methods: {
getRow(val) {
this.$emit('getRow', val)
},
demo(ctx) {
if (ctx.singleItem && ctx.singleItem.id) {
console.log(ctx.singleItem)
} else {
this.$warning('请选中一条数据')
}
}
},
components: {
}
}
</script>
<style>
</style>
<template>
<DefaultDialog :app='app'>
<div slot="form" style="display: flex;">
<el-form slot="form" ref="form" :model="form" label-width="100px" :rules="rules">
<el-row :gutter="20" :app="this">
<EditColItem :required="item.required||false" :readonly="item.readonly?true:false "
v-for="(item,index) in editColItemList " :value="item.value" :span="item.span" :label="item.label"
:prop='item.prop' :key="item.prop" :type="item.type" :typeConfig='item.typeConfig' :rule="item.rule" />
</el-row>
</el-form>
</div>
<div slot="reFooter" class="refooter">
<span slot="footer" class="dialog-footer">
<el-button @click="app.showDialog=false">取 消</el-button>
<el-button type="primary" @click="save()">保 存</el-button>
</span>
</div>
</DefaultDialog>
</template>
<script>
import {
editMixin
} from 'common'
export default {
mixins: [editMixin],
props: {
app: {
type: Object,
default: () => {
return {}
}
}
},
async mounted() {
const {
id
} = _.cloneDeep(this.app.singleItem)
this.$post('wms/kcgl/bzdj/query/detail', {
mid: id
}).then(res => {
let source = _.cloneDeep(res.data.records[0])
source.packmxid = source.id
delete source.id
this.form = source
})
},
data() {
return {
readonly: false,
editColItemList: [{
label: '唯一码',
prop: 'packCode',
span: 12,
type: 'input',
readonly: true
},
{
label: '物料编码',
prop: 'wlxxCode',
span: 12,
type: 'input',
readonly: true
},
{
label: '物料规格',
prop: 'wlxxGg',
span: 12,
type: 'input',
readonly: true
},
{
label: '制令号',
prop: 'zlh',
span: 12,
type: 'input',
readonly: true
},
{
label: '批号',
prop: 'wlph',
span: 12,
type: 'input',
readonly: true
},
{
label: '货主',
prop: 'hzName',
span: 12,
type: 'input',
readonly: true
},
{
label: '装包数量',
prop: 'zbsl',
span: 12,
type: 'inputNumber',
readonly: true
},
{
label: '拆分数量',
prop: 'cfsl',
span: 12,
type: 'inputNumber',
required: true,
value: 0
},
]
}
},
methods: {
save() {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.cfsl > this.form.zbsl) {
this.$warning('拆分数量不能大于装包数量')
} else {
let params = {
packid: this.app.singleItem.packid,
"djly": "M",
"datas": [this.form].map(item => {
let nitem = {}
nitem.wlid = item.wlid
nitem.wlph = item.wlph
nitem.zlh = item.zlh
nitem.zbsl = item.zbsl
nitem.cfsl = item.cfsl
nitem.hzid = item.hzid
nitem.packmxid = item.packmxid
return nitem
})
}
this.$post('wms/kcgl/bzdj/split', params).then(res => {
if (res.success) {
this.$success('操作成功')
this.app.showDialog = false
this.app.refresh()
}
})
}
}
})
}
}
}
</script>
<style scoped>
</style>
<template>
<RelDialog width="50%" :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<el-form slot="form" ref="form" :model="form" label-width="100px" :rules="rules">
<el-row :gutter="20" :app="this">
<EditColItem :required="item.required||false" :readonly="item.readonly?true:false " v-for="(item,index) in editColItemList " :value="item.value" :span="item.span" :label="item.label" :prop='item.prop' :key="item.prop" :type="item.type" :typeConfig='item.typeConfig' :rule="item.rule" />
</el-row>
</el-form>
</RelDialog>
</template>
<script>
import {
editMixin
} from 'common'
export default {
mixins: [editMixin],
data() {
return {
editColItemList: [
{
label: '编码',
prop: 'code',
span: 12,
type: 'input',
required:true,
},
{
label: '名称',
prop: 'name',
span: 12,
type: 'input',
required:true,
},
{
label: '备注',
prop: 'bz',
span: 24,
type: 'input'
},
]
}
}
}
</script>
<template>
<BasePage :power='power' @getRow='getRow' class="min_full" style="height: 100%;" :config="config">
<template #dialog="ctx">
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
<zb :app='ctx.basePage' v-if="ctx.basePage.showDialog&&ctx.basePage.DialogTitle=='装包'" />
<cb :app='ctx.basePage' v-if="ctx.basePage.showDialog&&ctx.basePage.DialogTitle=='调整'" />
</template>
<template #toolbar="ctx">
<el-button @click="zb(ctx.basePage)" size='mini' type="primary">装包</el-button>
<el-button @click="cb(ctx.basePage)" size='mini' type="primary">调整</el-button>
</template>
</BasePage>
</template>
<script>
import zb from './zb.vue';
import cb from './cb.vue'
export default {
data() {
return {
power: {
add: false,
copy: false,
/* 手动控制删除 */
delButton: false,
/* 手动控制编辑按钮权限 */
editButton: false,
/* 是否渲染右侧操作按钮 */
operateButtons: false,
/* 是否开启工作流按钮 */
workFlow: false,
/* 表格开启选择,以及记住选择 */
showSelection: false,
saveSelected: false
},
config: {
queryDetail: true,
/* 基本配置*/
url: 'wms/kcgl/bzdj',
tableTitle: [{
title: "类型",
field: "djlx",
width: 80,
"transform": {
"url": "wms/kcgl/bzdj/init/djlx",
"label": "name",
"value": "id"
}
},
{
title: "单据号",
field: "djid",
fieldType: "ftString",
width: 160
},
{
title: "业务日期",
field: "ywrq",
fieldType: "ftDate"
},
{
title: "包号",
field: "packCode",
fieldType: "ftString",
width: 260
},
{
title: "单据来源",
field: "djly",
"transform": {
"url": "wms/kcgl/bzdj/init/djly",
"label": "name",
"value": "id"
},
width: 80
},
{
title: "来源单号",
field: "lydjDjid",
fieldType: "ftString",
width: 140
},
{
title: "状态",
field: "zt",
"transform": {
"url": "wms/kcgl/bzdj/init/zt",
"label": "name",
"value": "id"
},
width: 100
},
{
title: "维护人",
field: "whr",
fieldType: "ftString",
width: 120
},
{
title: "维护时间",
field: "whsj",
fieldType: "ftDateTime"
},
{
title: "创建人",
field: "cjr",
fieldType: "ftString",
hidden: true
},
{
title: "创建时间",
field: "cjsj",
fieldType: "ftDateTime",
hidden: true
},
],
queryParams: [
[{
label: '日期',
startProp: "start",
endProp: "end",
span: 12,
type: 'RelDaterangeV2',
startValue: new Date().getTime() - 1000 * 60 * 60 * 24 * 30,
endValue: new Date().getTime(),
},
{
label: '唯一码',
prop: 'packCode',
span: 6,
type: 'input',
value: ''
}
]
],
/* 默认启停用 */
}
}
},
methods: {
getRow(val) {
this.$emit('getRow', val)
},
zb(ctx){
ctx.DialogWidth='50vw'
ctx.DialogTitle='装包'
ctx.showDialog=true
},
cb(ctx){
if(ctx.singleItem&&ctx.singleItem.id){
ctx.DialogWidth='50vw'
ctx.DialogTitle='调整'
ctx.showDialog=true
}else{
this.$warning('请选择一条数据操作')
}
},
},
components: {
zb,cb
}
}
</script>
<style>
</style>
<template>
<DefaultDialog :app='app'>
<div slot="form" style="display: flex;">
<el-form slot="form" ref="form" :model="form" label-width="100px" :rules="rules">
<el-row :gutter="20" :app="this">
<EditColItem :required="item.required||false" :readonly="item.readonly?true:false "
v-for="(item,index) in editColItemList " :value="item.value" :span="item.span" :label="item.label"
:prop='item.prop' :key="item.prop" :type="item.type" :typeConfig='item.typeConfig' :rule="item.rule" />
</el-row>
</el-form>
</div>
<div slot="reFooter" class="refooter">
<span slot="footer" class="dialog-footer">
<el-button @click="app.showDialog=false">取 消</el-button>
<el-button type="primary" @click="save()">保 存</el-button>
</span>
</div>
</DefaultDialog>
</template>
<script>
import {
editMixin
} from 'common'
export default {
mixins: [editMixin],
props: {
app: {
type: Object,
default: () => {
return {}
}
}
},
async mounted() {
},
data() {
return {
source:{},
readonly:false,
editColItemList: [
{
label: '物料',
prop: 'wlid',
span: 12,
required: true,
type: 'AuxInput',
typeConfig: {
isRequest: false,
code: 'WMSWLXX',
label: 'wlxxName',
transform: {
value: 'id',
label: 'name'
},
give:(row)=>{
this.form.wlxxCode=row.code
this.form.wlxxGg=row.gg
}
}
},
{
label: '物料编码',
prop: 'wlxxCode',
span: 12,
type: 'input',
},
{
label: '物料规格',
prop: 'wlxxGg',
span: 12,
type: 'input',
},
{
label: '制令号',
prop: 'zlh',
span: 12,
type: 'input',
required: true,
},
{
label: '批号',
prop: 'wlph',
span: 12,
type: 'input',
// required: true,
},
{
label: '装包数量',
prop: 'zbsl',
span: 12,
type: 'inputNumber',
required: true,
},
{
label: '货主',
prop: 'hzid',
span: 12,
required: true,
type: 'AuxInput',
typeConfig: {
isRequest: true,
code: 'HZID',
label: 'hzName',
transform: {
value: 'id',
label: 'name'
}
}
}
]
}
},
methods: {
save(){
this.$refs['form'].validate((valid) => {
if (valid) {
let params={
"djly":"M",
"datas":[this.form]
}
this.$post('wms/kcgl/bzdj/install', params).then(res => {
if (res.success) {
this.$success('操作成功')
this.app.showDialog = false
this.app.refresh()
}
})
}
})
}
}
}
</script>
<style scoped>
</style>
......@@ -99,7 +99,34 @@
DialogTitle: '码盘',
DialogWidth: '80vw',
/* 常规edit数据 */
editColItemList: [{
editColItemList: [
/* 入库单 辅助输入 关联入库单*/
{
label: '入库单',
"required": true,
prop: 'lydjid',
span: 8,
type: 'AuxInput',
typeConfig: {
isRequest: false,
code: 'WMSRKD',
label: 'showdjid',
transform: {
value: 'id',
label: 'djid'
},
give(row){
for (var key in this.form) {
key != 'id'&& key != 'djid' && key != 'djly' && (() => {
row[key] && (this.form[key] = row[key])
})()
}
}
},
},
{
label: '码盘单号',
prop: 'djid',
span: 8,
......@@ -174,57 +201,34 @@
},
"required": true,
},
{
label: '备注',
prop: 'bz',
span: 16,
type: 'input',
},
{
label: '开始时间',
"required": true,
prop: 'kssj',
span: 8,
type: 'datetime'
type: 'datetime',
readonly:true
},
{
label: '结束时间',
"required": true,
prop: 'jssj',
span: 8,
type: 'datetime'
type: 'datetime',
readonly:true
},
{
label: '耗时',
prop: 'hs',
span: 8,
type: 'input',
},
/* 入库单 辅助输入 关联入库单*/
{
label: '入库单',
"required": true,
prop: 'lydjid',
span: 8,
type: 'AuxInput',
typeConfig: {
isRequest: false,
code: 'WMSRKD',
label: 'showdjid',
transform: {
value: 'id',
label: 'djid'
},
give(row){
for (var key in this.form) {
key != 'id'&& key != 'djid' && key != 'djly' && (() => {
row[key] && (this.form[key] = row[key])
})()
}
}
},
},
{
label: '备注',
prop: 'bz',
span: 16,
type: 'input',
readonly:true
},
......
......@@ -62,9 +62,11 @@
prop: 'flid',
span: 12,
type: 'RelSelect',
required: true,
typeConfig: {
src: "jcsj/wlxx/init/wlfl"
}
},
value:this.app.queryParams.flbm=='root'?'':this.app.queryParams.flbm
},
{
label: '规格',
......@@ -89,8 +91,9 @@
span: 12,
type: 'RelSelect',
typeConfig: {
src: "jcsj/jldw/query"
},
src: "jcsj/jldw/query",
hasValue:false
}
},
{
......
<template>
<div class="login my-element ">
<vue-particles
class="login-bg"
color="#34a4ea"
:particleOpacity="0.8"
:particlesNumber="25"
shapeType="circle"
:particleSize="5"
linesColor="#8DD1FE"
:linesWidth="1"
:lineLinked="false"
:lineOpacity="0.4"
:linesDistance="150"
:moveSpeed="1"
:hoverEffect="true"
hoverMode="repulse"
:clickEffect="false"
clickMode="push"
>
</vue-particles>
<!-- 新登录框-->
<div class="login_form">
<div class="login_logo">
<div class="favicon" ></div>
<div class="favicon_text" >
格物云ERP
</div>
</div>
<div class="login_submit">
<el-tabs class="full" type="border-card" >
<el-tab-pane label="账户登录">
<div class="full" >
<el-form ref="loginForm1" :model="loginForm" :rules="loginRules" class="full login-form">
<el-form-item prop="username">
<el-input
class="loginput"
v-model="loginForm.username"
type="text"
auto-complete="off"
placeholder="账号"
>
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
class="loginput"
v-model="loginForm.password"
type="password"
auto-complete="off"
placeholder="密码"
@keyup.enter.native="handleLogin1"
>
</el-input>
</el-form-item>
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
</el-input>
<div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img"/>
</div>
</el-form-item>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
<el-form-item style="width:60%;margin: 0 auto;">
<el-button
class="btn btn-primary btn-shine"
:loading="loading"
size="medium"
type="primary"
style="width:100%;"
@click.native.prevent="handleLogin1"
>
<span v-if="!loading">登 录</span>
<span v-else>登 录 中...</span>
</el-button>
</el-form-item>
</el-form>
</div>
</el-tab-pane>
<el-tab-pane label="企业号登录">
<div class="full" >
<el-form ref="loginForm2" :model="loginForm" :rules="loginRules" class="full login-form login-form2 ">
<el-form-item prop="systemid" >
<el-input
v-model="loginForm.systemid"
type="text"
auto-complete="off"
placeholder="企业号"
>
</el-input>
</el-form-item>
<el-form-item prop="username">
<el-input
class="loginput"
v-model="loginForm.username"
type="text"
auto-complete="off"
placeholder="账号"
>
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
class="loginput"
v-model="loginForm.password"
type="password"
auto-complete="off"
placeholder="密码"
@keyup.enter.native="handleLogin2"
>
</el-input>
</el-form-item>
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
</el-input>
<div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img"/>
</div>
</el-form-item>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
<el-form-item style="width:60%;margin: 0 auto;">
<el-button
class="btn btn-primary btn-shine"
:loading="loading"
size="medium"
type="primary"
style="width:100%;"
@click.native.prevent="handleLogin2"
>
<span v-if="!loading">登 录</span>
<span v-else>登 录 中...</span>
</el-button>
</el-form-item>
</el-form>
</div>
</el-tab-pane>
</el-tabs>
</div>
</div>
<div class="el-login-footer">
</div>
</div>
</template>
<script>
import { getCodeImg } from "@/api/login";
import Cookies from "js-cookie";
import { encrypt, decrypt } from '@/utils/jsencrypt'
import md5 from '@/utils/md5.js'
import {systeminfo} from "@/api/common/common.js"
export default {
mounted() {
// alert(window.location.origin+'/'+(window.pathname||'')+process.env.VUE_APP_BASE_API)
},
name: "Login",
data() {
return {
/* 登录方式*/
isqyh:false,
appName:'',
codeUrl: "",
loginForm: {
systemid:"",
username: "",
password: "",
rememberMe: false,
code: "",
uuid: ""
},
loginRules: {
systemid: [
{ required: true, trigger: "blur", message: "请输入企业号" }
],
username: [
{ required: true, trigger: "blur", message: "请输入您的账号" }
],
password: [
{ required: true, trigger: "blur", message: "请输入您的密码" }
],
code: [{ required: true, trigger: "change", message: "请输入验证码" }]
},
loading: false,
// 验证码开关
captchaEnabled: true,
// 注册开关
register: false,
redirect: undefined
};
},
watch: {
$route: {
handler: function(route) {
this.redirect = route.query && route.query.redirect;
},
immediate: true
}
},
created() {
// this.getCode();
this.getCookie();
systeminfo({}).then(res=>{
this.appName=res.data.records.appName||''
document.title=this.appName
})
},
methods: {
getCode() {
getCodeImg().then(res => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
if (this.captchaEnabled) {
this.codeUrl = "data:image/gif;base64," + res.img;
this.loginForm.uuid = res.uuid;
}
});
},
getCookie() {
const systemid = Cookies.get("systemid");
const username = Cookies.get("username");
const password = Cookies.get("password");
const rememberMe = Cookies.get('rememberMe')
this.loginForm = {
systemid: systemid === undefined ? this.loginForm.systemid : systemid,
username: username === undefined ? this.loginForm.username : username,
password: password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
};
},
handleLogin1() {
this.isqyh=false
this.$refs.loginForm1.validate(valid => {
if (valid) {
this.loading = true;
if (this.loginForm.rememberMe) {
Cookies.set("systemid", this.loginForm.systemid, { expires: 30 });
Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 });
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 });
} else {
Cookies.remove("systemid");
Cookies.remove("username");
Cookies.remove("password");
Cookies.remove('rememberMe');
}
/* 判定是否是企业号登录*/
const loginForm=_.cloneDeep(this.loginForm)
if(!this.isqyh){
/*
企业号登录模式为企业号必填
如何不是删除该字段
是否存在该字段将是判定是否企业号登录的标志
*/
delete loginForm.systemid
}
this.$store.dispatch("Login", loginForm).then(() => {
this.$router.push({path:'index'})
}).catch(() => {
this.loading = false;
if (this.captchaEnabled) {
// this.getCode();
}
});
}
});
},
handleLogin2() {
this.isqyh=true
this.$refs.loginForm2.validate(valid => {
if (valid) {
this.loading = true;
if (this.loginForm.rememberMe) {
Cookies.set("systemid", this.loginForm.systemid, { expires: 30 });
Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 });
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 });
} else {
Cookies.remove("systemid");
Cookies.remove("username");
Cookies.remove("password");
Cookies.remove('rememberMe');
}
/* 判定是否是企业号登录*/
const loginForm=_.cloneDeep(this.loginForm)
if(!this.isqyh){
/*
企业号登录模式为企业号必填
如何不是删除该字段
是否存在该字段将是判定是否企业号登录的标志
*/
delete loginForm.systemid
}
this.$store.dispatch("Login", loginForm).then(() => {
this.$router.push({path:'index'})
}).catch(() => {
this.loading = false;
// if (this.captchaEnabled) {
// this.getCode();
// }
});
}
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.my-element {
animation: animatedBackground 11s linear infinite;
}
@keyframes animatedBackground {
0% {
filter: hue-rotate(0deg) saturate(100%) brightness(100%) ;
}
50% {
filter: hue-rotate(38deg) saturate(100%) brightness(100%) ;
}
100% {
filter: hue-rotate(0deg) saturate(100%) brightness(100%) ;
}
}
.btn {
--hue: 190;
padding: 0px!important;
// height:34px;
// line-height: 34px;
position: relative;
// padding: 1rem 3rem;
font-size: 1rem;
line-height: 40px;
color: white;
text-decoration: none;
text-transform: uppercase;
background-color:#0389ff;
border: 1px solid #0389ff;
outline: transparent;
overflow: hidden;
cursor: pointer;
user-select: none;
white-space: nowrap;
transition: 0.25s;
&:hover {
background:( #0389ff, 100%, 31%);
}
&-primary {
--hue: 187;
}
&-ghost {
color: (#0389ff, 100%, 41%);
background-color: #0389ff;
border-color: (#0389ff, 100%, 41%);
&:hover {
color: #fff;
}
}
&-shine {
color: white;
&::before {
position: absolute;
content: "";
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(
120deg,
transparent,
hsla(var(--hue), 100%, 41%, 0.5),
transparent
);
transform: translateX(-100%);
transition: 0.6s;
}
&:hover {
background: #00a2f8;
box-shadow: 0 0 5px 2px hsla(var(--hue), 100%, 41%, 0.5);
}
&:hover::before {
transform: translateX(100%);
}
}
}
::v-deep .el-input__inner{
line-height: 42px!important;
height: 42px!important;
&:hover{
border: #014dff 1px solid;
}
border: #0389ff 1px solid;
color: #000;
background-color:rgba(0, 0, 0, 0.039) ;
}
.buttonClass {
font-size:15px;
font-family:Arial;
// width:100px;
height:34px;
border-width:1px;
color:#ffffff;
border-color:#0389ff;
border-top-left-radius:3px;
border-top-right-radius:3px;
border-bottom-left-radius:3px;
border-bottom-right-radius:3px;
box-shadow:inset 0px 1px 0px 0px #54a3f7;
text-shadow:inset 0px 1px 0px #154682;
background:linear-gradient(#0389ff, #00aaff);
}
.buttonClass:hover {
background: linear-gradient(#00aaff, #007dc1);
}
.newTitle{
position: absolute;
top: 0px;
height: 160px;
width: 100%;
background-color: #fff;
}
.login-bg{
height: 98vh;
width: 100vw;
position: absolute;
}
.login {
display: flex;
justify-content: right;
align-items: center;
height: 100%;
background-image: url("../assets/images/login-rj.png");
background-size: cover;
}
.title {
font-family: Georgia, 'Times New Roman', Times, serif;
margin: 0px auto 30px auto;
text-align: center;
color: #ffffff;
}
.login-form2{
padding-top: 10px!important;
}
.login-form {
padding-top: 45px;
.el-input {
height: 42px;
input {
height: 42px;
color: #000;
}
}
.input-icon {
height: 42px;
width: 14px;
margin-left: 2px;
}
}
.login-tip {
font-size: 13px;
text-align: center;
color: #bfbfbf;
}
.login-code {
width: 33%;
height: 38px;
float: right;
img {
cursor: pointer;
vertical-align: middle;
}
}
.el-login-footer {
height: 40px;
line-height: 40px;
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
color: #fff;
font-family: Arial;
font-size: 12px;
letter-spacing: 1px;
}
.login-code-img {
height: 38px;
}
</style>
<style lang='scss' scoped >
.login_form{
height: 550px;
width: 400px;
position: absolute;
right: 100px;
.login_logo{
padding-top: 15px;
height: 30%;
width: 100%;
.favicon{
background-image: url("../assets/images/favicon.png");
height:70px;
width:70px;
background-size: 100% 100%;
margin: 0 auto;
}
.favicon_text{
margin-top: 8px;
text-align: center;
line-height: 24px;
font-size: 24px;
width: 100%;
font-weight: 800;
}
}
.login_submit{
height: 70%;
width: 100%;
}
}
::v-deep .el-tabs__nav
{
width: 100%;
display: flex;
div{
width: 50%;
text-align: center;
border: 0px!important;
font-size: 19px;
line-height: 40px;
font-weight: 700;
}
}
::v-deep .el-tabs__content{
height: 100%;
}
::v-deep .el-tab-pane{
height: 100%;
}
</style>
......@@ -39,7 +39,7 @@ module.exports = {
[process.env.VUE_APP_BASE_API]: {
// target: `http://192.168.30.254:18080/dmg`,
// target: `http://192.168.30.254:28084/erp`,
target: `http://localhost:9080/lxyl`,
target: `http://192.168.30.103:9080/lxyl`,
// target:'http://192.168.30.105:9081/erp',
changeOrigin: true,
pathRewrite: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment