Browse Source

feat: update 离线登记增加必填项

master
TengXF 6 months ago
parent
commit
254fae5231
  1. 88
      src/pages/mes/productOffline/createProductOffline.vue
  2. 9
      src/pages/mes/workScheduling/workScheduling.vue

88
src/pages/mes/productOffline/createProductOffline.vue

@ -1,12 +1,12 @@
<template>
<!-- 列表展示标准模版 -->
<view>
<view class="detail-container">
<u-form :model="form">
<view>
<u-form-item label="产品编码" prop="productCode">
<view>
<u-input v-model="form.productCode" type="select" @click="showProduct = true" placeholder="请选择产品编码"/>
<!-- <u-input v-model="form.productCode" disabled="true"/> -->
<u-input v-model="form.productCode" disabled="true" placeholder="请选择产品编码"/>
<!-- <u-input v-model="form.productCode" type="select" @click="showProduct = true" disabled="true"/> -->
</view>
</u-form-item>
</view>
@ -45,6 +45,13 @@
</view>
</u-form-item>
</view>
<view>
<u-form-item label="质检人员" prop="checkPersonCode">
<view>
<u-input v-model="form.checkPersonCode" />
</view>
</u-form-item>
</view>
<view>
<u-form-item label="离线原因" prop="offlineReson">
<view>
@ -52,16 +59,18 @@
</view>
</u-form-item>
</view>
<view class="btns">
<button class="sure" @click="handleSubmit" :loading='loading' :disabled='loading'>提交处理</button>
</view>
</u-form>
<view class="footer">
<!-- <view class="footer" >
<view class="btns">
<button class="sure" @click="handleSubmit" :loading='loading' :disabled='loading'>提交处理</button>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view> -->
</view>
<u-select v-model="showProduct" :list="productList" @confirm="selectProduct"></u-select>
<view><u-select v-model="showProduct" :list="productList" @confirm="selectProduct"></u-select></view>
</template>
<script setup lang="ts">
@ -95,6 +104,7 @@
offlineReson:'',
productDestination:'',
name:'',
checkPersonCode:''
})
/*分页参数*/
const params = ref({
@ -104,31 +114,47 @@
})
//
function handleSubmit(){
if(form.value.productCode!=''){
proxy.$modal.confirm('确定提交处理吗').then(() => {
proxy.$modal.loading('加载中')
loading.value = true
productOfflineApi.create(form.value).then((res) => {
proxy.$modal.closeLoading()
if (res.data) {
proxy.$modal.showToast('成功')
setTimeout(() => {
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast('失败')
if(form.value.productDestination == ''){
proxy.$modal.showToast('产品去向不能为空')
setTimeout(() => {
proxy.$modal.closeLoading()
}, 1000)
return ;
}
if(form.value.checkPersonCode == ''){
proxy.$modal.showToast('质检人员不能为空')
setTimeout(() => {
proxy.$modal.closeLoading()
}, 1000)
return ;
}
if(form.value.offlineReson == ''){
proxy.$modal.showToast('离线原因不能为空')
setTimeout(() => {
proxy.$modal.closeLoading()
}, 1000)
return ;
}
proxy.$modal.confirm('确定提交处理吗').then(() => {
proxy.$modal.loading('加载中')
loading.value = true
productOfflineApi.create(form.value).then((res) => {
proxy.$modal.closeLoading()
if (res.data) {
proxy.$modal.showToast('成功')
setTimeout(() => {
proxy.$tab.navigateBack()
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
}, 1500)
} else {
proxy.$modal.showToast('失败')
loading.value = false
})
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
}
else{
proxy.$modal.showToast('请先选择产品编码')
}
})
}
//
function selectProduct(index){
@ -203,6 +229,10 @@
</script>
<style lang="scss" scoped>
.detail-container {
min-height: 100vh;
background: white;
}
.footer {
position: fixed;

9
src/pages/mes/workScheduling/workScheduling.vue

@ -139,13 +139,13 @@
@click="kaigong(item)">开工</u-button>
<u-button type="success" size="mini" @click="SOP(item)" class="btn"
style="background-color:#aa5500">SOP</u-button>
<u-button v-if="item.flagDo==0 && item.status==1" type="primary" size="mini"
<u-button v-if="item.flagDo==0 && item.status==1 && item.workingNode != 'endNode'" type="primary" size="mini"
@click="callBasicItem(item)" class="btn">叫料</u-button>
<u-button v-if="item.flagDo==0 && item.status==1" type="error" size="mini"
<u-button v-if="item.flagDo==0 && item.status==1 && item.workingNode != 'endNode'" type="error" size="mini"
@click="addBasicItem(item)" class="btn">补料</u-button>
<u-button v-if="item.status==1 && item.workingNode =='endNode'" type="success" size="mini"
@click="finished(item)" class="btn">完工</u-button>
<u-button v-if="(current==3||current==0) && item.status==1" type="success" size="mini"
<u-button v-if="(current==3||current==0) && item.status==1 && item.workingNode != 'endNode'" type="success" size="mini"
style="background-color:#888888"
@click="openOffLine(item)" class="btn">离线</u-button>
</view>
@ -497,7 +497,7 @@
tabParams.value.pageNo = 1
getTabsList()
} else {
proxy.$modal.showToast('失败')
proxy.$modal.showToast(res.msg)
}
}).catch(() => {
proxy.$modal.closeLoading()
@ -565,6 +565,7 @@
status.value = 'loadmore'
tabParams.value.status = '0'
tabParams.value.flagDo = '1'
tabParams.value.pageNo = 1
getRequestList()
} else {

Loading…
Cancel
Save