Commit 11b35b84 by wangweidong

demo完善样品流转

parent 0ddb8e0d
...@@ -51,6 +51,8 @@ export default { ...@@ -51,6 +51,8 @@ export default {
http.post('/v1/sample/page-sample-receive', data).then(res => res), http.post('/v1/sample/page-sample-receive', data).then(res => res),
pageSampleFlow: data => pageSampleFlow: data =>
http.post('/v1/sample/page-sample-flow', data).then(res => res), http.post('/v1/sample/page-sample-flow', data).then(res => res),
pageSampleFlowHis: data =>
http.post('/v1/sample/page-sample-flow-his', data).then(res => res),
pageSampleReceiveHis: data => pageSampleReceiveHis: data =>
http.post('/v1/sample/page-sample-receive-his', data).then(res => res), http.post('/v1/sample/page-sample-receive-his', data).then(res => res),
...@@ -229,5 +231,11 @@ export default { ...@@ -229,5 +231,11 @@ export default {
http.post('/v1/sample_oos/register-suggestion', data).then(res => res), http.post('/v1/sample_oos/register-suggestion', data).then(res => res),
submitOosRegister: data => submitOosRegister: data =>
http.post('/v1/sample_oos/submit_oos_register?ids=' + data).then(res => res) http
.post('/v1/sample_oos/submit_oos_register?ids=' + data)
.then(res => res),
submitFlow: data =>
https.post('/v1/sample/submit-flow', JSON.stringify(data)).then(res => res),
pageSampleDataQuery: data =>
http.post('/v1/sample/page-sample-data-query', data).then(res => res)
} }
<template>
<div>
<Row>
<!--查询-->
<Col span="24" />
<Form
id="sample-data-query-form-id"
v-show="searchOpen"
inline
onsubmit="return false"
:label-width="70"
class="search-form"
>
<label class="label-sign" />
<Form-item class="search-item" label="样本编号:">
<Input v-model="formObj.sampleCode" placeholder="请输入样本编号" clearable @on-enter="_formSearch" />
</Form-item>
<Form-item class="search-item" label="检测项目:">
<Input v-model="formObj.name" placeholder="请输入检测项目" clearable @on-enter="_formSearch" />
</Form-item>
<Form-item class="search-btn">
<Button type="primary" @click="_formSearch">
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--table-->
<el-button @click="_export" type="primary" >检测数据导出</el-button>
<Col span="24" />
<element-table
ref="pageTable"
:page-columns="pageColumns"
:table-height="tableHeight"
:get-page="getPage"
:opt-col-width="100"
:icon-msg="iconMsg"
show-check-box
@on-result-change="_tableResultChange"
>
<el-table-column
v-for="item in pageColumns"
:key="item.key"
show-overflow-tooltip
sortable
:prop="item.key"
:label="item.title"
:width="item.width"
:min-width="200"
:fixed="item.fixed?item.fixed:undefined"
>
<template slot-scope="scope">
<span v-if="item.dateTime">
{{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):'' }}
</span>
<span v-else-if="item.status">
{{ scope.row[item.key] === undefined ? '': scope.row[item.key].display }}
</span>
<div v-else-if="item.key==='judged'">
{{ scope.row[item.key]===1?'是':'否' }}
</div>
<span v-else-if="item.key === 'singleJudge'">
{{ scope.row[item.key]?scope.row[item.key].display:'' }}
</span>
<span v-else-if="item.key==='recordWriiten'">
{{ scope.row[item.key]==='t'?'是':'否' }}
</span>
<span v-else>
{{ scope.row[item.key] }}
</span>
</template>
</el-table-column>
</element-table>
</Col>
</Row>
<!--操作日志-->
<itemRecord ref="recordModal" />
</div>
</template>
<script>
import { drugSample } from '../../api'
import http from '../../api/http'
import itemRecord from '../record/itemRecord'
export default {
components: {
itemRecord
},
data() {
return {
searchOpen: true,
formObj: {
sampleCode: '',
name: '',
testDateBegin: '',
testDateEnd: '',
auditorDateBegin: '',
auditorDateEnd: ''
},
selectIds: [],
pageColumns: [
{ title: '样本编号', key: 'sampleCode', width: 150, fixed: 'left' },
{ title: '价类', key: 'category', width: 120, type: true },
{ title: '状态', key: 'status', status: true, width: 120 },
{ title: '牌号', key: 'name', width: 120 },
{ title: '卷制标准版本号', key: 'standard', width: 230 },
{ title: '生产日期', key: 'pcTime', width: 120 },
{ title: '机台', key: 'samplePoint' },
{ title: '班次', key: 'classBan', width: 120 },
{ title: '备注', key: 'remark', width: 120 }
],
getPage: {},
iconMsg: [
{ type: 'pt-a-original', id: '', name: '查看原始记录' },
{ type: 'pt-a-clock', id: '', name: '操作日志' }
]
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('search')
}
},
mounted() {
this._page()
},
methods: {
// 录入时间
_signDateChange(data) {
this.formObj.testDateBegin = data[0]
this.formObj.testDateEnd = data[1]
},
// 审核时间
_auditDateChange(data) {
this.formObj.auditorDateBegin = data[0]
this.formObj.auditorDateEnd = data[1]
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_open() {
this._clear()
this._page()
},
_clear() {
this.formObj.sampleCode = ''
this.formObj.name = ''
this.$refs.testDate.handleClear()
this.$refs.auditorDate.handleClear()
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await drugSample.pageSampleDataQuery(
this.$serializeForm(this.formObj)
)
if (result) {
this.getPage = result
this.$refs.pageTable._initTable()
}
},
_searchParams(formId) {
return this.$refs.pageTable._searchParams(formId)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this._page()
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'selectIds':
this.selectIds = data
break
}
},
_iconClick(res, data) {
switch (res) {
case '查看原始记录':
this._itemOriginalRecordLook(data)
break
case '操作日志':
this._record(data.id)
break
}
},
// 查看原始记录
_itemOriginalRecordLook(data) {
if (
data.recordId === null ||
undefined === data.recordId ||
data.recordId === ''
) {
this.$Message.warning('该检测项目暂无原始记录!')
} else {
this.$refs.itemOriginalRecordLookModal._open(data.recordId, 'only')
}
},
_export() {
const data = this.$serialize('sample-data-query-form-id')
console.log(data)
const sampleIds = this.selectIds.join(',')
data.idsStr = sampleIds
this.$Modal.confirm({
title: '提示',
content: '确定导出数据?',
onOk: () => {
http.open(
'/v1/sample/export_sample_test_data/',
this.$serializeForm(data)
)
}
})
},
// 操作日志
_record(id) {
this.$refs.recordModal._open(id)
}
}
}
</script>
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<el-tab-pane label="样本流转" name="lab"> <el-tab-pane label="样本流转" name="lab">
<labSampleReceive ref="labTabs" /> <labSampleReceive ref="labTabs" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="历史任务" name="his"> <el-tab-pane label="流转历史" name="his">
<historyTask ref="hisTabs" /> <historyTask ref="hisTabs" />
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
> >
<template slot-scope="scope" @click.stop="_handleIndex(scope)"> <template slot-scope="scope" @click.stop="_handleIndex(scope)">
<span v-if="item.datetime"> <span v-if="item.datetime">
{{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):'' }} {{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):'' }}
</span> </span>
<span v-else-if="item.key==='status'"> <span v-else-if="item.key==='status'">
{{ scope.row[item.key]?scope.row[item.key].display:'' }} {{ scope.row[item.key]?scope.row[item.key].display:'' }}
...@@ -87,22 +87,22 @@ ...@@ -87,22 +87,22 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column-->
slot="col" <!-- slot="col"-->
label="操作" <!-- label="操作"-->
align="center" <!-- align="center"-->
:width="120" <!-- :width="120"-->
fixed="right" <!-- fixed="right"-->
> <!-- >-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<icon-list <!-- <icon-list-->
:msg="iconMsg" <!-- :msg="iconMsg"-->
:row-data="scope.row" <!-- :row-data="scope.row"-->
:row-index="scope.$index" <!-- :row-index="scope.$index"-->
@on-result-change="_iconClick" <!-- @on-result-change="_iconClick"-->
/> <!-- />-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
</element-table> </element-table>
</Col> </Col>
</Row> </Row>
...@@ -136,14 +136,32 @@ export default { ...@@ -136,14 +136,32 @@ export default {
align: 'center' align: 'center'
}, },
{ {
title: '接收人', title: '流转检测科室',
key: 'receiver', key: 'groupName',
align: 'center',
width: 120
},
{
title: '流转数量',
key: 'flowQuantity',
align: 'center',
width: 120
},
{
title: '单位',
key: 'unit',
align: 'center',
width: 120
},
{
title: '流转人',
key: 'flower',
align: 'center', align: 'center',
width: 120 width: 120
}, },
{ {
title: '接收时间', title: '流转时间',
key: 'receiveTime', key: 'flowTime',
align: 'center', align: 'center',
datetime: true, datetime: true,
width: 150 width: 150
...@@ -166,7 +184,7 @@ export default { ...@@ -166,7 +184,7 @@ export default {
currentIndex: '', currentIndex: '',
selectIds: [], selectIds: [],
iconMsg: [ iconMsg: [
{ id: '', type: 'pt-a-cloud', name: '附件' } // { id: '', type: 'pt-a-cloud', name: '附件' }
// { id: '', type: 'md-egg', name: '操作日志' } // { id: '', type: 'md-egg', name: '操作日志' }
] ]
} }
...@@ -184,7 +202,7 @@ export default { ...@@ -184,7 +202,7 @@ export default {
async _page() { async _page() {
const data = this.$serialize('his-sample-form') const data = this.$serialize('his-sample-form')
Object.assign(data, this.$refs.pageTable._searchParams()) Object.assign(data, this.$refs.pageTable._searchParams())
const result = await drugSample.pageSampleReceiveHis(data) const result = await drugSample.pageSampleFlowHis(data)
if (result) { if (result) {
this.getPage = result this.getPage = result
this.$refs.pageTable._initTable() this.$refs.pageTable._initTable()
......
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
</element-table> </element-table>
</Col> </Col>
</Row> </Row>
<transferListModal ref="ListModal" /> <transferListModal ref="ListModal" @on-result-change="_formSearch" />
<!--扫码接收--> <!--扫码接收-->
<labReceiveScan ref="receiveModal" @on-result-change="_formSearch" /> <labReceiveScan ref="receiveModal" @on-result-change="_formSearch" />
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
<span v-else-if="item.status"> <span v-else-if="item.status">
{{ scope.row[item.key].display }} {{ scope.row[item.key].display }}
</span> </span>
<span v-else-if="item.key==='num'"> <span v-else-if="item.key==='flowQuantity'">
<InputNumber v-model="scope.row.num" name="num" placeholder="请输入数量" style="width: 100px;" /> <InputNumber v-model="scope.row.flowQuantity" name="flowQuantity" placeholder="请输入数量" style="width: 100px;" />
</span> </span>
<span v-else-if="item.key==='unit'"> <span v-else-if="item.key==='unit'">
<Input v-model="scope.row.unit" name="unit" placeholder="请输入单位" style="width: 100px;" /> <Input v-model="scope.row.unit" name="unit" placeholder="请输入单位" style="width: 100px;" />
...@@ -36,13 +36,13 @@ ...@@ -36,13 +36,13 @@
<span v-else-if="item.key==='person'"> <span v-else-if="item.key==='person'">
<Input v-model="scope.row.person" name="person" placeholder="请输入流转人" style="width: 100px;" /> <Input v-model="scope.row.person" name="person" placeholder="请输入流转人" style="width: 100px;" />
</span> </span>
<span v-else-if="item.key==='time'"> <span v-else-if="item.key==='flowTime'">
<el-date-picker <el-date-picker
v-model="scope.row.time" v-model="scope.row.flowTime"
type="datetime" type="datetime"
placeholder="选择日期时间" placeholder="选择日期时间"
default-time="12:00:00"> default-time="12:00:00"
</el-date-picker> />
</span> </span>
<span v-else> <span v-else>
{{ scope.row[item.key] }} {{ scope.row[item.key] }}
...@@ -52,11 +52,16 @@ ...@@ -52,11 +52,16 @@
</element-table> </element-table>
</Col> </Col>
</Row> </Row>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import { drugSample } from '../../api'
export default { export default {
name: 'TransferListModal', name: 'TransferListModal',
data() { data() {
...@@ -65,6 +70,10 @@ export default { ...@@ -65,6 +70,10 @@ export default {
getPage: { getPage: {
records: [] records: []
}, },
footerList: [
{ id: '', name: '确定流转', type: 'primary' },
{ id: '', name: '取消', type: '' }
],
num: 0, num: 0,
unit: '', unit: '',
person: '', person: '',
...@@ -85,26 +94,61 @@ export default { ...@@ -85,26 +94,61 @@ export default {
fixed: 'left', fixed: 'left',
align: 'center' align: 'center'
}, },
{ title: '流转数量', key: 'num', width: 130, align: 'center' }, { title: '流转数量', key: 'flowQuantity', width: 130, align: 'center' },
{ {
title: '流转单位', title: '流转单位',
key: 'unit', key: 'unit',
width: 180, width: 180,
align: 'center' align: 'center'
}, },
{ title: '流转人', key: 'person', width: 120, align: 'center' }, { title: '流转人', key: 'flower', width: 120, align: 'center' },
{ title: '流转时间', key: 'time', width: 300, align: 'center' } { title: '流转时间', key: 'flowTime', width: 300, align: 'center' }
] ]
} }
}, },
methods: { methods: {
_open(data) { _open(data) {
this.showListModal = true this.showListModal = true
console.log(data) this.getPage.records = []
this.getPage.records = data const length = data.length
console.log(123) for (let i = 0; i < length; i++) {
console.log(this.getPage) const object = data[i]
const obj = {}
obj.sampleId = object.id
obj.sampleCode = object.sampleCode
obj.name = object.name
obj.groupName = object.groupName
obj.groupId = object.groupId
this.getPage.records.push(obj)
}
this.$refs.pageTable._initTable() this.$refs.pageTable._initTable()
},
_footerResult(msg) {
switch (msg) {
case '确定流转':
this._ok()
break
case '取消':
this._cancel()
break
}
},
_cancel() {
this.showListModal = false
},
_ok() {
const data = this.getPage.records
this._flow(data)
console.log(data)
},
_flow: async function(data) {
const result = await drugSample.submitFlow({ sampleFlows: data })
if (result) {
this.showListModal = false
this.$message.success('流转成功')
this.$emit('on-result-change')
}
} }
} }
} }
......
...@@ -225,17 +225,19 @@ export default { ...@@ -225,17 +225,19 @@ export default {
getPage: {}, getPage: {},
pageColumns: [ pageColumns: [
{ title: '检测项目', key: 'name', width: 120, fixed: true }, { title: '检测项目', key: 'name', width: 120, fixed: true },
{ title: '状态', key: 'progress', width: 120, status: true },
{ title: '检测类型', key: 'type', width: 150 }, { title: '检测类型', key: 'type', width: 150 },
{ title: '样本编号', key: 'sampleCode', width: 150 }, { title: '样本编号', key: 'sampleCode', width: 150 },
{ title: '样品量', key: 'sampleQuantity', width: 130 }, { title: '样品量', key: 'sampleQuantity', width: 130 },
{ title: '检测结果', key: 'testValue', width: 160 }, { title: '检测结果', key: 'testValue', width: 160 },
{ title: '不合格数量', key: 'failQuantity', width: 160 },
{ title: '标偏', key: 'deviation', width: 160 },
{ title: '缺陷', key: 'defects', width: 160 }, { title: '缺陷', key: 'defects', width: 160 },
{ title: '限值', key: 'limitValue', width: 130 }, { title: '限值', key: 'limitValue', width: 130 },
{ title: '比较符', key: 'compareSymbol', width: 160 }, { title: '比较符', key: 'compareSymbol', width: 160 },
{ title: '单位', key: 'unit', width: 100 }, { title: '单位', key: 'unit', width: 100 },
{ title: '是否系统判定', key: 'judged', width: 120, judged: true }, { title: '是否系统判定', key: 'judged', width: 120, judged: true },
{ title: '排序', key: 'orderBy', width: 80, judged: true }, { title: '排序', key: 'orderBy', width: 80, judged: true },
{ title: '状态', key: 'progress', width: 120, status: true },
{ {
title: '判定结果', title: '判定结果',
key: 'singleJudge', key: 'singleJudge',
......
...@@ -6,6 +6,7 @@ import drugItemInput from '../pages/drug-test-input/dataEntryIndex' ...@@ -6,6 +6,7 @@ import drugItemInput from '../pages/drug-test-input/dataEntryIndex'
import drugItemCheck from '../pages/drug-test-check/dataReviewIndex' import drugItemCheck from '../pages/drug-test-check/dataReviewIndex'
import drugItemAudit from '../pages/drug-test-audit/drugTestAuditIndex' import drugItemAudit from '../pages/drug-test-audit/drugTestAuditIndex'
import drugTestConsult from '../pages/drug-test-consult/dataTestConsult' import drugTestConsult from '../pages/drug-test-consult/dataTestConsult'
import dataDataQuery from '../pages/drug-data-query/dataDataQuery'
export default [ export default [
{ {
path: 'allocate', path: 'allocate',
...@@ -31,5 +32,10 @@ export default [ ...@@ -31,5 +32,10 @@ export default [
path: 'consult', path: 'consult',
component: drugTestConsult, component: drugTestConsult,
meta: { title: '数据查阅' } meta: { title: '数据查阅' }
},
{
path: 'data_query',
component: dataDataQuery,
meta: { title: '样品数据查询' }
} }
] ]
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