Merge branch 'projects/mes-test' of git.picaiba.com:mt-fe-group/yudao-dev into projects/mes-test

This commit is contained in:
gtz 2023-11-21 17:30:38 +08:00
commit bc2940ca99
36 changed files with 823 additions and 295 deletions

View File

@ -12,12 +12,12 @@ ENV = 'development'
VUE_APP_TITLE = MES系统 VUE_APP_TITLE = MES系统
# 芋道管理系统/开发环境 # 芋道管理系统/开发环境
VUE_APP_BASE_API = 'http://100.64.0.26:48082' # 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.4.173:48080'
# VUE_APP_BASE_API = 'http://192.168.2.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.49:48080'
# VUE_APP_BASE_API = 'http://192.168.1.8:48080' # VUE_APP_BASE_API = 'http://192.168.1.8:48082'
# VUE_APP_BASE_API = 'http://192.168.4.159: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.1.56:48080'
# VUE_APP_BASE_API = 'http://192.168.4.159:48080' # VUE_APP_BASE_API = 'http://192.168.4.159:48080'

View File

@ -31,25 +31,56 @@
<div class="form-part" v-if="section.key == 'base'"> <div class="form-part" v-if="section.key == 'base'">
<el-skeleton v-if="!showForm" animated /> <el-skeleton v-if="!showForm" animated />
<BaseInfoForm <!-- <BaseInfoForm
key="drawer-dialog-form" key="drawer-dialog-form"
v-if="showForm" v-if="showForm"
ref="form" ref="form"
:disabled="mode.includes('detail')" :disabled="mode.includes('detail')"
:dataForm="form" :dataForm="form"
:rows="formRows" /> :rows="formRows" /> -->
<el-row style="margin-bottom: 24px">
<el-col :span="8">
<div
class="title"
style="font-weight: 700; font-size: 16px; margin: 8px 0">
设备分组名称
</div>
<div class="value" style="font-size: 14px">{{ form.name }}</div>
</el-col>
<el-col :span="8">
<div
class="title"
style="font-weight: 700; font-size: 16px; margin: 8px 0">
设备分组编码
</div>
<div class="value" style="font-size: 14px">
{{ form.code }}
</div>
</el-col>
</el-row>
</div> </div>
<div v-if="section.key == 'attrs'" style="margin-top: 12px"> <div
v-if="section.key == 'attrs'"
style="position: relative; margin-top: 12px">
<div
v-if="!mode.includes('detail')"
style="position: absolute; top: -40px; right: 0">
<el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i>
添加报警
</el-button>
</div>
<base-table <base-table
v-loading="attrListLoading" v-loading="attrListLoading"
:table-props="section.props" :table-props="section.props"
:page="attrQuery?.params.pageNo || 1" :page="attrQuery?.params.pageNo || 1"
:limit="attrQuery?.params.pageSize || 10" :limit="attrQuery?.params.pageSize || 10"
:table-data="list" :table-data="list"
:add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr"
@emitFun="handleEmitFun"> @emitFun="handleEmitFun">
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr" -->
<method-btn <method-btn
v-if="section.tableBtn" v-if="section.tableBtn"
slot="handleBtn" slot="handleBtn"
@ -74,14 +105,7 @@
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit"> <el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
编辑 编辑
</el-button> </el-button>
<el-button v-else type="primary" @click="handleCancel">确定</el-button> <!-- <el-button v-else type="primary" @click="handleCancel">确定</el-button> -->
<!-- sections的第二项必须是 属性列表 -->
<!-- <el-button
v-if="sections[1].allowAdd"
type="primary"
@click="handleAddAttr">
添加属性
</el-button> -->
</div> </div>
</div> </div>
@ -226,7 +250,7 @@ export default {
bind: { bind: {
// //
// disabled: this.mode == 'detail', // disabled: this.mode == 'detail',
disabled: true disabled: true,
}, },
}; };
}); });

View File

@ -31,25 +31,56 @@
<div class="form-part" v-if="section.key == 'base'"> <div class="form-part" v-if="section.key == 'base'">
<el-skeleton v-if="!showForm" animated /> <el-skeleton v-if="!showForm" animated />
<BaseInfoForm <!-- <BaseInfoForm
key="drawer-dialog-form" key="drawer-dialog-form"
v-if="showForm" v-if="showForm"
ref="form" ref="form"
:disabled="true" :disabled="true"
:dataForm="form" :dataForm="form"
:rows="formRows" /> :rows="formRows" /> -->
<el-row style="margin-bottom: 24px">
<el-col :span="8">
<div
class="title"
style="font-weight: 700; font-size: 16px; margin: 8px 0">
设备分组名称
</div>
<div class="value" style="font-size: 14px">{{ form.name }}</div>
</el-col>
<el-col :span="8">
<div
class="title"
style="font-weight: 700; font-size: 16px; margin: 8px 0">
设备分组编码
</div>
<div class="value" style="font-size: 14px">
{{ form.code }}
</div>
</el-col>
</el-row>
</div> </div>
<div v-if="section.key == 'attrs'" style="margin-top: 12px"> <div
v-if="section.key == 'attrs'"
style="position: relative; margin-top: 12px">
<div
v-if="!mode.includes('detail')"
style="position: absolute; top: -40px; right: 0">
<el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i>
添加属性
</el-button>
</div>
<base-table <base-table
v-loading="attrListLoading" v-loading="attrListLoading"
:table-props="section.props" :table-props="section.props"
:page="attrQuery?.params.pageNo || 1" :page="attrQuery?.params.pageNo || 1"
:limit="attrQuery?.params.pageSize || 10" :limit="attrQuery?.params.pageSize || 10"
:table-data="list" :table-data="list"
:add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr"
@emitFun="handleEmitFun"> @emitFun="handleEmitFun">
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr" -->
<method-btn <method-btn
v-if="section.tableBtn" v-if="section.tableBtn"
slot="handleBtn" slot="handleBtn"
@ -74,14 +105,7 @@
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit"> <el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
编辑 编辑
</el-button> </el-button>
<el-button v-else type="primary" @click="handleCancel">确定</el-button> <!-- <el-button v-else type="primary" @click="handleCancel">确定</el-button> -->
<!-- sections的第二项必须是 属性列表 -->
<!-- <el-button
v-if="sections[1].allowAdd"
type="primary"
@click="handleAddAttr">
添加属性
</el-button> -->
</div> </div>
</div> </div>

View File

