Commit f43c1f81 by lichengming

修改了样品处理

parent 0f83ee75
......@@ -29,5 +29,18 @@ export default {
pageBackupHandleCheck: data =>
http
.post('soil/v1/sample_backup/page_backup_handle_check', data)
.then(res => res),
// 样品处理审批通过
disposalOk: data =>
http.post('soil/v1/sample_backup/disposal_ok?ids=' + data).then(res => res),
// 样品处理审批驳回
disposalFail: data =>
http
.post(
'soil/v1/sample_backup/disposal_fail?ids=' +
data.ids +
'&reason=' +
data.remark
)
.then(res => res)
}
......@@ -106,16 +106,19 @@
</Row>
</div>
</div>
<Reason ref="reasonModal" @on-result-change="_reasonResult"></Reason>
</div>
</template>
<script>
import AutoCompletes from '../../../../components/base/AutoCompletes'
import Reason from '../../../../components/base/Reason'
// eslint-disable-next-line no-unused-vars
import http from '../../../../api/http'
import { soilSample } from '../../../../api'
export default {
components: {
AutoCompletes
AutoCompletes,
Reason
},
data() {
return {
......@@ -129,6 +132,16 @@ export default {
btn: [
{
type: 'primary',
id: '',
name: '完成处理'
},
{
type: '',
id: '',
name: '驳回'
},
{
type: 'primary',
id: 'food-sample-preparation-his-all',
name: '制备'
},
......@@ -350,6 +363,12 @@ export default {
},
_btnClick(msg) {
switch (msg) {
case '完成处理':
this._dispose()
break
case '驳回':
this._disposeBack()
break
case '制备':
this._preMethod()
break
......@@ -380,6 +399,54 @@ export default {
break
}
},
// 通过
_dispose() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定通过这 ' + this.selectIds.length + ' 条数据?',
onOk: () => {
this._disposeOk(this.selectIds.join(','))
}
})
}
},
_disposeBack() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条委托!')
} else {
this.$refs.reasonModal._open('退回原因')
}
},
_reasonResult(data) {
if (undefined !== data && data !== '') {
this._reportCheckBack(data)
}
},
_reportCheckBack: async function(data) {
const result = await soilSample.disposalFail({
ids: this.selectIds,
remark: data
})
if (result) {
this.$Message.success('退回成功!')
console.log('退回成功')
await this._page()
}
},
_disposeOk: async function(ids) {
const result = await soilSample.disposalOk(ids)
if (result) {
this._resultChange('提交成功')
}
},
_resultChange(msg) {
this.$Message.success(msg)
this._page()
},
// 制备
_preMethod() {
if (this.selectSampleIds.length === 0) {
......
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