Jelajahi Sumber

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

liujt 2 bulan lalu
induk
melakukan
e0b1715c3f
25 mengubah file dengan 2028 tambahan dan 1235 penghapusan
  1. 11 0
      src/api/appUpdate/index.js
  2. 18 1
      src/views/appUpdate/index.vue
  3. 131 123
      src/views/factoryModel/productionLine/components/search.vue
  4. 15 6
      src/views/factoryModel/station/components/ProductModal.vue
  5. 41 26
      src/views/factoryModel/station/components/edit.vue
  6. 168 146
      src/views/factoryModel/station/components/search.vue
  7. 4 0
      src/views/factoryModel/station/index.vue
  8. 44 5
      src/views/material/BOMmanage/components/routingDialog.vue
  9. 31 19
      src/views/material/BOMmanage/qualityTesting/term.vue
  10. 18 3
      src/views/rulesManagement/components/MaterialAdd.vue
  11. 22 2
      src/views/rulesManagement/components/product-search.vue
  12. 78 9
      src/views/rulesManagement/components/programRulesDialog.vue
  13. 83 4
      src/views/rulesManagement/releaseRules/components/experimentationProcessNew.vue
  14. 764 565
      src/views/rulesManagement/releaseRules/components/templateDiv/customTableNew.vue
  15. 136 16
      src/views/system/organization/components/staffSelection.vue
  16. 52 15
      src/views/technology/productParam/components/product-search.vue
  17. 15 4
      src/views/technology/production/components/user-edit.vue
  18. 83 15
      src/views/technology/production/index.vue
  19. 177 156
      src/views/technology/route/components/historyModal.vue
  20. 1 0
      src/views/technology/route/components/production/components/user-search.vue
  21. 13 1
      src/views/technology/route/components/production/index.vue
  22. 4 1
      src/views/technology/route/components/user-edit.vue
  23. 15 1
      src/views/technology/route/components/user-taskinstance.vue
  24. 2 1
      src/views/technology/version/components/user-search.vue
  25. 102 116
      src/views/workforceManagement/team/components/search.vue

+ 11 - 0
src/api/appUpdate/index.js

