4
0
jianglw преди 4 години
родител
ревизия
8bd3a7e485

+ 884 - 0
src/dashoo.cn/frontend_animal/src/components/samples/samplesearchdialog.vue

@@ -0,0 +1,884 @@
+<template>
+  <el-dialog title="样本自定义搜索"
+             :visible.sync="samplesourcesearchdialogVisable"
+             width="90%"
+             :before-close="beforeClose"
+             :close-on-click-modal="false">
+    <el-row class="inputrow">
+      <el-col :span="4">
+        <!-- <el-row> -->
+        <el-tabs type="border-card">
+          <el-tab-pane label="基础字段"
+                       style="height:calc(100vh - 370px)">
+            <div :style="{'width':'100%','height':tableHeight-60+'px','overflow':'auto'}">
+              <el-tree :data="data1"
+                       @node-click="handleNodeClick"></el-tree>
+            </div>
+          </el-tab-pane>
+          <el-tab-pane label="扩展字段"
+                       style="height:calc(100vh - 370px)">
+            <div :style="{'width':'100%','height':tableHeight-60+'px','overflow':'auto'}">
+              <el-tree :data="data"
+                       @node-click="handleNodeClicKuoZhan"></el-tree>
+            </div>
+          </el-tab-pane>
+          <el-tab-pane label="样本来源"
+                       style="height:calc(100vh - 370px)">
+            <div :style="{'width':'100%','height':tableHeight-60+'px','overflow':'auto'}">
+              <el-tree :data="data2"
+                       @node-click="handleNodeClicSource"></el-tree>
+            </div>
+          </el-tab-pane>
+        </el-tabs>
+        <!-- </el-row> -->
+
+      </el-col>
+      <el-col :span="16">
+        <el-card>
+          <el-form inline
+                   label-width="120px">
+            <el-row>
+              <el-col>
+                <el-button size="mini"
+                           type="primary"
+                           style="margin-top:10px;"
+                           @click="resetcustomcondition()">新增方案</el-button>
+                <el-button size="mini"
+                           type="primary"
+                           style="margin-top:10px;"
+                           @click="saveSearchTemplate()">保存</el-button>
+                <el-form-item label="自定义搜索名称">
+                  <el-input v-model="currentSearchTemplateName"
+                            @change="customsearchnamechange()"
+                            size="mini"
+                            style="width:200px"
+                            placeholder="请输入自定义名称"></el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+
+          <el-table :data="searchTableData"
+                    size="mini"
+                    border
+                    style="width: 100%;margin-top:-60px"
+                    height="calc(100vh - 360px)">
+            <el-table-column prop="Name"
+                             label="字段"
+                             align="center"
+                             show-overflow-tooltip>
+            </el-table-column>
+            <el-table-column prop="Operate"
+                             label="表达式"
+                             align="center"
+                             width="200px"
+                             show-overflow-tooltip>
+              <template slot-scope="scope">
+                <el-select v-if="scope.row.TagIcon==='date'"
+                           v-model="scope.row.Operate">
+                  <el-option v-for="item in dateoptions"
+                             :key="item.value"
+                             :label="item.label"
+                             :value="item.value"></el-option>
+                </el-select>
+                <!--1. 基础字段是str类型 或者 2.是扩展字段但是不是日期类型 , -->
+                <el-select v-if="acquritype(scope.row)=='str'||(scope.row.kuoz==='true'&&scope.row.FieldType!==4)"
+                           v-model="scope.row.Operate">
+                  <el-option v-for="item in stroptions"
+                             :key="item.value"
+                             :label="item.label"
+                             :value="item.value"></el-option>
+                </el-select>
+                <!--如果基础字段是date类型,或者扩展字段并且是日期类型,那么就选用日期类型的表达式-->
+                <el-select v-else-if="acquritype(scope.row)=='str'||(scope.row.kuoz==='true'&&scope.row.FieldType===4)"
+                           v-model="scope.row.Operate">
+                  <el-option v-for="item in dateoptions"
+                             :key="item.value"
+                             :label="item.label"
+                             :value="item.value"></el-option>
+                </el-select>
+                <!-- <el-select v-else-if="scope.row.TagIcon==='date'"
+                           v-model="scope.row.Operate">
+                  <el-option v-for="item in dateoptions"
+                             :key="item.value"
+                             :label="item.label"
+                             :value="item.value"></el-option>
+                </el-select> -->
+
+                <!--如果基础字段是int类型,选用int表达式-->
+                <el-select v-else-if="acquritype(scope.row)=='int'"
+                           v-model="scope.row.Operate">
+                  <el-option v-for="item in intoptions"
+                             :key="item.value"
+                             :label="item.label"
+                             :value="item.value"></el-option>
+                </el-select>
+                <!--如果基础字段是cascader类型-->
+                <el-select v-else-if="acquritype(scope.row)=='cascader'"
+                           v-model="scope.row.Operate">
+                  <el-option v-for="item in dateoptions"
+                             :key="item.value"
+                             :label="item.label"
+                             :value="item.value"></el-option>
+                </el-select>
+                <!--如果基础字段是date类型,选用日期表达式-->
+                <el-select v-else-if="acquritype(scope.row)=='date'"
+                           v-model="scope.row.Operate">
+                  <el-option v-for="item in dateoptions"
+                             :key="item.value"
+                             :label="item.label"
+                             :value="item.value"></el-option>
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column prop="Value"
+                             label="值"
+                             width="250"
+                             align="center"
+                             show-overflow-tooltip>
+              <template slot-scope="scope">
+                <!--这个v-if 程序中不会走进来,是日期类型between and 的条件,不要删除-->
+                <el-date-picker v-model="scope.row.Value"
+                                type="daterange"
+                                v-if="acquritype(scope.row)==='date'&&scope.row.Operate==='between'"
+                                range-separator="至"
+                                start-placeholder="开始日期"
+                                end-placeholder="结束日期"
+                                value-format="yyyy-MM-dd"
+                                style="width:100%"></el-date-picker>
+                <!--如果基础字段是date类型,或者扩展字段的字段类型是日期类型-->
+                <el-date-picker v-model="scope.row.Value"
+                                v-else-if="acquritype(scope.row)==='date'||scope.row.FieldType===4"
+                                type="date"
+                                value-format="yyyy-MM-dd"
+                                :clearable="true"></el-date-picker>
+                <!--如果基础字段是str类型,就正常展示input-->
+                <!-- <el-input v-model="scope.row.Value"
+                          placeholder="请输入内容"
+                          v-else-if="acquritype(scope.row)==='str'||acquritype(scope.row)==='int'"></el-input> -->
+
+                <!--如果基础字段是cascader类型,就正常展示cascader-->
+
+                <el-cascader :options="orgtreelist"
+                             v-if="acquritypeN(scope.row)=='cascader'"
+                             :props="orgtreeprops"
+                             change-on-select
+                             v-model="scope.row.Value"
+                             placeholder="请选择"
+                             clearable
+                             @change="changecascader"></el-cascader>
+                <!-- <el-select v-if="acquritypeN(scope.row)=='select'"
+                           v-model="scope.row.Operate">
+                  <el-option v-for="item in intoptions"
+                             :key="item.value"
+                             :label="item.label"
+                             :value="item.value"></el-option>
+                </el-select> -->
+                <el-date-picker v-model="scope.row.Value"
+                                v-else-if="acquritypeN(scope.row)==='date'"
+                                type="date"
+                                value-format="yyyy-MM-dd"
+                                :clearable="true"></el-date-picker>
+                <el-input v-model="scope.row.Value"
+                          placeholder="请输入内容"
+                          v-else="acquritypeN(scope.row)=='input'"></el-input>
+              </template>
+            </el-table-column>
+            <el-table-column prop="Guanxi"
+                             label="逻辑关系"
+                             align="center"
+                             show-overflow-tooltip>
+              <template slot-scope="scope">
+                <el-select v-model="scope.row.Guanxi"
+                           v-if="scope.$index + 1 != searchTableData.length">
+                  <el-option v-for="item in orAndData"
+                             :key="item.value"
+                             :label="item.name"
+                             :value="item.value"></el-option>
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作"
+                             align="center"
+                             show-overflow-tooltip>
+              <template slot-scope="scope">
+                <el-button @click="removeCustomCondition(scope.row)"
+                           title="移除"
+                           type="danger"
+                           icon="el-icon-close"
+                           class="dashoo_button_2"
+                           circle
+                           size="small"></el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-card>
+      </el-col>
+      <el-col :span="4">
+        <el-card>
+          <el-tag v-for="tag in searchTemplates"
+                  :id="tag.Name"
+                  :key="tag.Name"
+                  closable
+                  class="reporttag reportselect"
+                  @click="clickmodeltypetag(tag.Name)"
+                  @close="removeSearchTab(tag.Id,tag.Name)">
+            <i class="el-icon-caret-right"
+               v-if="tag.Name === currentSearchTemplateName"></i>
+            {{tag.Name}}
+          </el-tag>
+        </el-card>
+      </el-col>
+    </el-row>
+  </el-dialog>
+</template>
+
+<script>
+import service from '../../utils/micro_request'
+export default {
+  name: 'customsearchdialog',
+
+  created () {
+    this.getOrgTreeList()
+  },
+  computed: {
+
+  },
+  // watch: {
+  //   visible (val) {
+  //     this.selfVisible = val
+  //   }
+
+  // },
+  data () {
+    return {
+      tableHeight: window.innerHeight - 230,
+      samplesourcesearchdialogVisable: false,
+      orAnd: 'and',
+      orgtreelist: [],
+      orgtreeprops: {
+        value: 'label',
+        label: 'label',
+        children: 'children'
+      },
+      orAndData: [{
+        name: '并且',
+        value: 'and'
+      },
+      {
+        name: '或者',
+        value: 'or'
+      }
+      ],
+      cascaderType: '',
+      selectType: '',
+      inputType: '',
+      selfVisible: this.visible, // 避免vue双向绑定警告
+      searchTableData: [],
+      searchTemplates: [],
+      currentSearchId: 0, // 当前自定义搜索模板的ID
+      currentSearchTemplateName: '', // 当前搜索名称
+      // 字符表达式选择
+      stroptions: [{
+        value: '=',
+        label: '等于'
+      },
+      {
+        value: '!=',
+        label: '不等于'
+      }, {
+        value: 'like',
+        label: '包含'
+      }
+      ],
+      // 数值类型表达式选择
+      intoptions: [{
+        value: '=',
+        label: '等于'
+      }, {
+        value: '>',
+        label: '大于'
+      }, {
+        value: '<',
+        label: '小于'
+      }, {
+        value: '>=',
+        label: '大于等于'
+      }, {
+        value: '!=',
+        label: '不等于'
+      }, {
+        value: '<=',
+        label: '小于等于'
+      }],
+      dateoptions: [{
+        value: '=',
+        label: '等于'
+      }, {
+        value: '>',
+        label: '大于'
+      }, {
+        value: '<',
+        label: '小于'
+      }, {
+        value: '>=',
+        label: '大于等于'
+      }, {
+        value: '!=',
+        label: '不等于'
+      }, {
+        value: '<=',
+        label: '小于等于'
+      }],
+      options: [{
+        value: '=',
+        label: '等于'
+      }, {
+        value: '>',
+        label: '大于'
+      }, {
+        value: '<',
+        label: '小于'
+      }, {
+        value: '>=',
+        label: '大于等于'
+      }, {
+        value: '!=',
+        label: '不等于'
+      }, {
+        value: '<=',
+        label: '小于等于'
+      }, {
+        value: 'like',
+        label: '包含'
+      }],
+      data1: [{
+        value: 'BarCode',
+        label: '样本唯一码',
+        type: 'str'
+      }, {
+        value: 'SampleCode',
+        label: '样本编码',
+        type: 'str'
+      }, {
+        value: 'SourceName',
+        label: '样本来源',
+        type: 'str'
+      }, {
+        value: 'Name',
+        label: '名称',
+        type: 'str'
+      }, {
+        value: 'SampleTypeName',
+        label: '样本类型',
+        type: 'str'
+      }, {
+        value: 'Capacity',
+        label: '可用容量',
+        type: 'int'
+      },
+      {
+        value: 'ValidityDate',
+        label: '有效日期',
+        type: 'date'
+      }, {
+        value: 'ReceiveDate',
+        label: '接收日期',
+        type: 'date'
+      }, {
+        value: 'CreateBy',
+        label: '录入人',
+        type: 'str'
+      }, {
+        value: 'PositionInfo',
+        label: '存储位置',
+        type: 'date'
+      }
+      ],
+      data: [],
+      // data2: []
+    }
+  },
+
+  // mounted () {
+  //   let _this = this
+  //   window.clickmodeltypetag = function (val, e) {
+  //     _this.clickmodeltypetag(val)
+  //   }
+  // },
+  methods: {
+    getOrgTreeList () {
+      service.postRequest('dashoo.biobank.bee-0.1', 'Sample', 'BasicSampleType')
+        .then(res => {
+          this.orgtreelist = utils.toolfun_gettreejson(res.data, 'id', 'parent_id', 'id,label')
+        })
+        .catch(err => {
+          console.error(err)
+        })
+    },
+    toolfun_gettreejson (rows, idFieldName, pidFieldName, fileds) { // 工具方法,将扁平数据转化成tree格式数据
+      function nodejsonexists (rows, ParentId) {
+        for (var i = 0; i < rows.length; i++) {
+          if (rows[i][idFieldName] === ParentId) {
+            return true
+          }
+        }
+        return false
+      }
+
+      let nodes = []
+      // get the top level nodes
+      for (let i = 0; i < rows.length; i++) {
+        let row = rows[i]
+        if (!nodejsonexists(rows, row[pidFieldName])) {
+          var data = {
+            id: row[idFieldName]
+          }
+          let arrFiled = fileds.split(',')
+          for (var j = 0; j < arrFiled.length; j++) {
+            if (arrFiled[j] !== idFieldName) {
+              data[arrFiled[j]] = row[arrFiled[j]]
+            }
+          }
+          nodes.push(data)
+        }
+      }
+      let toDo = []
+      for (let i = 0; i < nodes.length; i++) {
+        toDo.push(nodes[i])
+      }
+      while (toDo.length) {
+        let node = toDo.shift() // the parent node
+        // get the children nodes
+        for (let i = 0; i < rows.length; i++) {
+          let row = rows[i]
+          if (row[pidFieldName] === node.id) {
+            let child = {
+              id: row[idFieldName]
+            }
+            let arrFiled = fileds.split(',')
+            for (let j = 0; j < arrFiled.length; j++) {
+              if (arrFiled[j] !== idFieldName) {
+                child[arrFiled[j]] = row[arrFiled[j]]
+              }
+            }
+            if (node.children) {
+              node.children.push(child)
+            } else {
+              node.children = [child]
+            }
+            toDo.push(child)
+          }
+        }
+      }
+      return nodes
+    },
+    changecascader (e) {
+      this.cascaderName = e.join('/')
+    },
+    // 清除弹框的绑定值
+    resetForm () {
+      // 自定义弹框数据
+      this.currentSearchTemplateName = '',
+        this.currentSearchId = 0,
+        this.searchTableData = [],
+        this.searchTemplates = [],
+        this.searchTemplateName = ''
+      // console.log('rest')
+    },
+    // 点击关闭时调用
+    closePopup () {
+      // console.log('close')
+      this.resetForm()
+      // this.resetcustomcondition()
+      this.samplesourcesearchdialogVisable = false
+    },
+
+    creatpage () {
+      // 黏膜搜索
+      this.searchKuoZhanData()
+      this.getSampleSourceTypeExpand()
+      this.getAllSearchTab()
+      // this.resetForm()
+      // console.log("ddddd自定义搜索---currentSearchTemplateName", this.currentSearchTemplateName)
+    },
+    removeCustomCondition (row) {
+      if (this.searchTableData !== undefined && this.searchTableData != null && this.searchTableData.length > 0) {
+        for (var i = 0; i < this.searchTableData.length; i++) {
+          if (row.Name === this.searchTableData[i].Name) {
+            this.searchTableData.splice(i, 1)
+          }
+        }
+      }
+      this.searchTableData = this.searchTableData
+    },
+    // 查询扩展字段
+    searchKuoZhanData () {
+      this.data = []
+      service.postRequest('dashoo.biobank.bee-0.1', 'Sample', 'CustomizeSearch')
+        .then(res => {
+          var models = res.info.items
+          for (var i = 0; i < models.length; i++) {
+            var kuozhan = {
+              label: '',
+              children: []
+            }
+            if (i !== 0) {
+              // 和上一条数据是同一种类型,i-1>=0 数组下标不会越界
+              if (models[i].SampleTypeId === models[i - 1].SampleTypeId) {
+                this.data[this.data.length - 1].label = models[i].SampleTypeName
+                this.data[this.data.length - 1].children.push({ label: models[i].KuoZhanFieldName, sampleTypeId: models[i].SampleTypeId, FieldName: models[i].FieldName, FieldType: models[i].FieldType, TagIcon: models[i].TagIcon })
+              } else {
+                // 和上一条数据不是同一个样本类型
+                kuozhan.label = models[i].SampleTypeName
+                kuozhan.children.push({ label: models[i].KuoZhanFieldName, sampleTypeId: models[i].SampleTypeId, FieldName: models[i].FieldName, FieldType: models[i].FieldType, TagIcon: models[i].TagIcon })
+                // 不是同一种样本类型的时候需要增加一个元素
+                this.data.push(kuozhan)
+              }
+            } else {
+              // 第一次循环肯定要加入一个元素
+              kuozhan.label = models[i].SampleTypeName
+              kuozhan.children.push({ label: models[i].KuoZhanFieldName, sampleTypeId: models[i].SampleTypeId, FieldName: models[i].FieldName, FieldType: models[i].FieldType, TagIcon: models[i].TagIcon })
+              this.data.push(kuozhan)
+            }
+          }
+        })
+    },
+
+    getSampleSourceTypeExpand () {
+      this.data2 = []
+      service.postRequest('dashoo.biobank.bee-0.1', 'Sample', 'SourceTypeExpand')
+        .then(res => {
+          var models = res
+          // cascader判断
+          for (var i = 0; i < models.length; i++) {
+            var kuozhan = {
+              label: '',
+              children: []
+            }
+            if (i !== 0) {
+              // 和上一条数据是同一种类型,i-1>=0 数组下标不会越界
+              if (models[i].SampleSourceId === models[i - 1].SampleSourceId) {
+                this.data2[this.data2.length - 1].label = models[i].SampleSourceTypeName
+                this.data2[this.data2.length - 1].children.push({ label: models[i].KuoZhanFieldName, SampleSourceId: models[i].SampleSourceId, FieldName: models[i].FieldName, FieldType: models[i].FieldType, TagIcon: models[i].TagIcon })
+              } else {
+                // 和上一条数据不是同一个样本类型
+                kuozhan.label = models[i].SampleSourceTypeName
+                kuozhan.children.push({ label: models[i].KuoZhanFieldName, SampleSourceId: models[i].SampleSourceId, FieldName: models[i].FieldName, FieldType: models[i].FieldType, TagIcon: models[i].TagIcon })
+                // 不是同一种样本类型的时候需要增加一个元素
+                this.data2.push(kuozhan)
+              }
+            } else {
+              // 第一次循环肯定要加入一个元素
+              kuozhan.label = models[i].SampleSourceTypeName
+              kuozhan.children.push({ label: models[i].KuoZhanFieldName, SampleSourceId: models[i].SampleSourceId, FieldName: models[i].FieldName, FieldType: models[i].FieldType, TagIcon: models[i].TagIcon })
+              this.data2.push(kuozhan)
+            }
+          }
+        })
+    },
+
+    // 获取类型
+    acquritype (row) {
+      if (row.kuoz === 'false') {
+        for (var i = 0; i < this.data1.length; i++) {
+          if (this.data1[i].value === row.Field) {
+            return this.data1[i].type
+          }
+        }
+      }
+    },
+    getAllSearchTab () {
+      let _this = this
+      service.postRequest('dashoo.biobank.bee-0.1', 'Sample', 'GetSearchTemplate', { type: 'sample' })
+      // getSearchTemplate({ Type: 'sample' })
+        .then(res => {
+          if (res.info && res.info.items && res.info.items.length > 0) {
+            _this.searchTemplates = res.info.items.map(function (e) {
+              e.Fields = JSON.parse(e.Template)
+              return e
+            })
+            // //当前搜索模板的I
+
+            _this.currentSearchId = _this.searchTemplates[0].Id
+            _this.currentSearchTemplateName = _this.searchTemplates[0].Name
+            // console.log(_this.searchTemplates, 'searchTemplatessearchTemplatessearchTemplates')
+            // console.log(this.searchTemplates[0].Fields, "this.searchTemplates[0].Fields")
+            _this.searchTableData = this.getSearchTableData(this.searchTemplates[0].Fields)
+          } else {
+            // _this.$message({
+            //   type: 'warning',
+            //   message: res.data.message,
+            // })
+          }
+        })
+        .catch(err => {
+          // handle error
+          console.error(err)
+        })
+    },
+    beforeClose () {
+      this.$emit('close')
+      this.samplesourcesearchdialogVisable = false
+    },
+    removeSearchTab (Id, targetName) {
+      let _this = this
+      _this.$confirm('确定删除该条搜索模板, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        service.postRequest('dashoo.biobank.bee-0.1', 'Sample', 'DeleteSearchTemplate', {id: Id})
+          .then(res => {
+            if (res.info.code === 0) {
+              let tabs = _this.searchTemplates
+              let activeName = _this.currentSearchTemplateName
+              if (activeName === targetName) {
+                tabs.forEach((tab, index) => {
+                  if (tab.Name === targetName) {
+                    let nextTab = tabs[index + 1] || tabs[index - 1]
+                    if (nextTab) {
+                      activeName = nextTab.Name
+                      _this.searchTableData = this.getSearchTableData(nextTab.Fields)
+                    }
+                  }
+                })
+              }
+
+              this.$observer.$emit('handleSeach', true)
+              _this.currentSearchTemplateName = activeName
+              _this.searchTemplates = tabs.filter(tab => tab.Name !== targetName)
+            } else {
+              _this.$message({
+                type: 'warning',
+                message: res.info.message
+              })
+            }
+          })
+          .catch(err => {
+            // handle error
+            console.error(err)
+          })
+        this.searchTableData = []
+        this.currentSearchTemplateName = ''
+      })
+    },
+
+    saveAndSearchWithTemplate () {
+      let _this = this
+      this.saveSearchTemplate(function () {
+        _this.currentSearchTemplate = _this.currentSearchTemplateName
+        _this.searchWithTemplate(_this.currentSearchTemplateName)
+      })
+    },
+    // 自定义搜索名称发生变化
+    customsearchnamechange () {
+
+    },
+    // 重置
+    resetcustomcondition () {
+      this.searchTableData = []
+      this.currentSearchTemplateName = ''
+      this.currentSearchId = 0
+      this.searchTemplateName = ''
+    },
+    // 保存自定义的搜索条件
+    // 对表达式和逻辑关系要进行健壮性的判断
+    saveSearchTemplate () {
+      let _this = this
+      if (!this.searchTableData.length > 0) {
+        return
+      }
+      if (this.currentSearchTemplateName === '') {
+        this.$message({
+          type: 'warning',
+          message: '请输入自定义搜索名称'
+        })
+        return
+      }
+      if (this.searchTableData && this.searchTableData.length > 0) {
+        for (var i = 0; i < this.searchTableData.length; i++) {
+          // 判断表达式
+          if (this.searchTableData[i].Operate === '' || this.searchTableData[i].Operate === undefined || this.searchTableData[i].Operate === null) {
+            this.$message({
+              type: 'warning',
+              message: '【' + this.searchTableData[i].Name + '】表达式为空,保存失败!'
+            })
+            return
+          }
+          // 再判断逻辑关系 ,最后一个表达式不需要判断逻辑关系
+          if ((i != this.searchTableData.length - 1) && (this.searchTableData[i].Guanxi === '' || this.searchTableData[i].Guanxi === undefined || this.searchTableData[i].Guanxi === null)) {
+            this.$message({
+              type: 'warning',
+              message: '【' + this.searchTableData[i].Name + '】逻辑关系为空,保存失败!'
+            })
+            return
+          }
+
+          this.searchTableData[i].OrAnd = this.searchTableData[i].Guanxi
+        }
+      }
+
+      for (var m = 0; m < this.searchTableData.length; m++) {
+        if (this.searchTableData[m].Operate === 'between' && this.searchTableData[m].Value instanceof Array && this.searchTableData[m].Value.length === 2) {
+          this.searchTableData[m].Value = this.searchTableData[m].Value[0] + '--' + this.searchTableData[m].Value[1]
+        }
+        if (typeof this.searchTableData[m].Value === 'object') {
+          console.log(this.searchTableData[m].Value, '1111')
+          this.searchTableData[m].Value = this.searchTableData[m].Value.join('/')
+          console.log(this.searchTableData[m].Value, '2222')
+        }
+      }
+
+      let template = JSON.stringify(this.searchTableData)
+      console.log(template, '333')
+
+      // debugger
+      // // 这里再循环一遍是为了,让日期范围回填到table中,暂时没有想到好的办法,勿喷
+      // for (var j = 0; j < this.searchTableData.length; j++) {
+      //   if (this.searchTableData[j].Operate === 'between') {
+      //     this.searchTableData[j].Value = this.searchTableData[j].Value.split('--')
+      //   }
+      // }
+      // console.log(this.searchTableData, '22222222222222222222')
+
+      //   let s = ''
+      //   if (searchValue instanceof Array && searchValue.length > 0) {
+      //     if (searchValue[0] instanceof Date) {
+      //       let arr = []
+      //       for (let j = 0; j < searchValue.length; j++) {
+      //         arr.push(this.formatDateTime(searchValue[j]))
+      //       }
+      //       s = arr.join('--')
+      //     } else {
+      //       s = searchValue[searchValue.length - 1]
+      //     }
+      //   } else {
+      //     s =
+      // console.log(template, 'BBBBBBBBB')
+
+      // 保存确定
+      service.postRequest('dashoo.biobank.bee-0.1', 'Sample', 'putSearchTemplate', {templeteName: this.currentSearchTemplateName, currentSearchId: this.currentSearchId, template: template, type: 'sample'})
+      // putSearchTemplate(this.currentSearchTemplateName, this.currentSearchId, template, 'sample')
+        .then(res => {
+          if (res.info.code === 0) {
+            _this.$message({
+              type: 'success',
+              message: res.info.message
+            })
+            this.getAllSearchTab()
+            _this.closePopup()
+            this.$observer.$emit('handleSeach', true)
+          } else {
+            _this.$message({
+              type: 'warning',
+              message: res.info.message
+            })
+          }
+        })
+        .catch(err => {
+          // handle error
+          console.error(err)
+        })
+      // _this.resetcustomcondition()
+    },
+    clickmodeltypetag (val) {
+      // this.currentSearchTemplateName = val.getAttribute('id')
+      this.currentSearchTemplateName = val
+      for (let i = 0; i < this.searchTemplates.length; i++) {
+        if (this.searchTemplates[i].Name === this.currentSearchTemplateName) {
+          this.currentSearchId = this.searchTemplates[i].Id
+          this.searchTableData = this.getSearchTableData(this.searchTemplates[i].Fields)
+        }
+      }
+    },
+    getSearchTableData (searchFields) {
+      let data = searchFields.map(function (ele) {
+        // if (ele['OrAnd'] === 'or') {
+        //   ele['Guanxi'] = '或者'
+        // } else {
+        //   ele['Guanxi'] = '并且'
+        // }
+
+        // _this.searchTemplates.forEach((item) => {
+        //   item.Fields.forEach((it) => {
+        //     if (it.TagIcon == "cascader") {
+        //       it.Value = "[" + it.Value + "]"
+        //     }
+        //   })
+        // })
+        if (ele['Operate'] === 'between') {
+          ele['Value'] = ele['Value'].split('--')
+        }
+        if (ele.TagIcon == 'cascader') {
+          ele.Value = ele.Value.split('/')
+        }
+        return ele
+      })
+
+      return data || []
+    },
+
+    handleNodeClick (data) {
+      var converdata = {}
+      converdata.Name = data.label // 字段名称
+      converdata.Field = data.value // column
+      converdata.kuoz = 'false'
+      this.searchTableData.push(converdata)
+    },
+    handleNodeClicKuoZhan (data) {
+      // 样本类型下面的扩展字段是没有children的,所以可以用这种方式来判断
+      if (data.children === undefined || data.children.length === 0) {
+        var converdata = {}
+        converdata.Name = data.label // 字段名称
+        converdata.Field = data.FieldName // column
+        converdata.kuoz = 'true'
+        converdata.typecode = 'SampleType'
+        converdata.SampleTypeId = data.sampleTypeId
+        converdata.FieldType = data.FieldType
+        converdata.TagIcon = data.TagIcon
+        this.searchTableData.push(converdata)
+        console.log(this.searchTableData, data.TagIcon, 'datadatadatadatadatadatadatadata')
+        this.acquritypeN(data)
+      }
+    },
+    acquritypeN (row) {
+      for (var i = 0; i < this.searchTableData.length; i++) {
+        if (this.searchTableData[i].TagIcon === row.TagIcon) {
+          return this.searchTableData[i].TagIcon
+        }
+      }
+    },
+    handleNodeClicSource (data2) {
+      // 样本类型下面的扩展字段是没有children的,所以可以用这种方式来判断
+      if (data2.children === undefined || data2.children.length === 0) {
+        var converdata = {}
+
+        converdata.TagIcon = data2.TagIcon
+        converdata.Name = data2.label // 字段名称
+        converdata.Field = data2.FieldName // column
+        converdata.kuoz = 'true'
+        converdata.typecode = 'Sample'
+        converdata.SampleTypeId = parseInt(data2.SampleSourceId)
+        converdata.FieldType = data2.FieldType
+        this.searchTableData.push(converdata)
+        console.log(this.searchTableData)
+        this.acquritypeN(data2)
+      }
+    }
+
+  }
+}
+</script>
+<style lang="scss">
+.inputrow {
+  .el-date-editor.el-input,
+  .el-date-editor.el-input__inner {
+    margin-right: 30px;
+  }
+  .el-select {
+    width: 176px;
+    margin-right: 30px;
+  }
+}
+</style>

