add:业务逻辑开发
This commit is contained in:
@@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<!--agv双工位-->
|
||||
<div>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span">设备协议:</span>
|
||||
</div>
|
||||
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="扫码器ip:" label-width="150px" prop="x">
|
||||
<el-input v-model.trim="form.ip_address" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span" />
|
||||
<el-button
|
||||
:loading="false"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
style="float: right; padding: 6px 9px"
|
||||
type="primary"
|
||||
@click="doSubmit"
|
||||
>保存
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {
|
||||
queryDriverConfig,
|
||||
updateConfig
|
||||
} from '@/api/acs/device/driverConfig'
|
||||
|
||||
import crud from '@/mixins/crud'
|
||||
import deviceCrud from '@/api/acs/device/device'
|
||||
export default {
|
||||
name: 'StandardScanner',
|
||||
mixins: [crud],
|
||||
props: {
|
||||
parentForm: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
scannerIP: ''
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
// 从父表单获取设备编码
|
||||
this.device_id = this.$props.parentForm.device_id
|
||||
this.device_code = this.$props.parentForm.device_code
|
||||
queryDriverConfig(this.device_id, this.$props.parentForm.driver_code).then(data => {
|
||||
// 给表单赋值,并且属性不能为空
|
||||
if (data.form) {
|
||||
const arr = Object.keys(data.form)
|
||||
// 不为空
|
||||
if (arr.length > 0) {
|
||||
this.form = data.form
|
||||
}
|
||||
}
|
||||
|
||||
// 给表单赋值,并且属性不能为空
|
||||
if (data.parentForm) {
|
||||
const arr = Object.keys(data.parentForm)
|
||||
// 不为空
|
||||
if (arr.length > 0) {
|
||||
this.opc_code = data.parentForm.opc_code
|
||||
this.plc_code = data.parentForm.plc_code
|
||||
}
|
||||
}
|
||||
})
|
||||
deviceCrud.selectDeviceList().then(data => {
|
||||
this.deviceList = data
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doSubmit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.configLoading = true
|
||||
// 根据驱动类型判断是否为路由设备
|
||||
const parentForm = this.parentForm
|
||||
updateConfig(parentForm, this.form, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
this.configLoading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检验有货">
|
||||
<el-form-item label="检验有货" label-width="150px">
|
||||
<el-switch v-model="form.inspect_in_stocck" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -119,7 +119,7 @@
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="呼叫">
|
||||
<el-form-item label="呼叫" label-width="150px">
|
||||
<el-switch v-model="form.apply_task" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -128,13 +128,18 @@
|
||||
<el-switch v-model="form.manual_create_task" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否自动补空" label-width="150px">
|
||||
<el-switch v-model="form.apply_empty" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="关联设备" prop="device_code">
|
||||
<el-form-item label="放满设备" prop="device_code" label-width="150px">
|
||||
<el-select
|
||||
v-model="form.link_device_code"
|
||||
v-model="form.fmDeviceList"
|
||||
filterable
|
||||
multiple
|
||||
placeholder="请选择"
|
||||
@@ -149,11 +154,11 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="关联三色灯" prop="device_code" label-width="100px">
|
||||
<el-form-item label="产线补空设备" prop="device_code" label-width="150px">
|
||||
<el-select
|
||||
v-model="form.link_three_lamp"
|
||||
v-model="form.cxBkDeviceList"
|
||||
filterable
|
||||
clearable
|
||||
multiple
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
@@ -166,8 +171,20 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否需要光电" label-width="150px">
|
||||
<el-switch v-model="form.input_move" />
|
||||
<el-form-item label="人工补空设备" prop="device_code" label-width="150px">
|
||||
<el-select
|
||||
v-model="form.rgBkDeviceList"
|
||||
filterable
|
||||
multiple
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deviceList"
|
||||
:key="item.device_code"
|
||||
:label="item.device_name"
|
||||
:value="item.device_code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@@ -104,12 +104,11 @@
|
||||
<el-table
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
highlight-current-row
|
||||
style="width: 100%"
|
||||
highlight-current-row style="width: 100%"
|
||||
row-key="opc_id"
|
||||
border
|
||||
default-expand-all
|
||||
:tree-props="{children: 'children', has_children: 'has_children'}"
|
||||
:default-expand-all="true"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
@select="crud.selectChange"
|
||||
@select-all="crud.selectAllChange"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@@ -232,6 +231,25 @@ export default {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
[CRUD.HOOK.afterRefresh]() {
|
||||
this.crud.data = this.processTreeData(this.crud.data);
|
||||
},
|
||||
processTreeData(data) {
|
||||
if (!data || !Array.isArray(data)) return data;
|
||||
return data.map(item => {
|
||||
if (item.hasOwnProperty('hasChildren')) {
|
||||
item.hasChildren = item.hasChildren === "1" || item.hasChildren === 1 || item.hasChildren === true;
|
||||
} else if (item.children && item.children.length > 0) {
|
||||
item.hasChildren = true;
|
||||
} else {
|
||||
item.hasChildren = false;
|
||||
}
|
||||
if (item.children && Array.isArray(item.children)) {
|
||||
item.children = this.processTreeData(item.children);
|
||||
}
|
||||
return item;
|
||||
});
|
||||
},
|
||||
handleClick(row, flag) {
|
||||
// flag为0是新增,flag为1是编辑,flag为2是删除
|
||||
// 如果是父类操作
|
||||
|
||||
@@ -504,7 +504,7 @@ import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
hasgoods
|
||||
import deviceCrud from '@/api/acs/device/device'
|
||||
import routeCurd from '@/api/acs/route/routePlan'
|
||||
import { getDicts } from '@/views/system/dict/dict'
|
||||
import i18n from '@/i18n'
|
||||
@@ -633,7 +633,7 @@ export default {
|
||||
to_x2: null,
|
||||
to_y2: null,
|
||||
to_z2: null,
|
||||
agv_system_type: '',
|
||||
agv_system_type: '1',
|
||||
interactionJson: null
|
||||
},
|
||||
taskStatus: {
|
||||
|
||||
Reference in New Issue
Block a user