Browse Source

feat: update 工序完工、报工、质检、工单完工、操作按钮展示与隐藏

master
滕晓飞 9 months ago
parent
commit
46e2980179
  1. 16
      src/api/mes/workScheduling/index.ts
  2. 14
      src/pages.json
  3. 31
      src/pages/mes/productBackline/createProductBackline.vue
  4. 2
      src/pages/mes/productOffline/createProductOffline.vue
  5. 10
      src/pages/mes/productOffline/index.vue
  6. 4
      src/pages/mes/workScheduling/inspectionItems.vue
  7. 334
      src/pages/mes/workScheduling/waitQuality.vue
  8. 384
      src/pages/mes/workScheduling/waitReport.vue
  9. 496
      src/pages/mes/workScheduling/workScheduling.vue

16
src/api/mes/workScheduling/index.ts

@ -121,10 +121,24 @@ export function getNodePosition(params) {
return http.get('/mes/workScheduling/getNodePosition', {params})
}
// 完工查询人员
export function getCurrentWorkerList(params) {
export function getWorkerList(params) {
return http.get('/mes/workScheduling/getCurrentWorkerList', {params})
}
export function getRequestMainDetail(params) {
return http.get('/mes/item-request-detail/page', {params})
}
//工序报工
export function reportByProcess(data) {
return http.post('/mes/work-scheduling-detail/reportWorkByProcess', data)
}
//工序完工
export function finishedByProcess(data) {
return http.post('/mes/work-scheduling-detail/processFinished', data)
}
//工序质检
export function qualityByProcess(data) {
return http.post('/mes/work-scheduling-detail/processQualified', data)
}

14
src/pages.json

@ -2079,6 +2079,20 @@
"navigationBarTitleText": "配料详情",
"enablePullDownRefresh": true
}
},
{
"path": "pages/mes/workScheduling/waitQuality",
"style": {
"navigationBarTitleText": "待质检",
"enablePullDownRefresh": true
}
},
{
"path": "pages/mes/workScheduling/waitReport",
"style": {
"navigationBarTitleText": "待报工",
"enablePullDownRefresh": true
}
}

31
src/pages/mes/productBackline/createProductBackline.vue

