Commit 385f2f5a by wangweidong

检测项目录入完善

parent 66f2039e
......@@ -61,8 +61,7 @@ export default {
pageItemAuditHis: data =>
http.post('/v1/item/page-audit-his', data).then(res => res),
getById: id => http.get('/v1/test_catalogue/' + id).then(res => res),
edit: data =>
http.put('/v1/test_catalogue?id=' + data.id, data.obj).then(res => res),
edit: data => http.post('/v1/item/edit', data).then(res => res),
add: data => http.post('/v1/sample/', data).then(res => res),
submitCheck: data =>
http.post('/v1/item/submit-check?ids=' + data).then(res => res),
......
import http from '../http'
export default {
page: data => http.post('/v1/value_extend/page', data).then(res => res),
getById: id => http.get('/v1/value_extend/' + id).then(res => res),
edit: data => http.post('/v1/value_extend/edit', data).then(res => res),
deleteById: id => http.delete('/v1/value_extend/' + id).then(res => res),
add: data => http.post('/v1/value_extend/', data).then(res => res)
}
......@@ -66,6 +66,7 @@ export { default as staffTrainRecord } from './staff/staffTrainRecord'
export { default as staffTask } from './staff/staffTask'
export { default as car } from './res/car'
export { default as onlFormHead } from './online/onlFormHead'
export { default as testValueExtend } from './drug/testValueExtend'
/**
* 字典
*/
......
......@@ -12,21 +12,18 @@
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 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 class="search-item" label="牌号:">
<Input v-model="formObj.name" placeholder="请输入牌号" clearable @on-enter="_formSearch" />
</Form-item>
<Form-item class="search-item" label="供应商:">
<Input v-model="formObj.supplier" placeholder="请输入供应商" clearable @on-enter="_formSearch" />
</Form-item>
<Form-item class="search-item" label="请检时间:">
<Form-item class="search-item" label="生产日期:">
<Date-picker
type="datetimerange"
type="daterange"
split-panels
style="width:100%;"
placeholder="请选择请检时间"
placeholder="请选择生产日期"
:editable="false"
@on-change="_ctimeChange"
/>
......
......@@ -11,11 +11,11 @@
class="search-form"
>
<label class="label-sign" />
<Form-item class="search-item" label="样本号:">
<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 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">
......
......@@ -95,6 +95,8 @@ export default {
{ title: '检测项目', key: 'name' },
{ title: '样本号', key: 'sampleCode' },
{ title: '业务类型', key: 'category' },
{ title: '检测值', key: 'testValue', width: 120 },
{ title: '缺陷', key: 'defects', width: 120 },
{ title: '检测依据', key: 'code' },
{ title: '检测依据名称', key: 'standardName' },
{ title: '检测科室', key: 'groupName' },
......
......@@ -95,16 +95,17 @@ export default {
searchOpen: true,
btn: [{ type: 'success', id: '', name: '按人分配' }],
pageColumns: [
{ title: '检测项目', key: 'name' },
{ title: '样本号', key: 'sampleCode' },
{ title: '检测值', key: 'testValue' },
{ title: '业务类型', key: 'category' },
{ title: '检测依据', key: 'code' },
{ title: '检测项目', key: 'name', width: 120 },
{ title: '样本号', key: 'sampleCode', width: 120 },
{ title: '检测值', key: 'testValue', width: 120 },
{ title: '缺陷', key: 'defects', width: 120 },
{ title: '业务类型', key: 'category', width: 120 },
{ title: '检测依据', key: 'code', width: 120 },
{ title: '检测依据名称', key: 'standardName' },
{ title: '检测科室', key: 'groupName' },
{ title: '比较符', key: 'compareSymbol' },
{ title: '限值', key: 'limitValue' },
{ title: '单位', key: 'unit' },
{ title: '检测科室', key: 'groupName', width: 120 },
{ title: '比较符', key: 'compareSymbol', width: 120 },
{ title: '限值', key: 'limitValue', width: 120 },
{ title: '单位', key: 'unit', width: 120 },
{ title: '是否系统判定', key: 'judged', isNot: true },
{ title: '备注', key: 'remark' }
],
......
......@@ -94,6 +94,17 @@
@blur="_handleTestValueEdit(scope.row.id,scope.row.testValue)"
/>
</span>
<span v-else-if="item.key==='sampleQuantity'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.sampleQuantity"
size="medium"
placeholder="请输入样品量"
@blur="_handleSampleQuantityEdit(scope.row.id,scope.row.sampleQuantity)"
/>
</span>
<span v-else-if="item.date">
{{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):'' }}
</span>
......@@ -153,6 +164,8 @@
<selectEquipItem ref="selectEquipItemModal" @on-result-change="_formSearch" />
<!--查看仪器设备-->
<equipmentDetail ref="detailModal" @on-result-change="_formSearch" />
<!--检测值扩展-->
<testValueExtend ref="testValueExtendModal" @on-result-change="_formSearch" />
</div>
</template>
<script>
......@@ -167,6 +180,7 @@ import itemOriginalRecordLook from './origin/itemOriginalRecordLook'
import appendOriginalRecord from './origin/appendOriginalRecord'
import selectEquipItem from './select-equip/selectEquipItem'
import equipmentDetail from './select-equip/equipmentDetail'
import testValueExtend from './test-value-extend/testValueExtend'
export default {
components: {
......@@ -179,6 +193,7 @@ export default {
itemOriginalRecordLook,
appendOriginalRecord,
selectEquipItem,
testValueExtend,
equipmentDetail
},
data() {
......@@ -213,7 +228,9 @@ export default {
{ title: '状态', key: 'progress', width: 120, status: true },
{ title: '检测类型', key: 'type', width: 150 },
{ title: '样本编号', key: 'sampleCode', width: 150 },
{ title: '样品量', key: 'sampleQuantity', width: 130 },
{ title: '检测结果', key: 'testValue', width: 160 },
{ title: '缺陷', key: 'defects', width: 160 },
{ title: '限值', key: 'limitValue', width: 130 },
{ title: '比较符', key: 'compareSymbol', width: 160 },
{ title: '单位', key: 'unit', width: 100 },
......@@ -462,6 +479,11 @@ export default {
this.$refs.judgeModal._open(this.selectIds)
}
},
_testValueExtend(itemId) {
this.$refs.testValueExtendModal._open(itemId)
},
// 批量填写检测值
_detectionValue() {
if (this.selectData.length === 0) {
......@@ -496,6 +518,9 @@ export default {
case '确认':
this._submitById(data.id)
break
case '检测结果扩展':
this._testValueExtend(data.id)
break
case '偏离申请':
this._skewingApply(data)
break
......@@ -550,6 +575,20 @@ export default {
}
}
},
_handleSampleQuantityEdit: async function(id, sampleQuantity) {
if (sampleQuantity !== '' && undefined !== sampleQuantity) {
const data = {}
data.itemIds = id
data.sampleQuantity = sampleQuantity
const result = await drugItem.edit(data)
if (result) {
await this._page()
} else {
this.$Message.error('保存失败')
}
}
},
_handleOrderByValueEdit: async function(id, orderBy) {
if (orderBy !== '' && undefined !== orderBy) {
const data = {}
......
<template>
<div>
<Modal v-model="showDefectModal" v-drag width="800" class="modal-footer-none zIndex-1100">
<p slot="header">
添加缺陷
</p>
<div>
<Row>
<!--查询-->
<Form id="test-value-extend-form" inline onsubmit="return false" :label-width="70">
<label class="label-sign" />
<Form-item label="缺陷:">
<Input
name="name"
placeholder="请输入缺陷"
style="width: 200px"
clearable
@on-enter="_search"
/>
</Form-item>
<Form-item class="search-btn">
<Button type="primary" @click="_search">
搜索
</Button>
</Form-item>
</Form>
<Col span="24" />
<Button style="margin-bottom: 5px" type="primary" @click="_add">
添加
</Button>
</Col>
<!-- 表格 -->
<Col span="24" />
<element-table
ref="pageTable"
:table-height="tableHeight"
:get-page="getPage"
show-check-box
select-data
@on-result-change="_tableResultChange"
>
<el-table-column
v-for="item in pageColumns"
:key="item.key"
show-overflow-tooltip
:prop="item.key"
:align="item.align"
:label="item.title"
:min-width="item.width"
:fixed="item.fixed?item.fixed:undefined"
>
<template slot-scope="scope">
<span
v-if="item.key==='defect'"
@click.stop="_handleRow(scope)"
>
<el-input
v-model="scope.row.defect"
size="medium"
placeholder="请输入缺陷"
@blur="_handleEdit(scope.row.id,scope.row.defect,'defect')"
/>
</span>
<span
v-else-if="item.key==='type'"
@click.stop="_handleRow(scope)"
>
<el-select v-model="scope.row.type" filterable placeholder="请选择类别" @change="_handleEdit(scope.row.id,scope.row.type,'type')">
<el-option
v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</span>
<span
v-else-if="item.key==='code'"
@click.stop="_handleRow(scope)"
>
<el-select v-model="scope.row.code" filterable placeholder="请选择代码" @change="_handleEdit(scope.row.id,scope.row.code,'code')">
<el-option
v-for="item in codeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</span>
<span
v-else-if="item.key==='quantity'"
@click.stop="_handleRow(scope)"
>
<el-input
v-model="scope.row.quantity"
type="number"
size="medium"
placeholder="请输入数量"
@blur="_handleEdit(scope.row.id,scope.row.quantity,'quantity')"
/>
</span>
<span v-else>{{ scope.row[item.key] }}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
:width="100"
fixed="right"
>
<template slot-scope="scope">
<i @click="_delete(scope.row.id)">
删除
</i>
</template>
</el-table-column>
</element-table>
</Col>
</Row>
</div>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div>
</Modal>
</div>
</template>
<script>
/**
* 操作日志-委托
*/
import { testValueExtend } from '../../../../api'
export default {
components: {},
data() {
return {
showDefectModal: false,
getPage: {},
currentRow: {},
typeList: [],
codeList: [],
pageColumns: [
{ title: '缺陷', key: 'defect', align: 'center', width: 120 },
{ title: '类别', key: 'type', align: 'center', width: 100 },
{ title: '代码', key: 'code', align: 'center', width: 100 },
{ title: '数量', key: 'quantity', align: 'center' }
],
iconMsg: [{ type: 'pt-a-trash', id: '', name: '删除' }],
footerList: [
{ id: '', type: '', name: '关闭' },
{ id: '', type: 'primary', name: '确认' }
],
itemIds: [],
itemId: '',
selectData: []
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tableModal') - 200
}
},
methods: {
_open(itemId) {
this.showDefectModal = true
this.itemId = itemId
this._hideLoading()
this.$refs.pageTable.templateRadio = ''
this._clearPage()
this._page()
this._getTypeList()
},
_getTypeList() {
this.typeList.push({
value: '烟支',
label: '烟支'
})
this.typeList.push({
value: '卷烟纸',
label: '卷烟纸'
})
this.typeList.push({
value: '接装纸',
label: '接装纸'
})
this.typeList.push({
value: '滤嘴',
label: '滤嘴'
})
this.typeList.push({
value: '烟支标识',
label: '烟支标识'
})
this.typeList.push({
value: '小盒',
label: '小盒'
})
this.codeList.push({
value: 'Y01.A.1',
label: 'Y01.A.1'
})
this.codeList.push({
value: 'Y01.A.2',
label: 'Y01.A.2'
})
this.codeList.push({
value: 'Y02.A.1',
label: 'Y02.A.1'
})
this.codeList.push({
value: 'Y02.A.2',
label: 'Y02.A.2'
})
},
_clearPage() {
$('#test-value-extend-form')
.find('input')
.each(function() {
$(this).val('')
})
},
// 操作的序号
_handleRow(data) {
this.currentRow = data.row
},
_handleEdit(id, value, label) {
const data = {}
data[label] = value
data.id = id
console.log('data----1--', data)
this._edit(data)
},
_edit: async function(data) {
const result = await testValueExtend.edit(data)
if (result) {
await this._page()
}
},
_add() {
const data = { itemId: this.itemId }
this._save(data)
},
_delete(id) {
this._deleteByIds(id)
},
_deleteByIds: async function(id) {
const result = await testValueExtend.deleteById(id)
if (result) {
await this._page()
}
},
_page: async function() {
const data = this.$serialize('test-value-extend-form')
data.itemId = this.itemId
Object.assign(data, this.formObj)
Object.assign(data, this.$refs.pageTable._searchParams())
const result = await testValueExtend.page(data)
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 'selectData':
this.selectData = data
break
default:
this._page()
}
},
_footerResult(msg) {
switch (msg) {
case '关闭':
this.showDefectModal = false
break
case '确认':
this._ok()
break
}
},
_ok() {
const data = this.selectData
if (data.length === 0) {
this.$Message.warning('请先选择一条数据!')
this.$refs.footerModal._hideLoading()
} else {
const equipData = []
for (let i = 0; i < data.length; i++) {
equipData.push({
brand: data[i].brand,
equipId: data[i].id,
equipName: data[i].name,
labNum: data[i].name,
equipNum: data[i].labNum,
acquisitionCommand: data[i].acquisitionCommand,
spec: data[i].spec,
collectionType: data[i].acquisitionType,
ipAddress: data[i].ipAddress,
collectionAddress: data[i].acquisitionAddress
})
}
const equipDTO = {
equipList: equipData,
itemIds: this.itemIds
}
this._save(equipDTO)
}
},
async _save(data) {
const result = await testValueExtend.add(data)
if (result) {
await this._page()
} else {
this._hideLoading()
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_search() {
this.$refs.pageTable._pageChange(1)
}
}
}
</script>
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