Compare commits

...

4 Commits

Author SHA1 Message Date
1026a849f1 Merge pull request 'projects/mesxc-lb' (#176) from projects/mesxc-lb into projects/mesxc-test
Reviewed-on: #176
2024-01-11 09:26:14 +08:00
lb
5d157505aa update 2024-01-11 09:05:31 +08:00
lb
44b45a6a04 merge test 2024-01-11 09:02:56 +08:00
lb
593c9f7d60 bugfix 240110qun 2024-01-10 11:27:04 +08:00
5 changed files with 318 additions and 16 deletions

View File

@ -21,7 +21,10 @@ VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.1.8: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.4.159:48080'
# VUE_APP_BASE_API = 'http://192.168.1.104:48082' # 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.62:48082'
# VUE_APP_BASE_API = 'http://192.168.1.78:48082'
# VUE_APP_BASE_API = 'http://192.168.1.78:48082' # VUE_APP_BASE_API = 'http://192.168.1.78:48082'
# socket地址 # socket地址
# dcs地址 # dcs地址

View File

@ -62,7 +62,7 @@ export default {
url, url,
method, method,
params: (method === 'get' || method === 'delete') ? payload : null, params: (method === 'get' || method === 'delete') ? payload : null,
data: method !== 'get' ? payload : null, data: (method === 'get' || method === 'delete') ? null : payload
}) })
}, },
put(payload) { put(payload) {

View File

@ -0,0 +1,266 @@
<!--
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,
};
},
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>

View File

@ -50,12 +50,13 @@
<script> <script>
import moment from 'moment'; import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import DialogForm from './dialogForm.vue';
// import { getAccessToken } from '@/utils/auth'; // import { getAccessToken } from '@/utils/auth';
export default { export default {
name: 'EquipmentLineBind', name: 'EquipmentLineBind',
components: {}, components: { DialogForm },
mixins: [basicPageMixin], mixins: [basicPageMixin],
data() { data() {
return { return {
@ -149,7 +150,9 @@ export default {
select: true, select: true,
label: '产线', label: '产线',
prop: 'productionLineId', prop: 'productionLineId',
rules: [{ required: true, message: '产线名不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '产线名不能为空', trigger: 'blur' },
],
url: '/base/core-production-line/listAll', url: '/base/core-production-line/listAll',
bind: { clearable: true, filterable: true }, bind: { clearable: true, filterable: true },
// watch: 'workshopSectionId' // watch: 'workshopSectionId'
@ -159,7 +162,9 @@ export default {
label: '工段', label: '工段',
prop: 'workshopSectionId', prop: 'workshopSectionId',
depends: 'productionLineId', depends: 'productionLineId',
rules: [{ required: true, message: '工段不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '工段不能为空', trigger: 'blur' },
],
bind: { clearable: true, filterable: true }, bind: { clearable: true, filterable: true },
url: '/base/core-workshop-section/listByParentId', url: '/base/core-workshop-section/listByParentId',
}, },
@ -169,7 +174,9 @@ export default {
select: true, select: true,
label: '设备', label: '设备',
prop: 'equipmentId', prop: 'equipmentId',
rules: [{ required: true, message: '设备名不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '设备名不能为空', trigger: 'blur' },
],
bind: { clearable: true, filterable: true }, bind: { clearable: true, filterable: true },
url: '/base/core-equipment/listAll', url: '/base/core-equipment/listAll',
}, },
@ -190,9 +197,16 @@ export default {
label: '产线统计类型', label: '产线统计类型',
prop: 'lineDataType', prop: 'lineDataType',
bind: { bind: {
clearable: true, filterable: true clearable: true,
filterable: true,
}, },
rules: [{ required: true, message: '产线统计类型不能为空', trigger: 'change' }], rules: [
{
required: true,
message: '产线统计类型不能为空',
trigger: 'change',
},
],
}, },
{ {
select: true, select: true,
@ -204,9 +218,16 @@ export default {
label: '工段统计类型', label: '工段统计类型',
prop: 'sectionDataType', prop: 'sectionDataType',
bind: { 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) { handleDelete(row) {
const id = row.id; const id = row.id;
this.$modal this.$modal
.confirm('是否确认删除绑定"' + row.name + '"?') .confirm(
.then(function () { '是否确认删除绑定"' +
return deleteEquipmentType(id); (row.equipmentName == null ? '这条记录' : row.equipmentName) +
'"?'
)
.then(() => {
return this.del({ id });
}) })
.then(() => { .then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess('删除成功'); this.$modal.msgSuccess('删除成功');
}) })
.catch(() => {}); .catch((err) => {
console.error(err);
});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {

View File

@ -16,7 +16,9 @@
<el-form-item <el-form-item
label="产线" label="产线"
prop="productionLineId" prop="productionLineId"
:rules="[{ required: true, message: '产线不能为空', trigger: 'blur' }]"> :rules="[
{ required: true, message: '产线不能为空', trigger: 'blur' },
]">
<el-select <el-select
v-model="dataForm.productionLineId" v-model="dataForm.productionLineId"
placeholder="请选择产线" placeholder="请选择产线"
@ -35,7 +37,9 @@
<el-form-item <el-form-item
label="工段" label="工段"
prop="workshopSectionId" prop="workshopSectionId"
:rules="[{ required: true, message: '工段不能为空', trigger: 'blur' }]"> :rules="[
{ required: true, message: '工段不能为空', trigger: 'blur' },
]">
<el-select <el-select
v-model="dataForm.workshopSectionId" v-model="dataForm.workshopSectionId"
filterable filterable
@ -55,7 +59,9 @@
<el-form-item <el-form-item
label="设备" label="设备"
prop="equipmentId" prop="equipmentId"
:rules="[{ required: true, message: '设备不能为空', trigger: 'blur' }]"> :rules="[
{ required: true, message: '设备不能为空', trigger: 'blur' },
]">
<el-select <el-select
v-model="dataForm.equipmentId" v-model="dataForm.equipmentId"
filterable filterable