Jelajahi Sumber

自定义查询bug修改

gongyb 4 tahun lalu
induk
melakukan
d569b8d166

+ 58 - 121
src/dashoo.cn/frontend_animal/src/pages/samples/archived/index.vue

@@ -45,7 +45,7 @@
         </el-form>
       </div>
 
-      <el-table ref="multipleTable" :data="list" bordertooltip-effect="dark" border height="calc(100vh - 230px)"
+      <el-table ref="multipleTable" :data="donorsList" bordertooltip-effect="dark" border height="calc(100vh - 230px)"
         style="width: 100%;" @selection-change="handleSelectionChange" @header-dragend="header_dragend">
         <el-table-column type="selection" width="55"></el-table-column>
         <el-table-column label="操作" width="80" align="center" fixed>
@@ -122,7 +122,7 @@
             </el-form-item>
 
             <el-form-item label="容器类型">
-              <el-select size="mini" style="width:100%" v-model="value" placeholder="请选择">
+              <el-select size="mini" style="width:100%" v-model="DItem" placeholder="请选择" @change="GetEquipmentInfos">
                 <el-option
                   v-for="item in EquipmentList"
                   :key="item.DItem"
@@ -157,6 +157,22 @@
                 placeholder="结束日期">
               </el-date-picker>
             </el-form-item>
+            <el-form-item label="容器名称">
+              <el-select
+                size="mini"
+                v-model="EquipmentIds"
+                multiple
+                collapse-tags
+                style="width: 100%"
+                placeholder="请选择">
+                <el-option
+                  v-for="item in EquipmentInfosList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id">
+                </el-option>
+              </el-select>
+            </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="样本源名称">
@@ -198,121 +214,6 @@
       </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">
