Commit ddaa98ea by lichengming

修改了检测数据录入的填写检测值和判定

parent d470ded4
...@@ -20,7 +20,12 @@ export default { ...@@ -20,7 +20,12 @@ export default {
.then(res => res), .then(res => res),
testValue: data => testValue: data =>
http http
.post('meter/v1/item/bath_write_value/' + data.itemIds, data) .post(
'meter/v1/item/bath_write_value/' +
data.itemIds +
'?testValue=' +
data.testValue
)
.then(res => res), .then(res => res),
_handJudge: data => _handJudge: data =>
http.post('meter/v1/item/hand_judge/' + data.ids, data).then(res => res), http.post('meter/v1/item/hand_judge/' + data.ids, data).then(res => res),
......
...@@ -308,7 +308,6 @@ export default { ...@@ -308,7 +308,6 @@ export default {
} }
} else { } else {
// 编辑的时候选择单位(互不影响) // 编辑的时候选择单位(互不影响)
alert('编辑')
// this.cusName = data // this.cusName = data
// this.formObj.customer.cname = data // this.formObj.customer.cname = data
} }
......
...@@ -254,10 +254,6 @@ export default { ...@@ -254,10 +254,6 @@ export default {
break break
} }
} else { } else {
// 编辑的时候选择单位(互不影响)
// alert('编辑')
// this.cusName = data
// this.formObj.customer.cname = data
} }
}, },
_customerMatch(data) { _customerMatch(data) {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="90" inline> <Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="90" inline>
<Form-item label="委托单位" prop="client" class="width-48"> <Form-item label="委托单位" prop="client" class="width-48">
<AutoComplete :value="formObj.client" :down-data="customerData" name="client" <AutoComplete :value="formObj.client" :down-data="customerData" name="client" ref="autoComplete"
placeholder="请输入或选择委托单位" @on-result-change="_cusNameChange" placeholder="请输入或选择委托单位" @on-result-change="_cusNameChange"
></AutoComplete> ></AutoComplete>
</Form-item> </Form-item>
...@@ -277,10 +277,6 @@ export default { ...@@ -277,10 +277,6 @@ export default {
break break
} }
} else { } else {
// 编辑的时候选择单位(互不影响)
alert('编辑')
// this.cusName = data
// this.formObj.customer.cname = data
} }
}, },
_customerMatch(data) { _customerMatch(data) {
...@@ -556,6 +552,7 @@ export default { ...@@ -556,6 +552,7 @@ export default {
} }
}, },
_openEdit(formObj) { _openEdit(formObj) {
this.$refs.autoComplete.dataValue = formObj.client
this._getList() this._getList()
this.getPage.records = [] this.getPage.records = []
this.showModal = true this.showModal = true
......
...@@ -271,7 +271,6 @@ export default { ...@@ -271,7 +271,6 @@ export default {
} }
} else { } else {
// 编辑的时候选择单位(互不影响) // 编辑的时候选择单位(互不影响)
alert('编辑')
// this.cusName = data // this.cusName = data
// this.formObj.customer.cname = data // this.formObj.customer.cname = data
} }
......
...@@ -277,7 +277,6 @@ export default { ...@@ -277,7 +277,6 @@ export default {
} }
} else { } else {
// 编辑的时候选择单位(互不影响) // 编辑的时候选择单位(互不影响)
alert('编辑')
// this.cusName = data // this.cusName = data
// this.formObj.customer.cname = data // this.formObj.customer.cname = data
} }
......
...@@ -7,11 +7,6 @@ ...@@ -7,11 +7,6 @@
<Form-item label="检测值:" prop="value"> <Form-item label="检测值:" prop="value">
<Input v-model="formObj.value" placeholder="请输入检测值"/> <Input v-model="formObj.value" placeholder="请输入检测值"/>
</Form-item> </Form-item>
<!-- <Form-item label="单位:" prop="unit">-->
<!-- <AutoCompletes :value="formObj.unit" :downData="unitList" @on-result-change="_unitChange"-->
<!-- show-key="name" placeholder="请输入或选择单位"-->
<!-- ></AutoCompletes>-->
<!-- </Form-item>-->
</Form> </Form>
</div> </div>
<div slot="footer"> <div slot="footer">
...@@ -25,7 +20,7 @@ ...@@ -25,7 +20,7 @@
* 退回原因 * 退回原因
*/ */
import ModalFooter from '../../../components/base/modalFooter' import ModalFooter from '../../../components/base/modalFooter'
import { meterItem } from '../../../api'
export default { export default {
components: { components: {
ModalFooter ModalFooter
...@@ -67,18 +62,8 @@ export default { ...@@ -67,18 +62,8 @@ export default {
this.ids = ids // 合同id this.ids = ids // 合同id
this.showBackModal = true this.showBackModal = true
this.formObj = this.$resetFields(this.formObj) this.formObj = this.$resetFields(this.formObj)
// this._dicSearch()
this.$refs.footerModal._hideLoading() this.$refs.footerModal._hideLoading()
}, },
_dicSearch() {
this.$store
.dispatch('LmsBaseDict/getItem', '数据录入常用单位')
.then(() => {
const resultData = this.$store.state.LmsBaseDict.item
this.unitList = JSON.parse(JSON.stringify(resultData))
this.unitListTemp = JSON.parse(JSON.stringify(resultData))
})
},
_unitChange(msg, data) { _unitChange(msg, data) {
this.formObj.unit = data.name this.formObj.unit = data.name
}, },
...@@ -99,22 +84,24 @@ export default { ...@@ -99,22 +84,24 @@ export default {
_ok() { _ok() {
this.$refs.formObj.validate(valid => { this.$refs.formObj.validate(valid => {
if (valid) { if (valid) {
const obj = this.$serializeFormSearch(this.formObj) const data = {}
obj.ids = this.ids.join(',') data.itemIds = this.ids.join(',')
console.log('要传的数据', obj) this.$extend(data, { testValue: this.formObj.value })
// this.$store.dispatch('FoodItem/detectionValue', obj).then(() => { console.log(data)
// if (this.$store.state.FoodItem.success) { this._testValue(data)
// this.$Message.success('填写成功')
// this.showBackModal = false
// this.$emit('on-result-change')
// }
// this.$refs.footerModal._hideLoading()
// })
} else { } else {
this.$refs.footerModal._hideLoading()
this.$Message.error('表单验证失败!') this.$Message.error('表单验证失败!')
} }
}) })
},
_testValue: async function(data) {
console.log(data)
const result = await meterItem.testValue(data)
if (result) {
this.$Message.success('填写成功!')
this.showBackModal = false
this.$emit('on-result-change')
}
} }
} }
} }
......
...@@ -323,6 +323,7 @@ export default { ...@@ -323,6 +323,7 @@ export default {
this.$refs.pageTable._pageChange(1) this.$refs.pageTable._pageChange(1)
}, },
_page: async function() { _page: async function() {
this.selectIds = []
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj) console.log('this.formObj', this.formObj)
const result = await meterItem.pageTest(this.formObj) const result = await meterItem.pageTest(this.formObj)
......
...@@ -10,24 +10,24 @@ ...@@ -10,24 +10,24 @@
<Form id="formId" :label-width="80" inline onsubmit="return false"> <Form id="formId" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item label="样品名称:" class="search-item"> <Form-item label="样品名称:" class="search-item">
<Input v-model="formObj.name" placeholder="请输入样品名称" clearable @on-enter="_formSearch"/> <Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入样品名称" clearable/>
</Form-item> </Form-item>
<Form-item label="样品编号:" class="search-item"> <Form-item label="样品编号:" class="search-item">
<Input v-model="formObj.code" placeholder="请输入样品编号" clearable @on-enter="_formSearch"/> <Input v-model="formObj.code" @on-enter="_formSearch" placeholder="请输入样品编号" clearable/>
</Form-item> </Form-item>
<Form-item class="search-btn" style="margin-left: -10px"> <Form-item class="search-btn" style="margin-left: -10px">
<Button type="primary" @click="_formSearch">搜索</Button> <Button @click="_formSearch" type="primary">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Col> </Col>
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide" <btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick"
@on-result-change="_btnClick"></btn-list> class="contHide"></btn-list>
</Col> </Col>
<Col span="24"> <Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :get-page="getPage" <PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :get-page="getPage"
:icon-msg="iconMsg" select-data @on-result-change="_tableResultChange"> :icon-msg="iconMsg" @on-result-change="_tableResultChange" select-data>
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -48,9 +48,9 @@ ...@@ -48,9 +48,9 @@
<div v-else-if="item.key==='testValue'"> <div v-else-if="item.key==='testValue'">
<el-input <el-input
v-model="scope.row.testValue" v-model="scope.row.testValue"
@blur="_handleTestValueEdit(scope.row.id,scope.row.testValue)"
size="medium" size="medium"
placeholder="请输入检测结果" placeholder="请输入检测结果"
@blur="_handleTestValueEdit(scope.row.id,scope.row.testValue)"
/> />
</div> </div>
<div v-else-if="item.key==='progress'"> <div v-else-if="item.key==='progress'">
...@@ -64,12 +64,18 @@ ...@@ -64,12 +64,18 @@
</Row> </Row>
</div> </div>
</Modal> </Modal>
<DetectionValue ref="DetectionValue" @on-result-change="_page"></DetectionValue>
<Judge ref="Judge" @on-result-change="_page"></Judge>
</div> </div>
</template> </template>
<script> <script>
import { meterItem } from '../../../api' import { meterItem } from '../../../api'
import DetectionValue from '../../meter-out/personal-task/DetectionValue'
import Judge from '../../meter-out/personal-task/Judge'
export default { export default {
components: { components: {
DetectionValue,
Judge
// FoodSampleGovernDetail, // FoodSampleGovernDetail,
// CopyModal, // CopyModal,
// FoodSampleGovernLYEdits // FoodSampleGovernLYEdits
...@@ -77,15 +83,6 @@ export default { ...@@ -77,15 +83,6 @@ export default {
data() { data() {
return { return {
currentComponent: '', currentComponent: '',
// btn: [
// {type: 'success', id: '', name: '添加', componentName: 'FoodSampleGovernEdit'},
// {id: 'food-gov-sample-batch-add', name: '批量添加', componentName: 'FoodSampleGovernBatchAdd'},
// {id: '', name: '导入样品', componentName: 'FoodImportSample'},
// {id: '', name: '导入检测项目', componentName: 'RelItem'},
// {id: '', name: '导入检测项目包', componentName: 'RelItemPackage'},
// {id: '', name: '复制历史样品检测项目', componentName: 'CopyHisItem'},
// {id: '', name: '删除'},
// ],
iconMsg: [ iconMsg: [
{ type: 'compose', id: '', name: '编辑' }, { type: 'compose', id: '', name: '编辑' },
{ type: 'ios-copy', id: '', name: '复制', componentName: 'CopyModal' }, { type: 'ios-copy', id: '', name: '复制', componentName: 'CopyModal' },
...@@ -173,6 +170,12 @@ export default { ...@@ -173,6 +170,12 @@ export default {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
switch (msg) { switch (msg) {
case '判定':
this._judge()
break
case '填写检测值':
this._detectionValue()
break
case '完成': case '完成':
this._testEnd() this._testEnd()
break break
...@@ -191,6 +194,21 @@ export default { ...@@ -191,6 +194,21 @@ export default {
} }
}) })
}, },
_judge() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.Judge._open(this.selectIds)
}
},
_detectionValue() {
console.log(this.selectIds.length)
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.DetectionValue._open(this.selectIds)
}
},
_iconClick(res, data, componentName) { _iconClick(res, data, componentName) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
...@@ -259,6 +277,7 @@ export default { ...@@ -259,6 +277,7 @@ export default {
this.$refs.pageTable._pageChange(1) this.$refs.pageTable._pageChange(1)
}, },
_page: async function() { _page: async function() {
this.selectIds = []
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj) console.log('this.formObj', this.formObj)
const result = await meterItem.pageTest(this.formObj) const result = await meterItem.pageTest(this.formObj)
...@@ -400,6 +419,7 @@ export default { ...@@ -400,6 +419,7 @@ export default {
// 操作日志 // 操作日志
this.$refs.recordModal._open(id) this.$refs.recordModal._open(id)
}, },
// 单个填写检测值 // 单个填写检测值
_handleTestValueEdit: async function(id, testValue) { _handleTestValueEdit: async function(id, testValue) {
if (testValue !== '' && undefined !== testValue) { if (testValue !== '' && undefined !== testValue) {
......
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