输送线、托盘物料绑定

This commit is contained in:
2022-07-21 14:10:01 +08:00
parent 850353c464
commit e3baa9bb78
9 changed files with 400 additions and 6 deletions

View File

@@ -25,6 +25,7 @@
"vue-print-nb": "^1.0.3", "vue-print-nb": "^1.0.3",
"vue-qrcode-reader": "^1.2.2", "vue-qrcode-reader": "^1.2.2",
"vue-router": "^3.0.1", "vue-router": "^3.0.1",
"vuedraggable": "^2.24.3",
"vuex": "^3.0.1" "vuex": "^3.0.1"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -68,3 +68,30 @@ export const querySectCode = () => post('api/pda/check/querySectCode', {})
export const queryStructCode = (uuid) => post('api/pda/check/queryStructCode', { export const queryStructCode = (uuid) => post('api/pda/check/queryStructCode', {
sect_uuid: uuid sect_uuid: uuid
}) })
/** 入窑输送线规则 */
// 1.1根据规则模式查询信息
export const queryInfo = (mode) => post('api/pda/ruleSetting/queryInfo', {
mode: mode
})
export const ruleSettingConfirm = (obj, mode, is, JSONArray) => post('api/pda/ruleSetting/confirm', {
data: obj,
mode: mode,
is_used: is,
JSONArray: JSONArray
})
/** 托盘物料绑定 */
// 1.1根据托盘查询信息
export const queryInfoByVehicle = (code) => post('api/pda/bindingMaterial/queryInfoByVehicle', {
vehicle_code: code
})
// 1.2确定
export const bindingMaterialConfirm = (id, code, mname, pcsn, qty, vcode) => post('api/pda/bindingMaterial/confirm', {
material_id: id,
material_code: code,
material_name: mname,
pcsn: pcsn,
qty: qty,
vehicle_code: vcode
})

View File