@@ -21,3 +21,14 @@ export async function addInformation(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+/**
+ * 删除
+ */
+export async function deleteList(data) {
+  const res = await request.delete(`/sys/appupdates/delete`, {data});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 18 - 1
src/views/appUpdate/index.vue

@@ -35,6 +35,19 @@
             下载
           </el-link>
         </template>
+        <template v-slot:action="{ row }">
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除此版本吗?"
+            @confirm="deleteList(row)"
+          >
+            <template v-slot:reference>
+              <el-link type="danger" :underline="false" icon="el-icon-delete">
+                删除
+              </el-link>
+            </template>
+          </el-popconfirm>
+        </template>
       </ele-pro-table>
     </el-card>
     <!-- 新增/编辑/详情弹窗 -->
@@ -50,7 +63,7 @@
 <script>
   import addOrEditDialog from './components/addOrEditDialog.vue';
   import { getFile } from '@/api/system/file';
-  import { getTableList, addInformation } from '@/api/appUpdate';
+  import { getTableList, deleteList } from '@/api/appUpdate';
 
   export default {
     name: 'technologyProduction',
@@ -130,6 +143,10 @@
       reload(where) {
         this.$refs.table.reload({ page: 1, where: where });
       },
+      async deleteList({ id }) {
+        await deleteList([id]);
+        this.$refs.table.reload();
+      },
       /* 打开编辑弹窗 */
       openEdit(row = {}, type) {
         this.addOrEditDialogFlag = true;

+ 131 - 123
src/views/factoryModel/productionLine/components/search.vue

@@ -1,137 +1,145 @@
 <!-- 搜索表单 -->
 <template>
-  <el-form
-    label-width="77px"
-    class="ele-form-search"
-    @keyup.enter.native="search"
-    @submit.native.prevent
-  >
-    <el-row :gutter="15">
-      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
-        <el-form-item label="产线编码:">
-          <el-input clearable v-model.trim="where.code" placeholder="请输入" />
-        </el-form-item>
-      </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
-        <el-form-item label="产线名称:">
-          <el-input clearable v-model.trim="where.name" placeholder="请输入" />
-        </el-form-item>
-      </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
-        <el-form-item label="所属区域:" prop="location_city">
-          <area-select
-            v-model.trim="where.areaId"
-            :data="areaTreeList"
-            ref="tree"
-          />
-        </el-form-item>
-      </el-col>
-      <!-- <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
-        <el-form-item label="组织机构:">
-          <auth-selection v-model.trim="where.deptIds" style="width: 100%"></auth-selection>
-        </el-form-item>
-      </el-col> -->
-      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
-        <div class="ele-form-actions">
-          <el-button
-            type="primary"
-            icon="el-icon-search"
-            class="ele-btn-icon"
-            @click="search"
-          >
-            查询
-          </el-button>
-          <el-button @click="reset">重置</el-button>
-        </div>
-      </el-col>
-    </el-row>
-  </el-form>
+  <seekPage :seekList="seekList" @search="search"></seekPage>
 </template>
 
 <script>
-import {basicAreaPageAPI} from "@/api/regionalManage";
-import AreaSelect from "@/views/enterpriseModel/regionalManage/components/area-cascader.vue";
+  import { basicAreaPageAPI } from '@/api/regionalManage';
+  import { getFactoryarea } from '@/api/factoryModel';
+  import work from '@/api/technology/work';
 
-export default {
-  components: {AreaSelect},
-  props: {
-    options_groupId: {
-      type: Array,
-      default() {
-        return [];
+  export default {
+    components: {},
+    props: {
+      options_groupId: {
+        type: Array,
+        default() {
+          return [];
+        }
+      },
+      options_factory: {
+        type: Array,
+        default() {
+          return [];
+        }
       }
     },
-    options_factory: {
-      type: Array,
-      default() {
-        return [];
+    data() {
+      return {
+        areaTreeList: [],
+        factoryList: [],
+        workshopList: [],
+        workCenterList: []
+      };
+    },
+    computed: {
+      seekList() {
+        return [
+          {
+            label: '产线编码:',
+            value: 'code',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '产线名称:',
+            value: 'name',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '所属区域:',
+            value: 'areaId',
+            type: 'selectTree',
+            planList: this.areaTreeList,
+            placeholder: '请选择'
+          },
+          {
+            label: '所属工厂:',
+            value: 'factoryId',
+            type: 'select',
+            planList: this.factoryList.map((item) => ({
+              label: item.name,
+              value: item.id
+            })),
+            placeholder: '请选择'
+          },
+          {
+            label: '所属车间:',
+            value: 'workshopId',
+            type: 'select',
+            planList: this.workshopList.map((item) => ({
+              label: item.name,
+              value: item.id
+            })),
+            placeholder: '请选择'
+          },
+          {
+            label: '工作中心:',
+            value: 'workCenterId',
+            type: 'select',
+            planList: this.workCenterList.map((item) => ({
+              label: item.name,
+              value: item.id
+            })),
+            placeholder: '请选择'
+          }
+        ];
       }
-    }
-  },
-  watch: {
-    options_groupId(nval) {
-      this.toTreeData(nval);
-    }
-  },
-  data() {
-    // 默认表单数据
-    const defaultWhere = {
-      code: '',
-      name: ''
-    };
-    return {
-      defaultWhere,
-      // 表单数据
-      where: { ...defaultWhere },
-      options: {
-        groupId: []
-      },
-      areaTreeList:[]
-    };
-  },
-  computed: {
-    // 是否开启响应式布局
-    styleResponsive() {
-      return this.$store.state.theme.styleResponsive;
-    }
-  },
-  created() {
-    this.getBasicAreaList();
-  },
-  methods: {
-    /* 获取区域集合 */
-    async getBasicAreaList() {
-      this.areaList = await basicAreaPageAPI(
-        {
+    },
+    created() {
+      this.getBasicAreaList();
+      this.getFactoryList();
+      this.getWorkshopList();
+      this.getListWorkCenter();
+    },
+    methods: {
+      /* 获取区域集合 */
+      async getBasicAreaList() {
+        this.areaList = await basicAreaPageAPI({
           pageNum: 1,
           size: 9999
-        }
-      )
-      this.areaTreeList = this.$util.toTreeData({
-        data: this.areaList,
-        idField: 'id',
-        parentIdField: 'parentId'
-      });
+        });
+        this.areaTreeList = this.$util.toTreeData({
+          data: this.areaList,
+          idField: 'id',
+          parentIdField: 'parentId'
+        });
+      },
 
-    },
-    /* 搜索 */
-    search() {
-      this.$emit('search', this.where);
-    },
-    /*  重置 */
-    reset() {
-      console.log(this.defaultWhere);
-      this.where = { ...this.defaultWhere };
-      this.search();
-    },
-    // 格式化公司数据
-    toTreeData(val) {
-      this.options.groupId = this.$util.toTreeData({
-        data: val,
-        idField: 'id',
-        parentIdField: 'parentId'
-      });
+      // 获取工厂列表
+      async getFactoryList() {
+        const { list } = await getFactoryarea({
+          pageNum: 1,
+          size: 999,
+          type: 1,
+          enable: 1
+        });
+        this.factoryList = list || [];
+      },
+
+      // 获取车间列表
+      async getWorkshopList() {
+        const { list } = await getFactoryarea({
+          pageNum: 1,
+          size: 9999,
+          type: 3,
+          enable: 1
+        });
+        this.workshopList = list || [];
+      },
+
+      // 获取工作中心列表
+      async getListWorkCenter() {
+        await work.list({ pageNum: 1, size: -1 }).then((res) => {
+          this.workCenterList = res.list;
+        });
+      },
+
+      /* 搜索 */
+      search(where) {
+        this.$emit('search', where);
+      }
     }
-  }
-};
+  };
 </script>

+ 15 - 6
src/views/factoryModel/station/components/ProductModal.vue

@@ -11,7 +11,11 @@
     :maxable="true"
   >
     <el-card shadow="never">
-      <ProductSearch @search="reload" ref="searchRef" />
+      <ProductSearch
+        @search="reload"
+        ref="searchRef"
+        :factoryName="factoryName"
+      />
 
       <ele-split-layout
         width="244px"
@@ -35,6 +39,7 @@
             height="calc(100vh - 350px)"
             class="dict-table"
             @cell-click="cellClick"
+            :initLoad="false"
           >
             <!-- 表头工具栏 -->
             <template v-slot:action="{ row }">
@@ -72,7 +77,7 @@
     data() {
       return {
         visible: false,
-
+        factoryName: '',
         deviceList: [],
 
         // 表格列配置
@@ -232,7 +237,7 @@
         categoryLevelId: null,
         radio: null,
         idx: null,
-
+        factoryId: '',
         isCategory: true
       };
     },
@@ -250,13 +255,15 @@
             ...where,
             pageNum: page,
             size: limit,
-            categoryLevelId: this.categoryLevelId
+            categoryLevelId: this.categoryLevelId,
+            factoryId: this.factoryId
           });
         } else {
           return URL({
             ...where,
             pageNum: page,
-            size: limit
+            size: limit,
+            factoryId: this.factoryId
           });
         }
       },
@@ -284,7 +291,8 @@
           this.title = title;
           this.categoryLevelId = categoryLevelId;
           this.idx = idx;
-
+          console.log(item, 'item');
+          this.factoryName=item.factoryName
           this.current = {
             id: item.categoryId,
             name: item.categoryName,
@@ -292,6 +300,7 @@
           };
           this.radio = item.categoryId;
         }
+        this.factoryId = item.factoryId;
         this.getAllDeviceList();
         this.visible = true;
       },

+ 41 - 26
src/views/factoryModel/station/components/edit.vue

@@ -16,7 +16,7 @@
         header="基本信息"
         body-style="padding: 22px 22px 0 22px;"
       >
-        <el-row>
+        <el-row class="station-base-grid">
           <el-col :span="8">
             <el-form-item label="工位编码:" prop="code">
               <el-input
@@ -61,12 +61,8 @@
             </el-form-item>
           </el-col>
 
-          <el-col :span="8">
-            <el-form-item
-              label="设备编码:"
-              prop="extInfo.assetCode"
-              v-if="form.extInfo.type == 1"
-            >
+          <el-col v-if="form.extInfo.type == 1" :span="8">
+            <el-form-item label="设备编码:" prop="extInfo.assetCode">
               <el-input
                 v-model="form.extInfo.assetCode"
                 readonly
@@ -75,12 +71,8 @@
             </el-form-item>
           </el-col>
 
-          <el-col :span="8">
-            <el-form-item
-              label="设备名称:"
-              prop="extInfo.assetName"
-              v-if="form.extInfo.type == 1"
-            >
+          <el-col v-if="form.extInfo.type == 1" :span="8">
+            <el-form-item label="设备名称:" prop="extInfo.assetName">
               <el-input disabled v-model="form.extInfo.assetName" />
             </el-form-item>
           </el-col>
@@ -110,6 +102,7 @@
                   v-for="item in factoryList"
                   :key="item.id"
                   :label="item.name"
+                  @click="form.extInfo.factoryName = item.name"
                   :value="item.id"
                 >
                 </el-option>
@@ -179,7 +172,6 @@
               </el-select>
             </el-form-item>
           </el-col>
-
           <el-col :span="8">
             <el-form-item label="班组:" prop="extInfo.teamId">
               <el-select
@@ -438,6 +430,7 @@
         assetName: '', //设备名称
         meterMeasuringUnit: '', // 节拍计量单位
         workCenterId: null, //所属工作中心
+        factoryName: '',
         // produceId: null, //可执行工序
         type: null,
         teamId: null,
@@ -610,6 +603,10 @@
     },
     methods: {
       chooseAsset() {
+        if (!this.form.extInfo.factoryId) {
+          this.$message.error('请先选择工厂');
+          return;
+        }
         this.$refs.productRefs.open(this.form.extInfo, '选择设备', '4');
       },
       change_team(teamId) {
@@ -766,17 +763,20 @@
           if (!valid) {
             return false;
           }
-          if (this.clientEnvironmentId != 9) {
-            this.form.factoryWorkstationOperations =
-              this.$refs.stationMeter.getValue();
-            if (!this.form.factoryWorkstationOperations.length) {
-              return this.$message.error('请添加工序');
-            } else {
-              this.form.taskIds = this.form.factoryWorkstationOperations.map(
-                (n) => n.operationId
-              );
-            }
+
+          this.form.factoryWorkstationOperations =
+            this.$refs.stationMeter.getValue();
+          if (
+            !this.form.factoryWorkstationOperations.length &&
+            this.clientEnvironmentId != 9
+          ) {
+            return this.$message.warning('请添加工序');
+          } else {
+            this.form.taskIds = this.form.factoryWorkstationOperations.map(
+              (n) => n.operationId
+            );
           }
+
           this.loading = true;
 
           if (this.type != 'edit') {
@@ -900,7 +900,11 @@
 
         this.form.productionLineId = '';
         this.options.productionLineId = [];
-
+        this.form.extInfo.assetCode = '';
+        this.form.extInfo.assetName = '';
+        this.form.extInfo.assetId = '';
+        this.form.areaName = '';
+        this.form.areaId = '';
         this.getlistCf();
         this.getteampagerList(this.form.extInfo.factoryId);
       },
@@ -977,9 +981,11 @@
             ...res,
             extInfo: {
               ...baseForm.extInfo,
-              ...res.extInfo
+              ...res.extInfo,
+              factoryName: res.factoryName
             }
           };
+
           // this.form = this.deepCopy(Object.assign({}, this.form, res));
 
           // console.log(this.form, 'this.form1');
@@ -1039,6 +1045,15 @@
     }
   }
 
+  .station-base-grid {
+    display: flex;
+    flex-wrap: wrap;
+
+    > .el-col {
+      float: none;
+    }
+  }
+
   :deep(
       .el-dialog:not(.ele-dialog-form)
         .el-dialog__body

+ 168 - 146
src/views/factoryModel/station/components/search.vue

@@ -1,116 +1,19 @@
 <!-- 搜索表单 -->
 <template>
-  <el-form
-    label-width="100px"
-    class="ele-form-search"
-    @keyup.enter.native="search"
-    @submit.native.prevent
-  >
-    <el-row :gutter="15">
-      <el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }">
-        <el-form-item label="工位编码:">
-          <el-input clearable v-model.trim="where.code" placeholder="请输入" />
-        </el-form-item>
-        <el-form-item label="所属区域:">
-          <area-select
-            v-model.trim="where.areaId"
-            :data="areaTreeList"
-            ref="tree"
-          />
-        </el-form-item>
-      </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }">
-        <el-form-item label="工位名称:">
-          <el-input clearable v-model.trim="where.name" placeholder="请输入" />
-        </el-form-item>
-      </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="所属工作中心:" prop="extInfo.workCenterId">
-          <el-select
-            v-model="where.workCenterId"
-            filterable
-            placeholder="请选择"
-            style="width: 100%"
-            clearable
-          >
-            <el-option
-              v-for="item in workCenterList"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
-      </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="工序:" prop="where.sourceTaskId">
-          <el-select
-            v-model="where.sourceTaskId"
-            filterable
-            placeholder="请选择"
-            style="width: 100%"
-            clearable
-          >
-            <el-option
-              v-for="item in sourceTaskList"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
-      </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }">
-        <el-form-item label="负责人:">
-          <el-select
-            v-model.trim="where.leaderId"
-            filterable
-            placeholder="请选择"
-            style="width: 100%"
-            clearable
-          >
-            <el-option
-              v-for="item in options.leaderId"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
-      </el-col>
-      <!-- <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 6 }">
-        <el-form-item label="组织机构:">
-          <auth-selection v-model.trim="where.deptIds" style="width: 100%"></auth-selection>
-        </el-form-item>
-      </el-col> -->
-      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
-        <div class="ele-form-actions">
-          <el-button
-            type="primary"
-            icon="el-icon-search"
-            class="ele-btn-icon"
-            @click="search"
-          >
-            查询
-          </el-button>
-          <el-button @click="reset">重置</el-button>
-        </div>
-      </el-col>
-    </el-row>
-  </el-form>
+  <seekPage :seekList="seekList" @search="search"></seekPage>
 </template>
 
 <script>
   import { getUserPage } from '@/api/system/organization';
-  import AreaSelect from '@/views/enterpriseModel/regionalManage/components/area-cascader.vue';
   import { basicAreaPageAPI } from '@/api/regionalManage';
   import work from '@/api/technology/work';
   import producetask from '@/api/technology/production';
+  import { getteampage } from '@/api/workforceManagement/team';
+  import {
+    getFactoryarea
+  } from '@/api/factoryModel';
   export default {
-    components: { AreaSelect },
+    components: {},
     props: {
       options_groupId: {
         type: Array,
@@ -125,37 +28,124 @@
         }
       }
     },
