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

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

yusheng 1 год назад
Родитель
Сommit
189c98f389

+ 8 - 0
src/api/workforceManagement/team.js

@@ -24,6 +24,14 @@ export async function listFactoryLine(data) {
     return Promise.reject(new Error(res.data.message));
 }
 
+export async function listFactoryLineByFactoryId(data) {
+    const res = await request.post(`/main/factoryarea/listFactoryLineByFactoryId`,data);
+    if (res.data.code == 0) {
+        return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+}
+
 // 获取产线下的所有工位
 export async function listByProductionLineId(params) {
     const res = await request.get(`/main/factoryworkstation/listByProductionLineId/` + params, {});

+ 31 - 18
src/views/workforceManagement/team/components/edit.vue

@@ -57,7 +57,7 @@
             </el-form-item>
           </el-col>
 
-          <el-col :span="8" style="margin-bottom: 22px">
+          <!-- <el-col :span="8" style="margin-bottom: 22px">
             <el-form-item label="所属厂房:" prop="workshopPlanId">
               <el-select
                 v-model="form.workshopPlanId"
@@ -97,7 +97,7 @@
                 </el-option>
               </el-select>
             </el-form-item>
-          </el-col>
+          </el-col> -->
           <el-col :span="8" style="margin-bottom: 22px">
             <el-form-item label="产线:" prop="productionLineId">
               <el-select
@@ -194,7 +194,8 @@
     listWorkshopByParentId,
     listFactoryLine,
     saveteam,
-    updateteam
+    updateteam,
+    listFactoryLineByFactoryId
   } from '@/api/workforceManagement/team';
   import { pageList } from '@/api/technology/version/version.js';
   import work from '@/api/technology/work';
@@ -214,10 +215,10 @@
           productionLineId: [],
           userIds: '',
           userNumber: '',
-          workshopPlanId: null,
+          // workshopPlanId: null,
           workCenterId: null,
           workCenterIds: [],
-          workshopId: [],
+          // workshopId: [],
           factoryId: '',
           produceVersionId: '',
           status: 1
@@ -243,12 +244,12 @@
           factoryId: [
             { required: true, message: '请选择所属工厂', trigger: 'change' }
           ],
-          workshopPlanId: [
-            { required: true, message: '请选择', trigger: 'change' }
-          ],
-          workshopId: [
-            { required: true, message: '请输入', trigger: 'change' }
-          ],
+          // workshopPlanId: [
+          //   { required: true, message: '请选择', trigger: 'change' }
+          // ],
+          // workshopId: [
+          //   { required: true, message: '请输入', trigger: 'change' }
+          // ],
           productionLineId: [
             { required: true, message: '请输入', trigger: 'change' }
           ],
@@ -316,8 +317,8 @@
           });
 
           // 获取下拉列表
-          await this.getlistWorkshopByParentId();
-          await this.getlistCf();
+          // await this.getlistWorkshopByParentId();
+          // await this.getlistCf();
           await this.getlistFactoryLineByParentId();
           await this.getlistByProductionLineId();
         }
@@ -391,14 +392,15 @@
 
       // 获取厂房
       change_factoryId() {
-        this.form.workshopPlanId = '';
+        // this.form.workshopPlanId = '';
         this.workshopPlanList = [];
-        this.form.workshopId = '';
+        // this.form.workshopId = '';
         this.options.workshopId = [];
         this.form.productionLineId = '';
         this.options.productionLineId = [];
 
-        this.getlistCf();
+        // this.getlistCf();
+        this.getlistFactoryLineByParentId();
         this.form.workCenterId = null
         this.form.workCenterIds = [];
         this.options.workCenterList = [];
@@ -429,12 +431,23 @@
         });
       },
       // 获取产线
+      // getlistFactoryLineByParentId() {
+      //   return listFactoryLine(this.form.workshopId).then((res) => {
+      //     this.options.productionLineId = res.map((n) => {
+      //       return {
+      //         value: n.id,
+      //         label: n.name
+      //       };
+      //     });
+      //   });
+      // },
+       // 获取产线
       getlistFactoryLineByParentId() {
-        return listFactoryLine(this.form.workshopId).then((res) => {
+        return listFactoryLineByFactoryId([this.form.factoryId]).then((res) => {
           this.options.productionLineId = res.map((n) => {
             return {
               value: n.id,
-              label: n.name
+              label: n.pathName
             };
           });
         });

+ 4 - 4
src/views/workforceManagement/team/index.vue

@@ -107,10 +107,10 @@ export default {
           prop: 'factoryName'
         },
 
-        {
-          label: '所属厂房',
-          prop: 'workshopPlanName'
-        },
+        // {
+        //   label: '所属厂房',
+        //   prop: 'workshopPlanName'
+        // },
 
         {
           label: '所属产线',