Commit 9f1534f6 by wangweidong

Merge remote-tracking branch 'origin/dev' into dev

parents 2a4a2448 b89b6cec
......@@ -3,6 +3,7 @@
*/
import http from '../http'
import { https } from '../https'
// import { https } from '../https'
export default {
......@@ -20,6 +21,8 @@ export default {
http.post('soil/v1/experiment/page_allot', data).then(res => res),
pageExpTest: data =>
http.post('soil/v1/entrust/page_exp_test', data).then(res => res),
pageExpTestHis: data =>
http.post('soil/v1/entrust/page_exp_test_his', data).then(res => res),
samplePage: data => http.post('soil/v1/sample/page', data).then(res => res),
pageExpTestSample: data =>
http.post('soil/v1/sample/page_exp_test_sample', data).then(res => res),
......@@ -97,5 +100,18 @@ export default {
'&remark=' +
data.remark
)
.then(res => res)
.then(res => res),
// 添加设备信息
addExpEquip: data =>
https
.post('soil/v1/experiment_rel_equip/add_exp_equip', JSON.stringify(data))
.then(res => res),
equipPage: data =>
http.post('soil/v1/experiment_rel_equip/page', data).then(res => res),
deleteEquip: data =>
http.delete('soil/v1/experiment_rel_equip/?ids=' + data).then(res => res),
pageExpCheckHis: data =>
http.post('soil/v1/entrust/page_exp_check_his', data).then(res => res),
pageExpTestSampleHis: data =>
http.post('soil/v1/sample/page_exp_test_sample_his', data).then(res => res)
}
......@@ -204,7 +204,7 @@ export default {
}
},
_ok() {
if (this.tempData.length === 0) {
if (this.delIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
this._hideLoading()
} else {
......
......@@ -64,16 +64,19 @@
<UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo>
<Operation ref="operation"></Operation>
<FileManage ref="FileManage"></FileManage>
<SoilSampleManageHis ref="sampleManageModal"></SoilSampleManageHis>
</div>
</template>
<script>
import UserInfo from '../../../components/user-info-single/AssignPerson'
import { soilTest } from '../../../api'
import Operation from '../../../components/operation/Operation'
import SoilSampleManageHis from '../SoilSampleManageHis'
export default {
components: {
UserInfo,
Operation
Operation,
SoilSampleManageHis
},
data() {
return {
......
......@@ -64,16 +64,19 @@
<UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo>
<Operation ref="operation"></Operation>
<FileManage ref="FileManage"></FileManage>
<SoilSampleManageHis ref="sampleManageModal"></SoilSampleManageHis>
</div>
</template>
<script>
import UserInfo from '../../../components/user-info-single/AssignPerson'
import { soilTest } from '../../../api'
import Operation from '../../../components/operation/Operation'
import SoilSampleManageHis from '../SoilSampleManageHis'
export default {
components: {
UserInfo,
Operation
Operation,
SoilSampleManageHis
},
data() {
return {
......@@ -89,7 +92,6 @@ export default {
name: '管理样品'
},
{ type: 'md-cloud', id: '', name: '附件' },
{ type: 'md-trash', id: '', name: '删除' },
{
type: 'ios-clock',
id: '',
......@@ -399,7 +401,7 @@ export default {
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await soilTest.pageExpTest(
const result = await soilTest.pageExpCheckHis(
this.$serializeForm(this.formObj)
)
if (result) {
......
<template>
<div>
<Modal v-model="showModal" 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.experimentId = 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>
......@@ -64,16 +64,19 @@
<UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo>
<Operation ref="operation"></Operation>
<FileManage ref="FileManage"></FileManage>
<SoilSampleManageHis ref="sampleManageModal"></SoilSampleManageHis>
</div>
</template>
<script>
import UserInfo from '../../../components/user-info-single/AssignPerson'
import { soilTest } from '../../../api'
import Operation from '../../../components/operation/Operation'
import SoilSampleManageHis from './SoilSampleManageHis'
export default {
components: {
UserInfo,
Operation
Operation,
SoilSampleManageHis
},
data() {
return {
......@@ -89,7 +92,6 @@ export default {
name: '管理样品'
},
{ type: 'md-cloud', id: '', name: '附件' },
{ type: 'md-trash', id: '', name: '删除' },
{
type: 'ios-clock',
id: '',
......@@ -399,7 +401,7 @@ export default {
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await soilTest.pageExpTest(
const result = await soilTest.pageExpTestHis(
this.$serializeForm(this.formObj)
)
if (result) {
......
......@@ -51,6 +51,7 @@
<SelectOriTempRecord ref="recordModal" @on-result-change="_page"></SelectOriTempRecord>
<OriginalRecordEdit ref="editModal"></OriginalRecordEdit>
<IndexManage ref="indexModal" @on-result-change="_page"></IndexManage>
<EquipManage ref="equipModal" @on-result-change="_page"></EquipManage>
<SelEquip ref="selEquip" @on-result-change="_equipResult"></SelEquip>
</div>
</template>
......@@ -62,13 +63,15 @@ import SelectOriTempRecord from '../SelectOriTempRecord'
import OriginalRecordEdit from '../OriginalRecordEdit'
import IndexManage from '../IndexManage'
import SelEquip from '../../../../components/select-equip/SelEquip'
import EquipManage from '../EquipManage'
export default {
components: {
AssignPerson,
SelectOriTempRecord,
OriginalRecordEdit,
IndexManage,
SelEquip
SelEquip,
EquipManage
},
data() {
return {
......@@ -119,7 +122,8 @@ export default {
],
iconMsg: [
{ type: 'ios-book', id: '', name: '查看原始记录' },
{ type: 'md-apps', id: '', name: '查看指标' }
{ type: 'md-apps', id: '', name: '查看指标' },
{ type: 'ios-flask', id: '', name: '设备列表' }
],
getPage: {},
pageColumns: [
......@@ -168,17 +172,28 @@ export default {
switch (res) {
case '查看原始记录':
console.log(data)
this._viewRecord('1309434759937146882')
if (data.recorded === '是') {
// this._viewRecord('1309434759937146882')
this._viewRecord(data.originalRecordId)
} else {
this.$Message.warning('未填写原始记录')
}
break
case '查看指标':
this._indexManage(data)
break
case '设备列表':
this._equipManage(data)
break
}
})
},
_indexManage(data) {
this.$refs.indexModal._open(data)
},
_equipManage(data) {
this.$refs.equipModal._open(data)
},
_viewRecord(originalRecordId) {
// layx.iframe('labRecordWriteOriView', '原始记录预览', Global.recordURL + '/print/v1/form/' + originalRecordId, {
// eslint-disable-next-line no-undef
......@@ -210,8 +225,30 @@ export default {
this.userColumns = colList
this.$refs.pageTable._loadColumn(colList)
},
_equipResult(res) {
_equipResult: async function(res) {
console.log(res)
const tempData = {}
tempData.equipList = []
res.map((item, index) => {
tempData.equipList.push({
equipId: item.id,
equipName: item.name,
acquisitionCommand: item.acquisitionCommand,
brand: item.brand,
collectionAddress: item.acquisitionAddress,
collectionType: item.acquisitionType,
equipNum: item.labNum,
ipAddress: item.ipAddress,
labNum: item.classId,
spec: item.spec
})
})
tempData.expIds = this.selectIds
const result = await soilTest.addExpEquip(tempData)
if (result) {
this.$Message.success('添加成功')
}
// let equipIds = []
// for (let i = 0; i < res.length; i++) {
// equipIds.push(res[i].id)
......@@ -392,17 +429,13 @@ export default {
},
_submitItem(data) {
console.log(data)
if (data[0].recorded !== '是') {
this.$Message.warning('未编制报告不能提交')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定提交该数据?',
onOk: () => {
this._submitOk()
}
})
}
this.$Modal.confirm({
title: '提示',
content: '确定提交该数据?',
onOk: () => {
this._submitOk()
}
})
},
_submitOk: async function() {
const result = await soilTest.endExp(this.selectIds.join(','))
......@@ -414,8 +447,20 @@ export default {
if (this.selectIds.length === 0) {
this.$message.warning('请至少选择一条数据')
} else {
console.log('打开填写原始记录界面')
this.$refs.recordModal._open(this.selectIds, this.entrustId)
const errorInfo = []
for (let i = 0; i < this.selectData.length; i++) {
console.log(this.selectData[i].recorded)
if (this.selectData[i].recorded === '否') {
errorInfo.push(this.selectData[i].index + 1)
}
}
console.log('未编制报告', errorInfo)
if (errorInfo.length !== 0) {
this.$Message.warning('第' + errorInfo + '条数据未编制报告')
} else {
console.log('打开填写原始记录界面')
this.$refs.recordModal._open(this.selectIds, this.entrustId)
}
}
},
_allotByPerson() {
......
......@@ -20,7 +20,7 @@
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :pageColumns="pageColumns" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :table-name="tableName" :rows="100" is-task select-data>
@on-result-change="_tableResultChange" :icon-msg="iconMsg" :getPage="getPage" :table-name="tableName" :rows="100" is-task select-data>
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key"
......@@ -35,7 +35,7 @@
</div>
<a v-else-if="item.key==='code'" @click.stop="_detailModal(scope.row)">{{scope.row[item.key]}}</a>
<a v-else-if="item.key==='num'" @click.stop="_sampleDetail(scope.row)">{{scope.row[item.key]}}</a>
<span v-else-if="item.key==='status'">{{scope.row[item.key].display}}</span>
<span v-else-if="item.key==='progress'">{{scope.row[item.key].display}}</span>
<span
v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else-if="item.datetime">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM'):''}}</span>
......@@ -48,14 +48,28 @@
</Col>
</Row>
<AssignPerson ref="personModal" @on-result-change="_assignBackData"></AssignPerson>
<SelectOriTempRecord ref="recordModal" @on-result-change="_page"></SelectOriTempRecord>
<SelEquip ref="selEquip" @on-result-change="_equipResult"></SelEquip>
<IndexManage ref="indexModal" @on-result-change="_page"></IndexManage>
<EquipManage ref="equipModal" @on-result-change="_page"></EquipManage>
</div>
</template>
<script>
import Global from '../../../../api/config'
import { soilTest } from '../../../../api'
import AssignPerson from '../../../../components/user-info-single/AssignPerson'
import SelectOriTempRecord from '../SelectOriTempRecord'
import SelEquip from '../../../../components/select-equip/SelEquip'
import IndexManage from '../IndexManage'
import EquipManage from '../EquipManage'
export default {
components: { AssignPerson },
components: {
AssignPerson,
SelectOriTempRecord,
SelEquip,
IndexManage,
EquipManage
},
data() {
return {
// 定义表格名称----英文
......@@ -86,7 +100,9 @@ export default {
{ key: 'detectType', name: '样品类别', placeholder: '请输入样品类别' }
],
btn: [
{ type: 'success', id: '', name: '试验项目分配' },
{ type: 'success', id: '', name: '填写原始记录' },
{ type: 'success', id: '', name: '完成提交' },
{ type: 'success', id: '', name: '设备' },
{ type: '', id: 'food-task-assign-adjust-group', name: '调整分组' },
{
type: '',
......@@ -95,15 +111,24 @@ export default {
},
{ type: '', id: 'food-task-assign-maintain-info', name: '信息维护' }
],
iconMsg: [
{ type: 'ios-book', id: '', name: '查看原始记录' },
{ type: 'md-apps', id: '', name: '查看指标' },
{ type: 'ios-flask', id: '', name: '设备列表' }
],
getPage: {},
pageColumns: [
{ title: '试验名称', key: 'name', width: 160 },
{ title: '试验项目英文简写', key: 'shortName', width: 140 },
{ title: '试验项目', key: 'name', width: 120, fixed: 'left' },
{ title: '试样编号', key: 'sampleCode', width: 180 },
{ title: '试样深度', key: 'sampleDepth', width: 180 },
{ title: '试样包装类型', key: 'samplePack', width: 180 },
{ title: '是否填写原始记录', key: 'recorded', width: 180 },
{ title: '状态', key: 'progress', width: 180 },
{ title: '大类', key: 'mainType', width: 140 },
{ title: '小类', key: 'smallType', width: 140 },
{ title: '检测依据', key: 'testBasis', width: 180 },
{ title: '试验方法', key: 'testMethod', width: 180 },
{ title: '状态', key: 'status', width: 180 }
{ title: '检测方法', key: 'testMethod', width: 260 },
{ title: '检测依据', key: 'testBasis', width: 140 },
{ title: '检测科室', key: 'groupName', width: 150 }
],
leftSelectData: [],
sampleIds: [],
......@@ -238,6 +263,30 @@ export default {
})
}
},
_equipResult: async function(res) {
console.log(res)
const tempData = {}
tempData.equipList = []
res.map((item, index) => {
tempData.equipList.push({
equipId: item.id,
equipName: item.name,
acquisitionCommand: item.acquisitionCommand,
brand: item.brand,
collectionAddress: item.acquisitionAddress,
collectionType: item.acquisitionType,
equipNum: item.labNum,
ipAddress: item.ipAddress,
labNum: item.classId,
spec: item.spec
})
})
tempData.expIds = this.selectIds
const result = await soilTest.addExpEquip(tempData)
if (result) {
this.$Message.success('添加成功')
}
},
// 调整分组
_userGroupResult(data) {
const tempData = {
......@@ -260,6 +309,15 @@ export default {
case '试验项目分配':
this._userAssign()
break
case '填写原始记录':
this._addRecord()
break
case '完成提交':
this._submitItem(this.selectData)
break
case '设备':
this._selectEquipment()
break
case '按组分配':
await this._reportDueDate()
await this._groupAssign()
......@@ -285,6 +343,49 @@ export default {
break
}
},
_selectEquipment() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.selEquip._open('sample-input')
}
},
_submitItem(data) {
console.log(data)
this.$Modal.confirm({
title: '提示',
content: '确定提交该数据?',
onOk: () => {
this._submitOk()
}
})
},
_submitOk: async function() {
const result = await soilTest.endExp(this.selectIds.join(','))
if (result) {
this._resultChange('提交成功')
}
},
_addRecord() {
if (this.selectIds.length === 0) {
this.$message.warning('请至少选择一条数据')
} else {
const errorInfo = []
for (let i = 0; i < this.selectData.length; i++) {
console.log(this.selectData[i].recorded)
if (this.selectData[i].recorded === '否') {
errorInfo.push(this.selectData[i].index + 1)
}
}
console.log('未编制报告', errorInfo)
if (errorInfo.length !== 0) {
this.$Message.warning('第' + errorInfo + '条数据未编制报告')
} else {
console.log('打开填写原始记录界面')
this.$refs.recordModal._open(this.selectIds, this.entrustId)
}
}
},
// 信息维护
_maintainInfo() {
if (this.selectSampleIds.length === 0) {
......@@ -366,6 +467,9 @@ export default {
this.selectIds = selectIds
this.selectData = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'table-col':
// 用户选中的表格列
this.userColumns = data
......@@ -376,6 +480,55 @@ export default {
break
}
},
_iconClick(res, data, currentComponent) {
this.$nextTick(() => {
switch (res) {
case '查看原始记录':
console.log(data)
if (data.recorded === '是') {
// this._viewRecord('1309434759937146882')
this._viewRecord(data.originalRecordId)
} else {
this.$Message.warning('未填写原始记录')
}
break
case '查看指标':
this._indexManage(data)
break
case '设备列表':
this._equipManage(data)
break
}
})
},
_indexManage(data) {
this.$refs.indexModal._open(data)
},
_equipManage(data) {
this.$refs.equipModal._open(data)
},
_viewRecord(originalRecordId) {
// layx.iframe('labRecordWriteOriView', '原始记录预览', Global.recordURL + '/print/v1/form/' + originalRecordId, {
// eslint-disable-next-line no-undef
layx.iframe(
'labRecordWriteOriView',
'原始记录预览',
Global.recordURL +
'/print/v1/form/' +
originalRecordId +
'?type=ENVTESTMAKE',
{
event: {
onload: {
after: function(layxWindow, winform) {
// eslint-disable-next-line no-undef
layx.max(winform.id)
}
}
}
}
)
},
// 按人分配 选人选时间
_userAssign() {
const user = Global.getUserInfo('userInfo')
......
......@@ -20,7 +20,7 @@
<Col span="24">
<PTVXETable ref="pageTable" :pageColumns="pageColumns" :table-name="tableName"
:tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :rows="100" select-data>
@on-result-change="_tableResultChange" :getPage="getPage" :rows="100" :is-radio="true" select-data hide-checkbox>
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key"
......@@ -120,6 +120,9 @@ export default {
case 'selectData':
this.$emit('on-result-change', data)
break
case 'singleSelect':
this.$emit('on-result-change', data)
break
case 'changeSize':
this._page()
break
......
......@@ -350,16 +350,16 @@ export default {
return obj
},
_page: async function() {
const saveName = []
const saveMethod = []
for (let i = 0; i < this.leftSelectData.length; i++) {
saveName.push(this.leftSelectData[i].name)
saveMethod.push(this.leftSelectData[i].testMethod)
}
const saveName = this.leftSelectData.name
const saveMethod = this.leftSelectData.testMethod
// for (let i = 0; i < this.leftSelectData.length; i++) {
// saveName.push(this.leftSelectData[i].name)
// saveMethod.push(this.leftSelectData[i].testMethod)
// }
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.entrustId = this.entrustId
this.formObj.name = saveName.join(',')
this.formObj.testMethod = saveMethod.join(',')
this.formObj.name = saveName
this.formObj.testMethod = saveMethod
const result = await soilTest.pageExperimentAllot(
this.$serializeForm(this.formObj)
)
......
......@@ -30,6 +30,7 @@ export default {
methods: {
_leftResult(data) {
this.$refs.rightModal._open(this.id, data)
console.log(data)
},
_rightResult() {
this.$refs.leftModal._page()
......
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