This commit is contained in:
2023-08-29 17:33:10 +08:00
parent c148d53c0a
commit 97cddf2f41
6 changed files with 287 additions and 48 deletions

View File

@@ -55,14 +55,10 @@
},
toPage1 (e) {
let url = e.path
uni.redirectTo({
url: url
})
// if (e.sonTree.length > 0) {
// this.show = true
// this.secM = e.sonTree
// }
if (e.sonTree.length > 0) {
this.show = true
this.secM = e.sonTree
}
},
toPage2 (e) {
let url = e.path

View File

@@ -1,19 +1,160 @@
<template>
<view>
<view class="zd_container">
<nav-bar title="半成品入库"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">物料规格</span>
</view>
<view class="filter_input_wraper">
<input type="text" class="filter_input filter_input_disabled pointer" v-model="val1" @tap="getMater">
</view>
</view>
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">物料编码</span>
</view>
<view class="filter_input_wraper">
<input type="text" class="filter_input filter_input_disabled" v-model="val2">
</view>
</view>
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">物料数量</span>
</view>
<view class="filter_input_wraper">
<input type="number" class="filter_input" v-model="val3">
</view>
</view>
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">订单号</span>
</view>
<view class="filter_input_wraper">
<input type="text" class="filter_input" v-model="sale_id">
</view>
</view>
<view class="filter_item">
<view class="filter_label">工序</view>
<view class="filter_input_wraper">
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
</view>
</view>
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">料箱码</span>
</view>
<view class="filter_input_wraper">
<search-box
v-model="bar_code"
/>
</view>
</view>
</view>
</view>
<view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !val1 || !val3 || !bar_code}" :disabled="disabled" @tap="toSure">确认入库</button>
<button class="submit-button" @tap="toCancle">清空</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getWork, BcpConfirm} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
val1: '',
val2: '',
val3: '',
sale_id: '',
options: [],
index: '',
bar_code: '',
dataList: [],
pkId: '',
pkObj: {},
disabled: false
};
},
onShow() {
if (this.$store.getters.publicObj) {
this.val1 = this.$store.getters.publicObj.material_spec
this.val2 = this.$store.getters.publicObj.material_code
this.val3 = this.$store.getters.publicObj.net_weight
}
},
destroyed () {
this.$store.dispatch('publicObj', '')
},
created () {
this._getWork()
},
methods: {
getMater () {
uni.navigateTo({
url: '/pages/modules/SemifinishedMaterSearch'
})
},
/** 选择器 */
selectChange(e) {
this.index = e
},
/** 下拉框查询 */
async _getWork () {
let res = await getWork()
res.data.map(el => {
this.$set('value', el.workprocedure_id)
this.$set('text', el.workprocedure_name)
})
this.options = [...res.data]
},
/** 确认 */
async toSure () {
this.disabled = true
if (!this.val1 || !this.val3 || !this.bar_code ) {
this.disabled = false
return
}
try {
let from = {
material_spec: this.val1,
material_code: this.val2,
qty: this.val3,
sale_id: this.sale_id,
workprocedure_id: this.index,
bar_code: this.bar_code
}
let res = await BcpConfirm(from)
this.disabled = false
this.toCancle()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
},
toCancle () {
this.val1 = ''
this.val2 = ''
this.val3 = ''
this.sale_id = ''
this.index = ''
this.bar_code = ''
this.$store.dispatch('publicObj', '')
}
}
}
</script>
<style lang="stylus">
</style>

View File

@@ -1,19 +1,99 @@
<template>
<view>
<view class="zd_container">
<nav-bar :inner2="true" @goIn="goIn" title="半成品物料查询"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">物料规格</span>
</view>
<view class="filter_input_wraper">
<search-box
v-model="val1"
@handleChange="handleChange"
/>
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>序号</th>
<th>物料规格</th>
<th>物料编码</th>
<th>物料名称</th>
<th>单重</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.material_code === pkId}">
<td>{{i+1}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.product_name}}</td>
<td>{{e.net_weight}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !pkId}" @tap="toSure">确认</button>
<button class="submit-button" @tap="_getMaterial(val1)">查询</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getMaterial} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
val1: '',
dataList: [],
pkId: '',
pkObj: {}
};
},
methods: {
handleChange (e) {
this._getMaterial(e)
},
/** grid查询 */
async _getMaterial (e) {
let res = await getMaterial(e)
this.dataList = [...res.data]
},
toCheck (e) {
this.pkId = this.pkId === e.material_code ? '' : e.material_code
this.pkObj = this.pkId === e.material_code ? e : {}
},
toSure () {
if (!this.pkId) {
return
}
this.$store.dispatch('setPublicObj', this.pkObj)
this.goIn()
},
goIn () {
uni.redirectTo({
url: '/pages/modules/SemifinishedInStore'
})
}
}
}
</script>
<style lang="stylus">
</style>