@@ -16,7 +16,7 @@
<div class="con"> <div class="con">
<ul> <ul>
<li v-for="e in menuList" :key="e.menu_id" @click="toPage(e)">{{e.name}}</li> <li v-for="e in menuList" :key="e.menu_id" @click="toPage(e)">{{e.name}}</li>
<!-- <li @click="goInner('/TaskManage')">任务管理</li> <li @click="goInner('/TaskManage')">任务管理</li>
<li @click="goInner('/ZlManage')">指令管理</li> <li @click="goInner('/ZlManage')">指令管理</li>
<li @click="goInner('/Password')">修改密码</li> <li @click="goInner('/Password')">修改密码</li>
<li @click="goInner('/SendMater')">送料</li> <li @click="goInner('/SendMater')">送料</li>
@@ -24,7 +24,9 @@
<li @click="goInner('/SendEmptyPallet')">送空托盘</li> <li @click="goInner('/SendEmptyPallet')">送空托盘</li>
<li @click="goInner('/CallEmptyPallet')">呼叫空托盘</li> <li @click="goInner('/CallEmptyPallet')">呼叫空托盘</li>
<li @click="goInner('/BindPalletPoint')">托盘点位绑定</li> <li @click="goInner('/BindPalletPoint')">托盘点位绑定</li>
<li @click="goInner('/CheckManage')">盘点管理</li> --> <li @click="goInner('/CheckManage')">盘点管理</li>
<li @click="goInner('/ConveyorLine')">入窑输送线规则</li>
<li @click="goInner('/BindMaterPoint')">托盘物料绑定</li>
</ul> </ul>
</div> </div>
</section> </section>
@@ -43,6 +45,7 @@ export default {
}, },
mounted () { mounted () {
document.getElementsByTagName('body')[0].className = 'bgwhite' document.getElementsByTagName('body')[0].className = 'bgwhite'
this.$store.dispatch('receiveMaterObj', {})
}, },
created () { created () {
this._authority() this._authority()

View File

@@ -0,0 +1,112 @@
<template>
<section>
<nav-bar title="托盘物料绑定"></nav-bar>
<section class="content mgt186 mgb110">
<div class="filter-wraper">
<search-box
label="托盘条码"
v-model="val1"
@handleChange="handleChange1"
></search-box>
<search-box
label="产品编码"
v-model="val2"
:seaShow="false"
></search-box>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">物料名称</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="val3">
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">物料批次</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="val4">
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">数量</div>
<div class="fxcol mgl20">
<input type="number" class="filter-input filter-scan-input" v-model="val5">
</div>
</div>
</div>
</section>
<section class="submit-bar">
<button class="btn submit-button" :class="{'btn-disabled' : val1 === '' || val2 === '' || val3 === '' || val4 === '' || val5 === ''}" :disabled="disabled" @click="toSure">确定</button>
<button class="btn submit-button" @click="toCancle">取消</button>
</section>
</section>
</template>
<script>
import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue'
import {queryInfoByVehicle, bindingMaterialConfirm} from '@config/getData2.js'
export default {
name: 'BindMaterPoint',
components: {
NavBar,
SearchBox
},
data () {
return {
val1: '',
val2: '',
val3: '',
val4: '',
val5: '',
result: {},
disabled: false
}
},
created () {
this._queryArea1()
},
methods: {
handleChange1 (e, type) {
if (type) {
this._queryInfoByVehicle(e)
}
},
/** 查询托盘条码 */
async _queryInfoByVehicle (e) {
let res = await queryInfoByVehicle(e)
if (res.code === '1') {
this.result = res.result
this.val2 = res.result.material_code
this.val3 = res.result.material_name
this.val4 = res.result.pcsn
this.val5 = `res.result.parseFloat(qty).toFixed(3)`
} else {
this.Dialog(res.desc)
}
},
/** 确认 */
async toSure () {
this.disabled = true
if (this.val1 === '' || this.val2 === '' || this.val3 === '' || this.val4 === '' || this.val5 === '') {
this.disabled = false
return
}
try {
let res = await bindingMaterialConfirm(this.result.material_id, this.val2, this.val3, this.val4, this.val5, this.val1)
if (res.code === '1') {
this.toast(res.desc)
this.toCancle()
} else {
this.Dialog(res.desc)
}
this.disabled = false
} catch (e) {
this.disabled = false
}
},
/** 取消 */
toCancle () {
Object.assign(this.$data, this.$options.data())
}
}
}
</script>

View File

@@ -0,0 +1,184 @@
<template>
<section>
<nav-bar title="入窑输送线规则"></nav-bar>
<section class="content mgt15 mgb110">
<div class="filter-wraper">
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">规则模式</div>
<div class="fxcol mgl20 visible">
<dropdown-menu
:option="option1"
:active="active1"
:open="open1"
@toggleItem="toggleItem1"
@dropdownMenu="dropdownMenu1">
</dropdown-menu>
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">是否启用</div>
<div class="fxcol mgl20 visible">
<dropdown-menu
:option="option2"
:active="active2"
:open="open2"
@toggleItem="toggleItem2"
@dropdownMenu="dropdownMenu2">
</dropdown-menu>
</div>
</div>
</div>
<div class="grid-wraper">
<div class="slide_new">
<table>
<thead>
<tr>
<th>输送线编码</th>
<th>输送线名称</th>
<th>物料编码</th>
<th>物料名称</th>
</tr>
</thead>
<draggable element="tbody" v-model="dataList" @start="onStart" @end="onEnd">
<tr v-for="e in dataList" :key="e.disrule_id">
<td>{{e.cacheline_code}}</td>
<td>{{e.cacheline_name}}</td>
<td><input type="text" class="sin_input" v-model="e.material_code" @click="searchMater(e)"></td>
<td>{{e.material_name}}</td>
</tr>
</draggable>
</table>
</div>
</div>
</section>
<section class="submit-bar">
<button class="btn submit-button" :class="{'btn-disabled': active1 === ''}" @click="_queryInfo">查询</button>
<button class="btn btn-disabled submit-button" :class="{'btn-disabled': active1 === '' || active2 === '' || dataList.length === 0}" :disabled="disabled" @click="toSure">确定</button>
<button class="btn btn-disabled submit-button bgred" @click="cancle">取消</button>
</section>
</section>
</template>
<script>
import draggable from 'vuedraggable'
import NavBar from '@components/NavBar.vue'
import DropdownMenu from '@components/DropdownMenu.vue'
import {queryInfo, ruleSettingConfirm} from '@config/getData2.js'
export default {
name: 'ConveyorLine',
components: {
NavBar,
DropdownMenu,
draggable
},
data () {
return {
option1: [{value: '1', label: '入'}, {value: '2', label: '出'}],
active1: '',
open1: false,
option2: [{value: '1', label: '启用'}, {value: '0', label: '停用'}],
active2: '',
open2: false,
drag: false,
result: {},
dataList: [],
disabled: false
}
},
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
activated () {
if (JSON.stringify(this.$store.getters.receiveMaterObj) !== '{}') {
this.dataList.map(el => {
if (el.disrule_id === this.$route.query.id) {
el.material_code = this.$store.getters.receiveMaterObj.material_code
el.material_name = this.$store.getters.receiveMaterObj.material_name
}
})
}
},
methods: {
onStart () {
this.drag = true
},
onEnd () {
this.drag = false
},
toggleItem1 () {
if (!this.open1) {
this.open1 = true
} else {
this.open1 = false
}
},
dropdownMenu1 (i) {
this.active1 = i + ''
this.open1 = false
},
toggleItem2 () {
if (!this.open2) {
this.open2 = true
} else {
this.open2 = false
}
},
dropdownMenu2 (i) {
this.active2 = i + ''
this.open2 = false
},
async _queryInfo () {
if (!this.active1) {
return
}
let res = await queryInfo(this.option1[this.active1].value)
if (res.code === '1') {
this.result = res.result
this.option2.map((el, i) => {
if (el.value === res.is_used) {
this.active2 = `i`
}
})
this.dataList = [...res.JSONArray]
} else {
this.Dialog(res.desc)
}
},
async toSure () {
this.disabled = true
if (this.active1 === 0 || this.active2 === 0 || this.dataList.length === 0) {
this.disabled = false
return
}
try {
let res = await ruleSettingConfirm(this.result, this.option1[this.active1].value, this.option2[this.active2].value, this.dataList)
if (res.code === '1') {
this.toast(res.desc)
this._queryInfo()
} else {
this.Dialog(res.desc)
}
this.disabled = false
} catch (err) {
this.disabled = false
}
},
cancle () {
console.log(this.dataList)
// Object.assign(this.$data, this.$options.data())
},
searchMater (e) {
this.$router.push({
path: '/SearchMater',
query: {url: 'ConveyorLine', id: e.disrule_id}
})
}
}
}
</script>
<style lang="stylus" scoped>
@import '~@style/mixin'
</style>

View File

@@ -100,10 +100,17 @@ export default {
toSure () { toSure () {
if (this.pkId) { if (this.pkId) {
this.$store.dispatch('receiveMaterObj', this.pkObj) this.$store.dispatch('receiveMaterObj', this.pkObj)
this.$router.push({ if (this.$route.query.url === 'ConveyorLine') {
path: 'CheckManage', this.$router.push({
query: {uuid: this.$route.query.uuid} path: '/ConveyorLine',
}) query: {id: this.$route.query.id}
})
} else {
this.$router.push({
path: 'CheckManage',
query: {uuid: this.$route.query.uuid}
})
}
} }
} }
} }

View File

@@ -17,6 +17,8 @@ const CallEmptyPallet = r => require.ensure([], () => r(require('../pages/proj/C
const BindPalletPoint = r => require.ensure([], () => r(require('../pages/proj/BindPalletPoint')), 'BindPalletPoint') const BindPalletPoint = r => require.ensure([], () => r(require('../pages/proj/BindPalletPoint')), 'BindPalletPoint')
const CheckManage = r => require.ensure([], () => r(require('../pages/proj/CheckManage')), 'CheckManage') const CheckManage = r => require.ensure([], () => r(require('../pages/proj/CheckManage')), 'CheckManage')
const SearchMater = r => require.ensure([], () => r(require('../pages/proj/SearchMater')), 'SearchMater') const SearchMater = r => require.ensure([], () => r(require('../pages/proj/SearchMater')), 'SearchMater')
const ConveyorLine = r => require.ensure([], () => r(require('../pages/proj/ConveyorLine')), 'ConveyorLine')
const BindMaterPoint = r => require.ensure([], () => r(require('../pages/proj/BindMaterPoint')), 'BindMaterPoint')
Vue.use(Router) Vue.use(Router)
@@ -88,6 +90,14 @@ export default new Router({
{ {
path: '/SearchMater', // 查找物料 path: '/SearchMater', // 查找物料
component: SearchMater component: SearchMater
},
{
path: '/ConveyorLine', // 入窑输送线规则
component: ConveyorLine
},
{
path: '/BindMaterPoint', // 托盘物料绑定
component: BindMaterPoint
} }
], ],
scrollBehavior (to, from, savedPosition) { scrollBehavior (to, from, savedPosition) {

View File

@@ -19,6 +19,9 @@ body, div, span, header, footer, nav, section, aside, article, ul, dl, dt, dd, l
&:hover &:hover
outline: none outline: none
*
user-select none
input[type="button"], input[type="submit"], input[type="search"], input[type="reset"], textarea, select input[type="button"], input[type="submit"], input[type="search"], input[type="reset"], textarea, select
-webkit-appearance: none -webkit-appearance: none
appearance: none appearance: none
@@ -486,6 +489,41 @@ header
&:disabled &:disabled
background-color $gray background-color $gray
.slide_new
flex 1
table
table-layout fixed
min-width 100%
border-collapse separate
border-spacing 0
border 0
td, th
box-sizing border-box
overflow hidden
white-space nowrap
text-overflow ellipsis
white-space nowrap
padding 0 0.2rem
border-bottom 0.1rem solid #f5f5f5
&:first-child
position sticky
left 0
thead
tr
th
position sticky
top 0
background #d7d7d7
_font(.26rem, .98rem, #696969, bold)
&:first-child
z-index 1
background #d7d7d7
tbody
tr
td
_font(.28rem, .98rem, #323232)
background #fff
/** */ /** */
.el-select .el-select
width 100% width 100%

View File

@@ -6387,6 +6387,11 @@ sort-keys@^1.0.0:
dependencies: dependencies:
is-plain-obj "^1.0.0" is-plain-obj "^1.0.0"
sortablejs@1.10.2:
version "1.10.2"
resolved "https://registry.yarnpkg.com/sortablejs/-/sortablejs-1.10.2.tgz#6e40364d913f98b85a14f6678f92b5c1221f5290"
integrity sha512-YkPGufevysvfwn5rfdlGyrGjt7/CRHwvRPogD/lC+TnvcN29jDpCifKP+rBqf+LRldfXSTh+0CGLcSg0VIxq3A==
source-list-map@^2.0.0: source-list-map@^2.0.0:
version "2.0.0" version "2.0.0"
resolved "http://registry.npm.taobao.org/source-list-map/download/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085" resolved "http://registry.npm.taobao.org/source-list-map/download/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085"
@@ -7181,6 +7186,13 @@ vue@^2.5.2:
resolved "http://registry.npm.taobao.org/vue/download/vue-2.5.17.tgz#0f8789ad718be68ca1872629832ed533589c6ada" resolved "http://registry.npm.taobao.org/vue/download/vue-2.5.17.tgz#0f8789ad718be68ca1872629832ed533589c6ada"
integrity sha512-mFbcWoDIJi0w0Za4emyLiW72Jae0yjANHbCVquMKijcavBGypqlF7zHRgMa5k4sesdv7hv2rB4JPdZfR+TPfhQ== integrity sha512-mFbcWoDIJi0w0Za4emyLiW72Jae0yjANHbCVquMKijcavBGypqlF7zHRgMa5k4sesdv7hv2rB4JPdZfR+TPfhQ==
vuedraggable@^2.24.3:
version "2.24.3"
resolved "https://registry.yarnpkg.com/vuedraggable/-/vuedraggable-2.24.3.tgz#43c93849b746a24ce503e123d5b259c701ba0d19"
integrity sha512-6/HDXi92GzB+Hcs9fC6PAAozK1RLt1ewPTLjK0anTYguXLAeySDmcnqE8IC0xa7shvSzRjQXq3/+dsZ7ETGF3g==
dependencies:
sortablejs "1.10.2"
vuex@^3.0.1: vuex@^3.0.1:
version "3.0.1" version "3.0.1"
resolved "http://registry.npm.taobao.org/vuex/download/vuex-3.0.1.tgz#e761352ebe0af537d4bb755a9b9dc4be3df7efd2" resolved "http://registry.npm.taobao.org/vuex/download/vuex-3.0.1.tgz#e761352ebe0af537d4bb755a9b9dc4be3df7efd2"