Commit 276fdefa by wangweidong

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

parents b724fd22 d7f670c1
......@@ -20,7 +20,12 @@ export default {
.then(res => res),
testValue: data =>
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),
_handJudge: data =>
http.post('meter/v1/item/hand_judge/' + data.ids, data).then(res => res),
......
......@@ -62,7 +62,11 @@ export default {
https
.post('meter/v1/sample/add_send_entrust', JSON.stringify(data))
.then(res => res),
// 取消分包
subpackageCancel: data =>
http
.post('meter/v1/sample/subpackage_cancel_sample?ids=' + data.ids)
.then(res => res),
subpackageSample: data =>
http.post('meter/v1/sample/subpackage_sample?ids=' + data).then(res => res),
......
......@@ -308,7 +308,6 @@ export default {
}
} else {
// 编辑的时候选择单位(互不影响)
alert('编辑')
// this.cusName = data
// this.formObj.customer.cname = data
}
......
......@@ -254,10 +254,6 @@ export default {
break
}
} else {
// 编辑的时候选择单位(互不影响)
// alert('编辑')
// this.cusName = data
// this.formObj.customer.cname = data
}
},
_customerMatch(data) {
......
......@@ -6,7 +6,7 @@
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="90" inline>
<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"
></AutoComplete>
</Form-item>
......@@ -277,10 +277,6 @@ export default {
break
}
} else {
// 编辑的时候选择单位(互不影响)
alert('编辑')
// this.cusName = data
// this.formObj.customer.cname = data
}
},
_customerMatch(data) {
......@@ -556,6 +552,7 @@ export default {
}
},
_openEdit(formObj) {
this.$refs.autoComplete.dataValue = formObj.client
this._getList()
this.getPage.records = []
this.showModal = true
......
......@@ -271,7 +271,6 @@ export default {
}
} else {
// 编辑的时候选择单位(互不影响)
alert('编辑')
// this.cusName = data
// this.formObj.customer.cname = data
}
......
......@@ -277,7 +277,6 @@ export default {
}
} else {
// 编辑的时候选择单位(互不影响)
alert('编辑')
// this.cusName = data
// this.formObj.customer.cname = data
}
......
......@@ -7,11 +7,6 @@
<Form-item label="检测值:" prop="value">
<Input v-model="formObj.value" placeholder="请输入检测值"/>
</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>
</div>
<div slot="footer">
......@@ -25,7 +20,7 @@
* 退回原因
*/
import ModalFooter from '../../../components/base/modalFooter'
import { meterItem } from '../../../api'
export default {
components: {
ModalFooter
......@@ -67,18 +62,8 @@ export default {
this.ids = ids // 合同id
this.showBackModal = true
this.formObj = this.$resetFields(this.formObj)
// this._dicSearch()
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) {
this.formObj.unit = data.name
},
......@@ -99,22 +84,24 @@ export default {
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
const obj = this.$serializeFormSearch(this.formObj)
obj.ids = this.ids.join(',')
console.log('要传的数据', obj)
// this.$store.dispatch('FoodItem/detectionValue', obj).then(() => {
// if (this.$store.state.FoodItem.success) {
// this.$Message.success('填写成功')
// this.showBackModal = false
// this.$emit('on-result-change')
// }
// this.$refs.footerModal._hideLoading()
// })
const data = {}
data.itemIds = this.ids.join(',')
this.$extend(data, { testValue: this.formObj.value })
console.log(data)
this._testValue(data)
} else {
this.$refs.footerModal._hideLoading()
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 {
this.$refs.pageTable._pageChange(1)
},
_page: async function() {
this.selectIds = []
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await meterItem.pageTest(this.formObj)
......
......@@ -170,6 +170,9 @@ export default {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '取消分包':
this._subpackageCancelBtn()
break
case '分包':
this._subpackageSample()
break
......@@ -215,6 +218,23 @@ export default {
}
})
},
_subpackageCancelBtn() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
const data = {}
data.ids = this.selectIds
this._subpackageCancel(data)
}
},
_subpackageCancel: async function(data) {
console.log(data)
const result = await meterSample.subpackageCancel(data)
if (result) {
this.$Message.success('取消成功!')
this._page()
}
},
_sampleEditModal(data) {
console.log(data)
this.$refs.sampleEditModal._open(data.id)
......@@ -246,6 +266,7 @@ export default {
this.$refs.pageTable._pageChange(1)
},
_page: async function() {
this.selectIds = []
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await meterSample.page(this.formObj)
......
......@@ -10,24 +10,24 @@
<Form id="formId" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<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 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 class="search-btn" style="margin-left: -10px">
<Button type="primary" @click="_formSearch">搜索</Button>
<Button @click="_formSearch" type="primary">搜索</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>
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick"
class="contHide"></btn-list>
</Col>
<Col span="24">
<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
v-for="item in pageColumns"
:key="item.key"
......@@ -48,9 +48,9 @@
<div v-else-if="item.key==='testValue'">
<el-input
v-model="scope.row.testValue"
@blur="_handleTestValueEdit(scope.row.id,scope.row.testValue)"
size="medium"
placeholder="请输入检测结果"
@blur="_handleTestValueEdit(scope.row.id,scope.row.testValue)"
/>
</div>
<div v-else-if="item.key==='progress'">
......@@ -64,12 +64,18 @@
</Row>
</div>
</Modal>
<DetectionValue ref="DetectionValue" @on-result-change="_page"></DetectionValue>
<Judge ref="Judge" @on-result-change="_page"></Judge>
</div>
</template>
<script>
import { meterItem } from '../../../api'
import DetectionValue from '../../meter-out/personal-task/DetectionValue'
import Judge from '../../meter-out/personal-task/Judge'
export default {
components: {
DetectionValue,
Judge
// FoodSampleGovernDetail,
// CopyModal,
// FoodSampleGovernLYEdits
......@@ -77,15 +83,6 @@ export default {
data() {
return {
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: [
{ type: 'compose', id: '', name: '编辑' },
{ type: 'ios-copy', id: '', name: '复制', componentName: 'CopyModal' },
......@@ -173,6 +170,12 @@ export default {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '判定':
this._judge()
break
case '填写检测值':
this._detectionValue()
break
case '完成':
this._testEnd()
break
......@@ -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) {
this.currentComponent = componentName
this.$nextTick(function() {
......@@ -259,6 +277,7 @@ export default {
this.$refs.pageTable._pageChange(1)
},
_page: async function() {
this.selectIds = []
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await meterItem.pageTest(this.formObj)
......@@ -400,6 +419,7 @@ export default {
// 操作日志
this.$refs.recordModal._open(id)
},
// 单个填写检测值
_handleTestValueEdit: async function(id, 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