Эх сурвалжийг харах

Merge branch 'master' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-wt

yusheng 10 сар өмнө
parent
commit
9b8ef50a76

+ 0 - 2
src/views/boss/orderTracking/columns.js

@@ -560,7 +560,6 @@ export const getColumns = (vm) => {
       width: 120,
       align: 'center',
       className: 'date-box1',
-
       showOverflowTooltip: true,
       formatter: (row, column, cellValue, index) => {
         return getDeliveryCount(row, column.property);
@@ -572,7 +571,6 @@ export const getColumns = (vm) => {
       width: 120,
       align: 'center',
       className: 'date-box0',
-
       showOverflowTooltip: true,
       formatter: (row, column, cellValue, index) => {
         return getDeliveryCount(row, column.property);

+ 9 - 4
src/views/boss/orderTracking/components/searchTable.vue

@@ -1,6 +1,12 @@
 <!-- 搜索表单 -->
 <template>
-  <seekPage :seekList="seekList" :formLength="3" @search="search"></seekPage>
+  <seekPage
+    ref="seekPage"
+    v-if="seekList.length"
+    :seekList="seekList"
+    :formLength="4"
+    @search="search"
+  ></seekPage>
 </template>
 <script>
   import { reviewStatusSelect, saleOrderProgressStatusEnum } from '@/enum/dict';
@@ -16,7 +22,7 @@
             label: '销售订单号:',
             value: 'orderNo',
             type: 'input',
-            placeholder: ''
+            placeholder: '',
           },
           {
             label: '项目名称:',
@@ -46,8 +52,7 @@
             planList: saleOrderProgressStatusEnum,
             width: 380,
             placeholder: ''
-          },
-        
+          }
         ];
       }
     },

+ 59 - 6
src/views/boss/orderTracking/index.vue

@@ -2,7 +2,7 @@
   <div class="ele-body">
     <el-card shadow="never">
       <div class="filter-container">
-        <search-table @search="reload"></search-table>
+        <search-table @search="reload" ref="search"></search-table>
       </div>
     </el-card>
 
@@ -16,6 +16,7 @@
         height="calc(100% - 80px)"
         @columns-change="handleColumnChange"
         :cache-key="cacheKeyUrl"
+        :cell-class-name="setCellClass"
       >
         <template v-slot:firstProcessDeliveryTime="{ row, $index }">
           <el-date-picker
@@ -97,6 +98,7 @@
   import { mapGetters } from 'vuex';
   import { getColumns } from './columns.js';
   import { getByCode } from '@/api/system/dictionary-data';
+  import { re } from 'mathjs';
   export default {
     mixins: [tabMixins],
     components: {
@@ -131,7 +133,9 @@
           2: '全部发货'
         },
         firstTime: '',
-        records: []
+        records: [],
+        pendingSearchParams: null,
+        today: []
       };
     },
     computed: {
@@ -147,11 +151,44 @@
     },
 
     methods: {
+      getDateProductNum(row, columnKey) {
+        if (!row.deliveryTime) {
+          return false;
+        }
+        const res = row.deliveryTime.split(' ')[0].split('-');
+        const day = 'date' + res[2];
+        return columnKey === day;
+      },
+
       reload(where) {
-        this.$refs.table.reload({ page: 1, where: where });
+        this.$nextTick(() => {
+          if (this.$refs.table) {
+            // 确保 ref 存在后执行 reload
+            this.$refs.table.reload({ page: 1, where: where });
+          }
+        });
       },
+      getDate() {
+        let year = new Date().getFullYear();
+        let month = new Date().getMonth() + 1;
+        month = String(month).padStart(2, '0');
+        let days = new Date(year, month, 0).getDate();
+
+        this.today = [`${year}-${month}-01`, `${year}-${month}-${days}`];
+
+        return {
+          startDate: `${year}-${month}-01`,
+          endDate: `${year}-${month}-${days}`
+        };
+      },
+
       datasource({ page, where, limit, ...row }) {
+        console.log(where);
+
+        let params = this.getDate();
+
         return getListPage({
+          ...params,
           ...where,
           pageNum: page,
           size: limit
@@ -172,6 +209,12 @@
         this.$refs.table.reload({ where: this.params });
       },
 
+      setCellClass({ row, column, rowIndex, columnIndex }) {
+        return this.getDateProductNum(row, column.property)
+          ? 'content-num'
+          : '';
+      },
+
       //打开工艺路线详情
       async produceRouting(row) {
         const res = await getProduceRoutingDetail({
@@ -190,6 +233,11 @@
 
     mounted() {
       this.$store.dispatch('theme/setBodyFullscreen', true);
+      this.$set(
+        this.$refs.search.$refs.seekPage.defaultWhere,
+        'createTime',
+        this.today
+      );
     },
     beforeDestroy() {
       this.$store.dispatch('theme/setBodyFullscreen', false);
@@ -308,14 +356,19 @@
   }
 
   :deep(.ele-pro-table-header-ellipsis > .el-table th.el-table__cell) {
-    background-color: #e3e3e3;
+    background-color: #75bd42;
   }
 
   :deep(.date-box1) {
-    background-color: #f0f9eb;
+    // background-color: #f0f9eb;
   }
 
   :deep(.date-box0) {
-    background-color: rgba(215, 234, 255);
+    // background-color: rgba(215, 234, 255);
+  }
+
+  :deep(.content-num) {
+    color: #000;
+    background-color: #53c77f !important;
   }
 </style>