124 lines
3.2 KiB
Vue
124 lines
3.2 KiB
Vue
<template>
|
|
<view class="zd_container">
|
|
<nav-bar title="分拣排产"></nav-bar>
|
|
<view class="zd_content">
|
|
<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>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr v-for="(e, i) in dataList" :key="i" @tap="toCheck(e)" :class="{'checked': e.workorder_code === pkId}">
|
|
<td>{{e.workorder_code}}</td>
|
|
<td>{{e.material_code}}</td>
|
|
<td>{{e.material_name}}</td>
|
|
<td>{{e.workorder_status}}</td>
|
|
<td>{{e.operator}}</td>
|
|
<td>{{e.create_name}}</td>
|
|
<td><input type="number" class="sin_input" v-model="e.plan_qty"></td>
|
|
<td>{{e.real_qty}}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="submit-bar">
|
|
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled1" @tap="toSure1">开工</button>
|
|
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled2" @tap="toSure2">完工</button>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import NavBar from '@/components/NavBar.vue'
|
|
import SearchBox from '@/components/SearchBox.vue'
|
|
import {manualSortingOrders, manualSortingProductionScheduling, manualSortingProductionComplete} from '@/utils/getData2.js'
|
|
export default {
|
|
components: {
|
|
NavBar,
|
|
SearchBox
|
|
},
|
|
data() {
|
|
return {
|
|
dataList: [],
|
|
pkId: '',
|
|
pkObj: {},
|
|
disabled1: false,
|
|
disabled2: false
|
|
};
|
|
},
|
|
created () {
|
|
this._manualSortingOrders()
|
|
},
|
|
methods: {
|
|
/** grid查询 */
|
|
async _manualSortingOrders () {
|
|
let res = await manualSortingOrders()
|
|
this.dataList = [...res]
|
|
},
|
|
toCheck (e) {
|
|
this.pkId = this.pkId === e.workorder_code ? '' : e.workorder_code
|
|
this.pkObj = this.pkId === e.workorder_code ? e : {}
|
|
},
|
|
/** 开工 */
|
|
async toSure1 () {
|
|
this.disabled1 = true
|
|
if (!this.pkId) {
|
|
this.disabled1 = false
|
|
return
|
|
}
|
|
try {
|
|
let userName = this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).username : ''
|
|
let res = await manualSortingProductionScheduling(this.pkId, userName)
|
|
this.disabled1 = false
|
|
this.pkId = ''
|
|
this.pkObj = {}
|
|
this._manualSortingOrders()
|
|
uni.showToast({
|
|
title: res.message,
|
|
icon: 'none'
|
|
})
|
|
} catch (e) {
|
|
this.disabled1 = false
|
|
}
|
|
},
|
|
/** 完工 */
|
|
async toSure2 () {
|
|
this.disabled2 = true
|
|
if (!this.pkId) {
|
|
this.disabled2 = false
|
|
return
|
|
}
|
|
try {
|
|
let userName = this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).username : ''
|
|
let res = await manualSortingProductionComplete(this.pkId, userName)
|
|
this.disabled2 = false
|
|
this.pkId = ''
|
|
this.pkObj = {}
|
|
this._manualSortingOrders()
|
|
uni.showToast({
|
|
title: res.message,
|
|
icon: 'none'
|
|
})
|
|
} catch (e) {
|
|
this.disabled2 = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="stylus">
|
|
</style>
|