c6bebd75b70cf1dea2f90049594f8976a6266f57.svn-base 23 KB

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