+ 884 - 0
src/dashoo.cn/frontend_animal/src/components/samples/samplesourcesearchdialog.vue

@@ -0,0 +1,884 @@
+<template>
+  <el-dialog title="样本来源自定义搜索"
+             :visible.sync="samplesourcesearchdialogVisable"
+             width="90%"
+             :before-close="beforeClose"
+             :close-on-click-modal="false">
+    <el-row class="inputrow">
+      <el-col :span="4">
+        <!-- <el-row> -->
+        <el-tabs type="border-card">
+          <el-tab-pane label="基础字段"
+                       style="height:calc(100vh - 370px)">
+            <div :style="{'width':'100%','height':tableHeight-60+'px','overflow':'auto'}">
+              <el-tree :data="data1"
+                       @node-click="handleNodeClick"></el-tree>
+            </div>
+          </el-tab-pane>
+          <el-tab-pane label="扩展字段"
+                       style="height:calc(100vh - 370px)">
+            <div :style="{'width':'100%','height':tableHeight-60+'px','overflow':'auto'}">
+              <el-tree :data="data"
+                       @node-click="handleNodeClicKuoZhan"></el-tree>
+            </div>
+          </el-tab-pane>
+<!--          <el-tab-pane label="样本来源"-->
+<!--                       style="height:calc(100vh - 370px)">-->
+<!--            <div :style="{'width':'100%','height':tableHeight-60+'px','overflow':'auto'}">-->
+<!--              <el-tree :data="data2"-->
+<!--                       @node-click="handleNodeClicSource"></el-tree>-->
+<!--            </div>-->
+<!--          </el-tab-pane>-->
+        </el-tabs>
+        <!-- </el-row> -->
+
+      </el-col>
+      <el-col :span="16">
+        <el-card>
+          <el-form inline
+                   label-width="120px">
+            <el-row>
+              <el-col>
+                <el-button size="mini"
+                           type="primary"
+                           style="margin-top:10px;"
+                           @click="resetcustomcondition()">新增方案</el-button>
+                <el-button size="mini"
+                           type="primary"
+                           style="margin-top:10px;"
+                           @click="saveSearchTemplate()">保存</el-button>
+                <el-form-item label="自定义搜索名称">
+                  <el-input v-model="currentSearchTemplateName"
+                            @change="customsearchnamechange()"
+                            size="mini"
+                            style="width:200px"
+                            placeholder="请输入自定义名称"></el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+
+          <el-table :data="searchTableData"
+                    size="mini"
+                    border
+                    style="width: 100%;margin-top:-60px"
+                    height="calc(100vh - 360px)">
+            <el-table-column prop="Name"
+                             label="字段"
+                             align="center"
+                             show-overflow-tooltip>
+            </el-table-column>
+            <el-table-column prop="Operate"
+                             label="表达式"
+                             align="center"
+                             width="200px"
+                             show-overflow-tooltip>
+              <template slot-scope="scope">
+                <el-select v-if="scope.row.TagIcon==='date'"
+                           v-model="scope.row.Operate">
+                  <el-option v-for="item in dateoptions"
+                             :key="item.value"
+                             :label="item.label"
+                             :value="item.value"></el-option>
+                </el-select>
+                <!--1. 基础字段是str类型 或者 2.是扩展字段但是不是日期类型 , -->
+                <el-select v-if="acquritype(scope.row)=='str'||(scope.row.kuoz==='true'&&scope.row.FieldType!==4)"
+                           v-model="scope.row.Operate">
+                  <el-option v-for="item in stroptions"
+                             :key="item.value"
+                             :label="item.label"
+                             :value="item.value"></el-option>
+                </el-select>
+                <!--如果基础字段是date类型,或者扩展字段并且是日期类型,那么就选用日期类型的表达式-->
+                <el-select v-else-if="acquritype(scope.row)=='str'||(scope.row.kuoz==='true'&&scope.row.FieldType===4)"
+                           v-model="scope.row.Operate">
+                  <el-option v-for="item in dateoptions"
+                             :key="item.value"
+                             :label="item.label"
+                             :value="item.value"></el-option>
+                </el-select>
+                <!-- <el-select v-else-if="scope.row.TagIcon==='date'"
+                           v-model="scope.row.Operate">
+                  <el-option v-for="item in dateoptions"
+                             :key="item.value"
+                             :label="item.label"
+                             :value="item.value"></el-option>
+                </el-select> -->
+
+                <!--如果基础字段是int类型,选用int表达式-->
+                <el-select v-else-if="acquritype(scope.row)=='int'"
+                           v-model="scope.row.Operate">
+                  <el-option v-for="item in intoptions"
+                             :key="item.value"
+                             :label="item.label"
+                             :value="item.value"></el-option>
+                </el-select>
+                <!--如果基础字段是cascader类型-->
+                <el-select v-else-if="acquritype(scope.row)=='cascader'"
+                           v-model="scope.row.Operate">
+                  <el-option v-for="item in dateoptions"
+                             :key="item.value"
+                             :label="item.label"
+                             :value="item.value"></el-option>
+                </el-select>
+                <!--如果基础字段是date类型,选用日期表达式-->
+                <el-select v-else-if="acquritype(scope.row)=='date'"
+                           v-model="scope.row.Operate">
+                  <el-option v-for="item in dateoptions"
+                             :key="item.value"
+                             :label="item.label"
+                             :value="item.value"></el-option>
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column prop="Value"
+                             label="值"
+                             width="250"
+                             align="center"
+                             show-overflow-tooltip>
+              <template slot-scope="scope">
+                <!--这个v-if 程序中不会走进来,是日期类型between and 的条件,不要删除-->
+                <el-date-picker v-model="scope.row.Value"
+                                type="daterange"
+                                v-if="acquritype(scope.row)==='date'&&scope.row.Operate==='between'"
+                                range-separator="至"
+                                start-placeholder="开始日期"
+                                end-placeholder="结束日期"
+                                value-format="yyyy-MM-dd"
+                                style="width:100%"></el-date-picker>
+                <!--如果基础字段是date类型,或者扩展字段的字段类型是日期类型-->
+                <el-date-picker v-model="scope.row.Value"
+                                v-else-if="acquritype(scope.row)==='date'||scope.row.FieldType===4"
+                                type="date"
+                                value-format="yyyy-MM-dd"
+                                :clearable="true"></el-date-picker>
+                <!--如果基础字段是str类型,就正常展示input-->
+                <!-- <el-input v-model="scope.row.Value"
+                          placeholder="请输入内容"
+                          v-else-if="acquritype(scope.row)==='str'||acquritype(scope.row)==='int'"></el-input> -->
+
+                <!--如果基础字段是cascader类型,就正常展示cascader-->
+
+                <el-cascader :options="orgtreelist"
+                             v-if="acquritypeN(scope.row)=='cascader'"
+                             :props="orgtreeprops"
+                             change-on-select
+                             v-model="scope.row.Value"
+                             placeholder="请选择"
+                             clearable
+                             @change="changecascader"></el-cascader>
+                <!-- <el-select v-if="acquritypeN(scope.row)=='select'"
+                           v-model="scope.row.Operate">
+                  <el-option v-for="item in intoptions"
+                             :key="item.value"
+                             :label="item.label"
+                             :value="item.value"></el-option>
+                </el-select> -->
+                <el-date-picker v-model="scope.row.Value"
+                                v-else-if="acquritypeN(scope.row)==='date'"
+                                type="date"
+                                value-format="yyyy-MM-dd"
+                                :clearable="true"></el-date-picker>
+                <el-input v-model="scope.row.Value"
+                          placeholder="请输入内容"
+                          v-else="acquritypeN(scope.row)=='input'"></el-input>
+              </template>
+            </el-table-column>
+            <el-table-column prop="Guanxi"
+                             label="逻辑关系"
+                             align="center"
+                             show-overflow-tooltip>
+              <template slot-scope="scope">
+                <el-select v-model="scope.row.Guanxi"
+                           v-if="scope.$index + 1 != searchTableData.length">
+                  <el-option v-for="item in orAndData"
+                             :key="item.value"
+                             :label="item.name"
+                             :value="item.value"></el-option>
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作"
+                             align="center"
+                             show-overflow-tooltip>
+              <template slot-scope="scope">
+                <el-button @click="removeCustomCondition(scope.row)"
+                           title="移除"
+                           type="danger"
+                           icon="el-icon-close"
+                           class="dashoo_button_2"
+                           circle
+                           size="small"></el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-card>
+      </el-col>
+      <el-col :span="4">
+        <el-card>
+          <el-tag v-for="tag in searchTemplates"
+                  :id="tag.Name"
+                  :key="tag.Name"
+                  closable
+                  class="reporttag reportselect"
+                  @click="clickmodeltypetag(tag.Name)"
+                  @close="removeSearchTab(tag.Id,tag.Name)">
+            <i class="el-icon-caret-right"
+               v-if="tag.Name === currentSearchTemplateName"></i>
+            {{tag.Name}}
+          </el-tag>
+        </el-card>
+      </el-col>
+    </el-row>
+  </el-dialog>
+</template>
+
+<script>
+import service from '../../utils/micro_request'
+export default {
+  name: 'customsearchdialog',
+
+  created () {
+    this.getOrgTreeList()
+  },
+  computed: {
+
+  },
+  // watch: {
+  //   visible (val) {
+  //     this.selfVisible = val
+  //   }
+
+  // },
+  data () {
+    return {
+      tableHeight: window.innerHeight - 230,
+      samplesourcesearchdialogVisable: false,
+      orAnd: 'and',
+      orgtreelist: [],
+      orgtreeprops: {
+        value: 'label',
+        label: 'label',
+        children: 'children'
+      },
+      orAndData: [{
+        name: '并且',
+        value: 'and'
+      },
+      {
+        name: '或者',
+        value: 'or'
+      }
+      ],
+      cascaderType: '',
+      selectType: '',
+      inputType: '',
+      selfVisible: this.visible, // 避免vue双向绑定警告
+      searchTableData: [],
+      searchTemplates: [],
+      currentSearchId: 0, // 当前自定义搜索模板的ID
+      currentSearchTemplateName: '', // 当前搜索名称
+      // 字符表达式选择
+      stroptions: [{
+        value: '=',
+        label: '等于'
+      },
+      {
+        value: '!=',
+        label: '不等于'
+      }, {
+        value: 'like',
+        label: '包含'
+      }
+      ],
+      // 数值类型表达式选择
+      intoptions: [{
+        value: '=',
+        label: '等于'
+      }, {
+        value: '>',
+        label: '大于'
+      }, {
+        value: '<',
+        label: '小于'
+      }, {
+        value: '>=',
+        label: '大于等于'
+      }, {
+        value: '!=',
+        label: '不等于'
+      }, {
+        value: '<=',
+        label: '小于等于'
+      }],
+      dateoptions: [{
+        value: '=',
+        label: '等于'
+      }, {
+        value: '>',
+        label: '大于'
+      }, {
+        value: '<',
+        label: '小于'
+      }, {
+        value: '>=',
+        label: '大于等于'
+      }, {
+        value: '!=',
+        label: '不等于'
+      }, {
+        value: '<=',
+        label: '小于等于'
+      }],
+      options: [{
+        value: '=',
+        label: '等于'
+      }, {
+        value: '>',
+        label: '大于'
+      }, {
+        value: '<',
+        label: '小于'
+      }, {
+        value: '>=',
+        label: '大于等于'
+      }, {
+        value: '!=',
+        label: '不等于'
+      }, {
+        value: '<=',
+        label: '小于等于'
+      }, {
+        value: 'like',
+        label: '包含'
+      }],
+      data1: [{
+        value: 'Area',
+        label: '取样地区',
+        type: 'str'
+      }, {
+        value: 'SurveyDate',
+        label: '采样日期',
+        type: 'date'
+      }, {
+        value: 'Genus',
+        label: '蜂种',
+        type: 'str'
+      }, {
+        value: 'Remark',
+        label: '备注信息',
+        type: 'str'
+      }, {
+        value: 'Altitude',
+        label: '海拔',
+        type: 'str'
+      }, {
+        value: 'ProjectName',
+        label: '项目属性',
+        type: 'str'
+      }, {
+        value: 'SampleTypestr',
+        label: '样本类型',
+        type: 'date'
+      }, {
+        value: 'Name',
+        label: '名称',
+        type: 'str'
+      }
+      //   {
+      //   value: 'Latitude',
+      //   label: '纬度',
+      //   type: 'str'
+      // }, {
+      //   value: 'Longitude',
+      //   label: '经度',
+      //   type: 'str'
+      // }
+      ],
+      data: [],
+      // data2: []
+    }
+  },
+
+  // mounted () {
+  //   let _this = this
+  //   window.clickmodeltypetag = function (val, e) {
+  //     _this.clickmodeltypetag(val)
+  //   }
+  // },
+  methods: {
+    getOrgTreeList () {
+      service.postRequest('dashoo.biobank.bee-0.1', 'SampleSource', 'BasicSampleType')
+        .then(res => {
+          this.orgtreelist = utils.toolfun_gettreejson(res.data, 'id', 'parent_id', 'id,label')
+        })
+        .catch(err => {
+          console.error(err)
+        })
+    },
+    toolfun_gettreejson (rows, idFieldName, pidFieldName, fileds) { // 工具方法,将扁平数据转化成tree格式数据
+      function nodejsonexists (rows, ParentId) {
+        for (var i = 0; i < rows.length; i++) {
+          if (rows[i][idFieldName] === ParentId) {
+            return true
+          }
+        }
+        return false
+      }
+
+      let nodes = []
+      // get the top level nodes
+      for (let i = 0; i < rows.length; i++) {
+        let row = rows[i]
+        if (!nodejsonexists(rows, row[pidFieldName])) {
+          var data = {
+            id: row[idFieldName]
+          }
+          let arrFiled = fileds.split(',')
+          for (var j = 0; j < arrFiled.length; j++) {
+            if (arrFiled[j] !== idFieldName) {
+              data[arrFiled[j]] = row[arrFiled[j]]
+            }
+          }
+          nodes.push(data)
+        }
+      }
+      let toDo = []
+      for (let i = 0; i < nodes.length; i++) {
+        toDo.push(nodes[i])
+      }
+      while (toDo.length) {
+        let node = toDo.shift() // the parent node
+        // get the children nodes
+        for (let i = 0; i < rows.length; i++) {
+          let row = rows[i]
+          if (row[pidFieldName] === node.id) {
+            let child = {
+              id: row[idFieldName]
+            }
+            let arrFiled = fileds.split(',')
+            for (let j = 0; j < arrFiled.length; j++) {
+              if (arrFiled[j] !== idFieldName) {
+                child[arrFiled[j]] = row[arrFiled[j]]
+              }
+            }
+            if (node.children) {
+              node.children.push(child)
+            } else {
+              node.children = [child]
+            }
+            toDo.push(child)
+          }
+        }
+      }
+      return nodes
+    },
+    changecascader (e) {
+      this.cascaderName = e.join('/')
+    },
+    // 清除弹框的绑定值
+    resetForm () {
+      // 自定义弹框数据
+      this.currentSearchTemplateName = '',
+        this.currentSearchId = 0,
+        this.searchTableData = [],
+        this.searchTemplates = [],
+        this.searchTemplateName = ''
+      // console.log('rest')
+    },
+    // 点击关闭时调用
+    closePopup () {
+      // console.log('close')
+      this.resetForm()
+      // this.resetcustomcondition()
+      this.samplesourcesearchdialogVisable = false
+    },
+
+    creatpage () {
+      // 黏膜搜索
+      this.searchKuoZhanData()
+      // this.getSampleSourceTypeExpand()
+      this.getAllSearchTab()
+      // this.resetForm()
+      // console.log("ddddd自定义搜索---currentSearchTemplateName", this.currentSearchTemplateName)
+    },
+    removeCustomCondition (row) {
+      if (this.searchTableData !== undefined && this.searchTableData != null && this.searchTableData.length > 0) {
+        for (var i = 0; i < this.searchTableData.length; i++) {
+          if (row.Name === this.searchTableData[i].Name) {
+            this.searchTableData.splice(i, 1)
+          }
+        }
+      }
+      this.searchTableData = this.searchTableData
+    },
+    // 查询扩展字段
+    searchKuoZhanData () {
+      this.data = []
+      service.postRequest('dashoo.biobank.bee-0.1', 'SampleSource', 'CustomizeSearch')
+        .then(res => {
+          var models = res.info.items
+          for (var i = 0; i < models.length; i++) {
+            var kuozhan = {
+              label: '',
+              children: []
+            }
+            if (i !== 0) {
+              // 和上一条数据是同一种类型,i-1>=0 数组下标不会越界
+              if (models[i].SampleTypeId === models[i - 1].SampleTypeId) {
+                this.data[this.data.length - 1].label = models[i].SampleTypeName
+                this.data[this.data.length - 1].children.push({ label: models[i].KuoZhanFieldName, sampleTypeId: models[i].SampleTypeId, FieldName: models[i].FieldName, FieldType: models[i].FieldType, TagIcon: models[i].TagIcon })
+              } else {
+                // 和上一条数据不是同一个样本类型
+                kuozhan.label = models[i].SampleTypeName
+                kuozhan.children.push({ label: models[i].KuoZhanFieldName, sampleTypeId: models[i].SampleTypeId, FieldName: models[i].FieldName, FieldType: models[i].FieldType, TagIcon: models[i].TagIcon })
+                // 不是同一种样本类型的时候需要增加一个元素
+                this.data.push(kuozhan)
+              }
+            } else {
+              // 第一次循环肯定要加入一个元素
+              kuozhan.label = models[i].SampleTypeName
+              kuozhan.children.push({ label: models[i].KuoZhanFieldName, sampleTypeId: models[i].SampleTypeId, FieldName: models[i].FieldName, FieldType: models[i].FieldType, TagIcon: models[i].TagIcon })
+              this.data.push(kuozhan)
+            }
+          }
+        })
+    },
+
+    // getSampleSourceTypeExpand () {
+    //   this.data2 = []
+    //   service.postRequest('dashoo.biobank.bee-0.1', 'SampleSource', 'SourceTypeExpand')
+    //     .then(res => {
+    //       var models = res
+    //       // cascader判断
+    //       for (var i = 0; i < models.length; i++) {
+    //         var kuozhan = {
+    //           label: '',
+    //           children: []
+    //         }
+    //         if (i !== 0) {
+    //           // 和上一条数据是同一种类型,i-1>=0 数组下标不会越界
+    //           if (models[i].SampleSourceId === models[i - 1].SampleSourceId) {
+    //             this.data2[this.data2.length - 1].label = models[i].SampleSourceTypeName
+    //             this.data2[this.data2.length - 1].children.push({ label: models[i].KuoZhanFieldName, SampleSourceId: models[i].SampleSourceId, FieldName: models[i].FieldName, FieldType: models[i].FieldType, TagIcon: models[i].TagIcon })
+    //           } else {
+    //             // 和上一条数据不是同一个样本类型
+    //             kuozhan.label = models[i].SampleSourceTypeName
+    //             kuozhan.children.push({ label: models[i].KuoZhanFieldName, SampleSourceId: models[i].SampleSourceId, FieldName: models[i].FieldName, FieldType: models[i].FieldType, TagIcon: models[i].TagIcon })
+    //             // 不是同一种样本类型的时候需要增加一个元素
+    //             this.data2.push(kuozhan)
+    //           }
+    //         } else {
+    //           // 第一次循环肯定要加入一个元素
+    //           kuozhan.label = models[i].SampleSourceTypeName
+    //           kuozhan.children.push({ label: models[i].KuoZhanFieldName, SampleSourceId: models[i].SampleSourceId, FieldName: models[i].FieldName, FieldType: models[i].FieldType, TagIcon: models[i].TagIcon })
+    //           this.data2.push(kuozhan)
+    //         }
+    //       }
+    //     })
+    // },
+
+    // 获取类型
+    acquritype (row) {
+      if (row.kuoz === 'false') {
+        for (var i = 0; i < this.data1.length; i++) {
+          if (this.data1[i].value === row.Field) {
+            return this.data1[i].type
+          }
+        }
+      }
+    },
+    getAllSearchTab () {
+      let _this = this
+      service.postRequest('dashoo.biobank.bee-0.1', 'SampleSource', 'GetSearchTemplate', { type: 'sample' })
+      // getSearchTemplate({ Type: 'sample' })
+        .then(res => {
+          if (res.info && res.info.items && res.info.items.length > 0) {
+            _this.searchTemplates = res.info.items.map(function (e) {
+              e.Fields = JSON.parse(e.Template)
+              return e
+            })
+            // //当前搜索模板的I
+
+            _this.currentSearchId = _this.searchTemplates[0].Id
+            _this.currentSearchTemplateName = _this.searchTemplates[0].Name
+            // console.log(_this.searchTemplates, 'searchTemplatessearchTemplatessearchTemplates')
+            // console.log(this.searchTemplates[0].Fields, "this.searchTemplates[0].Fields")
+            _this.searchTableData = this.getSearchTableData(this.searchTemplates[0].Fields)
+          } else {
+            // _this.$message({
+            //   type: 'warning',
+            //   message: res.data.message,
+            // })
+          }
+        })
+        .catch(err => {
+          // handle error
+          console.error(err)
+        })
+    },
+    beforeClose () {
+      this.$emit('close')
+      this.samplesourcesearchdialogVisable = false
+    },
+    removeSearchTab (Id, targetName) {
+      let _this = this
+      _this.$confirm('确定删除该条搜索模板, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        service.postRequest('dashoo.biobank.bee-0.1', 'SampleSource', 'DeleteSearchTemplate', {id: Id})
+          .then(res => {
+            if (res.info.code === 0) {
+              let tabs = _this.searchTemplates
+              let activeName = _this.currentSearchTemplateName
+              if (activeName === targetName) {
+                tabs.forEach((tab, index) => {
+                  if (tab.Name === targetName) {
+                    let nextTab = tabs[index + 1] || tabs[index - 1]
+                    if (nextTab) {
+                      activeName = nextTab.Name
+                      _this.searchTableData = this.getSearchTableData(nextTab.Fields)
+                    }
+                  }
+                })
+              }
+
+              this.$observer.$emit('handleSeach', true)
+              _this.currentSearchTemplateName = activeName
+              _this.searchTemplates = tabs.filter(tab => tab.Name !== targetName)
+            } else {
+              _this.$message({
+                type: 'warning',
+                message: res.info.message
+              })
+            }
+          })
+          .catch(err => {
+            // handle error
+            console.error(err)
+          })
+        this.searchTableData = []
+        this.currentSearchTemplateName = ''
+      })
+    },
+
+    saveAndSearchWithTemplate () {
+      let _this = this
+      this.saveSearchTemplate(function () {
+        _this.currentSearchTemplate = _this.currentSearchTemplateName
+        _this.searchWithTemplate(_this.currentSearchTemplateName)
+      })
+    },
+    // 自定义搜索名称发生变化
+    customsearchnamechange () {
+
+    },
+    // 重置
+    resetcustomcondition () {
+      this.searchTableData = []
+      this.currentSearchTemplateName = ''
+      this.currentSearchId = 0
+      this.searchTemplateName = ''
+    },
+    // 保存自定义的搜索条件
+    // 对表达式和逻辑关系要进行健壮性的判断
+    saveSearchTemplate () {
+      let _this = this
+      if (!this.searchTableData.length > 0) {
+        return
+      }
+      if (this.currentSearchTemplateName === '') {
+        this.$message({
+          type: 'warning',
+          message: '请输入自定义搜索名称'
+        })
+        return
+      }
+      if (this.searchTableData && this.searchTableData.length > 0) {
+        for (var i = 0; i < this.searchTableData.length; i++) {
+          // 判断表达式
+          if (this.searchTableData[i].Operate === '' || this.searchTableData[i].Operate === undefined || this.searchTableData[i].Operate === null) {
+            this.$message({
+              type: 'warning',
+              message: '【' + this.searchTableData[i].Name + '】表达式为空,保存失败!'
+            })
+            return
+          }
+          // 再判断逻辑关系 ,最后一个表达式不需要判断逻辑关系
+          if ((i != this.searchTableData.length - 1) && (this.searchTableData[i].Guanxi === '' || this.searchTableData[i].Guanxi === undefined || this.searchTableData[i].Guanxi === null)) {
+            this.$message({
+              type: 'warning',
+              message: '【' + this.searchTableData[i].Name + '】逻辑关系为空,保存失败!'
+            })
+            return
+          }
+
+          this.searchTableData[i].OrAnd = this.searchTableData[i].Guanxi
+        }
+      }
+
+      for (var m = 0; m < this.searchTableData.length; m++) {
+        if (this.searchTableData[m].Operate === 'between' && this.searchTableData[m].Value instanceof Array && this.searchTableData[m].Value.length === 2) {
+          this.searchTableData[m].Value = this.searchTableData[m].Value[0] + '--' + this.searchTableData[m].Value[1]
+        }
+        if (typeof this.searchTableData[m].Value === 'object') {
+          console.log(this.searchTableData[m].Value, '1111')
+          this.searchTableData[m].Value = this.searchTableData[m].Value.join('/')
+          console.log(this.searchTableData[m].Value, '2222')
+        }
+      }
+
+      let template = JSON.stringify(this.searchTableData)
+      console.log(template, '333')
+
+      // debugger
+      // // 这里再循环一遍是为了,让日期范围回填到table中,暂时没有想到好的办法,勿喷
+      // for (var j = 0; j < this.searchTableData.length; j++) {
+      //   if (this.searchTableData[j].Operate === 'between') {
+      //     this.searchTableData[j].Value = this.searchTableData[j].Value.split('--')
+      //   }
+      // }
+      // console.log(this.searchTableData, '22222222222222222222')
+
+      //   let s = ''
+      //   if (searchValue instanceof Array && searchValue.length > 0) {
+      //     if (searchValue[0] instanceof Date) {
+      //       let arr = []
+      //       for (let j = 0; j < searchValue.length; j++) {
+      //         arr.push(this.formatDateTime(searchValue[j]))
+      //       }
+      //       s = arr.join('--')
+      //     } else {
+      //       s = searchValue[searchValue.length - 1]
+      //     }
+      //   } else {
+      //     s =
+      // console.log(template, 'BBBBBBBBB')
+
+      // 保存确定
+      service.postRequest('dashoo.biobank.bee-0.1', 'Search', 'PutSearchTemplate', {templeteName: this.currentSearchTemplateName, currentSearchId: this.currentSearchId, template: template, type: 'sampleSource'})
+      // putSearchTemplate(this.currentSearchTemplateName, this.currentSearchId, template, 'sample')
+        .then(res => {
+          if (res.info.code === 0) {
+            _this.$message({
+              type: 'success',
+              message: res.info.message
+            })
+            this.getAllSearchTab()
+            _this.closePopup()
+            this.$observer.$emit('handleSeach', true)
+          } else {
+            _this.$message({
+              type: 'warning',
+              message: res.info.message
+            })
+          }
+        })
+        .catch(err => {
+          // handle error
+          console.error(err)
+        })
+      // _this.resetcustomcondition()
+    },
+    clickmodeltypetag (val) {
+      // this.currentSearchTemplateName = val.getAttribute('id')
+      this.currentSearchTemplateName = val
+      for (let i = 0; i < this.searchTemplates.length; i++) {
+        if (this.searchTemplates[i].Name === this.currentSearchTemplateName) {
+          this.currentSearchId = this.searchTemplates[i].Id
+          this.searchTableData = this.getSearchTableData(this.searchTemplates[i].Fields)
+        }
+      }
+    },
+    getSearchTableData (searchFields) {
+      let data = searchFields.map(function (ele) {
+        // if (ele['OrAnd'] === 'or') {
+        //   ele['Guanxi'] = '或者'
+        // } else {
+        //   ele['Guanxi'] = '并且'
+        // }
+
+        // _this.searchTemplates.forEach((item) => {
+        //   item.Fields.forEach((it) => {
+        //     if (it.TagIcon == "cascader") {
+        //       it.Value = "[" + it.Value + "]"
+        //     }
+        //   })
+        // })
+        if (ele['Operate'] === 'between') {
+          ele['Value'] = ele['Value'].split('--')
+        }
+        if (ele.TagIcon == 'cascader') {
+          ele.Value = ele.Value.split('/')
+        }
+        return ele
+      })
+
+      return data || []
+    },
+
+    handleNodeClick (data) {
+      var converdata = {}
+      converdata.Name = data.label // 字段名称
+      converdata.Field = data.value // column
+      converdata.kuoz = 'false'
+      this.searchTableData.push(converdata)
+    },
+    handleNodeClicKuoZhan (data) {
+      // 样本类型下面的扩展字段是没有children的,所以可以用这种方式来判断
+      if (data.children === undefined || data.children.length === 0) {
+        var converdata = {}
+        converdata.Name = data.label // 字段名称
+        converdata.Field = data.FieldName // column
+        converdata.kuoz = 'true'
+        converdata.typecode = 'SampleType'
+        converdata.SampleTypeId = data.sampleTypeId
+        converdata.FieldType = data.FieldType
+        converdata.TagIcon = data.TagIcon
+        this.searchTableData.push(converdata)
+        console.log(this.searchTableData, data.TagIcon, 'datadatadatadatadatadatadatadata')
+        this.acquritypeN(data)
+      }
+    },
+    acquritypeN (row) {
+      for (var i = 0; i < this.searchTableData.length; i++) {
+        if (this.searchTableData[i].TagIcon === row.TagIcon) {
+          return this.searchTableData[i].TagIcon
+        }
+      }
+    }
+    // handleNodeClicSource (data2) {
+    //   // 样本类型下面的扩展字段是没有children的,所以可以用这种方式来判断
+    //   if (data2.children === undefined || data2.children.length === 0) {
+    //     var converdata = {}
+    //
+    //     converdata.TagIcon = data2.TagIcon
+    //     converdata.Name = data2.label // 字段名称
+    //     converdata.Field = data2.FieldName // column
+    //     converdata.kuoz = 'true'
+    //     converdata.typecode = 'SampleSource'
+    //     converdata.SampleTypeId = parseInt(data2.SampleSourceId)
+    //     converdata.FieldType = data2.FieldType
+    //     this.searchTableData.push(converdata)
+    //     console.log(this.searchTableData)
+    //     this.acquritypeN(data2)
+    //   }
+    // }
+
+  }
+}
+</script>
+<style lang="scss">
+.inputrow {
+  .el-date-editor.el-input,
+  .el-date-editor.el-input__inner {
+    margin-right: 30px;
+  }
+  .el-select {
+    width: 176px;
+    margin-right: 30px;
+  }
+}
+</style>

