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

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

parent 2743b7d6
......@@ -13,8 +13,8 @@ module.exports = {
// 代理后端服务器
proxyTable: {
'/host': {
target: 'http://10.100.172.150:9108', //设置你调用的接口域名和端口号 别忘了加http
// target: 'http://192.168.43.244:8888',// 东伟服务器地址
// target: 'http://10.100.172.150:9108', //设置你调用的接口域名和端口号 别忘了加http
target: 'http://192.168.43.244:8888',// 东伟服务器地址
changeOrigin: true,
pathRewrite: {
'^/host': ''//这里理解成用‘/host’代替target里面的地址,后面组件中我们掉接口时直接用api代替 比如我要调用'http://40.00.100.100:3002/user/add',直接写‘/api/user/add’即可
......
......@@ -71,12 +71,12 @@
"url": "/api/check/addCheckRecord",
"method": "post"
},
"deleteCheckItemModelById-delete": {
"url": "/api/check/deleteCheckItemModelById",
"id-delete": {
"url": "/api/check/deleteCheckItemModelById/{id}",
"method": "delete"
},
"expert-post": {
"url": "/api/check/expert",
"recordId-post": {
"url": "/api/check/expert/{recordId}",
"method": "post"
},
"getCheckByType-get": {
......@@ -168,6 +168,12 @@
"method": "get"
}
},
"led-controller": {
"ledInfo-get": {
"url": "/api/led/ledInfo",
"method": "get"
}
},
"report-data-source-controller": {
"reportDataSource-post": {
"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>
<el-dialog
title="新增报告"
:visible.sync="dialogToggle"
:show-close="false"
:close-on-press-escape="false"
:close-on-click-modal="false"
width="1200px">
<div style="padding-bottom: 10px">
<el-button
size="small"
type="primary">
新增检测项
</el-button>
</div>
<!-- 点检模板表格 -->
<el-table
style="width: 80%; margin-bottom: 10px"
:data="checkTemplate"
tooltip-effect="dark"
stripe
border>
<el-table-column
label="序号"
width="60px">
<template slot-scope="scope">
{{ scope.row.id }}
</template>
</el-table-column>
<el-table-column
label="版本状态/Rev">
<template slot-scope="scope">
{{ scope.row.rev }}
</template>
</el-table-column>
<el-table-column
label="记录编号/Sheet No.">
<template slot-scope="scope">
{{ scope.row.sheetNo }}
</template>
</el-table-column>
<el-table-column
label="流水码/No.">
<template slot-scope="scope">
{{ scope.row.no }}
</template>
</el-table-column>
<el-table-column
label="化验员">
<template slot-scope="scope">
{{ scope.row.createBy }}
</template>
</el-table-column>
<el-table-column
label="检测日期"
fixed="right">
<template slot-scope="scope">
{{ formatTime(scope.row.createTime, 'YYYY-MM-DD') }}
</template>
</el-table-column>
</el-table>
<!-- 点检项表格 -->
<el-table
style="width: 100%"
:data="checkItem"
tooltip-effect="dark"
stripe
border>
<el-table-column
label="序号">
<template slot-scope="scope">
<el-input-number
style="width: 100%"
v-model="scope.row.orderNum"
controls-position="right"
size="small">
</el-input-number>
</template>
</el-table-column>
<el-table-column
label="检测项目">
<template slot-scope="scope">
{{ scope.row.name }}
</template>
</el-table-column>
<el-table-column
label="检测指标">
<template slot-scope="scope">
<el-input-number
style="width: 100%"
v-model="scope.row.checkResult"
controls-position="right"
:precision="2"
size="small">
</el-input-number>
</template>
</el-table-column>
<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>
<span slot="footer" class="dialog-footer">
<el-button :loading="loadingToggle" size="small" type="primary" icon="el-icon-check">确认</el-button>
<el-button size="small" icon="el-icon-close" @click="doCancelClick()">取消</el-button>
</span>
</el-dialog>
<div>
<el-dialog
title="新增报告"
:visible.sync="dialogToggle"
:show-close="false"
:close-on-press-escape="false"
:close-on-click-modal="false"
width="1200px">
<div style="padding-bottom: 10px">
<el-button
size="small"
type="primary"
@click="doAddCheckItemClick()">
新增检测项
</el-button>
</div>
<!-- 点检模板表格 -->
<el-table
style="width: 80%; margin-bottom: 10px"
:data="checkTemplate"
tooltip-effect="dark"
stripe
border>
<el-table-column
label="序号"
width="60">
<template slot-scope="scope">
{{ scope.row.id }}
</template>
</el-table-column>
<el-table-column
label="版本状态/Rev">
<template slot-scope="scope">
<el-input
size="small"
v-model="scope.row.rev"
maxlength="50">
</el-input>
</template>
</el-table-column>
<el-table-column
label="记录编号/Sheet No.">
<template slot-scope="scope">
<el-input
size="small"
v-model="scope.row.sheetNo"
maxlength="50">
</el-input>
</template>
</el-table-column>
<el-table-column
label="流水码/No.">
<template slot-scope="scope">
<el-input
size="small"
v-model="scope.row.no"
maxlength="50">
</el-input>
</template>
</el-table-column>
<el-table-column
label="化验员">
<template slot-scope="scope">
<el-input
size="small"
v-model="scope.row.createBy"
maxlength="50">
</el-input>
</template>
</el-table-column>
<el-table-column
label="检测日期"
fixed="right">
<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>
<!-- 点检项表格 -->
<el-table
style="width: 100%"
:data="checkItem"
tooltip-effect="dark"
stripe
border>
<el-table-column
label="序号"
width="55">
<template slot-scope="scope">
{{ scope.row.orderNum }}
</template>
</el-table-column>
<el-table-column
label="检测项目">
<template slot-scope="scope">
{{ scope.row.name }}
</template>
</el-table-column>
<el-table-column
width="55"
align="center">
<template slot-scope="scope">
<span v-if="scope.row.isNecessary"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column
label="检测指标">
<template slot-scope="scope">
<el-input-number
style="width: 100%"
v-model="scope.row.checkResult"
controls-position="right"
:precision="2"
size="small"
placeholder="请输入检测指标">
</el-input-number>
</template>
</el-table-column>
<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>
<script>
import Moment from 'moment'
import AddCheckItem from './AddCheckItem'
export default {
components: {
AddCheckItem
},
watch: {
dialogToggle (newVal, oldVal) {
this.currentLoginName = window.sessionStorage.getItem('Admin-Name')
// 查询酸洗检测模板
this.getCheckByPickling()
}
......@@ -143,19 +199,14 @@
loadingToggle: false,
// 对话框开关标识
dialogToggle: false,
// 检测模板id
checkModelId: '',
// 模板数据
checkTemplate: [],
// 模板项数据
checkItem: [
{
orderNum: 1,
name: '游离碱FAL',
checkResult: '1',
rangeAll: '2-10',
frequency: '班/次',
createTime: ''
}
]
checkItem: [],
// 当前登录人名称
currentLoginName: ''
}
},
methods: {
......@@ -163,17 +214,53 @@
formatTime (time, format) {
return Moment(time).format(format)
},
// 点击新增检测项按钮
doAddCheckItemClick () {
this.$refs.AddCheckItem.dialogToggle = true
},
// 查询酸洗检测模板
getCheckByPickling () {
let queryParams = { type: 'PICKLING' }
this.$fetch('daily-check-controller/getCheckByType-get', queryParams).then(response => {
this.checkTemplate = []
this.checkItem = []
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 () {
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 @@
methods: {
// 检测子路由是否有权限访问
checkCurrentRouteAuthority (children, item) {
console.log('qxCHILD', children)
console.log('qxITEM', item)
if (!item.meta) {
return false; // 匹配到框架级路由
} 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