projects/mesxc-zhp #161

Closed
zhp wants to merge 119 commits from projects/mesxc-zhp into projects/mes-test
36 changed files with 823 additions and 295 deletions
Showing only changes of commit bc2940ca99 - Show all commits

View File

@ -12,12 +12,12 @@ ENV = 'development'
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://100.64.0.26: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: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.1.56: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'">
<el-skeleton v-if="!showForm" animated />
<BaseInfoForm
<!-- <BaseInfoForm
key="drawer-dialog-form"
v-if="showForm"
ref="form"
:disabled="mode.includes('detail')"
: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 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
v-loading="attrListLoading"
:table-props="section.props"
:page="attrQuery?.params.pageNo || 1"
:limit="attrQuery?.params.pageSize || 10"
:table-data="list"
:add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr"
@emitFun="handleEmitFun">
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr" -->
<method-btn
v-if="section.tableBtn"
slot="handleBtn"
@ -74,14 +105,7 @@
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
编辑
</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> -->
<!-- <el-button v-else type="primary" @click="handleCancel">确定</el-button> -->
</div>
</div>
@ -226,7 +250,7 @@ export default {
bind: {
//
// disabled: this.mode == 'detail',
disabled: true
disabled: true,
},
};
});

View File

@ -31,25 +31,56 @@
<div class="form-part" v-if="section.key == 'base'">
<el-skeleton v-if="!showForm" animated />
<BaseInfoForm
<!-- <BaseInfoForm
key="drawer-dialog-form"
v-if="showForm"
ref="form"
:disabled="true"
: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 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
v-loading="attrListLoading"
:table-props="section.props"
:page="attrQuery?.params.pageNo || 1"
:limit="attrQuery?.params.pageSize || 10"
:table-data="list"
:add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr"
@emitFun="handleEmitFun">
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr" -->
<method-btn
v-if="section.tableBtn"
slot="handleBtn"
@ -74,14 +105,7 @@
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
编辑
</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> -->
<!-- <el-button v-else type="primary" @click="handleCancel">确定</el-button> -->
</div>
</div>

View File

@ -31,25 +31,58 @@
<div class="form-part" v-if="section.key == 'base'">
<el-skeleton v-if="!showForm" animated />
<BaseInfoForm
<!-- <BaseInfoForm
key="drawer-dialog-form"
v-if="showForm"
ref="form"
:disabled="mode.includes('detail')"
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 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
v-loading="attrListLoading"
:table-props="section.props"
:page="attrQuery?.params.pageNo || 1"
:limit="attrQuery?.params.pageSize || 10"
:table-data="list"
:add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr"
@emitFun="handleEmitFun">
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr" -->
<method-btn
v-if="section.tableBtn"
slot="handleBtn"
@ -74,14 +107,7 @@
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
编辑
</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> -->
<!-- <el-button v-else type="primary" @click="handleCancel">确定</el-button> -->
</div>
</div>
@ -199,23 +225,22 @@ export default {
label: '设备参数类型',
prop: 'equipment_param_type',
options: [
{ label: '一般参数', value: 1 },
{ label: '工艺参数', value: 2 },
{ label: '报警参数', value: 3 },
],
{ label: '一般参数', value: 1 },
{ label: '工艺参数', value: 2 },
{ label: '报警参数', value: 3 },
],
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
},
{
select: true,
select: true,
label: '生产参数类型',
prop: 'production_param_type',
prop: 'production_param_type',
options: [
{ label: '进片数量', value: 1 },
{ label: '出片数量', value: 2 },
{ label: '破损数量', value: 3 },
{ label: '无类型', value: 4 },
],
{ label: '进片数量', value: 1 },
{ label: '出片数量', value: 2 },
{ label: '破损数量', value: 3 },
{ label: '无类型', value: 4 },
],
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
},
],

View File

