TengXF
7 months ago
6 changed files with 728 additions and 55 deletions
@ -0,0 +1,359 @@ |
|||||
|
<template> |
||||
|
<!-- 详情 --> |
||||
|
<view class="detail-container"> |
||||
|
<view class="info"> |
||||
|
<view class="title"> |
||||
|
<view>当前工序:{{formData.processCode}}</view> |
||||
|
</view> |
||||
|
<!-- 主数据 --> |
||||
|
<view class="dec"> |
||||
|
<view class="dec-item"> |
||||
|
<view>完工人员:</view> |
||||
|
<view><u-input v-model="formData.workerName" type="select" @click="showWorker = true" placeholder="请选择人员"/></view> |
||||
|
</view> |
||||
|
<view class="dec-item"> |
||||
|
<view>是否质检:</view> |
||||
|
<view><u-input v-model="formData.checkFlagName" type="select" @click="showType = true" placeholder="请选择是否质检"/></view> |
||||
|
</view> |
||||
|
<view class="dec-item"> |
||||
|
<view>完工工时:</view> |
||||
|
<view><u-input v-model="formData.workTerm" type="number" placeholder="请输入工时" /></view> |
||||
|
</view> |
||||
|
<view class="dec-item"> |
||||
|
<view>完工数量:</view> |
||||
|
<view><u-input v-model="formData.planCount" type="number" @update:modelValue="calculatePass()" placeholder="请输入数量" /></view> |
||||
|
</view> |
||||
|
<view class="dec-item"> |
||||
|
<view>合格数量:</view> |
||||
|
<view><u-input :disabled="checkFlag" v-model="formData.reportCount" type="number" placeholder="请输入合格数量" @update:modelValue="calculatePass()" /></view> |
||||
|
</view> |
||||
|
<view class="dec-item"> |
||||
|
<view>不合格数量:</view> |
||||
|
<view><u-input v-model="formData.unCount" type="number" disabled="true"/></view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<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> |
||||
|
<u-popup v-model="showWorker" mode="bottom" border-radius="14" length="30%"> |
||||
|
<view> |
||||
|
<u-select v-model="showWorker" mode="mutil-column-auto" :list="workerList" @confirm="confirmSelectWorker"></u-select> |
||||
|
</view> |
||||
|
</u-popup> |
||||
|
<u-popup v-model="showType" mode="bottom" border-radius="14" length="30%"> |
||||
|
<view> |
||||
|
<u-select v-model="showType" :list="typeList" @confirm="confirmSelectType"></u-select> |
||||
|
</view> |
||||
|
</u-popup> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import { |
||||
|
onLoad, |
||||
|
onShow |
||||
|
} from '@dcloudio/uni-app' |
||||
|
import { |
||||
|
ref, |
||||
|
getCurrentInstance |
||||
|
} from 'vue' |
||||
|
import * as workSchedulingListApi from '@/api/mes/workScheduling/index.ts' |
||||
|
const { proxy } = getCurrentInstance() |
||||
|
const params = ref({ |
||||
|
pageNo: 1, |
||||
|
pageSize: 10, |
||||
|
}) |
||||
|
const paramData = ref() |
||||
|
const checkFlag = ref(false) |
||||
|
const showWorker = ref(false) |
||||
|
const showType = ref(false) |
||||
|
const workerList = ref([]) |
||||
|
const typeList = ref([{label:'是',value: '1'},{label:'否',value: '2'}]) |
||||
|
const nodeInfo = ref({ |
||||
|
planDayCode:'PO20240430-0011', |
||||
|
processCode:'QD_CY_01' |
||||
|
}) |
||||
|
const formData = ref({ |
||||
|
id:'', |
||||
|
processCode:'', |
||||
|
workerCode:'', |
||||
|
workerName:'', |
||||
|
checkFlag:'', |
||||
|
checkFlagName:'', |
||||
|
workTerm:'', |
||||
|
reportCount:'', |
||||
|
planCount:'', |
||||
|
unCount:'', |
||||
|
batchCode:'', |
||||
|
workstationCode:'', |
||||
|
force:'true' |
||||
|
}) |
||||
|
|
||||
|
function calculatePass(){ |
||||
|
if(!checkFlag.value){ |
||||
|
formData.value.unCount = formData.value.planCount - formData.value.reportCount |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//提交接口 |
||||
|
function submitData(){ |
||||
|
proxy.$modal.loading('加载中') |
||||
|
workSchedulingListApi.completeHandle(formData.value).then((res) => { |
||||
|
proxy.$modal.closeLoading() |
||||
|
if (res.data) { |
||||
|
proxy.$modal.showToast('成功') |
||||
|
setTimeout(() => { |
||||
|
proxy.$tab.navigateBack() |
||||
|
}, 1500) |
||||
|
} else { |
||||
|
proxy.$modal.showToast('失败') |
||||
|
} |
||||
|
}).catch(() => { |
||||
|
proxy.$modal.closeLoading() |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 选择人员回调函数 |
||||
|
function confirmSelectWorker(val){ |
||||
|
formData.value.workerCode = val[0].value |
||||
|
formData.value.workerName = val[0].label |
||||
|
} |
||||
|
|
||||
|
function confirmSelectType(val){ |
||||
|
console.log(val[0].value == '1') |
||||
|
formData.value.checkFlag = val[0].value |
||||
|
formData.value.checkFlagName = val[0].label |
||||
|
if(val[0].value == '1'){ |
||||
|
checkFlag.value = false |
||||
|
formData.value.reportCount = '' |
||||
|
formData.value.unCount = '' |
||||
|
} |
||||
|
else{ |
||||
|
checkFlag.value=true |
||||
|
} |
||||
|
} |
||||
|
// 提交处理请求函数 |
||||
|
function handleSubmit(){ |
||||
|
proxy.$modal.confirm('确定提交处理吗').then(() => { |
||||
|
submitData() |
||||
|
}) |
||||
|
} |
||||
|
onLoad((option) => { |
||||
|
if (option.obj) { |
||||
|
paramData.value = JSON.parse(decodeURIComponent(option.obj)); // 将字符串转换为对象并存入paramData |
||||
|
nodeInfo.value.planDayCode = paramData.value.planMasterCode |
||||
|
nodeInfo.value.processCode = paramData.value.workingNode |
||||
|
formData.value.processCode = paramData.value.workingNode |
||||
|
formData.value.id = paramData.value.id |
||||
|
formData.value.workstationCode = paramData.value.currentWorkstation |
||||
|
formData.value.batchCode = paramData.value.batchCode |
||||
|
} |
||||
|
}) |
||||
|
onShow(() => { |
||||
|
getPageChildren() |
||||
|
}) |
||||
|
// 获取选择人员函数 |
||||
|
function getPageChildren(){ |
||||
|
workSchedulingListApi.getCurrentWorkerList(nodeInfo.value).then((res) => { |
||||
|
if (res.data) { |
||||
|
workerList.value = transList(res.data) |
||||
|
} else { |
||||
|
} |
||||
|
}).catch(() => { |
||||
|
}) |
||||
|
} |
||||
|
//数据转换 |
||||
|
function transList(data) { |
||||
|
console.log(data) |
||||
|
const list = data.map(item => { |
||||
|
return { |
||||
|
"label": item.workerName, |
||||
|
"value": item.workerCode |
||||
|
}; |
||||
|
}); |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.detail-container { |
||||
|
min-height: 100vh; |
||||
|
background: white; |
||||
|
} |
||||
|
|
||||
|
.line { |
||||
|
background: #f5f5f5; |
||||
|
height: 20rpx; |
||||
|
} |
||||
|
|
||||
|
.info { |
||||
|
background: white; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
.tab { |
||||
|
border-bottom: 1px solid #e4e4e4; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.title { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
padding: 20rpx 30rpx; |
||||
|
border-bottom: 1px solid #e4e4e4; |
||||
|
|
||||
|
view { |
||||
|
&:nth-child(1) { |
||||
|
flex: 1; |
||||
|
border-left: 10rpx solid #409eff; |
||||
|
padding-left: 20rpx; |
||||
|
font-weight: bold; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.dec { |
||||
|
padding: 30rpx; |
||||
|
|
||||
|
.dec-item { |
||||
|
padding-bottom: 30rpx; |
||||
|
display: flex; |
||||
|
|
||||
|
view { |
||||
|
&:nth-child(1) { |
||||
|
width: 180rpx; |
||||
|
} |
||||
|
|
||||
|
&:nth-child(2) { |
||||
|
color: #888888; |
||||
|
flex: 1; |
||||
|
width: 0px; |
||||
|
word-wrap: break-word; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.dec2 { |
||||
|
padding: 10rpx 30rpx; |
||||
|
display: flex; |
||||
|
|
||||
|
view { |
||||
|
&:nth-child(1) { |
||||
|
width: 180rpx; |
||||
|
} |
||||
|
|
||||
|
&:nth-child(2) { |
||||
|
color: #888888; |
||||
|
flex: 1; |
||||
|
width: 0px; |
||||
|
word-wrap: break-word; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
.items { |
||||
|
border-radius: 12rpx; |
||||
|
background: #F5F5F5; |
||||
|
padding-bottom: 20rpx; |
||||
|
|
||||
|
.items-name { |
||||
|
padding: 20rpx; |
||||
|
border-bottom: 1px solid #dedede; |
||||
|
} |
||||
|
|
||||
|
.items-dec { |
||||
|
padding: 0px 20rpx; |
||||
|
margin-top: 20rpx; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
.list { |
||||
|
padding: 20rpx; |
||||
|
|
||||
|
.item { |
||||
|
display: flex; |
||||
|
margin-bottom: 20rpx; |
||||
|
|
||||
|
.item-box { |
||||
|
border-radius: 12rpx; |
||||
|
border: 1px solid #dedede; |
||||
|
border-radius: 12rpx; |
||||
|
|
||||
|
flex: 1; |
||||
|
width: 0rpx; |
||||
|
} |
||||
|
|
||||
|
.spare-title { |
||||
|
padding: 20rpx 30rpx; |
||||
|
border-bottom: 1px solid #e4e4e4; |
||||
|
display: flex; |
||||
|
|
||||
|
.title-txt { |
||||
|
color: #409eff; |
||||
|
font-size: 30rpx; |
||||
|
font-weight: bold; |
||||
|
flex: 1; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.dec { |
||||
|
color: #9c9c9c; |
||||
|
padding: 0rpx 30rpx 20rpx; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.add-btn { |
||||
|
display: flex; |
||||
|
justify-content: flex-start; |
||||
|
align-items: center; |
||||
|
} |
||||
|
|
||||
|
.footer { |
||||
|
position: fixed; |
||||
|
bottom: 0px; |
||||
|
left: 0px; |
||||
|
width: 100%; |
||||
|
z-index: 22; |
||||
|
} |
||||
|
|
||||
|
.btns { |
||||
|
display: flex; |
||||
|
|
||||
|
|
||||
|
button { |
||||
|
flex: 1; |
||||
|
} |
||||
|
|
||||
|
.sure { |
||||
|
background: #409eff; |
||||
|
color: white; |
||||
|
border-radius: 0px; |
||||
|
|
||||
|
&::after { |
||||
|
border: 1px solid #409eff; |
||||
|
border-radius: 0px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.reset { |
||||
|
background: #ff7a45; |
||||
|
border-radius: 0px; |
||||
|
|
||||
|
&::after { |
||||
|
border-radius: 0px; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,183 @@ |
|||||
|
<template> |
||||
|
<!-- 列表展示标准模版 --> |
||||
|
<view class="container"> |
||||
|
<view class="list"> |
||||
|
<view class="item" v-for="(item,index) in list" :key="index"> |
||||
|
<view class="title"> |
||||
|
<view class="title-txt"> |
||||
|
配料编码:{{item.itemBasicCode}} |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="dec"> |
||||
|
<view>申请单号:</view> |
||||
|
<view>{{ item.requestBillNo }}</view> |
||||
|
</view> |
||||
|
<view class="dec"> |
||||
|
<view>物料数量:</view> |
||||
|
<view>{{ item.itemCounts }}</view> |
||||
|
</view> |
||||
|
<view class="dec"> |
||||
|
<view>物料单位:</view> |
||||
|
<view>{{ item.itemUom }}</view> |
||||
|
</view> |
||||
|
<view class="dec-item"> |
||||
|
<view>创建时间:{{ `${$time.formatDate(item.createTime)}` }}</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view style="height: 94rpx;padding-top: 30rpx;"> |
||||
|
<u-loadmore :status="status" v-if="status != 'loadmore'" /> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import { |
||||
|
onLoad, |
||||
|
onShow, |
||||
|
onReachBottom |
||||
|
} from '@dcloudio/uni-app' |
||||
|
import { |
||||
|
ref, |
||||
|
getCurrentInstance |
||||
|
} from 'vue' |
||||
|
|
||||
|
import * as workSchedulingListApi from '@/api/mes/workScheduling/index.ts' |
||||
|
|
||||
|
const {proxy} = getCurrentInstance() |
||||
|
const list = ref([]) |
||||
|
const status = ref('loadmore') |
||||
|
const params = ref({ |
||||
|
pageNo: 1, |
||||
|
pageSize: 10, |
||||
|
requestBillNo:'', |
||||
|
}) |
||||
|
function getRequestMainDetailList() { |
||||
|
if (status.value == 'nomore') return; |
||||
|
status.value = 'loading'; |
||||
|
proxy.$modal.loading('加载中') |
||||
|
workSchedulingListApi.getRequestMainDetail(params.value).then((res) => { |
||||
|
proxy.$modal.closeLoading() |
||||
|
if (res.data.list.length > 0) { |
||||
|
params.value.pageNo++; |
||||
|
status.value = 'loadmore' |
||||
|
list.value = list.value.concat(res.data.list) |
||||
|
console.log(list.value) |
||||
|
} |
||||
|
else{ |
||||
|
status.value = 'nomore' |
||||
|
} |
||||
|
}).catch(() => { |
||||
|
proxy.$modal.closeLoading() |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
//滑动到底部展示 |
||||
|
onReachBottom(() => { |
||||
|
getRequestMainDetailList() |
||||
|
}) |
||||
|
|
||||
|
onLoad((option) => { |
||||
|
if (option.obj) { |
||||
|
let requestParam = JSON.parse(decodeURIComponent(option.obj)); // 将字符串转换为对象并存入 |
||||
|
params.value.requestBillNo = requestParam.requestBillNo |
||||
|
} |
||||
|
}) |
||||
|
onShow(() => { |
||||
|
getRequestMainDetailList() |
||||
|
}) |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.container{ |
||||
|
background: #f5f5f5; |
||||
|
min-height: 100vh; |
||||
|
} |
||||
|
.list { |
||||
|
background: #f5f5f5; |
||||
|
margin-top: 20rpx; |
||||
|
.item { |
||||
|
padding: 30rpx 30rpx 0px 30rpx; |
||||
|
margin-top: 20rpx; |
||||
|
background: white; |
||||
|
position: relative; |
||||
|
.title { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
padding-bottom: 20rpx; |
||||
|
.title-txt { |
||||
|
color: #409eff; |
||||
|
font-weight: bold; |
||||
|
font-size: 36rpx; |
||||
|
width: 0px; |
||||
|
flex: 1; |
||||
|
word-wrap: break-word; |
||||
|
} |
||||
|
.time { |
||||
|
color: #919191; |
||||
|
} |
||||
|
} |
||||
|
.dec { |
||||
|
padding-bottom: 20rpx; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
view { |
||||
|
&:nth-child(1){ |
||||
|
width: 160rpx;; |
||||
|
} |
||||
|
&:nth-child(2){ |
||||
|
color: #999999; |
||||
|
flex: 1; |
||||
|
width: 0px; |
||||
|
word-wrap: break-word; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
.last { |
||||
|
padding-bottom: 30rpx; |
||||
|
} |
||||
|
.bottom { |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
border-top: 1px solid #E4E4E4; |
||||
|
padding: 20rpx 0px; |
||||
|
height: 90rpx; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.btns { |
||||
|
display: flex; |
||||
|
|
||||
|
|
||||
|
button { |
||||
|
flex: 1; |
||||
|
} |
||||
|
|
||||
|
.sure { |
||||
|
background: #409eff; |
||||
|
color: white; |
||||
|
border-radius: 0px; |
||||
|
margin-top: 60px; |
||||
|
|
||||
|
&::after { |
||||
|
border: 1px solid #409eff; |
||||
|
border-radius: 0px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.reset { |
||||
|
background: #ff7a45; |
||||
|
border-radius: 0px; |
||||
|
|
||||
|
&::after { |
||||
|
border-radius: 0px; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
</style> |
Loading…
Reference in new issue