소스 검색

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

liujt 8 달 전
부모
커밋
3f2f10043c

+ 9 - 0
src/api/recordrules/index.js

@@ -107,3 +107,12 @@ export async function recordrulesGetAllUpVersionById(id) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+// /main/recordrules/getById/{id} 查看详情
+export async function recordrulesGetById(id) {
+  const res = await request.get(`/main/recordrules/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 223 - 0
src/components/selectProduct/ProductModal.vue

@@ -0,0 +1,223 @@
+<template>
+  <el-dialog
+    title="选择产品"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="80%"
+  >
+    <el-card shadow="never">
+      <seekPage :seekList="seekList" @search="reload" />
+      <ele-split-layout
+        width="244px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div class="ele-border-lighter split-layout-right-content">
+          <AssetTree
+            ref="assetTreeRef"
+            id="9"
+            @handleNodeClick="handleNodeClick"
+          />
+        </div>
+        <!-- 表格 -->
+        <template v-slot:content>
+          <ele-pro-table
+            ref="table"
+            :columns="columns"
+            :datasource="datasource"
+            height="calc(100vh - 450px)"
+            class="dict-table"
+            :selection.sync="selection"
+            @cell-click="cellClick"
+          >
+          </ele-pro-table>
+        </template>
+      </ele-split-layout>
+    </el-card>
+    <div class="btns">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import AssetTree from '@/components/AssetTree';
+
+  import { getList } from '@/api/classifyManage/itemInformation';
+  export default {
+    components: { AssetTree },
+    props: {
+      // 是否 多选
+      multiple: {
+        type: Boolean,
+        default: false
+      }
+    },
+    computed: {
+      seekList() {
+        return [
+          {
+            label: '产品编码',
+            value: 'code',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '产品名称',
+            value: 'name',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '型号',
+            value: 'modelType',
+            type: 'input',
+            placeholder: '请输入'
+          }
+        ];
+      }
+    },
+    data() {
+      return {
+        visible: false,
+        // 表格列配置
+        columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+          },
+          {
+            columnKey: 'index',
+            type: 'index',
+            width: 45,
+            align: 'center',
+            reserveSelection: true
+          },
+          {
+            prop: 'code',
+            label: '产品编码'
+          },
+          {
+            prop: 'name',
+            label: '产品名称',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'brandNum',
+            label: '牌号'
+          },
+          {
+            prop: 'modelType',
+            label: '型号'
+          },
+          {
+            prop: 'measuringUnit',
+            label: '计量单位'
+          },
+          {
+            prop: 'packingUnit',
+            label: '包装单位'
+          }
+        ],
+        categoryLevelId: '9',
+        // 表格选中数据
+        selection: []
+      };
+    },
+    watch: {},
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, where, limit }) {
+        return getList({
+          ...where,
+          pageNum: page,
+          size: limit,
+          categoryLevelId: this.categoryLevelId,
+          isProduct: true
+        });
+      },
+      handleNodeClick(data) {
+        this.categoryLevelId = data.id;
+        this.reload();
+      },
+      /* 刷新表格 */
+      reload(where = {}) {
+        this.$refs.table.reload({ page: 1, where: where });
+      },
+      open(rows) {
+        console.log('rows', rows);
+        this.visible = true;
+        if (rows) {
+          this.selection = rows;
+          this.$nextTick(() => {
+            this.$refs.table.setSelectedRows(rows);
+          });
+        } else {
+          this.selection = [];
+          this.$nextTick(() => {
+            this.$refs.table.setSelectedRows([]);
+          });
+        }
+        console.log('this.selection', this.selection);
+      },
+      handleClose() {
+        this.visible = false;
+        this.selection = [];
+      },
+      selected() {
+        console.log('this.selection', this.selection);
+        if (!this.selection.length) {
+          return this.$message.warning('请选择产品');
+        }
+
+        if (!this.multiple && this.selection.length > 1) {
+          return this.$message.warning('只能选择一个产品');
+        }
+
+        this.$emit(
+          'changeProduct',
+          this.multiple ? this.selection : this.selection[0]
+        );
+        this.handleClose();
+      },
+      cellClick(row) {
+        console.log('cellClick', row);
+        this.selection.push(row);
+        this.$refs.table.setSelectedRows(this.selection);
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .tree_col {
+    border: 1px solid #eee;
+    padding: 10px 0;
+    box-sizing: border-box;
+    height: 500px;
+    overflow: auto;
+  }
+  .table_col {
+    padding-left: 10px;
+    ::v-deep .el-table th.el-table__cell {
+      background: #f2f2f2;
+    }
+  }
+  .pagination {
+    text-align: right;
+    padding: 10px 0;
+  }
+  .btns {
+    text-align: center;
+    padding: 10px 0;
+  }
+  .topsearch {
+    margin-bottom: 15px;
+  }
+</style>

+ 2 - 0
src/views/bpm/model/index.vue

@@ -11,6 +11,8 @@
         :page-size="pageSize"
         @columns-change="handleColumnChange"
         :cache-key="cacheKeyUrl"
+        height="calc(100vh - 350px)"
+        full-height="calc(100vh - 110px)"
       >
         <!-- 表头工具栏 -->
         <template v-slot:toolbar>

+ 0 - 185
src/views/rulesManagement/releaseRules/components/ProductModal.vue

@@ -1,185 +0,0 @@
-<template>
-  <el-dialog
-    title="选择产品"
-    :visible.sync="visible"
-    :before-close="handleClose"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    append-to-body
-    width="80%"
-  >
-    <el-card shadow="never">
-      <ProductSearch @search="reload" />
-      <ele-split-layout
-        width="244px"
-        allow-collapse
-        :right-style="{ overflow: 'hidden' }"
-      >
-        <div class="ele-border-lighter split-layout-right-content">
-          <AssetTree
-            ref="assetTreeRef"
-            id="9"
-            @handleNodeClick="handleNodeClick"
-          />
-        </div>
-        <!-- 表格 -->
-        <template v-slot:content>
-          <ele-pro-table
-            ref="table"
-            :columns="columns"
-            :datasource="datasource"
-            height="calc(100vh - 350px)"
-            class="dict-table"
-            @cell-click="cellClick"
-          >
-            <!-- 表头工具栏 -->
-            <template v-slot:action="{ row }">
-              <el-radio class="radio" v-model="radio" :label="row.id"><i></i></el-radio>
-            </template>
-          </ele-pro-table>
-        </template>
-      </ele-split-layout>
-    </el-card>
-    <div class="btns">
-      <el-button type="primary" size="small" @click="selected">选择</el-button>
-      <el-button size="small" @click="handleClose">关闭</el-button>
-    </div>
-  </el-dialog>
-</template>
-
-<script>
- import AssetTree from '@/components/AssetTree';
- import ProductSearch from './product-search.vue'
- import { getList } from '@/api/classifyManage/itemInformation';
-export default {
-   components: { AssetTree, ProductSearch },
-  data () {
-    return {
-      visible: false,
-      // 表格列配置
-      columns: [
-        {
-          columnKey: 'index',
-          type: 'index',
-          width: 45,
-          align: 'center',
-          reserveSelection: true
-        },
-        {
-          prop: 'code',
-          label: '产品编码'
-        },
-        {
-          prop: 'name',
-          label: '产品名称',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'brandNum',
-          label: '牌号'
-        },
-        {
-          prop: 'modelType',
-          label: '型号'
-        },
-        {
-          prop: 'measuringUnit',
-          label: '计量单位'
-        },
-        {
-          prop: 'packingUnit',
-          label: '包装单位'
-        },
-        {
-          action: 'action',
-          slot: 'action',
-          align: 'center',
-          label: '选择'
-        }
-      ],
-      categoryLevelId: '9',
-      radio:null
-    }
-  },
-
-  watch: {
-
-  },
-  methods: {
-    /* 表格数据源 */
-    datasource ({ page, where, limit }) {
-      return getList({
-        ...where,
-        pageNum: page,
-        size: limit,
-        categoryLevelId: this.categoryLevelId,
-        isProduct:true
-      });
-    },
-    handleNodeClick (data) {
-      this.categoryLevelId = data.id;
-      this.reload();
-    },
-    /* 刷新表格 */
-    reload () {
-      this.$refs.table.reload();
-    },
-    open(item){
-      if(item){
-        this.current = {
-          id:item.categoryId,
-          name: item.categoryName,
-          code:item.categoryCode
-        }
-        this.radio = item.categoryId
-      }
-      this.visible = true
-    },
-
-    // 单击获取id
-    cellClick (row) {
-        this.current = row
-        this.radio = row.id
-    },
-    handleClose () {
-      this.visible = false
-      this.current = null
-      this.radio = ''
-    },
-    selected(){
-       if(!this.current){
-         return this.$message.warning('请选择工作中心')
-       }
-       this.$emit('changeProduct',this.current)
-       this.handleClose()
-    },
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-.tree_col {
-  border: 1px solid #eee;
-  padding: 10px 0;
-  box-sizing: border-box;
-  height: 500px;
-  overflow: auto;
-}
-.table_col {
-  padding-left: 10px;
-  ::v-deep .el-table th.el-table__cell {
-    background: #f2f2f2;
-  }
-}
-.pagination {
-  text-align: right;
-  padding: 10px 0;
-}
-.btns {
-  text-align: center;
-  padding: 10px 0;
-}
-.topsearch{
-	margin-bottom:15px;
-}
-</style>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 588 - 152
src/views/rulesManagement/releaseRules/components/permitAdd.vue


+ 170 - 0
src/views/rulesManagement/releaseRules/components/processModal.vue

@@ -0,0 +1,170 @@
+<template>
+  <el-dialog
+    :title="title"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="70%"
+  >
+    <el-card shadow="never">
+      <user-search @search="reload" />
+
+      <!-- 数据表格 -->
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        :selection.sync="selection"
+        row-key="id"
+      >
+      </ele-pro-table>
+    </el-card>
+
+    <div class="btns">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import producetask from '@/api/technology/production';
+  import userSearch from '@/views/technology/production/components/user-search.vue';
+  export default {
+    components: {
+      userSearch
+    },
+    props: {
+      // 支撑多选
+      multiple: {
+        type: Boolean,
+        default: false
+      }
+    },
+    data() {
+      return {
+        visible: false,
+        title: '选择工序',
+
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'selection',
+            type: 'selection',
+            width: 45,
+            align: 'center',
+            reserveSelection: true,
+            fixed: 'left'
+          },
+
+          {
+            prop: 'code',
+            label: '工序编码',
+            // sortable: 'custom',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'name',
+            label: '工序名称',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            align: 'center',
+            prop: 'controlName',
+            label: '工序控制码',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'workCenterName',
+            label: '所属工作中心',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          }
+        ],
+
+        // 表格选中数据
+        selection: []
+      };
+    },
+
+    watch: {},
+    methods: {
+      /* 表格数据源 */
+      async datasource({ page, limit, where, order }) {
+        const res = await parameter.list({
+          ...where,
+          ...order,
+          pageNum: page,
+          size: limit
+        });
+        return res;
+      },
+
+      open(item) {
+        if (item) {
+          this.selection = item;
+          this.$nextTick(() => {
+            this.$refs.table.setSelectedRows(item);
+          });
+        } else {
+          this.selection = [];
+          this.$nextTick(() => {
+            this.$refs.table.setSelectedRows([]);
+          });
+        }
+        this.visible = true;
+      },
+
+      /* 表格数据源 */
+      async datasource({ page, limit, where, order }) {
+        const res = await producetask.list({
+          ...where,
+          ...order,
+          pageNum: page,
+          size: limit
+        });
+        return res;
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where: where });
+      },
+
+      handleClose() {
+        this.$refs.table.setSelectedRows([]);
+        this.selection = [];
+        this.visible = false;
+      },
+      selected() {
+        if (!this.selection.length) {
+          this.$message.warning('请选择工序');
+          return;
+        }
+        if (!this.multiple && this.selection.length > 1) {
+          return this.$message.warning('只能选择一项');
+        }
+        this.$emit(
+          'chooseProcess',
+          this.multiple ? this.selection : this.selection[0]
+        );
+        this.handleClose();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .btns {
+    text-align: center;
+    padding: 10px 0;
+  }
+</style>

+ 1 - 11
src/views/rulesManagement/releaseRules/components/rule-cycle.vue

@@ -347,19 +347,9 @@
         ]
       };
     },
-    watch: {
-      formData: {
-        handler(val) {
-          if (val.recordRulesCycleList) {
-            this.recordRulesCycleList = val.recordRulesCycleList;
-          }
-        }
-        // deep: true,
-        // immediate: true
-      }
-    },
     methods: {
       setRecordRulesCycleList(list) {
+        console.log('list', list);
         this.recordRulesCycleList = list;
       },
       // 巡点检周期输入数量

+ 28 - 3
src/views/rulesManagement/releaseRules/components/toolModal.vue

@@ -31,9 +31,9 @@
 
         <!-- 数据表格 -->
         <template v-slot:content>
-          <ProductSearch @search="reload" ref="searchRef" />
+          <seekPage :seekList="seekList" @search="reload" />
           <ele-pro-table
-            style="min-height: 400px"
+            height="calc(100vh - 480px)"
             ref="table"
             :columns="columns"
             :datasource="datasource"
@@ -59,6 +59,30 @@
     components: {
       ProductSearch
     },
+    computed: {
+      seekList() {
+        return [
+          {
+            label: '编码',
+            value: 'code',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '名称',
+            value: 'name',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '型号',
+            value: 'modelType',
+            type: 'input',
+            placeholder: '请输入'
+          }
+        ];
+      }
+    },
     data() {
       return {
         visible: false,
@@ -155,8 +179,9 @@
         return res;
       },
 
-      open(item) {
+      open(item, title) {
         this.processData = item || [];
+        this.title = title || '选择工具';
         this.visible = true;
 
         this.getTreeData();

+ 16 - 7
src/views/technology/production/components/user-setting-matter-add.vue

@@ -4,7 +4,7 @@
     :append-to-body="true"
     :close-on-click-modal="false"
     custom-class="ele-dialog-form"
-    title="添加事项"
+    :title="title"
     @update:visible="updateVisible"
     :maxable="true"
     :before-close="handleClose"
@@ -185,7 +185,9 @@
         rulesName: '',
         // 任务id
         taskId: null,
-        itemTaskName: ''
+        itemTaskName: '',
+        // 是否执行中
+        isUsing: 0
       };
 
       return {
@@ -222,7 +224,8 @@
         executeMethodOptions: [],
         // 记录规则事项类型,参考字典项:record_rules_item_type
         itemTypeOptions: [],
-        dialogLoading: false
+        dialogLoading: false,
+        title: '新增事项'
       };
     },
     methods: {
@@ -236,9 +239,11 @@
       },
       openAdd() {
         this.type = 'add';
+        this.title = '新增事项';
         this.visible = true;
       },
       openEdit(row) {
+        this.title = '编辑事项';
         console.log('row', row);
         this.type = 'edit';
         this.visible = true;
@@ -267,6 +272,12 @@
       },
       confirm() {
         console.log('this.formData', this.formData);
+
+        if (this.formData.isUsing) {
+          this.$message.warning('当前事项正在执行中,无法修改');
+          return;
+        }
+
         // 验证表单
         this.$refs.formRef.validate((valid) => {
           if (valid) {
@@ -287,11 +298,9 @@
       },
       // 关闭清空formData
       handleClose() {
-        this.visible = false;
         this.formData = JSON.parse(JSON.stringify(this.formBaseData));
-        this.$nextTick(() => {
-          this.$refs.formRef.clearValidate();
-        });
+        this.$refs.formRef?.clearValidate();
+        this.visible = false;
       },
       // 去选择记录规则
       selectReleaseId() {

+ 4 - 0
src/views/technology/production/components/user-setting-matter-process.vue

@@ -218,12 +218,14 @@
           ...matter,
           id: id,
           produceTaskId: this.currentRow.id,
+          produceTaskName: this.currentRow.name,
           reportWorkType: this.reportWorkType
         });
         this.addPOs.push({
           ...matter,
           id: id,
           produceTaskId: this.currentRow.id,
+          produceTaskName: this.currentRow.name,
           reportWorkType: this.reportWorkType
         });
         this.handleSort();
@@ -249,6 +251,7 @@
           this.updatePOs.push({
             ...matter,
             produceTaskId: this.currentRow.id,
+            produceTaskName: this.currentRow.name,
             reportWorkType: this.reportWorkType
           });
         } else {
@@ -302,6 +305,7 @@
             addPOs: this.addPOs,
             deletedIds: this.deletedIds,
             produceTaskId: this.currentRow.id,
+            produceTaskName: this.currentRow.name,
             updatePOs: this.updatePOs
           });
           this.$message.success('保存成功');

+ 4 - 0
src/views/technology/production/components/user-setting-matter.vue

@@ -219,12 +219,14 @@
           ...matter,
           id: id,
           produceTaskId: this.currentRow.id,
+          produceTaskName: this.currentRow.name,
           reportWorkType: this.reportWorkType
         });
         this.addPOs.push({
           ...matter,
           id: id,
           produceTaskId: this.currentRow.id,
+          produceTaskName: this.currentRow.name,
           reportWorkType: this.reportWorkType
         });
         this.handleSort();
@@ -250,6 +252,7 @@
           this.updatePOs.push({
             ...matter,
             produceTaskId: this.currentRow.id,
+            produceTaskName: this.currentRow.name,
             reportWorkType: this.reportWorkType
           });
         } else {
@@ -303,6 +306,7 @@
             addPOs: this.addPOs,
             deletedIds: this.deletedIds,
             produceTaskId: this.currentRow.id,
+            produceTaskName: this.currentRow.name,
             updatePOs: this.updatePOs
           });
           this.$message.success('保存成功');

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.