695593266@qq.com 2 месяцев назад
Родитель
Сommit
57d2e003b4
1 измененных файлов с 41 добавлено и 14 удалено
  1. 41 14
      src/views/beEntrusted/index.vue

+ 41 - 14
src/views/beEntrusted/index.vue

@@ -3,6 +3,17 @@
     <el-card shadow="never" v-loading="loading">
       <!-- <order-search @search="reload" ref="searchRef"> </order-search> -->
       <seek-page :seekList="seekList" @search="search"></seek-page>
+
+      <div class="btn_box">
+        <el-button type="primary" @click="salesToProductionOpen(2)"
+          >转生产订单</el-button
+        ></div
+      >
+
+      <el-tabs v-model="tabValue" type="card" @tab-click="handleTabClick">
+        <el-tab-pane label="受托任务" name="1"></el-tab-pane>
+        <el-tab-pane label="预处理任务" name="2"></el-tab-pane>
+      </el-tabs>
       <ele-pro-table
         ref="table"
         :columns="columns"
@@ -16,17 +27,6 @@
         :selection.sync="selection"
         @fullscreen-change="fullscreenChange"
       >
-        <template v-slot:toolbar>
-          <!-- <el-button type="primary" @click="salesToProductionOpen(1)"
-            >转生产计划</el-button
-          > -->
-          <el-button type="primary" @click="salesToProductionOpen(2)"
-            >转生产订单</el-button
-          >
-          <!-- <el-button type="primary" @click="salesToProductionOpen(3)"
-            >转生产工单</el-button
-          > -->
-        </template>
         <template v-slot:type="{ row }">
           <span> {{ getDictValue('请托类型', row.type + '') }}</span>
         </template>
@@ -209,7 +209,8 @@
         tableHeight: 'calc(100vh - 320px)',
         selection: [],
         factoryList: [],
-        typeList: []
+        typeList: [],
+        tabValue: '1'
       };
     },
     computed: {
@@ -461,6 +462,16 @@
             planList: this.factoryList
           },
           // {
+          //   label: '状态:',
+          //   value: 'preStatus',
+          //   type: 'select',
+          //   planList: [
+          //     { value: 0, label: '准备中' },
+          //     { value: 1, label: '准备完成' },
+          //     { value: 2, label: '取消' }
+          //   ]
+          // },
+          // {
           //   label: '受托工厂:',
           //   value: 'beEntrustedFactoriesId',
           //   type: 'select',
@@ -503,10 +514,16 @@
           endTime
         });
       },
+
       open(type, row) {
         this.$refs.create.open(type, row);
       },
 
+      handleTabClick(e) {
+        this.tabValue = e.name;
+        this.reload();
+      },
+
       async getTypeList() {
         let res = await getByCode('entrust_type');
         if (res?.code == 0) {
@@ -591,8 +608,14 @@
       },
       /* 刷新表格 */
       reload(where) {
+        const queryWhere = { ...(where || {}) };
+        if (this.tabValue === '2') {
+          queryWhere.preStatus = 1;
+        } else {
+          delete queryWhere.preStatus;
+        }
         this.$nextTick(() => {
-          this.$refs.table.reload({ page: 1, where });
+          this.$refs.table.reload({ page: 1, where: queryWhere });
         });
       },
 
@@ -619,4 +642,8 @@
   };
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+  .btn_box {
+    margin-bottom: 6px;
+  }
+</style>