gaojs
7 months ago
2 changed files with 654 additions and 0 deletions
@ -0,0 +1,362 @@ |
|||
<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="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> |
|||
</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()//1从我的进入3从审核进入 |
|||
const type = ref() |
|||
|
|||
function getSparePartsApplicationDetail() { |
|||
orderDayPlanListApi.getOrderDayPlanDetail(number.value).then((res) => { |
|||
console.log(number.value) |
|||
data.value = res.data |
|||
}).catch(() => { |
|||
}) |
|||
} |
|||
|
|||
// 触发提交表单 |
|||
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 |
|||
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: 20 rpx; |
|||
} |
|||
|
|||
.info { |
|||
background: white; |
|||
} |
|||
|
|||
|
|||
.tab { |
|||
border-bottom: 1px solid #e4e4e4; |
|||
|
|||
} |
|||
|
|||
.title { |
|||
display: flex; |
|||
align-items: center; |
|||
padding: 20 rpx 30 rpx; |
|||
border-bottom: 1px solid #e4e4e4; |
|||
|
|||
view { |
|||
&:nth-child(1) { |
|||
flex: 1; |
|||
border-left: 10 rpx solid #409eff; |
|||
padding-left: 20 rpx; |
|||
font-weight: bold; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.dec { |
|||
padding: 30 rpx; |
|||
|
|||
.dec-item { |
|||
padding-bottom: 30 rpx; |
|||
display: flex; |
|||
|
|||
view { |
|||
&:nth-child(1) { |
|||
width: 200 rpx; |
|||
} |
|||
|
|||
&:nth-child(2) { |
|||
color: #888888; |
|||
flex: 1; |
|||
width: 0px; |
|||
word-wrap: break-word; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
.dec2 { |
|||
padding: 10 rpx 30 rpx; |
|||
display: flex; |
|||
|
|||
view { |
|||
&:nth-child(1) { |
|||
width: 180 rpx; |
|||
} |
|||
|
|||
&:nth-child(2) { |
|||
color: #888888; |
|||
flex: 1; |
|||
width: 0px; |
|||
word-wrap: break-word; |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
.items { |
|||
border-radius: 12 rpx; |
|||
background: #F5F5F5; |
|||
padding-bottom: 20 rpx; |
|||
|
|||
.items-name { |
|||
padding: 20 rpx; |
|||
border-bottom: 1px solid #dedede; |
|||
} |
|||
|
|||
.items-dec { |
|||
padding: 0px 20 rpx; |
|||
margin-top: 20 rpx; |
|||
} |
|||
} |
|||
|
|||
|
|||
.list { |
|||
padding: 20 rpx; |
|||
|
|||
.item { |
|||
display: flex; |
|||
margin-bottom: 20 rpx; |
|||
|
|||
.item-box { |
|||
border-radius: 12 rpx; |
|||
border: 1px solid #dedede; |
|||
border-radius: 12 rpx; |
|||
|
|||
flex: 1; |
|||
width: 0 rpx; |
|||
} |
|||
|
|||
.spare-title { |
|||
padding: 20 rpx 30 rpx; |
|||
border-bottom: 1px solid #e4e4e4; |
|||
display: flex; |
|||
|
|||
.title-txt { |
|||
color: #409eff; |
|||
font-size: 30 rpx; |
|||
font-weight: bold; |
|||
flex: 1; |
|||
} |
|||
} |
|||
|
|||
.dec { |
|||
color: #9c9c9c; |
|||
padding: 0 rpx 30 rpx 20 rpx; |
|||
} |
|||
|
|||
} |
|||
} |
|||
|
|||
.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> |
@ -0,0 +1,292 @@ |
|||
<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=#ff9900 @search="searchTable()"></u-search> |
|||
<u-subsection :animation="true" active-color="#ff9900" ref="tabs1" :list="list1" :current="current" |
|||
@change="tabsChange" :is-scroll="false"> |
|||
</u-subsection> |
|||
<!-- <u-tabs-swiper ref="tabs1" :list="list1" :current="current" @change="tabsChange" :is-scroll="false" |
|||
swiperWidth="750"></u-tabs-swiper> --> |
|||
</view> |
|||
<view class="item" v-for="(item, index) in list" :key="index" @click="openDetail(item)"> |
|||
<view class="dec"> |
|||
<view>日计划单号:</view> |
|||
<view>{{ item.planNoDay }}</view> |
|||
</view> |
|||
<view class="dec"> |
|||
<view>产品批次码:</view> |
|||
<view>{{ item.batchCode }}</view> |
|||
</view> |
|||
<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==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'/> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<!-- <view class="item" v-for="(item,index) in list" :key="index" @click="openDetail(item)"> |
|||
<view class="dec"> |
|||
<view>日计划单号:</view> |
|||
<view>{{item.planNoDay}}</view> |
|||
</view> |
|||
<view class="dec"> |
|||
<view>产品批次码:</view> |
|||
<view>{{item.batchCode}}</view> |
|||
</view> |
|||
<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==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' /> |
|||
</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 list1 = ref([ |
|||
{ |
|||
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 orderDayPlanListApi.getOrderDayPage(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 orderDayPlanListApi.getOrderDayPage(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(() => { |
|||
console.log(searchValue.value) |
|||
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/orderDayPlan/detail?id=${item.id}`) |
|||
} |
|||
|
|||
//切换标签页 |
|||
function tabsChange(index) { |
|||
console.log(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 = [] |
|||
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) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.container { |
|||
background: #f5f5f5; |
|||
min-height: 100vh; |
|||
} |
|||
|
|||
.list { |
|||
background: #f5f5f5; |
|||
margin-top: 20 rpx; |
|||
|
|||
.item { |
|||
padding: 30 rpx 30 rpx 0px 30 rpx; |
|||
margin-top: 20 rpx; |
|||
background: white; |
|||
position: relative; |
|||
|
|||
.title { |
|||
display: flex; |
|||
align-items: center; |
|||
padding-bottom: 20 rpx; |
|||
|
|||
.title-txt { |
|||
color: #409eff; |
|||
font-weight: bold; |
|||
font-size: 36 rpx; |
|||
width: 0px; |
|||
flex: 1; |
|||
word-wrap: break-word; |
|||
} |
|||
|
|||
.time { |
|||
color: #919191; |
|||
|
|||
} |
|||
} |
|||
|
|||
.dec { |
|||
padding-bottom: 20 rpx; |
|||
display: flex; |
|||
align-items: center; |
|||
|
|||
view { |
|||
&:nth-child(1) { |
|||
width: 200 rpx;; |
|||
} |
|||
|
|||
&:nth-child(2) { |
|||
color: #999999; |
|||
flex: 1; |
|||
width: 0px; |
|||
word-wrap: break-word; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.last { |
|||
padding-bottom: 30 rpx; |
|||
} |
|||
|
|||
.bottom { |
|||
display: flex; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
border-top: 1px solid #E4E4E4; |
|||
padding: 20 rpx 0px; |
|||
height: 90 rpx; |
|||
|
|||
} |
|||
} |
|||
} |
|||
</style> |
Loading…
Reference in new issue