소스 검색

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

695593266@qq.com 5 달 전
부모
커밋
8e443b96ae

+ 1 - 1
src/views/rulesManagement/components/programRulesDialog.vue

@@ -430,7 +430,7 @@
       </el-tabs>
     </el-form>
     <template v-slot:footer>
-      <el-button @click="visible = false">取消</el-button>
+      <el-button @click="updateVisible(false)">取消</el-button>
       <el-button type="primary" @click="save"> 保存 </el-button>
     </template>
     <!-- 新增设备 -->

+ 17 - 1
src/views/rulesManagement/releaseRules/components/experimentationProcess.vue

@@ -21,7 +21,7 @@
         group="project1"
         :animation="300"
         handle=".sort-handle"
-        style="flex: 1"
+        style="flex: 1;max-height:calc(100vh - 500px);overflow: auto;"
       >
         <div
           class="demo-drag-list-item ele-cell"
@@ -62,6 +62,7 @@
               @calculation="calculation"
               @editShow="editShowFn"
               :readonly="readonly"
+              @copy="copy"
               :edit="edit"
             ></customTable>
           </div>
@@ -504,6 +505,21 @@
           valueObj: {}
         });
       },
+      copy(data) {
+        console.log(data, 'asdasd');
+        let id = generateRandomString(6);
+        this.list.push({
+          id,
+          type: 'customTable',
+          ...data
+        });
+        this.$nextTick(() => {
+          this.$refs['customTextRef' + id][0].init({
+            form: null,
+            ...data
+          });
+        });
+      },
       getValue() {
         this.list.forEach((item, index) => {
           let { form, valueObj, equation, units } =

+ 34 - 12
src/views/rulesManagement/releaseRules/components/templateDiv/customTable.vue

@@ -8,7 +8,7 @@
     <el-button type="primary" @click="addRow(columns[0].length)" v-if="edit"
       >新增行</el-button
     >
-    <!-- <el-button type="primary" @click="copy()" v-if="edit">复制表格</el-button> -->
+    <el-button type="primary" @click="copy()" v-if="edit">复制表格</el-button>
     <el-checkbox v-model="isMerge" style="margin-left: 10px" v-if="edit"
       >合并单元格</el-checkbox
     >
@@ -328,7 +328,7 @@
       },
       getIndex(id) {
         let columnIndex, rowIndex;
-        console.log(id);
+
         this.columns.forEach((cell, _columnIndex) => {
           let cellIndex = cell.findIndex((data) => data.id == id);
           if (cellIndex != '-1') {
@@ -365,6 +365,9 @@
             this.columns[columnIndex].forEach((cell, rowIndex) => {
               if (cell.colspanKey.length) {
                 //当前删除的列其他行有合并过单元格的处理
+                if (!this.columns[columnIndex + 1]) {
+                  return;
+                }
                 let data = this.columns[columnIndex + 1][rowIndex];
 
                 data.colspan = cell.colspan - 1;
@@ -454,6 +457,7 @@
         if (item.colspanKey.length) {
           this.columns.forEach((cell) => {
             cell.forEach((row) => {
+          
               if (item.colspanKey.includes(row.id)) {
                 width += Number(row.style.width);
               }
@@ -535,16 +539,34 @@
           });
         }
       },
-      // copy() {
-      //   this.$emit('copy', {
-      //     form: null,
-      //     equation: JSON.parse(JSON.stringify(this.equation)),
-      //     units: JSON.parse(JSON.stringify(this.units)),
-      //     valueObj: {
-      //       columns: JSON.parse(JSON.stringify(this.valueObj))
-      //     }
-      //   });
-      // },
+      copy() {
+        let columns = JSON.parse(JSON.stringify(this.columns));
+        columns.forEach((item, index) => {
+          item.forEach((cell) => {
+            if (cell.colspanKey.length&&!cell.copyId) {
+              cell.colspanKey.forEach((key, _index) => {
+                let id = generateRandomString(5);
+                let { columnIndex, rowIndex } = this.getIndex(key);
+                columns[columnIndex][rowIndex]['copyId'] = id;
+                cell.colspanKey[_index] = id;
+              });
+            }
+            if (cell.copyId) {
+              cell.id = cell.copyId;
+            } else {
+              cell.id = generateRandomString(5);
+            }
+          });
+        });
+        this.$emit('copy', {
+          value: null,
+          equation: {},
+          units: {},
+          valueObj: {
+            columns
+          }
+        });
+      },
       inputClick(item, type) {
         if (!this.edit) {
           return;

+ 22 - 9
src/views/rulesManagement/releaseRules/index.vue

@@ -283,7 +283,12 @@
             showOverflowTooltip: true,
             minWidth: 110,
             formatter: (row) => {
-              return this.getDictValue('记录规则报工类型', row.reportWorkType);
+              return this.getDictValue(
+                this.$route.path == '/releaseRules/experimentReleaseRules'
+                  ? '实验报工类型'
+                  : '记录规则报工类型',
+                row.reportWorkType
+              );
             }
           },
           {
@@ -293,7 +298,12 @@
             showOverflowTooltip: true,
             minWidth: 110,
             formatter: (row) => {
-              return this.getDictValue('记录规则类型', row.classify);
+              return this.getDictValue(
+                this.$route.path == '/releaseRules/experimentReleaseRules'
+                  ? '实验规则类型'
+                  : '记录规则类型',
+                row.classify
+              );
             }
           },
           {
@@ -304,7 +314,9 @@
             minWidth: 110,
             formatter: (row) => {
               return this.getDictValue(
-                '记录表模板样式',
+                this.$route.path == '/releaseRules/experimentReleaseRules'
+                  ? '实验模板样式'
+                  : '记录表模板样式',
                 row.recordTemplateStyle
               );
             }
@@ -709,13 +721,14 @@
           // 默认选中第一个节点
           this.treeNode = this.typeTree.length > 0 ? this.typeTree[0] : null;
           // console.log('this.treeNode`1111111111111111111111`', this.treeNode);
-          if (this.treeNode) {
-            // 默认选中节点
-            this.$nextTick(() => {
+
+          // 默认选中节点
+          this.$nextTick(() => {
+            if (this.treeNode) {
               this.$refs.treeRef.setCurrentKey(this.treeNode.id);
-              this.reload();
-            });
-          }
+            }
+            this.reload();
+          });
         }
 
         console.log('typeTree', this.typeTree);

+ 17 - 18
src/views/system/organization/components/org-user-edit.vue

@@ -19,6 +19,23 @@
     >
       <el-row :gutter="15">
         <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
+          <el-form-item label="所属工厂:">
+            <el-select
+              style="width: 100%"
+              clearable
+              v-model="form.factoryId"
+              filterable
+              :disabled="!!form.loginName"
+              placeholder="请选择所属工厂"
+            >
+              <el-option
+                v-for="item in factoryList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
           <el-form-item label="所属机构:" prop="groupId">
             <org-select
               :data="institutionList"
@@ -44,24 +61,6 @@
             ></el-cascader>
           </el-form-item>
 
-          <el-form-item label="所属工厂:">
-            <el-select
-              style="width: 100%"
-              clearable
-              v-model="form.factoryId"
-              filterable
-              :disabled="!!form.loginName"
-              placeholder="请选择所属工厂"
-            >
-              <el-option
-                v-for="item in factoryList"
-                :label="item.name"
-                :value="item.id"
-                :key="item.id"
-              ></el-option>
-            </el-select>
-          </el-form-item>
-
           <el-form-item label="性别:" prop="sex">
             <el-select
               clearable

+ 16 - 8
src/views/system/organization/components/org-user-list.vue

@@ -296,7 +296,13 @@
             showOverflowTooltip: true,
             minWidth: 110
           },
-
+          {
+            prop: 'phone',
+            label: '手机号',
+            sortable: 'custom',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
           {
             prop: 'postName',
             label: '岗位',
@@ -351,7 +357,7 @@
             showOverflowTooltip: true,
             minWidth: 120,
             formatter: (_row, _column, cellValue) => {
-              return _row.code? '已推送' : '未推送';
+              return _row.code ? '已推送' : '未推送';
             }
           },
           {
@@ -483,12 +489,14 @@
     methods: {
       allPushBtn() {
         const dataId = this.selection.map((v) => v.id);
-        employeePush(dataId).then((res) => {
-          this.$message.success('推送成功!');
-          this.reload();
-        }).catch(() => {
-          console.log('推送失败!');
-        });
+        employeePush(dataId)
+          .then((res) => {
+            this.$message.success('推送成功!');
+            this.reload();
+          })
+          .catch(() => {
+            console.log('推送失败!');
+          });
       },
       async addUsers(row) {
         // this.userRow = null;

+ 14 - 2
src/views/system/organization/components/org-user-search.vue

@@ -38,9 +38,20 @@
           />
         </el-form-item>
       </el-col>
+      <el-col v-bind="styleResponsive ? { md: 3 } : { span: 3 }">
+        <el-form-item>
+          <el-input
+            clearable
+            size="small"
+            v-model.trim="where.phone"
+            placeholder="手机号"
+          />
+        </el-form-item>
+      </el-col>
       <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
         <DictSelection
-          dictName="岗位"   placeholder="请选择岗位"
+          dictName="岗位"
+          placeholder="请选择岗位"
           clearable
           filterable
           v-model="where.postId"
@@ -82,7 +93,8 @@
         jobNumber: '',
         loginName: '',
         name: '',
-        postId:[],
+        phone:'',
+        postId: []
       };
       return {
         // 表单数据