人工排产

This commit is contained in:
2024-02-22 14:50:51 +08:00
parent e672f1abe8
commit 2725e42919
8 changed files with 246 additions and 141 deletions

View File

@@ -32,7 +32,7 @@
return {
userName: '',
menuList: [
{id: '1', name: '人工排产', icon: 'RF01', path: '/pages/modules/equip-inspection'},
{id: '1', name: '人工排产', icon: 'RF01', path: '/pages/modules/man-paichan'},
{id: '2', name: '涂线板', icon: 'RF02', path: '/pages/manage/man-group-disk'},
{id: '3', name: '物料库存', icon: 'RF03', path: '/pages/manage/man-group-disk'}
]

View File

@@ -75,9 +75,9 @@
})
},
async toLogin() {
uni.redirectTo({
url: '/pages/home/home'
})
// uni.redirectTo({
// url: '/pages/home/home'
// })
this.disabled = true
if (this.user === '') {
uni.showToast({

View File

@@ -8,12 +8,12 @@
<input type="text" class="setup-input" placeholder="请输入服务器地址" v-model="addrip">
</view>
</view>
<view class="zd_wrapper">
<!-- <view class="zd_wrapper">
<view class="input-wrap">
<view class="input-label">刷新时间(s)</view>
<input type="text" class="setup-input" placeholder="请输入刷新时间" v-model="setTime">
</view>
</view>
</view> -->
</view>
<view class="submit-bar">
<button class="submit-button" @click="_submit">确认</button>

View File

@@ -105,12 +105,13 @@
}
.mask {
position: fixed;
position: fixed;
z-index: 99;
left: 0;
top: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, .65);
background-color: rgba(0, 0, 0, .9);
}
.botton-radius {
@@ -119,7 +120,8 @@
}
.content {
position: relative;
position: relative;
z-index: 100;
top: 0;
width: 600rpx;
background-color: #fff;

View File

@@ -0,0 +1,140 @@
<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 class="fontcol1">{{e.workorder_code}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td><view class="fontbg" :class="'fontbg' + e.workorder_status">{{textState(e.workorder_status)}}</view></td>
<td>{{e.operator}}</td>
<td>{{e.create_name}}</td>
<!-- <td><input class="td_input" type="number" v-model="e.plan_qty"></td> -->
<td class="fontcol2">{{e.plan_qty}}</td>
<td class="fontcol2">{{e.real_qty}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="zd-row submit-bar_new">
<button class="zd-col-11 submit-button_new" :class="{'btn-disabled': !pkId}" :disabled="disabled1" @tap="_productionScheduling">开工</button>
<button class="zd-col-11 submit-button_new" :class="{'btn-disabled': !pkId}" :disabled="disabled2" @tap="_productionComplete">完工</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import {manualSortingOrders, productionScheduling, productionComplete} from '@/utils/getData2.js'
export default {
components: {
NavBar
},
data() {
return {
dataList: [],
disabled1: false,
disabled2: false,
pkId: ''
};
},
created () {
this._manualSortingOrders()
},
methods: {
textState (e) {
switch (e) {
case '1':
return '未生产'
break
case '3':
return '生产中'
break
case '4':
return '暂停'
break
default:
return ''
break
}
},
/** grid查询 */
async _manualSortingOrders () {
let res = await manualSortingOrders()
this.dataList = [...res]
},
toCheck (e) {
this.pkId = this.pkId === e.workorder_code ? '' : e.workorder_code
},
/** 开工 */
async _productionScheduling () {
this.disabled1 = true
if (!this.pkId) {
this.disabled1 = false
return
}
try {
let user = ''
if (this.$store.getters.userInfo) {
user = JSON.parse(this.$store.getters.userInfo).username
}
let res = await productionScheduling(this.pkId, user)
this.disabled1 = false
this.pkId = ''
this._manualSortingOrders()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled1 = false
}
},
/** 完工 */
async _productionComplete () {
this.disabled2 = true
if (!this.pkId) {
this.disabled2 = false
return
}
try {
let user = ''
if (this.$store.getters.userInfo) {
user = JSON.parse(this.$store.getters.userInfo).username
}
let res = await productionComplete(this.pkId, user)
this.disabled2 = false
this.pkId = ''
this._manualSortingOrders()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled2 = false
}
}
}
}
</script>
<style lang="stylus">
</style>