Kaynağa Gözat

feat: 调整场站字段为岗位并自动填充

yusheng 1 ay önce
ebeveyn
işleme
6414dbc35f

+ 8 - 1
src/api/main/index.js

@@ -113,4 +113,11 @@ export async function getAssetList(data) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+} // 查询实例详情
+export async function getAssetInfo(id) {
+  const res = await request.get(`main/asset/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 2 - 2
src/components/common/MaterialAdd.vue

@@ -121,11 +121,11 @@
             prop: 'usePerson'
           },
           {
-            label: '使用位',
+            label: '使用位',
             prop: 'postName'
           },
           {
-            label: '片区负责人负责人',
+            label: '片区负责人',
             prop: 'areaPersonInChargeUserName'
           },
           {

+ 1 - 2
src/components/selectWorkshop/selectWorkshop.vue

@@ -79,8 +79,7 @@
           },
           {
             label: '所属公司',
-            prop: 'groupId',
-            slot: 'groupId'
+            prop: 'groupName',
           },
           {
             label: '所属工厂',

+ 8 - 8
src/views/recordComponents/plan.vue

@@ -153,7 +153,7 @@
             minWidth: 110
           },
           {
-            prop: 'productLineName',
+            prop: 'postName',
             label: '场站名称',
             align: 'center',
             showOverflowTooltip: true,
@@ -282,13 +282,13 @@
             width: '280px',
             placeholder: '计划单号,计划名称,记录规则名称'
           },
-          {
-            label: '场站',
-            value: 'productLineId',
-            type: 'select',
-            planList: this.productLineList,
-            placeholder: '请选择'
-          },
+          // {
+          //   label: '场站',
+          //   value: '',
+          //   type: 'select',
+          //   planList: this.productLineList,
+          //   placeholder: '请选择'
+          // },
           {
             label: '班组',
             value: 'teamId',

+ 44 - 29
src/views/recordComponents/programRulesDialog.vue

@@ -103,9 +103,16 @@
             </el-select>
           </el-form-item>
         </el-col>
-        <el-col :span="8" v-if="dispatchStatus && addForm.type == 1">
-          <el-form-item label="场站" prop="productLineId">
-            <el-select
+        <el-col :span="8">
+          <el-form-item label="场站" prop="postName">
+            <el-input
+              v-model="addForm.postName"
+              size="small"
+              placeholder="自动带出"
+              disabled
+            >
+            </el-input>
+            <!-- <el-select
               v-model="addForm.productLineId"
               placeholder="请选择场站"
               filterable
@@ -119,7 +126,7 @@
                 @click.native="addForm.productLineName = item.name"
               >
               </el-option>
-            </el-select>
+            </el-select> -->
           </el-form-item>
         </el-col>
         <el-col :span="8" v-if="dispatchStatus && addForm.type == 0">
@@ -666,6 +673,8 @@
   import MaterialAdd from '@/components/common/MaterialAdd.vue';
   import { getteampage } from '@/api/main/index.js';
   import bindSubstanceList from './bindSubstanceList.vue';
+  import { getAssetInfo} from '@/api/main/index.js';
+
   //设备初始化字段
   const substanceKey = [
     'substanceCode',
@@ -1060,6 +1069,8 @@
         this.addForm.areaName = '';
         this.addForm.factoryId = '';
         this.addForm.factoryName = '';
+        this.addForm.postName ='' ;
+        this.addForm.postId = '';
       },
       // 关闭时清理表单
       handleClose() {
@@ -1129,8 +1140,8 @@
         this.addForm.teamId = '';
         this.addForm.teamName = '';
         this.addForm.executeIdList = [];
-        this.addForm.productLineName = '';
-        this.addForm.productLineId = '';
+        // this.addForm.productLineName = '';
+        // this.addForm.productLineId = '';
         this.productLineList = [];
       },
       //选择部门(搜索)
@@ -1206,6 +1217,9 @@
           this.addForm.deviceId = data.deviceId;
           this.addForm.deviceName = data.deviceName;
           this.addForm.deviceCode = data.deviceCode;
+          const deviceData= await getAssetInfo(data.deviceId)
+          this.addForm.postId=deviceData.postId
+          this.addForm.postName=deviceData.postName
           this.addForm.associatedObject = 2;
         }
 
@@ -1240,7 +1254,9 @@
           this.addForm.deviceId = info.id;
           this.addForm.deviceCode = info.code;
           this.addForm.deviceName = info.name;
-          this.addForm.detailList=[]
+          this.addForm.postId = info.postId;
+          this.addForm.postName = info.postName;
+          this.addForm.detailList = [];
         }
       },
       // 添加
@@ -1301,14 +1317,13 @@
       //   );
       // },
 
-
-      handleAdd(row, index,type) {
+      handleAdd(row, index, type) {
         this.currentRow = row;
         this.currentIndex = index;
-        if (type=='substanceName') {
-          if( !this.addForm.deviceId){
-            this.$message.error('请选择主设备!')
-            return
+        if (type == 'substanceName') {
+          if (!this.addForm.deviceId) {
+            this.$message.error('请选择主设备!');
+            return;
           }
           this.$refs.bindSubstanceRef.open(
             this.addForm.deviceId,
@@ -1377,7 +1392,7 @@
       },
       // 清空工具
       clearTool(row, index) {
-       if (type=='substanceName') {
+        if (type == 'substanceName') {
           substanceKey.forEach((key) => {
             this.$set(this.addForm.details[index], key, '');
           });
@@ -1526,21 +1541,21 @@
           (item) => item.id === this.addForm.teamId
         );
         this.addForm.teamName = currentTeam.name;
-        if (!init) {
-          this.addForm.productLineName = '';
-          this.addForm.productLineId = '';
-        }
-        this.productLineList = [];
-        currentTeam.factoryWorkstationVOList.forEach((item) => {
-          if (
-            !this.productLineList.find((p) => p.id === item.productionLineId)
-          ) {
-            this.productLineList.push({
-              name: item.productionLineName,
-              id: item.productionLineId
-            });
-          }
-        });
+        // if (!init) {
+        //   this.addForm.productLineName = '';
+        //   this.addForm.productLineId = '';
+        // }
+        // this.productLineList = [];
+        // currentTeam.factoryWorkstationVOList.forEach((item) => {
+        //   if (
+        //     !this.productLineList.find((p) => p.id === item.productionLineId)
+        //   ) {
+        //     this.productLineList.push({
+        //       name: item.productionLineName,
+        //       id: item.productionLineId
+        //     });
+        //   }
+        // });
 
         // if (currentTeam) {
         //   // 同步执行人

+ 8 - 8
src/views/recordComponents/workOrder.vue

@@ -121,7 +121,7 @@
             minWidth: 110
           },
           {
-            prop: 'productLineName',
+            prop: 'postName',
             label: '场站名称',
             align: 'center',
             showOverflowTooltip: true,
@@ -255,13 +255,13 @@
             width: '280px',
             placeholder: '工单单号,计划单号,记录规则名称'
           },
-          {
-            label: '场站',
-            value: 'productLineId',
-            type: 'select',
-            planList: this.productLineList,
-            placeholder: '请选择'
-          },
+          // {
+          //   label: '场站',
+          //   value: 'productLineId',
+          //   type: 'select',
+          //   planList: this.productLineList,
+          //   placeholder: '请选择'
+          // },
           {
             label: '班组',
             value: 'teamId',

+ 10 - 18
src/views/recordComponents/workOrderReport.vue

@@ -140,22 +140,14 @@
             </el-select>
           </el-form-item>
         </el-col>
-        <el-col :span="8" v-if="addForm.type">
-          <el-form-item label="场站" prop="productLineId">
-            <el-select
-              v-model="addForm.productLineId"
-              placeholder="请选择场站"
-              filterable
-            >
-              <el-option
-                v-for="item in productLineList"
-                :label="item.name"
-                :value="item.id"
-                :key="item.id"
-                @click.native="addForm.productLineName = item.name"
-              >
-              </el-option>
-            </el-select>
+        <el-col :span="8">
+          <el-form-item label="场站" prop="postName">
+            <el-input
+              clearable
+              v-model="addForm.postName"
+              placeholder=" "
+              disabled
+            />
           </el-form-item>
         </el-col>
         <el-col :span="8" v-if="pageName == 'steamInjectionInspectionRecord'">
@@ -418,8 +410,8 @@
         contactId: '',
         supplierId: '',
         supplierName: '',
-        productLineId: null,
-        productLineName: ''
+        postId: null,
+        postName: ''
       };
 
       return {