This commit is contained in:
2023-09-01 16:25:18 +08:00
parent b3c6066a6f
commit d52313cae5
3 changed files with 119 additions and 147 deletions

View File

@@ -3,31 +3,44 @@
<nav-bar title="空箱出库"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="filter_item">
<view class="filter_label">设备号</view>
<view class="filter_input_wraper">
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
</view>
</view>
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">状态</span>
<span class="filter_label">载具号</span>
</view>
<view class="filter_input_wraper">
<uni-data-select v-model="index2" :localdata="options2" @change="selectChange2"></uni-data-select>
<search-box
v-model="val1"
@handleChange="handleChange"
/>
</view>
</view>
<view class="filter_item filter_item_1">
<view class="filter_label">备注</view>
<view class="filter_input_wraper filter_input_wraper_1">
<textarea class="filter_textarea" v-model="remark"></textarea>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>序号</th>
<th>选择</th>
<th>货位</th>
<th>载具号</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.checked}">
<td>{{Number(i) + 1}}</td>
<td><span class="iconfont icon_unchecked" :class="{'icon_checked': e.checked}" @tap="toCheck(e)">&#xe66b;</span></td>
<td>{{e.struct_code}}</td>
<td>{{e.storagevehicle_code}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !index1 || !index2}" :disabled="disabled1" @tap="toSure">确认</button>
<button class="submit-button" @tap="toCancle">取消</button>
<button class="submit-button" :class="{'btn-disabled': !val1}" :disabled="disabled" @tap="toSure">出库确认</button>
<button class="submit-button" @tap="_empOutgetIvt(val1)">查询</button>
</view>
</view>
</template>
@@ -35,7 +48,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {deviceInfo, deviceStatus, deviceCheckVerify} from '@/utils/getData2.js'
import {empOutgetIvt, empOutconfirm} from '@/utils/getData1.js'
export default {
components: {
NavBar,
@@ -43,82 +56,50 @@
},
data() {
return {
options1: [],
index1: '',
options2: [],
index2: '',
remark: '',
disabled1: false
val1: '',
dataList: [],
checkArr: [],
disabled: false
};
},
created () {
this._deviceInfo()
this._deviceStatus()
},
methods: {
/** 选择器 */
selectChange1(e) {
this.index1 = e
handleChange (e) {
this._empOutgetIvt(e)
},
selectChange2(e) {
this.index2 = e
/** grid查询 */
async _empOutgetIvt (e) {
let res = await empOutgetIvt(e)
res.data.map(el => {
this.$set(el, 'checked', false)
})
this.dataList = [...res.data]
},
/** 获取设备下拉框 */
async _deviceInfo () {
let res = await deviceInfo()
this.options1 = [...res]
toCheck (e) {
e.checked = !e.checked
this.checkArr = this.dataList.filter(i => { return i.checked === true })
},
/** 获取设备状态下拉框 */
async _deviceStatus () {
let res = await deviceStatus()
this.options2 = [...res]
},
/** 确定 */
/** 确认 */
async toSure () {
this.disabled1 = true
if (!this.index1) {
uni.showToast({
title: '设备号不能为空',
icon: 'none'
})
this.disabled1 = false
return
}
if (!this.index2) {
uni.showToast({
title: '状态不能为空',
icon: 'none'
})
this.disabled1 = false
this.disabled = true
if (!this.val1) {
this.disabled = false
return
}
try {
let userName = this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).username : ''
let res = await deviceCheckVerify(this.index1, userName,this.remark, this.index2)
this.disabled1 = false
this.index1 = ''
this.index2 = ''
this.remark = ''
let res = await empOutconfirm(this.checkArr)
this.disabled = false
this.val1 = ''
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled1 = false
this.disabled = false
}
},
toCancle () {
this.disabled1 = false
this.index1 = ''
this.index2 = ''
this.remark = false
}
}
}
</script>
<style lang="stylus" scoped>
.filter_item_1, .filter_input_wraper_1
align-items: flex-start
height 210rpx
<style lang="stylus">
</style>

View File

@@ -3,31 +3,54 @@
<nav-bar title="半成品出库"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="filter_item">
<view class="filter_label">设备号</view>
<view class="filter_input_wraper">
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
</view>
</view>
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">状态</span>
<span class="filter_label">物料规格</span>
</view>
<view class="filter_input_wraper">
<uni-data-select v-model="index2" :localdata="options2" @change="selectChange2"></uni-data-select>
<search-box
v-model="val1"
@handleChange="handleChange"
/>
</view>
</view>
<view class="filter_item filter_item_1">
<view class="filter_label">备注</view>
<view class="filter_input_wraper filter_input_wraper_1">
<textarea class="filter_textarea" v-model="remark"></textarea>
</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>
<th>物料名称</th>
<th>载具号</th>
<th>数量</th>
<th>所属工序</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.checked}">
<td>{{Number(i) + 1}}</td>
<td><span class="iconfont icon_unchecked" :class="{'icon_checked': e.checked}" @tap="toCheck(e)">&#xe66b;</span></td>
<td>{{e.struct_code}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.storagevehicle_code}}</td>
<td>{{e.canuse_qty}}</td>
<td>{{e.workprocedure_name}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !index1 || !index2}" :disabled="disabled1" @tap="toSure">确认</button>
<button class="submit-button" @tap="toCancle">取消</button>
<button class="submit-button" :class="{'btn-disabled': !val1}" :disabled="disabled" @tap="toSure">出库确认</button>
<button class="submit-button" @tap="_iosOutgetIvt(val1)">查询</button>
</view>
</view>
</template>
@@ -35,7 +58,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {deviceInfo, deviceStatus, deviceCheckVerify} from '@/utils/getData2.js'
import {iosOutgetIvt, iosOutconfirm} from '@/utils/getData1.js'
export default {
components: {
NavBar,
@@ -43,82 +66,50 @@
},
data() {
return {
options1: [],
index1: '',
options2: [],
index2: '',
remark: '',
disabled1: false
val1: '',
dataList: [],
checkArr: [],
disabled: false
};
},
created () {
this._deviceInfo()
this._deviceStatus()
},
methods: {
/** 选择器 */
selectChange1(e) {
this.index1 = e
handleChange (e) {
this._iosOutgetIvt(e)
},
selectChange2(e) {
this.index2 = e
/** grid查询 */
async _iosOutgetIvt (e) {
let res = await iosOutgetIvt(e)
res.data.map(el => {
this.$set(el, 'checked', false)
})
this.dataList = [...res.data]
},
/** 获取设备下拉框 */
async _deviceInfo () {
let res = await deviceInfo()
this.options1 = [...res]
toCheck (e) {
e.checked = !e.checked
this.checkArr = this.dataList.filter(i => { return i.checked === true })
},
/** 获取设备状态下拉框 */
async _deviceStatus () {
let res = await deviceStatus()
this.options2 = [...res]
},
/** 确定 */
/** 确认 */
async toSure () {
this.disabled1 = true
if (!this.index1) {
uni.showToast({
title: '设备号不能为空',
icon: 'none'
})
this.disabled1 = false
return
}
if (!this.index2) {
uni.showToast({
title: '状态不能为空',
icon: 'none'
})
this.disabled1 = false
this.disabled = true
if (!this.val1) {
this.disabled = false
return
}
try {
let userName = this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).username : ''
let res = await deviceCheckVerify(this.index1, userName,this.remark, this.index2)
this.disabled1 = false
this.index1 = ''
this.index2 = ''
this.remark = ''
let res = await iosOutconfirm(this.checkArr)
this.disabled = false
this.val1 = ''
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled1 = false
this.disabled = false
}
},
toCancle () {
this.disabled1 = false
this.index1 = ''
this.index2 = ''
this.remark = false
}
}
}
</script>
<style lang="stylus" scoped>
.filter_item_1, .filter_input_wraper_1
align-items: flex-start
height 210rpx
<style lang="stylus">
</style>

View File

@@ -1,7 +1,7 @@
import request from './request.js'
/**
* 空箱出库
* 半成品出库
*/
// 1.1半成品出库页面
export const iosOutgetIvt = (mspec) => request({