25.js 4.5 KB

1
  1. webpackJsonp([25],{"3BpD":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={data:function(){return{visible:!1,outerVisible:!1,innerVisible:!1,dataForm:{id:"",eartag:"",pigstyId:"",unitId:"",periodId:"",sex:"",birthday:"",healthStatus:!0,weight:"",originPlace:"",breed:"",outFenceStatus:0,motherEartag:"",fatherEartag:""},dataRule:{eartag:[{required:!0,message:"耳标不能为空",trigger:"blur"}],pigstyId:[{required:!0,message:"栋舍不能为空",trigger:"blur"}],unitId:[{required:!0,message:"单元不能为空",trigger:"blur"}],periodId:[{required:!0,message:"栏期不能为空",trigger:"blur"}]},gender:[{value:"公",label:"公"},{value:"母",label:"母"}],pigstyList:[],unitList:[],unitSelectedList:[],periodList:[],periodSelectedList:[],healthStatus:[{value:!0,label:"健康"},{value:!1,label:"不健康"}],breedList:[{value:1,label:"杜巴嘉"},{value:2,label:"长白"}],originPlaceList:[],outFenceStatus:[{value:0,label:"育肥"},{value:1,label:"出栏"}],dataList:[]}},methods:{getName:function(e){return{self:"自身",father:"父亲",mother:"母亲",fathermother:"祖母",fatherfather:"祖父",mothermother:"外祖母",motherfather:"外祖父"}[e]},init:function(e){var t=this;this.outerVisible=!0,this.$http({url:this.$http.adornUrl("/management/yearpigbase/queryByRelationship"),method:"get",params:this.$http.adornParams({eartag:e})}).then(function(e){var a=e.data;a&&0===a.code?(t.dataList=a.Result.value,console.log(t.dataList),console.log(a.Result.value)):(t.dataList=[],t.$message.error(a.msg))})},dataFormSubmit:function(){var e=this;this.$refs.dataForm.validate(function(t){console.log(t),t&&e.$http({url:e.$http.adornUrl(e.dataForm.id?"/management/yearpigbase/update":"/management/yearpigbase/batchLairage"),method:"post",data:e.$http.adornData({id:e.dataForm.id||void 0,eartag:e.dataForm.eartag,pigstyId:e.dataForm.pigstyId,unitId:e.dataForm.unitId,periodId:e.dataForm.periodId,sex:e.dataForm.sex,birthday:e.dataForm.birthday,healthStatus:e.dataForm.healthStatus,weight:e.dataForm.weight,originPlace:e.dataForm.originPlace,breed:e.dataForm.breed,outFenceTime:e.dataForm.outFenceTime,motherEartag:e.dataForm.motherEartag,fatherEartag:e.dataForm.fatherEartag})}).then(function(t){var a=t.data;a&&0===a.code?(e.visible=!1,e.$emit("refreshDataList"),e.$message({message:"操作成功",type:"success",duration:1500}),e.visible=!1):e.$message.error(a.msg)})})},changeBirth:function(e){var t=this,a=new Date(e);(new Date).getTime()-a.getTime()<0&&this.$confirm("出生日期有误","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.dataForm.birthday="",console.log("还没出生呢...")}).catch(function(){})}}},i={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{title:"谱系",visible:e.outerVisible},on:{"update:visible":function(t){e.outerVisible=t}}},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.dataList,border:"",stripe:"",size:"mini","header-cell-style":{background:"rgb(245,245,245)",color:"#000",height:"45px",fontSize:"13px",fontWeight:"normal",borderBottom:"1px solid #ccc"},"cell-style":{color:"#888",fontSize:"13px"}}},[a("el-table-column",{attrs:{"header-align":"center",align:"center",label:"身份"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(e.getName(t.row.name)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"eartag","header-align":"center",align:"center",label:"耳标"}}),e._v(" "),a("el-table-column",{attrs:{prop:"dayAge","header-align":"center",align:"center",label:"日龄"}}),e._v(" "),a("el-table-column",{attrs:{prop:"weight","header-align":"center",align:"center",label:"体重(千克)"}}),e._v(" "),a("el-table-column",{attrs:{prop:"breed","header-align":"center",align:"center",label:"品种"}}),e._v(" "),a("el-table-column",{attrs:{prop:"originPlace","header-align":"center",align:"center",label:"产地"}})],1),e._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"small"},on:{click:function(t){e.outerVisible=!1}}},[e._v("关闭")])],1)],1)},staticRenderFns:[]};var l=a("VU/8")(r,i,!1,function(e){a("gbn2")},"data-v-63904353",null);t.default=l.exports},GNkn:function(e,t,a){(e.exports=a("FZ+f")(!1)).push([e.i,"\n[data-v-63904353].el-table--mini td, .el-table--mini th[data-v-63904353] {\r\n padding: 3px 0 !important;\r\n height: 20px !important;\n}\r\n",""])},gbn2:function(e,t,a){var r=a("GNkn");"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);a("rjj0")("6b6da068",r,!0)}});