@ -42,7 +42,7 @@
v-if="open"
ref="form"
v-model="form"
:disabled="mode == 'detail'"
:disabled="mode == 'detail'"
:has-files="true"
:rows="rows" />
</base-dialog>
@ -53,7 +53,7 @@
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
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');
@ -64,7 +64,6 @@ export default {
data() {
return {
searchBarKeys: [
'maintainPlanId',
'maintainPlanId',
'startTime',
'relatePlan',
@ -190,7 +189,6 @@ export default {
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
},
{
// TODO:
select: true,
label: '保养人员',
prop: 'maintainWorker',
@ -222,11 +220,10 @@ export default {
},
{},
{
// TODO:
select: true,
label: '所属计划',
prop: 'maintainPlanId',
url: '',
url: '/base/equipment-maintain-plan/page',
bind: {
filterable: true,
clearable: true,
@ -273,9 +270,16 @@ export default {
},
],
// TODO:
[{ label: '保养描述', prop: 'maintenanceDes', subcomponent: Editor, bind: {
'min-height': 192
} }],
[
{
label: '保养描述',
prop: 'maintenanceDes',
subcomponent: Editor,
bind: {
'min-height': 192,
},
},
],
[{ input: true, label: '备注', prop: 'remark' }],
],
//
@ -293,20 +297,26 @@ export default {
//
form: {},
basePath: '/base/equipment-maintain-log',
mode: null
mode: null,
};
},
created() {
this.initSearchBar();
if (this.$route.query) {
this.queryParams.equipmentId = this.$route.query?.equipmentId ?? undefined
this.queryParams.maintainPlanId = this.$route.query?.maintainPlanId ?? undefined
this.queryParams.relatePlan = this.$route.query?.relatePlan ?? undefined
this.queryParams.startTime = this.$route.query?.createTime ?? undefined
this.searchBarFormConfig[0].defaultSelect = 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.queryParams.equipmentId =
this.$route.query?.equipmentId ?? undefined;
this.queryParams.maintainPlanId =
this.$route.query?.maintainPlanId ?? undefined;
this.queryParams.relatePlan = this.$route.query?.relatePlan ?? undefined;
this.queryParams.startTime = this.$route.query?.createTime ?? undefined;
this.searchBarFormConfig[0].defaultSelect =
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();
},
@ -349,7 +359,7 @@ export default {
/** 取消按钮 */
cancel() {
this.open = false;
this.mode = null;
this.mode = null;
this.reset();
},
/** 表单重置 */
@ -399,7 +409,7 @@ export default {
this.info({ id }).then((response) => {
this.form = response.data;
this.open = true;
this.form.maintainWorker = this.form.maintainWorker.split(',')
this.form.maintainWorker = this.form.maintainWorker.split(',');
this.title = '修改保养记录';
});
},
@ -409,7 +419,7 @@ export default {
if (!valid) {
return;
}
this.form.maintainWorker = this.form.maintainWorker.join(',')
this.form.maintainWorker = this.form.maintainWorker.join(',');
//
if (this.form.id != null) {
this.put(this.form).then((response) => {
@ -431,7 +441,9 @@ export default {
handleDelete(row) {
const id = row.id;
this.$modal
.confirm('是否删除设备保养单号为"' + row.maintainOrderNumber + '"的数据项?')
.confirm(
'是否删除设备保养单号为"' + row.maintainOrderNumber + '"的数据项?'
)
.then(function () {
return deleteEqMaintainLog(id);
})
@ -443,7 +455,7 @@ export default {
},
handleDetail({ id }) {
this.reset();
this.mode = 'detail'
this.mode = 'detail';
this.info({ id }).then((response) => {
this.form = response.data;
this.open = true;

View File

@ -19,6 +19,7 @@
ref="form"
:model="dataForm"
label-width="100px"
label-position="top"
v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="8">
@ -213,7 +214,7 @@ export default {
this.visible = false;
},
goEdit() {
this.isdetail = false;
this.disabled = false;
},
/** 模拟透传 ref */
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"
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>
@ -63,22 +66,27 @@
<base-dialog
dialogTitle="选择设备"
:dialogVisible="open"
width="45%"
@close="cancel"
@cancel="cancel"
@confirm="submitForm">
<el-transfer v-model="choosedEquipments" :data="eqList">
<!-- <span slot-scope="{ option }">
{{ option.key }} - {{ option.label }}
</span> -->
</el-transfer>
<!-- <CustomTransfer /> -->
<BomSelector
ref="bomSelector"
v-if="open"
:bom-list="bomList"
:value="selectedBoms"
@update="selectedBoms = $event" />
</base-dialog>
</section>
</template>
<script>
import BomSelector from './BomSelector.vue';
export default {
name: 'ProcessBom',
components: {},
components: { BomSelector },
props: {
currentDet: {
type: Object,
@ -89,11 +97,12 @@ export default {
return {
open: false,
eqList: [],
bomList: [],
finalList: [],
choosedEquipments: [],
searchBarFormConfig: [{ label: '工序下设备' }],
tableProps: [
{ prop: 'equipmentId', label: '设备名称' },
{ prop: 'equName', label: '设备名称' },
{ prop: 'materialName', label: '物料BOM' },
{ prop: 'valueName', label: '参数BOM' },
],
@ -103,13 +112,17 @@ export default {
queryParams: {
pageNo: 1,
pageSize: 10,
equipmentName: '',
},
searchText: ''
searchText: '',
selectedBoms: [],
timer: null,
};
},
watch: {
currentDet: {
handler(val) {
console.log('currentDet', val);
if (val != null) {
this.getList(val);
} else {
@ -121,51 +134,21 @@ export default {
},
},
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() {},
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);
},
@ -186,8 +169,41 @@ export default {
data: method !== 'get' ? payload : null,
});
},
submitForm() {},
async getList({ detId, detName, detDesc, flowId, sectionName } = {}) {
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('操作失败');
}
} else {
this.$message.info('请选择设备');
}
});
},
async getList({
detId,
detName,
detDesc,
flowId,
sectionName,
sectionId,
} = {}) {
console.log('get list', detId, detName, flowId);
const { data, code } = await this.http(
'/extend/process-flow-det-equipment/page',
@ -201,10 +217,38 @@ export default {
this.list.splice(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() {
this.open = true;
await this.getEqList();
},
cancel() {
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
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-11-17 09:52:17
* @LastEditTime: 2023-11-20 15:54:28
* @Description:
-->
<template>
@ -15,31 +15,31 @@
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="名称" prop="name">
<el-form-item label="物品名称" prop="name">
<el-input
v-model="dataForm.name"
clearable
placeholder="请输入名称" />
placeholder="请输入物品名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="编码" prop="code">
<el-form-item label="物品编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
placeholder="请输入编码" />
placeholder="请输入物品编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格" prop="spec">
<el-form-item label="物品规格" prop="spec">
<el-input
v-model="dataForm.spec"
clearable
placeholder="请输入规格" />
placeholder="请输入物品规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-form-item label="物品单位" prop="unit">
<el-select
v-model="dataForm.unit"
filterable
@ -57,6 +57,7 @@
<el-col :span="12">
<el-form-item label="单日消耗量" prop="dailyUse">
<el-input-number
:min="0"
v-model="dataForm.dailyUse"
clearable
placeholder="请输入单日消耗量" />
@ -65,9 +66,10 @@
<el-col :span="12">
<el-form-item label="允许留存时间" prop="allowTime">
<el-input-number
:min="0"
v-model="dataForm.allowTime"
clearable
placeholder="请输入允许留存时间" />
placeholder="请输入允许留存时间" /> ()
</el-form-item>
</el-col>
<el-col :span="12">
@ -134,10 +136,10 @@ export default {
},
dataRule: {
code: [
{ required: true, message: '库位编码不能为空', trigger: 'blur' },
{ required: true, message: '物品编码不能为空', trigger: 'blur' },
],
name: [
{ required: true, message: '库位名称不能为空', trigger: 'blur' },
{ required: true, message: '物品名称不能为空', trigger: 'blur' },
],
},
isorno: [

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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