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

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

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

Loading…
Cancel
Save