1 |
- webpackJsonp([31],{"0pj7":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a("Xxa5"),r=a.n(n),l=a("exGp"),i=a.n(l),o={data:function(){return{form:{eartag:"",sex:"",breed:"",healthStatus:"",outFenceStatus:"",periodId:"",pigstyId:"",unitId:""},dataList:[],pageIndex:1,pageSize:10,totalPage:0,dataListLoading:!1,dataListSelections:[],addOrUpdateVisible:!1,farmId:void 0,gender:[{value:"公",label:"公"},{value:"母",label:"母"}],breedList:[],healthStatus:[{value:1,label:"健康"},{value:0,label:"不健康"}],outFenceStatus:[{value:0,label:"育肥"},{value:1,label:"出栏"}],periodList:[],periodSelectedList:[],pigstyList:[],unitList:[],unitSelectedList:[],labelPosition:"right"}},activated:function(){this.getDataList()},methods:{getDataList:function(){var e,t=this;this.dataListLoading=!0,this.$http({url:this.$http.adornUrl("/management/yearpigbase/fattenList"),method:"get",params:this.$http.adornParams({page:this.pageIndex,limit:this.pageSize,eartag:this.form.eartag||void 0,sex:this.form.sex||void 0,breed:this.form.breed||void 0,healthStatus:this.form.healthStatus||(0===this.form.healthStatus?this.form.healthStatus:void 0),outFenceStatus:this.form.outFenceStatus||(0===this.form.outFenceStatus?this.form.outFenceStatus:void 0),periodId:this.form.periodId||void 0,pigstyId:this.form.pigstyId||void 0,unitId:this.form.unitId||void 0})}).then((e=i()(r.a.mark(function e(a){var n,l,i,o,s,d,c,u,p=a.data;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.pigstyList=[],n=[],e.next=4,t.$http({url:t.$http.adornUrl("/management/pigsty/findAll"),method:"get",params:t.$http.adornParams({})});case 4:return(l=e.sent).data.all&&(n=l.data.all),n.forEach(function(e){var a={value:e.id,label:e.number};t.pigstyList.push(a)}),t.unitList=[],i=[],e.next=11,t.$http({url:t.$http.adornUrl("/management/unit/findAll"),method:"get",params:t.$http.adornParams({})});case 11:return(o=e.sent).data.all&&(i=o.data.all),i.forEach(function(e){var a={value:e.id,label:e.number,pigstyId:e.pigstyId};t.unitList.push(a)}),t.unitSelectedList=t.unitList,t.periodList=[],s=[],e.next=19,t.$http({url:t.$http.adornUrl("/management/period/findAll"),method:"get",params:t.$http.adornParams({})});case 19:return(d=e.sent).data.all&&(s=d.data.all),s.forEach(function(e){var a={value:e.id,label:e.number,pigstyId:e.pigstyId};t.periodList.push(a)}),t.periodSelectedList=t.form.pigstyId?t.periodList.filter(function(e){return e.pigstyId===t.form.pigstyId}):t.periodList,t.unitSelectedList=t.form.pigstyId?t.unitList.filter(function(e){return e.pigstyId===t.form.pigstyId}):t.unitList,t.breedList=[],c=[],e.next=28,t.$http({url:t.$http.adornUrl("/management/basebloodline/findAll"),method:"get",params:t.$http.adornParams({})});case 28:(u=e.sent).data.all&&(c=u.data.all),c.forEach(function(e){var a={value:e.name,label:e.name};t.breedList.push(a)}),p&&0===p.code?(t.dataList=p.page.list,t.totalPage=p.page.totalCount):(t.dataList=[],t.totalPage=0,t.$message.error(p.msg)),t.dataListLoading=!1;case 33:case"end":return e.stop()}},e,t)})),function(t){return e.apply(this,arguments)}))},selectFocus:function(e){var t=this;this.form.pigstyId||(this.$message.error("请先选择猪舍"),this.form[e+"Id"]="",setTimeout(function(){t.$refs[e].blur()},10))},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},deleteHandle:function(e){var t=this,a=e?[e.id]:this.dataListSelections.map(function(e){return e.id}),n=e?[e.eartag]:this.dataListSelections.map(function(e){return e.eartag});this.$confirm("确定对[耳标="+n.join(",")+"]进行["+(e?"出栏":"批量出栏")+"]操作?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.$http({url:t.$http.adornUrl("/management/yearpigbase/such"),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}),t.getDataList()):t.$message.error(a.msg)})}).catch(function(){})}},watch:{"form.pigstyId":{handler:function(e,t){t&&(this.form.unitId="",this.form.periodId=""),this.unitSelectedList=this.unitList.filter(function(t){return t.pigstyId===e}),this.periodSelectedList=this.periodList.filter(function(t){return t.pigstyId===e})}}}},s={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.breedList,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:"猪舍"},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",{ref:"unit",attrs:{placeholder:"单元"},on:{focus:function(t){e.selectFocus("unit")}},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",{ref:"period",attrs:{placeholder:"栏期"},on:{focus:function(t){e.selectFocus("period")}},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-d-arrow-right",type:"danger",disabled:e.dataListSelections.length<=0},on:{click:function(t){e.deleteHandle()}}},[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",width:"80"}}),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:"性别",width:"80"}}),e._v(" "),a("el-table-column",{attrs:{prop:"birthday","header-align":"center",align:"center",label:"出生日期"}}),e._v(" "),a("el-table-column",{attrs:{"header-align":"center",align:"center",label:"健康状态",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(t.row.healthStatus?"健康":"不健康"))])]}}])}),e._v(" "),a("el-table-column",{attrs:{"header-align":"center",align:"center",label:"养殖状态",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(t.row.outFenceStatus?"出栏":"育肥"))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"breed","header-align":"center",align:"center",label:"品种",width:"100"}}),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:{"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.deleteHandle(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}})],1)])],1)],1)},staticRenderFns:[]};var d=a("VU/8")(o,s,!1,function(e){a("AaZX")},"data-v-62663d42",null);t.default=d.exports},"2Acj":function(e,t,a){(e.exports=a("FZ+f")(!1)).push([e.i,"\n.rect[data-v-62663d42] {\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-62663d42] {\r\n padding-bottom: 10px;\n}\n.rect-table[data-v-62663d42] {\r\n margin-top: 20px;\n}\n.demo-table-expand[data-v-62663d42] {\r\n font-size: 0;\r\n margin-left: 40px;\n}\n.demo-table-expand label[data-v-62663d42] {\r\n width: 90px;\r\n color: #99a9bf;\n}\n.demo-table-expand .el-form-item[data-v-62663d42] {\r\n margin-right: 0;\r\n margin-bottom: 0;\r\n width: 80%;\n}\n.el-table .height[data-v-62663d42] {\r\n background: rgba(254, 254, 254, 0.5);\n}\n[data-v-62663d42].el-table--mini td, .el-table--mini th[data-v-62663d42] {\r\n padding: 3px 0 !important;\r\n height: 20px !important;\n}\n[data-v-62663d42].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-62663d42].el-table .el-checkbox__input.is-checked .el-checkbox__inner, .el-checkbox__input.is-indeterminate .el-checkbox__inner[data-v-62663d42] {\r\n background-color: rgb(24,144,255);\r\n border-color: rgb(24,144,255);\n}\n[data-v-62663d42].el-table .el-checkbox__inner:hover {\r\n border-color: rgb(24,144,255);\n}\n[data-v-62663d42].el-table .el-checkbox__input.is-focus .el-checkbox__inner {\r\n border-color: rgb(24,144,255);\n}\n[data-v-62663d42].el-table #select .cell .el-checkbox__input.is-checked .el-checkbox__inner, .el-checkbox__input.is-indeterminate .el-checkbox__inner[data-v-62663d42] {\r\n background-color: rgb(24,144,255);\r\n border-color: rgb(24,144,255);\n}\r\n",""])},AaZX:function(e,t,a){var n=a("2Acj");"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);a("rjj0")("58cd2420",n,!0)}});
|