huang_an пре 2 година
родитељ
комит
1330c0a3df

+ 154 - 0
src/api/warehouseManagement/warehouseDefinition.js

@@ -0,0 +1,154 @@
+import request from '@/utils/request';
+
+//条件查询工厂
+// export async function getFactoryarea(params) {
+//   const res = await request.get(`/main/factoryarea/page`, {
+//     params
+//   });
+//   if (res.data.code == 0) {
+//     return res.data.data;
+//   }
+//   return Promise.reject(new Error(res.data.message));
+// }
+
+// // 仓储管理-仓库信息的保存
+// export async function warehouseSave(data) {
+//   return request.post('/warehouseGoodsshelves/newWarehouse/save', data);
+// }
+export default {
+  //条件查询工厂
+  getFactoryarea: async (params) => {
+    const res = await request.get('/main/factoryarea/page', { params });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // /wms/warehouse/page
+  //获取部门
+  tree: async () => {
+    // const res = await request.get('/wms/warehouse/getTrees');
+    const res = await request.get('/main/group/getGroupList');
+    // /wms/warehouse/getTrees
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  //根据部门获取员工
+  getUserPage: async (params) => {
+    const res = await request.get('/main/user/getUserPage', { params });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  //仓库定义列表
+  list: async (params) => {
+    const res = await request.post(
+      '/wms/warehouse/select/warehouseList',
+      params
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //新增和修改
+  save: function (data) {
+    return request.post('/wms/warehouse/saveNew', data);
+  },
+
+  //新增库区
+  warehouseareaSave: async (data) => {
+    const res = await request.post('/wms/warehouse/save', data);
+
+    return res;
+  },
+  //新增仓库
+  saveOrUpdateWarehouse: async (data) => {
+    const res = await request.post(
+      '/wms/warehouse/saveOrUpdateWarehouse',
+      data
+    );
+
+    return res;
+  },
+  //修改货位状态是不是满的
+  warehouseChangeStatus: async (data) => {
+    const res = await request.put(
+      '/wms/warehouseareagoodsshelvesallocation/update',
+      data
+    );
+    if (res.data.code == 0) {
+      return res.data.message;
+    }
+  },
+  //删除
+  delete: async (id) => {
+    const res = await request.get(`/wms/warehouse/delete/${id}`);
+    if (res.data.code == 0) {
+      return res.data.message;
+    }
+  },
+  //删除
+  isDelete: async (id) => {
+    const res = await request.get('/wms/warehouse/isDelete/' + id);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //根据ID获取
+  getById: async (params) => {
+    const res = await request.get(`/wms/warehouse/getById/${params.id}`, {});
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //详情
+  info: function (params) {
+    return request.get('/main/org/info/info', { params });
+  },
+  //树
+  // tree: function (params) {
+  //     return http.asyncCall("/main/org/dept/tree", params,'get')
+  // },
+
+  //查询仓库详情
+
+  warehouseDetail: async (warehouseId) => {
+    const res = await request.post(
+      `/wms/warehouse/warehouseDetail/${warehouseId}`
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //根据仓库查询库区
+  getListByWarehouseId: async (id) => {
+    const res = await request.get(
+      `/wms/warehousearea/getListByWarehouseId/${id}`,
+      {}
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //根据库区查货架
+  getListByAreaId: async (id) => {
+    const res = await request.get(
+      `/wms/warehouseareagoodsshelves/getListByAreaId/${id}`
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //根据货架查货位
+  getListByGoodId: async (goodId) => {
+    const res = await request.get(
+      `/wms/warehouseareagoodsshelvesallocation/getListByGoodId/${goodId}`
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  }
+};

+ 3 - 1
src/views/ledgerAssets/equipment/components/equipment-list.vue

@@ -195,7 +195,9 @@
             showOverflowTooltip: true,
             minWidth: 110,
             formatter: (_row) => {
-              return _row.position[0].pathName;
+              return _row.position.length != 0
+                ? _row.position[0].pathName
+                : '-';
             }
           },
           {

+ 117 - 16
src/views/ledgerAssets/equipment/edit.vue

@@ -322,7 +322,7 @@
               <template slot="label"> 设备位置 </template>
               <el-form-item label-width="0">
                 <div style="display: flex">
-                  <div
+                  <!-- <div
                     class="location-warp"
                     style="width: 50%; margin-right: 10px"
                   >
@@ -331,35 +331,78 @@
                       v-model="form.location"
                       :options="options.cityDataLabel"
                     ></el-cascader>
-                  </div>
-                  <factorySelect
+                  </div> -->
+                  <el-select
+                    filterable
+                    v-model="positionInfo.factoryCode"
+                    style="margin-right: 10px"
+                    clearable
+                  >
+                    <el-option
+                      v-for="(item, index) in warehouseList"
+                      :key="index"
+                      :label="item.name"
+                      :value="item.id"
+                      @click.native="changeWarehouse(item)"
+                    ></el-option>
+                  </el-select>
+                  <!-- <factorySelect
                     style="margin-right: 10px"
                     v-model="positionInfo.factoryCode"
                     placeholder="请选择工厂"
                     @selfChange="hanldFactoryCode"
-                  />
-                  <WorkshopSelect
+                  /> -->
+                  <el-select
+                    filterable
+                    clearable
+                    v-model="positionInfo.workshopCode"
+                    style="margin-right: 10px"
+                  >
+                    <el-option
+                      v-for="(item, index) in areaList"
+                      :key="index"
+                      :label="item.name"
+                      :value="item.id"
+                      @click.native="twoClick(item)"
+                    ></el-option>
+                  </el-select>
+                  <!-- <WorkshopSelect
                     style="margin-right: 10px"
                     ref="WorkshopSelectRef"
                     :factoryId="positionInfo.factoryCode"
                     v-model="positionInfo.workshopCode"
                     @selfChange="hanldWorkshopCode"
                     placeholder="请选择车间"
-                  />
-                  <FactoryLineSelect
+                  /> -->
+                  <!-- <FactoryLineSelect
                     style="margin-right: 10px"
                     ref="FactoryLineSelectRef"
                     :workshopId="positionInfo.workshopCode"
                     v-model="positionInfo.lineCode"
                     @selfChange="hanldlineCodeCode"
                     placeholder="请选择产线"
-                  />
-                  <el-input
+                  /> -->
+                  <el-select
+                    clearable
+                    filterable
+                    v-model="positionInfo.lineCode"
+                  >
+                    <el-option
+                      v-for="(item, index) in shelvesList"
+                      :key="index"
+                      :label="item.goodsshelvesCode"
+                      :value="item.id"
+                      @click.native="
+                        positionInfo.lineName = item.goodsshelvesCode
+                      "
+                    ></el-option>
+                  </el-select>
+                  <!-- <el-input
                     style="margin-right: 10px"
                     class="item item-input"
                     placeholder="详细地址"
                     v-model="positionInfo.detailPosition"
-                  ></el-input>
+                  ></el-input> -->
                   <!-- <el-input
                     class="detail"
                     clearable
@@ -684,7 +727,7 @@
   //   getfactoryInfo,
   //   getFactorys,
   //   getProductionLine,
-  //   saveOrEdit,
+  //   // saveOrEdit,
   //   getAssetNum,
   //   getDetail,
   //   getSupplier
@@ -692,6 +735,7 @@
   import { getFactoryarea } from '@/api/factoryModel';
   import { saveOrEdit, getAssetInfo } from '@/api/ledgerAssets';
   import { getUserPage } from '@/api/system/organization';
+  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
   export default {
     components: {
       linkMsg,
@@ -846,7 +890,10 @@
           brand: [],
           cityDataLabel
         },
-        depList: []
+        depList: [],
+        warehouseList: [],
+        areaList: [],
+        shelvesList: []
       };
     },
     watch: {},
@@ -868,12 +915,49 @@
       if (this.$route.query.id) {
         this.pageType = 'edit';
         this.id = this.$route.query.id;
-        this.getInfo();
+        await this.getInfo();
         this.title = '编辑设备信息';
-        this.getgys();
+        // this.getgys();
+        await this._getWarehouseChildren();
       }
     },
     methods: {
+      async twoClick(val) {
+        this.positionInfo.workshopName = val.name;
+        const res = await warehouseDefinition.getListByAreaId(val.id);
+        this.shelvesList = res;
+      },
+      async changeWarehouse(val) {
+        this.positionInfo.factoryName = val.name;
+        const res = await warehouseDefinition.getListByWarehouseId(val.id);
+        this.areaList = res;
+      },
+      async _getWarehouseChildren() {
+        const res = await warehouseDefinition.list({});
+        this.warehouseList = res.map((item) => {
+          return { ...item, name: item.factoryName + '-' + item.name };
+        });
+
+        if (this.positionInfo.factoryCode) {
+          const params = {
+            id: this.positionInfo.factoryCode,
+            name: this.positionInfo.factoryName
+          };
+          this.changeWarehouse(params);
+        }
+        if (this.positionInfo.workshopCode) {
+          const params = {
+            id: this.positionInfo.workshopCode,
+            name: this.positionInfo.workshopName
+          };
+          this.twoClick(params);
+        }
+
+        // const res = await getWarehouseChildren();
+        // if (res?.success) {
+        //
+        // }
+      },
       isExit,
       handlwpbm() {
         this.$refs.DialogGoods.open();
@@ -1006,6 +1090,7 @@
         }
         this.$refs.form.validate((valid) => {
           if (valid) {
+            console.log('ppp', this.positionInfo);
             let par = {
               //基本信息
               ...this.form,
@@ -1021,8 +1106,24 @@
               ...this.zcInfo,
               position: {
                 detailPosition: this.positionInfo.detailPosition,
-                pathIds: `${this.positionInfo.factoryCode},${this.positionInfo.workshopCode},${this.positionInfo.lineCode}`,
-                pathName: `${this.positionInfo.factoryName},${this.positionInfo.workshopName},${this.positionInfo.lineName}`,
+                pathIds: `${
+                  this.positionInfo.factoryCode
+                    ? this.positionInfo.factoryCode + ','
+                    : ''
+                }${
+                  this.positionInfo.workshopCode
+                    ? this.positionInfo.workshopCode + ','
+                    : ''
+                }${this.positionInfo.lineCode}`,
+                pathName: `${
+                  this.positionInfo.factoryName
+                    ? this.positionInfo.factoryName + ','
+                    : ''
+                }${
+                  this.positionInfo.workshopName
+                    ? this.positionInfo.workshopName + ','
+                    : ''
+                }${this.positionInfo.lineName}`,
                 type: '1',
                 num: 1
               },

+ 3 - 3
src/views/ledgerAssets/mould/edit.vue

@@ -52,9 +52,9 @@
                 </el-form-item>
               </el-descriptions-item>
               <el-descriptions-item>
-                <template slot="label"> 冲压次数 </template>
+                <template slot="label"> 冲压次数 </template>
                 <el-form-item label-width="0">
-                  <el-input size="small" v-model="info.cycs"></el-input>
+                  <el-input size="small" v-model="info.startCyTimes"></el-input>
                 </el-form-item>
               </el-descriptions-item>
               <el-descriptions-item>
@@ -693,7 +693,7 @@
           mouldCode: this.info.mouldCode,
           fixCode: this.info.fixCode,
           codeNumber: this.info.codeNumber,
-          cycs: this.info.cycs
+          startCyTimes: this.info.startCyTimes
         };
         let obj = {};
         params.extInfoSelf.forEach((item) => {