Просмотр исходного кода

权限数组展开、报工流程功能改动

lucw 9 месяцев назад
Родитель
Сommit
6cb5499082

+ 1 - 1
src/api/producetaskrecordrulesrecord/index.js

@@ -27,7 +27,7 @@ export async function saveOrUpdate(body) {
 // 一键报工,新增或修改填写表单类型的执行记录,并修改状态为已执行
 export async function logicDelete(id) {
   const res = await request.delete(
-    '/mes/producetaskrulerecord/logicDelete/' + id
+    '/mes/producetaskrulerecord/logicDeleteById/' + id
   );
   if (res.data.code == 0) {
     return res.data.data;

+ 4 - 0
src/store/modules/user.js

@@ -36,6 +36,10 @@ const formatRouter = (list) => {
 
   menuList = fn(list);
 
+  // 收集权限的子节点(只取一层)
+  const extraChildren = authorities.flatMap((a) => a.children || []);
+  authorities = [...authorities, ...extraChildren];
+
   return { menuList, authorities };
 };
 

+ 27 - 26
src/views/produce/components/footBtn.vue

@@ -1,23 +1,24 @@
 <template>
   <div class="foot_box">
-    <div
-      v-for="(item, index) in btnListData"
-      :key="index"
-      class="btn"
-      :style="{ background: item.disable ? '#858585' : item.bjColor }"
-      v-if="$hasPermission(item.isShow)"
-      @click="footClick(item)"
-    >
-      <img src="../../../assets/Frame.png" class="Frame" />
-      {{ item.name }}
-    </div>
+    <template v-for="(item, index) in btnListData">
+      <div
+        v-if="$hasPermission(item.isShow)"
+        :key="index"
+        class="btn"
+        :style="{ background: item.disable ? '#858585' : item.bjColor }"
+        @click="footClick(item)"
+      >
+        <img src="../../../assets/Frame.png" class="Frame" />
+        {{ item.name }}
+      </div>
+    </template>
   </div>
 </template>
 
 <script>
   export default {
-  props: {
-      // ?
+    props: {
+      //
       type: {
         type: String | Number,
         default: ''
@@ -48,7 +49,7 @@
             name: '投料',
             type: 'feed',
             bjColor: '#FBD114',
-            isShow:'mes:feed:save'
+            isShow: 'mes:feed:save'
           },
           {
             name: '过程监测',
@@ -72,7 +73,7 @@
             name: '暂停启动',
             type: '',
             bjColor: '#858585',
-            isShow: 'mes:workorder:startstop',
+            isShow: 'mes:workorder:startstop'
           },
           {
             name: '产后检查',
@@ -90,19 +91,19 @@
             name: '工艺文件',
             type: 'work',
             bjColor: '#2f3033',
-            isShow: 'mes:workorder:bomfile',
+            isShow: 'mes:workorder:bomfile'
           },
           {
             name: '工步',
             type: 'workStep',
             bjColor: '#409EFF',
-            isShow: 'main:categoryparamstep:save',
+            isShow: 'main:categoryparamstep:save'
           },
           {
             name: '任务',
             type: 'task',
             bjColor: '#67c23a',
-            isShow: 'aps:assign:save',
+            isShow: 'aps:assign:save'
           },
           {
             name: '异常',
@@ -114,19 +115,19 @@
             name: 'BOM',
             type: 'bom',
             bjColor: '#BB5500',
-            isShow: 'mes:workorder:bom',
+            isShow: 'mes:workorder:bom'
           },
           {
             name: '设备',
             type: 'device',
             bjColor: '#008866',
-            isShow: 'mes:workorder:device',
+            isShow: 'mes:workorder:device'
           },
           {
             name: '周转车',
             type: 'turnover',
             bjColor: '#660066',
-            isShow: 'mes:workorder:transfer',
+            isShow: 'mes:workorder:transfer'
           }
           // {
           //   type: 'turnover',
@@ -149,7 +150,7 @@
             name: '投料',
             type: 'feed',
             bjColor: '#FBD114',
-            isShow:'mes:feed:save'
+            isShow: 'mes:feed:save'
           },
           {
             name: '报工',
@@ -168,25 +169,25 @@
             name: '暂停启动',
             type: '',
             bjColor: '#858585',
-            isShow: 'mes:workorder:startstop',
+            isShow: 'mes:workorder:startstop'
           },
           {
             name: '工艺文件',
             type: 'work',
             bjColor: '#2B56C2',
-            isShow: 'mes:workorder:bomfile',
+            isShow: 'mes:workorder:bomfile'
           },
           {
             name: '工步',
             type: 'workStep',
             bjColor: '#409EFF',
-            isShow: 'main:categoryparamstep:save',
+            isShow: 'main:categoryparamstep:save'
           },
           {
             name: '任务',
             type: 'task',
             bjColor: '#67c23a',
-            isShow: 'aps:assign:save',
+            isShow: 'aps:assign:save'
           },
           {
             name: '异常',

+ 6 - 9
src/views/produce/components/prenatalExamination/programRulesDialog.vue

@@ -192,7 +192,7 @@
                 <el-table-column
                   label="零部件编码"
                   prop="categoryCode"
-                  width="100"
+                  width="150"
                 >
                   <template slot-scope="scope">
                     <div v-if="scope.row.isNew">
@@ -206,11 +206,7 @@
                     </div>
                   </template>
                 </el-table-column>
-                <el-table-column
-                  label="零部件名称"
-                  prop="categoryName"
-                  width="100"
-                >
+                <el-table-column label="零部件名称" prop="categoryName">
                   <template slot-scope="scope">
                     <div v-if="scope.row.isNew">
                       <el-input
@@ -223,7 +219,7 @@
                     </div>
                   </template>
                 </el-table-column>
-                <el-table-column label="事项" prop="name" width="100">
+                <el-table-column label="事项" prop="name">
                   <template slot-scope="scope">
                     <div v-if="scope.row.isNew">
                       <el-input
@@ -236,7 +232,7 @@
                     </div>
                   </template>
                 </el-table-column>
-                <el-table-column label="内容" prop="content" width="200">
+                <el-table-column label="内容" prop="content">
                   <template slot-scope="scope">
                     <div v-if="scope.row.isNew">
                       <el-input
@@ -249,7 +245,7 @@
                     </div>
                   </template>
                 </el-table-column>
-                <el-table-column label="操作指导" prop="operationGuide" width="200">
+                <el-table-column label="操作指导" prop="operationGuide">
                   <template slot-scope="scope">
                     <div
                       class="operationGuide_box"
@@ -315,6 +311,7 @@
     <template v-slot:footer>
       <el-button :loading="butLoading" @click="beforeClose">取消</el-button>
       <el-button
+        v-if="$hasPermission('mes:producetaskrulerecord:save')"
         type="primary"
         @click="submit"
         :disabled="productionInfo.executeStatus != 0"

+ 25 - 14
src/views/produce/components/prenatalExamination/releaseRulesDialog.vue

@@ -185,6 +185,7 @@
     <template #footer>
       <div class="modal-footer">
         <el-button
+          v-if="$hasPermission('mes:producetaskrecordrulesrecord:sus')"
           :loading="butLoading"
           type="primary"
           @click="submit('submit')"
@@ -193,21 +194,26 @@
           一键报工
         </el-button>
 
-        <el-popconfirm
-          v-if="
-            productionInfo &&
-            productionInfo.recordId != null &&
-            productionInfo.executeStatus == 1
-          "
-          title="您确定要清空缓存吗?"
-          @confirm="clearCache"
+        <template
+          v-if="$hasPermission('mes:producetaskrecordrulesrecord:logicdelete')"
         >
-          <el-button slot="reference" :loading="butLoading" type="primary">
-            清空缓存
-          </el-button>
-        </el-popconfirm>
+          <el-popconfirm
+            v-if="
+              productionInfo &&
+              productionInfo.recordId != null &&
+              productionInfo.executeStatus == 1
+            "
+            title="您确定要清空缓存吗?"
+            @confirm="clearCache"
+          >
+            <el-button slot="reference" :loading="butLoading" type="primary">
+              清空缓存
+            </el-button>
+          </el-popconfirm>
+        </template>
 
         <el-button
+          v-if="$hasPermission('mes:producetaskrecordrulesrecord:saveorupdate')"
           :loading="butLoading"
           type="primary"
           @click="submit('cache')"
@@ -509,7 +515,6 @@
             this.$emit('reload');
 
             this.handleBeforeClose();
-
           } catch (error) {
             this.butLoading = false;
           }
@@ -521,7 +526,13 @@
           await logicDelete(this.productionInfo.recordId);
           this.butLoading = false;
           this.productionInfo.recordId == null;
-          this.addForm = JSON.parse(JSON.stringify(this.formDate));
+          this.addForm.workshopArea = '';
+          this.addForm.checkFinishTime = null;
+          this.addForm.checkValidity = null;
+          this.addForm.checkValidityUnit = null;
+          this.addForm.conclution = null;
+          this.addForm.id = null;
+
           this.getRuleList();
           this.$message.success('缓存清空成功!');
           this.productionInfo.executeStatus = 0;

+ 2 - 2
vue.config.js

@@ -33,7 +33,7 @@ module.exports = {
       '/api': {
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.116:18086',
-        target: 'http://192.168.1.251:18086',
+        // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.103:18086',192.168.1.116
         // target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.116:18086',
@@ -43,7 +43,7 @@ module.exports = {
         // target: 'http://192.168.1.33:18086',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.251:18087',
-        // target: 'http://192.168.1.116:18086',
+        target: 'http://192.168.1.116:18086',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''