|
|
@@ -223,1137 +223,1020 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import store from 'store'
|
|
|
- import {
|
|
|
- mapGetters
|
|
|
- } from 'vuex'
|
|
|
- import draggable from 'vuedraggable'
|
|
|
- import samplesearchdialog from '../../../components/samples/samplesearchdialog'
|
|
|
- import service from '../../../utils/micro_request'
|
|
|
- export default {
|
|
|
- name: 'samplesunsave',
|
|
|
- computed: mapGetters({
|
|
|
- authUser: 'authUser'
|
|
|
- }),
|
|
|
- components: {
|
|
|
- draggable,
|
|
|
- samplesearchdialog
|
|
|
- },
|
|
|
- data () {
|
|
|
- return {
|
|
|
- dialogVisible: false,
|
|
|
- currentItemCount: 0, // 当前页显示数量
|
|
|
- currentPage: 1, // 当前页
|
|
|
- size: 200, // 每页显示数量
|
|
|
- list: [], // table显示数据集
|
|
|
- BarCode: '', // 样本条码
|
|
|
- SampleCode: '', // 样本编码
|
|
|
- SampleType: '', // 样本类型
|
|
|
- Stnotevalue: '', // 特有扩展检索值
|
|
|
- STNoteField: [], // 特有扩展名称
|
|
|
- CreateBy: '', // 录入人
|
|
|
- CreateOn: [], // 录入时期
|
|
|
- StartDate: '', // 开始时期
|
|
|
- EndDate: '', // 结束时期
|
|
|
- GroupName: '', // 所属分组
|
|
|
- Name: '', // 名称
|
|
|
- DItem: '', // 容器类型id
|
|
|
- SourceName: '', // 样本来源
|
|
|
- EquipmentInfosList: [], // 容器名称列表
|
|
|
- EquipmentIds: [], // 设备id列表
|
|
|
- Validity: [], // 有效日期
|
|
|
- InnerCode: '', // 样本内码
|
|
|
- dialogFormVisible: false, // 添加弹框是否显示
|
|
|
- showquerydiv: false,
|
|
|
- searchmodel: {
|
|
|
- BarCode: '', // 样本条码
|
|
|
- SampleCode: '', // 样本编码
|
|
|
- SampleType: '', // 样本类型
|
|
|
- SamplingSite: '', // 取材部位
|
|
|
- Stnotevalue: '', // 特有扩展检索值
|
|
|
- STNoteField: [], // 特有扩展名称
|
|
|
- Noteitemvalue: '', // 公共扩展检索值
|
|
|
- Noteitem: [], // 公共扩展名称
|
|
|
- CreateBy: '', // 录入人
|
|
|
- CreateOn: [], // 录入时期
|
|
|
- StartDate: '', // 开始时期
|
|
|
- EndDate: '', // 结束时期
|
|
|
- Name: '', // 名称
|
|
|
- SourceName: '', // 样本来源
|
|
|
- Validity: [], // 有效日期
|
|
|
- GroupName: '',
|
|
|
- InnerCode: '' // 样本内码
|
|
|
- },
|
|
|
- sampletypes: [], // 样本类型
|
|
|
- typetykzlist: [], // 特有扩展
|
|
|
- multipleSelection: [], // 多选框
|
|
|
- showcolumn: [], // 显示列
|
|
|
- cachecols: [],
|
|
|
- columndialogVisible: false, // 自定义显示列弹框
|
|
|
- isIndeterminate: false,
|
|
|
- checkAll: true,
|
|
|
- searchDialogVisible: false, // 自定义搜索弹框
|
|
|
- searchTemplateName: '自定义搜索1',
|
|
|
- searchTemplates: [],
|
|
|
- currentSearchTemplateName: '',
|
|
|
- searchField: 'BarCode',
|
|
|
- searchValue: {
|
|
|
- BarCode: '',
|
|
|
- SampleCode: '',
|
|
|
- SourceName: '',
|
|
|
- InnerCode: '',
|
|
|
- Name: '',
|
|
|
- CreateBy: '',
|
|
|
- CreateOn: [],
|
|
|
- StartDate: '', // 开始时期
|
|
|
- EndDate: '', // 结束时期
|
|
|
- SampleType: '',
|
|
|
- Validity: [],
|
|
|
- Capacity: '',
|
|
|
- Location: '',
|
|
|
- Extension: '',
|
|
|
- GroupName: '' // 所属分组
|
|
|
- },
|
|
|
- orAnd: 'and',
|
|
|
- orAndData: [{
|
|
|
- name: '并且',
|
|
|
- value: 'and'
|
|
|
- },
|
|
|
+import store from 'store'
|
|
|
+import {
|
|
|
+ mapGetters
|
|
|
+} from 'vuex'
|
|
|
+import draggable from 'vuedraggable'
|
|
|
+import samplesearchdialog from '../../../components/samples/samplesearchdialog'
|
|
|
+import service from '../../../utils/micro_request'
|
|
|
+export default {
|
|
|
+ name: 'samplesunsave',
|
|
|
+ computed: mapGetters({
|
|
|
+ authUser: 'authUser'
|
|
|
+ }),
|
|
|
+ components: {
|
|
|
+ draggable,
|
|
|
+ samplesearchdialog
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ dialogVisible: false,
|
|
|
+ currentItemCount: 0, // 当前页显示数量
|
|
|
+ currentPage: 1, // 当前页
|
|
|
+ size: 200, // 每页显示数量
|
|
|
+ list: [], // table显示数据集
|
|
|
+ BarCode: '', // 样本条码
|
|
|
+ SampleCode: '', // 样本编码
|
|
|
+ SampleType: '', // 样本类型
|
|
|
+ Stnotevalue: '', // 特有扩展检索值
|
|
|
+ DItem: '', // 容器类型id
|
|
|
+ EquipmentList: [], // 容器类型列表
|
|
|
+ ExpandInfoList: [], // 扩展字段列表
|
|
|
+ EquipmentInfosList: [], // 容器名称列表
|
|
|
+ EquipmentIds: [], // 设备id列表
|
|
|
+ STNoteField: [], // 特有扩展名称
|
|
|
+ CreateBy: '', // 录入人
|
|
|
+ CreateOn: [], // 录入时期
|
|
|
+ StartDate: '', // 开始时期
|
|
|
+ EndDate: '', // 结束时期
|
|
|
+ GroupName: '', // 所属分组
|
|
|
+ Name: '', // 名称
|
|
|
+ SourceName: '', // 样本来源
|
|
|
+ InnerCode: '', // 样本内码
|
|
|
+ dialogFormVisible: false, // 添加弹框是否显示
|
|
|
+ showquerydiv: false,
|
|
|
+ sampletypes: [], // 样本类型
|
|
|
+ // 新增
|
|
|
+ typetykzlist: [], // 特有扩展
|
|
|
+ multipleSelection: [], // 多选框
|
|
|
+ showcolumn: [], // 显示列
|
|
|
+ cachecols: [],
|
|
|
+ columndialogVisible: false, // 自定义显示列弹框
|
|
|
+ isIndeterminate: false,
|
|
|
+ checkAll: true,
|
|
|
+ searchDialogVisible: false, // 自定义搜索弹框
|
|
|
+ searchTemplateName: '自定义搜索1',
|
|
|
+ searchTemplates: [],
|
|
|
+ currentSearchTemplateName: '',
|
|
|
+ searchField: 'BarCode',
|
|
|
+ searchValue: {
|
|
|
+ BarCode: '',
|
|
|
+ SampleCode: '',
|
|
|
+ SourceName: '',
|
|
|
+ InnerCode: '',
|
|
|
+ Name: '',
|
|
|
+ CreateBy: '',
|
|
|
+ SampleType: '',
|
|
|
+ Validity: [],
|
|
|
+ Capacity: '',
|
|
|
+ Location: '',
|
|
|
+ Extension: '',
|
|
|
+ GroupName: '' // 所属分组
|
|
|
+ },
|
|
|
+ orAnd: 'and',
|
|
|
+ orAndData: [{
|
|
|
+ name: '并且',
|
|
|
+ value: 'and'
|
|
|
+ },
|
|
|
{
|
|
|
name: '或者',
|
|
|
value: 'or'
|
|
|
}
|
|
|
- ],
|
|
|
- searchTableData: [],
|
|
|
- searchcolumn: [], // 搜索列
|
|
|
- currentSearchTemplate: '',
|
|
|
- acc: ''
|
|
|
- }
|
|
|
- },
|
|
|
- created () {
|
|
|
- this.acc = this.authUser.Profile.AccCode
|
|
|
- if (this.$route.query.size && this.$route.query.currentPage) {
|
|
|
- this.size = parseInt(this.$route.query.size)
|
|
|
- this.currentPage = parseInt(this.$route.query.currentPage)
|
|
|
- let searchmodel = store.get('samplearchivedseach')
|
|
|
+ ],
|
|
|
+ searchTableData: [],
|
|
|
+ searchcolumn: [], // 搜索列
|
|
|
+ currentSearchTemplate: '',
|
|
|
+ acc: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.acc = this.authUser.Profile.AccCode
|
|
|
+ if (this.$route.query.size && this.$route.query.currentPage) {
|
|
|
+ this.size = parseInt(this.$route.query.size)
|
|
|
+ this.currentPage = parseInt(this.$route.query.currentPage)
|
|
|
|
|
|
- if (typeof (this.searchmodel) !== 'undefined') {
|
|
|
- if (this.searchmodel.BarCode && this.searchmodel.BarCode !== '') { // 样本条码
|
|
|
- this.BarCode = this.searchmodel.BarCode
|
|
|
- }
|
|
|
- if (this.searchmodel.SampleCode && this.searchmodel.SampleCode !== '') { // 样本编码
|
|
|
- this.SampleCode = this.searchmodel.SampleCode
|
|
|
- }
|
|
|
- if (this.searchmodel.SourceName && this.searchmodel.SourceName !== '') { // 样本来源
|
|
|
- this.SourceName = this.searchmodel.SourceName
|
|
|
- }
|
|
|
- if (this.searchmodel.InnerCode && this.searchmodel.InnerCode !== '') { // 样本内码
|
|
|
- this.InnerCode = this.searchmodel.InnerCode
|
|
|
- }
|
|
|
- if (this.searchmodel.Name && this.searchmodel.Name !== '') { // 名称
|
|
|
- this.Name = this.searchmodel.Name
|
|
|
- }
|
|
|
- if (this.searchmodel.CreateBy && this.searchmodel.CreateBy !== '') { // 录入人
|
|
|
- this.CreateBy = this.searchmodel.CreateBy
|
|
|
- }
|
|
|
- if (this.searchmodel.CreateOn && this.searchmodel.CreateOn.length === 2) { // 录入日期
|
|
|
- this.CreateOn = [new Date(this.searchmodel.CreateOn[0]), new Date(this.searchmodel.CreateOn[1])]
|
|
|
- }
|
|
|
- if (this.searchmodel.SampleType && this.searchmodel.SampleType !== '') { // 样本类型
|
|
|
- this.SampleType = this.searchmodel.SampleType
|
|
|
- this.searchsampletypeChange()
|
|
|
- }
|
|
|
- if (this.searchmodel.STNoteField && this.searchmodel.STNoteField.length > 0) { // 特有扩展
|
|
|
- this.STNoteField = this.searchmodel.STNoteField
|
|
|
- }
|
|
|
- if (this.searchmodel.Stnotevalue && this.searchmodel.Stnotevalue !== '') { // 特有检索内容
|
|
|
- this.Stnotevalue = this.searchmodel.Stnotevalue
|
|
|
- }
|
|
|
- if (this.searchmodel.Validity && this.searchmodel.Validity.length === 2) { // 有效日期
|
|
|
- this.Validity = [new Date(this.searchmodel.Validity[0]), new Date(this.searchmodel.Validity[1])]
|
|
|
- }
|
|
|
- if (searchmodel.GroupName && searchmodel.GroupName !== '') { // 所属分组
|
|
|
- this.GroupName = searchmodel.GroupName
|
|
|
- }
|
|
|
+ let searchmodel = store.get('samplewaitstoreseach')
|
|
|
+ if (typeof (searchmodel) !== 'undefined') {
|
|
|
+ if (searchmodel.BarCode && searchmodel.BarCode !== '') { // 样本条码
|
|
|
+ this.BarCode = searchmodel.BarCode
|
|
|
+ }
|
|
|
+ if (searchmodel.SampleCode && searchmodel.SampleCode !== '') { // 样本编码
|
|
|
+ this.SampleCode = searchmodel.SampleCode
|
|
|
+ }
|
|
|
+ if (searchmodel.SourceName && searchmodel.SourceName !== '') { // 样本来源
|
|
|
+ this.SourceName = searchmodel.SourceName
|
|
|
+ }
|
|
|
+ if (searchmodel.InnerCode && searchmodel.InnerCode !== '') { // 样本内码
|
|
|
+ this.InnerCode = searchmodel.InnerCode
|
|
|
+ }
|
|
|
+ if (searchmodel.Name && searchmodel.Name !== '') { // 名称
|
|
|
+ this.Name = searchmodel.Name
|
|
|
+ }
|
|
|
+ if (searchmodel.CreateBy && searchmodel.CreateBy !== '') { // 录入人
|
|
|
+ this.CreateBy = searchmodel.CreateBy
|
|
|
+ }
|
|
|
+ if (searchmodel.CreateOn && searchmodel.CreateOn.length === 2) { // 录入日期
|
|
|
+ this.CreateOn = [new Date(searchmodel.CreateOn[0]), new Date(searchmodel.CreateOn[1])]
|
|
|
+ }
|
|
|
+ if (searchmodel.SampleType && searchmodel.SampleType !== '') { // 样本类型
|
|
|
+ this.SampleType = searchmodel.SampleType
|
|
|
+ this.searchsampletypeChange()
|
|
|
+ }
|
|
|
+ if (searchmodel.STNoteField && searchmodel.STNoteField.length > 0) { // 特有扩展
|
|
|
+ this.STNoteField = searchmodel.STNoteField
|
|
|
+ }
|
|
|
+ if (searchmodel.Stnotevalue && searchmodel.Stnotevalue !== '') { // 特有检索内容
|
|
|
+ this.Stnotevalue = searchmodel.Stnotevalue
|
|
|
+ }
|
|
|
+ if (searchmodel.Validity && searchmodel.Validity.length === 2) { // 有效日期
|
|
|
+ this.Validity = [new Date(searchmodel.Validity[0]), new Date(searchmodel.Validity[1])]
|
|
|
+ }
|
|
|
+ if (searchmodel.GroupName && searchmodel.GroupName !== '') { // 所属分组
|
|
|
+ this.GroupName = searchmodel.GroupName
|
|
|
}
|
|
|
- } else {
|
|
|
- store.set('samplearchivedseach', '')
|
|
|
}
|
|
|
+ } else {
|
|
|
+ store.set('samplewaitstoreseach', '')
|
|
|
+ }
|
|
|
|
|
|
- this.cachecols = store.get('samplearchivedshowcolumn')
|
|
|
- // 当前显示列无数据,使用已录入样本显示列数据
|
|
|
- if (!(this.cachecols && this.cachecols !== '')) {
|
|
|
- this.cachecols = store.get('sapminputshowcolumn')
|
|
|
+ this.cachecols = store.get('samplewaitstoreshowcolumn')
|
|
|
+ // 当前显示列无数据,使用已录入样本显示列数据
|
|
|
+ if (!(this.cachecols && this.cachecols !== '')) {
|
|
|
+ this.cachecols = store.get('sapminputshowcolumn')
|
|
|
+ }
|
|
|
+ if (this.cachecols && this.cachecols !== '') {
|
|
|
+ this.showcolumn = this.cachecols
|
|
|
+ } else {
|
|
|
+ this.showcolumn = [{
|
|
|
+ filed: 'BarCode',
|
|
|
+ name: '样本条码',
|
|
|
+ show: true,
|
|
|
+ kuoz: false
|
|
|
+ }, {
|
|
|
+ filed: 'SampleCode',
|
|
|
+ name: '样本编码',
|
|
|
+ show: true,
|
|
|
+ kuoz: false
|
|
|
+ }, {
|
|
|
+ filed: 'SourceName',
|
|
|
+ name: '样本来源',
|
|
|
+ show: true,
|
|
|
+ kuoz: false
|
|
|
+ }, {
|
|
|
+ filed: 'Genus',
|
|
|
+ name: '蜂种名称',
|
|
|
+ show: true,
|
|
|
+ kuoz: false
|
|
|
+ }, {
|
|
|
+ filed: 'AddressName',
|
|
|
+ name: '取样地区',
|
|
|
+ show: true,
|
|
|
+ kuoz: false
|
|
|
+ }, {
|
|
|
+ filed: 'SurveyDate',
|
|
|
+ name: '采样日期',
|
|
|
+ show: true,
|
|
|
+ kuoz: false
|
|
|
+ }, {
|
|
|
+ filed: 'Name',
|
|
|
+ name: '名称',
|
|
|
+ show: true,
|
|
|
+ kuoz: false
|
|
|
+ }, {
|
|
|
+ filed: 'SampleTypeName',
|
|
|
+ name: '样本类型',
|
|
|
+ show: true,
|
|
|
+ kuoz: false
|
|
|
+ }, {
|
|
|
+ filed: 'Capacity',
|
|
|
+ name: '可用容量',
|
|
|
+ show: true,
|
|
|
+ kuoz: false
|
|
|
+ }, {
|
|
|
+ filed: 'InnerCode',
|
|
|
+ name: '样本内码',
|
|
|
+ show: true,
|
|
|
+ kuoz: false
|
|
|
+ }, {
|
|
|
+ filed: 'ValidityDate',
|
|
|
+ name: '有效日期',
|
|
|
+ show: true,
|
|
|
+ kuoz: false
|
|
|
+ }, {
|
|
|
+ filed: 'ReceiveDate',
|
|
|
+ name: '接收日期',
|
|
|
+ show: true,
|
|
|
+ kuoz: false
|
|
|
+ }, {
|
|
|
+ filed: 'CreateBy',
|
|
|
+ name: '录入人',
|
|
|
+ show: true,
|
|
|
+ kuoz: false
|
|
|
+ }, {
|
|
|
+ filed: 'GroupName',
|
|
|
+ name: '所属分组',
|
|
|
+ show: true,
|
|
|
+ kuoz: false
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ this.getextends()
|
|
|
+ this.checkedshowall()
|
|
|
+ this.getAllSearchTab()
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ let _this = this
|
|
|
+ window.clickmodeltypetag = function (val, e) {
|
|
|
+ _this.clickmodeltypetag(val)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ initData () {
|
|
|
+ this.CreateOn = []
|
|
|
+ if ((this.StartDate != '' && this.EndDate == '') || (this.StartDate == '' && this.EndDate != '')) {
|
|
|
+ this.$message.error('请输入完整创建日期!')
|
|
|
+ } else if (this.StartDate > this.EndDate) {
|
|
|
+ this.$message.error('开始日期不能大于结束日期,请重新输入!')
|
|
|
+ } else if (this.StartDate != '' && this.EndDate != '') {
|
|
|
+ this.CreateOn.push(this.StartDate)
|
|
|
+ this.CreateOn.push(this.EndDate)
|
|
|
}
|
|
|
- if (this.cachecols && this.cachecols !== '') {
|
|
|
- this.showcolumn = this.cachecols
|
|
|
- } else {
|
|
|
- this.showcolumn = [{
|
|
|
- filed: 'BarCode',
|
|
|
- name: '样本条码',
|
|
|
- show: true,
|
|
|
- kuoz: false
|
|
|
- }, {
|
|
|
- filed: 'SampleCode',
|
|
|
- name: '样本编码',
|
|
|
- show: true,
|
|
|
- kuoz: false
|
|
|
- }, {
|
|
|
- filed: 'SourceName',
|
|
|
- name: '样本来源',
|
|
|
- show: true,
|
|
|
- kuoz: false
|
|
|
- }, {
|
|
|
- filed: 'Genus',
|
|
|
- name: '蜂种名称',
|
|
|
- show: true,
|
|
|
- kuoz: false
|
|
|
- }, {
|
|
|
- filed: 'AddressName',
|
|
|
- name: '取样地区',
|
|
|
- show: true,
|
|
|
- kuoz: false
|
|
|
- }, {
|
|
|
- filed: 'SurveyDate',
|
|
|
- name: '采样日期',
|
|
|
- show: true,
|
|
|
- kuoz: false
|
|
|
- }, {
|
|
|
- filed: 'Name',
|
|
|
- name: '名称',
|
|
|
- show: true,
|
|
|
- kuoz: false
|
|
|
- }, {
|
|
|
- filed: 'SampleTypeName',
|
|
|
- name: '样本类型',
|
|
|
- show: true,
|
|
|
- kuoz: false
|
|
|
- }, {
|
|
|
- filed: 'Capacity',
|
|
|
- name: '可用容量',
|
|
|
- show: true,
|
|
|
- kuoz: false
|
|
|
- }, {
|
|
|
- filed: 'InnerCode',
|
|
|
- name: '样本内码',
|
|
|
- show: true,
|
|
|
- kuoz: false
|
|
|
- }, {
|
|
|
- filed: 'ValidityDate',
|
|
|
- name: '有效日期',
|
|
|
- show: true,
|
|
|
- kuoz: false
|
|
|
- }, {
|
|
|
- filed: 'ReceiveDate',
|
|
|
- name: '接收日期',
|
|
|
- show: true,
|
|
|
- kuoz: false
|
|
|
- }, {
|
|
|
- filed: 'CreateBy',
|
|
|
- name: '录入人',
|
|
|
- show: true,
|
|
|
- kuoz: false
|
|
|
- }, {
|
|
|
- filed: 'GroupName',
|
|
|
- name: '所属分组',
|
|
|
+ this.currentSearchTemplate = ''
|
|
|
+ let _this = this
|
|
|
+ // 增加自定义显示列,存储位置,之后需要去掉
|
|
|
+ let ishaslocation = false
|
|
|
+ for (let i = 0; i < _this.showcolumn.length; i++) {
|
|
|
+ if (_this.showcolumn[i].filed === 'Location') {
|
|
|
+ ishaslocation = true
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!ishaslocation) {
|
|
|
+ _this.showcolumn.push({
|
|
|
+ filed: 'Location',
|
|
|
+ name: '存储位置',
|
|
|
show: true,
|
|
|
- kuoz: false
|
|
|
- }]
|
|
|
+ kuoz: false,
|
|
|
+ columnwidth: 200
|
|
|
+ })
|
|
|
}
|
|
|
- this.initData()
|
|
|
- this.getextends()
|
|
|
- this.checkedshowall()
|
|
|
- this.getAllSearchTab()
|
|
|
- },
|
|
|
- mounted () {
|
|
|
- let _this = this
|
|
|
- window.clickmodeltypetag = function (val, e) {
|
|
|
- _this.clickmodeltypetag(val)
|
|
|
+ // paginate
|
|
|
+ let params = {
|
|
|
+ _currentPage: this.currentPage,
|
|
|
+ _size: this.size,
|
|
|
+ BarCode: this.BarCode,
|
|
|
+ SampleCode: this.SampleCode,
|
|
|
+ SampleType: this.SampleType,
|
|
|
+ Stnotevalue: this.Stnotevalue,
|
|
|
+ STNoteField: this.STNoteField,
|
|
|
+ CreateBy: this.CreateBy,
|
|
|
+ SourceName: this.SourceName,
|
|
|
+ DItem: this.DItem,
|
|
|
+ EquipmentIds: this.EquipmentIds,
|
|
|
+ Name: this.Name,
|
|
|
+ Validity: this.Validity,
|
|
|
+ CreateOn: this.CreateOn,
|
|
|
+ InnerCode: this.InnerCode,
|
|
|
+ GroupName: _this.GroupName
|
|
|
}
|
|
|
- },
|
|
|
- methods: {
|
|
|
- initData () {
|
|
|
- this.CreateOn = []
|
|
|
- if ((this.StartDate != '' && this.EndDate == '') || (this.StartDate == '' && this.EndDate != '')) {
|
|
|
- this.$message.error('请输入完整创建日期!')
|
|
|
- } else if (this.StartDate > this.EndDate) {
|
|
|
- this.$message.error('开始日期不能大于结束日期,请重新输入!')
|
|
|
- } else if (this.StartDate != '' && this.EndDate != '') {
|
|
|
- this.CreateOn.push(this.StartDate)
|
|
|
- this.CreateOn.push(this.EndDate)
|
|
|
- }
|
|
|
- this.currentSearchTemplate = ''
|
|
|
- let _this = this
|
|
|
- // 增加自定义显示列,存储位置,之后需要去掉
|
|
|
- let ishaslocation = false
|
|
|
- for (let i = 0; i < _this.showcolumn.length; i++) {
|
|
|
- if (_this.showcolumn[i].filed === 'Location') {
|
|
|
- ishaslocation = true
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- if (!ishaslocation) {
|
|
|
- _this.showcolumn.push({
|
|
|
- filed: 'Location',
|
|
|
- name: '存储位置',
|
|
|
- show: true,
|
|
|
- kuoz: false,
|
|
|
- columnwidth: 200
|
|
|
- })
|
|
|
- }
|
|
|
- // paginate
|
|
|
- let params = {
|
|
|
- _currentPage: this.currentPage,
|
|
|
- _size: this.size,
|
|
|
- BarCode: this.BarCode,
|
|
|
- SampleCode: this.SampleCode,
|
|
|
- SampleType: this.SampleType,
|
|
|
- Stnotevalue: this.Stnotevalue,
|
|
|
- STNoteField: this.STNoteField,
|
|
|
- CreateBy: this.CreateBy,
|
|
|
- SourceName: this.SourceName,
|
|
|
- DItem: this.DItem,
|
|
|
- EquipmentIds: this.EquipmentIds,
|
|
|
- Name: this.Name,
|
|
|
- Validity: this.Validity,
|
|
|
- CreateOn: this.CreateOn,
|
|
|
- InnerCode: this.InnerCode,
|
|
|
- GroupName: _this.GroupName
|
|
|
- }
|
|
|
- if (this.CreateOn && this.CreateOn.length === 2) {
|
|
|
- let params2 = {
|
|
|
- CreateOnstart: this.CreateOn[0] / 1000,
|
|
|
- CreateOnend: this.CreateOn[1] / 1000
|
|
|
- }
|
|
|
- params = Object.assign(params, params2)
|
|
|
+ if (this.CreateOn && this.CreateOn.length === 2) {
|
|
|
+ let params2 = {
|
|
|
+ CreateOnstart: this.CreateOn[0] / 1000,
|
|
|
+ CreateOnend: this.CreateOn[1] / 1000
|
|
|
}
|
|
|
- if (this.Validity && this.Validity.length === 2) {
|
|
|
- let params3 = {
|
|
|
- Validitystart: this.Validity[0] / 1000,
|
|
|
- Validityend: this.Validity[1] / 1000
|
|
|
- }
|
|
|
- params = Object.assign(params, params3)
|
|
|
+ params = Object.assign(params, params2)
|
|
|
+ }
|
|
|
+ if (this.Validity && this.Validity.length === 2) {
|
|
|
+ let params3 = {
|
|
|
+ Validitystart: this.Validity[0] / 1000,
|
|
|
+ Validityend: this.Validity[1] / 1000
|
|
|
}
|
|
|
- store.set('samplestoredseach', params)
|
|
|
- _this.getAllSearchTab()
|
|
|
- this.$axios.get('/samplesfiles/animallist', {
|
|
|
- params
|
|
|
+ params = Object.assign(params, params3)
|
|
|
+ }
|
|
|
+ store.set('samplesfiles/animallist', params)
|
|
|
+ _this.getAllSearchTab()
|
|
|
+ this.$axios.get('/samplesunsave/animallist', {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ _this.list = res.data.items
|
|
|
+ _this.currentItemCount = res.data.currentItemCount
|
|
|
})
|
|
|
- .then(res => {
|
|
|
- _this.list = res.data.items
|
|
|
- _this.currentItemCount = res.data.currentItemCount
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- service.postRequest('dashoo.biobank.bee-0.1', 'Equipment', 'GetEquipmentType')
|
|
|
- .then(res => {
|
|
|
- this.EquipmentList = res.data
|
|
|
- })
|
|
|
- this.$refs.multipleTable.doLayout()
|
|
|
- },
|
|
|
- GetEquipmentInfos () {
|
|
|
- service.postRequest('dashoo.biobank.bee-0.1', 'Equipment', 'GetEquipmentInfos', {DItem: this.DItem})
|
|
|
- .then(res => {
|
|
|
- this.EquipmentInfosList = res.data
|
|
|
- })
|
|
|
- },
|
|
|
- // 根据子code获取所有父code
|
|
|
- getparentcodebytopcode (v) {
|
|
|
- let _this = this
|
|
|
- _this.$axios.get('/sampleorgan/getparentcodebytopcode/' + v, {})
|
|
|
- .then(res => {
|
|
|
- _this.selectedzuzhi = []
|
|
|
- let pidarr = res.data.split(',')
|
|
|
- for (var i = pidarr.length - 1; i >= 0; i--) {
|
|
|
- if (pidarr[i] !== '0') {
|
|
|
- _this.selectedzuzhi.push(pidarr[i])
|
|
|
- }
|
|
|
- }
|
|
|
- _this.searchzuzhitreehandleChange()
|
|
|
- })
|
|
|
- },
|
|
|
- getextends () {
|
|
|
- let _this = this
|
|
|
- this.$axios.get('/sampleinput/getsampletype', {
|
|
|
- _currentPage: -1
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
})
|
|
|
- .then(res => {
|
|
|
- _this.sampletypes = res.data.items
|
|
|
- if (store.get('samplearchivedseach').searchWithTemplate && store.get('samplearchivedseach')
|
|
|
- .searchWithTemplate !==
|
|
|
- '') { // 自定义查询
|
|
|
- this.handleSearchCommand(store.get('samplearchivedseach').searchWithTemplate)
|
|
|
- } else {
|
|
|
- this.initData()
|
|
|
+ service.postRequest('dashoo.biobank.bee-0.1', 'Equipment', 'GetEquipmentType')
|
|
|
+ .then(res => {
|
|
|
+ this.EquipmentList = res.data
|
|
|
+ })
|
|
|
+ this.$refs.multipleTable.doLayout()
|
|
|
+ service.postRequest('dashoo.biobank.bee-0.1', 'SampleRelated', 'CustomizeSearch', {type: 'Sample'})
|
|
|
+ .then(res => {
|
|
|
+ this.ExpandInfoList = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ GetEquipmentInfos () {
|
|
|
+ service.postRequest('dashoo.biobank.bee-0.1', 'Equipment', 'GetEquipmentInfos', {DItem: this.DItem})
|
|
|
+ .then(res => {
|
|
|
+ this.EquipmentInfosList = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 根据子code获取所有父code
|
|
|
+ getparentcodebytopcode (v) {
|
|
|
+ let _this = this
|
|
|
+ _this.$axios.get('/sampleorgan/getparentcodebytopcode/' + v, {})
|
|
|
+ .then(res => {
|
|
|
+ _this.selectedzuzhi = []
|
|
|
+ let pidarr = res.data.split(',')
|
|
|
+ for (var i = pidarr.length - 1; i >= 0; i--) {
|
|
|
+ if (pidarr[i] !== '0') {
|
|
|
+ _this.selectedzuzhi.push(pidarr[i])
|
|
|
}
|
|
|
- }).catch(() => {})
|
|
|
- },
|
|
|
- seachdata () {
|
|
|
- if (this.selectedzuzhi.length > 0) {
|
|
|
- this.selectsigorg = this.selectedzuzhi[this.selectedzuzhi.length - 1] + ''
|
|
|
- }
|
|
|
- this.currentPage = 1
|
|
|
- this.initData()
|
|
|
- this.dialogVisible = false
|
|
|
- },
|
|
|
- // 关闭自定义查询
|
|
|
- closeDialog () {
|
|
|
- this.getAllSearchTab()
|
|
|
- },
|
|
|
- deletedata (val) {
|
|
|
- let _this = this
|
|
|
- _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- _this.$axios.delete('samplesfiles/' + val.Id + '?sampletype=' + val.SampleType, null)
|
|
|
- .then(res => {
|
|
|
- if (res.data.code === 0) {
|
|
|
- _this.$message({
|
|
|
- type: 'success',
|
|
|
- message: res.data.message
|
|
|
- })
|
|
|
- // 更新界面
|
|
|
- this.initData()
|
|
|
- } else {
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: res.data.message
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {})
|
|
|
- }).catch(() => {})
|
|
|
- },
|
|
|
- // 批量删除
|
|
|
- batchdelete () {
|
|
|
- let _this = this
|
|
|
- if (_this.multipleSelection.length < 1) {
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '请选择要批量删除的样本'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- let failedIds = []
|
|
|
- let succeedMsg = ''
|
|
|
- let errorMsg = ''
|
|
|
- let count = 0
|
|
|
- for (var i = 0; i < _this.multipleSelection.length; i++) {
|
|
|
- _this.$axios.delete('samplesfiles/' + _this.multipleSelection[i].Id + '?sampletype=' + _this
|
|
|
- .multipleSelection[
|
|
|
- i].SampleType, null)
|
|
|
- .then(res => {
|
|
|
- if (res.data.code === 0) {
|
|
|
- succeedMsg = res.data.message
|
|
|
- } else {
|
|
|
- errorMsg = res.data.message
|
|
|
- failedIds.push(_this.multipleSelection[i].Id)
|
|
|
- }
|
|
|
- count++
|
|
|
- // 最后一个请求结束
|
|
|
- if (count == _this.multipleSelection.length) {
|
|
|
- // 更新界面
|
|
|
- this.initData()
|
|
|
- // 全部删除成功
|
|
|
- if (failedIds.length == 0) {
|
|
|
- _this.$message({
|
|
|
- type: 'success',
|
|
|
- message: succeedMsg
|
|
|
- })
|
|
|
- } else {
|
|
|
- // 存在删除失败
|
|
|
- errorMsg = errorMsg + ',失败ID:' + failedIds.join(',')
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: errorMsg
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
}
|
|
|
- }).catch(err => {
|
|
|
- console.error(err)
|
|
|
+ _this.searchzuzhitreehandleChange()
|
|
|
})
|
|
|
- },
|
|
|
- selsampletypeChange () {
|
|
|
- // 获取特有扩展
|
|
|
- let _this = this
|
|
|
- if (_this.SampleType !== '') {
|
|
|
- _this.$axios.get('/sampletype/gettykzzd?SampleType=' + _this.SampleType, {})
|
|
|
- .then(res => {
|
|
|
- // response
|
|
|
- _this.STNoteField = []
|
|
|
- _this.typetykzlist = res.data
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- // 返回查询条件执行
|
|
|
- searchsampletypeChange () {
|
|
|
- // 获取特有扩展
|
|
|
- let _this = this
|
|
|
- if (_this.SampleType !== '') {
|
|
|
- _this.$axios.get('/sampletype/gettykzzd?SampleType=' + _this.SampleType, {})
|
|
|
- .then(res => {
|
|
|
- // response
|
|
|
- _this.typetykzlist = res.data
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- // ---------------------------------------------------
|
|
|
- // 自定义显示列
|
|
|
- checkedshowall () {
|
|
|
- let tc = 0
|
|
|
- for (var i = 0; i < this.showcolumn.length; i++) {
|
|
|
- if (this.showcolumn[i].show) {
|
|
|
- tc++
|
|
|
+ },
|
|
|
+ getextends () {
|
|
|
+ let _this = this
|
|
|
+ this.$axios.get('/sampleinput/getsampletype', {
|
|
|
+ _currentPage: -1
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ _this.sampletypes = res.data.items
|
|
|
+ if (store.get('samplewaitstoreseach').searchWithTemplate && store.get('samplewaitstoreseach').searchWithTemplate !==
|
|
|
+ '') { // 自定义查询
|
|
|
+ this.handleSearchCommand(store.get('samplewaitstoreseach').searchWithTemplate)
|
|
|
+ } else {
|
|
|
+ this.initData()
|
|
|
}
|
|
|
+ }).catch(() => {})
|
|
|
+ },
|
|
|
+ seachdata () {
|
|
|
+ this.currentPage = 1
|
|
|
+ this.initData()
|
|
|
+ this.dialogVisible = false
|
|
|
+ },
|
|
|
+ selsampletypeChange () {
|
|
|
+ // 获取特有扩展
|
|
|
+ let _this = this
|
|
|
+ if (_this.SampleType !== '') {
|
|
|
+ _this.$axios.get('/sampletype/gettykzzd?SampleType=' + _this.SampleType, {})
|
|
|
+ .then(res => {
|
|
|
+ _this.STNoteField = []
|
|
|
+ _this.typetykzlist = res.data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 返回查询条件执行
|
|
|
+ searchsampletypeChange () {
|
|
|
+ // 获取特有扩展
|
|
|
+ let _this = this
|
|
|
+ if (_this.SampleType !== '') {
|
|
|
+ _this.$axios.get('/sampletype/gettykzzd?SampleType=' + _this.SampleType, {})
|
|
|
+ .then(res => {
|
|
|
+ _this.typetykzlist = res.data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // ---------------------------------------------------
|
|
|
+ // 自定义显示列
|
|
|
+ checkedshowall () {
|
|
|
+ let tc = 0
|
|
|
+ for (var i = 0; i < this.showcolumn.length; i++) {
|
|
|
+ if (this.showcolumn[i].show) {
|
|
|
+ tc++
|
|
|
}
|
|
|
- if (tc > 0 && tc < this.showcolumn.length) {
|
|
|
- this.isIndeterminate = true
|
|
|
+ }
|
|
|
+ if (tc > 0 && tc < this.showcolumn.length) {
|
|
|
+ this.isIndeterminate = true
|
|
|
+ this.checkAll = false
|
|
|
+ } else {
|
|
|
+ this.isIndeterminate = false
|
|
|
+ if (tc === 0) {
|
|
|
this.checkAll = false
|
|
|
} else {
|
|
|
- this.isIndeterminate = false
|
|
|
- if (tc === 0) {
|
|
|
- this.checkAll = false
|
|
|
- } else {
|
|
|
- this.checkAll = true
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- handleCheckAllChange (val) {
|
|
|
- for (var i = 0; i < this.showcolumn.length; i++) {
|
|
|
- this.showcolumn[i].show = val
|
|
|
+ this.checkAll = true
|
|
|
}
|
|
|
- },
|
|
|
- // 自定义显示列保存操作
|
|
|
- saveshowfiled () {
|
|
|
- store.set('samplearchivedshowcolumn', this.showcolumn)
|
|
|
- this.columndialogVisible = false
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '自定义显示列设置成功'
|
|
|
- })
|
|
|
- this.initData()
|
|
|
- },
|
|
|
- header_dragend (newWidth, oldWidth, column, event) {
|
|
|
- for (var i = 0; i < this.showcolumn.length; i++) {
|
|
|
- if (this.showcolumn[i].name === column.label) {
|
|
|
- this.showcolumn[i].columnwidth = newWidth
|
|
|
- store.set('samplearchivedshowcolumn', this.showcolumn)
|
|
|
- return
|
|
|
- }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleCheckAllChange (val) {
|
|
|
+ for (var i = 0; i < this.showcolumn.length; i++) {
|
|
|
+ this.showcolumn[i].show = val
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 自定义显示列保存操作
|
|
|
+ saveshowfiled () {
|
|
|
+ store.set('samplewaitstoreshowcolumn', this.showcolumn)
|
|
|
+ this.columndialogVisible = false
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '自定义显示列设置成功'
|
|
|
+ })
|
|
|
+ this.initData()
|
|
|
+ },
|
|
|
+ header_dragend (newWidth, oldWidth, column, event) {
|
|
|
+ for (var i = 0; i < this.showcolumn.length; i++) {
|
|
|
+ if (this.showcolumn[i].name === column.label) {
|
|
|
+ this.showcolumn[i].columnwidth = newWidth
|
|
|
+ store.set('samplewaitstoreshowcolumn', this.showcolumn)
|
|
|
+ return
|
|
|
}
|
|
|
- },
|
|
|
- // ----------------------------------------------------------------
|
|
|
- // 自定义查询
|
|
|
- /* handleSearchCommand (command) {
|
|
|
- if (command == 'search') {
|
|
|
- this.dialogVisible = true
|
|
|
- } else if (command == 'clear') {
|
|
|
- this.clearSearch()
|
|
|
- } else if (command == '编辑') {
|
|
|
- /!* this.searchDialogVisible = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // ----------------------------------------------------------------
|
|
|
+ // 自定义查询
|
|
|
+ handleSearchCommand (command) {
|
|
|
+ if (command == 'search') {
|
|
|
+ this.dialogVisible = true
|
|
|
+ } else if (command == 'clear') {
|
|
|
+ this.clearSearch()
|
|
|
+ } else if (command == '编辑') {
|
|
|
+ // this.$refs.customsearchdialog.creatpage()
|
|
|
+ // this.$refs.customsearchdialog.customsearchdialogVisable = true
|
|
|
+ // this.searchcolumn = this.showcolumn.filter(function (e) {
|
|
|
+ // return e.filed !== 'PositionInfo'
|
|
|
+ // })
|
|
|
+
|
|
|
+ /* this.searchDialogVisible = true
|
|
|
this.searchcolumn = this.showcolumn.filter(function (e) {
|
|
|
return e.filed != "Location"
|
|
|
- }) *!/
|
|
|
- this.$refs.samplesearchdialog.creatpage()
|
|
|
- this.$refs.samplesearchdialog.samplesearchdialogVisable = true
|
|
|
- } else {
|
|
|
- this.currentSearchTemplate = command
|
|
|
- let searchmodel = {
|
|
|
- searchWithTemplate: command
|
|
|
- }
|
|
|
- store.set('samplearchivedseach', searchmodel)
|
|
|
- this.searchWithTemplate(command)
|
|
|
- }
|
|
|
- }, */
|
|
|
- handleSearchCommand (command) {
|
|
|
- if (command == 'search') {
|
|
|
- this.dialogVisible = true
|
|
|
- } else if (command == 'clear') {
|
|
|
- this.clearSearch()
|
|
|
- } else if (command == '编辑') {
|
|
|
- // this.$refs.customsearchdialog.creatpage()
|
|
|
- // this.$refs.customsearchdialog.customsearchdialogVisable = true
|
|
|
- // this.searchcolumn = this.showcolumn.filter(function (e) {
|
|
|
- // return e.filed !== 'PositionInfo'
|
|
|
- // })
|
|
|
-
|
|
|
- /* this.searchDialogVisible = true
|
|
|
- this.searchcolumn = this.showcolumn.filter(function (e) {
|
|
|
- return e.filed != "Location"
|
|
|
- }) */
|
|
|
+ }) */
|
|
|
|
|
|
- this.$refs.samplesearchdialog.creatpage()
|
|
|
- this.$refs.samplesearchdialog.samplesearchdialogVisable = true
|
|
|
- } else {
|
|
|
- let params = {
|
|
|
- currentPage: 1,
|
|
|
- size: 200,
|
|
|
- template: command,
|
|
|
- isDelete: 0,
|
|
|
- type: 'Sample',
|
|
|
- status: 'archived'
|
|
|
- }
|
|
|
- console.log(params)
|
|
|
- service.postRequest('dashoo.biobank.bee-0.1', 'SampleRelated', 'SampleSearchByTemplate', params).then(res => {
|
|
|
- this.list = res.data.list
|
|
|
- this.currentItemCount = res.data.total
|
|
|
- })
|
|
|
- this.currentSearchTemplate = command
|
|
|
+ this.$refs.samplesearchdialog.creatpage()
|
|
|
+ this.$refs.samplesearchdialog.samplesearchdialogVisable = true
|
|
|
+ } else {
|
|
|
+ let params = {
|
|
|
+ currentPage: 1,
|
|
|
+ size: 200,
|
|
|
+ template: command,
|
|
|
+ isDelete: 0,
|
|
|
+ type: 'Sample',
|
|
|
+ status: 'waitingstore'
|
|
|
}
|
|
|
- },
|
|
|
- // 添加自定义搜索
|
|
|
- addSearchTab (name) {
|
|
|
- for (let i = 0; i < this.searchTemplates.length; i++) {
|
|
|
- if (this.searchTemplates[i].Name == name) {
|
|
|
- this.$message('名称已经存在')
|
|
|
- return
|
|
|
- }
|
|
|
+ console.log(params)
|
|
|
+ service.postRequest('dashoo.biobank.bee-0.1', 'SampleRelated', 'SampleSearchByTemplate', params).then(res => {
|
|
|
+ this.List = res.data.list
|
|
|
+ this.currentItemCount = res.data.total
|
|
|
+ })
|
|
|
+ this.currentSearchTemplate = command
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 添加自定义搜索
|
|
|
+ addSearchTab (name) {
|
|
|
+ for (let i = 0; i < this.searchTemplates.length; i++) {
|
|
|
+ if (this.searchTemplates[i].Name == name) {
|
|
|
+ this.$message('名称已经存在')
|
|
|
+ return
|
|
|
}
|
|
|
- this.searchTemplates.push({
|
|
|
- Name: name,
|
|
|
- Fields: []
|
|
|
- }),
|
|
|
+ }
|
|
|
+ this.searchTemplates.push({
|
|
|
+ Name: name,
|
|
|
+ Fields: []
|
|
|
+ }),
|
|
|
this.currentSearchTemplateName = name
|
|
|
|
|
|
- for (let i = 0; i < this.searchTemplates.length; i++) {
|
|
|
- if (this.searchTemplates[i].Name == this.currentSearchTemplateName) {
|
|
|
- this.searchTableData = this.getSearchTableData(this.searchTemplates[i].Fields)
|
|
|
- }
|
|
|
+ for (let i = 0; i < this.searchTemplates.length; i++) {
|
|
|
+ if (this.searchTemplates[i].Name == this.currentSearchTemplateName) {
|
|
|
+ this.searchTableData = this.getSearchTableData(this.searchTemplates[i].Fields)
|
|
|
}
|
|
|
- },
|
|
|
- removeSearchTab (targetName) {
|
|
|
- let _this = this
|
|
|
- this.$axios.delete('/sampleinput/searchTemplate?name=' + targetName, {})
|
|
|
- .then(res => {
|
|
|
- if (res.data.code == 0) {
|
|
|
- let tabs = _this.searchTemplates
|
|
|
- let activeName = _this.currentSearchTemplateName
|
|
|
- if (activeName === targetName) {
|
|
|
- tabs.forEach((tab, index) => {
|
|
|
- if (tab.Name === targetName) {
|
|
|
- let nextTab = tabs[index + 1] || tabs[index - 1]
|
|
|
- if (nextTab) {
|
|
|
- activeName = nextTab.Name
|
|
|
- _this.searchTableData = this.getSearchTableData(nextTab.Fields)
|
|
|
- }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ removeSearchTab (targetName) {
|
|
|
+ let _this = this
|
|
|
+ this.$axios.delete('/sampleinput/searchTemplate?name=' + targetName, {})
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ let tabs = _this.searchTemplates
|
|
|
+ let activeName = _this.currentSearchTemplateName
|
|
|
+ if (activeName === targetName) {
|
|
|
+ tabs.forEach((tab, index) => {
|
|
|
+ if (tab.Name === targetName) {
|
|
|
+ let nextTab = tabs[index + 1] || tabs[index - 1]
|
|
|
+ if (nextTab) {
|
|
|
+ activeName = nextTab.Name
|
|
|
+ _this.searchTableData = this.getSearchTableData(nextTab.Fields)
|
|
|
}
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- _this.currentSearchTemplateName = activeName
|
|
|
- _this.searchTemplates = tabs.filter(tab => tab.Name !== targetName)
|
|
|
- } else {
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: res.data.message
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- },
|
|
|
- // 添加自定义搜索详情
|
|
|
- addSearchField () {
|
|
|
- let searchValue
|
|
|
- for (let k in this.searchValue) {
|
|
|
- if (typeof this.searchValue[k] === 'number') {
|
|
|
- searchValue = this.searchValue[k]
|
|
|
- break
|
|
|
- } else if (this.searchValue[k] && this.searchValue[k].length > 0) {
|
|
|
- searchValue = this.searchValue[k]
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (!searchValue) {
|
|
|
- this.$message('请输入检索数值或范围')
|
|
|
- return
|
|
|
- }
|
|
|
|
|
|
- let s = ''
|
|
|
- if (searchValue instanceof Array && searchValue.length > 0) {
|
|
|
- if (searchValue[0] instanceof Date) {
|
|
|
- let arr = []
|
|
|
- for (let j = 0; j < searchValue.length; j++) {
|
|
|
- arr.push(this.formatDateTime(searchValue[j]))
|
|
|
- }
|
|
|
- s = arr.join('--')
|
|
|
+ _this.currentSearchTemplateName = activeName
|
|
|
+ _this.searchTemplates = tabs.filter(tab => tab.Name !== targetName)
|
|
|
} else {
|
|
|
- s = searchValue[searchValue.length - 1]
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
}
|
|
|
- } else {
|
|
|
- s = searchValue
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 添加自定义搜索详情
|
|
|
+ addSearchField () {
|
|
|
+ let searchValue
|
|
|
+ for (let k in this.searchValue) {
|
|
|
+ if (typeof this.searchValue[k] === 'number') {
|
|
|
+ searchValue = this.searchValue[k]
|
|
|
+ break
|
|
|
+ } else if (this.searchValue[k] && this.searchValue[k].length > 0) {
|
|
|
+ searchValue = this.searchValue[k]
|
|
|
+ break
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- for (let i = 0; i < this.searchTemplates.length; i++) {
|
|
|
- if (this.searchTemplates[i].Name == this.currentSearchTemplateName) {
|
|
|
- for (let index in this.searchTemplates[i].Fields) {
|
|
|
- let field = this.searchTemplates[i].Fields[index]
|
|
|
- if (field.Field == this.searchField && field.Value == this.searchValue && field.OrAnd == this.orAnd) {
|
|
|
- this.$message('此查询条件已经存在')
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
+ if (!searchValue) {
|
|
|
+ this.$message('请输入检索数值或范围')
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
- this.searchTemplates[i].Fields.push({
|
|
|
- Field: this.searchField,
|
|
|
- Value: s + '',
|
|
|
- OrAnd: this.orAnd,
|
|
|
- Name: this.getFieldName(this.searchField)
|
|
|
- })
|
|
|
- this.searchTableData = this.getSearchTableData(this.searchTemplates[i].Fields)
|
|
|
- break
|
|
|
+ let s = ''
|
|
|
+ if (searchValue instanceof Array && searchValue.length > 0) {
|
|
|
+ if (searchValue[0] instanceof Date) {
|
|
|
+ let arr = []
|
|
|
+ for (let j = 0; j < searchValue.length; j++) {
|
|
|
+ arr.push(this.formatDateTime(searchValue[j]))
|
|
|
}
|
|
|
+ s = arr.join('--')
|
|
|
+ } else {
|
|
|
+ s = searchValue[searchValue.length - 1]
|
|
|
}
|
|
|
- },
|
|
|
- // 查询自定义搜索详情
|
|
|
- saveAndSearchWithTemplate () {
|
|
|
- let _this = this
|
|
|
- this.saveSearchTemplate(function () {
|
|
|
- _this.currentSearchTemplate = _this.currentSearchTemplateName
|
|
|
- _this.searchWithTemplate(_this.currentSearchTemplateName)
|
|
|
- })
|
|
|
- },
|
|
|
- // 保存自定义搜索详情
|
|
|
- saveSearchTemplate (cb) {
|
|
|
- let _this = this
|
|
|
- let template = JSON.stringify(this.searchTableData)
|
|
|
- this.$axios.put('/sampleinput/searchTemplate?name=' + this.currentSearchTemplateName, template)
|
|
|
- .then(res => {
|
|
|
- if (res.data.code == 0) {
|
|
|
- _this.$message({
|
|
|
- type: 'success',
|
|
|
- message: res.data.message
|
|
|
- })
|
|
|
- if (cb) {
|
|
|
- cb()
|
|
|
- }
|
|
|
- } else {
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: res.data.message
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- },
|
|
|
- deleteSearchField (v) {
|
|
|
- if (v.Name) {
|
|
|
- for (let i = 0; i < this.searchTemplates.length; i++) {
|
|
|
- if (this.searchTemplates[i].Name == this.currentSearchTemplateName) {
|
|
|
- this.searchTemplates[i].Fields = this.searchTemplates[i].Fields.filter(function (ele) {
|
|
|
- return !(ele.Value == v.Value && ele.Field == v.Field && ele.OrAnd == v.OrAnd)
|
|
|
- })
|
|
|
- this.searchTableData = this.getSearchTableData(this.searchTemplates[i].Fields)
|
|
|
- break
|
|
|
+ } else {
|
|
|
+ s = searchValue
|
|
|
+ }
|
|
|
+
|
|
|
+ for (let i = 0; i < this.searchTemplates.length; i++) {
|
|
|
+ if (this.searchTemplates[i].Name == this.currentSearchTemplateName) {
|
|
|
+ for (let index in this.searchTemplates[i].Fields) {
|
|
|
+ let field = this.searchTemplates[i].Fields[index]
|
|
|
+ if (field.Field == this.searchField && field.Value == this.searchValue && field.OrAnd == this.orAnd) {
|
|
|
+ this.$message('此查询条件已经存在')
|
|
|
+ return
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- },
|
|
|
- searchWithTemplate (name) {
|
|
|
- console.log(name)
|
|
|
- this.searchDialogVisible = false
|
|
|
-
|
|
|
- let params = {
|
|
|
- _currentPage: this.currentPage,
|
|
|
- _size: this.size
|
|
|
|
|
|
+ this.searchTemplates[i].Fields.push({
|
|
|
+ Field: this.searchField,
|
|
|
+ Value: s + '',
|
|
|
+ OrAnd: this.orAnd,
|
|
|
+ Name: this.getFieldName(this.searchField)
|
|
|
+ })
|
|
|
+ this.searchTableData = this.getSearchTableData(this.searchTemplates[i].Fields)
|
|
|
+ break
|
|
|
}
|
|
|
- let _this = this
|
|
|
- this.$axios.get('/samplesfiles/search?name=' + name, {
|
|
|
- params
|
|
|
- })
|
|
|
- .then(res => {
|
|
|
- console.log(res.data.items)
|
|
|
- if (res.data.items) {
|
|
|
- _this.list = res.data.items
|
|
|
- _this.currentItemCount = res.data.currentItemCount
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 查询自定义搜索详情
|
|
|
+ saveAndSearchWithTemplate () {
|
|
|
+ let _this = this
|
|
|
+ this.saveSearchTemplate(function () {
|
|
|
+ _this.currentSearchTemplate = _this.currentSearchTemplateName
|
|
|
+ _this.searchWithTemplate(_this.currentSearchTemplateName)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 保存自定义搜索详情
|
|
|
+ saveSearchTemplate (cb) {
|
|
|
+ let _this = this
|
|
|
+ let template = JSON.stringify(this.searchTableData)
|
|
|
+ this.$axios.put('/sampleinput/searchTemplate?name=' + this.currentSearchTemplateName, template)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ if (cb) {
|
|
|
+ cb()
|
|
|
}
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- },
|
|
|
- getSearchTableData (searchFields) {
|
|
|
- let data = searchFields.map(function (ele) {
|
|
|
- if (ele['OrAnd'] == 'or') {
|
|
|
- ele['Guanxi'] = '或者'
|
|
|
} else {
|
|
|
- ele['Guanxi'] = '并且'
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
}
|
|
|
- return ele
|
|
|
})
|
|
|
-
|
|
|
- return data || []
|
|
|
- },
|
|
|
- clickmodeltypetag (val) {
|
|
|
- this.currentSearchTemplateName = val.getAttribute('id')
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ deleteSearchField (v) {
|
|
|
+ if (v.Name) {
|
|
|
for (let i = 0; i < this.searchTemplates.length; i++) {
|
|
|
if (this.searchTemplates[i].Name == this.currentSearchTemplateName) {
|
|
|
+ this.searchTemplates[i].Fields = this.searchTemplates[i].Fields.filter(function (ele) {
|
|
|
+ return !(ele.Value == v.Value && ele.Field == v.Field && ele.OrAnd == v.OrAnd)
|
|
|
+ })
|
|
|
this.searchTableData = this.getSearchTableData(this.searchTemplates[i].Fields)
|
|
|
+ break
|
|
|
}
|
|
|
}
|
|
|
- },
|
|
|
- getAllSearchTab () {
|
|
|
- let _this = this
|
|
|
- // getSearchTemplate({ Type: 'sample' })
|
|
|
- service.postRequest('dashoo.biobank.bee-0.1', 'SampleRelated', 'GetSearchTemplate', {type: 'Sample'})
|
|
|
- .then(res => {
|
|
|
- console.log('res.data', res.data)
|
|
|
- if (res.data && res.data.length > 0) {
|
|
|
- _this.searchTemplates = res.data.map(function (e) {
|
|
|
- e.Fields = JSON.parse(e.template)
|
|
|
- return e
|
|
|
- })
|
|
|
- console.log('_this.searchTemplates', _this.searchTemplates)
|
|
|
- // //当前搜索模板的I
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 关闭自定义查询
|
|
|
+ closeDialog () {
|
|
|
+ this.getAllSearchTab()
|
|
|
+ },
|
|
|
+ searchWithTemplate (name) {
|
|
|
+ console.log(name)
|
|
|
+ this.searchDialogVisible = false
|
|
|
|
|
|
- _this.currentSearchId = _this.searchTemplates[0].id
|
|
|
- _this.currentSearchTemplateName = _this.searchTemplates[0].name
|
|
|
- // console.log(_this.searchTemplates, 'searchTemplatessearchTemplatessearchTemplates')
|
|
|
- // console.log(this.searchTemplates[0].Fields, "this.searchTemplates[0].Fields")
|
|
|
- _this.searchTableData = this.getSearchTableData(this.searchTemplates[0].Fields)
|
|
|
- } else {
|
|
|
- // _this.$message({
|
|
|
- // type: 'warning',
|
|
|
- // message: res.data.message,
|
|
|
- // })
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- // handle error
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- },
|
|
|
- changeSearchField (val) {
|
|
|
- this.searchValue = {
|
|
|
- BarCode: '',
|
|
|
- SampleCode: '',
|
|
|
- SourceName: '',
|
|
|
- InnerCode: '',
|
|
|
- Name: '',
|
|
|
- CreateBy: '',
|
|
|
- CreateOn: [],
|
|
|
- StartDate: '', // 开始时期
|
|
|
- EndDate: '', // 结束时期
|
|
|
- SampleType: '',
|
|
|
- Validity: [],
|
|
|
- Capacity: '',
|
|
|
- Location: '',
|
|
|
- Extension: '',
|
|
|
- GroupName: ''
|
|
|
+ let params = {
|
|
|
+ _currentPage: this.currentPage,
|
|
|
+ _size: this.size
|
|
|
+
|
|
|
+ }
|
|
|
+ let _this = this
|
|
|
+ this.$axios.get('/samplesunsave/search?name=' + name, {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ console.log(res.data.items)
|
|
|
+ if (res.data.items) {
|
|
|
+ _this.list = res.data.items
|
|
|
+ _this.currentItemCount = res.data.currentItemCount
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getSearchTableData (searchFields) {
|
|
|
+ let data = searchFields.map(function (ele) {
|
|
|
+ if (ele['OrAnd'] == 'or') {
|
|
|
+ ele['Guanxi'] = '或者'
|
|
|
+ } else {
|
|
|
+ ele['Guanxi'] = '并且'
|
|
|
}
|
|
|
- },
|
|
|
- getFieldName (field) {
|
|
|
- for (let i = 0; i < this.showcolumn.length; i++) {
|
|
|
- if (this.showcolumn[i].filed == field) {
|
|
|
- return this.showcolumn[i].name
|
|
|
+ return ele
|
|
|
+ })
|
|
|
+
|
|
|
+ return data || []
|
|
|
+ },
|
|
|
+ clickmodeltypetag (val) {
|
|
|
+ this.currentSearchTemplateName = val.getAttribute('id')
|
|
|
+ for (let i = 0; i < this.searchTemplates.length; i++) {
|
|
|
+ if (this.searchTemplates[i].Name == this.currentSearchTemplateName) {
|
|
|
+ this.searchTableData = this.getSearchTableData(this.searchTemplates[i].Fields)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getAllSearchTab () {
|
|
|
+ let _this = this
|
|
|
+ // getSearchTemplate({ Type: 'sample' })
|
|
|
+ service.postRequest('dashoo.biobank.bee-0.1', 'SampleRelated', 'GetSearchTemplate', {type: 'Sample'})
|
|
|
+ .then(res => {
|
|
|
+ console.log('res.data', res.data)
|
|
|
+ if (res.data && res.data.length > 0) {
|
|
|
+ _this.searchTemplates = res.data.map(function (e) {
|
|
|
+ e.Fields = JSON.parse(e.template)
|
|
|
+ return e
|
|
|
+ })
|
|
|
+ console.log('_this.searchTemplates', _this.searchTemplates)
|
|
|
+ // //当前搜索模板的I
|
|
|
+
|
|
|
+ _this.currentSearchId = _this.searchTemplates[0].id
|
|
|
+ _this.currentSearchTemplateName = _this.searchTemplates[0].name
|
|
|
+ // console.log(_this.searchTemplates, 'searchTemplatessearchTemplatessearchTemplates')
|
|
|
+ // console.log(this.searchTemplates[0].Fields, "this.searchTemplates[0].Fields")
|
|
|
+ _this.searchTableData = this.getSearchTableData(this.searchTemplates[0].Fields)
|
|
|
+ } else {
|
|
|
+ // _this.$message({
|
|
|
+ // type: 'warning',
|
|
|
+ // message: res.data.message,
|
|
|
+ // })
|
|
|
}
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ changeSearchField (val) {
|
|
|
+ this.searchValue = {
|
|
|
+ BarCode: '',
|
|
|
+ SampleCode: '',
|
|
|
+ SourceName: '',
|
|
|
+ InnerCode: '',
|
|
|
+ Name: '',
|
|
|
+ CreateBy: '',
|
|
|
+ CreateOn: [],
|
|
|
+ StartDate: '', // 开始时期
|
|
|
+ EndDate: '', // 结束时期
|
|
|
+ selectedzuzhi: [],
|
|
|
+ SamplingSite: '',
|
|
|
+ SampleType: '',
|
|
|
+ Validity: [],
|
|
|
+ Capacity: '',
|
|
|
+ Location: '',
|
|
|
+ Extension: '',
|
|
|
+ GroupName: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getFieldName (field) {
|
|
|
+ for (let i = 0; i < this.showcolumn.length; i++) {
|
|
|
+ if (this.showcolumn[i].filed == field) {
|
|
|
+ return this.showcolumn[i].name
|
|
|
}
|
|
|
- return ''
|
|
|
- },
|
|
|
- // ----------------------------------------------------------------
|
|
|
- jstimehandle (val) {
|
|
|
- // if (val === '') {
|
|
|
- // return '----'
|
|
|
- // } else if (val === '0001-01-01T08:00:00+08:00') {
|
|
|
- // return '----'
|
|
|
- // } else if (val === '5000-01-01T23:59:59+08:00') {
|
|
|
- // return '永久'
|
|
|
- // } else {
|
|
|
- // val = val.replace('T', ' ')
|
|
|
- // return val.substring(0, 19)
|
|
|
- // }
|
|
|
- },
|
|
|
- Jstimehandle (val) {
|
|
|
- if (val === '') {
|
|
|
- return '----'
|
|
|
- } else if (val === '0001-01-01T08:00:00+08:00') {
|
|
|
- return '----'
|
|
|
- } else if (val === '5000-01-01T23:59:59+08:00') {
|
|
|
- return '永久'
|
|
|
- } else {
|
|
|
- val = val.replace('T', ' ')
|
|
|
- return val.substring(0, 10)
|
|
|
+ }
|
|
|
+ return ''
|
|
|
+ },
|
|
|
+ // ----------------------------------------------------------------
|
|
|
+ // 批量复存
|
|
|
+ batchsave () {
|
|
|
+ let _this = this
|
|
|
+ if (_this.multipleSelection.length < 1) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请选择要批量复存的样本'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ let flage = 0
|
|
|
+ let message = ''
|
|
|
+ for (let index = 0; index < _this.multipleSelection.length; index++) {
|
|
|
+ if (_this.multipleSelection[index].IState !== 5) {
|
|
|
+ message += _this.multipleSelection[index].BarCode + ' '
|
|
|
+ flage = 1
|
|
|
+ }
|
|
|
}
|
|
|
- },
|
|
|
- // 返回查询条件执行
|
|
|
- searchzuzhitreehandleChange (value) {
|
|
|
- if (this.selectedzuzhi.length > 0) {
|
|
|
- this.selectsigorg = this.selectedzuzhi[this.selectedzuzhi.length - 1] + ''
|
|
|
- this.$axios.get('/samplesite/getsitebyfcode?code=' + this.selectsigorg, {})
|
|
|
- .then(res => {
|
|
|
- this.samplesitenames = res.data
|
|
|
- }).catch(() => {})
|
|
|
+ if (flage == 1) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '所选样本中包含无位置信息的样本:' + message
|
|
|
+ })
|
|
|
+ return
|
|
|
}
|
|
|
- },
|
|
|
- // 导出样本
|
|
|
- handleExportsamplesCommand (command) {
|
|
|
- let _this = this
|
|
|
- if (command == 'exportchosen') { // 导出所选数据
|
|
|
- if (_this.multipleSelection.length < 1) {
|
|
|
+ }
|
|
|
+ this.$axios.put('/samplesunsave/batchresample', _this.multipleSelection)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
_this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '请选择要导出的样本'
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
})
|
|
|
- return
|
|
|
- }
|
|
|
- _this.exportsamples('exportchosen')
|
|
|
- } else if (command == 'exportpage') { // 导出当前页数据
|
|
|
- if (_this.list.length < 1) {
|
|
|
+ } else {
|
|
|
_this.$message({
|
|
|
type: 'warning',
|
|
|
- message: '当前页无样本'
|
|
|
+ message: res.data.message
|
|
|
})
|
|
|
- return
|
|
|
}
|
|
|
- _this.exportsamples('exportpage')
|
|
|
- } else if (command == 'exportall') { // 导出所有数据
|
|
|
- _this.$confirm('此操作将导出所有满足条件的数据!是否继续导出?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'info'
|
|
|
- }).then(() => {
|
|
|
- _this.exportsamples()
|
|
|
- }).catch(() => {})
|
|
|
+ _this.initData()
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 清空查询数据
|
|
|
+ clearSearch () {
|
|
|
+ this.BarCode = ''
|
|
|
+ this.SampleCode = ''
|
|
|
+ this.SourceName = ''
|
|
|
+ this.DItem = ''
|
|
|
+ this.EquipmentIds = ''
|
|
|
+ this.InnerCode = ''
|
|
|
+ this.Name = ''
|
|
|
+ this.CreateBy = ''
|
|
|
+ this.CreateOn = []
|
|
|
+ this.SampleType = ''
|
|
|
+ this.STNoteField = ''
|
|
|
+ this.Stnotevalue = ''
|
|
|
+ this.Validity = []
|
|
|
+ this.Noteitem = []
|
|
|
+ this.Noteitemvalue = ''
|
|
|
+ this.currentPage = 1
|
|
|
+ this.GroupName = ''
|
|
|
+ this.initData()
|
|
|
+ },
|
|
|
+ // 导出样本
|
|
|
+ handleExportsamplesCommand (command) {
|
|
|
+ let _this = this
|
|
|
+ if (command == 'exportchosen') { // 导出所选数据
|
|
|
+ if (_this.multipleSelection.length < 1) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请选择要导出的样本'
|
|
|
+ })
|
|
|
+ return
|
|
|
}
|
|
|
- },
|
|
|
- exportsamples (val) {
|
|
|
- let _this = this
|
|
|
- // 显示列
|
|
|
- let showcolumnarr = []
|
|
|
- let showcolumnnamearr = []
|
|
|
- let id = ''
|
|
|
- for (var i = 0; i < _this.showcolumn.length; i++) {
|
|
|
- if (_this.showcolumn[i].show) {
|
|
|
- showcolumnarr.push(_this.showcolumn[i].filed)
|
|
|
- showcolumnnamearr.push(_this.showcolumn[i].name.replace(/,/g, ','))
|
|
|
- }
|
|
|
+ _this.exportsamples('exportchosen')
|
|
|
+ } else if (command == 'exportpage') { // 导出当前页数据
|
|
|
+ if (_this.list.length < 1) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '当前页无样本'
|
|
|
+ })
|
|
|
+ return
|
|
|
}
|
|
|
- let params = {
|
|
|
- _currentPage: this.currentPage,
|
|
|
- _size: this.size,
|
|
|
- BarCode: this.BarCode,
|
|
|
- SampleCode: this.SampleCode,
|
|
|
- SampleType: this.SampleType,
|
|
|
- Stnotevalue: this.Stnotevalue,
|
|
|
- STNoteField: this.STNoteField,
|
|
|
- Noteitemvalue: this.Noteitemvalue,
|
|
|
- Noteitem: this.Noteitem,
|
|
|
- CreateBy: this.CreateBy,
|
|
|
- SourceName: this.SourceName,
|
|
|
- Name: this.Name,
|
|
|
- Validity: this.Validity,
|
|
|
- InnerCode: this.InnerCode,
|
|
|
- GroupName: this.GroupName,
|
|
|
- showcolumnarr: showcolumnarr + '',
|
|
|
- showcolumnnamearr: showcolumnnamearr + '',
|
|
|
- ExportFlag: 'archived'
|
|
|
+ _this.exportsamples('exportpage')
|
|
|
+ } else if (command == 'exportall') { // 导出所有数据
|
|
|
+ _this.$confirm('此操作将导出所有满足条件的数据!是否继续导出?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'info'
|
|
|
+ }).then(() => {
|
|
|
+ _this.exportsamples()
|
|
|
+ }).catch(() => {})
|
|
|
+ }
|
|
|
+ },
|
|
|
+ exportsamples (val) {
|
|
|
+ let _this = this
|
|
|
+ // 显示列
|
|
|
+ let showcolumnarr = []
|
|
|
+ let showcolumnnamearr = []
|
|
|
+ let id = ''
|
|
|
+ for (var i = 0; i < _this.showcolumn.length; i++) {
|
|
|
+ if (_this.showcolumn[i].show) {
|
|
|
+ showcolumnarr.push(_this.showcolumn[i].filed)
|
|
|
+ showcolumnnamearr.push(_this.showcolumn[i].name.replace(/,/g, ','))
|
|
|
}
|
|
|
- if (this.CreateOn && this.CreateOn.length === 2) {
|
|
|
- let params2 = {
|
|
|
- CreateOnstart: this.CreateOn[0] / 1000,
|
|
|
- CreateOnend: this.CreateOn[1] / 1000
|
|
|
- }
|
|
|
- params = Object.assign(params, params2)
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ _currentPage: this.currentPage,
|
|
|
+ _size: this.size,
|
|
|
+ BarCode: this.BarCode,
|
|
|
+ SampleCode: this.SampleCode,
|
|
|
+ SampleType: this.SampleType,
|
|
|
+ Stnotevalue: this.Stnotevalue,
|
|
|
+ STNoteField: this.STNoteField,
|
|
|
+ Noteitemvalue: this.Noteitemvalue,
|
|
|
+ Noteitem: this.Noteitem,
|
|
|
+ DItem: this.DItem,
|
|
|
+ EquipmentIds: this.EquipmentIds,
|
|
|
+ CreateBy: this.CreateBy,
|
|
|
+ SourceName: this.SourceName,
|
|
|
+ Name: this.Name,
|
|
|
+ Validity: this.Validity,
|
|
|
+ InnerCode: this.InnerCode,
|
|
|
+ GroupName: this.GroupName,
|
|
|
+ showcolumnarr: showcolumnarr + '',
|
|
|
+ showcolumnnamearr: showcolumnnamearr + '',
|
|
|
+ ExportFlag: 'waitingstore'
|
|
|
+ }
|
|
|
+ if (this.CreateOn && this.CreateOn.length === 2) {
|
|
|
+ let params2 = {
|
|
|
+ CreateOnstart: this.CreateOn[0] / 1000,
|
|
|
+ CreateOnend: this.CreateOn[1] / 1000
|
|
|
}
|
|
|
- if (_this.Validity && _this.Validity.length === 2) {
|
|
|
- let params3 = {
|
|
|
- Validitystart: _this.Validity[0] / 1000,
|
|
|
- Validityend: _this.Validity[1] / 1000
|
|
|
- }
|
|
|
- params = Object.assign(params, params3)
|
|
|
+ params = Object.assign(params, params2)
|
|
|
+ }
|
|
|
+ if (_this.Validity && _this.Validity.length === 2) {
|
|
|
+ let params3 = {
|
|
|
+ Validitystart: _this.Validity[0] / 1000,
|
|
|
+ Validityend: _this.Validity[1] / 1000
|
|
|
}
|
|
|
- // 导出所选样本
|
|
|
- if (val == 'exportchosen') {
|
|
|
- for (var i = 0; i < _this.multipleSelection.length; i++) {
|
|
|
- if (i == _this.multipleSelection.length - 1) {
|
|
|
- id += _this.multipleSelection[i].Id
|
|
|
- } else {
|
|
|
- id += _this.multipleSelection[i].Id + ','
|
|
|
- }
|
|
|
- }
|
|
|
- let paramsid = {
|
|
|
- Id: id
|
|
|
+ params = Object.assign(params, params3)
|
|
|
+ }
|
|
|
+ // 导出所选样本
|
|
|
+ if (val == 'exportchosen') {
|
|
|
+ for (var i = 0; i < _this.multipleSelection.length; i++) {
|
|
|
+ if (i == _this.multipleSelection.length - 1) {
|
|
|
+ id += _this.multipleSelection[i].Id
|
|
|
+ } else {
|
|
|
+ id += _this.multipleSelection[i].Id + ','
|
|
|
}
|
|
|
- params = Object.assign(params, paramsid)
|
|
|
}
|
|
|
- // 导出当前页样本
|
|
|
- if (val == 'exportpage') {
|
|
|
- for (var i = 0; i < _this.list.length; i++) {
|
|
|
- if (i == _this.list.length - 1) {
|
|
|
- id += _this.list[i].Id
|
|
|
- } else {
|
|
|
- id += _this.list[i].Id + ','
|
|
|
- }
|
|
|
- }
|
|
|
- let paramsid = {
|
|
|
- Id: id
|
|
|
+ let paramsid = {
|
|
|
+ Id: id
|
|
|
+ }
|
|
|
+ params = Object.assign(params, paramsid)
|
|
|
+ }
|
|
|
+ // 导出当前页样本
|
|
|
+ if (val == 'exportpage') {
|
|
|
+ for (var i = 0; i < _this.list.length; i++) {
|
|
|
+ if (i == _this.list.length - 1) {
|
|
|
+ id += _this.list[i].Id
|
|
|
+ } else {
|
|
|
+ id += _this.list[i].Id + ','
|
|
|
}
|
|
|
- params = Object.assign(params, paramsid)
|
|
|
}
|
|
|
- _this.$axios.get('/sampleinput/exportexcel', {
|
|
|
- params
|
|
|
- })
|
|
|
- .then(res => {
|
|
|
- window.location = 'http://' + res.data
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- },
|
|
|
- // 样本条码批量打印
|
|
|
- batchprint () {
|
|
|
- let _this = this
|
|
|
- if (_this.multipleSelection.length < 1) {
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '请选择要批量打印的样本'
|
|
|
- })
|
|
|
- return
|
|
|
+ let paramsid = {
|
|
|
+ Id: id
|
|
|
}
|
|
|
- this.$axios.get('/printscheme/getdefaultprintscheme', {})
|
|
|
- .then(res => {
|
|
|
- if (res.data && res.data !== '') {
|
|
|
- let idstring = ''
|
|
|
- for (var i = 0; i < _this.multipleSelection.length; i++) {
|
|
|
- idstring += _this.multipleSelection[i].Id + ';'
|
|
|
- }
|
|
|
- idstring = idstring.substring(0, idstring.length - 1)
|
|
|
- // 执行打印操作
|
|
|
- window.PrintReport(res.data, `animalarchivedbatch,${this.authUser.Profile.AccCode},${idstring}`)
|
|
|
- } else {
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '未设置默认打印方案,可在"系统设置"-"打印方案"中进行设置!'
|
|
|
- })
|
|
|
+ params = Object.assign(params, paramsid)
|
|
|
+ }
|
|
|
+ _this.$axios.get('/sampleinput/exportexcel', {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ window.location = 'http://' + res.data
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 样本条码批量打印
|
|
|
+ batchprint () {
|
|
|
+ let _this = this
|
|
|
+ if (_this.multipleSelection.length < 1) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请选择要批量打印的样本'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$axios.get('/printscheme/getdefaultprintscheme', {})
|
|
|
+ .then(res => {
|
|
|
+ if (res.data && res.data !== '') {
|
|
|
+ let idstring = ''
|
|
|
+ for (var i = 0; i < _this.multipleSelection.length; i++) {
|
|
|
+ idstring += _this.multipleSelection[i].Id + ';'
|
|
|
}
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- },
|
|
|
- // 清空查询数据
|
|
|
- clearSearch () {
|
|
|
- this.BarCode = ''
|
|
|
- this.SampleCode = ''
|
|
|
- this.SourceName = ''
|
|
|
- this.InnerCode = ''
|
|
|
- this.Name = ''
|
|
|
- this.EquipmentIds = ''
|
|
|
- this.CreateBy = ''
|
|
|
- this.CreateOn = []
|
|
|
- this.SampleType = ''
|
|
|
- this.STNoteField = ''
|
|
|
- this.Stnotevalue = ''
|
|
|
- this.Validity = []
|
|
|
- this.Noteitem = []
|
|
|
- this.Noteitemvalue = ''
|
|
|
- this.currentPage = 1
|
|
|
- this.GroupName = ''
|
|
|
+ idstring = idstring.substring(0, idstring.length - 1)
|
|
|
+ // 执行打印操作
|
|
|
+ window.PrintReport(res.data, `animalsamplesbatch,${this.authUser.Profile.AccCode},${idstring}`)
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '未设置默认打印方案,可在"系统设置"-"打印方案"中进行设置!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleSizeChange (value) {
|
|
|
+ this.size = value
|
|
|
+ this.currentPage = 1
|
|
|
+ if (this.currentSearchTemplate) {
|
|
|
+ this.searchWithTemplate(this.currentSearchTemplate)
|
|
|
+ } else {
|
|
|
this.initData()
|
|
|
- },
|
|
|
- deleteRow (index, rows) {
|
|
|
- rows.splice(index, 1)
|
|
|
- },
|
|
|
- handleSizeChange (value) {
|
|
|
- this.size = value
|
|
|
- this.currentPage = 1
|
|
|
- if (this.currentSearchTemplate) {
|
|
|
- this.searchWithTemplate(this.currentSearchTemplate)
|
|
|
- } else {
|
|
|
- this.initData()
|
|
|
- }
|
|
|
- },
|
|
|
- handleCurrentChange (value) {
|
|
|
- this.currentPage = value
|
|
|
- if (this.currentSearchTemplate) {
|
|
|
- this.searchWithTemplate(this.currentSearchTemplate)
|
|
|
- } else {
|
|
|
- this.initData()
|
|
|
- }
|
|
|
- },
|
|
|
- handleChange (value) {
|
|
|
- console.log(value)
|
|
|
- },
|
|
|
- handleSelectionChange (val) {
|
|
|
- this.multipleSelection = val
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleCurrentChange (value) {
|
|
|
+ this.currentPage = value
|
|
|
+ if (this.currentSearchTemplate) {
|
|
|
+ this.searchWithTemplate(this.currentSearchTemplate)
|
|
|
+ } else {
|
|
|
+ this.initData()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleSelectionChange (val) {
|
|
|
+ this.multipleSelection = val
|
|
|
+ },
|
|
|
+ handleChange (value) {
|
|
|
+ console.log(value)
|
|
|
+ },
|
|
|
+ jstimehandle (val) {
|
|
|
+ if (val === '') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '0001-01-01T08:00:00+08:00') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '5000-01-01T23:59:59+08:00') {
|
|
|
+ return '永久'
|
|
|
+ } else {
|
|
|
+ val = val.replace('T', ' ')
|
|
|
+ return val.substring(0, 19)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ Jstimehandle (val) {
|
|
|
+ if (val === '') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '0001-01-01T08:00:00+08:00') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '5000-01-01T23:59:59+08:00') {
|
|
|
+ return '永久'
|
|
|
+ } else {
|
|
|
+ val = val.replace('T', ' ')
|
|
|
+ return val.substring(0, 10)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
- .el-pagination {
|
|
|
- margin: 1rem 0 2rem;
|
|
|
- text-align: right;
|
|
|
- }
|
|
|
-
|
|
|
- .sampshowfiledsort_ul_tags {
|
|
|
- padding-left: 12px;
|
|
|
- margin-top: -5px;
|
|
|
- }
|
|
|
+.el-pagination {
|
|
|
+ margin: 1rem 0 2rem;
|
|
|
+ text-align: right;
|
|
|
+}
|
|
|
|
|
|
- .sampshowfiledsort_ul_tags:after {
|
|
|
- clear: both;
|
|
|
- content: '';
|
|
|
- display: block;
|
|
|
- }
|
|
|
+.sampshowfiledsort_ul_tags {
|
|
|
+ padding-left: 12px;
|
|
|
+ margin-top: -5px;
|
|
|
+}
|
|
|
|
|
|
- .sampshowfiledsort_ul_tags li {
|
|
|
- color: #fff;
|
|
|
- float: left;
|
|
|
- margin: 2px 2px 3px 0;
|
|
|
- padding: 3px 3px;
|
|
|
- min-width: 15px;
|
|
|
- font-size: 16px;
|
|
|
- text-align: center;
|
|
|
- cursor: move;
|
|
|
- transition: all 1s;
|
|
|
- list-style-type: none;
|
|
|
- }
|
|
|
+.sampshowfiledsort_ul_tags:after {
|
|
|
+ clear: both;
|
|
|
+ content: '';
|
|
|
+ display: block;
|
|
|
+}
|
|
|
|
|
|
- .searchDialogLeftStyle {
|
|
|
- border: 1px #CCCCCC solid;
|
|
|
- overflow: auto;
|
|
|
- height: 500px;
|
|
|
- padding: 4px;
|
|
|
- }
|
|
|
-
|
|
|
- .searchDialogLeftStyle .el-tag__close {
|
|
|
- color: white;
|
|
|
- }
|
|
|
-
|
|
|
- .searchDialogRightStyle {
|
|
|
- border: 1px #CCCCCC solid;
|
|
|
- overflow: auto;
|
|
|
- height: 500px;
|
|
|
- padding: 4px;
|
|
|
- }
|
|
|
-
|
|
|
- .reporttag {
|
|
|
- cursor: pointer;
|
|
|
- margin-top: 7px;
|
|
|
- margin-left: 5px;
|
|
|
- font-size: 14px; //background-color:#EBEBEB;
|
|
|
- }
|
|
|
-
|
|
|
- .reportselect {
|
|
|
- background-color: #5CACEE;
|
|
|
- color: #1E90FF;
|
|
|
- }
|
|
|
+.sampshowfiledsort_ul_tags li {
|
|
|
+ color: #fff;
|
|
|
+ float: left;
|
|
|
+ margin: 2px 2px 3px 0;
|
|
|
+ padding: 3px 3px;
|
|
|
+ min-width: 15px;
|
|
|
+ font-size: 16px;
|
|
|
+ text-align: center;
|
|
|
+ cursor: move;
|
|
|
+ transition: all 1s;
|
|
|
+ list-style-type: none;
|
|
|
+}
|
|
|
|
|
|
</style>
|
|
|
+
|