7bc755005de8058f43e4622546d87d1c2cdbda8f.svn-base 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987
  1. <template>
  2. <div class="app-container">
  3. <div class="operation">
  4. <el-button v-if="isRoleEdit" class="success" style="float: left;margin-right:10px;" @click="handleCreate">新增</el-button>
  5. <el-button v-if="isRoleEdit" class="danger" style="float: left;margin-right:10px;" @click="handleDelete">删除</el-button>
  6. <el-button v-if="isRoleEdit" class="warning" style="float: left;margin-right:10px;" @click="handleCopy">复制</el-button>
  7. <el-button v-if="isRoleEdit" class="import" style="float: right;" @click="handleImport">导入</el-button>
  8. <el-button class="export" style="float: right;margin-right: 10px;" @click="handleExport">导出</el-button>
  9. </div>
  10. <div class="search">
  11. <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
  12. <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
  13. <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
  14. <el-select v-model="table.getdataListParm.parammaps.barid" filterable placeholder="栏舍名称" class="filter-item" style="width: 120px;" clearable>
  15. <el-option v-for="item in houseNameList" :key="item.id" :label="item.bname" :value="item.id" />
  16. </el-select>
  17. <el-select v-model="table.getdataListParm.parammaps.cowclass" filterable placeholder="牲畜类别" class="filter-item" style="width: 120px;" clearable>
  18. <el-option v-for="item in livestockList" :key="item.id" :label="item.mixname" :value="item.classname" />
  19. </el-select>
  20. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  21. <el-button class="successBorder" @click="handleRefresh">重置</el-button>
  22. </div>
  23. <div class="table">
  24. <el-table
  25. :key="table.tableKey"
  26. v-loading="table.listLoading"
  27. element-loading-text="给我一点时间"
  28. :data="table.list"
  29. border
  30. fit
  31. highlight-current-row
  32. style="width: 100%;"
  33. :row-style="rowStyle"
  34. :cell-style="cellStyle"
  35. class="elTable table-fixed"
  36. @selection-change="handleSelectionChange"
  37. >
  38. <el-table-column type="selection" align="center" width="50" />
  39. <el-table-column label="序号" align="center" type="index" width="50px">
  40. <template slot-scope="scope">
  41. <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="栏舍名称" min-width="150px" align="center">
  45. <template slot-scope="scope">
  46. <span>{{ scope.row.barname }}</span>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="牲畜类别" min-width="150px" align="center">
  50. <template slot-scope="scope">
  51. <span>{{ scope.row.cowclass }}</span>
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="牛头数" min-width="90px" align="center">
  55. <template slot-scope="scope">
  56. <span>{{ scope.row.cowsum }}</span>
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="月龄" min-width="90px" align="center">
  60. <template slot-scope="scope">
  61. <span>{{ scope.row.avgmonthage }}</span>
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="体重(kg)" min-width="90px" align="center">
  65. <template slot-scope="scope">
  66. <span>{{ scope.row.bw }}</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="日增重(kg)" min-width="90px" align="center">
  70. <template slot-scope="scope">
  71. <span>{{ scope.row.dayw }}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="胎次" min-width="80px" align="center">
  75. <template slot-scope="scope">
  76. <span>{{ scope.row.fetal }}</span>
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="平均泌乳天数" min-width="110px" align="center">
  80. <template slot-scope="scope">
  81. <span>{{ scope.row.avgdim }}</span>
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="怀孕天数" min-width="90px" align="center">
  85. <template slot-scope="scope">
  86. <span>{{ scope.row.dayspre }}</span>
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="产奶量(kg/头)" min-width="110px" align="center">
  90. <template slot-scope="scope">
  91. <span>{{ scope.row.product }}</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column label="乳脂率(%)" min-width="90px" align="center">
  95. <template slot-scope="scope">
  96. <span>{{ scope.row.fat }}</span>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="乳蛋白率(%)" min-width="100px" align="center">
  100. <template slot-scope="scope">
  101. <span>{{ scope.row.pro }}</span>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="乳糖率(%)" min-width="90px" align="center">
  105. <template slot-scope="scope">
  106. <span>{{ scope.row.lactose }}</span>
  107. </template>
  108. </el-table-column>
  109. <el-table-column label="温度(℃)" min-width="110px" align="center">
  110. <template slot-scope="scope">
  111. <span>{{ scope.row.tem }}</span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="记录人" min-width="90px" align="center">
  115. <template slot-scope="scope">
  116. <span>{{ scope.row.emp }}</span>
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="生效时间" min-width="110px" align="center">
  120. <template slot-scope="scope">
  121. <span>{{ scope.row.productdate }}</span>
  122. </template>
  123. </el-table-column>
  124. <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
  125. <template slot-scope="{row}">
  126. <el-button v-if="isRoleEdit" class="miniSuccess" @click="handleUpdate(row)">编辑</el-button>
  127. <el-button v-if="isRoleEdit" class="miniDanger" @click="handleRowDelete(row)">删除</el-button>
  128. </template>
  129. </el-table-column>
  130. </el-table>
  131. <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
  132. </div>
  133. <el-dialog :title="textMap[create.dialogStatus]" :visible.sync="create.dialogFormVisible" :close-on-click-modal="false" width="90%">
  134. <div class="app-add">
  135. <el-form ref="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="135px" style="width: 100%;margin:0 auto 50px">
  136. <el-row>
  137. <el-col :span="6">
  138. <el-form-item label="生效日期:" prop="productdate">
  139. <el-date-picker v-model="create.temp.productdate" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 100%;" :clearable="false" :disabled="create.dialogStatus=='update'" />
  140. </el-form-item>
  141. </el-col>
  142. <el-col :span="6">
  143. <el-form-item label="记录人:" prop="emp">
  144. <el-select ref="emp" v-model="create.temp.emp" :disabled="create.dialogStatus=='update'" filterable placeholder="记录人" class="filter-item" style="width: 100%;" @blur="blurEmp">
  145. <el-option v-for="item in create.noteTakerList" :key="item.myId" :label="item.emp" :value="item.emp" />
  146. </el-select>
  147. </el-form-item>
  148. </el-col>
  149. </el-row>
  150. <el-row>
  151. <el-col :span="24">
  152. <h3 style="width: 160px;text-align: right;">栏舍信息</h3>
  153. </el-col>
  154. </el-row>
  155. <el-row>
  156. <el-col :span="6">
  157. <el-form-item label="栏舍名称:" prop="barid">
  158. <el-select v-model="create.temp.barid" :disabled="create.dialogStatus=='update'" filterable placeholder="栏舍名称" class="filter-item" style="width: 100%;" @change="changeBar">
  159. <el-option v-for="item in houseNameList" :key="item.id" :label="item.bname" :value="item.id" />
  160. </el-select>
  161. </el-form-item>
  162. </el-col>
  163. <el-col :span="6">
  164. <el-form-item label="牲畜类别:" prop="cowclassid">
  165. <el-select v-model="create.temp.cowclassid" :disabled="create.dialogStatus=='update'" filterable placeholder="牲畜类别" class="filter-item" style="width: 100%;" @change="changeCowclass">
  166. <el-option v-for="item in livestockList" :key="item.id" :label="item.mixname" :value="item.id" />
  167. </el-select>
  168. </el-form-item>
  169. </el-col>
  170. <el-col :span="6">
  171. <el-form-item label="牛头数:" prop="cowsum">
  172. <el-input ref="cowsum" v-model="create.temp.cowsum" class="filter-item" placeholder="正整数" type="number" step="0.01" />
  173. </el-form-item>
  174. </el-col>
  175. <el-col :span="6">
  176. <el-form-item label="环境温度(℃):" prop="tem">
  177. <el-input v-model="create.temp.tem" class="filter-item" placeholder="最多两位小数" type="number" step="0.01" />
  178. </el-form-item>
  179. </el-col>
  180. </el-row>
  181. <el-row>
  182. <el-col :span="24">
  183. <h3 style="width: 160px;text-align: right;">牛只基础信息</h3>
  184. </el-col>
  185. </el-row>
  186. <el-row>
  187. <el-col :span="6">
  188. <el-form-item label="平均月龄:" prop="avgmonthage">
  189. <el-input ref="avgmonthage" v-model="create.temp.avgmonthage" class="filter-item" placeholder="最多两位小数" type="number" step="0.01" />
  190. </el-form-item>
  191. </el-col>
  192. <el-col :span="6">
  193. <el-form-item label="体重(kg):" prop="bw">
  194. <el-input ref="bw" v-model="create.temp.bw" class="filter-item" placeholder="最多两位小数" type="number" step="0.01" />
  195. </el-form-item>
  196. </el-col>
  197. <el-col :span="6">
  198. <el-form-item label="日增重(kg):" prop="dayw">
  199. <el-input ref="dayw" v-model="create.temp.dayw" class="filter-item" placeholder="最多两位小数" type="number" step="0.01" />
  200. </el-form-item>
  201. </el-col>
  202. <el-col :span="6">
  203. <el-form-item label="怀孕天数:" prop="dayspre">
  204. <el-input ref="dayspre" v-model="create.temp.dayspre" class="filter-item" placeholder="0-280整数" type="number" />
  205. </el-form-item>
  206. </el-col>
  207. </el-row>
  208. <el-row>
  209. <el-col :span="6">
  210. <el-form-item label="胎次:" prop="fetal">
  211. <el-input ref="fetal" v-model="create.temp.fetal" :disabled="create.temp.bigcowclass=='后备牛' " class="filter-item" placeholder="0-20整数" type="number" />
  212. </el-form-item>
  213. </el-col>
  214. <el-col :span="6">
  215. <el-form-item label="平均泌乳天数:" prop="avgdim">
  216. <el-input ref="avgdim" v-model="create.temp.avgdim" :disabled="create.temp.bigcowclass=='后备牛' || create.temp.bigcowclass=='干奶牛'" class="filter-item" placeholder="正整数" type="number" />
  217. </el-form-item>
  218. </el-col>
  219. <el-col :span="6">
  220. <el-form-item label="产奶量(kg/头):" prop="product">
  221. <el-input ref="product" v-model="create.temp.product" :disabled="create.temp.bigcowclass=='后备牛' || create.temp.bigcowclass=='干奶牛'" class="filter-item" placeholder="最多两位小数" type="number" />
  222. </el-form-item>
  223. </el-col>
  224. <el-col :span="6">
  225. <el-form-item label="乳脂率(%)" prop="fat">
  226. <el-input ref="fat" v-model="create.temp.fat" :disabled="create.temp.bigcowclass=='后备牛' || create.temp.bigcowclass=='干奶牛'" class="filter-item" placeholder="最多两位小数" type="number" />
  227. </el-form-item>
  228. </el-col>
  229. </el-row>
  230. <el-row>
  231. <el-col :span="6">
  232. <el-form-item label="乳蛋白率(%):" prop="pro">
  233. <el-input ref="pro" v-model="create.temp.pro" :disabled="create.temp.bigcowclass=='后备牛' || create.temp.bigcowclass=='干奶牛'" class="filter-item" placeholder="最多两位小数" type="number" />
  234. </el-form-item>
  235. </el-col>
  236. <el-col :span="6">
  237. <el-form-item label="乳糖率(%):" prop="lactose">
  238. <el-input ref="lactose" v-model="create.temp.lactose" :disabled="create.temp.bigcowclass=='后备牛' || create.temp.bigcowclass=='干奶牛'" class="filter-item" placeholder="最多两位小数" type="number" />
  239. </el-form-item>
  240. </el-col>
  241. </el-row>
  242. </el-form>
  243. <div slot="footer" class="dialog-footer">
  244. <el-button class="cancel" @click="create.dialogFormVisible = false;getList()">关闭</el-button>
  245. <el-button v-if="create.dialogStatus==='create'" class="success" :disabled="isokDisable" @click="createDataAgain()">确认新增</el-button>
  246. <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="success" :disabled="isokDisable" @click="create.dialogStatus==='create'?createData():updateData()">确认</el-button>
  247. </div>
  248. </div>
  249. </el-dialog>
  250. </div>
  251. </template>
  252. <script>
  253. import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons } from '@/api/common'
  254. import Cookies from 'js-cookie'
  255. import { parseTime } from '@/utils/index.js'
  256. import Pagination from '@/components/Pagination'
  257. import { MessageBox } from 'element-ui'
  258. export default {
  259. name: 'Performance',
  260. components: { Pagination },
  261. data() {
  262. return {
  263. isRoleEdit: [],
  264. requestParams: [
  265. { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }},
  266. { name: 'getCowclassListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }}
  267. ],
  268. houseNameList: [], // 栏舍名称
  269. livestockList: [], // 牲畜类别
  270. table: {
  271. getdataListParm: {
  272. name: 'getBarmilkList',
  273. page: 1,
  274. offset: 1,
  275. pagecount: 10,
  276. returntype: 'Map',
  277. parammaps: {
  278. pastureid: Cookies.get('pastureid'),
  279. barid: '',
  280. cowclass: '',
  281. startTime: '',
  282. stopTime: '',
  283. inputDatetime: ''
  284. }
  285. },
  286. tableKey: 0,
  287. list: [],
  288. total: 0,
  289. listLoading: true,
  290. temp: {}
  291. },
  292. // 新增/编辑
  293. create: {
  294. dialogFormVisible: false,
  295. dialogStatus: '',
  296. temp: { pastureid: Cookies.get('pastureid'), productdate: parseTime(new Date(), '{y}-{m}-{d}'), emp: Cookies.get('employename'), barid: '', barname: '', cowclassid: '', cowclass: '', bigcowclass: '', cowsum: '', tem: '', avgmonthage: '', bw: '', dayw: '', dayspre: '', fetal: '', avgdim: '', product: '', fat: '', pro: '', lactose: '' },
  297. rules: {
  298. barid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
  299. cowclassid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
  300. },
  301. getdataListParm: {
  302. name: 'getBarmilkEmpHis',
  303. page: 1,
  304. offset: 1,
  305. pagecount: 10,
  306. returntype: 'Map',
  307. parammaps: {
  308. pastureid: Cookies.get('pastureid')
  309. }
  310. },
  311. noteTakerList: [] // 记录人
  312. },
  313. textMap: {
  314. create: '新增',
  315. update: '编辑'
  316. },
  317. requestParam: {},
  318. isokDisable: false,
  319. selectList: [],
  320. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  321. cellStyle: { padding: 0 + 'px' }
  322. }
  323. },
  324. created() {
  325. this.getList()
  326. this.getDownList()
  327. this.getButtons()
  328. },
  329. methods: {
  330. getButtons() {
  331. const Edit = 'Performance'
  332. const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
  333. this.isRoleEdit = isRoleEdit
  334. },
  335. getDownList() {
  336. GetDataByNames(this.requestParams).then(response => {
  337. this.houseNameList = response.data.getBarListEnable.list
  338. this.livestockList = response.data.getCowclassListEnable.list
  339. })
  340. },
  341. handleBefore() {
  342. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  343. var start = this.table.getdataListParm.parammaps.inputDatetime[0] - 3600 * 1000 * 24
  344. var stop = this.table.getdataListParm.parammaps.inputDatetime[1] - 3600 * 1000 * 24
  345. this.table.getdataListParm.parammaps.inputDatetime.length = 0
  346. this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
  347. this.$forceUpdate()
  348. }
  349. },
  350. handleNext() {
  351. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  352. var start = this.table.getdataListParm.parammaps.inputDatetime[0] + 3600 * 1000 * 24
  353. var stop = this.table.getdataListParm.parammaps.inputDatetime[1] + 3600 * 1000 * 24
  354. this.table.getdataListParm.parammaps.inputDatetime.length = 0
  355. this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
  356. this.$forceUpdate()
  357. }
  358. },
  359. getList() {
  360. this.table.listLoading = true
  361. GetDataByName(this.table.getdataListParm).then(response => {
  362. console.log('table数据', response.data.list)
  363. if (response.data.list !== null) {
  364. this.table.list = response.data.list
  365. this.table.pageNum = response.data.pageNum
  366. this.table.pageSize = response.data.pageSize
  367. this.table.total = response.data.total
  368. } else {
  369. this.table.list = []
  370. }
  371. setTimeout(() => {
  372. this.table.listLoading = false
  373. }, 100)
  374. })
  375. },
  376. handleSearch() {
  377. console.log('点击了查询')
  378. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  379. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  380. this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  381. } else {
  382. this.table.getdataListParm.parammaps.inputDatetime = ''
  383. this.table.getdataListParm.parammaps.startTime = ''
  384. this.table.getdataListParm.parammaps.stopTime = ''
  385. }
  386. this.table.getdataListParm.offset = 1
  387. this.getList()
  388. },
  389. handleRefresh() {
  390. console.log('点击了重置')
  391. this.table.getdataListParm.parammaps.barid = ''
  392. this.table.getdataListParm.parammaps.cowclass = ''
  393. this.table.getdataListParm.parammaps.startTime = ''
  394. this.table.getdataListParm.parammaps.stopTime = ''
  395. this.table.getdataListParm.parammaps.inputDatetime = ''
  396. this.table.getdataListParm.offset = 1
  397. this.getList()
  398. },
  399. // 新增
  400. resetTemp() {
  401. this.create.temp = { pastureid: Cookies.get('pastureid'), productdate: parseTime(new Date(), '{y}-{m}-{d}'), emp: Cookies.get('employename'), barid: '', barname: '', cowclassid: '', cowclass: '', bigcowclass: '', cowsum: '', tem: '', avgmonthage: '', bw: '', dayw: '', dayspre: '', fetal: '', avgdim: '', product: '', fat: '', pro: '', lactose: '' }
  402. },
  403. blurEmp(item) {
  404. this.create.temp.emp = item.target.value
  405. },
  406. // 栏舍名称
  407. changeBar(item) {
  408. this.create.temp.barname = this.houseNameList.find(obj => obj.id === item).bname
  409. },
  410. // 牲畜类别
  411. changeCowclass(item) {
  412. this.create.temp.cowclass = this.livestockList.find(obj => obj.id === item).classname
  413. this.create.temp.bigcowclass = this.livestockList.find(obj => obj.id === item).parentname
  414. },
  415. getNoteTakerList() {
  416. GetDataByName(this.create.getdataListParm).then(response => {
  417. if (response.data.list !== null) {
  418. for (let i = 0; i < response.data.list.length; i++) {
  419. response.data.list[i].myId = i
  420. }
  421. this.create.noteTakerList = response.data.list
  422. console.log('记录人数据', response.data.list)
  423. console.log(this.create.noteTakerList)
  424. } else {
  425. this.create.noteTakerList = []
  426. }
  427. })
  428. },
  429. handleCreate() {
  430. console.log('点击了新增')
  431. this.resetTemp()
  432. this.getNoteTakerList()
  433. this.create.dialogStatus = 'create'
  434. this.create.dialogFormVisible = true
  435. },
  436. createData() {
  437. console.log('点击了新增保存')
  438. this.isokDisable = true
  439. setTimeout(() => {
  440. this.isokDisable = false
  441. }, 1000)
  442. this.$refs['temp'].validate(valid => {
  443. if (valid) {
  444. this.isokDisable = true
  445. setTimeout(() => {
  446. this.isokDisable = false
  447. }, 1000)
  448. const positiveInteger = /^[1-9]\d*$/
  449. // 牛头数
  450. if (this.create.temp.cowsum !== '') {
  451. if (!positiveInteger.test(parseFloat(this.create.temp.cowsum))) {
  452. this.$message({ type: 'error', message: '牛头数请输入正整数', duration: 2000 })
  453. return false
  454. }
  455. }
  456. const twoDecimalPlaces = /^\d+(\.\d{1,2})?$/
  457. // 温度环境
  458. if (this.create.temp.tem !== '') {
  459. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.tem))) {
  460. this.$message({ type: 'error', message: '温度环境请保留两位小数', duration: 2000 })
  461. return false
  462. }
  463. }
  464. // 平均月龄
  465. if (this.create.temp.avgmonthage !== '') {
  466. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.avgmonthage))) {
  467. this.$message({ type: 'error', message: '平均月龄请保留两位小数', duration: 2000 })
  468. return false
  469. }
  470. }
  471. // 体重
  472. if (this.create.temp.bw !== '') {
  473. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.bw))) {
  474. this.$message({ type: 'error', message: '体重请保留两位小数', duration: 2000 })
  475. return false
  476. }
  477. }
  478. // 日增重
  479. if (this.create.temp.dayw !== '') {
  480. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.dayw))) {
  481. this.$message({ type: 'error', message: '日增重请保留两位小数', duration: 2000 })
  482. return false
  483. }
  484. }
  485. const dayspre = /^(([0-9]|([1-9]\d)|(1\d\d)|(2([0-7]\d|7[0-9]))))$/
  486. // 怀孕天数
  487. if (this.create.temp.dayspre !== '') {
  488. if (!dayspre.test(parseFloat(this.create.temp.dayspre))) {
  489. this.$message({ type: 'error', message: '怀孕天数请输入大于0小于280整数', duration: 2000 })
  490. return false
  491. }
  492. }
  493. const fetal = /^(?:[0-9]|1[0-9])$/
  494. // 胎次
  495. if (this.create.temp.fetal !== '') {
  496. if (!fetal.test(parseFloat(this.create.temp.fetal))) {
  497. this.$message({ type: 'error', message: '胎次请输入大于0小于20整数', duration: 2000 })
  498. return false
  499. }
  500. }
  501. // 平均泌乳
  502. if (this.create.temp.avgdim !== '') {
  503. if (!positiveInteger.test(parseFloat(this.create.temp.avgdim))) {
  504. this.$message({ type: 'error', message: '平均泌乳天数请输入正整数', duration: 2000 })
  505. return false
  506. }
  507. }
  508. // 产奶量
  509. if (this.create.temp.product !== '') {
  510. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.product))) {
  511. this.$message({ type: 'error', message: '产奶量请保留两位小数', duration: 2000 })
  512. return false
  513. }
  514. }
  515. // 乳脂率
  516. if (this.create.temp.fat !== '') {
  517. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.fat))) {
  518. this.$message({ type: 'error', message: '乳脂率请保留两位小数', duration: 2000 })
  519. return false
  520. }
  521. }
  522. // 乳蛋白率
  523. if (this.create.temp.pro !== '') {
  524. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.pro))) {
  525. this.$message({ type: 'error', message: '乳蛋白率请保留两位小数', duration: 2000 })
  526. return false
  527. }
  528. }
  529. // 乳糖率
  530. if (this.create.temp.lactose !== '') {
  531. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.lactose))) {
  532. this.$message({ type: 'error', message: '乳糖率请保留两位小数', duration: 2000 })
  533. return false
  534. }
  535. }
  536. this.requestParam.name = 'insertBarmilk'
  537. this.requestParam.parammaps = this.create.temp
  538. if (this.create.temp.cowsum == '') { this.create.temp.cowsum = '0' }
  539. if (this.create.temp.tem == '') { this.create.temp.tem = '0' }
  540. if (this.create.temp.avgmonthage == '') { this.create.temp.avgmonthage = '0' }
  541. if (this.create.temp.bw == '') { this.create.temp.bw = '0' }
  542. if (this.create.temp.dayw == '') { this.create.temp.dayw = '0' }
  543. if (this.create.temp.dayspre == '') { this.create.temp.dayspre = '0' }
  544. if (this.create.temp.fetal == '') { this.create.temp.fetal = '0' }
  545. if (this.create.temp.avgdim == '') { this.create.temp.avgdim = '0' }
  546. if (this.create.temp.product == '') { this.create.temp.product = '0' }
  547. if (this.create.temp.fat == '') { this.create.temp.fat = '0' }
  548. if (this.create.temp.pro == '') { this.create.temp.pro = '0' }
  549. if (this.create.temp.lactose == '') { this.create.temp.lactose = '0' }
  550. PostDataByName(this.requestParam).then(response => {
  551. console.log('新增保存发送参数', this.requestParam)
  552. if (response.msg !== 'fail') {
  553. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  554. this.create.dialogFormVisible = false
  555. this.getList()
  556. } else {
  557. const barid = new RegExp("key 'barid'")
  558. if (barid.test(response.data)) {
  559. this.$message({ type: 'error', message: '该栏舍今日生产性能已存在,不可重复生成', duration: 2000 })
  560. } else {
  561. failproccess(response, this.$notify)
  562. }
  563. if (this.create.temp.cowsum == '0') { this.create.temp.cowsum = '' }
  564. if (this.create.temp.tem == '0') { this.create.temp.tem = '' }
  565. if (this.create.temp.avgmonthage == '0') { this.create.temp.avgmonthage = '' }
  566. if (this.create.temp.bw == '0') { this.create.temp.bw = '' }
  567. if (this.create.temp.dayw == '0') { this.create.temp.dayw = '' }
  568. if (this.create.temp.dayspre == '0') { this.create.temp.dayspre = '' }
  569. if (this.create.temp.fetal == '0') { this.create.temp.fetal = '' }
  570. if (this.create.temp.avgdim == '0') { this.create.temp.avgdim = '' }
  571. if (this.create.temp.product == '0') { this.create.temp.product = '' }
  572. if (this.create.temp.fat == '0') { this.create.temp.fat = '' }
  573. if (this.create.temp.pro == '0') { this.create.temp.pro = '' }
  574. if (this.create.temp.lactose == '0') { this.create.temp.lactose = '' }
  575. }
  576. })
  577. }
  578. })
  579. },
  580. createDataAgain() {
  581. console.log('点击了新增保存')
  582. this.isokDisable = true
  583. setTimeout(() => {
  584. this.isokDisable = false
  585. }, 1000)
  586. this.$refs['temp'].validate(valid => {
  587. if (valid) {
  588. this.isokDisable = true
  589. setTimeout(() => {
  590. this.isokDisable = false
  591. }, 1000)
  592. const positiveInteger = /^[1-9]\d*$/
  593. // 牛头数
  594. if (this.create.temp.cowsum !== '') {
  595. if (!positiveInteger.test(parseFloat(this.create.temp.cowsum))) {
  596. this.$message({ type: 'error', message: '牛头数请输入正整数', duration: 2000 })
  597. return false
  598. }
  599. }
  600. const twoDecimalPlaces = /^\d+(\.\d{1,2})?$/
  601. // 温度环境
  602. if (this.create.temp.tem !== '') {
  603. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.tem))) {
  604. this.$message({ type: 'error', message: '温度环境请保留两位小数', duration: 2000 })
  605. return false
  606. }
  607. }
  608. // 平均月龄
  609. if (this.create.temp.avgmonthage !== '') {
  610. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.avgmonthage))) {
  611. this.$message({ type: 'error', message: '平均月龄请保留两位小数', duration: 2000 })
  612. return false
  613. }
  614. }
  615. // 体重
  616. if (this.create.temp.bw !== '') {
  617. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.bw))) {
  618. this.$message({ type: 'error', message: '体重请保留两位小数', duration: 2000 })
  619. return false
  620. }
  621. }
  622. // 日增重
  623. if (this.create.temp.dayw !== '') {
  624. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.dayw))) {
  625. this.$message({ type: 'error', message: '日增重请保留两位小数', duration: 2000 })
  626. return false
  627. }
  628. }
  629. const dayspre = /^(([0-9]|([1-9]\d)|(1\d\d)|(2([0-7]\d|7[0-9]))))$/
  630. // 怀孕天数
  631. if (this.create.temp.dayspre !== '') {
  632. if (!dayspre.test(parseFloat(this.create.temp.dayspre))) {
  633. this.$message({ type: 'error', message: '怀孕天数请输入大于0小于280整数', duration: 2000 })
  634. return false
  635. }
  636. }
  637. const fetal = /^(?:[0-9]|1[0-9])$/
  638. // 胎次
  639. if (this.create.temp.fetal !== '') {
  640. if (!fetal.test(parseFloat(this.create.temp.fetal))) {
  641. this.$message({ type: 'error', message: '胎次请输入大于0小于20整数', duration: 2000 })
  642. return false
  643. }
  644. }
  645. // 平均泌乳
  646. if (this.create.temp.avgdim !== '') {
  647. if (!positiveInteger.test(parseFloat(this.create.temp.avgdim))) {
  648. this.$message({ type: 'error', message: '平均泌乳天数请输入正整数', duration: 2000 })
  649. return false
  650. }
  651. }
  652. // 产奶量
  653. if (this.create.temp.product !== '') {
  654. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.product))) {
  655. this.$message({ type: 'error', message: '产奶量请保留两位小数', duration: 2000 })
  656. return false
  657. }
  658. }
  659. // 乳脂率
  660. if (this.create.temp.fat !== '') {
  661. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.fat))) {
  662. this.$message({ type: 'error', message: '乳脂率请保留两位小数', duration: 2000 })
  663. return false
  664. }
  665. }
  666. // 乳蛋白率
  667. if (this.create.temp.pro !== '') {
  668. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.pro))) {
  669. this.$message({ type: 'error', message: '乳蛋白率请保留两位小数', duration: 2000 })
  670. return false
  671. }
  672. }
  673. // 乳糖率
  674. if (this.create.temp.lactose !== '') {
  675. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.lactose))) {
  676. this.$message({ type: 'error', message: '乳糖率请保留两位小数', duration: 2000 })
  677. return false
  678. }
  679. }
  680. this.requestParam.name = 'insertBarmilk'
  681. this.requestParam.parammaps = this.create.temp
  682. if (this.create.temp.cowsum == '') { this.create.temp.cowsum = '0' }
  683. if (this.create.temp.tem == '') { this.create.temp.tem = '0' }
  684. if (this.create.temp.avgmonthage == '') { this.create.temp.avgmonthage = '0' }
  685. if (this.create.temp.bw == '') { this.create.temp.bw = '0' }
  686. if (this.create.temp.dayw == '') { this.create.temp.dayw = '0' }
  687. if (this.create.temp.dayspre == '') { this.create.temp.dayspre = '0' }
  688. if (this.create.temp.fetal == '') { this.create.temp.fetal = '0' }
  689. if (this.create.temp.avgdim == '') { this.create.temp.avgdim = '0' }
  690. if (this.create.temp.product == '') { this.create.temp.product = '0' }
  691. if (this.create.temp.fat == '') { this.create.temp.fat = '0' }
  692. if (this.create.temp.pro == '') { this.create.temp.pro = '0' }
  693. if (this.create.temp.lactose == '') { this.create.temp.lactose = '0' }
  694. PostDataByName(this.requestParam).then(response => {
  695. console.log('新增保存发送参数', this.requestParam)
  696. if (response.msg !== 'fail') {
  697. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  698. this.resetTemp()
  699. this.create.noteTakerList = []
  700. this.getNoteTakerList()
  701. } else {
  702. const barid = new RegExp("key 'barid'")
  703. if (barid.test(response.data)) {
  704. this.$message({ type: 'error', message: '该栏舍今日生产性能已存在,不可重复生成', duration: 2000 })
  705. } else {
  706. failproccess(response, this.$notify)
  707. }
  708. if (this.create.temp.cowsum == '0') { this.create.temp.cowsum = '' }
  709. if (this.create.temp.tem == '0') { this.create.temp.tem = '' }
  710. if (this.create.temp.avgmonthage == '0') { this.create.temp.avgmonthage = '' }
  711. if (this.create.temp.bw == '0') { this.create.temp.bw = '' }
  712. if (this.create.temp.dayw == '0') { this.create.temp.dayw = '' }
  713. if (this.create.temp.dayspre == '0') { this.create.temp.dayspre = '' }
  714. if (this.create.temp.fetal == '0') { this.create.temp.fetal = '' }
  715. if (this.create.temp.avgdim == '0') { this.create.temp.avgdim = '' }
  716. if (this.create.temp.product == '0') { this.create.temp.product = '' }
  717. if (this.create.temp.fat == '0') { this.create.temp.fat = '' }
  718. if (this.create.temp.pro == '0') { this.create.temp.pro = '' }
  719. if (this.create.temp.lactose == '0') { this.create.temp.lactose = '' }
  720. }
  721. })
  722. }
  723. })
  724. },
  725. // 编辑
  726. handleUpdate(row) {
  727. console.log('点击了编辑', row)
  728. row.barid = String(row.barid)
  729. row.cowclassid = String(row.cowclassid)
  730. this.create.temp = Object.assign({}, row)
  731. this.create.temp.id = row.id
  732. if (this.create.temp.cowsum == '0') { this.create.temp.cowsum = '' }
  733. if (this.create.temp.avgdim == '0') { this.create.temp.avgdim = '' }
  734. this.getNoteTakerList()
  735. this.create.dialogStatus = 'update'
  736. this.create.dialogFormVisible = true
  737. },
  738. updateData() {
  739. this.isokDisable = true
  740. setTimeout(() => {
  741. this.isokDisable = false
  742. }, 1000)
  743. this.$refs['temp'].validate(valid => {
  744. if (valid) {
  745. this.isokDisable = true
  746. setTimeout(() => {
  747. this.isokDisable = false
  748. }, 1000)
  749. const positiveInteger = /^[1-9]\d*$/
  750. // 牛头数
  751. if (this.create.temp.cowsum !== '') {
  752. if (!positiveInteger.test(parseFloat(this.create.temp.cowsum))) {
  753. this.$message({ type: 'error', message: '牛头数请输入正整数', duration: 2000 })
  754. return false
  755. }
  756. }
  757. const twoDecimalPlaces = /^\d+(\.\d{1,2})?$/
  758. // 温度环境
  759. if (this.create.temp.tem !== '') {
  760. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.tem))) {
  761. this.$message({ type: 'error', message: '温度环境请保留两位小数', duration: 2000 })
  762. return false
  763. }
  764. }
  765. // 平均月龄
  766. if (this.create.temp.avgmonthage !== '') {
  767. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.avgmonthage))) {
  768. this.$message({ type: 'error', message: '平均月龄请保留两位小数', duration: 2000 })
  769. return false
  770. }
  771. }
  772. // 体重
  773. if (this.create.temp.bw !== '') {
  774. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.bw))) {
  775. this.$message({ type: 'error', message: '体重请保留两位小数', duration: 2000 })
  776. return false
  777. }
  778. }
  779. // 日增重
  780. if (this.create.temp.dayw !== '') {
  781. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.dayw))) {
  782. this.$message({ type: 'error', message: '日增重请保留两位小数', duration: 2000 })
  783. return false
  784. }
  785. }
  786. const dayspre = /^(([0-9]|([1-9]\d)|(1\d\d)|(2([0-7]\d|7[0-9]))))$/
  787. // 怀孕天数
  788. if (this.create.temp.dayspre !== '') {
  789. if (!dayspre.test(parseFloat(this.create.temp.dayspre))) {
  790. this.$message({ type: 'error', message: '怀孕天数请输入大于0小于280整数', duration: 2000 })
  791. return false
  792. }
  793. }
  794. const fetal = /^(?:[0-9]|1[0-9])$/
  795. // 胎次
  796. if (this.create.temp.fetal !== '') {
  797. if (!fetal.test(parseFloat(this.create.temp.fetal))) {
  798. this.$message({ type: 'error', message: '胎次请输入大于0小于20整数', duration: 2000 })
  799. return false
  800. }
  801. }
  802. // 平均泌乳
  803. if (this.create.temp.avgdim !== '') {
  804. if (!positiveInteger.test(parseFloat(this.create.temp.avgdim))) {
  805. this.$message({ type: 'error', message: '平均泌乳天数请输入正整数', duration: 2000 })
  806. return false
  807. }
  808. }
  809. // 产奶量
  810. if (this.create.temp.product !== '') {
  811. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.product))) {
  812. this.$message({ type: 'error', message: '产奶量请保留两位小数', duration: 2000 })
  813. return false
  814. }
  815. }
  816. // 乳脂率
  817. if (this.create.temp.fat !== '') {
  818. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.fat))) {
  819. this.$message({ type: 'error', message: '乳脂率请保留两位小数', duration: 2000 })
  820. return false
  821. }
  822. }
  823. // 乳蛋白率
  824. if (this.create.temp.pro !== '') {
  825. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.pro))) {
  826. this.$message({ type: 'error', message: '乳蛋白率请保留两位小数', duration: 2000 })
  827. return false
  828. }
  829. }
  830. // 乳糖率
  831. if (this.create.temp.lactose !== '') {
  832. if (!twoDecimalPlaces.test(parseFloat(this.create.temp.lactose))) {
  833. this.$message({ type: 'error', message: '乳糖率请保留两位小数', duration: 2000 })
  834. return false
  835. }
  836. }
  837. this.requestParam.name = 'updateBarmilk'
  838. this.requestParam.parammaps = this.create.temp
  839. if (this.create.temp.cowsum == '') { this.create.temp.cowsum = '0' }
  840. if (this.create.temp.tem == '') { this.create.temp.tem = '0' }
  841. if (this.create.temp.avgmonthage == '') { this.create.temp.avgmonthage = '0' }
  842. if (this.create.temp.bw == '') { this.create.temp.bw = '0' }
  843. if (this.create.temp.dayw == '') { this.create.temp.dayw = '0' }
  844. if (this.create.temp.dayspre == '') { this.create.temp.dayspre = '0' }
  845. if (this.create.temp.fetal == '') { this.create.temp.fetal = '0' }
  846. if (this.create.temp.avgdim == '') { this.create.temp.avgdim = '0' }
  847. if (this.create.temp.product == '') { this.create.temp.product = '0' }
  848. if (this.create.temp.fat == '') { this.create.temp.fat = '0' }
  849. if (this.create.temp.pro == '') { this.create.temp.pro = '0' }
  850. if (this.create.temp.lactose == '') { this.create.temp.lactose = '0' }
  851. PostDataByName(this.requestParam).then(response => {
  852. console.log('新增保存发送参数', this.requestParam)
  853. if (response.msg !== 'fail') {
  854. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  855. this.create.dialogFormVisible = false
  856. this.getList()
  857. } else {
  858. failproccess(response, this.$notify)
  859. if (this.create.temp.dayspre == '0') { this.create.temp.dayspre = '' }
  860. if (this.create.temp.fetal == '0') { this.create.temp.fetal = '' }
  861. if (this.create.temp.cowsum == '0') { this.create.temp.cowsum = '' }
  862. if (this.create.temp.avgdim == '0') { this.create.temp.avgdim = '' }
  863. }
  864. })
  865. }
  866. })
  867. },
  868. // 删除
  869. handleRowDelete(row) {
  870. console.log('点击了行内删除')
  871. MessageBox.confirm('是否确认删除此信息?', {
  872. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  873. }).then(() => {
  874. this.selectList = []
  875. this.requestParam.name = 'deleteBarmilk'
  876. this.requestParam.parammaps = {}
  877. this.requestParam.parammaps.pastureid = row.pastureid
  878. this.requestParam.parammaps.id = row.id
  879. PostDataByName(this.requestParam).then(response => {
  880. if (response.msg === 'fail') {
  881. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  882. } else {
  883. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  884. this.getList()
  885. }
  886. })
  887. }).catch(() => {
  888. this.$message({ type: 'info', message: '已取消删除' })
  889. })
  890. },
  891. handleSelectionChange(val) {
  892. console.log('勾选数据', val)
  893. this.selectList = val
  894. },
  895. handleDelete() {
  896. console.log('点击了删除')
  897. if (this.selectList.length == 0) {
  898. this.$message({ type: 'error', message: '请选择栏舍生产性能', duration: 2000 })
  899. } else {
  900. MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
  901. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  902. }).then(() => {
  903. console.log(this.selectList)
  904. this.requestParam.common = { 'returnmap': '0' }
  905. this.requestParam.data = []
  906. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
  907. this.requestParam.data[0].children = []
  908. this.requestParam.data[0].children[0] = { 'name': 'deleteBarmilk', 'type': 'e', 'parammaps': {
  909. id: '@insertSpotList.id',
  910. pastureid: '@insertSpotList.pastureid'
  911. }}
  912. ExecDataByConfig(this.requestParam).then(response => {
  913. console.log('删除保存发送参数', this.requestParam)
  914. if (response.msg === 'fail') {
  915. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  916. } else {
  917. this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
  918. this.getList()
  919. }
  920. })
  921. })
  922. }
  923. },
  924. // 复制
  925. handleCopy() {
  926. console.log('点击了复制')
  927. if (this.selectList.length == 0) {
  928. this.$message({ type: 'error', message: '请选择栏舍生产性能', duration: 2000 })
  929. } else if (this.selectList.length == 1) {
  930. MessageBox.confirm('是否确认复制此信息?', {
  931. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  932. }).then(() => {
  933. this.requestParam.name = 'copybarmilk'
  934. this.requestParam.parammaps = {}
  935. this.requestParam.parammaps.pastureid = this.selectList[0].pastureid
  936. this.requestParam.parammaps.id = this.selectList[0].id
  937. PostDataByName(this.requestParam).then(response => {
  938. if (response.msg === 'fail') {
  939. const barid = new RegExp("key 'barid'")
  940. if (barid.test(response.data)) {
  941. this.$message({ type: 'error', message: '该栏舍今日生产性能已存在,不可重复生成', duration: 2000 })
  942. } else {
  943. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  944. }
  945. } else {
  946. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  947. this.getList()
  948. }
  949. })
  950. }).catch(() => {
  951. this.$message({ type: 'info', message: '已取消删除' })
  952. })
  953. } else {
  954. this.$message({ type: 'error', message: '请选择一条栏舍生产性能', duration: 2000 })
  955. }
  956. },
  957. // 导出
  958. handleExport() {
  959. console.log('点击了导出')
  960. },
  961. // 导入
  962. handleImport() {
  963. console.log('点击了导入')
  964. }
  965. }
  966. }
  967. </script>
  968. <style lang="scss" scoped>
  969. .search{padding-top:10px;clear: both;}
  970. .table{margin-top:10px;}
  971. </style>