8165b0883ae5eaac185647c760baa7cf85c5fea8.svn-base 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  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': '' })
  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. // 检验用户名称/角色是否为空
  235. if (this.table.temp.eqcode == '' && this.table.temp.tname == '' && this.table.temp.datacaptureno == '' && this.table.temp.tclassid == '' && this.table.temp.maxstirfeed == '') {
  236. this.$message({ type: 'error', message: 'TMR设备编号/TMR设备名称/数据采集卡编号/TMR设备类型/最大搅拌量不能为空', duration: 2000 })
  237. return false
  238. } else if (this.table.temp.tname == '' && this.table.temp.datacaptureno == '' && this.table.temp.tclassid == '' && this.table.temp.maxstirfeed == '') {
  239. this.$message({ type: 'error', message: 'TMR设备名称/数据采集卡编号/TMR设备类型/最大搅拌量不能为空', duration: 2000 })
  240. return false
  241. } else if (this.table.temp.datacaptureno == '' && this.table.temp.tclassid == '' && this.table.temp.maxstirfeed == '') {
  242. this.$message({ type: 'error', message: '数据采集卡编号/TMR设备类型/最大搅拌量不能为空', duration: 2000 })
  243. return false
  244. } else if (this.table.temp.tclassid == '' && this.table.temp.maxstirfeed == '') {
  245. this.$message({ type: 'error', message: 'TMR设备类型/最大搅拌量不能为空', duration: 2000 })
  246. return false
  247. } else if (this.table.temp.eqcode == '') {
  248. this.$message({ type: 'error', message: 'TMR设备编号不能为空', duration: 2000 })
  249. return false
  250. } else if (this.table.temp.tname == '') {
  251. this.$message({ type: 'error', message: 'TMR设备名称不能为空', duration: 2000 })
  252. return false
  253. } else if (this.table.temp.datacaptureno == '') {
  254. this.$message({ type: 'error', message: '数据采集卡编号不能为空', duration: 2000 })
  255. return false
  256. } else if (this.table.temp.tclassid == '') {
  257. this.$message({ type: 'error', message: '设备类型不能为空', duration: 2000 })
  258. return false
  259. } else if (this.table.temp.maxstirfeed == '') {
  260. this.$message({ type: 'error', message: '最大搅拌量不能为空', duration: 2000 })
  261. return false
  262. }
  263. const datacaptureno = /^([0-9]|(1[0-5]))$/
  264. if (!datacaptureno.test(parseFloat(this.table.temp.datacaptureno))) {
  265. this.$message({ type: 'error', message: '数据采集卡请输入0-15之间整数', duration: 2000 })
  266. return false
  267. }
  268. const maxstirfeed = /^[1-9]\d*$/
  269. if (!maxstirfeed.test(parseFloat(this.table.temp.maxstirfeed))) {
  270. this.$message({ type: 'error', message: '最大搅拌量请输入正整数', duration: 2000 })
  271. return false
  272. }
  273. const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
  274. if (pattern.test(this.table.temp.eqcode)) {
  275. this.$message({ type: 'error', message: 'TMR设备编号不可输入特殊字符', duration: 2000 })
  276. return false
  277. }
  278. if (pattern.test(this.table.temp.tname)) {
  279. this.$message({ type: 'error', message: 'TMR设备名称不可输入特殊字符', duration: 2000 })
  280. return false
  281. }
  282. this.isokDisable = true
  283. setTimeout(() => {
  284. this.isokDisable = false
  285. }, 1000)
  286. this.requestParam.name = 'insertTMR'
  287. this.requestParam.parammaps = this.table.temp
  288. PostDataByName(this.requestParam).then(response => {
  289. console.log('新增保存发送参数', this.requestParam)
  290. if (response.msg !== 'fail') {
  291. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  292. this.getList()
  293. } else {
  294. failproccess(response, this.$notify)
  295. }
  296. })
  297. },
  298. createCancel(row) {
  299. console.log('点击了新增取消')
  300. for (let i = 0; i < this.table.list.length; i++) {
  301. if (row.myId === this.table.list[i].myId) {
  302. var listIndex = this.table.list.indexOf(this.table.list[i])
  303. }
  304. if (listIndex > -1) {
  305. this.table.list.splice(listIndex, 1)
  306. return
  307. }
  308. }
  309. },
  310. handleUpdate(row) {
  311. for (let i = 0; i < this.table.list.length; i++) {
  312. if (this.table.list[i].Edit == true) {
  313. this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
  314. return false
  315. }
  316. }
  317. // 编辑true,不可编辑false
  318. row.Edit = true
  319. row.NoEdit = false
  320. // 新增false,编辑false,编辑保存true
  321. row.isCreate = false
  322. row.isUpdate = false
  323. row.isUpdateSave = true
  324. row.tclassid = String(row.tclassid)
  325. this.table.temp.tclassid = row.tclassid
  326. this.table.temp.tclassname = row.tclassname
  327. },
  328. updateData(row) {
  329. console.log('点击了编辑保存', row)
  330. this.table.temp.pastureid = Cookies.get('pastureid')
  331. this.table.temp.eqcode = row.eqcode
  332. this.table.temp.tname = row.tname
  333. this.table.temp.datacaptureno = row.datacaptureno
  334. this.table.temp.tclassid = row.tclassid
  335. this.table.temp.tclassname = this.table.temp.tclassname
  336. this.table.temp.maxstirfeed = row.maxstirfeed
  337. this.table.temp.enable = row.enable
  338. this.table.temp.remark = row.remark
  339. this.table.temp.id = row.id
  340. // 检验用户名称/角色是否为空
  341. if (this.table.temp.eqcode == '' && this.table.temp.tname == '' && this.table.temp.datacaptureno == '' && this.table.temp.tclassid == '' && this.table.temp.maxstirfeed == '') {
  342. this.$message({ type: 'error', message: 'TMR设备编号/TMR设备名称/数据采集卡编号/TMR设备类型/最大搅拌量不能为空', duration: 2000 })
  343. return false
  344. } else if (this.table.temp.tname == '' && this.table.temp.datacaptureno == '' && this.table.temp.tclassid == '' && this.table.temp.maxstirfeed == '') {
  345. this.$message({ type: 'error', message: 'TMR设备名称/数据采集卡编号/TMR设备类型/最大搅拌量不能为空', duration: 2000 })
  346. return false
  347. } else if (this.table.temp.datacaptureno == '' && this.table.temp.tclassid == '' && this.table.temp.maxstirfeed == '') {
  348. this.$message({ type: 'error', message: '数据采集卡编号/TMR设备类型/最大搅拌量不能为空', duration: 2000 })
  349. return false
  350. } else if (this.table.temp.tclassid == '' && this.table.temp.maxstirfeed == '') {
  351. this.$message({ type: 'error', message: 'TMR设备类型/最大搅拌量不能为空', duration: 2000 })
  352. return false
  353. } else if (this.table.temp.eqcode == '') {
  354. this.$message({ type: 'error', message: 'TMR设备编号不能为空', duration: 2000 })
  355. return false
  356. } else if (this.table.temp.tname == '') {
  357. this.$message({ type: 'error', message: '设备名称不能为空', duration: 2000 })
  358. return false
  359. } else if (this.table.temp.datacaptureno == '') {
  360. this.$message({ type: 'error', message: '数据采集卡编号不能为空', duration: 2000 })
  361. return false
  362. } else if (this.table.temp.tclassid == '') {
  363. this.$message({ type: 'error', message: '设备类型不能为空', duration: 2000 })
  364. return false
  365. } else if (this.table.temp.maxstirfeed == '') {
  366. this.$message({ type: 'error', message: '最大搅拌量不能为空', duration: 2000 })
  367. return false
  368. }
  369. const datacaptureno = /^([0-9]|(1[0-5]))$/
  370. if (!datacaptureno.test(parseInt(this.table.temp.datacaptureno))) {
  371. this.$message({ type: 'error', message: '数据采集卡请输入0-15之间整数', duration: 2000 })
  372. return false
  373. }
  374. const maxstirfeed = /^[1-9]\d*$/
  375. if (!maxstirfeed.test(parseInt(this.table.temp.maxstirfeed))) {
  376. this.$message({ type: 'error', message: '最大搅拌量请输入正整数', duration: 2000 })
  377. return false
  378. }
  379. const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
  380. if (pattern.test(this.table.temp.eqcode)) {
  381. this.$message({ type: 'error', message: 'TMR设备编号不可输入特殊字符', duration: 2000 })
  382. return false
  383. }
  384. if (pattern.test(this.table.temp.tname)) {
  385. this.$message({ type: 'error', message: 'TMR设备名称不可输入特殊字符', duration: 2000 })
  386. return false
  387. }
  388. this.isokDisable = true
  389. setTimeout(() => {
  390. this.isokDisable = false
  391. }, 1000)
  392. this.requestParam.name = 'updateTMR'
  393. this.requestParam.parammaps = this.table.temp
  394. PostDataByName(this.requestParam).then(response => {
  395. console.log('新增保存发送参数', this.requestParam)
  396. if (response.msg !== 'fail') {
  397. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  398. this.getList()
  399. } else {
  400. failproccess(response, this.$notify)
  401. }
  402. })
  403. },
  404. updateCancel(row) {
  405. console.log('点击了编辑取消')
  406. // 编辑false,不可编辑true
  407. row.Edit = false
  408. row.NoEdit = true
  409. // 新增false,编辑true,编辑保存false
  410. row.isCreate = false
  411. row.isUpdate = true
  412. row.isUpdateSave = false
  413. this.getList()
  414. },
  415. // 删除
  416. handleRowDelete(row) {
  417. console.log('点击了行内删除')
  418. MessageBox.confirm('是否确认删除此信息?', {
  419. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  420. }).then(() => {
  421. this.selectList = []
  422. this.requestParam = {}
  423. this.requestParam.common = { 'returnmap': '0' }
  424. this.requestParam.data = []
  425. this.requestParam.data[0] = { 'name': 'checkDeleteTmr', 'type': 'v', 'parammaps': {
  426. 'pastureid': row.pastureid,
  427. 'id': row.id
  428. }}
  429. this.requestParam.data[1] = { 'name': 'deleteTMR', 'type': 'e', 'parammaps': {
  430. 'pastureid': row.pastureid,
  431. 'id': row.id
  432. }}
  433. ExecDataByConfig(this.requestParam).then(response => {
  434. console.log('删除保存发送参数', this.requestParam)
  435. if (response.msg === 'fail') {
  436. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  437. } else {
  438. this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
  439. this.getList()
  440. }
  441. })
  442. }).catch(() => {
  443. this.$message({ type: 'info', message: '已取消删除' })
  444. })
  445. },
  446. handleSelectionChange(val) {
  447. console.log('勾选数据', val)
  448. this.selectList = val
  449. },
  450. handleDelete() {
  451. console.log('点击了删除')
  452. if (this.selectList.length == 0) {
  453. this.$message({ type: 'error', message: '请选择TMR设备信息', duration: 2000 })
  454. } else {
  455. MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
  456. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  457. }).then(() => {
  458. console.log(this.selectList)
  459. this.requestParam = {}
  460. this.requestParam.common = { 'returnmap': '0' }
  461. this.requestParam.data = []
  462. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
  463. this.requestParam.data[0].children = []
  464. this.requestParam.data[0].children[0] = { 'name': 'checkDeleteTmr', 'type': 'v', 'parammaps': {
  465. id: '@insertSpotList.id',
  466. pastureid: '@insertSpotList.pastureid'
  467. }}
  468. this.requestParam.data[0].children[1] = { 'name': 'deleteTMR', 'type': 'e', 'parammaps': {
  469. id: '@insertSpotList.id',
  470. pastureid: '@insertSpotList.pastureid'
  471. }}
  472. ExecDataByConfig(this.requestParam).then(response => {
  473. console.log('删除保存发送参数', this.requestParam)
  474. if (response.msg === 'fail') {
  475. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  476. } else {
  477. this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
  478. this.getList()
  479. }
  480. })
  481. })
  482. }
  483. }
  484. }
  485. }
  486. </script>
  487. <style lang="scss" scoped>
  488. .search{margin-top:10px;}
  489. .table{margin-top:10px;}
  490. </style>