View File

@@ -63,46 +63,31 @@ export const handRequest = () => request({
export const authority = () => {
let res = {
sonTree: [
{menu_id: '1', icon: 'RF08', name: '入库搬运', path: '', sonTree: [
{menu_id: '1', name: '生箔生产进度', path: '/pages/ProductManage/SboProdProgress'}
]},
{menu_id: '2', icon: 'RF02', name: '叫料出库', path: '', sonTree: []},
{menu_id: '3', icon: 'RF03', name: '任务管理', path: '', sonTree: []},
{menu_id: '4', icon: 'RF07', name: '指令管理', path: '', sonTree: []},
{menu_id: '5', icon: 'RF04', name: '设备点检', path: '/pages/modules/equip-inspection', sonTree: []},
{menu_id: '6', icon: 'RF10', name: '设备操作', path: '', sonTree: []}
{menu_id: '1', icon: 'RF08', name: '半成品管理', path: '', sonTree: [
{menu_id: '1', name: '半成品入库', path: '/pages/modules/SemifinishedInStore'}
]}
]
}
return res
}
/**
* 设备点检
* 半成品入库
*/
// 获取设备下拉框
export const deviceInfo = () => request({
url:'api/pda/deviceCheck/deviceInfo',
data: {}
})
// 获取设备状态下拉框
export const deviceStatus = () => request({
url:'api/pda/deviceCheck/deviceStatus',
data: {}
})
// 设备点检
export const deviceCheckVerify = (code, user, remark, status) => request({
url:'api/pda/deviceCheck/verify',
// 1.1物料选择页面 -- 单选
export const getMaterial = (sp) => request({
url:'api/pda/hrBcp/iosIn/getMaterial',
data: {
device_code: code,
username: user,
remark: remark,
check_status: status
material_spec: sp
}
})
// 1.3打印机类型
export const virtualprintType = (url) => request1({
url: `${url}/` + 'api/pda/virtual/printType',
// 1.2工序下拉框
export const getWork = (sp) => request({
url:'api/pda/hrBcp/iosIn/getWork',
data: {}
})
// 1.3确认入库(按钮)
export const BcpConfirm = (from) => request({
url:'api/pda/hrBcp/iosIn/confirm',
data: from
})

31
vuex/modules/data.js Normal file
View File

@@ -0,0 +1,31 @@
import * as types from '../types'
const state = {
publicObj: '',
publicArr: ''
}
const getters = {
publicObj: state => state.publicObj,
publicArr: state => state.publicArr
}
const actions = {
setPublicObj ({commit}, res) {
commit(types.PUBLIC_OBJ, res)
},
setPublicArr ({commit}, res) {
commit(types.PUBLIC_ARR, res)
}
}
const mutations = {
[types.PUBLIC_OBJ] (state, res) {
state.publicObj = res
},
[types.PUBLIC_ARR] (state, res) {
state.publicArr = res
}
}
export default {
state,
getters,
actions,
mutations
}

View File

@@ -6,4 +6,10 @@ export const DEL_LOGIN_NAME = 'DEL_LOGIN_NAME'
export const COM_CONFIG = 'COM_CONFIG'
export const SAVE_USER_INFO = 'SAVE_USER_INFO'
export const DEL_USER_INFO = 'DEL_USER_INFO'
export const SAVE_TOKEN = 'SAVE_TOKEN'
export const SAVE_TOKEN = 'SAVE_TOKEN'
/**
* data
*/
export const PUBLIC_OBJ = 'PUBLIC_OBJ'
export const PUBLIC_ARR = 'PUBLIC_ARR'