Răsfoiți Sursa

新增作业执行页面和执行详情页面路由

pm 11 luni în urmă
părinte
comite
e581004809

+ 20 - 0
src/api/mes/jobplay/jobplay.js

@@ -0,0 +1,20 @@
+import request from '@/utils/request'
+
+
+// 查询作业票类型-列表
+export function listJobPlayTicket(query) {
+  return request({
+    url: '/iscs/ticket/getMonitorJobTicketPage',
+    method: 'get',
+    params: query
+  })
+}
+
+// 获取作业票类型详细信息
+export function getJobPlayTicketInfo(repairId) {
+  return request({
+    url: '/iscs/ticket/selectMonitorJobTicketDetail?ticketId=' + repairId,
+    method: 'get'
+  })
+}
+

+ 32 - 21
src/router/index.js

@@ -20,12 +20,12 @@ import Layout from '@/layout'
  * roles: ['admin', 'common']       // 访问路由的角色权限
  * permissions: ['a:a:a', 'b:b:b']  // 访问路由的菜单权限
  * meta : {
-    noCache: true                   // 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
-    title: 'title'                  // 设置该路由在侧边栏和面包屑中展示的名字
-    icon: 'svg-name'                // 设置该路由的图标,对应路径src/assets/icons/svg
-    breadcrumb: false               // 如果设置为false,则不会在breadcrumb面包屑中显示
-    activeMenu: '/system/user'      // 当路由设置了该属性,则会高亮相对应的侧边栏。
-  }
+ noCache: true                   // 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
+ title: 'title'                  // 设置该路由在侧边栏和面包屑中展示的名字
+ icon: 'svg-name'                // 设置该路由的图标,对应路径src/assets/icons/svg
+ breadcrumb: false               // 如果设置为false,则不会在breadcrumb面包屑中显示
+ activeMenu: '/system/user'      // 当路由设置了该属性,则会高亮相对应的侧边栏。
+ }
  */
 
 // 公共路由
@@ -117,23 +117,23 @@ export const dynamicRoutes = [
         path: 'NewSop',
         component: () => import('@/views/mes/sop/sopm/NewSop'),
         name: 'NewSop',
-        meta: { title: 'SOP管理-新建SOP', activeMenu: '/mes/sop/sopm/NewSop' },
+        meta: { title: 'SOP管理-新建SOP', activeMenu: '/mes/sop/sopm/NewSop' }
 
       },
       {
         path: 'NewSopEdit',
         component: () => import('@/views/mes/sop/sopm/NewSop'),
         name: 'NewSopEdit',
-        meta: { title: 'SOP管理-编辑SOP', activeMenu: '/mes/sop/sopm/NewSop' },
+        meta: { title: 'SOP管理-编辑SOP', activeMenu: '/mes/sop/sopm/NewSop' }
 
       },
       {
         path: 'sopmLook',
         component: () => import('@/views/mes/sop/sopm/sopmLook'),
         name: 'sopmLook',
-        meta: { title: 'SOP管理-查看SOP', activeMenu: '/mes/sop/sopm/sopmLook' },
+        meta: { title: 'SOP管理-查看SOP', activeMenu: '/mes/sop/sopm/sopmLook' }
 
-      },
+      }
     ]
   },
   {
@@ -146,14 +146,14 @@ export const dynamicRoutes = [
         path: 'NewOperations',
         component: () => import('@/views/mes/job/jobm/NewOperations'),
         name: 'NewOperations',
-        meta: { title: '作业管理-新建作业票', activeMenu: '/mes/job/jobm/NewOperations' },
+        meta: { title: '作业管理-新建作业票', activeMenu: '/mes/job/jobm/NewOperations' }
 
       },
       {
         path: 'NewOperationsEdit',
         component: () => import('@/views/mes/job/jobm/NewOperations'),
         name: 'NewOperationsEdit',
-        meta: { title: '作业管理-编辑作业票', activeMenu: '/mes/job/jobm/NewOperations' },
+        meta: { title: '作业管理-编辑作业票', activeMenu: '/mes/job/jobm/NewOperations' }
 
       },
       {
@@ -161,11 +161,24 @@ export const dynamicRoutes = [
         component: () => import('@/views/mes/job/jobm/lookWork'),
         name: 'lookWork',
         meta: { title: '作业管理-查看作业票', activeMenu: '/mes/job/jobm/lookWork' }
-      },
-
+      }
 
     ]
   },
