|
|
@@ -11,8 +11,8 @@
|
|
|
</el-breadcrumb>
|
|
|
<span style="float: right;">
|
|
|
<el-form ref="form" :inline="true" style="float: left; margin-top: -11.5px">
|
|
|
- <el-form-item label="样本源名称">
|
|
|
- <el-input size="mini" style="width: 165px;" v-model="searchform.Name" placeholder="请输入样本源名称"></el-input>
|
|
|
+ <el-form-item label="取样地区">
|
|
|
+ <el-input size="mini" style="width: 165px;" v-model="searchform.Area" placeholder="请输入取样地区"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="来源内码">
|
|
|
<el-input size="mini" style="width: 165px;" v-model="searchform.InnerNo" placeholder="请输入来源内码"></el-input>
|
|
|
@@ -57,6 +57,7 @@
|
|
|
<router-link :to="'/biobank/source/addsource/operationb'">
|
|
|
<el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;">添加</el-button>
|
|
|
</router-link>
|
|
|
+ <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="synchronizeVisible = true">数据同步</el-button>
|
|
|
<el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
|
|
|
@click="columndialogVisible = true">显示列</el-button>
|
|
|
<!-- <el-button size="mini" type="primary" style="margin-left:10px; margin-top: -4px;"
|
|
|
@@ -156,7 +157,7 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
|
|
|
- :page-sizes="[10, 100, 200, 500]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :page-sizes="[100, 200, 500, 1000]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
|
|
|
:total="currentItemCount">
|
|
|
</el-pagination>
|
|
|
</el-card>
|
|
|
@@ -248,7 +249,18 @@
|
|
|
<el-button size="mini" type="primary" @click="seachdata">查 询</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
-
|
|
|
+ <el-dialog title="样本导出" :visible.sync="sampleSourceExportVisible" @close="exportSampleSourceTypeInfo" width = "600px">
|
|
|
+ <el-form>
|
|
|
+ <el-form-item label="文件名称">
|
|
|
+ <el-input v-model="FileName" placeholder="请输入导出文件名称" size="middle" style="width:60%"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button size="mini" @click="exportSampleSourceTypeInfo">取 消</el-button>
|
|
|
+ <el-button size="mini" type="primary" @click="exportType == 'exportrelated' ? exportSamples() : exportSampleSource()">导 出</el-button>
|
|
|
+<!-- <el-button size="mini" type="primary" @click="exportSampleSource">导 出</el-button> // this.exportType == 'exportrelated' ? exportSamples :-->
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
<el-dialog title="样本批量导入" :visible.sync="importVisible">
|
|
|
<el-upload :action="filehost + '/api/uploads/exportanimal'" :show-file-list="false" :data="importfileparam"
|
|
|
:on-success="handleexportfileSuccess" :before-upload="beforeexportfileUpload">
|
|
|
@@ -277,6 +289,17 @@
|
|
|
<el-button type="primary" @click="saveshowfiled()">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog title="数据同步"
|
|
|
+ :visible.sync="synchronizeVisible"
|
|
|
+ v-loading="loading"
|
|
|
+ element-loading-text="数据同步中,请耐心等待">
|
|
|
+ <el-radio v-model="syncType" label="1">南口同步到马连洼</el-radio>
|
|
|
+ <el-radio v-model="syncType" label="2">马连洼同步到南口</el-radio>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="synchronizeVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="synchronizeSubmit">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
|
|
|
<!-- 自定义查询 -->
|
|
|
<samplesourcesearchdialog @close="closeDialog"
|
|
|
@@ -288,6 +311,7 @@ import {
|
|
|
mapGetters
|
|
|
} from 'vuex'
|
|
|
import service from '../../../utils/micro_request'
|
|
|
+import { customizeSearch, getSearchTemplate, sampleSourceSearchByTemplate, exportExcel, updateInfo } from '../../../utils/microSampleRelated'
|
|
|
import samplesourcesearchdialog from '../../../components/samples/samplesourcesearchdialog'
|
|
|
import draggable from 'vuedraggable'
|
|
|
import store from 'store'
|
|
|
@@ -305,6 +329,7 @@ export default {
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
+ loading: false,
|
|
|
filehost: '',
|
|
|
importfileparam: {}, // 导入文件参数
|
|
|
importfilepath: '', // 导入文件路径
|
|
|
@@ -319,17 +344,22 @@ export default {
|
|
|
list: [], // table显示数据集
|
|
|
showcolumn: [], // 显示列
|
|
|
columndialogVisible: false, // 自定义显示列弹框
|
|
|
+ sampleSourceExportVisible: false, // 样本导出弹框
|
|
|
isIndeterminate: false,
|
|
|
checkAll: true,
|
|
|
exportloading: false,
|
|
|
ExpandInfoList: [], // 扩展字段列表
|
|
|
+ FileName: '', // 导出文件名称,
|
|
|
+ exportType: '', // 导出类型
|
|
|
+ synchronizeVisible: false, // 数据同步弹窗
|
|
|
+ syncType: undefined, // 同步类型 1 南口-->马连洼 2 马连洼-->南口
|
|
|
searchform: {
|
|
|
GenusId: '',
|
|
|
Genus: '',
|
|
|
Address: '',
|
|
|
InnerNo: '',
|
|
|
CreateOn: '',
|
|
|
- Name: '',
|
|
|
+ Area: '',
|
|
|
Weight: '',
|
|
|
SourceType: '',
|
|
|
currentPage: '',
|
|
|
@@ -427,11 +457,32 @@ export default {
|
|
|
name: '取样地区',
|
|
|
show: true,
|
|
|
kuoz: false
|
|
|
+ }, {
|
|
|
+ filed: 'Longitude',
|
|
|
+ name: '经度',
|
|
|
+ show: true,
|
|
|
+ kuoz: false
|
|
|
+ }, {
|
|
|
+ filed: 'Latitude',
|
|
|
+ name: '纬度',
|
|
|
+ show: true,
|
|
|
+ kuoz: false
|
|
|
+ }, {
|
|
|
+ filed: 'Altitude',
|
|
|
+ name: '海拔',
|
|
|
+ show: true,
|
|
|
+ kuoz: false
|
|
|
+ }, {
|
|
|
+ filed: 'ProjectName',
|
|
|
+ name: '项目属性',
|
|
|
+ show: true,
|
|
|
+ kuoz: false
|
|
|
}, {
|
|
|
filed: 'Amount',
|
|
|
name: '数量',
|
|
|
show: true,
|
|
|
- kuoz: false
|
|
|
+ kuoz: false,
|
|
|
+ columnwidth: 80
|
|
|
}, {
|
|
|
filed: 'AuditorStatus',
|
|
|
name: '审核状态',
|
|
|
@@ -448,6 +499,16 @@ export default {
|
|
|
name: '采样日期',
|
|
|
show: true,
|
|
|
kuoz: false
|
|
|
+ }, {
|
|
|
+ filed: 'GenusName',
|
|
|
+ name: '蜂种备注',
|
|
|
+ show: true,
|
|
|
+ kuoz: false
|
|
|
+ }, {
|
|
|
+ filed: 'Remark',
|
|
|
+ name: '备注信息',
|
|
|
+ show: true,
|
|
|
+ kuoz: false
|
|
|
}]
|
|
|
}
|
|
|
this.filehost = process.env.imgserverhost
|
|
|
@@ -463,12 +524,7 @@ export default {
|
|
|
methods: {
|
|
|
// 接收时this.$route.query.SourceName
|
|
|
handlePush (name) {
|
|
|
- this.$router.push(
|
|
|
- {
|
|
|
- path: '/samples/stored',
|
|
|
- query: {name: name}
|
|
|
- }
|
|
|
- )
|
|
|
+ window.open('/samples/stored?name=' + name, '_blank')
|
|
|
},
|
|
|
sampleDetails (id) {
|
|
|
this.$router.push(
|
|
|
@@ -483,6 +539,7 @@ export default {
|
|
|
)
|
|
|
},
|
|
|
initdata () {
|
|
|
+ this.currentSearchTemplate = ''
|
|
|
let _this = this
|
|
|
let SurveyDate = []
|
|
|
if (!_this.SurveyDate) {
|
|
|
@@ -546,7 +603,7 @@ export default {
|
|
|
.catch(err => {
|
|
|
console.error(err)
|
|
|
})
|
|
|
- service.postRequest('dashoo.biobank.bee-0.1-jlw', 'SampleRelated', 'CustomizeSearch', {type: 'SampleSource'})
|
|
|
+ customizeSearch({type: 'SampleSource'})
|
|
|
.then(res => {
|
|
|
this.ExpandInfoList = res.data
|
|
|
})
|
|
|
@@ -636,11 +693,12 @@ export default {
|
|
|
console.log('closed')
|
|
|
this.getAllSearchTab()
|
|
|
},
|
|
|
-
|
|
|
+ exportSampleSourceTypeInfo () {
|
|
|
+ this.sampleSourceExportVisible = false
|
|
|
+ },
|
|
|
getAllSearchTab () {
|
|
|
let _this = this
|
|
|
- // getSearchTemplate({ Type: 'sample' })
|
|
|
- service.postRequest('dashoo.biobank.bee-0.1-jlw', 'SampleRelated', 'GetSearchTemplate', {type: 'SampleSource'})
|
|
|
+ getSearchTemplate({type: 'SampleSource'})
|
|
|
.then(res => {
|
|
|
if (res.data && res.data.length > 0) {
|
|
|
_this.searchTemplates = res.data.map(function (e) {
|
|
|
@@ -716,7 +774,7 @@ export default {
|
|
|
for (var i = 0; i < this.showcolumn.length; i++) {
|
|
|
if (this.showcolumn[i].name === column.label) {
|
|
|
this.showcolumn[i].columnwidth = newWidth
|
|
|
- store.set('sapminputshowcolumn', this.showcolumn)
|
|
|
+ store.set('sapmsourceinputshowcolumn', this.showcolumn)
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
@@ -760,36 +818,27 @@ export default {
|
|
|
} else if (command == 'clear') {
|
|
|
this.clearSearch()
|
|
|
} else {
|
|
|
- // TODO 样本模板查询微服务
|
|
|
- let params = {
|
|
|
- currentPage: 1,
|
|
|
- size: 200,
|
|
|
- template: command,
|
|
|
- isDelete: 0,
|
|
|
- type: 'SampleSource'
|
|
|
- }
|
|
|
- console.log(params)
|
|
|
- service.postRequest('dashoo.biobank.bee-0.1-jlw', 'SampleRelated', 'SampleSourceSearchByTemplate', params).then(res => {
|
|
|
+ this.searchByTemplate(command)
|
|
|
+ // this.$refs.sampleTable.searchWithTemplate(searchParams)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 自定义模板查询数据
|
|
|
+ searchByTemplate (command) {
|
|
|
+ // 样本模板查询微服务
|
|
|
+ let params = {
|
|
|
+ currentPage: this.currentPage,
|
|
|
+ size: this.size,
|
|
|
+ template: command,
|
|
|
+ isDelete: 0,
|
|
|
+ type: 'SampleSource'
|
|
|
+ }
|
|
|
+ console.log(params)
|
|
|
+ sampleSourceSearchByTemplate(params)
|
|
|
+ .then(res => {
|
|
|
this.donorsList = res.data.list
|
|
|
this.currentItemCount = res.data.total
|
|
|
})
|
|
|
- this.currentSearchTemplate = command
|
|
|
- /* let searchmodel = {
|
|
|
- searchWithTemplate: command
|
|
|
- }
|
|
|
- store.set('samplestoredseach', searchmodel) */
|
|
|
- // this.searchWithTemplate(command)
|
|
|
- // 调用子组件的查询方法 状态 1待存储2已存储3.取出待放回4.已归档
|
|
|
-
|
|
|
- let searchParams = {
|
|
|
- template: command,
|
|
|
- status: 2,
|
|
|
- isStore: true,
|
|
|
- type: 0,
|
|
|
- current: 1
|
|
|
- }
|
|
|
- // this.$refs.sampleTable.searchWithTemplate(searchParams)
|
|
|
- }
|
|
|
+ this.currentSearchTemplate = command
|
|
|
},
|
|
|
clearSearch () {
|
|
|
this.searchform.GenusId = ''
|
|
|
@@ -810,11 +859,19 @@ export default {
|
|
|
handleSizeChange (value) {
|
|
|
this.size = value
|
|
|
this.currentPage = 1
|
|
|
- this.initdata()
|
|
|
+ if (this.currentSearchTemplate) {
|
|
|
+ this.searchByTemplate(this.currentSearchTemplate)
|
|
|
+ } else {
|
|
|
+ this.initdata()
|
|
|
+ }
|
|
|
},
|
|
|
handleCurrentChange (value) {
|
|
|
this.currentPage = value
|
|
|
- this.initdata()
|
|
|
+ if (this.currentSearchTemplate) {
|
|
|
+ this.searchByTemplate(this.currentSearchTemplate)
|
|
|
+ } else {
|
|
|
+ this.initdata()
|
|
|
+ }
|
|
|
},
|
|
|
formatDateTime (date) {
|
|
|
var y = date.getFullYear()
|
|
|
@@ -847,7 +904,9 @@ export default {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- _this.exportSampleSource('exportchosen')
|
|
|
+ this.exportType = 'exportchosen'
|
|
|
+ this.sampleSourceExportVisible = true
|
|
|
+ // _this.exportSampleSource('exportchosen')
|
|
|
} else if (command === 'exportpage') { // 导出当前页数据
|
|
|
if (_this.$refs.tableData.data.length < 1) {
|
|
|
_this.$message({
|
|
|
@@ -856,16 +915,20 @@ export default {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- _this.exportSampleSource('exportpage')
|
|
|
+ this.exportType = 'exportpage'
|
|
|
+ this.sampleSourceExportVisible = true
|
|
|
+ // _this.exportSampleSource('exportpage')
|
|
|
} else if (command === 'exportall') { // 导出所有数据
|
|
|
- _this.$confirm('此操作将导出所有满足条件的数据!是否继续导出?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'info'
|
|
|
- }).then(() => {
|
|
|
- _this.exportSampleSource('exportall')
|
|
|
- }).catch(() => {
|
|
|
- })
|
|
|
+ // _this.$confirm('此操作将导出所有满足条件的数据!是否继续导出?', '提示', {
|
|
|
+ // confirmButtonText: '确定',
|
|
|
+ // cancelButtonText: '取消',
|
|
|
+ // type: 'info'
|
|
|
+ // }).then(() => {
|
|
|
+ // _this.exportSampleSource('exportall')
|
|
|
+ // }).catch(() => {
|
|
|
+ // })
|
|
|
+ this.exportType = 'exportall'
|
|
|
+ this.sampleSourceExportVisible = true
|
|
|
} else if (command === 'exportrelated') {
|
|
|
if (this.multipleSelection.length === 0) {
|
|
|
_this.$message({
|
|
|
@@ -879,12 +942,15 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'info'
|
|
|
}).then(() => {
|
|
|
- _this.exportSamples()
|
|
|
+ // _this.exportSamples()
|
|
|
+ this.exportType = 'exportrelated'
|
|
|
+ this.sampleSourceExportVisible = true
|
|
|
}).catch(() => {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- exportSampleSource (val) {
|
|
|
+ exportSampleSource () {
|
|
|
+ this.sampleSourceExportVisible = false
|
|
|
let _this = this
|
|
|
_this.exportloading = true
|
|
|
// 显示列
|
|
|
@@ -901,6 +967,7 @@ export default {
|
|
|
current_page: this.currentPage,
|
|
|
size: this.size,
|
|
|
name: this.searchform.Name,
|
|
|
+ file_name: this.FileName,
|
|
|
inner_no: this.InnerNo,
|
|
|
genus: this.searchform.Genus,
|
|
|
address: this.searchform.Address,
|
|
|
@@ -915,7 +982,8 @@ export default {
|
|
|
}
|
|
|
if (this.CreateOn && this.CreateOn.length === 2) {
|
|
|
let params2 = {
|
|
|
- create_on: this.CreateOn[0] / 1000 + ',' + this.CreateOn[1] / 1000
|
|
|
+ CreateOnStart: this.CreateOnStart,
|
|
|
+ CreateOnEnd: this.CreateOnEnd
|
|
|
}
|
|
|
params = Object.assign(params, params2)
|
|
|
}
|
|
|
@@ -927,7 +995,7 @@ export default {
|
|
|
params = Object.assign(params, params3)
|
|
|
}
|
|
|
// 导出所选样本
|
|
|
- if (val === 'exportchosen') {
|
|
|
+ if (_this.exportType === 'exportchosen') {
|
|
|
for (var i = 0; i < _this.$refs.tableData.selection.length; i++) {
|
|
|
if (i === _this.$refs.tableData.selection.length - 1) {
|
|
|
id += _this.$refs.tableData.selection[i].Id
|
|
|
@@ -941,7 +1009,7 @@ export default {
|
|
|
params = Object.assign(params, paramsid)
|
|
|
}
|
|
|
// 导出当前页样本
|
|
|
- if (val === 'exportpage') {
|
|
|
+ if (_this.exportType === 'exportpage') {
|
|
|
for (var i = 0; i < _this.$refs.tableData.data.length; i++) {
|
|
|
if (i === _this.$refs.tableData.data.length - 1) {
|
|
|
id += _this.$refs.tableData.data[i].Id
|
|
|
@@ -954,25 +1022,27 @@ export default {
|
|
|
}
|
|
|
params = Object.assign(params, paramsid)
|
|
|
}
|
|
|
- if (val === 'exportall') {
|
|
|
+ if (_this.exportType === 'exportall') {
|
|
|
params.current_page = 0
|
|
|
params.size = 0
|
|
|
}
|
|
|
// 样本来源相关导出
|
|
|
- service.downloadExcel('dashoo.biobank.bee-0.1-jlw', 'SampleRelated', 'ExportExcel', params)
|
|
|
+ exportExcel(params)
|
|
|
},
|
|
|
exportSamples () {
|
|
|
- const dateInfo = this.formatExportDate(new Date())
|
|
|
+ this.sampleSourceExportVisible = false
|
|
|
+ // const dateInfo = this.formatExportDate(new Date())
|
|
|
let _this = this
|
|
|
let id = ''
|
|
|
let params = {
|
|
|
AccCode: this.authUser.Profile.AccCode,
|
|
|
- Name: this.Name,
|
|
|
- InnerNo: this.InnerNo,
|
|
|
- CreateOn: (this.CreateOn).join(','),
|
|
|
- currentPage: this.currentPage,
|
|
|
+ name: this.Name,
|
|
|
+ file_name: this.FileName,
|
|
|
+ inner_no: this.InnerNo,
|
|
|
+ create_on: this.create_on,
|
|
|
+ current_page: this.currentPage,
|
|
|
size: this.size,
|
|
|
- Type: 'Sample'
|
|
|
+ type: 'Sample'
|
|
|
}
|
|
|
for (var i = 0; i < _this.$refs.tableData.selection.length; i++) {
|
|
|
if (i === _this.$refs.tableData.selection.length - 1) {
|
|
|
@@ -982,14 +1052,14 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
let paramsid = {
|
|
|
- Id: id
|
|
|
+ id: id
|
|
|
}
|
|
|
params = Object.assign(params, paramsid)
|
|
|
if (this.multipleSelection.length === 0) {
|
|
|
params.currentPage = 0
|
|
|
params.size = 0
|
|
|
}
|
|
|
- service.downloadExcel('dashoo.biobank.bee-0.1-jlw', 'SampleRelated', 'ExportExcel', params)
|
|
|
+ exportExcel(params)
|
|
|
},
|
|
|
jstimehandle (val) {
|
|
|
if (val === '') {
|
|
|
@@ -1019,6 +1089,26 @@ export default {
|
|
|
// this.$forceUpdate()
|
|
|
// this.initdata()
|
|
|
},
|
|
|
+ // 同步数据
|
|
|
+ synchronizeSubmit () {
|
|
|
+ this.$confirm('是否确认数据同步?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.loading = true
|
|
|
+ updateInfo({update_type: this.syncType}).then(res => {
|
|
|
+ this.loading = false
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.msg
|
|
|
+ })
|
|
|
+ this.synchronizeVisible = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
checkedshowall () {
|
|
|
let tc = 0
|
|
|
for (var i = 0; i < this.showcolumn.length; i++) {
|