Commit c9931b17 by lichengming

修改了试样检测

parent 7b7fc2e8
...@@ -21,5 +21,7 @@ export default { ...@@ -21,5 +21,7 @@ export default {
pageExpTest: data => pageExpTest: data =>
http.post('soil/v1/entrust/page_exp_test', data).then(res => res), http.post('soil/v1/entrust/page_exp_test', data).then(res => res),
samplePage: data => http.post('soil/v1/sample/page', data).then(res => res), samplePage: data => http.post('soil/v1/sample/page', data).then(res => res),
pageExpTestSample: data =>
http.post('soil/v1/sample/page_exp_test_sample', data).then(res => res),
pageItem: data => http.post('soil/v1/experiment/page', data).then(res => res) pageItem: data => http.post('soil/v1/experiment/page', data).then(res => res)
} }
<template>
<div>
<Modal v-model="showBackModal" :mask-closable="false" class="zIndex-1100">
<p slot="header">
{{ modalTitle }}
</p>
<div>
<Form id="contract-back-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="90">
<Form-item label="判定结果:" prop="singleJudge">
<RadioGroup v-model="formObj.singleJudge">
<Radio :label="'PASS'">
合格
</Radio>
<Radio :label="'FAIL'">
不合格
</Radio>
<Radio :label="'NO_TEST'">
不检测
</Radio>
<Radio :label="'NO_JUDGE'">
不判定
</Radio>
</RadioGroup>
</Form-item>
</Form>
</div>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div>
</Modal>
</div>
</template>
<script>
/**
* 判定
*/
import { soilTest } from '../../../api'
export default {
components: {},
data() {
return {
ids: [], // 合同ids
modalTitle: '判定',
showBackModal: false,
formObj: {
singleJudge: 'PASS'
},
path: '',
ruleValidate: {
singleJudge: [
{ required: true, message: '判定结果不能为空', trigger: 'blur' }
]
},
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
]
}
},
methods: {
_open(ids) {
this.ids = ids // 合同id
this.showBackModal = true
this.formObj.singleJudge = 'PASS'
this._hideLoading()
},
_cancel() {
this.showBackModal = false
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_resultChange(result, msg) {
if (result) {
this.showBackModal = false
this.$Message.success(msg)
this.$emit('on-result-change')
}
this._hideLoading()
},
_save: async function(data) {
const result = await soilTest.handJudge(data)
this._resultChange(result, '操作成功')
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
const data = this.$serialize('edit-form')
data.singleJudge = this.formObj.singleJudge
data.itemIds = this.ids.join(',')
this._save(data)
} else {
this.$Message.error('表单验证失败')
this._hideLoading()
}
})
}
}
}
</script>
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
import UserInfo from '../../../components/user-info-single/AssignPerson' import UserInfo from '../../../components/user-info-single/AssignPerson'
import { soilTest } from '../../../api' import { soilTest } from '../../../api'
import Operation from '../../../components/operation/Operation' import Operation from '../../../components/operation/Operation'
import dataEntry from './tabs/dataEntry' import dataEntry from './dataEntry'
export default { export default {
components: { components: {
UserInfo, UserInfo,
......
...@@ -83,12 +83,14 @@ ...@@ -83,12 +83,14 @@
</div> </div>
</template> </template>
<script> <script>
import { soilTest } from '../../../../api' import { soilTest } from '../../../api'
import fillResult from '../fillResult' import fillResult from './fillResult'
export default { export default {
components: { fillResult }, components: { fillResult },
data() { data() {
return { return {
formId: 'dataEntry',
modalTitle: '管理样品',
searchOpen: true, searchOpen: true,
showModal: false, showModal: false,
formObj: { formObj: {
...@@ -139,7 +141,7 @@ export default { ...@@ -139,7 +141,7 @@ export default {
_page: async function(id) { _page: async function(id) {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.entrustId = id this.formObj.entrustId = id
const result = await soilTest.samplePage( const result = await soilTest.pageExpTestSample(
this.$serializeForm(this.formObj) this.$serializeForm(this.formObj)
) )
if (result) { if (result) {
......
...@@ -57,9 +57,9 @@ ...@@ -57,9 +57,9 @@
<Button @click="_detectionValue" style="margin-bottom: 5px" type="primary"> <Button @click="_detectionValue" style="margin-bottom: 5px" type="primary">
填写检测值 填写检测值
</Button> </Button>
<Button @click="_selectEquipmentByIds" style="margin-bottom: 5px" type="primary"> <!-- <Button @click="_selectEquipmentByIds" style="margin-bottom: 5px" type="primary">-->
选择仪器设备 <!-- 选择仪器设备-->
</Button> <!-- </Button>-->
</Col> </Col>
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
...@@ -118,6 +118,7 @@ ...@@ -118,6 +118,7 @@
align="center" align="center"
fixed="right" fixed="right"
> >
<icon-list :msg="iconMsgDised" @on-result-change="_iconClick"></icon-list>
</el-table-column> </el-table-column>
</element-table> </element-table>
</Col> </Col>
...@@ -127,13 +128,17 @@ ...@@ -127,13 +128,17 @@
</div> </div>
</Modal> </Modal>
<!--判定--> <!--判定-->
<Judge ref="judgeModal" @on-result-change="_page" />
<!--填写检测值-->
<fillTestValue ref="valueModal" @on-result-change="_page"></fillTestValue>
</div> </div>
</template> </template>
<script> <script>
import { soilTest } from '../../../api' import { soilTest } from '../../../api'
import fillTestValue from './fillTestValue'
import Judge from './Judge'
export default { export default {
components: {}, components: { fillTestValue, Judge },
data() { data() {
return { return {
formObj: { formObj: {
...@@ -151,8 +156,7 @@ export default { ...@@ -151,8 +156,7 @@ export default {
btn: [ btn: [
{ type: 'primary', id: '', name: '确认' }, { type: 'primary', id: '', name: '确认' },
{ type: 'primary', id: '', name: '判定' }, { type: 'primary', id: '', name: '判定' },
{ type: 'primary', id: '', name: '填写检测值' }, { type: 'primary', id: '', name: '填写检测值' }
{ type: 'primary', id: '', name: '选择仪器设备' }
], ],
footerList: [ footerList: [
{ id: '', type: '', name: '取消' }, { id: '', type: '', name: '取消' },
...@@ -166,6 +170,16 @@ export default { ...@@ -166,6 +170,16 @@ export default {
{ title: '试验项目英文简写', key: 'shortName', width: 140 }, { title: '试验项目英文简写', key: 'shortName', width: 140 },
{ title: '大类', key: 'mainType', width: 140 }, { title: '大类', key: 'mainType', width: 140 },
{ title: '小类', key: 'smallType' }, { title: '小类', key: 'smallType' },
{ title: '检测结果', key: 'testValue', width: 160 },
{ title: '限值', key: 'limitValue', width: 130 },
{ title: '比较符', key: 'compareSymbol', width: 160 },
{ title: '单位', key: 'unit', width: 100 },
{
title: '判定结果',
key: 'singleJudge',
width: 140,
singleJudge: true
},
{ title: '检测依据', key: 'testBasis', width: 180 }, { title: '检测依据', key: 'testBasis', width: 180 },
{ title: '试验方法', key: 'testMethod', width: 180 }, { title: '试验方法', key: 'testMethod', width: 180 },
{ title: '状态', key: 'status', width: 180 } { title: '状态', key: 'status', width: 180 }
......
<template>
<Modal v-model="detectionModal" :mask-closable="false" width="400">
<p slot="header">
填写检测值
</p>
<Form
id="edit-form"
ref="formObj"
:model="formObj"
:rules="ruleValidate"
:label-width="80"
onsubmit="return false"
inline
>
<Form-item label="检测结果" prop="testValue" style="width: 100%;">
<Input v-model="formObj.testValue" name="testValue" placeholder="请填写检测结果值" />
</Form-item>
</Form>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div>
</Modal>
</template>
<script>
import { soilTest } from '../../../api'
const defVal = {
testValue: ''
}
export default {
name: 'DetectionValue',
data() {
return {
detectionModal: false,
formObj: defVal,
ruleValidate: {
testValue: [
{ required: true, message: '检测结果值不能为空!', trigger: 'blur' }
]
},
footerList: [
{ id: '', type: '', name: '取消' },
{ id: '', type: 'primary', name: '保存' }
],
selectIds: []
}
},
methods: {
_open(ids) {
this.detectionModal = true
this.$refs.formObj.resetFields()
this.formObj = Object.assign({}, {}, defVal)
this._hideLoading()
this.selectIds = ids
},
_footerResult(msg) {
switch (msg) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_ok(msg) {
this.$refs.formObj.validate(valid => {
if (valid) {
const data = this.$serialize('edit-form')
data.itemIds = this.selectIds.join(',')
data.testValue = this.formObj.testValue
this._save(data)
} else {
this.$Message.error('表单验证失败')
this._hideLoading()
}
})
},
_cancel() {
this.detectionModal = false
},
_resultChange(result, msg) {
if (result) {
this.detectionModal = false
this.$Message.success(msg)
this.$emit('on-result-change')
}
this._hideLoading()
},
_save: async function(data) {
const result = await soilTest.testValue(data)
this._resultChange(result, '提交成功')
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
}
}
}
</script>
<style scoped>
</style>
...@@ -12,6 +12,10 @@ ...@@ -12,6 +12,10 @@
<WaitScan ref="waitScanModal"></WaitScan> <WaitScan ref="waitScanModal"></WaitScan>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<!-- <keep-alive>-->
<!-- &lt;!&ndash; eslint-disable-next-line vue/require-component-is &ndash;&gt;-->
<!-- <component ref="refModal" :is="currentComponent"></component>-->
<!-- </keep-alive>-->
</div> </div>
</Modal> </Modal>
</div> </div>
...@@ -34,9 +38,13 @@ export default { ...@@ -34,9 +38,13 @@ export default {
modalTitle: '', modalTitle: '',
selectIds: [], selectIds: [],
activeName: 'waitReceive', activeName: 'waitReceive',
name: '' name: '',
currentComponent: ''
} }
}, },
mounted() {
// this.currentComponent = 'waitScan'
},
methods: { methods: {
_open(contractId, type, name) { _open(contractId, type, name) {
this.type = type // 类型(采样或送样) this.type = type // 类型(采样或送样)
...@@ -44,6 +52,7 @@ export default { ...@@ -44,6 +52,7 @@ export default {
this.showSampleModal = true this.showSampleModal = true
this.entrustId = contractId // 合同id this.entrustId = contractId // 合同id
this.activeName = 'waitReceive' this.activeName = 'waitReceive'
// this.currentComponent = 'waitScan'
this.selectIds = [] this.selectIds = []
this._waitPage() this._waitPage()
}, },
......
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