-    watch: {
-      options_groupId(nval) {
-        this.toTreeData(nval);
-      }
-    },
     data() {
-      // 默认表单数据
-      const defaultWhere = {
-        code: '',
-        name: '',
-        leaderId: '',
-        workCenterId: '',
-        sourceTaskId: ''
-      };
       return {
-        defaultWhere,
-        // 表单数据
-        where: { ...defaultWhere },
-        options: {
-          groupId: [],
-          leaderId: []
-        },
         workCenterList: [],
         areaTreeList: [],
-        sourceTaskList: []
+        sourceTaskList: [],
+        leaderIdList: [],
+        teamList: [],
+        factoryList: [],
+        workshopPlanList: [],
+        workshopList: []
       };
     },
     computed: {
-      // 是否开启响应式布局
-      styleResponsive() {
-        return this.$store.state.theme.styleResponsive;
+      seekList() {
+        return [
+          {
+            label: '工位编码:',
+            value: 'code',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '所属区域:',
+            value: 'areaId',
+            type: 'selectTree',
+            planList: this.areaTreeList,
+            placeholder: '请选择'
+          },
+          {
+            label: '工位名称:',
+            value: 'name',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '所属工作中心:',
+            value: 'workCenterId',
+            labelWidth: '120px',
+            type: 'select',
+            planList: this.workCenterList.map((item) => ({
+              label: item.name,
+              value: item.id
+            })),
+            placeholder: '请选择'
+          },
+          {
+            label: '工序:',
+            value: 'sourceTaskId',
+            type: 'select',
+            planList: this.sourceTaskList.map((item) => ({
+              label: item.name,
+              value: item.id
+            })),
+            placeholder: '请选择'
+          },
+          {
+            label: '负责人:',
+            value: 'leaderId',
+            type: 'select',
+            planList: this.leaderIdList.map((item) => ({
+              label: item.name,
+              value: item.id
+            })),
+            placeholder: '请选择'
+          },
+          {
+            label: '所属班组:',
+            value: 'teamId',
+            type: 'select',
+            planList: this.teamList.map((item) => ({
+              label: item.name,
+              value: item.id
+            })),
+            placeholder: '请选择'
+          },
+          {
+            label: '所属工厂:',
+            value: 'factoryId',
+            type: 'select',
+            planList: this.factoryList.map((item) => ({
+              label: item.name,
+              value: item.id
+            })),
+            placeholder: '请选择'
+          },
+          {
+            label: '设备编码:',
+            value: 'assetCode',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '设备名称:',
+            value: 'assetName',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '所属厂房:',
+            value: 'workshopPlanId',
+            type: 'select',
+            planList: this.workshopPlanList.map((item) => ({
+              label: item.workshopPlanName || item.name,
+              value: item.id
+            })),
+            placeholder: '请选择'
+          },
+          {
+            label: '所属车间:',
+            value: 'workshopId',
+            type: 'select',
+            planList: this.workshopList.map((item) => ({
+              label: item.name,
+              value: item.id
+            })),
+            placeholder: '请选择'
+          }
+        ];
       }
     },
     created() {
@@ -163,6 +153,10 @@
       this.getBasicAreaList();
       this.getListWorkCenter();
       this.getListProduce();
+      this.getTeamPage();
+      this.getFactoryList();
+      this.getWorkshopPlanList();
+      this.getWorkshopList();
     },
     methods: {
       /* 获取区域集合 */
@@ -186,37 +180,65 @@
 
       getListProduce() {
         producetask.list({ pageNum: 1, size: -1 }).then((res) => {
-          console.log(res.list, '工序列表');
           this.sourceTaskList = res.list || [];
         });
       },
 
       /* 搜索 */
-      search() {
-        this.$emit('search', this.where);
-      },
-      /*  重置 */
-      reset() {
-        console.log(this.defaultWhere);
-        this.where = { ...this.defaultWhere };
-        this.search();
-      },
-      // 格式化公司数据
-      toTreeData(val) {
-        this.options.groupId = this.$util.toTreeData({
-          data: val,
-          idField: 'id',
-          parentIdField: 'parentId'
-        });
+      search(where) {
+        this.$emit('search', where);
       },
+
       // 获取人员
       getUserPage() {
         let par = {
           size: 999
         };
         getUserPage(par).then((res) => {
-          console.log(res);
-          this.options.leaderId = res.list;
+          this.leaderIdList = res.list;
+        });
+      },
+      // 获取班组
+      getTeamPage() {
+        let param = {
+          pageNum: 1,
+          size: 9999
+        };
+        getteampage(param).then((res) => {
+          this.teamList = res.list || [];
+        });
+      },
+      // 获取工厂列表
+      getFactoryList() {
+        getFactoryarea({
+          pageNum: 1,
+          size: 999,
+          type: 1,
+          enable: 1
+        }).then((res) => {
+          this.factoryList = res.list || [];
+        });
+      },
+      // 获取厂房列表
+      getWorkshopPlanList() {
+        getFactoryarea({
+          pageNum: 1,
+          size: 9999,
+          type: 2,
+          enable: 1
+        }).then((res) => {
+          this.workshopPlanList = res.list || [];
+        });
+      },
+      // 获取车间列表
+      getWorkshopList() {
+        getFactoryarea({
+          pageNum: 1,
+          size: 9999,
+          type: 3,
+          enable: 1
+        }).then((res) => {
+          this.workshopList = res.list || [];
         });
       }
     }

+ 4 - 0
src/views/factoryModel/station/index.vue

@@ -141,6 +141,10 @@
             label: '所属区域',
             prop: 'areaName'
           },
+          {
+            label: '所属班组',
+            prop: 'teamName'
+          },
 
           {
             label: '所属工厂',

+ 44 - 5
src/views/material/BOMmanage/components/routingDialog.vue

@@ -55,6 +55,24 @@
                 </el-select>
               </el-form-item>
             </el-col>
+            <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
+              <el-form-item label="所属工厂:">
+                <el-select
+                  v-model.trim="where.factoriesId"
+                  clearable
+                  placeholder="请选择"
+                  :style="{ width: '100%' }"
+                >
+                  <el-option
+                    v-for="item in options_factory"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
             <!-- <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
               <el-form-item label="状态:" label-width="70px">
                 <el-select
@@ -110,7 +128,7 @@
           </template>
 
           <template v-slot:routeType="{ row }">
-           {{ row.routeType == 2 ? '委外' :  row.routeType == 1 ? '生产' :   row.routeType == 3 ? '质检' : ''}} 
+           {{ row.routeType == 2 ? '委外' :  row.routeType == 1 ? '生产' :   row.routeType == 3 ? '质检' : ''}}
           </template>
         </ele-pro-table>
       </el-card>
@@ -135,6 +153,7 @@
     workingProcedureSave
   } from '@/api/material/BOM';
   import { pageList } from '@/api/technology/version/version.js';
+  import { getFactoryarea } from '@/api/factoryModel';
   import UserDetail from './user-detail.vue';
   import route from '@/api/technology/route';
   export default {
@@ -147,7 +166,13 @@
         visible: false,
         selection: [],
         versionList: [],
-        where: {},
+        where: {
+          code: '',
+          name: '',
+          produceVersionId: '',
+          factoriesId: ''
+        },
+        options_factory: [],
         // 表格列配置
         columns: [
           {
@@ -240,10 +265,16 @@
     },
     created() {
       this.getVersionList();
+      this.getFactoryarea();
     },
     methods: {
       reset() {
-        this.where = {};
+        this.where = {
+          code: '',
+          name: '',
+          produceVersionId: '',
+          factoriesId: ''
+        };
         this.search();
       },
       handleClose() {
@@ -264,7 +295,7 @@
           this.tableData['processRoute'] = { list: [] }
         }
         this.visible = true;
-       
+
       },
       selected() {
         let routingId = this.selection.map((it) => it.id);
@@ -285,7 +316,7 @@
                 newArr.push(data[i]);
               }
             }
-          
+
             workingProcedureUpdate({
               id: this.tableData.id,
               categoryId: this.treeData.categoryId,
@@ -336,6 +367,14 @@
 
         this.versionList = res.list;
       },
+      getFactoryarea() {
+        getFactoryarea({
+          type: 1,
+          size: 9999
+        }).then((res) => {
+          this.options_factory = res.list;
+        });
+      },
       search() {
         this.reload(this.where);
       },

+ 31 - 19
src/views/material/BOMmanage/qualityTesting/term.vue

@@ -49,27 +49,12 @@
 
       <template v-slot:defaultValue="{ row }">
         <div class="main-parameter-cell">
-          <div class="main-parameter-symbol" v-if="row.textType != 8">
-            <DictSelection
-              clearable
-              dictName="数学字符"
-              v-model="row.symbol"
-              :disabled="isView"
-            ></DictSelection>
-          </div>
           <div
             v-if="row.textType == 3 || row.textType == 8"
             class="main-parameter-range"
           >
             <el-input
-              v-model="row.minValue"
-              :disabled="isView"
-              :style="{ width: row.textType == 3 ? '45%' : '150px' }"
-            ></el-input>
-            <span v-if="row.textType == 3">&nbsp;&nbsp;-</span>
-
-            <el-input
-              v-else
+              v-if="row.textType == 8"
               v-model="row.defaultValue"
               style="width: 250px; margin-left: 10px"
             >
@@ -84,6 +69,14 @@
                 </DictSelection
               ></template>
             </el-input>
+
+            <el-input
+              v-model="row.minValue"
+              :disabled="isView"
+              :style="{ width: row.textType == 3 ? '45%' : '150px' }"
+            ></el-input>
+            <span>&nbsp;&nbsp;-</span>
+
             <el-input
               v-model="row.maxValue"
               :disabled="isView"
@@ -92,22 +85,41 @@
                 marginLeft: '10px'
               }"
             ></el-input>
+            <div class="main-parameter-unit" v-if="row.textType != 8">
+              <DictSelection
+                dictName="工艺参数单位"
+                clearable
+                filterable
+                v-model="row.unitName"
+                :disabled="isView"
+              ></DictSelection>
+            </div>
           </div>
-          <div v-else class="main-parameter-input">
+          <div v-else style="display: flex; width: 80%">
+            <!-- <div class="main-parameter-symbol"> -->
+            <DictSelection
+              style="width: 100px"
+              clearable
+              dictName="数学字符"
+              v-model="row.symbol"
+              :disabled="isView"
+            ></DictSelection>
+            <!-- </div> -->
             <el-input
               v-model="row.defaultValue"
               placeholder="请输入"
               :disabled="isView"
             ></el-input>
-          </div>
-          <div class="main-parameter-unit" v-if="row.textType != 8">
+            <!-- <div class="main-parameter-unit"> -->
             <DictSelection
               dictName="工艺参数单位"
+              style="width: 150px"
               clearable
               filterable
               v-model="row.unitName"
               :disabled="isView"
             ></DictSelection>
+            <!-- </div> -->
           </div>
         </div>
       </template>

+ 18 - 3
src/views/rulesManagement/components/MaterialAdd.vue

@@ -30,7 +30,11 @@
 
         <!-- 数据表格 -->
         <template v-slot:content>
-          <ProductSearch @search="reload" ref="searchRef" />
+          <ProductSearch
+            @search="reload"
+            ref="searchRef"
+            :factoryName="factoryName"
+          />
           <ele-pro-table
             height="400"
             ref="table"
@@ -110,6 +114,9 @@
           label: 'name'
         },
         type: null,
+        factoryId: '',
+        factoryName: '',
+
         // 表格选中数据
         selection: [],
         processData: [],
@@ -314,6 +321,11 @@
                 label: '固资编码',
                 prop: 'fixCode'
               },
