a9187edca79fbb02a3c50ac43f2077475287f62d.svn-base 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  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 v-if="isRoleEdit" 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 v-if="isRoleEdit" 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="cancelClose" @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="cancelClose" @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. this.getButtons()
  393. },
  394. methods: {
  395. getButtons() {
  396. const Edit = 'StandardParameters'
  397. const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
  398. this.isRoleEdit = isRoleEdit
  399. },
  400. getDownList() {
  401. GetDataByNames(this.requestParams).then(response => {
  402. this.physicalList = response.data.getDictByName.list
  403. this.faecesList = response.data.getDictByName2.list
  404. })
  405. },
  406. handleTabClick(tab, event) {
  407. console.log(tab, event)
  408. if (tab.name === 'first') {
  409. this.getList()
  410. } else if (tab.name === 'second') {
  411. this.getList2()
  412. }
  413. },
  414. getList() {
  415. this.table1.listLoading = true
  416. GetDataByName(this.table1.getdataListParm).then(response => {
  417. console.log('table1数据', response.data.list)
  418. if (response.data.list !== null) {
  419. this.table1.list = response.data.list
  420. this.table1.total = response.data.total
  421. } else {
  422. this.table1.list = []
  423. }
  424. setTimeout(() => {
  425. this.table1.listLoading = false
  426. }, 100)
  427. })
  428. },
  429. getList2() {
  430. this.table2.listLoading = true
  431. GetDataByName(this.table2.getdataListParm).then(response => {
  432. console.log('table1数据', response.data.list)
  433. if (response.data.list !== null) {
  434. this.table2.list = response.data.list
  435. if (response.data.total) {
  436. this.table2.total = response.data.total
  437. }
  438. } else {
  439. this.table2.list = []
  440. }
  441. setTimeout(() => {
  442. this.table2.listLoading = false
  443. }, 100)
  444. })
  445. },
  446. // 编辑
  447. handleUpdate(row) {
  448. if (this.activeName === 'first') {
  449. console.log('点击了体况、粪便评分标准编辑')
  450. this.table1.dialogStatus = 'update'
  451. this.table1.dialogFormVisible = true
  452. this.table1.temp = Object.assign({}, row)
  453. } else if (this.activeName === 'second') {
  454. console.log('点击了宾州筛、粪便筛标准范围编辑')
  455. this.table2.dialogStatus = 'update'
  456. this.table2.dialogFormVisible = true
  457. this.table2.temp = Object.assign({}, row)
  458. }
  459. },
  460. updateData() {
  461. if (this.activeName === 'first') {
  462. console.log('点击了体况、粪便评分标准编辑保存')
  463. this.isokDisable = true
  464. setTimeout(() => {
  465. this.isokDisable = false
  466. }, 1000)
  467. this.$refs['temp'].validate(valid => {
  468. if (valid) {
  469. this.requestParam.name = 'updateOptscore'
  470. this.requestParam.parammaps = this.table1.temp
  471. PostDataByName(this.requestParam).then(response => {
  472. console.log('新增保存发送参数', this.requestParam)
  473. if (response.msg !== 'fail') {
  474. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  475. this.table1.dialogFormVisible = false
  476. this.getList()
  477. } else {
  478. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  479. }
  480. })
  481. }
  482. })
  483. } else if (this.activeName === 'second') {
  484. console.log('点击了宾州筛、粪便筛标准范围编辑保存')
  485. this.isokDisable = true
  486. setTimeout(() => {
  487. this.isokDisable = false
  488. }, 1000)
  489. // 若最小值大于最大值
  490. if (parseFloat(this.table2.temp.bzonemin) > parseFloat(this.table2.temp.bzonemax)) {
  491. this.$message({ type: 'error', message: '宾州筛第一层最大值不可小于等于最小值', duration: 2000 })
  492. return false
  493. }
  494. if (parseFloat(this.table2.temp.bztwomin) > parseFloat(this.table2.temp.bztwomax)) {
  495. this.$message({ type: 'error', message: '宾州筛第二层最大值不可小于等于最小值', duration: 2000 })
  496. return false
  497. }
  498. if (parseFloat(this.table2.temp.bzthreemin) > parseFloat(this.table2.temp.bzthreemax)) {
  499. this.$message({ type: 'error', message: '宾州筛第三层最大值不可小于等于最小值', duration: 2000 })
  500. return false
  501. }
  502. if (parseFloat(this.table2.temp.bzfourmin) > parseFloat(this.table2.temp.bzfourmax)) {
  503. this.$message({ type: 'error', message: '宾州筛第四层最大值不可小于等于最小值', duration: 2000 })
  504. return false
  505. }
  506. if (parseFloat(this.table2.temp.fbonemin) > parseFloat(this.table2.temp.fbonemax)) {
  507. this.$message({ type: 'error', message: '粪便筛第一层最大值不可小于等于最小值', duration: 2000 })
  508. return false
  509. }
  510. if (parseFloat(this.table2.temp.fbtwomin) > parseFloat(this.table2.temp.fbtwomax)) {
  511. this.$message({ type: 'error', message: '粪便筛第二层最大值不可小于等于最小值', duration: 2000 })
  512. return false
  513. }
  514. if (parseFloat(this.table2.temp.fbthreemin) > parseFloat(this.table2.temp.fbthreemax)) {
  515. this.$message({ type: 'error', message: '粪便筛第三层最大值不可小于等于最小值', duration: 2000 })
  516. return false
  517. }
  518. // 若最大值最小值为空
  519. if (this.table2.temp.bzonemin == '' || this.table2.temp.bzonemin == undefined) { this.table2.temp.bzonemin = '0' }
  520. if (this.table2.temp.bzonemax == '' || this.table2.temp.bzonemax == undefined) { this.table2.temp.bzonemax = '0' }
  521. if (this.table2.temp.bztwomin == '' || this.table2.temp.bztwomin == undefined) { this.table2.temp.bztwomin = '0' }
  522. if (this.table2.temp.bztwomax == '' || this.table2.temp.bztwomax == undefined) { this.table2.temp.bztwomax = '0' }
  523. if (this.table2.temp.bzthreemin == '' || this.table2.temp.bzthreemin == undefined) { this.table2.temp.bzthreemin = '0' }
  524. if (this.table2.temp.bzthreemax == '' || this.table2.temp.bzthreemax == undefined) { this.table2.temp.bzthreemax = '0' }
  525. if (this.table2.temp.bzfourmin == '' || this.table2.temp.bzfourmin == undefined) { this.table2.temp.bzfourmin = '0' }
  526. if (this.table2.temp.bzfourmax == '' || this.table2.temp.bzfourmax == undefined) { this.table2.temp.bzfourmax = '0' }
  527. if (this.table2.temp.fbonemin == '' || this.table2.temp.fbonemin == undefined) { this.table2.temp.fbonemin = '0' }
  528. if (this.table2.temp.fbonemax == '' || this.table2.temp.fbonemax == undefined) { this.table2.temp.fbonemax = '0' }
  529. if (this.table2.temp.fbtwomin == '' || this.table2.temp.fbtwomin == undefined) { this.table2.temp.fbtwomin = '0' }
  530. if (this.table2.temp.fbtwomax == '' || this.table2.temp.fbtwomax == undefined) { this.table2.temp.fbtwomax = '0' }
  531. if (this.table2.temp.fbthreemin == '' || this.table2.temp.fbthreemin == undefined) { this.table2.temp.fbthreemin = '0' }
  532. if (this.table2.temp.fbthreemax == '' || this.table2.temp.fbthreemax == undefined) { this.table2.temp.fbthreemax = '0' }
  533. var positiveInteger = /^([0-9]{1,2}|100)$/
  534. if (!positiveInteger.test(parseFloat(this.table2.temp.bzonemin))) {
  535. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  536. return false
  537. }
  538. if (!positiveInteger.test(parseFloat(this.table2.temp.bzonemax))) {
  539. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  540. return false
  541. }
  542. if (!positiveInteger.test(parseFloat(this.table2.temp.bztwomin))) {
  543. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  544. return false
  545. }
  546. if (!positiveInteger.test(parseFloat(this.table2.temp.bztwomax))) {
  547. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  548. return false
  549. }
  550. if (!positiveInteger.test(parseFloat(this.table2.temp.bzthreemin))) {
  551. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  552. return false
  553. }
  554. if (!positiveInteger.test(parseFloat(this.table2.temp.bzthreemax))) {
  555. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  556. return false
  557. }
  558. if (!positiveInteger.test(parseFloat(this.table2.temp.bzfourmin))) {
  559. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  560. return false
  561. }
  562. if (!positiveInteger.test(parseFloat(this.table2.temp.bzfourmax))) {
  563. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  564. return false
  565. }
  566. if (!positiveInteger.test(parseFloat(this.table2.temp.fbonemin))) {
  567. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  568. return false
  569. }
  570. if (!positiveInteger.test(parseFloat(this.table2.temp.fbonemax))) {
  571. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  572. return false
  573. }
  574. if (!positiveInteger.test(parseFloat(this.table2.temp.fbtwomin))) {
  575. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  576. return false
  577. }
  578. if (!positiveInteger.test(parseFloat(this.table2.temp.fbtwomax))) {
  579. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  580. return false
  581. }
  582. if (!positiveInteger.test(parseFloat(this.table2.temp.fbthreemin))) {
  583. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  584. return false
  585. }
  586. if (!positiveInteger.test(parseFloat(this.table2.temp.fbthreemin))) {
  587. this.$message({ type: 'error', message: '范围不可输入小数', duration: 2000 })
  588. return false
  589. }
  590. this.requestParam.name = 'insertOptrange'
  591. this.requestParam.parammaps = this.table2.temp
  592. this.$refs['temp'].validate(valid => {
  593. if (valid) {
  594. PostDataByName(this.requestParam).then(response => {
  595. console.log('新增保存发送参数', this.requestParam)
  596. if (response.msg !== 'fail') {
  597. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  598. this.table2.dialogFormVisible = false
  599. this.getList2()
  600. this.activeName = 'second'
  601. } else {
  602. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  603. if (this.table2.temp.bzonemin == '0') { this.table2.temp.bzonemin = '' }
  604. if (this.table2.temp.bzonemax == '0') { this.table2.temp.bzonemax = '' }
  605. if (this.table2.temp.bztwomin == '0') { this.table2.temp.bztwomin = '' }
  606. if (this.table2.temp.bztwomax == '0') { this.table2.temp.bztwomax = '' }
  607. if (this.table2.temp.bzthreemin == '0') { this.table2.temp.bzthreemin = '' }
  608. if (this.table2.temp.bzthreemax == '0') { this.table2.temp.bzthreemax = '' }
  609. if (this.table2.temp.bzfourmin == '0') { this.table2.temp.bzfourmin = '' }
  610. if (this.table2.temp.bzfourmax == '0') { this.table2.temp.bzfourmax = '' }
  611. if (this.table2.temp.fbonemin == '0') { this.table2.temp.fbonemin = '' }
  612. if (this.table2.temp.fbonemax == '0') { this.table2.temp.fbonemax = '' }
  613. if (this.table2.temp.fbtwomin == '0') { this.table2.temp.fbtwomin = '' }
  614. if (this.table2.temp.fbtwomax == '0') { this.table2.temp.fbtwomax = '' }
  615. if (this.table2.temp.fbthreemin == '0') { this.table2.temp.fbthreemin = '' }
  616. if (this.table2.temp.fbthreemax == '0') { this.table2.temp.fbthreemax = '' }
  617. }
  618. })
  619. }
  620. })
  621. }
  622. },
  623. // 导出
  624. handleExport() {
  625. if (this.activeName === 'first') {
  626. console.log('体况、粪便评分标准/导出')
  627. } else if (this.activeName === 'second') {
  628. console.log('宾州筛、粪便筛标准范围/导出')
  629. }
  630. },
  631. // 导入
  632. handleImport() {
  633. if (this.activeName === 'first') {
  634. console.log('体况、粪便评分标准/导入')
  635. } else if (this.activeName === 'second') {
  636. console.log('宾州筛、粪便筛标准范围/导入')
  637. }
  638. }
  639. }
  640. }
  641. </script>
  642. <style lang="scss" scoped>
  643. .operation{
  644. position: relative;
  645. height: 50px;
  646. .export{position: absolute;right: 110px;bottom: 10px;}
  647. .import{position: absolute;right: 0;bottom: 10px;}
  648. }
  649. </style>