Commit 185a78cc authored by 李志鸣's avatar 李志鸣

fea(api文件): 更新api文件

parent 2743b7d6
...@@ -13,8 +13,8 @@ module.exports = { ...@@ -13,8 +13,8 @@ module.exports = {
// 代理后端服务器 // 代理后端服务器
proxyTable: { proxyTable: {
'/host': { '/host': {
target: 'http://10.100.172.150:9108', //设置你调用的接口域名和端口号 别忘了加http // target: 'http://10.100.172.150:9108', //设置你调用的接口域名和端口号 别忘了加http
// target: 'http://192.168.43.244:8888',// 东伟服务器地址 target: 'http://192.168.43.244:8888',// 东伟服务器地址
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
'^/host': ''//这里理解成用‘/host’代替target里面的地址,后面组件中我们掉接口时直接用api代替 比如我要调用'http://40.00.100.100:3002/user/add',直接写‘/api/user/add’即可 '^/host': ''//这里理解成用‘/host’代替target里面的地址,后面组件中我们掉接口时直接用api代替 比如我要调用'http://40.00.100.100:3002/user/add',直接写‘/api/user/add’即可
......
...@@ -71,12 +71,12 @@ ...@@ -71,12 +71,12 @@
"url": "/api/check/addCheckRecord", "url": "/api/check/addCheckRecord",
"method": "post" "method": "post"
}, },
"deleteCheckItemModelById-delete": { "id-delete": {
"url": "/api/check/deleteCheckItemModelById", "url": "/api/check/deleteCheckItemModelById/{id}",
"method": "delete" "method": "delete"
}, },
"expert-post": { "recordId-post": {
"url": "/api/check/expert", "url": "/api/check/expert/{recordId}",
"method": "post" "method": "post"
}, },
"getCheckByType-get": { "getCheckByType-get": {
...@@ -168,6 +168,12 @@ ...@@ -168,6 +168,12 @@
"method": "get" "method": "get"
} }
}, },
"led-controller": {
"ledInfo-get": {
"url": "/api/led/ledInfo",
"method": "get"
}
},
"report-data-source-controller": { "report-data-source-controller": {
"reportDataSource-post": { "reportDataSource-post": {
"url": "/api/reportDataSource", "url": "/api/reportDataSource",
......
<template>
<el-dialog
title="新增检测项"
:visible.sync="dialogToggle"
:show-close="false"
:close-on-press-escape="false"
:close-on-click-modal="false"
width="600px">
<el-form
label-width="100px"
label-position="top"
ref="form"
:model="formData"
:rules="formRules">
<el-row :gutter="30">
<el-col :span="12">
<el-form-item
label="序号"
prop="orderNum"
required>
<el-input-number
:min="0"
:max="999999999"
style="width: 100%"
v-model="formData.orderNum"
controls-position="right"
size="small"
placeholder="请输入序号">
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="检测项目"
prop="name"
required>
<el-input
maxlength="50"
v-model="formData.name"
size="small"
style="width: 100%"
placeholder="请输入检测项目">
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
<el-form-item
label="控制范围(下限)"
prop="rangeLower"
required>
<el-input-number
:min="0"
:max="999999999"
style="width: 100%"
v-model="formData.rangeLower"
controls-position="right"
size="small"
placeholder="请输入控制范围(下限)">
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="控制范围(上限)"
prop="rangeUpper"
required>
<el-input-number
:min="0"
:max="999999999"
style="width: 100%"
v-model="formData.rangeUpper"
controls-position="right"
size="small"
placeholder="请输入控制范围(上限)">
</el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
<el-form-item
label="频次"
prop="frequency"
required>
<el-input
maxlength="50"
v-model="formData.frequency"
size="small"
style="width: 100%"
placeholder="请输入频次">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="是否为必检项"
prop="isNecessary"
required>
<el-select
v-model="formData.isNecessary"
placeholder="请选择是否为必检项"
size="small"
style="width: 100%">
<el-option label="是" value="true"></el-option>
<el-option label="否" value="false"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button :loading="loadingToggle" size="small" type="primary" icon="el-icon-check" @click="doConfirmClick('form')">确认</el-button>
<el-button size="small" icon="el-icon-close" @click="doCancelClick('form')">取消</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
props: {
checkModelId: {}
},
data () {
return {
// 数据提交状态开关标识
loadingToggle: false,
// 对话框开关标识
dialogToggle: false,
// 表单数据
formData: {
orderNum: '',
name: '',
rangeUpper: '',
rangeLower: '',
frequency: '',
isNecessary: ''
},
// 表单正则
formRules: {
// 序号
orderNum: [
{
validator: (rule, value, callback) => {
if (_.trim(value) === '') {
callback(new Error('请输入序号'))
}
callback()
},
trigger: ['change', 'blur']
}
],
// 检测项目
name: [
{
validator: (rule, value, callback) => {
if (_.trim(value) === '') {
callback(new Error('请输入检测项目'))
}
callback()
},
trigger: ['change', 'blur']
}
],
// 控制范围(上限)
rangeUpper: [
{
validator: (rule, value, callback) => {
if (_.trim(value) === '') {
callback(new Error('请输入控制范围(上限)'))
}
callback()
},
trigger: ['change', 'blur']
}
],
// 控制范围(下限)
rangeLower: [
{
validator: (rule, value, callback) => {
if (_.trim(value) === '') {
callback(new Error('请输入控制范围(下限)'))
}
callback()
},
trigger: ['change', 'blur']
}
],
// 频次
frequency: [
{
validator: (rule, value, callback) => {
if (_.trim(value) === '') {
callback(new Error('请输入频次'))
}
callback()
},
trigger: ['change', 'blur']
}
],
// 是否为必检项
isNecessary: [
{
validator: (rule, value, callback) => {
if (_.trim(value) === '') {
callback(new Error('请选择必检项'))
}
callback()
},
trigger: ['change', 'blur']
}
]
}
}
},
methods: {
// 点击确认按钮
doConfirmClick (formName) {
this.$refs[formName].validate(vaild => {
if (vaild) {
this.loadingToggle = true
let queryParams = { ...this.formData }
queryParams.checkModelId = this.checkModelId
queryParams.rangeAll = `${this.formData.rangeLower}-${this.formData.rangeUpper}`
this.$fetch('daily-check-controller/saveCheckItemModel-post', queryParams).then(response => {
this.loadingToggle = false
this.$message.success('新增检测项成功!')
this.dialogToggle = false
this.$refs[formName].resetFields()
this.$emit('doConfirmClick')
for (let key in this.formData) {
this.formData[key] = ''
}
}).catch(() => {
this.loadingToggle = false
})
}
})
},
// 点击取消按钮
doCancelClick (formName) {
this.$refs[formName].resetFields()
this.dialogToggle = false
for (let key in this.formData) {
this.formData[key] = ''
}
}
}
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
<template> <template>
<el-dialog <div>
title="新增报告" <el-dialog
:visible.sync="dialogToggle" title="新增报告"
:show-close="false" :visible.sync="dialogToggle"
:close-on-press-escape="false" :show-close="false"
:close-on-click-modal="false" :close-on-press-escape="false"
width="1200px"> :close-on-click-modal="false"
<div style="padding-bottom: 10px"> width="1200px">
<el-button <div style="padding-bottom: 10px">
size="small" <el-button
type="primary"> size="small"
新增检测项 type="primary"
</el-button> @click="doAddCheckItemClick()">
</div> 新增检测项
<!-- 点检模板表格 --> </el-button>
<el-table </div>
style="width: 80%; margin-bottom: 10px" <!-- 点检模板表格 -->
:data="checkTemplate" <el-table
tooltip-effect="dark" style="width: 80%; margin-bottom: 10px"
stripe :data="checkTemplate"
border> tooltip-effect="dark"
<el-table-column stripe
label="序号" border>
width="60px"> <el-table-column
<template slot-scope="scope"> label="序号"
{{ scope.row.id }} width="60">
</template> <template slot-scope="scope">
</el-table-column> {{ scope.row.id }}
<el-table-column </template>
label="版本状态/Rev"> </el-table-column>
<template slot-scope="scope"> <el-table-column
{{ scope.row.rev }} label="版本状态/Rev">
</template> <template slot-scope="scope">
</el-table-column> <el-input
<el-table-column size="small"
label="记录编号/Sheet No."> v-model="scope.row.rev"
<template slot-scope="scope"> maxlength="50">
{{ scope.row.sheetNo }} </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="流水码/No."> label="记录编号/Sheet No.">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.no }} <el-input
</template> size="small"
</el-table-column> v-model="scope.row.sheetNo"
<el-table-column maxlength="50">
label="化验员"> </el-input>
<template slot-scope="scope"> </template>
{{ scope.row.createBy }} </el-table-column>
</template> <el-table-column
</el-table-column> label="流水码/No.">
<el-table-column <template slot-scope="scope">
label="检测日期" <el-input
fixed="right"> size="small"
<template slot-scope="scope"> v-model="scope.row.no"
{{ formatTime(scope.row.createTime, 'YYYY-MM-DD') }} maxlength="50">
</template> </el-input>
</el-table-column> </template>
</el-table> </el-table-column>
<!-- 点检项表格 --> <el-table-column
<el-table label="化验员">
style="width: 100%" <template slot-scope="scope">
:data="checkItem" <el-input
tooltip-effect="dark" size="small"
stripe v-model="scope.row.createBy"
border> maxlength="50">
<el-table-column </el-input>
label="序号"> </template>
<template slot-scope="scope"> </el-table-column>
<el-input-number <el-table-column
style="width: 100%" label="检测日期"
v-model="scope.row.orderNum" fixed="right">
controls-position="right" <template slot-scope="scope">
size="small"> <el-date-picker
</el-input-number> style="width: 100%"
</template> v-model="scope.row.createTime"
</el-table-column> type="date"
<el-table-column size="small"
label="检测项目"> placeholder="请选择检测日期">
<template slot-scope="scope"> </el-date-picker>
{{ scope.row.name }} </template>
</template> </el-table-column>
</el-table-column> </el-table>
<el-table-column <!-- 点检项表格 -->
label="检测指标"> <el-table
<template slot-scope="scope"> style="width: 100%"
<el-input-number :data="checkItem"
style="width: 100%" tooltip-effect="dark"
v-model="scope.row.checkResult" stripe
controls-position="right" border>
:precision="2" <el-table-column
size="small"> label="序号"
</el-input-number> width="55">
</template> <template slot-scope="scope">
</el-table-column> {{ scope.row.orderNum }}
<el-table-column </template>
label="控制范围"> </el-table-column>
<template slot-scope="scope"> <el-table-column
{{ scope.row.rangeAll }} label="检测项目">
</template> <template slot-scope="scope">
</el-table-column> {{ scope.row.name }}
<el-table-column </template>
label="频次"> </el-table-column>
<template slot-scope="scope"> <el-table-column
{{ scope.row.frequency }} width="55"
</template> align="center">
</el-table-column> <template slot-scope="scope">
<el-table-column <span v-if="scope.row.isNecessary"></span>
label="取样时间"> <span v-else></span>
<template slot-scope="scope"> </template>
<el-date-picker </el-table-column>
style="width: 100%" <el-table-column
v-model="scope.row.createTime" label="检测指标">
type="date" <template slot-scope="scope">
size="small" <el-input-number
placeholder="请选择取样时间"> style="width: 100%"
</el-date-picker> v-model="scope.row.checkResult"
</template> controls-position="right"
</el-table-column> :precision="2"
</el-table> size="small"
<span slot="footer" class="dialog-footer"> placeholder="请输入检测指标">
<el-button :loading="loadingToggle" size="small" type="primary" icon="el-icon-check">确认</el-button> </el-input-number>
<el-button size="small" icon="el-icon-close" @click="doCancelClick()">取消</el-button> </template>
</span> </el-table-column>
</el-dialog> <el-table-column
label="控制范围">
<template slot-scope="scope">
{{ scope.row.rangeAll }}
</template>
</el-table-column>
<el-table-column
label="频次">
<template slot-scope="scope">
{{ scope.row.frequency }}
</template>
</el-table-column>
<el-table-column
label="取样时间">
<template slot-scope="scope">
<el-date-picker
style="width: 100%"
v-model="scope.row.createTime"
type="date"
size="small"
placeholder="请选择取样时间">
</el-date-picker>
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="55">
<template slot-scope="scope">
<el-button
type="text"
size="small"
style="color: rgb(244, 116, 118)"
@click="doCheckItemDelect(scope.row)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button :loading="loadingToggle" size="small" type="primary" icon="el-icon-check" @click="doConfirmClick()">确认</el-button>
<el-button size="small" icon="el-icon-close" @click="doCancelClick()">取消</el-button>
</span>
</el-dialog>
<!-- 新增检测项对话框 -->
<AddCheckItem
ref="AddCheckItem"
:checkModelId="checkModelId"
@doConfirmClick="doAddCheckItemConfirmClick">
</AddCheckItem>
</div>
</template> </template>
<script> <script>
import Moment from 'moment' import Moment from 'moment'
import AddCheckItem from './AddCheckItem'
export default { export default {
components: {
AddCheckItem
},
watch: { watch: {
dialogToggle (newVal, oldVal) { dialogToggle (newVal, oldVal) {
this.currentLoginName = window.sessionStorage.getItem('Admin-Name')
// 查询酸洗检测模板 // 查询酸洗检测模板
this.getCheckByPickling() this.getCheckByPickling()
} }
...@@ -143,19 +199,14 @@ ...@@ -143,19 +199,14 @@
loadingToggle: false, loadingToggle: false,
// 对话框开关标识 // 对话框开关标识
dialogToggle: false, dialogToggle: false,
// 检测模板id
checkModelId: '',
// 模板数据 // 模板数据
checkTemplate: [], checkTemplate: [],
// 模板项数据 // 模板项数据
checkItem: [ checkItem: [],
{ // 当前登录人名称
orderNum: 1, currentLoginName: ''
name: '游离碱FAL',
checkResult: '1',
rangeAll: '2-10',
frequency: '班/次',
createTime: ''
}
]
} }
}, },
methods: { methods: {
...@@ -163,17 +214,53 @@ ...@@ -163,17 +214,53 @@
formatTime (time, format) { formatTime (time, format) {
return Moment(time).format(format) return Moment(time).format(format)
}, },
// 点击新增检测项按钮
doAddCheckItemClick () {
this.$refs.AddCheckItem.dialogToggle = true
},
// 查询酸洗检测模板 // 查询酸洗检测模板
getCheckByPickling () { getCheckByPickling () {
let queryParams = { type: 'PICKLING' } let queryParams = { type: 'PICKLING' }
this.$fetch('daily-check-controller/getCheckByType-get', queryParams).then(response => { this.$fetch('daily-check-controller/getCheckByType-get', queryParams).then(response => {
this.checkTemplate = []
this.checkItem = []
this.checkTemplate.push(_.cloneDeep(response.checkModel)) this.checkTemplate.push(_.cloneDeep(response.checkModel))
// this.checkItem = _.cloneDeep(response.checkItem) this.checkTemplate[0].createBy = this.currentLoginName
this.checkModelId = _.cloneDeep(response.checkModel.id)
this.checkItem = _.cloneDeep(response.checkItem)
}) })
}, },
// 点击确认按钮
doConfirmClick () {
let queryParams = { checkRecord: this.checkTemplate[0], itemRecords: this.checkItem }
console.log(queryParams)
},
// 点击取消按钮 // 点击取消按钮
doCancelClick () { doCancelClick () {
this.dialogToggle = false this.dialogToggle = false
this.checkTemplate = []
this.checkItem = []
},
// 点击检测项删除按钮
doCheckItemDelect (checkItem) {
this.$confirm(`确定要删除序号为 ${checkItem.orderNum},检测项目为 ${checkItem.name} 的检测项么?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
center: true
}).then(() => {
let queryParams = { id: checkItem.id, hash: 'id' }
this.$fetch('daily-check-controller/deleteCheckItemModelById-delete', queryParams).then(response => {
this.$message.success('删除成功!')
// 查询酸洗检测模板
this.getCheckByPickling()
})
})
},
// 点击新增检测项对话框确认按钮
doAddCheckItemConfirmClick () {
// 查询酸洗检测模板
this.getCheckByPickling()
} }
} }
} }
......
...@@ -65,8 +65,6 @@ ...@@ -65,8 +65,6 @@
methods: { methods: {
// 检测子路由是否有权限访问 // 检测子路由是否有权限访问
checkCurrentRouteAuthority (children, item) { checkCurrentRouteAuthority (children, item) {
console.log('qxCHILD', children)
console.log('qxITEM', item)
if (!item.meta) { if (!item.meta) {
return false; // 匹配到框架级路由 return false; // 匹配到框架级路由
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment