功能优化:商品选择、按钮展示
This commit is contained in:
@@ -55,6 +55,7 @@
|
||||
:pagination="ipagination"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type: getType}"
|
||||
:loading="loading"
|
||||
:customRow="rowAction"
|
||||
@change="handleTableChange">
|
||||
</a-table>
|
||||
</div>
|
||||
@@ -108,8 +109,8 @@
|
||||
title: '选择商品',
|
||||
ipagination: {
|
||||
current: 1,
|
||||
pageSize: 5,
|
||||
pageSizeOptions: ['5', '10', '20', '30'],
|
||||
pageSize: 10,
|
||||
pageSizeOptions: ['10', '20', '30'],
|
||||
showTotal: (total, range) => {
|
||||
return range[0] + '-' + range[1] + ' 共' + total + '条'
|
||||
},
|
||||
@@ -275,6 +276,23 @@
|
||||
},
|
||||
modalFormOk() {
|
||||
this.loadData();
|
||||
},
|
||||
rowAction(record, index) {
|
||||
return {
|
||||
on: {
|
||||
click: () => {
|
||||
let arr = []
|
||||
arr.push(record.id)
|
||||
this.selectedRowKeys = arr
|
||||
},
|
||||
dblclick: () => {
|
||||
let arr = []
|
||||
arr.push(record.id)
|
||||
this.selectedRowKeys = arr
|
||||
this.handleSubmit()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
:pagination="ipagination"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type: getType}"
|
||||
:loading="loading"
|
||||
:customRow="rowAction"
|
||||
@change="handleTableChange">
|
||||
</a-table>
|
||||
</div>
|
||||
@@ -223,6 +224,23 @@
|
||||
},
|
||||
modalFormOk() {
|
||||
this.loadData();
|
||||
},
|
||||
rowAction(record, index) {
|
||||
return {
|
||||
on: {
|
||||
click: () => {
|
||||
let arr = []
|
||||
arr.push(record.id)
|
||||
this.selectedRowKeys = arr
|
||||
},
|
||||
dblclick: () => {
|
||||
let arr = []
|
||||
arr.push(record.id)
|
||||
this.selectedRowKeys = arr
|
||||
this.handleSubmit()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: getType}">
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: getType}"
|
||||
:customRow="rowAction">
|
||||
</a-table>
|
||||
<!-- table区域-end -->
|
||||
</a-modal>
|
||||
@@ -117,6 +118,23 @@
|
||||
}
|
||||
}
|
||||
this.selectBillIds = billIds.substring(1);
|
||||
},
|
||||
rowAction(record, index) {
|
||||
return {
|
||||
on: {
|
||||
click: () => {
|
||||
let arr = []
|
||||
arr.push(record.id)
|
||||
this.selectedRowKeys = arr
|
||||
},
|
||||
dblclick: () => {
|
||||
let arr = []
|
||||
arr.push(record.id)
|
||||
this.selectedRowKeys = arr
|
||||
this.handleOk()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,6 +225,14 @@
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleEdit: function (record) {
|
||||
this.$refs.modalForm.edit(record);
|
||||
this.$refs.modalForm.title = "编辑";
|
||||
this.$refs.modalForm.disableSubmit = false;
|
||||
if(this.btnEnableList.indexOf(1)===-1) {
|
||||
this.$refs.modalForm.isReadOnly = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,11 @@
|
||||
cancelText="关闭"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
style="top:5%;height: 100%;overflow-y: hidden">
|
||||
<template slot="footer">
|
||||
<a-button key="back" v-if="isReadOnly" @click="handleCancel">
|
||||
关闭
|
||||
</a-button>
|
||||
</template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-tabs default-active-key="1">
|
||||
@@ -163,6 +168,7 @@
|
||||
manyUnitStatus: true,
|
||||
unitChecked: false,
|
||||
model: {},
|
||||
isReadOnly: false,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 8 },
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
</div>
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator" style="margin-top: 5px">
|
||||
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
||||
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
|
||||
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button style="margin-left: 8px">
|
||||
批量操作 <a-icon type="down" />
|
||||
@@ -46,8 +46,8 @@
|
||||
@change="handleTableChange">
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
|
||||
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</span>
|
||||
@@ -119,14 +119,7 @@
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleEdit: function (record) {
|
||||
this.$refs.modalForm.edit(record);
|
||||
this.$refs.modalForm.title = "编辑";
|
||||
this.$refs.modalForm.disableSubmit = false;
|
||||
if(this.btnEnableList.indexOf(1)===-1) {
|
||||
this.$refs.modalForm.isReadOnly = true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -45,10 +45,10 @@
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a v-if="btnEnableList.indexOf(1)>-1" @click="handleSetFunction(record)">分配功能</a>
|
||||
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
|
||||
<a v-if="btnEnableList.indexOf(1)>-1" @click="handleSetPushBtn(record.id)">分配按钮</a>
|
||||
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
|
||||
<a @click="handleSetFunction(record)">分配功能</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="handleSetPushBtn(record.id)">分配按钮</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
|
||||
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
|
||||
@@ -59,8 +59,8 @@
|
||||
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical"/>
|
||||
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定重置密码为123456吗?" @confirm="() => handleReset(record.id)">
|
||||
<a-divider type="vertical"/>
|
||||
<a-popconfirm title="确定重置密码为123456吗?" @confirm="() => handleReset(record.id)">
|
||||
<a>重置密码</a>
|
||||
</a-popconfirm>
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user