|
|
@@ -137,10 +137,10 @@
|
|
|
<el-form-item label="名称">
|
|
|
<el-input v-model="Name" placeholder="请输入名称" size="mini" style="width:100%"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="组织器官">
|
|
|
+ <!-- <el-form-item label="组织器官">
|
|
|
<el-cascader :options="zuzhitreelist" :props="sampinputtreeprops" change-on-select :show-all-levels="false"
|
|
|
v-model="selectedzuzhi" @change="zuzhitreehandleChange" placeholder="请选择组织" size="mini" style="width:100%"></el-cascader>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item label="特有扩展">
|
|
|
<el-select v-model="STNoteField" multiple placeholder="请选择" size="mini" style="width:100%">
|
|
|
<el-option v-for="item in typetykzlist" :label="item.Name" :value="item.FieldName" :key="item.FieldName"></el-option>
|
|
|
@@ -157,11 +157,11 @@
|
|
|
<el-form-item label="录入人">
|
|
|
<el-input v-model="CreateBy" placeholder="请输入录入人" size="mini" style="width:100%"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="取材部位">
|
|
|
+ <!-- <el-form-item label="取材部位">
|
|
|
<el-select v-model="SamplingSite" clearable placeholder="请选择" size="mini" style="width:100%">
|
|
|
<el-option v-for="item in samplesitenames" :label="item.Name" :value="item.Code" :key="item.Code"></el-option>
|
|
|
</el-select>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item label="特有检索">
|
|
|
<el-input v-model="Stnotevalue" placeholder="输入检索内容" size="mini" style="width:100%"></el-input>
|
|
|
</el-form-item>
|
|
|
@@ -319,7 +319,7 @@
|
|
|
components: {
|
|
|
draggable
|
|
|
},
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
dialogVisible: false,
|
|
|
currentItemCount: 0, // 当前页显示数量
|
|
|
@@ -337,7 +337,7 @@
|
|
|
selectsigorg: '', // 组织器官
|
|
|
CreateBy: '', // 录入人
|
|
|
CreateOn: [], // 录入时期
|
|
|
- GroupName: '', //所属分组
|
|
|
+ GroupName: '', // 所属分组
|
|
|
Name: '', // 名称
|
|
|
SourceName: '', // 样本来源
|
|
|
InnerCode: '', // 样本内码
|
|
|
@@ -357,17 +357,17 @@
|
|
|
// 新增
|
|
|
organlist: [],
|
|
|
typetykzlist: [], // 特有扩展
|
|
|
- multipleSelection: [], //多选框
|
|
|
+ multipleSelection: [], // 多选框
|
|
|
showcolumn: [], // 显示列
|
|
|
cachecols: [],
|
|
|
columndialogVisible: false, // 自定义显示列弹框
|
|
|
isIndeterminate: false,
|
|
|
checkAll: true,
|
|
|
searchDialogVisible: false, // 自定义搜索弹框
|
|
|
- searchTemplateName: "自定义搜索1",
|
|
|
+ searchTemplateName: '自定义搜索1',
|
|
|
searchTemplates: [],
|
|
|
- currentSearchTemplateName: "",
|
|
|
- searchField: "BarCode",
|
|
|
+ currentSearchTemplateName: '',
|
|
|
+ searchField: 'BarCode',
|
|
|
searchValue: {
|
|
|
BarCode: '',
|
|
|
SampleCode: '',
|
|
|
@@ -383,7 +383,7 @@
|
|
|
Capacity: '',
|
|
|
Location: '',
|
|
|
Extension: '',
|
|
|
- GroupName: '', //所属分组
|
|
|
+ GroupName: '' // 所属分组
|
|
|
},
|
|
|
sampinputtreeprops2: {
|
|
|
value: 'name',
|
|
|
@@ -392,79 +392,79 @@
|
|
|
},
|
|
|
selectedzuzhi2: [],
|
|
|
samplesitenames2: [], // 取材部位
|
|
|
- orAnd: "and",
|
|
|
+ orAnd: 'and',
|
|
|
orAndData: [{
|
|
|
- name: "并且",
|
|
|
- value: "and",
|
|
|
- },
|
|
|
- {
|
|
|
- name: "或者",
|
|
|
- value: "or",
|
|
|
- }
|
|
|
+ name: '并且',
|
|
|
+ value: 'and'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '或者',
|
|
|
+ value: 'or'
|
|
|
+ }
|
|
|
],
|
|
|
searchTableData: [],
|
|
|
searchcolumn: [], // 搜索列
|
|
|
currentSearchTemplate: '',
|
|
|
- acc: '',
|
|
|
+ acc: ''
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
+ 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('samplewaitstoreseach')
|
|
|
- if (typeof (searchmodel) != 'undefined') {
|
|
|
- if (searchmodel.BarCode && searchmodel.BarCode !== '') { //样本条码
|
|
|
+ if (typeof (searchmodel) !== 'undefined') {
|
|
|
+ if (searchmodel.BarCode && searchmodel.BarCode !== '') { // 样本条码
|
|
|
this.BarCode = searchmodel.BarCode
|
|
|
}
|
|
|
- if (searchmodel.SampleCode && searchmodel.SampleCode !== '') { //样本编码
|
|
|
+ if (searchmodel.SampleCode && searchmodel.SampleCode !== '') { // 样本编码
|
|
|
this.SampleCode = searchmodel.SampleCode
|
|
|
}
|
|
|
- if (searchmodel.SourceName && searchmodel.SourceName !== '') { //样本来源
|
|
|
+ if (searchmodel.SourceName && searchmodel.SourceName !== '') { // 样本来源
|
|
|
this.SourceName = searchmodel.SourceName
|
|
|
}
|
|
|
- if (searchmodel.InnerCode && searchmodel.InnerCode !== '') { //样本内码
|
|
|
+ if (searchmodel.InnerCode && searchmodel.InnerCode !== '') { // 样本内码
|
|
|
this.InnerCode = searchmodel.InnerCode
|
|
|
}
|
|
|
- if (searchmodel.Name && searchmodel.Name !== '') { //名称
|
|
|
+ if (searchmodel.Name && searchmodel.Name !== '') { // 名称
|
|
|
this.Name = searchmodel.Name
|
|
|
}
|
|
|
- if (searchmodel.CreateBy && searchmodel.CreateBy !== '') { //录入人
|
|
|
+ if (searchmodel.CreateBy && searchmodel.CreateBy !== '') { // 录入人
|
|
|
this.CreateBy = searchmodel.CreateBy
|
|
|
}
|
|
|
- if (searchmodel.CreateOn && searchmodel.CreateOn.length === 2) { //录入日期
|
|
|
+ if (searchmodel.CreateOn && searchmodel.CreateOn.length === 2) { // 录入日期
|
|
|
this.CreateOn = [new Date(searchmodel.CreateOn[0]), new Date(searchmodel.CreateOn[1])]
|
|
|
}
|
|
|
- if (searchmodel.SamplingOrgan && searchmodel.SamplingOrgan !== '') { //组织器官
|
|
|
+ if (searchmodel.SamplingOrgan && searchmodel.SamplingOrgan !== '') { // 组织器官
|
|
|
this.selectsigorg = searchmodel.SamplingOrgan
|
|
|
this.getparentcodebytopcode(searchmodel.SamplingOrgan)
|
|
|
// this.selectedzuzhi=searchmodel.SamplingOrgan
|
|
|
}
|
|
|
- if (searchmodel.SamplingSite && searchmodel.SamplingSite !== '') { //取材部位
|
|
|
+ if (searchmodel.SamplingSite && searchmodel.SamplingSite !== '') { // 取材部位
|
|
|
this.SamplingSite = searchmodel.SamplingSite
|
|
|
}
|
|
|
- if (searchmodel.SampleType && searchmodel.SampleType !== '') { //样本类型
|
|
|
+ if (searchmodel.SampleType && searchmodel.SampleType !== '') { // 样本类型
|
|
|
this.SampleType = searchmodel.SampleType
|
|
|
this.searchsampletypeChange()
|
|
|
}
|
|
|
- if (searchmodel.STNoteField && searchmodel.STNoteField.length > 0) { //特有扩展
|
|
|
+ if (searchmodel.STNoteField && searchmodel.STNoteField.length > 0) { // 特有扩展
|
|
|
this.STNoteField = searchmodel.STNoteField
|
|
|
}
|
|
|
- if (searchmodel.Stnotevalue && searchmodel.Stnotevalue !== '') { //特有检索内容
|
|
|
+ if (searchmodel.Stnotevalue && searchmodel.Stnotevalue !== '') { // 特有检索内容
|
|
|
this.Stnotevalue = searchmodel.Stnotevalue
|
|
|
}
|
|
|
- if (searchmodel.Validity && searchmodel.Validity.length === 2) { //有效日期
|
|
|
+ if (searchmodel.Validity && searchmodel.Validity.length === 2) { // 有效日期
|
|
|
this.Validity = [new Date(searchmodel.Validity[0]), new Date(searchmodel.Validity[1])]
|
|
|
}
|
|
|
- if (searchmodel.Noteitem && searchmodel.Noteitem.length > 0) { //公有扩展
|
|
|
+ if (searchmodel.Noteitem && searchmodel.Noteitem.length > 0) { // 公有扩展
|
|
|
this.Noteitem = searchmodel.Noteitem
|
|
|
}
|
|
|
- if (searchmodel.Noteitemvalue && searchmodel.Noteitemvalue !== '') { //公共检索内容
|
|
|
+ if (searchmodel.Noteitemvalue && searchmodel.Noteitemvalue !== '') { // 公共检索内容
|
|
|
this.Noteitemvalue = searchmodel.Noteitemvalue
|
|
|
}
|
|
|
- if (searchmodel.GroupName && searchmodel.GroupName !== '') { //所属分组
|
|
|
+ if (searchmodel.GroupName && searchmodel.GroupName !== '') { // 所属分组
|
|
|
this.GroupName = searchmodel.GroupName
|
|
|
}
|
|
|
}
|
|
|
@@ -473,7 +473,7 @@
|
|
|
}
|
|
|
|
|
|
this.cachecols = store.get('samplewaitstoreshowcolumn')
|
|
|
- //当前显示列无数据,使用已录入样本显示列数据
|
|
|
+ // 当前显示列无数据,使用已录入样本显示列数据
|
|
|
if (!(this.cachecols && this.cachecols !== '')) {
|
|
|
this.cachecols = store.get('sapminputshowcolumn')
|
|
|
}
|
|
|
@@ -552,14 +552,14 @@
|
|
|
this.checkedshowall()
|
|
|
this.getAllSearchTab()
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ mounted () {
|
|
|
let _this = this
|
|
|
window.clickmodeltypetag = function (val, e) {
|
|
|
_this.clickmodeltypetag(val)
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- initData() {
|
|
|
+ initData () {
|
|
|
this.currentSearchTemplate = ''
|
|
|
let _this = this
|
|
|
let params = {
|
|
|
@@ -589,11 +589,11 @@
|
|
|
}
|
|
|
params = Object.assign(params, params2)
|
|
|
}
|
|
|
- //返回时保存查找内容
|
|
|
+ // 返回时保存查找内容
|
|
|
store.set('samplewaitstoreseach', params)
|
|
|
this.$axios.get('/samplesunsave/list', {
|
|
|
- params
|
|
|
- })
|
|
|
+ params
|
|
|
+ })
|
|
|
.then(res => {
|
|
|
// response
|
|
|
_this.list = res.data.items
|
|
|
@@ -603,8 +603,8 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- //根据子code获取所有父code
|
|
|
- getparentcodebytopcode(v) {
|
|
|
+ // 根据子code获取所有父code
|
|
|
+ getparentcodebytopcode (v) {
|
|
|
let _this = this
|
|
|
_this.$axios.get('/sampleorgan/getparentcodebytopcode/' + v, {})
|
|
|
.then(res => {
|
|
|
@@ -618,7 +618,7 @@
|
|
|
_this.searchzuzhitreehandleChange()
|
|
|
})
|
|
|
},
|
|
|
- getOrgan() {
|
|
|
+ getOrgan () {
|
|
|
if (this.organlist.length === 0) {
|
|
|
let _this = this
|
|
|
_this.$axios.get('/shelfset/getorgan', {})
|
|
|
@@ -628,17 +628,17 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- getextends() {
|
|
|
+ getextends () {
|
|
|
let _this = this
|
|
|
this.$axios.get('/sampleinput/getsampletype', {
|
|
|
- _currentPage: -1
|
|
|
- })
|
|
|
+ _currentPage: -1
|
|
|
+ })
|
|
|
.then(res => {
|
|
|
_this.sampletypes = res.data.items
|
|
|
}).catch(() => {})
|
|
|
this.$axios.get('/sampleinput/getpublicsampletype', {
|
|
|
- _currentPage: -1
|
|
|
- })
|
|
|
+ _currentPage: -1
|
|
|
+ })
|
|
|
.then(res => {
|
|
|
_this.publicsampletypes = res.data.items
|
|
|
// 扩展列增加到显示列中
|
|
|
@@ -695,7 +695,7 @@
|
|
|
}
|
|
|
}
|
|
|
if (store.get('samplewaitstoreseach').searchWithTemplate && store.get('samplewaitstoreseach').searchWithTemplate !==
|
|
|
- '') { //自定义查询
|
|
|
+ '') { // 自定义查询
|
|
|
this.handleSearchCommand(store.get('samplewaitstoreseach').searchWithTemplate)
|
|
|
} else {
|
|
|
// initial data
|
|
|
@@ -703,13 +703,13 @@
|
|
|
}
|
|
|
}).catch(() => {})
|
|
|
this.$axios.get('/sampleinput/getoperations', {
|
|
|
- _currentPage: -1
|
|
|
- })
|
|
|
+ _currentPage: -1
|
|
|
+ })
|
|
|
.then(res => {
|
|
|
_this.zuzhitreelist = window.toolfun_gettreejson(res.data.items, 'id', 'pId', 'id,name,code')
|
|
|
}).catch(() => {})
|
|
|
},
|
|
|
- seachdata() {
|
|
|
+ seachdata () {
|
|
|
// selectedzuzhi
|
|
|
if (this.selectedzuzhi.length > 0) {
|
|
|
this.selectsigorg = this.selectedzuzhi[this.selectedzuzhi.length - 1] + ''
|
|
|
@@ -717,7 +717,7 @@
|
|
|
this.currentPage = 1
|
|
|
this.initData()
|
|
|
},
|
|
|
- selsampletypeChange() {
|
|
|
+ selsampletypeChange () {
|
|
|
// 获取特有扩展
|
|
|
let _this = this
|
|
|
if (_this.SampleType !== '') {
|
|
|
@@ -729,8 +729,8 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- //返回查询条件执行
|
|
|
- searchsampletypeChange() {
|
|
|
+ // 返回查询条件执行
|
|
|
+ searchsampletypeChange () {
|
|
|
// 获取特有扩展
|
|
|
let _this = this
|
|
|
if (_this.SampleType !== '') {
|
|
|
@@ -741,9 +741,9 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- //---------------------------------------------------
|
|
|
- //自定义显示列
|
|
|
- checkedshowall() {
|
|
|
+ // ---------------------------------------------------
|
|
|
+ // 自定义显示列
|
|
|
+ checkedshowall () {
|
|
|
let tc = 0
|
|
|
for (var i = 0; i < this.showcolumn.length; i++) {
|
|
|
if (this.showcolumn[i].show) {
|
|
|
@@ -762,13 +762,13 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- handleCheckAllChange(val) {
|
|
|
+ handleCheckAllChange (val) {
|
|
|
for (var i = 0; i < this.showcolumn.length; i++) {
|
|
|
this.showcolumn[i].show = val
|
|
|
}
|
|
|
},
|
|
|
// 自定义显示列保存操作
|
|
|
- saveshowfiled() {
|
|
|
+ saveshowfiled () {
|
|
|
store.set('samplewaitstoreshowcolumn', this.showcolumn)
|
|
|
this.columndialogVisible = false
|
|
|
this.$message({
|
|
|
@@ -777,7 +777,7 @@
|
|
|
})
|
|
|
this.initData()
|
|
|
},
|
|
|
- header_dragend(newWidth, oldWidth, column, event) {
|
|
|
+ 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
|
|
|
@@ -786,17 +786,17 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- //----------------------------------------------------------------
|
|
|
- //自定义查询
|
|
|
- handleSearchCommand(command) {
|
|
|
+ // ----------------------------------------------------------------
|
|
|
+ // 自定义查询
|
|
|
+ handleSearchCommand (command) {
|
|
|
if (command == 'search') {
|
|
|
this.dialogVisible = true
|
|
|
} else if (command == 'clear') {
|
|
|
this.clearSearch()
|
|
|
- } else if (command == "编辑") {
|
|
|
+ } else if (command == '编辑') {
|
|
|
this.searchDialogVisible = true
|
|
|
this.searchcolumn = this.showcolumn.filter(function (e) {
|
|
|
- return e.filed != "Location"
|
|
|
+ return e.filed != 'Location'
|
|
|
})
|
|
|
} else {
|
|
|
this.currentSearchTemplate = command
|
|
|
@@ -807,19 +807,19 @@
|
|
|
this.searchWithTemplate(command)
|
|
|
}
|
|
|
},
|
|
|
- //添加自定义搜索
|
|
|
- addSearchTab(name) {
|
|
|
+ // 添加自定义搜索
|
|
|
+ addSearchTab (name) {
|
|
|
for (let i = 0; i < this.searchTemplates.length; i++) {
|
|
|
if (this.searchTemplates[i].Name == name) {
|
|
|
- this.$message("名称已经存在")
|
|
|
+ this.$message('名称已经存在')
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
this.searchTemplates.push({
|
|
|
- Name: name,
|
|
|
- Fields: [],
|
|
|
- }),
|
|
|
- this.currentSearchTemplateName = name
|
|
|
+ Name: name,
|
|
|
+ Fields: []
|
|
|
+ }),
|
|
|
+ this.currentSearchTemplateName = name
|
|
|
|
|
|
for (let i = 0; i < this.searchTemplates.length; i++) {
|
|
|
if (this.searchTemplates[i].Name == this.currentSearchTemplateName) {
|
|
|
@@ -827,32 +827,31 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- removeSearchTab(targetName) {
|
|
|
+ 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;
|
|
|
+ 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];
|
|
|
+ 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,
|
|
|
+ message: res.data.message
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
@@ -861,7 +860,7 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- zuzhitreehandleChange2(value) {
|
|
|
+ zuzhitreehandleChange2 (value) {
|
|
|
if (this.selectedzuzhi2.length > 0) {
|
|
|
let selectsigorg = this.selectedzuzhi2[this.selectedzuzhi2.length - 1] + ''
|
|
|
this.$axios.get('/samplesite/getsitebyfcode?code=' + selectsigorg, {})
|
|
|
@@ -871,11 +870,11 @@
|
|
|
}).catch(() => {})
|
|
|
}
|
|
|
},
|
|
|
- //添加自定义搜索详情
|
|
|
- addSearchField() {
|
|
|
+ // 添加自定义搜索详情
|
|
|
+ addSearchField () {
|
|
|
let searchValue
|
|
|
for (let k in this.searchValue) {
|
|
|
- if (typeof this.searchValue[k] == 'number') {
|
|
|
+ if (typeof this.searchValue[k] === 'number') {
|
|
|
searchValue = this.searchValue[k]
|
|
|
break
|
|
|
} else if (this.searchValue[k] && this.searchValue[k].length > 0) {
|
|
|
@@ -885,18 +884,18 @@
|
|
|
}
|
|
|
|
|
|
if (!searchValue) {
|
|
|
- this.$message("请输入检索数值或范围")
|
|
|
+ this.$message('请输入检索数值或范围')
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- let s = ""
|
|
|
+ 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("--")
|
|
|
+ s = arr.join('--')
|
|
|
} else {
|
|
|
s = searchValue[searchValue.length - 1]
|
|
|
}
|
|
|
@@ -909,7 +908,7 @@
|
|
|
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("此查询条件已经存在")
|
|
|
+ this.$message('此查询条件已经存在')
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
@@ -918,23 +917,23 @@
|
|
|
Field: this.searchField,
|
|
|
Value: s + '',
|
|
|
OrAnd: this.orAnd,
|
|
|
- Name: this.getFieldName(this.searchField),
|
|
|
+ Name: this.getFieldName(this.searchField)
|
|
|
})
|
|
|
this.searchTableData = this.getSearchTableData(this.searchTemplates[i].Fields)
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- //查询自定义搜索详情
|
|
|
- saveAndSearchWithTemplate() {
|
|
|
+ // 查询自定义搜索详情
|
|
|
+ saveAndSearchWithTemplate () {
|
|
|
let _this = this
|
|
|
this.saveSearchTemplate(function () {
|
|
|
_this.currentSearchTemplate = _this.currentSearchTemplateName
|
|
|
_this.searchWithTemplate(_this.currentSearchTemplateName)
|
|
|
})
|
|
|
},
|
|
|
- //保存自定义搜索详情
|
|
|
- saveSearchTemplate(cb) {
|
|
|
+ // 保存自定义搜索详情
|
|
|
+ saveSearchTemplate (cb) {
|
|
|
let _this = this
|
|
|
let template = JSON.stringify(this.searchTableData)
|
|
|
this.$axios.put('/sampleinput/searchTemplate?name=' + this.currentSearchTemplateName, template)
|
|
|
@@ -942,7 +941,7 @@
|
|
|
if (res.data.code == 0) {
|
|
|
_this.$message({
|
|
|
type: 'success',
|
|
|
- message: res.data.message,
|
|
|
+ message: res.data.message
|
|
|
})
|
|
|
if (cb) {
|
|
|
cb()
|
|
|
@@ -950,7 +949,7 @@
|
|
|
} else {
|
|
|
_this.$message({
|
|
|
type: 'warning',
|
|
|
- message: res.data.message,
|
|
|
+ message: res.data.message
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
@@ -959,7 +958,7 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- deleteSearchField(v) {
|
|
|
+ deleteSearchField (v) {
|
|
|
if (v.Name) {
|
|
|
for (let i = 0; i < this.searchTemplates.length; i++) {
|
|
|
if (this.searchTemplates[i].Name == this.currentSearchTemplateName) {
|
|
|
@@ -972,20 +971,20 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- searchWithTemplate(name) {
|
|
|
+ searchWithTemplate (name) {
|
|
|
console.log(name)
|
|
|
this.searchDialogVisible = false
|
|
|
|
|
|
let params = {
|
|
|
_currentPage: this.currentPage,
|
|
|
- _size: this.size,
|
|
|
+ _size: this.size
|
|
|
|
|
|
}
|
|
|
let _this = this
|
|
|
// request
|
|
|
this.$axios.get('/samplesunsave/search?name=' + name, {
|
|
|
- params
|
|
|
- })
|
|
|
+ params
|
|
|
+ })
|
|
|
.then(res => {
|
|
|
console.log(res.data.items)
|
|
|
// response
|
|
|
@@ -1000,27 +999,27 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- getSearchTableData(searchFields) {
|
|
|
+ getSearchTableData (searchFields) {
|
|
|
let data = searchFields.map(function (ele) {
|
|
|
- if (ele["OrAnd"] == "or") {
|
|
|
- ele["Guanxi"] = "或者"
|
|
|
+ if (ele['OrAnd'] == 'or') {
|
|
|
+ ele['Guanxi'] = '或者'
|
|
|
} else {
|
|
|
- ele["Guanxi"] = "并且"
|
|
|
+ ele['Guanxi'] = '并且'
|
|
|
}
|
|
|
return ele
|
|
|
})
|
|
|
|
|
|
return data || []
|
|
|
},
|
|
|
- clickmodeltypetag(val) {
|
|
|
- this.currentSearchTemplateName = val.getAttribute("id")
|
|
|
+ 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() {
|
|
|
+ getAllSearchTab () {
|
|
|
let _this = this
|
|
|
this.$axios.get('/sampleinput/searchTemplate', {})
|
|
|
.then(res => {
|
|
|
@@ -1043,7 +1042,7 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- changeSearchField(val) {
|
|
|
+ changeSearchField (val) {
|
|
|
this.searchValue = {
|
|
|
BarCode: '',
|
|
|
SampleCode: '',
|
|
|
@@ -1062,17 +1061,17 @@
|
|
|
GroupName: ''
|
|
|
}
|
|
|
},
|
|
|
- getFieldName(field) {
|
|
|
+ getFieldName (field) {
|
|
|
for (let i = 0; i < this.showcolumn.length; i++) {
|
|
|
if (this.showcolumn[i].filed == field) {
|
|
|
return this.showcolumn[i].name
|
|
|
}
|
|
|
}
|
|
|
- return ""
|
|
|
+ return ''
|
|
|
},
|
|
|
- //----------------------------------------------------------------
|
|
|
- //批量复存
|
|
|
- batchsave() {
|
|
|
+ // ----------------------------------------------------------------
|
|
|
+ // 批量复存
|
|
|
+ batchsave () {
|
|
|
let _this = this
|
|
|
if (_this.multipleSelection.length < 1) {
|
|
|
_this.$message({
|
|
|
@@ -1102,12 +1101,12 @@
|
|
|
if (res.data.code == 0) {
|
|
|
_this.$message({
|
|
|
type: 'success',
|
|
|
- message: res.data.message,
|
|
|
+ message: res.data.message
|
|
|
})
|
|
|
} else {
|
|
|
_this.$message({
|
|
|
type: 'warning',
|
|
|
- message: res.data.message,
|
|
|
+ message: res.data.message
|
|
|
})
|
|
|
}
|
|
|
_this.initData()
|
|
|
@@ -1117,8 +1116,8 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- //清空查询数据
|
|
|
- clearSearch() {
|
|
|
+ // 清空查询数据
|
|
|
+ clearSearch () {
|
|
|
this.BarCode = ''
|
|
|
this.SampleCode = ''
|
|
|
this.SourceName = ''
|
|
|
@@ -1139,7 +1138,7 @@
|
|
|
this.GroupName = ''
|
|
|
this.initData()
|
|
|
},
|
|
|
- zuzhitreehandleChange(value) {
|
|
|
+ zuzhitreehandleChange (value) {
|
|
|
if (this.selectedzuzhi.length > 0) {
|
|
|
this.selectsigorg = this.selectedzuzhi[this.selectedzuzhi.length - 1] + ''
|
|
|
this.$axios.get('/samplesite/getsitebyfcode?code=' + this.selectsigorg, {})
|
|
|
@@ -1149,8 +1148,8 @@
|
|
|
}).catch(() => {})
|
|
|
}
|
|
|
},
|
|
|
- //返回查询条件执行
|
|
|
- searchzuzhitreehandleChange(value) {
|
|
|
+ // 返回查询条件执行
|
|
|
+ searchzuzhitreehandleChange (value) {
|
|
|
if (this.selectedzuzhi.length > 0) {
|
|
|
this.selectsigorg = this.selectedzuzhi[this.selectedzuzhi.length - 1] + ''
|
|
|
this.$axios.get('/samplesite/getsitebyfcode?code=' + this.selectsigorg, {})
|
|
|
@@ -1159,10 +1158,10 @@
|
|
|
}).catch(() => {})
|
|
|
}
|
|
|
},
|
|
|
- //导出样本
|
|
|
- handleExportsamplesCommand(command) {
|
|
|
+ // 导出样本
|
|
|
+ handleExportsamplesCommand (command) {
|
|
|
let _this = this
|
|
|
- if (command == 'exportchosen') { //导出所选数据
|
|
|
+ if (command == 'exportchosen') { // 导出所选数据
|
|
|
if (_this.multipleSelection.length < 1) {
|
|
|
_this.$message({
|
|
|
type: 'warning',
|
|
|
@@ -1171,7 +1170,7 @@
|
|
|
return
|
|
|
}
|
|
|
_this.exportsamples('exportchosen')
|
|
|
- } else if (command == 'exportpage') { //导出当前页数据
|
|
|
+ } else if (command == 'exportpage') { // 导出当前页数据
|
|
|
if (_this.list.length < 1) {
|
|
|
_this.$message({
|
|
|
type: 'warning',
|
|
|
@@ -1180,7 +1179,7 @@
|
|
|
return
|
|
|
}
|
|
|
_this.exportsamples('exportpage')
|
|
|
- } else if (command == 'exportall') { //导出所有数据
|
|
|
+ } else if (command == 'exportall') { // 导出所有数据
|
|
|
_this.$confirm('此操作将导出所有满足条件的数据!是否继续导出?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
@@ -1190,7 +1189,7 @@
|
|
|
}).catch(() => {})
|
|
|
}
|
|
|
},
|
|
|
- exportsamples(val) {
|
|
|
+ exportsamples (val) {
|
|
|
let _this = this
|
|
|
// 显示列
|
|
|
let showcolumnarr = []
|
|
|
@@ -1238,13 +1237,13 @@
|
|
|
}
|
|
|
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 + ","
|
|
|
+ id += _this.multipleSelection[i].Id + ','
|
|
|
}
|
|
|
}
|
|
|
let paramsid = {
|
|
|
@@ -1252,13 +1251,13 @@
|
|
|
}
|
|
|
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 + ","
|
|
|
+ id += _this.list[i].Id + ','
|
|
|
}
|
|
|
}
|
|
|
let paramsid = {
|
|
|
@@ -1267,8 +1266,8 @@
|
|
|
params = Object.assign(params, paramsid)
|
|
|
}
|
|
|
_this.$axios.get('/sampleinput/exportexcel', {
|
|
|
- params
|
|
|
- })
|
|
|
+ params
|
|
|
+ })
|
|
|
.then(res => {
|
|
|
window.location = 'http://' + res.data
|
|
|
})
|
|
|
@@ -1277,8 +1276,8 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- //样本条码批量打印
|
|
|
- batchprint() {
|
|
|
+ // 样本条码批量打印
|
|
|
+ batchprint () {
|
|
|
let _this = this
|
|
|
if (_this.multipleSelection.length < 1) {
|
|
|
_this.$message({
|
|
|
@@ -1309,7 +1308,7 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- handleSizeChange(value) {
|
|
|
+ handleSizeChange (value) {
|
|
|
this.size = value
|
|
|
this.currentPage = 1
|
|
|
if (this.currentSearchTemplate) {
|
|
|
@@ -1318,7 +1317,7 @@
|
|
|
this.initData()
|
|
|
}
|
|
|
},
|
|
|
- handleCurrentChange(value) {
|
|
|
+ handleCurrentChange (value) {
|
|
|
this.currentPage = value
|
|
|
if (this.currentSearchTemplate) {
|
|
|
this.searchWithTemplate(this.currentSearchTemplate)
|
|
|
@@ -1326,13 +1325,13 @@
|
|
|
this.initData()
|
|
|
}
|
|
|
},
|
|
|
- handleSelectionChange(val) {
|
|
|
+ handleSelectionChange (val) {
|
|
|
this.multipleSelection = val
|
|
|
},
|
|
|
- handleChange(value) {
|
|
|
+ handleChange (value) {
|
|
|
console.log(value)
|
|
|
},
|
|
|
- jstimehandle(val) {
|
|
|
+ jstimehandle (val) {
|
|
|
if (val === '') {
|
|
|
return '----'
|
|
|
} else if (val === '0001-01-01T08:00:00+08:00') {
|
|
|
@@ -1343,10 +1342,9 @@
|
|
|
val = val.replace('T', ' ')
|
|
|
return val.substring(0, 19)
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|