代码更新
This commit is contained in:
@@ -163,7 +163,7 @@ export default {
|
||||
this.timer = setInterval(() => { // 定时刷新
|
||||
console.log('定时器启动')
|
||||
this.initStatus()
|
||||
}, 10000)
|
||||
}, 2000)
|
||||
},
|
||||
initStatus() {
|
||||
const data = {
|
||||
|
||||
193
lms/nladmin-ui/src/views/wms/agvrush/devicecharge/index.vue
Normal file
193
lms/nladmin-ui/src/views/wms/agvrush/devicecharge/index.vue
Normal file
@@ -0,0 +1,193 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="设备编码">
|
||||
<el-input
|
||||
v-model="query.device_code"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="设备编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="是否异常">
|
||||
<el-select
|
||||
v-model="query.is_fault"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.IS_OR_NOT"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="设备区域">
|
||||
<el-select
|
||||
v-model="query.region_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.DEVICE_REGION_TYPE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="设备车间">
|
||||
<el-select
|
||||
v-model="query.plant_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_area"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column prop="device_code" label="设备编码" show-overflow-tooltip width="150px" />
|
||||
<el-table-column prop="device_name" label="设备名称 " show-overflow-tooltip width="300px" />
|
||||
<el-table-column prop="is_fault" label="状态 " show-overflow-tooltip width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="scope.row.is_fault==='1'" type="danger" circle />
|
||||
<el-button v-if="scope.row.is_fault==='0'" type="success" circle />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="plant_code" label="所属车间 " show-overflow-tooltip width="100px" :formatter="formatType1" />
|
||||
<el-table-column prop="region_code" label="所属区域 " show-overflow-tooltip width="100px" :formatter="formatType2" />
|
||||
<el-table-column prop="fault_type" label="异常类型 " show-overflow-tooltip width="100px" :formatter="formatType3" />
|
||||
<el-table-column prop="fault_info" label="故障信息" show-overflow-tooltip width="250px" />
|
||||
<el-table-column prop="solve_mode" label="解决方式" show-overflow-tooltip width="250px" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudFaultdevice from '@/views/wms/basedata/master/faultdevice/faultdevice'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = {
|
||||
}
|
||||
export default {
|
||||
name: 'Devicecharge',
|
||||
dicts: ['DEVICE_ERROR_TYPE', 'IS_OR_NOT', 'DEVICE_REGION_TYPE', 'product_area'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '设备故障监控',
|
||||
url: 'api/faultdevice/deviceCharge',
|
||||
optShow: {
|
||||
add: false,
|
||||
reset: true
|
||||
},
|
||||
size: 20,
|
||||
idField: 'device_id',
|
||||
sort: 'device_id,desc',
|
||||
crudMethod: { ...crudFaultdevice }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
syncLoading: false,
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init()
|
||||
},
|
||||
beforeDestroy() {
|
||||
// js提供的clearInterval方法用来清除定时器
|
||||
console.log('定时器销毁')
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
init: function() {
|
||||
this.initStageData()
|
||||
},
|
||||
initStageData() {
|
||||
this.timer = setInterval(() => {
|
||||
console.log('定时器启动')
|
||||
this.initStatus()
|
||||
}, 2000)
|
||||
},
|
||||
initStatus() {
|
||||
const data = this.crud.query
|
||||
crudFaultdevice.deviceCharge(data).then(res => {
|
||||
this.crud.data = res.content
|
||||
this.crud.page.size = 10
|
||||
})
|
||||
},
|
||||
formatType1(row) {
|
||||
return this.dict.label.product_area[row.plant_code]
|
||||
},
|
||||
formatType2(row) {
|
||||
return this.dict.label.DEVICE_REGION_TYPE[row.region_code]
|
||||
},
|
||||
formatType3(row) {
|
||||
return this.dict.label.DEVICE_ERROR_TYPE[row.fault_type]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -129,6 +129,14 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否自动贴标" prop="is_auto_table">
|
||||
<el-radio v-model="form.is_auto_table" label="0">否</el-radio>
|
||||
<el-radio v-model="form.is_auto_table" label="1">是</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="16">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" style="width: 550px;" type="textarea" />
|
||||
@@ -159,6 +167,7 @@
|
||||
<el-table-column prop="bz_print_no" label="包装打印模板" width="150px" :formatter="printTemple" show-overflow-tooltip />
|
||||
<el-table-column prop="shd_print_no" label="送货单打印模板路径" width="180px" show-overflow-tooltip/>
|
||||
<el-table-column prop="shd_dtl_num" label="送货单明细数" width="150px" show-overflow-tooltip />
|
||||
<el-table-column prop="is_auto_table" label="是否自动贴标" width="150px" show-overflow-tooltip :formatter="autoTable"/>
|
||||
<el-table-column prop="update_optname" label="修改者" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="150" />
|
||||
<el-table-column label="启用" align="center" prop="is_used">
|
||||
@@ -239,7 +248,8 @@ const defaultForm = {
|
||||
class_name: null,
|
||||
zj_print_no: null,
|
||||
bz_print_no: null,
|
||||
shd_print_no: null
|
||||
shd_print_no: null,
|
||||
is_auto_table: '1'
|
||||
}
|
||||
export default {
|
||||
name: 'Customerbase',
|
||||
@@ -369,6 +379,9 @@ export default {
|
||||
},
|
||||
printTemple(row) {
|
||||
return this.dict.label.print_temple[row.bz_print_no]
|
||||
},
|
||||
autoTable(row) {
|
||||
return this.dict.label.is_used[row.is_auto_table]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/faultdevice',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/faultdevice/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/faultdevice',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function syncInfo() {
|
||||
return request({
|
||||
url: 'api/faultdevice/syncInfo',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function deviceCharge(params) {
|
||||
return request({
|
||||
url: 'api/faultdevice/deviceCharge',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, syncInfo, deviceCharge }
|
||||
@@ -0,0 +1,211 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="故障编码">
|
||||
<el-input
|
||||
v-model="query.fault_code"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="故障编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="异常类型">
|
||||
<el-select
|
||||
v-model="query.fault_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.DEVICE_ERROR_TYPE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<rrOperation />
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-thumb"
|
||||
size="mini"
|
||||
:loading="syncLoading"
|
||||
@click="syncInfo"
|
||||
>
|
||||
同步
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="550px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="140px">
|
||||
<el-form-item label="故障编码:" prop="fault_code">
|
||||
<el-input v-model="form.fault_code" style="width: 300px;" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="故障信息:" prop="fault_info">
|
||||
<el-input v-model="form.fault_info" style="width: 300px;" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="异常类型:" prop="fault_type">
|
||||
<el-select
|
||||
v-model="form.fault_type"
|
||||
size="mini"
|
||||
:disabled="true"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 300px"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.DEVICE_ERROR_TYPE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="解决方式:" prop="solve_mode">
|
||||
<el-input v-model="form.solve_mode" type="textarea" :rows="2" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column prop="fault_code" label="故障编码" show-overflow-tooltip />
|
||||
<el-table-column prop="fault_info" label="故障信息 " show-overflow-tooltip width="150px" />
|
||||
<el-table-column prop="fault_type" label="异常类型 " show-overflow-tooltip width="100px" :formatter="formatType" />
|
||||
<el-table-column prop="solve_mode" label="解决方式" show-overflow-tooltip width="300px" />
|
||||
<el-table-column prop="create_name" label="创建人" />
|
||||
<el-table-column prop="create_time" label="创建时间" width="150" />
|
||||
<el-table-column prop="update_name" label="修改者" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="150" />
|
||||
<el-table-column
|
||||
v-permission="['admin','customerbase:edit','customerbase:del']"
|
||||
label="操作"
|
||||
width="150px"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:disabled-dle="true"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudFaultdevice from '@/views/wms/basedata/master/faultdevice/faultdevice'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = {
|
||||
fault_id: null,
|
||||
fault_code: null,
|
||||
fault_info: null,
|
||||
acs_type: null,
|
||||
solve_mode: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_id: null,
|
||||
update_name: null,
|
||||
update_time: null
|
||||
}
|
||||
export default {
|
||||
name: 'Faultdevice',
|
||||
dicts: ['DEVICE_ERROR_TYPE'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '设备故障处理',
|
||||
url: 'api/faultdevice',
|
||||
optShow: {
|
||||
add: false,
|
||||
reset: true
|
||||
},
|
||||
idField: 'device_id',
|
||||
sort: 'device_id,desc',
|
||||
crudMethod: { ...crudFaultdevice }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
syncLoading: false,
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
syncInfo() {
|
||||
this.syncLoading = true
|
||||
crudFaultdevice.syncInfo().then(res => {
|
||||
this.crud.notify('同步成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
this.syncLoading = false
|
||||
}).catch(() => {
|
||||
this.syncLoading = false
|
||||
})
|
||||
},
|
||||
formatType(row) {
|
||||
return this.dict.label.DEVICE_ERROR_TYPE[row.fault_type]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
312
lms/nladmin-ui/src/views/wms/sendout/outtwo/index.vue
Normal file
312
lms/nladmin-ui/src/views/wms/sendout/outtwo/index.vue
Normal file
@@ -0,0 +1,312 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row>
|
||||
<div id="container" className="container" />
|
||||
</el-row>
|
||||
<!--点击设备显示信息-->
|
||||
<el-dialog
|
||||
id="dialogs"
|
||||
title="点位信息"
|
||||
class="newDialog"
|
||||
:visible.sync="dialogDeviceMsgVisible"
|
||||
width="22%"
|
||||
:top="tops"
|
||||
:show-close="false"
|
||||
:modal="false"
|
||||
>
|
||||
<el-table
|
||||
:data="arr"
|
||||
style="width: 100%"
|
||||
max-height="500px"
|
||||
>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="监控项"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="value"
|
||||
label="当前值"
|
||||
/>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
<!--弹窗设置设备与图标绑定与角度-->
|
||||
<el-dialog title="点位操作" :visible.sync="dialogFormVisible1" width="35%">
|
||||
<el-form :model="form" size="small">
|
||||
<el-form-item label="点位编码:" prop="device_code" label-width="80px">
|
||||
<el-input v-model="form.point_code" :disabled="true" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="木箱号:" label-width="80px">
|
||||
<el-input v-model="form.vehicle_code" :disabled="true" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible1 = false">取 消</el-button>
|
||||
<el-button type="primary" @click="unlock">解 绑</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudStage from '@/api/logicflow/stage'
|
||||
import '@logicflow/core/dist/style/index.css'
|
||||
import '@logicflow/extension/lib/style/index.css'
|
||||
|
||||
import { LogicFlow } from '@logicflow/core'
|
||||
import { registerCustomElement } from '@/views/system/logicflow/editor/components/node'
|
||||
import { getStructByCodesFs, unLockPoint } from '@/views/system/monitor/device/structStage'
|
||||
let data = {}
|
||||
let lf = ''
|
||||
export default {
|
||||
// 发货区监控1层
|
||||
name: 'Sendout',
|
||||
data() {
|
||||
return {
|
||||
stageParam: 'FS_2', // 舞台参数
|
||||
dialogDeviceMsgVisible: false,
|
||||
device_code: null,
|
||||
tops: '20vh',
|
||||
stage_code: '',
|
||||
stageSelectList: [],
|
||||
arr: [], // 显示数组
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible1: false,
|
||||
dialogFormVisible2: false,
|
||||
dialogFormVisible3: false,
|
||||
dialogFormVisible4: false,
|
||||
form: {
|
||||
point_code: '',
|
||||
vehicle_code: ''
|
||||
},
|
||||
allStructMsg: [],
|
||||
msgTop: '200px',
|
||||
msgLeft: '200px'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init()
|
||||
},
|
||||
beforeDestroy() {
|
||||
// js提供的clearInterval方法用来清除定时器
|
||||
console.log('定时器销毁')
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
methods: {
|
||||
// 流程图初始化
|
||||
init() {
|
||||
// 初始化配置
|
||||
lf = new LogicFlow({
|
||||
overlapMode: 1,
|
||||
container: document.querySelector('#container'), // 容器
|
||||
// 画布配置
|
||||
// width: window.innerWidth, // 宽度
|
||||
height: window.innerHeight, // 高度
|
||||
grid: { // 不用格子直接显示,使用背景
|
||||
visible: false,
|
||||
type: 'mesh',
|
||||
size: 5
|
||||
},
|
||||
background: {
|
||||
// backgroundImage: 'url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2QwZDBkMCIgb3BhY2l0eT0iMC4yIiBzdHJva2Utd2lkdGg9IjEiLz48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZDBkMGQwIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=")',
|
||||
backgroundRepeat: 'repeat'
|
||||
},
|
||||
adjustEdge: false,
|
||||
adjustEdgeMiddle: false,
|
||||
adjustEdgeStartAndEnd: false,
|
||||
adjustNodePosition: false,
|
||||
hideAnchors: true,
|
||||
nodeTextEdit: false,
|
||||
edgeTextEdit: false
|
||||
})
|
||||
lf.setTheme(
|
||||
{
|
||||
baseEdge: { strokeWidth: 1 },
|
||||
baseNode: { strokeWidth: 1 },
|
||||
nodeText: { overflowMode: 'autoWrap', lineHeight: 1.5 },
|
||||
edgeText: { overflowMode: 'autoWrap', lineHeight: 1.5 }
|
||||
}
|
||||
)
|
||||
// 注册自定义元素
|
||||
registerCustomElement(lf)
|
||||
// 删除默认的右键菜单
|
||||
lf.extension.menu.setMenuConfig({
|
||||
nodeMenu: false
|
||||
})
|
||||
lf.on('node:click', (data, e) => { // 鼠标点击节点
|
||||
// 展开显示设备信息 todo: 1
|
||||
if (data.data.type !== 'pro-rect' && data.data.type !== 'pro-circle' && data.data.type !== 'triangle' && data.data.type !== 'rect-radius') {
|
||||
if (data.data.properties.struct_id) {
|
||||
this.moveShow(data.data) // 传递节点数据,用来获取id做比对
|
||||
this.dialogDeviceMsgVisible = true
|
||||
this.struct_id = data.data.properties.struct_id // ?暂时没用
|
||||
this.tops = data.e.y + 'px'
|
||||
document.getElementsByClassName('el-dialog')[0].style.marginLeft = data.e.x + 'px'
|
||||
}
|
||||
}
|
||||
})
|
||||
// 右键单击事件
|
||||
lf.on('node:contextmenu', (data, e) => {
|
||||
debugger
|
||||
let item = ''
|
||||
item = this.allStructMsg.find((structMsg) => structMsg.id === data.data.id)
|
||||
|
||||
const data1 = item.data[0]
|
||||
|
||||
this.form.point_code = data1.point_code
|
||||
this.form.vehicle_code = data1.vehicle_code
|
||||
this.dialogFormVisible1 = true
|
||||
})
|
||||
// lf.on('node:mouseleave', (data, e) => {
|
||||
// this.dialogDeviceMsgVisible = false
|
||||
// })
|
||||
// 开始渲染
|
||||
lf.render(data)
|
||||
this.initStageData()
|
||||
},
|
||||
initStageData() {
|
||||
// 获取舞台编码
|
||||
crudStage.getNewStageDataByCode(this.stageParam).then(res => {
|
||||
data = JSON.parse(res.stage_data)
|
||||
lf.render(data)
|
||||
this.initStatus()
|
||||
})
|
||||
// todo: 定时器
|
||||
this.timer = setInterval(() => { // 定时刷新设备的状态信息
|
||||
console.log('定时器启动')
|
||||
this.initStatus()
|
||||
}, 10000)
|
||||
},
|
||||
initStatus() { // 初始化数据
|
||||
let resion = {}
|
||||
resion = lf.getGraphData().nodes.map(item => ({ id: item.id, struct_id: item.properties.struct_id }))
|
||||
getStructByCodesFs(resion).then(res => {
|
||||
this.allStructMsg = res
|
||||
// 实时设置状态信息
|
||||
for (var item of res) { // 循环设置属性
|
||||
if (item.struct_status != undefined) {
|
||||
lf.setProperties(item.id, {
|
||||
struct_status: item.struct_status
|
||||
})
|
||||
}
|
||||
}
|
||||
// 设置动态实时显示设备信息
|
||||
const { nodes } = lf.getSelectElements() // 获取选中的节点
|
||||
if (nodes.length === 1) { // 因为是定时器,没有选中则不用实时更新显示数据
|
||||
this.moveShow(nodes[0]) // 监控模式下不可能托选,因此就只有一个数据
|
||||
}
|
||||
})
|
||||
},
|
||||
moveShow(nodeData) { // 点击之后显示出来的数据----只需要设备信息
|
||||
let item = ''
|
||||
// 查找点击节点的id
|
||||
item = this.allStructMsg.find((structMsg) => structMsg.id === nodeData.id)
|
||||
this.arr = [] // 清空
|
||||
if (item.struct_id && item.data) { // item.data是数组
|
||||
this.arr = [
|
||||
{ name: '货位编号', value: item.struct_code }
|
||||
]
|
||||
const data1 = item.data[0] // 至少有一条
|
||||
const data = item.data // 总的data数据
|
||||
// 以下是设置参数显示值
|
||||
for (const val in data1) {
|
||||
if (val === 'vehicle_code' && data1.vehicle_code) {
|
||||
const obj = { name: '木箱号', value: data1[val] }
|
||||
this.arr.push(obj)
|
||||
}
|
||||
if (val === 'quanlity_in_box' && data1.quanlity_in_box) {
|
||||
const obj = { name: '子卷数', value: data1[val] }
|
||||
this.arr.push(obj)
|
||||
}
|
||||
if (val === 'sale_order_name' && data1.sale_order_name) {
|
||||
const obj = { name: '订单号', value: data1[val] }
|
||||
this.arr.push(obj)
|
||||
}
|
||||
if (val === 'product_description' && data1.product_description) {
|
||||
const obj = { name: '物料', value: data1[val] }
|
||||
this.arr.push(obj)
|
||||
}
|
||||
if (val === 'box_weight' && data1.box_weight) {
|
||||
const obj = { name: '木箱总重', value: data1[val] }
|
||||
this.arr.push(obj)
|
||||
}
|
||||
}
|
||||
if (data.length > 1) { // 显示子卷
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
let container_name
|
||||
let net_weight
|
||||
for (const val in data[i]) {
|
||||
if (val === 'container_name' && data[i].container_name) {
|
||||
container_name = data[i][val]
|
||||
}
|
||||
if (val === 'net_weight' && data[i].net_weight) {
|
||||
net_weight = data[i][val]
|
||||
}
|
||||
}
|
||||
if (container_name && net_weight) {
|
||||
const obj = { name: container_name, value: net_weight }
|
||||
this.arr.push(obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
unlock() {
|
||||
// 解锁点位
|
||||
if (this.form.vehicle_code === '') {
|
||||
this.$message({
|
||||
message: '此点位已解绑',
|
||||
type: 'warning'
|
||||
})
|
||||
return
|
||||
}
|
||||
unLockPoint(this.form).then(res => {
|
||||
this.dialogFormVisible1 = false
|
||||
this.initStageData()
|
||||
this.$message({
|
||||
message: '解绑成功',
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
.container {
|
||||
background-color: #f8f9fa;
|
||||
height: 100%;
|
||||
}
|
||||
.newDialog /deep/ .el-dialog__header {
|
||||
padding: 1vh 1vw 0 1vw;
|
||||
}
|
||||
.newDialog /deep/ .el-dialog__body {
|
||||
padding: 1vh 1vw;
|
||||
}
|
||||
.toolbar-sty {
|
||||
position: absolute;
|
||||
margin-top: 5px;
|
||||
top: 0;
|
||||
padding: 5px;
|
||||
left: 30px;
|
||||
height: 45px;
|
||||
/*width: 310px;*/
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
z-index: 10;
|
||||
background: #e5e5e5;
|
||||
}
|
||||
</style>
|
||||
@@ -171,6 +171,9 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="checked">
|
||||
<el-checkbox v-model="checked">是否异常出库</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span class="crud-opts-right2">
|
||||
@@ -317,6 +320,7 @@ export default {
|
||||
tabledis: [],
|
||||
currentRow: {},
|
||||
currentDis: {},
|
||||
checked: false,
|
||||
form: {
|
||||
gender2: ''
|
||||
},
|
||||
@@ -593,6 +597,7 @@ export default {
|
||||
this.loadingSetPoint = true
|
||||
if (this.currentDis.iostorinvdis_id !== null) {
|
||||
this.currentDis.point_code = this.form2.point_code
|
||||
this.currentDis.checked = this.checked
|
||||
checkoutbill.oneSetPoint2(this.currentDis).then(res => {
|
||||
this.queryTableDdis(this.currentDis.iostorinvdtl_id)
|
||||
this.crud.notify('设置成功!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
@@ -614,6 +619,7 @@ export default {
|
||||
}
|
||||
this.loadingSetAllPoint = true
|
||||
this.currentRow.point_code = this.form2.point_code
|
||||
this.currentRow.checked = this.checked
|
||||
checkoutbill.allSetPoint(this.currentRow).then(res => {
|
||||
this.queryTableDdis(this.currentRow.iostorinvdtl_id)
|
||||
this.crud.notify('设置成功!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
@@ -630,7 +636,8 @@ export default {
|
||||
this.loadingSetAllPoint = true
|
||||
const data = {
|
||||
'point_code': this.form2.point_code,
|
||||
'iostorinv_id': this.mstrow.iostorinv_id
|
||||
'iostorinv_id': this.mstrow.iostorinv_id,
|
||||
'checked': this.checked
|
||||
}
|
||||
checkoutbill.allSetPoint(data).then(res => {
|
||||
// this.queryTableDdis(this.currentRow.iostorinvdtl_id)
|
||||
|
||||
Reference in New Issue
Block a user