|
|
@@ -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
|
|
|
},
|