|
|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
<template>
|
|
|
|
|
<view class="container">
|
|
|
|
|
<view>
|
|
|
|
|
<u-sticky
|
|
|
|
|
class="sticky"
|
|
|
|
|
:custom-nav-height="0"
|
|
|
|
|
@ -13,12 +13,22 @@
|
|
|
|
|
safe-area-inset-top
|
|
|
|
|
placeholder
|
|
|
|
|
/>
|
|
|
|
|
<u-tabs
|
|
|
|
|
:list="menuList"
|
|
|
|
|
:current="current"
|
|
|
|
|
key-name="name"
|
|
|
|
|
:scrollable="false"
|
|
|
|
|
:active-style="{
|
|
|
|
|
color: '#0E85FF',
|
|
|
|
|
}"
|
|
|
|
|
@change="change"
|
|
|
|
|
>
|
|
|
|
|
</u-tabs>
|
|
|
|
|
</u-sticky>
|
|
|
|
|
<view class="example">
|
|
|
|
|
<el-tabs v-loading="loading" v-model="activeName" class="demo-tabs" @tab-click="handleTabClick">
|
|
|
|
|
<el-tab-pane label="个人报工" name="first">
|
|
|
|
|
<view class="container">
|
|
|
|
|
<view v-if="current === 0" >
|
|
|
|
|
<uni-list :border="true">
|
|
|
|
|
<uni-list-item v-for="(item, index) in reportList">
|
|
|
|
|
<uni-list-item v-for="(item, index) in reportList" :key="index">
|
|
|
|
|
<!-- 自定义 header -->
|
|
|
|
|
<template v-slot:header>
|
|
|
|
|
<div onclick="">
|
|
|
|
|
@ -42,29 +52,23 @@
|
|
|
|
|
</uni-list-item>
|
|
|
|
|
</uni-list>
|
|
|
|
|
<uni-fab ref="fab" @fabClick="editOrAddReport" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="代报工" name="second" v-if="auth('mes:produce-report-detail:replace')">
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="auth('mes:produce-report-detail:replace') && current === 1">
|
|
|
|
|
<uni-fab :pattern="pattern" ref="fabReplace" @fabClick="addReplaceReport" />
|
|
|
|
|
<uni-forms ref="valiReplaceForm" :model="valiFormData">
|
|
|
|
|
<uni-row>
|
|
|
|
|
<uni-col :xs="14" :sm="12" :md="6" :lg="3" :xl="1">
|
|
|
|
|
<uni-forms-item label-width="50px" label-align="left" label="日期" name="reportDateString">
|
|
|
|
|
<uni-datetime-picker v-model="valiFormData.reportDateString" type="date" :clear-icon="true" @change="maskClick" />
|
|
|
|
|
</uni-forms-item>
|
|
|
|
|
</uni-col>
|
|
|
|
|
<uni-col :xs="10" :sm="8" :md="6" :lg="3" :xl="1">
|
|
|
|
|
<uni-forms-item label-width="50px" label-align="left" label="工人" name="userId">
|
|
|
|
|
<uni-data-select v-model="valiFormData.userId" :localdata="userList" placement="top" @change="handleReplaceReportChange()">
|
|
|
|
|
</uni-data-select>
|
|
|
|
|
</uni-forms-item>
|
|
|
|
|
</uni-col>
|
|
|
|
|
</uni-row>
|
|
|
|
|
<uni-forms-item label="工序" name="orgType">
|
|
|
|
|
<uni-data-checkbox v-model="valiFormData.orgType" :localdata="processTypes()" @change="handleReplaceReportChange()"/>
|
|
|
|
|
</uni-forms-item>
|
|
|
|
|
</uni-forms>
|
|
|
|
|
<uni-list :border="true">
|
|
|
|
|
<uni-list-item v-for="(item, index) in replaceReportList">
|
|
|
|
|
<uni-list-item v-for="(item, index) in replaceReportList" :key="index">
|
|
|
|
|
<!-- 自定义 header -->
|
|
|
|
|
<template v-slot:header>
|
|
|
|
|
<div onclick="">
|
|
|
|
|
@ -88,29 +92,22 @@
|
|
|
|
|
</template>
|
|
|
|
|
</uni-list-item>
|
|
|
|
|
</uni-list>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="个人报工审核" name="third" v-if="auth('mes:produce-report-detail:replace')">
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="current === 2 && auth('mes:produce-report-detail:replace')">
|
|
|
|
|
<uni-forms ref="valiForm" :model="valiFormData">
|
|
|
|
|
<uni-row>
|
|
|
|
|
<uni-col :xs="14" :sm="12" :md="6" :lg="3" :xl="1">
|
|
|
|
|
<uni-forms-item label-width="50px" label-align="left" label="日期" name="reportDateString">
|
|
|
|
|
<uni-datetime-picker v-model="valiFormData.reportDateString" type="date" :clear-icon="true" @change="maskClick" />
|
|
|
|
|
</uni-forms-item>
|
|
|
|
|
</uni-col>
|
|
|
|
|
<uni-col :xs="10" :sm="8" :md="6" :lg="3" :xl="1">
|
|
|
|
|
<uni-forms-item label-width="50px" label-align="left" label="工人" name="userId">
|
|
|
|
|
<uni-data-select v-model="valiFormData.userId" :localdata="userList" placement="top" @change="handleOtherReportChange()">
|
|
|
|
|
</uni-data-select>
|
|
|
|
|
</uni-forms-item>
|
|
|
|
|
</uni-col>
|
|
|
|
|
</uni-row>
|
|
|
|
|
<uni-forms-item label="工序" name="orgType">
|
|
|
|
|
<uni-data-checkbox v-model="valiFormData.orgType" :localdata="processTypes()" @change="handleOtherReportChange()"/>
|
|
|
|
|
</uni-forms-item>
|
|
|
|
|
</uni-forms>
|
|
|
|
|
|
|
|
|
|
<uni-list :border="true">
|
|
|
|
|
<uni-list-item v-for="(item, index) in otherReportList">
|
|
|
|
|
<uni-list-item v-for="(item, index) in otherReportList" key="index">
|
|
|
|
|
<!-- 自定义 header -->
|
|
|
|
|
<template v-slot:header>
|
|
|
|
|
<div onclick="">
|
|
|
|
|
@ -134,12 +131,8 @@
|
|
|
|
|
</template>
|
|
|
|
|
</uni-list-item>
|
|
|
|
|
</uni-list>
|
|
|
|
|
<view>
|
|
|
|
|
<div></div>
|
|
|
|
|
</view>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="报工报表" name="four">报工报表</el-tab-pane>
|
|
|
|
|
</el-tabs>
|
|
|
|
|
<view v-if="current === 3" >报工报表</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
@ -178,7 +171,6 @@ export default {
|
|
|
|
|
buttonColor: '#e66126',
|
|
|
|
|
iconColor: '#fff'
|
|
|
|
|
},
|
|
|
|
|
activeName: 'first',
|
|
|
|
|
valiFormData: {
|
|
|
|
|
reportDate: [],
|
|
|
|
|
reportDateString: getCurrentDate(),
|
|
|
|
|
@ -186,55 +178,41 @@ export default {
|
|
|
|
|
orgType: 'chengxing',
|
|
|
|
|
reportType: '个人',
|
|
|
|
|
},
|
|
|
|
|
menuList: [
|
|
|
|
|
{
|
|
|
|
|
name: '个人报工'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '代报工'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '个人报工审核'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '报工报表'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
current: 0
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
onLoad() {
|
|
|
|
|
this.loading = true
|
|
|
|
|
this.getList();
|
|
|
|
|
this.getReplaceReportList()
|
|
|
|
|
this.getOtherReportList()
|
|
|
|
|
this.getUserList()
|
|
|
|
|
this.loading = false
|
|
|
|
|
},
|
|
|
|
|
onPullDownRefresh() {
|
|
|
|
|
//请求个人报工审核数据
|
|
|
|
|
if(this.currentPaneName==='third'){
|
|
|
|
|
this.getOtherReportList()
|
|
|
|
|
}
|
|
|
|
|
//请求代报数据
|
|
|
|
|
else if(this.currentPaneName==='second'){
|
|
|
|
|
this.getReplaceReportList();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
//请求个人报工数据
|
|
|
|
|
this.getList();
|
|
|
|
|
}
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
uni.stopPullDownRefresh();
|
|
|
|
|
}, 1000);
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
change(index) {
|
|
|
|
|
this.current = index.index
|
|
|
|
|
},
|
|
|
|
|
auth(permission) {
|
|
|
|
|
return auth.hasPermi(permission)
|
|
|
|
|
},
|
|
|
|
|
processTypes() {
|
|
|
|
|
return processTypes
|
|
|
|
|
},
|
|
|
|
|
handleTabClick(tab) {
|
|
|
|
|
this.loading = true
|
|
|
|
|
this.currentPaneName=tab.paneName
|
|
|
|
|
//请求个人报工审核数据
|
|
|
|
|
if(tab.paneName==='third'){
|
|
|
|
|
this.getOtherReportList()
|
|
|
|
|
}
|
|
|
|
|
//请求代报数据
|
|
|
|
|
else if(tab.paneName==='second'){
|
|
|
|
|
this.getReplaceReportList();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
//请求个人报工数据
|
|
|
|
|
this.getList();
|
|
|
|
|
}
|
|
|
|
|
this.loading = false
|
|
|
|
|
},
|
|
|
|
|
timestampToTime,
|
|
|
|
|
getOtherReportList() {
|
|
|
|
|
let date = this.valiFormData.reportDateString
|
|
|
|
|
@ -270,9 +248,15 @@ export default {
|
|
|
|
|
if (res.confirm) {
|
|
|
|
|
deleteByReportId(id).then(response => {
|
|
|
|
|
modal.msgSuccess("操作成功")
|
|
|
|
|
if(this.activeName==='first')this.getList()
|
|
|
|
|
if(this.activeName==='third')this.getOtherReportList()
|
|
|
|
|
if(this.activeName==='second')this.getReplaceReportList()
|
|
|
|
|
if (this.current === 0) {
|
|
|
|
|
this.getList()
|
|
|
|
|
}
|
|
|
|
|
if (this.current === 1) {
|
|
|
|
|
this.getReplaceReportList()
|
|
|
|
|
}
|
|
|
|
|
if (this.current === 2) {
|
|
|
|
|
this.getOtherReportList()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.loading = false
|
|
|
|
|
@ -284,9 +268,15 @@ export default {
|
|
|
|
|
if (res.confirm) {
|
|
|
|
|
updateStatus(id, status).then(response => {
|
|
|
|
|
modal.msgSuccess("操作成功")
|
|
|
|
|
if(this.activeName==='first')this.getList()
|
|
|
|
|
if(this.activeName==='third')this.getOtherReportList()
|
|
|
|
|
if(this.activeName==='second')this.getReplaceReportList()
|
|
|
|
|
if (this.current === 0) {
|
|
|
|
|
this.getList()
|
|
|
|
|
}
|
|
|
|
|
if (this.current === 1) {
|
|
|
|
|
this.getReplaceReportList()
|
|
|
|
|
}
|
|
|
|
|
if (this.current === 2) {
|
|
|
|
|
this.getOtherReportList()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.loading = false
|
|
|
|
|
@ -302,9 +292,15 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
maskClick(e) {
|
|
|
|
|
this.valiFormData.reportDateString = e
|
|
|
|
|
if(this.activeName==='first')this.getList()
|
|
|
|
|
if(this.activeName==='third')this.getOtherReportList()
|
|
|
|
|
if(this.activeName==='second')this.getReplaceReportList()
|
|
|
|
|
if (this.current === 0) {
|
|
|
|
|
this.getList()
|
|
|
|
|
}
|
|
|
|
|
if (this.current === 1) {
|
|
|
|
|
this.getReplaceReportList()
|
|
|
|
|
}
|
|
|
|
|
if (this.current === 2) {
|
|
|
|
|
this.getOtherReportList()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleOtherReportChange() {
|
|
|
|
|
this.loading = true
|
|
|
|
|
@ -327,16 +323,18 @@ export default {
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.container {
|
|
|
|
|
padding: 15px;
|
|
|
|
|
background-color: #ffffff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.sticky {
|
|
|
|
|
background: linear-gradient(180deg, #d4e9ff 0%, #f3f9ff 100%);
|
|
|
|
|
backdrop-filter: blur(27.18px);
|
|
|
|
|
box-shadow: 0 1px 1px 0 rgba(0, 72, 145, 0.1),
|
|
|
|
|
0 0.5px 0 0 rgba(0, 0, 0, 0.1);
|
|
|
|
|
}
|
|
|
|
|
.example {
|
|
|
|
|
padding: 15px;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.addSite {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-around;
|
|
|
|
|
@ -348,10 +346,12 @@ export default {
|
|
|
|
|
background-color: red;
|
|
|
|
|
border-radius: 60rpx;
|
|
|
|
|
font-size: 30rpx;
|
|
|
|
|
|
|
|
|
|
.add {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
color: #ffffff;
|
|
|
|
|
|
|
|
|
|
.icon {
|
|
|
|
|
margin-right: 10rpx;
|
|
|
|
|
}
|
|
|
|
|
|