-          <el-col :span="10">
-            <el-form-item label="自定义搜索名称">
-              <el-input v-model="searchTemplateName" placeholder="请输入自定义名称" style="width:80%">
-              </el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="2">
-            <el-button @click="addSearchTab(searchTemplateName)">添加</el-button>
-          </el-col>
-        </el-row>
-      </el-form>
-      <el-row :gutter="0">
-        <el-col :span="5">
-          <div class="searchDialogLeftStyle">
-            <el-tag v-for="tag in searchTemplates" :id="tag.Name" :key="tag.Name" closable
-              class="reporttag reportselect" :onclick="'clickmodeltypetag(' + tag.Name + ')'"
-              style="display:block;text-align:center;color:white;" @close="removeSearchTab(tag.Name)">
-              <i class="el-icon-caret-right" v-if="tag.Name == currentSearchTemplateName"></i>
-              {{tag.Name}}
-            </el-tag>
-          </div>
-        </el-col>
-        <el-col :span="19">
-          <div class="searchDialogRightStyle">
-            <el-form ref="form" inline label-width="0px">
-              <el-row style="margin-top:10px;">
-                <el-col :span="24" style="margin-left:10px;">{{">> "+currentSearchTemplateName}}</el-col>
-              </el-row>
-              <el-row style="margin-top:10px;margin-bottom:10px;">
-                <el-col class="line" :span="24" style="background-color:lightgrey; line-height: 2px;">&nbsp;</el-col>
-              </el-row>
-              <el-row :gutter="1">
-                <el-col :span="5">
-                  <el-select v-model="searchField" @change="changeSearchField()" placeholder="请选择"
-                    style="margin-left:5px;margin-right:5px;">
-                    <el-option v-for="item in searchcolumn" :key="item.field" :label="item.name" :value="item.filed">
-                    </el-option>
-                  </el-select>
-                </el-col>
-                <el-col :span="8">
-                  <el-input v-if="searchField == 'BarCode'" v-model="searchValue.BarCode" placeholder="请输入样本条码"
-                    style="margin-left:5px;display:inline-block;"></el-input>
-                  <el-input v-else-if="searchField == 'SampleCode'" v-model="searchValue.SampleCode"
-                    placeholder="请输入样本编码"></el-input>
-                  <el-input v-else-if="searchField == 'SourceName'" v-model="searchValue.SourceName"
-                    placeholder="请输入样本源名称"></el-input>
-                  <el-input v-else-if="searchField == 'InnerCode'" v-model="searchValue.InnerCode"
-                    placeholder="请输入样本内码"></el-input>
-                  <el-input v-else-if="searchField == 'Name'" v-model="searchValue.Name" placeholder="请输入名称"></el-input>
-                  <el-input v-else-if="searchField == 'CreateBy'" v-model="searchValue.CreateBy" placeholder="请输入录入人">
-                  </el-input>
-                  <el-input v-else-if="searchField == 'GroupName'" v-model="searchValue.GroupName"
-                    placeholder="请输入所属分组"></el-input>
-                  <el-date-picker v-else-if="searchField == 'ReceiveDate'" v-model="searchValue.CreateOn"
-                    type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
-                    style="width:100%"></el-date-picker>
-                  <el-select v-else-if="searchField == 'SampleTypeName'" v-model="searchValue.SampleType" clearable
-                    placeholder="请选择" @change="selsampletypeChange" style="width:100%">
-                    <el-option v-for="item in sampletypes" :key="item.Id" :label="item.Name" :value="item.Name">
-                    </el-option>
-                  </el-select>
-                  <el-date-picker v-else-if="searchField == 'ValidityDate'" v-model="searchValue.Validity"
-                    type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
-                    style="width:100%">
-                  </el-date-picker>
-                  <el-input v-else-if="searchField == 'Capacity'" v-model="searchValue.Capacity" placeholder="请输入容量">
-                  </el-input>
-                  <el-input v-else-if="searchField == 'Location'" v-model="searchValue.Location" placeholder=" 请输入存储位置">
-                  </el-input>
-                  <el-input v-else v-model="searchValue.Extension" placeholder=""
-                    style="margin-left:5px;display:inline-block;"></el-input>
-                </el-col>
-                <el-col :span="3">
-                  <el-select v-model="orAnd" placeholder="请选择" style="margin-left:15px;">
-                    <el-option v-for="item in orAndData" :key="item.value" :label="item.name" :value="item.value">
-                    </el-option>
-                  </el-select>
-                </el-col>
-                <el-col :span="3">
-                  <el-button type="primary" size="middle" style="margin-left:5px;display:inline-block;"
-                    @click="addSearchField">添加</el-button>
-                </el-col>
-                <el-col :span="5">
-                  <el-button type="primary" size="middle" style="display:inline-block;"
-                    @click="saveAndSearchWithTemplate">查询</el-button>
-                  <el-button type="primary" size="middle" style="display:inline-block;" @click="saveSearchTemplate">保存
-                  </el-button>
-                </el-col>
-              </el-row>
-              <el-row style="margin-top:10px;">
-                <el-col class="line" :span="24" style="background-color:lightgrey; line-height: 2px;">&nbsp;</el-col>
-              </el-row>
-              <el-row>
-                <el-table :data="searchTableData" border style="width: 100%">
-                  <el-table-column prop="Name" label="检索名称" show-overflow-tooltip>
-                  </el-table-column>
-                  <el-table-column prop="Value" label="数值范围" width="300px" show-overflow-tooltip>
-                  </el-table-column>
-                  <el-table-column prop="Guanxi" label="查询关系" show-overflow-tooltip>
-                  </el-table-column>
-                  <el-table-column prop="Operate" label="操作" show-overflow-tooltip>
-                    <template slot-scope="scope">
-                      <el-button @click="deleteSearchField(scope.row)" type="text" size="small">删除</el-button>
-                    </template>
-                  </el-table-column>
-                </el-table>
-              </el-row>
-            </el-form>
-          </div>
-        </el-col>
-      </el-row>
-    </el-dialog>-->
 
     <!-- 自定义查询 -->
     <samplesearchdialog @close="closeDialog"
@@ -357,7 +258,10 @@
         EndDate: '', // 结束时期
         GroupName: '', // 所属分组
         Name: '', // 名称
+        DItem: '', // 容器类型id
         SourceName: '', // 样本来源
+        EquipmentInfosList: [], // 容器名称列表
+        EquipmentIds: [], // 设备id列表
         Validity: [], // 有效日期
         InnerCode: '', // 样本内码
         dialogFormVisible: false, // 添加弹框是否显示
@@ -581,6 +485,24 @@
         }
         this.currentSearchTemplate = ''
         let _this = this
