点位绑定解绑
This commit is contained in:
@@ -102,3 +102,20 @@ export const createTask = (sid, scode, spcode, nid, ncode, npcode) => post('api/
|
||||
next_region_code: ncode,
|
||||
next_point_code: npcode
|
||||
})
|
||||
|
||||
/**
|
||||
* 点位绑定解绑
|
||||
*/
|
||||
// 1.1 查询缓存区点位状态
|
||||
export const pointQueryPoint = () => post('api/pda/point/queryPoint', {})
|
||||
// 1.2组盘查询
|
||||
export const pointQueryVehicle = (code, vcode) => post('api/pda/point/queryVehicle', {
|
||||
point_code: code,
|
||||
vehicle_code: vcode
|
||||
})
|
||||
// 1.3点位绑定解绑
|
||||
export const pointBinding = (code, vcode, flag) => post('api/pda/point/binding', {
|
||||
point_id: code,
|
||||
vehicle_code: vcode,
|
||||
flag: flag
|
||||
})
|
||||
|
||||
@@ -14,11 +14,7 @@ axios.interceptors.request.use(
|
||||
}
|
||||
token && (config.headers.Authorization = token)
|
||||
if (config.method === 'post') {
|
||||
if (!config.data.flag) {
|
||||
config.data = config.data
|
||||
} else {
|
||||
config.data = config.data.formData
|
||||
}
|
||||
config.data = config.data
|
||||
}
|
||||
return config
|
||||
},
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<li @click="goInner('/HandTask')">搬运任务</li>
|
||||
<li @click="goInner('/InstoreConfirm')">入库确认</li>
|
||||
<li @click="goInner('/OutstoreConfirm')">出库确认</li>
|
||||
<li @click="goInner('/PointBinding')">点位绑定解绑</li>
|
||||
<!-- <li @click="goInner('/PwdManage')">修改密码</li> -->
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
200
src/pages/task/PointBinding.vue
Normal file
200
src/pages/task/PointBinding.vue
Normal file
@@ -0,0 +1,200 @@
|
||||
<template>
|
||||
<section>
|
||||
<nav-bar title="点位绑定解绑"></nav-bar>
|
||||
<section class="content 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>
|
||||
<search-box
|
||||
label="载具号"
|
||||
:focused="true"
|
||||
:seaShow="false"
|
||||
v-model="val1"
|
||||
></search-box>
|
||||
</div>
|
||||
<div class="grid-wraper">
|
||||
<div class="left_fixed">
|
||||
<table class="layout-t left_layout_t">
|
||||
<tr>
|
||||
<th>载具编码</th>
|
||||
</tr>
|
||||
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.vehicle_code === pkId}">
|
||||
<td>{{e.vehicle_code}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="slide">
|
||||
<table class="layout-t">
|
||||
<tr>
|
||||
<th>点位编码</th>
|
||||
<th>产品编号</th>
|
||||
<th>物料号</th>
|
||||
<th>工单编号</th>
|
||||
</tr>
|
||||
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.vehicle_code === pkId}">
|
||||
<td>{{e.point_code}}</td>
|
||||
<td>{{e.product_code}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.order_code}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="submit-bar">
|
||||
<button class="btn submit-button" @click="toCancle">取消</button>
|
||||
<button class="btn submit-button" @click="_pointQueryVehicle">查询</button>
|
||||
<button class="btn submit-button" :disabled="disabled1" :class="{'btn-disabled': !pkId}" @click="toSure0('0')">绑定</button>
|
||||
<button class="btn submit-button" :disabled="disabled2" :class="{'btn-disabled': !pkId}" @click="toSure1('1')">解绑</button>
|
||||
</section>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@components/NavBar.vue'
|
||||
import SearchBox from '@components/SearchBox.vue'
|
||||
import DropdownMenu from '@components/DropdownMenu.vue'
|
||||
import { pointQueryPoint, pointQueryVehicle, pointBinding } from '@config/getData2.js'
|
||||
export default {
|
||||
name: 'PointBinding',
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox,
|
||||
DropdownMenu
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
option1: [],
|
||||
active1: '',
|
||||
open1: false,
|
||||
option2: [],
|
||||
active2: '',
|
||||
open2: false,
|
||||
val1: '',
|
||||
dataList: '',
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
disabled1: false,
|
||||
disabled2: false
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this._queryPoint()
|
||||
},
|
||||
methods: {
|
||||
async _queryPoint () {
|
||||
let res = await pointQueryPoint()
|
||||
if (res.code === '1') {
|
||||
this.option1 = [...res.result]
|
||||
this.option1.map(el => {
|
||||
this.$set(el, 'value', el.region_code)
|
||||
this.$set(el, 'label', el.region_name)
|
||||
})
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
toggleItem1 () {
|
||||
if (!this.open1) {
|
||||
this.open1 = true
|
||||
} else {
|
||||
this.open1 = false
|
||||
}
|
||||
},
|
||||
dropdownMenu1 (i) {
|
||||
this.active1 = i + ''
|
||||
this.open1 = false
|
||||
this.option1.map(el => {
|
||||
if (el.region_code === this.option1[this.active1].value) {
|
||||
this.option2 = el.pointArr
|
||||
this.option2.map(el => {
|
||||
this.$set(el, 'value', el.point_code)
|
||||
this.$set(el, 'label', el.point_name)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
toggleItem2 () {
|
||||
if (!this.open2) {
|
||||
this.open2 = true
|
||||
} else {
|
||||
this.open2 = false
|
||||
}
|
||||
},
|
||||
dropdownMenu2 (i) {
|
||||
this.active2 = i + ''
|
||||
this.open2 = false
|
||||
},
|
||||
async _pointQueryVehicle () {
|
||||
let code = this.active2 !== '' ? this.option2[this.active2].value : ''
|
||||
let res = await pointQueryVehicle(code, this.val1)
|
||||
if (res.code === '1') {
|
||||
this.dataList = [...res.result]
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
toSure0 (type) {
|
||||
this.disabled1 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled1 = false
|
||||
}
|
||||
this._pointBinding(type)
|
||||
},
|
||||
toSure1 (type) {
|
||||
this.disabled2 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled2 = false
|
||||
}
|
||||
this._pointBinding(type)
|
||||
},
|
||||
async _pointBinding (type) {
|
||||
try {
|
||||
let code = this.active2 !== '' ? this.option2[this.active2].value : ''
|
||||
let res = await pointBinding(code, this.pkId, type)
|
||||
if (res.code === '1') {
|
||||
this.toast(res.desc)
|
||||
this.toCancle()
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
}
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
this.disabled2 = false
|
||||
}
|
||||
},
|
||||
toCancle () {
|
||||
Object.assign(this.$data, this.$options.data())
|
||||
this._queryPoint()
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.vehicle_code ? '' : e.vehicle_code
|
||||
this.pkObj = this.pkId === e.vehicle_code ? e : {}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -11,6 +11,7 @@ const ZlManage = r => require.ensure([], () => r(require('../pages/task/ZlManage
|
||||
const HandTask = r => require.ensure([], () => r(require('../pages/task/HandTask')), 'HandTask')
|
||||
const OutstoreConfirm = r => require.ensure([], () => r(require('../pages/task/OutstoreConfirm')), 'OutstoreConfirm')
|
||||
const InstoreConfirm = r => require.ensure([], () => r(require('../pages/task/InstoreConfirm')), 'InstoreConfirm')
|
||||
const PointBinding = r => require.ensure([], () => r(require('../pages/task/PointBinding')), 'PointBinding')
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
@@ -55,6 +56,10 @@ export default new Router({
|
||||
{
|
||||
path: '/HandTask', // 搬运任务
|
||||
component: HandTask
|
||||
},
|
||||
{
|
||||
path: '/PointBinding', // 点位绑定解绑
|
||||
component: PointBinding
|
||||
}
|
||||
],
|
||||
scrollBehavior (to, from, savedPosition) {
|
||||
|
||||
Reference in New Issue
Block a user