Compare commits

..

No commits in common. "51baca61cc72f9ff08406212b91d64e0cb0ac297" and "20975948ef17e30faa068330953bc2e1e694fd84" have entirely different histories.

4 changed files with 58 additions and 133 deletions

View File

@ -13,11 +13,11 @@ VUE_APP_TITLE = MES系统
# 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
# VUE_APP_BASE_API = 'http://192.168.0.33:48082'
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.4.173:48080'
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
# VUE_APP_BASE_API = 'http://192.168.1.49:48080'
VUE_APP_BASE_API = 'http://192.168.1.8:48082'
# VUE_APP_BASE_API = 'http://192.168.1.8:48080'
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
# VUE_APP_BASE_API = 'http://192.168.1.56:48080'
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'

View File

@ -27,10 +27,10 @@ export default {
// event: 'update',
// },
props: {
currentSelect: {
type: String,
default: null,
},
// selected: {
// type: String,
// default: '',
// },
list: {
type: Array,
default: () => [],
@ -44,7 +44,7 @@ export default {
return {
list__inner: [],
selected: null,
randomKey: Math.random(),
randomKey: Math.random()
};
},
watch: {
@ -57,13 +57,6 @@ export default {
deep: true,
immediate: true,
},
currentSelect: {
handler(val) {
this.selected = val;
this.randomKey = Math.random();
},
immediate: true,
},
},
methods: {
handleChange(bomItem, selected) {
@ -83,7 +76,7 @@ export default {
clearSelected() {
console.log('clearSelected');
this.selected = null;
this.randomKey = Math.random();
this.randomKey = Math.random()
// this.$emit('update', null);
// this.$nextTick(() => {
// this.$forceUpdate();

View File

@ -29,21 +29,13 @@
</span>
</div>
<div class="sl__body">
<div
class="sl__body-item"
<el-checkbox
v-for="eq in filteredBomList"
:key="eq.id + refreshKey">
<el-checkbox
:key="refreshKey"
:checked="selectedEquipments.includes(eq.id)"
@change="(e) => handleEquipmentChange(eq, e)"
class=""></el-checkbox>
<span
:key="'label' + refreshKey"
@click.stop="() => handleLoadDom(eq)">
{{ eq.name }}
</span>
</div>
:key="eq.id + refreshKey"
:label="eq.name"
:checked="selectedEquipments.includes(eq.id)"
@change="(e) => handleEquipmentChange(eq, e)"
class="sl__body-item"></el-checkbox>
</div>
</div>
</el-col>
@ -55,10 +47,9 @@
<BomSelection
ref="materialsBomList"
:key="materialsBomList.equipmentId + 'materialsBomList'"
key="materialsBomList"
:list="materialsBomList"
:equipment-id="materialsBomList.equipmentId"
:current-select="currentSelectedMaterialBomId"
@change="handleMaterialBomChange" />
</div>
</el-col>
@ -70,10 +61,9 @@
<BomSelection
ref="valuesBomList"
:key="valuesBomList.equipmentId + 'valuesBomList'"
key="valuesBomList"
:list="valuesBomList"
:equipment-id="valuesBomList.equipmentId"
:current-select="currentSelectedValueBomId"
@change="handleValueBomChange" />
</div>
</el-col>
@ -108,8 +98,6 @@ export default {
materialsBomList: [],
valuesBomList: [],
refreshKey: Math.random(),
currentSelectedMaterialBomId: null,
currentSelectedValueBomId: null,
};
},
watch: {
@ -133,26 +121,6 @@ export default {
},
},
methods: {
commit() {
this.$emit('update', this.selected);
},
handleLoadDom(eq) {
// dom
this.currentEquipment = eq.id;
this.materialsBomList = eq.materialsBom;
this.valuesBomList = eq.valuesBom;
// bom
if (this.selectedEquipments.includes(eq.id)) {
const selectedItem = this.selected.find(
(item) => item.equipmentId == eq.id
);
this.currentSelectedMaterialBomId =
selectedItem.equMaterialBomId ?? null;
this.currentSelectedValueBomId = selectedItem.equValueBomId ?? null;
}
},
handleEquipmentChange(eq, selected) {
this.currentEquipment = eq.id;
this.materialsBomList = eq.materialsBom;
@ -165,20 +133,18 @@ export default {
equValueBomId: null,
equMaterialBomId: null,
});
// this.$emit('update', this.selected);
this.$emit('update', this.selected);
} else {
//
this.selectedEquipments = this.selectedEquipments.filter(
(id) => id !== eq.id
);
// this.$refs.materialsBomList.clearSelected();
// this.$refs.valuesBomList.clearSelected();
this.currentSelectedMaterialBomId = null;
this.currentSelectedValueBomId = null;
this.$refs.materialsBomList.clearSelected();
this.$refs.valuesBomList.clearSelected();
this.selected = this.selected.filter(
(item) => item.equipmentId !== eq.id
);
// this.$emit('update', this.selected);
this.$emit('update', this.selected);
}
},
@ -196,12 +162,11 @@ export default {
});
// ''
this.refreshKey = Math.random();
// this.$emit('update', this.selected);
this.$emit('update', this.selected);
return;
}
selectedItem && (selectedItem.equMaterialBomId = selected ? bomId : null);
this.currentSelectedMaterialBomId = selected ? bomId : null;
// this.$emit('update', this.selected);
this.$emit('update', this.selected);
},
handleValueBomChange(equipmentId, bomId, selected) {
@ -217,12 +182,11 @@ export default {
equMaterialBomId: null,
});
this.refreshKey = Math.random();
// this.$emit('update', this.selected);
this.$emit('update', this.selected);
return;
}
selectedItem && (selectedItem.equValueBomId = selected ? bomId : null);
this.currentSelectedValueBomId = selected ? bomId : null;
// this.$emit('update', this.selected);
this.$emit('update', this.selected);
},
},
};
@ -233,31 +197,27 @@ export default {
min-height: 200px;
}
.select-list {
}
.sl__body {
display: flex;
flex-direction: column;
gap: 6px;
padding: 6px;
}
.sl__body-item {
margin: 0;
padding: 3px 6px;
border-radius: 4px;
cursor: pointer;
transition: background 0.3s ease-in-out;
display: flex;
align-items: center;
gap: 8px;
> .el-checkbox {
margin: 0;
padding: 3px 6px;
border-radius: 4px;
transition: background 0.3s ease-in-out;
> span {
flex: 1;
}
&:hover {
background: #0001;
&:hover {
background: #0001;
}
}
}
.sl__header {
border-bottom: 1px solid #ccc;
}

View File

@ -31,9 +31,6 @@
icon="el-icon-search"
placeholder="搜索"
v-model="searchText"
:disabled="currentDet == null"
@change="handleSearchTextChange"
clearable
style="margin-left: 20px">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
</el-input>
@ -71,12 +68,7 @@
@cancel="cancel"
@confirm="submitForm">
<!-- <CustomTransfer /> -->
<BomSelector
ref="bomSelector"
v-if="open"
:bom-list="bomList"
:value="selectedBoms"
@update="selectedBoms = $event" />
<BomSelector :bom-list="bomList" v-model="selectedBoms" />
</base-dialog>
</section>
</template>
@ -102,7 +94,7 @@ export default {
choosedEquipments: [],
searchBarFormConfig: [{ label: '工序下设备' }],
tableProps: [
{ prop: 'equName', label: '设备名称' },
{ prop: 'equipmentId', label: '设备名称' },
{ prop: 'materialName', label: '物料BOM' },
{ prop: 'valueName', label: '参数BOM' },
],
@ -112,11 +104,9 @@ export default {
queryParams: {
pageNo: 1,
pageSize: 10,
equipmentName: '',
},
searchText: '',
selectedBoms: [],
timer: null,
};
},
watch: {
@ -135,20 +125,7 @@ export default {
},
methods: {
handleEmitFun() {},
handleTableBtnClick() {},
handleSearchTextChange(val) {
if (this.timer) clearTimeout(this.timer);
this.timer = setTimeout(() => {
console.log('geting list.......');
this.queryParams.equipmentName = val;
this.$nextTick(() => {
this.getList(this.currentDet);
});
}, 300);
},
put(payload) {
return this.http(this.updateUrl, 'put', payload);
},
@ -169,32 +146,27 @@ export default {
data: method !== 'get' ? payload : null,
});
},
submitForm() {
//
this.$refs.bomSelector.commit();
//
this.$nextTick(async () => {
console.log('selectedBoms', this.selectedBoms);
if (this.selectedBoms.length) {
const { code, data } = await this.http(
'/extend/process-flow-det-equipment/createList',
'post',
this.selectedBoms.map((item) => ({
...item,
flowDetId: this.currentDet.detId,
}))
);
if (code == 0) {
this.$message.success('操作成功');
this.getList(this.currentDet);
this.cancel();
} else {
this.$message.error('操作失败');
}
async submitForm() {
console.log('selectedBoms', this.selectedBoms);
if (this.selectedBoms.length) {
const { code, data } = await this.http(
'/extend/process-flow-det-equipment/createList',
'post',
this.selectedBoms.map((item) => ({
...item,
flowDetId: this.currentDet.detId,
}))
);
if (code == 0) {
this.$message.success('操作成功');
this.getList(this.currentDet);
this.cancel();
} else {
this.$message.info('请选择设备');
this.$message.error('操作失败');
}
});
} else {
this.$message.info('请选择设备');
}
},
async getList({
detId,
@ -230,7 +202,7 @@ export default {
//
eq.materialsBom.chosen = eq.materialsBomChoseId ?? null;
eq.valuesBom.chosen = eq.valuesBomChoseId ?? null;
if (eq.equChose || eq.materialsBom.chosen || eq.valuesBom.chosen) {
if (eq.materialsBom.chosen || eq.valuesBom.chosen) {
this.selectedBoms.push({
equipmentId: eq.id,
equMaterialBomId: eq.materialsBom.chosen,