Commit a801b521 by wangweidong

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	pages/soil-report-manage/report-make/OriginalRecordView.vue
parents 51ebb430 8a900743
......@@ -51,5 +51,7 @@ export default {
listExperimentProgress: data =>
http
.post('soil/v1/experiment/list_experiment_progress', data)
.then(res => res)
.then(res => res),
listSampleProgress: data =>
http.post('soil/v1/sample/list_sample_progress', data).then(res => res)
}
......@@ -9,10 +9,7 @@
<Form :label-width="80" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="模板名称:">
<Input v-model="formObj.templateTitle" @on-enter="_formSearch" placeholder="请输入模板名称" clearable></Input>
</Form-item>
<Form-item class="search-item" label="委托单位:">
<Input v-model="formObj.cusNames" @on-enter="_formSearch" placeholder="请输入委托单位" clearable></Input>
<Input v-model="formObj.title" @on-enter="_formSearch" placeholder="请输入模板名称" clearable></Input>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
......@@ -104,7 +101,11 @@ export default {
templateTitle: '',
fillInTimeBegin: '',
fillInTimeEnd: '',
cusNames: ''
cusNames: '',
codes: '',
itemNames: '',
testAccordings: '',
title: undefined
},
searchOpen: false
}
......
<template>
<div>
<!--内容-->
<Modal v-model="showModal" :width="100" class="modal-footer-none modal-top-0">
<p slot="header">{{modalTitle}}</p>
<div>
<el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="样品台账" name="sample">
<ReportMakeBySample ref="sampleTabs"></ReportMakeBySample>
</el-tab-pane>
<el-tab-pane label="汇总报告台账" name="summary">
<SummaryInfo ref="summaryTabs"></SummaryInfo>
</el-tab-pane>
<el-tab-pane label="试验项目报告台账" name="report">
<ReportInfoMake ref="reportTabs"></ReportInfoMake>
</el-tab-pane>
</el-tabs>
</div>
</Modal>
</div>
</template>
<script>
import ReportInfoMake from './sample-report-manage/ReportInfoMake'
import ReportMakeBySample from './sample-report-manage/ReportMakeBySample'
import SummaryInfo from './sample-report-manage/SummaryInfo'
export default {
components: {
ReportMakeBySample,
ReportInfoMake,
SummaryInfo
},
data() {
return {
showModal: false,
modalTitle: '',
activeName: '',
contractId: '',
entrustId: '',
type: '',
personal: ''
}
},
computed: {
tableHeight: function() {
return document.documentElement.clientHeight - 135
}
},
methods: {
_open(entrustId) {
this.modalTitle = '管理样品和报告'
this.showModal = true
this.activeName = 'sample'
this.entrustId = entrustId
this.$refs.sampleTabs._open(this.entrustId)
console.log(this.entrustId)
// 先初始化样品台账的数据
// this.$nextTick(() =>
// this.$refs.sampleTabs._getPage(
// this.contractId,
// this.type,
// this.personal
// )
// )
// this._sampleData(contractId)
},
// 判断待编样品是否为0
_sampleData(contractId) {
const data = {
contractId: contractId,
onlyReportMake: 1,
reported: 0,
page: 1,
rows: 50,
personal: this.personal
}
this.$store.dispatch('FoodSample/pageSampleReportMake', data).then(() => {
const records = this.$store.state.FoodSample.page.records
if (records.length === 0) {
this.activeName = 'report'
this.$nextTick(() => this._report())
} else {
this.activeName = 'sample'
this.$nextTick(() =>
this.$refs.sampleTabs._getPage(
this.contractId,
this.type,
this.personal
)
)
}
})
},
_report() {
this.$refs.reportTabs._open(this.entrustId)
},
_sample() {
console.log(this.entrustId)
this.$refs.sampleTabs._open(this.entrustId)
},
_summary() {
this.$refs.summaryTabs._open(this.entrustId)
},
_changeTabs(tab, event) {
switch (tab.name) {
case 'sample':
this._sample()
break
case 'report':
this._report()
break
case 'summary':
this._summary()
break
}
}
// _sampleTabResult(msg) {
// if (msg === 'changeTab') {
// this.activeName = 'report'
// this.$refs.reportTabs._open(this.contractId, this.personal)
// }
// }
}
}
</script>
......@@ -8,10 +8,6 @@
<Col span="24">
<Form id="search-form-report-tab" :label-width="70" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="报告编号:">
<Input @on-enter="_formSearch" name="reportCode" placeholder="请输入报告编号"
clearable/>
</Form-item>
<Form-item class="search-item" label="委托单位:">
<Input @on-enter="_formSearch" name="client" placeholder="请输入委托单位" clearable/>
</Form-item>
......@@ -85,8 +81,11 @@
<script>
import { soilReport } from '../../../../api'
import Operation from '../../../../components/operation/Operation'
import SampleByMakeModal from '../../report-manage/SampleByMakeModal'
import OriginalRecordView from '../OriginalRecordView'
export default {
components: { Operation },
// eslint-disable-next-line vue/no-unused-components
components: { Operation, SampleByMakeModal, OriginalRecordView },
props: {
reportStatus: null
},
......@@ -121,6 +120,17 @@ export default {
// componentName: 'ErecordIndex'
// },
{
type: 'ios-flask-outline',
id: '',
name: '管理样品和报告'
},
{
type: 'ios-beaker',
id: '',
name: '查看原始记录'
},
{ type: 'ios-cloud', id: '', name: '附件' },
{
type: 'ios-clock',
id: '',
name: '操作记录'
......@@ -184,23 +194,6 @@ export default {
break
}
},
_reportDateChange(data) {
$('input[name="reportDueDateBegin"]').val(data[0])
$('input[name="reportDueDateEnd"]').val(data[1])
},
// 制单日期
_ctimeChange(data) {
$('input[name="ctimeBegin"]').val(data[0])
$('input[name="ctimeEnd"]').val(data[1])
},
_dateChange(data) {
$('input[name=auditDateBegin]').val(data[0])
$('input[name=auditDateEnd]').val(data[1])
},
_issueDateChange(data) {
$('input[name=issueDateBegin]').val(data[0])
$('input[name=issueDateEnd]').val(data[1])
},
_btnClick(msg) {
switch (msg) {
case '导出发放记录':
......@@ -291,8 +284,14 @@ export default {
this.currentComponent = componentName
this.$nextTick(() => {
switch (res) {
case '资料管理':
this._resManage(data)
case '管理样品和报告':
this._sampleManage(data.id)
break
case '查看原始记录':
this._viewRecord(data.id)
break
case '附件':
this._upload(data.id)
break
case '操作记录':
this._record(data.id)
......@@ -300,6 +299,26 @@ export default {
}
})
},
_upload(id) {
this.currentComponent = 'FileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'entrustId')
})
// 上传文件
// this.$refs.FileManage._open(id, 'entrustId')
},
_viewRecord(id) {
this.currentComponent = 'OriginalRecordView'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
},
_sampleManage(id) {
this.currentComponent = 'SampleByMakeModal'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
},
_record(id) {
this.$refs.recordModal._open(id)
},
......
<template>
<div>
<Row>
<!--查询条件-->
<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.entrustCode" 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">
<BtnList :msg="btn" :open="searchOpen" :showSearchBtn="true" @on-result-change="_btnClick"
class="contHide">
</BtnList>
</Col>
<Col span="24">
<PTVXETable ref="pageTable" :pageColumns="pageColumns" :table-name="tableName"
:tableHeight="tableHeight"
@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>
</PTVXETable>
</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>
......@@ -32,6 +32,7 @@ import yearDeclara from '../pages/soil-statistics/yearDeclara'
import MeterCustomerEntrust from '../pages/soil-statistics/customer-entrust/MeterCustomerEntrust'
import MeterPersonalTask from '../pages/soil-statistics/personal-task/MeterPersonalTask'
import MeterAnnualEntrust from '../pages/soil-statistics/annual-entrust/MeterAnnualEntrust'
import SampleProgressDetail from '../pages/soil-statistics/sample-progress/SampleProgressDetail'
import ReportAuditIndex from '../pages/soil-report-manage/report-audit/ReportAuditIndex'
import ReportIssueIndex from '../pages/soil-report-manage/report-issue/ReportIssueIndex'
import SampleDisposeIndex from '../pages/soil-sample-manage/sample-dispose/SampleDisposeIndex'
......@@ -267,6 +268,11 @@ export default [
meta: { title: '不合格项目查询' }
},
{
path: 'sample_progress',
component: SampleProgressDetail,
meta: { title: '样品进度查询' }
},
{
path: 'year_declara_count',
component: yearDeclara,
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