Commit 26d3da33 by lichengming

修改了样品进度查询

parent 8a900743
......@@ -6,8 +6,8 @@
<div>
<Form :label-width="100" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="委托编号:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.entrustCode" placeholder="请输入委托编号" clearable/>
<Form-item label="钻孔名称:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.boreholeName" placeholder="请输入钻孔名称" clearable/>
</Form-item>
<Form-item label="样品编号:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.sampleCode" placeholder="请输入样品编号" clearable/>
......
<template>
<div>
<Row style="border: 2px solid #EEEEEE">
<!--查询条件-->
<Col span="24">
<div>
<Form :label-width="100" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="钻孔名称:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.boreholeName" placeholder="请输入钻孔名称" clearable/>
</Form-item>
<Form-item label="样品编号:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.sampleCode" placeholder="请输入样品编号" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</div>
</Col>
<Col span="24">
<PTVXETableHeight ref="pageTable" :pageColumns="pageColumns" :table-name="tableName"
:tableHeight="300"
@on-result-change="_tableResultChange" :getPage="getPage" select-data>
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
:key="item.key"
sortable>
<template slot-scope="scope">
<div v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</div>
<div v-else-if="item.key==='testProgress'" style="position: relative">
<Progress :percent="scope.row.testProgressPer" :stroke-width="30" status="active" hide-info>
</Progress>
<div style="position: absolute;top: 0;bottom: 0;text-align: center;width: 100%;line-height: 30px">
{{scope.row[item.key]}}
</div>
</div>
<div v-else-if="item.status">
{{scope.row[item.key]?scope.row[item.key].display:''}}
</div>
<div v-else-if="item.type">{{$sampleType(scope.row[item.key])}}</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETableHeight>
</Col>
</Row>
</div>
</template>
<script>
import { soilStatistics } from '../../api'
export default {
components: {},
data() {
return {
tableName: 'food-test-progress-table',
// 用户自己选中的列
userColumns: [],
searchOpen: true,
formObj: {
cname: '',
num: '',
contractName: '',
code: '',
finished: '',
reportDateBegin: '',
reportDateEnd: '',
myGroupData: 0,
name: '',
groupIds: '',
salesmans: '',
type: ''
},
btn: [
{ type: 'primary', id: '', name: '导出' },
{ type: 'primary', id: '', name: '催单' }
],
getPage: {},
pageColumns: [
{ title: '委托编号', key: 'entrustCode', width: 140 },
{ title: '钻孔名称', key: 'boreholeName', width: 140 },
{ title: '样品编号', key: 'sampleCode', width: 140 },
{ title: '状态', key: 'status', width: 80, status: true },
{ title: '检测进度', key: 'testProgress', width: 160 }
],
selectIds: [],
selectData: [],
groupData: [],
salesmanData: [],
selectGroupIds: [],
selectSalesmans: [],
typeList: [{ name: '企业', value: 0 }, { name: '政府', value: 1 }]
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('', 300)
} else {
return this.$tableHeight('noSearch')
}
}
},
mounted() {
this._page()
},
methods: {
// 重置column
_resetColumn(colList) {
this.userColumns = colList
this.$refs.pageTable._loadColumn(colList)
},
// 获取业务员数据
_getSalesManList() {
this.$store.dispatch('LmsEquipInfo/userList').then(() => {
const list = this.$store.state.LmsEquipInfo.userList
const tempList = []
list.forEach(item => {
if (item.status.display !== '待激活' && item.realname !== undefined) {
tempList.push({ id: item.id, realname: item.realname })
}
})
this.salesmanData = JSON.parse(JSON.stringify(tempList))
})
},
_salesmanDataChange(data) {
this.formObj.salesmans = data.join(',')
},
// 所选检测科室的ids
_groupDataChange(data) {
this.formObj.groupIds = data.join(',')
},
// 获取当前的检测科室下拉
_getGroupList() {
this.$store.dispatch('LmsUserGroup/list').then(() => {
this.groupData = this.$store.state.LmsUserGroup.list
})
},
// 应出报告日期
_reportDueDateChange(data) {
this.formObj.reportDateBegin = data[0]
this.formObj.reportDateEnd = data[1]
},
_btnClick(msg) {
switch (msg) {
case '导出':
if (this.getPage.records.length === 0) {
this.$Message.warning('暂无数据,不可导出')
} else {
this._export()
}
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
_page: async function() {
// this.$refs.pageTable._page('search-form-package', 'FoodJudgeBasis/page')
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilStatistics.listSampleProgress(
this.$serializeForm(this.formObj)
)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.selectIds = []
this.getPage = this.$store.state.FoodSample.page
break
case 'selectData':
this.selectData = data
this.selectIds = []
for (let i = 0; i < data.length; i++) {
this.selectIds.push(data[i].id)
}
break
case 'changeSize':
this._page()
break
case 'table-col':
// 用户选中的表格列
this.userColumns = data
break
}
}
}
}
</script>
......@@ -19,7 +19,7 @@
<!--<Col span="24">-->
<!--<SampleSteps :info="sampleInfo" ref="stepsModal"></SampleSteps>-->
<!--</Col>-->
<Col :style="processObj" span="24">
<Col style="height: 300px;" span="24">
<VScrollFull ref="myscrollfull" @load="_loadData" :pageSize="rows">
<div slot="empty" style="text-align:center" class="gray-color">暂无数据</div>
<SampleSteps ref="stepsModal" :info="sampleInfo"></SampleSteps>
......
......@@ -27,7 +27,10 @@
<UnfinishedContract></UnfinishedContract>
</Col>
<Col span="24">
<SampleProgress></SampleProgress>
<SampleProgress style="margin-bottom: 20px;"></SampleProgress>
</Col>
<Col span="24" style="margin-bottom: 10px;">
<SampleProgressDetail></SampleProgressDetail>
</Col>
<Col span="12">
<UnfinishedItem></UnfinishedItem>
......@@ -88,6 +91,7 @@ import YearOverItem from './YearOverItem'
import GroupItem from './GroupItem'
import CustomerContract from './CustomerContract'
import SampleProgress from './sample-progress/SampleProgress'
import SampleProgressDetail from './SampleProgressDetail'
export default {
name: 'Workbench',
components: {
......@@ -122,7 +126,9 @@ export default {
// eslint-disable-next-line vue/no-unused-components
CustomerContract,
// eslint-disable-next-line vue/no-unused-components
SampleProgress
SampleProgress,
// eslint-disable-next-line vue/no-unused-components
SampleProgressDetail
},
data() {
return {
......
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