5.js 17 KB

1
  1. webpackJsonp([5,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(){})}}},n={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 i=a("VU/8")(r,n,!1,function(e){a("gbn2")},"data-v-63904353",null);t.default=i.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",""])},Y20x:function(e,t,a){var r=a("wxmW");"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);a("rjj0")("7a04b2ae",r,!0)},eB9R:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("Xxa5"),n=a.n(r),i=a("BO1k"),l=a.n(i),o=a("exGp"),s=a.n(o),d={data:function(){return{form:{eartag:"",sex:"",breed:"",healthStatus:"",outFenceStatus:"",periodId:"",pigstyId:"",unitId:""},dataList:[],pageIndex:1,pageSize:10,totalPage:0,dataListLoading:!1,dataListSelections:[],detailsVisible:!1,farmId:void 0,gender:[{value:"公",label:"公"},{value:"母",label:"母"}],breed:[{value:1,label:"杜巴嘉"},{value:2,label:"长白"}],healthStatus:[{value:!0,label:"健康"},{value:!1,label:"不健康"}],outFenceStatus:[{value:0,label:"育肥"},{value:1,label:"出栏"}],periodList:[],periodSelectedList:[],pigstyList:[],unitList:[],unitSelectedList:[],labelPosition:"right"}},components:{Details:a("3BpD").default},activated:function(){this.getDataList()},methods:{getDataList:function(){var e,t=this;this.dataListLoading=!0,this.$http({url:this.$http.adornUrl("/management/yearpigbase/list"),method:"get",params:this.$http.adornParams({page:this.pageIndex,limit:this.pageSize})}).then((e=s()(n.a.mark(function e(a){var r,i,o,s,d,c,u=a.data;return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.pigstyList=[],r=[],e.next=4,t.$http({url:t.$http.adornUrl("/management/pigsty/findAll"),method:"get",params:t.$http.adornParams({})});case 4:return(i=e.sent).data.all&&(r=i.data.all),r.forEach(function(e){var a={value:e.id,label:e.number};t.pigstyList.push(a)}),t.unitList=[],o=[],e.next=11,t.$http({url:t.$http.adornUrl("/management/unit/findAll"),method:"get",params:t.$http.adornParams({})});case 11:return(s=e.sent).data.all&&(o=s.data.all),o.forEach(function(e){var a={value:e.id,label:e.number,pigstyId:e.pigstyId,farmId:e.farmId};t.unitList.push(a)}),t.unitSelectedList=t.unitList,t.periodList=[],d=[],e.next=19,t.$http({url:t.$http.adornUrl("/management/period/findAll"),method:"get",params:t.$http.adornParams({})});case 19:(c=e.sent).data.all&&(d=c.data.all),d.forEach(function(e){var a={value:e.id,label:e.number,pigstyId:e.pigstyId};t.periodList.push(a)}),t.periodSelectedList=t.periodList,u&&0===u.code?(t.dataList=u.page.list,t.totalPage=u.page.totalCount):(t.dataList=[],t.totalPage=0,t.$message.error(u.msg)),t.dataList.forEach(function(e){var a=!0,r=!1,n=void 0;try{for(var i,o=l()(t.unitList);!(a=(i=o.next()).done);a=!0){var s=i.value;if(e.unitId===s.value){e.unitNumber=s.label,e.farmId=s.farmId,e.pigstyId=s.pigstyId;break}}}catch(e){r=!0,n=e}finally{try{!a&&o.return&&o.return()}finally{if(r)throw n}}var d=!0,c=!1,u=void 0;try{for(var p,g=l()(t.pigstyList);!(d=(p=g.next()).done);d=!0){var h=p.value;if(e.pigstyId===h.value){e.phNumber=h.label;break}}}catch(e){c=!0,u=e}finally{try{!d&&g.return&&g.return()}finally{if(c)throw u}}var m=!0,f=!1,b=void 0;try{for(var v,y=l()(t.periodList);!(m=(v=y.next()).done);m=!0){var x=v.value;if(e.periodId===x.value){e.periodNumber=x.label;break}}}catch(e){f=!0,b=e}finally{try{!m&&y.return&&y.return()}finally{if(f)throw b}}}),t.dataListLoading=!1;case 26:case"end":return e.stop()}},e,t)})),function(t){return e.apply(this,arguments)}))},pigstyChange:function(e){this.unitSelectedList=this.unitList.filter(function(t){return t.pigstyId===e}),this.periodSelectedList=this.periodList.filter(function(t){return t.pigstyId===e})},ifPigsty:function(e){this.form.pigstyId||(this.$message.error("请先选择猪舍"),this.form[e]="")},clearAll:function(){for(var e in this.form)this.form[e]="";this.unitSelectedList=this.unitList,this.periodSelectedList=this.periodList},sizeChangeHandle:function(e){this.pageSize=e,this.pageIndex=1,this.getDataList()},currentChangeHandle:function(e){this.pageIndex=e,this.getDataList()},selectionChangeHandle:function(e){this.dataListSelections=e},detailsHandle:function(e){var t=this;this.detailsVisible=!0,this.$nextTick(function(){t.$refs.details.init(e.eartag)})},deleteHandle:function(e){var t=this,a=e?[e]:this.dataListSelections.map(function(e){return e.id});this.$confirm("确定对[id="+a.join(",")+"]进行["+(e?"删除":"批量删除")+"]操作?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.$http({url:t.$http.adornUrl("/management/yearpigbase/delete"),method:"post",data:t.$http.adornData(a,!1)}).then(function(e){var a=e.data;a&&0===a.code?t.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){t.getDataList()}}):t.$message.error(a.msg)})}).catch(function(){})}},watch:{"form.pigstyId":{handler:function(e,t){t&&(this.form.unitId="",this.form.periodId="")}}}},c={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"mod-role"},[a("el-container",[a("el-header",[a("div",{staticClass:"rect rect-form"},[a("el-form",{ref:"form",attrs:{inline:!0,model:e.form,size:"mini"},nativeOn:{keyup:function(t){if(!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.getDataList()}}},[a("el-form-item",[a("el-input",{attrs:{placeholder:"耳标",clearable:""},model:{value:e.form.eartag,callback:function(t){e.$set(e.form,"eartag",t)},expression:"form.eartag"}})],1),e._v(" "),a("el-form-item",{staticStyle:{width:"140px"}},[a("el-select",{attrs:{placeholder:"性别"},model:{value:e.form.sex,callback:function(t){e.$set(e.form,"sex",t)},expression:"form.sex"}},e._l(e.gender,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],1),e._v(" "),a("el-form-item",{staticStyle:{width:"140px"}},[a("el-select",{attrs:{placeholder:"品种"},model:{value:e.form.breed,callback:function(t){e.$set(e.form,"breed",t)},expression:"form.breed"}},e._l(e.breed,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],1),e._v(" "),a("el-form-item",{staticStyle:{width:"140px"}},[a("el-select",{attrs:{placeholder:"健康状态"},model:{value:e.form.healthStatus,callback:function(t){e.$set(e.form,"healthStatus",t)},expression:"form.healthStatus"}},e._l(e.healthStatus,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],1),e._v(" "),a("el-form-item",{staticStyle:{width:"140px"}},[a("el-select",{attrs:{placeholder:"养殖状态"},model:{value:e.form.outFenceStatus,callback:function(t){e.$set(e.form,"outFenceStatus",t)},expression:"form.outFenceStatus"}},e._l(e.outFenceStatus,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],1),e._v(" "),a("el-form-item",{staticStyle:{width:"140px"}},[a("el-select",{attrs:{placeholder:"猪舍"},on:{change:e.pigstyChange},model:{value:e.form.pigstyId,callback:function(t){e.$set(e.form,"pigstyId",t)},expression:"form.pigstyId"}},e._l(e.pigstyList,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],1),e._v(" "),a("el-form-item",{staticStyle:{width:"140px"}},[a("el-select",{attrs:{placeholder:"单元"},on:{change:function(t){e.ifPigsty("unitId")}},model:{value:e.form.unitId,callback:function(t){e.$set(e.form,"unitId",t)},expression:"form.unitId"}},e._l(e.unitSelectedList,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],1),e._v(" "),a("el-form-item",{staticStyle:{width:"140px"}},[a("el-select",{attrs:{placeholder:"栏期"},on:{change:function(t){e.ifPigsty("periodId")}},model:{value:e.form.periodId,callback:function(t){e.$set(e.form,"periodId",t)},expression:"form.periodId"}},e._l(e.periodSelectedList,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{icon:"el-icon-search"},on:{click:function(t){e.getDataList()}}},[e._v("查 询")])],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{icon:"el-icon-circle-close"},on:{click:e.clearAll}},[e._v("清 空")])],1)],1)],1)]),e._v(" "),a("el-main",[a("div",{staticClass:"rect rect-table"},[a("el-form",{attrs:{inline:"",size:"mini"}},[a("el-form-item",[a("el-button",{attrs:{icon:"el-icon-plus"},on:{click:function(t){e.addOrUpdateHandle()}}},[e._v("\n 新 增\n ")])],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{icon:"el-icon-delete",type:"danger",disabled:e.dataListSelections.length<=0},on:{click:function(t){e.deleteHandle()}}},[e._v("\n 删 除\n ")])],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{icon:"el-icon-edit",type:"danger",disabled:e.dataListSelections.length<=0},on:{click:function(t){e.addOrUpdateHandle()}}},[e._v("\n 批量修改\n ")])],1)],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.dataListLoading,expression:"dataListLoading"}],staticStyle:{width:"100%"},attrs:{data:e.dataList,border:"",stripe:"",size:"mini",height:"540","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"}},on:{"selection-change":e.selectionChangeHandle}},[a("el-table-column",{attrs:{type:"selection","header-align":"center",align:"center",width:"50"}}),e._v(" "),a("el-table-column",{attrs:{prop:"id","header-align":"center",align:"center",label:"id"}}),e._v(" "),a("el-table-column",{attrs:{prop:"eartag","header-align":"center",align:"center",label:"耳标"}}),e._v(" "),a("el-table-column",{attrs:{prop:"sex","header-align":"center",align:"center",label:"性别"}}),e._v(" "),a("el-table-column",{attrs:{prop:"pigstyName","header-align":"center",align:"center",label:"猪舍"}}),e._v(" "),a("el-table-column",{attrs:{prop:"unitName","header-align":"center",align:"center",label:"单元"}}),e._v(" "),a("el-table-column",{attrs:{prop:"periodName","header-align":"center",align:"center",label:"栏期"}}),e._v(" "),a("el-table-column",{attrs:{fixed:"right","header-align":"center",align:"center",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{staticStyle:{color:"rgb(24,144,255)"},attrs:{type:"text",size:"medium"},on:{click:function(a){e.detailsHandle(t.row)}}},[e._v("\n 查看谱系\n ")])]}}])})],1),e._v(" "),a("el-pagination",{attrs:{"current-page":e.pageIndex,"page-sizes":[10,20,50,100],"page-size":e.pageSize,total:e.totalPage,layout:"total, sizes, prev, pager, next, jumper"},on:{"size-change":e.sizeChangeHandle,"current-change":e.currentChangeHandle}}),e._v(" "),e.detailsVisible?a("Details",{ref:"details",on:{refreshDataList:e.getDataList}}):e._e()],1)])],1)],1)},staticRenderFns:[]};var u=a("VU/8")(d,c,!1,function(e){a("Y20x")},"data-v-464b2f46",null);t.default=u.exports},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)},wxmW:function(e,t,a){(e.exports=a("FZ+f")(!1)).push([e.i,"\n.rect[data-v-464b2f46] {\r\n background-color: #fff;\r\n padding: 30px 15px;\r\n border-radius: 5px;\r\n border: 1px solid #e8e8e8;\n}\n.rect-form[data-v-464b2f46] {\r\n padding-bottom: 10px;\n}\n.rect-table[data-v-464b2f46] {\r\n margin-top: 20px;\n}\n.demo-table-expand[data-v-464b2f46] {\r\n font-size: 0;\r\n margin-left: 40px;\n}\n.demo-table-expand label[data-v-464b2f46] {\r\n width: 90px;\r\n color: #99a9bf;\n}\n.demo-table-expand .el-form-item[data-v-464b2f46] {\r\n margin-right: 0;\r\n margin-bottom: 0;\r\n width: 80%;\n}\n.el-table .height[data-v-464b2f46] {\r\n background: rgba(254, 254, 254, 0.5);\n}\n[data-v-464b2f46].el-table--mini td, .el-table--mini th[data-v-464b2f46] {\r\n padding: 3px 0 !important;\r\n height: 20px !important;\n}\n[data-v-464b2f46].el-checkbox__input.is-checked+.el-checkbox__label {\r\n color: rgb(24,144,255);\r\n background-color: rgb(24,144,255);\r\n border-color: rgb(24,144,255);\n}\n[data-v-464b2f46].el-table .el-checkbox__input.is-checked .el-checkbox__inner, .el-checkbox__input.is-indeterminate .el-checkbox__inner[data-v-464b2f46] {\r\n background-color: rgb(24,144,255);\r\n border-color: rgb(24,144,255);\n}\n[data-v-464b2f46].el-table .el-checkbox__inner:hover {\r\n border-color: rgb(24,144,255);\n}\n[data-v-464b2f46].el-table .el-checkbox__input.is-focus .el-checkbox__inner {\r\n border-color: rgb(24,144,255);\n}\n[data-v-464b2f46].el-table #select .cell .el-checkbox__input.is-checked .el-checkbox__inner, .el-checkbox__input.is-indeterminate .el-checkbox__inner[data-v-464b2f46] {\r\n background-color: rgb(24,144,255);\r\n border-color: rgb(24,144,255);\n}\r\n",""])}});