送空
This commit is contained in:
@@ -114,3 +114,8 @@ export const sendEmpty = (code, vcode) => post('api/pda/sendEmpty', {
|
|||||||
point_code: code,
|
point_code: code,
|
||||||
vehicle_code: vcode
|
vehicle_code: vcode
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 叫空
|
||||||
|
export const callEmpty = (code, vcode) => post('api/pda/callEmpty', {
|
||||||
|
point_code: code
|
||||||
|
})
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
<li @click="goInner('/sendmater')">送料</li>
|
<li @click="goInner('/sendmater')">送料</li>
|
||||||
<li @click="goInner('/callmater')">叫料</li>
|
<li @click="goInner('/callmater')">叫料</li>
|
||||||
<li @click="goInner('/sendempty')">送空</li>
|
<li @click="goInner('/sendempty')">送空</li>
|
||||||
|
<li @click="goInner('/callempty')">叫空</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
220
src/pages/proj/CallEmpty.vue
Normal file
220
src/pages/proj/CallEmpty.vue
Normal file
@@ -0,0 +1,220 @@
|
|||||||
|
<template>
|
||||||
|
<section>
|
||||||
|
<nav-bar title="叫空"></nav-bar>
|
||||||
|
<section class="content mgt186">
|
||||||
|
<div class="filter-wraper">
|
||||||
|
<div class="bottom-filter-tip">
|
||||||
|
<div class="filter-label txtjustify">区域</div>
|
||||||
|
<div class="fxcol mgl20 visible" >
|
||||||
|
<dropdown-menu
|
||||||
|
:option="optionNew1"
|
||||||
|
:active="active1"
|
||||||
|
:open="open1"
|
||||||
|
:inputed="true"
|
||||||
|
v-model="val1"
|
||||||
|
@handleBlur="handleBlur1"
|
||||||
|
@handleChange="handleChange1"
|
||||||
|
@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="optionNew2"
|
||||||
|
:active="active2"
|
||||||
|
:open="open2"
|
||||||
|
:inputed="true"
|
||||||
|
v-model="val2"
|
||||||
|
@handleBlur="handleBlur2"
|
||||||
|
@handleChange="handleChange2"
|
||||||
|
@toggleItem="toggleItem2"
|
||||||
|
@dropdownMenu="dropdownMenu2">
|
||||||
|
</dropdown-menu>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<section class="submit-bar">
|
||||||
|
<button class="btn submit-button" :class="{'btn-disabled' : val2 === ''}" :disabled="disabled1" @click="_callEmpty">确定</button>
|
||||||
|
<button class="btn submit-button" @click="toCancle">取消</button>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import NavBar from '@components/NavBar.vue'
|
||||||
|
import DropdownMenu from '@components/DropdownMenu.vue'
|
||||||
|
import {pdaRegion, pdaPoint, callEmpty} from '@config/getData2'
|
||||||
|
export default {
|
||||||
|
name: 'CallEmpty',
|
||||||
|
components: {
|
||||||
|
NavBar,
|
||||||
|
DropdownMenu
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
option1: [],
|
||||||
|
optionNew1: [],
|
||||||
|
active1: '',
|
||||||
|
open1: false,
|
||||||
|
val1: '',
|
||||||
|
option2: [],
|
||||||
|
optionNew2: [],
|
||||||
|
active2: '',
|
||||||
|
open2: false,
|
||||||
|
val2: '',
|
||||||
|
disabled1: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
this._pdaRegion()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询区域 */
|
||||||
|
async _pdaRegion () {
|
||||||
|
let res = await pdaRegion('send_empty')
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 模糊匹配 */
|
||||||
|
selectMatchItem (type, lists, keyWord) {
|
||||||
|
let resArr = []
|
||||||
|
lists.filter((item) => {
|
||||||
|
if (type === '1' && item.region_name.indexOf(keyWord) > -1) {
|
||||||
|
resArr.push(item)
|
||||||
|
}
|
||||||
|
if (type === '2' && item.point_name.indexOf(keyWord) > -1) {
|
||||||
|
resArr.push(item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return resArr
|
||||||
|
},
|
||||||
|
handleChange1 (e) {
|
||||||
|
if (!e) {
|
||||||
|
this.active1 = ''
|
||||||
|
}
|
||||||
|
this.optionNew1 = []
|
||||||
|
this.optionNew1 = this.selectMatchItem('1', this.option1, e)
|
||||||
|
this.open1 = true
|
||||||
|
},
|
||||||
|
handleBlur1 () {
|
||||||
|
this.open1 = false
|
||||||
|
this.val1 = ''
|
||||||
|
},
|
||||||
|
toggleItem1 () {
|
||||||
|
if (!this.open1) {
|
||||||
|
this.optionNew1 = this.option1
|
||||||
|
this.active1 = ''
|
||||||
|
this.optionNew1.map((e, i) => {
|
||||||
|
if (e.label === this.val1) {
|
||||||
|
this.active1 = i + ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.open1 = true
|
||||||
|
} else {
|
||||||
|
this.open1 = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dropdownMenu1 (i) {
|
||||||
|
this.active1 = i + ''
|
||||||
|
this.open1 = false
|
||||||
|
if (this.optionNew1.length > 0) {
|
||||||
|
this.val1 = this.optionNew1[i].label
|
||||||
|
this.val2 = ''
|
||||||
|
this.active2 = ''
|
||||||
|
this._pdaPoint(this.optionNew1[i].value)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 查询点位 */
|
||||||
|
async _pdaPoint (code) {
|
||||||
|
let res = await pdaPoint('send_empty', code)
|
||||||
|
if (res.code === '1') {
|
||||||
|
this.option2 = [...res.result]
|
||||||
|
this.option2.map(el => {
|
||||||
|
this.$set(el, 'value', el.point_code)
|
||||||
|
this.$set(el, 'label', el.point_name)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.Dialog(res.desc)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleChange2 (e) {
|
||||||
|
if (!e) {
|
||||||
|
this.active2 = ''
|
||||||
|
}
|
||||||
|
this.optionNew2 = []
|
||||||
|
this.optionNew2 = this.selectMatchItem('2', this.option2, e)
|
||||||
|
this.open2 = true
|
||||||
|
},
|
||||||
|
handleBlur2 () {
|
||||||
|
this.open2 = false
|
||||||
|
this.val2 = ''
|
||||||
|
},
|
||||||
|
toggleItem2 () {
|
||||||
|
if (!this.open2) {
|
||||||
|
this.optionNew2 = this.option2
|
||||||
|
this.active2 = ''
|
||||||
|
this.optionNew2.map((e, i) => {
|
||||||
|
if (e.label === this.val2) {
|
||||||
|
this.active2 = i + ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.open2 = true
|
||||||
|
} else {
|
||||||
|
this.open2 = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dropdownMenu2 (i) {
|
||||||
|
this.active2 = i + ''
|
||||||
|
this.open2 = false
|
||||||
|
if (this.optionNew2.length > 0) {
|
||||||
|
this.val2 = this.optionNew2[i].label
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 确认 */
|
||||||
|
async _callEmpty () {
|
||||||
|
this.disabled1 = true
|
||||||
|
if (this.val2 === '') {
|
||||||
|
this.disabled1 = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
let code = ''
|
||||||
|
this.option2.map(el => {
|
||||||
|
if (el.point_name === this.val2) {
|
||||||
|
code = el.point_code
|
||||||
|
}
|
||||||
|
})
|
||||||
|
let res = await callEmpty(code)
|
||||||
|
if (res.code === '1') {
|
||||||
|
this.toast(res.desc)
|
||||||
|
this.toCancle()
|
||||||
|
} else {
|
||||||
|
this.Dialog(res.desc)
|
||||||
|
}
|
||||||
|
this.disabled1 = false
|
||||||
|
} catch (e) {
|
||||||
|
this.disabled1 = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 取消 */
|
||||||
|
toCancle () {
|
||||||
|
this.val1 = ''
|
||||||
|
this.val2 = ''
|
||||||
|
this.active1 = ''
|
||||||
|
this.active2 = ''
|
||||||
|
this.disabled1 = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -11,6 +11,7 @@ const BelowGradeReport = r => require.ensure([], () => r(require('../pages/proj/
|
|||||||
const SendMater = r => require.ensure([], () => r(require('../pages/proj/SendMater')), 'SendMater')
|
const SendMater = r => require.ensure([], () => r(require('../pages/proj/SendMater')), 'SendMater')
|
||||||
const CallMater = r => require.ensure([], () => r(require('../pages/proj/CallMater')), 'CallMater')
|
const CallMater = r => require.ensure([], () => r(require('../pages/proj/CallMater')), 'CallMater')
|
||||||
const SendEmpty = r => require.ensure([], () => r(require('../pages/proj/SendEmpty')), 'SendEmpty')
|
const SendEmpty = r => require.ensure([], () => r(require('../pages/proj/SendEmpty')), 'SendEmpty')
|
||||||
|
const CallEmpty = r => require.ensure([], () => r(require('../pages/proj/CallEmpty')), 'CallEmpty')
|
||||||
|
|
||||||
Vue.use(Router)
|
Vue.use(Router)
|
||||||
|
|
||||||
@@ -62,6 +63,10 @@ export default new Router({
|
|||||||
{
|
{
|
||||||
path: '/sendempty', // 送空
|
path: '/sendempty', // 送空
|
||||||
component: SendEmpty
|
component: SendEmpty
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/callempty', // 叫空
|
||||||
|
component: CallEmpty
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
scrollBehavior (to, from, savedPosition) {
|
scrollBehavior (to, from, savedPosition) {
|
||||||
|
|||||||
Reference in New Issue
Block a user