projects/mesxc-lb #176
5
.env.dev
5
.env.dev
@ -13,15 +13,16 @@ VUE_APP_TITLE = MES系统
|
||||
|
||||
# 芋道管理系统/开发环境
|
||||
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
|
||||
VUE_APP_BASE_API = 'http://10.70.2.2:8080'
|
||||
# VUE_APP_BASE_API = 'http://10.70.2.2:8080'
|
||||
# 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:48082'
|
||||
# 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.104:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.62:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.78:48082'
|
||||
VUE_APP_BASE_API = 'http://192.168.1.78:48082'
|
||||
|
||||
# 积木报表指向地址
|
||||
VUE_APP_JIMU_API = 'http://10.70.2.22:8080'
|
||||
|
@ -62,7 +62,7 @@ export default {
|
||||
url,
|
||||
method,
|
||||
params: (method === 'get' || method === 'delete') ? payload : null,
|
||||
data: method !== 'get' ? payload : null,
|
||||
data: (method === 'get' || method === 'delete') ? null : payload
|
||||
})
|
||||
},
|
||||
put(payload) {
|
||||
|
270
src/views/base/coreEquipmentLineBind/dialogForm.vue
Normal file
270
src/views/base/coreEquipmentLineBind/dialogForm.vue
Normal file
@ -0,0 +1,270 @@
|
||||
<!--
|
||||
filename: dialogForm.vue
|
||||
author: liubin
|
||||
date: 2023-09-11 15:55:13
|
||||
description: DialogForm for equipmentBindSection only
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="dataForm"
|
||||
label-width="128px"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="产线"
|
||||
prop="productionLineId"
|
||||
:rules="[
|
||||
{ required: true, message: '产线不能为空', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="dataForm.productionLineId"
|
||||
placeholder="请选择产线"
|
||||
filterable
|
||||
clearable
|
||||
@change="handleProductlineChange">
|
||||
<el-option
|
||||
v-for="opt in productionLineList"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="工段"
|
||||
prop="workshopSectionId"
|
||||
:rules="[
|
||||
{ required: true, message: '工段不能为空', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="dataForm.workshopSectionId"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择工段"
|
||||
@change="$emit('update', dataForm)">
|
||||
<el-option
|
||||
v-for="opt in worksectionList"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="设备"
|
||||
prop="equipmentId"
|
||||
clearable
|
||||
filterable
|
||||
:rules="[
|
||||
{ required: true, message: '设备不能为空', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="dataForm.equipmentId"
|
||||
filterable
|
||||
placeholder="请选择设备"
|
||||
@change="$emit('update', dataForm)">
|
||||
<el-option
|
||||
v-for="opt in equipmentList"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="工段排序"
|
||||
prop="sort"
|
||||
:rules="[
|
||||
{
|
||||
type: 'number',
|
||||
trigger: 'change',
|
||||
message: '请输入正确的数字类型',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
]">
|
||||
<el-input
|
||||
v-model="dataForm.sort"
|
||||
clearable
|
||||
@change="$emit('update', dataForm)"
|
||||
placeholder="请输入工段排序" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="产线统计类型"
|
||||
prop="lineDataType"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '产线统计类型不能为空',
|
||||
trigger: 'change',
|
||||
},
|
||||
]">
|
||||
<el-select
|
||||
v-model="dataForm.lineDataType"
|
||||
placeholder="请选择产线统计类型"
|
||||
clearable
|
||||
filterable
|
||||
@change="$emit('update', dataForm)">
|
||||
<el-option
|
||||
v-for="opt in [
|
||||
{ label: '无类型', value: 0 },
|
||||
{ label: '进口统计', value: 1 },
|
||||
{ label: '出口统计', value: 2 },
|
||||
]"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="工段统计类型"
|
||||
prop="sectionDataType"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '工段统计类型不能为空',
|
||||
trigger: 'change',
|
||||
},
|
||||
]">
|
||||
<el-select
|
||||
v-model="dataForm.sectionDataType"
|
||||
placeholder="请选择工段统计类型"
|
||||
clearable
|
||||
filterable
|
||||
@change="$emit('update', dataForm)">
|
||||
<el-option
|
||||
v-for="opt in [
|
||||
{ label: '无类型', value: 0 },
|
||||
{ label: '进口统计', value: 1 },
|
||||
{ label: '出口统计', value: 2 },
|
||||
]"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DialogForm',
|
||||
model: {
|
||||
prop: 'dataForm',
|
||||
event: 'update',
|
||||
},
|
||||
emits: ['update'],
|
||||
components: {},
|
||||
props: {
|
||||
dataForm: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formLoading: true,
|
||||
productionLineList: [],
|
||||
equipmentList: [],
|
||||
worksectionList: [],
|
||||
dataFormCache: null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
debugger;
|
||||
console.log('[mounted] form:', this.dataForm);
|
||||
},
|
||||
mounted() {
|
||||
Promise.all([this.getProductLineList(), this.getEquipmentList()]).then(
|
||||
() => {
|
||||
this.formLoading = false;
|
||||
}
|
||||
);
|
||||
},
|
||||
watch: {
|
||||
'dataForm.productionLineId': {
|
||||
handler: async function (plId) {
|
||||
if (plId) await this.getWorksectionList(plId);
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
/** 模拟透传 ref */
|
||||
validate(cb) {
|
||||
return this.$refs.form.validate(cb);
|
||||
},
|
||||
resetFields(args) {
|
||||
return this.$refs.form.resetFields(args);
|
||||
},
|
||||
async handleProductlineChange(id) {
|
||||
await this.getWorksectionList(id);
|
||||
this.dataForm.workshopSectionId = null;
|
||||
this.$emit('update', this.dataForm);
|
||||
},
|
||||
// getCode
|
||||
async getCode(url) {
|
||||
const response = await this.$axios(url);
|
||||
return response.data;
|
||||
},
|
||||
// 获取产线列表
|
||||
async getProductLineList() {
|
||||
const response = await this.$axios('/base/core-production-line/listAll');
|
||||
this.productionLineList = response.data.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
// 获取设备列表
|
||||
async getEquipmentList() {
|
||||
const response = await this.$axios(
|
||||
// '/base/core-equipment/page?pageNo=1&pageSize=100'
|
||||
'/base/core-equipment/listAll'
|
||||
);
|
||||
this.equipmentList = response.data.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
// 获取工段列表
|
||||
async getWorksectionList(plId) {
|
||||
const response = await this.$axios(
|
||||
'/base/core-workshop-section/listByParentId',
|
||||
{
|
||||
params: {
|
||||
id: plId,
|
||||
},
|
||||
}
|
||||
);
|
||||
this.worksectionList = response.data.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.el-date-editor,
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
@ -50,12 +50,13 @@
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import DialogForm from './dialogForm.vue';
|
||||
|
||||
// import { getAccessToken } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'EquipmentLineBind',
|
||||
components: {},
|
||||
components: { DialogForm },
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
@ -149,7 +150,9 @@ export default {
|
||||
select: true,
|
||||
label: '产线',
|
||||
prop: 'productionLineId',
|
||||
rules: [{ required: true, message: '产线名不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '产线名不能为空', trigger: 'blur' },
|
||||
],
|
||||
url: '/base/core-production-line/listAll',
|
||||
bind: { clearable: true, filterable: true },
|
||||
// watch: 'workshopSectionId'
|
||||
@ -159,7 +162,9 @@ export default {
|
||||
label: '工段',
|
||||
prop: 'workshopSectionId',
|
||||
depends: 'productionLineId',
|
||||
rules: [{ required: true, message: '工段不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '工段不能为空', trigger: 'blur' },
|
||||
],
|
||||
bind: { clearable: true, filterable: true },
|
||||
url: '/base/core-workshop-section/listByParentId',
|
||||
},
|
||||
@ -169,7 +174,9 @@ export default {
|
||||
select: true,
|
||||
label: '设备',
|
||||
prop: 'equipmentId',
|
||||
rules: [{ required: true, message: '设备名不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '设备名不能为空', trigger: 'blur' },
|
||||
],
|
||||
bind: { clearable: true, filterable: true },
|
||||
url: '/base/core-equipment/listAll',
|
||||
},
|
||||
@ -190,9 +197,16 @@ export default {
|
||||
label: '产线统计类型',
|
||||
prop: 'lineDataType',
|
||||
bind: {
|
||||
clearable: true, filterable: true
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
},
|
||||
rules: [{ required: true, message: '产线统计类型不能为空', trigger: 'change' }],
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '产线统计类型不能为空',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
select: true,
|
||||
@ -204,9 +218,16 @@ export default {
|
||||
label: '工段统计类型',
|
||||
prop: 'sectionDataType',
|
||||
bind: {
|
||||
clearable: true, filterable: true
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
},
|
||||
rules: [{ required: true, message: '工段统计类型不能为空', trigger: 'change' }],
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '工段统计类型不能为空',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
],
|
||||
@ -335,15 +356,21 @@ export default {
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除绑定"' + row.name + '"?')
|
||||
.then(function () {
|
||||
return deleteEquipmentType(id);
|
||||
.confirm(
|
||||
'是否确认删除绑定"' +
|
||||
(row.equipmentName == null ? '这条记录' : row.equipmentName) +
|
||||
'"?'
|
||||
)
|
||||
.then(() => {
|
||||
return this.del({ id });
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
|
@ -16,7 +16,9 @@
|
||||
<el-form-item
|
||||
label="产线"
|
||||
prop="productionLineId"
|
||||
:rules="[{ required: true, message: '产线不能为空', trigger: 'blur' }]">
|
||||
:rules="[
|
||||
{ required: true, message: '产线不能为空', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="dataForm.productionLineId"
|
||||
placeholder="请选择产线"
|
||||
@ -35,7 +37,9 @@
|
||||
<el-form-item
|
||||
label="工段"
|
||||
prop="workshopSectionId"
|
||||
:rules="[{ required: true, message: '工段不能为空', trigger: 'blur' }]">
|
||||
:rules="[
|
||||
{ required: true, message: '工段不能为空', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="dataForm.workshopSectionId"
|
||||
filterable
|
||||
@ -55,7 +59,9 @@
|
||||
<el-form-item
|
||||
label="设备"
|
||||
prop="equipmentId"
|
||||
:rules="[{ required: true, message: '设备不能为空', trigger: 'blur' }]">
|
||||
:rules="[
|
||||
{ required: true, message: '设备不能为空', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="dataForm.equipmentId"
|
||||
filterable
|
||||
@ -147,6 +153,10 @@ export default {
|
||||
dataFormCache: null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
debugger;
|
||||
console.log('[mounted] form:', this.dataForm);
|
||||
},
|
||||
mounted() {
|
||||
Promise.all([this.getProductLineList(), this.getEquipmentList()]).then(
|
||||
() => {
|
||||
|
Loading…
Reference in New Issue
Block a user