@ -48,7 +48,8 @@
<view>
<u-form-item label="加工人员" prop="operCode">
<view>
<u-input v-model="form.operCode" />
<!-- <u-input v-model="form.operCode" /> -->
<u-input v-model="form.operCode" type="select" @click="showWorker = true" placeholder="请选择人员"/>
</view>
</u-form-item>
</view>
@ -62,10 +63,15 @@
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
<u-select v-model="showBackProduct" :list="backProductList" @confirm="selectProduct"></u-select>
<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>
</template>
<script setup lang="ts">
import requestButton from '@/mycomponents/button/requestButton.vue'
// import requestButton from '@/mycomponents/button/requestButton.vue'
/*初始化*/
import {
onLoad,
@ -97,6 +103,8 @@
operCode:'',
name:'',
})
const showWorker = ref(false)
const workerList = ref([])
/*分页参数*/
const params = ref({
pageNo: 1,
@ -152,6 +160,12 @@
proxy.$modal.closeLoading()
})
}
function confirmSelectWorker(val){
console.log(val)
form.value.operCode = val[1].value
//
// handleBackline()
}
//
function transList(data) {
const backProductList = data.map(item => {
@ -172,6 +186,18 @@
form.value.stationCode = productItem.value.stationCode
}
function getPageChildren(){
productOfflineApi.getPageChildren(params.value).then((res) => {
console.log(res)
if (res.data) {
console.log(res.data)
workerList.value = res.data
} else {
}
}).catch(() => {
})
}
/*通用方法*/
onLoad((option) => {
if (option.obj) {
@ -188,6 +214,7 @@
onShow(() => {
getproductOfflinePage()
getPageChildren()
})
onReachBottom(() => {
})

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

@ -185,7 +185,7 @@
form.value.planCode = paramData.value.planMasterCode
form.value.processCode = paramData.value.workingNode
form.value.stationCode = paramData.value.currentWorkstation
form.value.productCode = paramData.value.currentWorkstation
form.value.productCode = paramData.value.productCode
}
})

10
src/pages/mes/productOffline/index.vue

@ -15,7 +15,7 @@
</view>
</view>
<view class="dec">
<view>登记状态</view>
<view>当前状态</view>
<view>
<u-tag text="待处理" type="warning" mode="light" shape="circle" v-if="item.status==1" :style="{ width: '62px' }" />
<u-tag text="已处理" type="success" mode="light" shape="circle" v-if="item.status==2" :style="{ width: '62px' }" />
@ -135,7 +135,13 @@
backlineItem.value.processCode = index.processCode
backlineItem.value.stationCode = index.stationCode
backlineItem.value.productCode = index.productCode
showWorker.value = true
// showWorker.value = true
const objString = JSON.stringify(index);
proxy.$tab.navigateTo(`/pages/mes/productBackline/createProductBackline?obj=${encodeURIComponent(objString)}`)
proxy.$modal.loading('加载中')
setTimeout(function() {
proxy.$modal.closeLoading();
}, 500);
}
// tabs
function tabsChange(curr){

4
src/pages/mes/workScheduling/inspectionItems.vue

@ -56,7 +56,7 @@
<u-button type="primary" size="default" style="background-color: #5599FF" @click="submit(number)">提交</u-button>
</view>
<view class="dec-item">
<!-- <view class="dec-item">
<view>质检模板号{{ quaifyFormNo}}</view>
</view>
<view class="dec-item">
@ -70,7 +70,7 @@
</view>
<view class="dec-item">
<view>质检模板号{{ equipmentRadioValue}}</view>
</view>
</view> -->
<view>
<u-popup v-model="show" mode="bottom" width="500rpx" height="200px" border-radius="20" mask-close-able="false">
<view><u-input v-model="reasons" placeholder="请输入未通过原因" /></view>

334
src/pages/mes/workScheduling/waitQuality.vue

@ -0,0 +1,334 @@
<template>
<!-- 详情 -->
<view class="detail-container">
<view class="info">
<view class="title">
<view>当前工序{{saveData.processCode}}</view>
</view>
<!-- 主数据 -->
<view class="dec">
<view class="dec-item">
<view>生产人员</view>
<view><u-input v-model="saveData.personSelectedItem" type="select" @click="showWorker = true" placeholder="请选择生产人员"/></view>
</view>
<view class="dec-item">
<view>质检人员</view>
<view><u-input v-model="saveData.checkPerson" type="text" placeholder="请输入质检人员"/></view>
</view>
<view class="dec-item">
<view>合格数量</view>
<view><u-input v-model="saveData.qualified" type="number" placeholder="请输入合格数量" /></view>
</view>
<view class="dec-item">
<view>不合格数量</view>
<view><u-input v-model="saveData.unqualified" type="number" placeholder="请输入不合格数量" /></view>
</view>
<view class="dec-item">
<view>不合格原因</view>
<view><u-input v-model="saveData.remark" type="text" placeholder="请输入原因" /></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 paramData = ref()
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 saveData = ref({
id:'0',
planDayCode:'',
processCode:'',
qualified:'',
unqualified:'',
personSelected:[],
personSelectedItem:'',
remark:"",
checkPerson:""
})
//
function submitData(){
proxy.$modal.loading('加载中')
console.log(saveData.value)
workSchedulingListApi.qualityByProcess(saveData.value).then((res) => {
proxy.$modal.closeLoading()
if (res.data) {
proxy.$modal.showToast('成功')
setTimeout(() => {
proxy.$tab.navigateBack()
}, 1000)
} else {
proxy.$modal.showToast('失败')
}
}).catch(() => {
proxy.$modal.closeLoading()
})
}
//
function confirmSelectWorker(val){
if(!saveData.value.personSelected.includes(val[0].value)){
saveData.value.personSelected.push(val[0].value)
if(saveData.value.personSelectedItem == ''){
saveData.value.personSelectedItem = val[0].label
}
else{
saveData.value.personSelectedItem = saveData.value.personSelectedItem + ',' + val[0].label
}
}
}
//
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.planNoDay
nodeInfo.value.processCode = paramData.value.nodeCode
saveData.value.processCode = paramData.value.nodeCode
saveData.value.planDayCode = paramData.value.planNoDay
}
})
onShow(() => {
getPageChildren()
})
//
function getPageChildren(){
workSchedulingListApi.getWorkerList(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>

384
src/pages/mes/workScheduling/waitReport.vue

@ -0,0 +1,384 @@
<template>
<!-- 详情 -->
<view class="detail-container">
<view class="info">
<view class="title">
<view>当前工序{{saveData.processCode}}</view>
</view>
<!-- 主数据 -->
<view class="dec">
<view class="dec-item">
<view>报工人员</view>
<view><u-input v-model="formData.reportPersonName" type="select" @click="showWorker = true" placeholder="请选择人员"/></view>
</view>
<view class="dec-item">
<view>报工数量</view>
<view><u-input v-model="formData.reportCount" type="number" @update:modelValue="calculatePass()" 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-switch v-model="formData.checkFlag" style="width:47px" @change="changeStatus()"></u-switch>
</view>
</view>
<view class="dec-item">
<view>合格数量</view>
<view><u-input :disabled="!formData.checkFlag" v-model="formData.qualified" type="number" placeholder="请输入合格数量" @update:modelValue="calculatePass()" /></view>
</view>
<view class="dec-item">
<view>不合格数量</view>
<view><u-input v-model="formData.unqualified" 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 paramData = ref()
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 reportPersonList = ref([])
const formData = ref({
checkFlag:false,
reportCount:'',
qualified:'',
unqualified:'',
reportPerson:'',
reportPersonName:'',
workTerm:''
})
const saveData = ref({
processCode:'',
reportDate:'',
schedulingCode:'',
list:[]
})
function changeStatus(){
if(formData.value.checkFlag){
}
else
{
formData.value.qualified = ''
formData.value.unqualified = ''
}
}
function calculatePass(){
if(formData.value.checkFlag){
formData.value.unqualified = formData.value.reportCount - formData.value.qualified
}
}
//
function submitData(){
handleData()
workSchedulingListApi.reportByProcess(saveData.value).then((res) => {
proxy.$modal.closeLoading()
if (res.code == 0) {
proxy.$modal.showToast('成功')
setTimeout(() => {
proxy.$tab.navigateBack()
}, 1500)
} else {
proxy.$modal.showToast('失败')
}
}).catch(() => {
proxy.$modal.closeLoading()
})
}
function handleData(){
saveData.value.list = []
reportPersonList.value.forEach(person => {
const save = {
checkFlag:formData.value.checkFlag,
reportCount:formData.value.reportCount,
qualified:formData.value.qualified,
unqualified:formData.value.unqualified,
reportPerson:person.reportPerson,
workTerm:formData.value.workTerm
}
saveData.value.list.push(save)
});
//
const currentDate = new Date();
const formattedDate = currentDate.toISOString().split('T')[0]; // YYYY-MM-DD
const formattedTime = currentDate.toTimeString().split(' ')[0]; // HH:mm:ss
// reportDate
saveData.value.reportDate = `${formattedDate} ${formattedTime}`;
console.log(saveData.value)
}
//
function confirmSelectWorker(val){
const data = {
reportPerson:val[0].value
}
const exists = reportPersonList.value.some(person => person.reportPerson === data.reportPerson);
if (!exists){
reportPersonList.value.push(data);
if(formData.value.reportPersonName == ''){
formData.value.reportPersonName = val[0].label
}else{
formData.value.reportPersonName = formData.value.reportPersonName + ","+ val[0].label
}
}
}
//
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.planNoDay
nodeInfo.value.processCode = paramData.value.nodeCode
saveData.value.processCode = paramData.value.nodeCode
saveData.value.schedulingCode = paramData.value.schedulingCode
}
})
onShow(() => {
getPageChildren()
})
//
function getPageChildren(){
workSchedulingListApi.getWorkerList(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>

496
src/pages/mes/workScheduling/workScheduling.vue

@ -5,29 +5,35 @@
<u-search :show-action="true" v-model="searchValue" action-text="搜索" input-align="left" height="65"
border-color=#5599FF @search="searchTable()">
</u-search>
<u-tabs :list="list1" :is-scroll="true" active-color="#5599FF" v-model="current" @change="tabsChange"></u-tabs>
<u-tabs :list="list1" :is-scroll="true" active-color="#5599FF" v-model="current"
@change="tabsChange"></u-tabs>
<!-- <u-subsection :animation="true" active-color="#5599FF" :list="list1" :current="current"
@change="tabsChange" :is-scroll="false">
</u-subsection> -->
</view>
<!-- 展示待领料数据 -->
<view v-if="current==4" class="item" v-for="(item, index) in list" :key="index" @click="openRequestDetail(item)">
<view v-if="current==4" class="item" v-for="(item, index) in list" :key="index"
@click="openRequestDetail(item)">
<view class="title">
<view class="title-txt">
<view>计划号{{ item.planDayCode }}</view>
</view>
</view>
<view class="dec">
<view>产品号</view><view>{{ item.productCode }}</view>
<view>产品号</view>
<view>{{ item.productCode }}</view>
</view>
<view class="dec">
<view>工序号</view><view>{{ item.processCode }}</view>
<view>工序号</view>
<view>{{ item.processCode }}</view>
</view>
<view class="dec">
<view>工位号</view><view>{{ item.workstationCode }}</view>
<view>工位号</view>
<view>{{ item.workstationCode }}</view>
</view>
<view class="dec">
<view>创建时间</view><view class="time">{{`${$time.formatDate(item.createTime)}`}}</view>
<view>创建时间</view>
<view class="time">{{`${$time.formatDate(item.createTime)}`}}</view>
</view>
<view>
<u-button type="success" size="mini" @click="receiveItem(item)" class="btn">领料</u-button>
@ -38,64 +44,108 @@
<view v-if="current!=4" class="item" v-for="(item, index) in list" :key="index">
<view class="dec">
<view>计划号</view><view>{{ item.planMasterCode }}</view>
<view>计划号</view>
<view>{{ item.planMasterCode }}</view>
</view>
<view class="dec">
<view>产品号</view><view>{{ item.productCode }}</view>
<view>产品号</view>
<view>{{ item.productCode }}</view>
</view>
<view class="dec">
<view>工序号</view><view>{{ item.workingNode }}</view>
<view>工序号</view>
<view>{{ item.workingNode }}</view>
</view>
<view class="dec">
<view>工位号</view><view>{{ item.currentWorkstation }}</view>
<view>工位号</view>
<view>{{ item.currentWorkstation }}</view>
</view>
<view class="dec">
<view>创建时间</view><view>{{`${$time.formatDate(item.createTime)}`}}</view>
<view>创建时间</view>
<view>{{`${$time.formatDate(item.createTime)}`}}</view>
</view>
<view class="dec">
<view>状态</view>
<view>
<u-tag text="异常" v-if="item.status==-3" bg-color='rgba(255,255,255,0)' color='#fe8463'
border-color='#fe8463' type="primary" shape='circle'/>
border-color='#fe8463' type="primary" shape='circle' />
<u-tag text="已终止" v-if="item.status==-2" bg-color='rgba(255,255,255,0)' color='#fe8463'
border-color='#fe8463' type="primary" shape='circle'/>
border-color='#fe8463' type="primary" shape='circle' />
<u-tag text="待齐套" v-if="item.status==-1" bg-color='rgba(255,255,255,0)' color='#fe8463'
border-color='#fe8463' type="primary" shape='circle'/>
border-color='#fe8463' type="primary" shape='circle' />
<u-tag text="待开工" v-if="item.status==0" bg-color='rgba(255,255,255,0)' color='#fe8463'
border-color='#fe8463' type="primary" shape='circle'/>
border-color='#fe8463' type="primary" shape='circle' />
<u-tag text="生产中" v-if="item.status==1" bg-color='rgba(255,255,255,0)' color='#fe8463'
border-color='#fe8463' type="primary" shape='circle'/>
border-color='#fe8463' type="primary" shape='circle' />
<u-tag text="待配料" v-if="item.status==2" bg-color='rgba(255,255,255,0)' color='#fe8463'
border-color='#fe8463' type="primary" shape='circle'/>
border-color='#fe8463' type="primary" shape='circle' />
<u-tag text="已暂停" v-if="item.status==3" bg-color='rgba(255,255,255,0)' color='#fe8463'
border-color='#fe8463' type="primary" shape='circle'/>
border-color='#fe8463' type="primary" shape='circle' />
<u-tag text="待报工" v-if="item.status==4" bg-color='rgba(255,255,255,0)' color='#fe8463'
border-color='#fe8463' type="primary" shape='circle'/>
border-color='#fe8463' type="primary" shape='circle' />
<u-tag text="待质检" v-if="item.status==5" bg-color='rgba(255,255,255,0)' color='#fe8463'
border-color='#fe8463' type="primary" shape='circle'/>
<u-tag text="已完" v-if="item.status==9" bg-color='rgba(255,255,255,0)' color='#fe8463'
border-color='#fe8463' type="primary" shape='circle'/>
border-color='#fe8463' type="primary" shape='circle' />
<u-tag text="已完" v-if="item.status==6" bg-color='rgba(255,255,255,0)' color='#fe8463'
border-color='#fe8463' type="primary" shape='circle' />
</view>
</view>
<!-- <view class="dec">
<view>当前工序</view><view>{{item.workingNode}}</view> <u-button type="success" size="mini" v-if="item.status==1" @click="nodeCodeFinish(item)" class="btn1" style="background-color:#3366FF">完成</u-button>
</view> -->
<view>
<u-collapse ref="collapse" open="false">
<u-collapse-item title="当前工序" >
<view class="content">
<text class="text">{{ item.workingNode }}</text>
<u-button type="success" size="mini" v-if="item.status==1" @click="nodeCodeFinish(item)" class="btn1" style="background-color:#3366FF">完成</u-button>
</view>
<u-collapse-item title="工序步骤">
<u-table>
<u-tr>
<u-th>步骤</u-th>
<u-th>编码</u-th>
<u-th v-if="item.status==1" >操作</u-th>
</u-tr>
<u-tr v-for="(detail, detailIndex) in item.detailDOList" :key="detailIndex"
class="text">
<u-td>{{ detailIndex + 1 }}</u-td>
<u-td>{{ detail.nodeCode }}</u-td>
<u-td v-if="detail.nodeCode==item.workingNode && item.status==1">
<u-button type="success" @click="nodeCodeFinish(detail)" class="tableBtn" >待完成</u-button>
</u-td>
<u-td v-if="detail.status==2 && item.status==1">
<u-button type="primary" @click="reportHandle(detail)" class="tableBtn" >待报工</u-button>
</u-td>
<u-td v-if="detail.status==4 && item.status==1">
<u-button type="primary" @click="waitCheck(detail)" class="tableBtn" >待质检</u-button>
</u-td>
<u-td v-if="detail.status==0 && item.status==1 && detail.nodeCode!=item.workingNode">
<u-button type="warning" class="tableBtn" >待执行</u-button>
</u-td>
<u-td v-if="detail.status==1 && item.status==1 ">
<u-button type="warning" class="tableBtn" >已完成</u-button>
</u-td>
<u-td v-if="detail.status==3 && item.status==1 ">
<u-button type="warning" class="tableBtn" >已报工</u-button>
</u-td>
</u-tr>
</u-table>
</u-collapse-item>
</u-collapse>
</view>
<view >
<u-button type="success" v-if="item.status==-1" size="mini" class="btn" @click="openInspectItem(item)">齐套检查</u-button>
<u-button type="success" v-if="item.status==0" size="mini" class="btn" @click="kaigong(item)">开工</u-button>
<u-button type="success" size="mini" @click="SOP(item)" class="btn" style="background-color:#888888">SOP</u-button>
<u-button type="success" size="mini" @click="openDetail(item)" class="btn" style="background-color:#888888">明细</u-button>
<u-button v-if="item.flagDo==0 && item.status==1" 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" @click="addBasicItem(item)" class="btn">补料</u-button>
<u-button v-if="(current==3||current==0) && item.status==1" type="warning" size="mini" @click="reportHandle(item)" class="btn" >报工</u-button>
<u-button v-if="(current==3||current==0) && item.status==1" type="success" size="mini" @click="finished(item)" class="btn" >完工</u-button>
<view>
<u-button type="success" v-if="item.status==-1" size="mini" class="btn"
@click="openInspectItem(item)">齐套检查</u-button>
<u-button type="success" v-if="item.status==0" size="mini" class="btn"
@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"
@click="callBasicItem(item)" class="btn">叫料</u-button>
<u-button v-if="item.flagDo==0 && item.status==1" type="error" size="mini"
@click="addBasicItem(item)" class="btn">补料</u-button>
<!-- <u-button v-if="(current==3||current==0) && item.status==1" type="success" size="mini"
@click="finished(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"
style="background-color:#888888"
@click="openOffLine(item)" class="btn">离线</u-button>
</view>
</view>
<view style="height: 94rpx;padding-top: 30rpx;">
@ -107,15 +157,14 @@
</template>
<script setup lang="ts">
import { onReachBottom, onShow } from "@dcloudio/uni-app"
import { getCurrentInstance, ref } from "vue"
import { onReachBottom, onShow } from "@dcloudio/uni-app"
import { getCurrentInstance, ref } from "vue"
import * as workSchedulingListApi from "@/api/mes/workScheduling/index.ts"
import * as workSchedulingApi from "@/api/mes/workScheduling"
import { _toast } from "@/utils/common"
import * as workSchedulingListApi from "@/api/mes/workScheduling/index.ts"
import * as workSchedulingApi from "@/api/mes/workScheduling"
import { _toast } from "@/utils/common"
const list1 = ref([
const list1 = ref([
{
name: "全部"
},
@ -134,43 +183,33 @@ const list1 = ref([
{
name: '已暂停',
},
{
name: '待报工',
},
{
name: '待质检',
},
{
name: '已完工',
},
{
name: '已完成',
},
{
name: '异常',
},
{
name: '已终止',
}
])
//
const {proxy} = getCurrentInstance()
const current = ref(0)
const status = ref('loadmore') //
const falg = ref('')
const list = ref([])
const searchValue = ref('')
const nodeCodes = ref([])
])
//
const { proxy } = getCurrentInstance()
const current = ref(0)
const status = ref('loadmore') //
const falg = ref('')
const list = ref([])
const searchValue = ref('')
const params = ref({
const params = ref({
pageNo: 1,
pageSize: 10,
status: '',
flag: null
})
})
async function getViewList() {
async function getViewList() {
if (status.value == 'nomore') return
status.value = 'loading'
proxy.$modal.loading('加载中')
@ -187,17 +226,17 @@ async function getViewList() {
proxy.$modal.closeLoading()
})
falg.value = 'view'
}
}
const tabParams = ref({
const tabParams = ref({
pageNo: 1,
pageSize: 10,
status: '',
flag: null,
flagDo:''
})
flagDo: ''
})
async function getTabsList() {
async function getTabsList() {
if (status.value == 'nomore') return
status.value = 'loading'
proxy.$modal.loading('加载中')
@ -214,10 +253,10 @@ async function getTabsList() {
proxy.$modal.closeLoading()
})
falg.value = 'tab'
}
}
//
function getRequestList() {
//
function getRequestList() {
if (status.value == 'nomore') return
status.value = 'loading'
proxy.$modal.loading('加载中')
@ -234,11 +273,21 @@ function getRequestList() {
proxy.$modal.closeLoading()
})
falg.value = 'request'
}
}
//线
function openOffLine(item) {
const objString = JSON.stringify(item);
proxy.$tab.navigateTo(`/pages/mes/productOffline/createProductOffline?obj=${encodeURIComponent(objString)}`)
setTimeout(function () {
proxy.$modal.closeLoading();
}, 500);
console.log(item)
}
//
onShow(() => {
//
onShow(() => {
falg.value == 'tab'
status.value = 'loading'
tabParams.value.flagDo = ''
@ -248,9 +297,9 @@ onShow(() => {
list.value = []
getTabsList()
})
//
onReachBottom(() => {
})
//
onReachBottom(() => {
if (falg.value == 'tab') {
status.value = 'loading'
getTabsList()
@ -260,19 +309,18 @@ onReachBottom(() => {
status.value = 'loading'
getViewList()
}
else{
else {
status.value = 'loading'
getRequestList()
}
})
})
//
function nodeCodeFinish(item){
proxy.$modal.confirm("是否确认完成工序").then(()=>{
//
function nodeCodeFinish(item) {
proxy.$modal.confirm("是否确认完成工序").then(() => {
proxy.$modal.loading('加载中')
workSchedulingListApi.getWorkSchedulingProcessFinished(item.remark).then((res) => {
proxy.$modal.showToast('成功')
console.log(res.data)
tabsChange(3);
proxy.$modal.closeLoading()
}).catch(() => {
@ -280,102 +328,106 @@ function nodeCodeFinish(item){
proxy.$modal.closeLoading()
})
})
}
}
//
function openRequestDetail(item, index) {
//
function openRequestDetail(item, index) {
proxy.$tab.navigateTo(`/pages/mes/workScheduling/requestDetail?obj=${JSON.stringify(item)}`)
}
}
//
function openDetail(item, index) {
//
function openDetail(item, index) {
proxy.$tab.navigateTo(`/pages/mes/workScheduling/workSchedulingDetail?obj=${JSON.stringify(item)}`)
}
}
//Bom
function openBomInspect(item, index) {
//Bom
function openBomInspect(item, index) {
proxy.$tab.navigateTo(`/pages/mes/workScheduling/bomInspect?planNoDay=${item.planNoDay}`)
}
}
//
function openInspectItem(item, index) {
//
function openInspectItem(item, index) {
const objString = JSON.stringify(item);
proxy.$tab.navigateTo(`/pages/mes/workScheduling/inspectionItems?obj=${objString}`)
}
}
//
function kaigong(item){
proxy.$modal.confirm("是否确认提交").then(()=>{
//
function kaigong(item) {
proxy.$modal.confirm("是否确认提交").then(() => {
proxy.$modal.loading('加载中')
item.status = '1'
const objString = JSON.stringify(item);
workSchedulingListApi.updateWorkScheduling(objString).then((res) => {
proxy.$modal.showToast('成功')
tabsChange(2);
loading.value = false
proxy.$modal.closeLoading()
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
})
}
}
//
function tabsChange(index) {
tabParams.value.flagDo = ''
current.value = index
tabParams.value.pageNo = 1
if (index == '0') {
tabParams.value.status = ''
}else if(index == '1'){
tabParams.value.status = '-1'
}else if(index == '2'){
tabParams.value.status = '0'
}else if(index == '3'){
tabParams.value.status = '1'
}else if(index == '4'){
list.value = []
status.value = 'loading'
tabParams.value.status = '0'
tabParams.value.flagDo = '1'
getRequestList()
return
}else if(index == '5'){
tabParams.value.status = '3'
}else if(index == '6'){
tabParams.value.status = '4'
}else if(index == '7'){
tabParams.value.status = '5'
}else if(index == '8'){
tabParams.value.status = '6'
}else if(index == '9'){
tabParams.value.status = '9'
}else if(index == '10'){
tabParams.value.status = '-3'
}else if(index == '11'){
tabParams.value.status = '-2'
} else {
tabParams.value.status = index
//
function tabsChange(index) {
tabParams.value.flagDo = '';
current.value = index;
tabParams.value.pageNo = 1;
switch (index) {
case 0:
tabParams.value.status = '';
break;
case 1:
tabParams.value.status = '-1';
break;
case 2:
tabParams.value.status = '0';
break;
case 3:
tabParams.value.status = '1';
break;
case 4:
list.value = [];
status.value = 'loading';
tabParams.value.status = '0';
tabParams.value.flagDo = '1';
getRequestList();
return;
case 5:
tabParams.value.status = '3';
break;
case 6:
tabParams.value.status = '6';
break;
case 7:
tabParams.value.status = '9';
break;
case 8:
tabParams.value.status = '-2';
break;
default:
tabParams.value.status = index;
break;
}
list.value = [];
status.value = 'loading';
getTabsList();
}
list.value = []
status.value = 'loading'
getTabsList()
}
const searchTableParams = ref({
const searchTableParams = ref({
planNoDay: '',
flag: null
})
})
const nodeInfo = ref({
planDayCode:'PO20240430-0011',
processCode:'QD_CY_01'
})
const nodeInfo = ref({
planDayCode: 'PO20240430-0011',
processCode: 'QD_CY_01'
})
async function searchTable() {
async function searchTable() {
list.value = []
searchTableParams.value.planNoDay = this.searchValue
await workSchedulingListApi.getWorkSchedulingPDAPage(searchTableParams.value).then((res) => {
@ -383,30 +435,32 @@ async function searchTable() {
list.value = list.value.concat(res.data.list)
}
})
}
}
// ->
function finished(item) {
function finished(item) {
console.log(item)
nodeInfo.value.planDayCode = item.planMasterCode
nodeInfo.value.processCode = item.workingNode
workSchedulingListApi.getNodePosition(nodeInfo.value).then((res) => {
proxy.$modal.closeLoading()
console.log(res.data)
if (res.data != null && res.data=="end") {
if (res.data != null && res.data == "end") {
proxy.$modal.confirm('确定提交完工吗?').then(() => {
submitFinish(item)
})
} else {
proxy.$modal.confirm('当前不是最后工序,是否强制完工').then(() => {
submitFinish(item)
})
_toast("当前不是最后工序,不允许完工")
// proxy.$modal.loading("")
// setTimeout(() => {
// proxy.$modal.closeLoading()
// }, 1000)
}
}).catch(() => {
proxy.$modal.closeLoading()
})
}
// ->
function submitFinish(item){
}
// ->
function submitFinish(item) {
proxy.$modal.confirm('确定提交完工吗?').then(() => {
workSchedulingListApi.completeHandle(item).then((res) => {
proxy.$modal.closeLoading()
if (res.code == 0) {
@ -415,45 +469,49 @@ function submitFinish(item){
status.value = 'loadmore'
tabParams.value.pageNo = 1
getTabsList()
} else {
proxy.$modal.showToast('失败')
}
}).catch(() => {
proxy.$modal.closeLoading()
})
}
async function reportHandle(item) {
proxy.$modal.loading("加载中")
await workSchedulingApi.getConfigProcessWorker({
planDayCode: item.planMasterCode,
processCode: item.workingNode,
schedulingCode: item.schedulingCode
}).then((res) => {
uni.setStorageSync("isLeader", res.data.leader)
if (res.data.persons.length == 0) {
_toast("没有可以报工项")
return
}
uni.setStorageSync("processReportList", res.data.persons)
uni.redirectTo({
url: res.data.leader ? "/pages/mes/workScheduling/processReportPeopleCheck" : "/pages/mes/workScheduling/processReportForm"
})
}).finally(() => {
proxy.$modal.closeLoading()
})
}
//
function callBasicItem(item) {
}
//
function reportHandle(detail) {
proxy.$tab.navigateTo(`/pages/mes/workScheduling/waitReport?obj=${JSON.stringify(detail)}`)
// proxy.$modal.loading("")
// await workSchedulingApi.getConfigProcessWorker({
// planDayCode: item.planMasterCode,
// processCode: item.workingNode,
// schedulingCode: item.schedulingCode
// }).then((res) => {
// uni.setStorageSync("isLeader", res.data.leader)
// if (res.data.persons.length == 0) {
// _toast("")
// return
// }
// uni.setStorageSync("processReportList", res.data.persons)
// uni.redirectTo({
// url: res.data.leader ? "/pages/mes/workScheduling/processReportPeopleCheck" : "/pages/mes/workScheduling/processReportForm"
// })
// }).finally(() => {
// proxy.$modal.closeLoading()
// })
}
//
function waitCheck(item){
console.log(item)
proxy.$tab.navigateTo(`/pages/mes/workScheduling/waitQuality?obj=${JSON.stringify(item)}`)
}
//
function callBasicItem(item) {
proxy.$tab.navigateTo(`/pages/mes/workScheduling/callMaterial?obj=${JSON.stringify(item)}`)
}
}
//
function receiveItem(item){
console.log(item)
//
function receiveItem(item) {
proxy.$modal.confirm('确定提交吗').then(() => {
proxy.$modal.loading('处理中')
workSchedulingListApi.receiveBasicItem(item).then((res) => {
@ -473,16 +531,16 @@ function receiveItem(item){
proxy.$modal.closeLoading()
})
}
}
//
function addBasicItem(item){
//
function addBasicItem(item) {
const objString = JSON.stringify(item);
proxy.$tab.navigateTo(`/pages/mes/workScheduling/addBasicItem/index?obj=${encodeURIComponent(objString)}`)
}
}
//SOP
function SOP(item){
//SOP
function SOP(item) {
workSchedulingListApi.getWorkSchedulingPDF(JSON.stringify(item.planMasterCode)).then((res) => {
//
}).catch(() => {
@ -490,11 +548,11 @@ function SOP(item){
})
//#ifndef H5
console.log('H5:'+item.planMasterCode)
console.log('H5:' + item.planMasterCode)
//#endif
//#ifndef APP-PLUS
console.log('APP-PLUS:'+item.planMasterCode)
console.log('APP-PLUS:' + item.planMasterCode)
uni.downloadFile({
url: 'http://dev.ccwin-in.com:25310/admin-api/infra/file/0/show/4488ed218c1365755c97c18fcf576cf281eff8c81d052ea289b3ceea1eaf89d7.pdf',
// url: 'http://storage.xuetangx.com/public_assets/xuetangx/PDF/PlayerAPI_v1.0.6.pdf',
@ -511,27 +569,30 @@ function SOP(item){
}
});
//#endif
}
}
</script>
<style lang="scss" scoped>
.container{
.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;
@ -540,19 +601,24 @@ function SOP(item){
flex: 1;
word-wrap: break-word;
}
.time {
color: #919191;
}
}
.dec {
padding-bottom: 20rpx;
display: flex;
align-items: center;
view {
&:nth-child(1){
width: 200rpx;;
&:nth-child(1) {
width: 200rpx;
;
}
&:nth-child(2){
&:nth-child(2) {
color: #999999;
flex: 1;
width: 0px;
@ -560,9 +626,11 @@ function SOP(item){
}
}
}
.last {
padding-bottom: 30rpx;
}
.bottom {
display: flex;
justify-content: space-between;
@ -573,18 +641,24 @@ function SOP(item){
}
}
}
.btn{
.btn {
margin-left: 8px;
width: 65px;
height:35px;
width: 55px;
height: 35px;
font-size: 17px
}
.btn1{
.btn1 {
margin-left: 8px;
width: 35px;
height:20px;
height: 20px;
font-size: 10px
}
.tableBtn {
margin-left: 8px;
width: 35px;
height: 25px;
font-size: 12px
}
</style>
Loading…
Cancel
Save