+ 167 - 12
src/dashoo.cn/frontend_animal/src/pages/biobank/source/animal.vue

@@ -42,6 +42,11 @@
               查询
               <el-dropdown-menu slot="dropdown">
                 <el-dropdown-item command="search">高级查询</el-dropdown-item>
+                <el-dropdown-item style="color:black;"
+                                  v-for="item in searchTemplates"
+                                  :key="item.Name"
+                                  :command="item.Template">{{item.Name}}</el-dropdown-item>
+                <el-dropdown-item command="customize">自定义查询</el-dropdown-item>
                 <el-dropdown-item command="clear">查询重置</el-dropdown-item>
               </el-dropdown-menu>
             </el-dropdown>
@@ -64,11 +69,17 @@
             </span>
             <el-button size="small" type="text" icon="el-icon-delete" style="margin-left:3px;" title="删除"
                        @click="delSamplesSource(scope.row)"></el-button>
-            <router-link :to="'/biobank/source/'+ scope.row.Id + '/sourcedetail'">
+<!--            <router-link :to="'/biobank/source/'+ scope.row.Id + '/sourcedetail&size='+size+'&currentPage='+currentPage">-->
+<!--              <el-button size="small" title="详情" type="text" style="margin-left:3px;">-->
+<!--                <i class="icon icon-eye"></i>-->
+<!--              </el-button>-->
+<!--            </router-link>-->
+            <span
+              @click="sampleDetails(scope.row.Id)">
               <el-button size="small" title="详情" type="text" style="margin-left:3px;">
                 <i class="icon icon-eye"></i>
               </el-button>
