Browse Source

Merge remote-tracking branch 'origin/master'

master
gaojs 4 months ago
parent
commit
522bee0215
  1. 15
      src/api/mes/workScheduling/index.ts
  2. 14
      src/pages.json
  3. 10
      src/pages/mes/orderDayPlan/orderDayPlan.vue
  4. 359
      src/pages/mes/workScheduling/completeHandle.vue
  5. 183
      src/pages/mes/workScheduling/requestDetail.vue
  6. 182
      src/pages/mes/workScheduling/workScheduling.vue

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

@ -113,3 +113,18 @@ export function addBasicItem(data) {
return http.post('/mes/', data)
}
export function getRequestMainList(params) {
return http.get('/mes/item-request-main/page', {params})
}
// 完工查询是否最后节点
export function getNodePosition(params) {
return http.get('/mes/workScheduling/getNodePosition', {params})
}
// 完工查询人员
export function getCurrentWorkerList(params) {
return http.get('/mes/workScheduling/getCurrentWorkerList', {params})
}
export function getRequestMainDetail(params) {
return http.get('/mes/item-request-detail/page', {params})
}

14
src/pages.json

@ -2058,6 +2058,20 @@
"navigationBarTitleText": "补料申请",
"enablePullDownRefresh": true
}
},
{
"path": "pages/mes/workScheduling/completeHandle",
"style": {
"navigationBarTitleText": "完工处理",
"enablePullDownRefresh": true
}
},
{
"path": "pages/mes/workScheduling/requestDetail",
"style": {
"navigationBarTitleText": "配料详情",
"enablePullDownRefresh": true
}
}

10
src/pages/mes/orderDayPlan/orderDayPlan.vue

@ -12,17 +12,21 @@
<view class="item" v-for="(item, index) in list" :key="index" @click="openDetail(item)">
<view class="title">
<view class="title-txt">
{{item.planNoDay}}
计划号{{item.planNoDay}}
</view>
</view>
<view class="dec">
<view>创建时间</view>
<view class="time">
{{`${$time.formatDate(item.createTime)}`}}
</view>
</view>
<view class="dec">
<view>日计划单号</view><view>{{ item.planNoDay }}</view>
<view>生产批次</view><view>{{ item.batchCode }}</view>
</view>
<view class="dec">
<view>产品批次</view><view>{{ item.batchCode }}</view>
<view>产品码</view><view>{{ item.productCode }}</view>
</view>
<view class="dec">
<view>状态</view>

359
src/pages/mes/workScheduling/completeHandle.vue

@ -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>

183
src/pages/mes/workScheduling/requestDetail.vue

@ -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>

182
src/pages/mes/workScheduling/workScheduling.vue

