소스 검색

工卡部分修改

pm 9 달 전
부모
커밋
61a26962f2

+ 26 - 1
src/views/mes/email/emailNotify/index.vue

@@ -80,13 +80,24 @@
       @selection-change="handleSelectionChange"
     >
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column prop="name" label="提醒事项"></el-table-column>
+      <el-table-column label="提醒事项"  prop="name"  ></el-table-column>
+      <el-table-column label="是否激活"  prop="status">
+        <template slot-scope="scope">
+          <el-switch
+            v-model="scope.row.status"
+            active-value="1"
+            inactive-value="0"
+            @change="handleFrozenChange(scope.row)"
+          ></el-switch>
+        </template>
+      </el-table-column>
       <el-table-column prop="templateName" label="邮件模板"></el-table-column>
       <el-table-column prop="reminderTime" label="提醒时长">
         <template slot-scope="scope">
           {{formattedTime(scope.row.reminderTime)}}
         </template>
       </el-table-column>
+
       <el-table-column
         label="操作"
         align="center"
@@ -171,6 +182,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import { genCode } from "@/api/system/autocode/rule";
 import Template from "@/views/print/printtemplate/list.vue";
 import { listEmailTemplates } from '@/api/mes/email/templates'
+import { changeFrozenState } from '@/api/mes/wm/location'
 
 export default {
   name: "Dept",
@@ -264,6 +276,19 @@ export default {
   },
 
   methods: {
+    // 是否激活
+    handleFrozenChange(row){
+      console.log(row);
+      updateIsMailNotifyConfig(row).then(response => {
+        console.log(response);
+        if(row.status == "0"){
+          this.$message.info('取消激活')
+        }else if(row.status == "1"){
+          this.$message.success('激活成功')
+        }
+
+      })
+    },
     /** 查询部门列表 */
     getList() {
       this.loading = true;

+ 21 - 9
src/views/mes/hw/workCard/index.vue

@@ -177,9 +177,9 @@
     <!-- 添加或修改设备维修单对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="450px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="120px">
-        <el-form-item label="用户名称" prop="userName">
+        <el-form-item label="用户名称" prop="userId">
           <el-select
-            v-model="form.userName"
+            v-model="form.userId"
             placeholder="请选择工卡用户"
             clearable
             style="width: 100%"
@@ -304,13 +304,15 @@ export default {
       },
       userList: [],
       // 表单参数
-      form: {},
+      form: {
+        userName: null,
+      },
       // 表单校验
       rules: {
         cardCode: [
           { required: true, message: "工卡编码不能为空", trigger: "blur" },
         ],
-        userName: [
+        userId: [
           { required: true, message: "用户名称不能为空", trigger: "blur" },
         ],
         cardNfc: [
@@ -360,7 +362,7 @@ export default {
         // console.log(respone, "人员数据");
         this.userList = respone.rows.map((item) => {
           return {
-            value: item.userName,
+            value: item.userId,
             label: item.userName,
           };
         });
@@ -415,10 +417,10 @@ export default {
       workCardInfo(this.EditId).then((response) => {
         console.log(response, "response");
         this.form = response.data;
-        if (response.data.cardType == "1") {
-          this.form.cardType = "员工卡";
-        } else {
-          this.form.cardType = "临时卡";
+        if(response.data.cardType=='1'){
+          this.form.cardType='员工卡'
+        }else if(response.data.cardType=='2'){
+          this.form.cardType='临时卡'
         }
         this.open = true;
         this.title = "编辑工卡信息";
@@ -429,12 +431,22 @@ export default {
       this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.EditId != null) {
+            if(this.form.cardType=='员工卡'){
+              this.form.cardType='1'
+            }else if(this.form.cardType=='临时卡'){
+              this.form.cardType='2'
+            }
             updateWorkCard(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
+
+            const data=this.userList.find((item) => item.value == this.form.userId?item.value:'');
+            // console.log(data);
+           this.form.userName=data.label;
+           this.form.userId=data.value;
             //  console.log(this.form, "form");
             addWorkCard(this.form).then((response) => {
               this.$modal.msgSuccess("新增成功");

+ 1 - 1
src/views/mes/blacklist/index.vue → src/views/mes/material/blacklist/index.vue

@@ -233,7 +233,7 @@
 </template>
 
 <script>
-import { listBlacklist, addBlacklist, delBlacklist,listWhitelist } from '@/api/mes/blacklist/index'
+import { listBlacklist, addBlacklist, delBlacklist,listWhitelist } from '@/api/mes/blacklist'
 export default {
   name: 'lock',
   dicts: ['hardware_status'],

+ 13 - 0
src/views/mes/material/directions/index.vue

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

+ 22 - 10
src/views/mes/material/lockers/index.vue

@@ -47,7 +47,7 @@
               index * 40
             }px`,
           }"
-          :src="require('@/assets/images/table_map2.jpg')"
+          :src="require(`@/assets/images/${imageMap[cabinet.status]}.jpg`)"
           alt=""
           @click="handleCabinetClick(cabinet)"
         />
@@ -343,7 +343,12 @@ export default {
         workstationName: undefined,
         workstationId: undefined
       },
+      imageMap: {
+        0: "table_map2", //正常
+        1: "table_map1", //使用中
+        2: "table_map3", //异常
 
+      },
       pickerOptions: {
         shortcuts: [
           {
@@ -454,31 +459,37 @@ export default {
       getMaterialsCabinet(this.queryParams).then((response) => {
         this.CabinetList = response.data.records
         console.log(response, '所有物资柜')
-        this.TicketListPage = response.data.records.filter((item) => {
-          return item.workstationId == '6'
-        })
-        console.log(this.TicketListPage, 'this.TicketListPage')
-        this.COCOTicketListPage = response.data.records.filter((item) => {
-          return item.workstationId == '7'
-        })
         this.total = response.data.total
         this.loading = false
       })
+
     },
     getOtherList() {
       const data = {
         pasge: 1,
         size: -1
       }
+      getMaterialsCabinet(data).then((response) => {
+        console.log(response, '所有物资柜')
+        this.TicketListPage = response.data.records.filter((item) => {
+          return item.workstationId == '6'
+        })
+        this.COCOTicketListPage = response.data.records.filter((item) => {
+          return item.workstationId == '7'
+        })
+        this.total = response.data.total
+        this.loading = false
+      })
       listMarsDept(data).then((response) => {
         // 新增岗位单选
+        const data=response.data.records.filter((item) => {return item.parentId=='0'})
         this.marsOptions = this.handleTree(
-          response.data.records,
+          data,
           'workstationId',
           'parentId'
         )
         // mars岗位树数据
-        this.workstationOptions = this.transformToTree(response.data.records)
+        this.workstationOptions = this.transformToTree(data)
         // 使用递归函数查找匹配的节点
         const selectedTreeNode = this.findNodeById(
           this.workstationOptions,
@@ -617,6 +628,7 @@ export default {
     handleAdd() {
       this.reset()
       this.open = true
+      this.form.workstationId = null
       this.title = '新增物资柜信息'
       this.optType = 'add'
     },