4
0
Prechádzať zdrojové kódy

Merge branch 'master' of http://code.dashoo.cn/dashoo/biobank

jianglw 4 rokov pred
rodič
commit
38ab131962

+ 10 - 9
src/dashoo.cn/frontend_animal/src/components/samples/samplesearchdialog.vue

@@ -1,6 +1,6 @@
 <template>
   <el-dialog title="样本自定义搜索"
-             :visible.sync="samplesourcesearchdialogVisable"
+             :visible.sync="samplesearchdialogVisable"
              width="90%"
              :before-close="beforeClose"
              :close-on-click-modal="false">
@@ -253,7 +253,7 @@ export default {
   data () {
     return {
       tableHeight: window.innerHeight - 230,
-      samplesourcesearchdialogVisable: false,
+      samplesearchdialogVisable: false,
       orAnd: 'and',
       orgtreelist: [],
       orgtreeprops: {
@@ -395,7 +395,7 @@ export default {
         type: 'date'
       }
       ],
-      data: [],
+      data: []
       // data2: []
     }
   },
@@ -479,11 +479,12 @@ export default {
     // 清除弹框的绑定值
     resetForm () {
       // 自定义弹框数据
+      // eslint-disable-next-line no-unused-expressions
       this.currentSearchTemplateName = '',
-        this.currentSearchId = 0,
-        this.searchTableData = [],
-        this.searchTemplates = [],
-        this.searchTemplateName = ''
+      this.currentSearchId = 0,
+      this.searchTableData = [],
+      this.searchTemplates = [],
+      this.searchTemplateName = ''
       // console.log('rest')
     },
     // 点击关闭时调用
@@ -491,7 +492,7 @@ export default {
       // console.log('close')
       this.resetForm()
       // this.resetcustomcondition()
-      this.samplesourcesearchdialogVisable = false
+      this.samplesearchdialogVisable = false
     },
 
     creatpage () {
@@ -619,7 +620,7 @@ export default {
     },
     beforeClose () {
       this.$emit('close')
-      this.samplesourcesearchdialogVisable = false
+      this.samplesearchdialogVisable = false
     },
     removeSearchTab (Id, targetName) {
       let _this = this

+ 155 - 144
src/dashoo.cn/frontend_animal/src/pages/samples/archived/index.vue

@@ -167,7 +167,7 @@
       </div>
     </el-dialog>
 
-    <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">
@@ -281,7 +281,12 @@
           </div>
         </el-col>
       </el-row>
-    </el-dialog>
+    </el-dialog>-->
+
+    <!-- 自定义查询 -->
+    <samplesearchdialog @close="closeDialog"
+                        ref="samplesearchdialog"></samplesearchdialog>
+
 
   </div>
 </template>
@@ -292,15 +297,17 @@
     mapGetters
   } from 'vuex'
   import draggable from 'vuedraggable'
+  import samplesearchdialog from '../../../components/samples/samplesearchdialog'
   export default {
     name: 'samplesunsave',
     computed: mapGetters({
       authUser: 'authUser'
     }),
     components: {
-      draggable
+      draggable,
+      samplesearchdialog
     },
-    data() {
+    data () {
       return {
         dialogVisible: false,
         currentItemCount: 0, // 当前页显示数量
@@ -314,7 +321,7 @@
         STNoteField: [], // 特有扩展名称
         CreateBy: '', // 录入人
         CreateOn: [], // 录入时期
-        GroupName: '', //所属分组
+        GroupName: '', // 所属分组
         Name: '', // 名称
         SourceName: '', // 样本来源
         Validity: [], // 有效日期
@@ -336,21 +343,21 @@
           SourceName: '', // 样本来源
           Validity: [], // 有效日期
           GroupName: '',
-          InnerCode: '', // 样本内码
+          InnerCode: '' // 样本内码
         },
         sampletypes: [], // 样本类型
         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: '',
@@ -364,67 +371,67 @@
           Capacity: '',
           Location: '',
           Extension: '',
-          GroupName: '', //所属分组
+          GroupName: '' // 所属分组
         },
-        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('samplearchivedseach')
 
-        if (typeof (this.searchmodel) != 'undefined') {
-          if (this.searchmodel.BarCode && this.searchmodel.BarCode !== '') { //样本条码
+        if (typeof (this.searchmodel) !== 'undefined') {
+          if (this.searchmodel.BarCode && this.searchmodel.BarCode !== '') { // 样本条码
             this.BarCode = this.searchmodel.BarCode
           }
-          if (this.searchmodel.SampleCode && this.searchmodel.SampleCode !== '') { //样本编码
+          if (this.searchmodel.SampleCode && this.searchmodel.SampleCode !== '') { // 样本编码
             this.SampleCode = this.searchmodel.SampleCode
           }
-          if (this.searchmodel.SourceName && this.searchmodel.SourceName !== '') { //样本来源
+          if (this.searchmodel.SourceName && this.searchmodel.SourceName !== '') { // 样本来源
             this.SourceName = this.searchmodel.SourceName
           }
-          if (this.searchmodel.InnerCode && this.searchmodel.InnerCode !== '') { //样本内码
+          if (this.searchmodel.InnerCode && this.searchmodel.InnerCode !== '') { // 样本内码
             this.InnerCode = this.searchmodel.InnerCode
           }
-          if (this.searchmodel.Name && this.searchmodel.Name !== '') { //名称
+          if (this.searchmodel.Name && this.searchmodel.Name !== '') { // 名称
             this.Name = this.searchmodel.Name
           }
-          if (this.searchmodel.CreateBy && this.searchmodel.CreateBy !== '') { //录入人
+          if (this.searchmodel.CreateBy && this.searchmodel.CreateBy !== '') { // 录入人
             this.CreateBy = this.searchmodel.CreateBy
           }
-          if (this.searchmodel.CreateOn && this.searchmodel.CreateOn.length === 2) { //录入日期
+          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 !== '') { //样本类型
+          if (this.searchmodel.SampleType && this.searchmodel.SampleType !== '') { // 样本类型
             this.SampleType = this.searchmodel.SampleType
             this.searchsampletypeChange()
           }
-          if (this.searchmodel.STNoteField && this.searchmodel.STNoteField.length > 0) { //特有扩展
+          if (this.searchmodel.STNoteField && this.searchmodel.STNoteField.length > 0) { // 特有扩展
             this.STNoteField = this.searchmodel.STNoteField
           }
-          if (this.searchmodel.Stnotevalue && this.searchmodel.Stnotevalue !== '') { //特有检索内容
+          if (this.searchmodel.Stnotevalue && this.searchmodel.Stnotevalue !== '') { // 特有检索内容
             this.Stnotevalue = this.searchmodel.Stnotevalue
           }
-          if (this.searchmodel.Validity && this.searchmodel.Validity.length === 2) { //有效日期
+          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 !== '') { //所属分组
+          if (searchmodel.GroupName && searchmodel.GroupName !== '') { // 所属分组
             this.GroupName = searchmodel.GroupName
           }
         }
@@ -433,7 +440,7 @@
       }
 
       this.cachecols = store.get('samplearchivedshowcolumn')
-      //当前显示列无数据,使用已录入样本显示列数据
+      // 当前显示列无数据,使用已录入样本显示列数据
       if (!(this.cachecols && this.cachecols !== '')) {
         this.cachecols = store.get('sapminputshowcolumn')
       }
@@ -517,14 +524,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 = {
@@ -554,8 +561,8 @@
         }
         store.set('samplearchivedseach', params)
         this.$axios.get('/samplesfiles/animallist', {
-            params
-          })
+          params
+        })
           .then(res => {
             _this.list = res.data.items
             _this.currentItemCount = res.data.currentItemCount
@@ -564,8 +571,8 @@
             console.error(err)
           })
       },
-      //根据子code获取所有父code
-      getparentcodebytopcode(v) {
+      // 根据子code获取所有父code
+      getparentcodebytopcode (v) {
         let _this = this
         _this.$axios.get('/sampleorgan/getparentcodebytopcode/' + v, {})
           .then(res => {
@@ -579,30 +586,34 @@
             _this.searchzuzhitreehandleChange()
           })
       },
-      getextends() {
+      getextends () {
         let _this = this
         this.$axios.get('/sampleinput/getsampletype', {
-            _currentPage: -1
-          })
+          _currentPage: -1
+        })
           .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()
             }
           }).catch(() => {})
       },
-      seachdata() {
+      seachdata () {
         if (this.selectedzuzhi.length > 0) {
           this.selectsigorg = this.selectedzuzhi[this.selectedzuzhi.length - 1] + ''
         }
         this.currentPage = 1
         this.initData()
       },
-      deletedata(val) {
+      // 关闭自定义查询
+      closeDialog () {
+        this.getAllSearchTab()
+      },
+      deletedata (val) {
         let _this = this
         _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
           confirmButtonText: '确定',
@@ -628,8 +639,8 @@
             .catch(() => {})
         }).catch(() => {})
       },
-      //批量删除
-      batchdelete() {
+      // 批量删除
+      batchdelete () {
         let _this = this
         if (_this.multipleSelection.length < 1) {
           _this.$message({
@@ -649,32 +660,32 @@
           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)
+              .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);
+                  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
                     })
                   }
                 }
@@ -684,7 +695,7 @@
           console.error(err)
         })
       },
-      selsampletypeChange() {
+      selsampletypeChange () {
         // 获取特有扩展
         let _this = this
         if (_this.SampleType !== '') {
@@ -696,8 +707,8 @@
             })
         }
       },
-      //返回查询条件执行
-      searchsampletypeChange() {
+      // 返回查询条件执行
+      searchsampletypeChange () {
         // 获取特有扩展
         let _this = this
         if (_this.SampleType !== '') {
@@ -708,9 +719,9 @@
             })
         }
       },
-      //---------------------------------------------------
-      //自定义显示列
-      checkedshowall() {
+      // ---------------------------------------------------
+      // 自定义显示列
+      checkedshowall () {
         let tc = 0
         for (var i = 0; i < this.showcolumn.length; i++) {
           if (this.showcolumn[i].show) {
@@ -729,13 +740,13 @@
           }
         }
       },
-      handleCheckAllChange(val) {
+      handleCheckAllChange (val) {
         for (var i = 0; i < this.showcolumn.length; i++) {
           this.showcolumn[i].show = val
         }
       },
       // 自定义显示列保存操作
-      saveshowfiled() {
+      saveshowfiled () {
         store.set('samplearchivedshowcolumn', this.showcolumn)
         this.columndialogVisible = false
         this.$message({
@@ -744,7 +755,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
@@ -753,18 +764,20 @@
           }
         }
       },
-      //----------------------------------------------------------------
-      //自定义查询
-      handleSearchCommand(command) {
+      // ----------------------------------------------------------------
+      // 自定义查询
+      handleSearchCommand (command) {
         if (command == 'search') {
           this.dialogVisible = true
         } else if (command == 'clear') {
           this.clearSearch()
-        } else if (command == "编辑") {
-          this.searchDialogVisible = true
+        } else if (command == '编辑') {
+          /* 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 = {
@@ -774,19 +787,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) {
@@ -794,32 +807,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
               })
             }
           })
@@ -827,11 +839,11 @@
             console.error(err)
           })
       },
-      //添加自定义搜索详情
-      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) {
@@ -841,18 +853,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]
           }
@@ -865,7 +877,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
               }
             }
@@ -874,23 +886,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)
@@ -898,7 +910,7 @@
             if (res.data.code == 0) {
               _this.$message({
                 type: 'success',
-                message: res.data.message,
+                message: res.data.message
               })
               if (cb) {
                 cb()
@@ -906,7 +918,7 @@
             } else {
               _this.$message({
                 type: 'warning',
-                message: res.data.message,
+                message: res.data.message
               })
             }
           })
@@ -914,7 +926,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) {
@@ -927,19 +939,19 @@
           }
         }
       },
-      searchWithTemplate(name) {
+      searchWithTemplate (name) {
         console.log(name)
         this.searchDialogVisible = false
 
         let params = {
           _currentPage: this.currentPage,
-          _size: this.size,
+          _size: this.size
 
         }
         let _this = this
         this.$axios.get('/samplesfiles/search?name=' + name, {
-            params
-          })
+          params
+        })
           .then(res => {
             console.log(res.data.items)
             if (res.data.items) {
@@ -951,27 +963,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 => {
@@ -993,7 +1005,7 @@
             console.error(err)
           })
       },
-      changeSearchField(val) {
+      changeSearchField (val) {
         this.searchValue = {
           BarCode: '',
           SampleCode: '',
@@ -1010,16 +1022,16 @@
           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 ''
       },
-      //----------------------------------------------------------------
-      jstimehandle(val) {
+      // ----------------------------------------------------------------
+      jstimehandle (val) {
         // if (val === '') {
         //   return '----'
         // } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -1031,7 +1043,7 @@
         //   return val.substring(0, 19)
         // }
       },
-      Jstimehandle(val) {
+      Jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -1043,8 +1055,8 @@
           return val.substring(0, 10)
         }
       },
-      //返回查询条件执行
-      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, {})
@@ -1053,10 +1065,10 @@
             }).catch(() => {})
         }
       },
-      //导出样本
-      handleExportsamplesCommand(command) {
+      // 导出样本
+      handleExportsamplesCommand (command) {
         let _this = this
-        if (command == 'exportchosen') { //导出所选数据
+        if (command == 'exportchosen') { // 导出所选数据
           if (_this.multipleSelection.length < 1) {
             _this.$message({
               type: 'warning',
@@ -1065,7 +1077,7 @@
             return
           }
           _this.exportsamples('exportchosen')
-        } else if (command == 'exportpage') { //导出当前页数据
+        } else if (command == 'exportpage') { // 导出当前页数据
           if (_this.list.length < 1) {
             _this.$message({
               type: 'warning',
@@ -1074,7 +1086,7 @@
             return
           }
           _this.exportsamples('exportpage')
-        } else if (command == 'exportall') { //导出所有数据
+        } else if (command == 'exportall') { // 导出所有数据
           _this.$confirm('此操作将导出所有满足条件的数据!是否继续导出?', '提示', {
             confirmButtonText: '确定',
             cancelButtonText: '取消',
@@ -1084,7 +1096,7 @@
           }).catch(() => {})
         }
       },
-      exportsamples(val) {
+      exportsamples (val) {
         let _this = this
         // 显示列
         let showcolumnarr = []
@@ -1130,13 +1142,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 = {
@@ -1144,13 +1156,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 = {
@@ -1159,8 +1171,8 @@
           params = Object.assign(params, paramsid)
         }
         _this.$axios.get('/sampleinput/exportexcel', {
-            params
-          })
+          params
+        })
           .then(res => {
             window.location = 'http://' + res.data
           })
@@ -1168,8 +1180,8 @@
             console.error(err)
           })
       },
-      //样本条码批量打印
-      batchprint() {
+      // 样本条码批量打印
+      batchprint () {
         let _this = this
         if (_this.multipleSelection.length < 1) {
           _this.$message({
@@ -1199,8 +1211,8 @@
             console.error(err)
           })
       },
-      //清空查询数据
-      clearSearch() {
+      // 清空查询数据
+      clearSearch () {
         this.BarCode = ''
         this.SampleCode = ''
         this.SourceName = ''
@@ -1218,10 +1230,10 @@
         this.GroupName = ''
         this.initData()
       },
-      deleteRow(index, rows) {
+      deleteRow (index, rows) {
         rows.splice(index, 1)
       },
-      handleSizeChange(value) {
+      handleSizeChange (value) {
         this.size = value
         this.currentPage = 1
         if (this.currentSearchTemplate) {
@@ -1230,7 +1242,7 @@
           this.initData()
         }
       },
-      handleCurrentChange(value) {
+      handleCurrentChange (value) {
         this.currentPage = value
         if (this.currentSearchTemplate) {
           this.searchWithTemplate(this.currentSearchTemplate)
@@ -1238,15 +1250,14 @@
           this.initData()
         }
       },
-      handleChange(value) {
+      handleChange (value) {
         console.log(value)
       },
-      handleSelectionChange(val) {
+      handleSelectionChange (val) {
         this.multipleSelection = val
       }
     }
   }
-
 </script>
 
 <style lang="scss">

+ 16 - 3
src/dashoo.cn/frontend_animal/src/pages/samples/prerecorded/index.vue

@@ -175,6 +175,7 @@
       </div>
     </el-dialog>
 
+<!--
     <el-dialog title="自定义搜索" :visible.sync="searchDialogVisible" width="1000px" top="5vh">
       <el-form ref="form" inline label-width="120px">
         <el-row :gutter="0">
@@ -273,6 +274,10 @@
         </el-col>
       </el-row>
     </el-dialog>
+-->
+    <!-- 自定义查询 -->
+    <samplesearchdialog @close="closeDialog"
+                        ref="samplesearchdialog"></samplesearchdialog>
 
   </div>
 </template>
@@ -282,13 +287,15 @@
   } from 'vuex'
   import store from 'store'
   import draggable from 'vuedraggable'
+  import samplesearchdialog from '../../../components/samples/samplesearchdialog'
   export default {
     name: 'samplespreinputlist',
     computed: mapGetters({
       authUser: 'authUser'
     }),
     components: {
-      draggable
+      draggable,
+      samplesearchdialog
     },
     data () {
       return {
@@ -818,10 +825,12 @@
         } else if (command == 'clear') {
           this.clearSearch()
         } else if (command == '编辑') {
-          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 = {
@@ -1032,6 +1041,10 @@
           }
         }
       },
+      // 关闭自定义查询
+      closeDialog () {
+        this.getAllSearchTab()
+      },
       getAllSearchTab () {
         let _this = this
         this.$axios.get('/sampleinput/searchTemplate', {})

+ 158 - 144
src/dashoo.cn/frontend_animal/src/pages/samples/stored/index.vue

@@ -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}&currentPage=${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">

+ 143 - 134
src/dashoo.cn/frontend_animal/src/pages/samples/waitingstore/index.vue

@@ -167,7 +167,7 @@
       </div>
     </el-dialog>
 
-    <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">
@@ -264,7 +264,10 @@
           </div>
         </el-col>
       </el-row>
-    </el-dialog>
+    </el-dialog>-->
+    <!-- 自定义查询 -->
+    <samplesearchdialog @close="closeDialog"
+                        ref="samplesearchdialog"></samplesearchdialog>
 
   </div>
 </template>
@@ -274,15 +277,17 @@
     mapGetters
   } from 'vuex'
   import draggable from 'vuedraggable'
+  import samplesearchdialog from '../../../components/samples/samplesearchdialog'
   export default {
     name: 'samplesunsave',
     computed: mapGetters({
       authUser: 'authUser'
     }),
     components: {
-      draggable
+      draggable,
+      samplesearchdialog
     },
-    data() {
+    data () {
       return {
         dialogVisible: false,
         currentItemCount: 0, // 当前页显示数量
@@ -296,7 +301,7 @@
         STNoteField: [], // 特有扩展名称
         CreateBy: '', // 录入人
         CreateOn: [], // 录入时期
-        GroupName: '', //所属分组
+        GroupName: '', // 所属分组
         Name: '', // 名称
         SourceName: '', // 样本来源
         InnerCode: '', // 样本内码
@@ -305,17 +310,17 @@
         sampletypes: [], // 样本类型
         // 新增
         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: '',
@@ -328,67 +333,67 @@
           Capacity: '',
           Location: '',
           Extension: '',
-          GroupName: '', //所属分组
+          GroupName: '' // 所属分组
         },
-        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.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
           }
         }
@@ -397,7 +402,7 @@
       }
 
       this.cachecols = store.get('samplewaitstoreshowcolumn')
-      //当前显示列无数据,使用已录入样本显示列数据
+      // 当前显示列无数据,使用已录入样本显示列数据
       if (!(this.cachecols && this.cachecols !== '')) {
         this.cachecols = store.get('sapminputshowcolumn')
       }
@@ -480,14 +485,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 = {
@@ -515,11 +520,11 @@
           }
           params = Object.assign(params, params2)
         }
-        //返回时保存查找内容
+        // 返回时保存查找内容
         store.set('samplewaitstoreseach', params)
         this.$axios.get('/samplesunsave/animallist', {
-            params
-          })
+          params
+        })
           .then(res => {
             _this.list = res.data.items
             _this.currentItemCount = res.data.currentItemCount
@@ -528,8 +533,8 @@
             console.error(err)
           })
       },
-      //根据子code获取所有父code
-      getparentcodebytopcode(v) {
+      // 根据子code获取所有父code
+      getparentcodebytopcode (v) {
         let _this = this
         _this.$axios.get('/sampleorgan/getparentcodebytopcode/' + v, {})
           .then(res => {
@@ -543,26 +548,26 @@
             _this.searchzuzhitreehandleChange()
           })
       },
-      getextends() {
+      getextends () {
         let _this = this
         this.$axios.get('/sampleinput/getsampletype', {
-            _currentPage: -1
-          })
+          _currentPage: -1
+        })
           .then(res => {
             _this.sampletypes = res.data.items
-             if (store.get('samplewaitstoreseach').searchWithTemplate && store.get('samplewaitstoreseach').searchWithTemplate !==
-              '') { //自定义查询
+            if (store.get('samplewaitstoreseach').searchWithTemplate && store.get('samplewaitstoreseach').searchWithTemplate !==
+              '') { // 自定义查询
               this.handleSearchCommand(store.get('samplewaitstoreseach').searchWithTemplate)
             } else {
               this.initData()
             }
           }).catch(() => {})
       },
-      seachdata() {
+      seachdata () {
         this.currentPage = 1
         this.initData()
       },
-      selsampletypeChange() {
+      selsampletypeChange () {
         // 获取特有扩展
         let _this = this
         if (_this.SampleType !== '') {
@@ -573,8 +578,8 @@
             })
         }
       },
-      //返回查询条件执行
-      searchsampletypeChange() {
+      // 返回查询条件执行
+      searchsampletypeChange () {
         // 获取特有扩展
         let _this = this
         if (_this.SampleType !== '') {
@@ -584,9 +589,9 @@
             })
         }
       },
-      //---------------------------------------------------
-      //自定义显示列
-      checkedshowall() {
+      // ---------------------------------------------------
+      // 自定义显示列
+      checkedshowall () {
         let tc = 0
         for (var i = 0; i < this.showcolumn.length; i++) {
           if (this.showcolumn[i].show) {
@@ -605,13 +610,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({
@@ -620,7 +625,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
@@ -629,18 +634,20 @@
           }
         }
       },
-      //----------------------------------------------------------------
-      //自定义查询
-      handleSearchCommand(command) {
+      // ----------------------------------------------------------------
+      // 自定义查询
+      handleSearchCommand (command) {
         if (command == 'search') {
           this.dialogVisible = true
         } else if (command == 'clear') {
           this.clearSearch()
-        } else if (command == "编辑") {
-          this.searchDialogVisible = true
+        } else if (command == '编辑') {
+        /*  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 = {
@@ -650,19 +657,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) {
@@ -670,32 +677,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
               })
             }
           })
@@ -703,11 +709,11 @@
             console.error(err)
           })
       },
-      //添加自定义搜索详情
-      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) {
@@ -717,18 +723,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]
           }
@@ -741,7 +747,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
               }
             }
@@ -750,23 +756,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)
@@ -774,7 +780,7 @@
             if (res.data.code == 0) {
               _this.$message({
                 type: 'success',
-                message: res.data.message,
+                message: res.data.message
               })
               if (cb) {
                 cb()
@@ -782,7 +788,7 @@
             } else {
               _this.$message({
                 type: 'warning',
-                message: res.data.message,
+                message: res.data.message
               })
             }
           })
@@ -790,7 +796,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) {
@@ -803,19 +809,23 @@
           }
         }
       },
-      searchWithTemplate(name) {
+      // 关闭自定义查询
+      closeDialog () {
+        this.getAllSearchTab()
+      },
+      searchWithTemplate (name) {
         console.log(name)
         this.searchDialogVisible = false
 
         let params = {
           _currentPage: this.currentPage,
-          _size: this.size,
+          _size: this.size
 
         }
         let _this = this
         this.$axios.get('/samplesunsave/search?name=' + name, {
-            params
-          })
+          params
+        })
           .then(res => {
             console.log(res.data.items)
             if (res.data.items) {
@@ -827,27 +837,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 => {
@@ -869,7 +879,7 @@
             console.error(err)
           })
       },
-      changeSearchField(val) {
+      changeSearchField (val) {
         this.searchValue = {
           BarCode: '',
           SampleCode: '',
@@ -888,17 +898,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({
@@ -928,12 +938,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()
@@ -942,8 +952,8 @@
             console.error(err)
           })
       },
-      //清空查询数据
-      clearSearch() {
+      // 清空查询数据
+      clearSearch () {
         this.BarCode = ''
         this.SampleCode = ''
         this.SourceName = ''
@@ -961,10 +971,10 @@
         this.GroupName = ''
         this.initData()
       },
-      //导出样本
-      handleExportsamplesCommand(command) {
+      // 导出样本
+      handleExportsamplesCommand (command) {
         let _this = this
-        if (command == 'exportchosen') { //导出所选数据
+        if (command == 'exportchosen') { // 导出所选数据
           if (_this.multipleSelection.length < 1) {
             _this.$message({
               type: 'warning',
@@ -973,7 +983,7 @@
             return
           }
           _this.exportsamples('exportchosen')
-        } else if (command == 'exportpage') { //导出当前页数据
+        } else if (command == 'exportpage') { // 导出当前页数据
           if (_this.list.length < 1) {
             _this.$message({
               type: 'warning',
@@ -982,7 +992,7 @@
             return
           }
           _this.exportsamples('exportpage')
-        } else if (command == 'exportall') { //导出所有数据
+        } else if (command == 'exportall') { // 导出所有数据
           _this.$confirm('此操作将导出所有满足条件的数据!是否继续导出?', '提示', {
             confirmButtonText: '确定',
             cancelButtonText: '取消',
@@ -992,7 +1002,7 @@
           }).catch(() => {})
         }
       },
-      exportsamples(val) {
+      exportsamples (val) {
         let _this = this
         // 显示列
         let showcolumnarr = []
@@ -1038,13 +1048,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 = {
@@ -1052,13 +1062,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 = {
@@ -1067,8 +1077,8 @@
           params = Object.assign(params, paramsid)
         }
         _this.$axios.get('/sampleinput/exportexcel', {
-            params
-          })
+          params
+        })
           .then(res => {
             window.location = 'http://' + res.data
           })
@@ -1076,8 +1086,8 @@
             console.error(err)
           })
       },
-      //样本条码批量打印
-      batchprint() {
+      // 样本条码批量打印
+      batchprint () {
         let _this = this
         if (_this.multipleSelection.length < 1) {
           _this.$message({
@@ -1108,7 +1118,7 @@
             console.error(err)
           })
       },
-      handleSizeChange(value) {
+      handleSizeChange (value) {
         this.size = value
         this.currentPage = 1
         if (this.currentSearchTemplate) {
@@ -1117,7 +1127,7 @@
           this.initData()
         }
       },
-      handleCurrentChange(value) {
+      handleCurrentChange (value) {
         this.currentPage = value
         if (this.currentSearchTemplate) {
           this.searchWithTemplate(this.currentSearchTemplate)
@@ -1125,13 +1135,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') {
@@ -1143,7 +1153,7 @@
           return val.substring(0, 19)
         }
       },
-      Jstimehandle(val) {
+      Jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -1154,10 +1164,9 @@
           val = val.replace('T', ' ')
           return val.substring(0, 10)
         }
-      },
+      }
     }
   }
-
 </script>
 
 <style lang="scss">