Commit a260a42c by zhangmengqi

Merge branch 'dev'

parents e330d3cc 81cdaed1
...@@ -40,5 +40,15 @@ export default { ...@@ -40,5 +40,15 @@ export default {
getGroupList: data => getGroupList: data =>
http.post('/res/v1/user_group/list', data).then(res => res), http.post('/res/v1/user_group/list', data).then(res => res),
getBasisList: data => getBasisList: data =>
http.post('soil/v1/standard/list', data).then(res => res) http.post('soil/v1/standard/list', data).then(res => res),
originalTemplatePage: data =>
http.post('soil/v1/original_template/page', data).then(res => res),
originalTemplateDeleteById: data =>
http.delete('soil/v1/original_template/?ids=' + data).then(res => res),
originalTemplateEdit: data =>
http
.put('soil/v1/original_template/' + data.id, data.formObj)
.then(res => res),
originalTemplateGetById: data =>
http.get('soil/v1/original_template/' + data).then(res => res)
} }
...@@ -31,8 +31,16 @@ export default { ...@@ -31,8 +31,16 @@ export default {
http.post('soil/v1/entrust/page_sample_receive_his', data).then(res => res), http.post('soil/v1/entrust/page_sample_receive_his', data).then(res => res),
pageSamplePrepare: data => pageSamplePrepare: data =>
http.post('soil/v1/entrust/page_sample_prepare', data).then(res => res), http.post('soil/v1/entrust/page_sample_prepare', data).then(res => res),
pageSamplePrepareCheck: data =>
http
.post('soil/v1/entrust/page_sample_prepare_check', data)
.then(res => res),
pageSamplePrepareHis: data => pageSamplePrepareHis: data =>
http.post('soil/v1/entrust/page_sample_prepare_his', data).then(res => res), http.post('soil/v1/entrust/page_sample_prepare_his', data).then(res => res),
pageSamplePrepareCheckHis: data =>
http
.post('soil/v1/entrust/page_sample_prepare_check_his', data)
.then(res => res),
getById: data => http.get('soil/v1/entrust/' + data).then(res => res), getById: data => http.get('soil/v1/entrust/' + data).then(res => res),
getVOById: data => http.get('soil/v1/entrust/vo/' + data).then(res => res), getVOById: data => http.get('soil/v1/entrust/vo/' + data).then(res => res),
deleteById: data => deleteById: data =>
...@@ -81,6 +89,8 @@ export default { ...@@ -81,6 +89,8 @@ export default {
http.post('soil/v1/sample/send_sample', data).then(res => res), http.post('soil/v1/sample/send_sample', data).then(res => res),
pagePrepare: data => pagePrepare: data =>
http.post('soil/v1/sample/page_prepare', data).then(res => res), http.post('soil/v1/sample/page_prepare', data).then(res => res),
pagePrepareCheck: data =>
http.post('soil/v1/sample/page_prepare_check', data).then(res => res),
pagePrepareHis: data => pagePrepareHis: data =>
http.post('soil/v1/sample/page_prepare_his', data).then(res => res), http.post('soil/v1/sample/page_prepare_his', data).then(res => res),
pagePrepareDetailHis: data => pagePrepareDetailHis: data =>
...@@ -118,5 +128,9 @@ export default { ...@@ -118,5 +128,9 @@ export default {
pageTake: data => pageTake: data =>
http.post('soil/v1/sample/page_take', data).then(res => res), http.post('soil/v1/sample/page_take', data).then(res => res),
testType: data => testType: data =>
http.post('res/v1/dict/dict_query?type=' + data).then(res => res) http.post('res/v1/dict/dict_query?type=' + data).then(res => res),
pageSurplusHandleCheckHis: data =>
http
.post('soil/v1/prepare/page_surplus_handle_check_his', data)
.then(res => res)
} }
...@@ -179,5 +179,20 @@ export default { ...@@ -179,5 +179,20 @@ export default {
pageSecondaryHis: data => pageSecondaryHis: data =>
http.post('soil/v1/prepare/page_secondary_his', data).then(res => res), http.post('soil/v1/prepare/page_secondary_his', data).then(res => res),
sampleDeleteById: data => sampleDeleteById: data =>
http.delete('soil/v1/sample/?ids=' + data).then(res => res) http.delete('soil/v1/sample/?ids=' + data).then(res => res),
// 制备审核通过
prepareCheckOk: data =>
http.post('soil/v1/sample/prepare_check_ok?ids=' + data).then(res => res),
// 制备审核驳回
prepareCheckBack: data =>
http
.post(
'soil/v1/sample/prepare_check_back?ids=' +
data.ids +
'&remark=' +
data.remark
)
.then(res => res),
sampleBringOut: data =>
http.post('soil/v1/sample/sample_bring_out?ids=' + data).then(res => res)
} }
...@@ -39,5 +39,13 @@ export default { ...@@ -39,5 +39,13 @@ export default {
pageWaitEnd: data => pageWaitEnd: data =>
http http
.post('soil/v1/statistics/page_wait_end_entrust_statistics', data) .post('soil/v1/statistics/page_wait_end_entrust_statistics', data)
.then(res => res),
pagePersonalExpStatistics: data =>
http
.post('soil/v1/statistics/page_personal_exp_statistics', data)
.then(res => res),
pageGroupExpStatistics: data =>
http
.post('soil/v1/statistics/page_group_exp_statistics', data)
.then(res => res) .then(res => res)
} }
...@@ -478,7 +478,7 @@ export default { ...@@ -478,7 +478,7 @@ export default {
siteNo: '', siteNo: '',
experiments: '' experiments: ''
} }
this.getPage.records.unshift(data) this.getPage.records.push(data)
}, },
_getPackList: async function() { _getPackList: async function() {
const result = await soilEntrust.testType('样品包装类型') const result = await soilEntrust.testType('样品包装类型')
...@@ -721,7 +721,7 @@ export default { ...@@ -721,7 +721,7 @@ export default {
this.formObj = formObj this.formObj = formObj
this._showTime(formObj) this._showTime(formObj)
if (formObj.sampleList) { if (formObj.sampleList) {
this.getPage.records = formObj.sampleList this.getPage.records = formObj.sampleList.reverse()
} }
// for (let i = 0; i < formObj.sampleList.length; i++) { // for (let i = 0; i < formObj.sampleList.length; i++) {
// if (formObj.sampleList[i].lastTime !== undefined) { // if (formObj.sampleList[i].lastTime !== undefined) {
......
<template>
<div>
<Modal v-model="showEditModal" :mask-closable="false">
<p slot="header">{{modalTitle}}</p>
<div v-show="isLoad">
<Spin fix>
<Icon type="load-c" size=18 class="file-spin-icon-load"></Icon>
<div>正在上传,请稍后...</div>
</Spin>
</div>
<div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="80">
<Form-item label="类别" prop="classType">
<!-- <Input v-model="formObj.classType" @on-keyup="_onKeyUp" name="classType" placeholder="请选择类别" icon="plus-circled"-->
<!-- ></Input>-->
<el-select v-model="formObj.classType" placeholder="请选择类别" size="small" clearable>
<el-option :label="item.value" :value="item.value" v-for="(item,index) in typeList"
:key="index"></el-option>
</el-select>
</Form-item>
<Form-item label="别名" prop="alias">
<Input v-model="formObj.alias" name="alias" placeholder="请输入别名"></Input>
</Form-item>
<Form-item label="项目代号" prop="remark">
<Input v-model="formObj.remark" name="remark" placeholder="请输入项目代号"></Input>
</Form-item>
</Form>
</div>
<div slot="footer" class="btn-width clearfix">
<Button @click="_cancel" style="margin-left: 8px;">取消</Button>
<Button @click="_ok" type="primary" style="margin-bottom: 0;float: right">保存</Button>
<!-- <label style="margin-bottom: 0;float: right">-->
<!-- <Upload-->
<!-- :action="action"-->
<!-- :on-success="_handelsuccess"-->
<!-- :before-upload="_beupload"-->
<!-- :on-progress="_handelprogress"-->
<!-- :on-format-error="_formatError"-->
<!-- :data="dataObj"-->
<!-- :with-credentials="true"-->
<!-- :show-upload-list="false"-->
<!-- :format="format"-->
<!-- >-->
<!-- <Button :disabled="isDisable" type="primary">导入文件</Button>-->
<!-- </Upload>-->
<!-- </label>-->
</div>
</Modal>
<!--类别弹出树-->
<!-- <LmsTemplateClassifyZTree ref="ztreeModal" @on-result-change="_ztree"></LmsTemplateClassifyZTree>-->
</div>
</template>
<script>
/**
* 添加编辑
*/
// import LmsTemplateClassifyZTree from '../lms-template-classify/LmsTemplateClassifyZTree.vue'
// import global from '../../../api/config'
import { soilAptitude } from '../../api'
const defVal = {
alias: '',
classType: '',
remark: '',
classifyId: 0
}
export default {
// components: { LmsTemplateClassifyZTree },
data() {
return {
modalTitle: '添加',
formObj: defVal,
ruleValidate: {
alias: [{ required: true, message: '别名不能为空', trigger: 'blur' }],
remark: [
{ required: true, message: '项目代号不能为空', trigger: 'blur' }
],
classType: [
{ required: true, message: '类别不能为空', trigger: 'blur' }
]
},
typeList: [
{
value: '检定证书'
},
{
value: '校准证书'
}
],
id: '',
showEditModal: false,
dataObj: {
file: ''
},
pname: '',
action: '',
isLoad: false,
isDisable: true,
format: ['docx', 'xlsx', 'xls']
}
},
methods: {
_onKeyUp() {
if (
this.formObj.alias === '' ||
this.formObj.classType === '' ||
this.formObj.remark === ''
) {
this.isDisable = true
} else {
this.isDisable = false
this.action =
global.baseURL +
'/meter/v1/file_template/upload_template/?classType=' +
this.formObj.classType +
'&alias=' +
this.formObj.alias +
'&remark=' +
this.formObj.remark
}
},
_selectZtree() {
// this.$refs.ztreeModal._openZtree()
},
_cancel() {
this.showEditModal = false
},
_ok: async function() {
const result = await soilAptitude.originalTemplateEdit({
id: this.id,
formObj: this.formObj
})
if (result) {
this.$message.success('编辑成功')
this.showEditModal = false
this.$emit('on-result-change')
}
},
_open(data) {
console.log(data)
this.showEditModal = true
this.isLoad = false
this.id = data.id
this.formObj.alias = data.alias
this.formObj.remark = data.remark
this.formObj.classType = data.classType
this.modalTitle = '编辑模板'
console.log(this.id)
},
_beupload(file) {
this.dataObj.file = file.name
},
_handelprogress(event, file, fileList) {
this.isLoad = true
},
// _handelsuccess(response, file, fileList) {
// // 上传成功
// if (response.success) {
// this.isLoad = false
// this.$Message.success('上传成功!')
// this.$emit('on-result-change')
// this.showEditModal = false
// } else {
// this.isLoad = true
// this.$Message.error(response.msg)
// }
// },
_formatError(file) {
this.$Notice.error({
title: '文件格式不正确',
duration: 10,
desc:
'文件 ' +
file.name +
' 格式不正确,请上传格式为 docx、xlsx、xls 的文件!'
})
},
_ztree(result) {
this.pname = ''
if (result === undefined) {
this.formObj.classifyId = '0'
this.pname = ''
} else {
this.formObj.classifyId = result.id
this.pname = result.name
}
// 判断必填项是否为空
}
}
}
</script>
<style scoped>
.clearfix:after {
content: '';
clear: both;
display: block;
}
</style>
<template>
<div>
<!--内容-->
<div class="layout-content-padding marginLeft-10">
<div class="layout-content-main tree-position">
<div class="position-right">
<Row>
<!--查询-->
<Col span="24">
<Form id="search-form" v-show="searchOpen" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="模板名称:">
<Input v-model="formObj.name" @on-enter="_formSearch" name="name" placeholder="请输入模板名称" clearable></Input>
<input type="hidden" name="classifyId">
</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" :show-search-btn="true" @on-result-change="_btnClick"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :page-columns="pageColumns"
:get-page="getPage" :opt-col-width="120" :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">
<span>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</div>
</div>
<!-- 添加、编辑 -->
<SoilRecordTemplateEdit ref="editModal" @on-result-change="_search"></SoilRecordTemplateEdit>
<SoilRecordEdit ref="reportEdit" @on-result-change="_search"></SoilRecordEdit>
</div>
</template>
<script>
import global from '../../api/config'
import { soilAptitude } from '../../api'
import SoilRecordTemplateEdit from './SoilRecordTemplateEdit'
import SoilRecordEdit from './SoilRecordEdit'
export default {
components: { SoilRecordTemplateEdit, SoilRecordEdit },
data() {
return {
pageColumns: [
{ title: '原始记录模板名称', key: 'name' },
{ title: '模板类别', key: 'classType' },
{ title: '别名', key: 'alias' },
{ title: '备注', key: 'remark' }
],
formObj: {
name: undefined
},
iconMsg: [
{ type: 'md-create', id: '', name: '编辑' },
{ type: 'ios-book', id: '', name: '预览/编辑' },
// { type: 'ios-download', id: '', name: '下载' },
{ type: 'md-remove-circle', id: '', name: '删除' }
],
getPage: {},
tableStyleObj: {},
btn: [
{ type: 'success', id: '', name: '添加' },
{ type: 'error', id: '', name: '删除' }
],
searchOpen: true,
selectIds: []
}
},
computed: {
// tableHeight: function() {
// if (this.searchOpen) {
// return this.$newTableHeight('search')
// } else {
// return this.$newTableHeight('noSearch')
// }
// }
},
mounted() {
// this._contHide()
// this._classTree()
this._page()
},
methods: {
_btnClick(msg) {
switch (msg) {
case '添加':
this._editModal()
break
case '删除':
this._delAll()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
_refresh() {
// 刷新
this.id = ''
this.name = ''
this._search()
this._classTree()
},
_classData(result, msg) {
$('input[name=classifyId]').val(result)
this._formSearch()
},
_classTree() {
this.$refs.classTree._Ztree()
},
_treeHide() {
// 左侧树隐藏
this.isTree = false
this.tableStyleObj.marginLeft = '15px'
},
_treeShow() {
this.isTree = true
this.tableStyleObj.marginLeft = '215px'
},
_iconClick(res, data) {
switch (res) {
case '编辑':
this._reportEdit(data)
break
case '下载':
this._download(data.id)
break
case '预览/编辑':
this._lookReport(data)
break
case '删除':
this._deleteByIds([data.id])
break
}
},
_lookReport: async function(data) {
const result = await soilAptitude.originalTemplateGetById(data.id)
if (result) {
this._viewReport(result)
}
},
_viewReport(data) {
// window.open(global.baseURL + '/print/v1/oos?key=' + objectKey+'&edit=true', '', 'height=' + (screen.availHeight - 50) + ',' +
// 'width=' + (screen.availWidth - 10) + ',top=0,left=0,toolbar=no,menubar=no,scrollbars=auto,resizeable=no,' +
// 'location=no,status=no')
if (data) {
this.$openWindowModeless({
objectKey: data.objectKey,
id: data.id,
idType: 11,
isReport: 4
})
}
},
_contHide() {
this._page()
},
_page: async function() {
console.log('page')
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilAptitude.originalTemplatePage(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
// const result = await
// this.$refs.pageTable._page('search-form', 'SysFileTemplate/page')
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_editModal() {
this.$refs.editModal._open()
},
_reportEdit(data) {
this.$refs.reportEdit._open(data)
},
// 批量删除
_delAll() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this._deleteByIds(ids)
}
},
// 删除
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
_delete: async function(ids) {
const result = await soilAptitude.originalTemplateDeleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
},
_download(id) {
this.$Modal.confirm({
title: '提示',
content: '确定要下载?',
onOk: () => {
window.open(
global.baseURL + '/base/v1/file_template/download/' + id,
'_blank'
)
}
})
},
_search() {
this._page()
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
// this.getPage = this.$store.state.SysFileTemplate.page
break
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
default:
this._page()
}
}
}
}
</script>
<template>
<div>
<Modal v-model="showEditModal" :mask-closable="false">
<p slot="header">{{modalTitle}}</p>
<div v-show="isLoad">
<Spin fix>
<Icon type="load-c" size=18 class="file-spin-icon-load"></Icon>
<div>正在上传,请稍后...</div>
</Spin>
</div>
<div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="80">
<Form-item label="类别" prop="classType">
<!-- <Input v-model="formObj.classType" @on-keyup="_onKeyUp" name="classType" placeholder="请选择类别" icon="plus-circled"-->
<!-- ></Input>-->
<el-select v-model="formObj.classType" placeholder="请选择类别" size="small" clearable>
<el-option :label="item.value" :value="item.value" v-for="(item,index) in typeList"
:key="index"></el-option>
</el-select>
</Form-item>
<Form-item label="别名" prop="alias">
<Input v-model="formObj.alias" @on-keyup="_onKeyUp" name="alias" placeholder="请输入别名"></Input>
</Form-item>
<Form-item label="项目代号" prop="remark">
<Input v-model="formObj.remark" @on-keyup="_onKeyUp" name="remark" placeholder="请输入项目代号"></Input>
</Form-item>
</Form>
</div>
<div slot="footer" class="btn-width clearfix">
<Button @click="_cancel" style="margin-left: 8px;">取消</Button>
<label style="margin-bottom: 0;float: right">
<Upload
:action="action"
:on-success="_handelsuccess"
:before-upload="_beupload"
:on-progress="_handelprogress"
:on-format-error="_formatError"
:data="dataObj"
:with-credentials="true"
:show-upload-list="false"
:format="format"
>
<Button :disabled="isDisable" type="primary">导入文件</Button>
</Upload>
</label>
</div>
</Modal>
<!--类别弹出树-->
<!-- <LmsTemplateClassifyZTree ref="ztreeModal" @on-result-change="_ztree"></LmsTemplateClassifyZTree>-->
</div>
</template>
<script>
/**
* 添加编辑
*/
// import LmsTemplateClassifyZTree from '../lms-template-classify/LmsTemplateClassifyZTree.vue'
import global from '../../api/config'
const defVal = {
alias: '',
classType: '',
remark: '',
classifyId: 0
}
export default {
// components: { LmsTemplateClassifyZTree },
data() {
return {
modalTitle: '添加',
formObj: defVal,
ruleValidate: {
alias: [{ required: true, message: '别名不能为空', trigger: 'blur' }],
remark: [
{ required: true, message: '项目代号不能为空', trigger: 'blur' }
],
classType: [
{ required: true, message: '类别不能为空', trigger: 'blur' }
]
},
typeList: [
{
value: '检定证书'
},
{
value: '校准证书'
}
],
showEditModal: false,
dataObj: {
file: ''
},
pname: '',
action: '',
isLoad: false,
isDisable: true,
format: ['docx', 'xlsx', 'xls']
}
},
methods: {
_onKeyUp() {
if (
this.formObj.alias === '' ||
this.formObj.classType === '' ||
this.formObj.remark === ''
) {
this.isDisable = true
} else {
this.isDisable = false
this.action =
global.baseURL +
'/soil/v1/original_template/upload_template/?classType=' +
this.formObj.classType +
'&alias=' +
this.formObj.alias +
'&remark=' +
this.formObj.remark
}
},
_selectZtree() {
// this.$refs.ztreeModal._openZtree()
},
_cancel() {
this.showEditModal = false
},
_open() {
this.showEditModal = true
this.isLoad = false
this.formObj.alias = ''
this.formObj.remark = ''
this.formObj.classType = ''
this.modalTitle = '添加模板'
},
_beupload(file) {
this.dataObj.file = file.name
},
_handelprogress(event, file, fileList) {
this.isLoad = true
},
_handelsuccess(response, file, fileList) {
// 上传成功
if (response.success) {
this.isLoad = false
this.$Message.success('上传成功!')
this.$emit('on-result-change')
this.showEditModal = false
} else {
this.isLoad = true
this.$Message.error(response.msg)
}
},
_formatError(file) {
this.$Notice.error({
title: '文件格式不正确',
duration: 10,
desc:
'文件 ' +
file.name +
' 格式不正确,请上传格式为 docx、xlsx、xls 的文件!'
})
},
_ztree(result) {
this.pname = ''
if (result === undefined) {
this.formObj.classifyId = '0'
this.pname = ''
} else {
this.formObj.classifyId = result.id
this.pname = result.name
}
// 判断必填项是否为空
this._onKeyUp()
}
}
}
</script>
<style scoped>
.clearfix:after {
content: '';
clear: both;
display: block;
}
</style>
...@@ -339,7 +339,6 @@ export default { ...@@ -339,7 +339,6 @@ export default {
this.selectData = data this.selectData = data
break break
case 'allSelect': case 'allSelect':
console.log('123465798', data)
this.allSelect(data) this.allSelect(data)
break break
case 'iconClick': case 'iconClick':
......
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
<Form-item class="search-item" label="试样编号:"> <Form-item class="search-item" label="试样编号:">
<Input @on-enter="_formSearch" v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入试样编号" clearable/> <Input @on-enter="_formSearch" v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入试样编号" clearable/>
</Form-item> </Form-item>
<Form-item class="search-item" label="钻孔名称:">
<Input @on-enter="_formSearch" v-model="formObj.boreholeName" name="boreholeName" placeholder="请输入钻孔名称" clearable/>
</Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button @click="_formSearch" type="primary">搜索</Button>
</Form-item> </Form-item>
...@@ -89,9 +92,15 @@ export default { ...@@ -89,9 +92,15 @@ export default {
formObj: { formObj: {
entrustCode: undefined, entrustCode: undefined,
sampleCode: undefined, sampleCode: undefined,
name: undefined name: undefined,
boreholeName: undefined
}, },
btn: [ btn: [
{
type: 'success',
id: '',
name: '调出'
}
// { // {
// type: 'success', // type: 'success',
// id: '', // id: '',
...@@ -107,6 +116,7 @@ export default { ...@@ -107,6 +116,7 @@ export default {
{ title: '委托商', key: 'client', width: 200 }, { title: '委托商', key: 'client', width: 200 },
{ title: '委托编号', key: 'entrustCode', width: 120 }, { title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '试样编号', key: 'sampleCode', width: 100 }, { title: '试样编号', key: 'sampleCode', width: 100 },
{ title: '钻孔名称', key: 'boreholeName', width: 100 },
{ title: '试样深度', key: 'sampleDepth', width: 95 }, { title: '试样深度', key: 'sampleDepth', width: 95 },
{ title: '现场编号', key: 'siteNo', width: 100 }, { title: '现场编号', key: 'siteNo', width: 100 },
{ title: '接收人', key: 'receiver', width: 120 }, { title: '接收人', key: 'receiver', width: 120 },
...@@ -188,6 +198,9 @@ export default { ...@@ -188,6 +198,9 @@ export default {
case '导出': case '导出':
// this._export() // this._export()
break break
case '调出':
this._callout()
break
// 收起搜索 // 收起搜索
case 'search': case 'search':
this.searchOpen = !this.searchOpen this.searchOpen = !this.searchOpen
...@@ -223,6 +236,27 @@ export default { ...@@ -223,6 +236,27 @@ export default {
} }
}) })
}, },
_callout() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定调出这' + this.selectIds.length + '条记录?',
onOk: () => {
this._calloutOk()
}
})
}
},
_calloutOk() {
console.log(this.selectIds)
const result = soilSample.sampleBringOut(this.selectIds)
if (result) {
this.$Message.success('调出成功')
this._page()
}
},
_upload(id) { _upload(id) {
const obj = { const obj = {
importUrl: '/soil/v1/standard_annex/upload/' + id importUrl: '/soil/v1/standard_annex/upload/' + id
......
<!--资质项目列表-->
<template>
<div>
<div>
<Form :label-width="65" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="检测项目:" class="search-item">
<Input v-model="formObj.name" @on-enter="_search" placeholder="请输入检测项目" clearable />
</Form-item>
<Form-item>
<Button @click="_search" type="primary">搜索</Button>
</Form-item>
</Form>
</div>
<PTVXETable ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" select-data>
<vxe-table-column
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns"
:key="item.key" sortable>
<template slot-scope="scope">
<div v-if="item.judge">{{scope.row[item.key] === 0 ?'否':'是'}}</div>
<div v-else-if="item.key==='testBasis'">
{{(scope.row.testBasis?scope.row.testBasis:' ')+(scope.row.testBasisName?scope.row.testBasisName:'')}}
</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETable>
</div>
</template>
<script>
import { soilAptitude } from '../../../api'
export default {
components: {},
data() {
return {
getPage: {},
formObj: {
name: undefined,
testBasis: undefined,
aptitude: undefined
},
tableHeight: document.documentElement.clientHeight - 285,
pageColumns: [
{ title: '检测项目', key: 'name', width: 100 },
{ title: '检测依据', key: 'testBasis', width: 260 },
// {title: '检测依据名称', key: 'testBasisName', width: 330},
{ title: '检测方法', key: 'testMethod', width: 130 },
{ title: '检测科室', key: 'groupName', width: 140 },
{ title: '资质', key: 'aptitude', width: 130 },
{ title: '检出限类别', key: 'detectionType', width: 130 },
{ title: '检出限', key: 'detectionLimit', width: 130 },
{ title: '单位', key: 'unit', width: 130 }
],
formId: '',
itemList: [],
testBasisList: []
}
},
methods: {
_open() {
this.formObj = this.$resetFields(this.formObj)
this._page()
},
// 获取检测项目
_getItemList(data) {
const obj = {}
if (data) {
obj.name = data
}
this.$store.dispatch('FoodAptitudeItem/getTestItem', obj).then(() => {
this.itemList = this.$store.state.FoodAptitudeItem.list
})
},
// 检测项目结果
_testItemChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.name = data
this._getItemList()
break
case 'query':
this.formObj.name = data
this._getItemList(data)
break
case 'focus':
this._getItemList()
break
case 'enter':
this._search()
break
}
},
_getTestBasisList(data) {
const obj = { classify: 1, page: 1, rows: 20 }
if (data) {
obj.name = data.stdNum
}
this.$store.dispatch('StandardInfo/pageListByName', obj).then(() => {
this.testBasisList = this.$store.state.StandardInfo.page.records
})
},
_testBasisChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.testBasis = data.stdNum
this._getTestBasisList()
break
case 'query':
this.formObj.testBasis = data.stdNum
this._getTestBasisList(data)
break
case 'focus':
this._getTestBasisList()
break
case 'enter':
this._search()
break
}
},
_page: async function() {
const result = await soilAptitude.page(this.$serializeForm(this.formObj))
if (result) {
console.log(result)
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_clearSelection() {
this.$refs.pageTable._clearSelection()
},
_search() {
this.$refs.pageTable._pageChange(1)
},
_reset() {
this.formObj = this.$resetFields(this.formObj)
},
_tableResultChange(msg, data, checked) {
switch (msg) {
case 'page':
this._page()
break
case 'selectAll':
this.$emit('on-result-change', 'selectAll', data)
break
case 'selectData':
this.$emit('on-result-change', 'selectData', data)
break
case 'dbSelect':
this.$emit('on-result-change', 'dbClick', data)
break
case 'changeSize':
this._page()
break
}
}
}
}
</script>
<template>
<div>
<Modal v-model="showModal" v-drag width="800" class="modal-footer-none full-screen">
<div slot="header">{{modalTitle}}</div>
<div>
<Form id="index-right-form" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="仪器名称:">
<Input v-model="formObj.equipName" @on-enter="_formSearch" placeholder="请输入仪器名称" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
<btn-list :msg="btn" @on-result-change="_btnClick" class="contHide" style="margin-bottom: 10px;"/>
<PTVXETable ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :icon-msg="iconMsg">
<vxe-table-column
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns" :key="item.key">
<template slot-scope="scope">
<span v-if="item.key==='defaulted'">{{scope.row[item.key]?'是':'否'}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</div>
<div class="viewFileImg">
<vue-gallery-slideshow :images="imgViewList" :index="imgViewIndex"
@close="imgViewIndex = null"></vue-gallery-slideshow>
</div>
</Modal>
<IndexManageEdit ref="indexEdit" @on-result-change="_page"></IndexManageEdit>
</div>
</template>
<script>
import { soilAptitude, soilTest } from '../../../api'
import global from '../../../api/config'
import IndexManageEdit from './IndexManageEdit'
export default {
components: { IndexManageEdit },
data() {
return {
id: '',
modalTitle: '',
showModal: false,
btn: [{ type: 'success', id: 'ZBC', name: '添加指标' }],
tableHeight: document.documentElement.clientHeight - 180,
imgViewList: [],
imgViewIndex: null,
viewUri: '/soil/v1/sample_photo/view',
pageColumns: [
{ title: '仪器名称', key: 'equipName', width: 120 },
{ title: '仪器编号', key: 'equipNum', width: 120 },
{ title: '规格型号', key: 'spec', width: 120 },
{ title: '仪器品牌', key: 'brand', width: 120 },
{ title: '实验室编号', key: 'labNum', width: 120 }
],
getPage: {},
iconMsg: [{ type: 'md-eye', id: '', name: '预览' }],
selectIds: [],
formObj: {
name: ''
},
// 资质信息
aptitudeItemInfo: {}
}
},
methods: {
_open(data) {
console.log(data)
this.aptitudeItemInfo = data
this.formObj = this.$resetFields(this.formObj)
this.id = data.id
this.modalTitle = data.name + ' 查看采集文件'
this.showModal = true
this._page()
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.expId = this.id
const result = await soilTest.collectFilePage(
this.$serializeForm(this.formObj)
)
if (result) {
console.log(result)
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
break
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
_iconClick(res, data) {
switch (res) {
case '编辑':
this._editModal(true, data)
break
case '预览':
this._viewFile(data)
break
}
},
_viewFile(data) {
// this.$pdfView(data.objectKey)
const imgViewList = []
// imgViewList.push(global.baseURL + this.downloadFileUrlFile + data.id)
this.imgViewList = imgViewList
imgViewList.push(
global.baseURL +
this.viewUri +
'?id=' +
data.id +
'&objectKey=' +
data.objectKey
)
console.log(
global.baseURL +
this.viewUri +
'?id=' +
data.id +
'&objectKey=' +
data.objectKey
)
this.imgViewIndex = 0
},
_editModal(edit, data) {
if (edit) {
this._getById(data)
} else {
this.$refs.indexEdit._open(this.id, '')
}
},
_getById: async function(data) {
const result = await soilTest.itemGetById(data.id)
console.log(result)
if (result) {
this.$refs.indexEdit._open('', result)
}
},
_btnClick(msg) {
switch (msg) {
case '添加指标':
this._editModal(false)
break
case '删除':
this._deleteByIds()
break
}
},
_deleteByIds() {
if (this.selectIds.length === 0) {
// this.$msgTip('warning')
this.$message.warning('请至少选择一条记录')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定删除 ' + this.selectIds.length + ' 条记录?',
onOk: () => {
this._delOk(this.selectIds)
}
})
}
},
_delOk: async function(ids) {
const result = await soilAptitude.expItemDeleteByIds(ids)
if (result) {
this.$message.success('删除成功')
this._page()
}
}
}
}
</script>
<style scoped>
.viewFileImg >>> .vgs__container {
height: 100% !important;
}
</style>
<template>
<div>
<Modal v-model="showModal" v-drag width="100" class="modal-footer-none full-screen">
<div slot="header">{{modalTitle}}</div>
<div>
<Form id="index-right-form" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="采集内容:">
<Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入采集内容" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
<btn-list :msg="btn" @on-result-change="_btnClick" class="contHide" style="margin-bottom: 10px;"/>
<PTVXETable ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage">
<vxe-table-column
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns" :key="item.key">
<template slot-scope="scope">
<span v-if="item.key==='defaulted'">{{scope.row[item.key]?'是':'否'}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</div>
</Modal>
<IndexManageEdit ref="indexEdit" @on-result-change="_page"></IndexManageEdit>
</div>
</template>
<script>
import { soilAptitude, soilTest } from '../../../api'
import IndexManageEdit from './IndexManageEdit'
export default {
components: { IndexManageEdit },
data() {
return {
id: '',
modalTitle: '',
showModal: false,
btn: [{ type: 'success', id: 'ZBC', name: '添加指标' }],
tableHeight: document.documentElement.clientHeight - 180,
pageColumns: [
{ title: '采集内容', key: 'name' },
{ title: '检测值', key: 'testValue', width: 120 },
{ title: '实验室编号', key: 'labNum', width: 120 },
{ title: '仪器名称', key: 'equipName', width: 120 },
{ title: '仪器编号', key: 'equipNum', width: 120 },
{ title: '规格型号', key: 'spec', width: 120 }
],
getPage: {},
iconMsg: [{ type: 'md-create', id: '', name: '编辑' }],
selectIds: [],
formObj: {
name: ''
},
// 资质信息
aptitudeItemInfo: {}
}
},
methods: {
_open(data) {
console.log(data)
this.aptitudeItemInfo = data
this.formObj = this.$resetFields(this.formObj)
this.id = data.id
this.modalTitle = data.name + ' 查看采集数据'
this.showModal = true
this._page()
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.expId = this.id
const result = await soilTest.collectDataPage(
this.$serializeForm(this.formObj)
)
if (result) {
console.log(result)
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
break
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
_iconClick(res, data) {
switch (res) {
case '编辑':
this._editModal(true, data)
break
}
},
_editModal(edit, data) {
if (edit) {
this._getById(data)
} else {
this.$refs.indexEdit._open(this.id, '')
}
},
_getById: async function(data) {
const result = await soilTest.itemGetById(data.id)
console.log(result)
if (result) {
this.$refs.indexEdit._open('', result)
}
},
_btnClick(msg) {
switch (msg) {
case '添加指标':
this._editModal(false)
break
case '删除':
this._deleteByIds()
break
}
},
_deleteByIds() {
if (this.selectIds.length === 0) {
// this.$msgTip('warning')
this.$message.warning('请至少选择一条记录')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定删除 ' + this.selectIds.length + ' 条记录?',
onOk: () => {
this._delOk(this.selectIds)
}
})
}
},
_delOk: async function(ids) {
const result = await soilAptitude.expItemDeleteByIds(ids)
if (result) {
this.$message.success('删除成功')
this._page()
}
}
}
}
</script>
<template>
<div>
<Modal v-model="showEditModal" v-drag :mask-closable="false" :width="500" class="zIndex-1200">
<p slot="header">{{modalTitle}}</p>
<div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="100" inline>
<Form-item label="土质描述详情" prop="detail " style="width: 100%">
<el-input v-model="formObj.detail " name="detail "></el-input>
</Form-item>
</Form>
</div>
<div slot="footer">
<ModalFooter ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></ModalFooter>
</div>
</Modal>
</div>
</template>
<script>
/**
* 添加编辑
*/
import ModalFooter from '../../../components/base/modalFooter'
import { soilAptitude, soilEntrust, soilSample } from '../../../api'
export default {
components: {
ModalFooter
},
data() {
return {
formId: '',
modalTitle: '土质描述详情填写',
formObj: {
detail: ''
},
ruleValidate: {},
showEditModal: false,
ids: '',
options: [],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
]
}
},
methods: {
/** *modal-footer */
selectLocation(data) {
this._getLocationById(data)
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_resultChange(msg) {
this.showEditModal = false
this.$Message.success(msg)
this.$emit('on-result-change')
this._hideLoading()
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
this.formObj.ids = this.ids
this._receive(this.formObj)
} else {
this.$Message.error('表单验证失败!')
this._hideLoading()
}
})
},
_receive: async function(data) {
const result = await soilEntrust.weiteSoilDetail(data)
if (result) {
this._resultChange('填写成功!')
}
},
_save: async function(data) {
const result = await soilAptitude.standardSave(data)
if (result) {
this._resultChange('添加成功!')
}
},
_edit: async function(data) {
const result = await soilAptitude.standardEdit(data)
if (result) {
this._resultChange('编辑成功!')
}
},
_cancel() {
this._hideLoading()
this.showEditModal = false
},
_open(ids) {
this.formObj.detail = ''
this.ids = ids
this.showEditModal = true
},
_getLocation: async function() {
const result = await soilSample.locationList()
if (result) {
console.log(result)
this.options = result
console.log(this.options)
}
},
_getLocationById: async function(id) {
console.log(id)
const result = await soilSample.locationGetById(id)
if (result) {
this.formObj.receiveLocation = result.name
}
console.log(this.formObj.receiveLocation)
},
_registerAdd() {
this.formId = this.$randomCode()
this._hideLoading()
this.$refs.formObj.resetFields()
this.modalTitle = '添加'
this.formObj.id = ''
this.formObj.type = 3
this.showEditModal = true
}
}
}
</script>
<template>
<div>
<Modal v-model="showModal" v-drag width="800" class="modal-footer-none full-screen">
<div slot="header">{{modalTitle}}</div>
<div>
<Form id="index-right-form" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="仪器名称:">
<Input v-model="formObj.equipName" @on-enter="_formSearch" placeholder="请输入仪器名称" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
<btn-list :msg="btn" @on-result-change="_btnClick" class="contHide" style="margin-bottom: 10px;"/>
<PTVXETable ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :icon-msg="iconMsg" :getPage="getPage">
<vxe-table-column
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns" :key="item.key">
<template slot-scope="scope">
<span v-if="item.key==='defaulted'">{{scope.row[item.key]?'是':'否'}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</div>
</Modal>
<IndexManageEdit ref="indexEdit" @on-result-change="_page"></IndexManageEdit>
</div>
</template>
<script>
import { soilTest } from '../../../api'
import IndexManageEdit from './IndexManageEdit'
export default {
components: { IndexManageEdit },
data() {
return {
id: '',
modalTitle: '',
showModal: false,
btn: [],
tableHeight: document.documentElement.clientHeight - 180,
pageColumns: [
{ title: '仪器名称', key: 'equipName', width: 120 },
{ title: '仪器编号', key: 'equipNum', width: 120 },
{ title: '仪器品牌', key: 'brand', width: 120 },
{ title: '采集类型', key: 'collectionType', width: 120 },
{ title: '采集地址', key: 'collectionAddress', width: 120 },
{ title: '采集命令', key: 'acquisitionCommand', width: 120 }
],
getPage: {},
iconMsg: [{ type: 'md-trash', id: '', name: '删除' }],
selectIds: [],
formObj: {
name: ''
},
// 资质信息
aptitudeItemInfo: {}
}
},
methods: {
_open(data) {
console.log(data)
this.aptitudeItemInfo = data
this.formObj = this.$resetFields(this.formObj)
this.id = data.id
this.modalTitle = data.name + ' 设备管理'
this.showModal = true
this._page()
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.expId = this.id
const result = await soilTest.equipPage(this.$serializeForm(this.formObj))
if (result) {
console.log(result)
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
break
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
_iconClick(res, data) {
switch (res) {
case '编辑':
this._editModal(true, data)
break
case '删除':
this._deleteByIds(data.id)
break
}
},
_editModal(edit, data) {
if (edit) {
this._getById(data)
} else {
this.$refs.indexEdit._open(this.id, '')
}
},
_getById: async function(data) {
const result = await soilTest.itemGetById(data.id)
console.log(result)
if (result) {
this.$refs.indexEdit._open('', result)
}
},
_btnClick(msg) {
switch (msg) {
case '添加指标':
this._editModal(false)
break
case '删除':
this._deleteByIds()
break
}
},
_deleteByIds(id) {
this.$Modal.confirm({
title: '提示',
content: '确定删除这条记录?',
onOk: () => {
this._delOk(id)
}
})
},
_delOk: async function(id) {
const result = await soilTest.deleteEquip(id)
if (result) {
this.$Message.success('删除成功')
this._page()
}
}
}
}
</script>
<!--Collapse关联框 单个导入项目-->
<template>
<div>
<Modal v-model="showModal" v-drag :mask-closable="false" width="100" class="zIndex-1200 full-screen modal-header-none">
<p slot="header">
导入检测项目
</p>
<div>
<Collapse :right-title="'已选的检测项目 (共'+getPage.records.length+'条)'" @on-result-change="_optionResult"
:left-width="18"
left-title="资质项目">
<template #left>
<AptitudeItem ref="leftModal" @on-result-change="_leftResult"></AptitudeItem>
</template>
<template #right>
<PTVXETable ref="pageTable" :tableHeight="tableHeight" :getPage="getPage"
@on-result-change="_rightResult" select-data hide-page>
<vxe-table-column
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
v-for="item in pageColumns" :key="item.key">
<template slot-scope="scope">
<div v-if="item.key==='scened'">{{scope.row[item.key]?'':scope.row[item.key]===0?'否':'是'}}</div>
<div v-else-if="item.key==='testBasis'">
{{(scope.row.testBasis?scope.row.testBasis:' ')+
(scope.row.testBasisName?scope.row.testBasisName:'')}}
</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETable>
</template>
</Collapse>
</div>
<div slot="footer">
<modal-footer ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></modal-footer>
</div>
</Modal>
</div>
</template>
<script>
import Collapse from '../../../components/base/Collapse'
import { soilSample } from '../../../api'
import AptitudeItem from './AptitudeItem'
/* 普通样品导入检测项目(一种是直接走接口保存,另一种是返回已选中的数据),专用于除了【质控】之外的导入检测项目 */
export default {
components: {
Collapse,
// AddItem,
AptitudeItem
},
props: {
isRepeat: null // 只有模拟样品才能导入重复的检测项目
},
data() {
return {
pageColumns: [
{ title: '检测项目', key: 'name', width: 100 },
{ title: '检测依据', key: 'testBasis', width: 260 },
// {title: '检测依据名称', key: 'testBasisName', width: 180,},
{ title: '检测方法', key: 'testMethod', width: 130 },
{ title: '检测科室', key: 'groupName', width: 140 }
],
footerList: [
{ name: '取消', type: '' },
{ name: '确定', type: 'primary' }
],
selectData: [],
showModal: false,
addIds: [],
sampleId: '',
delData: [],
getPage: {
records: []
},
isEditModal: false,
isReceive: false, // 用于区别是样品接收中导入检测项目还是普通样品中导入检测项目
tableHeight: document.documentElement.clientHeight - 240
}
},
methods: {
_open(sampleId) {
this.showModal = true
this.isReceive = false
this.sampleId = sampleId
this.selectData = []
this.addIds = []
this.delData = []
this.getPage.records = []
this.$refs.leftModal._open()
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '确定':
this._ok()
break
}
},
_ok: async function() {
const result = await soilSample.importExperiments({
aptitudeIds: this.addIds,
ids: this.sampleId
})
if (result) {
this.showModal = false
this.$Message.success('导入成功')
this.$emit('on-result-change')
}
},
_cancel() {
this.showModal = false
this.$refs.footerModal._hideLoading()
},
// 样品接收中用的导入检测项目(给一个样品导入检测项目)
_openReceive() {
this.isReceive = true
this.selectData = []
this.addIds = []
this.delData = []
// this.getPage = [];
this.getPage.records = []
this.$refs.leftModal._open()
},
_optionResult(name) {
switch (name) {
case '添加':
this._add()
break
case '删除':
this._deleteSelected()
break
}
},
// 未关联方法返回的数据
_leftResult(msg, data, checked) {
switch (msg) {
case 'selectAll':
this.selectData = data
break
case 'selectData':
this.selectData = data
// if (data.checked) {
// this.selectData.push(data)
// const set = new Set([...this.selectData])
// this.selectData = [...set]
// console.log('选择的数据', this.selectData)
// } else {
// const index = this.selectData.indexOf(data)
// this.selectData.splice(index, 1)
// }
break
case 'dbClick':
this.selectData = [data]
this._add()
break
case 'search':
this.selectData = []
break
}
},
// 已关联方法返回的数据
_rightResult(msg, data) {
switch (msg) {
case 'selectData':
this.delData = data
break
}
},
// 添加关联方法
_add() {
if (this.selectData.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
for (let i = 0; i < this.selectData.length; i++) {
if (this.isRepeat) {
// 表示模拟样品,可导入重复的项目
this.getPage.records.push(this.selectData[i])
this.addIds.push(this.selectData[i].id)
} else {
// 普通样品,不能导入重复的项目
// eslint-disable-next-line no-lonely-if
if (
!this.getPage.records.find(
item => item.name === this.selectData[i].name
)
) {
this.getPage.records.push(this.selectData[i])
this.addIds.push(this.selectData[i].id)
}
}
}
// 勾选之后两侧都需要手动清空,否则会出现另一侧也勾选的问题
this.$refs.leftModal._clearSelection()
this.$refs.pageTable._clearSelection()
this.selectData = []
}
},
_deleteSelected() {
if (this.delData.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this._deleteByIds(
this.delData,
'确定删除 ' + this.delData.length + ' 条记录?'
)
}
},
_deleteByIds(row, content) {
for (let i = 0; i < row.length; i++) {
const dataIndex = this.getPage.records.indexOf(row[i])
this.getPage.records.splice(dataIndex, 1)
const idIndex = this.addIds.indexOf(row[i].id)
this.addIds.splice(idIndex, 1)
}
// 勾选之后两侧都需要手动清空,否则会出现另一侧也勾选的问题
this.$refs.leftModal._clearSelection()
this.$refs.pageTable._clearSelection()
// 手动清空删除的数据
this.delData = []
}
}
}
</script>
<template>
<div>
<Modal v-model="showModal" v-drag width="100" class="modal-footer-none full-screen">
<div slot="header">{{modalTitle}}</div>
<div>
<Form id="index-right-form" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="指标名称:">
<Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入类别" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
<btn-list :msg="btn" @on-result-change="_btnClick" class="contHide" style="margin-bottom: 10px;"/>
<PTVXETable ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :iconMsg="iconMsg">
<vxe-table-column
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns" :key="item.key">
<template slot-scope="scope">
<span v-if="item.key==='defaulted'">{{scope.row[item.key]?'是':'否'}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</div>
</Modal>
<IndexManageEdit ref="indexEdit" @on-result-change="_page"></IndexManageEdit>
</div>
</template>
<script>
import { soilAptitude, soilTest } from '../../../api'
import IndexManageEdit from './IndexManageEdit'
export default {
components: { IndexManageEdit },
data() {
return {
id: '',
modalTitle: '',
showModal: false,
btn: [
{ type: 'success', id: '', name: '添加指标' },
{ type: 'error', id: '', name: '删除' }
],
tableHeight: document.documentElement.clientHeight - 180,
pageColumns: [
{ title: '试验指标名称', key: 'name' },
{ title: '试验指标大类', key: 'mainType', width: 120 },
{ title: '试验指标小类', key: 'smallType', width: 120 },
{ title: '状态', key: 'status', width: 120 },
{ title: '检测值', key: 'testValue', width: 120 },
{ title: '单位', key: 'unit', width: 120 }
],
getPage: {},
iconMsg: [{ type: 'md-create', id: '', name: '编辑' }],
selectIds: [],
formObj: {
name: ''
},
// 资质信息
aptitudeItemInfo: {}
}
},
methods: {
_open(data) {
console.log(data)
this.aptitudeItemInfo = data
this.formObj = this.$resetFields(this.formObj)
this.id = data.id
this.modalTitle = data.name + ' 指标管理'
this.showModal = true
this._page()
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.experimentId = this.id
const result = await soilTest.itemPage(this.$serializeForm(this.formObj))
if (result) {
console.log(result)
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
break
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
_iconClick(res, data) {
switch (res) {
case '编辑':
this._editModal(true, data)
break
}
},
_editModal(edit, data) {
if (edit) {
this._getById(data)
} else {
this.$refs.indexEdit._open(this.id, '')
}
},
_getById: async function(data) {
const result = await soilTest.itemGetById(data.id)
console.log(result)
if (result) {
this.$refs.indexEdit._open('', result)
}
},
_btnClick(msg) {
switch (msg) {
case '添加指标':
this._editModal(false)
break
case '删除':
this._deleteByIds()
break
}
},
_deleteByIds() {
if (this.selectIds.length === 0) {
// this.$msgTip('warning')
this.$message.warning('请至少选择一条记录')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定删除 ' + this.selectIds.length + ' 条记录?',
onOk: () => {
this._delOk(this.selectIds)
}
})
}
},
_delOk: async function(ids) {
const result = await soilAptitude.expItemDeleteByIds(ids)
if (result) {
this.$message.success('删除成功')
this._page()
}
}
}
}
</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
*/
import { soilTest } from '../../../api'
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) {
console.log('请求树')
console.log(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: async function() {
const data = {}
data.businessTypeList = this.businessTypeList
if (this.key) {
data.name = this.key
}
const result = await soilTest.zTree(data)
if (result) {
const treeObj = $.fn.zTree.init(
$('#' + this.treeId),
this.setting,
result
)
treeObj.expandAll(true)
setTimeout(() => {
this.isloading = false
this.isTree = true
}, 300)
}
// 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>
<template>
<div>
<!--<Modal v-model="showModal" title="原始记录" :mask-closable="false" width="1300" class="modal-footer-none">-->
<!--<div style="text-align:center;align-content:center;width: 100%;height: 790px" v-html="htmlContent">-->
<!--</div>-->
<!--</Modal>-->
</div>
</template>
<script>
import Global from '../../../api/config'
import { soilTest } from '../../../api'
/**
* 编辑原始记录详情
*/
export default {
data() {
return {
// showModal: false,
again: false,
formId: '',
htmlContent: '',
formIdTemp: ''
}
},
created() {
// 监听原始记录消息
// eslint-disable-next-line nuxt/no-globals-in-created
window.addEventListener('message', this._saveOriginal)
},
// 销毁监听事件
beforeDestroy() {
this.again = false
window.removeEventListener('message', this._saveOriginal)
},
methods: {
_open(formId) {
this.formId = formId
this.formIdTemp = formId + this.$randomCode()
this.again = true
// this.showModal = true;
let recordUrl = ''
if (process.env.NODE_ENV === 'production') {
recordUrl = 'http://record.patzn.com'
} else {
recordUrl = Global.recordURL
}
// 编辑的时候传此bindUri 是为了 绑定spreadJs自定义的公式
const bindUri =
Global.baseURL + '/env/v1/env_item/original_record_data_bind?source='
const url =
recordUrl +
'/print/v1/eln/form_YT_' +
formId +
'?bindUri=' +
encodeURIComponent(bindUri)
// this.htmlContent = '<iframe style="padding: 0px;width:100%;height:100%" frameborder="0" src=' + encodeURI(url) + '></iframe>';
this.$layx(this.formIdTemp, '编辑原始记录', url)
},
_openWithType(formId, fromType) {
this.formId = formId
this.formIdTemp = formId + this.$randomCode()
this.again = true
// this.showModal = true;
let recordUrl = ''
if (process.env.NODE_ENV === 'production') {
recordUrl = 'http://record.patzn.com'
} else {
recordUrl = Global.recordURL
}
// 编辑的时候传此bindUri 是为了 绑定spreadJs自定义的公式
const bindUri =
Global.baseURL + '/env/v1/env_item/original_record_data_bind?source='
const url =
recordUrl +
'/print/v1/eln/form_YT_' +
formId +
'?bindUri=' +
encodeURIComponent(bindUri) +
'&type=' +
fromType
// this.htmlContent = '<iframe style="padding: 0px;width:100%;height:100%" frameborder="0" src=' + encodeURI(url) + '></iframe>';
this.$layx(this.formIdTemp, '编辑原始记录', url)
},
_saveOriginal(data) {
console.log('修改的数据', data)
if (this.again) {
if (data.data.msg === true) {
this._editSaveRecord(data)
} else {
this._cancel()
}
this.again = false
}
},
_cancel() {
// this.showModal = false;
// 关闭所有layx弹框
// eslint-disable-next-line no-undef
layx.destroyAll(this.formIdTemp)
},
_updateRecord: async function(param) {
const result = await soilTest.updateItem(param)
console.log(result)
if (result) {
this.$Message.success('保存成功')
this._cancel()
this.$emit('on-result-change')
}
},
// 保存后解析项目的检测值
_editSaveRecord(data) {
const param = {
formId: this.formId
}
console.log('data', data)
const copyMapTemp = {}
if (data.data.copySheet && data.data.copyedSheet) {
param.copyMap = {}
const copyedKey = String(data.data.copyedSheet)
copyMapTemp[copyedKey] = ''
copyMapTemp[copyedKey] = String(data.data.copySheet)
// 存在复制sheet的情况
param.copyMap = JSON.stringify(copyMapTemp)
} else if (typeof data.data.testValueArry !== 'undefined') {
const testValue = data.data.testValueArry
param.copyMap = {}
testValue.forEach(item => {
const copyedKey = String(item.copyedSheet)
copyMapTemp[copyedKey] = ''
copyMapTemp[copyedKey] = String(item.copySheet)
param.copyMap = JSON.stringify(copyMapTemp)
})
}
this._updateRecord(param)
// this.$store.dispatch('EnvItem/updateFormForItem', param).then(() => {
// if (this.$store.state.EnvItem.success) {
// this.$Message.success('保存成功')
// // this.showModal = false;
// this.$emit('on-result-change')
// this._cancel()
// }
// })
}
}
}
</script>
<template>
<div>
<Modal v-model="showModal" v-drag :mask-closable="false" width="90" class="zIndex-1000 full-screen">
<p slot="header">制备详情</p>
<Row>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" class="contHide" @on-result-change="_btnClick"></btn-list>
</Col>
<!--内容-->
<Col span="24">
<PTVXETable
ref="pageTable"
:table-height="tableHeight"
:get-page="getPage"
:form-id="formId"
select-data
hide-page
@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"
:edit-render="item.editCell?{autofocus: 'input'}:null"
sortable
>
<!--只读模板-->
<template v-slot="scope">
<div v-if="item.key==='prepareDate'">
{{scope.row.prepareDate?$dateformat(scope.row.preparationDate,'yyyy-mm-dd HH:MM'):''}}
</div>
<span v-else-if="item.key==='type'">{{ scope.row[item.key]===0? '送检样':'余样' }}</span>
<span v-else-if="item.key==='status'">{{ scope.row[item.key].display }}</span>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer>
</div>
<!--打印标签-->
<!--选择人员-->
</Modal>
</div>
</template>
<script>
import { soilEntrust } from '../../../api'
export default {
components: {},
data() {
return {
formId: 'preparationModal',
showModal: false,
wayData: new Map(),
formObj: {
sampleId: undefined
},
tableHeight: document.documentElement.clientHeight - 215,
footerList: [],
list: [
{ name: '取消', type: '', id: '' },
{ name: '关闭', type: 'primary', id: '' }
],
btn: [{ type: 'error', id: 'ZBC', name: '删除' }],
iconMsg: [
{ type: 'md-create', id: '', name: '批量赋值' },
{ type: 'md-trash', id: '', name: '删除' }
],
getPage: {
records: []
},
selectData: [],
selectIds: [],
pageColumns: [
{ title: '试样编号', key: 'sampleCode', width: 130 },
{ title: '试样深度', key: 'sampleDepth', width: 130 },
{ title: '检验科室', key: 'groupName', width: 130 },
{ title: '制备类型', key: 'type', width: 130 },
{
title: '制备方式',
key: 'prepareWay',
width: 130
},
{
title: '制备数量',
key: 'quantity',
width: 150
},
{ title: '单位', key: 'unit', width: 110 },
{ title: '状态', key: 'status', width: 150 },
{ title: '保存方式', key: 'keepWay', width: 150 },
{ title: '保存容器', key: 'keepContainer', width: 150 },
{
title: '制备时间',
key: 'prepareDate',
width: 200
},
{
title: '制备人',
key: 'preparer',
width: 130
},
{ title: '备注', key: 'remark', width: 150 }
],
currentRow: {},
preparationWayData: [],
resultStateWayData: [],
saveWayData: [],
sampleId: '',
unitData: [],
locationList: [],
packList: [],
isAccurate: ''
}
},
methods: {
// 获取存储位置
_locationChange(msg, data, handleObj) {
this.currentRow = handleObj
switch (msg) {
case 'select':
this.$set(this.currentRow, 'storePlace', data)
break
case 'query':
this.$set(this.currentRow, 'storePlace', data)
this._getLocation(data)
break
}
},
// 单位
_unitChange(msg, data, handleObj) {
this._handleRow(handleObj)
switch (msg) {
case 'select':
this.currentRow.unit = data
break
case 'query':
this.currentRow.unit = data
break
}
},
_preparationChange(msg, data, handleObj) {
this._handleRow(handleObj)
this.currentRow.prepareWay = data
},
_testItemChange(msg, data, handleObj) {
this._handleRow(handleObj)
this.currentRow.resultState = data.name
},
_saveChange(msg, data, handleObj) {
this._handleRow(handleObj)
this.currentRow.keepWay = data.name
},
timeChange(data) {
console.log(data)
this.currentRow.prepareDate = data
},
_packSaveChange(msg, data, handleObj) {
this._handleRow(handleObj)
this.currentRow.keepContainer = data.name
},
_open(sampleId) {
this.sampleIds = sampleId
this.formObj.sampleId = sampleId
console.log(this.sampleIds)
this.showModal = true
this.getPage.records = []
this.unitData = []
this.footerList = []
for (let i = 0; i < this.list.length; i++) {
if (this.$showBtn(this.list[i].id)) {
this.footerList.push(this.list[i])
}
}
this._page()
// this._dicSearch()
},
_page: async function() {
const result = await soilEntrust.pagePrepareDetailHis(this.formObj)
if (result) {
console.log(result)
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '关闭':
this._cancel()
break
}
},
_cancel() {
this.showModal = false
this._hideLoading()
},
_resultChange(msg) {
this.showModal = false
this.$Message.success(msg)
this.$emit('on-result-change')
this._hideLoading()
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.$refs.pageTable._hideLoading()
break
case 'selectData':
this.selectData = data
const selectIds = []
for (let i = 0; i < data.length; i++) {
selectIds.push(data[i].id)
}
this.selectIds = selectIds
break
case 'iconClick':
this._iconClick(
data.name,
data.rowData,
data.componentName,
data.rowIndex
)
break
}
},
_btnClick(msg) {
switch (msg) {
case '打印标签':
if (this.selectData.length > 0) {
this.$refs.printer._open()
} else {
this.$Message.warning('请至少选择一条数据')
}
break
case '删除':
this._deleteSelected()
break
}
},
_printerResult(data) {
this.$refs.printNumber._open(this.selectData, data.printerVal)
},
_deleteSelected() {
// 批量删除
const selectData = this.selectData
if (selectData.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this._deleteByIds(
selectData,
'确定删除 ' + selectData.length + ' 条记录?'
)
}
},
_iconClick(res, data, componentName, rowIndex) {
this.currentRow = data
switch (res) {
case '批量赋值':
this._copyPlan(data)
break
case '删除':
this._deleteByIds([data])
break
}
},
_deleteByIds(rows, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
for (let i = 0; i < rows.length; i++) {
const index = this.getPage.records.indexOf(rows[i])
this.getPage.records.splice(index, 1)
}
this.$Message.success('操作成功')
this.selectData = []
this.selectIds = []
}
})
},
_selectStaff() {
this.$refs.userModal._open('preparationPerson')
},
_userData(data) {
// 选择人员返回数据
this.currentRow.preparationPerson = data.realname
this.currentRow.preparationPersonId = data.userId
},
// 操作的序号
_handleRow(data) {
this.currentRow = data.row
},
_handleTimeRow(data) {
console.log(this.currentRow)
this.currentRow = data.row
}
}
}
</script>
<template>
<div>
<Modal v-model="showModal" v-drag :mask-closable="false">
<p slot="header">填写试验项目信息</p>
<div>
<Form id="storage-location-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="100">
<Form-item label="英文简写:" prop="shortName">
<el-input v-model="formObj.shortName" name="shortName" placeholder="请输入英文简写">
</el-input>
</Form-item>
<Form-item label="大类:" prop="mainType">
<el-input v-model="formObj.mainType" name="mainType" placeholder="请输入大类">
</el-input>
</Form-item>
<Form-item label="小类:" prop="smallType">
<el-input v-model="formObj.smallType" name="smallType" placeholder="请输入小类">
</el-input>
</Form-item>
<Form-item label="试验方法:" prop="testMethod">
<el-input v-model="formObj.testMethod" name="testMethod" placeholder="请输入试验方法">
</el-input>
</Form-item>
<Form-item label="试验科室:">
<el-select :value="formObj.groupName" @change="selGroupName" style="width:100%" size="small">
<el-option v-for="item in groupoptions" :value="item.id" :label="item.name" :key="item.name">{{ item.name }}
</el-option>
</el-select>
</Form-item>
<Form-item label="检测依据:">
<AutoCompletes v-model="formObj.testBasis" :down-data="testBasisList" @on-result-change="_selTestBasis"
style="editable:false" clearable
placeholder="请选择检测依据" show-key="name"></AutoCompletes>
</Form-item>
</Form>
</div>
<div slot="footer">
<modal-footer ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></modal-footer>
</div>
</Modal>
</div>
</template>
<script>
import { soilAptitude, soilSample } from '../../../api'
import AutoCompletes from '../../../components/base/AutoCompletes'
export default {
components: { AutoCompletes },
data() {
return {
ids: [], // 委托ids
showModal: false,
formObj: {},
ruleValidate: {},
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
],
conditionList: [],
locList: [],
backupUserList: [],
prepareWayList: [],
keepWayList: [],
keepContainerList: [],
groupoptions: [],
testBasisList: [],
sampleUnit: ''
}
},
mounted() {
this._getGroupList()
this._getTestBasisList()
},
methods: {
_locChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.backupPlace = data.backupPlace
this._getCondition(data.backupPlace)
break
case 'query':
this.formObj.backupPlace = data.backupPlace
this._getLocList(data.backupPlace)
break
}
},
_getGroupList: async function() {
const result = await soilAptitude.getGroupList()
if (result) {
this.groupoptions = result
console.log('试验科室', result)
}
},
_getTestBasisList: async function() {
const result = await soilAptitude.getBasisList()
if (result) {
this.testBasisList = result
}
},
_selTestBasis(msg, data) {
if (msg === 'select') {
this.formObj.testBasis = data.name
}
},
channelInputLimit(e) {
const key = e.key
// 不允许输入'e'和'.'
if (key === 'e' || key === '.') {
e.returnValue = false
return false
}
return true
},
selPrepareWay(data) {
this.$forceUpdate()
this.formObj.prepareWay = data
},
selKeepWay(data) {
this.$forceUpdate()
this.formObj.keepWay = data
},
selKeepContainer(msg, data) {
this.$forceUpdate()
if (msg === 'select') {
this.formObj.keepContainer = data.name
} else if (msg === 'query') {
this.formObj.keepContainer = data.name
}
},
selGroupName(data) {
this.$forceUpdate()
if (data) {
for (let i = 0; i < this.groupoptions.length; i++) {
if (this.groupoptions[i].id === data) {
this.formObj.groupName = this.groupoptions[i].name
}
}
} else {
this.getPage.records[this.currentIndex].groupName = ''
}
this.formObj.groupId = data
// this.$forceUpdate()
// this.getPage.records[this.currentIndex].backupUser = data
// this.getPage.records[this.currentIndex].backupUser = data
},
// 存储条件 回调
_locChangeCondition(msg, data) {
switch (msg) {
case 'select':
this.formObj.storageCondition = data.name
this._getLocCondition(data.name)
break
case 'query':
this.formObj.storageCondition = data.name
this._getLocConditionList(data.name)
break
}
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_open(data) {
this.showModal = true
this.formObj = this.$resetFields(this.formObj)
this.sampleUnit = ''
this.$refs.footerModal._hideLoading()
this.ids = data
// 循环遍历数据
},
_getPrepareWay: async function() {
const result = await soilSample.getDictList('制备方式')
if (result) {
this.prepareWayList = result
}
},
_getkeepWayList: async function() {
const result = await soilSample.getDictList('保存方式')
if (result) {
this.keepWayList = result
}
},
_getkeepContainerList: async function() {
const result = await soilSample.getDictList('保存容器')
if (result) {
this.keepContainerList = result
}
},
_getUserList: async function() {
const result = await soilSample.getUserList()
if (result) {
console.log(result)
this.backupUserList = result.records
}
},
//
_dateChange(data) {
this.formObj.endDate = data
},
_cancel() {
this.showModal = false
this.$refs.footerModal._hideLoading()
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
console.log(this.formObj)
const tempData = this.formObj
tempData.ids = this.ids.join(',')
this._saveInfo(tempData)
} else {
this.$Message.error('表单验证失败!')
this.$refs.footerModal._hideLoading()
}
})
},
_saveInfo: async function(data) {
const result = await soilSample.editItem(data)
if (result) {
this.showModal = false
this.$refs.footerModal._hideLoading()
this.$emit('on-result-change')
this.$Message.success('保存成功')
}
}
}
}
</script>
<template>
<div>
</div>
</template>
<script>
import { Iframe } from '../../../plugins/iframe'
/**
* 自定义打开 原始记录添加界面
*/
export default {
props: {
ifrAction: null
},
data() {
return {
iframeShow: false,
isLoading: false,
fullScreenHeight: document.documentElement.clientHeight - 82 + 'px',
iframeHeight: document.documentElement.clientHeight - 300 + 'px',
iframeHeader: '原始记录添加'
}
},
methods: {
/** 自定义iframe**/
_createIframe(bindUri, params) {
Iframe.iframe(bindUri, params)
},
/** 自定义iframe的使用**/
_closeIframe() {
Iframe.closeModalDiv()
}
}
}
</script>
<style>
.record-modal {
width: 800px;
height: 500px;
border: 1px solid #0079fd;
position: fixed;
box-shadow: 0 0 10px #505050;
top: 0;
left: 0;
display: block;
}
.record-modal-header {
width: 100%;
height: 30px;
background-color: #ffffff;
position: relative;
border-bottom: 1px solid #ffffff;
}
.record-modal-title {
width: 200px;
position: absolute;
left: 0;
top: 0;
height: 100%;
font-size: 14px;
font-weight: 400;
color: #000;
text-align: left;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 30px;
margin-left: 10px;
}
.record-modal-btn {
position: absolute;
right: 0;
top: 0;
width: 120px;
height: 100%;
margin-top: 0;
/*margin-left: 680px;*/
}
.record-modal-btn > div {
float: left;
width: 40px;
height: 100%;
font-size: 14px;
line-height: 30px;
text-align: center;
cursor: default;
user-select: none;
}
.record-modal-max {
font-weight: bold;
}
.record-modal-min:hover,
.record-modal-max:hover {
background-color: #e5e5e5;
}
.record-modal-close {
font-size: 24px !important;
}
.record-modal-close:hover {
background-color: #e81123 !important;
}
.record-modal-content {
width: 100%;
height: 470px;
position: relative;
background-color: #ffffff;
}
.record-loading-content {
background-color: #ffffff;
width: 100%;
text-align: center;
position: absolute;
top: 50%;
transform: translateY(-50%);
}
</style>
<template>
<div>
<Modal v-model="showSampleModal" v-drag @on-visible-change="_visibleChange" width="1200"
class="zIndex-900 modal-footer-none">
<p slot="header">管理样品</p>
<div>
<SoilSampleManage ref="prepareManage"></SoilSampleManage>
<!-- <keep-alive>-->
<!-- &lt;!&ndash; eslint-disable-next-line vue/require-component-is &ndash;&gt;-->
<!-- <component ref="refModal" :is="currentComponent"></component>-->
<!-- </keep-alive>-->
</div>
</Modal>
</div>
</template>
<script>
import SoilSampleManage from './SoilSampleManage'
export default {
components: {
SoilSampleManage
},
data() {
return {
type: '',
contractId: '', // 合同id
entrustId: '',
showSampleModal: false,
modalTitle: '',
selectIds: [],
name: ''
}
},
mounted() {},
methods: {
_open(entrustId, type, name) {
this.type = type // 类型(采样或送样)
this.name = name
this.showSampleModal = true
this.entrustId = entrustId // 委托id
this.selectIds = []
this._preparePage()
},
// 制备管理
_preparePage() {
this.$refs.prepareManage._open(this.entrustId)
},
_visibleChange(data) {
this.$emit('on-result-change')
}
}
}
</script>
<template>
<div>
<Modal v-model="showModal" v-drag :mask-closable="false">
<p slot="header">填写制备信息</p>
<div>
<Form id="storage-location-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="100">
<Form-item label="制备方式:" prop="prepareWay">
<el-select :value="formObj.prepareWay" @change="selPrepareWay" style="width:100%" size="small">
<el-option v-for="item in prepareWayList" :value="item.name" :key="item.name">{{ item.name }}
</el-option>
</el-select>
</Form-item>
<Form-item label="制备数量:" prop="quantity">
<el-input
v-model="formObj.quantity"
@keydown.native="channelInputLimit"
clearable
type="number"
placeholder="请输入或选择数量"
/>
</Form-item>
<Form-item label="单位:">
<Input v-model="formObj.unit" clearable placeholder="请输入单位"></Input>
</Form-item>
<Form-item label="保存方式:">
<el-select :value="formObj.keepWay" @change="selKeepWay" style="width:100%" size="small">
<el-option v-for="item in keepWayList" :value="item.name" :key="item.name">{{ item.name }}
</el-option>
</el-select>
</Form-item>
<Form-item label="保存容器:">
<AutoCompletes v-model="formObj.keepContainer" :handle-obj="formObj" :down-data="keepContainerList" @on-result-change="selKeepContainer"
style="editable:false" clearable
placeholder="请选择保存容器" show-key="name"></AutoCompletes>
<!-- <el-select :value="formObj.keepContainer" @change="selKeepContainer" style="width:100%" size="small">-->
<!-- <el-option v-for="item in keepContainerList" :value="item.name" :key="item.name">{{ item.name }}-->
<!-- </el-option>-->
<!-- </el-select>-->
</Form-item>
<Form-item label="制备人:">
<el-select :value="formObj.preparer" @change="selUser" style="width:100%" size="small">
<el-option v-for="(item,index) in backupUserList" :value="item.id" :label="item.realname" :key="index">{{ item.realname }}
</el-option>
</el-select>
</Form-item>
</Form>
</div>
<div slot="footer">
<modal-footer ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></modal-footer>
</div>
</Modal>
</div>
</template>
<script>
import { soilSample } from '../../../api'
import AutoCompletes from '../../../components/base/AutoCompletes'
export default {
components: { AutoCompletes },
data() {
return {
ids: [], // 委托ids
showModal: false,
formObj: {},
ruleValidate: {},
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
],
conditionList: [],
locList: [],
backupUserList: [],
prepareWayList: [],
keepWayList: [],
keepContainerList: [],
sampleUnit: ''
}
},
mounted() {
this._getPrepareWay()
this._getkeepWayList()
this._getkeepContainerList()
this._getUserList()
},
methods: {
_locChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.backupPlace = data.backupPlace
this._getCondition(data.backupPlace)
break
case 'query':
this.formObj.backupPlace = data.backupPlace
this._getLocList(data.backupPlace)
break
}
},
channelInputLimit(e) {
const key = e.key
// 不允许输入'e'和'.'
if (key === 'e' || key === '.') {
e.returnValue = false
return false
}
return true
},
selPrepareWay(data) {
this.$forceUpdate()
this.formObj.prepareWay = data
},
selKeepWay(data) {
this.$forceUpdate()
this.formObj.keepWay = data
},
selKeepContainer(msg, data) {
this.$forceUpdate()
if (msg === 'select') {
this.formObj.keepContainer = data.name
} else if (msg === 'query') {
this.formObj.keepContainer = data.name
}
},
selUser(data) {
this.$forceUpdate()
if (data) {
for (let i = 0; i < this.backupUserList.length; i++) {
if (this.backupUserList[i].id === data) {
this.formObj.preparer = this.backupUserList[i].realname
}
}
} else {
this.getPage.records[this.currentIndex].preparer = ''
}
this.formObj.preparerId = data
// this.$forceUpdate()
// this.getPage.records[this.currentIndex].backupUser = data
// this.getPage.records[this.currentIndex].backupUser = data
},
// 存储条件 回调
_locChangeCondition(msg, data) {
switch (msg) {
case 'select':
this.formObj.storageCondition = data.name
this._getLocCondition(data.name)
break
case 'query':
this.formObj.storageCondition = data.name
this._getLocConditionList(data.name)
break
}
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_open(data) {
this.showModal = true
this.formObj = this.$resetFields(this.formObj)
this.sampleUnit = ''
this.$refs.footerModal._hideLoading()
this.ids = data
// 循环遍历数据
},
_getPrepareWay: async function() {
const result = await soilSample.getDictList('制备方式')
if (result) {
this.prepareWayList = result
}
},
_getkeepWayList: async function() {
const result = await soilSample.getDictList('保存方式')
if (result) {
this.keepWayList = result
}
},
_getkeepContainerList: async function() {
const result = await soilSample.getDictList('保存容器')
if (result) {
this.keepContainerList = result
}
},
_getUserList: async function() {
const result = await soilSample.getUserList()
if (result) {
console.log(result)
this.backupUserList = result.records
}
},
//
_dateChange(data) {
this.formObj.endDate = data
},
_cancel() {
this.showModal = false
this.$refs.footerModal._hideLoading()
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
this.$emit('on-result-change', this.formObj)
this.showModal = false
this.$refs.footerModal._hideLoading()
} else {
this.$Message.error('表单验证失败!')
this.$refs.footerModal._hideLoading()
}
})
},
_saveInfo: async function(data) {
const result = await soilSample.editBackup(data)
if (result) {
this.$Message.success('保存成功')
}
}
}
}
</script>
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24" style="margin-top: 10px">
<Form v-show="searchOpen" id="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="委托商:">
<Input v-model="formObj.client" name="client" placeholder="请输入委托单位" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-item" label="委托编号:">
<Input v-model="formObj.entrustCode" name="entrustCode" placeholder="请输入委托单号" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-btn">
<Button type="primary" @click="_formSearch">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
@on-result-change="_btnClick"></btn-list>
</Col>
<!--表格-->
<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">
<span v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<div v-else-if="item.status">
{{ scope.row[item.key].display }}
</div>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</div>
<keep-alive>
<!-- eslint-disable-next-line vue/require-component-is -->
<component :is="currentComponent" ref="refModal" @on-result-change="_componentResult"></component>
</keep-alive>
</div>
</template>
<script>
import { soilAptitude, soilEntrust } from '../../../api'
import MeterEntrustRecord from '../../../components/operation/Operation'
import SoilSampleManageHis from '../SoilSampleManageHis'
import global from '../../../api/config'
import SoilEntrustItemNum from './SoilItemNum'
export default {
// eslint-disable-next-line vue/no-unused-components
components: { SoilSampleManageHis, MeterEntrustRecord, SoilEntrustItemNum },
data() {
return {
currentComponent: '',
formId: 'meterSubcontractorFormId',
searchOpen: true,
btn: [
// {
// type: 'success',
// id: '',
// name: '添加'
// }
],
iconMsg: [
{
type: 'ios-list',
id: '',
name: '试样列表'
},
{
type: 'ios-camera-outline',
id: '',
name: '试样照片'
},
{
type: 'ios-download',
id: '',
name: '导出开土制备记录'
},
{
type: 'ios-calculator-outline',
id: '',
name: '项目量统计'
},
{
type: 'md-cloud',
id: '',
name: '附件'
},
{
type: 'ios-clock',
id: '',
name: '操作日志'
}
],
formObj: {
client: undefined,
entrustCode: undefined
},
selectIds: [],
getPage: {},
pageColumns: [
{ title: '委托商', key: 'client', width: 200 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '委托日期', key: 'entrustDate', width: 120, date: true },
{ title: '钻孔位置', key: 'boreholeLocation', width: 120 },
{ title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true },
{ title: '平均容重', key: 'projectNo', width: 120 },
{ title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 },
{ title: '批准日期', key: 'approveDate', width: 120, date: true },
{ title: '批准人', key: 'approver', width: 120 },
{ title: '检验类别', key: 'testType', width: 120 }
]
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('search')
} else {
return this.$tableHeight('noSearch')
}
}
},
mounted() {
this._page()
},
methods: {
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '添加':
this._editModal(false)
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_iconClick(res, data, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '编辑':
this._editModal(true, data.id)
break
case '资质项目':
this._itemModal(data.id)
break
case '导出开土制备记录':
this._exportPrepare(data.id)
break
case '附件':
this._upload(data.id)
break
case '项目量统计':
this._itemNumManage(data.id)
break
case '试样照片':
this._upLoadPhoto(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
case '操作日志':
this._record(data.id)
break
case '查看样品':
this._sampleManage(data.id)
break
case '试样列表':
this._sampleManage(data.id)
break
}
})
},
_itemNumManage(data) {
this.currentComponent = 'SoilEntrustItemNum'
this.$nextTick(() => {
this.$refs.refModal._open(data)
})
},
_exportPrepare(id) {
this.$Modal.confirm({
title: '提示',
content: '确定导出这条记录',
onOk: () => {
window.open(
global.baseURL +
'/soil/v1/entrust/export_soil_prepare_record?ids=' +
id,
'_blank'
)
}
})
},
_componentResult(data, msg) {
switch (this.currentComponent) {
default:
this._page()
}
},
_sampleManage(data) {
this.currentComponent = 'SoilSampleManageHis'
this.$nextTick(() => {
this.$refs.refModal._open(data)
})
// 管理样品
// this.$refs.sampleManageModal._open(data)
},
_record(id) {
this.currentComponent = 'MeterEntrustRecord'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
// this.$refs.entrustRecordModal._open(id)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'changeSize':
this._page()
break
}
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await soilEntrust.pageSamplePrepareCheckHis(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
// 删除
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
// 编辑&添加
_editModal(edit, id) {
if (edit) {
// 编辑
// this.$refs.editSubcontractorModal._open(id)
this._getById(id)
} else {
// 添加
this.$refs.editSubcontractorModal._open()
}
},
// 追加项目
_itemModal(data) {
this.$refs.refModal._open(data)
},
_upLoadPhoto(id) {
this.currentComponent = 'PhotoManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'entrustId')
})
// this.$refs.photoManage._open(id, 'entrustId')
},
_upload(id) {
// 上传文件
this.currentComponent = 'FileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'entrustId')
})
// this.$refs.fileManage._open(id, 'entrustId')
},
_getById: async function(id) {
const result = await soilAptitude.getById(id)
if (result) {
this.$refs.editSubcontractorModal._open(result)
}
},
_delete: async function(ids) {
const result = await soilAptitude.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
}
}
}
</script>
<template>
<div>
<div class="layout-content-padding">
<div class="layout-content-main">
<el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="待完成" name="wait"></el-tab-pane>
<el-tab-pane label="历史记录" name="his"></el-tab-pane>
</el-tabs>
<keep-alive>
<!-- eslint-disable-next-line vue/require-component-is -->
<component ref="refModal" :is="currentComponent"></component>
</keep-alive>
</div>
</div>
</div>
</template>
<script>
import MeterSendEntrust from './SamplePreparation'
import MeterSendEntrustHis from './SamplePreparationHis'
export default {
name: 'MeterSendEntrustIndex',
// eslint-disable-next-line vue/no-unused-components
components: { MeterSendEntrust, MeterSendEntrustHis },
data() {
return {
activeName: 'wait',
currentComponent: ''
}
},
mounted() {
this.activeName = 'wait'
this._page()
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'wait') {
this._page()
} else {
this.currentComponent = 'MeterSendEntrustHis'
this.$nextTick(() => {
this.$refs.refModal._page()
})
}
},
_page() {
this.currentComponent = 'MeterSendEntrust'
this.$nextTick(() => {
this.$refs.refModal._page()
})
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<Modal v-model="showModal" v-drag width="1100">
<p slot="header">选择原始记录模板</p>
<div>
<TwoCard @on-result-change="_refresh" :gutter=16 left-name="原始记录模板类别" right-name="实验室原始记录模板名称" left-span="8">
<template slot="left">
<OriginalRecordClassTree ref="classTree" @on-result-change="_classData"></OriginalRecordClassTree>
</template>
<template slot="right">
<Row>
<!--查询-->
<Col span="24">
<Form :label-width="50" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="名称:">
<Input v-model="formObj.title" @on-enter="_search" placeholder="请输入名称" style="width: 200px"
clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_search" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETableHeight ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :isRadio="true" hide-checkbox>
<vxe-table-column
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="(item) in pageColumns"
:key="item.key" sortable>
<template slot-scope="scope">
<div v-if="item.key==='ctime'">
{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):''}}
</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETableHeight>
</Col>
</Row>
</template>
</TwoCard>
</div>
<div slot="footer">
<modal-footer ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></modal-footer>
</div>
</Modal>
<!--自定义post请求iframe-->
<RecordIframe ref="iframeModal"></RecordIframe>
</div>
</template>
<script>
/**
* 选择原始记录模板(实验室的)
*/
import Global from '../../../api/config'
import TwoCard from '../../../components/base/TwoCard'
import { soilTest } from '../../../api'
import OriginalRecordClassTree from './OriginalRecordClassTree'
import RecordIframe from './RecordIframe'
let count = 0
export default {
components: {
OriginalRecordClassTree,
TwoCard,
RecordIframe
},
data() {
return {
showModal: false,
getPage: {},
pageColumns: [{ title: '名称', key: 'title' }],
formObj: {
id: '',
title: '',
businessTypeList: 0
},
entrustId: '',
clientList: [],
selectData: [],
itemIds: [],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '确定', type: 'primary' }
]
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('', 300)
}
},
created() {
// 监听原始记录消息
// eslint-disable-next-line nuxt/no-globals-in-created
window.addEventListener('message', this._saveOriginal)
},
// 销毁监听事件
beforeDestroy() {
count = 0
window.removeEventListener('message', this._saveOriginal)
},
methods: {
// 刷新左右数据
_refresh() {
this.formObj = this.$resetFields(this.formObj)
this.formObj.businessTypeList = 0
this.$refs.classTree._requestByBusinessTypeList()
this._search()
},
// 左侧数据请求
_classTree() {
const height = this.$tableHeight('', 300)
this.$refs.classTree._Ztree(height, 0)
},
// 左边树的点击
_classData(result) {
if (result !== undefined) {
this.formObj.id = result.id
} else {
this.formObj.id = ''
}
this._search()
},
/** *modal-footer */
_footerResult(name) {
switch (name) {
case '取消':
this.showModal = false
break
case '确定':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_open(ids, entrustId, clientInfo) {
console.log(Global.recordURL)
this.formObj = this.$resetFields(this.formObj)
this.entrustId = entrustId
this.clientList = clientInfo
this._classTree()
this.showModal = true
this.itemIds = ids
this.formObj.businessTypeList = 0
this._page()
this.selectData = []
this._hideLoading()
count = 0
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.entrustId = this.id
const result = await soilTest.templatePage(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_search() {
this.$refs.pageTable._pageChange(1)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'singleSelect':
this.selectData = [data]
break
case 'dbSelect':
this.selectData = [data]
this._ok()
break
case 'changeSize':
this._page()
break
}
},
_ok() {
if (this.selectData.length === 0) {
this.$Message.warning('请选择一个原始记录模板!')
this._hideLoading()
} else {
console.log(this.selectData)
// 校验多样品多项目原始记录模板
this._createOriginalRecord()
}
},
_check: async function(param) {
const result = await soilTest.checkLimit(param)
console.log(result)
},
_createOriginalRecord() {
this.showModal = false
console.log('环境', process.env.NODE_ENV)
let recordUrl = ''
if (process.env.NODE_ENV === 'production') {
recordUrl = 'http://record.patzn.com'
} else {
recordUrl = Global.recordURL
}
let baseUrl = Global.baseURL
baseUrl +=
'/soil/v1/sample/original_record_data_bind?entrustId=' +
this.entrustId +
'&expIds=' +
this.itemIds +
'&modelId=' +
this.selectData[0].id
const url =
recordUrl +
'/print/v1/eln/template_meter_' +
this.selectData[0].id +
'?bindUri=' +
encodeURIComponent(baseUrl)
const params = {
ids: this.itemIds.join(','),
client: this.clientList[0],
bindUri: encodeURIComponent(baseUrl)
}
this.$refs.iframeModal._createIframe(url, params)
console.log('原始记录', url, params)
localStorage.setItem('recordStatus', 'addLabRecord')
},
_recordChange() {
this.$emit('on-result-change')
},
_save: async function(temp) {
const result = await soilTest.saveItem(temp)
console.log(result)
if (result) {
this.$Message.success('添加成功')
this._recordChange()
this.$refs.iframeModal._closeIframe()
}
},
// 保存原始记录信息
_saveOriginal(data) {
if (localStorage.getItem('recordStatus') === 'addLabRecord') {
if (count === 0) {
if (data.data.msg !== true) {
// 添加
const tempData = {
formId: data.data.msg,
ids: this.itemIds.join(',')
}
console.log('saveData', data)
const copyMapTemp = {}
if (data.data.copySheet && data.data.copyedSheet) {
tempData.copyMap = {}
const copyedKey = String(data.data.copyedSheet)
copyMapTemp[copyedKey] = ''
copyMapTemp[copyedKey] = String(data.data.copySheet)
// 存在复制sheet的情况
tempData.copyMap = JSON.stringify(copyMapTemp)
} else if (typeof data.data.testValueArry !== 'undefined') {
const testValue = data.data.testValueArry
tempData.copyMap = {}
testValue.forEach(item => {
const copyedKey = String(item.copyedSheet)
copyMapTemp[copyedKey] = ''
copyMapTemp[copyedKey] = String(item.copySheet)
tempData.copyMap = JSON.stringify(copyMapTemp)
})
}
console.log('保存的数据', tempData)
if (tempData.formId !== undefined) {
tempData.entrustId = this.entrustId
this._save(tempData)
}
}
}
count = count + 1
}
}
}
}
</script>
<template>
<div>
<Modal v-model="showModal" v-drag width="800">
<p slot="header">
{{ modalTitle }}
</p>
<div>
<!--内容-->
<Row>
<!--查询-->
<Col span="24">
</Col>
<!--操作-->
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" hide-page="true" is-edit select-data @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"
:edit-render="item.editCell?{autofocus: 'input'}:null"
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
{{ scope.row[item.key] }}
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div>
</Modal>
</div>
</template>
<script>
import { soilEntrust } from '../../../api'
export default {
components: {},
data() {
return {
formId: 'SampleItemManage',
currentComponent: '',
btn: [],
entrustId: '',
showModal: false,
modalTitle: '试验项目统计量',
selectIds: [],
itemId: '',
showOption: true,
searchOpen: true,
selectData: {},
getPage: { records: [] },
currentRow: '',
currentIndex: '',
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '关闭', type: 'primary' }
],
pageColumns: [
{ title: '试验名称', key: 'name' },
{ title: '试验总数', key: 'num' }
],
formObj: {
entrustId: undefined
}
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tableModal')
}
},
methods: {
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '关闭':
this._cancel()
break
}
},
_cancel() {
this.$emit('on-result-change')
this.$refs.pageTable._hideLoading()
this.$refs.footerModal._hideLoading()
this.showModal = false
},
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
methodChange(data) {
const editData = {}
editData.testMethod = data.testMethod
this._editItem(data.id, editData)
},
_handleRow(data) {
this.currentRow = data.row
this.currentIndex = data.rowIndex
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '批量填写试验项目信息':
this._writeInfo()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_iconClick(res, data, componentName, index) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '编辑':
this._editModal(true, data)
break
case '删除':
console.log(index)
this._deleteById(data.id)
break
case '附件':
this.$refs.refModal._open(data.id, 'sampleId')
break
}
})
},
_tableResultChange(msg, data) {
const selectIds = []
switch (msg) {
case 'selectData':
for (let i = 0; i < data.length; i++) {
selectIds.push(data[i].id)
}
this.selectIds = selectIds
this.selectData = data
break
case 'page':
this._pageByEntrustId()
break
case 'changeSize':
this._pageByEntrustId()
break
}
},
_open(id) {
this.formObj = this.$resetFields(this.formObj)
this.formObj.entrustId = id
this.showModal = true
this.$refs.pageTable._hideLoading()
this._pageByEntrustId()
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_pageByEntrustId: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilEntrust.listEntrustItemNum(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage.records = result
}
},
_detailModal(data) {},
_search() {
this._pageByEntrustId()
},
_resultChange(msg) {
this._pageByEntrustId()
this.$Message.success(msg)
this.$emit('on-result-change')
}
}
}
</script>
<template>
<div>
<TwoColumnPage>
<template slot="left">
<ItemLeftList ref="leftModal" @on-result-change="_leftResult"></ItemLeftList>
</template>
<template slot="right">
<ItemRightList ref="rightModal" @on-result-change="_rightResult"></ItemRightList>
</template>
</TwoColumnPage>
</div>
</template>
<script>
import TwoColumnPage from '../../../../components/base/TwoColumnPage'
import ItemLeftList from './RecordLeftList'
import ItemRightList from './RecordRightList'
export default {
components: {
TwoColumnPage,
ItemLeftList,
ItemRightList
},
data() {
return {
id: ''
}
},
methods: {
_leftResult(data) {
console.log('ItemTabs', data)
this.$refs.rightModal._open(this.id, data)
},
_rightResult() {
this.$refs.leftModal._page()
},
_open(id) {
this.id = id
console.log(id)
this.$refs.leftModal._open(this.id)
},
_clearTable() {
this.$refs.rightModal._clearAll()
}
}
}
</script>
<template>
<div>
<Row>
<!--查询-->
<Col span="24">
<Form id="task-assign-item-left" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="检测项目:">
<Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入检测项目" clearable></Input>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<btn-list @on-result-change="_btnClick" class="contHide" style="margin-bottom: 6px;"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :isRadio="true" :pageColumns="pageColumns" :table-name="tableName"
:tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :hide-checkbox="true" select-data>
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width"
:fixed="item.fixed?item.fixed:undefined"
sortable>
<template slot-scope="scope">
<a v-if="item.detail" @click.stop="_detailModal(scope.row)">{{scope.row[item.key]}}</a>
<span v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
<VXESettingCol slot="setting" :pageColumns="pageColumns" :userColumns="userColumns"
@on-result-change="_resetColumn" :table-name="tableName"></VXESettingCol>
</PTVXETable>
</Col>
</Row>
</div>
</template>
<script>
import { soilTest } from '../../../../api'
export default {
components: {},
data() {
return {
currentComponent: '',
formObj: {
name: undefined
},
tableName: 'food-task-assign-item-left',
// 用户自己选中的列
userColumns: [],
optionList: [
{ key: 'name', name: '检测项目', placeholder: '请输入检测项目' },
{ key: 'testBasis', name: '检测依据', placeholder: '请输入检测依据' }
],
getPage: {},
id: '',
pageColumns: [
{ title: '检测项目', key: 'name', width: 120 },
{ title: '检测方法', key: 'testMethod', width: 140 },
{ title: '检测依据名称', key: 'testBasisName', width: 200 }
]
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tabSearch')
}
},
methods: {
// 重置column
_resetColumn(colList) {
this.userColumns = colList
this.$refs.pageTable._loadColumn(colList)
},
_modalResult() {
if (this.currentComponent === 'AutoAssignModal') {
this._formSearch()
}
},
_selInputResult1(msg, data) {
switch (msg) {
case 'search':
this._formSearch()
break
}
},
_open(id) {
this.id = id
this._page()
},
_searchParams() {
const obj = {}
const obj1 = this.$refs.selInput1._getFormObj()
Object.assign(obj, obj1)
return obj
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.entrustId = this.id
const result = await soilTest.pagePrepareByExp(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_tableResultChange(msg, data) {
console.log(msg, data)
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodItem.page
break
case 'selectData':
this.$emit('on-result-change', data)
break
case 'singleSelect':
this.$emit('on-result-change', data)
break
case 'changeSize':
this._page()
break
case 'table-col':
// 用户选中的表格列
this.userColumns = data
break
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_btnClick(msg) {
switch (msg) {
case '自动分配':
this._autoAssign()
break
}
},
_autoAssign() {
console.log('自动分配')
}
}
}
</script>
...@@ -35,6 +35,10 @@ ...@@ -35,6 +35,10 @@
:handle-obj="scope" @on-result-change="_preparationChange" clearable :handle-obj="scope" @on-result-change="_preparationChange" clearable
placeholder="输入或选择制备方式"></AutoComplete> placeholder="输入或选择制备方式"></AutoComplete>
</div> </div>
<div v-else-if="item.key==='printNum'" @click="_handleRow(scope)">
<el-input v-model="scope.row.printNum" @input="inputChange(scope)" name="printNum" placeholder="输入打印数量">
</el-input>
</div>
<div v-else-if="item.key==='unit'" @click="_handleRow(scope)"> <div v-else-if="item.key==='unit'" @click="_handleRow(scope)">
<el-input v-model="scope.row.unit" name="unit" placeholder="输入或选择单位"> <el-input v-model="scope.row.unit" name="unit" placeholder="输入或选择单位">
</el-input> </el-input>
...@@ -145,11 +149,13 @@ export default { ...@@ -145,11 +149,13 @@ export default {
getPage: { getPage: {
records: [] records: []
}, },
currentIndex: -1,
selectData: [], selectData: [],
selectIds: [], selectIds: [],
pageColumns: [ pageColumns: [
{ title: '试样编号', key: 'sampleCode', width: 130 }, { title: '试样编号', key: 'sampleCode', width: 130 },
{ title: '试样深度', key: 'sampleDepth', width: 130 }, { title: '试样深度', key: 'sampleDepth', width: 130 },
{ title: '打印数量', key: 'printNum', width: 130, editCell: true },
{ title: '检验科室', key: 'groupName', width: 130 }, { title: '检验科室', key: 'groupName', width: 130 },
// 暂时屏蔽 // 暂时屏蔽
// {title: '打印份数', key: 'printNum', width: 110}, // {title: '打印份数', key: 'printNum', width: 110},
...@@ -201,6 +207,10 @@ export default { ...@@ -201,6 +207,10 @@ export default {
this.$refs.pageTable._showLoading() this.$refs.pageTable._showLoading()
}, },
methods: { methods: {
inputChange(data) {
this.$forceUpdate()
this.getPage.records[data.$rowIndex].printNum = data.row.printNum
},
// 获取存储位置 // 获取存储位置
_locationChange(msg, data, handleObj) { _locationChange(msg, data, handleObj) {
this.currentRow = handleObj this.currentRow = handleObj
...@@ -327,6 +337,7 @@ export default { ...@@ -327,6 +337,7 @@ export default {
console.log(result[j].prepareDate) console.log(result[j].prepareDate)
console.log(new Date(result[j].prepareDate)) console.log(new Date(result[j].prepareDate))
this.getPage.records[j].prepareDate = new Date(result[j].prepareDate) this.getPage.records[j].prepareDate = new Date(result[j].prepareDate)
this.getPage.records[j].printNum = 1
} }
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
} }
...@@ -431,35 +442,38 @@ export default { ...@@ -431,35 +442,38 @@ export default {
} }
const data = this.selectData const data = this.selectData
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
LODOP.PRINT_INITA( for (let j = 0; j < data[i].printNum; j++) {
'0mm', LODOP.PRINT_INITA(
'0mm', '0mm',
'60.01mm', '0mm',
'40.01mm', '60.01mm',
'打印控件功能演示_Lodop功能_打印图片3' '40.01mm',
) '打印控件功能演示_Lodop功能_打印图片3'
LODOP.ADD_PRINT_BARCODE( )
'0.08mm', LODOP.ADD_PRINT_BARCODE(
'18.39mm', '0.08mm',
'58.87mm', '18.39mm',
'24.74mm', '58.87mm',
'QRCode', '24.74mm',
data[i].sampleCode + '-' + data[i].groupId 'QRCode',
) data[i].sampleCode + '-' + data[i].groupId
LODOP.ADD_PRINT_TEXT( )
130, LODOP.ADD_PRINT_TEXT(
13, 130,
186, 13,
20, 186,
this._formatDate(data[i].prepareDate) 20,
) this._formatDate(data[i].prepareDate)
LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2) )
LODOP.ADD_PRINT_TEXT(113, 13, 187, 20, data[i].groupName) LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2) LODOP.ADD_PRINT_TEXT(113, 13, 187, 20, data[i].groupName)
LODOP.ADD_PRINT_TEXT(95, 12, 188, 20, data[i].sampleCode) LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2) LODOP.ADD_PRINT_TEXT(95, 12, 188, 20, data[i].sampleCode)
LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
LODOP.PRINT_DESIGN() // LODOP.PRINT_DESIGN()
LODOP.PRINT()
}
} }
}, },
// 时间戳转换方法 date:时间戳数字 // 时间戳转换方法 date:时间戳数字
......
...@@ -71,8 +71,7 @@ export default { ...@@ -71,8 +71,7 @@ export default {
}, },
// 关闭弹框的时候刷新上个界面 // 关闭弹框的时候刷新上个界面
_visibleChange(data) { _visibleChange(data) {
if (data === false) { this.$emit('on-result-change')
}
} }
} }
} }
......
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
<Form-item class="search-item" label="委托编号:"> <Form-item class="search-item" label="委托编号:">
<Input v-model="formObj.entrustCode" @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托编号" clearable/> <Input v-model="formObj.entrustCode" @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托编号" clearable/>
</Form-item> </Form-item>
<Form-item class="search-item" label="钻孔名称:">
<Input v-model="formObj.boreholeName" @on-enter="_formSearch" placeholder="请输入钻孔名称" clearable></Input>
</Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button @click="_formSearch" type="primary">搜索</Button>
</Form-item> </Form-item>
...@@ -129,9 +132,9 @@ export default { ...@@ -129,9 +132,9 @@ export default {
{ title: '委托商', key: 'client', width: 200 }, { title: '委托商', key: 'client', width: 200 },
{ title: '委托编号', key: 'entrustCode', width: 120 }, { title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '委托日期', key: 'entrustDate', width: 120, date: true }, { title: '委托日期', key: 'entrustDate', width: 120, date: true },
{ title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '钻孔位置', key: 'boreholeLocation', width: 120 }, { title: '钻孔位置', key: 'boreholeLocation', width: 120 },
{ title: '水深(米)', key: 'waterDepth', width: 120 }, { title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true }, { title: '进度', key: 'progress', width: 120, status: true },
// { title: '平均容重', key: 'projectNo', width: 120 }, // { title: '平均容重', key: 'projectNo', width: 120 },
// { title: '报告编号', key: 'reportCode', width: 120 }, // { title: '报告编号', key: 'reportCode', width: 120 },
......
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
<Form-item class="search-item" label="委托编号:"> <Form-item class="search-item" label="委托编号:">
<Input v-model="formObj.entrustCode" @on-enter="_formSearch" placeholder="请输入委托单位" clearable></Input> <Input v-model="formObj.entrustCode" @on-enter="_formSearch" placeholder="请输入委托单位" clearable></Input>
</Form-item> </Form-item>
<Form-item class="search-item" label="钻孔名称:">
<Input v-model="formObj.boreholeName" @on-enter="_formSearch" placeholder="请输入钻孔名称" clearable></Input>
</Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button @click="_formSearch" type="primary">搜索</Button>
</Form-item> </Form-item>
...@@ -99,9 +102,9 @@ export default { ...@@ -99,9 +102,9 @@ export default {
{ title: '委托商', key: 'client', width: 200 }, { title: '委托商', key: 'client', width: 200 },
{ title: '委托编号', key: 'entrustCode', width: 120 }, { title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '委托日期', key: 'entrustDate', width: 120, date: true }, { title: '委托日期', key: 'entrustDate', width: 120, date: true },
{ title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '钻孔位置', key: 'boreholeLocation', width: 120 }, { title: '钻孔位置', key: 'boreholeLocation', width: 120 },
{ title: '水深(米)', key: 'waterDepth', width: 120 }, { title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true }, { title: '进度', key: 'progress', width: 120, status: true },
{ title: '平均容重', key: 'projectNo', width: 120 }, { title: '平均容重', key: 'projectNo', width: 120 },
{ title: '报告编号', key: 'reportCode', width: 120 }, { title: '报告编号', key: 'reportCode', width: 120 },
......
<!--检测项目编辑列表(添加、导入检测项目)-->
<template>
<div>
<Modal
v-model="showModal"
:mask-closable="false"
:width="690"
title="检测项目管理"
>
<Row>
<Col span="24">
<Form v-model="formObj" :label-width="90" inline onsubmit="return false">
<Form-item class="search-item" label="试验名称:" style="margin-left: -25px">
<Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入试验名称" clearable />
</Form-item>
<!-- <Form-item class="search-item" label="检测依据:">-->
<!-- <Input v-model="formObj.code" 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" />
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" select-data>
<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">
<span v-if="item.key==='judged'">
{{ scope.row[item.key]===1?'是':'否' }}
</span>
<div v-else-if="item.key==='compareSymbol'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.compareSymbol"
placeholder="请输入比较符"
/>
</div>
<div v-else-if="item.key==='limitValue'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.limitValue"
placeholder="请输入限值"
/>
</div>
<div v-else-if="item.key==='unit'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.unit"
placeholder="请输入单位"
/>
</div>
<div v-else-if="item.key==='code'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.code"
style="width: 130px;"
blur
placeholder="请选择检测依据"
/>
<i @click.stop="_selectjudgeBasis(scope.$index)" style="cursor: pointer;font-size: 14px;" class="icons iconfont pt-search icon-search"></i>
</div>
<span v-else>
{{ scope.row[item.key] }}
</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div>
</Modal>
</div>
</template>
<script>
import { soilAptitude } from '../../../../api'
export default {
components: {},
data() {
return {
formObj: {
catalogueId: '',
name: '',
code: '',
standardCode: '',
standardName: ''
},
showModal: false,
searchOpen: false,
btn: [],
index: '',
iconMsg: [],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
],
pageColumns: [
{ title: '试验名称', key: 'name', width: 140 },
{ title: '大类', key: 'mainType', width: 140 },
{ title: '小类', key: 'smallType', width: 140 },
{ title: '方法', key: 'testMethod', width: 180 }
// { title: '设备', key: 'device', width: 180 },
// { title: '检测依据', key: 'code', width: 180 },
// { title: '检测科室', key: 'groupName', width: 110 },
// { title: '比较符', key: 'compareSymbol', width: 120 },
// { title: '限值', key: 'limitValue' },
// { title: '单位', key: 'unit' },
// { title: '是否系统判定', key: 'judged', width: 120, judged: true },
// { title: '备注', key: 'remark' }
],
catalogueId: '',
getPage: {},
selectData: []
}
},
methods: {
_open(catalogueId, label) {
this.formObj = this.$resetFields(this.formObj)
this.showModal = true
this.catalogueId = catalogueId
this.formObj.catalogueId = catalogueId
this.getPage.records = []
this.$refs.pageTable._hideLoading()
this._page()
// if (catalogueId) {
// this._page()
// }
},
_handleRow(scope) {
console.log(scope)
},
_selectjudgeBasis(index) {
console.log(index)
this.index = index
this.$refs.EditModal._open()
},
_backData(data) {
console.log(typeof this.index)
this.getPage.records[this.index].code = data.code
this.$set(
this.getPage.records,
this.index,
this.getPage.records[this.index]
)
console.log(this.getPage.records)
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_page: async function() {
// this.$refs.pageTable._page('search-form-package', 'FoodJudgeBasis/page')
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilAptitude.page(this.$serializeForm(this.formObj))
if (result) {
console.log(result)
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_btnClick(msg) {
switch (msg) {
case '导入检测项目':
this.$refs.relItemModal._open(this.catalogueId)
break
}
},
// 操作列操作
_iconClick(res, data) {
switch (res) {
case '删除':
this._deleteById(data.relPackageId)
break
}
},
// 删除
_deleteById(id) {
this.$Modal.confirm({
title: '提示',
content: '确定删除该数据?',
onOk: () => {
this._deleteOk(id)
}
})
},
// _deleteOk: async function(id) {
// // const result = await drugCatalogueItem.deleteById(id)
// if (result) {
// this.$Message.success('删除成功')
// this._page()
// }
// },
// table结果 返回整行
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this._page()
break
case 'selectData':
this.selectData = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
_ok() {
const data = this.selectData
if (data.length === 0) {
this._hideLoading()
this.$Message.warning('请选择至少一条数据!')
}
const ids = []
data.forEach(item => {
ids.push(item.id)
})
this._saveCatalogueItem(data)
},
_saveCatalogueItem(data) {
this.showModal = false
this._hideLoading()
this.$emit('on-result-change', data)
console.log('data------', data)
this._hideLoading()
},
_cancel() {
this.selectData = []
this.showModal = false
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
}
}
}
</script>
...@@ -14,6 +14,12 @@ ...@@ -14,6 +14,12 @@
<Form-item label="试验名称:" class="search-item"> <Form-item label="试验名称:" class="search-item">
<Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入试验名称" clearable /> <Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入试验名称" clearable />
</Form-item> </Form-item>
<Form-item label="大类:" class="search-item">
<Input v-model="formObj.mainType" @on-enter="_formSearch" placeholder="请输入大类" clearable />
</Form-item>
<Form-item label="小类:" class="search-item">
<Input v-model="formObj.smallType" @on-enter="_formSearch" placeholder="请输入小类" clearable />
</Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary"> <Button @click="_formSearch" type="primary">
搜索 搜索
...@@ -35,6 +41,7 @@ ...@@ -35,6 +41,7 @@
:field="item.key" :field="item.key"
:title="item.title" :title="item.title"
:min-width="item.width?item.width:200" :min-width="item.width?item.width:200"
:edit-render="item.editCell?{autofocus: 'input'}:null"
:fixed="item.fixed?item.fixed:undefined" sortable> :fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="item.detail"> <div v-if="item.detail">
...@@ -51,6 +58,11 @@ ...@@ -51,6 +58,11 @@
</el-select> </el-select>
<span v-if="!showOption">{{ scope.row[item.key]===0? '否':'是' }}</span> <span v-if="!showOption">{{ scope.row[item.key]===0? '否':'是' }}</span>
</div> </div>
<div v-else-if="item.key==='groupName'" @click="_handleRow(scope)">
<AutoCompletes v-model="scope.row.groupName" :handle-obj="scope.row" :down-data="groupoptions" @on-result-change="_selGroup"
style="editable:false" clearable
placeholder="请选择试验室" show-key="name"></AutoCompletes>
</div>
<div v-else-if="item.key==='status'"> <div v-else-if="item.key==='status'">
{{ scope.row[item.key].display }} {{ scope.row[item.key].display }}
</div> </div>
...@@ -111,9 +123,10 @@ ...@@ -111,9 +123,10 @@
</template> </template>
<script> <script>
import http from '../../../../api/http' import http from '../../../../api/http'
import { soilEntrust } from '../../../../api' import AutoCompletes from '../../../../components/base/AutoCompletes'
import { soilAptitude, soilEntrust } from '../../../../api'
export default { export default {
components: {}, components: { AutoCompletes },
data() { data() {
return { return {
formId: 'SampleItemManage', formId: 'SampleItemManage',
...@@ -124,6 +137,7 @@ export default { ...@@ -124,6 +137,7 @@ export default {
showModal: false, showModal: false,
modalTitle: '管理检测项目', modalTitle: '管理检测项目',
selectIds: [], selectIds: [],
groupoptions: [],
itemId: '', itemId: '',
index: '', index: '',
showOption: true, showOption: true,
...@@ -139,6 +153,7 @@ export default { ...@@ -139,6 +153,7 @@ export default {
pageColumns: [ pageColumns: [
{ title: '试验名称', key: 'name', width: 160 }, { title: '试验名称', key: 'name', width: 160 },
{ title: '试验项目英文简写', key: 'shortName', width: 140 }, { title: '试验项目英文简写', key: 'shortName', width: 140 },
{ title: '试验科室', key: 'groupName', width: 140, editCell: true },
{ title: '大类', key: 'mainType', width: 140 }, { title: '大类', key: 'mainType', width: 140 },
{ title: '小类', key: 'smallType' }, { title: '小类', key: 'smallType' },
{ title: '检测依据', key: 'testBasis', width: 180 }, { title: '检测依据', key: 'testBasis', width: 180 },
...@@ -159,7 +174,9 @@ export default { ...@@ -159,7 +174,9 @@ export default {
formObj: { formObj: {
name: undefined, name: undefined,
sampleId: undefined, sampleId: undefined,
code: undefined code: undefined,
mainType: undefined,
smallType: undefined
} }
} }
}, },
...@@ -169,6 +186,31 @@ export default { ...@@ -169,6 +186,31 @@ export default {
} }
}, },
methods: { methods: {
_getGroupList: async function() {
const result = await soilAptitude.getGroupList()
if (result) {
this.groupoptions = result
}
},
_selGroup(msg, data, handleObj) {
console.log(handleObj)
if (msg === 'select') {
this.getPage.records[this.currentIndex].groupName = data.name
this.getPage.records[this.currentIndex].groupId = data.id
const tempData = {}
tempData.groupName = data.name
tempData.groupId = data.id
this._editItem(handleObj.id, tempData)
}
},
_editItem: async function(id, obj) {
const result = await soilEntrust.editItem({ id: id, obj: obj })
if (result) {
this.$Message.success('修改成功')
} else {
this.$Message.warning('修改失败')
}
},
_selectjudgeBasis(id, index) { _selectjudgeBasis(id, index) {
console.log(id) console.log(id)
this.itemId = id this.itemId = id
...@@ -443,6 +485,7 @@ export default { ...@@ -443,6 +485,7 @@ export default {
this.showModal = true this.showModal = true
this.sampleId = id // 委托id this.sampleId = id // 委托id
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this._getGroupList()
this._page() this._page()
}, },
_openRecord(id) { _openRecord(id) {
......
...@@ -11,13 +11,23 @@ ...@@ -11,13 +11,23 @@
<Input @on-enter="_formSearch" v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入试样编号" clearable></Input> <Input @on-enter="_formSearch" v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入试样编号" clearable></Input>
</Form-item> </Form-item>
<Form-item label="是否有试验项目:" class="search-item"> <Form-item label="是否有试验项目:" class="search-item">
<Select v-model="formObj.haveExp" clearable name="groupId" style="width:150px" placeholder="请选择检测科室"> <Select v-model="formObj.haveExp" clearable name="groupId" style="width:150px" placeholder="请选择是否有试验项目">
<Option v-for="(item,index) in itemData" :value="item.value" :key="index">{{item.name}}</Option> <Option v-for="(item,index) in itemData" :value="item.value" :key="index">{{item.name}}</Option>
</Select> </Select>
</Form-item> </Form-item>
<Form-item label="试验项目:" class="search-item"> <Form-item label="筛选试样:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.experimentNames" name="experimentNames" placeholder="请输入试验项目" clearable></Input> <Input @on-enter="_formSearch" v-model="formObj.experimentNames" name="experimentNames" placeholder="请输入试验项目" clearable></Input>
</Form-item> </Form-item>
<Form-item label="试验科室:" class="search-item">
<el-select @change="_selGroup" v-model="formObj.groupId" placeholder="请选择" clearable style="width: 100%">
<el-option
v-for="(item,index) in groupoptions"
:key="index"
:label="item.name"
:value="item.id"
/>
</el-select>
</Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button @click="_formSearch" type="primary">搜索</Button>
</Form-item> </Form-item>
...@@ -61,21 +71,30 @@ ...@@ -61,21 +71,30 @@
<SampleReceiveModal ref="locationModal" @on-result-change="_page()"></SampleReceiveModal> <SampleReceiveModal ref="locationModal" @on-result-change="_page()"></SampleReceiveModal>
<SoilSampleItemManage ref="sampleItemManage" @on-result-change="_page"></SoilSampleItemManage> <SoilSampleItemManage ref="sampleItemManage" @on-result-change="_page"></SoilSampleItemManage>
<KeepAdress ref="keepAdressModal" @on-result-change="_page"></KeepAdress> <KeepAdress ref="keepAdressModal" @on-result-change="_page"></KeepAdress>
<SampleItemSelect ref="sampleItemSelectModal" @on-result-change="_itemImportBack" is-change />
</div> </div>
</template> </template>
<script> <script>
import { soilEntrust } from '../../../../api' import { soilAptitude, soilEntrust, soilSample } from '../../../../api'
import SampleReceiveModal from '../SampleReceiveModal' import SampleReceiveModal from '../SampleReceiveModal'
import SampleItemSelect from './SampleItemSelect'
import SoilSampleItemManage from './SoilSampleItemManage' import SoilSampleItemManage from './SoilSampleItemManage'
import KeepAdress from './KeepAdress' import KeepAdress from './KeepAdress'
export default { export default {
components: { SampleReceiveModal, SoilSampleItemManage, KeepAdress }, components: {
SampleReceiveModal,
SoilSampleItemManage,
KeepAdress,
SampleItemSelect
},
data() { data() {
return { return {
btn: [ btn: [
{ type: 'primary', id: '', name: '收样室收样' }, { type: 'primary', id: '', name: '收样室收样' },
{ type: 'primary', id: '', name: '样品留存' } { type: 'primary', id: '', name: '样品留存' },
{ type: 'primary', id: '', name: '导入试验项目' }
], ],
groupoptions: [],
selectIds: [], selectIds: [],
getPage: {}, getPage: {},
itemData: [ itemData: [
...@@ -102,6 +121,7 @@ export default { ...@@ -102,6 +121,7 @@ export default {
contractId: '', // 合同id contractId: '', // 合同id
selectData: [], selectData: [],
currentComponent: '', currentComponent: '',
indexList: [],
formObj: { formObj: {
samplingNum: '', samplingNum: '',
name: '', name: '',
...@@ -109,7 +129,9 @@ export default { ...@@ -109,7 +129,9 @@ export default {
detectType: '', detectType: '',
standard: '', standard: '',
samplingLinkList: [], samplingLinkList: [],
haveExp: undefined haveExp: undefined,
groupName: undefined,
groupId: undefined
}, },
stdList: [], stdList: [],
sampleLinkList: [ sampleLinkList: [
...@@ -166,6 +188,10 @@ export default { ...@@ -166,6 +188,10 @@ export default {
_selectSampleLink(data) { _selectSampleLink(data) {
console.log(data) console.log(data)
}, },
_selGroup(data) {
console.log(data)
this.formObj.groupId = data
},
// 组件返回值 // 组件返回值
_componentResult(data, msg) { _componentResult(data, msg) {
switch (this.currentComponent) { switch (this.currentComponent) {
...@@ -180,6 +206,12 @@ export default { ...@@ -180,6 +206,12 @@ export default {
this._search() this._search()
} }
}, },
_getGroupList: async function() {
const result = await soilAptitude.getGroupList()
if (result) {
this.groupoptions = result
}
},
_detailModal(id) { _detailModal(id) {
// 查看 // 查看
if (this.type === 0) { if (this.type === 0) {
...@@ -208,6 +240,7 @@ export default { ...@@ -208,6 +240,7 @@ export default {
this.selectIds = [] this.selectIds = []
this.saveWayList = [] this.saveWayList = []
this.saveWayString = '' this.saveWayString = ''
this._getGroupList()
this.$nextTick(() => { this.$nextTick(() => {
this._page() this._page()
}) })
...@@ -281,12 +314,6 @@ export default { ...@@ -281,12 +314,6 @@ export default {
this.$refs.refModal._open('扫码接收发放') this.$refs.refModal._open('扫码接收发放')
} }
break break
case '导入检测项目':
this._importItem()
break
case '导入检测项目包':
this._importItemPackage()
break
case '复制历史样品检测项目': case '复制历史样品检测项目':
this._copyHisItem() this._copyHisItem()
break break
...@@ -296,6 +323,9 @@ export default { ...@@ -296,6 +323,9 @@ export default {
case '样品留存': case '样品留存':
this._sampleKeep(this.selectIds) this._sampleKeep(this.selectIds)
break break
case '导入试验项目':
this._importItem()
break
case '打印标签': case '打印标签':
this._selectPrinter('print-label') this._selectPrinter('print-label')
break break
...@@ -312,6 +342,33 @@ export default { ...@@ -312,6 +342,33 @@ export default {
} }
}) })
}, },
_importItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择至少一条数据!')
} else {
this.$refs.sampleItemSelectModal._open()
}
},
_itemImportBack(data) {
console.log(data)
if (data.length > 0) {
const ids = []
for (let i = 0; i < data.length; i++) {
ids.push(data[i].id)
}
this._importItemOk(ids)
}
},
_importItemOk: async function(ids) {
const result = await soilSample.importExperiments({
aptitudeIds: ids,
ids: this.selectIds
})
if (result) {
this.$Message.success('导入成功')
this._page()
}
},
// 1.自定义打印,除检样、备样、留样 增加制备标签,需要单独的查询制备标签的数据, // 1.自定义打印,除检样、备样、留样 增加制备标签,需要单独的查询制备标签的数据,
// 2.样品接收位置的制备用制备的的接口,将当前的保存方式置空,打印出来手动填写 // 2.样品接收位置的制备用制备的的接口,将当前的保存方式置空,打印出来手动填写
_cusTomePrint() { _cusTomePrint() {
...@@ -512,7 +569,7 @@ export default { ...@@ -512,7 +569,7 @@ export default {
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page': case 'page':
this.getPage = this.$store.state.FoodSample.page this._page()
break break
case 'selectData': case 'selectData':
this.selectData = data this.selectData = data
...@@ -556,27 +613,6 @@ export default { ...@@ -556,27 +613,6 @@ export default {
// }) // })
} }
}, },
// 导入检测项目包
_importItemPackage() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$nextTick(() => {
this.$refs.refModal._open(this.selectIds)
})
}
},
// 导入检测项目
_importItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$nextTick(() => {
this.$refs.refModal._open(this.selectIds, this.selectData[0])
})
}
},
_copyHisItem() { _copyHisItem() {
if (this.selectIds.length === 0) { if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!') this.$Message.warning('请至少选中一条样品数据!')
......
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