685d8861f854b98ed191ce63b70750696dc6d6cb.svn-base 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. <template>
  2. <div class="app-container">
  3. <div class="operation">
  4. <el-button class="success" @click="handleCreate">新增</el-button>
  5. <el-button class="danger" @click="handleDelete">删除</el-button>
  6. </div>
  7. <div class="search">
  8. <el-input v-model="table.getdataListParm.parammaps.bname" placeholder="栏舍名称" style="width: 180px;" class="filter-item" clearable />
  9. <el-input v-model="table.getdataListParm.parammaps.bcode" placeholder="栏舍编号" style="width: 180px;" class="filter-item" clearable />
  10. <el-select v-model="table.getdataListParm.parammaps.enable" filterable placeholder="是否启用" class="filter-item" style="width: 120px;" clearable>
  11. <el-option v-for="item in enableList" :key="item.id" :label="item.name" :value="item.id" />
  12. </el-select>
  13. <div ref="selectInput" class="filter-item selectInput">
  14. <el-input type="text" name="" value="" placeholder="请点击选择搜索条件" class="Input" />
  15. <i v-if="arrowDown" icon="el-icon-arrow-down" class="el-icon-arrow-down" />
  16. <i v-if="arrowUp" icon="el-icon-arrow-up" class="el-icon-arrow-up" />
  17. <ul v-if="arrowUp" class="selectUl">
  18. <li><a>允许误差数</a><el-input v-model="table.getdataListParm.parammaps.allowratio" type="text" style="width: 245px;" /></li>
  19. <li><a>跳转重量域</a><el-input v-model="table.getdataListParm.parammaps.autozone" type="text" style="width: 245px;" /></li>
  20. <li>
  21. <a>跳转延时</a>
  22. <el-select v-model="table.getdataListParm.parammaps.autosecond" filterable class="filter-item" style="width: 245px;" clearable>
  23. <el-option v-for="item in jumpDelayList" :key="item.value" :label="item.label" :value="item.value" />
  24. </el-select>
  25. </li>
  26. <li>
  27. <div style="float: right;">
  28. <el-button class="minCancel" @click="arrowUp=false;arrowDown=true;">取消</el-button>
  29. <el-button class="miniSuccess" @click="handleSearch">搜索</el-button>
  30. </div>
  31. </li>
  32. </ul>
  33. </div>
  34. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  35. <el-button class="successBorder" @click="handleRefresh">重置</el-button>
  36. </div>
  37. <div class="table">
  38. <el-table
  39. :key="table.tableKey"
  40. v-loading="table.listLoading"
  41. element-loading-text="给我一点时间"
  42. :data="table.list"
  43. border
  44. fit
  45. highlight-current-row
  46. style="width: 100%;"
  47. :row-style="rowStyle"
  48. :cell-style="cellStyle"
  49. class="elTable table-fixed"
  50. @selection-change="handleSelectionChange"
  51. >
  52. <el-table-column type="selection" align="center" width="50" />
  53. <el-table-column label="序号" align="center" type="index" width="50px">
  54. <template slot-scope="scope">
  55. <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="栏舍名称" min-width="130px" align="center">
  59. <template slot-scope="scope">
  60. <span v-if="scope.row.NoEdit">{{ scope.row.bname }}</span>
  61. <el-input v-if="scope.row.Edit" v-model="scope.row.bname" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" style="width:95%;padding:10px 0;" maxlength="32" />
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="栏舍编号" min-width="130px" align="center">
  65. <template slot-scope="scope">
  66. <span v-if="scope.row.NoEdit">{{ scope.row.bcode }}</span>
  67. <el-input v-if="scope.row.Edit" v-model="scope.row.bcode" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="8" style="width:95%;padding:10px 0;" />
  68. </template>
  69. </el-table-column>
  70. <el-table-column label="允许误差数(kg)" min-width="150px" align="center">
  71. <template slot-scope="scope">
  72. <span v-if="scope.row.NoEdit">{{ scope.row.allowratio }}</span>
  73. <el-input v-if="scope.row.Edit" v-model="scope.row.allowratio" style="width:95%;padding:10px 0;" />
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="跳转重量域(kg)" min-width="150px" align="center">
  77. <template slot-scope="scope">
  78. <span v-if="scope.row.NoEdit">{{ scope.row.autozone }}</span>
  79. <el-input v-if="scope.row.Edit" v-model="scope.row.autozone" style="width:95%;padding:10px 0;" />
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="跳转延时(s)" min-width="150px" align="center">
  83. <template slot-scope="scope">
  84. <span v-if="scope.row.NoEdit">{{ scope.row.autosecondname }}</span>
  85. <el-select v-if="scope.row.Edit" v-model="scope.row.autosecond" filterable class="filter-item" style="width: 95%;padding:10px 0;" @change="changeAutosecond">
  86. <el-option v-for="item in jumpDelayList" :key="item.value" :label="item.label" :value="item.value" />
  87. </el-select>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="确认开始" min-width="110px" align="center">
  91. <template slot-scope="scope">
  92. <el-switch v-model="scope.row.isstart" :disabled="scope.row.NoEdit==true" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleConfirmStartChange(scope.$index, scope.row)" />
  93. </template>
  94. </el-table-column>
  95. <el-table-column label="是否启用" min-width="110px" align="center">
  96. <template slot-scope="scope">
  97. <el-switch v-model="scope.row.enable" :disabled="scope.row.NoEdit==true" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.$index, scope.row)" />
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
  101. <template slot-scope="{row}">
  102. <!-- 新增 -->
  103. <el-button v-if="row.isCreate" class="miniSuccess" :disabled="isokDisable" @click="createData(row)">保存</el-button>
  104. <el-button v-if="row.isCreate" class="minCancel" @click="createCancel(row)">取消</el-button>
  105. <!-- 编辑 -->
  106. <el-button v-if="row.isUpdate" class="miniSuccess" @click="handleUpdate(row)">编辑</el-button>
  107. <el-button v-if="row.isUpdate" class="miniDanger" @click="handleRowDelete(row)">删除</el-button>
  108. <!-- 编辑保存 -->
  109. <el-button v-if="row.isUpdateSave" class="miniSuccess" :disabled="isokDisable" @click="updateData(row)">保存</el-button>
  110. <el-button v-if="row.isUpdateSave" class="minCancel" @click="updateCancel(row)">取消</el-button>
  111. </template>
  112. </el-table-column>
  113. </el-table>
  114. <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
  115. </div>
  116. </div>
  117. </template>
  118. <script>
  119. import { GetDataByName, GetDataByNames, PostDataByName, failproccess, ExecDataByConfig } from '@/api/common'
  120. import Cookies from 'js-cookie'
  121. import Pagination from '@/components/Pagination'
  122. import { MessageBox } from 'element-ui'
  123. export default {
  124. name: 'GroupColumn',
  125. components: { Pagination },
  126. data() {
  127. return {
  128. requestParams: [
  129. { name: 'getDictByName', offset: 0, pagecount: 0, params: ['跳转延时'] }
  130. ],
  131. enableList: [{ id: '1', name: '是' }, { id: '0', name: '否' }],
  132. jumpDelayList: [],
  133. table: {
  134. getdataListParm: {
  135. name: 'getBarList',
  136. page: 1,
  137. offset: 1,
  138. pagecount: 10,
  139. returntype: 'Map',
  140. parammaps: {
  141. pastureid: Cookies.get('pastureid'),
  142. bcode: '',
  143. bname: '',
  144. allowratio: '',
  145. autozone: '',
  146. autosecond: '',
  147. enable: ''
  148. }
  149. },
  150. tableKey: 0,
  151. list: [],
  152. total: 0,
  153. listLoading: true,
  154. temp: {}
  155. },
  156. requestParam: {},
  157. isokDisable: false,
  158. selectList: [],
  159. arrowDown: true,
  160. arrowUp: false,
  161. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  162. cellStyle: { padding: 0 + 'px' }
  163. }
  164. },
  165. created() {
  166. this.getList()
  167. this.getDownList()
  168. },
  169. mounted() {
  170. document.addEventListener('click', (e) => {
  171. if (this.$refs.selectInput !== undefined) {
  172. if (!this.$refs.selectInput.contains(e.target)) {
  173. this.arrowDown = true
  174. this.arrowUp = false
  175. } else {
  176. this.arrowDown = false
  177. this.arrowUp = true
  178. }
  179. }
  180. })
  181. },
  182. methods: {
  183. getDownList() {
  184. GetDataByNames(this.requestParams).then(response => {
  185. this.jumpDelayList = response.data.getDictByName.list
  186. })
  187. },
  188. getList() {
  189. this.table.listLoading = true
  190. GetDataByName(this.table.getdataListParm).then(response => {
  191. console.log('table数据', response.data.list)
  192. if (response.data.list !== null) {
  193. for (let i = 0; i < response.data.list.length; i++) {
  194. this.$set(response.data.list[i], 'Edit', false) // 编辑
  195. this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
  196. this.$set(response.data.list[i], 'isCreate', false) // 新增操作
  197. this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
  198. this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
  199. }
  200. this.table.list = response.data.list
  201. this.table.pageNum = response.data.pageNum
  202. this.table.pageSize = response.data.pageSize
  203. this.table.total = response.data.total
  204. } else {
  205. this.table.list = []
  206. }
  207. setTimeout(() => {
  208. this.table.listLoading = false
  209. }, 100)
  210. })
  211. },
  212. handleEnableChange() {
  213. console.log('点击了是否启用')
  214. },
  215. handleConfirmStartChange() {
  216. console.log('点击了确认开始')
  217. },
  218. handleSearch() {
  219. console.log('点击了查询')
  220. this.table.getdataListParm.offset = 1
  221. this.getList()
  222. this.arrowDown = true
  223. this.arrowUp = false
  224. },
  225. handleRefresh() {
  226. console.log('点击了重置')
  227. this.table.getdataListParm.parammaps.bcode = ''
  228. this.table.getdataListParm.parammaps.bname = ''
  229. this.table.getdataListParm.parammaps.allowratio = ''
  230. this.table.getdataListParm.parammaps.autozone = ''
  231. this.table.getdataListParm.parammaps.autosecond = ''
  232. this.table.getdataListParm.parammaps.enable = ''
  233. this.table.getdataListParm.offset = 1
  234. this.getList()
  235. },
  236. changeAutosecond(item) {
  237. this.table.temp.autosecondname = this.jumpDelayList.find(obj => obj.value === item).label
  238. console.log(this.table.temp.autosecondname)
  239. },
  240. handleCreate() {
  241. console.log('点击了新增')
  242. // 编辑true/不可编辑false
  243. // 新增操true,编辑false,编辑保存false
  244. for (let i = 0; i < this.table.list.length; i++) {
  245. if (this.table.list[i].Edit == true) {
  246. this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
  247. return false
  248. }
  249. }
  250. this.table.temp.autosecondname = ''
  251. this.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'isstart': 1, 'bname': '', 'bcode': '', 'allowratio': '', 'autozone': '', 'autosecond': '0', 'autosecondname': '禁用' })
  252. },
  253. createData(row) {
  254. console.log('点击了新增保存', row)
  255. this.table.temp.pastureid = Cookies.get('pastureid')
  256. this.table.temp.bcode = row.bcode
  257. this.table.temp.bname = row.bname
  258. this.table.temp.allowratio = row.allowratio
  259. this.table.temp.autozone = row.autozone
  260. this.table.temp.autosecond = row.autosecond
  261. if (this.table.temp.autosecondname == '') {
  262. this.table.temp.autosecondname = row.autosecondname
  263. } else {
  264. this.table.temp.autosecondname = this.table.temp.autosecondname
  265. }
  266. this.table.temp.isstart = row.isstart
  267. this.table.temp.enable = row.enable
  268. // 检验用户名称/角色是否为空
  269. if (this.table.temp.bname == '' && this.table.temp.bcode == '') {
  270. this.$message({ type: 'error', message: '栏舍名称/栏舍编号不能为空', duration: 2000 })
  271. return false
  272. } else if (this.table.temp.bname == '') {
  273. this.$message({ type: 'error', message: '栏舍名称不能为空', duration: 2000 })
  274. return false
  275. } else if (this.table.temp.bcode == '') {
  276. this.$message({ type: 'error', message: '栏舍编号不能为空', duration: 2000 })
  277. return false
  278. }
  279. const bcode = /(^[\-0-9][0-9]*(.[0-9]+)?)$/
  280. if (!bcode.test(parseInt(this.table.temp.bcode))) {
  281. console.log(this.table.temp.bcode)
  282. this.$message({ type: 'error', message: '栏舍编号请输入1-8位数字', duration: 2000 })
  283. return false
  284. }
  285. if (this.table.temp.allowratio !== '') {
  286. console.log(this.table.temp.allowratio)
  287. const allowratio = /^[1-9]\d*$/
  288. if (!allowratio.test(parseFloat(this.table.temp.allowratio))) {
  289. this.$message({ type: 'error', message: '允许误差数请输入正整数', duration: 2000 })
  290. return false
  291. }
  292. } else {
  293. this.table.temp.allowratio = '0'
  294. }
  295. if (this.table.temp.autozone !== '') {
  296. console.log(this.table.temp.autozone)
  297. const autozone = /^([0-9]|(1[0-9]|(20)))$/
  298. if (!autozone.test(parseFloat(this.table.temp.autozone))) {
  299. this.$message({ type: 'error', message: '跳转重量域请输入小于等于20的正整数', duration: 2000 })
  300. return false
  301. }
  302. } else {
  303. this.table.temp.autozone = '0'
  304. }
  305. const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
  306. if (pattern.test(this.table.temp.eqcode)) {
  307. this.$message({ type: 'error', message: 'TMR设备编号不可输入特殊字符', duration: 2000 })
  308. return false
  309. }
  310. if (pattern.test(this.table.temp.tname)) {
  311. this.$message({ type: 'error', message: 'TMR设备名称不可输入特殊字符', duration: 2000 })
  312. return false
  313. }
  314. this.isokDisable = true
  315. setTimeout(() => {
  316. this.isokDisable = false
  317. }, 1000)
  318. this.requestParam.name = 'insertBar'
  319. this.requestParam.parammaps = this.table.temp
  320. PostDataByName(this.requestParam).then(response => {
  321. console.log('新增保存发送参数', this.requestParam)
  322. if (response.msg !== 'fail') {
  323. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  324. this.getList()
  325. } else {
  326. failproccess(response, this.$notify)
  327. }
  328. })
  329. },
  330. createCancel(row) {
  331. console.log('点击了新增取消')
  332. for (let i = 0; i < this.table.list.length; i++) {
  333. if (row.myId === this.table.list[i].myId) {
  334. var listIndex = this.table.list.indexOf(this.table.list[i])
  335. }
  336. if (listIndex > -1) {
  337. this.table.list.splice(listIndex, 1)
  338. return
  339. }
  340. }
  341. },
  342. handleUpdate(row) {
  343. console.log('点击了编辑', row)
  344. for (let i = 0; i < this.table.list.length; i++) {
  345. if (this.table.list[i].Edit == true) {
  346. this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
  347. return false
  348. }
  349. }
  350. // 编辑true,不可编辑false
  351. row.Edit = true
  352. row.NoEdit = false
  353. // 新增false,编辑false,编辑保存true
  354. row.isCreate = false
  355. row.isUpdate = false
  356. row.isUpdateSave = true
  357. row.autosecond = String(row.autosecond)
  358. if (row.allowratio == 0) { row.allowratio = '' }
  359. if (row.autozone == 0) { row.autozone = '' }
  360. this.table.temp.autosecondname = row.autosecondname
  361. this.table.temp.autosecond = row.autosecond
  362. },
  363. updateData(row) {
  364. console.log('点击了编辑保存', row)
  365. this.table.temp.pastureid = Cookies.get('pastureid')
  366. this.table.temp.bcode = row.bcode
  367. this.table.temp.bname = row.bname
  368. this.table.temp.allowratio = row.allowratio
  369. this.table.temp.autozone = row.autozone
  370. this.table.temp.autosecond = row.autosecond
  371. this.table.temp.autosecondname = this.table.temp.autosecondname
  372. this.table.temp.isstart = row.isstart
  373. this.table.temp.enable = row.enable
  374. this.table.temp.id = row.id
  375. // 检验用户名称/角色是否为空
  376. if (this.table.temp.bname == '' && this.table.temp.bcode == '') {
  377. this.$message({ type: 'error', message: '栏舍名称/栏舍编号不能为空', duration: 2000 })
  378. return false
  379. } else if (this.table.temp.bname == '') {
  380. this.$message({ type: 'error', message: '栏舍名称不能为空', duration: 2000 })
  381. return false
  382. } else if (this.table.temp.bcode == '') {
  383. this.$message({ type: 'error', message: '栏舍编号不能为空', duration: 2000 })
  384. return false
  385. }
  386. const bcode = /(^[\-0-9][0-9]*(.[0-9]+)?)$/
  387. if (!bcode.test(parseInt(this.table.temp.bcode))) {
  388. console.log(this.table.temp.bcode)
  389. this.$message({ type: 'error', message: '栏舍编号请输入1-8位数字', duration: 2000 })
  390. return false
  391. }
  392. if (this.table.temp.allowratio !== '') {
  393. console.log(this.table.temp.allowratio)
  394. const allowratio = /^[1-9]\d*$/
  395. if (!allowratio.test(parseFloat(this.table.temp.allowratio))) {
  396. this.$message({ type: 'error', message: '允许误差数请输入正整数', duration: 2000 })
  397. return false
  398. }
  399. } else {
  400. this.table.temp.allowratio = '0'
  401. }
  402. if (this.table.temp.autozone !== '') {
  403. console.log(this.table.temp.autozone)
  404. const autozone = /^([0-9]|(1[0-9]|(20)))$/
  405. if (!autozone.test(parseFloat(this.table.temp.autozone))) {
  406. this.$message({ type: 'error', message: '跳转重量域请输入小于等于20的正整数', duration: 2000 })
  407. return false
  408. }
  409. } else {
  410. this.table.temp.autozone = '0'
  411. }
  412. const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
  413. if (pattern.test(this.table.temp.eqcode)) {
  414. this.$message({ type: 'error', message: 'TMR设备编号不可输入特殊字符', duration: 2000 })
  415. return false
  416. }
  417. if (pattern.test(this.table.temp.tname)) {
  418. this.$message({ type: 'error', message: 'TMR设备名称不可输入特殊字符', duration: 2000 })
  419. return false
  420. }
  421. this.isokDisable = true
  422. setTimeout(() => {
  423. this.isokDisable = false
  424. }, 1000)
  425. this.requestParam.name = 'updateBar'
  426. this.requestParam.parammaps = this.table.temp
  427. PostDataByName(this.requestParam).then(response => {
  428. console.log('新增保存发送参数', this.requestParam)
  429. if (response.msg !== 'fail') {
  430. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  431. this.getList()
  432. } else {
  433. failproccess(response, this.$notify)
  434. }
  435. })
  436. },
  437. updateCancel(row) {
  438. console.log('点击了编辑取消')
  439. // 编辑false,不可编辑true
  440. row.Edit = false
  441. row.NoEdit = true
  442. // 新增false,编辑true,编辑保存false
  443. row.isCreate = false
  444. row.isUpdate = true
  445. row.isUpdateSave = false
  446. },
  447. handleRowDelete(row) {
  448. console.log('点击了行内删除')
  449. MessageBox.confirm('是否确认删除此信息?', {
  450. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  451. }).then(() => {
  452. this.selectList = []
  453. this.requestParam.name = 'deleteBar'
  454. this.requestParam.parammaps = {}
  455. this.requestParam.parammaps.pastureid = row.pastureid
  456. this.requestParam.parammaps.id = row.id
  457. PostDataByName(this.requestParam).then(response => {
  458. if (response.msg === 'fail') {
  459. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  460. } else {
  461. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  462. this.getList()
  463. }
  464. })
  465. }).catch(() => {
  466. this.$message({ type: 'info', message: '已取消删除' })
  467. })
  468. },
  469. handleSelectionChange(val) {
  470. console.log('勾选数据', val)
  471. this.selectList = val
  472. },
  473. handleDelete() {
  474. console.log('点击了删除')
  475. if (this.selectList.length == 0) {
  476. this.$message({ type: 'error', message: '请选择舍组栏信息', duration: 2000 })
  477. } else {
  478. MessageBox.confirm('是否确认删除此信息?', {
  479. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  480. }).then(() => {
  481. console.log(this.selectList)
  482. this.requestParam.common = { 'returnmap': '0' }
  483. this.requestParam.data = []
  484. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
  485. this.requestParam.data[0].children = []
  486. this.requestParam.data[0].children[0] = { 'name': 'deleteBar', 'type': 'e', 'parammaps': {
  487. id: '@insertSpotList.id',
  488. pastureid: '@insertSpotList.pastureid'
  489. }}
  490. ExecDataByConfig(this.requestParam).then(response => {
  491. console.log('删除保存发送参数', this.requestParam)
  492. if (response.msg === 'fail') {
  493. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  494. } else {
  495. this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
  496. this.getList()
  497. }
  498. })
  499. })
  500. }
  501. }
  502. }
  503. }
  504. </script>
  505. <style lang="scss" scoped>
  506. .search{margin-top:10px;}
  507. .table{margin-top:10px;}
  508. $width:350px;
  509. $left:325px;
  510. .selectInput{
  511. position: relative;
  512. display: inline-block;
  513. .Input{width: $width;position: relative;}
  514. .el-icon-arrow-down{width: 30px;height: 30px;position: absolute;left: $left;top:10px;color:#C0C4CC;}
  515. .el-icon-arrow-up{width: 30px;height: 30px;position: absolute;left: $left;top:10px;color:#C0C4CC;}
  516. .selectUl{
  517. z-index: 111;width: $width;background: #fff;border: 1px solid #E4E7ED;box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);margin: -1px 0 0 0;padding: 6px 0; margin: 0;box-sizing: border-box;position: absolute;
  518. li{
  519. list-style: none;font-size: 14px; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #606266; height: 50px; line-height: 50px; box-sizing: border-box; cursor: pointer;
  520. a{float:left;width: 80px;}
  521. a:hover{color: rgba(0, 204, 102, 0.71); font-weight: 700;}
  522. }
  523. }
  524. }
  525. </style>