Commit 25606830 by lichengming

添加数据复核页面

parent fc044299
<template>
<div>
<Modal v-model="showSampleModal" @on-visible-change="_visibleChange" width="1200"
class="zIndex-900 modal-footer-none">
<p slot="header"> {{name}}--管理样品</p>
<div>
<el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="按项目复核" name="waitReceive">
<WaitReceive ref="waitReceiveModal"></WaitReceive>
</el-tab-pane>
<el-tab-pane label="按样品复核" name="waitScan">
<WaitScan ref="waitScanModal"></WaitScan>
</el-tab-pane>
<!-- <el-tab-pane label="查看原始记录" name="viewRecord">-->
<!-- <OriginalRecordView ref="recordModal"></OriginalRecordView>-->
<!-- </el-tab-pane>-->
</el-tabs>
<!-- <keep-alive>-->
<!-- &lt;!&ndash; eslint-disable-next-line vue/require-component-is &ndash;&gt;-->
<!-- <component ref="refModal" :is="currentComponent"></component>-->
<!-- </keep-alive>-->
</div>
</Modal>
</div>
</template>
<script>
import WaitReceive from './item-tabs/ItemTabs'
import WaitScan from './sample-tabs/SampleTabs'
// import OriginalRecordView from './OriginalRecordView'
export default {
components: {
WaitReceive,
WaitScan
// OriginalRecordView
},
data() {
return {
type: '',
contractId: '', // 合同id
entrustId: '',
showSampleModal: false,
modalTitle: '',
selectIds: [],
activeName: 'waitReceive',
name: '',
currentComponent: ''
}
},
mounted() {
// this.currentComponent = 'waitScan'
},
methods: {
_open(contractId, type, name) {
this.type = type // 类型(采样或送样)
this.name = name
this.showSampleModal = true
this.entrustId = contractId // 合同id
this.activeName = 'waitReceive'
// this.currentComponent = 'waitScan'
this.selectIds = []
this._waitPage()
},
// 待接收
_waitPage() {
this.$refs.waitReceiveModal._open(this.entrustId)
},
// 待发放
_waitSend() {
this.$refs.waitScanModal._open(this.entrustId)
},
// 已接收
_issuedPage() {
this.$refs.alreadyIssuedModal._open(this.contractId, this.type)
},
_changeTabs(tab, event) {
if (tab.name === 'viewRecord') {
// this._issuedPage()
this.$refs.recordModal._open(this.entrustId)
} else if (tab.name === 'waitReceive') {
// this._waitPage()
this.$refs.waitScanModal._clearTable()
this.$refs.waitReceiveModal._open(this.entrustId)
} else if (tab.name === 'waitScan') {
this.$refs.waitReceiveModal._clearTable()
this.$refs.waitScanModal._open(this.entrustId)
// this._waitSend()
}
},
_search() {
this.$refs.waitReceiveModal._clearTable()
this.$refs.waitScanModal._clearTable()
this.$emit('on-result-change')
},
// 关闭弹框的时候刷新上个界面
_visibleChange(data) {
if (data === false) {
this._search()
}
}
}
}
</script>
<template>
<div>
<div class="layout-content-padding">
<div class="layout-content-main">
<el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="数据复核" name="check">
<SampleBackupsManage ref="checkTabs"></SampleBackupsManage>
</el-tab-pane>
<el-tab-pane label="历史任务" name="checkHis">
<SampleBackupsQuery ref="checkHisTabs"></SampleBackupsQuery>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
import SampleBackupsManage from './DataCheck'
import SampleBackupsQuery from './DataCheckHis'
export default {
components: {
SampleBackupsManage,
SampleBackupsQuery
},
data() {
return {
activeName: 'check'
}
},
mounted() {
this.activeName = 'check'
this.$refs.checkTabs._page()
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'check') {
this.$refs.checkTabs._page()
} else if (tab.name === 'applyRecord') {
// this.$refs.applyRecordTabs._page()
} else {
this.$refs.checkHisTabs._page()
}
}
}
}
</script>
<template>
<div>
<Modal v-model="showModal" width="100" class="modal-footer-none full-screen">
<div slot="header">{{modalTitle}}</div>
<div>
<Form id="index-right-form" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="指标名称:">
<Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入类别" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
<btn-list :msg="btn" @on-result-change="_btnClick" class="contHide" style="margin-bottom: 10px;"/>
<PTVXETable ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :iconMsg="iconMsg">
<vxe-table-column
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns" :key="item.key">
<template slot-scope="scope">
<span v-if="item.key==='defaulted'">{{scope.row[item.key]?'是':'否'}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</div>
</Modal>
<IndexManageEdit ref="indexEdit" @on-result-change="_page"></IndexManageEdit>
</div>
</template>
<script>
import { soilAptitude, soilTest } from '../../../api'
import IndexManageEdit from './IndexManageEdit'
export default {
components: { IndexManageEdit },
data() {
return {
id: '',
modalTitle: '',
showModal: false,
btn: [
{ type: 'success', id: '', name: '添加指标' },
{ type: 'error', id: '', name: '删除' }
],
tableHeight: document.documentElement.clientHeight - 180,
pageColumns: [
{ title: '试验指标名称', key: 'name' },
{ title: '试验指标大类', key: 'mainType', width: 120 },
{ title: '试验指标小类', key: 'smallType', width: 120 },
{ title: '状态', key: 'status', width: 120 },
{ title: '检测值', key: 'testValue', width: 120 },
{ title: '单位', key: 'unit', width: 120 }
],
getPage: {},
iconMsg: [{ type: 'md-create', id: '', name: '编辑' }],
selectIds: [],
formObj: {
name: ''
},
// 资质信息
aptitudeItemInfo: {}
}
},
methods: {
_open(data) {
console.log(data)
this.aptitudeItemInfo = data
this.formObj = this.$resetFields(this.formObj)
this.id = data.id
this.modalTitle = data.name + ' 指标管理'
this.showModal = true
this._page()
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.experimentId = this.id
const result = await soilTest.itemPage(this.$serializeForm(this.formObj))
if (result) {
console.log(result)
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
break
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
_iconClick(res, data) {
switch (res) {
case '编辑':
this._editModal(true, data)
break
}
},
_editModal(edit, data) {
if (edit) {
this._getById(data)
} else {
this.$refs.indexEdit._open(this.id, '')
}
},
_getById: async function(data) {
const result = await soilTest.itemGetById(data.id)
console.log(result)
if (result) {
this.$refs.indexEdit._open('', result)
}
},
_btnClick(msg) {
switch (msg) {
case '添加指标':
this._editModal(false)
break
case '删除':
this._deleteByIds()
break
}
},
_deleteByIds() {
if (this.selectIds.length === 0) {
// this.$msgTip('warning')
this.$message.warning('请至少选择一条记录')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定删除 ' + this.selectIds.length + ' 条记录?',
onOk: () => {
this._delOk(this.selectIds)
}
})
}
},
_delOk: async function(ids) {
const result = await soilAptitude.expItemDeleteByIds(ids)
if (result) {
this.$message.success('删除成功')
this._page()
}
}
}
}
</script>
<template>
<div>
<Row>
<!--查询-->
<Col span="24">
<Form id="task-assign-item-left" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="检测项目:">
<Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入检测项目" clearable></Input>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<btn-list @on-result-change="_btnClick" class="contHide" style="margin-bottom: 6px;"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :isRadio="true" :pageColumns="pageColumns" :table-name="tableName"
:tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :hide-checkbox="true" :rows="100" select-data>
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width"
:fixed="item.fixed?item.fixed:undefined"
sortable>
<template slot-scope="scope">
<a v-if="item.detail" @click.stop="_detailModal(scope.row)">{{scope.row[item.key]}}</a>
<span v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
<VXESettingCol slot="setting" :pageColumns="pageColumns" :userColumns="userColumns"
@on-result-change="_resetColumn" :table-name="tableName"></VXESettingCol>
</PTVXETable>
</Col>
</Row>
</div>
</template>
<script>
import { soilTest } from '../../../../api'
export default {
components: {},
data() {
return {
currentComponent: '',
formObj: {
name: undefined
},
tableName: 'food-task-assign-item-left',
// 用户自己选中的列
userColumns: [],
optionList: [
{ key: 'name', name: '检测项目', placeholder: '请输入检测项目' },
{ key: 'testBasis', name: '检测依据', placeholder: '请输入检测依据' }
],
getPage: {},
id: '',
pageColumns: [
{ title: '检测项目', key: 'name', width: 120 },
{ title: '检测方法', key: 'testMethod', width: 140 },
{ title: '检测依据名称', key: 'testBasisName', width: 200 }
]
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tabSearch')
}
},
methods: {
// 重置column
_resetColumn(colList) {
this.userColumns = colList
this.$refs.pageTable._loadColumn(colList)
},
_modalResult() {
if (this.currentComponent === 'AutoAssignModal') {
this._formSearch()
}
},
_selInputResult1(msg, data) {
switch (msg) {
case 'search':
this._formSearch()
break
}
},
_open(id) {
this.id = id
this._page()
},
_searchParams() {
const obj = {}
const obj1 = this.$refs.selInput1._getFormObj()
Object.assign(obj, obj1)
return obj
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.entrustId = this.id
const result = await soilTest.pageTestByExp(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_tableResultChange(msg, data) {
console.log(msg, data)
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodItem.page
break
case 'selectData':
this.$emit('on-result-change', data)
break
case 'singleSelect':
this.$emit('on-result-change', data)
break
case 'changeSize':
this._page()
break
case 'table-col':
// 用户选中的表格列
this.userColumns = data
break
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_btnClick(msg) {
switch (msg) {
case '自动分配':
this._autoAssign()
break
}
},
_autoAssign() {
console.log('自动分配')
// this.$refs.autoAssignModal._open()
// this.$store.dispatch('FoodItem/autoAllotNum').then(() => {
// const num = this.$store.state.FoodItem.count
// if (num !== undefined) {
// this.$refs.refModal._open(num)
// }
// })
}
}
}
</script>
<template>
<div>
<TwoColumnPage>
<template slot="left">
<ItemLeftList ref="leftModal" @on-result-change="_leftResult"></ItemLeftList>
</template>
<template slot="right">
<ItemRightList ref="rightModal" @on-result-change="_rightResult"></ItemRightList>
</template>
</TwoColumnPage>
</div>
</template>
<script>
import TwoColumnPage from '../../../../components/base/TwoColumnPage'
import ItemLeftList from './ItemLeftList'
import ItemRightList from './ItemRightList'
export default {
components: {
TwoColumnPage,
ItemLeftList,
ItemRightList
},
data() {
return {
id: ''
}
},
methods: {
_leftResult(data) {
console.log('ItemTabs', data)
this.$refs.rightModal._open(this.id, data)
},
_rightResult() {
this.$refs.leftModal._page()
},
_open(id) {
this.id = id
console.log(id)
this.$refs.leftModal._open(this.id)
// this.$refs.rightModal._getColumn()
},
_clearTable() {
this.$refs.rightModal._clearAll()
}
}
}
</script>
<template>
<div>
<Row>
<!--查询-->
<Col span="24">
<Form id="task-assign-sample-left" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="委托编号:">
<Input v-model="formObj.client" @on-enter="_formSearch" placeholder="请输入检测项目" clearable></Input>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<btn-list @on-result-change="_btnClick" class="contHide" style="margin-bottom: 6px;"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :pageColumns="pageColumns" :table-name="tableName"
:tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :rows="100">
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width"
:fixed="item.fixed?item.fixed:undefined"
sortable>
<template slot-scope="scope">
<a v-if="item.detail" @click.stop="_detailModal(scope.row)">{{scope.row[item.key]}}</a>
<span v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
<VXESettingCol slot="setting" :pageColumns="pageColumns" :userColumns="userColumns"
@on-result-change="_resetColumn" :table-name="tableName"></VXESettingCol>
</PTVXETable>
</Col>
</Row>
</div>
</template>
<script>
import { soilTest } from '../../../../api'
export default {
components: {},
data() {
return {
currentComponent: '',
formObj: {
entrustId: undefined
},
entrustId: '',
tableName: 'food-task-assign-item-left',
// 用户自己选中的列
userColumns: [],
selectIds: [],
optionList: [
{ key: 'name', name: '检测项目', placeholder: '请输入检测项目' },
{ key: 'testBasis', name: '检测依据', placeholder: '请输入检测依据' }
],
getPage: {},
pageColumns: [
{ title: '试样编号', key: 'sampleCode', width: 120 },
{ title: '委托编号', key: 'entrustCode', width: 140 },
{ title: '委托商', key: 'client', width: 200 }
]
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tabSearch')
}
},
methods: {
// 重置column
_resetColumn(colList) {
this.userColumns = colList
this.$refs.pageTable._loadColumn(colList)
},
_modalResult() {
if (this.currentComponent === 'AutoAssignModal') {
this._formSearch()
}
},
_selInputResult1(msg, data) {
switch (msg) {
case 'search':
this._formSearch()
break
}
},
_open(id) {
this.entrustId = id
this._page()
},
_searchParams() {
const obj = {}
const obj1 = this.$refs.selInput1._getFormObj()
Object.assign(obj, obj1)
return obj
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.entrustId = this.entrustId
const result = await soilTest.pageExpTestSample(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this._page()
break
// case 'selectData':
// this.$emit('on-result-change', data)
// break
case 'selectIds':
this.selectIds = data
this.$emit('on-result-change', this.selectIds.join(','))
break
case 'changeSize':
this._page()
break
case 'table-col':
// 用户选中的表格列
this.userColumns = data
break
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_btnClick(msg) {
switch (msg) {
case '自动分配':
this.currentComponent = 'AutoAssignModal'
this.$nextTick(function() {
this._autoAssign()
})
break
}
},
_autoAssign() {
this.$store.dispatch('FoodItem/autoAllotNum').then(() => {
const num = this.$store.state.FoodItem.count
if (num !== undefined) {
this.$refs.refModal._open(num)
}
})
}
}
}
</script>
<template>
<div>
<TwoColumnPage>
<template slot="left">
<ItemLeftList ref="SampleleftModal" @on-result-change="_leftResult"></ItemLeftList>
</template>
<template slot="right">
<ItemRightList ref="SamplerightModal" @on-result-change="_rightResult"></ItemRightList>
</template>
</TwoColumnPage>
</div>
</template>
<script>
import TwoColumnPage from '../../../../components/base/TwoColumnPage'
import ItemLeftList from './SampleLeftList'
import ItemRightList from './SampleRightList'
export default {
components: {
TwoColumnPage,
ItemLeftList,
ItemRightList
},
data() {
return {
id: ''
}
},
methods: {
_leftResult(data) {
this.$refs.SamplerightModal._open(this.id, data)
},
_rightResult() {
this.$refs.SampleleftModal._page()
},
_open(id) {
this.id = id
this.$refs.SampleleftModal._open(id)
// this.$refs.rightModal._getColumn()
},
_clearTable() {
this.$refs.SamplerightModal._clearAll()
}
}
}
</script>
......@@ -6,7 +6,7 @@
<Form id="task-assign-item-left" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="检测项目:">
<Input v-model="formObj.client" @on-enter="_formSearch" placeholder="请输入检测项目" clearable></Input>
<Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入检测项目" clearable></Input>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
......@@ -49,7 +49,9 @@ export default {
data() {
return {
currentComponent: '',
formObj: {},
formObj: {
name: undefined
},
tableName: 'food-task-assign-item-left',
// 用户自己选中的列
userColumns: [],
......
......@@ -6,7 +6,7 @@
<Form id="task-assign-item-right" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="检测项目:">
<Input v-model="formObj.client" @on-enter="_formSearch" placeholder="请输入检测项目" clearable></Input>
<Input @on-enter="_formSearch" name="name" placeholder="请输入检测项目" clearable></Input>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
......@@ -421,6 +421,8 @@ export default {
// saveName.push(this.leftSelectData[i].name)
// saveMethod.push(this.leftSelectData[i].testMethod)
// }
// const data = this.$serialize('task-assign-item-right')
// console.log(data)
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.entrustId = this.entrustId
this.formObj.name = this.leftSelectData.name
......
......@@ -15,6 +15,7 @@ import SampleTakeIndex from '../pages/soil-sample-manage/sample-take/SampleTakeI
import SurplusManage from '../pages/soil-sample-manage/surplus-manage/SampleSurplusIndex'
import TestTaskIndex from '../pages/soil-test-manage/test-task-manage/TestTaskIndex'
import TestInputIndex from '../pages/soil-test-manage/test-input/TestInputIndex'
import CheckIndex from '../pages/soil-test-manage/test-data-check/CheckIndex'
import Blank from '~/pages/blank'
export default [
{
......@@ -87,6 +88,11 @@ export default [
path: 'do_test',
component: TestInputIndex,
meta: { title: '试样检测' }
},
{
path: 'check',
component: CheckIndex,
meta: { title: '数据复核' }
}
]
},
......
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