Commit a11084b0 by lichengming

修改了试验委托登记编辑

parent c44e2d0e
......@@ -3,15 +3,29 @@
*/
import http from '../http'
// import { https } from '../https'
import { https } from '../https'
export default {
// page
page: data => http.post('soil/v1/entrust/page', data).then(res => res),
getVOById: data => http.get('soil/v1/entrust/' + data).then(res => res),
getById: data => http.get('soil/v1/entrust/' + data).then(res => res),
getVOById: data => http.get('soil/v1/entrust/vo/' + data).then(res => res),
deleteById: data =>
http.delete('soil/v1/entrust/?ids=' + data).then(res => res),
// 保存
save: data => http.post('soil/v1/entrust/', data).then(res => res),
edit: data => http.put('soil/v1/entrust/' + data.id, data.obj)
save: data =>
https
.post('soil/v1/entrust/add_entrust', JSON.stringify(data))
.then(res => res),
edit: data => http.put('soil/v1/entrust/' + data.id, data.obj),
editDTO: data =>
https
.post('soil/v1/entrust/edit_entrust', JSON.stringify(data))
.then(res => res),
submit: data =>
https.post('soil/v1/entrust/submit_to_review?ids=' + data).then(res => res),
submitSkipReview: data =>
https
.post('soil/v1/entrust/submit_to_skip_review?ids=' + data)
.then(res => res)
}
......@@ -38,7 +38,7 @@
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
<span v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<!-- <span v-else-if="item.status">{{scope.row[item.key].display}}</span>-->
<span v-else-if="item.status">{{scope.row[item.key].display}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
......@@ -53,7 +53,7 @@
</div>
</template>
<script>
import { soilAptitude, soilEntrust } from '../../../api'
import { soilEntrust } from '../../../api'
import http from '../../../api/http'
import Operation from '../../../components/operation/Operation'
import EntrustRegisterEdit from './EntrustRegisterEdit'
......@@ -69,18 +69,17 @@ export default {
type: 'success',
id: '',
name: '添加'
},
{
type: 'success',
id: '',
name: '提交至评审'
},
{
type: 'success',
id: '',
name: '提交'
}
// ,
// {
// type: 'success',
// id: '',
// name: '提交至评审'
// },
// {
// type: 'success',
// id: '',
// name: '提交'
// }
],
iconMsg: [
{
......@@ -234,14 +233,14 @@ export default {
}
},
_subToRe: async function(ids) {
const result = await soilAptitude.submit(ids)
const result = await soilEntrust.submit(ids)
if (result) {
this._resultChange('提交成功')
}
},
_subToSkipRe: async function(ids) {
const result = await soilAptitude.submitSkipReview(ids)
const result = await soilEntrust.submitSkipReview(ids)
if (result) {
this._resultChange('提交成功')
}
......@@ -261,6 +260,9 @@ export default {
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'page':
this._page()
break
case 'changeSize':
this._page()
break
......
......@@ -63,8 +63,8 @@
<!-- ></el-input>-->
<!-- <a @on-result-change="_judgeBasisChange" @click="_selectjudgeBasis(scope.$rowIndex)" style="font-size: 18px;" class="">+</a>-->
<!-- </div>-->
<div v-if="item.key==='sampleCode'" @click.stop="_handleRow(scope)">
<el-input v-model="scope.row.sampleCode" blur placeholder="请输入试样编号"
<div v-if="item.key==='siteNo'" @click.stop="_handleRow(scope)">
<el-input v-model="scope.row.siteNo" blur placeholder="请输入现场编号"
></el-input>
</div>
<div v-if="item.key==='sampleDepth'" @click.stop="_handleRow(scope)">
......@@ -79,6 +79,9 @@
<el-input v-model="scope.row.sampleDescribe" blur placeholder="请输入土质描述"
></el-input>
</div>
<div v-else @click.stop="_handleRow(scope)">
<span> {{ scope.row[item.key] }}</span>
</div>
</template>
</vxe-table-column>
</PTVXETable>
......@@ -162,6 +165,7 @@ export default {
],
pageColumns: [
{ title: '试样编号', key: 'sampleCode', width: 140 },
{ title: '现场编号', key: 'siteNo', width: 140 },
{ title: '试样深度', key: 'sampleDepth', width: 140 },
{ title: '样品包装类型', key: 'samplePack', width: 150 },
{ title: '土质描述', key: 'sampleDescribe' }
......@@ -472,7 +476,8 @@ export default {
sampleCode: '',
sampleDepth: '',
samplePack: '',
sampleDescribe: ''
sampleDescribe: '',
siteNo: ''
}
this.getPage.records.unshift(data)
},
......@@ -628,11 +633,13 @@ export default {
if (this.$string(this.id).isEmpty()) {
// 添加
// const saveData = this.formObj
// this._save(data)
data.sampleList = this.getPage.records
this._save(data)
} else {
// const saveData = this.formObj
console.log(data)
data.id = this.id
data.sampleList = this.getPage.records
this._edit(data)
}
} else {
......@@ -685,13 +692,16 @@ export default {
this.showBtn = false
this.showModal = true
this.$refs.formObj.resetFields()
this.getPage.records = []
this._hideLoading()
this.id = ''
this.modalTitle = '委托单编辑'
this.id = formObj.id
this.formObj = formObj
this._showTime(formObj)
// this.getPage.records = formObj.sampleList
if (formObj.sampleList) {
this.getPage.records = formObj.sampleList
}
// for (let i = 0; i < formObj.sampleList.length; i++) {
// if (formObj.sampleList[i].lastTime !== undefined) {
// this.getPage.records[i].lastTime = new Date(
......@@ -753,12 +763,7 @@ export default {
}
},
_edit: async function(data) {
const result = await soilEntrust.edit({
id: this.formObj.id,
obj: data
})
console.log('修改后')
console.log(result)
const result = await soilEntrust.editDTO(data)
if (result) {
this._resultChange('编辑成功!')
}
......
......@@ -61,17 +61,20 @@
<!--选择领样人-->
<UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo>
<SampleManage ref="sampleManageModal" @on-result-change="_page"></SampleManage>
<ItemManage ref="itemManageModal" @on-result-change="_page"></ItemManage>
</div>
</template>
<script>
import UserInfo from '../../../components/user-info-single/AssignPerson'
import { soilEntrust } from '../../../api'
import SampleManage from './entrust-sample-manage/SampleManage'
import ItemManage from './ItemManage'
export default {
components: {
UserInfo,
SampleManage
SampleManage,
ItemManage
},
data() {
return {
......@@ -350,7 +353,7 @@ export default {
this._editModal(data.id, data.type, data.cname)
break
case '项目管理':
this.$refs.refModal._open(data.id)
this.$refs.itemManageModal._open(data.id)
break
case '编辑协议':
this._editModals(res, data)
......
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