9d8cb21ec8d6a0a65e31103d3d3a35ab3781495f.svn-base 31 KB

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