浏览代码

浏览器升级滚动条 区号规则

shihang 6 年之前
父节点
当前提交
a48ae84cd9

+ 19 - 12
src/dashoo.cn/backend/api/controllers/biobank/samplessource.go

@@ -662,13 +662,14 @@ func (this *SamplesSourceController) AnimalList() {
 	var list []samplessource.AnimalInfo
 	genus := this.GetString("Genus")
 	name := this.GetString("Name")
-	tive := this.GetString("Tive")
 	innerno := this.GetString("InnerNo")
-	weight := this.GetString("Weight")
-	place := this.GetString("Place")
+	SurveyDate := this.GetString("SurveyDate")
+	SourceType := this.GetString("SourceType")
+	Address := this.GetString("Address")
+
 	svc := samplessource.GetSamplesSourceService(utils.DBE)
 	where := " 1=1"
-	orderby := "CreateOn"
+	orderby := "SurveyDate"
 	asc := false
 	Order := this.GetString("Order")
 	Prop := this.GetString("Prop")
@@ -684,18 +685,24 @@ func (this *SamplesSourceController) AnimalList() {
 	if name != "" {
 		where = where + " and Name like '%" + name + "%'"
 	}
-	if tive != "" {
-		where = where + " and Tive =" + tive + " "
-	}
 	if innerno != "" {
-		where = where + " and InnerNo = '" + innerno + "'"
+		where = where + " and InnerNo like '%" + innerno + "%'"
 	}
-	if weight != "" {
-		where = where + " and weight = '" + weight + "'"
+	if SurveyDate != "" {
+		dates := strings.Split(SurveyDate, ",")
+		if len(dates) == 2 {
+			minDate := dates[0]
+			maxDate := dates[1]
+			where = where + " and SurveyDate>='" + minDate + "' and SurveyDate<='" + maxDate + "'"
+		}
 	}
-	if place != "" {
-		where = where + " and Place = '" + place + "'"
+	if SourceType != "" {
+		where = where + " and SourceType = '" + SourceType + "'"
 	}
+	if Address != "" {
+		where = where + " and ( ProvinceName like '%" + Address + "% or CityName like '%" + Address + "% or StreetName like '%" + Address + "% or Address like '%" + Address + "%)'"
+	}
+
 	total := svc.GetPagingEntitiesWithOrderBytbl(this.User.AccCode, page.CurrentPage, page.Size, orderby, asc, &list, where)
 	var datainfo DataInfo
 	datainfo.Items = list

+ 2 - 2
src/dashoo.cn/frontend_animal/nuxt.config.js

@@ -159,8 +159,8 @@ module.exports = {
   },
 
   axios: {
-    // baseURL: '//localhost:9081/api/' // 本机开发使用
-    baseURL: '//47.92.238.200:9081/api/' // BioBank on ALi发布使用
+    baseURL: '//localhost:9081/api/' // 本机开发使用
+    // baseURL: '//47.92.238.200:9081/api/' // BioBank on ALi发布使用
     // baseURL: '//188.188.30.89:9081/api/' //临沂使用
     // baseURL: '//api09.labsop.cn/api/'
     // baseURL: '//192.168.0.211:10091/api/' // 花生所系统

+ 2 - 2
src/dashoo.cn/frontend_animal/src/components/samples/chooseanimal.vue

@@ -25,11 +25,11 @@
         </el-table-column>
         <el-table-column prop="Name" sortable min-width="80" label="样本源名称" align="center" show-overflow-tooltip>
         </el-table-column>
-        <el-table-column prop="Genus" sortable min-width="80" label="蜂种名称" align="center" show-overflow-tooltip>
+        <el-table-column prop="Genus" sortable min-width="80" label="蜂种" align="center" show-overflow-tooltip>
         </el-table-column>
         <el-table-column prop="InnerNo" sortable align="center" label="来源内码" min-width="110" show-overflow-tooltip>
         </el-table-column>
-        <el-table-column prop="AddressLine" sortable align="center" label="取样地" min-width="130" show-overflow-tooltip>
+        <el-table-column prop="AddressLine" sortable align="center" label="取样地" min-width="130" show-overflow-tooltip>
           <template slot-scope="scope">
             <p>{{getaddress(scope.row)}}</p>
           </template>

+ 35 - 29
src/dashoo.cn/frontend_animal/src/layouts/default.vue

@@ -1,48 +1,54 @@
-
 <template>
-	<div class="wrapper">
-	<headbar></headbar>
-	<section class="main">
+  <div class="wrapper">
+    <headbar></headbar>
+    <section class="main">
       <sidebar></sidebar>
       <main class="content">
-        <nuxt class="inner"></nuxt>
+        <nuxt class="inner" style="height: calc(100vh - 90px);"></nuxt>
       </main>
+
     </section>
     <div>
       <img src="/img/cryobiobank97K.png" style="width: 300px; height: 300px;display: none;" id="cryobiobank97Kimg">
-      <img src="/img/cryobiobank97K_bloodbag.png" style="width: 300px; height: 300px;display: none;" id="cryobiobank97K_bloodbagimg">
+      <img src="/img/cryobiobank97K_bloodbag.png" style="width: 300px; height: 300px;display: none;"
+        id="cryobiobank97K_bloodbagimg">
       <div id="divmenudiv" onmouseover="onoverdivmenu()" onmouseout="onoutdivmenu()" class="menudiv">
         <div class="menutext" style="display:none;" id="divmenutext">
         </div>
       </div>
     </div>
-	</div>
+  </div>
 </template>
 3
 <script>
-import { mapGetters } from 'vuex'
-// import Navbar from '@/components/Navbar'
-import Headbar from '@/components/Headbar'
-import Sidebar from '@/components/Sidebar'
+  import {
+    mapGetters
+  } from 'vuex'
+  // import Navbar from '@/components/Navbar'
+  import Headbar from '@/components/Headbar'
+  import Sidebar from '@/components/Sidebar'
 
-export default {
-  components: {
-    Headbar,
-		Sidebar
-  },
-  computed: {
-    ...mapGetters(['isMenuHidden'])
-  },
-  mounted() {
-    let _this = this
-    window.clickmenulink = function(val) {
-      _this.clickmenulink(val)
-    }
-  },
-  methods: {
-    clickmenulink(val) {
-      this.$router.push({path: val})
+  export default {
+    components: {
+      Headbar,
+      Sidebar
+    },
+    computed: {
+      ...mapGetters(['isMenuHidden'])
+    },
+    mounted() {
+      let _this = this
+      window.clickmenulink = function (val) {
+        _this.clickmenulink(val)
+      }
+    },
+    methods: {
+      clickmenulink(val) {
+        this.$router.push({
+          path: val
+        })
+      }
     }
   }
-}
+
 </script>

+ 27 - 16
src/dashoo.cn/frontend_animal/src/pages/biobank/source/_opera/operationb.vue

@@ -34,16 +34,15 @@
             <legend style="color:#436EEE"></legend>
             <i class="icon icon-paragraph-justify">基本信息</i>
           </div>
-          <el-row :gutter="20" class="customordetailcss">
+          <el-row :gutter="20">
             <el-col :span="8">
               <el-form-item label="样本源名称" prop="Name">
                 <el-input v-model="samplesForm.Name" placeholder="请输入样本源名称" style="width: 100%"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="蜂种名称" prop="Genus">
-                <el-select ref="reftube" v-model="samplesForm.Genus" placeholder="请选择蜂种名称" style="width:100%"
-                  filterable>
+              <el-form-item label="蜂种" prop="Genus">
+                <el-select ref="reftube" v-model="samplesForm.Genus" placeholder="请选择蜂种" style="width:100%" filterable>
                   <el-option v-for="item in genuslist" :label="item.Value" :value="item.Value" :key="item.Key">
                   </el-option>
                 </el-select>
@@ -76,7 +75,7 @@
               </el-form-item>
             </el-col>
             <el-col :span="16">
-              <el-form-item label="取样地" prop="Province">
+              <el-form-item label="取样地" prop="Province">
                 <el-row>
                   <el-col :span="10">
                     <el-cascader :options="countryoptions" :props="countryprops" maxlength="20" placeholder="省市区"
@@ -96,7 +95,7 @@
               </el-form-item>
             </el-col>
           </el-row>
-          <el-row class="customordetailcss">
+          <el-row>
             <el-col :span="8">
               <el-form-item label="经度">
                 <el-input v-model="samplesForm.Longitude" placeholder="请输入经度" style="width: 100%"></el-input>
@@ -472,7 +471,8 @@
         this.$axios.get('extends/listbylogin', {})
           .then(res => {
             this.animalextends = res.data
-            if (this.pid > '0') {
+            if (this.pid > '1' && this.pid != 'addsource') {
+              console.log("wewwwwwwwwwwwww", this.pid)
               this.getanimalinfo()
             }
           })
@@ -496,7 +496,6 @@
         let countstr = JSON.stringify(resultData.districts[0].districts)
         countstr = countstr.replace(/\,\"districts\"\:\[\]/g, '')
         this.countryoptions = JSON.parse(countstr)
-        console.log("1111111111111111111111111", this.countryoptions)
       },
       // getCountryList(val) {
       //   let tmpJson = JSON.parse(val)
@@ -511,23 +510,35 @@
       //   }
       // },
       handleAreaChange(value) {
-        console.log("wwwwwwwwwwwwwwwwwwwwwwwww", value)
         this.samplesForm.Province = value[0]
         this.samplesForm.City = value[1]
         this.samplesForm.Street = value[2]
         for (var i = 0; i < this.countryoptions.length; i++) {
           if (value[0] == this.countryoptions[i].adcode) {
             this.samplesForm.ProvinceName = this.countryoptions[i].name
-            for (var n = 0; n < this.countryoptions[i].districts.length; n++) {
-              if (value[1] == this.countryoptions[i].districts[n].adcode) {
-                this.samplesForm.CityName = this.countryoptions[i].districts[n].name
-                for (var m = 0; m < this.countryoptions[i].districts[n].districts.length; m++) {
-                  if (value[2] == this.countryoptions[i].districts[n].districts[m].adcode) {
-                    this.samplesForm.StreetName = this.countryoptions[i].districts[n].districts[m].name
-                    this.samplesForm.AreaCode = this.countryoptions[i].districts[n].districts[m].citycode
+            
+            if (this.countryoptions[i].districts) {
+              for (var n = 0; n < this.countryoptions[i].districts.length; n++) {
+                if (value[1] == this.countryoptions[i].districts[n].adcode) {
+                  this.samplesForm.CityName = this.countryoptions[i].districts[n].name
+
+                  if (this.countryoptions[i].districts[n].districts) {
+                    for (var m = 0; m < this.countryoptions[i].districts[n].districts.length; m++) {                   
+                      if (value[2] == this.countryoptions[i].districts[n].districts[m].adcode) {
+                        this.samplesForm.StreetName = this.countryoptions[i].districts[n].districts[m].name
+                        this.samplesForm.AreaCode = (Array(4).join(0) + this.countryoptions[i].districts[n].districts[m].citycode).slice(-4)
+                      }
+                    }
+                  } else {
+                    this.samplesForm.StreetName = this.countryoptions[i].districts[n].name
+                    this.samplesForm.AreaCode = (Array(4).join(0) + this.countryoptions[i].districts[n].citycode).slice(
+                      -4)
                   }
                 }
               }
+            } else {
+              this.samplesForm.StreetName = this.countryoptions[i].name
+              this.samplesForm.AreaCode = (Array(4).join(0) + this.countryoptions[i].citycode).slice(-4)
             }
           }
         }

+ 80 - 17
src/dashoo.cn/frontend_animal/src/pages/biobank/source/animal.vue

@@ -21,6 +21,10 @@
           <el-form-item label="来源内码">
             <el-input size="mini" style="width: 165px;" v-model="searchform.InnerNo" placeholder="请输入来源内码"></el-input>
           </el-form-item>
+          <el-form-item label="采样日期">
+            <el-date-picker size="mini" style="width: 220px" v-model="SurveyDate" type="daterange" range-separator="至"
+              start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
+          </el-form-item>
           <el-form-item>
             <el-dropdown split-button type="primary" size="mini" @click="seachdata" @command="searchCommand">
               查询
@@ -50,16 +54,24 @@
         </el-table-column>
         <el-table-column prop="Name" sortable min-width="80" label="样本源名称" align="center" show-overflow-tooltip>
         </el-table-column>
-        <el-table-column prop="Genus" sortable min-width="80" label="种属" align="center" show-overflow-tooltip>
+        <el-table-column prop="Genus" sortable min-width="80" label="蜂种" align="center" show-overflow-tooltip>
+        </el-table-column>
+        <el-table-column prop="InnerNo" sortable align="center" label="来源内码" min-width="120" show-overflow-tooltip>
         </el-table-column>
-        <el-table-column prop="InnerNo" sortable align="center" label="来源内码" min-width="90" show-overflow-tooltip>
+        <el-table-column prop="AddressLine" sortable align="center" label="取样地区" min-width="150" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <p>{{getaddress(scope.row)}}</p>
+          </template>
         </el-table-column>
         <el-table-column prop="Amount" sortable label="数量" align="center" show-overflow-tooltip min-width="60">
           <template slot-scope="scope">
             <p>{{scope.row.Amount}} {{scope.row.Unit}}</p>
           </template>
         </el-table-column>
-        <el-table-column prop="SourceType" sortable label="来源" align="center" show-overflow-tooltip min-width="60">
+        <el-table-column prop="SurveyDate" sortable align="center" label="采样日期" min-width="80" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <p>{{jstimehandle(scope.row.SurveyDate)}}</p>
+          </template>
         </el-table-column>
       </el-table>
       <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
@@ -78,9 +90,9 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="来源内码">
-              <el-input size="mini" v-model="searchform.InnerNo" style="width:100%" placeholder="请输入来源码"></el-input>
+              <el-input size="mini" v-model="searchform.InnerNo" style="width:100%" placeholder="请输入来源码"></el-input>
             </el-form-item>
-          </el-col>        
+          </el-col>
           <!-- <el-col :span="12">
             <el-form-item label="阴阳性">
               <el-select size="mini" v-model="searchform.Tive" style="width:100%" placeholder="请选择阴性阳性">
@@ -90,18 +102,39 @@
             </el-form-item>
           </el-col> -->
           <el-col :span="12">
-            <el-form-item label="蜂种名称">
-              <el-select ref="reftube" v-model="searchform.Genus" placeholder="请选择蜂种名称" style="width:100%" size="mini" filterable>
-                  <el-option v-for="item in genuslist" :label="item.Value" :value="item.Value" :key="item.Key">
-                  </el-option>
-                </el-select>
+            <el-form-item label="蜂种">
+              <el-select ref="reftube" v-model="searchform.Genus" placeholder="请选择蜂种" style="width:100%" size="mini"
+                filterable>
+                <el-option v-for="item in genuslist" :label="item.Value" :value="item.Value" :key="item.Key">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="取样地区">
+              <el-input size="mini" v-model="searchform.Address" style="width:100%" placeholder="请输入取样地区"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="采样日期">
+              <el-date-picker size="mini" style="width: 240px" v-model="SurveyDate" type="daterange" range-separator="至"
+                start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
             </el-form-item>
           </el-col>
           <el-col :span="12">
+            <el-form-item label="样本来源">
+              <el-select ref="refplace" v-model="searchform.SourceType" size="mini" style="width: 240px"
+                placeholder="请选择样本来源">
+                <el-option label="收捕" value="收捕"></el-option>
+                <el-option label="购买" value="购买"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <!-- <el-col :span="12">
             <el-form-item label="数量">
-              <el-input size="mini" v-model="searchform.Amount" style="width:100%" placeholder="请输入样本来源"></el-input>
+              <el-input size="mini" v-model="searchform.Amount" style="width:100%" placeholder="请输入数量(群)"></el-input>
             </el-form-item>
-          </el-col>         
+          </el-col> -->
         </el-row>
       </el-form>
       <span slot="footer" class="dialog-footer">
@@ -130,6 +163,7 @@
         searchform: {
           GenusId: '',
           Genus: '',
+          Address: '',
           InnerNo: '',
           Name: '',
           Weight: '',
@@ -139,6 +173,7 @@
           starttime: null,
           endtime: null,
         },
+        SurveyDate: [new Date(new Date().getTime() - 3 * 30 * 24 * 60 * 60 * 1000), new Date()], // 采样日期
         currentItemCount: 0,
         currentPage: 1,
         size: 10,
@@ -170,7 +205,18 @@
     methods: {
       initdata() {
         let _this = this
-        // paginate
+        let SurveyDate = []
+        if (!_this.SurveyDate) {
+          _this.SurveyDate = []
+        }
+        // 解析时间
+        if (_this.SurveyDate.length == 2) {
+          _this.SurveyDate[1].setHours(23)
+          _this.SurveyDate[1].setMinutes(59)
+          _this.SurveyDate[1].setSeconds(59)
+          SurveyDate.push(_this.formatDateTime(_this.SurveyDate[0]))
+          SurveyDate.push(_this.formatDateTime(_this.SurveyDate[1]))
+        }
         const params = {
           _currentPage: this.currentPage,
           _size: this.size,
@@ -178,7 +224,7 @@
           Prop: this.Column.Prop
         }
         Object.assign(params, _this.searchform)
-        _this.$axios.get('/samplessource/animallist', {
+        _this.$axios.get('/samplessource/animallist?SurveyDate=' + SurveyDate.join(','), {
             params
           })
           .then(res => {
@@ -186,10 +232,13 @@
             _this.currentItemCount = res.data.currentItemCount
           })
           .catch(err => {
-            // handle error
             console.error(err)
           })
       },
+      getaddress(val) {
+        let address = val.ProvinceName + val.CityName + val.StreetName + val.Address
+        return address
+      },
       getAnimalGenus() {
         // 获取种属
         let _this = this
@@ -247,11 +296,13 @@
         }
       },
       clearSearch() {
+        this.searchform.GenusId = ''
         this.searchform.Genus = ''
-        this.searchform.Weight = ''
+        this.searchform.Address = ''
+        this.searchform.InnerNo = ''
         this.searchform.SourceType = ''
         this.searchform.Name = ''
-        this.searchform.InnerNo = ''
+        this.SurveyDate = []
         this.initdata()
       },
       handleSizeChange(value) {
@@ -273,6 +324,18 @@
         var minute = date.getMinutes();
         minute = minute < 10 ? ('0' + minute) : minute;
         return y + '-' + m + '-' + d + ' ' + h + ':' + minute;
+      },
+      jstimehandle(val) {
+        if (val === '') {
+          return '----'
+        } else if (val === '0001-01-01T08:00:00+08:00') {
+          return '----'
+        } else if (val === '5000-01-01T23:59:59+08:00') {
+          return '永久'
+        } else {
+          val = val.replace('T', ' ')
+          return val.substring(0, 10)
+        }
       }
     }
   }

+ 29 - 13
src/dashoo.cn/frontend_animal/src/pages/samples/prerecorded/_opera/unhumanpre.vue

@@ -49,20 +49,21 @@
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="蜂种名称">
-                <el-input v-model="sourceform.Genus" placeholder="蜂种名称" disabled></el-input>
+              <el-form-item label="蜂种">
+                <el-input v-model="sourceform.Genus" placeholder="蜂种" disabled></el-input>
               </el-form-item>
             </el-col>
           </el-row>
           <el-row>
             <el-col :span="16">
-              <el-form-item label="取样地">
-                <el-input v-model="Address" placeholder="取样地" disabled></el-input>
+              <el-form-item label="取样地">
+                <el-input v-model="Address" placeholder="取样地" disabled></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="采样日期">
-                <el-date-picker v-model="sourceform.SurveyDate" type="date" style="width:100%" placeholder="选择日期" disabled>
+                <el-date-picker v-model="sourceform.SurveyDate" type="date" style="width:100%" placeholder="选择日期"
+                  disabled>
                 </el-date-picker>
               </el-form-item>
             </el-col>
@@ -147,7 +148,7 @@
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item label="分装份数">
+            <el-form-item label="分装份数" prop="SubpackageNum">
               <el-input-number v-model="sampleform.SubpackageNum" style="width:100%" :min="1" :max="30"
                 @blur="lostFocusSubpackageCapacityUse"></el-input-number>
             </el-form-item>
@@ -363,6 +364,13 @@
           callback();
         }
       };
+      var checkSubpackageNum = (rule, value, callback) => {
+        if (!isNaN(parseInt(value)) && !isNaN(value) && value > 0 && value < 100) {
+          callback();
+        } else {
+          callback(new Error("请输入正确数字值"));
+        }
+      };
       var checkCapacity = (rule, value, callback) => {
         if (!isNaN(parseFloat(value)) && !isNaN(value)) {
           if (parseFloat(value) <= 0) {
@@ -504,6 +512,10 @@
           //   validator: checkSampleCode,
           //   trigger: "blur"
           // }],
+          SubpackageNum: [{
+            validator: checkSubpackageNum,
+            trigger: "blur"
+          }],
           SampleTypestr: [{
             validator: checkSampleType,
             trigger: "change"
@@ -707,6 +719,7 @@
         this.sourceform.Amount = val.Amount
         this.sourceform.Unit = val.Unit
         this.sourceform.SourceType = val.SourceType
+        this.sourceform.SurveyDate = new Date(val.SurveyDate)
         this.amountuni = val.Amount + val.Unit
         this.Address = val.ProvinceName + val.CityName + val.StreetName + val.Address
         this.AreaCode = val.AreaCode
@@ -776,8 +789,7 @@
             _this.sampleform.SampleType = parseInt(_this.sampleform.SampleTypestr)
             _this.sampleform.SampleCode = _this.AreaCode + '-' + _this.GroupCode + '-' + _this.TypeCode
             _this.sampleform.Capacity = parseFloat(_this.sampleform.Capacitystr - _this.sampleform.UsedCapacity)
-              .toFixed(
-                2)
+              .toFixed(2)
             // 拼接扩展字段
             _this.SubpackageCapacity = parseFloat(_this.sampleform.SubpackageCapacity).toFixed(2)
             _this.SubpackageNum = _this.sampleform.SubpackageNum
@@ -875,7 +887,6 @@
         }).then(() => {
           _this.$axios.delete('samplepreinput/' + val.Id + '?sampletype=' + val.SampleType, null)
             .then(res => {
-              // response
               if (res.data.code === 0) {
                 _this.$message({
                   type: 'success',
@@ -904,9 +915,6 @@
         this.transportForm.BarCode = val.BarCode
         this.transportForm.SampleSize = val.InitCapacity
         this.transportForm.SampleUnit = val.Unit
-
-        //  this.transportForm.SamplingOrganName = val.SamplingOrganName
-        //   this.transportForm.SamplingSiteName = val.SamplingSiteName
         this.transportForm.Id = val.Id //样本子表ID
       },
       //获取样本分装预览详情列表信息
@@ -957,7 +965,15 @@
               })
               return
             } else {
-              _this.savedata()
+              if (_this.GroupCode == '') {
+                _this.$message({
+                  type: 'warning',
+                  message: '请选择群号!'
+                })
+                return
+              } else {
+                _this.savedata()
+              }
             }
           } else {
             return false