huang_an 2 lat temu
rodzic
commit
0d34eef965
1 zmienionych plików z 57 dodań i 31 usunięć
  1. 57 31
      src/views/ledgerAssets/equipment/edit.vue

+ 57 - 31
src/views/ledgerAssets/equipment/edit.vue

@@ -292,30 +292,35 @@
               <template slot="label"> 所属厂房 </template>
               <el-form-item label-width="0">
                 <FactoryAreaSelect
+                  placeholder="请选择工厂"
                   style="margin-right: 10px"
                   v-model="zcInfo.factoryRoomId1"
                   :augr="1"
                 />
                 <FactoryAreaSelect
+                  placeholder="请选择厂房"
                   style="margin-right: 10px"
                   v-model="zcInfo.factoryRoomId2"
                   :augr="2"
                 />
                 <FactoryAreaSelect
+                  placeholder="请选择车间"
                   style="margin-right: 10px"
                   v-model="zcInfo.factoryRoomId3"
                   :augr="3"
                 />
                 <FactoryAreaSelect
                   style="margin-right: 10px"
+                  placeholder="请选择产线"
                   v-model="zcInfo.factoryRoomId4"
                   :augr="4"
                 />
-                <el-input
-                  placeholder="请输入"
+                <FactoryAreaSelect
+                  style="margin-right: 10px"
+                  placeholder="请输入工位"
                   v-model="zcInfo.factoryRoomId5"
-                  style="width: 20%"
-                ></el-input>
+                  :augr="5"
+                />
               </el-form-item>
             </el-descriptions-item>
             <el-descriptions-item :span="4">
@@ -332,7 +337,7 @@
                       :options="options.cityDataLabel"
                     ></el-cascader>
                   </div> -->
-                  <el-select
+                  <!-- <el-select
                     filterable
                     v-model="positionInfo.factoryCode"
                     style="margin-right: 10px"
@@ -345,14 +350,14 @@
                       :value="item.id"
                       @click.native="changeWarehouse(item)"
                     ></el-option>
-                  </el-select>
+                  </el-select> -->
                   <!-- <factorySelect
                     style="margin-right: 10px"
                     v-model="positionInfo.factoryCode"
                     placeholder="请选择工厂"
                     @selfChange="hanldFactoryCode"
                   /> -->
-                  <el-select
+                  <!-- <el-select
                     filterable
                     clearable
                     v-model="positionInfo.workshopCode"
@@ -365,7 +370,7 @@
                       :value="item.id"
                       @click.native="twoClick(item)"
                     ></el-option>
-                  </el-select>
+                  </el-select> -->
                   <!-- <WorkshopSelect
                     style="margin-right: 10px"
                     ref="WorkshopSelectRef"
@@ -382,7 +387,7 @@
                     @selfChange="hanldlineCodeCode"
                     placeholder="请选择产线"
                   /> -->
-                  <el-select
+                  <!-- <el-select
                     clearable
                     filterable
                     v-model="positionInfo.lineCode"
@@ -396,13 +401,17 @@
                         positionInfo.lineName = item.goodsshelvesCode
                       "
                     ></el-option>
-                  </el-select>
-                  <!-- <el-input
-                    style="margin-right: 10px"
-                    class="item item-input"
+                  </el-select> -->
+                  <el-cascader
+                    clearable
+                    v-model="form.location"
+                    :options="options.cityDataLabel"
+                  ></el-cascader>
+                  <el-input
+                    style="width: 30%; margin-left: 10px"
                     placeholder="详细地址"
                     v-model="positionInfo.detailPosition"
-                  ></el-input> -->
+                  ></el-input>
                   <!-- <el-input
                     class="detail"
                     clearable
@@ -800,6 +809,11 @@
         assetInfo: {},
         // 资产信息
         zcInfo: {
+          factoryRoomId1: '',
+          factoryRoomId2: '',
+          factoryRoomId3: '',
+          factoryRoomId4: '',
+          factoryRoomId5: '',
           // 	固定资产编码
           fixCode: '',
           // 颜色
@@ -918,7 +932,7 @@
         await this.getInfo();
         this.title = '编辑设备信息';
         // this.getgys();
-        await this._getWarehouseChildren();
+        // await this._getWarehouseChildren();
       }
     },
     methods: {
@@ -1094,13 +1108,7 @@
             let par = {
               //基本信息
               ...this.form,
-              // id: this.basicInfo.id,
-              // assetCode: this.form.code,
-              // assetName: this.form.name,
               assetType: 1,
-              // informationId: this.basicInfo.id,
-              // productTime: this.form.productTime,
-              // expirationTime: this.expirationTime,
               // 资产信息
               positionIds: '1,1,1,1',
               ...this.zcInfo,
@@ -1127,6 +1135,8 @@
                 type: '1',
                 num: 1
               },
+              factoryRoomId: '',
+              factoryRoomName: '',
               // 文档信息
               attUrl: this.setWd() || [],
               // // 设备图片
@@ -1137,6 +1147,20 @@
 
               // extInfoSelf: this.setKz()
             };
+            const factoryRoomIds = [
+              this.zcInfo.factoryRoomId1,
+              this.zcInfo.factoryRoomId2,
+              this.zcInfo.factoryRoomId3,
+              this.zcInfo.factoryRoomId4,
+              this.zcInfo.factoryRoomId5
+            ];
+            const nonEmptyFactoryRoomIds = factoryRoomIds.filter((id) => id);
+            par.position.pathIds = nonEmptyFactoryRoomIds.join(',');
+
+            //==
+            par.deviceLocationName = par.location.toString();
+            // par.sss = par.position.detailPosition;
+            //==
             //============================
             par.extInfo = { ...this.zcInfo };
             let obj = {};
@@ -1194,6 +1218,7 @@
         const data = await getAssetInfo(this.id);
         data.extInfoSelf = data.extInfoSelf || [];
         this.form = data;
+        this.form.location = data.deviceLocationName.split(',');
 
         this.basicInfo = data.category;
         this.assetInfo = data.category.category;
@@ -1207,14 +1232,15 @@
           const pathIds = data.positionList[0].pathIds.split(',');
           const pathName = data.positionList[0].pathName.split(',');
 
-          this.positionInfo.factoryCode = pathIds[0];
-          this.positionInfo.factoryName = pathName[0];
+          this.zcInfo.factoryRoomId1 = pathIds[0];
+
+          this.zcInfo.factoryRoomId2 = pathIds[1];
+
+          this.zcInfo.factoryRoomId3 = pathIds[2];
 
-          this.positionInfo.workshopCode = pathIds[1];
-          this.positionInfo.workshopName = pathName[1];
+          this.zcInfo.factoryRoomId4 = pathIds[3];
 
-          this.positionInfo.lineCode = pathIds[2];
-          this.positionInfo.lineName = pathName[2];
+          this.zcInfo.factoryRoomId5 = pathIds[4];
 
           this.$nextTick(() => {
             // this.$refs.WorkshopSelectRef.getList();
@@ -1250,10 +1276,10 @@
           };
           this.isLink = true;
         }
-        // 资产信息
-        for (const key of Object.keys(this.zcInfo)) {
-          this.zcInfo[key] = data[key];
-        }
+        // // 资产信息
+        // for (const key of Object.keys(this.zcInfo)) {
+        //   this.zcInfo[key] = data[key];
+        // }
         this.getwhbm();
         this.getqsbm();
         if (data.attUrl && data.attUrl.length > 0) {