Parcourir la source

新增人工上传的异常页面,修改工卡和锁定站渲染部分问题

pm il y a 7 mois
Parent
commit
90e37ba386

+ 1 - 1
src/api/mes/material/exception.js

@@ -1,6 +1,6 @@
 import request from '@/utils/request'
 
-// 查询物资信息--分页 /dev-api/iscs/materials/getIsMaterialsPage
+// 查询物资异常--分页 /dev-api/iscs/materials/getIsMaterialsPage
 export function MaterialsLoanExceptionPage(query) {
   return request({
     url: '/iscs/exception/getIsMaterialsLoanExceptionPage',

+ 49 - 0
src/api/mes/material/manualException.js

@@ -0,0 +1,49 @@
+import request from '@/utils/request'
+
+// 查询人工传入异常信息--分页 /dev-api/iscs/materials/getIsMaterialsPage
+export function getIsExceptionPage(query) {
+  return request({
+    url: '/iscs/exception/getIsExceptionPage',
+    method: 'get',
+    params: query
+  })
+}
+
+// 新增人工传入异常信息 /dev-api/iscs/materials/insertIsMaterials
+export function insertIsException(data) {
+  return request({
+    url: '/iscs/exception/insertIsException',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改人工传入异常信息
+export function updateIsException(data) {
+  return request({
+    url: '/iscs/exception/updateIsException',
+    method: 'post',
+    data: data
+  })
+}
+
+// 删除人工传入异常信息
+export function deleteIsExceptionByExceptionIds(data) {
+  return request({
+    url: '/iscs/exception/deleteIsExceptionByExceptionIds?exceptionIds=' + data,
+    method: 'post',
+  })
+}
+
+// 获取人工传入异常详细信息
+export function selectMaterialsById(query) {
+  return request({
+    url: '/iscs/exception/selectIsExceptionById?exceptionId=' + query,
+    method: 'get',
+  })
+}
+
+
+
+
+

+ 529 - 0
src/views/mes/Exceptions/manualException/index.vue

@@ -0,0 +1,529 @@
+<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="exceptionCategory">
+        <el-select v-model="queryParams.exceptionCategory" placeholder="请选择" clearable>
+          <el-option
+            v-for="dict in dict.type.classification_of_exceptions"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="异常来源" prop="sourceName">
+        <el-input
+          v-model="queryParams.sourceName"
+          placeholder="请输入异常来源"
+          clearable
+          size="small"
+        />
+      </el-form-item>
+      <el-form-item label="异常类型" prop="exceptionType">
+        <el-select v-model="queryParams.exceptionType" placeholder="请选择" clearable>
+          <el-option
+            v-for="dict in dict.type.type_of_exception"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="严重等级" prop="exceptionLevel">
+        <el-select v-model="queryParams.exceptionLevel" placeholder="请选择" clearable>
+          <el-option
+            v-for="dict in dict.type.severity_level"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="上报人" prop="raiserName">
+        <el-input
+          v-model="queryParams.raiserName"
+          placeholder="请输入上报人"
+          clearable
+          size="small"
+
+        />
+      </el-form-item>
+      <el-form-item label="异常发生时间">
+        <el-date-picker
+          style="width: 215px"
+          :default-time="['00:00:00', '23:59:59']"
+          v-model="raiseTime"
+          type="datetimerange"
+          :picker-options="pickerOptions"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          align="right"
+          @change="handleClearTime"
+        >
+        </el-date-picker>
+      </el-form-item>
+
+      <el-form-item label="异常解除时间">
+        <el-date-picker
+          style="width: 215px"
+          :default-time="['00:00:00', '23:59:59']"
+          v-model="handleTime"
+          type="datetimerange"
+          :picker-options="pickerOptions"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          align="right"
+          @change="handleClearTime2"
+        >
+        </el-date-picker>
+      </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-radio-group v-model="tabPosition" style="margin: 5px">
+      <el-radio-button label="first">全部</el-radio-button>
+      <el-radio-button label="second">待处理</el-radio-button>
+      <el-radio-button label="third">已处理</el-radio-button>
+    </el-radio-group>
+    <el-table
+      v-loading="loading"
+      :data="ExceptionList"
+    >
+      <el-table-column label="编号" align="center" prop="exceptionId">
+      </el-table-column>
+      <el-table-column label="异常分类" align="center" prop="exceptionCategory">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.classification_of_exceptions" :value="scope.row.exceptionCategory"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="异常来源" align="center" prop="sourceName">
+      </el-table-column>
+      <el-table-column label="异常类型" align="center" prop="exceptionTypeName">
+      </el-table-column>
+      <el-table-column label="严重等级" align="center" prop="exceptionLevelName">
+      </el-table-column>
+      <el-table-column label="上报人" align="center" prop="raiserName">
+      </el-table-column>
+      <el-table-column label="状态" align="center" prop="status">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.manual_status" :value="scope.row.status"/>
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="异常发生时间"
+        align="center"
+        prop="raiseTime"
+      >
+      </el-table-column>
+      <el-table-column label="异常解除时间" align="center" prop="handleTime">
+      </el-table-column>
+      <el-table-column label="操作">
+        <template slot-scope="scope">
+          <el-button type="text" @click="handleCheck(scope.row)">查看</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.current"
+      :limit.sync="queryParams.size"
+      @pagination="getList"
+    />
+    <el-dialog :visible.sync="open" width="550px" append-to-body class="elDialog">
+      <div slot="title" class="dialog-title">
+        <i></i>
+        <span class="title">{{ title }}</span>
+      </div>
+      <div class="exception-details" v-if="exceptionData">
+        <table border="1" cellpadding="10" cellspacing="0" style="width: 100%; border-collapse: collapse;">
+          <tbody>
+          <!-- 异常分类 -->
+          <tr style="border-bottom: 1px solid #ddd;">
+            <td style="text-align: right; width: 120px;">
+              <strong>异常分类:</strong>
+            </td>
+            <td style="text-align: left;">
+              <dict-tag :options="dict.type.classification_of_exceptions" :value="exceptionData.exceptionCategory"/>
+            </td>
+          </tr>
+
+          <!-- 异常来源 -->
+          <tr style="border-bottom: 1px solid #ddd;">
+            <td style="text-align: right;">
+              <strong>异常来源:</strong>
+            </td>
+            <td style="text-align: left;">
+              {{ exceptionData.sourceName }}
+            </td>
+          </tr>
+
+          <!-- 异常类型 -->
+          <tr style="border-bottom: 1px solid #ddd;">
+            <td style="text-align: right;">
+              <strong>异常类型:</strong>
+            </td>
+            <td style="text-align: left;">
+              {{ exceptionData.exceptionTypeName }}
+            </td>
+          </tr>
+
+          <!-- 严重等级 -->
+          <tr style="border-bottom: 1px solid #ddd;">
+            <td style="text-align: right;">
+              <strong>严重等级:</strong>
+            </td>
+            <td style="text-align: left;">
+              {{ exceptionData.exceptionLevelName }}
+            </td>
+          </tr>
+
+          <!-- 状态 -->
+          <tr style="border-bottom: 1px solid #ddd;">
+            <td style="text-align: right;">
+              <strong>状态:</strong>
+            </td>
+            <td style="text-align: left;">
+              <dict-tag :options="dict.type.manual_status" :value="exceptionData.status"/>
+            </td>
+          </tr>
+
+          <!-- 上报人 -->
+          <tr style="border-bottom: 1px solid #ddd;">
+            <td style="text-align: right;">
+              <strong>上报人:</strong>
+            </td>
+            <td style="text-align: left;">
+              {{ exceptionData.raiserName }}
+            </td>
+          </tr>
+
+          <!-- 异常发生时间 -->
+          <tr style="border-bottom: 1px solid #ddd;">
+            <td style="text-align: right;">
+              <strong>异常发生时间:</strong>
+            </td>
+            <td style="text-align: left;">
+              {{ exceptionData.raiseTime }}
+            </td>
+          </tr>
+
+          <!-- 异常解除时间 -->
+          <tr style="border-bottom: 1px solid #ddd;">
+            <td style="text-align: right;">
+              <strong>异常解除时间:</strong>
+            </td>
+            <td style="text-align: left;">
+              {{ exceptionData.handleTime }}
+            </td>
+          </tr>
+
+          <!-- 异常描述 -->
+          <tr style="border-bottom: 1px solid #ddd; height: 250px;">
+            <td style="text-align: right; vertical-align: top;">
+              <strong>异常描述:</strong>
+            </td>
+            <td style="text-align: left; vertical-align: top;">
+              {{ exceptionData.exceptionDescription }}
+            </td>
+          </tr>
+          </tbody>
+        </table>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button
+          :disabled="exceptionData.status=='1'"
+          v-no-more-click
+          type="primary"
+          @click="handleDeal"
+        >处 理
+        </el-button>
+        <el-button v-no-more-click type="primary" @click="cancel"
+        >关 闭
+        </el-button>
+      </div>
+    </el-dialog>
+  </div>
+
+</template>
+
+<script>
+
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import Template from '@/views/print/printtemplate/list.vue'
+import { MaterialsLoanExceptionPage } from '@/api/mes/material/exception'
+import { getIsExceptionPage, selectMaterialsById, updateIsException } from '@/api/mes/material/manualException'
+
+export default {
+  name: 'Team',
+  components: { Template, Treeselect },
+  dicts: ['classification_of_exceptions', 'type_of_exception', 'severity_level', 'manual_status'],
+  data() {
+    return {
+      //自动生成编码
+      autoGenFlag: false,
+      optType: undefined,
+
+      tabPosition: 'first',
+      // 遮罩层
+      loading: true,
+      loadStatus: '',//弹窗加加载
+      // 选中数组
+      ids: [],
+      codes: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 班组表格数据
+      ExceptionList: [],
+      // mars树选项
+      marsOptions: [],
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      raiseTime: '',
+      handleTime: '',
+      queryParams: {
+        current: 1,
+        size: 10,
+        exceptionCategory: '',//异常种类(0-锁控柜 1-物资柜)
+        exceptionDescription: '',
+        exceptionLevel: '',//异常等级
+        exceptionLevelName: '',//异常等级名称
+        exceptionType: '',//异常类型
+        exceptionTypeName: '',//异常类型名称
+        raiseTime: '',//异常发生时间
+        raiser: '',//发起人Id
+        raiserName: '',//发起人名称
+        sourceId: '',//来源Id
+        sourceName: '',//来源Name
+        startHandleTime: '',//异常处理时间开始
+        endHandleTime: '',//异常处理时间结束
+        startRaiseTime: '',//异常发生时间开始
+        endRaiseTime: '',//异常发生结束时间
+        status: ''//待处理0 已处理1
+      },
+      title: '',
+      exceptionData: {  },
+      // 表单参数
+      form: {},
+      cabinets: [], //物资所属柜
+      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])
+            }
+          }
+        ]
+      }
+
+    }
+  },
+  watch: {
+    tabPosition: function(val, oldVal) {
+      if (val == 'second') {
+        this.queryParams.status = '0'
+        this.getList()
+      }else if(val == 'third') {
+        this.queryParams.status = '1'
+        this.getList()
+      }else {
+        this.queryParams.status = ''
+        this.getList()
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+
+  methods: {
+    formatDate(date) {
+      const year = date.getFullYear().toString().padStart(2, '0')
+      const month = (date.getMonth() + 1).toString().padStart(2, '0')
+      const day = date.getDate().toString().padStart(2, '0')
+      const hours = date.getHours().toString().padStart(2, '0')
+      const minutes = date.getMinutes().toString().padStart(2, '0')
+      const seconds = date.getSeconds().toString().padStart(2, '0')
+
+      return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
+    },
+    /** 查询物资信息列表 */
+    getList() {
+      this.loading = true
+      if (Array.isArray(this.raiseTime) && this.raiseTime.length === 2) {
+        this.queryParams.startRaiseTime = this.formatDate(this.raiseTime[0])
+        this.queryParams.endRaiseTime = this.formatDate(this.raiseTime[1])
+      }
+      if (Array.isArray(this.handleTime) && this.handleTime.length === 2) {
+        this.queryParams.startHandleTime = this.formatDate(this.handleTime[0])
+        this.queryParams.endHandleTime = this.formatDate(this.handleTime[1])
+      }
+      const data = {
+        ...this.queryParams
+      }
+      getIsExceptionPage(data).then((response) => {
+        console.log(response, '获取物资归还异常allList ')
+        this.ExceptionList = response.data.records
+        this.total = response.data.total
+        this.loading = false
+      })
+    },
+    // 查看
+    handleCheck(row) {
+      this.title = '异常详情'
+      this.open = true
+      this.loadStatus=this.$loading({
+        target:".elDialog .el-dialog"
+      })
+      setTimeout(() => {
+        this.loadStatus.close()
+      },500)
+      selectMaterialsById(row.exceptionId).then(response => {
+        this.exceptionData = response.data
+      })
+    },
+    // 处理按钮
+    handleDeal() {
+      let data
+      if(this.exceptionData.status == '0') {
+        data={
+          ...this.exceptionData,
+          status:1
+        }
+      }else{
+        data={
+          ...this.exceptionData,
+        }
+      }
+
+      updateIsException(data).then((response) => {
+        console.log(response)
+        this.$modal.msgSuccess("修改成功");
+        this.open = false
+        this.getList()
+      })
+    },
+// 取消按钮
+    cancel() {
+      this.open = false
+      this.reset()
+    },
+    // 表单重置
+    reset() {
+      this.resetForm('form')
+      this.autoGenFlag = false
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.size = 10
+      this.getList()
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams.startRaiseTime=""
+      this.queryParams.endRaiseTime =""
+      this.raiseTime = ''
+      this.handleTime = ''
+      this.queryParams.startHandleTime=""
+      this.queryParams.endHandleTime =""
+      this.resetForm('queryForm')
+      this.handleQuery()
+    },
+    handleClearTime(value) {
+      if (value == null) {
+        this.queryParams.startTime = null
+        this.queryParams.endTime = null
+      }
+    },
+    handleClearTime2(value) {
+      if (value == null) {
+        this.queryParams.handleStartTime = null
+        this.queryParams.handleEndTime = null
+      }
+    }
+
+  }
+}
+</script>
+<style lang="scss" src="@/assets/styles/dialog-title.scss" scoped>
+.el-input-width {
+  width: 380px !important;
+
+}
+
+table {
+  width: 100%;
+  border-collapse: collapse;
+}
+
+th, td {
+  border: 1px solid #ddd;
+  padding: 10px;
+  text-align: left;
+}
+
+th {
+  background-color: #f5f5f5;
+  font-weight: bold;
+}
+
+td p {
+  margin: 5px 0;
+}
+</style>

+ 2 - 2
src/views/mes/dv/technology/technologyDetail/MapData.vue

@@ -386,8 +386,8 @@ const positions=this.pointList
 
           // 创建对号文本
           const redtext = new Konva.Text({
-            x: x - 5 + 42 / 2, // 水平居中
-            y: y + 62 / 2, // 垂直居中
+            x: x - 8 + 42 / 2, // 水平居中
+            y: y + 50 / 2, // 垂直居中
             fontSize: 24, // 根据需要调整字体大小
             text: '✔',
             fontFamily: 'Arial',

+ 1 - 1
src/views/mes/hw/Keys/index.vue

@@ -203,7 +203,7 @@
           <el-input
             v-model="form.keyNfc"
             placeholder="请输入钥匙Nfc"
-
+            maxlength="16"
           />
         </el-form-item>
         <el-form-item label="MAC地址" prop="macAddress">

+ 11 - 0
src/views/mes/hw/workCard/index.vue

@@ -183,6 +183,7 @@
             placeholder="请选择工卡用户"
             clearable
             style="width: 100%"
+            @change="handleSelectUser"
           >
             <el-option
               v-for="dict in this.userList"
@@ -218,6 +219,7 @@
           <el-input
             v-model="form.cardNfc"
             placeholder="请输入工卡Nfc"
+            maxlength="16"
           />
         </el-form-item>
         <el-form-item label="工卡类型" prop="cardType">
@@ -367,6 +369,14 @@ export default {
         });
       });
     },
+    handleSelectUser(value){
+
+      const userNameLabel=this.userList.find((item) => {
+        return item.value === value
+      })
+      this.form.userName = userNameLabel.label
+
+    },
     // 取消按钮
     cancel() {
       this.open = false;
@@ -435,6 +445,7 @@ export default {
             }else if(this.form.cardType=='临时卡'){
               this.form.cardType='2'
             }
+
             updateWorkCard(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;

+ 1 - 1
src/views/system/configuration/index.vue

@@ -250,7 +250,7 @@ export default {
       selectIsSystemAttributeById(ruleId).then(response => {
         this.form = response.data
         this.open = true
-        this.title = '修改编码规则'
+        this.title = '修改基础数据'
       })
     },
     /** 提交按钮 */

+ 3 - 2
src/views/system/user/index.vue

@@ -435,6 +435,7 @@
           <el-col :span="12">
             <el-form-item label="单位" prop="unitIds">
               <treeselect
+                 class="treeselect"
                 v-model="form.unitIds"
                 :options="UnitOptions"
                 :normalizer="Unitnormalizer"
@@ -487,7 +488,7 @@
               <el-select
                 size="small"
                 v-model="form.workstationIds"
-                placeholder="请选择"
+                placeholder="请选择岗位"
                 :popper-append-to-body="false"
                 multiple
                 clearable
@@ -584,7 +585,7 @@
         </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button v-no-more-click type="primary" @click="submitForm"
+        <el-button class="addpersonBtn" v-no-more-click type="primary" @click="submitForm"
           >确 定</el-button
         >
         <el-button v-no-more-click @click="cancel">取 消</el-button>