3bf8a637c4a61906babef085e9474df4e9e3ae2e.svn-base 24 KB

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