a0c7643b21ca9e5ab676428af177df7feb4fa3c3.svn-base 24 KB

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