From 392f9468875a8721c17c4e15c288333017cac4a1 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期六, 16 七月 2022 15:11:44 +0800
Subject: [PATCH] 1.修改bug2.工序检验实现部分3.缺陷定义实现部分

---
 src/views/jcsz/jsqd.vue |  113 +++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 67 insertions(+), 46 deletions(-)

diff --git a/src/views/jcsz/jsqd.vue b/src/views/jcsz/jsqd.vue
index a6ff328..4a554be 100644
--- a/src/views/jcsz/jsqd.vue
+++ b/src/views/jcsz/jsqd.vue
@@ -24,6 +24,7 @@
                 style="width: 200px"
                 placeholder="璇烽�夋嫨"
               >
+                <!--                @focus="getRoleTypeSearch2"-->
                 <el-option
                   v-for="item in RoleTypeCodeArr2"
                   :key="item.roletype_code"
@@ -46,15 +47,16 @@
       <div style="margin-left: 10px;display: flex">
         <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
         <el-button type="primary" icon="el-icon-setting" @click="settingButton">璁剧疆</el-button>
-        <el-button type="primary" icon="el-icon-upload2" @click="upload">瀵煎叆</el-button>
+        <!--        <el-button type="primary" icon="el-icon-upload2" @click="upload">瀵煎叆</el-button>-->
       </div>
       <el-divider />
       <div class="elTableDiv">
         <el-table
           :data="tableData"
           border
+
           stripe
-          :height="tableHeight"
+          :height="tableHeight+'px'"
           :style="{width: 100+'%',height:tableHeight+'px'}"
           highlight-current-row
           :header-cell-style="this.$headerCellStyle"
@@ -89,7 +91,6 @@
           <el-table-column
             prop="description"
             label="瑙掕壊鎻忚堪"
-            show-overflow-tooltip
             sortable="custom"
           />
           <el-table-column
@@ -101,26 +102,27 @@
             prop="lm_date"
             label="鍒涘缓鏃堕棿"
             sortable="custom"
-            show-overflow-tooltip
           />
           <el-table-column
-            prop="lm_date"
+            prop="is_user"
             label="鍏宠仈鐢ㄦ埛"
             width="120"
             sortable="custom"
           >
             <template slot-scope="{row}">
-              <i class="el-icon-user-solid" @click="userClick(row)" />
+              <i v-if="row.is_user==='Y'" class="el-icon-user-solid" @click="userClick(row)" />
+              <i v-if="row.is_user==='N'" class="el-icon-user-solid" style="color: #E4E7ED" @click="userClick(row)" />
             </template>
           </el-table-column>
           <el-table-column
-            prop="lm_date"
+            prop="is_right"
             label="鍒嗛厤鏉冮檺"
             sortable="custom"
             width="120"
           >
             <template slot-scope="{row}">
-              <i class="el-icon-share" @click="rightClick(row)" />
+              <i v-if="row.is_right==='Y'" class="el-icon-share" @click="rightClick(row)" />
+              <i v-if="row.is_right==='N'" class="el-icon-share" style="color: #E4E7ED" @click="rightClick(row)" />
             </template>
           </el-table-column>
           <el-table-column
@@ -128,7 +130,7 @@
           >
             <template slot-scope="{row}">
               <div class="operationClass">
-                <el-button type="text" @click="edit('edit',row)">淇敼</el-button>
+                <el-button type="text" @click="edit('edit',row)">缂栬緫</el-button>
                 <el-button type="text" @click="del(row)">鍒犻櫎</el-button>
               </div>
             </template>
@@ -150,9 +152,9 @@
 
     <!--    鏂板淇敼瀵硅瘽妗�-->
     <el-dialog
-      :title="operation==='add'?'鏂板':'淇敼'"
+      :title="operation==='add'?'鏂板':'缂栬緫'"
       :visible.sync="dialogVisible"
