6ebaa963aae77431e7bbd4b747b59113d5df63df.svn-base 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953
  1. <template>
  2. <div class="app-container" style="position: relative;">
  3. <div v-if="activeName == 'first'" class="operation" style="position: absolute;top: -5px;right: 10px;z-index:1;">
  4. <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
  5. <el-button class="import" icon="el-icon-download" style="float: right;">导入</el-button>
  6. </el-upload>
  7. <el-dropdown style="float: right;margin-right: 10px;">
  8. <el-button class="export" icon="el-icon-upload2">导出</el-button>
  9. <el-dropdown-menu slot="dropdown">
  10. <el-dropdown-item @click.native="handleExport(1)">导出模板</el-dropdown-item>
  11. <el-dropdown-item @click.native="handleExport(2)">导出数据</el-dropdown-item>
  12. </el-dropdown-menu>
  13. </el-dropdown>
  14. </div>
  15. <div v-if="activeName == 'second'" class="operation" style="position: absolute;top: -5px;right: 10px;z-index:1;">
  16. <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers2" :data="uploadData2" :action="uploadExcelUrl2" :show-file-list="false" :before-upload="beforeImport2" :on-success="handleImportSuccess2">
  17. <el-button class="import" style="float: right;" icon="el-icon-download">导入</el-button>
  18. </el-upload>
  19. <el-dropdown style="float: right;margin-right: 10px;">
  20. <el-button class="export" icon="el-icon-upload2">导出</el-button>
  21. <el-dropdown-menu slot="dropdown">
  22. <el-dropdown-item @click.native="handleExport(3)">导出模板</el-dropdown-item>
  23. <el-dropdown-item @click.native="handleExport(4)">导出数据</el-dropdown-item>
  24. </el-dropdown-menu>
  25. </el-dropdown>
  26. </div>
  27. <el-tabs v-model="activeName" @tab-click="handleTabClick">
  28. <el-tab-pane label="体况、粪便评分标准" name="first">
  29. <div class="table1">
  30. <el-table
  31. :key="table1.tableKey"
  32. v-loading="table1.listLoading"
  33. element-loading-text="给我一点时间"
  34. :data="table1.list"
  35. border
  36. fit
  37. highlight-current-row
  38. style="width: 100%;"
  39. :row-style="rowStyle"
  40. :cell-style="cellStyle"
  41. class="elTable table-fixed"
  42. >
  43. <el-table-column label="序号" align="center" type="index" width="50px" />
  44. <el-table-column label="配方名称" min-width="130px" align="center">
  45. <template slot-scope="scope">
  46. <span>{{ scope.row.ftname }}</span>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="体况评分标准" align="center" min-width="300px">
  50. <el-table-column label="体况评分标准(分)" min-width="80px" align="center">
  51. <template slot-scope="scope">
  52. <span>{{ scope.row.bodystandard }}</span>
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="数据来源" min-width="80px" align="center">
  56. <template slot-scope="scope">
  57. <span>{{ scope.row.bodysource }}</span>
  58. </template>
  59. </el-table-column>
  60. </el-table-column>
  61. <el-table-column label="粪便评分标准" align="center" min-width="300px">
  62. <el-table-column label="粪便评分标准(分)" min-width="80px" align="center">
  63. <template slot-scope="scope">
  64. <span>{{ scope.row.dungstandard }}</span>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="数据来源" min-width="80px" align="center">
  68. <template slot-scope="scope">
  69. <span>{{ scope.row.dungsource }}</span>
  70. </template>
  71. </el-table-column>
  72. </el-table-column>
  73. <el-table-column label="操作" align="center" width="50" class-name="small-padding fixed-width" fixed="right">
  74. <template slot-scope="{row}">
  75. <el-button v-if="isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
  76. </template>
  77. </el-table-column>
  78. </el-table>
  79. <span v-if="table1.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ table1.total }}条</span>
  80. </div>
  81. </el-tab-pane>
  82. <el-tab-pane label="宾州筛、粪便筛标准范围" name="second">
  83. <div class="table2">
  84. <el-table
  85. :key="table2.tableKey"
  86. v-loading="table2.listLoading"
  87. element-loading-text="给我一点时间"
  88. :data="table2.list"
  89. border
  90. fit
  91. highlight-current-row
  92. style="width: 100%;"
  93. :row-style="rowStyle"
  94. :cell-style="cellStyle"
  95. class="elTable table-fixed"
  96. >
  97. <el-table-column label="序号" align="center" type="index" width="50px" />
  98. <el-table-column label="牲畜类别" align="center" min-width="200px">
  99. <el-table-column label="牲畜父类" min-width="80px" align="center">
  100. <template slot-scope="scope">
  101. <span>{{ scope.row.parentname }}</span>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="牲畜子类" min-width="80px" align="center">
  105. <template slot-scope="scope">
  106. <span>{{ scope.row.cowname }}</span>
  107. </template>
  108. </el-table-column>
  109. </el-table-column>
  110. <el-table-column label="宾州筛" align="center" min-width="200px">
  111. <el-table-column label="宾州筛一层(%)" min-width="80px" align="center">
  112. <template slot-scope="scope">
  113. <span>{{ scope.row.bzonemin }} - {{ scope.row.bzonemax }}</span>
  114. </template>
  115. </el-table-column>
  116. <el-table-column label="宾州筛二层(%)" min-width="80px" align="center">
  117. <template slot-scope="scope">
  118. <span>{{ scope.row.bztwomin }} - {{ scope.row.bztwomax }}</span>
  119. </template>
  120. </el-table-column>
  121. <el-table-column label="宾州筛三层(%)" min-width="80px" align="center">
  122. <template slot-scope="scope">
  123. <span>{{ scope.row.bzthreemin }} - {{ scope.row.bzthreemax }}</span>
  124. </template>
  125. </el-table-column>
  126. <el-table-column label="宾州筛四层(%)" min-width="80px" align="center">
  127. <template slot-scope="scope">
  128. <span>{{ scope.row.bzfourmin }} - {{ scope.row.bzfourmax }}</span>
  129. </template>
  130. </el-table-column>
  131. <el-table-column label="数据来源" min-width="80px" align="center">
  132. <template slot-scope="scope">
  133. <span>{{ scope.row.bzsource }}</span>
  134. </template>
  135. </el-table-column>
  136. </el-table-column>
  137. <el-table-column label="粪便筛" align="center" min-width="300px">
  138. <el-table-column label="粪便筛一层(%)" min-width="80px" align="center">
  139. <template slot-scope="scope">
  140. <span>{{ scope.row.fbonemin }} - {{ scope.row.fbonemax }}</span>
  141. </template>
  142. </el-table-column>
  143. <el-table-column label="粪便筛二层(%)" min-width="80px" align="center">
  144. <template slot-scope="scope">
  145. <span>{{ scope.row.fbtwomin }} - {{ scope.row.fbtwomax }}</span>
  146. </template>
  147. </el-table-column>
  148. <el-table-column label="粪便筛三层(%)" min-width="80px" align="center">
  149. <template slot-scope="scope">
  150. <span>{{ scope.row.fbthreemin }} - {{ scope.row.fbthreemax }}</span>
  151. </template>
  152. </el-table-column>
  153. <el-table-column label="数据来源" min-width="80px" align="center">
  154. <template slot-scope="scope">
  155. <span>{{ scope.row.fbsource }}</span>
  156. </template>
  157. </el-table-column>
  158. </el-table-column>
  159. <el-table-column label="操作" align="center" width="50" class-name="small-padding fixed-width" fixed="right">
  160. <template slot-scope="{row}">
  161. <el-button v-if="isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
  162. </template>
  163. </el-table-column>
  164. </el-table>
  165. <span v-if="table2.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ table2.total }}条</span>
  166. </div>
  167. </el-tab-pane>
  168. </el-tabs>
  169. <!-- 体况、粪便评分标准 -->
  170. <el-dialog :fullscreen="dialogFull" :visible.sync="table1.dialogFormVisible" :close-on-click-modal="false" width="80%">
  171. <template slot="title">
  172. <div class="avue-crud__dialog__header">
  173. <span class="el-dialog__title">
  174. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
  175. {{ textMap[table1.dialogStatus] }}
  176. </span>
  177. <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
  178. <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
  179. <svg-icon v-else icon-class="fullscreen" />
  180. </div>
  181. </div>
  182. </template>
  183. <div class="app-add">
  184. <el-form ref="temp" :rules="table1.rules" :model="table1.temp" label-position="right" label-width="160px" style="width: 90%;margin:0 auto 50px">
  185. <el-row>
  186. <el-col :span="12">
  187. <h3 style="width: 160px;float: left;">配方</h3>
  188. </el-col>
  189. </el-row>
  190. <el-row>
  191. <el-col :span="12">
  192. <el-form-item label="配方名称:" prop="ftname">
  193. <span>{{ table1.temp.ftname }}</span>
  194. </el-form-item>
  195. </el-col>
  196. </el-row>
  197. <el-row>
  198. <el-col :span="12">
  199. <h3 style="width: 160px;float: left;">体况评分标准</h3>
  200. </el-col>
  201. </el-row>
  202. <el-row>
  203. <el-col :span="12">
  204. <el-form-item label="体况评分标准(分):" prop="bodystandard">
  205. <el-select v-model="table1.temp.bodystandard" filterable placeholder="评分标准" class="filter-item" style="width: 100%;">
  206. <el-option v-for="item in physicalList" :key="item.value" :label="item.label" :value="item.label" />
  207. </el-select>
  208. </el-form-item>
  209. </el-col>
  210. <el-col :span="12">
  211. <el-form-item label="数据来源:" prop="bodysource">
  212. <el-input v-model="table1.temp.bodysource" type="textarea" placeholder="1-255字符":autosize="{ minRows: 1, maxRows: 4}" style="width:100%;" maxlength="255" />
  213. </el-form-item>
  214. </el-col>
  215. </el-row>
  216. <el-row>
  217. <el-col :span="12">
  218. <h3 style="width: 160px;float: left;">粪便评分标准</h3>
  219. </el-col>
  220. </el-row>
  221. <el-row>
  222. <el-col :span="12">
  223. <el-form-item label="粪便评分标准(分):" prop="dungstandard">
  224. <el-select v-model="table1.temp.dungstandard" filterable placeholder="粪便评分标准" class="filter-item" style="width: 100%;">
  225. <el-option v-for="item in faecesList" :key="item.value" :label="item.label" :value="item.value" />
  226. </el-select>
  227. </el-form-item>
  228. </el-col>
  229. <el-col :span="12">
  230. <el-form-item label="数据来源:" prop="dungsource">
  231. <el-input v-model="table1.temp.dungsource" type="textarea" placeholder="1-255字符" :autosize="{ minRows: 1, maxRows: 4}" style="width:100%;" maxlength="255" />
  232. </el-form-item>
  233. </el-col>
  234. </el-row>
  235. </el-form>
  236. <div slot="footer" class="dialog-footer">
  237. <el-button class="cancelClose" @click="table1.dialogFormVisible = false;getList() ">关闭</el-button>
  238. <el-button class="save" :disabled="isokDisable" @click="updateData()">确认</el-button>
  239. </div>
  240. </div>
  241. </el-dialog>
  242. <!-- 宾州筛、粪便筛标准范围 -->
  243. <el-dialog :fullscreen="dialogFull" :visible.sync="table2.dialogFormVisible" :close-on-click-modal="false" width="80%">
  244. <template slot="title">
  245. <div class="avue-crud__dialog__header">
  246. <span class="el-dialog__title">
  247. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
  248. {{ textMap[table2.dialogStatus] }}
  249. </span>
  250. <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
  251. <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
  252. <svg-icon v-else icon-class="fullscreen" />
  253. </div>
  254. </div>
  255. </template>
  256. <div class="app-add">
  257. <el-form ref="temp" :rules="table2.rules" :model="table2.temp" label-position="right" label-width="160px" style="width: 90%;margin:0 auto 50px">
  258. <el-row>
  259. <el-col :span="10">
  260. <h3 style="width: 160px;float: left;">牲畜类别</h3>
  261. </el-col>
  262. </el-row>
  263. <el-row>
  264. <el-col :span="10">
  265. <el-form-item label="牲畜父类:" prop="parentname">
  266. <span>{{ table2.temp.parentname }}</span>
  267. </el-form-item>
  268. </el-col>
  269. <el-col :span="10">
  270. <el-form-item label="牲畜子类:" prop="cowname">
  271. <span>{{ table2.temp.cowname }}</span>
  272. </el-form-item>
  273. </el-col>
  274. </el-row>
  275. <el-row>
  276. <el-col :span="10">
  277. <h3 style="width: 160px;float: left;">宾州筛</h3>
  278. </el-col>
  279. </el-row>
  280. <el-row>
  281. <el-col :span="10">
  282. <el-form-item label="宾州筛一层(%):">
  283. <el-input-number v-model="table2.temp.bzonemin" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最小值" />
  284. <span style="width: 1%;">——</span>
  285. <el-input-number v-model="table2.temp.bzonemax" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最大值" />
  286. </el-form-item>
  287. </el-col>
  288. <el-col :span="10">
  289. <el-form-item label="宾州筛二层(%):">
  290. <el-input-number v-model="table2.temp.bztwomin" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最小值" />
  291. <span style="width: 1%;">——</span>
  292. <el-input-number v-model="table2.temp.bztwomax" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最大值" />
  293. </el-form-item>
  294. </el-col>
  295. </el-row>
  296. <el-row>
  297. <el-col :span="10">
  298. <el-form-item label="宾州筛三层(%):">
  299. <el-input-number v-model="table2.temp.bzthreemin" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最小值" />
  300. <span style="width: 1%;">——</span>
  301. <el-input-number v-model="table2.temp.bzthreemax" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最大值" />
  302. </el-form-item>
  303. </el-col>
  304. <el-col :span="10">
  305. <el-form-item label="宾州筛四层(%):">
  306. <el-input-number v-model="table2.temp.bzfourmin" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最小值" />
  307. <span style="width: 1%;">——</span>
  308. <el-input-number v-model="table2.temp.bzfourmax" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最大值" />
  309. </el-form-item>
  310. </el-col>
  311. </el-row>
  312. <el-row>
  313. <el-col :span="10">
  314. <el-form-item label="数据来源:" prop="bzsource">
  315. <el-input v-model="table2.temp.bzsource" type="textarea" placeholder="1-255字符" :autosize="{ minRows: 1, maxRows: 4}" style="width:100%;" maxlength="255" />
  316. </el-form-item>
  317. </el-col>
  318. </el-row>
  319. <el-row>
  320. <el-col :span="10">
  321. <h3 style="width: 160px;float: left;">粪便筛</h3>
  322. </el-col>
  323. </el-row>
  324. <el-row>
  325. <el-col :span="10">
  326. <el-form-item label="粪便筛一层(%):">
  327. <el-input-number v-model="table2.temp.fbonemin" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最小值" />
  328. <span style="width: 1%;">——</span>
  329. <el-input-number v-model="table2.temp.fbonemax" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最大值" />
  330. </el-form-item>
  331. </el-col>
  332. <el-col :span="10">
  333. <el-form-item label="粪便筛二层(%):">
  334. <el-input-number v-model="table2.temp.fbtwomin" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最小值" />
  335. <span style="width: 1%;">——</span>
  336. <el-input-number v-model="table2.temp.fbtwomax" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最大值" />
  337. </el-form-item>
  338. </el-col>
  339. </el-row>
  340. <el-row>
  341. <el-col :span="10">
  342. <el-form-item label="粪便筛三层(%):">
  343. <el-input-number v-model="table2.temp.fbthreemin" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最小值" />
  344. <span style="width: 1%;">——</span>
  345. <el-input-number v-model="table2.temp.fbthreemax" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最大值" />
  346. </el-form-item>
  347. </el-col>
  348. <el-col :span="10">
  349. <el-form-item label="数据来源:" prop="fbsource">
  350. <el-input v-model="table2.temp.fbsource" type="textarea" placeholder="1-255字符" :autosize="{ minRows: 1, maxRows: 4}" style="width:100%;" maxlength="255" />
  351. </el-form-item>
  352. </el-col>
  353. </el-row>
  354. </el-form>
  355. <div slot="footer" class="dialog-footer">
  356. <el-button class="cancelClose" @click="table2.dialogFormVisible = false; getList2()">关闭</el-button>
  357. <el-button class="save" :disabled="isokDisable" @click="updateData()">确认</el-button>
  358. </div>
  359. </div>
  360. </el-dialog>
  361. </div>
  362. </template>
  363. <script>
  364. import { GetDataByName, PostDataByName, failproccess, GetDataByNames, checkButtons } from '@/api/common'
  365. import Cookies from 'js-cookie'
  366. import axios from 'axios'
  367. import { parseTime, json2excel } from '@/utils/index.js'
  368. import { getToken } from '@/utils/auth'
  369. export default {
  370. name: 'StandardParameters',
  371. data() {
  372. return {
  373. dialogFull: false,
  374. isRoleEdit: [],
  375. activeName: 'first',
  376. requestParams: [
  377. { name: 'getDictByName', offset: 0, pagecount: 0, params: ['评分标准'] },
  378. { name: 'getDictByName2', offset: 0, pagecount: 0, params: ['粪便评分标准'] }
  379. ],
  380. physicalList: [], // 标准体况评分
  381. faecesList: [], // 标准粪便评分
  382. table1: {
  383. getdataListParm: {
  384. name: 'getOptscoreList',
  385. page: 1,
  386. offset: 1,
  387. returntype: 'Map',
  388. parammaps: {
  389. pastureid: Cookies.get('pastureid'),
  390. enable: ''
  391. }
  392. },
  393. tableKey: 0,
  394. list: [],
  395. total: 0,
  396. listLoading: true,
  397. // 编辑
  398. dialogFormVisible: false,
  399. dialogStatus: '',
  400. temp: {},
  401. rules: {
  402. bodystandard: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
  403. dungstandard: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
  404. }
  405. },
  406. table2: {
  407. getdataListParm: {
  408. name: 'getOptrangeList',
  409. page: 1,
  410. offset: 1,
  411. returntype: 'Map',
  412. parammaps: {
  413. pastureid: Cookies.get('pastureid')
  414. }
  415. },
  416. tableKey: 0,
  417. list: [],
  418. total: 0,
  419. listLoading: true,
  420. // 编辑
  421. dialogFormVisible: false,
  422. dialogStatus: '',
  423. temp: {},
  424. rules: {}
  425. },
  426. download: {
  427. getdataListParm: {},
  428. list: []
  429. },
  430. textMap: {
  431. update: '编辑'
  432. },
  433. requestParam: {},
  434. isokDisable: false,
  435. rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
  436. cellStyle: { padding: 0 + 'px' }
  437. }
  438. },
  439. computed: {
  440. // 设置请求头
  441. headers() {
  442. return {
  443. token: getToken()
  444. }
  445. },
  446. uploadData() {
  447. return {
  448. name: 'checkft,updateOptscoreUpload',
  449. importParams: '配方名称,体况评分标准(分),体况评分数据来源,粪便评分标准(分),粪便评分数据来源',
  450. sheetname: 'Sheet1',
  451. // 登录牧场
  452. pastureid: Cookies.get('pastureid'),
  453. // 日期参数
  454. dateParams: '',
  455. // 必填参数
  456. requiredParams: '配方名称,体况评分标准(分),粪便评分标准(分)',
  457. // 为数值的参数
  458. numParams: '体况评分标准(分),粪便评分标准(分)'
  459. }
  460. },
  461. // 设置上传地址
  462. uploadExcelUrl() {
  463. return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
  464. },
  465. headers2() {
  466. return {
  467. token: getToken()
  468. }
  469. },
  470. uploadData2() {
  471. return {
  472. name: 'checkbigcowclassW,checkclassnameW,insertOptrangeUpload',
  473. importParams: '牲畜父类,牲畜子类,宾州筛一层(%),宾州筛二层(%),宾州筛三层(%),宾州筛四层(%),宾州筛数据来源,粪便筛一层(%),粪便筛二层(%),粪便筛三层(%),粪便筛数据来源',
  474. sheetname: 'Sheet1',
  475. // 登录牧场
  476. pastureid: Cookies.get('pastureid'),
  477. // 日期参数
  478. dateParams: '',
  479. // 必填参数
  480. requiredParams: '牲畜父类,牲畜子类',
  481. // 为数值的参数
  482. numParams: ''
  483. }
  484. },
  485. // 设置上传地址
  486. uploadExcelUrl2() {
  487. return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
  488. }
  489. },
  490. created() {
  491. this.getList()
  492. this.getDownList()
  493. this.getButtons()
  494. },
  495. methods: {
  496. getButtons() {
  497. const Edit = 'StandardParameters'
  498. const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
  499. this.isRoleEdit = isRoleEdit
  500. },
  501. getDownList() {
  502. GetDataByNames(this.requestParams).then(response => {
  503. this.physicalList = response.data.getDictByName.list
  504. this.faecesList = response.data.getDictByName2.list
  505. })
  506. },
  507. handleTabClick(tab, event) {
  508. console.log(tab, event)
  509. if (tab.name === 'first') {
  510. this.getList()
  511. } else if (tab.name === 'second') {
  512. this.getList2()
  513. }
  514. },
  515. getList() {
  516. this.table1.listLoading = true
  517. GetDataByName(this.table1.getdataListParm).then(response => {
  518. console.log('table1数据', response.data.list)
  519. if (response.data.list !== null) {
  520. this.table1.list = response.data.list
  521. this.table1.total = response.data.total
  522. } else {
  523. this.table1.list = []
  524. }
  525. setTimeout(() => {
  526. this.table1.listLoading = false
  527. }, 100)
  528. })
  529. },
  530. getList2() {
  531. this.table2.listLoading = true
  532. GetDataByName(this.table2.getdataListParm).then(response => {
  533. console.log('table1数据', response.data.list)
  534. if (response.data.list !== null) {
  535. this.table2.list = response.data.list
  536. if (response.data.total) {
  537. this.table2.total = response.data.total
  538. }
  539. } else {
  540. this.table2.list = []
  541. }
  542. setTimeout(() => {
  543. this.table2.listLoading = false
  544. }, 100)
  545. })
  546. },
  547. // 编辑
  548. handleUpdate(row) {
  549. this.dialogFull = false
  550. if (this.activeName === 'first') {
  551. console.log('点击了体况、粪便评分标准编辑')
  552. this.table1.dialogStatus = 'update'
  553. this.table1.dialogFormVisible = true
  554. this.table1.temp = Object.assign({}, row)
  555. } else if (this.activeName === 'second') {
  556. console.log('点击了宾州筛、粪便筛标准范围编辑')
  557. this.table2.dialogStatus = 'update'
  558. this.table2.dialogFormVisible = true
  559. this.table2.temp = Object.assign({}, row)
  560. }
  561. },
  562. updateData() {
  563. if (this.activeName === 'first') {
  564. console.log('点击了体况、粪便评分标准编辑保存')
  565. this.isokDisable = true
  566. setTimeout(() => {
  567. this.isokDisable = false
  568. }, 1000)
  569. this.$refs['temp'].validate(valid => {
  570. if (valid) {
  571. this.requestParam.name = 'updateOptscore'
  572. this.requestParam.parammaps = this.table1.temp
  573. PostDataByName(this.requestParam).then(response => {
  574. console.log('新增保存发送参数', this.requestParam)
  575. if (response.msg !== 'fail') {
  576. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  577. this.table1.dialogFormVisible = false
  578. this.getList()
  579. } else {
  580. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  581. }
  582. })
  583. }
  584. })
  585. } else if (this.activeName === 'second') {
  586. console.log('点击了宾州筛、粪便筛标准范围编辑保存')
  587. this.isokDisable = true
  588. setTimeout(() => {
  589. this.isokDisable = false
  590. }, 1000)
  591. // 若最小值大于最大值
  592. if (parseFloat(this.table2.temp.bzonemin) > parseFloat(this.table2.temp.bzonemax)) {
  593. this.$message({ type: 'error', message: '宾州筛一层最大值不可小于等于最小值', duration: 2000 })
  594. return false
  595. }
  596. if (parseFloat(this.table2.temp.bztwomin) > parseFloat(this.table2.temp.bztwomax)) {
  597. this.$message({ type: 'error', message: '宾州筛二层最大值不可小于等于最小值', duration: 2000 })
  598. return false
  599. }
  600. if (parseFloat(this.table2.temp.bzthreemin) > parseFloat(this.table2.temp.bzthreemax)) {
  601. this.$message({ type: 'error', message: '宾州筛三层最大值不可小于等于最小值', duration: 2000 })
  602. return false
  603. }
  604. if (parseFloat(this.table2.temp.bzfourmin) > parseFloat(this.table2.temp.bzfourmax)) {
  605. this.$message({ type: 'error', message: '宾州筛四层最大值不可小于等于最小值', duration: 2000 })
  606. return false
  607. }
  608. if (parseFloat(this.table2.temp.fbonemin) > parseFloat(this.table2.temp.fbonemax)) {
  609. this.$message({ type: 'error', message: '粪便筛一层最大值不可小于等于最小值', duration: 2000 })
  610. return false
  611. }
  612. if (parseFloat(this.table2.temp.fbtwomin) > parseFloat(this.table2.temp.fbtwomax)) {
  613. this.$message({ type: 'error', message: '粪便筛二层最大值不可小于等于最小值', duration: 2000 })
  614. return false
  615. }
  616. if (parseFloat(this.table2.temp.fbthreemin) > parseFloat(this.table2.temp.fbthreemax)) {
  617. this.$message({ type: 'error', message: '粪便筛三层最大值不可小于等于最小值', duration: 2000 })
  618. return false
  619. }
  620. // 若最大值最小值为空
  621. if (this.table2.temp.bzonemin == '' || this.table2.temp.bzonemin == undefined) { this.table2.temp.bzonemin = '0' }
  622. if (this.table2.temp.bzonemax == '' || this.table2.temp.bzonemax == undefined) { this.table2.temp.bzonemax = '0' }
  623. if (this.table2.temp.bztwomin == '' || this.table2.temp.bztwomin == undefined) { this.table2.temp.bztwomin = '0' }
  624. if (this.table2.temp.bztwomax == '' || this.table2.temp.bztwomax == undefined) { this.table2.temp.bztwomax = '0' }
  625. if (this.table2.temp.bzthreemin == '' || this.table2.temp.bzthreemin == undefined) { this.table2.temp.bzthreemin = '0' }
  626. if (this.table2.temp.bzthreemax == '' || this.table2.temp.bzthreemax == undefined) { this.table2.temp.bzthreemax = '0' }
  627. if (this.table2.temp.bzfourmin == '' || this.table2.temp.bzfourmin == undefined) { this.table2.temp.bzfourmin = '0' }
  628. if (this.table2.temp.bzfourmax == '' || this.table2.temp.bzfourmax == undefined) { this.table2.temp.bzfourmax = '0' }
  629. if (this.table2.temp.fbonemin == '' || this.table2.temp.fbonemin == undefined) { this.table2.temp.fbonemin = '0' }
  630. if (this.table2.temp.fbonemax == '' || this.table2.temp.fbonemax == undefined) { this.table2.temp.fbonemax = '0' }
  631. if (this.table2.temp.fbtwomin == '' || this.table2.temp.fbtwomin == undefined) { this.table2.temp.fbtwomin = '0' }
  632. if (this.table2.temp.fbtwomax == '' || this.table2.temp.fbtwomax == undefined) { this.table2.temp.fbtwomax = '0' }
  633. if (this.table2.temp.fbthreemin == '' || this.table2.temp.fbthreemin == undefined) { this.table2.temp.fbthreemin = '0' }
  634. if (this.table2.temp.fbthreemax == '' || this.table2.temp.fbthreemax == undefined) { this.table2.temp.fbthreemax = '0' }
  635. var positiveInteger = /^([0-9]{1,2}|100)$/
  636. if (!positiveInteger.test(parseFloat(this.table2.temp.bzonemin))) {
  637. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  638. return false
  639. }
  640. if (!positiveInteger.test(parseFloat(this.table2.temp.bzonemax))) {
  641. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  642. return false
  643. }
  644. if (!positiveInteger.test(parseFloat(this.table2.temp.bztwomin))) {
  645. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  646. return false
  647. }
  648. if (!positiveInteger.test(parseFloat(this.table2.temp.bztwomax))) {
  649. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  650. return false
  651. }
  652. if (!positiveInteger.test(parseFloat(this.table2.temp.bzthreemin))) {
  653. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  654. return false
  655. }
  656. if (!positiveInteger.test(parseFloat(this.table2.temp.bzthreemax))) {
  657. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  658. return false
  659. }
  660. if (!positiveInteger.test(parseFloat(this.table2.temp.bzfourmin))) {
  661. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  662. return false
  663. }
  664. if (!positiveInteger.test(parseFloat(this.table2.temp.bzfourmax))) {
  665. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  666. return false
  667. }
  668. if (!positiveInteger.test(parseFloat(this.table2.temp.fbonemin))) {
  669. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  670. return false
  671. }
  672. if (!positiveInteger.test(parseFloat(this.table2.temp.fbonemax))) {
  673. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  674. return false
  675. }
  676. if (!positiveInteger.test(parseFloat(this.table2.temp.fbtwomin))) {
  677. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  678. return false
  679. }
  680. if (!positiveInteger.test(parseFloat(this.table2.temp.fbtwomax))) {
  681. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  682. return false
  683. }
  684. if (!positiveInteger.test(parseFloat(this.table2.temp.fbthreemin))) {
  685. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  686. return false
  687. }
  688. if (!positiveInteger.test(parseFloat(this.table2.temp.fbthreemin))) {
  689. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  690. return false
  691. }
  692. this.requestParam.name = 'insertOptrange'
  693. this.requestParam.parammaps = this.table2.temp
  694. this.$refs['temp'].validate(valid => {
  695. if (valid) {
  696. PostDataByName(this.requestParam).then(response => {
  697. console.log('新增保存发送参数', this.requestParam)
  698. if (response.msg !== 'fail') {
  699. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  700. this.table2.dialogFormVisible = false
  701. this.getList2()
  702. this.activeName = 'second'
  703. } else {
  704. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  705. if (this.table2.temp.bzonemin == '0') { this.table2.temp.bzonemin = '' }
  706. if (this.table2.temp.bzonemax == '0') { this.table2.temp.bzonemax = '' }
  707. if (this.table2.temp.bztwomin == '0') { this.table2.temp.bztwomin = '' }
  708. if (this.table2.temp.bztwomax == '0') { this.table2.temp.bztwomax = '' }
  709. if (this.table2.temp.bzthreemin == '0') { this.table2.temp.bzthreemin = '' }
  710. if (this.table2.temp.bzthreemax == '0') { this.table2.temp.bzthreemax = '' }
  711. if (this.table2.temp.bzfourmin == '0') { this.table2.temp.bzfourmin = '' }
  712. if (this.table2.temp.bzfourmax == '0') { this.table2.temp.bzfourmax = '' }
  713. if (this.table2.temp.fbonemin == '0') { this.table2.temp.fbonemin = '' }
  714. if (this.table2.temp.fbonemax == '0') { this.table2.temp.fbonemax = '' }
  715. if (this.table2.temp.fbtwomin == '0') { this.table2.temp.fbtwomin = '' }
  716. if (this.table2.temp.fbtwomax == '0') { this.table2.temp.fbtwomax = '' }
  717. if (this.table2.temp.fbthreemin == '0') { this.table2.temp.fbthreemin = '' }
  718. if (this.table2.temp.fbthreemax == '0') { this.table2.temp.fbthreemax = '' }
  719. }
  720. })
  721. }
  722. })
  723. }
  724. },
  725. // 导出
  726. handleExport(item) {
  727. if (item == 1) {
  728. console.log('体况、粪便评分标准/导出')
  729. var downloadList = [
  730. { 'obj1': '1、文件类型为xlsx类型,对应表格文件名格式为:文件名称.xlsx;' },
  731. { 'obj1': '2、底部工作表名称不可更改,默认为:Sheet1;' },
  732. { 'obj1': '3、配方名称,体况评分标准(分),粪便评分标准为必填;' },
  733. { 'obj1': '4、配方名称必须与系统中配方模板的配方名称匹配;' },
  734. { 'obj1': '5、标准分数为固定几个分值,分别为:2.75-,2.75,3,3.25,3.75,4+;粪便评分标准为1,2,3,4,5' },
  735. { 'obj1': '6、数据最多可导入200条,超过200条请分多个文件导入。' }
  736. ]
  737. var excelDatas = [
  738. {
  739. tHeader: ['配方名称', '体况评分标准(分)', '体况评分数据来源', '粪便评分标准(分)', '粪便评分数据来源'],
  740. filterVal: ['ftname', '', '', '', ''],
  741. tableDatas: this.table1.list,
  742. sheetName: 'Sheet1'
  743. }, {
  744. tHeader: ['填写规范:'],
  745. filterVal: ['obj1'],
  746. tableDatas: downloadList,
  747. sheetName: 'Sheet2'
  748. }
  749. ]
  750. json2excel(excelDatas, '基础数据_体况、粪便评分标准导入模板', true, 'xlsx')
  751. } else if (item == 3) {
  752. console.log('宾州筛、粪便筛标准范围/导出')
  753. this.download.getdataListParm.name = 'getOptrangeList'
  754. this.download.getdataListParm.parammaps = {}
  755. this.download.getdataListParm.parammaps.pastureid = Cookies.get('pastureid')
  756. GetDataByName(this.download.getdataListParm).then(response => {
  757. if (response.data.list !== null) {
  758. this.download.list = response.data.list
  759. } else {
  760. this.download.list = []
  761. }
  762. var downloadList = [
  763. { 'obj1': '1、文件类型为xlsx类型,对应表格文件名格式为:文件名称.xlsx;' },
  764. { 'obj1': '2、底部工作表名称不可更改,默认为:Sheet1;' },
  765. { 'obj1': '3、牲畜父类,牲畜子类为必填;' },
  766. { 'obj1': '4、牲畜类别必须与系统基础数据中牲畜类别匹配;' },
  767. { 'obj1': '5、数据最多可导入200条,超过200条请分多个文件导入。' }
  768. ]
  769. var excelDatas = [
  770. {
  771. tHeader: ['牲畜父类', '牲畜子类', '宾州筛一层(%)', '宾州筛二层(%)', '宾州筛三层(%)', '宾州筛四层(%)', '宾州筛数据来源', '粪便筛一层(%)', '粪便筛二层(%)', '粪便筛三层(%)', '粪便筛数据来源'],
  772. filterVal: ['parentname', 'cowname', '', '', '', '', '', '', '', '', ''],
  773. tableDatas: this.download.list,
  774. sheetName: 'Sheet1'
  775. }, {
  776. tHeader: ['填写规范:'],
  777. filterVal: ['obj1'],
  778. tableDatas: downloadList,
  779. sheetName: 'Sheet2'
  780. }
  781. ]
  782. json2excel(excelDatas, '基础数据_宾州筛、粪便筛标准范围导入模板', true, 'xlsx')
  783. })
  784. } else if (item == 2) {
  785. console.log('体况评分导出数据', this.table1.list)
  786. import('@/vendor/Export5Excel').then(excel => {
  787. const multiHeader = [
  788. ['配方名称', '体况评分标准', '', '粪便评分标准', '']
  789. ]
  790. const multiHeader2 = [
  791. ['', '体况评分标准(分)', '数据来源', '粪便评分标准(分)', '数据来源']
  792. ]
  793. const filterVal = ['ftname', 'bodystandard', 'bodysource', 'dungstandard', 'dungsource']
  794. const data = this.table1.list.map((v) => filterVal.map((j) => v[j]))
  795. const merges = ['A1:A2', 'B1:C1', 'D1:E1']
  796. excel.export_json_to_excel({ multiHeader, multiHeader2, data, filename: '体况、粪便评分标准导出数据', merges })
  797. })
  798. } else if (item == 4) {
  799. var downList = []
  800. for (let i = 0; i < this.table2.list.length; i++) {
  801. var obj = {}
  802. obj.parentname = this.table2.list[i].parentname
  803. obj.cowname = this.table2.list[i].cowname
  804. obj.bzsource = this.table2.list[i].bzsource
  805. if (this.table2.list[i].bzonemin == undefined) { this.table2.list[i].bzonemin = '' }
  806. if (this.table2.list[i].bzonemax == undefined) { this.table2.list[i].bzonemax = '' }
  807. if (this.table2.list[i].bztwomin == undefined) { this.table2.list[i].bztwomin = '' }
  808. if (this.table2.list[i].bztwomax == undefined) { this.table2.list[i].bztwomax = '' }
  809. if (this.table2.list[i].bzthreemin == undefined) { this.table2.list[i].bzthreemin = '' }
  810. if (this.table2.list[i].bzthreemax == undefined) { this.table2.list[i].bzthreemax = '' }
  811. if (this.table2.list[i].bzfourmin == undefined) { this.table2.list[i].bzfourmin = '' }
  812. if (this.table2.list[i].bzfourmax == undefined) { this.table2.list[i].bzfourmax = '' }
  813. if (this.table2.list[i].fbonemin == undefined) { this.table2.list[i].fbonemin = '' }
  814. if (this.table2.list[i].fbonemax == undefined) { this.table2.list[i].fbonemax = '' }
  815. if (this.table2.list[i].fbtwomin == undefined) { this.table2.list[i].fbtwomin = '' }
  816. if (this.table2.list[i].fbtwomax == undefined) { this.table2.list[i].fbtwomax = '' }
  817. if (this.table2.list[i].fbthreemin == undefined) { this.table2.list[i].fbthreemin = '' }
  818. if (this.table2.list[i].fbthreemax == undefined) { this.table2.list[i].fbthreemax = '' }
  819. obj.one1 = this.table2.list[i].bzonemin + '-' + this.table2.list[i].bzonemax
  820. obj.two1 = this.table2.list[i].bztwomin + '-' + this.table2.list[i].bztwomax
  821. obj.three1 = this.table2.list[i].bzthreemin + '-' + this.table2.list[i].bzthreemax
  822. obj.four1 = this.table2.list[i].bzfourmin + '-' + this.table2.list[i].bzfourmax
  823. obj.one2 = this.table2.list[i].fbonemin + '-' + this.table2.list[i].fbonemax
  824. obj.two2 = this.table2.list[i].fbtwomin + '-' + this.table2.list[i].fbtwomax
  825. obj.three2 = this.table2.list[i].fbthreemin + '-' + this.table2.list[i].fbthreemax
  826. obj.fbsource = this.table2.list[i].fbsource
  827. downList.push(obj)
  828. }
  829. import('@/vendor/Export5Excel').then(excel => {
  830. const multiHeader = [
  831. ['牲畜类别', '', '宾州筛', '', '', '', '', '粪便筛', '', '', '']
  832. ]
  833. const multiHeader2 = [
  834. ['牲畜父类', '牲畜子类', '宾州筛一层(%)', '宾州筛二层(%)', '宾州筛三层(%)', '宾州筛四层(%)', '数据来源', '粪便筛一层(%)', '粪便筛二层(%)', '粪便筛三层(%)', '数据来源']
  835. ]
  836. const filterVal = ['parentname', 'cowname', 'one1', 'two1', 'three1', 'four1', 'bzsource', 'one2', 'two2', 'three2', 'fbsource']
  837. const data = downList.map((v) => filterVal.map((j) => v[j]))
  838. const merges = ['A1:B1', 'C1:G1', 'H1:K1']
  839. excel.export_json_to_excel({ multiHeader, multiHeader2, data, filename: '宾州筛、粪便筛标准范围导出数据', merges })
  840. })
  841. }
  842. },
  843. beforeImport(file) {
  844. const isLt2M = file.size / 1024 / 1024 < 2
  845. if (!isLt2M) {
  846. this.$message.error('上传文件大小不能超过 2MB!')
  847. }
  848. return isLt2M
  849. },
  850. handleImportSuccess(res, file) {
  851. this.getList()
  852. if (res.msg === 'ok') {
  853. this.$message({ title: '成功', message: '导入成功:' + res.data.success + '条!', type: 'success', duration: 2000 })
  854. if (res.data.err_count > 0) {
  855. this.$notify({ title: '失败', message: '导入失败:' + res.data.err_count + '条!', type: 'danger', duration: 2000 })
  856. import('@/vendor/Export2Excel').then(excel => {
  857. const list1 = res.data.result
  858. const tHeader = [
  859. '配方名称', '体况评分标准(分)', '体况评分数据来源', '粪便评分标准(分)', '粪便评分数据来源', '错误信息'
  860. ]
  861. const filterVal = [
  862. '配方名称', '体况评分标准(分)', '体况评分数据来源', '粪便评分标准(分)', '粪便评分数据来源', 'error_msg'
  863. ]
  864. const data1 = this.formatJson(filterVal, list1)
  865. excel.export_json_to_excel({ header: tHeader, data: data1, filename: '体况、粪便评分导入报错信息', autoWidth: true, bookType: 'xlsx' })
  866. })
  867. }
  868. } else {
  869. this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
  870. }
  871. },
  872. formatJson(filterVal, jsonData) {
  873. return jsonData.map(v =>
  874. filterVal.map(j => {
  875. if (j === 'timestamp') {
  876. return parseTime(v[j])
  877. } else {
  878. return v[j]
  879. }
  880. })
  881. )
  882. },
  883. beforeImport2(file) {
  884. const isLt2M = file.size / 1024 / 1024 < 2
  885. if (!isLt2M) {
  886. this.$message.error('上传文件大小不能超过 2MB!')
  887. }
  888. return isLt2M
  889. },
  890. handleImportSuccess2(res, file) {
  891. this.getList2()
  892. if (res.msg === 'ok') {
  893. this.$message({ title: '成功', message: '导入成功:' + res.data.success + '条!', type: 'success', duration: 2000 })
  894. if (res.data.err_count > 0) {
  895. this.$notify({ title: '失败', message: '导入失败:' + res.data.err_count + '条!', type: 'danger', duration: 2000 })
  896. import('@/vendor/Export2Excel').then(excel => {
  897. const list1 = res.data.result
  898. const tHeader = [
  899. '牲畜父类', '牲畜子类', '宾州筛一层(%)', '宾州筛二层(%)', '宾州筛三层(%)', '宾州筛四层(%)', '宾州筛数据来源', '粪便筛二层(%)', '粪便筛三层(%)', '粪便筛数据来源', '错误信息'
  900. ]
  901. const filterVal = [
  902. '牲畜父类', '牲畜子类', '宾州筛一层(%)', '宾州筛二层(%)', '宾州筛三层(%)', '宾州筛四层(%)', '宾州筛数据来源', '粪便筛二层(%)', '粪便筛三层(%)', '粪便筛数据来源', 'error_msg'
  903. ]
  904. const data1 = this.formatJson2(filterVal, list1)
  905. excel.export_json_to_excel({ header: tHeader, data: data1, filename: '宾州筛、粪便筛导入报错信息', autoWidth: true, bookType: 'xlsx' })
  906. })
  907. }
  908. } else {
  909. this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
  910. }
  911. },
  912. formatJson2(filterVal, jsonData) {
  913. return jsonData.map(v =>
  914. filterVal.map(j => {
  915. if (j === 'timestamp') {
  916. return parseTime(v[j])
  917. } else {
  918. return v[j]
  919. }
  920. })
  921. )
  922. }
  923. // 导入
  924. // handleImport() {
  925. // if (this.activeName === 'first') {
  926. // console.log('体况、粪便评分标准/导入')
  927. // } else if (this.activeName === 'second') {
  928. // console.log('宾州筛、粪便筛标准范围/导入')
  929. // }
  930. // }
  931. }
  932. }
  933. </script>
  934. <style lang="scss" scoped>
  935. // .operation{
  936. // position: relative;
  937. // height: 50px;
  938. // .export{position: absolute;right: 110px;bottom: 10px;}
  939. // .import{position: absolute;right: 0;bottom: 10px;}
  940. // }
  941. </style>