94 lines
2.2 KiB
Vue
94 lines
2.2 KiB
Vue
<template>
|
|
<!-- 工单报工 -->
|
|
<view>
|
|
<uni-card>
|
|
<uni-forms :modelValue="formData" label-width="80px" label-align="right">
|
|
<uni-forms-item label="工单号" name="fkWorkorder">
|
|
<span>{{formData.fkWorkorder}}</span>
|
|
</uni-forms-item>
|
|
<uni-forms-item label="产品编号" name="productionCode">
|
|
<span>{{formData.productionCode}}</span>
|
|
</uni-forms-item>
|
|
<uni-forms-item label="产品名称" name="productionName">
|
|
<span>{{formData.productionName}}</span>
|
|
</uni-forms-item>
|
|
<uni-forms-item label="规格" name="specification">
|
|
<span>{{formData.specification}}</span>
|
|
</uni-forms-item>
|
|
<uni-forms-item label="计划生产" name="dispatchNum">
|
|
<span>{{formData.dispatchNum}}</span>
|
|
</uni-forms-item>
|
|
<uni-forms-item label="报工数" name="finishedNum">
|
|
<uni-easyinput type="number" v-model.number="formData.finishedNum" placeholder="请输入报工数" />
|
|
</uni-forms-item>
|
|
</uni-forms>
|
|
</uni-card>
|
|
<view class="bottom-box">
|
|
<button :disabled="loading" type="primary" @click="submit">确认报工</button>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import { manualGenerationOfReportWork,updateReport } from '@/api/workorder/index.js';
|
|
export default {
|
|
onLoad: function (option) {
|
|
this.$nextTick(()=>{
|
|
this.formData = JSON.parse(JSON.stringify(option));
|
|
})
|
|
},
|
|
data() {
|
|
return {
|
|
loading:false,
|
|
formData: {
|
|
id:null,
|
|
finishNum:0
|
|
}
|
|
};
|
|
},
|
|
methods: {
|
|
// 报工提交
|
|
submit() {
|
|
this.loading = true;
|
|
uni.showLoading({
|
|
title:'报工中……'
|
|
})
|
|
const params = {
|
|
workorder:this.formData.fkWorkorder,
|
|
reportNum:this.formData.finishedNum
|
|
}
|
|
updateReport(params).then(res=>{
|
|
if(res.code === 200){
|
|
this.loading = false;
|
|
uni.showToast({
|
|
icon: 'success',
|
|
title: '报工成功',
|
|
duration:2000,
|
|
success() {
|
|
setTimeout(()=>{
|
|
uni.navigateBack(-1)
|
|
},2000)
|
|
|
|
}
|
|
});
|
|
uni.hideLoading();
|
|
}else{
|
|
uni.hideLoading();
|
|
}
|
|
}).catch(()=>{
|
|
uni.hideLoading();
|
|
})
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style scoped>
|
|
span{
|
|
height: 100%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: flex-start;
|
|
}
|
|
</style>
|