Commit ca8fca21 by lichengming

修改了根据id调接口

parent e2e84a95
......@@ -114,10 +114,12 @@ export default {
.get('soil/v1/sample_photo/view?objectKey=' + data.objectKey)
.then(res => res),
// 试样制备表
// preparePage: data =>
// http
// .post('soil/v1/sample/obtain_prepare_data?ids=' + data)
// .then(res => res),
preparePage: data =>
http
.post('soil/v1/sample/obtain_prepare_data?ids=' + data)
.then(res => res),
http.post('soil/v1/sample/obtain_prepare_data', data).then(res => res),
// 试样制备完成
savePrepare: data =>
......
......@@ -27,7 +27,7 @@ export default {
http.put('soil/v1/receive_location/' + data.id, data.obj).then(res => res),
// 试验室领样操作
takeSample: data =>
http.post('soil/v1/sample/take_sample?ids=' + data).then(res => res),
http.post('soil/v1/sample/take_sample', data).then(res => res),
// 备样历史分页列表
pageBackupHis: data =>
http.post('soil/v1/sample_backup/page_backup_his', data).then(res => res),
......@@ -182,17 +182,19 @@ export default {
http.delete('soil/v1/sample/?ids=' + data).then(res => res),
// 制备审核通过
prepareCheckOk: data =>
http.post('soil/v1/sample/prepare_check_ok?ids=' + data).then(res => res),
http.post('soil/v1/sample/prepare_check_ok', data).then(res => res),
// 制备审核驳回
// prepareCheckBack: data =>
// http
// .post(
// 'soil/v1/sample/prepare_check_back?ids=' +
// data.ids +
// '&remark=' +
// data.remark
// )
// .then(res => res),
prepareCheckBack: data =>
http
.post(
'soil/v1/sample/prepare_check_back?ids=' +
data.ids +
'&remark=' +
data.remark
)
.then(res => res),
http.post('soil/v1/sample/prepare_check_back', data).then(res => res),
sampleBringOut: data =>
http.post('soil/v1/sample/sample_bring_out?ids=' + data).then(res => res),
boxPage: data => http.post('soil/v1/box/page', data).then(res => res),
......@@ -201,14 +203,18 @@ export default {
editBox: data =>
http.put('soil/v1/box/' + data.id, data.obj).then(res => res),
getByIdBox: data => http.get('soil/v1/box/' + data).then(res => res),
// saveExcelOriginalRecord: data =>
// http
// .post(
// 'soil/v1/experiment/save_excel_original_record?ids=' +
// data.ids +
// '&templateId=' +
// data.id
// )
// .then(res => res),
saveExcelOriginalRecord: data =>
http
.post(
'soil/v1/experiment/save_excel_original_record?ids=' +
data.ids +
'&templateId=' +
data.id
)
.post('soil/v1/experiment/save_excel_original_record', data)
.then(res => res),
saveExcelExpReport: data =>
http
......
......@@ -95,10 +95,12 @@ export default {
itemGetById: data => http.get('soil/v1/item/' + data).then(res => res),
endExp: data =>
http.post('soil/v1/experiment/end_exp?ids=' + data).then(res => res),
endExpIds: data =>
http.post('soil/v1/experiment/end_exp', data).then(res => res),
pageExpCheck: data =>
http.post('soil/v1/entrust/page_exp_check', data).then(res => res),
endExpCheck: data =>
http.post('soil/v1/experiment/end_exp_check?ids=' + data).then(res => res),
http.post('soil/v1/experiment/end_exp_check', data).then(res => res),
endExpAudit: data =>
http.post('soil/v1/experiment/end_exp_audit?ids=' + data).then(res => res),
pageCheckByExp: data =>
......@@ -121,14 +123,7 @@ export default {
)
.then(res => res),
checkBack: data =>
http
.post(
'soil/v1/experiment/exp_check_back?ids=' +
data.ids +
'&remark=' +
data.remark
)
.then(res => res),
http.post('soil/v1/experiment/exp_check_back', data).then(res => res),
// 添加设备信息
addExpEquip: data =>
https
......
......@@ -264,7 +264,7 @@ export default {
},
_reportCheckBack: async function(data) {
const result = await soilSample.prepareCheckBack({
ids: this.selectIds,
ids: this.selectIds.join(','),
remark: data
})
......@@ -289,7 +289,9 @@ export default {
}
},
_passPrepare: async function() {
const result = await soilSample.prepareCheckOk(this.selectIds.join(','))
const result = await soilSample.prepareCheckOk({
ids: this.selectIds.join(',')
})
if (result) {
this.$Message.success('审核通过')
this._page()
......
......@@ -315,7 +315,6 @@ export default {
_open(sampleIds) {
this.$refs.pageTable._showLoading()
this.sampleIds = sampleIds
console.log(this.sampleIds)
this.showModal = true
this.getPage.records = []
this.unitData = []
......@@ -329,13 +328,10 @@ export default {
// this._dicSearch()
},
_page: async function() {
const result = await soilEntrust.preparePage(this.sampleIds)
const result = await soilEntrust.preparePage({ ids: this.sampleIds })
if (result) {
console.log(result)
this.getPage.records = result
for (let j = 0; j < result.length; j++) {
console.log(result[j].prepareDate)
console.log(new Date(result[j].prepareDate))
this.getPage.records[j].prepareDate = new Date(result[j].prepareDate)
this.getPage.records[j].printNum = 1
}
......@@ -360,28 +356,32 @@ export default {
this._hideLoading()
},
_ok() {
console.log(this.getPage.records)
this.$refs.pageTable._showLoading()
const prepareList = []
for (let i = 0; i < this.getPage.records.length; i++) {
prepareList.push(this.getPage.records[i])
}
if (prepareList.length === 0) {
this.$Message.warning('制备数据不能为空')
this.$refs.pageTable._hideLoading()
this._hideLoading()
return false
}
this.save({ prepareList: prepareList })
},
save: async function(data) {
this.$refs.pageTable._showLoading()
const result = await soilEntrust.savePrepare(data)
console.log(result)
this._resultChange('制备成功')
if (result) {
this._resultChange('制备成功')
}
},
_resultChange(msg) {
this.showModal = false
this.$Message.success(msg)
this.$emit('on-result-change')
this._hideLoading()
this.$refs.pageTable._hideLoading()
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
......
<template>
<div>
<Modal v-model="showSampleModal" v-drag width="1100"
class="zIndex-900 modal-footer-none" @on-visible-change="_visibleChange">
<Modal v-model="showSampleModal" v-drag @on-visible-change="_visibleChange"
width="1100" class="zIndex-900 modal-footer-none">
<p slot="header">
管理样品
</p>
......@@ -10,19 +10,19 @@
<Row>
<!--查询-->
<Col span="24" style="padding-bottom: 5px">
<Form v-show="searchOpen" id="search-wait" :label-width="90" inline onsubmit="return false">
<Form id="search-wait" v-show="searchOpen" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="试样编号:" class="search-item">
<Input v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入样品编号" clearable @on-enter="_formSearch"></Input>
<Input v-model="formObj.sampleCode" @on-enter="_formSearch" name="sampleCode" placeholder="请输入样品编号" clearable></Input>
<input name="contractId" type="hidden">
</Form-item>
<Form-item class="search-btn">
<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 :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick" class="contHide">
<!--<template slot="processTask">-->
<!--<div class="fr process-task">-->
<!--<Button @click="_exportReceiveRecord">导出交接记录</Button>-->
......@@ -36,8 +36,8 @@
:table-height="tableHeight"
:get-page="getPage"
:icon-msg="iconMsg"
select-data
@on-result-change="_tableResultChange">
@on-result-change="_tableResultChange"
select-data>
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
......@@ -303,7 +303,7 @@ export default {
}
},
_confirmTake: async function(ids) {
const result = await soilSample.takeSample(ids)
const result = await soilSample.takeSample({ ids: ids })
if (result) {
this._resultChange('领样成功')
}
......
......@@ -109,14 +109,7 @@ export default {
],
btn: [
{ type: 'success', id: '', name: '提交' },
{ type: 'warning', id: '', name: '退回' },
{ type: '', id: 'food-task-assign-adjust-group', name: '调整分组' },
{
type: '',
id: 'food-task-assign-plan-date',
name: '设置计划完成时间'
},
{ type: '', id: 'food-task-assign-maintain-info', name: '信息维护' }
{ type: 'warning', id: '', name: '退回' }
],
iconMsg: [
{ type: 'ios-book', id: '', name: '查看原始记录' },
......@@ -171,7 +164,7 @@ export default {
},
_reportCheckBack: async function(data) {
const result = await soilTest.checkBack({
ids: this.selectIds,
ids: this.selectIds.join(','),
remark: data
})
......@@ -415,7 +408,9 @@ export default {
}
},
_submitToAuditOk: async function() {
const result = await soilTest.endExpCheck(this.selectIds.join(','))
const result = await soilTest.endExpCheck({
ids: this.selectIds.join(',')
})
if (result) {
this._resultChange('提交成功')
}
......
......@@ -93,14 +93,7 @@ export default {
],
btn: [
{ type: 'success', id: '', name: '提交' },
{ type: 'warning', id: '', name: '退回' },
{ type: '', id: 'food-task-assign-adjust-group', name: '调整分组' },
{
type: '',
id: 'food-task-assign-plan-date',
name: '设置计划完成时间'
},
{ type: '', id: 'food-task-assign-maintain-info', name: '信息维护' }
{ type: 'warning', id: '', name: '退回' }
],
getPage: {},
iconMsg: [
......@@ -204,7 +197,7 @@ export default {
},
_reportCheckBack: async function(data) {
const result = await soilTest.checkBack({
ids: this.selectIds,
ids: this.selectIds.join(','),
remark: data
})
......@@ -332,7 +325,9 @@ export default {
}
},
_submitToAuditOk: async function() {
const result = await soilTest.endExpCheck(this.selectIds.join(','))
const result = await soilTest.endExpCheck({
ids: this.selectIds.join(',')
})
if (result) {
this._resultChange('提交成功')
}
......
......@@ -251,11 +251,10 @@ export default {
this.$refs.createModal._open()
},
_makeCodeExcel: async function(data) {
console.log(this.selectIds)
this.$refs.pageTable._hideLoading()
this.$refs.pageTable._showLoading()
const result = await soilSample.saveExcelOriginalRecord({
ids: this.selectIds,
id: data.id
ids: this.selectIds.join(','),
templateId: data.id
})
if (result) {
await this._page()
......@@ -270,6 +269,7 @@ export default {
}
},
_viewReport(data) {
this.$refs.pageTable._hideLoading()
if (data) {
this.$openWindowModeless({
objectKey: data.objectKey,
......@@ -327,7 +327,6 @@ export default {
this.$refs.pageTable._loadColumn(colList)
},
_equipResult: async function(res) {
console.log(res)
const tempData = {}
tempData.equipList = []
res.map((item, index) => {
......@@ -526,7 +525,7 @@ export default {
})
},
_submitOk: async function() {
const result = await soilTest.endExp(this.selectIds.join(','))
const result = await soilTest.endExpIds({ ids: this.selectIds.join(',') })
if (result) {
this._resultChange('提交成功')
}
......
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