接口
This commit is contained in:
@@ -146,3 +146,41 @@ export const tmpcallVechile = (dcode, qty) => post('api/pda/tmpcallVechile', {
|
|||||||
export const tmpsendVechile = (dcode) => post('api/pda/tmpsendVechile', {
|
export const tmpsendVechile = (dcode) => post('api/pda/tmpsendVechile', {
|
||||||
device_code: dcode
|
device_code: dcode
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 公共接口
|
||||||
|
// 1.1车间列表
|
||||||
|
export const dictall = () => post('api/dict/all', {
|
||||||
|
})
|
||||||
|
|
||||||
|
// 人工倒料
|
||||||
|
// 1.1设备列表
|
||||||
|
export const washdevicelist = (wid) => post('api/device/list', {
|
||||||
|
workprocedure_id: wid
|
||||||
|
})
|
||||||
|
|
||||||
|
// 1.2根据设备列表获取物料信息
|
||||||
|
export const washquery = (parea, dcode) => post('api/pda/wash/query', {
|
||||||
|
product_area: parea,
|
||||||
|
device_code: dcode
|
||||||
|
})
|
||||||
|
|
||||||
|
// 1.3称重
|
||||||
|
export const washweighing = (list) => post('api/pda/wash/weighing', {
|
||||||
|
list: list
|
||||||
|
})
|
||||||
|
|
||||||
|
// 1.4确认
|
||||||
|
export const washweighingFinish = (dcode, dweight, mcode, mspec, mname) => post('api/pda/wash/weighingFinish', {
|
||||||
|
device_code: dcode,
|
||||||
|
deviceinstor_weight: dweight,
|
||||||
|
material_code: mcode,
|
||||||
|
material_spec: mspec,
|
||||||
|
material_name: mname
|
||||||
|
})
|
||||||
|
|
||||||
|
// 1.5查询物料列表
|
||||||
|
export const washsearchlist = (page, size, mcode) => post('api/pda/wash/searchlist', {
|
||||||
|
page: page,
|
||||||
|
size: size,
|
||||||
|
material_code: mcode
|
||||||
|
})
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
title () {
|
title () {
|
||||||
let res = ['清洗上料', '清洗下料', '人工倒料'][Number(this.$route.meta.guidePath) - 1]
|
let res = ['清洗上料', '清洗下料', '人工倒料', '选择物料'][Number(this.$route.meta.guidePath) - 1]
|
||||||
return res
|
return res
|
||||||
},
|
},
|
||||||
...mapGetters(['keepAlive'])
|
...mapGetters(['keepAlive'])
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
<el-select v-model="value1" filterable clearable placeholder="请选择">
|
<el-select v-model="value1" filterable clearable placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in options1"
|
v-for="item in options1"
|
||||||
:key="item.stor_id"
|
:key="item.value"
|
||||||
:label="item.stor_name"
|
:label="item.label"
|
||||||
:value="item.stor_id">
|
:value="item.value">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
@@ -31,30 +31,40 @@
|
|||||||
<div class="search-item">
|
<div class="search-item">
|
||||||
<div class="search-label">规格</div>
|
<div class="search-label">规格</div>
|
||||||
<div class="filter_input_wraper pointer" @click="searchMater">
|
<div class="filter_input_wraper pointer" @click="searchMater">
|
||||||
<input type="text" class="filter-input" v-model="material_code" disabled>
|
<input type="text" class="filter-input" v-model="material_spec" disabled>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="search-item">
|
<div class="search-item">
|
||||||
<div class="search-label">编码</div>
|
<div class="search-label">编码</div>
|
||||||
<div class="filter_input_wraper">
|
<div class="filter_input_wraper">
|
||||||
<input type="text" class="filter-input" v-model="material_spec" disabled>
|
<input type="text" class="filter-input" v-model="material_code" disabled>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="search-item">
|
<div class="search-item">
|
||||||
<div class="search-label">名称</div>
|
<div class="search-label">名称</div>
|
||||||
<div class="filter_input_wraper">
|
<div class="filter_input_wraper">
|
||||||
<input type="number" class="filter-input" v-model="total_qty">
|
<input type="number" class="filter-input" v-model="material_name" disabled>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="search-item">
|
<div class="search-item">
|
||||||
<div class="search-label">重量(g)</div>
|
<div class="search-label">重量(g)</div>
|
||||||
<div class="filter_input_wraper">
|
<div class="filter_input_wraper">
|
||||||
<input type="number" class="filter-input" v-model="qty">
|
<input type="number" class="filter-input" v-model="deviceinstor_weight" disabled>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <div class="search-item">
|
||||||
|
<div class="search-label">重量(g)</div>
|
||||||
|
<div class="filter_input_wraper filter_input_wraper_1">
|
||||||
|
<input type="text" class="filter-input" v-model="deviceinstor_weight" disabled>
|
||||||
|
</div>
|
||||||
|
<div class="filter_button">
|
||||||
|
<button class="button button--primary" :disabled="disabled1" @click="_washweighing">称重</button>
|
||||||
|
</div>
|
||||||
|
</div> -->
|
||||||
<div class="search-item_2">
|
<div class="search-item_2">
|
||||||
<button class="button button--primary" :disabled="disabled2" :class="{'button--defalut': value1 === '' || value2 === '' || value3 === '' || material_code === '' || total_qty === '' || unit_weight === '' || storagevehicle_code === ''}" @click="toSure">确认</button>
|
<button class="button button--primary" :disabled="disabled1" @click="_washweighing">称重</button>
|
||||||
<button class="button button--primary" @click="toJumpSearch">取消</button>
|
<button class="button button--primary" :disabled="disabled2" :class="{'button--defalut': value1 === '' || value2 === '' || material_spec === '' || material_code === '' || material_name === ''}" @click="toSure">确认</button>
|
||||||
|
<button class="button button--primary" @click="toCancel">取消</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -62,45 +72,25 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getBcpStor, getBillType, getPoint, callVehicle, createIn} from '@config/getData2.js'
|
import {dictall, washdevicelist, washquery, washweighing, washweighingFinish} from '@config/getData2.js'
|
||||||
import {accDiv} from '@config/utils.js'
|
import {accDiv} from '@config/utils.js'
|
||||||
export default {
|
export default {
|
||||||
name: 'semifinishedinstore',
|
name: 'manpour',
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
options1: [],
|
options1: [],
|
||||||
value1: '',
|
value1: '',
|
||||||
options2: [],
|
options2: [],
|
||||||
value2: '',
|
value2: '',
|
||||||
options3: [],
|
|
||||||
value3: '',
|
|
||||||
material_id: '',
|
material_id: '',
|
||||||
material_code: '',
|
|
||||||
material_spec: '',
|
material_spec: '',
|
||||||
total_qty: '',
|
material_code: '',
|
||||||
unit_weight: '',
|
material_name: '',
|
||||||
storagevehicle_code: '',
|
deviceinstor_weight: '',
|
||||||
remark: '',
|
|
||||||
disabled1: false,
|
disabled1: false,
|
||||||
disabled2: false
|
disabled2: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
qty () {
|
|
||||||
let res = ''
|
|
||||||
res = accDiv(this.total_qty, this.unit_weight)
|
|
||||||
res = Number(res).toFixed(3)
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
total_qty () {
|
|
||||||
this.total_qty = this.total_qty.indexOf('.') > -1 ? this.total_qty.slice(0, this.total_qty.indexOf('.') + 4) : this.total_qty
|
|
||||||
},
|
|
||||||
unit_weight () {
|
|
||||||
this.unit_weight = this.unit_weight.indexOf('.') > -1 ? this.unit_weight.slice(0, this.unit_weight.indexOf('.') + 4) : this.unit_weight
|
|
||||||
}
|
|
||||||
},
|
|
||||||
beforeRouteLeave (to, from, next) {
|
beforeRouteLeave (to, from, next) {
|
||||||
if (to.path === '/home' || to.path === '/login') {
|
if (to.path === '/home' || to.path === '/login') {
|
||||||
this.$store.dispatch('setKeepAlive', [])
|
this.$store.dispatch('setKeepAlive', [])
|
||||||
@@ -109,77 +99,64 @@ export default {
|
|||||||
},
|
},
|
||||||
activated () {
|
activated () {
|
||||||
if (this.$store.getters.materObj !== '') {
|
if (this.$store.getters.materObj !== '') {
|
||||||
this.material_id = JSON.parse(this.$store.getters.materObj).material_id
|
|
||||||
this.material_code = JSON.parse(this.$store.getters.materObj).material_code
|
|
||||||
this.material_spec = JSON.parse(this.$store.getters.materObj).material_spec
|
this.material_spec = JSON.parse(this.$store.getters.materObj).material_spec
|
||||||
this.unit_weight = Number(JSON.parse(this.$store.getters.materObj).net_weight).toFixed(3)
|
this.material_code = JSON.parse(this.$store.getters.materObj).material_code
|
||||||
|
this.material_name = JSON.parse(this.$store.getters.materObj).material_name
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this._getBcpStor()
|
this._dictall()
|
||||||
this._getBillType()
|
this._washdevicelist()
|
||||||
this._getPoint()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 仓库下拉框
|
// 车间下拉框
|
||||||
async _getBcpStor () {
|
async _dictall () {
|
||||||
let res = await getBcpStor()
|
let res = await dictall()
|
||||||
this.options1 = [...res.data]
|
if (res.code === 200) {
|
||||||
|
this.options1 = [...res.content]
|
||||||
|
} else {
|
||||||
|
this.toast(res.msg)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 单据类型下拉框
|
// 设备下拉框
|
||||||
async _getBillType () {
|
async _washdevicelist () {
|
||||||
let res = await getBillType()
|
let res = await washdevicelist('1535144682756116480')
|
||||||
this.options2 = [...res.data]
|
if (res.code === 200) {
|
||||||
|
this.options2 = [...res.content]
|
||||||
|
} else {
|
||||||
|
this.toast(res.msg)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 入库点下拉框
|
// 称重
|
||||||
async _getPoint () {
|
async _washweighing () {
|
||||||
let res = await getPoint()
|
|
||||||
this.options3 = [...res.data]
|
|
||||||
},
|
|
||||||
// 呼叫空载具
|
|
||||||
async _callVehicle () {
|
|
||||||
this.disabled1 = true
|
this.disabled1 = true
|
||||||
|
let list = []
|
||||||
|
list.push(this.value2)
|
||||||
try {
|
try {
|
||||||
let res = await callVehicle()
|
// let res = await washweighing(['A1_SKQX_05'])
|
||||||
this.toast(res.message)
|
let res = await washweighing(list)
|
||||||
|
this.toast(res.msg)
|
||||||
|
this.deviceinstor_weight = res.content[0].deviceinstor_weight
|
||||||
this.disabled1 = false
|
this.disabled1 = false
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.disabled1 = false
|
this.disabled1 = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 确认入库
|
// 确认
|
||||||
async toSure () {
|
async toSure () {
|
||||||
this.disabled2 = true
|
this.disabled2 = true
|
||||||
if (this.value1 === '' || this.value2 === '' || this.value3 === '' || this.material_code === '' || this.total_qty === '' || this.unit_weight === '' || this.storagevehicle_code === '') {
|
if (this.value1 === '' || this.value2 === '' || this.material_spec === '' || this.material_code === '' || this.material_name === '') {
|
||||||
this.disabled2 = false
|
this.disabled2 = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let from = {
|
let res = await washweighingFinish(this.value1, this.value2, this.material_spec, this.material_code, this.material_name)
|
||||||
stor_id: this.value1,
|
this.toast(res.msg)
|
||||||
bill_type: this.value2,
|
|
||||||
material_id: this.material_id,
|
|
||||||
material_code: this.material_code,
|
|
||||||
material_spec: this.material_spec,
|
|
||||||
total_qty: this.total_qty,
|
|
||||||
unit_weight: this.unit_weight,
|
|
||||||
qty: this.qty,
|
|
||||||
point_code: this.value3,
|
|
||||||
storagevehicle_code: this.storagevehicle_code,
|
|
||||||
remark: this.remark
|
|
||||||
}
|
|
||||||
let res = await createIn(from)
|
|
||||||
this.toast(res.message)
|
|
||||||
this.value1 = ''
|
this.value1 = ''
|
||||||
this.value2 = ''
|
this.value2 = ''
|
||||||
this.value3 = ''
|
|
||||||
this.material_id = ''
|
|
||||||
this.material_code = ''
|
|
||||||
this.material_spec = ''
|
this.material_spec = ''
|
||||||
this.total_qty = ''
|
this.material_code = ''
|
||||||
this.unit_weight = ''
|
this.material_name = ''
|
||||||
this.storagevehicle_code = ''
|
|
||||||
this.remark = ''
|
|
||||||
this.disabled2 = false
|
this.disabled2 = false
|
||||||
this.$store.dispatch('setMaterObj', '')
|
this.$store.dispatch('setMaterObj', '')
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -188,13 +165,10 @@ export default {
|
|||||||
},
|
},
|
||||||
searchMater () {
|
searchMater () {
|
||||||
this.$store.dispatch('setMaterObj', '')
|
this.$store.dispatch('setMaterObj', '')
|
||||||
this.$router.push('/semifinishedinmatersearch')
|
this.$router.push('/selectmater')
|
||||||
},
|
},
|
||||||
toJumpSearch () {
|
toCancel () {
|
||||||
this.$router.push('/semifinishedinstoresearch')
|
this.$router.push('/home')
|
||||||
},
|
|
||||||
handleBlur ($event) {
|
|
||||||
$event.target.value = Number($event.target.value).toFixed(3)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,20 +3,14 @@
|
|||||||
<div class="search-confirm-wrap">
|
<div class="search-confirm-wrap">
|
||||||
<div class="search-wrap">
|
<div class="search-wrap">
|
||||||
<div class="search-item">
|
<div class="search-item">
|
||||||
<div class="search-label">货位</div>
|
<div class="search-label">物料</div>
|
||||||
<div class="filter_input_wraper">
|
<div class="filter_input_wraper">
|
||||||
<input type="text" class="filter-input" v-model="val1">
|
<input type="text" class="filter-input" v-model="val1">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="search-item">
|
<div class="search-item_2 flexend">
|
||||||
<div class="search-label">物料</div>
|
<button class="button button--primary" @click="_washsearchlist">查询</button>
|
||||||
<div class="filter_input_wraper">
|
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" @click="toSure">确定</button>
|
||||||
<input type="text" class="filter-input" v-model="val2">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="search-item flexend">
|
|
||||||
<button class="button button--primary" @click="_checkGetMaterialIvt">查询</button>
|
|
||||||
<button class="button button--primary" :class="{'button--defalut': checkArr.length === 0}" @click="toSure">确定</button>
|
|
||||||
<button class="button button--primary" @click="clearUp">清除</button>
|
<button class="button button--primary" @click="clearUp">清除</button>
|
||||||
<button class="button button--primary" @click="colseUp">关闭</button>
|
<button class="button button--primary" @click="colseUp">关闭</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -26,28 +20,18 @@
|
|||||||
<table class="filter-table">
|
<table class="filter-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>选择</th>
|
<th>序号</th>
|
||||||
<th>库区</th>
|
<th>规格</th>
|
||||||
<th>货位</th>
|
|
||||||
<th>物料编号</th>
|
<th>物料编号</th>
|
||||||
<th>物料名称</th>
|
<th>物料名称</th>
|
||||||
<th>重量</th>
|
|
||||||
<th>单重(g)</th>
|
|
||||||
<th>载具号</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="e in dataList" :key="e.struct_name" @click="toRadio(e)">
|
<tr v-for="(e, i) in dataList" :key="i" :class="{'selected_icon': pkId === e.material_code}" @click="toRadio(e)">
|
||||||
<td>
|
<td>{{i + 1}}</td>
|
||||||
<button class="iconfont select_icon select_square_icon" :class="e.checked ? 'selected_icon' : 'unselect_icon'"></button>
|
<td>{{e.material_spec }}</td>
|
||||||
</td>
|
|
||||||
<td>{{ e.sect_name }}</td>
|
|
||||||
<td>{{e.struct_name}}</td>
|
|
||||||
<td>{{e.material_code}}</td>
|
<td>{{e.material_code}}</td>
|
||||||
<td>{{e.material_name}}</td>
|
<td>{{e.material_name}}</td>
|
||||||
<td>{{e.canuse_qty | numeric(3)}}</td>
|
|
||||||
<td>{{ e.unit_weight | numeric(3) }}</td>
|
|
||||||
<td>{{ e.storagevehicle_code }}</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@@ -57,36 +41,35 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {checkGetMaterialIvt} from '@config/getData2.js'
|
import {washsearchlist} from '@config/getData1.js'
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
options1: [],
|
||||||
|
value1: '',
|
||||||
val1: '',
|
val1: '',
|
||||||
val2: '',
|
|
||||||
dataList: [],
|
dataList: [],
|
||||||
checkArr: [],
|
pkId: '',
|
||||||
|
pkObj: {},
|
||||||
page: 1,
|
page: 1,
|
||||||
size: '30',
|
size: '22',
|
||||||
busy: false,
|
busy: false,
|
||||||
desc: ''
|
desc: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this._checkGetMaterialIvt()
|
this._washsearchlist()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// grid
|
// grid
|
||||||
async _checkGetMaterialIvt () {
|
async _washsearchlist () {
|
||||||
this.page = 1
|
this.page = 1
|
||||||
this.busy = false
|
this.busy = false
|
||||||
this.desc = ''
|
this.desc = ''
|
||||||
let res = await checkGetMaterialIvt(this.val2, this.val1, this.page + '', this.size)
|
let res = await washsearchlist(this.page + '', this.size, this.val1)
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
res.data.map(el => {
|
this.dataList = [...res.content]
|
||||||
this.$set(el, 'checked', false)
|
if (res.content.length < 22) {
|
||||||
})
|
|
||||||
this.dataList = [...res.data]
|
|
||||||
if (res.data.length < 30) {
|
|
||||||
this.busy = true
|
this.busy = true
|
||||||
this.desc = '已加载全部数据'
|
this.desc = '已加载全部数据'
|
||||||
}
|
}
|
||||||
@@ -94,12 +77,9 @@ export default {
|
|||||||
async loadMore () {
|
async loadMore () {
|
||||||
this.busy = true
|
this.busy = true
|
||||||
this.page++
|
this.page++
|
||||||
let res = await checkGetMaterialIvt(this.val2, this.val1, this.page + '', this.size)
|
let res = await washsearchlist(this.page + '', this.size, this.val1)
|
||||||
res.data.map(el => {
|
this.dataList = [...this.dataList, ...res.content]
|
||||||
this.$set(el, 'checked', false)
|
if (res.content.length < 22) {
|
||||||
})
|
|
||||||
this.dataList = [...this.dataList, ...res.data]
|
|
||||||
if (res.data.length < 30) {
|
|
||||||
this.busy = true
|
this.busy = true
|
||||||
this.desc = '已加载全部数据'
|
this.desc = '已加载全部数据'
|
||||||
} else {
|
} else {
|
||||||
@@ -107,36 +87,26 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
colseUp () {
|
colseUp () {
|
||||||
this.$router.push('/semifinishedcheck')
|
this.$router.push('/manpour')
|
||||||
|
},
|
||||||
|
toRadio (e) {
|
||||||
|
this.pkId = this.pkId === e.material_code ? '' : e.material_code
|
||||||
|
this.pkObj = this.pkId === e.material_code ? e : {}
|
||||||
},
|
},
|
||||||
toSure () {
|
toSure () {
|
||||||
if (this.checkArr.length === 0) {
|
if (!this.pkId) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$store.dispatch('setMaterArr', this.checkArr)
|
this.$store.dispatch('setMaterObj', JSON.stringify(this.pkObj))
|
||||||
this.colseUp()
|
this.colseUp()
|
||||||
},
|
},
|
||||||
clearUp () {
|
clearUp () {
|
||||||
this.checkArr = []
|
this.pkId = ''
|
||||||
},
|
this.pkObj = {}
|
||||||
toRadio (e) {
|
|
||||||
e.checked = !e.checked
|
|
||||||
this.checkArr = this.dataList.filter(i => { return i.checked === true })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~@style/mixin.styl'
|
|
||||||
.search-item
|
|
||||||
width 27%
|
|
||||||
&:nth-child(3)
|
|
||||||
width 42%
|
|
||||||
.filter_radius
|
|
||||||
_fj()
|
|
||||||
margin-right 15px
|
|
||||||
.filter_radius_label
|
|
||||||
margin-left 5px
|
|
||||||
_font(12px, 30px, #fff,,)
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user