| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285 |
- <template>
- <view class="mainBox">
- <uni-nav-bar fixed="true" statusBar="true" left-icon="back"
- :title="pageName=='myList'?'我的质检工单':pageName=='myInspectionProjectTask'?'我的质检任务单':pageName=='myInspectionProjectEntrusted'?'我的质检受托单':'质检工单'"
- @clickLeft="back">
- </uni-nav-bar>
- <view class="top-wrapper">
- <uni-section>
- <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="keyWord" placeholder="名称、批次号">
- </uni-easyinput>
- </uni-section>
- <button class="search_btn" @click="doSearch">搜索</button>
- </view>
- <div style="height:100rpx;width: 475rpx;"></div>
- <view class="wrapper">
- <u-list @scrolltolower="scrolltolower" class="listContent">
- <view v-for="(item, index) in tableList" :key="index+item.id" style="position: relative;">
- <view class="item">
- <view class="herder_item">
- <view class="herder_text"></view>
- <view class="herder_view">
- {{ getDictValue('质检计划类型', item.qualityType+'')}}/{{item.code}}/{{item.productCode}}/{{item.productName}}
- </view>
- </view>
- <view class="text">检验项目:</view>
- <view class="item_value">
- <view @click="goTo(item.id,row.id,item.sampleMeasureUnit)"
- v-for="(row,_index) in item.templateList" :key="item.inspectionName+index+'_'+_index"
- :style="{background:row.status==1?'#19be6b':row.status==2?'#ff9900':row.status==3?'#ff9900':'#909399'}">
- {{row.inspectionName}}
- </view>
- </view>
- </view>
- </view>
- <view style="width:100%;height:40rpx"></view>
- <view style='margin-top: 20vh;' v-if="tableList.length==0">
- <u-empty iconSize='150' textSize='32' text='暂无数据'>
- </u-empty>
- </view>
- </u-list>
- </view>
- <u-toast ref="uToast"></u-toast>
- </view>
- </template>
- <script>
- import dictMixns from '@/mixins/dictMixins'
- import {
- getList,
- getRequestentrustList,
- getTaskmonadList
- } from '@/api/inspectionWork/index.js'
- export default {
- components: {},
- mixins: [dictMixns],
- props: {
- pageName: {
- default: ""
- }
- },
- data() {
- return {
- tableList: [],
- page: 1,
- size: 10,
- isEnd: false,
- keyWord: '',
- userInfo: {}
- }
- },
- computed: {
- },
- created() {
- this.requestDict('质检计划类型')
- },
- methods: {
- successInit() {
- uni.showLoading({
- title: '加载中'
- })
- let data = {
- pageNum: 1,
- size: this.tableList.length,
- keyWord: this.keyWord,
- recordingMethod: 1,
- }
- if (this.pageName) {
- data.currentLoginUserId = this.userInfo.userId
- }
- if (this.pageName == 'myInspectionProjectEntrusted') {
- data.approvalStatus = 2
- }
- let api = this.pageName == 'myInspectionProjectTask' ? getTaskmonadList : this.pageName ==
- 'myInspectionProjectEntrusted' ? getRequestentrustList : getList
- api(data).then(res => {
- this.tableList = res.list
- }).then(() => {
- uni.hideLoading()
- })
- },
- doSearch() {
- this.isEnd = false
- this.page = 1
- this.getList()
- },
- //获取列表信息
- getList() {
- this.userInfo = uni.getStorageSync('userInfo')
- if (this.isEnd || !this.userInfo.userId) {
- return
- }
- uni.showLoading({
- title: '加载中'
- })
- let data = {
- pageNum: this.page,
- size: this.size,
- keyWord: this.keyWord,
- recordingMethod: 1,
- }
- if (this.pageName) {
- data.currentLoginUserId = this.userInfo.userId
- }
- if (this.pageName == 'myInspectionProjectEntrusted') {
- data.approvalStatus = 2
- }
- let api = this.pageName == 'myInspectionProjectTask' ? getTaskmonadList : this.pageName ==
- 'myInspectionProjectEntrusted' ? getRequestentrustList : getList
- api(data).then(res => {
- if (this.page === 1) {
- this.tableList = res.list
- } else {
- this.tableList.push(...res.list)
- }
- this.page += 1
- this.isEnd = this.tableList.length >= res.count
- }).then(() => {
- uni.hideLoading()
- })
- },
- goTo(workId, projectId, sampleMeasureUnit) {
- uni.navigateTo({
- url: '/pages/qms/inspectionWork/inspectionProjectReport?workId=' + workId + '&projectId=' +
- projectId + '&pageName=' + this.pageName + '&sampleMeasureUnit=' + sampleMeasureUnit
- })
- },
- scrolltolower() {
- if (this.isEnd) {
- return
- }
- this.getList();
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .mainBox {
- background-color: #f3f8fb
- }
- // .wrapper{
- // }
- .top-wrapper {
- background-color: #fff;
- display: flex;
- width: 750rpx;
- height: 88rpx;
- padding: 16rpx 32rpx;
- align-items: center;
- // gap: 16rpx;
- position: absolute;
- z-index: 999;
- // top: 44px;
- // // #ifdef APP-PLUS
- // top: 140rpx;
- // // #endif
- /deep/.uni-section {
- margin-top: 0px;
- }
- /deep/.uni-section-header {
- padding: 0px;
- }
- .search_btn {
- width: 120rpx;
- height: 70rpx;
- line-height: 70rpx;
- padding: 0 24rpx;
- background: $theme-color;
- font-size: 32rpx;
- color: #fff;
- margin: 0;
- margin-left: 26rpx;
- }
- .menu_icon {
- width: 44rpx;
- height: 44rpx;
- margin-left: 14rpx;
- }
- }
- .item {
- width: 720rpx;
- // height:400rpx;
- margin: 20rpx auto 0;
- padding: 26rpx;
- border-radius: 30rpx;
- .text {
- margin-top: 20rpx;
- }
- background: #fff;
- }
- .item_value {
- width: 100%;
- display: flex;
- flex-wrap: wrap;
- margin-left: -10rpx;
- >view {
- font-size: 24rpx;
- color: #fff;
- padding: 12rpx;
- border-radius: 10rpx;
- background: #979797;
- margin-left: 10rpx;
- margin-top: 20rpx;
- }
- }
- .herder_item {
- display: flex;
- // align-items: center;
- font-size: 28rpx;
- font-weight: bold;
- .herder_view {
- width: calc(100% - 20rpx);
- word-break: break-all;
- }
- .herder_text {
- min-width: 10rpx;
- height: 32rpx;
- border-radius: 10rpx;
- background: #00c0a1;
- margin-right: 12rpx;
- margin-top: 5rpx;
- }
- }
- </style>
|