+              {
+                label: '所属工厂',
+                prop: 'factoryName'
+              },
+
               {
                 label: '使用人',
                 prop: 'usePerson'
@@ -384,13 +396,14 @@
           pageNum: page,
           size: limit,
           categoryLevelId: this.categoryLevelId,
-          rootCategoryLevelId: this.rootId
+          rootCategoryLevelId: this.rootId,
+          factoryId: this.factoryId||''
         });
         console.log('res---------', res);
         this.categoryId = res.list[0]?.categoryId;
         return res;
       },
-      open(ruleIdList, ruleIdListIndex) {
+      open(ruleIdList, ruleIdListIndex, factoryId,factoryName) {
         let list = ruleIdList
           .map((item) => {
             return item.equipmentList;
@@ -403,6 +416,8 @@
         }
         this.ruleIdListIndex = ruleIdListIndex;
         this.visible = true;
+        this.factoryId = factoryId;
+        this.factoryName = factoryName;
         this.getTreeData();
       },
 

+ 22 - 2
src/views/rulesManagement/components/product-search.vue

@@ -14,13 +14,21 @@
       </el-col>
       <el-col v-bind="styleResponsive ? { md: 8 } : { span: 8 }">
         <el-form-item label="编号">
-          <el-input clearable v-model.trim="where.codeNumber" placeholder="请输入" />
+          <el-input
+            clearable
+            v-model.trim="where.codeNumber"
+            placeholder="请输入"
+          />
         </el-form-item>
       </el-col>
 
       <el-col v-bind="styleResponsive ? { md: 8 } : { span: 8 }">
         <el-form-item label="固资编码">
-          <el-input clearable v-model.trim="where.fixCode" placeholder="请输入" />
+          <el-input
+            clearable
+            v-model.trim="where.fixCode"
+            placeholder="请输入"
+          />
         </el-form-item>
       </el-col>
     </el-row>
@@ -43,6 +51,15 @@
           <DeptSelect v-model="where.postId" />
         </el-form-item>
       </el-col>
+      <el-col
+        v-bind="styleResponsive ? { md: 8 } : { span: 8 }"
+        v-if="factoryName"
+      >
+        <el-form-item label="所属工厂">
+          <el-input disabled :value="factoryName" />
+        </el-form-item>
+      </el-col>
+
       <el-col v-bind="styleResponsive ? { md: 8 } : { span: 8 }">
         <div class="ele-form-actions">
           <el-button
@@ -86,6 +103,9 @@
         treeData: []
       };
     },
+    props: {
+      factoryName: ''
+    },
     computed: {
       // 是否开启响应式布局
       styleResponsive() {

+ 78 - 9
src/views/rulesManagement/components/programRulesDialog.vue

@@ -84,6 +84,29 @@
           </el-form-item>
         </el-col>
 
+        <el-col
+          :span="8"
+          v-if="dispatchType && !dialogTitle.includes('量具送检')"
+        >
+          <el-form-item label="所属工厂" prop="factoryId">
+            <el-select
+              v-model="addForm.factoryId"
+              :disabled="isBindPlan"
+              size="small"
+              @change="factoryChange"
+              style="width: 100%"
+              clearable
+            >
+              <el-option
+                :value="item.id"
+                :label="item.name"
+                v-for="item in factoryList"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+
         <el-col
           :span="8"
           v-if="
@@ -95,11 +118,10 @@
           <el-form-item label="班组" prop="teamId">
             <el-select
               v-model="addForm.teamId"
-              :disabled="isBindPlan"
+              :disabled="isBindPlan || !addForm.factoryId"
               size="small"
               @change="teamChange"
               :key="'teamId'"
-
               style="width: 100%"
             >
               <el-option
@@ -498,6 +520,7 @@
     getByTaskId
   } from '@/api/material/BOM';
   import { getteampage } from '@/api/workforceManagement/team';
+  import { getFactoryarea } from '@/api/factoryModel';
 
   import { getFile } from '@/api/system/file';
   import { deepClone } from 'ele-admin/lib/utils/core';
@@ -605,6 +628,10 @@
           urgent: [
             { required: true, message: '请选择紧急程度', trigger: 'change' }
           ],
+          factoryId: [
+            { required: true, message: '请选择所属工厂', trigger: 'change' }
+          ],
+
           type: [{ required: true, message: '请选择', trigger: 'change' }]
         },
 
@@ -698,7 +725,8 @@
         hasCategoryId: false,
         getByIdData: {},
         modelType: '',
-        teamAllList: []
+        teamAllList: [],
+        factoryList: []
       };
     },
     computed: {
@@ -734,6 +762,7 @@
       }
     },
     mounted() {
+      this.getFactoryList();
       this.getAllTeamList();
       this.getUserList({ groupId: '1' });
     },
@@ -765,7 +794,8 @@
             remark: '', // 备注
             urgent: '1',
             teamId: '', // 班组id
-            executeUsers: [] // 执行人
+            executeUsers: [], // 执行人
+            factoryId: '' // 所属工厂id
           };
           this.ruleIdList = [];
           this.isBindPlan = false;
@@ -773,13 +803,17 @@
           //   this.matterRulesList = [];
         }
       },
-      async getAllTeamList() {
-        const { list } = await getteampage({
+      async getAllTeamList(factoryId) {
+        const params = {
           pageNum: 1,
           size: -1
-        });
+        };
+        if (factoryId) {
+          params.factoryId = factoryId;
+        }
+        const { list } = await getteampage(params);
         console.log('teamAllList 班组', list);
-        this.teamAllList = list;
+        this.teamAllList = list || [];
       },
       teamChange() {
         console.log('this.addForm.teamId', this.addForm.teamId);
@@ -810,6 +844,33 @@
 
         this.$forceUpdate();
       },
+      // 获取工厂列表
+      async getFactoryList() {
+        const { list } = await getFactoryarea({
+          pageNum: 1,
+          size: 9999,
+          type: 1,
+          enable: 1
+        });
+        this.factoryList = list || [];
+      },
+      // 工厂切换
+      factoryChange(factoryId) {
+        // 清空班组
+        this.$set(this.addForm, 'teamId', '');
+        this.$set(this.addForm, 'executeUsers', []);
+        this.teamAllList = [];
+        // 清空设备列表
+        if (this.ruleIdList && this.ruleIdList.length > 0) {
+          this.ruleIdList.forEach((item) => {
+            item.equipmentList = [];
+          });
+        }
+        // 重新获取班组列表(带工厂ID)
+        if (factoryId) {
+          this.getAllTeamList(factoryId);
+        }
+      },
       ruleChange(item) {
         this.ruleObj.name = item.name;
         this.ruleObj.code = item.code;
@@ -1191,7 +1252,15 @@
       },
 
       handleAdd(ruleIdList, ruleIdListIndex) {
-        this.$refs.productRefs.open(ruleIdList, ruleIdListIndex);
+        if (!this.addForm.factoryId) {
+          return this.$message.error('请先选择工厂');
+        }
+        this.$refs.productRefs.open(
+          ruleIdList,
+          ruleIdListIndex,
+          this.addForm.factoryId,
+          this.factoryList.find((item) => item.id == this.addForm.factoryId)?.name
+        );
       },
 
       /* 更新visible */

+ 83 - 4
src/views/rulesManagement/releaseRules/components/experimentationProcessNew.vue

@@ -21,7 +21,7 @@
         group="project1"
         :animation="300"
         handle=".sort-handle"
-        style="flex: 1;max-height:calc(100vh - 500px);overflow: auto;"
+        style="flex: 1; max-height: calc(100vh - 500px); overflow: auto"
       >
         <div
           class="demo-drag-list-item ele-cell"
@@ -95,6 +95,33 @@
               @change="editInputChange"
             ></el-input>
           </el-form-item>
+          <el-form-item label="字段类型:" prop="fieldType" v-if="domObj.mode=='person'">
+            <el-select
+              v-model="domObj.fieldType"
+              placeholder="请选择"
+              @change="onFieldTypeChange"
+              clearable
+            >
+              <el-option
+                v-for="opt in fieldTypeOptions"
+                :key="opt.value"
+                :label="opt.label"
+                :value="opt.value"
+              />
+            </el-select>
+          </el-form-item>
+          <!-- 🆕 对齐方式下拉 -->
+          <el-form-item label="对齐方式:" prop="textAlign">
+            <el-select
+              v-model="domObj.textAlign"
+              placeholder="请选择"
+              @change="editInputChange"
+            >
+              <el-option label="左对齐" value="left"></el-option>
+              <el-option label="居中对齐" value="center"></el-option>
+              <el-option label="右对齐" value="right"></el-option>
+            </el-select>
+          </el-form-item>
           <el-form-item label="是否只读:" prop="readonly">
             <el-select
               v-model="domObj.readonly"
@@ -275,6 +302,13 @@
         templateDivRef: '',
         domObj: { units: {} },
         idList: [],
+        fieldTypeOptions: [
+          { label: '作业负责人', value: 'work_leader' },
+          { label: '监护人', value: 'guardian' },
+          { label: '作业人', value: 'worker' },
+          { label: '安全交底人', value: 'safety_briefer' },
+          { label: '接受交底人', value: 'safety_receiver' }
+        ],
         opSelectOptions: ['+', '-', '*', '/', '%', '(', ')'],
         equationUnit: {
           equation: [],
@@ -342,7 +376,47 @@
           }
         });
       },