+        // 增加自定义显示列,存储位置,之后需要去掉
+        let ishaslocation = false
+        for (let i = 0; i < _this.showcolumn.length; i++) {
+          if (_this.showcolumn[i].filed === 'Location') {
+            ishaslocation = true
+            break
+          }
+        }
+        if (!ishaslocation) {
+          _this.showcolumn.push({
+            filed: 'Location',
+            name: '存储位置',
+            show: true,
+            kuoz: false,
+            columnwidth: 200
+          })
+        }
+        // paginate
         let params = {
           _currentPage: this.currentPage,
           _size: this.size,
@@ -589,10 +511,10 @@
           SampleType: this.SampleType,
           Stnotevalue: this.Stnotevalue,
           STNoteField: this.STNoteField,
-          Noteitemvalue: this.Noteitemvalue,
-          Noteitem: this.Noteitem,
           CreateBy: this.CreateBy,
           SourceName: this.SourceName,
+          DItem: this.DItem,
+          EquipmentIds: this.EquipmentIds,
           Name: this.Name,
           Validity: this.Validity,
           CreateOn: this.CreateOn,
@@ -606,8 +528,16 @@
           }
           params = Object.assign(params, params2)
         }
-        store.set('samplearchivedseach', params)
-        this.$axios.get('/samplesfiles/animallist', {
+        if (this.Validity && this.Validity.length === 2) {
+          let params3 = {
+            Validitystart: this.Validity[0] / 1000,
+            Validityend: this.Validity[1] / 1000
+          }
+          params = Object.assign(params, params3)
+        }
+        store.set('samplestoredseach', params)
+        _this.getAllSearchTab()
+        this.$axios.get('/sampleinput/animallist', {
           params
         })
           .then(res => {
@@ -622,6 +552,12 @@
             this.EquipmentList = res.data
           })
       },
+      GetEquipmentInfos () {
+        service.postRequest('dashoo.biobank.bee-0.1', 'Equipment', 'GetEquipmentInfos', {DItem: this.DItem})
+          .then(res => {
+            this.EquipmentInfosList = res.data
+          })
+      },
       // 根据子code获取所有父code
       getparentcodebytopcode (v) {
         let _this = this
@@ -1315,6 +1251,7 @@
         this.SourceName = ''
         this.InnerCode = ''
         this.Name = ''
+        this.EquipmentIds = ''
         this.CreateBy = ''
         this.CreateOn = []
         this.SampleType = ''

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

@@ -49,7 +49,7 @@
         </el-form>
       </div>
 
-      <el-table ref="multipleTable" :data="list" bordertooltip-effect="dark" border height="calc(100vh - 230px)" style="width: 100%;"
+      <el-table ref="multipleTable" :data="donorsList" bordertooltip-effect="dark" border height="calc(100vh - 230px)" style="width: 100%;"
         @selection-change="handleSelectionChange" @header-dragend="header_dragend">
         <el-table-column type="selection" width="55"></el-table-column>
         <el-table-column label="操作" width="110" align="center" fixed>
@@ -123,7 +123,7 @@
             </el-form-item>
 
             <el-form-item label="容器类型">
-              <el-select size="mini" style="width:100%" v-model="value" placeholder="请选择">
+              <el-select size="mini" style="width:100%" v-model="DItem" placeholder="请选择" @change="GetEquipmentInfos">
                 <el-option
                   v-for="item in EquipmentList"
                   :key="item.DItem"
@@ -158,6 +158,22 @@
                 placeholder="结束日期">
               </el-date-picker>
             </el-form-item>
+            <el-form-item label="容器名称">
+              <el-select
+                size="mini"
+                v-model="EquipmentIds"
+                multiple
+                collapse-tags
+                style="width: 100%"
+                placeholder="请选择">
+                <el-option
+                  v-for="item in EquipmentInfosList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id">
+                </el-option>
+              </el-select>
+            </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="样本源名称">
@@ -341,6 +357,10 @@
         SampleCode: '', // 样本编码
         SampleType: '', // 样本类型
         Stnotevalue: '', // 特有扩展检索值
+        DItem: '', // 容器类型id
+        EquipmentList: [], // 容器类型列表
+        EquipmentIds: [], // 设备id列表
+        EquipmentInfosList: [], // 容器名称列表
         STNoteField: [], // 特有扩展名称
         CreateBy: '', // 录入人
         CreateOn: [], // 录入时期
@@ -583,20 +603,40 @@
         }
         this.currentSearchTemplate = ''
         let _this = this
+        // 增加自定义显示列,存储位置,之后需要去掉
+        let ishaslocation = false
+        for (let i = 0; i < _this.showcolumn.length; i++) {
+          if (_this.showcolumn[i].filed === 'Location') {
+            ishaslocation = true
+            break
+          }
+        }
+        if (!ishaslocation) {
+          _this.showcolumn.push({
+            filed: 'Location',
+            name: '存储位置',
+            show: true,
+            kuoz: false,
+            columnwidth: 200
+          })
+        }
+        // paginate
         let params = {
           _currentPage: this.currentPage,
           _size: this.size,
-          BarCode: _this.BarCode,
-          SampleCode: _this.SampleCode,
-          SampleType: _this.SampleType,
-          Stnotevalue: _this.Stnotevalue,
-          STNoteField: _this.STNoteField,
-          CreateBy: _this.CreateBy,
-          SourceName: _this.SourceName,
-          Name: _this.Name,
-          Validity: _this.Validity,
-          CreateOn: _this.CreateOn,
-          InnerCode: _this.InnerCode,
+          BarCode: this.BarCode,
+          SampleCode: this.SampleCode,
+          SampleType: this.SampleType,
+          Stnotevalue: this.Stnotevalue,
+          STNoteField: this.STNoteField,
+          CreateBy: this.CreateBy,
+          SourceName: this.SourceName,
+          DItem: this.DItem,
+          EquipmentIds: this.EquipmentIds,
+          Name: this.Name,
+          Validity: this.Validity,
+          CreateOn: this.CreateOn,
+          InnerCode: this.InnerCode,
           GroupName: _this.GroupName
         }
         if (this.CreateOn && this.CreateOn.length === 2) {
@@ -606,9 +646,16 @@
           }
           params = Object.assign(params, params2)
         }
