|
|
@@ -213,7 +213,7 @@
|
|
|
<batchrecoverydialog @close="recoverydialogcallback" :applyform="shenhe" :visible.sync="dialogfusuVisible">
|
|
|
</batchrecoverydialog>
|
|
|
|
|
|
- <el-dialog title="自定义搜索" :visible.sync="searchDialogVisible" width="1000px" top="5vh">
|
|
|
+<!-- <el-dialog title="自定义搜索" :visible.sync="searchDialogVisible" width="1000px" top="5vh">
|
|
|
<el-form ref="form" inline label-width="120px">
|
|
|
<el-row :gutter="0">
|
|
|
<el-col :span="10">
|
|
|
@@ -327,7 +327,12 @@
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- </el-dialog>
|
|
|
+ </el-dialog>-->
|
|
|
+
|
|
|
+ <!-- 自定义查询 -->
|
|
|
+ <samplesearchdialog @close="closeDialog"
|
|
|
+ ref="samplesearchdialog"></samplesearchdialog>
|
|
|
+
|
|
|
<uploadattachdialog @close="uploaddialogcallback" :sampleinfo="sampleinfodetail"
|
|
|
:visible.sync="dialoguploadVisible"></uploadattachdialog>
|
|
|
</div>
|
|
|
@@ -338,8 +343,11 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import batchrecoverydialog from '../../../components/samples/batchrecoverydialog'
|
|
|
+ import samplesearchdialog from '../../../components/samples/samplesearchdialog'
|
|
|
+
|
|
|
import store from 'store'
|
|
|
import uploadattachdialog from '@/components/samples/uploadattachdialog'
|
|
|
+
|
|
|
import draggable from 'vuedraggable'
|
|
|
// import customsearchdialog from '../../../components/samples/customsearchdialog'
|
|
|
import {
|
|
|
@@ -351,15 +359,16 @@
|
|
|
computed: {
|
|
|
...mapGetters({
|
|
|
authUser: 'authUser'
|
|
|
- }),
|
|
|
+ })
|
|
|
},
|
|
|
components: {
|
|
|
draggable,
|
|
|
batchrecoverydialog,
|
|
|
uploadattachdialog,
|
|
|
+ samplesearchdialog
|
|
|
// customsearchdialog
|
|
|
},
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
dialogVisible: false,
|
|
|
sampleinfodetail: {
|
|
|
@@ -391,7 +400,7 @@
|
|
|
sampletypes: [], // 样本类型
|
|
|
publicdatas: [], // 样本取用记录
|
|
|
relationSamples: [], // 相关样本
|
|
|
- GroupName: '', //所属分组
|
|
|
+ GroupName: '', // 所属分组
|
|
|
path: '', // 上传文件路径
|
|
|
userextends: [], // 扩展字段
|
|
|
specialelist: [], // 特殊扩展字段
|
|
|
@@ -402,7 +411,7 @@
|
|
|
selectedzuzhi2: [],
|
|
|
peintitemid: 0,
|
|
|
shenhe: {
|
|
|
- applyfusu_flag: true,
|
|
|
+ applyfusu_flag: true
|
|
|
},
|
|
|
multipleSelection: [],
|
|
|
typetykzlist: [], // 特有扩展
|
|
|
@@ -415,9 +424,9 @@
|
|
|
searchDialogVisible: false, // 自定义搜索弹框
|
|
|
|
|
|
searchTableData: [],
|
|
|
- searchTemplateName: "自定义搜索1",
|
|
|
- currentSearchTemplateName: "",
|
|
|
- searchField: "BarCode",
|
|
|
+ searchTemplateName: '自定义搜索1',
|
|
|
+ currentSearchTemplateName: '',
|
|
|
+ searchField: 'BarCode',
|
|
|
searchValue: {
|
|
|
BarCode: '',
|
|
|
SampleCode: '',
|
|
|
@@ -433,32 +442,32 @@
|
|
|
Capacity: '',
|
|
|
Location: '',
|
|
|
Extension: '',
|
|
|
- GroupName: '', //所属分组
|
|
|
+ GroupName: '' // 所属分组
|
|
|
},
|
|
|
- orAnd: "and",
|
|
|
+ orAnd: 'and',
|
|
|
searchTemplates: [],
|
|
|
orAndData: [{
|
|
|
- name: "并且",
|
|
|
- value: "and",
|
|
|
- },
|
|
|
- {
|
|
|
- name: "或者",
|
|
|
- value: "or",
|
|
|
- }
|
|
|
+ name: '并且',
|
|
|
+ value: 'and'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '或者',
|
|
|
+ value: 'or'
|
|
|
+ }
|
|
|
],
|
|
|
searchcolumn: [], // 搜索列
|
|
|
currentSearchTemplate: '',
|
|
|
- acc: '',
|
|
|
+ acc: ''
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
+ created () {
|
|
|
this.SourceName = this.$route.query.name
|
|
|
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('samplestoredseach')
|
|
|
- if (typeof (searchmodel) != 'undefined') {
|
|
|
+ if (typeof (searchmodel) !== 'undefined') {
|
|
|
if (searchmodel.BarCode && searchmodel.BarCode !== '') { // 样本条码
|
|
|
this.BarCode = searchmodel.BarCode
|
|
|
}
|
|
|
@@ -468,32 +477,32 @@
|
|
|
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.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.GroupName && searchmodel.GroupName !== '') { //所属分组
|
|
|
+ if (searchmodel.GroupName && searchmodel.GroupName !== '') { // 所属分组
|
|
|
this.GroupName = searchmodel.GroupName
|
|
|
}
|
|
|
}
|
|
|
@@ -588,7 +597,7 @@
|
|
|
this.getAllSearchTab()
|
|
|
},
|
|
|
|
|
|
- mounted() {
|
|
|
+ mounted () {
|
|
|
let _this = this
|
|
|
window.clickmodeltypetag = function (val, e) {
|
|
|
_this.clickmodeltypetag(val)
|
|
|
@@ -596,7 +605,7 @@
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
- initData() {
|
|
|
+ initData () {
|
|
|
this.currentSearchTemplate = ''
|
|
|
let _this = this
|
|
|
// 增加自定义显示列,存储位置,之后需要去掉
|
|
|
@@ -660,7 +669,7 @@
|
|
|
})
|
|
|
},
|
|
|
// 根据子code获取所有父code
|
|
|
- getparentcodebytopcode(v) {
|
|
|
+ getparentcodebytopcode (v) {
|
|
|
let _this = this
|
|
|
_this.$axios.get('/sampleorgan/getparentcodebytopcode/' + v, {})
|
|
|
.then(res => {
|
|
|
@@ -674,15 +683,19 @@
|
|
|
_this.searchzuzhitreehandleChange()
|
|
|
})
|
|
|
},
|
|
|
- uploadfile(val) {
|
|
|
+ uploadfile (val) {
|
|
|
this.sampleinfodetail.BarCode = val.BarCode
|
|
|
this.sampleinfodetail.SampleCode = val.SampleCode
|
|
|
this.dialoguploadVisible = true
|
|
|
},
|
|
|
- uploaddialogcallback() {
|
|
|
+ // 关闭自定义查询
|
|
|
+ closeDialog () {
|
|
|
+ this.getAllSearchTab()
|
|
|
+ },
|
|
|
+ uploaddialogcallback () {
|
|
|
this.initData()
|
|
|
},
|
|
|
- loadprintdata() {
|
|
|
+ loadprintdata () {
|
|
|
this.$axios.get('/sampleinput/getprintschemelist', {
|
|
|
_currentPage: -1
|
|
|
})
|
|
|
@@ -690,7 +703,7 @@
|
|
|
this.printschemelist = res.data.items
|
|
|
}).catch(() => {})
|
|
|
},
|
|
|
- getextends() {
|
|
|
+ getextends () {
|
|
|
let _this = this
|
|
|
this.$axios.get('/sampleinput/getsampletype', {
|
|
|
_currentPage: -1
|
|
|
@@ -705,15 +718,15 @@
|
|
|
}
|
|
|
}).catch(() => {})
|
|
|
},
|
|
|
- seachdata() {
|
|
|
+ seachdata () {
|
|
|
this.currentPage = 1
|
|
|
this.initData()
|
|
|
},
|
|
|
- openPrintDialog(val) {
|
|
|
+ openPrintDialog (val) {
|
|
|
this.peintitemid = val.Id
|
|
|
this.dialogPrintVisible = true
|
|
|
},
|
|
|
- selsampletypeChange() {
|
|
|
+ selsampletypeChange () {
|
|
|
// 获取特有扩展
|
|
|
let _this = this
|
|
|
if (_this.SampleType !== '') {
|
|
|
@@ -724,8 +737,8 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- //返回查询条件执行
|
|
|
- searchsampletypeChange() {
|
|
|
+ // 返回查询条件执行
|
|
|
+ searchsampletypeChange () {
|
|
|
// 获取特有扩展
|
|
|
let _this = this
|
|
|
if (_this.SampleType !== '') {
|
|
|
@@ -736,7 +749,7 @@
|
|
|
}
|
|
|
},
|
|
|
// 自定义显示列保存操作
|
|
|
- saveshowfiled() {
|
|
|
+ saveshowfiled () {
|
|
|
store.set('sapminputshowcolumn', this.showcolumn)
|
|
|
this.columndialogVisible = false
|
|
|
this.$message({
|
|
|
@@ -745,12 +758,12 @@
|
|
|
})
|
|
|
this.initData()
|
|
|
},
|
|
|
- handleCheckAllChange(val) {
|
|
|
+ handleCheckAllChange (val) {
|
|
|
for (var i = 0; i < this.showcolumn.length; i++) {
|
|
|
this.showcolumn[i].show = val
|
|
|
}
|
|
|
},
|
|
|
- checkedshowall() {
|
|
|
+ checkedshowall () {
|
|
|
let tc = 0
|
|
|
for (var i = 0; i < this.showcolumn.length; i++) {
|
|
|
if (this.showcolumn[i].show) {
|
|
|
@@ -769,7 +782,7 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- handleSizeChange(value) {
|
|
|
+ handleSizeChange (value) {
|
|
|
this.size = value
|
|
|
this.currentPage = 1
|
|
|
if (this.currentSearchTemplate) {
|
|
|
@@ -777,9 +790,8 @@
|
|
|
} else {
|
|
|
this.initData()
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
- handleCurrentChange(value) {
|
|
|
+ handleCurrentChange (value) {
|
|
|
this.currentPage = value
|
|
|
if (this.currentSearchTemplate) {
|
|
|
this.searchWithTemplate(this.currentSearchTemplate)
|
|
|
@@ -788,7 +800,7 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- jstimehandle(val) {
|
|
|
+ jstimehandle (val) {
|
|
|
if (val === '') {
|
|
|
return '----'
|
|
|
} else if (val === '0001-01-01T08:00:00+08:00') {
|
|
|
@@ -800,7 +812,7 @@
|
|
|
return val.substring(0, 19)
|
|
|
}
|
|
|
},
|
|
|
- Jstimehandle(val) {
|
|
|
+ Jstimehandle (val) {
|
|
|
if (val === '') {
|
|
|
return '----'
|
|
|
} else if (val === '0001-01-01T08:00:00+08:00') {
|
|
|
@@ -812,11 +824,11 @@
|
|
|
return val.substring(0, 10)
|
|
|
}
|
|
|
},
|
|
|
- jssubstrhandle(val, no) {
|
|
|
+ jssubstrhandle (val, no) {
|
|
|
let position = val.split(';')
|
|
|
return position[no]
|
|
|
},
|
|
|
- deletedata(val) {
|
|
|
+ deletedata (val) {
|
|
|
let _this = this
|
|
|
_this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
@@ -843,10 +855,10 @@
|
|
|
.catch(() => {})
|
|
|
}).catch(() => {})
|
|
|
},
|
|
|
- handleSelectionChange(val) {
|
|
|
+ handleSelectionChange (val) {
|
|
|
this.multipleSelection = val
|
|
|
},
|
|
|
- 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
|
|
|
@@ -855,7 +867,7 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- chooseType(command) {
|
|
|
+ chooseType (command) {
|
|
|
let _this = this
|
|
|
if (_this.multipleSelection.length < 1) {
|
|
|
_this.$message({
|
|
|
@@ -864,7 +876,7 @@
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- if (command == 'Apply') { //生成出库申请单:复苏
|
|
|
+ if (command == 'Apply') { // 生成出库申请单:复苏
|
|
|
_this.shenhe.applyfusu_flag = false
|
|
|
}
|
|
|
_this.shenhe = Object.assign(_this.shenhe, {
|
|
|
@@ -872,10 +884,10 @@
|
|
|
})
|
|
|
_this.dialogfusuVisible = true
|
|
|
},
|
|
|
- //导出样本
|
|
|
- handleExportsamplesCommand(command) {
|
|
|
+ // 导出样本
|
|
|
+ handleExportsamplesCommand (command) {
|
|
|
let _this = this
|
|
|
- if (command == 'exportchosen') { //导出所选数据
|
|
|
+ if (command == 'exportchosen') { // 导出所选数据
|
|
|
if (_this.multipleSelection.length < 1) {
|
|
|
_this.$message({
|
|
|
type: 'warning',
|
|
|
@@ -884,7 +896,7 @@
|
|
|
return
|
|
|
}
|
|
|
_this.exportsamples('exportchosen')
|
|
|
- } else if (command == 'exportpage') { //导出当前页数据
|
|
|
+ } else if (command == 'exportpage') { // 导出当前页数据
|
|
|
if (_this.list.length < 1) {
|
|
|
_this.$message({
|
|
|
type: 'warning',
|
|
|
@@ -893,7 +905,7 @@
|
|
|
return
|
|
|
}
|
|
|
_this.exportsamples('exportpage')
|
|
|
- } else if (command == 'exportall') { //导出所有数据
|
|
|
+ } else if (command == 'exportall') { // 导出所有数据
|
|
|
_this.$confirm('此操作将导出所有满足条件的数据!是否继续导出?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
@@ -903,7 +915,7 @@
|
|
|
}).catch(() => {})
|
|
|
}
|
|
|
},
|
|
|
- exportsamples(val) {
|
|
|
+ exportsamples (val) {
|
|
|
let _this = this
|
|
|
_this.exportloading = true
|
|
|
// 显示列
|
|
|
@@ -948,13 +960,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 = {
|
|
|
@@ -962,13 +974,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 = {
|
|
|
@@ -977,8 +989,8 @@
|
|
|
params = Object.assign(params, paramsid)
|
|
|
}
|
|
|
_this.$axios.get('/sampleinput/exportexcel', {
|
|
|
- params
|
|
|
- })
|
|
|
+ params
|
|
|
+ })
|
|
|
.then(res => {
|
|
|
_this.exportloading = false
|
|
|
window.location = 'http://' + res.data
|
|
|
@@ -989,14 +1001,14 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- doprintscheme() {
|
|
|
+ doprintscheme () {
|
|
|
this.dialogPrintVisible = false
|
|
|
window.PrintReport(this.Printscheme, `animalsamples,${this.peintitemid},${this.authUser.Profile.AccCode}`)
|
|
|
},
|
|
|
- getstationurl(val) {
|
|
|
+ getstationurl (val) {
|
|
|
return `?station=${val.ShelfX};${val.ShelfY};${val.BoxX};${val.BoxY};${val.Position};${val.Id}&pname=samples-stored&size=${this.size}¤tPage=${this.currentPage}`
|
|
|
},
|
|
|
- batchprint() {
|
|
|
+ batchprint () {
|
|
|
let _this = this
|
|
|
if (_this.multipleSelection.length < 1) {
|
|
|
_this.$message({
|
|
|
@@ -1027,7 +1039,7 @@
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- batchdelete() {
|
|
|
+ batchdelete () {
|
|
|
let _this = this
|
|
|
if (_this.multipleSelection.length < 1) {
|
|
|
_this.$message({
|
|
|
@@ -1048,33 +1060,33 @@
|
|
|
let count = 0
|
|
|
for (var i = 0; i < _this.multipleSelection.length; i++) {
|
|
|
_this.$axios.delete('sampleinput/' + _this.multipleSelection[i].Id + '?sampletype=' + _this
|
|
|
- .multipleSelection[
|
|
|
- i].SampleType, null)
|
|
|
+ .multipleSelection[
|
|
|
+ i].SampleType, null)
|
|
|
.then(res => {
|
|
|
// response
|
|
|
if (res.data.code === 0) {
|
|
|
succeedMsg = res.data.message
|
|
|
} else {
|
|
|
errorMsg = res.data.message
|
|
|
- failedIds.push(_this.multipleSelection[i].Id);
|
|
|
+ failedIds.push(_this.multipleSelection[i].Id)
|
|
|
}
|
|
|
count++
|
|
|
- //最后一个请求结束
|
|
|
+ // 最后一个请求结束
|
|
|
if (count == _this.multipleSelection.length) {
|
|
|
- //更新界面
|
|
|
+ // 更新界面
|
|
|
this.initData()
|
|
|
- //全部删除成功
|
|
|
+ // 全部删除成功
|
|
|
if (failedIds.length == 0) {
|
|
|
_this.$message({
|
|
|
type: 'success',
|
|
|
- message: succeedMsg,
|
|
|
+ message: succeedMsg
|
|
|
})
|
|
|
} else {
|
|
|
- //存在删除失败
|
|
|
- errorMsg = errorMsg + ",失败ID:" + failedIds.join(",")
|
|
|
+ // 存在删除失败
|
|
|
+ errorMsg = errorMsg + ',失败ID:' + failedIds.join(',')
|
|
|
_this.$message({
|
|
|
type: 'warning',
|
|
|
- message: errorMsg,
|
|
|
+ message: errorMsg
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
@@ -1096,10 +1108,10 @@
|
|
|
// }
|
|
|
// _this.dialogfusuVisible = true
|
|
|
// },
|
|
|
- numtoupchar(num) {
|
|
|
+ numtoupchar (num) {
|
|
|
return String.fromCharCode(64 + parseInt(num))
|
|
|
},
|
|
|
- postiontoupchar(postion) {
|
|
|
+ postiontoupchar (postion) {
|
|
|
let pos = postion.split(';')
|
|
|
if (pos.length === 2) {
|
|
|
return this.numtoupchar(pos[1]) + pos[0]
|
|
|
@@ -1107,15 +1119,15 @@
|
|
|
return postion
|
|
|
}
|
|
|
},
|
|
|
- recoverydialogcallback(v) {
|
|
|
+ recoverydialogcallback (v) {
|
|
|
this.multipleSelection = []
|
|
|
this.initData()
|
|
|
},
|
|
|
|
|
|
- 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) {
|
|
|
@@ -1125,18 +1137,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]
|
|
|
}
|
|
|
@@ -1149,7 +1161,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
|
|
|
}
|
|
|
}
|
|
|
@@ -1158,7 +1170,7 @@
|
|
|
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
|
|
|
@@ -1166,7 +1178,7 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- deleteSearchField(v) {
|
|
|
+ deleteSearchField (v) {
|
|
|
if (v.Name) {
|
|
|
for (let i = 0; i < this.searchTemplates.length; i++) {
|
|
|
if (this.searchTemplates[i].Name == this.currentSearchTemplateName) {
|
|
|
@@ -1180,12 +1192,12 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- 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
|
|
|
})
|
|
|
@@ -1193,36 +1205,36 @@
|
|
|
return data || []
|
|
|
},
|
|
|
|
|
|
- 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 ''
|
|
|
},
|
|
|
|
|
|
- getFieldByName(name) {
|
|
|
+ getFieldByName (name) {
|
|
|
for (let i = 0; i < this.showcolumn.length; i++) {
|
|
|
if (this.showcolumn[i].name == name) {
|
|
|
return this.showcolumn[i].filed
|
|
|
}
|
|
|
}
|
|
|
- return ""
|
|
|
+ return ''
|
|
|
},
|
|
|
|
|
|
- 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) {
|
|
|
@@ -1231,7 +1243,7 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- getAllSearchTab() {
|
|
|
+ getAllSearchTab () {
|
|
|
let _this = this
|
|
|
this.$axios.get('/sampleinput/searchTemplate', {})
|
|
|
.then(res => {
|
|
|
@@ -1255,32 +1267,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
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
@@ -1290,8 +1301,8 @@
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- 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)
|
|
|
@@ -1299,21 +1310,25 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- handleSearchCommand(command) {
|
|
|
+ handleSearchCommand (command) {
|
|
|
if (command == 'search') {
|
|
|
this.dialogVisible = true
|
|
|
} else if (command == 'clear') {
|
|
|
this.clearSearch()
|
|
|
- } else if (command == "编辑") {
|
|
|
+ } 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.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 = {
|
|
|
@@ -1324,18 +1339,18 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- searchWithTemplate(name) {
|
|
|
+ searchWithTemplate (name) {
|
|
|
this.searchDialogVisible = false
|
|
|
let params = {
|
|
|
_currentPage: this.currentPage,
|
|
|
- _size: this.size,
|
|
|
+ _size: this.size
|
|
|
|
|
|
}
|
|
|
let _this = this
|
|
|
// request
|
|
|
this.$axios.get('/sampleinput/search?name=' + name, {
|
|
|
- params
|
|
|
- })
|
|
|
+ params
|
|
|
+ })
|
|
|
.then(res => {
|
|
|
// response
|
|
|
if (res.data.items) {
|
|
|
@@ -1350,7 +1365,7 @@
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- saveAndSearchWithTemplate() {
|
|
|
+ saveAndSearchWithTemplate () {
|
|
|
let _this = this
|
|
|
this.saveSearchTemplate(function () {
|
|
|
_this.currentSearchTemplate = _this.currentSearchTemplateName
|
|
|
@@ -1358,7 +1373,7 @@
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- saveSearchTemplate(cb) {
|
|
|
+ saveSearchTemplate (cb) {
|
|
|
let _this = this
|
|
|
let template = JSON.stringify(this.searchTableData)
|
|
|
this.$axios.put('/sampleinput/searchTemplate?name=' + this.currentSearchTemplateName, template)
|
|
|
@@ -1366,7 +1381,7 @@
|
|
|
if (res.data.code == 0) {
|
|
|
_this.$message({
|
|
|
type: 'success',
|
|
|
- message: res.data.message,
|
|
|
+ message: res.data.message
|
|
|
})
|
|
|
if (cb) {
|
|
|
cb()
|
|
|
@@ -1374,7 +1389,7 @@
|
|
|
} else {
|
|
|
_this.$message({
|
|
|
type: 'warning',
|
|
|
- message: res.data.message,
|
|
|
+ message: res.data.message
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
@@ -1384,7 +1399,7 @@
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- changeSearchField(val) {
|
|
|
+ changeSearchField (val) {
|
|
|
this.searchValue = {
|
|
|
BarCode: '',
|
|
|
SampleCode: '',
|
|
|
@@ -1403,7 +1418,7 @@
|
|
|
GroupName: ''
|
|
|
}
|
|
|
},
|
|
|
- clearSearch() {
|
|
|
+ clearSearch () {
|
|
|
this.BarCode = ''
|
|
|
this.SampleCode = ''
|
|
|
this.SourceName = ''
|
|
|
@@ -1419,22 +1434,21 @@
|
|
|
this.GroupName = ''
|
|
|
this.initData()
|
|
|
},
|
|
|
- formatDateTime(date) {
|
|
|
- var y = date.getFullYear();
|
|
|
- var m = date.getMonth() + 1;
|
|
|
- m = m < 10 ? ('0' + m) : m;
|
|
|
- var d = date.getDate();
|
|
|
- d = d < 10 ? ('0' + d) : d;
|
|
|
- var h = date.getHours();
|
|
|
- var minute = date.getMinutes();
|
|
|
- var second = date.getSeconds();
|
|
|
- minute = minute < 10 ? ('0' + minute) : minute;
|
|
|
- minute = second < 10 ? ('0' + second) : second;
|
|
|
- return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;
|
|
|
+ formatDateTime (date) {
|
|
|
+ var y = date.getFullYear()
|
|
|
+ var m = date.getMonth() + 1
|
|
|
+ m = m < 10 ? ('0' + m) : m
|
|
|
+ var d = date.getDate()
|
|
|
+ d = d < 10 ? ('0' + d) : d
|
|
|
+ var h = date.getHours()
|
|
|
+ var minute = date.getMinutes()
|
|
|
+ var second = date.getSeconds()
|
|
|
+ minute = minute < 10 ? ('0' + minute) : minute
|
|
|
+ minute = second < 10 ? ('0' + second) : second
|
|
|
+ return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|