Commit a476bb29 by lichengming

修改了委托单登记

parent d3ee366c
...@@ -39,5 +39,13 @@ export default { ...@@ -39,5 +39,13 @@ export default {
pageWaitEnd: data => pageWaitEnd: data =>
http http
.post('soil/v1/statistics/page_wait_end_entrust_statistics', data) .post('soil/v1/statistics/page_wait_end_entrust_statistics', data)
.then(res => res),
pagePersonalExpStatistics: data =>
http
.post('soil/v1/statistics/page_personal_exp_statistics', data)
.then(res => res),
pageGroupExpStatistics: data =>
http
.post('soil/v1/statistics/page_group_exp_statistics', data)
.then(res => res) .then(res => res)
} }
...@@ -478,7 +478,7 @@ export default { ...@@ -478,7 +478,7 @@ export default {
siteNo: '', siteNo: '',
experiments: '' experiments: ''
} }
this.getPage.records.unshift(data) this.getPage.records.push(data)
}, },
_getPackList: async function() { _getPackList: async function() {
const result = await soilEntrust.testType('样品包装类型') const result = await soilEntrust.testType('样品包装类型')
...@@ -721,7 +721,7 @@ export default { ...@@ -721,7 +721,7 @@ export default {
this.formObj = formObj this.formObj = formObj
this._showTime(formObj) this._showTime(formObj)
if (formObj.sampleList) { if (formObj.sampleList) {
this.getPage.records = formObj.sampleList this.getPage.records = formObj.sampleList.reverse()
} }
// for (let i = 0; i < formObj.sampleList.length; i++) { // for (let i = 0; i < formObj.sampleList.length; i++) {
// if (formObj.sampleList[i].lastTime !== undefined) { // if (formObj.sampleList[i].lastTime !== undefined) {
......
...@@ -14,6 +14,12 @@ ...@@ -14,6 +14,12 @@
<Form-item label="试验名称:" class="search-item"> <Form-item label="试验名称:" class="search-item">
<Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入试验名称" clearable /> <Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入试验名称" clearable />
</Form-item> </Form-item>
<Form-item label="大类:" class="search-item">
<Input v-model="formObj.mainType" @on-enter="_formSearch" placeholder="请输入大类" clearable />
</Form-item>
<Form-item label="小类:" class="search-item">
<Input v-model="formObj.smallType" @on-enter="_formSearch" placeholder="请输入小类" clearable />
</Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary"> <Button @click="_formSearch" type="primary">
搜索 搜索
...@@ -159,7 +165,9 @@ export default { ...@@ -159,7 +165,9 @@ export default {
formObj: { formObj: {
name: undefined, name: undefined,
sampleId: undefined, sampleId: undefined,
code: undefined code: undefined,
mainType: undefined,
smallType: undefined
} }
} }
}, },
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<Option v-for="(item,index) in itemData" :value="item.value" :key="index">{{item.name}}</Option> <Option v-for="(item,index) in itemData" :value="item.value" :key="index">{{item.name}}</Option>
</Select> </Select>
</Form-item> </Form-item>
<Form-item label="试验项目:" class="search-item"> <Form-item label="筛选试样:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.experimentNames" name="experimentNames" placeholder="请输入试验项目" clearable></Input> <Input @on-enter="_formSearch" v-model="formObj.experimentNames" name="experimentNames" placeholder="请输入试验项目" clearable></Input>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
......
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
</Select> </Select>
</Form-item> </Form-item>
<Form-item label="日期:"> <Form-item label="日期:">
<DatePicker v-model="formObj.date" :editable="false" @on-change="_dateChange" type="year" <DatePicker v-model="formObj.date" :editable="false" type="year"
style="width:90px"></DatePicker> style="width:90px"></DatePicker>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_search" type="primary">搜索</Button> <Button @click="_page" type="primary">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Col> </Col>
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
</div> </div>
</template> </template>
<script> <script>
import { soilStatistics } from '../../api'
import GroupItemBar from './GroupItemBar' import GroupItemBar from './GroupItemBar'
export default { export default {
...@@ -47,25 +48,24 @@ export default { ...@@ -47,25 +48,24 @@ export default {
} }
}, },
mounted() { mounted() {
// this._getEquipList() this._page()
}, },
methods: { methods: {
// 检测科室 // 检测科室
_getEquipList() { _page: async function() {
this.$store.dispatch('LmsUserGroup/list').then(() => { const result = await soilStatistics.pageGroupExpStatistics()
this.groupData = this.$store.state.LmsUserGroup.list if (result) {
this.formObj.groupId = this.groupData[0].id console.log('bar', result)
this.formObj.groupName = this.groupData[0].name const obj = {
this.$nextTick(function() { mounth: [],
this.$refs.barModal._openBar(this.formObj) num: []
}) }
}) for (let i = 0; i < result.records.length; i++) {
}, obj.num.push(result.records[i].testCount)
_dateChange(data) { obj.mounth.push(result.records[i].testMonth)
this.$refs.barModal._openBar(this.formObj) }
}, this.$refs.barModal._openBar(obj)
_search() { }
this.$refs.barModal._openBar(this.formObj)
} }
} }
} }
......
...@@ -29,9 +29,6 @@ export default { ...@@ -29,9 +29,6 @@ export default {
containLabel: true, containLabel: true,
x: 130 x: 130
}, },
legend: {
data: ['检测量']
},
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
...@@ -67,7 +64,7 @@ export default { ...@@ -67,7 +64,7 @@ export default {
{ {
name: '检测量', name: '检测量',
type: 'bar', type: 'bar',
data: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120] data: []
} }
] ]
}, },
...@@ -76,33 +73,37 @@ export default { ...@@ -76,33 +73,37 @@ export default {
} }
}, },
methods: { methods: {
_openBar(obj) { _openBar: function(obj) {
this.year = obj.date.getFullYear() this.option.series[0].data = []
this.groupId = obj.groupId
this.option.xAxis[0].data = [] this.option.xAxis[0].data = []
for (let i = 1; i < 13; i++) { this.option.xAxis[0].data = obj.mounth
if (i < 10) { this.option.series[0].data = obj.num
this.option.xAxis[0].data.push(this.year + '-0' + i) // this.year = obj.date.getFullYear()
} else { // this.groupId = obj.groupId
this.option.xAxis[0].data.push(this.year + '-' + i) // this.option.xAxis[0].data = []
} // for (let i = 1; i < 13; i++) {
} // if (i < 10) {
this.$store // this.option.xAxis[0].data.push(this.year + '-0' + i)
.dispatch('FoodContract/groupYearNum', { // } else {
year: this.year, // this.option.xAxis[0].data.push(this.year + '-' + i)
groupId: this.groupId // }
}) // }
.then(() => { // this.$store
const result = this.$store.state.FoodContract.page // .dispatch('FoodContract/groupYearNum', {
this.option.series[0].data = [] // year: this.year,
for (let j = 0; j < result.length; j++) { // groupId: this.groupId
for (let k = 0; k < this.option.xAxis[0].data.length; k++) { // })
if (result[j].testMonth === this.option.xAxis[0].data[k]) { // .then(() => {
this.option.series[0].data[k] = result[j].testCount // const result = this.$store.state.FoodContract.page
} // this.option.series[0].data = []
} // for (let j = 0; j < result.length; j++) {
} // for (let k = 0; k < this.option.xAxis[0].data.length; k++) {
}) // if (result[j].testMonth === this.option.xAxis[0].data[k]) {
// this.option.series[0].data[k] = result[j].testCount
// }
// }
// }
// })
} }
} }
} }
......
...@@ -2,89 +2,70 @@ ...@@ -2,89 +2,70 @@
<div> <div>
<Card style="width:100%"> <Card style="width:100%">
<div class="config_meta"> <div class="config_meta">
<p class="fl">待检检测项目 {{total}} </p> <p class="fl">个人试验项目查询 {{total}} </p>
<div class="fr"> <div class="fr">
<Tooltip content="刷新" placement="left-start"> <Tooltip content="刷新" placement="left-start">
<Icon @click="_request" type="ios-refresh" size="30" color="#2d8cf0" style="cursor:pointer;"></Icon> <Icon @click="_page" type="ios-refresh" size="30" color="#2d8cf0" style="cursor:pointer;"></Icon>
</Tooltip>
<Tooltip content="查看更多" placement="left-start" style="margin-left: 5px">
<Icon @click="_detail" type="ios-more" size="30" color="#2d8cf0" style="cursor:pointer;"></Icon>
</Tooltip> </Tooltip>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div style="width: 100%;"> <div style="width: 100%;">
<element-table ref="pageTable" :pageColumns="pageColumns" <PTVXETableHeight ref="pageTable" :page-columns="pageColumns"
:tableHeight="tableHeight" :getPage="tableData" hide-checkbox> :get-page="getPage" :table-height="tableHeight">
<el-table-column <vxe-table-column
:prop="item.key"
:label="item.title"
:min-width="item.width"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
show-overflow-tooltip sortable> :field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="item.status">{{scope.row.progress.display}}</span> <span>{{scope.row[item.key]}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template> </template>
</el-table-column> </vxe-table-column>
</element-table> </PTVXETableHeight>
</div> </div>
</Card> </Card>
<!--未完成检测项目列表-->
<!-- <FoodUnfinishedItem ref="unfinishedDetail"></FoodUnfinishedItem>-->
</div> </div>
</template> </template>
<script> <script>
import { soilStatistics } from '../../api'
export default { export default {
components: {}, components: {},
data() { data() {
return { return {
tableData: { records: [] }, tableData: { records: [] },
formObj: {},
getPage: {},
pageColumns: [ pageColumns: [
{ title: '状态', key: 'progress', width: 110, status: true }, { title: '委托编号', key: 'entrustCode', width: 150 },
{ title: '检测项目名称', key: 'name', width: 150 }, { title: '试验名称', key: 'name', width: 140 },
{ title: '检测依据', key: 'testBasis', width: 140 }, { title: '试样编号', key: 'sampleCode', width: 140 },
{ title: '样品编号', key: 'num', width: 180 }, { title: '试验项目英文简写', key: 'shortName', width: 180 },
{ title: '样品名称', key: 'sampleName', width: 120 }, { title: '检测依据', key: 'testBasis', width: 100 }
{ title: '所属科室', key: 'groupName', width: 100 }
], ],
tableHeight: '280', tableHeight: '280',
total: '' total: ''
} }
}, },
mounted() { mounted() {
// this._request() this._page()
}, },
methods: { methods: {
_detail() { _page: async function() {
this.$refs.unfinishedDetail._open() Object.assign(this.formObj, this.$refs.pageTable._searchParams())
}, const result = await soilStatistics.pagePersonalExpStatistics(
_request() { this.formObj
this.$refs.pageTable._hideLoading() )
this.$store if (result) {
.dispatch('StatisticContract/pageItem', { page: 1, rows: 7 }) this.$refs.pageTable._hideLoading()
.then(() => { this.getPage = result
const tableData = this.$store.state.StatisticContract.page.records }
const total = this.$store.state.StatisticContract.page.total // const result = await
// this.$refs.pageTable._page('search-form', 'SysFileTemplate/page')
if (total === 0) {
this.total = ''
} else {
this.total = '(共 ' + total + ' 条)'
}
let num = 0
if (tableData.length < 7) {
num = tableData.length
} else {
num = 7
}
for (let i = 0; i < num; i++) {
this.tableData.records.push(tableData[i])
}
})
} }
} }
} }
......
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