jiangping
2023-10-24 349bcef9a96391d22522a3409adf5a89e7e70a95
minipro_standard/pages_adjust/pages/workOrder/workOrder.vue
@@ -1,7 +1,7 @@
<template>
   <view class="content p30">
   <view class="content p30 bbox">
      <div class="content_search">
         <v-Search @searchInput="searchInput" @submit="submit" @reset="reset" :isShow="true"
         <v-Search @searchInput="searchInput" @submit="search" @reset="reset" :isShow="true"
            placeholder="搜索工单编码/工序名称">
            <template v-slot:content>
               <div class="Search_item">
@@ -22,13 +22,14 @@
         <v-LableSelection :TagList="tagList" :isShow="true" @change="clickTag"></v-LableSelection>
      </div>
      <div class="content_total mt20">共{{page.total}}条数据</div>
      <scroll-view scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered" @scrolltolower="getLists"
         @refresherrefresh="onRefresh">
         <div class="content_list">
      <div class="content_list">
         <scroll-view scroll-y="true" :style="{height:height}" refresher-enabled="true"
            :refresher-triggered="triggered" @scrolltolower="getLists" @refresherrefresh="onRefresh">
            <div class="content_list_item" v-for="(item, i) in list" :key="i" @click="jump(item)">
               <div class="content_list_item_top">
                  <div class="content_list_item_top_left">
                     <span v-if="item.mmodel">{{item.mmodel.name}} | {{item.procedureName}}</span>
                     <span class="f32" v-if="item.mmodel">{{item.mmodel.name}} | {{item.procedureName}}</span>
                     <div class="content_list_item_top_left_tag" v-if="item.urgent">优先{{item.urgent}}</div>
                     <div class="content_list_item_top_left_tag backgreen" v-if="item.type === 0">正常</div>
                     <div class="content_list_item_top_left_tag backyellow" v-if="item.type === 2">返工返修</div>
@@ -42,10 +43,10 @@
                     <span v-if="item.status === 4">已报工</span>
                     <span v-if="item.status === 5">已入库</span>
                     <span v-if="item.status === 6">已取消</span>
                     <span class="green" v-if="item.status === 7">进行中</span>
                     <span class="green" v-if="item.status === 7">生产中</span>
                  </div>
               </div>
               <span>工单编号: {{item.code}}</span>
               <span class="f24">工单编号: {{item.code}}</span>
               <div class="content_list_item_content">
                  <div class="content_list_item_content_item">
                     <div class="content_list_item_content_item_label">物料编码:</div>
@@ -77,9 +78,16 @@
                  </div>
               </div>
            </div>
         </div>
      </scroll-view>
      <u-calendar :show="isOpenDate" mode="range" @confirm="dateConfirm"></u-calendar>
         </scroll-view>
      </div>
      <view class="fx1">
      </view>
      <!-- <u-calendar :show="isOpenDate" mode="range" @confirm="dateConfirm"></u-calendar> -->
      <l-calendar :lunar="false" v-model="isOpenDate" @change="dateConfirm" :isRange="true" activeBgColor="#305ED5"
         rangeColor="#305ED5" rangeBgColor="rgba(48, 80, 213, 0.1)"></l-calendar>
   </view>
</template>
@@ -90,6 +98,9 @@
      getList,
      pageCount
   } from '@/util/api/WorkOrderAPI.js'
   import {
      gsdate
   } from '@/util/utils.js'
   export default {
      components: {
         vSearch,
@@ -114,12 +125,13 @@
                  num: '0'
               }
            ],
            height: '',
            triggered: false,
            _freshing: false,
            searchForm: {
               mixParam: '',
               startDate: '',
               endDate: '',
               endDate: gsdate(new Date()),
               statusList: []
            },
            page: {
@@ -130,13 +142,41 @@
            list: [],
         }
      },
      onReady() {
         var that = this
         this.$nextTick(() => {
            uni.createSelectorQuery()
               .in(this)
               .select('.content_search')
               .boundingClientRect((rect) => {
                  console.log('-----', rect);
                  that.height = `calc(100vh - ${rect.height + 80}px)`
                  that.top = `${rect.height}px`
               })
               .exec()
         })
      },
      onLoad() {
         this.pageCounts()
         this.loadData()
      },
      methods: {
         reset() {
            this.searchForm = {
               mixParam: '',
               startDate: '',
               // endDate: gsdate(new Date()),
               endDate: '',
               statusList: []
            }
            this.search()
         },
         searchInput(data) {
            this.searchForm.mixParam = data
            this.search()
         },
         loadData() {
            getList({
                  ...this.page,
                  model: {
@@ -163,11 +203,10 @@
         pageCounts() {
            pageCount({
               ...this.searchForm,
               endDate: this.searchForm.endDate ? (this.searchForm.endDate + ' 23:59:59') : '',
               endDate: this.searchForm.endDate || null,
               statusList: this.searchForm.statusList.length === 0 ? this.tagList[0].id : this.searchForm
                  .statusList
            }).then(res => {
               console.log(res);
            }).then(res => {
               if (res.code === 200) {
                  this.tagList[0].num = String(res.data.startNum)
                  this.tagList[1].num = String(res.data.ingNum)
@@ -181,9 +220,10 @@
            this.loadData()
         },
         dateConfirm(v) {
            console.log(v);
            this.isOpenDate = false
            this.searchForm.startDate = v[0]
            this.searchForm.endDate = v[v.length - 1]
            this.searchForm.startDate = v.startDate
            this.searchForm.endDate = v.endDate
         },
         getLists() {
            this.page.page += 1
@@ -192,20 +232,24 @@
         onRefresh() {
            if (this.triggered) return
            this.triggered = true;
            this.search()
         },
         search() {
            this.page.page = 1
            this.loadData()
            this.pageCounts()
         },
         jump(item) {
            // uni.navigateTo({
            //    url: `/pages_adjust/pages/OrderDetail/OrderDetail?id=${item.id}`
         jump(item) {
            // uni.navigateTo({
            //    url: `/pages_adjust/pages/OrderDetail/OrderDetail?id=${item.id}`
            // })
            if (item.status === 4 || item.status === 6 || item.paused === 1) {
               uni.navigateTo({
                  url: `/pages_adjust/pages/OrderDetail/OrderDetail?id=${item.id}`
               uni.navigateTo({
                  url: `/pages_adjust/pages/OrderDetail/OrderDetail?id=${item.id}`
               })
            } else {
               uni.navigateTo({
                  url: `/pages_adjust/pages/workOrderReporting/workOrderReporting?id=${item.id}`
            } else {
               uni.navigateTo({
                  url: `/pages_adjust/pages/workOrderReporting/workOrderReporting?id=${item.id}`
               })
            }
         }
@@ -215,20 +259,9 @@
<style lang="scss" scoped>
   .content {
      .content_code {
         position: fixed;
         right: 30rpx;
         bottom: 100rpx;
         img {
            width: 138rpx;
            height: 138rpx;
         }
      }
      .content_top {
         top: 0 !important;
      }
      display: flex;
      flex-direction: column;
      height: 100vh;
      .content_search {
         background: white;