-            </router-link>
+            </span>
           </template>
         </el-table-column>
         <el-table-column prop="Name" sortable min-width="80" label="样本源名称" align="center" show-overflow-tooltip>
@@ -197,14 +208,19 @@
         <el-button @click="importVisible = false" size="mini">取消</el-button>
       </div>
     </el-dialog>
+
+    <!-- 自定义查询 -->
+    <samplesourcesearchdialog @close="closeDialog"
+                        ref="samplesourcesearchdialog"></samplesourcesearchdialog>
   </div>
 </template>
 <script>
 import {
   mapGetters
 } from 'vuex'
-import exportExcel from '../../../api/system/auditsetting'
-import service from "../../../utils/micro_request";
+import service from '../../../utils/micro_request'
+import samplesourcesearchdialog from '../../../components/samples/samplesourcesearchdialog'
+import store from 'store'
 export default {
 
   computed: {
@@ -213,6 +229,9 @@ export default {
     })
   },
   name: 'samplessource',
+  components: {
+    samplesourcesearchdialog
+  },
   data () {
     return {
       filehost: '',
@@ -262,9 +281,46 @@ export default {
     }
   },
   created () {
+    let _this=this
+    // console.log('jlw', store.get('samplestoredseach'))
     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 (searchmodel.Name && searchmodel.BarCode !== '') { // 样本源名称
+          this.searchform.Name = searchmodel.Name
+        }
+        if (searchmodel.InnerNo && searchmodel.InnerNo != '') { // 来源内码
+
+          this.searchform.InnerNo = searchmodel.InnerNo
+        }
+        // if (searchmodel.CreateOn && searchmodel.CreateOn != '') { // 创建时间
+        //   console.log('111111', searchmodel.CreateOn)
+        //   this.CreateOn = searchmodel.CreateOn
+        // }
+        if (searchmodel.Genus && searchmodel.Genus != '') { // 蜂种
+
+          this.searchform.Genus = searchmodel.Genus
+        }
+        if (searchmodel.Address && searchmodel.Address != '') { // 取样地区
+          this.searchform.Address = searchmodel.Address
+        }
+        // if (searchmodel.SurveyDate && searchmodel.SurveyDate != '') { // 采样日期
+        //   this.SurveyDate = searchmodel.SurveyDate
+        // }
+        if (searchmodel.ProjectName && searchmodel.ProjectName) { // 项目属性
+          this.searchform.ProjectName = searchmodel.ProjectName
+        }
+        if (searchmodel.AuditorStatus && searchmodel.AuditorStatus) { // 审核状态
+          this.searchform.AuditorStatus = searchmodel.AuditorStatus
+        }
+        if (searchmodel.AuditorName && searchmodel.AuditorName) { // 审核人名称
+          this.searchform.AuditorName = searchmodel.AuditorName
+        }
+      }
+    } else {
+      store.set('samplestoredseach', '')
     }
     this.filehost = process.env.imgserverhost
     this.initdata()