@ -10,18 +10,44 @@
@change="tabsChange" :is-scroll="false">
</u-subsection> -->
</view>
<view class="item" v-for="(item, index) in list" :key="index">
<!-- 展示待领料数据 -->
<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 class="dec">
<view>工序号</view><view>{{ item.processCode }}</view>
</view>
<view class="dec">
<view>工位号</view><view>{{ item.workstationCode }}</view>
</view>
<view class="dec">
<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>
</view>
</view>
<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.schedulingCode }}</view>
<view>产品</view><view>{{ item.productCode }}</view>
</view>
<view class="dec">
<view>产品编号</view><view>{{ item.productCode }}</view>
<view>工序</view><view>{{ item.workingNode }}</view>
</view>
<view class="dec">
<view>产品名称</view><view>{{ item.productName }}</view>
<view>工位号</view><view>{{ item.currentWorkstation }}</view>
</view>
<view class="dec">
<view>创建时间</view><view>{{`${$time.formatDate(item.createTime)}`}}</view>
@ -66,11 +92,10 @@
<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 type="success" v-if="item.status==1" size="mini" @click="callBasicItem(item)" class="btn">叫料</u-button>
<u-button type="primary" v-if="item.status==1" size="mini" @click="receiveBasicItem(item)" class="btn">领料</u-button>
<u-button type="warning" v-if="item.status==1" size="mini" @click="addBasicItem(item)" class="btn">补料</u-button>
<u-button type="success" v-if="item.status==1" size="mini" @click="reportHandle(item)" class="btn" style="background-color: burlywood">报工</u-button>
<u-button type="success" v-if="item.status==1" size="mini" @click="completeHandle(item)" class="btn" style="background-color:chocolate">完工</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>
</view>
<view style="height: 94rpx;padding-top: 30rpx;">
@ -168,7 +193,8 @@ const tabParams = ref({
pageNo: 1,
pageSize: 10,
status: '',
flag: null
flag: null,
flagDo:''
})
async function getTabsList() {
@ -190,9 +216,33 @@ async function getTabsList() {
falg.value = 'tab'
}
//
function getRequestList() {
if (status.value == 'nomore') return
status.value = 'loading'
proxy.$modal.loading('加载中')
workSchedulingListApi.getRequestMainList(tabParams.value).then((res) => {
proxy.$modal.closeLoading()
if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list)
tabParams.value.pageNo++
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
}).catch(() => {
proxy.$modal.closeLoading()
})
falg.value = 'request'
}
//
onShow(() => {
falg.value == 'tab'
status.value = 'loading'
tabParams.value.flagDo = ''
current.value = 0
tabParams.value.pageNo = 1
tabParams.value.status = ''
list.value = []
@ -210,21 +260,12 @@ onReachBottom(() => {
status.value = 'loading'
getViewList()
}
else{
status.value = 'loading'
getRequestList()
}
})
//
// function getNodeCodes(item){
// console.log(item.schedulingCode)
// workSchedulingListApi.getWorkSchedulingDetail(item.schedulingCode).then((res) => {
// console.log(res.data);
// nodeCodes.value = []
// nodeCodes.value = res.data
// console.log(nodeCodes.value);
// }).catch(() => {
// })
// }
//
function nodeCodeFinish(item){
console.log(item.remark)
@ -240,6 +281,12 @@ function nodeCodeFinish(item){
})
}
//
function openRequestDetail(item, index) {
proxy.$tab.navigateTo(`/pages/mes/workScheduling/requestDetail?obj=${JSON.stringify(item)}`)
}
//
function openDetail(item, index) {
proxy.$tab.navigateTo(`/pages/mes/workScheduling/workSchedulingDetail?obj=${JSON.stringify(item)}`)
@ -277,6 +324,7 @@ function kaigong(item){
//
function tabsChange(index) {
tabParams.value.flagDo = ''
current.value = index
tabParams.value.pageNo = 1
if (index == '0') {
@ -288,7 +336,12 @@ function tabsChange(index) {
}else if(index == '3'){
tabParams.value.status = '1'
}else if(index == '4'){
tabParams.value.status = '2'
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'){
@ -316,6 +369,11 @@ const searchTableParams = ref({
flag: null
})
const nodeInfo = ref({
planDayCode:'PO20240430-0011',
processCode:'QD_CY_01'
})
async function searchTable() {
list.value = []
searchTableParams.value.planNoDay = this.searchValue
@ -325,24 +383,43 @@ async function searchTable() {
}
})
}
//
function completeHandle(item) {
console.log(item)
proxy.$modal.loading("点击了完工按钮")
setTimeout(() => {
// ->
function finished(item) {
nodeInfo.value.planDayCode = item.planMasterCode
nodeInfo.value.processCode = item.workingNode
workSchedulingListApi.getNodePosition(nodeInfo.value).then((res) => {
proxy.$modal.closeLoading()
}, 1000)
// proxy.$modal.loading('')
// workSchedulingListApi.completeHandle(completedParams.value).then((res) => {
// proxy.$modal.closeLoading()
// if (res.data) {
// } else {
console.log(res.data)
if (res.data != null && res.data=="end") {
proxy.$modal.confirm('确定提交完工吗?').then(() => {
submitFinish(item)
// }
// }).catch(() => {
// proxy.$modal.closeLoading()
// })
})
} else {
proxy.$modal.confirm('当前不是最后工序,是否强制完工').then(() => {
submitFinish(item)
})
}
}).catch(() => {
proxy.$modal.closeLoading()
})
}
// ->
function submitFinish(item){
workSchedulingListApi.completeHandle(item).then((res) => {
proxy.$modal.closeLoading()
if (res.data) {
proxy.$modal.showToast('成功')
list.value = []
status.value = 'loadmore'
tabParams.value.pageNo = 1
getTabsList()
} else {
proxy.$modal.showToast('失败')
}
}).catch(() => {
proxy.$modal.closeLoading()
})
}
async function reportHandle(item) {
@ -373,14 +450,35 @@ function callBasicItem(item) {
}
//
function receiveBasicItem(item) {
function receiveItem(item){
console.log(item)
proxy.$modal.confirm('确定提交吗').then(() => {
proxy.$modal.loading('处理中')
workSchedulingListApi.receiveBasicItem(item).then((res) => {
proxy.$modal.closeLoading()
if (res.data) {
list.value = []
status.value = 'loadmore'
tabParams.value.status = '0'
tabParams.value.flagDo = '1'
getRequestList()
} else {
}
}).catch(() => {
proxy.$modal.closeLoading()
})
proxy.$modal.closeLoading()
})
}
//
function addBasicItem(item){
const objString = JSON.stringify(item);
proxy.$tab.navigateTo(`/pages/mes/workScheduling/addBasicItem/index?obj=${encodeURIComponent(objString)}`)
}
//SOP
function SOP(item){
workSchedulingListApi.getWorkSchedulingPDF(JSON.stringify(item.planMasterCode)).then((res) => {

Loading…
Cancel
Save