Browse Source

Mes 齐套检查更新

master
gaojs 7 months ago
parent
commit
2c1ce209af
  1. 100
      src/api/mes/orderDay/index.ts
  2. 58
      src/api/mes/workScheduling/index.ts
  3. 30
      src/pages.json
  4. 71
      src/pages/mes/orderDayPlan/detail.vue
  5. 23
      src/pages/mes/orderDayPlan/orderDayPlan.vue
  6. 149
      src/pages/mes/workScheduling/bomInspect.vue
  7. 301
      src/pages/mes/workScheduling/detail.vue
  8. 149
      src/pages/mes/workScheduling/equipmentInspect.vue
  9. 405
      src/pages/mes/workScheduling/inspectionItems.vue
  10. 311
      src/pages/mes/workScheduling/workScheduling.vue
  11. 148
      src/pages/mes/workScheduling/workerInspect.vue

100
src/api/mes/orderDay/index.ts

@ -20,6 +20,14 @@ export interface OrderDayVO {
taskMode: string
}
export function getCompleteInspectionMark(paramCode) {
return http.get('/mes/complete-inspect/get?paramCode=' + paramCode)
}
export function getQualityformInfo(fromNo) {
return http.get('/mes/qualityform/getQualityform?fromNo=' + fromNo)
}
export function getOrderDayPage(params) {
return http.get('/mes/orderday/page', {params})
}
@ -29,88 +37,14 @@ export function getOrderDayPlanDetail(number) {
return http.get('/mes/orderday/get?id=' + number)
}
// 查询生产日计划列表
// export const getOrderDayPage = async (params) => {
// if (params.isSearch) {
// delete params.isSearch
// const data = {...params}
// return await request.post({ url: '/mes/orderday/senior', data })
// } else {
// return await request.get({ url: `/mes/orderday/page`, params })
// }
// }
// // 查询生产日计划详情
// export const getOrderDay = async (id: number) => {
// return await request.get({ url: `/mes/orderday/get?id=` + id })
// }
// // 新增生产日计划
// export const createOrderDay = async (data: OrderDayVO) => {
// return await request.post({ url: `/mes/orderday/create`, data })
// }
// // 修改生产日计划
// export const updateOrderDay = async (data: OrderDayVO) => {
// return await request.put({ url: `/mes/orderday/update`, data })
// }
// // 删除生产日计划
// export const deleteOrderDay = async (id: number) => {
// return await request.delete({ url: `/mes/orderday/delete?id=` + id })
// }
// // 导出生产日计划 Excel
// export const exportOrderDay = async (params) => {
// return await request.download({ url: `/mes/orderday/export-excel`, params })
// }
// // 下载用户导入模板
// export const importTemplate = () => {
// return request.download({ url: '/mes/orderday/get-import-template' })
// }
// // 根据产品编码获取Bom
// export const getBoms = async (code: String) => {
// return request.get({ url: '/mes/common/geBomByProductCode?code='+code })
// }
// // 根据产品编码获取工艺路线
// export const getProcessroutes = async (code: String) => {
// return request.get({ url: '/mes/common/getProcessRouteByProductCode?code='+code })
// }
// // 根据车间编码获取产线列表
// export const getProductlines = async (code: String) => {
// return request.get({ url: '/mes/common/getLinesByWorkRoomCode?code='+code })
// }
// // 获取产线信息
// export const getProductlineInfo = async (code: String) => {
// return request.get({ url: '/mes/common/getLinesByWorkRoomCode?code='+code })
// }
// // 根据工艺路线的工序信息
// export const getProcessroutesDetail = async (code) => {
// return await request.get({ url: `/mes/orderday/getProcessInfo?code=`+ code })
// }
// // 根据获取计划BOM信息
// export const getPlanBom = async (params) => {
// return await request.get({ url: `/mes/orderday/getBomInfo`,params })
// }
export function getBomInfo(params) {
return http.post('/mes/complete-inspect/get-orderDay-bom', params)
}
// // 根据获取计划BOM信息
// export const getBomInfoTree = async (params) => {
// return await request.get({ url: `/mes/orderday/getBomInfoTree`,params })
// }
// // 根据计划的车间、产线、计划时间 查询已经配置的人员
// export const getPlanWorks = async (params) => {
// return await request.get({ url: `/mes/orderday/getWorkGroup`,params })
// }
// // 根据车间、产线 查询已配置的设备
// export const getPlanDevices = async (params) => {
// return await request.get({ url: `/mes/orderday/getDeviceInfo`,params })
// }
export function getBomInfoList(params) {
return http.post('/mes/complete-inspect/get-orderDay-bom-page', params)
}
// ///发布计划
// export const publishPlan = async (data: OrderDayVO) => {
// return await request.post({ url: `/mes/orderday/publishPlan`,data })
// }
// //终止计划
// export const stopPlan = async (params) => {
// return await request.post({ url: `/mes/orderday/stopPlan`,params })
// }
export function updateBomInfo(params) {
return http.post('/mes/complete-inspect/update', params)
}

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