@ -31,25 +31,58 @@
<div class="form-part" v-if="section.key == 'base'"> <div class="form-part" v-if="section.key == 'base'">
<el-skeleton v-if="!showForm" animated /> <el-skeleton v-if="!showForm" animated />
<BaseInfoForm <!-- <BaseInfoForm
key="drawer-dialog-form" key="drawer-dialog-form"
v-if="showForm" v-if="showForm"
ref="form" ref="form"
:disabled="mode.includes('detail')" :disabled="mode.includes('detail')"
v-model="form" v-model="form"
:rows="formRows" /> :rows="formRows" /> -->
<el-row style="margin-bottom: 24px">
<el-col :span="8">
<div
class="title"
style="font-weight: 700; font-size: 16px; margin: 8px 0">
设备名
</div>
<div class="value" style="font-size: 14px">
{{ form.equipmentName }}
</div>
</el-col>
<el-col :span="8">
<div
class="title"
style="font-weight: 700; font-size: 16px; margin: 8px 0">
关联表名
</div>
<div class="value" style="font-size: 14px">
{{ form.plcTableName }}
</div>
</el-col>
</el-row>
</div> </div>
<div v-if="section.key == 'attrs'" style="margin-top: 12px"> <div
v-if="section.key == 'attrs'"
style="position: relative; margin-top: 12px">
<div
v-if="!mode.includes('detail')"
style="position: absolute; top: -40px; right: 0">
<el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i>
添加属性
</el-button>
</div>
<base-table <base-table
v-loading="attrListLoading" v-loading="attrListLoading"
:table-props="section.props" :table-props="section.props"
:page="attrQuery?.params.pageNo || 1" :page="attrQuery?.params.pageNo || 1"
:limit="attrQuery?.params.pageSize || 10" :limit="attrQuery?.params.pageSize || 10"
:table-data="list" :table-data="list"
:add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr"
@emitFun="handleEmitFun"> @emitFun="handleEmitFun">
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr" -->
<method-btn <method-btn
v-if="section.tableBtn" v-if="section.tableBtn"
slot="handleBtn" slot="handleBtn"
@ -74,14 +107,7 @@
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit"> <el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
编辑 编辑
</el-button> </el-button>
<el-button v-else type="primary" @click="handleCancel">确定</el-button> <!-- <el-button v-else type="primary" @click="handleCancel">确定</el-button> -->
<!-- sections的第二项必须是 属性列表 -->
<!-- <el-button
v-if="sections[1].allowAdd"
type="primary"
@click="handleAddAttr">
添加属性
</el-button> -->
</div> </div>
</div> </div>
@ -214,7 +240,6 @@ export default {
{ label: '出片数量', value: 2 }, { label: '出片数量', value: 2 },
{ label: '破损数量', value: 3 }, { label: '破损数量', value: 3 },
{ label: '无类型', value: 4 }, { label: '无类型', value: 4 },
], ],
rules: [{ required: true, message: '不能为空', trigger: 'blur' }], rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
}, },

View File