-      width="50%"
+      width="800px"
       top="15vh"
       :close-on-click-modal="false"
       @closed="handleClose"
@@ -160,17 +162,17 @@
     >
       <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
         <el-form-item label="瑙掕壊缂栫爜" prop="RoleCode">
-          <el-input v-model="dialogForm.RoleCode" :disabled="operation!=='add'" style="width: 220px" />
+          <el-input v-model="dialogForm.RoleCode" :disabled="operation!=='add'" style="width: 200px" />
         </el-form-item>
         <el-form-item label="瑙掕壊鍚嶇О" prop="RoleName">
-          <el-input v-model="dialogForm.RoleName" style="width: 220px" />
+          <el-input v-model="dialogForm.RoleName" style="width: 200px" />
         </el-form-item>
         <el-form-item prop="RoleTypeCode" label="瑙掕壊绫诲瀷">
           <el-select
             v-model="dialogForm.RoleTypeCode"
             filterable
             :popper-append-to-body="false"
-            style="width: 220px"
+            style="width: 200px"
             placeholder="璇烽�夋嫨"
           >
             <el-option
@@ -182,7 +184,7 @@
           </el-select>
         </el-form-item>
         <el-form-item label="瑙掕壊鎻忚堪" prop="description">
-          <el-input v-model="dialogForm.description" type="textarea" style="width: 220px" />
+          <el-input v-model="dialogForm.description" type="textarea" style="width: 200px" />
         </el-form-item>
       </el-form>
       <span slot="footer" class="dialog-footer">
@@ -196,7 +198,7 @@
     <el-dialog
       title="璁剧疆"
       :visible.sync="settingDialogVisible"
-      width="50%"
+      width="800px"
       top="15vh"
       :close-on-click-modal="false"
       class="settingDialogVisible"
@@ -209,7 +211,7 @@
       <el-table
         :data="RoleTypeCodeArr"
         border
-        height="400"
+        height="300"
         highlight-current-row
         :header-cell-style="this.$headerCellStyle"
         :cell-style="this.$cellStyle"
@@ -278,9 +280,10 @@
     <el-dialog
       title="瑙掕壊鍏宠仈鐢ㄦ埛"
       :visible.sync="userDialogVisible"
-      width="80%"
+      width="1500px"
       :close-on-click-modal="false"
       top="15vh"
+      :fullscreen="isFullscreen"
       class="userDialogVisible"
       @closed="handleCloseUser"
       @close="handleCloseUser"
@@ -295,10 +298,10 @@
       <div style="display: flex;min-height: 50px">
         <el-form ref="dialogFormUser" inline :model="dialogFormUser" label-width="80px">
           <el-form-item label="鐢ㄦ埛缂栫爜">
-            <el-input v-model="dialogFormUser.usercode" class="userDialogVisibleInput" style="width: 220px" />
+            <el-input v-model="dialogFormUser.usercode" style="width: 200px" />
           </el-form-item>
           <el-form-item label="鐢ㄦ埛鍚嶇О">
-            <el-input v-model="dialogFormUser.username" class="userDialogVisibleInput" style="width: 220px" />
+            <el-input v-model="dialogFormUser.username" style="width: 200px" />
           </el-form-item>
           <el-form-item label="鎵�灞炵粍缁�">
             <el-cascader
@@ -309,20 +312,19 @@
               :append-to-body="false"
               :options="StuOrgArr"
               :props="defaultProps"
-              class="userDialogVisibleInput"
-              style="width: 220px;"
+              style="width: 200px;"
+
               @change="dialogCascaderChange"
             />
-
+            <!--            @focus="getUserOrganization"-->
           </el-form-item>
           <el-form-item label="鍏宠仈瑙掕壊">
             <el-select
               v-model="dialogFormUser.isrole"
               filterable
               :popper-append-to-body="false"
-              style="width: 220px"
+              style="width: 200px"
               placeholder="璇烽�夋嫨"