@ -0,0 +1,58 @@
import http from '../../http'
export interface OrderDayVO {
status: string
remark: string
planNoMonth: string
planNoDay: string
productCode: string
workroomCode: string
lineCode: string
planCount: number
processrouteCode: string
tempProcessroute: string
standardBom: string
tempBom: string
workMode: string
planDate: Date
startTime: Date
endTime: Date
taskMode: string
}
export function getCompleteInspectionMark(paramCode) {
return http.get('/mes/complete-inspect/get?paramCode=' + paramCode)
}
export function getQualityformInfo(fromNo) {
return http.get('/mes/qualityform/getQualityform?fromNo=' + fromNo)
}
export function getWorkSchedulingPage(params) {
return http.get('/mes/work-scheduling/page', {params})
}
export function getWorkSchedulingDetail(number) {
//return http.get('/eam/item-apply-request-main/appGetByNumber?number=' + number)
return http.get('/mes/work-scheduling/get?id=' + number)
}
export function getBomInfo(params) {
return http.post('/mes/complete-inspect/get-orderDay-bom', params)
}
export function getBomInfoList(params) {
return http.post('/mes/complete-inspect/get-orderDay-bom-page', params)
}
export function getWorkerInfoList(params) {
return http.post('/mes/complete-inspect/get-orderDay-worker-page', params)
}
export function getEquipmentInfoList(params) {
return http.post('/mes/complete-inspect/get-orderDay-equipment-page', params)
}
export function updateWorkSchedulingInfo(params) {
return http.post('/mes/complete-inspect/update', params)
}

30
src/pages.json