@ -53,7 +53,7 @@
import moment from 'moment'; import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import Editor from '@/components/Editor'; import Editor from '@/components/Editor';
import { deleteEqMaintainLog } from '@/api/equipment/base/maintain/record' import { deleteEqMaintainLog } from '@/api/equipment/base/maintain/record';
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
@ -64,7 +64,6 @@ export default {
data() { data() {
return { return {
searchBarKeys: [ searchBarKeys: [
'maintainPlanId',
'maintainPlanId', 'maintainPlanId',
'startTime', 'startTime',
'relatePlan', 'relatePlan',
@ -190,7 +189,6 @@ export default {
rules: [{ required: true, message: '不能为空', trigger: 'blur' }], rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
}, },
{ {
// TODO:
select: true, select: true,
label: '保养人员', label: '保养人员',
prop: 'maintainWorker', prop: 'maintainWorker',
@ -222,11 +220,10 @@ export default {
}, },
{}, {},
{ {
// TODO:
select: true, select: true,
label: '所属计划', label: '所属计划',
prop: 'maintainPlanId', prop: 'maintainPlanId',
url: '', url: '/base/equipment-maintain-plan/page',
bind: { bind: {
filterable: true, filterable: true,
clearable: true, clearable: true,
@ -273,9 +270,16 @@ export default {
}, },
], ],
// TODO: // TODO:
[{ label: '保养描述', prop: 'maintenanceDes', subcomponent: Editor, bind: { [
'min-height': 192 {
} }], label: '保养描述',
prop: 'maintenanceDes',
subcomponent: Editor,
bind: {
'min-height': 192,
},
},
],
[{ input: true, label: '备注', prop: 'remark' }], [{ input: true, label: '备注', prop: 'remark' }],
], ],
// //
@ -293,20 +297,26 @@ export default {
// //
form: {}, form: {},
basePath: '/base/equipment-maintain-log', basePath: '/base/equipment-maintain-log',
mode: null mode: null,
}; };
}, },
created() { created() {
this.initSearchBar(); this.initSearchBar();
if (this.$route.query) { if (this.$route.query) {
this.queryParams.equipmentId = this.$route.query?.equipmentId ?? undefined this.queryParams.equipmentId =
this.queryParams.maintainPlanId = this.$route.query?.maintainPlanId ?? undefined this.$route.query?.equipmentId ?? undefined;
this.queryParams.relatePlan = this.$route.query?.relatePlan ?? undefined this.queryParams.maintainPlanId =
this.queryParams.startTime = this.$route.query?.createTime ?? undefined this.$route.query?.maintainPlanId ?? undefined;
this.searchBarFormConfig[0].defaultSelect = this.$route.query.equipmentId ?? undefined this.queryParams.relatePlan = this.$route.query?.relatePlan ?? undefined;
this.searchBarFormConfig[1].defaultSelect = Number(this.$route.query.maintainPlanId) ?? undefined this.queryParams.startTime = this.$route.query?.createTime ?? undefined;
this.searchBarFormConfig[2].defaultSelect = this.$route.query?.createTime ?? undefined this.searchBarFormConfig[0].defaultSelect =
this.searchBarFormConfig[3].defaultSelect = Number(this.$route.query.relatePlan) ?? undefined this.$route.query.equipmentId ?? undefined;
this.searchBarFormConfig[1].defaultSelect =
Number(this.$route.query.maintainPlanId) ?? undefined;
this.searchBarFormConfig[2].defaultSelect =
this.$route.query?.createTime ?? undefined;
this.searchBarFormConfig[3].defaultSelect =
Number(this.$route.query.relatePlan) ?? undefined;
} }
this.getList(); this.getList();
}, },
@ -399,7 +409,7 @@ export default {
this.info({ id }).then((response) => { this.info({ id }).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.form.maintainWorker = this.form.maintainWorker.split(',') this.form.maintainWorker = this.form.maintainWorker.split(',');
this.title = '修改保养记录'; this.title = '修改保养记录';
}); });
}, },
@ -409,7 +419,7 @@ export default {
if (!valid) { if (!valid) {
return; return;
} }
this.form.maintainWorker = this.form.maintainWorker.join(',') this.form.maintainWorker = this.form.maintainWorker.join(',');
// //
if (this.form.id != null) { if (this.form.id != null) {
this.put(this.form).then((response) => { this.put(this.form).then((response) => {
@ -431,7 +441,9 @@ export default {
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id;
this.$modal this.$modal
.confirm('是否删除设备保养单号为"' + row.maintainOrderNumber + '"的数据项?') .confirm(
'是否删除设备保养单号为"' + row.maintainOrderNumber + '"的数据项?'
)
.then(function () { .then(function () {
return deleteEqMaintainLog(id); return deleteEqMaintainLog(id);
}) })
@ -443,7 +455,7 @@ export default {
}, },
handleDetail({ id }) { handleDetail({ id }) {
this.reset(); this.reset();
this.mode = 'detail' this.mode = 'detail';
this.info({ id }).then((response) => { this.info({ id }).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;

View File

@ -19,6 +19,7 @@
ref="form" ref="form"
:model="dataForm" :model="dataForm"
label-width="100px" label-width="100px"
label-position="top"
v-loading="formLoading"> v-loading="formLoading">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
@ -213,7 +214,7 @@ export default {
this.visible = false; this.visible = false;
}, },
goEdit() { goEdit() {
this.isdetail = false; this.disabled = false;
}, },
/** 模拟透传 ref */ /** 模拟透传 ref */
validate(cb) { validate(cb) {

View File

@ -0,0 +1,114 @@
<!--
filename: BomSelection.vue
author: liubin
date: 2023-11-20 13:23:36
description:
-->
<template>
<div class="bom-selection">
<el-checkbox
v-for="item in list__inner"
:key="item.id + randomKey"
:label="item.name"
:disabled="item.disabled"
:checked="item.id === selected"
@change="(e) => handleChange(item, e)"
class="sl__body-item"></el-checkbox>
</div>
</template>
<script>
export default {
name: 'BomSelection',
components: {},
// model: {
// prop: 'selected',
// event: 'update',
// },
props: {
currentSelect: {
type: String,
default: null,
},
list: {
type: Array,
default: () => [],
},
equipmentId: {
type: String,
default: '',
},
},
data() {
return {
list__inner: [],
selected: null,
randomKey: Math.random(),
};
},
watch: {
list: {
handler(val) {
if (val) {
this.list__inner = val.map((item) => ({ ...item, disabled: false }));
}
},
deep: true,
immediate: true,
},
currentSelect: {
handler(val) {
this.selected = val;
this.randomKey = Math.random();
},
immediate: true,
},
},
methods: {
handleChange(bomItem, selected) {
this.list__inner = this.list__inner.map((item) => ({
...item,
disabled: selected ? item.id !== bomItem.id : false,
}));
if (selected) this.selected = null;
else this.clearSelected();
this.$emit('change', this.equipmentId, bomItem.id, selected);
this.$nextTick(() => {
this.$forceUpdate();
});
},
clearSelected() {
console.log('clearSelected');
this.selected = null;
this.randomKey = Math.random();
// this.$emit('update', null);
// this.$nextTick(() => {
// this.$forceUpdate();
// });
},
},
};
</script>
<style scoped lang="scss">
.bom-selection {
display: flex;
flex-direction: column;
gap: 6px;
padding: 6px;
}
.sl__body-item {
margin: 0;
padding: 3px 6px;
border-radius: 4px;
transition: background 0.3s ease-in-out;
&:hover {
background: #0001;
}
}
</style>

View File

@ -0,0 +1,264 @@
<!--
filename: BomSelector.vue
author: liubin
date: 2023-11-17 16:23:28
description:
-->
<template>
<div class="bom-selector">
<el-row>
<el-col :span="8">
<el-input
v-model="searchText"
placeholder="搜索"
clearable
style="margin-bottom: 12px; user-select: none">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
</el-input>
</el-col>
</el-row>
<el-row style="border: 1px solid #ccc; display: flex">
<el-col :span="8">
<div class="select-list">
<div class="sl__header" style="background: #f3f4fb; padding: 12px">
<span style="">可分配设备</span>
<span>
{{ selectedEquipments.length }}/{{ filteredBomList.length }}
</span>
</div>
<div class="sl__body">
<div
class="sl__body-item"
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>
</div>
</div>
</el-col>
<el-col :span="8" style="border-left: 1px solid #ccc">
<div class="select-list">
<div class="sl__header" style="background: #f3f4fb; padding: 12px">
<span style="">物料BOM</span>
</div>
<BomSelection
ref="materialsBomList"
:key="materialsBomList.equipmentId + 'materialsBomList'"
:list="materialsBomList"
:equipment-id="materialsBomList.equipmentId"
:current-select="currentSelectedMaterialBomId"
@change="handleMaterialBomChange" />
</div>
</el-col>
<el-col :span="8" style="border-left: 1px solid #ccc">
<div class="select-list">
<div class="sl__header" style="background: #f3f4fb; padding: 12px">
<span style="">参数BOM</span>
</div>
<BomSelection
ref="valuesBomList"
:key="valuesBomList.equipmentId + 'valuesBomList'"
:list="valuesBomList"
:equipment-id="valuesBomList.equipmentId"
:current-select="currentSelectedValueBomId"
@change="handleValueBomChange" />
</div>
</el-col>
</el-row>
</div>
</template>
;
<script>
import BomSelection from './BomSelection.vue';
export default {
name: 'BomSelector',
components: { BomSelection },
model: {
prop: 'value',
event: 'update',
},
props: {
bomList: {
type: Array,
default: () => [],
},
value: {
type: Array,
default: () => [],
},
},
data() {
return {
searchText: '',
selectedEquipments: [],
selected: [],
materialsBomList: [],
valuesBomList: [],
refreshKey: Math.random(),
currentSelectedMaterialBomId: null,
currentSelectedValueBomId: null,
};
},
watch: {
value: {
handler(val) {
console.log('value', val);
if (val) {
this.selectedEquipments = val.map((item) => item.equipmentId);
this.selected = val;
}
},
deep: true,
immediate: true,
},
},
computed: {
filteredBomList() {
return this.bomList.filter((item) => {
return item.name.includes(this.searchText);
});
},
},
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;
this.valuesBomList = eq.valuesBom;
if (selected) {
this.selectedEquipments.push(eq.id);
this.selected.push({
equipmentId: eq.id,
equValueBomId: null,
equMaterialBomId: null,
});
// 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.selected = this.selected.filter(
(item) => item.equipmentId !== eq.id
);
// this.$emit('update', this.selected);
}
},
handleMaterialBomChange(equipmentId, bomId, selected) {
const selectedItem = this.selected.find(
(item) => item.equipmentId == equipmentId
);
if (selected && !selectedItem) {
//
this.selectedEquipments.push(equipmentId);
this.selected.push({
equipmentId,
equValueBomId: null,
equMaterialBomId: bomId,
});
// ''
this.refreshKey = Math.random();
// this.$emit('update', this.selected);
return;
}
selectedItem && (selectedItem.equMaterialBomId = selected ? bomId : null);
this.currentSelectedMaterialBomId = selected ? bomId : null;
// this.$emit('update', this.selected);
},
handleValueBomChange(equipmentId, bomId, selected) {
const selectedItem = this.selected.find(
(item) => item.equipmentId == equipmentId
);
if (selected && !selectedItem) {
//
this.selectedEquipments.push(equipmentId);
this.selected.push({
equipmentId,
equValueBomId: bomId,
equMaterialBomId: null,
});
this.refreshKey = Math.random();
// this.$emit('update', this.selected);
return;
}
selectedItem && (selectedItem.equValueBomId = selected ? bomId : null);
this.currentSelectedValueBomId = selected ? bomId : null;
// this.$emit('update', this.selected);
},
},
};
</script>
<style scoped lang="scss">
.bom-selector {
min-height: 200px;
}
.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;
> span {
flex: 1;
}
&:hover {
background: #0001;
}
}
.sl__header {
border-bottom: 1px solid #ccc;
}
</style>

View File

@ -31,6 +31,9 @@
icon="el-icon-search" icon="el-icon-search"
placeholder="搜索" placeholder="搜索"
v-model="searchText" v-model="searchText"
:disabled="currentDet == null"
@change="handleSearchTextChange"
clearable
style="margin-left: 20px"> style="margin-left: 20px">
<i slot="prefix" class="el-input__icon el-icon-search"></i> <i slot="prefix" class="el-input__icon el-icon-search"></i>
</el-input> </el-input>
@ -63,22 +66,27 @@
<base-dialog <base-dialog
dialogTitle="选择设备" dialogTitle="选择设备"
:dialogVisible="open" :dialogVisible="open"
width="45%"
@close="cancel" @close="cancel"
@cancel="cancel" @cancel="cancel"
@confirm="submitForm"> @confirm="submitForm">
<el-transfer v-model="choosedEquipments" :data="eqList"> <!-- <CustomTransfer /> -->
<!-- <span slot-scope="{ option }"> <BomSelector
{{ option.key }} - {{ option.label }} ref="bomSelector"
</span> --> v-if="open"
</el-transfer> :bom-list="bomList"
:value="selectedBoms"
@update="selectedBoms = $event" />
</base-dialog> </base-dialog>
</section> </section>
</template> </template>
<script> <script>
import BomSelector from './BomSelector.vue';
export default { export default {
name: 'ProcessBom', name: 'ProcessBom',
components: {}, components: { BomSelector },
props: { props: {
currentDet: { currentDet: {
type: Object, type: Object,
@ -89,11 +97,12 @@ export default {
return { return {
open: false, open: false,
eqList: [], eqList: [],
bomList: [],
finalList: [], finalList: [],
choosedEquipments: [], choosedEquipments: [],
searchBarFormConfig: [{ label: '工序下设备' }], searchBarFormConfig: [{ label: '工序下设备' }],
tableProps: [ tableProps: [
{ prop: 'equipmentId', label: '设备名称' }, { prop: 'equName', label: '设备名称' },
{ prop: 'materialName', label: '物料BOM' }, { prop: 'materialName', label: '物料BOM' },
{ prop: 'valueName', label: '参数BOM' }, { prop: 'valueName', label: '参数BOM' },
], ],
@ -103,13 +112,17 @@ export default {
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
equipmentName: '',
}, },
searchText: '' searchText: '',
selectedBoms: [],
timer: null,
}; };
}, },
watch: { watch: {
currentDet: { currentDet: {
handler(val) { handler(val) {
console.log('currentDet', val);
if (val != null) { if (val != null) {
this.getList(val); this.getList(val);
} else { } else {
@ -121,51 +134,21 @@ export default {
}, },
}, },
methods: { methods: {
renderFn(h, option) {
console.log(option);
return <span>1</span>;
},
async getEqList() {
console.log('currentDet', this.currentDet);
const { sectionId } = this.currentDet;
const { code, data } = await this.http(
'base/core-equipment-bind-section/page',
'get',
{ workshopSectionId: sectionId, pageNo: 1, pageSize: 100 }
);
if (code == 0) {
console.log('workshopSectionId', data);
//
this.eqList = [
{ equipmentId: 1, equipmentName: '设备1' },
{ equipmentId: 2, equipmentName: '设备2' },
{ equipmentId: 3, equipmentName: '设备3' },
{ equipmentId: 4, equipmentName: '设备4' },
{ equipmentId: 5, equipmentName: '设备5' },
{ equipmentId: 6, equipmentName: '设备6' },
]; // ].map((item) => ({ label: item.equipmentName, key: item.equipmentId }));
// bombom
// bom bom
this.finalList = this.eqList.map((item) => {
item.sub = [];
// key: equipmentId-bomId
item.sub.push({
key: item.equipmentId + '-' + '101',
label: '参数bom1',
});
item.sub.push({
key: item.equipmentId + '-' + '201',
label: '物料bom1',
});
return item;
});
}
},
handleEmitFun() {}, handleEmitFun() {},
handleTableBtnClick() {}, 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) { put(payload) {
return this.http(this.updateUrl, 'put', payload); return this.http(this.updateUrl, 'put', payload);
}, },
@ -186,8 +169,41 @@ export default {
data: method !== 'get' ? payload : null, data: method !== 'get' ? payload : null,
}); });
}, },
submitForm() {}, submitForm() {
async getList({ detId, detName, detDesc, flowId, sectionName } = {}) { //
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('操作失败');
}
} else {
this.$message.info('请选择设备');
}
});
},
async getList({
detId,
detName,
detDesc,
flowId,
sectionName,
sectionId,
} = {}) {
console.log('get list', detId, detName, flowId); console.log('get list', detId, detName, flowId);
const { data, code } = await this.http( const { data, code } = await this.http(
'/extend/process-flow-det-equipment/page', '/extend/process-flow-det-equipment/page',
@ -201,10 +217,38 @@ export default {
this.list.splice(0); this.list.splice(0);
this.total = 0; this.total = 0;
} }
// bom
this.http('/extend/process-flow-det/getEquipmentDetBySectionId', 'post', {
sectionId,
flowDetId: detId,
}).then(({ code, data }) => {
if (code == 0) {
this.bomList = data.map((eq) => {
eq.materialsBom = eq.materialsBom || [];
eq.valuesBom = eq.valuesBom || [];
//
eq.materialsBom.chosen = eq.materialsBomChoseId ?? null;
eq.valuesBom.chosen = eq.valuesBomChoseId ?? null;
if (eq.equChose || eq.materialsBom.chosen || eq.valuesBom.chosen) {
this.selectedBoms.push({
equipmentId: eq.id,
equMaterialBomId: eq.materialsBom.chosen,
equValueBomId: eq.valuesBom.chosen,
});
}
// id
eq.materialsBom.equipmentId = eq.id;
eq.valuesBom.equipmentId = eq.id;
return eq;
});
} else {
this.bomList.splice(0);
}
});
}, },
async handleAddEquipment() { async handleAddEquipment() {
this.open = true; this.open = true;
await this.getEqList();
}, },
cancel() { cancel() {
this.open = false; this.open = false;

View File

@ -0,0 +1,51 @@
export class Candidate {
constructor(id, name, paramBomList, materialBomList) {
this.equipmentId = id;
this.equipmentName = name;
this.children = [];
this.totalBom = paramBomList.length + materialBomList.length;
this.selected = false;
paramBomList.forEach((pb) => {
this.children.push({
id: pb.id,
name: pb.name,
type: 'param',
selected: false,
});
});
materialBomList.forEach((mb) => {
this.children.push({
id: mb.id,
name: mb.name,
type: 'material',
selected: false,
});
});
}
get selected() {
return this.children.filter((child) => child.selected).length;
}
get paramBom() {
return this.children.filter((child) => child.type === 'param');
}
get materialBom() {
return this.children.filter((child) => child.type === 'material');
}
}
export class CandidateList {
constructor() {
this.value = [];
}
addCandidate(candidate) {
this.value.push(candidate);
}
get selected() {
return this.list.filter((candidate) => candidate.selected).length;
}
}

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 13:52:10 * @Date: 2023-08-01 13:52:10
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-11-17 09:52:17 * @LastEditTime: 2023-11-20 15:54:28
* @Description: * @Description:
--> -->
<template> <template>
@ -15,31 +15,31 @@
label-width="100px"> label-width="100px">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="名称" prop="name"> <el-form-item label="物品名称" prop="name">
<el-input <el-input
v-model="dataForm.name" v-model="dataForm.name"
clearable clearable
placeholder="请输入名称" /> placeholder="请输入物品名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="编码" prop="code"> <el-form-item label="物品编码" prop="code">
<el-input <el-input
v-model="dataForm.code" v-model="dataForm.code"
clearable clearable
placeholder="请输入编码" /> placeholder="请输入物品编码" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="规格" prop="spec"> <el-form-item label="物品规格" prop="spec">
<el-input <el-input
v-model="dataForm.spec" v-model="dataForm.spec"
clearable clearable
placeholder="请输入规格" /> placeholder="请输入物品规格" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="单位" prop="unit"> <el-form-item label="物品单位" prop="unit">
<el-select <el-select
v-model="dataForm.unit" v-model="dataForm.unit"
filterable filterable
@ -57,6 +57,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="单日消耗量" prop="dailyUse"> <el-form-item label="单日消耗量" prop="dailyUse">
<el-input-number <el-input-number
:min="0"
v-model="dataForm.dailyUse" v-model="dataForm.dailyUse"
clearable clearable
placeholder="请输入单日消耗量" /> placeholder="请输入单日消耗量" />
@ -65,9 +66,10 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="允许留存时间" prop="allowTime"> <el-form-item label="允许留存时间" prop="allowTime">
<el-input-number <el-input-number
:min="0"
v-model="dataForm.allowTime" v-model="dataForm.allowTime"
clearable clearable
placeholder="请输入允许留存时间" /> placeholder="请输入允许留存时间" /> ()
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -134,10 +136,10 @@ export default {
}, },
dataRule: { dataRule: {
code: [ code: [
{ required: true, message: '库位编码不能为空', trigger: 'blur' }, { required: true, message: '物品编码不能为空', trigger: 'blur' },
], ],
name: [ name: [
{ required: true, message: '库位名称不能为空', trigger: 'blur' }, { required: true, message: '物品名称不能为空', trigger: 'blur' },
], ],
}, },
isorno: [ isorno: [

View File

@ -57,19 +57,19 @@ import { publicFormatter } from '@/utils/dict';
const tableProps = [ const tableProps = [
{ {
prop: 'name', prop: 'name',
label: '名称', label: '物品名称',
}, },
{ {
prop: 'code', prop: 'code',
label: '编码', label: '物品编码',
}, },
{ {
prop: 'spec', prop: 'spec',
label: '规格', label: '物品规格',
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '物品单位',
filter: publicFormatter('unit_dict') filter: publicFormatter('unit_dict')
}, },
{ {
@ -121,8 +121,8 @@ export default {
formConfig: [ formConfig: [
{ {
type: 'input', type: 'input',
label: '名称', label: '物品名称',
placeholder: '名称', placeholder: '物品名称',
param: 'name', param: 'name',
}, },
{ {

View File

@ -2,7 +2,6 @@
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:isFold="true"
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" /> @headBtnClick="buttonClick" />

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 13:52:10 * @Date: 2023-08-01 13:52:10
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:32:54 * @LastEditTime: 2023-11-20 15:14:18
* @Description: * @Description:
--> -->
<template> <template>
@ -68,7 +68,6 @@
v-model="dataForm.goodsBatch" v-model="dataForm.goodsBatch"
filterable filterable
clearable clearable
@change="setBatchInfo"
placeholder="请选择物品名称"> placeholder="请选择物品名称">
<el-option <el-option
v-for="(item, index) in Batch" v-for="(item, index) in Batch"
@ -79,13 +78,12 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="入库数量" prop="numDet"> <el-form-item :label="dataForm.id?'出库数量':'入库数量'" prop="numDet">
<el-input-number <el-input-number
v-model="dataForm.numDet" v-model="dataForm.numDet"
clearable clearable
:min="0" :min="0"
:max="max?max:9999999" placeholder="请输入数量" />
placeholder="请输入入库数量" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -130,7 +128,6 @@ export default {
}, },
goodsArr: [], goodsArr: [],
Batch: [], Batch: [],
max: 0,
dataRule: { dataRule: {
goodsId: [ goodsId: [
{ required: true, message: '物品名称不能为空', trigger: 'change' }, { required: true, message: '物品名称不能为空', trigger: 'change' },
@ -143,7 +140,7 @@ export default {
}, },
], ],
numDet: [ numDet: [
{ required: true, message: '入库数量不能为空', trigger: 'blur' }, { required: true, message: '数量不能为空', trigger: 'blur' },
], ],
}, },
}; };
@ -172,13 +169,6 @@ export default {
} }
}); });
}, },
setBatchInfo(){
this.Batch.forEach((item) => {
if (item.goodsBatch === this.dataForm.goodsBatch) {
this.max = item.numDet
}
});
},
outWare(data) { outWare(data) {
this.getArr(); this.getArr();
this.visible = true; this.visible = true;

View File

@ -29,6 +29,7 @@
<el-option <el-option
v-for="item in productArr" v-for="item in productArr"
:key="item.id" :key="item.id"
:disabled="!item.enabled"
:label="item.name" :label="item.name"
:value="item" /> :value="item" />
</el-select> </el-select>

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 13:52:10 * @Date: 2023-08-01 13:52:10
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-11-17 09:51:59 * @LastEditTime: 2023-11-20 15:54:39
* @Description: * @Description:
--> -->
<template> <template>
@ -15,31 +15,31 @@
label-width="100px"> label-width="100px">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="名称" prop="name"> <el-form-item label="物品名称" prop="name">
<el-input <el-input
v-model="dataForm.name" v-model="dataForm.name"
clearable clearable
placeholder="请输入名称" /> placeholder="请输入物品名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="编码" prop="code"> <el-form-item label="物品编码" prop="code">
<el-input <el-input
v-model="dataForm.code" v-model="dataForm.code"
clearable clearable
placeholder="请输入编码" /> placeholder="请输入物品编码" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="规格" prop="spec"> <el-form-item label="物品规格" prop="spec">
<el-input <el-input
v-model="dataForm.spec" v-model="dataForm.spec"
clearable clearable
placeholder="请输入规格" /> placeholder="请输入物品规格" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="单位" prop="unit"> <el-form-item label="物品单位" prop="unit">
<el-select <el-select
v-model="dataForm.unit" v-model="dataForm.unit"
filterable filterable
@ -57,6 +57,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="单日消耗量" prop="dailyUse"> <el-form-item label="单日消耗量" prop="dailyUse">
<el-input-number <el-input-number
:min="0"
v-model="dataForm.dailyUse" v-model="dataForm.dailyUse"
clearable clearable
placeholder="请输入单日消耗量" /> placeholder="请输入单日消耗量" />
@ -65,9 +66,10 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="允许留存时间" prop="allowTime"> <el-form-item label="允许留存时间" prop="allowTime">
<el-input-number <el-input-number
:min="0"
v-model="dataForm.allowTime" v-model="dataForm.allowTime"
clearable clearable
placeholder="请输入允许留存时间" /> placeholder="请输入允许留存时间" /> ()
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -134,10 +136,10 @@ export default {
}, },
dataRule: { dataRule: {
code: [ code: [
{ required: true, message: '库位编码不能为空', trigger: 'blur' }, { required: true, message: '物品编码不能为空', trigger: 'blur' },
], ],
name: [ name: [
{ required: true, message: '库位名称不能为空', trigger: 'blur' }, { required: true, message: '物品名称不能为空', trigger: 'blur' },
], ],
}, },
isorno: [ isorno: [

View File

@ -57,19 +57,19 @@ import { publicFormatter } from '@/utils/dict';
const tableProps = [ const tableProps = [
{ {
prop: 'name', prop: 'name',
label: '名称', label: '物品名称',
}, },
{ {
prop: 'code', prop: 'code',
label: '编码', label: '物品编码',
}, },
{ {
prop: 'spec', prop: 'spec',
label: '规格', label: '物品规格',
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '物品单位',
filter: publicFormatter('unit_dict') filter: publicFormatter('unit_dict')
}, },
{ {
@ -121,8 +121,8 @@ export default {
formConfig: [ formConfig: [
{ {
type: 'input', type: 'input',
label: '名称', label: '物品名称',
placeholder: '名称', placeholder: '物品名称',
param: 'name', param: 'name',
}, },
{ {

View File

@ -2,7 +2,6 @@
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:isFold="true"
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" /> @headBtnClick="buttonClick" />

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 13:52:10 * @Date: 2023-08-01 13:52:10
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:24:41 * @LastEditTime: 2023-11-20 15:14:00
* @Description: * @Description:
--> -->
<template> <template>
@ -68,7 +68,6 @@
v-model="dataForm.goodsBatch" v-model="dataForm.goodsBatch"
filterable filterable
clearable clearable
@change="setBatchInfo"
placeholder="请选择物品名称"> placeholder="请选择物品名称">
<el-option <el-option
v-for="(item, index) in Batch" v-for="(item, index) in Batch"
@ -79,13 +78,12 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="入库数量" prop="numDet"> <el-form-item :label="dataForm.id?'出库数量':'入库数量'" prop="numDet">
<el-input-number <el-input-number
v-model="dataForm.numDet" v-model="dataForm.numDet"
clearable clearable
:min="0" :min="0"
:max="max?max:9999999" placeholder="请输入数量" />
placeholder="请输入入库数量" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -130,7 +128,6 @@ export default {
}, },
goodsArr: [], goodsArr: [],
Batch: [], Batch: [],
max: 0,
dataRule: { dataRule: {
goodsId: [ goodsId: [
{ required: true, message: '物品名称不能为空', trigger: 'change' }, { required: true, message: '物品名称不能为空', trigger: 'change' },
@ -143,7 +140,7 @@ export default {
}, },
], ],
numDet: [ numDet: [
{ required: true, message: '入库数量不能为空', trigger: 'blur' }, { required: true, message: '数量不能为空', trigger: 'blur' },
], ],
}, },
}; };
@ -172,13 +169,6 @@ export default {
} }
}); });
}, },
setBatchInfo(){
this.Batch.forEach((item) => {
if (item.goodsBatch === this.dataForm.goodsBatch) {
this.max = item.numDet
}
});
},
outWare(data) { outWare(data) {
this.getArr(); this.getArr();
this.visible = true; this.visible = true;

View File

@ -29,6 +29,7 @@
<el-option <el-option
v-for="item in productArr" v-for="item in productArr"
:key="item.id" :key="item.id"
:disabled="!item.enabled"
:label="item.name" :label="item.name"
:value="item" /> :value="item" />
</el-select> </el-select>

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 13:52:10 * @Date: 2023-08-01 13:52:10
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-11-17 09:51:44 * @LastEditTime: 2023-11-20 15:54:49
* @Description: * @Description:
--> -->
<template> <template>
@ -15,31 +15,31 @@
label-width="100px"> label-width="100px">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="名称" prop="name"> <el-form-item label="物品名称" prop="name">
<el-input <el-input
v-model="dataForm.name" v-model="dataForm.name"
clearable clearable
placeholder="请输入名称" /> placeholder="请输入物品名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="编码" prop="code"> <el-form-item label="物品编码" prop="code">
<el-input <el-input
v-model="dataForm.code" v-model="dataForm.code"
clearable clearable
placeholder="请输入编码" /> placeholder="请输入物品编码" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="规格" prop="spec"> <el-form-item label="物品规格" prop="spec">
<el-input <el-input
v-model="dataForm.spec" v-model="dataForm.spec"
clearable clearable
placeholder="请输入规格" /> placeholder="请输入物品规格" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="单位" prop="unit"> <el-form-item label="物品单位" prop="unit">
<el-select <el-select
v-model="dataForm.unit" v-model="dataForm.unit"
filterable filterable
@ -57,6 +57,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="单日消耗量" prop="dailyUse"> <el-form-item label="单日消耗量" prop="dailyUse">
<el-input-number <el-input-number
:min="0"
v-model="dataForm.dailyUse" v-model="dataForm.dailyUse"
clearable clearable
placeholder="请输入单日消耗量" /> placeholder="请输入单日消耗量" />
@ -65,9 +66,10 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="允许留存时间" prop="allowTime"> <el-form-item label="允许留存时间" prop="allowTime">
<el-input-number <el-input-number
:min="0"
v-model="dataForm.allowTime" v-model="dataForm.allowTime"
clearable clearable
placeholder="请输入允许留存时间" /> placeholder="请输入允许留存时间" /> ()
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -134,10 +136,10 @@ export default {
}, },
dataRule: { dataRule: {
code: [ code: [
{ required: true, message: '库位编码不能为空', trigger: 'blur' }, { required: true, message: '物品编码不能为空', trigger: 'blur' },
], ],
name: [ name: [
{ required: true, message: '库位名称不能为空', trigger: 'blur' }, { required: true, message: '物品名称不能为空', trigger: 'blur' },
], ],
}, },
isorno: [ isorno: [

View File

@ -57,19 +57,19 @@ import { publicFormatter } from '@/utils/dict';
const tableProps = [ const tableProps = [
{ {
prop: 'name', prop: 'name',
label: '名称', label: '物品名称',
}, },
{ {
prop: 'code', prop: 'code',
label: '编码', label: '物品编码',
}, },
{ {
prop: 'spec', prop: 'spec',
label: '规格', label: '物品规格',
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '物品单位',
filter: publicFormatter('unit_dict') filter: publicFormatter('unit_dict')
}, },
{ {
@ -121,8 +121,8 @@ export default {
formConfig: [ formConfig: [
{ {
type: 'input', type: 'input',
label: '名称', label: '物品名称',
placeholder: '名称', placeholder: '物品名称',
param: 'name', param: 'name',
}, },
{ {

View File

@ -2,7 +2,6 @@
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:isFold="true"
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" /> @headBtnClick="buttonClick" />

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 13:52:10 * @Date: 2023-08-01 13:52:10
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-11-04 14:17:39 * @LastEditTime: 2023-11-20 15:13:37
* @Description: * @Description:
--> -->
<template> <template>
@ -68,7 +68,6 @@
v-model="dataForm.goodsBatch" v-model="dataForm.goodsBatch"
filterable filterable
clearable clearable
@change="setBatchInfo"
placeholder="请选择物品名称"> placeholder="请选择物品名称">
<el-option <el-option
v-for="(item, index) in Batch" v-for="(item, index) in Batch"
@ -79,13 +78,12 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="入库数量" prop="numDet"> <el-form-item :label="dataForm.id?'出库数量':'入库数量'" prop="numDet">
<el-input-number <el-input-number
v-model="dataForm.numDet" v-model="dataForm.numDet"
clearable clearable
:min="0" :min="0"
:max="max?max:9999999" placeholder="请输入数量" />
placeholder="请输入入库数量" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -130,7 +128,6 @@ export default {
}, },
goodsArr: [], goodsArr: [],
Batch: [], Batch: [],
max: 0,
dataRule: { dataRule: {
goodsId: [ goodsId: [
{ required: true, message: '物品名称不能为空', trigger: 'change' }, { required: true, message: '物品名称不能为空', trigger: 'change' },
@ -143,7 +140,7 @@ export default {
}, },
], ],
numDet: [ numDet: [
{ required: true, message: '入库数量不能为空', trigger: 'blur' }, { required: true, message: '数量不能为空', trigger: 'blur' },
], ],
}, },
}; };
@ -172,13 +169,6 @@ export default {
} }
}); });
}, },
setBatchInfo(){
this.Batch.forEach((item) => {
if (item.goodsBatch === this.dataForm.goodsBatch) {
this.max = item.numDet
}
});
},
outWare(data) { outWare(data) {
this.getArr(); this.getArr();
this.visible = true; this.visible = true;

View File

@ -29,6 +29,7 @@
<el-option <el-option
v-for="item in productArr" v-for="item in productArr"
:key="item.id" :key="item.id"
:disabled="!item.enabled"
:label="item.name" :label="item.name"
:value="item" /> :value="item" />
</el-select> </el-select>

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 13:52:10 * @Date: 2023-08-01 13:52:10
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-11-17 09:51:29 * @LastEditTime: 2023-11-20 15:54:59
* @Description: * @Description:
--> -->
<template> <template>
@ -15,31 +15,31 @@
label-width="100px"> label-width="100px">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="名称" prop="name"> <el-form-item label="物品名称" prop="name">
<el-input <el-input
v-model="dataForm.name" v-model="dataForm.name"
clearable clearable
placeholder="请输入名称" /> placeholder="请输入物品名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="编码" prop="code"> <el-form-item label="物品编码" prop="code">
<el-input <el-input
v-model="dataForm.code" v-model="dataForm.code"
clearable clearable
placeholder="请输入编码" /> placeholder="请输入物品编码" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="规格" prop="spec"> <el-form-item label="物品规格" prop="spec">
<el-input <el-input
v-model="dataForm.spec" v-model="dataForm.spec"
clearable clearable
placeholder="请输入规格" /> placeholder="请输入物品规格" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="单位" prop="unit"> <el-form-item label="物品单位" prop="unit">
<el-select <el-select
v-model="dataForm.unit" v-model="dataForm.unit"
filterable filterable
@ -57,6 +57,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="单日消耗量" prop="dailyUse"> <el-form-item label="单日消耗量" prop="dailyUse">
<el-input-number <el-input-number
:min="0"
v-model="dataForm.dailyUse" v-model="dataForm.dailyUse"
clearable clearable
placeholder="请输入单日消耗量" /> placeholder="请输入单日消耗量" />
@ -65,9 +66,10 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="允许留存时间" prop="allowTime"> <el-form-item label="允许留存时间" prop="allowTime">
<el-input-number <el-input-number
:min="0"
v-model="dataForm.allowTime" v-model="dataForm.allowTime"
clearable clearable
placeholder="请输入允许留存时间" /> placeholder="请输入允许留存时间" /> ()
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -134,10 +136,10 @@ export default {
}, },
dataRule: { dataRule: {
code: [ code: [
{ required: true, message: '库位编码不能为空', trigger: 'blur' }, { required: true, message: '物品编码不能为空', trigger: 'blur' },
], ],
name: [ name: [
{ required: true, message: '库位名称不能为空', trigger: 'blur' }, { required: true, message: '物品名称不能为空', trigger: 'blur' },
], ],
}, },
isorno: [ isorno: [

View File

@ -57,19 +57,19 @@ import { publicFormatter } from '@/utils/dict';
const tableProps = [ const tableProps = [
{ {
prop: 'name', prop: 'name',
label: '名称', label: '物品名称',
}, },
{ {
prop: 'code', prop: 'code',
label: '编码', label: '物品编码',
}, },
{ {
prop: 'spec', prop: 'spec',
label: '规格', label: '物品规格',
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '物品单位',
filter: publicFormatter('unit_dict') filter: publicFormatter('unit_dict')
}, },
{ {
@ -121,8 +121,8 @@ export default {
formConfig: [ formConfig: [
{ {
type: 'input', type: 'input',
label: '名称', label: '物品名称',
placeholder: '名称', placeholder: '物品名称',
param: 'name', param: 'name',
}, },
{ {

View File

@ -2,7 +2,6 @@
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:isFold="true"
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" /> @headBtnClick="buttonClick" />

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 13:52:10 * @Date: 2023-08-01 13:52:10
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:24:26 * @LastEditTime: 2023-11-20 15:12:43
* @Description: * @Description:
--> -->
<template> <template>
@ -68,7 +68,6 @@
v-model="dataForm.goodsBatch" v-model="dataForm.goodsBatch"
filterable filterable
clearable clearable
@change="setBatchInfo"
placeholder="请选择物品名称"> placeholder="请选择物品名称">
<el-option <el-option
v-for="(item, index) in Batch" v-for="(item, index) in Batch"
@ -79,13 +78,12 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="入库数量" prop="numDet"> <el-form-item :label="dataForm.id?'出库数量':'入库数量'" prop="numDet">
<el-input-number <el-input-number
v-model="dataForm.numDet" v-model="dataForm.numDet"
clearable clearable
:min="0" :min="0"
:max="max?max:9999999" placeholder="请输入数量" />
placeholder="请输入入库数量" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -130,7 +128,6 @@ export default {
}, },
goodsArr: [], goodsArr: [],
Batch: [], Batch: [],
max: 0,
dataRule: { dataRule: {
goodsId: [ goodsId: [
{ required: true, message: '物品名称不能为空', trigger: 'change' }, { required: true, message: '物品名称不能为空', trigger: 'change' },
@ -143,7 +140,7 @@ export default {
}, },
], ],
numDet: [ numDet: [
{ required: true, message: '入库数量不能为空', trigger: 'blur' }, { required: true, message: '数量不能为空', trigger: 'blur' },
], ],
}, },
}; };
@ -172,13 +169,6 @@ export default {
} }
}); });
}, },
setBatchInfo(){
this.Batch.forEach((item) => {
if (item.goodsBatch === this.dataForm.goodsBatch) {
this.max = item.numDet
}
});
},
outWare(data) { outWare(data) {
this.getArr(); this.getArr();
this.visible = true; this.visible = true;

View File

@ -29,6 +29,7 @@
<el-option <el-option
v-for="item in productArr" v-for="item in productArr"
:key="item.id" :key="item.id"
:disabled="!item.enabled"
:label="item.name" :label="item.name"
:value="item" /> :value="item" />
</el-select> </el-select>

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 13:52:10 * @Date: 2023-08-01 13:52:10
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-11-17 09:50:55 * @LastEditTime: 2023-11-20 15:54:15
* @Description: * @Description:
--> -->
<template> <template>
@ -15,31 +15,31 @@
label-width="100px"> label-width="100px">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="名称" prop="name"> <el-form-item label="物品名称" prop="name">
<el-input <el-input
v-model="dataForm.name" v-model="dataForm.name"
clearable clearable
placeholder="请输入名称" /> placeholder="请输入物品名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="编码" prop="code"> <el-form-item label="物品编码" prop="code">
<el-input <el-input
v-model="dataForm.code" v-model="dataForm.code"
clearable clearable
placeholder="请输入编码" /> placeholder="请输入物品编码" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="规格" prop="spec"> <el-form-item label="物品规格" prop="spec">
<el-input <el-input
v-model="dataForm.spec" v-model="dataForm.spec"
clearable clearable
placeholder="请输入规格" /> placeholder="请输入物品规格" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="单位" prop="unit"> <el-form-item label="物品单位" prop="unit">
<el-select <el-select
v-model="dataForm.unit" v-model="dataForm.unit"
filterable filterable
@ -57,6 +57,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="单日消耗量" prop="dailyUse"> <el-form-item label="单日消耗量" prop="dailyUse">
<el-input-number <el-input-number
:min="0"
v-model="dataForm.dailyUse" v-model="dataForm.dailyUse"
clearable clearable
placeholder="请输入单日消耗量" /> placeholder="请输入单日消耗量" />
@ -65,9 +66,10 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="允许留存时间" prop="allowTime"> <el-form-item label="允许留存时间" prop="allowTime">
<el-input-number <el-input-number
:min="0"
v-model="dataForm.allowTime" v-model="dataForm.allowTime"
clearable clearable
placeholder="请输入允许留存时间" /> placeholder="请输入允许留存时间" /> ()
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -134,10 +136,10 @@ export default {
}, },
dataRule: { dataRule: {
code: [ code: [
{ required: true, message: '库位编码不能为空', trigger: 'blur' }, { required: true, message: '物品编码不能为空', trigger: 'blur' },
], ],
name: [ name: [
{ required: true, message: '库位名称不能为空', trigger: 'blur' }, { required: true, message: '物品名称不能为空', trigger: 'blur' },
], ],
}, },
isorno: [ isorno: [

View File

@ -57,19 +57,19 @@ import { publicFormatter } from '@/utils/dict';
const tableProps = [ const tableProps = [
{ {
prop: 'name', prop: 'name',
label: '名称', label: '物品名称',
}, },
{ {
prop: 'code', prop: 'code',
label: '编码', label: '物品编码',
}, },
{ {
prop: 'spec', prop: 'spec',
label: '规格', label: '物品规格',
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '物品单位',
filter: publicFormatter('unit_dict') filter: publicFormatter('unit_dict')
}, },
{ {
@ -121,8 +121,8 @@ export default {
formConfig: [ formConfig: [
{ {
type: 'input', type: 'input',
label: '名称', label: '物品名称',
placeholder: '名称', placeholder: '物品名称',
param: 'name', param: 'name',
}, },
{ {

View File

@ -2,7 +2,6 @@
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:isFold="true"
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" /> @headBtnClick="buttonClick" />

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 13:52:10 * @Date: 2023-08-01 13:52:10
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-11-04 14:17:39 * @LastEditTime: 2023-11-20 15:12:13
* @Description: * @Description:
--> -->
<template> <template>
@ -68,7 +68,6 @@
v-model="dataForm.goodsBatch" v-model="dataForm.goodsBatch"
filterable filterable
clearable clearable
@change="setBatchInfo"
placeholder="请选择物品名称"> placeholder="请选择物品名称">
<el-option <el-option
v-for="(item, index) in Batch" v-for="(item, index) in Batch"
@ -79,13 +78,13 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="入库数量" prop="numDet"> <el-form-item :label="dataForm.id?'出库数量':'入库数量'" prop="numDet">
<el-input-number <el-input-number
v-model="dataForm.numDet" v-model="dataForm.numDet"
clearable clearable
:min="0" :min="0"
:max="max?max:9999999" placeholder="请输入数量" />
placeholder="请输入入库数量" /> <!-- :max="max?max:9999999" -->
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -130,7 +129,7 @@ export default {
}, },
goodsArr: [], goodsArr: [],
Batch: [], Batch: [],
max: 0, //max: 0,
dataRule: { dataRule: {
goodsId: [ goodsId: [
{ required: true, message: '物品名称不能为空', trigger: 'change' }, { required: true, message: '物品名称不能为空', trigger: 'change' },
@ -143,7 +142,7 @@ export default {
}, },
], ],
numDet: [ numDet: [
{ required: true, message: '入库数量不能为空', trigger: 'blur' }, { required: true, message: '数量不能为空', trigger: 'blur' },
], ],
}, },
}; };
@ -172,13 +171,13 @@ export default {
} }
}); });
}, },
setBatchInfo(){ // setBatchInfo(){
this.Batch.forEach((item) => { // this.Batch.forEach((item) => {
if (item.goodsBatch === this.dataForm.goodsBatch) { // if (item.goodsBatch === this.dataForm.goodsBatch) {
this.max = item.numDet // this.max = item.numDet
} // }
}); // });
}, // },
outWare(data) { outWare(data) {
this.getArr(); this.getArr();
this.visible = true; this.visible = true;

View File

@ -29,6 +29,7 @@
<el-option <el-option
v-for="item in productArr" v-for="item in productArr"
:key="item.id" :key="item.id"
:disabled="!item.enabled"
:label="item.name" :label="item.name"
:value="item" /> :value="item" />
</el-select> </el-select>

View File

@ -18,7 +18,7 @@
@click.native="setWareInfo(item)" @click.native="setWareInfo(item)"
:style="{ :style="{
background: item.id === wareInfo.warehouseId ? '#37D97F' : '', background: item.id === wareInfo.warehouseId ? '#37D97F' : '',
color: item.id === wareInfo.warehouseId ? 'white' : '' color: item.id === wareInfo.warehouseId ? 'white' : '',
}" }"
class="ware-card"> class="ware-card">
{{ item.name }} {{ item.name }}
@ -263,7 +263,7 @@ export default {
this.dataListLoading = true; this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then((response) => { this.urlOptions.getDataListURL(this.listQuery).then((response) => {
this.tableData = response.data.list; this.tableData = response.data.list;
this.total = response.data.total; this.listQuery.total = response.data.total;
this.dataListLoading = false; this.dataListLoading = false;
}); });
}, },