-        // 返回时保存查找内容
-        store.set('sampleprerecordedseach', params)
-        this.$axios.get('/samplepreinput/animallist', {
+        if (this.Validity && this.Validity.length === 2) {
+          let params3 = {
+            Validitystart: this.Validity[0] / 1000,
+            Validityend: this.Validity[1] / 1000
+          }
+          params = Object.assign(params, params3)
+        }
+        store.set('samplestoredseach', params)
+        _this.getAllSearchTab()
+        this.$axios.get('/sampleinput/animallist', {
           params
         })
           .then(res => {
@@ -623,6 +670,12 @@
             this.EquipmentList = res.data
           })
       },
+      GetEquipmentInfos () {
+        service.postRequest('dashoo.biobank.bee-0.1', 'Equipment', 'GetEquipmentInfos', {DItem: this.DItem})
+          .then(res => {
+            this.EquipmentInfosList = res.data
+          })
+      },
       // 根据子code获取所有父code
       // getparentcodebytopcode(v) {
       //   let _this = this
@@ -1214,6 +1267,8 @@
       clearSearch () {
         this.BarCode = ''
         this.SampleCode = ''
+        this.DItem = ''
+        this.EquipmentIds = ''
         this.SourceName = ''
         this.InnerCode = ''
         this.Name = ''

+ 62 - 7
src/dashoo.cn/frontend_animal/src/pages/samples/waitingstore/index.vue

@@ -40,7 +40,7 @@
         </el-form>
       </div>
 
-      <el-table ref="multipleTable" :data="list" bordertooltip-effect="dark" border height="calc(100vh - 230px)" style="width: 100%;"
+      <el-table ref="multipleTable" :data="donorsList" bordertooltip-effect="dark" border height="calc(100vh - 230px)" style="width: 100%;"
         @selection-change="handleSelectionChange" @header-dragend="header_dragend">
         <el-table-column type="selection" width="55"></el-table-column>
         <el-table-column label="操作" width="80" align="center" fixed>
@@ -124,7 +124,7 @@
             </el-form-item>
 
             <el-form-item label="容器类型">
-              <el-select  size="mini" style="width:100%" v-model="value" placeholder="请选择">
+              <el-select size="mini" style="width:100%" v-model="DItem" placeholder="请选择" @change="GetEquipmentInfos">
                 <el-option
                   v-for="item in EquipmentList"
                   :key="item.DItem"
@@ -159,6 +159,22 @@
                 placeholder="结束日期">
               </el-date-picker>
             </el-form-item>
+            <el-form-item label="容器名称">
+              <el-select
+                size="mini"
+                v-model="EquipmentIds"
+                multiple
+                collapse-tags
+                style="width: 100%"
+                placeholder="请选择">
+                <el-option
+                  v-for="item in EquipmentInfosList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id">
+                </el-option>
+              </el-select>
+            </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="样本源名称">
@@ -331,6 +347,10 @@
         SampleCode: '', // 样本编码
         SampleType: '', // 样本类型
         Stnotevalue: '', // 特有扩展检索值
+        DItem: '', // 容器类型id
+        EquipmentList: [], // 容器类型列表
+        EquipmentInfosList: [], // 容器名称列表
+        EquipmentIds: [], // 设备id列表
         STNoteField: [], // 特有扩展名称
         CreateBy: '', // 录入人
         CreateOn: [], // 录入时期
@@ -539,6 +559,24 @@
         }
         this.currentSearchTemplate = ''
         let _this = this
+        // 增加自定义显示列,存储位置,之后需要去掉
+        let ishaslocation = false
+        for (let i = 0; i < _this.showcolumn.length; i++) {
+          if (_this.showcolumn[i].filed === 'Location') {
+            ishaslocation = true
+            break
+          }
+        }
+        if (!ishaslocation) {
+          _this.showcolumn.push({
+            filed: 'Location',
+            name: '存储位置',
+            show: true,
+            kuoz: false,
+            columnwidth: 200
+          })
+        }
+        // paginate
         let params = {
           _currentPage: this.currentPage,
           _size: this.size,
@@ -547,10 +585,10 @@
           SampleType: this.SampleType,
           Stnotevalue: this.Stnotevalue,
           STNoteField: this.STNoteField,
-          Noteitemvalue: this.Noteitemvalue,
-          Noteitem: this.Noteitem,
           CreateBy: this.CreateBy,
           SourceName: this.SourceName,
+          DItem: this.DItem,
+          EquipmentIds: this.EquipmentIds,
           Name: this.Name,
           Validity: this.Validity,
           CreateOn: this.CreateOn,
@@ -564,9 +602,16 @@
           }
           params = Object.assign(params, params2)
         }