@@ -278,11 +334,24 @@ export default {
     // 接收时this.$route.query.SourceName
     handlePush (name) {
       this.$router.push(
-        {path: '/samples/stored',
+        {
+          path: '/samples/stored',
           query: {name: name}
         }
       )
     },
+    sampleDetails (id) {
+      this.$router.push(
+        {
+          path: '/biobank/source/' + id + '/sourcedetail',
+          query: {
+            pname: 'biobank-source-animal',
+            size: this.size,
+            currentPage: this.currentPage
+          }
+        }
+      )
+    },
     initdata () {
       let _this = this
       let SurveyDate = []
@@ -296,6 +365,7 @@ export default {
         SurveyDate.push(_this.formatDateTime(_this.SurveyDate[0]))
         SurveyDate.push(_this.formatDateTime(_this.SurveyDate[1]))
       }
+      console.log('createon', _this.CreateOn)
       let CreateOn = []
       if (_this.CreateOn != null) {
         if (_this.CreateOn.length == 2) {
@@ -306,14 +376,34 @@ export default {
           CreateOn.push(_this.formatDateTime(_this.CreateOn[1]))
         }
       }
-
-      const params = {
+      if (store.get('samplestoredseach').CreateOn && store.get('samplestoredseach').CreateOn.length != 0) {
+        console.log('createOnOnOn', store.get('samplestoredseach').CreateOn)
+        let CreateOnTemp = store.get('samplestoredseach').CreateOn
+        CreateOn.push(CreateOnTemp[0])
+        CreateOn.push(CreateOnTemp[1])
+      }
+      if (store.get('samplestoredseach').SurveyDate && store.get('samplestoredseach').SurveyDate.length != 0) {
+        let SurveyDateTemp = store.get('samplestoredseach').SurveyDate
+        CreateOn.push(SurveyDateTemp[0])
+        CreateOn.push(SurveyDateTemp[1])
+      }
+      console.log('size---',this.size)
+      console.log('currentPage---',this.currentPage)
+      let params = {
         _currentPage: this.currentPage,
         _size: this.size,
         Order: this.Column.Order,
-        Prop: this.Column.Prop
+        Prop: this.Column.Prop,
       }
+      // _this.searchform.CreateOn = _this.CreateOn
       Object.assign(params, _this.searchform)
+      let params1 = {
+        CreateOn: _this.CreateOn
+      }
+      params = Object.assign(params, params1)
+      console.log('params', params)
+      store.set('samplestoredseach', params)
+      console.log('jlw', store.get('samplestoredseach'))
       _this.$axios.get('/samplessource/animallist?SurveyDate=' + SurveyDate.join(',') + '&CreateOn=' +
         CreateOn.join(','), {
         params
@@ -406,6 +496,62 @@ export default {
           console.error(err)
         })
     },
+    // 关闭自定义查询
+    closeDialog () {
+      this.getAllSearchTab()
+    },
+
+    getAllSearchTab () {
+      let _this = this
+      // getSearchTemplate({ Type: 'sample' })
+      service.postRequest('dashoo.biobank.bee-0.1', 'SampleRelated', 'ExportExcel', { type: 'sample' })
+        .then(res => {
+          if (res.info && res.info.items && res.info.items.length > 0) {
+            _this.searchTemplates = res.info.items.map(function (e) {
+              e.Fields = JSON.parse(e.Template)
+              return e
+            })
+            _this.currentSearchTemplateName = _this.searchTemplates[0].Name
+            _this.searchTableData = this.getSearchTableData(this.searchTemplates[0].Fields)
+          } else {
+            // _this.$message({
+            //   type: 'warning',
+            //   message: res.data.message,
+            // })
+            _this.searchTemplates = []
+          }
+        })
+        .catch(err => {
+          // handle error
+          console.error(err)
+        })
+    },
+    getSearchTableData (searchFields) {
+      let data = searchFields.map(function (ele) {
+        // if (ele['OrAnd'] === 'or') {
+        //   ele['Guanxi'] = '或者'
+        // } else {
+        //   ele['Guanxi'] = '并且'
+        // }
+
+        // _this.searchTemplates.forEach((item) => {
+        //   item.Fields.forEach((it) => {
+        //     if (it.TagIcon == "cascader") {
+        //       it.Value = "[" + it.Value + "]"
+        //     }
+        //   })
+        // })
+        if (ele['Operate'] === 'between') {
+          ele['Value'] = ele['Value'].split('--')
+        }
+        if (ele.TagIcon == 'cascader') {
+          ele.Value = ele.Value.split('/')
+        }
+        return ele
+      })
+
+      return data || []
+    },
     handleexportfileSuccess (res, file) {
       this.importfilepath = res
     },
@@ -446,6 +592,12 @@ export default {
     searchCommand (command) {
       if (command == 'search') {
         this.dialogVisible = true
+      } else if (command == 'customize') {
+        this.$refs.samplesourcesearchdialog.creatpage()
+        this.$refs.samplesourcesearchdialog.samplesourcesearchdialogVisable = true
+        // this.searchcolumn = this.showcolumn.filter(function (e) {
+        //   return e.filed !== 'PositionInfo'
+        // })
       } else if (command == 'clear') {
         this.clearSearch()
       }
@@ -571,7 +723,8 @@ export default {
         AuditorName: this.AuditorName,
         showcolumnarr: showcolumnarr + '',
         showcolumnnamearr: showcolumnnamearr + '',
-        ExportFlag: 'stored'
+        ExportFlag: 'stored',
+        Type: 'SampleType'
       }
       /*    if (this.CreateOn && this.CreateOn.length === 2) {
         let params2 = {
@@ -621,8 +774,9 @@ export default {
       }
       const dateInfo = this.formatExportDate(new Date())
       const name = dateInfo + '样本来源.xlsx'
+      console.log('filename', name)
       // 样本来源相关导出
-      service.downloadExcel('dashoo.biobank.bee-0.1', 'SampleSource', 'ExportExcel', name, params)
+      service.downloadExcel('dashoo.biobank.bee-0.1', 'SampleRelated', 'ExportExcel', name, params)
     },
     exportSamples () {
       // TODO 后台:所有样本来源创建一个sheet表,根据不同样本来源排序
@@ -635,7 +789,8 @@ export default {
         InnerNo: this.InnerNo,
         CreateOn: (this.CreateOn).join(','),
         currentPage: this.currentPage,
-        size: this.size
+        size: this.size,
+        Type: 'Sample'
       }
       for (var i = 0; i < _this.$refs.tableData.selection.length; i++) {
         if (i === _this.$refs.tableData.selection.length - 1) {
@@ -653,7 +808,7 @@ export default {
         params.size = 0
       }
       const name = dateInfo + '样本来源关联样本.xlsx'
-      service.downloadExcel('dashoo.biobank.bee-0.1', 'Sample', 'ExportExcel', name, params)
+      service.downloadExcel('dashoo.biobank.bee-0.1', 'SampleRelated', 'ExportExcel', name, params)
     },
     jstimehandle (val) {
       if (val === '') {

+ 12 - 2
src/dashoo.cn/frontend_animal/src/pages/samples/stored/index.vue

@@ -331,12 +331,17 @@
     <uploadattachdialog @close="uploaddialogcallback" :sampleinfo="sampleinfodetail"
       :visible.sync="dialoguploadVisible"></uploadattachdialog>
   </div>
+
+  <!-- 自定义 -->
+<!--  <customsearchdialog @close="closeDialog"-->
+<!--                      ref="customsearchdialog"></customsearchdialog>-->
 </template>
 <script>
   import batchrecoverydialog from '../../../components/samples/batchrecoverydialog'
   import store from 'store'
   import uploadattachdialog from '@/components/samples/uploadattachdialog'
   import draggable from 'vuedraggable'
+  // import customsearchdialog from '../../../components/samples/customsearchdialog'
   import {
     mapGetters
   } from 'vuex'
@@ -351,7 +356,8 @@
     components: {
       draggable,
       batchrecoverydialog,
-      uploadattachdialog
+      uploadattachdialog,
+      // customsearchdialog
     },
     data() {
       return {
@@ -447,7 +453,6 @@
     },
     created() {
       this.SourceName = this.$route.query.name
-      console.log(this.$route.query.name,"this.$route.query.SourceNamethis.$route.query.SourceNamethis.$route.query.SourceNamethis.$route.query.SourceName")
       this.acc = this.authUser.Profile.AccCode
       if (this.$route.query.size && this.$route.query.currentPage) {
         this.size = parseInt(this.$route.query.size)
@@ -1300,6 +1305,11 @@
         } else if (command == 'clear') {
           this.clearSearch()
         } else if (command == "编辑") {
+          // this.$refs.customsearchdialog.creatpage()
+          // this.$refs.customsearchdialog.customsearchdialogVisable = true
+          // this.searchcolumn = this.showcolumn.filter(function (e) {
+          //   return e.filed !== 'PositionInfo'
+          // })
           this.searchDialogVisible = true
           this.searchcolumn = this.showcolumn.filter(function (e) {
             return e.filed != "Location"

+ 1 - 1
src/dashoo.cn/frontend_animal/src/utils/micro_request.js

@@ -1,6 +1,6 @@
 import axios from 'axios'
 import { Notification, MessageBox, Message } from 'element-ui'
-import store from '@/store'
+import store from 'store'
 // import { getToken } from '@/utils/auth'
 import errorCode from '@/utils/errorCode'