6d4d175ef2e9064b04c3931a69051aebd0c18957.svn-base 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. <template>
  2. <div class="app-container">
  3. <div class="operation">
  4. <el-button v-if="isRoleEdit" class="success" style="float: left;margin-right:10px;" @click="handleCreate">新增</el-button>
  5. <el-button v-if="isRoleEdit" class="danger" style="float: left;margin-right:10px;" @click="handleDelete">删除</el-button>
  6. <el-button v-if="isRoleEdit" class="warning" style="float: left;margin-right:10px;" @click="handleCopy">复制</el-button>
  7. <el-button v-if="isRoleEdit" class="import" style="float: right;" @click="handleImport">导入</el-button>
  8. <el-button class="export" style="float: right;margin-right: 10px;" @click="handleExport">导出</el-button>
  9. </div>
  10. <div class="search">
  11. <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
  12. <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
  13. <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
  14. <el-select v-model="table.getdataListParm.parammaps.barid" placeholder="栏舍名称" class="filter-item" style="width: 120px;" clearable>
  15. <el-option v-for="item in houseNameList" :key="item.id" :label="item.bname" :value="item.id" />
  16. </el-select>
  17. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  18. <el-button class="successBorder" @click="handleRefresh">重置</el-button>
  19. </div>
  20. <div class="table">
  21. <el-table
  22. :key="table.tableKey"
  23. v-loading="table.listLoading"
  24. element-loading-text="给我一点时间"
  25. :data="table.list"
  26. border
  27. fit
  28. highlight-current-row
  29. style="width: 100%;"
  30. :row-style="rowStyle"
  31. :cell-style="cellStyle"
  32. class="elTable table-fixed"
  33. @selection-change="handleSelectionChange"
  34. >
  35. <el-table-column type="selection" align="center" width="50" />
  36. <el-table-column label="序号" align="center" type="index" width="50px">
  37. <template slot-scope="scope">
  38. <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
  39. </template>
  40. </el-table-column>
  41. <el-table-column label="栏舍名称" min-width="150px" align="center">
  42. <template slot-scope="scope">
  43. <span>{{ scope.row.barname }}</span>
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="剩料量(kg)" min-width="150px" align="center">
  47. <template slot-scope="scope">
  48. <span>{{ scope.row.remain }}</span>
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="应用班次" min-width="90px" align="center">
  52. <template slot-scope="scope">
  53. <span>{{ scope.row.timesstr }}</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="处理时间" min-width="100px" align="center">
  57. <template slot-scope="scope">
  58. <span>{{ scope.row.operatetime }}</span>
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="操作人" min-width="90px" align="center">
  62. <template slot-scope="scope">
  63. <span>{{ scope.row.emp }}</span>
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
  67. <template slot-scope="{row}">
  68. <el-button v-if="isRoleEdit" class="miniSuccess" @click="handleUpdate(row)">编辑</el-button>
  69. <el-button v-if="isRoleEdit" class="miniDanger" @click="handleRowDelete(row)">删除</el-button>
  70. </template>
  71. </el-table-column>
  72. </el-table>
  73. <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
  74. </div>
  75. <!-- 新增/编辑 -->
  76. <el-dialog :title="textMap[create.dialogStatus]" :visible.sync="create.dialogFormVisible" :close-on-click-modal="false" width="40%">
  77. <div class="app-add">
  78. <el-form ref="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="135px" style="width: 90%;margin:0 auto 50px">
  79. <el-row>
  80. <el-col :span="20">
  81. <el-form-item label="栏舍名称:" prop="barid">
  82. <el-select ref="barid" v-model="create.temp.barid" :disabled="create.dialogStatus=='update'" filterable placeholder="栏舍名称" class="filter-item" style="width: 100%;" @change="changeBar">
  83. <el-option v-for="item in houseNameList" :key="item.id" :label="item.bname" :value="item.id" />
  84. </el-select>
  85. </el-form-item>
  86. </el-col>
  87. </el-row>
  88. <el-row>
  89. <el-col :span="20">
  90. <el-form-item label="剩料量:" prop="remain">
  91. <el-input ref="remain" v-model="create.temp.remain" class="filter-item" placeholder="剩料量" type="number" />
  92. </el-form-item>
  93. </el-col>
  94. </el-row>
  95. <el-row>
  96. <el-col :span="20">
  97. <el-form-item label="班次:" prop="times">
  98. <el-select ref="times" v-model="create.temp.times" filterable placeholder="班次" class="filter-item" style="width: 100%;">
  99. <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
  100. </el-select>
  101. </el-form-item>
  102. </el-col>
  103. </el-row>
  104. <el-row>
  105. <el-col :span="20">
  106. <el-form-item label="处理时间:" prop="operatetime">
  107. <el-date-picker v-model="create.temp.operatetime" :disabled="create.dialogStatus=='update'" type="datetime" placeholder="选择处理时间" format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm" style="width: 100%;" :clearable="false" />
  108. </el-form-item>
  109. </el-col>
  110. </el-row>
  111. <el-row>
  112. <el-col :span="20">
  113. <el-form-item label="操作人:" prop="emp">
  114. <el-select ref="emp" v-model="create.temp.emp" filterable placeholder="操作人" class="filter-item" style="width: 100%;" @blur="blurEmp">
  115. <el-option v-for="item in create.noteTakerList" :key="item.myId" :label="item.emp" :value="item.emp" />
  116. </el-select>
  117. </el-form-item>
  118. </el-col>
  119. </el-row>
  120. </el-form>
  121. <div slot="footer" class="dialog-footer">
  122. <el-button class="cancel" @click="create.dialogFormVisible = false;getList()">关闭</el-button>
  123. <el-button v-if="create.dialogStatus==='create'" class="success" :disabled="isokDisable" @click="createDataAgain()">确认新增</el-button>
  124. <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="success" :disabled="isokDisable" @click="create.dialogStatus==='create'?createData():updateData()">确认</el-button>
  125. </div>
  126. </div>
  127. </el-dialog>
  128. </div>
  129. </template>
  130. <script>
  131. import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons } from '@/api/common'
  132. import Cookies from 'js-cookie'
  133. import { parseTime } from '@/utils/index.js'
  134. import Pagination from '@/components/Pagination'
  135. import { MessageBox } from 'element-ui'
  136. export default {
  137. name: 'MaterialRemainingRecord',
  138. components: { Pagination },
  139. data() {
  140. return {
  141. isRoleEdit: [],
  142. requestParams: [
  143. { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }},
  144. { name: 'getSysoptEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid'), 'inforname': 'times' }}
  145. ],
  146. houseNameList: [], // 栏舍名称
  147. frequencyList: [], // 班次
  148. table: {
  149. getdataListParm: {
  150. name: 'getBarfeedremainList',
  151. page: 1,
  152. offset: 1,
  153. pagecount: 10,
  154. returntype: 'Map',
  155. parammaps: {
  156. pastureid: Cookies.get('pastureid'),
  157. barid: '',
  158. startTime: '',
  159. stopTime: '',
  160. inputDatetime: ''
  161. }
  162. },
  163. tableKey: 0,
  164. list: [],
  165. total: 0,
  166. listLoading: true,
  167. temp: {}
  168. },
  169. // 新增/编辑
  170. create: {
  171. dialogFormVisible: false,
  172. dialogStatus: '',
  173. temp: { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}'), emp: Cookies.get('employename'), barid: '', barname: '', remain: '', times: '' },
  174. rules: {
  175. barid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
  176. remain: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
  177. times: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
  178. },
  179. getdataListParm: {
  180. name: 'getBarfeedremainEmpHis',
  181. page: 1,
  182. offset: 1,
  183. pagecount: 10,
  184. returntype: 'Map',
  185. parammaps: {
  186. pastureid: Cookies.get('pastureid')
  187. }
  188. },
  189. noteTakerList: [] // 记录人
  190. },
  191. textMap: {
  192. create: '新增',
  193. update: '编辑'
  194. },
  195. requestParam: {},
  196. isokDisable: false,
  197. selectList: [],
  198. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  199. cellStyle: { padding: 0 + 'px' }
  200. }
  201. },
  202. created() {
  203. this.getList()
  204. this.getDownList()
  205. this.getButtons()
  206. },
  207. methods: {
  208. getButtons() {
  209. const Edit = 'MaterialRemainingRecord'
  210. const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
  211. this.isRoleEdit = isRoleEdit
  212. },
  213. getDownList() {
  214. GetDataByNames(this.requestParams).then(response => {
  215. this.houseNameList = response.data.getBarListEnable.list
  216. if (response.data.getSysoptEnable.list !== null) {
  217. for (let i = 1; i <= response.data.getSysoptEnable.list[0].inforvalue; i++) {
  218. const obj = {}
  219. obj.id = String(i)
  220. if (i == 1) { obj.name = '第一班' } else if (i == 2) { obj.name = '第二班' } else if (i == 3) { obj.name = '第三班' } else if (i == 4) { obj.name = '第四班' }
  221. this.frequencyList.push(obj)
  222. }
  223. } else {
  224. this.frequencyList = []
  225. }
  226. })
  227. },
  228. handleBefore() {
  229. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  230. var start = this.table.getdataListParm.parammaps.inputDatetime[0] - 3600 * 1000 * 24
  231. var stop = this.table.getdataListParm.parammaps.inputDatetime[1] - 3600 * 1000 * 24
  232. this.table.getdataListParm.parammaps.inputDatetime.length = 0
  233. this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
  234. this.$forceUpdate()
  235. }
  236. },
  237. handleNext() {
  238. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  239. var start = this.table.getdataListParm.parammaps.inputDatetime[0] + 3600 * 1000 * 24
  240. var stop = this.table.getdataListParm.parammaps.inputDatetime[1] + 3600 * 1000 * 24
  241. this.table.getdataListParm.parammaps.inputDatetime.length = 0
  242. this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
  243. this.$forceUpdate()
  244. }
  245. },
  246. getList() {
  247. this.table.listLoading = true
  248. GetDataByName(this.table.getdataListParm).then(response => {
  249. console.log('table数据', response.data.list)
  250. if (response.data.list !== null) {
  251. this.table.list = response.data.list
  252. this.table.pageNum = response.data.pageNum
  253. this.table.pageSize = response.data.pageSize
  254. this.table.total = response.data.total
  255. } else {
  256. this.table.list = []
  257. }
  258. setTimeout(() => {
  259. this.table.listLoading = false
  260. }, 100)
  261. })
  262. },
  263. handleSearch() {
  264. console.log('点击了查询')
  265. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  266. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  267. this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  268. } else {
  269. this.table.getdataListParm.parammaps.inputDatetime = ''
  270. this.table.getdataListParm.parammaps.startTime = ''
  271. this.table.getdataListParm.parammaps.stopTime = ''
  272. }
  273. this.table.getdataListParm.offset = 1
  274. this.getList()
  275. },
  276. handleRefresh() {
  277. console.log('点击了重置')
  278. this.table.getdataListParm.parammaps.barid = ''
  279. this.table.getdataListParm.parammaps.startTime = ''
  280. this.table.getdataListParm.parammaps.stopTime = ''
  281. this.table.getdataListParm.parammaps.inputDatetime = ''
  282. this.table.getdataListParm.offset = 1
  283. this.getList()
  284. },
  285. // 新增
  286. resetTemp() {
  287. this.create.temp = { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}'), emp: Cookies.get('employename'), barid: '', barname: '', remain: '', times: '' }
  288. },
  289. blurEmp(item) {
  290. this.create.temp.emp = item.target.value
  291. },
  292. // 栏舍名称
  293. changeBar(item) {
  294. this.create.temp.barname = this.houseNameList.find(obj => obj.id === item).bname
  295. },
  296. getNoteTakerList() {
  297. GetDataByName(this.create.getdataListParm).then(response => {
  298. if (response.data.list !== null) {
  299. for (let i = 0; i < response.data.list.length; i++) {
  300. response.data.list[i].myId = i
  301. }
  302. this.create.noteTakerList = response.data.list
  303. console.log('记录人数据', response.data.list)
  304. console.log(this.create.noteTakerList)
  305. } else {
  306. this.create.noteTakerList = []
  307. }
  308. })
  309. },
  310. handleCreate() {
  311. console.log('点击了新增')
  312. this.resetTemp()
  313. this.getNoteTakerList()
  314. this.create.dialogStatus = 'create'
  315. this.create.dialogFormVisible = true
  316. },
  317. createData() {
  318. console.log('点击了新增保存')
  319. this.isokDisable = true
  320. setTimeout(() => {
  321. this.isokDisable = false
  322. }, 1000)
  323. this.$refs['temp'].validate(valid => {
  324. if (valid) {
  325. this.isokDisable = true
  326. setTimeout(() => {
  327. this.isokDisable = false
  328. }, 1000)
  329. const remain = /^\d+(\.\d{1,2})?$/
  330. // 剩料量
  331. if (!remain.test(parseFloat(this.create.temp.remain))) {
  332. this.$message({ type: 'error', message: '剩料量请输入自然数并保留两位小数', duration: 2000 })
  333. return false
  334. }
  335. this.requestParam.name = 'insertBarfeedremain'
  336. this.requestParam.parammaps = this.create.temp
  337. if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
  338. PostDataByName(this.requestParam).then(response => {
  339. console.log('新增保存发送参数', this.requestParam)
  340. if (response.msg !== 'fail') {
  341. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  342. this.create.dialogFormVisible = false
  343. this.getList()
  344. } else {
  345. const barid = new RegExp("key 'barid'")
  346. if (barid.test(response.data)) {
  347. this.$message({ type: 'error', message: '该栏舍该班次今日剩料量已存在,不可重复生成', duration: 2000 })
  348. } else {
  349. failproccess(response, this.$notify)
  350. }
  351. }
  352. })
  353. }
  354. })
  355. },
  356. createDataAgain() {
  357. console.log('点击了新增保存')
  358. this.isokDisable = true
  359. setTimeout(() => {
  360. this.isokDisable = false
  361. }, 1000)
  362. this.$refs['temp'].validate(valid => {
  363. if (valid) {
  364. this.isokDisable = true
  365. setTimeout(() => {
  366. this.isokDisable = false
  367. }, 1000)
  368. const remain = /^\d+(\.\d{1,2})?$/
  369. // 剩料量
  370. if (!remain.test(parseFloat(this.create.temp.remain))) {
  371. this.$message({ type: 'error', message: '剩料量请输入自然数并保留两位小数', duration: 2000 })
  372. return false
  373. }
  374. this.requestParam.name = 'insertBarfeedremain'
  375. this.requestParam.parammaps = this.create.temp
  376. if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
  377. PostDataByName(this.requestParam).then(response => {
  378. console.log('新增保存发送参数', this.requestParam)
  379. if (response.msg !== 'fail') {
  380. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  381. this.resetTemp()
  382. this.getList()
  383. this.getNoteTakerList()
  384. } else {
  385. const barid = new RegExp("key 'barid'")
  386. if (barid.test(response.data)) {
  387. this.$message({ type: 'error', message: '该栏舍该班次今日剩料量已存在,不可重复生成', duration: 2000 })
  388. } else {
  389. failproccess(response, this.$notify)
  390. }
  391. }
  392. })
  393. }
  394. })
  395. },
  396. // 编辑
  397. handleUpdate(row) {
  398. console.log('点击了编辑', row)
  399. row.barid = String(row.barid)
  400. this.create.temp = Object.assign({}, row)
  401. this.create.temp.id = row.id
  402. this.getNoteTakerList()
  403. this.create.dialogStatus = 'update'
  404. this.create.dialogFormVisible = true
  405. },
  406. updateData() {
  407. this.isokDisable = true
  408. setTimeout(() => {
  409. this.isokDisable = false
  410. }, 1000)
  411. this.$refs['temp'].validate(valid => {
  412. if (valid) {
  413. this.isokDisable = true
  414. setTimeout(() => {
  415. this.isokDisable = false
  416. }, 1000)
  417. const remain = /^\d+(\.\d{1,2})?$/
  418. // 剩料量
  419. if (!remain.test(parseFloat(this.create.temp.remain))) {
  420. this.$message({ type: 'error', message: '剩料量请输入自然数并保留两位小数', duration: 2000 })
  421. return false
  422. }
  423. this.requestParam.name = 'updateBarfeedremain'
  424. this.requestParam.parammaps = this.create.temp
  425. if (this.create.temp.emp == '') { this.create.temp.emp = Cookies.get('employename') }
  426. PostDataByName(this.requestParam).then(response => {
  427. console.log('新增保存发送参数', this.requestParam)
  428. if (response.msg !== 'fail') {
  429. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  430. this.create.dialogFormVisible = false
  431. this.getList()
  432. } else {
  433. failproccess(response, this.$notify)
  434. }
  435. })
  436. }
  437. })
  438. },
  439. // 删除
  440. handleRowDelete(row) {
  441. console.log('点击了行内删除')
  442. MessageBox.confirm('是否确认删除此信息?', {
  443. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  444. }).then(() => {
  445. this.selectList = []
  446. this.requestParam.name = 'deleteBarfeedremain'
  447. this.requestParam.parammaps = {}
  448. this.requestParam.parammaps.pastureid = row.pastureid
  449. this.requestParam.parammaps.id = row.id
  450. PostDataByName(this.requestParam).then(response => {
  451. if (response.msg === 'fail') {
  452. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  453. } else {
  454. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  455. this.getList()
  456. }
  457. })
  458. }).catch(() => {
  459. this.$message({ type: 'info', message: '已取消删除' })
  460. })
  461. },
  462. handleSelectionChange(val) {
  463. console.log('勾选数据', val)
  464. this.selectList = val
  465. },
  466. handleDelete() {
  467. console.log('点击了删除')
  468. if (this.selectList.length == 0) {
  469. this.$message({ type: 'error', message: '请选择栏舍剩料记录', duration: 2000 })
  470. } else {
  471. MessageBox.confirm('是否确认删除此信息?', {
  472. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  473. }).then(() => {
  474. console.log(this.selectList)
  475. this.requestParam.common = { 'returnmap': '0' }
  476. this.requestParam.data = []
  477. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
  478. this.requestParam.data[0].children = []
  479. this.requestParam.data[0].children[0] = { 'name': 'deleteBarfeedremain', 'type': 'e', 'parammaps': {
  480. id: '@insertSpotList.id',
  481. pastureid: '@insertSpotList.pastureid'
  482. }}
  483. ExecDataByConfig(this.requestParam).then(response => {
  484. console.log('删除保存发送参数', this.requestParam)
  485. if (response.msg === 'fail') {
  486. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  487. } else {
  488. this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
  489. this.getList()
  490. }
  491. })
  492. })
  493. }
  494. },
  495. // 复制
  496. handleCopy() {
  497. console.log('点击了复制')
  498. if (this.selectList.length == 0) {
  499. this.$message({ type: 'error', message: '请选择栏舍剩料记录', duration: 2000 })
  500. } else if (this.selectList.length == 1) {
  501. MessageBox.confirm('是否确认复制此信息?', {
  502. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  503. }).then(() => {
  504. this.requestParam.name = 'copybarfeedremain'
  505. this.requestParam.parammaps = {}
  506. this.requestParam.parammaps.pastureid = this.selectList[0].pastureid
  507. this.requestParam.parammaps.id = this.selectList[0].id
  508. PostDataByName(this.requestParam).then(response => {
  509. if (response.msg === 'fail') {
  510. const barid = new RegExp("key 'barid'")
  511. if (barid.test(response.data)) {
  512. this.$message({ type: 'error', message: '该栏舍该班次今日剩料量已存在,不可重复生成', duration: 2000 })
  513. } else {
  514. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  515. }
  516. } else {
  517. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  518. this.getList()
  519. }
  520. })
  521. }).catch(() => {
  522. this.$message({ type: 'info', message: '已取消删除' })
  523. })
  524. } else {
  525. this.$message({ type: 'error', message: '请选择一条栏舍剩料记录', duration: 2000 })
  526. }
  527. },
  528. // 导出
  529. handleExport() {
  530. console.log('点击了导出')
  531. },
  532. // 导入
  533. handleImport() {
  534. console.log('点击了导入')
  535. }
  536. }
  537. }
  538. </script>
  539. <style lang="scss" scoped>
  540. .search{padding-top:10px;clear: both;}
  541. .table{margin-top:10px;}
  542. </style>