Commit 9226d4e2 by lichengming

修改了试验项目编辑原始记录

parent 4d3b7751
......@@ -49,5 +49,9 @@ export default {
recordPage: data =>
http.post('soil/v1/original_record/page', data).then(res => res),
pageTest: data =>
http.post('soil/v1/experiment/page_test', data).then(res => res)
http.post('soil/v1/experiment/page_test', data).then(res => res),
updateItem: data =>
http
.post('soil/v1/original_record/update_original_record', data)
.then(res => res)
}
......@@ -27,6 +27,9 @@ module.exports = {
{
src:
'http://static.patzn.com/thirdparty/ztree/zTree_v3-3.5.29/js/jquery.ztree.all.min.js'
},
{
src: 'http://static.patzn.com/thirdparty/layx/layx-2.5.3.min.js'
}
],
link: [
......@@ -52,7 +55,11 @@ module.exports = {
rel: 'stylesheet',
href: 'http://static.patzn.com/theme/my-theme/main.css'
},
{ rel: 'stylesheet', href: '', name: 'theme' }
{ rel: 'stylesheet', href: '', name: 'theme' },
{
rel: 'stylesheet',
href: 'http://static.patzn.com/thirdparty/layx/layx-2.5.3.min.css'
}
]
},
......
......@@ -8,6 +8,7 @@
</template>
<script>
import Global from '../../../api/config'
import { soilTest } from '../../../api'
/**
* 编辑原始记录详情
......@@ -74,6 +75,7 @@ export default {
this.$layx(this.formIdTemp, '编辑原始记录', url)
},
_saveOriginal(data) {
console.log('修改的数据', data)
if (this.again) {
if (data.data.msg === true) {
this._editSaveRecord(data)
......@@ -89,6 +91,15 @@ export default {
// eslint-disable-next-line no-undef
layx.destroyAll(this.formIdTemp)
},
_updateRecord: async function(param) {
const result = await soilTest.updateItem(param)
console.log(result)
if (result) {
this.$Message.success('保存成功')
this._cancel()
this.$emit('on-result-change')
}
},
// 保存后解析项目的检测值
_editSaveRecord(data) {
const param = {
......@@ -113,14 +124,15 @@ export default {
param.copyMap = JSON.stringify(copyMapTemp)
})
}
this.$store.dispatch('EnvItem/updateFormForItem', param).then(() => {
if (this.$store.state.EnvItem.success) {
this.$Message.success('保存成功')
// this.showModal = false;
this.$emit('on-result-change')
this._cancel()
}
})
this._updateRecord(param)
// this.$store.dispatch('EnvItem/updateFormForItem', param).then(() => {
// if (this.$store.state.EnvItem.success) {
// this.$Message.success('保存成功')
// // this.showModal = false;
// this.$emit('on-result-change')
// this._cancel()
// }
// })
}
}
}
......
......@@ -88,14 +88,12 @@ export default {
{
type: 'md-create',
id: '',
name: '编辑',
componentName: 'ItemOriginalRecordEdit'
name: '编辑'
},
{
type: 'ios-book',
id: '',
name: '查看原始记录',
componentName: 'OriginalItemView'
name: '查看原始记录'
}
// {
// type: 'erlenmeyer-flask',
......@@ -246,10 +244,13 @@ export default {
this.$nextTick(() => {
switch (res) {
case '编辑':
this.$refs.refModal._openWithType(data.id, 'ENVTESTMAKEEDIT')
this.$refs.recordEditModal._openWithType(
data.originalRecordId,
'ENVTESTMAKEEDIT'
)
break
case '查看原始记录':
this._recordView(data.id)
this._recordView(data.originalRecordId)
break
case '查看检测项目':
this.$refs.refModal._open(data)
......@@ -304,9 +305,9 @@ export default {
case 'selectIds':
this.selectIds = data
break
// case 'iconClick':
// this._iconClick(data.name, data.rowData, data.componentName);
// break;
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'changeSize':
this._page()
break
......
......@@ -483,10 +483,15 @@ Vue.prototype.$resetFields = function(formObj) {
}
return formObj
}
Vue.prototype.$layx = function(id, title, url, option) {
// eslint-disable-next-line no-undef
layx.iframe(id, title, url, option || { width: '100%', height: '100%' })
}
/**
*搜索条件清空缓存处理方式(form表单 查询)
*
*/
Vue.prototype.$serializeForm = function(formObj) {
const newFormObj = {}
for (const key in formObj) {
......
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