对接后台,部分已完成

This commit is contained in:
2021-12-08 14:54:13 +08:00
parent ab898dda04
commit ee44a9f77f
32 changed files with 1556 additions and 877 deletions

View File

@@ -1,17 +1,24 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2021-12-08 11:15:12
* @Description:
-->
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="参数名" prop="paramKey">
<el-input v-model="dataForm.paramKey" placeholder="参数名"></el-input>
<el-form-item label="报警编码" prop="code">
<el-input v-model="dataForm.code" placeholder="报警编码"></el-input>
</el-form-item>
<el-form-item label="参数值" prop="paramValue">
<el-input v-model="dataForm.paramValue" placeholder="参数值"></el-input>
<el-form-item label="报警类型" prop="alarmClass">
<el-input v-model="dataForm.alarmClass" placeholder="报警类型"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
<el-form-item label="报警内容" prop="alarmInfo">
<el-input v-model="dataForm.alarmInfo" placeholder="报警内容"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@@ -27,39 +34,45 @@
return {
visible: false,
dataForm: {
id: 0,
paramKey: '',
paramValue: '',
remark: ''
id: '',
code: '',
alarmClass: '',
alarmInfo: ''
},
dataRule: {
paramKey: [
{ required: true, message: '参数名不能为空', trigger: 'blur' }
code: [
{ required: true, message: '报警编码不能为空', trigger: 'blur' }
],
paramValue: [
{ required: true, message: '参数值不能为空', trigger: 'blur' }
alarmInfo: [
{ required: true, message: '报警内容不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.dataForm.id = id || ''
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/sys/config/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
url: this.$http.adornUrl(`alarmBase/get`),
method: 'post',
data: this.$http.adornData({id})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.paramKey = data.config.paramKey
this.dataForm.paramValue = data.config.paramValue
this.dataForm.remark = data.config.remark
this.dataForm = data.data
}
})
} else {
this.$http({
url: this.$http.adornUrl(`alarmBase/codeGenerator`),
method: 'post',
data: this.$http.adornData()
}).then((data) => {
this.dataForm.code = data.data
})
}
})
},
@@ -68,13 +81,13 @@
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/sys/config/${!this.dataForm.id ? 'save' : 'update'}`),
url: this.$http.adornUrl(`alarmBase/${!this.dataForm.id ? 'add' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'paramKey': this.dataForm.paramKey,
'paramValue': this.dataForm.paramValue,
'remark': this.dataForm.remark
'code': this.dataForm.code,
'alarmClass': this.dataForm.alarmClass,
'alarmInfo': this.dataForm.alarmInfo
})
}).then(({data}) => {
if (data && data.code === 0) {

View File

@@ -1,17 +1,65 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2021-12-08 14:03:15
* @Description:
-->
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="参数名" prop="paramKey">
<el-input v-model="dataForm.paramKey" placeholder="参数名"></el-input>
:visible.sync="visible"
>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px"
>
<el-form-item label="缓存区编码" prop="code">
<el-input v-model="dataForm.code" placeholder="缓存区编码"></el-input>
</el-form-item>
<el-form-item label="参数值" prop="paramValue">
<el-input v-model="dataForm.paramValue" placeholder="参数值"></el-input>
<el-form-item label="缓存区名称" prop="warehouseName">
<el-input
v-model="dataForm.warehouseName"
placeholder="缓存区名称"
></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
<el-form-item label="英文名称" prop="alarmInfo">
<el-input
v-model="dataForm.alarmInfo"
placeholder="英文名称"
></el-input>
</el-form-item>
<el-form-item label="缩写" prop="alarmInfo">
<el-input v-model="dataForm.alarmInfo" placeholder="缩写"></el-input>
</el-form-item>
<el-form-item label="规格描述" prop="spec">
<el-input
v-model="dataForm.spec"
placeholder="规格描述"
></el-input>
</el-form-item>
<el-form-item label="库位数量" prop="alarmInfo">
<el-input
v-model="dataForm.alarmInfo"
placeholder="库位数量"
></el-input>
</el-form-item>
<el-form-item label="当前状态" prop="alarmInfo"
><el-switch
v-model="dataForm.alarmInfo"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="1"
inactive-value="0"
>
</el-switch>
</el-form-item>
<el-form-item label="备注" prop="description">
<el-input v-model="dataForm.description" placeholder="备注"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@@ -22,78 +70,82 @@
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
paramKey: '',
paramValue: '',
remark: ''
},
dataRule: {
paramKey: [
{ required: true, message: '参数名不能为空', trigger: 'blur' }
],
paramValue: [
{ required: true, message: '参数值不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/sys/config/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.paramKey = data.config.paramKey
this.dataForm.paramValue = data.config.paramValue
this.dataForm.remark = data.config.remark
}
})
}
})
export default {
data () {
return {
visible: false,
dataForm: {
id: '',
code: '',
description: '',
spec: '',
warehouseName: ''
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/sys/config/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'paramKey': this.dataForm.paramKey,
'paramValue': this.dataForm.paramValue,
'remark': this.dataForm.remark
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
dataRule: {
}
}
},
methods: {
init (id) {
this.dataForm.id = id || ''
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`warehouse/get`),
method: 'post',
data: this.$http.adornData({ id })
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataForm = data.data
}
})
} else {
this.$http({
url: this.$http.adornUrl(`warehouse/codeGenerator`),
method: 'post',
data: this.$http.adornData()
}).then(data => {
this.dataForm.code = data.data
})
}
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate(valid => {
if (valid) {
this.$http({
url: this.$http.adornUrl(
`warehouse/${!this.dataForm.id ? 'add' : 'update'}`
),
method: 'post',
data: this.$http.adornData({
id: this.dataForm.id || undefined,
code: this.dataForm.code,
description: this.dataForm.description,
warehouseName: this.dataForm.warehouseName,
spec: this.dataForm.spec
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View File

@@ -1,17 +1,27 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2021-12-08 11:22:54
* @Description:
-->
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="参数名" prop="paramKey">
<el-input v-model="dataForm.paramKey" placeholder="参数名"></el-input>
<el-form :model="dataForm" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="车辆编码" prop="code">
<el-input v-model="dataForm.code" placeholder="车辆编码"></el-input>
</el-form-item>
<el-form-item label="参数值" prop="paramValue">
<el-input v-model="dataForm.paramValue" placeholder="参数值"></el-input>
<el-form-item label="车辆名称" prop="vehicleName">
<el-input v-model="dataForm.vehicleName" placeholder="车辆名称"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
<el-form-item label="缩写" prop="vehicleAlias">
<el-input v-model="dataForm.vehicleAlias" placeholder="缩写"></el-input>
</el-form-item>
<el-form-item label="IP地址" prop="ip">
<el-input v-model="dataForm.ip" placeholder="IP地址"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@@ -27,39 +37,38 @@
return {
visible: false,
dataForm: {
id: 0,
paramKey: '',
paramValue: '',
remark: ''
},
dataRule: {
paramKey: [
{ required: true, message: '参数名不能为空', trigger: 'blur' }
],
paramValue: [
{ required: true, message: '参数值不能为空', trigger: 'blur' }
]
id: '',
code: '',
ip: '',
vehicleName: '',
vehicleAlias: ''
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.dataForm.id = id || ''
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/sys/config/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
url: this.$http.adornUrl(`vehicle/get`),
method: 'post',
data: this.$http.adornData({id})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.paramKey = data.config.paramKey
this.dataForm.paramValue = data.config.paramValue
this.dataForm.remark = data.config.remark
this.dataForm = data.data
}
})
} else {
this.$http({
url: this.$http.adornUrl(`vehicle/codeGenerator`),
method: 'post',
data: this.$http.adornData()
}).then((data) => {
this.dataForm.code = data.data
})
}
})
},
@@ -68,13 +77,14 @@
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/sys/config/${!this.dataForm.id ? 'save' : 'update'}`),
url: this.$http.adornUrl(`vehicle/${!this.dataForm.id ? 'add' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'paramKey': this.dataForm.paramKey,
'paramValue': this.dataForm.paramValue,
'remark': this.dataForm.remark
'code': this.dataForm.code,
'vehicleName': this.dataForm.vehicleName,
'ip': this.dataForm.ip,
'vehicleAlias': this.dataForm.vehicleAlias
})
}).then(({data}) => {
if (data && data.code === 0) {

View File

@@ -1,17 +1,37 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2021-12-08 14:11:44
* @Description:
-->
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="参数名" prop="paramKey">
<el-input v-model="dataForm.paramKey" placeholder="参数名"></el-input>
<el-form-item label="库位名称" prop="locationName">
<el-input v-model="dataForm.locationName" placeholder="库位名称"></el-input>
</el-form-item>
<el-form-item label="参数值" prop="paramValue">
<el-input v-model="dataForm.paramValue" placeholder="参数值"></el-input>
<el-form-item label="库位编码" prop="code">
<el-input v-model="dataForm.code" placeholder="库位编码"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
<el-form-item label="当前状态" prop="alarmInfo"
><el-switch
v-model="dataForm.alarmInfo"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="1"
inactive-value="0"
>
</el-switch>
</el-form-item>
<el-form-item label="库位别名" prop="locationNameAlias">
<el-input v-model="dataForm.locationNameAlias" placeholder="库位别名"></el-input>
</el-form-item>
<el-form-item label="英文名称" prop="alarmInfo">
<el-input v-model="dataForm.alarmInfo" placeholder="英文名称"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@@ -27,39 +47,44 @@
return {
visible: false,
dataForm: {
id: 0,
paramKey: '',
paramValue: '',
remark: ''
id: '',
code: '',
locationName: '',
locationNameAlias: '',
warehouseId: ''
},
dataRule: {
paramKey: [
{ required: true, message: '参数名不能为空', trigger: 'blur' }
],
paramValue: [
{ required: true, message: '参数值不能为空', trigger: 'blur' }
code: [
{ required: true, message: '编码不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
init (id, warehouseId) {
this.dataForm.id = id || ''
this.dataForm.warehouseId = warehouseId
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/sys/config/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
url: this.$http.adornUrl(`locationInfo/get`),
method: 'post',
data: this.$http.adornData({id})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.paramKey = data.config.paramKey
this.dataForm.paramValue = data.config.paramValue
this.dataForm.remark = data.config.remark
this.dataForm = data.data
}
})
} else {
this.$http({
url: this.$http.adornUrl(`locationInfo/codeGenerator`),
method: 'post',
data: this.$http.adornData()
}).then((data) => {
this.dataForm.code = data.data
})
}
})
},
@@ -68,13 +93,14 @@
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/sys/config/${!this.dataForm.id ? 'save' : 'update'}`),
url: this.$http.adornUrl(`locationInfo/${!this.dataForm.id ? 'add' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'paramKey': this.dataForm.paramKey,
'paramValue': this.dataForm.paramValue,
'remark': this.dataForm.remark
'code': this.dataForm.code,
'locationName': this.dataForm.locationName,
'warehouseId': this.dataForm.warehouseId,
'locationNameAlias': this.dataForm.locationNameAlias
})
}).then(({data}) => {
if (data && data.code === 0) {

View File

@@ -19,25 +19,25 @@
width="50">
</el-table-column>
<el-table-column
prop="paramKey"
prop="createTime"
header-align="center"
align="center"
label="添加时间">
</el-table-column>
<el-table-column
prop="paramValue"
prop="locationName"
header-align="center"
align="center"
label="库位名称">
</el-table-column>
<el-table-column
prop="remark"
prop="code"
header-align="center"
align="center"
label="编码">
</el-table-column>
<el-table-column
prop="rname"
prop="locationNameAlias"
header-align="center"
align="center"
label="别名">
@@ -53,6 +53,9 @@
header-align="center"
align="center"
label="状态">
<template slot-scope="scope">
<span>{{scope.row.status === 0?'空闲':scope.row.status === 1?'使用中':'不可使用'}}</span>
</template>
</el-table-column>
<el-table-column
fixed="right"
@@ -85,6 +88,7 @@
export default {
data () {
return {
warehouseId: '',
dataList: [],
pageIndex: 1,
pageSize: 10,
@@ -101,22 +105,24 @@
},
created () {
console.log(this.$route.query.id)
this.warehouseId = this.$route.query.id
},
methods: {
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/sys/config/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize
url: this.$http.adornUrl('locationInfo/page'),
method: 'post',
data: this.$http.adornData({
'current': this.pageIndex,
'size': this.pageSize,
'warehouseId': this.warehouseId
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
this.dataList = data.data.records
this.totalPage = data.data.total
} else {
this.dataList = []
this.totalPage = 0
@@ -139,9 +145,12 @@
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
this.$refs.addOrUpdate.init(id, this.warehouseId)
})
},
LocationBtn (id) {
this.$router.push({name: 'basic-cache-location', query: {id}})
},
// 删除
deleteHandle (id) {
this.$confirm(`确定对[id=${id}]进行删除操作?`, '提示', {
@@ -150,9 +159,9 @@
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/sys/config/delete'),
url: this.$http.adornUrl('locationInfo/delete'),
method: 'post',
data: this.$http.adornData(id, false)
data: this.$http.adornData({id})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({

View File

@@ -0,0 +1,126 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2021-12-08 14:21:48
* @Description:
-->
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="100px">
<el-form-item label="工艺编码" prop="code">
<el-input v-model="dataForm.code" placeholder="工艺编码"></el-input>
</el-form-item>
<el-form-item label="工艺号" prop="alarmClass">
<el-input v-model="dataForm.alarmClass" placeholder="工艺号"></el-input>
</el-form-item>
<el-form-item label="对应PLC值" prop="alarmInfo">
<el-input v-model="dataForm.alarmInfo" placeholder="对应PLC值"></el-input>
</el-form-item>
<el-form-item label="当前状态" prop="alarmInfo"
><el-switch
v-model="dataForm.alarmInfo"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="1"
inactive-value="0"
>
</el-switch>
</el-form-item>
<el-form-item label="说明" prop="remark">
<el-input v-model="dataForm.remark" placeholder="说明"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: '',
code: '',
alarmClass: '',
alarmInfo: '',
remark: ''
},
dataRule: {
code: [
{ required: true, message: '工艺编码不能为空', trigger: 'blur' }
],
alarmInfo: [
{ required: true, message: '对应PLC值不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || ''
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`alarmBase/get`),
method: 'post',
data: this.$http.adornData({id})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm = data.data
}
})
} else {
this.$http({
url: this.$http.adornUrl(`alarmBase/codeGenerator`),
method: 'post',
data: this.$http.adornData()
}).then((data) => {
this.dataForm.code = data.data
})
}
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`alarmBase/${!this.dataForm.id ? 'add' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'code': this.dataForm.code,
'alarmClass': this.dataForm.alarmClass,
'alarmInfo': this.dataForm.alarmInfo
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>