|
@@ -5,12 +5,7 @@
|
|
|
<a-row :gutter="48">
|
|
|
<a-col :span="6">
|
|
|
<a-form-item label="箱体类型" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
- <a-input
|
|
|
- id="boxSetting-name"
|
|
|
- allowClear
|
|
|
- :maxLength="30"
|
|
|
- v-model="queryParam.name"
|
|
|
- placeholder="请输入箱体类型" />
|
|
|
+ <a-input id="boxSetting-name" allowClear :maxLength="30" v-model="queryParam.name" placeholder="请输入箱体类型" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
@@ -33,16 +28,11 @@
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
<a-icon type="edit" title="编辑" class="actionBtn icon-blues" @click="handleEdit(record)" />
|
|
|
- <a-icon
|
|
|
- type="delete"
|
|
|
- title="删除"
|
|
|
- class="actionBtn icon-red"
|
|
|
- v-if="!record.isEnable"
|
|
|
- @click="delect(record)" />
|
|
|
+ <a-icon type="delete" title="删除" class="actionBtn icon-red" v-if="!record.isEnable" @click="delect(record)" />
|
|
|
</template>
|
|
|
</s-table>
|
|
|
<!-- 新增/编辑 弹窗 -->
|
|
|
- <add-set-modal :visible="openBoxModal" :data="itemData" @refresh="refreshTable" @close="openBoxModal = false"></add-set-modal>
|
|
|
+ <add-set-modal :visible="openBoxModal" :goldExRuleNo="itemGoldExRuleNo" :id="itemId" @refresh="refreshTable" @close="openBoxModal = false"></add-set-modal>
|
|
|
</a-card>
|
|
|
</template>
|
|
|
|
|
@@ -52,7 +42,10 @@ import {
|
|
|
VSelect
|
|
|
} from '@/components'
|
|
|
import AddSetModal from './AddSetModal.vue'
|
|
|
-import { getList, deleteExchangeSetting } from '@/api/exchangeSetting.js'
|
|
|
+import {
|
|
|
+ getList,
|
|
|
+ deleteExchangeSetting
|
|
|
+} from '@/api/exchangeSetting.js'
|
|
|
export default {
|
|
|
name: 'Equipment',
|
|
|
components: {
|
|
@@ -75,8 +68,9 @@ export default {
|
|
|
queryParam: {
|
|
|
name: '' // 箱体类型
|
|
|
},
|
|
|
- openBoxModal: false, // 新增/编辑弹窗
|
|
|
- boxId: '', // 箱体id
|
|
|
+ openBoxModal: false, // 新增/编辑弹窗
|
|
|
+ itemId: '', // 新增/编辑id
|
|
|
+ itemGoldExRuleNo: '', // 兑换编码
|
|
|
// 表头
|
|
|
columns: [{
|
|
|
title: '序号',
|
|
@@ -86,62 +80,68 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
title: '创建时间',
|
|
|
- dataIndex: 'networkName',
|
|
|
+ dataIndex: 'createDate',
|
|
|
width: 200,
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
title: '兑换规则名称',
|
|
|
- dataIndex: 'address',
|
|
|
+ dataIndex: 'name',
|
|
|
width: 200,
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
title: '兑换规则说明',
|
|
|
- dataIndex: 'equipmentNo',
|
|
|
+ dataIndex: 'remarks',
|
|
|
width: 200,
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
title: '兑换规则(投放重量(g)/可兑换乐豆数(个))',
|
|
|
children: [{
|
|
|
- title: '废旧衣服',
|
|
|
- dataIndex: 'oProportion',
|
|
|
+ title: '废旧衣物',
|
|
|
+ dataIndex: 'clothes',
|
|
|
width: 100,
|
|
|
- align: 'center'
|
|
|
+ align: 'center',
|
|
|
+ customRender: (record, text) => {
|
|
|
+ return record ? (record.rubbishWeight ? (record.rubbishWeight + 'g/' + record.goleNum + '个') : '--') : '--'
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title: '废旧塑料',
|
|
|
- dataIndex: 'tProportion',
|
|
|
+ dataIndex: 'plastic',
|
|
|
width: 100,
|
|
|
- align: 'center'
|
|
|
+ align: 'center',
|
|
|
+ customRender: (record, text) => {
|
|
|
+ return record ? (record.rubbishWeight ? (record.rubbishWeight + 'g/' + record.goleNum + '个') : '--') : '--'
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
- title: '废旧金属',
|
|
|
- dataIndex: 'tProportion',
|
|
|
- width: 100,
|
|
|
- align: 'center',
|
|
|
- customRender: (record, index) => {
|
|
|
- return record.tProportion || '--'
|
|
|
- }
|
|
|
+ title: '废旧金属',
|
|
|
+ dataIndex: 'metal',
|
|
|
+ width: 100,
|
|
|
+ align: 'center',
|
|
|
+ customRender: (record, text) => {
|
|
|
+ return record ? (record.rubbishWeight ? (record.rubbishWeight + 'g/' + record.goleNum + '个') : '--') : '--'
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
- title: '废旧纸张',
|
|
|
- dataIndex: 'tProportion',
|
|
|
- width: 100,
|
|
|
- align: 'center',
|
|
|
- customRender: (record, index) => {
|
|
|
- return record.tProportion || '--'
|
|
|
- }
|
|
|
+ title: '废旧纸张',
|
|
|
+ dataIndex: 'paper',
|
|
|
+ width: 100,
|
|
|
+ align: 'center',
|
|
|
+ customRender: (record, text) => {
|
|
|
+ return record ? (record.rubbishWeight ? (record.rubbishWeight + 'g/' + record.goleNum + '个') : '--') : '--'
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
- title: '有害垃圾',
|
|
|
- dataIndex: 'tProportion',
|
|
|
- width: 100,
|
|
|
- align: 'center',
|
|
|
- customRender: (record, index) => {
|
|
|
- return record.tProportion || '--'
|
|
|
- }
|
|
|
+ title: '有害垃圾',
|
|
|
+ dataIndex: 'harm',
|
|
|
+ width: 100,
|
|
|
+ align: 'center',
|
|
|
+ customRender: (record, text) => {
|
|
|
+ return record ? (record.rubbishWeight ? (record.rubbishWeight + 'g/' + record.goleNum + '个') : '--') : '--'
|
|
|
+ }
|
|
|
}
|
|
|
]
|
|
|
},
|
|
@@ -182,14 +182,25 @@ export default {
|
|
|
this.form.resetFields()
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
+ // 新增/编辑 后刷新列表
|
|
|
+ refreshTable () {
|
|
|
+ if (this.itemId) {
|
|
|
+ this.$refs.table.refresh()
|
|
|
+ } else {
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ }
|
|
|
+ },
|
|
|
// 新建
|
|
|
openModal () {
|
|
|
this.openBoxModal = true
|
|
|
- this.itemData = {}
|
|
|
+ this.itemId = ''
|
|
|
+ this.itemGoldExRuleNo = ''
|
|
|
},
|
|
|
// 编辑
|
|
|
handleEdit (item) {
|
|
|
- this.openBoxModal = true
|
|
|
+ this.openBoxModal = true
|
|
|
+ this.itemId = item.id
|
|
|
+ this.itemGoldExRuleNo = item.goldExRuleNo
|
|
|
},
|
|
|
// 删除
|
|
|
delect (row) {
|