d422a0b9524b8d1250e2bc9386f3c58e00ce251c.svn-base 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. <template>
  2. <div class="app-container">
  3. <el-tabs v-model="activeName" @tab-click="handleTabClick">
  4. <el-tab-pane label="体况、粪便评分标准" name="first">
  5. <div class="operation">
  6. <el-button class="import" style="float: right;" @click="handleImport">导入</el-button>
  7. <el-button class="export" style="float: right;margin-right: 10px;" @click="handleExport">导出</el-button>
  8. </div>
  9. <div class="table1">
  10. <el-table
  11. :key="table1.tableKey"
  12. v-loading="table1.listLoading"
  13. element-loading-text="给我一点时间"
  14. :data="table1.list"
  15. border
  16. fit
  17. highlight-current-row
  18. style="width: 100%;"
  19. :row-style="rowStyle"
  20. :cell-style="cellStyle"
  21. class="elTable table-fixed"
  22. >
  23. <el-table-column label="序号" align="center" type="index" width="50px">
  24. <template slot-scope="scope">
  25. <span>{{ scope.$index + (table1.pageNum-1) * table1.pageSize + 1 }}</span>
  26. </template>
  27. </el-table-column>
  28. <el-table-column label="配方名称" min-width="130px" align="center">
  29. <template slot-scope="scope">
  30. <span>{{ scope.row.brandName }}</span>
  31. </template>
  32. </el-table-column>
  33. <el-table-column label="体况评分标准" align="center" min-width="300px">
  34. <el-table-column label="体况评分标准(分)" min-width="80px" align="center">
  35. <template slot-scope="scope">
  36. <span>{{ scope.row.brandName }}</span>
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="数据来源" min-width="80px" align="center">
  40. <template slot-scope="scope">
  41. <span>{{ scope.row.brandName }}</span>
  42. </template>
  43. </el-table-column>
  44. </el-table-column>
  45. <el-table-column label="粪便评分标准" align="center" min-width="300px">
  46. <el-table-column label="粪便评分标准(分)" min-width="80px" align="center">
  47. <template slot-scope="scope">
  48. <span>{{ scope.row.brandName }}</span>
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="数据来源" min-width="80px" align="center">
  52. <template slot-scope="scope">
  53. <span>{{ scope.row.brandName }}</span>
  54. </template>
  55. </el-table-column>
  56. </el-table-column>
  57. <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
  58. <template slot-scope="{row}">
  59. <el-button class="miniSuccess" @click="handleUpdate(row)">编辑</el-button>
  60. </template>
  61. </el-table-column>
  62. </el-table>
  63. </div>
  64. </el-tab-pane>
  65. <el-tab-pane label="宾州筛、粪便筛标准范围" name="second">
  66. <div class="operation">
  67. <el-button class="import" style="float: right;" @click="handleImport">导入</el-button>
  68. <el-button class="export" style="float: right;margin-right: 10px;" @click="handleExport">导出</el-button>
  69. </div>
  70. <div class="table2">
  71. <el-table
  72. :key="table2.tableKey"
  73. v-loading="table2.listLoading"
  74. element-loading-text="给我一点时间"
  75. :data="table2.list"
  76. border
  77. fit
  78. highlight-current-row
  79. style="width: 100%;"
  80. :row-style="rowStyle"
  81. :cell-style="cellStyle"
  82. class="elTable table-fixed"
  83. >
  84. <el-table-column label="序号" align="center" type="index" width="50px">
  85. <template slot-scope="scope">
  86. <span>{{ scope.$index + (table2.pageNum-1) * table2.pageSize + 1 }}</span>
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="牲畜类别" align="center" min-width="200px">
  90. <el-table-column label="牲畜父类" min-width="80px" align="center">
  91. <template slot-scope="scope">
  92. <span>{{ scope.row.brandName }}</span>
  93. </template>
  94. </el-table-column>
  95. <el-table-column label="牲畜子类" min-width="80px" align="center">
  96. <template slot-scope="scope">
  97. <span>{{ scope.row.brandName }}</span>
  98. </template>
  99. </el-table-column>
  100. </el-table-column>
  101. <el-table-column label="宾州筛" align="center" min-width="200px">
  102. <el-table-column label="宾州筛一层(%)" min-width="80px" align="center">
  103. <template slot-scope="scope">
  104. <span>{{ scope.row.brandName }}</span>
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="宾州筛二层(%)" min-width="80px" align="center">
  108. <template slot-scope="scope">
  109. <span>{{ scope.row.brandName }}</span>
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="宾州筛三层(%)" min-width="80px" align="center">
  113. <template slot-scope="scope">
  114. <span>{{ scope.row.brandName }}</span>
  115. </template>
  116. </el-table-column>
  117. <el-table-column label="宾州筛四层(%)" min-width="80px" align="center">
  118. <template slot-scope="scope">
  119. <span>{{ scope.row.brandName }}</span>
  120. </template>
  121. </el-table-column>
  122. <el-table-column label="数据来源" min-width="80px" align="center">
  123. <template slot-scope="scope">
  124. <span>{{ scope.row.brandName }}</span>
  125. </template>
  126. </el-table-column>
  127. </el-table-column>
  128. <el-table-column label="粪便筛" align="center" min-width="300px">
  129. <el-table-column label="粪便筛一层(%)" min-width="80px" align="center">
  130. <template slot-scope="scope">
  131. <span>{{ scope.row.brandName }}</span>
  132. </template>
  133. </el-table-column>
  134. <el-table-column label="粪便筛二层(%)" min-width="80px" align="center">
  135. <template slot-scope="scope">
  136. <span>{{ scope.row.brandName }}</span>
  137. </template>
  138. </el-table-column>
  139. <el-table-column label="粪便筛三层(%)" min-width="80px" align="center">
  140. <template slot-scope="scope">
  141. <span>{{ scope.row.brandName }}</span>
  142. </template>
  143. </el-table-column>
  144. <el-table-column label="粪便筛四层(%)" min-width="80px" align="center">
  145. <template slot-scope="scope">
  146. <span>{{ scope.row.brandName }}</span>
  147. </template>
  148. </el-table-column>
  149. <el-table-column label="数据来源" min-width="80px" align="center">
  150. <template slot-scope="scope">
  151. <span>{{ scope.row.brandName }}</span>
  152. </template>
  153. </el-table-column>
  154. </el-table-column>
  155. <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
  156. <template slot-scope="{row}">
  157. <el-button class="miniSuccess" @click="handleUpdate(row)">编辑</el-button>
  158. </template>
  159. </el-table-column>
  160. </el-table>
  161. </div>
  162. </el-tab-pane>
  163. </el-tabs>
  164. <!-- 体况、粪便评分标准 -->
  165. <el-dialog :title="textMap[table1.dialogStatus]" :visible.sync="table1.dialogFormVisible" :close-on-click-modal="false" width="80%">
  166. <div class="app-add">
  167. <el-form ref="temp" :rules="table2.rules" :model="table2.temp" label-position="right" label-width="160px" style="width: 90%;margin:0 auto 50px">
  168. <el-row>
  169. <el-col :span="12">
  170. <h3 style="width: 160px;float: left;">配方</h3>
  171. </el-col>
  172. </el-row>
  173. <el-row>
  174. <el-col :span="12">
  175. <el-form-item label="配方名称:" prop="location">
  176. <span>{{ table1.temp.location }}</span>
  177. </el-form-item>
  178. </el-col>
  179. </el-row>
  180. <el-row>
  181. <el-col :span="12">
  182. <h3 style="width: 160px;float: left;">体况评分标准</h3>
  183. </el-col>
  184. </el-row>
  185. <el-row>
  186. <el-col :span="12">
  187. <el-form-item label="体况评分标准(分):" prop="location">
  188. <el-select v-model="table1.temp.location" placeholder="评分标准" class="filter-item" style="width: 100%;">
  189. <el-option v-for="item in physicalList" :key="item.id" :label="item.name" :value="item.id" />
  190. </el-select>
  191. </el-form-item>
  192. </el-col>
  193. <el-col :span="12">
  194. <el-form-item label="数据来源:" prop="location">
  195. <el-input v-model="table1.temp.brandName" type="textarea" placeholder="1-255字符":autosize="{ minRows: 1, maxRows: 4}" style="width:100%;" maxlength="255" />
  196. </el-form-item>
  197. </el-col>
  198. </el-row>
  199. <el-row>
  200. <el-col :span="12">
  201. <h3 style="width: 160px;float: left;">粪便评分标准</h3>
  202. </el-col>
  203. </el-row>
  204. <el-row>
  205. <el-col :span="12">
  206. <el-form-item label="粪便评分标准(分):" prop="location">
  207. <el-select v-model="table1.temp.location" placeholder="评分标准" class="filter-item" style="width: 100%;">
  208. <el-option v-for="item in physicalList" :key="item.id" :label="item.name" :value="item.id" />
  209. </el-select>
  210. </el-form-item>
  211. </el-col>
  212. <el-col :span="12">
  213. <el-form-item label="数据来源:" prop="location">
  214. <el-input v-model="table1.temp.brandName" type="textarea" placeholder="1-255字符" :autosize="{ minRows: 1, maxRows: 4}" style="width:100%;" maxlength="255" />
  215. </el-form-item>
  216. </el-col>
  217. </el-row>
  218. </el-form>
  219. <div slot="footer" class="dialog-footer">
  220. <el-button class="cancel" @click="table1.dialogFormVisible = false; ">关闭</el-button>
  221. <el-button class="success" :disabled="isokDisable" @click="updateData()">确认</el-button>
  222. </div>
  223. </div>
  224. </el-dialog>
  225. <!-- 宾州筛、粪便筛标准范围 -->
  226. <el-dialog :title="textMap[table2.dialogStatus]" :visible.sync="table2.dialogFormVisible" :close-on-click-modal="false" width="80%">
  227. <div class="app-add">
  228. <el-form ref="temp" :rules="table2.rules" :model="table2.temp" label-position="right" label-width="160px" style="width: 90%;margin:0 auto 50px">
  229. <el-row>
  230. <el-col :span="8">
  231. <h3 style="width: 160px;float: left;">牲畜类别</h3>
  232. </el-col>
  233. </el-row>
  234. <el-row>
  235. <el-col :span="8">
  236. <el-form-item label="牲畜父类:" prop="location">
  237. <span>{{ table2.temp.location }}</span>
  238. </el-form-item>
  239. </el-col>
  240. <el-col :span="8">
  241. <el-form-item label="牲畜子类:" prop="location">
  242. <span>{{ table2.temp.location }}</span>
  243. </el-form-item>
  244. </el-col>
  245. </el-row>
  246. <el-row>
  247. <el-col :span="8">
  248. <h3 style="width: 160px;float: left;">宾州筛</h3>
  249. </el-col>
  250. </el-row>
  251. <el-row>
  252. <el-col :span="8">
  253. <el-form-item label="宾州筛第一层(%):" prop="location">
  254. <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最小值" />
  255. <span style="width: 1%;">-</span>
  256. <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最大值" />
  257. </el-form-item>
  258. </el-col>
  259. <el-col :span="8">
  260. <el-form-item label="宾州筛第二层(%):" prop="location">
  261. <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最小值" />
  262. <span style="width: 1%;">-</span>
  263. <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最大值" />
  264. </el-form-item>
  265. </el-col>
  266. </el-row>
  267. <el-row>
  268. <el-col :span="8">
  269. <el-form-item label="宾州筛第三层(%):" prop="location">
  270. <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最小值" />
  271. <span style="width: 2%;">-</span>
  272. <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最大值" />
  273. </el-form-item>
  274. </el-col>
  275. <el-col :span="8">
  276. <el-form-item label="宾州筛第四层(%):" prop="location">
  277. <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最小值" />
  278. <span style="width: 2%;">-</span>
  279. <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最大值" />
  280. </el-form-item>
  281. </el-col>
  282. </el-row>
  283. <el-row>
  284. <el-col :span="8">
  285. <el-form-item label="数据来源:" prop="location">
  286. <el-input v-model="table2.temp.brandName" type="textarea" placeholder="1-255字符" :autosize="{ minRows: 1, maxRows: 4}" style="width:100%;" maxlength="255" />
  287. </el-form-item>
  288. </el-col>
  289. </el-row>
  290. <el-row>
  291. <el-col :span="8">
  292. <h3 style="width: 160px;float: left;">粪便筛</h3>
  293. </el-col>
  294. </el-row>
  295. <el-row>
  296. <el-col :span="8">
  297. <el-form-item label="粪便筛第一层(%):" prop="location">
  298. <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最小值" />
  299. <span style="width:2%;">-</span>
  300. <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最大值" />
  301. </el-form-item>
  302. </el-col>
  303. <el-col :span="8">
  304. <el-form-item label="粪便筛第二层(%):" prop="location">
  305. <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最小值" />
  306. <span style="width:2%;">-</span>
  307. <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最大值" />
  308. </el-form-item>
  309. </el-col>
  310. </el-row>
  311. <el-row>
  312. <el-col :span="8">
  313. <el-form-item label="粪便筛第三层(%):" prop="location">
  314. <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最小值" />
  315. <span style="width:2%;">-</span>
  316. <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最大值" />
  317. </el-form-item>
  318. </el-col>
  319. <el-col :span="8">
  320. <el-form-item label="数据来源:" prop="location">
  321. <el-input v-model="table2.temp.brandName" type="textarea" placeholder="1-255字符" :autosize="{ minRows: 1, maxRows: 4}" style="width:100%;" maxlength="255" />
  322. </el-form-item>
  323. </el-col>
  324. </el-row>
  325. </el-form>
  326. <div slot="footer" class="dialog-footer">
  327. <el-button class="cancel" @click="table2.dialogFormVisible = false; ">关闭</el-button>
  328. <el-button class="success" :disabled="isokDisable" @click="updateData()">确认</el-button>
  329. </div>
  330. </div>
  331. </el-dialog>
  332. </div>
  333. </template>
  334. <script>
  335. import { GetDataByName } from '@/api/common'
  336. export default {
  337. name: 'StandardParameters',
  338. data() {
  339. return {
  340. activeName: 'first',
  341. physicalList: [{ id: 0, name: '2.5' }, { id: 1, name: '2.75' }, { id: 2, name: '3' }, { id: 3, name: '3.25' }, { id: 4, name: '3.5' }, { id: 5, name: '3.75' }, { id: 6, name: '4+' }], // 标准体况评分
  342. faecesList: [{ id: 0, name: '1' }, { id: 1, name: '2' }, { id: 2, name: '3' }, { id: 3, name: '4' }, { id: 4, name: '5' }], // 标准粪便评分
  343. table1: {
  344. getdataListParm: {
  345. name: 'getAssetList',
  346. page: 1,
  347. offset: 1,
  348. pagecount: 10,
  349. returntype: 'Map',
  350. parammaps: {
  351. enable: ''
  352. }
  353. },
  354. tableKey: 0,
  355. list: [],
  356. total: 0,
  357. listLoading: true,
  358. // 编辑
  359. dialogFormVisible: false,
  360. dialogStatus: '',
  361. temp: {},
  362. rules: {}
  363. },
  364. table2: {
  365. getdataListParm: {
  366. name: 'getAssetList',
  367. page: 1,
  368. offset: 1,
  369. pagecount: 10,
  370. returntype: 'Map',
  371. parammaps: {
  372. enable: ''
  373. }
  374. },
  375. tableKey: 0,
  376. list: [],
  377. total: 0,
  378. listLoading: true,
  379. // 编辑
  380. dialogFormVisible: false,
  381. dialogStatus: '',
  382. temp: {},
  383. rules: {}
  384. },
  385. textMap: {
  386. update: '编辑'
  387. },
  388. isokDisable: false,
  389. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  390. cellStyle: { padding: 0 + 'px' }
  391. }
  392. },
  393. created() {
  394. this.getList()
  395. },
  396. methods: {
  397. handleTabClick(tab, event) {
  398. console.log(tab, event)
  399. if (tab.name === 'first') {
  400. this.getList()
  401. } else if (tab.name === 'second') {
  402. this.getList2()
  403. }
  404. },
  405. getList() {
  406. this.table1.listLoading = true
  407. GetDataByName(this.table1.getdataListParm).then(response => {
  408. console.log('table1数据', response.data.list)
  409. if (response.data.list !== null) {
  410. this.table1.list = response.data.list
  411. this.table1.pageNum = response.data.pageNum
  412. this.table1.pageSize = response.data.pageSize
  413. .table1.total = response.data.total
  414. } else {
  415. this.table1.list = []
  416. }
  417. setTimeout(() => {
  418. this.table1.listLoading = false
  419. }, 100)
  420. })
  421. },
  422. getList2() {
  423. this.table2.listLoading = true
  424. GetDataByName(this.table2.getdataListParm).then(response => {
  425. console.log('table1数据', response.data.list)
  426. if (response.data.list !== null) {
  427. this.table2.list = response.data.list
  428. this.table2.pageNum = response.data.pageNum
  429. this.table2.pageSize = response.data.pageSize
  430. if (response.data.total) {
  431. this.table2.total = response.data.total
  432. }
  433. } else {
  434. this.table2.list = []
  435. }
  436. setTimeout(() => {
  437. this.table2.listLoading = false
  438. }, 100)
  439. })
  440. },
  441. // 编辑
  442. handleUpdate() {
  443. if (this.activeName === 'first') {
  444. console.log('点击了体况、粪便评分标准编辑')
  445. this.table1.dialogStatus = 'update'
  446. this.table1.dialogFormVisible = true
  447. } else if (this.activeName === 'second') {
  448. console.log('点击了宾州筛、粪便筛标准范围编辑')
  449. this.table2.dialogStatus = 'update'
  450. this.table2.dialogFormVisible = true
  451. }
  452. },
  453. updateData() {
  454. if (this.activeName === 'first') {
  455. console.log('点击了体况、粪便评分标准编辑保存')
  456. } else if (this.activeName === 'second') {
  457. console.log('点击了宾州筛、粪便筛标准范围编辑保存')
  458. }
  459. },
  460. // 导出
  461. handleExport() {
  462. if (this.activeName === 'first') {
  463. console.log('体况、粪便评分标准/导出')
  464. } else if (this.activeName === 'second') {
  465. console.log('宾州筛、粪便筛标准范围/导出')
  466. }
  467. },
  468. // 导入
  469. handleImport() {
  470. if (this.activeName === 'first') {
  471. console.log('体况、粪便评分标准/导入')
  472. } else if (this.activeName === 'second') {
  473. console.log('宾州筛、粪便筛标准范围/导入')
  474. }
  475. }
  476. }
  477. }
  478. </script>
  479. <style lang="scss" scoped>
  480. .operation{
  481. position: relative;
  482. height: 50px;
  483. .export{position: absolute;right: 110px;bottom: 10px;}
  484. .import{position: absolute;right: 0;bottom: 10px;}
  485. }
  486. </style>