+      onFieldTypeChange(val) {
+        const oldId = this.domObj.id;
+        const oldFieldType = this.domObj.fieldType;
 
+        if (val) {
+          // 获取当前编辑的 customTable 子组件实例
+          const childRef = this.$refs[this.templateDivRef];
+          // if (
+          //   !childRef ||
+          //   !childRef[0] ||
+          //   typeof childRef[0].isIdDuplicate !== 'function'
+          // ) {
+          //   // 若组件未加载或方法不存在,直接允许修改(降级)
+          //   this.domObj.id = val;
+          //   this.domObj.fieldType = val;
+          //   this.editInputChange();
+          //   return;
+          // }
+
+          // 调用子组件的重复检查方法
+
+          const isDuplicate = childRef[0].isIdDuplicate(val, this.domObj.id);
+          if (isDuplicate) {
+            this.$message.warning(
+              '该字段类型在当前表格中已被使用,请选择其他类型'
+            );
+            this.domObj.fieldType =  '';
+          } else {
+            // 唯一,允许修改
+            this.domObj.id = val;
+            this.domObj.fieldType = val;
+          }
+
+          this.editInputChange();
+        } else {
+          // 取消选择:随机生成 id,清空类型
+          this.domObj.id = generateRandomString(6);
+          this.domObj.fieldType = '';
+          this.editInputChange();
+        }
+      },
       truncateToFixedManual(num, decimalPlaces) {
         let factor = Math.pow(10, decimalPlaces);
         return Math.floor(num * factor) / factor;
@@ -476,10 +550,15 @@
         }
       },
       editShowFn({ templateDivRef, domObj }) {
-        if (!this.edit) {
-          return;
-        }
+        if (!this.edit) return;
         this.templateDivRef = templateDivRef;
+        // 根据 id 匹配类型(若 id 为预设值则回显,否则置空)
+        const found = this.fieldTypeOptions.find(
+          (opt) => opt.value === domObj.id
+        );
+        domObj.fieldType = found ? found.value : '';
+        // 确保 domObj 有 textAlign 默认值(若没有则设置)
+        if (!domObj.textAlign) domObj.textAlign = 'center';
         this.$set(this, 'domObj', domObj);
         this.editShow = true;
       },

File diff ditekan karena terlalu besar
+ 764 - 565
src/views/rulesManagement/releaseRules/components/templateDiv/customTableNew.vue


+ 136 - 16
src/views/system/organization/components/staffSelection.vue

@@ -34,8 +34,38 @@
         </el-col>
         <el-col :span="9" class="zw-page-main">
           <el-card>
-            <div class="zw-card-header" slot="header">
+            <div class="zw-card-header staff-header" slot="header">
               <span class="zw-header-title details-title">员工明细 </span>
+              <div class="staff-search">
+                <el-input
+                  v-model.trim="userName"
+                  :placeholder="form.groupId ? '请输入员工姓名' : '请先选择部门'"
+                  clearable
+                  size="small"
+                  prefix-icon="el-icon-search"
+                  class="staff-search-input"
+                  :disabled="!form.groupId"
+                  @keyup.enter.native="searchStaff"
+                  @clear="searchStaff(false)"
+                />
+                <el-button
+                  size="small"
+                  type="primary"
+                  icon="el-icon-search"
+                  :disabled="!form.groupId"
+                  @click="searchStaff"
+                >
+                  查询
+                </el-button>
+                <el-button
+                  size="small"
+                  icon="el-icon-refresh"
+                  :disabled="!form.groupId && !userName"
+                  @click="resetStaffSearch"
+                >
+                  重置
+                </el-button>
+              </div>
             </div>
             <div class="zw-page-main-list">
               <el-container class="zw-container">
@@ -56,7 +86,7 @@
                   </el-table-column>
                   <el-table-column label="工号">
                     <template slot-scope="{ row }">
-                      <div>{{ row.jobNumber }}</div>
+                      <div>{{ getStaffJobNumber(row) }}</div>
                     </template>
                   </el-table-column>
                   <el-table-column width="80" label="操作">
@@ -109,7 +139,7 @@
                   </el-table-column>
                   <el-table-column label="工号">
                     <template slot-scope="{ row }">
-                      <div>{{ row.jobNumber }}</div>
+                      <div>{{ getStaffJobNumber(row) }}</div>
                     </template>
                   </el-table-column>
                   <el-table-column width="80" label="操作">
@@ -136,7 +166,11 @@
   </div>
 </template>
 <script>
