Commit 21b0247f by lichengming

修改了数据录入项目原始记录

parent 15559253
...@@ -160,5 +160,7 @@ export default { ...@@ -160,5 +160,7 @@ export default {
http.post('soil/v1/prepare_record/page', data).then(res => res), http.post('soil/v1/prepare_record/page', data).then(res => res),
// 备样操作日志分页列表 // 备样操作日志分页列表
backupRecordPage: data => backupRecordPage: data =>
http.post('soil/v1/sample_backup_record/page', data).then(res => res) http.post('soil/v1/sample_backup_record/page', data).then(res => res),
experimentRecordPage: data =>
http.post('soil/v1/experiment_record/page', data).then(res => res)
} }
<template>
<div>
<Modal v-model="showModal" v-drag width="900" class="modal-footer-none zIndex-1100">
<p slot="header">操作日志</p>
<div>
<Row>
<!--查询-->
<Col span="24">
<Form id="search-contract-record" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="操作阶段:">
<Input v-model="formObj.origin" @on-enter="_search" name="origin" placeholder="请输入操作阶段"
style="width: 200px" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_search" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight"
:get-page="getPage" @on-result-change="_tableResultChange" hide-checkbox>
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined">
<template slot-scope="scope">
<span v-if="item.key==='type'">
{{scope.row[item.key] === 0 ? '流转' : scope.row[item.key] === 1 ? '退回': scope.row[item.key] === 2 ?'更新' :
scope.row[item.key] === 3 ? '转发':'文件'}}
</span>
<span v-else-if="item.key==='ctime'">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</Modal>
</div>
</template>
<script>
/**
* 操作日志-委托
*/
import { meterEntrust } from '../../api'
export default {
data() {
return {
showModal: false,
getPage: {},
pageColumns: [
{ title: '操作类型', key: 'type', width: 80 },
{ title: '操作阶段', key: 'origin', width: 120 },
{ title: '目标阶段', key: 'target', width: 120 },
{ title: '操作人', key: 'operator', width: 80 },
{ title: '操作时间', key: 'ctime', width: 150 },
{ title: '操作原因', key: 'remark' },
{ title: '责任人', key: 'liable', width: 80 }
],
formObj: {
entrustId: undefined,
origin: undefined,
sampleId: undefined
}
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tableModal')
}
},
methods: {
_open(experimentId) {
this.showModal = true
this.formObj.experimentId = experimentId
this.formObj.sampleId = undefined
this._page()
},
_openTask(sampleId) {
this.showModal = true
this.formObj.sampleId = sampleId
this.formObj.entrustId = undefined
this._pageTask()
},
_openSurplus(samplePrepareId) {
this.showModal = true
this.formObj.samplePrepareId = samplePrepareId
this._pageSurplus()
},
_openBcakup(sampleBackupId) {
this.showModal = true
this.formObj.sampleBackupId = sampleBackupId
this._pageBackup()
},
_page: async function() {
console.log('要传的参数')
console.log(this.formObj)
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await meterEntrust.experimentRecordPage(this.formObj)
console.log(result)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_pageSurplus: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await meterEntrust.prepareRecordPage(
this.$serializeForm(this.formObj)
)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_pageBackup: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await meterEntrust.backupRecordPage(
this.$serializeForm(this.formObj)
)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_pageTask: async function() {
console.log('要传的参数')
console.log(this.formObj)
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await meterEntrust.pageTask(this.formObj)
console.log(result)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodContractRecord.page
break
case 'changeSize':
this._page()
break
}
},
_search() {
if (this.formObj.entrustId !== undefined) {
this._page()
} else if (this.formObj.sampleBackupId !== undefined) {
this._pageBackup()
} else if (this.formObj.samplePrepareId !== undefined) {
this._pageSurplus()
} else {
this._pageTask()
}
}
}
}
</script>
...@@ -6,21 +6,21 @@ ...@@ -6,21 +6,21 @@
<Form id="task-assign-item-right" :label-width="70" inline onsubmit="return false"> <Form id="task-assign-item-right" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="试样编号:"> <Form-item class="search-item" label="试样编号:">
<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>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button type="primary" @click="_formSearch">搜索</Button> <Button @click="_formSearch" type="primary">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Col> </Col>
<!--操作--> <!--操作-->
<Col span="24"> <Col span="24">
<btn-list :msg="btn" class="contHide" @on-result-change="_btnClick"></btn-list> <btn-list :msg="btn" @on-result-change="_btnClick" class="contHide"></btn-list>
</Col> </Col>
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETable ref="pageTable" :page-columns="pageColumns" :table-height="tableHeight" <PTVXETable ref="pageTable" :page-columns="pageColumns" :table-height="tableHeight"
:get-page="getPage" :icon-msg="iconMsg" :table-name="tableName" is-task select-data @on-result-change="_tableResultChange"> :get-page="getPage" :icon-msg="iconMsg" :table-name="tableName" @on-result-change="_tableResultChange" is-task select-data>
<vxe-table-column <vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns" v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key" :key="item.key"
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
<SelEquip ref="selEquip" @on-result-change="_equipResult"></SelEquip> <SelEquip ref="selEquip" @on-result-change="_equipResult"></SelEquip>
<CreateReport ref="createModal" @on-result-change="_certificateSelectExcelBack"></CreateReport> <CreateReport ref="createModal" @on-result-change="_certificateSelectExcelBack"></CreateReport>
<Reason ref="reasonModal" @on-result-change="_reasonResult" /> <Reason ref="reasonModal" @on-result-change="_reasonResult" />
<Operation ref="Operation"></Operation>
</div> </div>
</template> </template>
<script> <script>
...@@ -71,6 +72,7 @@ import EquipManage from '../EquipManage' ...@@ -71,6 +72,7 @@ import EquipManage from '../EquipManage'
import CollectManage from '../CollectManage' import CollectManage from '../CollectManage'
import CollectFileManage from '../CollectFileManage' import CollectFileManage from '../CollectFileManage'
import Reason from '../../../../components/base/Reason' import Reason from '../../../../components/base/Reason'
import Operation from '../../../../components/operation/ItemOperation'
import CreateReport from './CreateReport' import CreateReport from './CreateReport'
export default { export default {
components: { components: {
...@@ -83,7 +85,8 @@ export default { ...@@ -83,7 +85,8 @@ export default {
CollectManage, CollectManage,
CollectFileManage, CollectFileManage,
Reason, Reason,
CreateReport CreateReport,
Operation
}, },
data() { data() {
return { return {
...@@ -137,7 +140,12 @@ export default { ...@@ -137,7 +140,12 @@ export default {
{ type: 'md-apps', id: '', name: '查看指标' }, { type: 'md-apps', id: '', name: '查看指标' },
{ type: 'ios-bookmarks', id: '', name: '查看采集数据' }, { type: 'ios-bookmarks', id: '', name: '查看采集数据' },
{ type: 'ios-browsers', id: '', name: '查看采集文件' }, { type: 'ios-browsers', id: '', name: '查看采集文件' },
{ type: 'ios-flask', id: '', name: '设备列表' } { type: 'ios-flask', id: '', name: '设备列表' },
{
type: 'ios-clock',
id: '',
name: '操作日志'
}
], ],
getPage: {}, getPage: {},
pageColumns: [ pageColumns: [
...@@ -214,9 +222,17 @@ export default { ...@@ -214,9 +222,17 @@ export default {
case '设备列表': case '设备列表':
this._equipManage(data) this._equipManage(data)
break break
case '操作日志':
this._operationRecord(data.id)
break
} }
}) })
}, },
_operationRecord(id) {
this.$refs.Operation._open(id)
// 操作日志
// this.$refs.operation._open(id)
},
_reportView(data) { _reportView(data) {
if (data.recorded === '是') { if (data.recorded === '是') {
if (data.objectKey) { if (data.objectKey) {
......
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