Commit 9226d4e2 by lichengming

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

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