@ -1907,6 +1907,36 @@
"navigationBarTitleText": "日计划查询明细",
"enablePullDownRefresh": true
}
},{
"path": "pages/mes/workScheduling/workScheduling",
"style": {
"navigationBarTitleText": "生产任务查询明细",
"enablePullDownRefresh": true
}
},{
"path": "pages/mes/workScheduling/bomInspect",
"style": {
"navigationBarTitleText": "齐套检查——Bom",
"enablePullDownRefresh": true
}
},{
"path": "pages/mes/workScheduling/equipmentInspect",
"style": {
"navigationBarTitleText": "齐套检查——设备",
"enablePullDownRefresh": true
}
},{
"path": "pages/mes/workScheduling/workerInspect",
"style": {
"navigationBarTitleText": "齐套检查——人员",
"enablePullDownRefresh": true
}
},{
"path": "pages/mes/workScheduling/inspectionItems",
"style": {
"navigationBarTitleText": "齐套检查——检查项",
"enablePullDownRefresh": true
}
},{
"path": "pages/mes/workOrder/processReport",
"style": {

71
src/pages/mes/orderDayPlan/detail.vue

@ -66,23 +66,10 @@
<view>结束时间</view>
<view>{{ `${$time.formatDate(data.endTime)}` }}</view>
</view>
<view class="items" v-for="(cur,key) in data.subList" :key="key" style="margin-bottom: 20rpx;">
<view class="items-name">
备件名称{{ cur.itemName }}
</view>
<view class="items-dec" v-if="cur.type">
类型{{ cur.type == 'type' ? '设备' : '模具' }}
</view>
<view class="items-dec" v-if="cur.name">
{{ cur.type == 'type' ? '设备' : '模具' }}名称{{ cur.name }}
</view>
<view class="items-dec">
是否以旧换新{{ cur.isRadeIn == 'TRUE' ? '是' : '否' }}
</view>
<view class="items-dec">
数量{{ cur.qty }}
</view>
</view>
<view class="dec-item">
<view>齐套检查-Bom</view>
<view>{{ data.bomInspect }}</view>
</view>
</view>
</view>
<view class="footer" v-if="from == 3">
@ -122,54 +109,6 @@ function getSparePartsApplicationDetail() {
})
}
//
function agree() {
proxy.$modal.confirm('确定通过申请吗').then(() => {
proxy.$modal.loading('加载中')
loading.value = true
sparePartsApplicationApproveApi.sparePartsApplicationAgree(data.value.id).then((res) => {
proxy.$modal.closeLoading()
if (res.data) {
proxy.$modal.showToast('审核成功')
setTimeout(() => {
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast('审核失败')
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
})
}
//
function reject(item) {
proxy.$modal.confirm('确定驳回申请吗?').then(() => {
proxy.$modal.loading('加载中')
loading.value = true
sparePartsApplicationApproveApi.sparePartsApplicationReject(item.id).then(async (res) => {
if (res.data) {
proxy.$modal.showToast('已驳回')
setTimeout(() => {
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast('审核失败')
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
})
}
onLoad((option) => {
if (option.type) type.value = option.type
@ -230,7 +169,7 @@ onShow(() => {
view {
&:nth-child(1) {
width: 200rpx;
width: 240rpx;
}
&:nth-child(2) {

23
src/pages/mes/orderDayPlan/orderDayPlan.vue

@ -3,9 +3,9 @@
<view class="list">
<view>
<u-search :show-action="true" v-model="searchValue" action-text="搜索" input-align="left" height="65"
border-color=#ff9900 @search="searchTable()">
border-color=#5599FF @search="searchTable()">
</u-search>
<u-subsection :animation="true" active-color="#ff9900" ref="tabs1" :list="list1" :current="current"
<u-subsection :animation="true" active-color="#5599FF" ref="tabs1" :list="list1" :current="current"
@change="tabsChange" :is-scroll="false">
</u-subsection>
</view>
@ -27,6 +27,8 @@
<view class="dec">
<view>状态</view>
<view>
<u-tag text="待齐套" v-if="item.status==-1" bg-color='rgba(255,255,255,0)' color='#fe8463'
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'/>
<u-tag text="已发布" v-if="item.status==2" bg-color='rgba(255,255,255,0)' color='#fe8463'
@ -37,6 +39,9 @@
border-color='#fe8463' type="primary" shape='circle'/>
</view>
</view>
<!-- <view v-if="item.status==-1" >
<u-button type="primary" @click="openInspectItem(item)">齐套检查</u-button>
</view> -->
</view>
<view style="height: 94rpx;padding-top: 30rpx;">
<u-loadmore :status="status" v-if="status != 'loadmore'" />
@ -142,7 +147,6 @@ async function getTabsList() {
//
onShow(() => {
console.log(searchValue.value)
tabParams.value.pageNo = 1
tabParams.value.status = ''
list.value = []
@ -167,9 +171,18 @@ function openDetail(item, index) {
proxy.$tab.navigateTo(`/pages/mes/orderDayPlan/detail?id=${item.id}`)
}
//Bom
function openBomInspect(item, index) {
proxy.$tab.navigateTo(`/pages/mes/orderDayPlan/bomInspect?planNoDay=${item.planNoDay}`)
}
function openInspectItem(item, index) {
const objString = JSON.stringify(item);
proxy.$tab.navigateTo(`/pages/mes/orderDayPlan/inspectionItems?obj=${objString}`)
}
//
function tabsChange(index) {
console.log(index)
current.value = index
tabParams.value.pageNo = 1
if (index == '0') {
@ -189,9 +202,7 @@ const searchTableParams = ref({
async function searchTable() {
list.value = []
console.log(this.searchValue)
searchTableParams.value.planNoDay = this.searchValue
console.log(searchTableParams.value)
await orderDayPlanListApi.getOrderDayPage(searchTableParams.value).then((res) => {
if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list)

149
src/pages/mes/workScheduling/bomInspect.vue

@ -0,0 +1,149 @@
<template>
<view class="container">
<view class="list">
<view class="item" v-for="(item, index) in list" :key="index" >
<view class="dec">
<view>日计划编码</view><view>{{ item.planDayCode }}</view>
</view>
<view class="dec">
<view>工序编码</view><view>{{ item.processCode }}</view>
</view>
<view class="dec">
<view>物料号</view><view>{{ item.repMaterialCode }}</view>
</view>
<view class="dec">
<view>数量</view><view>{{ item.totalMaterialCounts }}</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 orderDayPlanListApi from '@/api/mes/orderDay/index.ts'
const {proxy} = getCurrentInstance()
const loading = ref(false)
const status = ref('loadmore') //
const type = ref()
const list = ref([])
const params = ref({
pageNo: 1,
pageSize: 10,
planMaserCode: ''
})
function getBomInspectList() {
console.log(status.value)
if (status.value == 'nomore') return
status.value = 'loading'
proxy.$modal.loading('加载中')
orderDayPlanListApi.getBomInfoList(params.value).then((res) => {
proxy.$modal.closeLoading()
console.log(params.value.pageNo)
console.log(res.data.list.length)
if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list)
params.value.pageNo++
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
}).catch(() => {
proxy.$modal.closeLoading()
})
}
//
onReachBottom(() => {
status.value = 'loadmore'
getBomInspectList()
})
onLoad((option) => {
if (option.planMaserCode) {
params.value.planMaserCode = option.planMaserCode
}
})
onShow(() => {
getBomInspectList()
})
</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: 200rpx;;
}
&: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;
}
}
}
</style>

301
src/pages/mes/workScheduling/detail.vue

@ -0,0 +1,301 @@
<template>
<!-- 详情 -->
<view class="detail-container">
<view class="info">
<view class="title">
<view>日计划明细</view>
</view>
<view class="dec">
<view class="dec-item">
<view>日计划单号</view>
<view>{{ data.planNoDay }}</view>
</view>
<view class="dec-item">
<view>产品批次码</view>
<view>{{ data.batchCode }}</view>
</view>
<view class="dec-item">
<view>月计划单号</view>
<view>{{ data.planNoMonth }}</view>
</view>
<view class="dec-item">
<view>状态</view>
<view>{{ data.status }}</view>
</view>
<view class="dec-item">
<view>产品编号</view>
<view>{{ data.productCode }}</view>
</view>
<view class="dec-item">
<view>车间编码</view>
<view>{{ data.workroomCode }}</view>
</view>
<view class="dec-item">
<view>产线编码</view>
<view>{{ data.lineCode }}</view>
</view>
<view class="dec-item">
<view>计划数量</view>
<view>{{ data.planCount }}</view>
</view>
<view class="dec-item">
<view>工艺路线编码</view>
<view>{{ data.processrouteCode }}</view>
</view>
<view class="dec-item">
<view>允许临时工艺</view>
<view>{{ data.tempProcessroute }}</view>
</view>
<view class="dec-item">
<view>BOM版本</view>
<view>{{ data.standardBom }}</view>
</view>
<view class="dec-item">
<view>工单模式</view>
<view>{{ data.workMode }}</view>
</view>
<view class="dec-item">
<view>计划日期</view>
<view>{{ `${$time.formatDate(data.planDate)}` }}</view>
</view>
<view class="dec-item">
<view>开始时间</view>
<view>{{ `${$time.formatDate(data.startTime)}` }}</view>
</view>
<view class="dec-item">
<view>结束时间</view>
<view>{{ `${$time.formatDate(data.endTime)}` }}</view>
</view>
<view class="dec-item">
<view>齐套检查-Bom</view>
<view>{{ data.bomInspect }}</view>
</view>
</view>
</view>
<view class="footer" v-if="from == 3">
<view class="btns">
<button class="reset" @click="reject">驳回</button>
<button class="sure" @click="agree" :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>
</template>
<script setup lang="ts">
import {
onLoad,
onShow
} from '@dcloudio/uni-app'
import {
ref,
getCurrentInstance
} from 'vue'
import * as orderDayPlanListApi from '@/api/mes/orderDay/index.ts'
const {proxy} = getCurrentInstance()
const number = ref('')
const data = ref({})
const loading = ref(false)
const from = ref()//13
const type = ref()
function getSparePartsApplicationDetail() {
orderDayPlanListApi.getOrderDayPlanDetail(number.value).then((res) => {
console.log(number.value)
data.value = res.data
}).catch(() => {
})
}
onLoad((option) => {
if (option.type) type.value = option.type
if (option.from) from.value = option.from
if (option.id) {
number.value = option.id
}
})
onShow(() => {
getSparePartsApplicationDetail()
})
</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: 240rpx;
}
&: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: #F5F5F5;
border-radius: 0px;
&::after {
border-radius: 0px;
}
}
}
</style>

149
src/pages/mes/workScheduling/equipmentInspect.vue

@ -0,0 +1,149 @@
<template>
<view class="container">
<view class="list">
<view class="item" v-for="(item, index) in list" :key="index" >
<view class="dec">
<view>日计划编码</view><view>{{ item.planDayCode }}</view>
</view>
<view class="dec">
<view>工序编码</view><view>{{ item.processCode }}</view>
</view>
<view class="dec">
<view>设备编号</view><view>{{ item.equipmentCode }}</view>
</view>
<view class="dec">
<view>设备名称</view><view>{{ item.equipmentName }}</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 loading = ref(false)
const status = ref('loadmore') //
const type = ref()
const list = ref([])
const params = ref({
pageNo: 1,
pageSize: 10,
planMaserCode: ''
})
function getEquipmentInspectList() {
console.log(status.value)
if (status.value == 'nomore') return
status.value = 'loading'
proxy.$modal.loading('加载中')
workSchedulingListApi.getEquipmentInfoList(params.value).then((res) => {
proxy.$modal.closeLoading()
console.log(params.value.pageNo)
console.log(res.data.list.length)
if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list)
params.value.pageNo++
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
}).catch(() => {
proxy.$modal.closeLoading()
})
}
//
onReachBottom(() => {
status.value = 'loadmore'
getEquipmentInspectList()
})
onLoad((option) => {
if (option.planMaserCode) {
params.value.planMaserCode = option.planMaserCode
}
})
onShow(() => {
getEquipmentInspectList()
})
</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: 200rpx;;
}
&: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;
}
}
}
</style>

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

@ -0,0 +1,405 @@
<template>
<!-- 检查项 -->
<view class="detail-container">
<view class="list" v-for="(item, index) in list" :key="index">
<view class="title">
<view class="title-txt">
<u-tag text="物料检查" v-if="item=='bom'" bg-color='rgba(255,255,255,0)' color='#5599FF'
border-color='#5599FF' type="primary" shape='circle'/>
<u-tag text="人员检查" v-if="item=='worker'" bg-color='rgba(255,255,255,0)' color='#5599FF'
border-color='#5599FF' type="primary" shape='circle'/>
<u-tag text="设备检查" v-if="item=='equipment'" bg-color='rgba(255,255,255,0)' color='#5599FF'
border-color='#5599FF' type="primary" shape='circle'/>
<!-- {{item}} -->
</view>
<view class="dec">
{{number}}
</view>
<view class="dec-item">
<view v-if="item == 'bom'" >
<u-button type="primary" size="default" style="background-color: #5599FF" @click="openDetail(number,item)"> </u-button>
<u-radio-group v-model="bomRadioValue" @change="radioGroupChange">
<u-radio @change="radioChange" v-for="(item, index) in listRadio" :key="index"
:name="item.name"
:disabled=radioFalg>
{{item.name}}
</u-radio>
</u-radio-group>
</view>
<view v-if="item == 'worker'" >
<u-button type="primary" size="default" style="background-color: #5599FF" @click="openDetail(number,item)"> </u-button>
<u-radio-group v-model="workerRadioValue" @change="radioGroupChange">
<u-radio @change="radioChange" v-for="(item, index) in listRadio" :key="index"
:name="item.name"
:disabled=radioFalg>
{{item.name}}
</u-radio>
</u-radio-group>
</view>
<view v-if="item == 'equipment'" >
<u-button type="primary" size="default" style="background-color: #5599FF" @click="openDetail(number,item)"> </u-button>
<u-radio-group v-model="equipmentRadioValue" @change="radioGroupChange">
<u-radio @change="radioChange" v-for="(item, index) in listRadio" :key="index"
:name="item.name"
:disabled=radioFalg>
{{item.name}}
</u-radio>
</u-radio-group>
</view>
</view>
</view>
</view>
<view class="dec-item" v-if="reasons != ''">
<view>未通过原因{{ reasons}}</view>
</view>
<view class="dec-item" v-if="completeInspectStatus">
<u-button type="primary" size="default" style="background-color: #5599FF" @click="submit(number)">提交</u-button>
</view>
<view class="dec-item">
<view>质检模板号{{ quaifyFormNo}}</view>
</view>
<view class="dec-item">
<view>质检模板号{{ bomInspectFlag}}</view>
</view>
<view class="dec-item">
<view>质检模板号{{ bomRadioValue}}</view>
</view>
<view class="dec-item">
<view>质检模板号{{ workerRadioValue}}</view>
</view>
<view class="dec-item">
<view>质检模板号{{ equipmentRadioValue}}</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>
<u-button type="success" size="medium" @click="confirmReason">完成</u-button>
</u-popup>
<!-- <u-button @click="show = true">打开</u-button> -->
</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
} from '@dcloudio/uni-app'
import {
ref,
getCurrentInstance
} from 'vue'
import * as workSchedulingListApi from '@/api/mes/workScheduling/index.ts'
const {proxy} = getCurrentInstance()
const number = ref('')
const loading = ref(false)
const show = ref(false)
const reasons = ref('')
const quaifyFormNo = ref('')
const planDayId = ref('')
const list = ref([])
const listRadio = ref([{name: '通过',disabled: false},{name: '未通过',disabled: false}])
const completeInspectStatus = ref(false)
const radioFalg = ref(false)
const bomRadioValue = ref('')
const workerRadioValue = ref('')
const equipmentRadioValue = ref('')
const mesSchedulingParams = ref({
planMaserCode: '',
status: '',
qualityFormNo: '',
reason: ''
})
function submit(index) {
//
if(bomRadioValue.value == '' ||workerRadioValue.value == '' ||equipmentRadioValue.value == '' ){
proxy.$modal.alert("还有未检查项");
return
}
//
if(bomRadioValue.value == '未通过' ||workerRadioValue.value == '未通过' ||equipmentRadioValue.value == '未通过' ){
mesSchedulingParams.value.status = '-1'
show.value = true
}else{
mesSchedulingParams.value.status = '0'
reasons.value = ''
}
if(mesSchedulingParams.value.status == '0'){
proxy.$modal.confirm("是否确认提交").then(()=>{
mesSchedulingParams.value.planMaserCode = number.value
mesSchedulingParams.value.qualityFormNo = quaifyFormNo.value
workSchedulingListApi.updateWorkSchedulingInfo(mesSchedulingParams.value).then((res) => {
console.log(res.data)
proxy.$tab.navigateBack(1);
//refresh();
}).catch(() => {
proxy.$modal.closeLoading()
})
})
}
}
function confirmReason() {
mesSchedulingParams.value.reason = reasons.value
proxy.$modal.confirm("是否确认提交").then(()=>{
mesSchedulingParams.value.planMaserCode = number.value
mesSchedulingParams.value.qualityFormNo = quaifyFormNo.value
console.log(mesSchedulingParams)
workSchedulingListApi.updateWorkSchedulingInfo(mesSchedulingParams.value).then((res) => {
console.log(res.data)
// refresh();
proxy.$tab.navigateBack(1);
}).catch(() => {
proxy.$modal.closeLoading()
})
})
show.value = false
}
//
function openDetail(index,itemVal) {
if(itemVal == 'bom'){
proxy.$tab.navigateTo(`/pages/mes/workScheduling/bomInspect?planMaserCode=${index}`)
}
if(itemVal == 'worker'){
proxy.$tab.navigateTo(`/pages/mes/workScheduling/workerInspect?planMaserCode=${index}`)
}
if(itemVal == 'equipment'){
proxy.$tab.navigateTo(`/pages/mes/workScheduling/equipmentInspect?planMaserCode=${index}`)
}
}
onLoad((option) => {
if (option.obj) {
number.value = JSON.parse(option.obj).planMaserCode
planDayId.value = JSON.parse(option.obj).id
if( JSON.parse(option.obj).status == '-1'){
completeInspectStatus.value = true
}else{
completeInspectStatus.value = false
}
}
//
workSchedulingListApi.getCompleteInspectionMark("complete_inspect").then((res) => {
quaifyFormNo.value = res.data.remark
}).catch(() => {
proxy.$modal.closeLoading()
})
})
//
// function refresh(){
// proxy.$modal.loading('')
// workSchedulingListApi.getWorkSchedulingDetail(planDayId.value).then((res) => {
// console.log(res.data.status)
// //
// if(res.data.status == '-1'){
// completeInspectStatus.value = true
// radioFalg.value = false
// }else{
// completeInspectStatus.value = false
// radioFalg.value = true
// }
// proxy.$modal.closeLoading()
// }).catch(() => {
// proxy.$modal.closeLoading()
// })
// }
onShow(() => {
list.value = []
workSchedulingListApi.getQualityformInfo(quaifyFormNo.value).then((res) => {
list.value = list.value.concat(res.data.itemCode.split(','))
}).catch(() => {
proxy.$modal.closeLoading()
})
})
</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: 200rpx;
}
&: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: #F5F5F5;
border-radius: 0px;
&::after {
border-radius: 0px;
}
}
}
</style>

311
src/pages/mes/workScheduling/workScheduling.vue

@ -0,0 +1,311 @@
<template>
<view class="container">
<view class="list">
<view>
<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-subsection :animation="true" active-color="#5599FF" :list="list1" :current="current"
@change="tabsChange" :is-scroll="false">
</u-subsection> -->
</view>
<view class="item" v-for="(item, index) in list" :key="index" @click="openDetail(item)">
<view class="title">
<view class="title-txt">
{{item.planMaserCode}}
</view>
<view class="time">
{{`${$time.formatDate(item.createTime)}`}}
</view>
</view>
<view class="dec">
<view>日计划单号</view><view>{{ item.planMaserCode }}</view>
</view>
<view class="dec">
<view>任务工单号</view><view>{{ item.schedulingCode }}</view>
</view>
<view class="dec">
<view>产品编号</view><view>{{ item.productCode }}</view>
</view>
<view class="dec">
<view>产品名称</view><view>{{ item.productName }}</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'/>
<u-tag text="已终止" v-if="item.status==-2" bg-color='rgba(255,255,255,0)' color='#fe8463'
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'/>
<u-tag text="待开工" v-if="item.status==0" bg-color='rgba(255,255,255,0)' color='#fe8463'
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'/>
<u-tag text="待配料" v-if="item.status==2" bg-color='rgba(255,255,255,0)' color='#fe8463'
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'/>
<u-tag text="待报工" v-if="item.status==4" bg-color='rgba(255,255,255,0)' color='#fe8463'
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'/>
</view>
</view>
<view v-if="item.status==-1" >
<u-button type="primary" @click="openInspectItem(item)">齐套检查</u-button>
</view>
<view v-if="item.status==0" >
<u-button type="primary" @click="开工(item)">开工</u-button>
</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 list1 = ref([
{
name: '全部',
},
{
name: '待齐套',
},
{
name: '待开工',
},
{
name: '生产中',
},
{
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 ss = ref()
const params = ref({
pageNo: 1,
pageSize: 10,
status: '',
flag: null
})
async function getViewList() {
if (status.value == 'nomore') return
status.value = 'loading'
proxy.$modal.loading('加载中')
await workSchedulingListApi.getWorkSchedulingPage(params.value).then((res) => {
proxy.$modal.closeLoading()
if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list)
params.value.pageNo++
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
}).catch(() => {
proxy.$modal.closeLoading()
})
falg.value = 'view'
}
const tabParams = ref({
pageNo: 1,
pageSize: 10,
status: '',
flag: null
})
async function getTabsList() {
if (status.value == 'nomore') return
status.value = 'loading'
proxy.$modal.loading('加载中')
await workSchedulingListApi.getWorkSchedulingPage(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 = 'tab'
}
//
onShow(() => {
tabParams.value.pageNo = 1
tabParams.value.status = ''
list.value = []
getTabsList()
})
//
onReachBottom(() => {
if (falg.value == 'tab') {
status.value = 'loading'
getTabsList()
}
if (falg.value == 'view') {
status.value = 'loading'
getViewList()
}
})
//
function openDetail(item, index) {
proxy.$tab.navigateTo(`/pages/mes/workScheduling/detail?id=${item.id}`)
}
//Bom
function openBomInspect(item, index) {
proxy.$tab.navigateTo(`/pages/mes/workScheduling/bomInspect?planNoDay=${item.planNoDay}`)
}
function openInspectItem(item, index) {
const objString = JSON.stringify(item);
proxy.$tab.navigateTo(`/pages/mes/workScheduling/inspectionItems?obj=${objString}`)
}
//
function tabsChange(index) {
current.value = index
tabParams.value.pageNo = 1
if (index == '0') {
tabParams.value.status = ''
} else {
tabParams.value.status = index
}
list.value = []
status.value = 'loading'
getTabsList()
}
const searchTableParams = ref({
planNoDay: '',
flag: null
})
async function searchTable() {
list.value = []
searchTableParams.value.planNoDay = this.searchValue
await workSchedulingListApi.getWorkSchedulingPage(searchTableParams.value).then((res) => {
if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list)
}
})
}
</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: 200rpx;;
}
&: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;
}
}
}
</style>

148
src/pages/mes/workScheduling/workerInspect.vue

@ -0,0 +1,148 @@
<template>
<view class="container">
<view class="list">
<view class="item" v-for="(item, index) in list" :key="index" >
<view class="dec">
<view>日计划编码</view><view>{{ item.planDayCode }}</view>
</view>
<view class="dec">
<view>工序编码</view><view>{{ item.processCode }}</view>
</view>
<view class="dec">
<view>人员编码</view><view>{{ item.workerCode }}</view>
</view>
<view class="dec">
<view>人员昵称</view><view>{{ item.workerName }}</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 loading = ref(false)
const status = ref('loadmore') //
const list = ref([])
const params = ref({
pageNo: 1,
pageSize: 10,
planMaserCode: ''
})
function getWorkerInspectList() {
console.log(status.value)
if (status.value == 'nomore') return
status.value = 'loading'
proxy.$modal.loading('加载中')
workSchedulingListApi.getWorkerInfoList(params.value).then((res) => {
proxy.$modal.closeLoading()
console.log(params.value.pageNo)
console.log(res.data.list.length)
if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list)
params.value.pageNo++
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
}).catch(() => {
proxy.$modal.closeLoading()
})
}
//
onReachBottom(() => {
status.value = 'loadmore'
getWorkerInspectList()
})
onLoad((option) => {
if (option.planMaserCode) {
params.value.planMaserCode = option.planMaserCode
}
})
onShow(() => {
getWorkerInspectList()
})
</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: 200rpx;;
}
&: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;
}
}
}
</style>
Loading…
Cancel
Save