-        // 返回时保存查找内容
-        store.set('samplewaitstoreseach', params)
-        this.$axios.get('/samplesunsave/animallist', {
+        if (this.Validity && this.Validity.length === 2) {
+          let params3 = {
+            Validitystart: this.Validity[0] / 1000,
+            Validityend: this.Validity[1] / 1000
+          }
+          params = Object.assign(params, params3)
+        }
+        store.set('samplestoredseach', params)
+        _this.getAllSearchTab()
+        this.$axios.get('/sampleinput/animallist', {
           params
         })
           .then(res => {
@@ -581,6 +626,12 @@
             this.EquipmentList = res.data
           })
       },
+      GetEquipmentInfos () {
+        service.postRequest('dashoo.biobank.bee-0.1', 'Equipment', 'GetEquipmentInfos', {DItem: this.DItem})
+          .then(res => {
+            this.EquipmentInfosList = res.data
+          })
+      },
       // 根据子code获取所有父code
       getparentcodebytopcode (v) {
         let _this = this
@@ -1030,6 +1081,8 @@
         this.BarCode = ''
         this.SampleCode = ''
         this.SourceName = ''
+        this.DItem = ''
+        this.EquipmentIds = ''
         this.InnerCode = ''
         this.Name = ''
         this.CreateBy = ''
@@ -1097,6 +1150,8 @@
           STNoteField: this.STNoteField,
           Noteitemvalue: this.Noteitemvalue,
           Noteitem: this.Noteitem,
+          DItem: this.DItem,
+          EquipmentIds: this.EquipmentIds,
           CreateBy: this.CreateBy,
           SourceName: this.SourceName,
           Name: this.Name,