695593266@qq.com 8 miesięcy temu
rodzic
commit
ade2b7082d

+ 12 - 2
src/api/workOrder/index.js

@@ -13,6 +13,14 @@ export async function getList(params) {
   return Promise.reject(new Error(res.data.message));
 }
 
+export async function getListStop(params) {
+  const res = await request.post('/aps/workorder/pageStop', params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
 // 下达
 export async function releaseWorkOrder(data) {
   const res = await request.post(`/aps/workorder/releaseWorkOrder`, data);
@@ -61,9 +69,11 @@ export async function getUserInfo(id) {
 
 //校验当前用户是否是对应班组班组长
 export async function getcheckLoginUserIsTeamLeader(teamId) {
-  const res = await request.get(`/main/team/checkLoginUserIsTeamLeader/${teamId}`);
+  const res = await request.get(
+    `/main/team/checkLoginUserIsTeamLeader/${teamId}`
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+}

+ 5 - 0
src/views/saleOrder/salesToProductionNewTwo.vue

@@ -1722,6 +1722,11 @@
       },
 
       async publishData(type) {
+        if (!this.form.batchNo) {
+          this.$message.warning('批次号不能为空');
+          return;
+        }
+
         const key = getRouteTabKey();
         let params = deepClone(this.form);
         params.categoryId = params.salesOrders[0]?.categoryId;

+ 90 - 90
src/views/workOrder/components/order-search.vue

@@ -237,7 +237,7 @@
                     />
                   </el-form-item>
                 </el-row>
-
+                <!--
                 <el-row>
                   <el-form-item label="组织机构:">
                     <auth-selection
@@ -247,7 +247,7 @@
                       style="width: 100%"
                     ></auth-selection>
                   </el-form-item>
-                </el-row>
+                </el-row> -->
               </div>
             </el-dropdown-menu>
           </el-dropdown>
@@ -258,100 +258,100 @@
 </template>
 
 <script>
-import { getFactoryarea } from '@/api/saleOrder';
-export default {
-  props: {},
-  data() {
-    // 默认表单数据
-    const defaultWhere = {
-      keyWord: '',
-      code: '',
-      productionPlanCode: '',
-      produceRoutingName: '',
-      productCode: '',
-      productName: '',
-      brandNo: '',
-      model: '',
-      factoryId: '',
-      status: '',
-      createTime: []
-    };
+  import { getFactoryarea } from '@/api/saleOrder';
+  export default {
+    props: {},
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        keyWord: '',
+        code: '',
+        productionPlanCode: '',
+        produceRoutingName: '',
+        productCode: '',
+        productName: '',
+        brandNo: '',
+        model: '',
+        factoryId: '',
+        status: '',
+        createTime: []
+      };
 
-    return {
-      options_factory: [],
-      // 表单数据
-      where: { ...defaultWhere },
-      statusOpt: [
-        { label: '暂停', value: 9 },
-        { label: '终止', value: 10 },
-        { label: '待下达', value: 8 },
-        { label: '待生产', value: 4 },
-        { label: '生产中', value: 5 }
-      ],
-      teamList: []
-    };
-  },
-  computed: {
-    // 是否开启响应式布局
-    styleResponsive() {
-      return this.$store.state.theme.styleResponsive;
-    }
-  },
-  watch: {},
-  mounted() {
-    this.getFactoryarea();
-    this.$nextTick(() => {
-      this.where.factoryId = this.$store.state.user.info.factoryId;
-    });
-  },
-  created() {},
-  methods: {
-    getFactoryarea() {
-      let par = {
-        type: 1,
-        size: 9999
+      return {
+        options_factory: [],
+        // 表单数据
+        where: { ...defaultWhere },
+        statusOpt: [
+          { label: '暂停', value: 9 },
+          { label: '终止', value: 10 },
+          { label: '待下达', value: 8 },
+          { label: '待生产', value: 4 },
+          { label: '生产中', value: 5 }
+        ],
+        teamList: []
       };
-      getFactoryarea(par).then((res) => {
-        if (res.list && res.list.length > 0) {
-          this.options_factory = res.list.map((el) => {
-            console.log(el.id);
-            console.log(el.name);
-            return {
-              value: el.id,
-              label: el.name
-            };
-          });
-          console.log(this.options_factory);
-        }
-      });
     },
-    /* 搜索 */
-    search() {
-      const where = { ...this.where };
-      if (where.createTime?.length) {
-        where.createTimeStart = where.createTime[0];
-        where.createTimeEnd = where.createTime[1];
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
       }
-      delete where.createTime;
-      console.log(where);
-      this.$emit('search', where);
     },
-    /*  重置 */
-    reset() {
-      this.where = { ...this.defaultWhere };
-      this.search();
+    watch: {},
+    mounted() {
+      this.getFactoryarea();
+      this.$nextTick(() => {
+        this.where.factoryId = this.$store.state.user.info.factoryId;
+      });
+    },
+    created() {},
+    methods: {
+      getFactoryarea() {
+        let par = {
+          type: 1,
+          size: 9999
+        };
+        getFactoryarea(par).then((res) => {
+          if (res.list && res.list.length > 0) {
+            this.options_factory = res.list.map((el) => {
+              console.log(el.id);
+              console.log(el.name);
+              return {
+                value: el.id,
+                label: el.name
+              };
+            });
+            console.log(this.options_factory);
+          }
+        });
+      },
+      /* 搜索 */
+      search() {
+        const where = { ...this.where };
+        if (where.createTime?.length) {
+          where.createTimeStart = where.createTime[0];
+          where.createTimeEnd = where.createTime[1];
+        }
+        delete where.createTime;
+        console.log(where);
+        this.$emit('search', where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
     }
-  }
-};
+  };
 </script>
 <style lang="scss" scoped>
-.ele-form-actions {
-  display: flex;
-  align-items: center;
-  justify-content: flex-start;
-  padding-top: 4.5px;
-}
-.searchExpend {
-  padding: 20px 50px 0 30px;
-}
+  .ele-form-actions {
+    display: flex;
+    align-items: center;
+    justify-content: flex-start;
+    padding-top: 4.5px;
+  }
+  .searchExpend {
+    padding: 20px 50px 0 30px;
+  }
 </style>

+ 21 - 4
src/views/workOrder/index.vue

@@ -2,6 +2,14 @@
   <div class="ele-body">
     <el-card v-loading="loading" shadow="never">
       <order-search ref="searchRef" @search="reload"></order-search>
+
+      <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-tab-pane label="我的任务" name="1"></el-tab-pane>
+        <el-tab-pane label="全部任务" name="2"></el-tab-pane> -->
+      </el-tabs>
       <!--      <el-tabs v-model="activeName" type="card">
         <el-tab-pane label="未完成工单" name="first"></el-tab-pane>
         <el-tab-pane label="已完成工单" name="second"></el-tab-pane>
@@ -163,7 +171,8 @@
     getList,
     releaseWorkOrder,
     updatePriority,
-    unpackDel
+    unpackDel,
+    getListStop
   } from '@/api/workOrder/index.js';
   import {
     listByFirstTaskId,
@@ -239,7 +248,8 @@
         dispatchRow: {},
         dispatchVisible: false,
         selectionMap: {},
-        detailsVisible: false
+        detailsVisible: false,
+        tabValue: '1'
       };
     },
     computed: {
@@ -340,7 +350,7 @@
             prop: 'factoryName',
             label: '所属工厂',
             align: 'center',
-            minWidth: 100,
+            minWidth: 100
           },
           {
             prop: 'taskName',
@@ -681,7 +691,8 @@
           where.statusList.push(where.status);
           delete where.status;
         }
-        return getList({
+        const URL = this.tabValue == '1' ? getList : getListStop;
+        return URL({
           pageNum: page,
           size: limit,
           ...where,
@@ -794,6 +805,12 @@
         });
       },
 
+      handleTabClick(e) {
+        console.log(e.name);
+        this.tabValue = e.name;
+        this.reload();
+      },
+
       onSortChange(e) {
         let sort = {
           orderBy: e.order,