Commit 4be57a60 by lichengming

修改了试样检测页面

parent e1f58483
<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>
<template>
<div>
<div>
<Form onsubmit="return false">
<Form-item>
<Input v-model="key" @on-enter="_search" placeholder="请输入关键字,回车查询" style="width:100%"
icon="ios-search-strong"/>
</Form-item>
</Form>
</div>
<!--加载中-->
<div v-show="isloading" class="demo-spin-container spin-bg tree_height">
<Spin fix size="large"></Spin>
</div>
<ul :id="treeId" v-show="isTree"
class="ztree ztreePro tree_height" style="overflow-x: auto;"></ul>
</div>
</template>
<style>
</style>
<script>
/**
* 原始记录类别添加编辑Ztree
*/
export default {
data() {
return {
treeId: '',
key: '',
isloading: true,
isTree: false,
setting: {
data: {
simpleData: {
enable: true,
idKey: 'id',
pIdKey: 'pid'
}
},
callback: {
onClick: this.zTreeOnClick
}
},
businessTypeList: ''
}
},
created() {
// this._Ztree()
},
methods: {
_Ztree(tableHeight, businessTypeList) {
this.key = ''
this.treeId = 'oriRecordClassTree' + this.$randomCode()
this.isloading = true
this.isTree = false
if (businessTypeList === undefined) {
// 查询所有类别
this._request()
} else {
// 采样实/实验室不同类型
this.businessTypeList = businessTypeList
// this._requestByBusinessTypeList()
}
if (tableHeight) {
$('.tree_height').height(tableHeight)
} else {
$('.tree_height').height(document.documentElement.clientHeight - 230)
}
},
zTreeOnClick(event, treeId, treeNode) {
this.$emit('on-result-change', treeNode)
},
_search() {
this.isloading = true
this.isTree = false
// 查询实验室、采样、所有类型的数据
if (this.businessTypeList !== undefined) {
// this._requestByBusinessTypeList()
} else {
this._request()
}
this.$emit('on-result-change')
},
// 原始记录模板管理查env所有的类别
_request() {
const data = {}
if (this.key) {
data.name = this.key
}
this.$store.dispatch('ElnTemplateCategory/list', data).then(() => {
const treeObj = $.fn.zTree.init(
$('#' + this.treeId),
this.setting,
this.$store.state.ElnTemplateCategory.list
)
treeObj.expandAll(true)
setTimeout(() => {
this.isloading = false
this.isTree = true
}, 300)
})
},
// 采样/实验室查env下,不同类型(采样/实验室)的树数据
_requestByBusinessTypeList() {
const data = {}
data.businessTypeList = this.businessTypeList
if (this.key) {
data.name = this.key
}
this.$store.dispatch('ElnTemplateCategory/listType', data).then(() => {
const treeObj = $.fn.zTree.init(
$('#' + this.treeId),
this.setting,
this.$store.state.ElnTemplateCategory.list
)
treeObj.expandAll(true)
setTimeout(() => {
this.isloading = false
this.isTree = true
}, 300)
})
}
}
}
</script>
...@@ -80,6 +80,8 @@ export default { ...@@ -80,6 +80,8 @@ export default {
} }
}, },
_search() { _search() {
this.$refs.waitReceiveModal._clearTable()
this.$refs.waitScanModal._clearTable()
this.$emit('on-result-change') this.$emit('on-result-change')
}, },
// 关闭弹框的时候刷新上个界面 // 关闭弹框的时候刷新上个界面
......
...@@ -70,14 +70,12 @@ ...@@ -70,14 +70,12 @@
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 './dataEntry'
import SampleManage from './SampleManage' import SampleManage from './SampleManage'
export default { export default {
components: { components: {
UserInfo, UserInfo,
Operation, Operation,
// eslint-disable-next-line vue/no-unused-components // eslint-disable-next-line vue/no-unused-components
dataEntry,
SampleManage SampleManage
}, },
data() { data() {
......
<template>
<div>
<Modal v-model="showModal" width="1000">
<p slot="header">
{{ modalTitle }}
</p>
<Row>
<!--查询-->
<Col span="24">
<Form
v-show="searchOpen"
:label-width="70"
inline
onsubmit="return false"
class="search-form"
>
<label class="label-sign" />
<Form-item class="search-item" label="样本号:">
<Input v-model="formObj.sampleCode" @on-enter="_formSearch" placeholder="请输入样本号" clearable />
</Form-item>
<Form-item class="search-item" label="样品名称:">
<Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入样品名称" clearable />
</Form-item>
<!-- <Form-item label="检测类型:" class="search-item" prop="category">-->
<!-- <Input v-model="formObj.category" placeholder="请输入检测类型" clearable @on-enter="_formSearch" />-->
<!-- </Form-item>-->
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" show-search-btn="true" style="height: 30px;" />
</Col>
<!--table-->
<Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange">
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
<!-- <template v-if="item.dateTime">-->
<!-- {{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):'' }}-->
<!-- </template>-->
<template v-if="item.status">
{{ scope.row[item.key] === undefined ? '': scope.row[item.key].display }}
</template>
<template v-else-if="item.key==='sampleType'">
<span v-if="scope.row[item.key]==='HY'">
化学药品
</span>
<span v-else-if="scope.row[item.key]==='HG'">
有机化工品
</span>
<span v-else>
{{ scope.row[item.key] }}
</span>
</template>
<template v-else-if="item.key === 'allInput'">
{{ scope.row[item.key]?scope.row[item.key] === "f" ? '未全部录入': '已全部录入':'' }}
</template>
<template v-else-if="item.key==='judged'">
{{ scope.row[item.key]===1?'是':'否' }}
</template>
<template v-else>
{{ scope.row[item.key] }}
</template>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
<fillResult ref="resultModal" @on-result-change="_formSearch" />
</Modal>
</div>
</template>
<script>
import { soilTest } from '../../../api'
import fillResult from './fillResult'
export default {
components: { fillResult },
data() {
return {
formId: 'dataEntry',
modalTitle: '管理样品',
searchOpen: true,
showModal: false,
formObj: {
sampleCode: '',
name: '',
category: ''
},
btn: [
// { type: 'primary', id: '', name: '提交至复核' }
],
selectIds: [],
pageColumns: [
{ title: '试样编号', key: 'sampleCode', fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth' },
{ title: '土质描述', key: 'sampleDescribe' },
{ title: '样品包装类型', key: 'samplePack' },
{ title: '现场编号', key: 'siteNo' }
// { title: '录入时间', key: '', dateTime: true }
],
getPage: {},
iconMsg: [
{ type: 'md-create', id: '', name: '填写结果' },
{ type: 'md-clock', id: '', name: '操作日志' }
],
typeList: [
{ value: 'ORIGINAL', label: '进场原料' },
{ value: 'OTHER', label: '其他原料' }
]
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('', 305)
} else {
return this.$tableHeight('', 261)
}
}
},
methods: {
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_open(id) {
this.showModal = true
this._page(id)
},
_page: async function(id) {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.entrustId = id
const result = await soilTest.pageExpTestSample(
this.$serializeForm(this.formObj)
)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_searchParams(formId) {
return this.$refs.pageTable._searchParams(formId)
},
_tableResultChange(msg, data) {
const selectIds = []
switch (msg) {
case 'page':
this._page()
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'selectData':
for (let i = 0; i < data.length; i++) {
selectIds.push(data[i].id)
}
this.selectIds = selectIds
this.selectData = data
break
// case 'selectIds':
// this.selectIds = data
// break
}
},
_btnClick(msg) {
switch (msg) {
case '提交至复核':
this._submitToCheck()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
_submitToCheck() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定提交至复核?',
onOk: async () => {
const result = await soilTest.submitForReview(this.selectIds)
if (result) {
this.$Message.success('提交成功')
this._page()
}
}
})
}
},
_iconClick(res, data) {
switch (res) {
case '操作日志':
this._record(data.id)
break
case '填写结果':
this._fillResult(data.id)
break
}
},
_fillResult(id) {
this.$refs.resultModal._open(id)
},
// 操作日志
_record(id) {
this.$refs.recordModal._open(id)
}
}
}
</script>
<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>
...@@ -47,14 +47,16 @@ ...@@ -47,14 +47,16 @@
</Col> </Col>
</Row> </Row>
<AssignPerson ref="personModal" @on-result-change="_assignBackData"></AssignPerson> <AssignPerson ref="personModal" @on-result-change="_assignBackData"></AssignPerson>
<SelectOriTempRecord ref="recordModal" @on-result-change="_page"></SelectOriTempRecord>
</div> </div>
</template> </template>
<script> <script>
import Global from '../../../../api/config' import Global from '../../../../api/config'
import { soilTest } from '../../../../api' import { soilTest } from '../../../../api'
import AssignPerson from '../../../../components/user-info-single/AssignPerson' import AssignPerson from '../../../../components/user-info-single/AssignPerson'
import SelectOriTempRecord from '../SelectOriTempRecord'
export default { export default {
components: { AssignPerson }, components: { AssignPerson, SelectOriTempRecord },
data() { data() {
return { return {
// 定义表格名称----英文 // 定义表格名称----英文
...@@ -270,6 +272,9 @@ export default { ...@@ -270,6 +272,9 @@ export default {
case '试验项目分配': case '试验项目分配':
this._userAssign() this._userAssign()
break break
case '填写原始记录':
this._addRecord()
break
case '按组分配': case '按组分配':
await this._reportDueDate() await this._reportDueDate()
await this._groupAssign() await this._groupAssign()
...@@ -295,6 +300,14 @@ export default { ...@@ -295,6 +300,14 @@ export default {
break break
} }
}, },
_addRecord() {
if (this.selectIds.length === 0) {
this.$message.warning('请至少选择一条数据')
} else {
console.log('打开填写原始记录界面')
this.$refs.recordModal._open(this.selectIds)
}
},
_allotByPerson() { _allotByPerson() {
const user = Global.getUserInfo('userInfo') const user = Global.getUserInfo('userInfo')
this.$refs.personModal._openGoupByUserId('分配人员', user.id, 'itemTree') this.$refs.personModal._openGoupByUserId('分配人员', user.id, 'itemTree')
...@@ -554,6 +567,10 @@ export default { ...@@ -554,6 +567,10 @@ export default {
} }
this.$refs.refModal._open(data.sampleId) this.$refs.refModal._open(data.sampleId)
}) })
},
_clearAll() {
this.getPage.records = []
this.selectIds = []
} }
} }
} }
......
...@@ -39,6 +39,9 @@ export default { ...@@ -39,6 +39,9 @@ export default {
console.log(id) console.log(id)
this.$refs.leftModal._open(this.id) this.$refs.leftModal._open(this.id)
// this.$refs.rightModal._getColumn() // this.$refs.rightModal._getColumn()
},
_clearTable() {
this.$refs.rightModal._clearAll()
} }
} }
} }
......
...@@ -530,6 +530,10 @@ export default { ...@@ -530,6 +530,10 @@ export default {
} }
this.$refs.refModal._open(data.sampleId) this.$refs.refModal._open(data.sampleId)
}) })
},
_clearAll() {
this.getPage.records = []
this.selectIds = []
} }
} }
} }
......
...@@ -35,6 +35,9 @@ export default { ...@@ -35,6 +35,9 @@ export default {
_open(id) { _open(id) {
this.$refs.SampleleftModal._open(id) this.$refs.SampleleftModal._open(id)
// this.$refs.rightModal._getColumn() // this.$refs.rightModal._getColumn()
},
_clearTable() {
this.$refs.SamplerightModal._clearAll()
} }
} }
} }
......
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