+  {
+    path: '/mes/job/jobplay',
+    component: Layout,
+    hidden: true,
+    permissions: ['mes:job:jobplay:view'],
+    children: [
+      {
+        path: 'jobPlayDetail',
+        component: () => import('@/views/mes/job/jobplay/jobPlayDetail'),
+        name: 'jobPlayDetail',
+        meta: { title: '作业管理-新建作业票', activeMenu: '/mes/job/jobplay/jobPlayDetail' }
+      }
+    ]
+  },
   {
     path: '/mes/md/workarea/index',
     component: Layout,
@@ -176,8 +189,8 @@ export const dynamicRoutes = [
         path: 'MapData',
         component: () => import('@/views/mes/md/workarea/MapData'),
         name: 'MapData',
-        meta: { title: '预览', activeMenu: '/mes/md/workarea/MapData' },
-      },
+        meta: { title: '预览', activeMenu: '/mes/md/workarea/MapData' }
+      }
     ]
   },
   {
@@ -258,7 +271,7 @@ export const dynamicRoutes = [
     children: [
       {
         path: 'ganttedit',
-        component: () => import("@/views/mes/pro/schedule/ganttedit"),
+        component: () => import('@/views/mes/pro/schedule/ganttedit'),
         name: 'ganttEdit',
         meta: { title: '使用甘特图排产', activeMenu: '/mes/pro/schedule' }
       }
@@ -330,7 +343,7 @@ export const dynamicRoutes = [
     children: [
       {
         path: 'edit',
-        component: () => import("@/views/print/printtemplate/index"),
+        component: () => import('@/views/print/printtemplate/index'),
         name: 'printTemplateEdit',
         meta: { title: '打印模板编辑', activeMenu: '/print/printtemplate/edit' }
       }
@@ -338,10 +351,8 @@ export const dynamicRoutes = [
   }
 ]
 
-
-
 //防止连续点击多次路由报错
-let routerPush = Router.prototype.push;
+let routerPush = Router.prototype.push
 Router.prototype.push = function push(location) {
   return routerPush.call(this, location).catch(err => err)
 }

+ 405 - 0
src/views/mes/job/jobplay/index.vue

@@ -0,0 +1,405 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="100px"
+    >
+      <el-form-item label="作业票编号" prop="ticketCode">
+        <el-input
+          v-model="queryParams.ticketCode"
+          placeholder="请输入作业票编号"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="作业票名称" prop="ticketName">
+        <el-input
+          v-model="queryParams.ticketName"
+          placeholder="请输入作业票名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="状态" prop="ticketStatus">
+        <el-select v-model="queryParams.ticketStatus" placeholder="状态">
+          <el-option
+            v-for="dict in dict.type.ticket_status"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="工作区域" prop="workareaId">
+        <el-select v-model="queryParams.workareaId" placeholder="请选择区域">
+          <el-option
+            v-for="dict in this.workareaList"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="创建时间">
+        <el-date-picker
+          style="width: 218px"
+          v-model="createTime"
+          type="daterange"
+          align="right"
+          unlink-panels
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          :picker-options="pickerOptions"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="作业类型" prop="ticketType">
+        <el-select
+          v-model="queryParams.ticketType"
+          placeholder="请选择作业类型"
+        >
+          <el-option
+            v-for="dict in dict.type.ticket_type"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button v-no-more-click
+                   type="primary"
+                   icon="el-icon-search"
+                   size="mini"
+                   @click="handleQuery"
+        >搜索</el-button
+        >
+        <el-button v-no-more-click icon="el-icon-refresh" size="mini" @click="resetQuery"
+        >重置</el-button
+        >
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button v-no-more-click
+                   type="danger"
+                   plain
+                   icon="el-icon-delete"
+                   size="mini"
+                   :disabled="multiple"
+                   @click="handleDelete"
+                   v-hasPermi="['mes:job:jobplay:remove']"
+        >批量删除
+        </el-button>
+      </el-col>
+
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
+    </el-row>
+
+    <el-table
+      v-loading="loading"
+      :data="jobList"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="55" align="center" />
+       <el-table-column
+        label="作业票Id"
+        prop="ticketId"
+        width="75"
+      ></el-table-column>
+      <el-table-column label="作业票编号" align="center" prop="ticketCode">
+      </el-table-column>
+      <el-table-column label="作业票名称" align="center" prop="ticketName" />
+      <el-table-column label="作业类型" align="center" prop="ticketType">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.ticket_type"
+            :value="scope.row.ticketType"
+          />
+        </template>
+      </el-table-column>
+      <el-table-column label="上锁状态" align="center" prop="ticketName" />
+      <el-table-column label="创建时间" align="center" prop="createTime">
+      </el-table-column>
+      <el-table-column
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
+        <template slot-scope="scope">
+          <el-button v-no-more-click
+                     size="mini"
+                     type="text"
+                     icon="el-icon-view"
+                     @click="handleLook(scope.row)"
+                     v-hasPermi="['mes:job:jobplay:view']"
+          >查看
+          </el-button>
+          <el-button v-no-more-click
+                     size="mini"
+                     type="text"
+                     icon="el-icon-delete"
+                     @click="handleDelete(scope.row)"
+                     v-hasPermi="['mes:job:jobplay:remove']"
+          >删除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.current"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import {listJobPlayTicket,getJobPlayTicketInfo} from "@/api/mes/jobplay/jobplay"
+
+import { genCode } from "@/api/system/autocode/rule";
+
+export default {
+  name: "Team",
+  dicts: ["ticket_type", "ticket_status"],
+  data() {
+    return {
+      //自动生成编码
+      autoGenFlag: false,
+      optType: undefined,
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      codes: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 班组表格数据
+      jobList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 车间数据
+      workshopList: [],
+      // 工作区域数据
+      workareaList: [],
+      // 查询参数
+      createTime: "",
+      queryParams: {
+        current: 1,
+        size: 10,
+        ticketCode: null,
+        ticketName: null,
+        ticketStatus: null,
+        workshopId: null,
+        workareaId: null,
+        ticketType: null,
+        startTime: "",
+        endTime: "",
+      },
+      pickerOptions: {
+        shortcuts: [
+          {
+            text: "最近一周",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+          {
+            text: "最近一个月",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+          {
+            text: "最近三个月",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+        ],
+      },
+
+      // 表单参数
+      form: {},
+      //
+    };
+  },
+  created() {
+    this.getList();
+
+  },
+
+  methods: {
+
+    // 格式化日期查询数据
+    formatDate(date) {
+      if (date && date instanceof Date && !isNaN(date)) {
+        // 使用本地时间
+        return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(
+          2,
+          "0"
+        )}-${String(date.getDate()).padStart(2, "0")}`;
+      }
+      return null;
+    },
+    /** 查询班组列表 */
+    getList() {
+      this.loading = true;
+      // 格式化日期并更新queryParams
+      if (Array.isArray(this.createTime) && this.createTime.length === 2) {
+        this.queryParams.startTime = this.formatDate(this.createTime[0]);
+        this.queryParams.endTime = this.formatDate(this.createTime[1]);
+      }
+      listJobPlayTicket(this.queryParams).then((response) => {
+        console.log(response, "response--作业票列表");
+        this.jobList = response.data.records;
+        this.total = response.data.total;
+        this.loading = false;
+      });
+    },
+
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        ticketCode: null,
+        ticketName: null,
+        ticketStatus: null,
+        workareaName: null,
+        workshopName: null,
+        ticketType: null,
+        pointCount: null,
+        createTime: null,
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.current = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.createTime = "";
+      (this.queryParams.startTime = ""),
+        (this.queryParams.endTime = ""),
+        this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map((item) => item.ticketId);
+      this.codes = selection.map((item) => item.ticketCode);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
+    },
+    /** 新增按钮操作 */
+    handleAdd(val) {
+
+      this.reset();
+      this.open = true;
+      this.selectSopPoints(null);
+      this.PointTableData(null);
+      this.$router.push(`/mes/job/jobm/NewOperations?ticketId=null`);
+      this.title = "添加隔离点";
+      this.optType = "add";
+
+    },
+    // 查看
+    handleLook(row) {
+      // 设置为true表示作业票里查看不可以点击隔离点
+
+      this.$router.push(`/mes/job/jobplay/jobPlayDetail?ticketId=${row.ticketId}`);
+    },
+
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const teamId = row.ticketId || this.ids;
+      this.setSopLook(false);
+
+      this.$router.push(
+        `/mes/job/jobm/NewOperationsEdit?ticketId=${row.ticketId}`
+      );
+
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          if (this.form.teamId != null) {
+            updateTeam(this.form).then((response) => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addTeam(this.form).then((response) => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const teamIds = row.ticketId || this.ids;
+      const titcketCodes = row.ticketCode || this.codes;
+      this.$modal
+        .confirm('是否确认删除作业票编号为"' + titcketCodes + '"的数据项?')
+        .then(function () {
+          return deleteIsJobTicket(teamIds);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
+
+
+  },
+};
+</script>
+<style lang="scss" src="@/assets/styles/dialog-title.scss" scoped>
+.el-input-width {
+  width: 380px !important;
+}
+</style>

+ 13 - 0
src/views/mes/job/jobplay/jobPlayDetail.vue

@@ -0,0 +1,13 @@
+<script>
+export default {
+  name: 'jobPlayDetail'
+}
+</script>
+
+<template>
+
+</template>
+
+<style scoped lang="scss">
+
+</style>

+ 2 - 38
src/views/mes/md/segregationpoint/index.vue

@@ -190,30 +190,6 @@
           />
         </template>
       </el-table-column>
-
-       <el-table-column label="锁具名称" align="center" prop="lockTypeName">
-      </el-table-column>
-      <el-table-column label="锁具类型" align="center" prop="lockTypeId">
-        <template slot-scope="scope">
-          <dict-tag
-            :options="dict.type.lock_type"
-            :value="scope.row.lockTypeId"
-          />
-
-        </template>
-      </el-table-column>
-      <el-table-column label="锁具图标" align="center" prop="lockTypeIcon" width="90">
-        <template slot-scope="scope">
-          <img :src="scope.row.lockTypeIcon" alt="" style="width: 50px; height: 50px" v-if="scope.row.lockTypeIcon"/>
-          <span v-else>-</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="锁具图片" align="center" prop="lockTypeImg" width="90">
-        <template slot-scope="scope">
-          <img :src="scope.row.lockTypeImg" alt="" style="width: 50px; height: 50px" v-if="scope.row.lockTypeImg"/>
-          <span v-else>-</span>
-        </template>
-      </el-table-column>
       <el-table-column label="危险能量类型" align="center" prop="powerType">
         <template slot-scope="scope">
           <dict-tag
@@ -603,27 +579,15 @@ export default {
     },
     //图标上传成功
     handleIconUplaoded(imgUrl) {
+      console.log(imgUrl,'gelidian ')
       this.form.pointIcon = imgUrl[0].url;
     },
-    handleIconUplaoded1(imgUrl){
-      this.form.lockTypeImg = imgUrl[0].url;
-    },
-    //图标上传成功
-    handleIconUplaoded2(imgUrl) {
-      this.form.lockTypeIcon = imgUrl[0].url;
-    },
 
     // 图标移除
     handleIconRemoved(imgUrl) {
       this.form.pointIcon = null;
     },
-    // 图标移除
-    handleIconRemoved1(imgUrl) {
-      this.form.lockTypeImg = null;
-    },
-    handleIconRemoved2(imgUrl){
-      this.form.lockTypeIcon = ''
-    },
+
     //图片移除
     handleImgRemoved(imgUrl) {
       this.form.pointPicture = null;