-              class="userDialogVisibleInput"
             >
               <el-option
                 v-for="item in roleArr"
@@ -422,8 +424,9 @@
     <el-dialog
       title="瑙掕壊鍏宠仈鏉冮檺"
       :visible.sync="dialogVisibleRight"
-      width="50%"
+      width="800px"
       top="15vh"
+      :fullscreen="isFullscreen"
       :close-on-click-modal="false"
       class="dialogVisibleRight"
       @closed="handleCloseRight"
@@ -508,10 +511,11 @@
 } from '@/api/jcsz'
 import { getCookie } from '@/utils/auth'
 import $ from 'jquery'
+import clearAllChildren from '@/utils/global'
 
 const SER_HZ = /^[\u4e00-\u9fa5]+$/
 export default {
-  name: 'Zzjg',
+  name: 'JSQD',
   components: {
     Pagination
   },
@@ -535,6 +539,7 @@
     //   }
     // }
     return {
+      isFullscreen: false,
       mainHeight: 0,
       tableHeight: 0,
       form: {
@@ -667,7 +672,7 @@
     // 鑾峰彇鎵�灞炵粍缁�
     async getUserOrganization() {
       const { data: res } = await UserOrganization()
-      this.StuOrgArr = res
+      this.StuOrgArr = clearAllChildren(res)
     },
     // 鎺掑簭鏀瑰彉鏃�
     sortChange({ column, prop, order }) {
@@ -787,8 +792,11 @@
     // 鑾峰彇椤甸潰楂樺害
     getHeight() {
       this.$nextTick(() => {
+        console.log(window.innerHeight)
+        console.log(window.innerHeight)
         this.mainHeight = window.innerHeight - 250
         this.tableHeight = this.mainHeight - 100
+        // this.isFullscreen = window.innerHeight < 800
       })
     },
     /* 璁剧疆妯″潡*/
@@ -811,7 +819,7 @@
     // 娣诲姞鎸夐挳
     addSetting() {
       let number = Math.random() * Math.random()// 浣滀负鍒犻櫎鏃剁殑鏍囪瘑绗�
-      number = number === 0 ? Math.random() * Math.random() : number
+      number = number === 0 ? (10 + Math.random()) : number
       const data = { roletype_code: '', roletype_name: '', isVisible: 1, number: number }
       this.RoleTypeCodeArr.unshift(data)
     },
@@ -935,6 +943,7 @@
       const res = await SaveRoleAssoctUser(userMultipleArr, this.dialogFormUser.rolecode)
       if (res.code === '200') {
         this.$message.success('淇濆瓨鎴愬姛锛�')
+        await this.getRoleSearch()
         this.userDialogVisible = false
       }
     },
@@ -949,6 +958,7 @@
       this.dialogFormUser.orgcode = ''
       this.dialogFormUser.isrole = ''
       this.$refs.dialogCascaderUser.checkedValue = ''
+      this.getRoleAssociationUser()
     },
 
     /* 瑙掕壊鍏宠仈鏉冮檺瀵硅瘽妗嗛儴鍒�*/
@@ -988,7 +998,7 @@
         pcIsSelected2 = true
 
         const interval = setInterval(() => {
-          if ($('input:checkbox').length > 0) {
+          if ($("input[name='PC']").length > 0) {
             waitFlag = true
           }
           if (waitFlag) {
@@ -1008,7 +1018,7 @@
         appIsSelected2 = true
 
         const interval = setInterval(() => {
-          if ($('input:checkbox').length > 0) {
+          if ($("input[name='APP']").length > 0) {
             waitFlag = true
           }
           if (waitFlag) {
@@ -1029,7 +1039,7 @@
         appIsSelected2 = true
 
         const interval = setInterval(() => {
-          if ($('input:checkbox').length > 0) {
+          if ($("input[name='PC']").length > 0) {
             waitFlag = true
           }
           if (waitFlag) {
@@ -1181,6 +1191,7 @@
       const res = await SaveUserAssoctRight(rightSubmit, rolecode, usercode)
       if (res.code === '200') {
         this.$message.success('淇濆瓨鎴愬姛锛�')
+        await this.getRoleSearch()
         this.dialogVisibleRight = false
       }
     },
@@ -1248,12 +1259,20 @@
       const currentCode = this.dialogFormRight.rightCurrentCode// 鏉冮檺鎿嶄綔绔痗ode
       // 1.绗竴绉嶆儏鍐�  鍗婂彾涓洪浂  鍏ㄥ彾涓洪浂
       if (checkedKeys.length === 0 && halfCheckedKeys.length === 0) {
-        console.log('1.绗竴绉嶆儏鍐�  鍗婂彾涓洪浂  鍏ㄥ彾涓洪浂')
+        console.log('1.绗竴绉嶆儏鍐�  鍗婂彾涓洪浂  鍏ㄥ彾涓洪浂1111')
         this.dialogFormRight.rightOperationArr.forEach((item, index) => {
           if (item.code === currentCode) {
             item.isSelected2 = false
+
             this.$nextTick(() => {
-              $('input:checkbox').eq(index).prop('checked', false)// 鑷畾涔夊崟閫夋鍥炴樉
+              if (item.name === 'PC') {
+                $("input[name='PC']").eq(0).prop('checked', false)// 鑷畾涔夊崟閫夋鍥炴樉
+              }
+              if (item.name === 'APP') {
+                $("input[name='APP']").eq(0).prop('checked', false)// 鑷畾涔夊崟閫夋鍥炴樉
+              }
+              // $("input[name='APP']").eq(0).prop('checked', false)// 鑷畾涔夊崟閫夋鍥炴樉
+              // $('input:checkbox').eq(index).prop('checked', false)// 鑷畾涔夊崟閫夋鍥炴樉
             })
           }
         })
@@ -1272,7 +1291,13 @@
           if (item.code === currentCode) {
             item.isSelected2 = true
             this.$nextTick(() => {
-              $('input:checkbox').eq(index).prop('checked', true)// 鑷畾涔夊崟閫夋鍥炴樉
+              if (item.name === 'PC') {
+                $("input[name='PC']").eq(0).prop('checked', true)// 鑷畾涔夊崟閫夋鍥炴樉
+              }
+              if (item.name === 'APP') {
+                $("input[name='APP']").eq(0).prop('checked', true)// 鑷畾涔夊崟閫夋鍥炴樉
+              }
+              // $('input:checkbox').eq(index).prop('checked', true)// 鑷畾涔夊崟閫夋鍥炴樉
             })
           }
         })
@@ -1292,7 +1317,13 @@
           if (item.code === currentCode) {
             item.isSelected2 = true
             this.$nextTick(() => {
-              $('input:checkbox').eq(index).prop('checked', true)// 鑷畾涔夊崟閫夋鍥炴樉
+              if (item.name === 'PC') {
+                $("input[name='PC']").eq(0).prop('checked', true)// 鑷畾涔夊崟閫夋鍥炴樉
+              }
+              if (item.name === 'APP') {
+                $("input[name='APP']").eq(0).prop('checked', true)// 鑷畾涔夊崟閫夋鍥炴樉
+              }
+              // $('input:checkbox').eq(index).prop('checked', true)// 鑷畾涔夊崟閫夋鍥炴樉
             })
           }
         })
@@ -1428,16 +1459,6 @@
       background-color: $main_color;
     }
   }
-}
-
-.userDialogVisible {
-  ::v-deep .userDialogVisibleInput {
-    //width:calc(100% - 30px) !important;
-  }
-
-  //::v-deep  .el-form-item {
-  //  width:calc(100% - 30px) !important;
-  //}
 }
 
 ::v-deep .el-radio__input.is-checked .el-radio__inner {

--
Gitblit v1.9.3