fb47fcafeed1ff9d5ce6ec18ae7f78186d5b17fc.svn-base 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  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.ftname }}</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.bodystandard }}</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.bodysource }}</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.dungstandard }}</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.dungsource }}</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 v-if="isRoleEdit" 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 v-if="isRoleEdit" 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.parentname }}</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.cowname }}</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.bzonemin }} - {{ scope.row.bzonemax }}</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.bztwomin }} - {{ scope.row.bztwomax }}</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.bzthreemin }} - {{ scope.row.bzthreemax }}</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.bzfourmin }} - {{ scope.row.bzfourmax }}</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.bzsource }}</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.fbonemin }} - {{ scope.row.fbonemax }}</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.fbtwomin }} - {{ scope.row.fbtwomax }}</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.fbthreemin }} - {{ scope.row.fbthreemax }}</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.fbsource }}</span>
  147. </template>
  148. </el-table-column>
  149. </el-table-column>
  150. <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
  151. <template slot-scope="{row}">
  152. <el-button class="miniSuccess" @click="handleUpdate(row)">编辑</el-button>
  153. </template>
  154. </el-table-column>
  155. </el-table>
  156. </div>
  157. </el-tab-pane>
  158. </el-tabs>
  159. <!-- 体况、粪便评分标准 -->
  160. <el-dialog :title="textMap[table1.dialogStatus]" :visible.sync="table1.dialogFormVisible" :close-on-click-modal="false" width="80%">
  161. <div class="app-add">
  162. <el-form ref="temp" :rules="table1.rules" :model="table1.temp" label-position="right" label-width="160px" style="width: 90%;margin:0 auto 50px">
  163. <el-row>
  164. <el-col :span="12">
  165. <h3 style="width: 160px;float: left;">配方</h3>
  166. </el-col>
  167. </el-row>
  168. <el-row>
  169. <el-col :span="12">
  170. <el-form-item label="配方名称:" prop="ftname">
  171. <span>{{ table1.temp.ftname }}</span>
  172. </el-form-item>
  173. </el-col>
  174. </el-row>
  175. <el-row>
  176. <el-col :span="12">
  177. <h3 style="width: 160px;float: left;">体况评分标准</h3>
  178. </el-col>
  179. </el-row>
  180. <el-row>
  181. <el-col :span="12">
  182. <el-form-item label="体况评分标准(分):" prop="bodystandard">
  183. <el-select v-model="table1.temp.bodystandard" filterable placeholder="评分标准" class="filter-item" style="width: 100%;">
  184. <el-option v-for="item in physicalList" :key="item.value" :label="item.label" :value="item.label" />
  185. </el-select>
  186. </el-form-item>
  187. </el-col>
  188. <el-col :span="12">
  189. <el-form-item label="数据来源:" prop="bodysource">
  190. <el-input v-model="table1.temp.bodysource" type="textarea" placeholder="1-255字符":autosize="{ minRows: 1, maxRows: 4}" style="width:100%;" maxlength="255" />
  191. </el-form-item>
  192. </el-col>
  193. </el-row>
  194. <el-row>
  195. <el-col :span="12">
  196. <h3 style="width: 160px;float: left;">粪便评分标准</h3>
  197. </el-col>
  198. </el-row>
  199. <el-row>
  200. <el-col :span="12">
  201. <el-form-item label="粪便评分标准(分):" prop="dungstandard">
  202. <el-select v-model="table1.temp.dungstandard" filterable placeholder="粪便评分标准" class="filter-item" style="width: 100%;">
  203. <el-option v-for="item in faecesList" :key="item.value" :label="item.label" :value="item.value" />
  204. </el-select>
  205. </el-form-item>
  206. </el-col>
  207. <el-col :span="12">
  208. <el-form-item label="数据来源:" prop="dungsource">
  209. <el-input v-model="table1.temp.dungsource" type="textarea" placeholder="1-255字符" :autosize="{ minRows: 1, maxRows: 4}" style="width:100%;" maxlength="255" />
  210. </el-form-item>
  211. </el-col>
  212. </el-row>
  213. </el-form>
  214. <div slot="footer" class="dialog-footer">
  215. <el-button class="cancel" @click="table1.dialogFormVisible = false;getList() ">关闭</el-button>
  216. <el-button class="success" :disabled="isokDisable" @click="updateData()">确认</el-button>
  217. </div>
  218. </div>
  219. </el-dialog>
  220. <!-- 宾州筛、粪便筛标准范围 -->
  221. <el-dialog :title="textMap[table2.dialogStatus]" :visible.sync="table2.dialogFormVisible" :close-on-click-modal="false" width="80%">
  222. <div class="app-add">
  223. <el-form ref="temp" :rules="table2.rules" :model="table2.temp" label-position="right" label-width="160px" style="width: 90%;margin:0 auto 50px">
  224. <el-row>
  225. <el-col :span="10">
  226. <h3 style="width: 160px;float: left;">牲畜类别</h3>
  227. </el-col>
  228. </el-row>
  229. <el-row>
  230. <el-col :span="10">
  231. <el-form-item label="牲畜父类:" prop="parentname">
  232. <span>{{ table2.temp.parentname }}</span>
  233. </el-form-item>
  234. </el-col>
  235. <el-col :span="10">
  236. <el-form-item label="牲畜子类:" prop="cowname">
  237. <span>{{ table2.temp.cowname }}</span>
  238. </el-form-item>
  239. </el-col>
  240. </el-row>
  241. <el-row>
  242. <el-col :span="10">
  243. <h3 style="width: 160px;float: left;">宾州筛</h3>
  244. </el-col>
  245. </el-row>
  246. <el-row>
  247. <el-col :span="10">
  248. <el-form-item label="宾州筛第一层(%):">
  249. <el-input-number v-model="table2.temp.bzonemin" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最小值" />
  250. <span style="width: 1%;">-</span>
  251. <el-input-number v-model="table2.temp.bzonemax" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最大值" />
  252. </el-form-item>
  253. </el-col>
  254. <el-col :span="10">
  255. <el-form-item label="宾州筛第二层(%):">
  256. <el-input-number v-model="table2.temp.bztwomin" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最小值" />
  257. <span style="width: 1%;">-</span>
  258. <el-input-number v-model="table2.temp.bztwomax" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最大值" />
  259. </el-form-item>
  260. </el-col>
  261. </el-row>
  262. <el-row>
  263. <el-col :span="10">
  264. <el-form-item label="宾州筛第三层(%):">
  265. <el-input-number v-model="table2.temp.bzthreemin" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最小值" />
  266. <span style="width: 1%;">-</span>
  267. <el-input-number v-model="table2.temp.bzthreemax" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最大值" />
  268. </el-form-item>
  269. </el-col>
  270. <el-col :span="10">
  271. <el-form-item label="宾州筛第四层(%):">
  272. <el-input-number v-model="table2.temp.bzfourmin" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最小值" />
  273. <span style="width: 1%;">-</span>
  274. <el-input-number v-model="table2.temp.bzfourmax" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最大值" />
  275. </el-form-item>
  276. </el-col>
  277. </el-row>
  278. <el-row>
  279. <el-col :span="10">
  280. <el-form-item label="数据来源:" prop="bzsource">
  281. <el-input v-model="table2.temp.bzsource" type="textarea" placeholder="1-255字符" :autosize="{ minRows: 1, maxRows: 4}" style="width:100%;" maxlength="255" />
  282. </el-form-item>
  283. </el-col>
  284. </el-row>
  285. <el-row>
  286. <el-col :span="10">
  287. <h3 style="width: 160px;float: left;">粪便筛</h3>
  288. </el-col>
  289. </el-row>
  290. <el-row>
  291. <el-col :span="10">
  292. <el-form-item label="粪便筛第一层(%):">
  293. <el-input-number v-model="table2.temp.fbonemin" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最小值" />
  294. <span style="width: 1%;">-</span>
  295. <el-input-number v-model="table2.temp.fbonemax" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最大值" />
  296. </el-form-item>
  297. </el-col>
  298. <el-col :span="10">
  299. <el-form-item label="粪便筛第二层(%):">
  300. <el-input-number v-model="table2.temp.fbtwomin" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最小值" />
  301. <span style="width: 1%;">-</span>
  302. <el-input-number v-model="table2.temp.fbtwomax" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最大值" />
  303. </el-form-item>
  304. </el-col>
  305. </el-row>
  306. <el-row>
  307. <el-col :span="10">
  308. <el-form-item label="粪便筛第三层(%):">
  309. <el-input-number v-model="table2.temp.fbthreemin" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最小值" />
  310. <span style="width: 1%;">-</span>
  311. <el-input-number v-model="table2.temp.fbthreemax" :min="0" :max="100" :controls="false" style="width:44%;" placeholder="最大值" />
  312. </el-form-item>
  313. </el-col>
  314. <el-col :span="10">
  315. <el-form-item label="数据来源:" prop="fbsource">
  316. <el-input v-model="table2.temp.fbsource" type="textarea" placeholder="1-255字符" :autosize="{ minRows: 1, maxRows: 4}" style="width:100%;" maxlength="255" />
  317. </el-form-item>
  318. </el-col>
  319. </el-row>
  320. </el-form>
  321. <div slot="footer" class="dialog-footer">
  322. <el-button class="cancel" @click="table2.dialogFormVisible = false; getList2()">关闭</el-button>
  323. <el-button class="success" :disabled="isokDisable" @click="updateData()">确认</el-button>
  324. </div>
  325. </div>
  326. </el-dialog>
  327. </div>
  328. </template>
  329. <script>
  330. import { GetDataByName, PostDataByName, failproccess, GetDataByNames, checkButtons } from '@/api/common'
  331. import Cookies from 'js-cookie'
  332. export default {
  333. name: 'StandardParameters',
  334. data() {
  335. return {
  336. isRoleEdit: [],
  337. activeName: 'first',
  338. requestParams: [
  339. { name: 'getDictByName', offset: 0, pagecount: 0, params: ['评分标准'] },
  340. { name: 'getDictByName2', offset: 0, pagecount: 0, params: ['粪便评分标准'] }
  341. ],
  342. physicalList: [], // 标准体况评分
  343. faecesList: [], // 标准粪便评分
  344. table1: {
  345. getdataListParm: {
  346. name: 'getOptscoreList',
  347. page: 1,
  348. offset: 1,
  349. pagecount: 10,
  350. returntype: 'Map',
  351. parammaps: {
  352. pastureid: Cookies.get('pastureid'),
  353. enable: ''
  354. }
  355. },
  356. tableKey: 0,
  357. list: [],
  358. total: 0,
  359. listLoading: true,
  360. // 编辑
  361. dialogFormVisible: false,
  362. dialogStatus: '',
  363. temp: {},
  364. rules: {
  365. bodystandard: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
  366. dungstandard: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
  367. }
  368. },
  369. table2: {
  370. getdataListParm: {
  371. name: 'getOptrangeList',
  372. page: 1,
  373. offset: 1,
  374. pagecount: 10,
  375. returntype: 'Map',
  376. parammaps: {
  377. pastureid: Cookies.get('pastureid')
  378. }
  379. },
  380. tableKey: 0,
  381. list: [],
  382. total: 0,
  383. listLoading: true,
  384. // 编辑
  385. dialogFormVisible: false,
  386. dialogStatus: '',
  387. temp: {},
  388. rules: {}
  389. },
  390. textMap: {
  391. update: '编辑'
  392. },
  393. requestParam: {},
  394. isokDisable: false,
  395. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  396. cellStyle: { padding: 0 + 'px' }
  397. }
  398. },
  399. created() {
  400. this.getList()
  401. this.getDownList()
  402. },
  403. methods: {
  404. getButtons() {
  405. const Edit = 'StandardParameters'
  406. const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
  407. this.isRoleEdit = isRoleEdit
  408. },
  409. getDownList() {
  410. GetDataByNames(this.requestParams).then(response => {
  411. this.physicalList = response.data.getDictByName.list
  412. this.faecesList = response.data.getDictByName2.list
  413. })
  414. },
  415. handleTabClick(tab, event) {
  416. console.log(tab, event)
  417. if (tab.name === 'first') {
  418. this.getList()
  419. } else if (tab.name === 'second') {
  420. this.getList2()
  421. }
  422. },
  423. getList() {
  424. this.table1.listLoading = true
  425. GetDataByName(this.table1.getdataListParm).then(response => {
  426. console.log('table1数据', response.data.list)
  427. if (response.data.list !== null) {
  428. this.table1.list = response.data.list
  429. this.table1.pageNum = response.data.pageNum
  430. this.table1.pageSize = response.data.pageSize
  431. this.table1.total = response.data.total
  432. } else {
  433. this.table1.list = []
  434. }
  435. setTimeout(() => {
  436. this.table1.listLoading = false
  437. }, 100)
  438. })
  439. },
  440. getList2() {
  441. this.table2.listLoading = true
  442. GetDataByName(this.table2.getdataListParm).then(response => {
  443. console.log('table1数据', response.data.list)
  444. if (response.data.list !== null) {
  445. this.table2.list = response.data.list
  446. this.table2.pageNum = response.data.pageNum
  447. this.table2.pageSize = response.data.pageSize
  448. if (response.data.total) {
  449. this.table2.total = response.data.total
  450. }
  451. } else {
  452. this.table2.list = []
  453. }
  454. setTimeout(() => {
  455. this.table2.listLoading = false
  456. }, 100)
  457. })
  458. },
  459. // 编辑
  460. handleUpdate(row) {
  461. if (this.activeName === 'first') {
  462. console.log('点击了体况、粪便评分标准编辑')
  463. this.table1.dialogStatus = 'update'
  464. this.table1.dialogFormVisible = true
  465. this.table1.temp = Object.assign({}, row)
  466. } else if (this.activeName === 'second') {
  467. console.log('点击了宾州筛、粪便筛标准范围编辑')
  468. this.table2.dialogStatus = 'update'
  469. this.table2.dialogFormVisible = true
  470. this.table2.temp = Object.assign({}, row)
  471. }
  472. },
  473. updateData() {
  474. if (this.activeName === 'first') {
  475. console.log('点击了体况、粪便评分标准编辑保存')
  476. this.isokDisable = true
  477. setTimeout(() => {
  478. this.isokDisable = false
  479. }, 1000)
  480. this.$refs['temp'].validate(valid => {
  481. if (valid) {
  482. this.requestParam.name = 'updateOptscore'
  483. this.requestParam.parammaps = this.table1.temp
  484. PostDataByName(this.requestParam).then(response => {
  485. console.log('新增保存发送参数', this.requestParam)
  486. if (response.msg !== 'fail') {
  487. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  488. this.table1.dialogFormVisible = false
  489. this.getList()
  490. } else {
  491. failproccess(response, this.$notify)
  492. }
  493. })
  494. }
  495. })
  496. } else if (this.activeName === 'second') {
  497. console.log('点击了宾州筛、粪便筛标准范围编辑保存')
  498. this.isokDisable = true
  499. setTimeout(() => {
  500. this.isokDisable = false
  501. }, 1000)
  502. // 若最小值大于最大值
  503. if (parseFloat(this.table2.temp.bzonemin) > parseFloat(this.table2.temp.bzonemax)) {
  504. this.$message({ type: 'error', message: '宾州筛第一层最大值不可小于等于最小值', duration: 2000 })
  505. return false
  506. }
  507. if (parseFloat(this.table2.temp.bztwomin) > parseFloat(this.table2.temp.bztwomax)) {
  508. this.$message({ type: 'error', message: '宾州筛第二层最大值不可小于等于最小值', duration: 2000 })
  509. return false
  510. }
  511. if (parseFloat(this.table2.temp.bzthreemin) > parseFloat(this.table2.temp.bzthreemax)) {
  512. this.$message({ type: 'error', message: '宾州筛第三层最大值不可小于等于最小值', duration: 2000 })
  513. return false
  514. }
  515. if (parseFloat(this.table2.temp.bzfourmin) > parseFloat(this.table2.temp.bzfourmax)) {
  516. this.$message({ type: 'error', message: '宾州筛第四层最大值不可小于等于最小值', duration: 2000 })
  517. return false
  518. }
  519. if (parseFloat(this.table2.temp.fbonemin) > parseFloat(this.table2.temp.fbonemax)) {
  520. this.$message({ type: 'error', message: '粪便筛第一层最大值不可小于等于最小值', duration: 2000 })
  521. return false
  522. }
  523. if (parseFloat(this.table2.temp.fbtwomin) > parseFloat(this.table2.temp.fbtwomax)) {
  524. this.$message({ type: 'error', message: '粪便筛第二层最大值不可小于等于最小值', duration: 2000 })
  525. return false
  526. }
  527. if (parseFloat(this.table2.temp.fbthreemin) > parseFloat(this.table2.temp.fbthreemax)) {
  528. this.$message({ type: 'error', message: '粪便筛第三层最大值不可小于等于最小值', duration: 2000 })
  529. return false
  530. }
  531. // 若最大值最小值为空
  532. if (this.table2.temp.bzonemin == '' || this.table2.temp.bzonemin == undefined) { this.table2.temp.bzonemin = '0' }
  533. if (this.table2.temp.bzonemax == '' || this.table2.temp.bzonemax == undefined) { this.table2.temp.bzonemax = '0' }
  534. if (this.table2.temp.bztwomin == '' || this.table2.temp.bztwomin == undefined) { this.table2.temp.bztwomin = '0' }
  535. if (this.table2.temp.bztwomax == '' || this.table2.temp.bztwomax == undefined) { this.table2.temp.bztwomax = '0' }
  536. if (this.table2.temp.bzthreemin == '' || this.table2.temp.bzthreemin == undefined) { this.table2.temp.bzthreemin = '0' }
  537. if (this.table2.temp.bzthreemax == '' || this.table2.temp.bzthreemax == undefined) { this.table2.temp.bzthreemax = '0' }
  538. if (this.table2.temp.bzfourmin == '' || this.table2.temp.bzfourmin == undefined) { this.table2.temp.bzfourmin = '0' }
  539. if (this.table2.temp.bzfourmax == '' || this.table2.temp.bzfourmax == undefined) { this.table2.temp.bzfourmax = '0' }
  540. if (this.table2.temp.fbonemin == '' || this.table2.temp.fbonemin == undefined) { this.table2.temp.fbonemin = '0' }
  541. if (this.table2.temp.fbonemax == '' || this.table2.temp.fbonemax == undefined) { this.table2.temp.fbonemax = '0' }
  542. if (this.table2.temp.fbtwomin == '' || this.table2.temp.fbtwomin == undefined) { this.table2.temp.fbtwomin = '0' }
  543. if (this.table2.temp.fbtwomax == '' || this.table2.temp.fbtwomax == undefined) { this.table2.temp.fbtwomax = '0' }
  544. if (this.table2.temp.fbthreemin == '' || this.table2.temp.fbthreemin == undefined) { this.table2.temp.fbthreemin = '0' }
  545. if (this.table2.temp.fbthreemax == '' || this.table2.temp.fbthreemax == undefined) { this.table2.temp.fbthreemax = '0' }
  546. var positiveInteger = /^([0-9]{1,2}|100)$/
  547. if (!positiveInteger.test(parseFloat(this.table2.temp.bzonemin))) {
  548. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  549. return false
  550. }
  551. if (!positiveInteger.test(parseFloat(this.table2.temp.bzonemax))) {
  552. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  553. return false
  554. }
  555. if (!positiveInteger.test(parseFloat(this.table2.temp.bztwomin))) {
  556. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  557. return false
  558. }
  559. if (!positiveInteger.test(parseFloat(this.table2.temp.bztwomax))) {
  560. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  561. return false
  562. }
  563. if (!positiveInteger.test(parseFloat(this.table2.temp.bzthreemin))) {
  564. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  565. return false
  566. }
  567. if (!positiveInteger.test(parseFloat(this.table2.temp.bzthreemax))) {
  568. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  569. return false
  570. }
  571. if (!positiveInteger.test(parseFloat(this.table2.temp.bzfourmin))) {
  572. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  573. return false
  574. }
  575. if (!positiveInteger.test(parseFloat(this.table2.temp.bzfourmax))) {
  576. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  577. return false
  578. }
  579. if (!positiveInteger.test(parseFloat(this.table2.temp.fbonemin))) {
  580. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  581. return false
  582. }
  583. if (!positiveInteger.test(parseFloat(this.table2.temp.fbonemax))) {
  584. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  585. return false
  586. }
  587. if (!positiveInteger.test(parseFloat(this.table2.temp.fbtwomin))) {
  588. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  589. return false
  590. }
  591. if (!positiveInteger.test(parseFloat(this.table2.temp.fbtwomax))) {
  592. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  593. return false
  594. }
  595. if (!positiveInteger.test(parseFloat(this.table2.temp.fbthreemin))) {
  596. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  597. return false
  598. }
  599. if (!positiveInteger.test(parseFloat(this.table2.temp.fbthreemin))) {
  600. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  601. return false
  602. }
  603. this.requestParam.name = 'insertOptrange'
  604. this.requestParam.parammaps = this.table2.temp
  605. this.$refs['temp'].validate(valid => {
  606. if (valid) {
  607. PostDataByName(this.requestParam).then(response => {
  608. console.log('新增保存发送参数', this.requestParam)
  609. if (response.msg !== 'fail') {
  610. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  611. this.table2.dialogFormVisible = false
  612. this.getList2()
  613. this.activeName = 'second'
  614. } else {
  615. failproccess(response, this.$notify)
  616. if (this.table2.temp.bzonemin == '0') { this.table2.temp.bzonemin = '' }
  617. if (this.table2.temp.bzonemax == '0') { this.table2.temp.bzonemax = '' }
  618. if (this.table2.temp.bztwomin == '0') { this.table2.temp.bztwomin = '' }
  619. if (this.table2.temp.bztwomax == '0') { this.table2.temp.bztwomax = '' }
  620. if (this.table2.temp.bzthreemin == '0') { this.table2.temp.bzthreemin = '' }
  621. if (this.table2.temp.bzthreemax == '0') { this.table2.temp.bzthreemax = '' }
  622. if (this.table2.temp.bzfourmin == '0') { this.table2.temp.bzfourmin = '' }
  623. if (this.table2.temp.bzfourmax == '0') { this.table2.temp.bzfourmax = '' }
  624. if (this.table2.temp.fbonemin == '0') { this.table2.temp.fbonemin = '' }
  625. if (this.table2.temp.fbonemax == '0') { this.table2.temp.fbonemax = '' }
  626. if (this.table2.temp.fbtwomin == '0') { this.table2.temp.fbtwomin = '' }
  627. if (this.table2.temp.fbtwomax == '0') { this.table2.temp.fbtwomax = '' }
  628. if (this.table2.temp.fbthreemin == '0') { this.table2.temp.fbthreemin = '' }
  629. if (this.table2.temp.fbthreemax == '0') { this.table2.temp.fbthreemax = '' }
  630. }
  631. })
  632. }
  633. })
  634. }
  635. },
  636. // 导出
  637. handleExport() {
  638. if (this.activeName === 'first') {
  639. console.log('体况、粪便评分标准/导出')
  640. } else if (this.activeName === 'second') {
  641. console.log('宾州筛、粪便筛标准范围/导出')
  642. }
  643. },
  644. // 导入
  645. handleImport() {
  646. if (this.activeName === 'first') {
  647. console.log('体况、粪便评分标准/导入')
  648. } else if (this.activeName === 'second') {
  649. console.log('宾州筛、粪便筛标准范围/导入')
  650. }
  651. }
  652. }
  653. }
  654. </script>
  655. <style lang="scss" scoped>
  656. .operation{
  657. position: relative;
  658. height: 50px;
  659. .export{position: absolute;right: 110px;bottom: 10px;}
  660. .import{position: absolute;right: 0;bottom: 10px;}
  661. }
  662. </style>