-import { listOrganizations, getUserPage } from '@/api/system/organization';
+import {
+  listOrganizations,
+  getUserPage,
+  getUserDetail
+} from '@/api/system/organization';
 export default {
   data() {
     return {
@@ -154,16 +188,55 @@ export default {
       pageNum: 1, //设备当前页数
       size: 10,
       isMore: false,
+      userName: '',
       dialogVisible: false
     };
   },
   created() {},
   methods: {
-    open(selectedList) {
+    async open(selectedList) {
       this.dialogVisible = true;
-      this.selectStafflist = selectedList;
+      this.selectStafflist = await this.normalizeSelectedStaffList(
+        selectedList
+      );
       this.getInfo();
     },
+    getStaffJobNumber(row) {
+      return (
+        row.jobNumber ||
+        row.approverJobNumber ||
+        row.userCode ||
+        row.code ||
+        ''
+      );
+    },
+    async normalizeSelectedStaffList(selectedList) {
+      const list = Array.isArray(selectedList) ? selectedList : [];
+      return Promise.all(
+        list.map(async (item) => {
+          const normalized = {
+            ...item,
+            id: item.id || item.approverId,
+            name: item.name || item.approverName,
+            jobNumber: this.getStaffJobNumber(item)
+          };
+          if (normalized.jobNumber || !normalized.id) {
+            return normalized;
+          }
+          try {
+            const detail = await getUserDetail(normalized.id);
+            return {
+              ...detail,
+              ...normalized,
+              name: normalized.name || detail.name,
+              jobNumber: detail.jobNumber || this.getStaffJobNumber(detail)
+            };
+          } catch (error) {
+            return normalized;
+          }
+        })
+      );
+    },
     //初始数据
     async getInfo() {
       let list = await listOrganizations();
@@ -172,19 +245,53 @@ export default {
         idField: 'id',
         parentIdField: 'parentId'
       });
+      this.$nextTick(() => {
+        this.selectDefaultDepartment();
+      });
       //this.treeList = res.data;
     },
+    selectDefaultDepartment() {
+      const defaultDepartment = this.treeList && this.treeList[0];
+      if (!defaultDepartment) {
+        return;
+      }
+      if (this.$refs.tree) {
+        this.$refs.tree.setCurrentKey(defaultDepartment.id);
+      }
+      this.handleNodeClick(defaultDepartment);
+    },
     //选择分类
     handleNodeClick(data) {
       this.staffList = [];
       this.pageNum = 1;
       this.form.groupId = data.id;
-      let params = {
-        pageNum: 1,
+      this.getStaffList(this.buildStaffParams());
+    },
+    buildStaffParams(pageNum = 1) {
+      return {
+        pageNum,
         size: this.size,
-        groupId: this.form.groupId
+        groupId: this.form.groupId,
+        name: this.userName
       };
-      this.getStaffList(params);
+    },
+    searchStaff(showTip = true) {
+      if (!this.form.groupId) {
+        this.staffList = [];
+        this.pageNum = 1;
+        this.isMore = false;
+        if (showTip) {
+          this.$message.warning('请先选择部门');
+        }
+        return;
+      }
+      this.staffList = [];
+      this.pageNum = 1;
+      this.getStaffList(this.buildStaffParams());
+    },
+    resetStaffSearch() {
+      this.userName = '';
+      this.searchStaff();
     },
     //获取员工列表
     async getStaffList(params) {
@@ -210,12 +317,7 @@ export default {
     //查询更多员工
     async getMore() {
       this.pageNum = this.pageNum + 1;
-      let params = {
-        pageNum: this.pageNum,
-        size: this.size,
-        groupId: this.form.groupId
-      };
-      this.getStaffList(params);
+      this.getStaffList(this.buildStaffParams(this.pageNum));
     },
     //选择员工
     choiceAsset(info) {
@@ -241,6 +343,10 @@ export default {
     handleClose() {
       this.staffList = [];
       this.selectStafflist = [];
+      this.userName = '';
+      this.form.groupId = null;
+      this.pageNum = 1;
+      this.isMore = false;
       this.dialogVisible = false;
     }
   }
@@ -264,6 +370,20 @@ export default {
   line-height: 32px;
   height: 32px;
 }
+.staff-header {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  height: 32px;
+}
+.staff-search {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+}
+.staff-search-input {
+  width: 180px;
+}
 .zw-page-list-p {
   font-size: 14px;
   margin-bottom: 18px;

+ 52 - 15
src/views/technology/productParam/components/product-search.vue

@@ -7,22 +7,50 @@
     @submit.native.prevent
   >
     <el-row :gutter="10">
-      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+      <el-col v-bind="styleResponsive ? { md: 4 } : { span: 4 }">
         <el-form-item label="编码">
           <el-input clearable v-model.trim="where.code" placeholder="请输入" />
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+      <el-col v-bind="styleResponsive ? { md: 4 } : { span: 4 }">
         <el-form-item label="名称">
           <el-input clearable v-model.trim="where.name" placeholder="请输入" />
         </el-form-item>
       </el-col>
 
-      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+      <el-col v-bind="styleResponsive ? { md: 3 } : { span: 3 }">
         <el-form-item label="型号">
-          <el-input clearable v-model.trim="where.modelType" placeholder="请输入" />
+          <el-input
+            clearable
+            v-model.trim="where.modelType"
+            placeholder="请输入"
+          />
         </el-form-item>
       </el-col>
+      <el-col
+        v-bind="styleResponsive ? { md: 3 } : { span: 3 }"
+        v-if="factoryName"
+      >
+        <el-form-item label="状态">
+          <el-select v-model="where.hasWorkstation">
+            <el-option :value="''" label="全部"></el-option>
+            <el-option :value="0" label="未占用"></el-option>
+            <el-option :value="1" label="已占用"></el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col
+        v-bind="styleResponsive ? { md: 3 } : { span: 3 }"
+        v-if="factoryName"
+      >
+        <el-form-item label="所属工厂">
+          <el-input
+            clearable
+            :value="factoryName"
+            placeholder="请输入"
+            disabled
+        /></el-form-item>
+      </el-col>
       <el-col v-bind="styleResponsive ? { md: 4 } : { md: 4 }">
         <div class="ele-form-actions">
           <el-button
@@ -48,46 +76,55 @@
 </template>
 
 <script>
+  import elSelect from '@/components/FormGenerator/components/render/slots/el-select';
+
   export default {
-    data () {
+    data() {
       // 默认表单数据
       const defaultWhere = {
         name: '',
         code: '',
-        modelType: ''
+        modelType: '',
+        hasWorkstation: ''
       };
       return {
         defaultWhere,
         // 表单数据
         where: { ...defaultWhere },
-        treeData:[]
+        treeData: []
       };
     },
+    props: {
+      factoryName: {
+        type: String,
+        default: ''
+      }
+    },
     computed: {
       // 是否开启响应式布局
-      styleResponsive () {
+      styleResponsive() {
         return this.$store.state.theme.styleResponsive;
       }
     },
-    created() {
-    },
+    created() {},
     methods: {
-
       /* 搜索 */
-      search () {
+      search() {
         if (this.where.appType === 0) {
           this.where.appType = '';
         }
+        if (!this.factoryName) {
+          delete this.where.hasWorkstation;
+        }
         this.$emit('search', this.where);
       },
       /*  重置 */
-      reset () {
+      reset() {
         this.where = { ...this.defaultWhere };
         this.search();
       },
-      reset2 () {
+      reset2() {
         this.where = { ...this.defaultWhere };
-
       }
     }
   };

+ 15 - 4
src/views/technology/production/components/user-edit.vue

@@ -6,12 +6,18 @@
     :append-to-body="true"
     :close-on-click-modal="false"
     custom-class="ele-dialog-form"
-    :title="isUpdate ? '修改工序' : '添加工序'"
+    :title="detail ? '工序详情' : isUpdate ? '修改工序' : '添加工序'"
     @update:visible="updateVisible"
     :maxable="true"
   >
     <header-title title="基本信息"></header-title>
-    <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+    <el-form
+      ref="form"
+      :model="form"
+      :rules="rules"
+      label-width="120px"
+      :disabled="detail"
+    >
       <el-row>
         <el-col :span="8">
           <el-form-item label="工序编码:">
@@ -578,7 +584,7 @@
 
     <template v-slot:footer>
       <el-button @click="updateVisible(false)">取消</el-button>
-      <el-button type="primary" :loading="loading" @click="save">
+      <el-button v-if="!detail" type="primary" :loading="loading" @click="save">
         保存
       </el-button>
     </template>
@@ -605,7 +611,8 @@
       // 修改回显的数据
       data: Object,
       controlList: Array,
-      typeList: Array
+      typeList: Array,
+      detail: Boolean
     },
     data() {
       const defaultForm = function () {
@@ -646,6 +653,7 @@
           isFinalCheckProduction: '',
           isFirstArticleDualInspection: '',
           needNCCode: '',
+          isRelease: 0,
           sort: null,
           intervalTime: {
             nextShortPreTime: '', // 时间单位转换后的下一个短周期的时间,格式为YYYY-MM-DDTHH'
@@ -763,6 +771,9 @@
         this.versionList = res.list;
       },
       chooseWorkCenter() {
+        if (this.detail) {
+          return;
+        }
         this.$refs.centerRefs.open(this.form);
       },
       determineChoose(row) {

+ 83 - 15
src/views/technology/production/index.vue

@@ -92,7 +92,15 @@
             {{ row.name }}
           </el-link>
           <span v-else> {{ row.name }}</span> -->
-          {{ row.name }}
+          <el-link type="primary" :underline="false" @click="openDetail(row)">
+            {{ row.name }}
+          </el-link>
+        </template>
+
+        <template v-slot:code="{ row }">
+          <el-link type="primary" :underline="false" @click="openDetail(row)">
+            {{ row.code }}
+          </el-link>
         </template>
         <!-- 状态列 -->
 
@@ -102,8 +110,13 @@
 
         <template v-slot:processLabel="{ row }">
           <el-tag v-if="row.processLabel == 1">自制</el-tag>
-          <el-tag v-if="row.processLabel == 2">委外</el-tag>
-          <el-tag v-if="row.processLabel == 3">请托</el-tag>
+          <el-tag v-if="row.processLabel == 2" type="success">委外</el-tag>
+          <el-tag v-if="row.processLabel == 3" type="warning">请托</el-tag>
+        </template>
+
+        <template v-slot:isRelease="{ row }">
+          <el-tag v-if="row.isRelease == 1" type="success">已发布</el-tag>
+          <el-tag v-else type="info">未发布</el-tag>
         </template>
 
         <!-- 操作列 -->
@@ -111,9 +124,10 @@
           <el-link
             type="primary"
             :underline="false"
-            icon="el-icon-edit"
             @click="openEdit(row)"
-            v-if="$hasPermission('main:producetask:update')"
+            v-if="
+              $hasPermission('main:producetask:update') && row.isRelease != 1
+            "
           >
             修改
           </el-link>
@@ -130,24 +144,39 @@
             class="ele-action"
             title="确定要删除当前工序吗?"
             @confirm="remove(row)"
-            v-if="$hasPermission('main:producetask:delete')"
+            v-if="
+              $hasPermission('main:producetask:delete') && row.isRelease != 1
+            "
           >
             <template v-slot:reference>
-              <el-link type="danger" :underline="false" icon="el-icon-delete">
-                删除
-              </el-link>
+              <el-link type="danger" :underline="false"> 删除 </el-link>
             </template>
           </el-popconfirm>
 
           <el-link
             type="primary"
             :underline="false"
-            icon="el-icon-setting"
             @click="openSettingMatterProcess(row)"
-            v-if="$hasPermission('main:produce_task:config_item')"
+            v-if="
+              $hasPermission('main:produce_task:config_item') &&
+              row.isRelease != 1
+            "
           >
             配置
           </el-link>
+
+          <el-popconfirm
+            class="ele-action"
+            title="确定要发布当前工序吗?"
+            @confirm="release(row)"
+            v-if="
+              $hasPermission('main:producetask:update') && row.isRelease != 1
+            "
+          >
+            <template v-slot:reference>
+              <el-link type="primary" :underline="false"> 发布 </el-link>
+            </template>
+          </el-popconfirm>
         </template>
       </ele-pro-table>
     </el-card>
@@ -160,6 +189,7 @@
       @done="reload"
       ref="userEdit"
       :typeList="typeList"
+      :detail="showDetail"
     />
 
     <!-- 配置工艺参数 -->
@@ -244,10 +274,12 @@
           {
             prop: 'sort',
             label: '排序',
-            align: 'center'
+            align: 'center',
+            minWidth: 40
           },
           {
             prop: 'code',
+            slot: 'code',
             label: '工序编码',
             // sortable: 'custom',
             showOverflowTooltip: true,
@@ -283,7 +315,15 @@
             slot: 'processLabel',
             label: '工序标签',
             showOverflowTooltip: true,
-            minWidth: 110
+            minWidth: 100
+          },
+          {
+            align: 'center',
+            prop: 'isRelease',
+            slot: 'isRelease',
+            label: '是否发布',
+            showOverflowTooltip: true,
+            minWidth: 100
           },
           {
             align: 'center',
@@ -291,7 +331,7 @@
             slot: 'version',
             label: '版本',
             showOverflowTooltip: true,
-            minWidth: 110
+            minWidth: 80
           },
           {
             align: 'center',
@@ -330,6 +370,7 @@
         current: null,
         // 是否显示编辑弹窗
         showEdit: false,
+        showDetail: false,
         // 是否显示参数弹窗
         showSetting: false,
         controlList: [],
@@ -501,6 +542,10 @@
           this.$message.error('请至少选择一条数据');
           return;
         }
+        if (this.selection.some((item) => item.isRelease == 1)) {
+          this.$message.warning('已发布的工序不能批量设置工作中心');
+          return;
+        }
         this.$refs.centerRefs.open(this.selection[0]);
       },
 
@@ -509,13 +554,32 @@
         this.$refs.table.reload({ page: 1, where: where });
       },
       /* 打开编辑弹窗 */
-      openEdit(row) {
+      openEdit(row, detail = false) {
         this.getControlList();
         this.current = row;
+        this.showDetail = detail;
         this.showEdit = true;
         this.$refs.userEdit.$refs.form &&
           this.$refs.userEdit.$refs.form.clearValidate();
       },
+      openDetail(row) {
+        this.openEdit(row, true);
+      },
+
+      async release(row) {
+        const loading = this.$loading({ lock: true });
+        try {
+          const detail = await producetask.getById(row.id);
+          await producetask.save({
+            ...detail,
+            isRelease: 1
+          });
+          this.$message.success('发布成功');
+          this.reload();
+        } finally {
+          loading.close();
+        }
+      },
 
       determineChoose(row) {
         if (row) {
@@ -612,6 +676,10 @@
           this.$message.error('请至少选择一条数据');
           return;
         }
+        if (this.selection.some((item) => item.isRelease == 1)) {
+          this.$message.warning('已发布的工序不能删除');
+          return;
+        }
         this.$confirm('确定要删除选中的工序吗?', '提示', {
           type: 'warning'
         })

+ 177 - 156
src/views/technology/route/components/historyModal.vue

@@ -1,191 +1,212 @@
 <template>
-    <el-dialog title="历史版本" :visible.sync="visible" v-if="visible" :before-close="handleClose" :close-on-click-modal="false"
-        :close-on-press-escape="false" append-to-body width="60%">
-
+  <el-dialog
+    title="历史版本"
+    :visible.sync="visible"
+    v-if="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="70%"
+  >
+    <el-form :model="form" label-width="120px">
+      <el-row :gutter="16">
         <el-col :span="8">
-            <el-form-item label="工艺路线编码:">
-                <span> {{ form.code }} </span>
-            </el-form-item>
+          <el-form-item label="工艺路线编码:">
+            <span> {{ form.code }} </span>
+          </el-form-item>
         </el-col>
         <el-col :span="8">
-            <el-form-item label="工艺路线名称:">
-                <span> {{ form.name }} </span>
-            </el-form-item>
+          <el-form-item label="工艺路线名称:">
+            <span> {{ form.name }} </span>
+          </el-form-item>
         </el-col>
-        <el-col :span="8">
-            <el-form-item label="产品编码:">
-                <span> {{ form.categoryCode }} </span>
-            </el-form-item>
+        <!-- <el-col :span="8">
+          <el-form-item label="产品编码:">
+            <span> {{ form.categoryCode }} </span>
+          </el-form-item>
         </el-col>
         <el-col :span="8">
-            <el-form-item label="产品名称:">
-                <span> {{ form.categoryName }} </span>
-            </el-form-item>
-        </el-col>
-
-
-
-        <ele-pro-table ref="table" :columns="columns" :datasource="datasource" height="calc(100vh - 350px)"
-            class="dict-table">
-            <!-- 表头工具栏 -->
-
-            <!-- 状态列 -->
-            <template v-slot:status="{ row }">
-                {{ checkStatus(row) }}
-            </template>
-
-        </ele-pro-table>
-
-
-    </el-dialog>
+          <el-form-item label="产品名称:">
+            <span> {{ form.categoryName }} </span>
+          </el-form-item>
+        </el-col> -->
+      </el-row>
+    </el-form>
+
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="datasource"
+      height="calc(100vh - 350px)"
+      class="dict-table"
+    >
+      <!-- 表头工具栏 -->
+
+      <!-- 状态列 -->
+      <template v-slot:status="{ row }">
+        {{ checkStatus(row) }}
+      </template>
+
+      <template v-slot:action="{ row }">
+        <el-link type="primary" :underline="false" @click="openDetail(row)">
+          详情
+        </el-link>
+      </template>
+    </ele-pro-table>
+
+    <UserDetail
+      :visible.sync="detailEdit"
+      :data="current"
+      @close="detailEdit = false"
+      ref="UserDetailRef"
+    ></UserDetail>
+  </el-dialog>
 </template>
-  
+
 <script>
-import AssetTree from '@/components/AssetTree';
-import route from '@/api/technology/route';
-export default {
-    components: { AssetTree },
+  import route from '@/api/technology/route';
+  import UserDetail from './user-detail.vue';
+  export default {
+    components: {
+      UserDetail
+    },
     data() {
-        return {
-            visible: false,
-            // 表格列配置
-            columns: [
-                {
-                    columnKey: 'index',
-                    type: 'index',
-                    width: 45,
-                    align: 'center',
-                    reserveSelection: true
-                },
-                {
-                    prop: 'version',
-                    label: '版本',
-                    align: 'center',
-                    showOverflowTooltip: true,
-                    minWidth: 110
-                },
-                {
-                    prop: 'status',
-                    label: '状态',
-                    align: 'center',
-                    slot: 'status',
-                    showOverflowTooltip: true,
-                    minWidth: 110
-                },
-
-                {
-                    prop: 'createTime',
-                    label: '创建日期',
-                    align: 'center',
-                    showOverflowTooltip: true,
-                    minWidth: 110
-                },
-
-                {
-                    prop: 'releaseTime',
-                    label: '发布日期',
-                    align: 'center',
-                    showOverflowTooltip: true,
-                    minWidth: 110
-                },
-
-
-                {
-                    prop: 'downTime',
-                    label: '停用时间',
-                    align: 'center',
-                    showOverflowTooltip: true,
-                    minWidth: 110
-                },
-
-
-
-
-
-
-
-
-
-            ],
-
-            statusList: [
-                { label: '草稿', value: -1 },
-                { label: '失效', value: 0 },
-                { label: '生效', value: 1 }
-            ],
-            form: null
-
-        }
+      return {
+        visible: false,
+        detailEdit: false,
+        current: {},
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            type: 'index',
+            width: 45,
+            align: 'center',
+            reserveSelection: true
+          },
+          {
+            prop: 'version',
+            label: '版本',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            slot: 'status',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+
+          {
+            prop: 'createTime',
+            label: '创建日期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+
+          {
+            prop: 'releaseTime',
+            label: '发布日期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+
+          {
+            prop: 'downTime',
+            label: '停用时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'action',
+            slot: 'action',
+            label: '操作',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          }
+        ],
+
+        statusList: [
+          { label: '草稿', value: -1 },
+          { label: '失效', value: 0 },
+          { label: '生效', value: 1 }
+        ],
+        form: {}
+      };
     },
 
-    watch: {
-
-    },
+    watch: {},
     methods: {
-        /* 表格数据源 */
-        async datasource({ page, limit }) {
-            const res = await route.list({
-                code: this.form.code,
-
-                pageNum: page,
-                size: limit
-            });
-            return res;
-        },
-
-
-        open(item) {
-            if (item) {
-                this.form = item
-            }
-            this.visible = true
-        },
-
-
-        handleClose() {
-            this.visible = false
-            this.form = null
-
-        },
-
-        checkStatus(row) {
-            let obj = this.statusList.find((it) => it.value == row.status);
-            return obj.label;
-        },
-
+      /* 表格数据源 */
+      async datasource({ page, limit }) {
+        const res = await route.list({
+          code: this.form.code,
+
+          pageNum: page,
+          size: limit
+        });
+        return res;
+      },
+
+      open(item) {
+        this.form = item || {};
+        this.visible = true;
+      },
+
+      handleClose() {
+        this.visible = false;
+        this.form = {};
+      },
+
+      openDetail(row) {
+        this.current = row;
+        this.detailEdit = true;
+      },
+
+      checkStatus(row) {
+        let obj = this.statusList.find((it) => it.value == row.status);
+        return obj ? obj.label : '';
+      }
     }
-}
+  };
 </script>
-  
+
 <style lang="scss" scoped>
-.tree_col {
+  .tree_col {
     border: 1px solid #eee;
     padding: 10px 0;
     box-sizing: border-box;
     height: 500px;
     overflow: auto;
-}
+  }
 
-.table_col {
+  .table_col {
     padding-left: 10px;
 
     ::v-deep .el-table th.el-table__cell {
-        background: #f2f2f2;
+      background: #f2f2f2;
     }
-}
+  }
 
-.pagination {
+  .pagination {
     text-align: right;
     padding: 10px 0;
-}
+  }
 
-.btns {
+  .btns {
     text-align: center;
     padding: 10px 0;
-}
+  }
 
-.topsearch {
+  .topsearch {
     margin-bottom: 15px;
-}
+  }
 </style>
-  

+ 1 - 0
src/views/technology/route/components/production/components/user-search.vue

@@ -25,6 +25,7 @@
             placeholder="请选择"
             filterable
             clearable
+            disabled
           >
             <el-option
               v-for="item in factoryList"

+ 13 - 1
src/views/technology/route/components/production/index.vue

@@ -14,7 +14,11 @@
         row-key="id"
       >
         <!-- 状态列 -->
-
+        <template v-slot:processLabel="{ row }">
+          <el-tag v-if="row.processLabel == 1">自制</el-tag>
+          <el-tag v-if="row.processLabel == 2" type="success">委外</el-tag>
+          <el-tag v-if="row.processLabel == 3" type="warning">请托</el-tag>
+        </template>
         <!-- 操作列 -->
       </ele-pro-table>
     </el-card>
@@ -105,6 +109,14 @@
             showOverflowTooltip: true,
             minWidth: 110
           },
+          {
+            align: 'center',
+            prop: 'processLabel',
+            slot: 'processLabel',
+            label: '工序标签',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
           {
             prop: 'workCenterName',
             label: '所属工作中心',

+ 4 - 1
src/views/technology/route/components/user-edit.vue

@@ -31,7 +31,7 @@
           </el-form-item>
         </el-col>
         <el-col :span="8">
-          <el-form-item label="所属工厂:">
+          <el-form-item label="所属工厂:" prop="factoryId">
             <el-select
               v-model="form.factoryId"
               placeholder="请选择"
@@ -194,6 +194,9 @@
           ],
           produceVersionId: [
             { required: true, message: '请输入工艺类型', trigger: 'blur' }
+          ],
+          factoryId: [
+            { required: true, message: '请选择所属工厂', trigger: 'blur' }
           ]
 
           // routeType: [

+ 15 - 1
src/views/technology/route/components/user-taskinstance.vue

@@ -36,6 +36,12 @@
           <el-input v-model="row.orderNum" placeholder="请输入排序"></el-input>
         </template>
 
+        <template v-slot:processLabel="{ row }">
+          <el-tag v-if="row.processLabel == 1">自制</el-tag>
+          <el-tag v-if="row.processLabel == 2" type="success">委外</el-tag>
+          <el-tag v-if="row.processLabel == 3" type="warning">请托</el-tag>
+        </template>
+
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
           <el-link
@@ -162,6 +168,14 @@
             showOverflowTooltip: true,
             minWidth: 110
           },
+          {
+            align: 'center',
+            prop: 'processLabel',
+            slot: 'processLabel',
+            label: '工序标签',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
           {
             prop: 'workCenterName',
             label: '所属工作中心',
@@ -228,7 +242,7 @@
           {
             value: 6,
             label: '质检工序'
-          },
+          }
           // {
           //   value: 7,
           //   label: '生产准备'

+ 2 - 1
src/views/technology/version/components/user-search.vue

@@ -1,7 +1,7 @@
 <!-- 搜索表单 -->
 <template>
   <el-form
-    label-width="80px"
+    label-width="120px"
     class="ele-form-search"
     @keyup.enter.native="search"
     @submit.native.prevent
@@ -70,6 +70,7 @@
         // categoryName: ''
       };
       return {
+        defaultWhere,
         // 表单数据
         where: { ...defaultWhere },
       };

+ 102 - 116
src/views/workforceManagement/team/components/search.vue

@@ -1,124 +1,92 @@
 <!-- 搜索表单 -->
 <template>
-  <el-form
-    label-width="80px"
-    class="ele-form-search"
-    @keyup.enter.native="search"
-    @submit.native.prevent
-  >
-    <el-row>
-      <el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }">
-        <el-form-item label="名称:">
-          <el-input clearable v-model.trim="where.name" placeholder="请输入" />
-        </el-form-item>
-      </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }">
-        <el-form-item label="所属工厂:">
-          <el-select
-            style="width: 100%"
-            clearable
-            v-model="where.factoryId"
-            @change="change_factoryId"
-            filterable
-            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-col>
-
-      <el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }">
-        <el-form-item label="所属厂房:">
-          <el-select
-            style="width: 100%"
-            clearable
-            v-model="where.workshopPlanId"
-            filterable
-            placeholder="请选择所属厂房"
-          >
-            <el-option
-              v-for="item in workshopPlanList"
-              :label="item.name"
-              :value="item.id"
-              :key="item.id"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-      </el-col>
-
-      <el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }">
-        <el-form-item label="工作中心:">
-          <el-select
-            style="width: 100%"
-            clearable
-            v-model="where.workCenterId"
-            filterable
-            placeholder="请选择工作中心"
-          >
-            <el-option
-              v-for="item in workCenterList"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
-      </el-col>
-
-      <el-col v-bind="styleResponsive ? { lg: 3, md: 6 } : { span: 3 }">
-        <div class="ele-form-actions">
-          <el-button
-            type="primary"
-            icon="el-icon-search"
-            class="ele-btn-icon"
-            @click="search"
-          >
-            查询
-          </el-button>
-          <el-button @click="reset">重置</el-button>
-        </div>
-      </el-col>
-    </el-row>
-  </el-form>
+  <seekPage ref="seekPageRef" :seekList="seekList" :formLength="4" @search="search"></seekPage>
 </template>
 
 <script>
   import { getFactoryarea } from '@/api/factoryModel';
   import work from '@/api/technology/work';
+  import { getUserPage } from '@/api/system/organization';
   export default {
     data() {
-      // 默认表单数据
-      const defaultWhere = {
-        name: '',
-        factoryId: '',
-        workshopPlanId: '',
-        workCenterId: ''
-      };
       return {
-        // 表单数据
-        where: { ...defaultWhere },
-
         factoryList: [],
         workshopPlanList: [],
-        workCenterList: []
+        workCenterList: [],
+        leaderList: []
       };
     },
-
+    computed: {
+      seekList() {
+        return [
+          {
+            label: '名称:',
+            value: 'name',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '编码:',
+            value: 'code',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '所属工厂:',
+            value: 'factoryId',
+            type: 'select',
+            planList: this.factoryList.map((item) => ({
+              label: item.name,
+              value: item.id
+            })),
+            placeholder: '请选择所属工厂'
+          },
+          {
+            label: '所属厂房:',
+            value: 'workshopPlanId',
+            type: 'select',
+            planList: this.workshopPlanList.map((item) => ({
+              label: item.name,
+              value: item.id
+            })),
+            placeholder: '请选择所属厂房'
+          },
+          {
+            label: '工作中心:',
+            value: 'workCenterId',
+            type: 'select',
+            planList: this.workCenterList.map((item) => ({
+              label: item.name,
+              value: item.id
+            })),
+            placeholder: '请选择工作中心'
+          },
+          {
+            label: '班组长:',
+            value: 'leaderUserId',
+            type: 'select',
+            planList: this.leaderList.map((item) => ({
+              label: item.name,
+              value: item.id
+            })),
+            placeholder: '请选择班组长'
+          }
+        ];
+      }
+    },
+    watch: {
+      factoryList: {
+        handler() {
+          this.$nextTick(() => {
+            this.watchFactoryChange();
+          });
+        }
+      }
+    },
     created() {
       this.getFactoryList();
       this.getListWorkCenter();
-    },
-    computed: {
-      // 是否开启响应式布局
-      styleResponsive() {
-        return this.$store.state.theme.styleResponsive;
-      }
+      this.getLeaderList();
     },
     methods: {
       async getFactoryList() {
@@ -130,18 +98,34 @@
         this.factoryList = list || [];
       },
 
+      // 监听工厂切换
+      watchFactoryChange() {
+        if (!this.$refs.seekPageRef) return;
+        const seekPage = this.$refs.seekPageRef;
+        if (!seekPage._watcherFactoryId) {
+          seekPage._watcherFactoryId = this.$watch(
+            () => seekPage.defaultWhere.factoryId,
+            (newVal) => {
+              if (newVal) {
+                this.change_factoryId(newVal);
+              } else {
+                this.workshopPlanList = [];
+              }
+            }
+          );
+        }
+      },
+
       // 获取厂房
-      change_factoryId() {
-        this.where.workshopPlanId = '';
+      change_factoryId(factoryId) {
         this.workshopPlanList = [];
-
         let par = {
           type: 2,
-          parentId: this.where.factoryId,
+          parentId: factoryId,
           size: 9999
         };
         getFactoryarea(par).then((res) => {
-          this.workshopPlanList = res.list;
+          this.workshopPlanList = res.list || [];
         });
       },
 
@@ -151,14 +135,16 @@
         });
       },
 
-      /* 搜索 */
-      search() {
-        this.$emit('search', this.where);
+      // 获取班组长列表
+      getLeaderList() {
+        getUserPage({ size: 999 }).then((res) => {
+          this.leaderList = res.list || [];
+        });
       },
-      /*  重置 */
-      reset() {
-        this.where = { ...this.defaultWhere };
-        this.search();
+
+      /* 搜索 */
+      search(where) {
+        this.$emit('search', where);
       }
     }
   };

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini