Commit 53247982 authored by hubaoshan's avatar hubaoshan

pd 1.0

parent 80e3a5d4
...@@ -2,68 +2,85 @@ ...@@ -2,68 +2,85 @@
<div class="application"> <div class="application">
<!-- 第一部分 --> <!-- 第一部分 -->
<div class="oneRegion"> <div class="oneRegion">
<!-- <div class="top">-->
<!-- <div v-if="tabList[0].number == 0" class="oneButtion">-->
<!-- <div class="spanTest">-->
<!-- <div class="testContent">{{ tabList[0].label }}</div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div v-if="tabList[0].number > 0" class="oneButtion">-->
<!-- <el-button-->
<!-- :class="actionIndex === 0 ? 'button_rowBtn_action' : 'button_rowBtn'"-->
<!-- type="primary"-->
<!-- @click="handleToggle(tabList[0],0)"-->
<!-- >-->
<!-- <div class="buttionText">-->
<!-- <span>{{ tabList[0].label }}</span>-->
<!-- <span style="color: red">({{ tabList[0].number }})</span>-->
<!-- </div>-->
<!-- </el-button>-->
<!-- </div>-->
<!-- <div v-if="tabList[1].number == 0" class="oneButtion">-->
<!-- <div class="spanTest"><div class="testContent">{{ tabList[1].label }}</div></div>-->
<!-- </div>-->
<!-- <div v-if="tabList[1].number > 0" class="oneButtion">-->
<!-- <el-button-->
<!-- :class="actionIndex === 1 ? 'button_rowBtn_action' : 'button_rowBtn'"-->
<!-- type="primary"-->
<!-- @click="handleToggle(tabList[1],1)"-->
<!-- >-->
<!-- <div class="buttionText">-->
<!-- <span>{{ tabList[1].label }}</span>-->
<!-- <span style="color: red">({{ tabList[1].number }})</span>-->
<!-- </div>-->
<!-- </el-button>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="top">-->
<!-- <div v-if="tabList[2].number == 0" class="oneButtion">-->
<!-- <div class="spanTest"><div class="testContent">{{ tabList[2].label }}</div></div>-->
<!-- </div>-->
<!-- <div v-if="tabList[2].number > 0" class="oneButtion">-->
<!-- <el-button-->
<!-- :class="actionIndex === 2 ? 'button_rowBtn_action' : 'button_rowBtn'"-->
<!-- type="primary"-->
<!-- @click="handleToggle(tabList[2],2)"-->
<!-- >-->
<!-- <div class="buttionText">-->
<!-- <span>{{ tabList[2].label }}</span>-->
<!-- <span style="color: red">({{ tabList[2].number }})</span>-->
<!-- </div>-->
<!-- </el-button>-->
<!-- </div>-->
<!-- <div v-if="tabList[3].number == 0" class="oneButtion">-->
<!-- <div class="spanTest"><div class="testContent">{{ tabList[3].label }}</div></div>-->
<!-- </div>-->
<!-- <div v-if="tabList[3].number > 0" class="oneButtion">-->
<!-- <el-button-->
<!-- :class="actionIndex === 3 ? 'button_rowBtn_action' : 'button_rowBtn'"-->
<!-- type="primary"-->
<!-- @click="handleToggle(tabList[3],3)"-->
<!-- >-->
<!-- <div class="buttionText">-->
<!-- <span>{{ tabList[3].label }}</span>-->
<!-- <span style="color: red">({{ tabList[3].number }})</span>-->
<!-- </div>-->
<!-- </el-button>-->
<!-- </div>-->
<!-- </div>-->
<div class="top"> <div class="top">
<div v-if="tabList[0].number == 0" class="oneButtion"> <div v-if="tabList[4].number == 0" class="oneButtion">
<div class="spanTest"> <div class="spanTest"><div class="testContent">{{ tabList[4].label }}</div></div>
<div class="testContent">{{ tabList[0].label }}</div>
</div>
</div> </div>
<div v-if="tabList[0].number > 0" class="oneButtion"> <div v-if="tabList[4].number > 0" class="oneButtion">
<el-button <el-button
:class="actionIndex === 0 ? 'button_rowBtn_action' : 'button_rowBtn'" :class="actionIndex === 4 ? 'button_rowBtn_action' : 'button_rowBtn'"
type="primary" type="primary"
@click="handleToggle(tabList[0],0)" @click="handleToggle(tabList[4],4)"
> >
<div class="buttionText"> <div class="buttionText">
<span>{{ tabList[0].label }}</span> <span>{{ tabList[4].label }}</span>
<span style="color: red">({{ tabList[0].number }})</span> <span style="color: red">({{ tabList[4].number }})</span>
</div>
</el-button>
</div>
<div v-if="tabList[1].number == 0" class="oneButtion">
<div class="spanTest"><div class="testContent">{{ tabList[1].label }}</div></div>
</div>
<div v-if="tabList[1].number > 0" class="oneButtion">
<el-button
:class="actionIndex === 1 ? 'button_rowBtn_action' : 'button_rowBtn'"
type="primary"
@click="handleToggle(tabList[1],1)"
>
<div class="buttionText">
<span>{{ tabList[1].label }}</span>
<span style="color: red">({{ tabList[1].number }})</span>
</div>
</el-button>
</div>
</div>
<div class="top">
<div v-if="tabList[2].number == 0" class="oneButtion">
<div class="spanTest"><div class="testContent">{{ tabList[2].label }}</div></div>
</div>
<div v-if="tabList[2].number > 0" class="oneButtion">
<el-button
:class="actionIndex === 2 ? 'button_rowBtn_action' : 'button_rowBtn'"
type="primary"
@click="handleToggle(tabList[2],2)"
>
<div class="buttionText">
<span>{{ tabList[2].label }}</span>
<span style="color: red">({{ tabList[2].number }})</span>
</div>
</el-button>
</div>
<div v-if="tabList[3].number == 0" class="oneButtion">
<div class="spanTest"><div class="testContent">{{ tabList[3].label }}</div></div>
</div>
<div v-if="tabList[3].number > 0" class="oneButtion">
<el-button
:class="actionIndex === 3 ? 'button_rowBtn_action' : 'button_rowBtn'"
type="primary"
@click="handleToggle(tabList[3],3)"
>
<div class="buttionText">
<span>{{ tabList[3].label }}</span>
<span style="color: red">({{ tabList[3].number }})</span>
</div> </div>
</el-button> </el-button>
</div> </div>
...@@ -134,6 +151,10 @@ export default { ...@@ -134,6 +151,10 @@ export default {
type: null, type: null,
number: null number: null
}, },
{
type: null,
number: null
},
{ {
type: null, type: null,
number: null number: null
...@@ -188,14 +209,14 @@ export default { ...@@ -188,14 +209,14 @@ export default {
console.log('tempIndexList', tempIndexList) console.log('tempIndexList', tempIndexList)
console.log('tempTypeList', tempTypeList) console.log('tempTypeList', tempTypeList)
if (tempIndexList.length > 0) { if (tempIndexList.length > 0) {
this.actionIndex = tempIndexList[0] this.actionIndex = tempIndexList[1]
} }
if (tempTypeList.length > 0) { if (tempTypeList.length > 0) {
this.queryparams.ptype = tempTypeList[0] this.queryparams.ptype = tempTypeList[1]
const obj = { const obj = {
page: 1, page: 1,
rows: 10, rows: 10,
ptype: tempTypeList[0], ptype: tempTypeList[1],
dealStatus: '0' dealStatus: '0'
} }
try { try {
......
<template> <template>
<div class="dispose-module"> <div class="dispose-module">
<div class="search"> <div class="search">
<el-form @submit.native.prevent ref="searchRef" :model="form" :rules="rules" label-width="80px" class="formClass" label-position="right"> <el-form ref="searchRef" :model="form" :rules="rules" label-width="80px" class="formClass" label-position="right" @submit.native.prevent>
<el-form-item label="code:"> <el-form-item label="code:">
<span>{{ form.appCode || '-' }}</span> <span>{{ form.appCode || '-' }}</span>
</el-form-item> </el-form-item>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<hr class="disposeHr"> <hr class="disposeHr">
<div class="disposeTable"> <div class="disposeTable">
<div class="searchInput"> <div class="searchInput">
<el-form @submit.native.prevent ref="formRef" :model="searchForm" :rules="rules" label-width="80px" class="formClass" label-position="right"> <el-form ref="formRef" :model="searchForm" :rules="rules" label-width="80px" class="formClass" label-position="right" @submit.native.prevent>
<el-form-item label="位置"> <el-form-item label="位置">
<el-input ref="input1" v-model="searchForm.search" clearable @keyup.enter.native="handleSearch" /> <el-input ref="input1" v-model="searchForm.search" clearable @keyup.enter.native="handleSearch" />
</el-form-item> </el-form-item>
...@@ -56,8 +56,8 @@ ...@@ -56,8 +56,8 @@
import { handleOutWarehouse, persistOut } from '@/api/setup/applicationTable' import { handleOutWarehouse, persistOut } from '@/api/setup/applicationTable'
import { getDict } from '@/api/system/dict/data' import { getDict } from '@/api/system/dict/data'
import {playAudio, successAudio} from '@/utils/common' import { playAudio, successAudio } from '@/utils/common'
import {customUpperCase} from "@/utils/common"; import { customUpperCase } from '@/utils/common'
export default { export default {
name: 'Dispose', name: 'Dispose',
data() { data() {
...@@ -111,6 +111,7 @@ export default { ...@@ -111,6 +111,7 @@ export default {
if (res.code === 200) { if (res.code === 200) {
console.log('res', res) console.log('res', res)
this.typeList = res.data this.typeList = res.data
console.log('ressssssss', this.typeList)
} }
}) })
}, },
......
<template>
<div class="enterboundTwo">
<div class="enterForm">
<div class="search">
<el-form ref="from" :model="form" :rules="rules" label-width="80px" class="formClass" label-position="right" @submit.native.prevent>
<el-form-item label="仓库:" prop="whId">
<el-select v-model="form.whId" filterable class="normalSelect" placeholder="请选择">
<el-option
v-for="(item,index) in warehouseList"
:key="index"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="类型:" prop="ptype">
<el-select v-model="form.ptype" filterable class="normalSelect" placeholder="请选择">
<el-option
v-for="(item,index) in typeList"
:key="index"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="XX:" prop="value1">
<el-input ref="input1" v-model="form.value1" clearable @keyup.enter.native="handelTab(1,$event)" />
</el-form-item>
<el-form-item v-if="responsePn">
<div>
<span style="color: black;">库PN: </span><span style="color: red;">{{ responsePn }}</span>
</div>
</el-form-item>
<el-form-item label="yy:" prop="value2">
<el-input ref="input2" v-model="form.value2" clearable @keyup.enter.native="handelTab(2,$event)" />
</el-form-item>
<el-form-item label="数量:" prop="qty">
<el-input ref="input3" v-model="form.qty" :maxlength="4" />
</el-form-item>
</el-form>
</div>
<div class="buttonRegion">
<el-button class="button_rowBtn" type="primary" @click="SubmitForm">保存</el-button>
<el-button class="button_rowBtn" type="primary" @click="clearFormConfirmation($event)">清空</el-button>
</div>
<div class="BottomContent">
<div class="fontSp">单号: {{ orderCode }}</div>
<div class="loginUser">操作人: {{ nickName }}</div>
</div>
</div>
</div>
</template>
<script>
import { getDict } from '@/api/system/dict/data'
import { addIncomeWmsBox, getJcCode } from '@/api/incomeWmsBox'
import { findByLocation } from '@/api/incomeWmsLabel'
import { playAudio, successAudio } from '@/utils/common'
export default {
name: 'EnterboundTwo',
data() {
return {
responsePn: '',
orderCode: '',
warehouseList: [],
value2: '',
confirmTheSubmission: false,
typeList: [
{
label: 'che',
value: '30'
}
// {
// label: 'wd',
// value: '3'
// },
// {
// label: 'sl',
// value: '4'
// },
// {
// label: 'zd',
// value: '5'
// }
],
form: {
whId: '',
ptype: '30',
value1: '',
qty: '',
pn: '',
labelId: null,
orderCode: '',
location: ''
},
obj: {},
newPn: '',
rules: {
value1: [
{ required: true, message: '请输入XX的值', trigger: 'blur' },
{ pattern: /^.*,.*/ | /^.*$/, message: '输入值不符合格式要求,请重新输入', trigger: 'blur' }
],
qty: [{ validator: this.validatorQty, trigger: 'blur' }],
value2: [{ pattern: /^[^,]+,[\d{4}\/\d{2}\/\d{2},[1-9]\d*],[^,]+,[^,]+$/, message: '输入值不符合格式要求,请重新输入', trigger: 'blur' }]
}
}
},
created() {
this.focusing()
this.getWarehouseList()
this.getOrderCode()
this.getNickName()
},
methods: {
/**
* @description: 一开始将焦点聚焦到第一个输入框下
* @author: gaoyu
* @param:
* @return:
**/
focusing() {
this.$nextTick().then(() => {
this.$refs.input1.focus()
})
},
/**
* @description: 获取仓库信息
* @author: gaoyu
* @param:
* @return:
**/
getWarehouseList() {
// 获取仓库的数据字段
getDict('WAREHOUSE').then(res => {
console.log('仓库数据字典', res)
this.warehouseList = res.data
const whId = res.data[0].dictValue
this.form.whId = whId
})
},
/**
* @description: 回车聚焦方法
* @author: gaoyu
* @param:
* @return:
**/
handelTab(i, e) {
const that = this
if (!that.$refs['input' + i]) {
return
}
/**
* 1.判断i是1还是2
* 如果是1进入校验XX的校验
* 如果是2进入pn的校验
* **/
switch (i) {
case 1:
this.validXX(i, e)
break
case 2:
that.validPn()
}
},
/**
* @description: 如果是1进入校验XX的校验
* @author: gaoyu
* @param:
* @return:
**/
validXX(i, e) {
const that = this
if (!that.$refs['input' + i]) {
return
}
console.log('校验xx')
/**
* 1.判断xx是否包含,
* 2.如果包含的话判断是否根据,转成数组 取数组中的第一的数据
* **/
// var location = ''
// if (this.form.value1.includes(',')) {
// var list = this.form.value1.split(',')
// console.log(list)
// location = list[0]
// } else {
// location = this.form.value1
// console.log('location',location);
// }
var location = ''
if (this.form.value1.includes(',') || this.form.value1.includes(',')) {
var list = this.form.value1.split(/,|,/)
console.log(list)
location = list[0]
} else {
location = this.form.value1
console.log('location', location)
}
if (location && location !== '') {
findByLocation(location).then(res => {
if (res.code === 200) {
if (res.data) {
this.form.labelId = res.data.businessId
if (res.data.pn) {
this.responsePn = res.data.pn
}
if (res.data.location) {
this.form.location = res.data.location
}
successAudio(true)
that.$nextTick(() => {
e.target.blur()
const index = i + 1
that.$refs['input' + index].focus()
})
} else {
playAudio(true)
this.$message.error({
message: '数据库中无对应' + location + '请重新输入',
duration: 2000,
onClose: () => {
playAudio(false)
}
})
this.form.value1 = null
this.responsePn = null
this.form.location = null
this.form.labelId = null
this.form.pn = null
this.form.qty = null
}
}
})
} else {
playAudio(true)
return this.$message.error({
message: '输入值不符合格式要求,请重新输入',
duration: 2000,
onClose: () => {
playAudio(false)
}
})
}
},
/**
* @description:pn的校验
* @author: gaoyu
* @param:
* @return:
**/
validPn() {
/**
* responsePn:数据库pn
* form.pn:表格pn
*/
const values = this.form.value2.split(',')
const obj = {
lot: values[1],
pn: values[0],
bzq: values[2],
10: values[3],
unit: values[4],
cj_name: values[5]
}
console.log(obj.pn)
this.newPn = obj.pn
if (this.responsePn !== '' && this.responsePn !== null) {
if (obj.pn !== this.responsePn) {
console.log(obj.pn)
console.log(this.responsePn)
this.$message.error({
message: '您输入的pn ' + obj.pn + ' 与返回pn ' + this.responsePn + ' 不一样',
duration: 2000
})
this.form.pn = ''
} else {
this.obj = {
lot: values[1],
pn: values[0],
bzq: values[2],
ten: values[3],
unit: values[4],
cj_name: values[5]
}
this.$nextTick().then(() => {
this.$refs.input3.focus()
})
}
} else {
this.$nextTick().then(() => {
this.$refs.input3.focus()
})
}
},
/**
* @description: 保存
* @author: gaoyu
* @param:
* @return:
**/
SubmitForm() {
const values = this.form.value2.split(',')
const newObj = {
lot: values[1],
pn: values[0],
bzq: values[2],
10: values[3],
unit: values[4],
cj_name: values[5]
}
this.$refs.from.validate(valid => {
if (valid) {
if (this.form.ptype === 30) {
if (!values[0] || !values[1] || !values[2] || !values[3] || !values[4]) {
this.$message.error({
message: '前5个值不能为空,请检查',
duration: 2000
})
this.form.value2 = ''
}
} else if (this.responsePn && this.responsePn !== '' && this.responsePn !== undefined) {
if (this.obj.pn !== this.responsePn) {
this.$message.error({
message: '您输入的pn:' + this.obj.pn + '与返回pn:' + this.responsePn + '的不一样',
duration: 2000
})
this.form.pn = ''
}
} else {
console.log('obj.pn', newObj.pn)
console.log('newPn', this.newPn)
this.form.qty = this.form.qty * values[3]
const newLot = values[1]
const tooPn = values[0]
console.log('tooPn', tooPn)
const item = {
qty: this.form.qty,
newPn: tooPn,
lot: newLot,
...this.form
}
console.log('pn', item)
addIncomeWmsBox(item).then(res => {
if (res.code === 200) {
this.$message.success('保存成功')
this.resetForm()
this.getOrderCode()
this.$nextTick().then(() => {
this.$refs.input1.focus()
})
}
})
}
}
})
},
/**
* @description: 清空
* @author: gaoyu
* @param:
* @return:
**/
clearFormConfirmation() {
this.resetForm()
},
/**
* @description: 获取单号
* @author: gaoyu
* @param:
* @return:
**/
getOrderCode() {
getJcCode().then(response => {
if (response.code === 200) {
this.orderCode = response.data
}
})
},
/**
* @description: 获取操作人选项
* @author: gaoyu
* @param:
* @return:
**/
getNickName() {
this.nickName = this.$store.getters.name
},
/**
* @description: 重置表单
* @author: gaoyu
* @param:
* @return:
**/
resetForm() {
this.form = {
whId: 1,
ptype: '30',
value1: '',
qty: '',
pn: '',
labelId: null,
orderCode: '',
location: ''
}
this.responsePn = ''
this.getWarehouseList()
this.$nextTick().then(() => {
this.$refs.input1.focus()
})
},
validatorQty(rule, value, callback) {
const reg = /^[1-9]\d*$/ // 正整数的正则表达式
if (value && value !== '' && value !== undefined && !reg.test(value)) {
callback(new Error('请输入正整数'))
} else {
callback()
}
}
}
}
</script>
<style scoped lang="scss">
.enterboundTwo {
display: flex;
justify-content: center;
.enterForm {
width: 96%;
.search {
.normalSelect {
width: 100%;
}
}
.buttonRegion {
margin-top: 20px;
margin-left: 40px;
display: flex;
justify-content: space-between;
.button_rowBtn {
font-size: 17px;
width: 120px;
}
}
.BottomContent {
margin-top: 5%;
margin-left: 40px;
display: flex;
justify-content: space-between;
.loginUser {
text-align: right;
margin-right: 0.7%;
}
}
}
}
</style>
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